Index: trunk/kernel/Makefile
===================================================================
--- trunk/kernel/Makefile	(revision 690)
+++ trunk/kernel/Makefile	(revision 1)
@@ -1,313 +1,100 @@
-#############################################################################
-#                  ALMOS-MKH  Makefile for Kernel                           #
-#############################################################################
+#=====================================================================
+#                      ALMOS-kernel Makefile                         #
+#=====================================================================
 
--include ../params-soft.mk
-ifeq ($(ARCH_NAME),)
-$(error Please define in ARCH_NAME parameter in params-soft.mk!)
+include ../common.mk
+
+KERNEL_REV ?=current
+
+DIRS=	cpu/$(CPU)           	  \
+	arch/$(ARCH)         	  \
+	drivers/$(DRVRS)	  \
+	kern                      \
+	mm                        \
+	fs/devfs                  \
+	fs/sysfs                  \
+	fs/ext2                   \
+	fs/fat32                  \
+	fs/ramfs                  \
+	vfs                       \
+	libk                      \
+	ksh
+
+ifndef CPU
+$(error CPU variable is not defined)
 endif
 
-# We choose drivers and hal file to be linked with kernel.elf
-ifeq ($(ARCH_NAME), tsar_mips32)
+LFLAGS = -T$(OBJDIR)/kldscript $(CPULFLAGS)
 
-  DRIVERS_OBJS = $(HAL_ARCH)/build/drivers/soclib_tty.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_mty.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_bdv.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_hba.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_mmc.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_pic.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_nic.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_dma.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_fbf.o  \
-                 $(HAL_ARCH)/build/drivers/soclib_iob.o
+INCLUDES=	$(foreach DIR,$(DIRS),-I$(DIR)) -I$(OBJDIR)/kern/
 
-  HAL_OBJS     = $(HAL_ARCH)/build/core/hal_special.o    \
-                 $(HAL_ARCH)/build/core/hal_context.o    \
-                 $(HAL_ARCH)/build/core/hal_atomic.o     \
-                 $(HAL_ARCH)/build/core/hal_remote.o     \
-                 $(HAL_ARCH)/build/core/hal_uspace.o     \
-                 $(HAL_ARCH)/build/core/hal_irqmask.o    \
-                 $(HAL_ARCH)/build/core/hal_gpt.o        \
-                 $(HAL_ARCH)/build/core/hal_ppm.o        \
-                 $(HAL_ARCH)/build/core/hal_vmm.o        \
-                 $(HAL_ARCH)/build/core/hal_kentry.o     \
-                 $(HAL_ARCH)/build/core/hal_switch.o     \
-                 $(HAL_ARCH)/build/core/hal_syscall.o    \
-                 $(HAL_ARCH)/build/core/hal_exception.o  \
-                 $(HAL_ARCH)/build/core/hal_interrupt.o  \
-                 $(HAL_ARCH)/build/core/hal_drivers.o
+CFLAGS  = 	$(INCLUDES) -fno-builtin -static -Wall -Werror -MMD -Wundef
+ifeq   ($(MODE),DEBUG)
+CFLAGS  += 	-g -O0 -fno-inline
+else
+CFLAGS  += 	-O2 
+endif
+CFLAGS +=	$(CPUCFLAGS)
+
+CFILES=	$(foreach DIR,$(DIRS),$(wildcard $(DIR)/*.c))
+SFILES=	$(wildcard cpu/$(CPU)/*.S)
+
+OBJS=	$(addprefix $(OBJDIR)/, $(CFILES:.c=.o) $(SFILES:.S=.o))
+DEPS=	$(OBJS:.o=.d)
+
+OBJDIRS= $(addprefix $(OBJDIR)/, $(DIRS))
+
+# Kernel bin file name
+ifeq ($(KERNEL_REV),current)
+TARGET=$(OBJDIR)/almos-mk-$(ARCH)-$(CPU)
+else
+TARGET=$(OBJDIR)/almos-mk-$(ARCH)-$(CPU)-$(KERNEL_REV)
 endif
 
-ifeq ($(ARCH_NAME), x86_64)
 
-  DRIVERS_OBJS = $(HAL_ARCH)/build/drivers/ioc_ata.o     \
-                 $(HAL_ARCH)/build/drivers/pic_apic.o    \
-                 $(HAL_ARCH)/build/drivers/txt_rs232.o
+.PHONY: clean timestamp
 
-  HAL_OBJS     = $(HAL_ARCH)/build/core/hal_boot.o       \
-                 $(HAL_ARCH)/build/core/hal_smpboot.o    \
-                 $(HAL_ARCH)/build/core/hal_init.o       \
-                 $(HAL_ARCH)/build/core/hal_cpu.o        \
-                 $(HAL_ARCH)/build/core/hal_kentry.o     \
-                 $(HAL_ARCH)/build/core/hal_acpi.o       \
-                 $(HAL_ARCH)/build/core/hal_apic.o       \
-                 $(HAL_ARCH)/build/core/x86_printf.o     \
-                 $(HAL_ARCH)/build/core/hal_drivers.o    \
-                 $(HAL_ARCH)/build/core/hal_special.o    \
-                 $(HAL_ARCH)/build/core/hal_context.o    \
-                 $(HAL_ARCH)/build/core/hal_atomic.o     \
-                 $(HAL_ARCH)/build/core/hal_remote.o     \
-                 $(HAL_ARCH)/build/core/hal_uspace.o     \
-                 $(HAL_ARCH)/build/core/hal_irqmask.o    \
-                 $(HAL_ARCH)/build/core/hal_gpt.o        \
-                 $(HAL_ARCH)/build/core/hal_ppm.o        \
-                 $(HAL_ARCH)/build/core/hal_exception.o  \
-                 $(HAL_ARCH)/build/core/hal_interrupt.o  \
-                 $(HAL_ARCH)/build/core/hal_syscall.o
+
+$(TARGET): $(OBJDIRS) $(OBJDIR)/kldscript timestamp $(OBJS) 
+	@echo '   [  LD  ]        '$@.elf
+	@$(LD) -o $@.elf $(OBJS) $(LFLAGS)
+	@echo '   [  NM  ]        '$@.elf.nm 
+	@$(NM) $@.elf > $@.elf.nm
+	@echo '   [ COPY ]        '$@.bin
+	@$(OCPY) -O binary  $@.elf  $@.bin
+	@echo -e '\n   [ DONE ]        \n'
+	$(ODMP) $(DUMPFLAGS)  -d $@.elf > $@.dump
+
+
+timestamp:
+	@echo "Compile flags: $(CFLAGS)"
+	@echo '#define ALMOS_DATE "'$(shell date +"%d %B %Y - %T")'"' > $(OBJDIR)/kern/almOS-date.h 
+
+$(OBJDIR)/kldscript: arch/$(ARCH)/kldscript.h arch/$(ARCH)/arch-config.h
+	@echo '   [  CPP ]        '$< 
+	@cpp $< | grep -v "#" | grep . > $@
+
+$(OBJDIR)/%.o: %.c
+	@echo '   [  CC  ]        '$<
+	cpp $(INCLUDES) $< out.cpp
+	@$(CC) $(CFLAGS) -c $< -o $@
+ifneq   ($(MODE),DEBUG)
+	@$(STRIP) -x -R .pdr -R .gnu.attributes -R .reginfo -R .comment $@
 endif
 
-LIBGCC = -L$(shell $(CC) -print-libgcc-file-name | sed 's/libgcc.a//') #todo ?
+$(OBJDIR)/%.o: %.S
+	@echo '   [  AS  ]        '$<
+	@$(CC) $(CFLAGS) -c $< -o $@
+ifneq   ($(MODE),DEBUG)
+	@$(STRIP) -x -R .pdr -R .gnu.attributes -R .reginfo -R .comment $@
+endif
 
-# Rules that don't build target files
-# always out-of-date, need to be regenerated everytime they are called
-.PHONY: compile			        \
-		dirs				    \
-		clean				    \
-		build/kernel.elf
+clean:
+	rm -rf $(OBJDIR) out.cpp
+
+$(OBJDIRS):
+	@echo '   [ MKDIR ]       '$@
+	@mkdir -p $@
 
 
-# Objects to be linked for kernel.elf generation
-KERN_OBJS	= build/kern/kernel_init.o      \
-              build/kern/printk.o           \
-              build/kern/thread.o           \
-              build/kern/process.o          \
-              build/kern/chdev.o            \
-              build/kern/ksocket.o          \
-              build/kern/cluster.o          \
-              build/kern/scheduler.o        \
-              build/kern/core.o             \
-              build/kern/dqdt.o             \
-              build/kern/do_syscall.o       \
-              build/kern/rpc.o              \
-              build/kern/alarm.o            \
-              build/kern/pipe.o
-
-DEV_OBJS    = build/devices/dev_txt.o       \
-              build/devices/dev_ioc.o       \
-              build/devices/dev_mmc.o       \
-              build/devices/dev_nic.o       \
-              build/devices/dev_pic.o       \
-              build/devices/dev_dma.o       \
-              build/devices/dev_fbf.o       \
-              build/devices/dev_iob.o
-
-MM_OBJS     = build/mm/ppm.o                \
-              build/mm/vmm.o                \
-              build/mm/vseg.o               \
-              build/mm/page.o               \
-              build/mm/kcm.o                \
-              build/mm/mapper.o             \
-              build/mm/kmem.o
-
-LIBK_OBJS   = build/libk/grdxt.o            \
-              build/libk/bits.o             \
-              build/libk/elf.o              \
-              build/libk/string.o           \
-              build/libk/ctype.o            \
-              build/libk/rwlock.o           \
-              build/libk/busylock.o         \
-              build/libk/queuelock.o        \
-              build/libk/barrier.o          \
-              build/libk/xbarrier.o         \
-              build/libk/remote_busylock.o  \
-              build/libk/remote_queuelock.o \
-              build/libk/remote_rwlock.o    \
-              build/libk/remote_fifo.o      \
-              build/libk/remote_mutex.o     \
-              build/libk/remote_sem.o       \
-              build/libk/remote_condvar.o   \
-              build/libk/remote_barrier.o   \
-              build/libk/remote_buf.o       \
-              build/libk/memcpy.o           \
-              build/libk/htab.o             \
-              build/libk/xhtab.o            \
-              build/libk/user_dir.o
-
-SYS_OBJS_0  = build/syscalls/sys_thread_exit.o     \
-              build/syscalls/sys_thread_yield.o    \
-              build/syscalls/sys_thread_create.o   \
-              build/syscalls/sys_thread_join.o     \
-              build/syscalls/sys_thread_detach.o   \
-              build/syscalls/sys_thread_cancel.o   \
-              build/syscalls/sys_sem.o             \
-              build/syscalls/sys_condvar.o         \
-              build/syscalls/sys_barrier.o         \
-              build/syscalls/sys_mutex.o 
-
-SYS_OBJS_1  = build/syscalls/sys_rename.o          \
-              build/syscalls/sys_munmap.o          \
-              build/syscalls/sys_open.o            \
-              build/syscalls/sys_mmap.o            \
-              build/syscalls/sys_read.o            \
-              build/syscalls/sys_write.o           \
-              build/syscalls/sys_lseek.o           \
-              build/syscalls/sys_close.o           \
-              build/syscalls/sys_unlink.o          \
-              build/syscalls/sys_pipe.o
-
-SYS_OBJS_2  = build/syscalls/sys_chdir.o           \
-              build/syscalls/sys_mkdir.o           \
-              build/syscalls/sys_mkfifo.o          \
-              build/syscalls/sys_opendir.o         \
-              build/syscalls/sys_readdir.o         \
-              build/syscalls/sys_closedir.o        \
-              build/syscalls/sys_getcwd.o          \
-              build/syscalls/sys_isatty.o          \
-              build/syscalls/sys_alarm.o           \
-              build/syscalls/sys_rmdir.o
-
-SYS_OBJS_3  = build/syscalls/sys_utls.o            \
-              build/syscalls/sys_chmod.o           \
-              build/syscalls/sys_signal.o          \
-              build/syscalls/sys_timeofday.o       \
-              build/syscalls/sys_kill.o            \
-              build/syscalls/sys_getpid.o          \
-              build/syscalls/sys_fork.o            \
-              build/syscalls/sys_exec.o            \
-              build/syscalls/sys_stat.o            \
-              build/syscalls/sys_wait.o 
-
-SYS_OBJS_4  = build/syscalls/sys_get.o             \
-              build/syscalls/sys_display.o         \
-              build/syscalls/sys_place_fork.o      \
-              build/syscalls/sys_thread_sleep.o    \
-              build/syscalls/sys_thread_wakeup.o   \
-              build/syscalls/sys_trace.o           \
-              build/syscalls/sys_fg.o              \
-              build/syscalls/sys_is_fg.o           \
-              build/syscalls/sys_fbf.o
-
-SYS_OBJS_5  = build/syscalls/sys_exit.o            \
-              build/syscalls/sys_sync.o            \
-              build/syscalls/sys_fsync.o           \
-              build/syscalls/sys_socket.o
-
-VFS_OBJS    = build/fs/vfs.o              \
-              build/fs/fatfs.o            \
-              build/fs/devfs.o            \
-              build/fs/ramfs.o
-
-# List of directories to be searched for included files
-# when compiling for kernel.elf generation
-KERNEL_INCLUDE = -I.                   \
-                 -Ikern                \
-                 -Idevices             \
-                 -Isyscalls            \
-                 -I$(SHARED_INCLUDE)   \
-                 -I$(HAL_ARCH)/drivers \
-                 -Isyscalls            \
-                 -Ilibk                \
-                 -Imm                  \
-                 -Ifs                  \
-                 -I../tools/arch_info  \
-                 -I$(HAL)/generic      \
-                 -I$(HAL_ARCH)/core    \
-                 -I..
-
-# Rule to generate kernel.elf.
-compile: dirs                     \
-         build/kernel.elf
-
-# Rule to create the build directories.
-dirs:
-	@mkdir -p build
-	@mkdir -p build/kern
-	@mkdir -p build/hal
-	@mkdir -p build/devices
-	@mkdir -p build/mm
-	@mkdir -p build/libk
-	@mkdir -p build/drivers
-	@mkdir -p build/fs
-	@mkdir -p build/syscalls
-
-
-######################################
-# rules to compile the drivers and hal
-$(HAL_ARCH)/build/%:
-	$(MAKE) -C $(HAL_ARCH)
-
-#######################################
-# Rules to generate kernel/kern objects
-build/kern/%.o:		    kern/%.c                      \
-                        kern/%.h                      \
-                        kernel_config.h               \
-                        $(HAL_ARCH)/core/hal_kernel_types.h
-	$(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $<
-
-
-######################################
-# Rules to generate kernel/dev objects
-build/devices/%.o:      devices/%.c                   \
-                        devices/%.h                   \
-                        kernel_config.h               \
-                        $(HAL_ARCH)/core/hal_kernel_types.h
-	$(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $<
-
-#####################################
-# Rules to generate kernel/mm objects
-build/mm/%.o:           mm/%.c                        \
-                        mm/%.h                        \
-                        kernel_config.h               \
-                        $(HAL_ARCH)/core/hal_kernel_types.h
-	$(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $<
-
-#######################################
-# Rules to generate kernel/libk objects
-build/libk/%.o:         libk/%.c                      \
-                        libk/%.h                      \
-                        kernel_config.h               \
-                        $(HAL_ARCH)/core/hal_kernel_types.h
-	$(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $<
-
-###########################################
-# Rules to generate kernel/syscalls objects
-build/syscalls/%.o:     syscalls/%.c                  \
-                        syscalls/syscalls.h           \
-                        kernel_config.h               \
-                        $(HAL_ARCH)/core/hal_kernel_types.h
-	$(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $<
-
-#######################################
-# Rules to generate kernel/fs objects
-build/fs/%.o:           fs/%.c                        \
-                        fs/%.h                        \
-                        kernel_config.h               \
-                        $(HAL_ARCH)/core/hal_kernel_types.h
-	$(CC) $(KERNEL_INCLUDE) $(CFLAGS) -c -o $@ $<
-
-##############################
-# Rule to generate kernel.elf
-build/kernel.elf:	$(KERN_OBJS)                 \
-                    $(HAL_OBJS_0)                \
-                    $(HAL_OBJS_1)                \
-                    $(DEV_OBJS)                  \
-                    $(MM_OBJS)                   \
-                    $(LIBK_OBJS)                 \
-                    $(DRIVERS_OBJS)              \
-                    $(VFS_OBJS)                  \
-                    $(SYS_OBJS_0)                \
-                    $(SYS_OBJS_1)                \
-                    $(SYS_OBJS_2)                \
-                    $(SYS_OBJS_3)                \
-                    $(SYS_OBJS_4)                \
-                    $(SYS_OBJS_5)                \
-    	            $(HAL_ARCH)/kernel.ld
-	$(LD) -o $@ -T $(HAL_ARCH)/kernel.ld $(LIBGCC)         \
-          $(KERN_OBJS) $(HAL_OBJS) $(DEV_OBJS) $(MM_OBJS)  \
-          $(LIBK_OBJS) $(DRIVERS_OBJS) $(VFS_OBJS)         \
-          $(SYS_OBJS_0) $(SYS_OBJS_1) $(SYS_OBJS_2)        \
-          $(SYS_OBJS_3) $(SYS_OBJS_4) $(SYS_OBJS_5) -lgcc
-	$(DU) -D $@ > $@.txt
-
-clean:
-	rm -rf build/*
+-include $(DEPS)
Index: trunk/kernel/`
===================================================================
--- trunk/kernel/`	(revision 1)
+++ trunk/kernel/`	(revision 1)
@@ -0,0 +1,264 @@
+/*
+ * rpc.h - RPC related operations
+ *
+ * Authors Mohamed Karaoui (2015)
+ *         Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ * 
+ * This file is part of ALMOS-MK.
+ *
+ * ALMOS-MK is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MK is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MK; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _RPC_H_
+#define _RPC_H_
+
+#include <errno.h>
+#include <types.h>
+#include <bits.h>
+#include <atomic.h>
+#include <spinlock.h>
+#include <remote_fifo.h>
+#include <kernel_config.h>
+
+/**********************************************************************************/
+/**************  structures for Remote Procedure Calls ****************************/
+/**********************************************************************************/
+
+/***********************************************************************************
+ *  This enum defines all RPC indexes (must be consistent with array in rpc.c)
+ **********************************************************************************/
+
+typedef enum
+{
+    RPC_PMEM_GET_PAGES         = 0,
+    RPC_PROCESS_PID_ALLOC      = 1,
+    RPC_PROCESS_MIGRATE        = 2,
+    RPC_THREAD_USER_CREATE     = 3,
+    RPC_VFAT_ALLOC_FAT_ENTRY   = 4,
+    RPC_VFAT_CLUSTER_COUNT     = 5,
+    RPC_VFS_LOOKUP_CHILD       = 6,
+    RPC_MAX_INDEX              = 7
+}
+rpc_index_t;
+
+/***********************************************************************************
+ *  This structure defines the RPC descriptor
+ **********************************************************************************/
+
+typedef struct rpc_desc_s
+{
+	rpc_index_t       index;      // index of requested RPC service
+	volatile uint32_t response;   // response valid when 0
+    uint64_t          args[7];    // input/output arguments buffer
+} 
+rpc_desc_t;
+
+/***********************************************************************************
+ *  This structure defines the RPC fifo, the associated light lock,
+ *  and the intrumentation counter.
+ **********************************************************************************/
+
+typedef struct rpc_fifo_s
+{
+	spinlock_t lock;          // spinlock for the readers
+	uint64_t          count;  // total number of received RPCs (instrumentation) 
+	remote_fifo_t     fifo;   // embedded remote fifo
+} 
+rpc_fifo_t;
+
+
+/**********************************************************************************/
+/******* Generic functions supporting RPCs : client side **************************/
+/**********************************************************************************/
+
+/***********************************************************************************
+ * This blocking function executes on the client core. 
+ * It puts one RPC extended pointer in the remote fifo. 
+ * It sends an IPI if fifo is empty, and waits until RPC response available.
+ * The RPC descriptor must be allocated in the caller's stack
+ * and initialised by the caller.  Exit with a Panic message if remote fifo 
+ * is still full after (CONFIG_RPC_PUT_MAX_ITERATIONS) retries.
+ * @ cxy   : server cluster identifier
+ * @ desc  : local pointer on RPC descriptor in client cluster
+ **********************************************************************************/
+void rpc_send_sync( cxy_t        cxy,    
+                    rpc_desc_t * desc );
+
+/***********************************************************************************
+ * This non blocking function is called by the scheduler of the client core
+ * to detect RPC completion.  
+ * @ ptr   : local pointer on the RPC descriptor in client cluster.
+ * @ return true if the client thread must resume (RPC completed). 
+ **********************************************************************************/ 
+static bool_t rpc_callback( void * ptr );
+
+
+
+/**********************************************************************************/
+/******* Generic functions supporting RPCs : server side **************************/
+/**********************************************************************************/
+
+/***********************************************************************************
+ * This function initialises the local RPC fifo and the lock protecting readers.
+ * The number of slots is defined by the CONFIG_REMOTE_FIFO_SLOTS parameter.
+ * Each slot contains an extended pointer on the RPC descriptor.
+ * @ rf     : pointer on the local RPC fifo.
+ **********************************************************************************/ 
+void rpc_fifo_init( rpc_fifo_t * rf );
+
+/***********************************************************************************
+ * This function is the entry point for RPC handling on the server side.
+ * It can be executed by any thread running (in kernel mode) on any CPU.
+ * It first checks the CPU private RPC fifo, an then the cluster shared RPC fifo.
+ * It calls the rpc_activate_thread() function to activate a dedicated RPC thread,
+ * after registration of the selected RPC fifo in the selected thread descriptor. 
+ * @ returns true if at least one RPC found / false otherwise.
+ **********************************************************************************/
+bool_t rpc_check();
+
+/***********************************************************************************
+ * This function contains the loop to execute all pending RPCs on the server side.
+ * It should be called with irq disabled and after light lock acquisition.
+ * @ rpc_fifo  : pointer on the local RPC fifo
+ * @ returns 0 if success
+ **********************************************************************************/
+error_r rpc_execute_all( rpc_fifo_t * rpc_fifo );
+
+/***********************************************************************************
+ * This function is acting as a demultiplexor on the server side. 
+ * Depending on the RPC index stored in the RPC descriptor,
+ * it calls the relevant rpc_*_server() function.
+ * @ xptr : extended pointer on the RPC descriptor.
+ **********************************************************************************/
+void rpc_handle( xptr_t * xp );
+
+/**********************************************************************************
+ * This function activates one RPC thread to handle the pending RPC(s) contained
+ * in one RPC fifo (shared or private). It is called by any thread detecting
+ * a non-empty RPC fifo.
+ * It gets the first free RPC thread from the free-list, or creates a new one
+ * if the RPC thread free-list associated to the current cpu is empty. 
+ * Finally, the calling thread immediately switches to the RPC thread.
+ * @ rpc_fifo : pointer on the non-empty RPC fifo.
+ * @ return 0 if success / return ENOMEM if error.
+ **********************************************************************************/
+error_t rpc_activate_thread( rpc_fifo_t * rpc_fifo );
+
+/***********************************************************************************
+ * This function defines the infinite loop executed by each RPC thread.
+ **********************************************************************************/
+void * rpc_thread();
+
+/**********************************************************************************
+ * This call-back function must be registered in the RPC thread descriptor.
+ * It is executed by the scheduler when the thread makes a sched_sleep() call,
+ * when the "before_sleep" field in thread descriptor is not NULL. 
+ * It releases the light lock and print a debug message.
+ * @ thread  : local pointer on thread. 
+ **********************************************************************************/
+void rpc_before_sleep( thread_t * thread );
+
+/**********************************************************************************
+ * This call-back function must be registered in the RPC thread descriptor.
+ * It is executed by the scheduler when the thread makes a wakeup(),
+ * when the "after_wakeup" field in thread descriptor is not NULL. 
+ * It print a debug message.
+ * @ thread  : local pointer on thread. 
+ **********************************************************************************/
+void rpc_after_wakeup( thread_t * thread );
+
+/**********************************************************************************/
+/******* Marshalling functions attached to the various RPCs ***********************/
+/**********************************************************************************/
+
+/***********************************************************************************
+ * The RPC_PMEM_GET_PAGES allocates one or several pages in a remote cluster,
+ * and returns the PPN of the first allocated page.
+ * @ cxy     : server cluster identifier
+ * @ order   : [in]  ln2( number of requested pages )
+ * @ status  : [out] error status (0 if success)
+ * @ ppn     : [out] first physical page number
+ **********************************************************************************/
+void rpc_pmem_get_pages_client( cxy_t      cxy,
+                                uint32_t   order,
+                                uint32_t * status,
+                                uint32_t * ppn );
+
+void rpc_pmem_get_pages_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_PROCESS_PID_ALLOC allocates one new PID in a remote cluster, registers
+ * the new process in the remote cluster, and returns the PID, and an error code.
+ * @ cxy     : server cluster identifier.
+ * @ process : [in]  pointer on process descriptor in client cluster.
+ * @ status  : [out] error status (0 if success).
+ * @ pid     : [out] new process identifier.
+ **********************************************************************************/
+void rpc_process_pid_alloc_client( cxy_t       cxy,
+                                   process_t * process,
+                                   error_t   * status,
+                                   pid_t     * pid );
+
+void rpc_process_pid_alloc_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_PROCESS_MIGRATE creates a process descriptor copy, in a remote cluster
+ * and initializes if from information found in the reference process descriptor.
+ * This remote cluster becomes the new reference cluster.
+ * @ cxy     : server cluster identifier.
+ * @ xp_ref  : [in]  extended pointer on reference process descriptor.
+ * @ status  : [out] error status (0 if success).
+ **********************************************************************************/
+void rpc_process_migrate_client( cxy_t       cxy,
+                                 xptr_t      xp_ref,
+                                 error_t   * status );
+
+void rpc_process_migrate_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_VFS_LOOKUP_CHILD returns in the lpr structure information on the
+ * the inode identified by the dentry name and the lkp structure. 
+ * @ cxy     : server cluster identifier
+ * @ lkp     : [in]   pointer on input structure in client cluster
+ * @ name    : [in]   dentry name
+ * @ lpr     : [out]  pointer on output structure in client cluster
+ **********************************************************************************/
+void rpc_vfs_lookup_child_client( cxy_t                    cxy,
+                                  vfs_lookup_t          *  lkp,
+                                  char                  *  name,
+                                  vfs_lookup_response_t *  lpr );
+
+void rpc_vfs_lookup_child_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_THREAD_USER_CREATE creates an user thread in the server cluster,
+ * as specified by the pthread_attr_t argument. It returns an extended pointer
+ * on the thread descriptor in server cluster and an error code.
+ * @ cxy     : server cluster identifier.
+ * @ attr    : [in]   pointer on pthread_attr_t in client cluster.
+ * @ error   : [out] error status (0 if success).
+ * @ thread  : [out] extended pointer on thread descriptor. 
+ **********************************************************************************/
+void rpc_thread_user_create_client( cxy_t             cxy,
+                                    pthread_attr_t *  attr,
+                                    error_t        *  error,
+                                    xptr_t         *  new_thread );
+
+void rpc_thread_user_create_server( xptr_t xp );
+
+
+
+#endif
Index: trunk/kernel/arch/ibmpc/arch-config.h
===================================================================
--- trunk/kernel/arch/ibmpc/arch-config.h	(revision 1)
+++ trunk/kernel/arch/ibmpc/arch-config.h	(revision 1)
@@ -0,0 +1,55 @@
+/*
+ * arch.c - architecture related configurations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _ARCH_CONFIG_H_
+#define _ARCH_CONFIG_H_
+
+#ifndef _CONFIG_H_
+#error This config-file is not to be included directely, use config.h instead
+#endif
+
+//////////////////////////////////////////////
+//      ARCH RELATED CONFIGURATIONS         //
+//////////////////////////////////////////////
+#define CONFIG_USR_OFFSET       0x00C00000
+#define CONFIG_USR_LIMIT        0x01F00000
+#define CONFIG_CPU_BITS_NR               2
+#define CONFIG_CLUSTER_BITS_NR           2
+#define CONFIG_CLUSTER_NR                1
+#define CONFIG_CPU_PER_CLUSTER_NR        1
+#define CONFIG_CPU_NR                    1
+#define CONFIG_IO_CLUSTER_ID             0
+#define CONFIG_BOOT_CLUSTER_ID           0
+#define CONFIG_BOOT_CPU_ID               0
+#define CONFIG_TTY_DEV_NR                1
+#define CONFIG_DMSG_KLOG_TTY             0
+#define CONFIG_DMSG_BOOT_TTY             0
+#define CONFIG_DMSG_ISR_TTY              0
+#define CONFIG_DMSG_EXCEPT_TTY           0
+#define CONFIG_KSH_TTY                   0
+#define CONFIG_TIMER_WITH_IRQ            yes
+#define CONFIG_TTY_ECHO_MODE             yes
+#define CONFIG_FB_USE_DMA                no
+//////////////////////////////////////////////
+
+
+#endif	/* _ARCH_CONFIG_H_ */
Index: trunk/kernel/arch/ibmpc/arch.c
===================================================================
--- trunk/kernel/arch/ibmpc/arch.c	(revision 1)
+++ trunk/kernel/arch/ibmpc/arch.c	(revision 1)
@@ -0,0 +1,51 @@
+/*
+ * arch.c - architecture related operations (see kern/hal-arch.h)
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <types.h>
+#include <kdmsg.h>
+#include <cpu.h>
+#include <device.h>
+#include <system.h>
+
+error_t arch_cpu_init(struct cpu_s *cpu)
+{
+	cpu->arch.action = NULL;
+	return 0;
+}
+
+error_t arch_cpu_set_irq_entry(struct cpu_s *cpu, int irq_nr, struct irq_action_s *action)
+{
+	assert(cpu->arch.action == NULL && "IRQ entry has been already specified\n");
+	cpu->arch.action = action;
+	return 0;
+}
+
+error_t arch_cpu_get_irq_entry(struct cpu_s *cpu, int irq_nr, struct irq_action_s **action)
+{
+	if(cpu->arch.action == NULL)
+		return EINVAL;
+
+	cpu->arch.action->data = (void*)irq_nr;
+	*action = cpu->arch.action;
+	return 0;
+}
Index: trunk/kernel/arch/ibmpc/arch.h
===================================================================
--- trunk/kernel/arch/ibmpc/arch.h	(revision 1)
+++ trunk/kernel/arch/ibmpc/arch.h	(revision 1)
@@ -0,0 +1,74 @@
+/*
+ * arch.h - architecture specific implementation of kernel's HAL
+ * (see kern/hal-arch.h)
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _ARCH_H_
+#define _ARCH_H_
+
+#include <config.h>
+#include <segmentation.h>
+#include <types.h>
+
+#ifndef _HAL_ARCH_H_
+#error arch.h connot be included directly, use system.h instead
+#endif
+
+/* CPUs/CLUSTERs Numbers */
+#define CACHE_LINE_SIZE   CONFIG_CACHE_LINE_SIZE
+#define __CPU_NR          CONFIG_CPU_NR
+#define __CPUs            CONFIG_CPU_PER_CLUSTER_NR
+#define __CLUSTER_NR      CONFIG_CLUSTER_NR
+#define __CPU_BITS_NR     CONFIG_CPU_BITS_NR
+#define __CLUSTER_BITS_NR CONFIG_CLUSTER_BITS_NR
+#define __PAGE_SIZE       CONFIG_CACHE_LINE_SIZE
+
+#undef CPU_NR
+#undef CLUSTER_NR
+#undef CPU_PER_CLUSTER
+#undef GET_CPU_ID
+#undef GET_CLUSTER_ID
+#undef MAKE_CPU_ID
+
+#define CPU_NR                      __CPU_NR
+#define CLUSTER_NR                  __CLUSTER_NR
+#define CPU_PER_CLUSTER             __CPUs
+#define GET_CPU_ID(_cpu_id)         ((_cpu_id) & (__CPU_NR - 1))
+#define GET_CLUSTER_ID(_cpu_id)     ((_cpu_id) >> __CPU_BITS_NR)
+#define MAKE_CPU_ID(_cluster,_cpu)  (((_cluster) << __CPU_BITS_NR) | (_cpu))
+
+/* Timer parameters macros */
+#undef TIC
+#undef CYCLES_PER_SECOND
+
+#define TIC                 40000
+#define CYCLES_PER_SECOND   200000
+#define ALPHA               20
+
+/* Structures definitions */
+struct irq_action_s;
+
+struct arch_cpu_s
+{
+	struct irq_action_s *action;
+};
+
+#endif	/* _ARCH_H_ */
Index: trunk/kernel/arch/ibmpc/arch_init.c
===================================================================
--- trunk/kernel/arch/ibmpc/arch_init.c	(revision 1)
+++ trunk/kernel/arch/ibmpc/arch_init.c	(revision 1)
@@ -0,0 +1,90 @@
+/*
+ * arch_init.c - architecture intialization operations (see kern/hal-arch.h)
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <types.h>
+#include <hardware.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
+#include <list.h>
+#include <pic.h>
+#include <tty.h>
+#include <scheduler.h>
+#include <kdmsg.h>
+#include <devfs.h>
+#include <cluster.h>
+#include <rt_timer.h>
+#include <pci-bus.h>
+#include <kmem.h>
+#include <ata.h>
+
+/* TODO: dynamicly calculate this value on each icu bind operation */
+#define ICU_MASK     0x3  // interrupt enabled for frist 2 devices 
+
+struct device_s __sys_dma;
+struct device_s __fb_screen;
+struct device_s __sys_blk;
+struct device_s rt_timer;
+
+static void ioCluster_init(struct cluster_s *cluster, uint_t id)
+{
+	struct device_s *pic;
+	int i;
+
+	/* First of all: Initialize TTYs */
+	ibmpc_tty_init(&ttys_tbl[0], __tty_addr, 1, 0);   // IRQ 0 is taken by Timer 0
+
+	boot_dmsg("\nSetup Terminal \t\t\t\tOK\n");
+   
+	cluster_init(cluster, id, __CPU_NR);
+
+	boot_dmsg("Setup PIC      ");
+	pic = kbootMem_calloc(sizeof(*pic));
+	ibmpc_pic_init(pic, __pic_addr, 0);
+	ibmpc_pic_bind(pic, &ttys_tbl[0]);
+	devfs_register(&ttys_tbl[0]);
+
+	for(i=0; i < __CPU_NR; i++)
+		arch_cpu_set_irq_entry(&cluster->cpu_tbl[i], 0, &pic->action);
+
+	boot_dmsg("\t\t\t\tOK\nSetup Timer    ");
+	rt_timer_init(TIC, 1);
+	ibmpc_pic_bind(pic, &rt_timer);
+
+	boot_dmsg("\t\t\t\tOK\nSetup H.D.D    ");
+	ibmpc_ata_init(&__sys_blk, (void*)ATA0_DRIVE0, 14);
+	ibmpc_pic_bind(pic, &__sys_blk);
+
+	boot_dmsg("\t\t\t\tOK\nActivating IRQs");
+	pic->op.icu.set_mask(pic, ICU_MASK, 0, 0);
+	boot_dmsg("\t\t\t\tOK\n");
+}
+
+
+error_t arch_init(void)
+{
+	kdmsg_init();
+	ioCluster_init(&clusters_tbl[IO_CLUSTER_ID], IO_CLUSTER_ID);
+
+	return 0;
+}
Index: trunk/kernel/arch/ibmpc/hardware.h
===================================================================
--- trunk/kernel/arch/ibmpc/hardware.h	(revision 1)
+++ trunk/kernel/arch/ibmpc/hardware.h	(revision 1)
@@ -0,0 +1,49 @@
+/*
+ * hardware.h - architecture specific macros
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _HARDWARE_H_
+#define _HARDWARE_H_
+
+#include <config.h>
+#include <segmentation.h>
+#include <types.h>
+#include <system.h>
+#include <screen.h>
+/* Addresses of the peripheral devices */
+#define __pic_addr        ((uint_t*)PIC_BASE)
+#define __tty_addr        ((uint_t*)TTY_BASE)
+#define __fb_addr         ((uint_t*)FB_BASE)
+#define __timer_addr      ((uint_t*)TIMER_BASE)
+#define __dma_addr        ((uint_t*)DMA_BASE)
+#define __blk_addr        ((uint_t*)BD_BASE)
+
+#define IO_CLUSTER_ID     CONFIG_IO_CLUSTER_ID
+
+/* Terminals related macros */
+#define TTY_DEV_NR        CONFIG_TTY_DEV_NR
+#define SYS_TTY           0
+#define TTY_BUFFER_DEPTH  40
+
+/* Timer parameters macros */
+#define TIMER_DEV_NR      CONFIG_TIMER_DEV_NR
+
+#endif	/* _HARDWARE_H_ */
Index: trunk/kernel/arch/ibmpc/kdmsg.c
===================================================================
--- trunk/kernel/arch/ibmpc/kdmsg.c	(revision 1)
+++ trunk/kernel/arch/ibmpc/kdmsg.c	(revision 1)
@@ -0,0 +1,131 @@
+/*
+ * kdmsg.c - output kernel debug/trace/information to an available terminal
+ * (see kern/kdmsg.h)
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <hardware.h>
+#include <cpu.h>
+#include <device.h>
+#include <tty.h>
+#include <libk.h>
+#include <kdmsg.h>
+#include <spinlock.h>
+
+spinlock_t exception_lock;
+spinlock_t printk_lock;
+spinlock_t isr_lock;
+
+void kdmsg_init()
+{
+	spinlock_init(&exception_lock);
+	spinlock_init(&printk_lock);
+	spinlock_init(&isr_lock);
+}
+
+int __fprintk (int tty, spinlock_t *lock, const char *fmt, ...)
+{
+	va_list ap;
+	int count;
+	char buff[256];
+	dev_request_t rq;
+
+	va_start (ap, fmt);
+
+	assert(tty == 0 && "Unexpected tty device id");
+	count = iprintk (buff, 1, (char *) fmt, ap);
+	assert(count < 256 && "Buffer overflow");
+
+	va_end (ap);
+	rq.src   = buff;
+	rq.count = count;
+	rq.flags = DEV_RQ_NOBLOCK;
+
+	if(lock)
+	{
+		if(lock == &printk_lock)
+			spinlock_lock(&ttys_tbl[tty].lock);
+		else
+			cpu_spinlock_lock(&ttys_tbl[tty].lock.val);
+	}
+
+	ttys_tbl[tty].op.dev.write(&ttys_tbl[tty], &rq);
+   
+	if(lock)
+	{
+		if(lock == &printk_lock)
+			spinlock_unlock(&ttys_tbl[tty].lock);
+		else
+			cpu_spinlock_unlock(&ttys_tbl[tty].lock.val);
+	}
+
+	return count;
+}
+
+int __perror (int fatal, const char *fmt, ...)
+{
+	va_list ap;
+	int count;
+	char buff[256];
+	dev_request_t rq;
+
+	va_start (ap, fmt);
+	count = iprintk (buff, 1, (char *) fmt, ap);
+	va_end (ap);
+   
+	rq.src = buff;
+	rq.count = count;
+	rq.flags = DEV_RQ_NOBLOCK;
+
+	ttys_tbl[0].op.dev.write(&ttys_tbl[0], &rq);
+
+	if(fatal)
+		while(1);
+
+	return count;
+}
+
+void bdump(uint_t fd, char* buff, size_t count)
+{
+	register uint_t i,j,size;
+	char *tab = "0123456789ABCDEF";
+	char tmp[256];
+	dev_request_t rq;
+     
+	assert((fd != 0) && "file descriptor is not a tty");
+	i=0;
+
+	while(count)
+	{
+		size = (count < 256) ? count : 256;
+    
+		for(j=0; j < size; j++, i++)
+			tmp[j] = tab[ (buff[i] & 0xF)];
+		
+		rq.src   = tmp;
+		rq.count = 256;
+		rq.flags = 0;
+    
+		ttys_tbl[0].op.dev.write(&ttys_tbl[0], &rq);
+
+		count -= size;
+	}
+}
Index: trunk/kernel/arch/ibmpc/kldscript.h
===================================================================
--- trunk/kernel/arch/ibmpc/kldscript.h	(revision 1)
+++ trunk/kernel/arch/ibmpc/kldscript.h	(revision 1)
@@ -0,0 +1,49 @@
+/*
+ * kldscript.h - kernel ldscript
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+ENTRY(_start)
+phys = 0x00100000;
+SECTIONS
+{
+  .text phys : AT(phys) {
+    code = .;
+    *(.boot)
+    *(.text)
+    *(.rodata*)
+    _ecode = .;
+    . = ALIGN(4096);
+  }
+  .data : AT(phys + (data - code))
+  {
+    data = .;
+    *(.data)
+    . = ALIGN(4096);
+  }
+  .bss : AT(phys + (bss - code))
+  {
+    bss = .;
+    *(.bss)
+    . = ALIGN(4096);
+  }
+  _edata = .;
+  _end = .;
+}
Index: trunk/kernel/arch/ibmpc/kldscript.h2
===================================================================
--- trunk/kernel/arch/ibmpc/kldscript.h2	(revision 1)
+++ trunk/kernel/arch/ibmpc/kldscript.h2	(revision 1)
@@ -0,0 +1,57 @@
+/*OUTPUT_FORMAT("binary")*/
+ENTRY(_start)
+phys = 0x00100000;
+SECTIONS
+{
+  .text phys : AT(phys) {
+    code = .;
+    *(.boot)
+    *(.text)
+    _ecode = .;
+    . = ALIGN(4096);
+  }
+
+  .eh_frame : AT(phys + (_eh_frame - code))
+  {
+    _eh_frame = .;
+    *(.rodata*)
+    *(.data)
+    . = ALIGN(4096);
+  }
+
+  .data : AT(phys + (data - code))
+  {
+    data = .;
+    *(.rodata*)
+    *(.data)
+    . = ALIGN(4096);
+  }
+
+  .bss : AT(phys + (bss - code))
+  {
+    bss = .;
+    *(.bss)
+    . = ALIGN(4096);
+  }
+  _edata = .;
+  _end = .;
+
+  .comment : AT(phys + (_comment - code))
+  {
+    _comment = .;
+    *(.comment*)
+  }
+
+  .stab : AT(phys + (_stab - code))
+  {
+    _stab = .;
+    *(.stab*)
+  }
+
+  .stabstr : AT(phys + (_stabstr - code))
+  {
+    _stabstr = .;
+    *(.stabstr*)
+  }
+}
+/*INPUT(__do_syscall.o)*/
Index: trunk/kernel/arch/ibmpc/rt_timer.c
===================================================================
--- trunk/kernel/arch/ibmpc/rt_timer.c	(revision 1)
+++ trunk/kernel/arch/ibmpc/rt_timer.c	(revision 1)
@@ -0,0 +1,104 @@
+/*
+ * rt_timer.c - real-time timer related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <rt_timer.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
+#include <sysio.h>
+#include <thread.h>
+#include <kmem.h>
+
+extern struct device_s rt_timer;
+
+static void timer_irq_handler (struct irq_action_s *action)
+{
+	register struct cpu_s *cpu;
+	register struct thread_s *this;
+   
+	this = CURRENT_THREAD;
+	cpu = this->local_cpu;
+
+	if(this->type == PTHREAD)
+	{
+		MEM_CHECK(this->info.usr_stack_base);
+	}
+   
+	MEM_CHECK(this->info.sys_stack_base);
+   
+	cpu->alarm_mgr.action.irq_handler(&cpu->alarm_mgr.action);
+
+	cpu->tics_nr ++;
+	cpu->tics_count ++;
+	sched_clock(this);
+}
+
+/** Initialize Real-Time timer source */
+error_t rt_timer_init(uint_t period, uint_t withIrq)
+{
+	rt_timer.irq = 0;
+	rt_timer.action.irq_handler = &timer_irq_handler;
+	rt_timer.type = DEV_TIMER;
+
+	strcpy(rt_timer.name, "TIMER");
+	metafs_init(&rt_timer.node, rt_timer.name);
+
+	return 0;
+}
+
+/** Read Real-Time timer current value  */
+error_t rt_timer_read(uint_t *time)
+{
+	*time = CURRENT_THREAD->local_cpu->tics_nr * 20;
+	return 0;
+}
+
+/** Set Real-Time timer's current value */
+error_t rt_timer_set(uint_t time)
+{
+	return 0;
+}
+
+/** Set Real-Time timer's period */
+error_t rt_timer_setperiod(uint_t period)
+{
+	return 0;
+}
+
+/** Send commands to Real-Time timer device */
+error_t rt_timer_ctrl(struct rt_params_s *param)
+{
+	switch(param->rt_cmd)
+	{
+	case RT_TIMER_STOP:
+		//rt_timer.op.timer.stop(&rt_timer);
+		return 0;
+
+	case RT_TIMER_RUN:
+		//rt_timer.op.timer.run(&rt_timer, (uint_t)rt_timer.data);
+		return 0;
+
+	default:
+		return -1;
+	}
+}
Index: trunk/kernel/arch/ibmpc/segmentation.h
===================================================================
--- trunk/kernel/arch/ibmpc/segmentation.h	(revision 1)
+++ trunk/kernel/arch/ibmpc/segmentation.h	(revision 1)
@@ -0,0 +1,41 @@
+/*
+ * segmentation.h - physical address space known segments
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+//////////////////////////////////////////////
+//         Devices mapped segments 
+//////////////////////////////////////////////
+#define     TIMER_BASE  0xd3200000
+#define     TIMER_SIZE  0x00000080
+
+#define     PIC_BASE    0x00000020
+
+#define     TTY_XSIZE   80
+#define     TTY_YSIZE   25
+#define     TTY_BASE    0x000B8000  
+#define     TTY_SIZE    TTY_XSIZE*TTY_YSIZE*2
+
+#define     ATA0_DRIVE0 0x000001F0
+#define     ATA0_DRIVE1 0x000101F0
+
+#define     ATA1_DRIVE0 0x00000170
+#define     ATA1_DRIVE1 0x00010170
+//////////////////////////////////////////////
Index: trunk/kernel/arch/tsar/arch-config.h
===================================================================
--- trunk/kernel/arch/tsar/arch-config.h	(revision 1)
+++ trunk/kernel/arch/tsar/arch-config.h	(revision 1)
@@ -0,0 +1,72 @@
+/*
+ * arch.c - architecture related configurations
+ *
+ * Copyright (c) 2007,2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _ARCH_CONFIG_H_
+#define _ARCH_CONFIG_H_
+
+#ifndef _CONFIG_H_
+#error This config-file is not to be included directely, use config.h instead
+#endif
+
+//////////////////////////////////////////////
+//      ARCH RELATED CONFIGURATIONS         //
+//////////////////////////////////////////////
+#define CONFIG_ARCH_NAME             "tsar"
+#define CONFIG_THREAD_PAGE_ORDER     0x1
+#define RUN_IN_PHYSICAL_MODE         yes
+#define CONFIG_PHYSICAL_BITS	     40
+#define CONFIG_LOCAL_PHYSICAL_BITS   32//NUMBER of bits that are local to a cluster
+
+/* Kepping the same value for KERNEL_OFFSET allow us to 
+ * have the same kernel for both mode of addressing */
+#if RUN_IN_PHYSICAL_MODE
+
+ /* kernel space allocated virtual addresses */
+ #define CONFIG_KERNEL_OFFSET         0x00000000
+ #define CONFIG_KERNEL_LIMIT          0x00003FFF //approximated may require more (if less no problem)
+ #define CONFIG_DEVREGION_SIZE        0x00000000 //empty
+ /* user space allocated virtual addresses */
+ #define CONFIG_USR_OFFSET            0x00004000
+ #define CONFIG_USR_LIMIT             0x80000000//0xFFFFFFFF
+
+#else /*!RUN_IN_PHYSICAL_MODE*/
+
+ /* kernel space allocated virtual addresses */
+ #define CONFIG_KERNEL_OFFSET         0x00000000
+ #define CONFIG_KERNEL_LIMIT          0x3FFFFFFF
+ #define CONFIG_DEVREGION_SIZE        0x00000000 //Dynamically allocated from kernel space
+ /* drivers are physically accessed !? */
+ /* user space allocated virtual addresses */
+ #define CONFIG_USR_OFFSET            0x40000000
+ #define CONFIG_USR_LIMIT             0xFFFFFFFF
+
+#endif
+
+#define CONFIG_PPN_BITS_NR                20
+#define CONFIG_TTY_ECHO_MODE              yes
+#define CONFIG_TTY_MAX_DEV_NR             32
+#define CONFIG_TTY_BUFFER_DEPTH           40
+#define CONFIG_FB_USE_DMA                 no
+#define CONFIG_ARCH_HAS_BARRIERS          no
+//////////////////////////////////////////////
+
+#endif	/* _ARCH_CONFIG_H_ */
Index: trunk/kernel/arch/tsar/arch-dqdt.c
===================================================================
--- trunk/kernel/arch/tsar/arch-dqdt.c	(revision 1)
+++ trunk/kernel/arch/tsar/arch-dqdt.c	(revision 1)
@@ -0,0 +1,410 @@
+/*
+ * arch-dqdt.c - build the Distributed Quaternary Decision Tree
+ * (see kern/dqdt.h)
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <types.h>
+#include <cpu.h>
+#include <bits.h>
+#include <thread.h>
+#include <system.h>
+#include <kmem.h>
+#include <arch-bib.h>
+#include <boot-info.h>
+#include <cluster.h>
+#include <kdmsg.h>
+#include <dqdt.h>
+
+#if 0
+uint_t arch_dqdt_distance(struct dqdt_cluster_s *c1, struct dqdt_cluster_s *c2, struct dqdt_attr_s *attr)
+{
+	register sint_t x1,y1,x2,y2,d;
+  
+	switch(attr->d_attr)
+	{
+	case DQDT_DIST_DEFAULT:
+		x1 = c1->home->x_coord;
+		y1 = c1->home->y_coord;
+		x2 = c2->home->x_coord;
+		y2 = c2->home->y_coord;
+		d = ABS((x1 - x2)) + ABS((y1 - y2));
+		break;
+
+	case DQDT_DIST_RANDOM:
+		//srand(cpu_time_stamp());
+		d = rand() % 0xFFF;
+		break;
+
+	default:
+		d = 1;
+		break;
+	}
+
+	return d;
+}
+
+static uint_t __cluster_index(uint_t x, uint_t y, uint_t ymax)
+{
+	return x*ymax + y;
+}
+
+error_t arch_dqdt_chip_init(struct dqdt_cluster_s ***chip,
+			    struct cluster_entry_s *clusters_tbl, 
+			    uint_t xmax, 
+			    uint_t ymax)
+{
+	struct dqdt_cluster_s *ptr;
+	kmem_req_t req;
+	uint_t chip_xmax;
+	uint_t chip_ymax;
+	uint_t x;
+	uint_t y;
+	uint_t cid;
+
+	dqdt_dmsg(1, "%s: real (%d x %d)\n", __FUNCTION__, xmax, ymax);
+
+	req.type  = KMEM_GENERIC;
+	req.size  = sizeof(*ptr);
+	chip_xmax = CONFIG_MAX_CLUSTER_ROOT;
+	chip_ymax = chip_xmax;
+
+	for(x = 0; x < chip_xmax; x++)
+		for(y = 0; y < chip_ymax; y++)
+			chip[x][y] = NULL;
+
+	req.flags = AF_BOOT | AF_REMOTE | AF_ZERO;
+
+	for(x = 0; x < xmax; x++)
+	{
+		for(y = 0; y < ymax; y++)
+		{
+			cid = __cluster_index(x, y, ymax);
+      
+			if(clusters_tbl[cid].cluster == NULL)
+				continue;
+
+			req.ptr = clusters_tbl[cid].cluster;
+			ptr     = kmem_alloc(&req);
+
+			if(ptr == NULL) 
+				return ENOMEM;
+
+			ptr->cores_nr            = clusters_tbl[cid].cluster->onln_cpu_nr;
+			ptr->flags               = DQDT_CLUSTER_UP;
+			ptr->home                = clusters_tbl[cid].cluster;
+			ptr->home->levels_tbl[0] = ptr;
+			ptr->home->x_coord       = x;
+			ptr->home->y_coord       = y;
+			ptr->home->z_coord       = 0;
+			ptr->home->chip_id       = 0;
+			chip[x][y]               = ptr;
+
+			dqdt_dmsg(1, "%s: found cid %d, x %d, y %d, ptr %x\n", 
+				  __FUNCTION__, 
+				  cid, 
+				  x, 
+				  y, 
+				  ptr);
+		}
+	}
+
+	req.flags = AF_BOOT | AF_ZERO;
+
+	for(x = 0; x < chip_xmax; x++)
+	{
+		for(y = 0; y < chip_ymax; y++)
+		{
+			if(chip[x][y] != NULL)
+				continue;
+      
+			ptr = kmem_alloc(&req);
+      
+			if(ptr == NULL) 
+				return ENOMEM;
+
+			chip[x][y] = ptr;
+		}
+	}
+
+	return 0;
+}
+
+static struct dqdt_cluster_s *** arch_dqdt_alloc_matrix(uint_t xmax, uint_t ymax)
+{
+	uint_t x;
+	kmem_req_t req;
+	struct dqdt_cluster_s ***matrix;
+
+	dqdt_dmsg(1, "%s: %d x %d\n", __FUNCTION__, xmax, ymax);
+  
+	req.type  = KMEM_GENERIC;
+	req.size  = xmax * sizeof(*matrix);
+	req.flags = AF_BOOT;
+  
+	matrix = kmem_alloc(&req);
+
+	if(matrix == NULL)
+		return NULL;
+  
+	for(x = 0; x < xmax; x++)
+	{
+		req.size  = ymax * sizeof(**matrix);
+		matrix[x] = kmem_alloc(&req);
+
+		if(matrix[x] == NULL)
+			return NULL;
+	}
+  
+	dqdt_dmsg(1, "%s: %d x %d, done\n", __FUNCTION__, xmax, ymax);
+	return matrix;
+}
+
+void arch_dqdt_free_matrix(struct dqdt_cluster_s ***matrix, uint_t xmax, uint_t ymax)
+{
+	uint_t x;
+	kmem_req_t req;
+  
+	req.type = KMEM_GENERIC;
+    
+	for(x = 0; x < xmax; x++)
+	{
+		req.ptr = matrix[x];
+		kmem_free(&req);
+	}
+  
+	req.ptr = matrix;
+	kmem_free(&req);
+}
+
+struct dqdt_cluster_s * arch_dqdt_make_cluster(struct dqdt_cluster_s ***matrix,
+					       uint_t level,
+					       uint_t x, 
+					       uint_t y)
+{
+	kmem_req_t req;
+	struct cluster_s *cluster;
+	struct dqdt_cluster_s *ptr;
+	struct dqdt_cluster_s *child0;
+	struct dqdt_cluster_s *child1;
+	struct dqdt_cluster_s *child2;
+	struct dqdt_cluster_s *child3;
+	uint_t clstr_x;
+	uint_t clstr_y;
+	uint_t childs_nr;
+	uint_t cores_nr;
+
+	childs_nr = 0;
+	cores_nr  = 0;  
+	child0    = NULL;
+	child1    = NULL;
+	child2    = NULL;
+	child3    = NULL;
+	cluster   = NULL;
+	clstr_x   = x;
+	clstr_y   = y;
+
+	dqdt_dmsg(1, "%s: level %d, x %d, y %d\n", __FUNCTION__, level, x, y);
+
+	if(matrix[x][y]->flags & DQDT_CLUSTER_UP)
+	{
+		child0  = matrix[x][y];
+		cluster = matrix[x][y]->home;
+		clstr_x = x;
+		clstr_y = y;
+		childs_nr ++;
+		cores_nr += child0->cores_nr;
+	}
+
+	if(matrix[x+1][y]->flags & DQDT_CLUSTER_UP) 
+	{
+		child1  = matrix[x+1][y];
+		cluster = matrix[x+1][y]->home;
+		clstr_x = x+1;
+		clstr_y = y;
+		childs_nr ++;
+		cores_nr += child1->cores_nr;
+	}
+   
+	if(matrix[x][y+1]->flags & DQDT_CLUSTER_UP) 
+	{
+		child2  = matrix[x][y+1];
+		cluster = matrix[x][y+1]->home;
+		clstr_x = x;
+		clstr_y = y+1;
+		childs_nr ++;
+		cores_nr += child2->cores_nr;
+	}
+  
+	if(matrix[x+1][y+1]->flags & DQDT_CLUSTER_UP)
+	{
+		child3  = matrix[x+1][y+1];
+		cluster = matrix[x+1][y+1]->home;
+		clstr_x = x+1;
+		clstr_y = y+1;
+		childs_nr ++;
+		cores_nr += child3->cores_nr;
+	}
+  
+	req.type  = KMEM_GENERIC;
+	req.size  = sizeof(*ptr);
+	req.flags = AF_BOOT | AF_REMOTE | AF_ZERO;
+	req.ptr   = (cluster == NULL) ? current_cluster : cluster;
+
+	ptr = kmem_alloc(&req);
+  
+	if(ptr == NULL) 
+		return NULL;
+
+	ptr->level = level;
+	ptr->home  = matrix[clstr_x][clstr_y]->home;
+	ptr->flags = matrix[clstr_x][clstr_y]->flags;
+
+	if(cluster != NULL)
+	{
+		cluster->levels_tbl[level] = ptr;
+
+		ptr->children[0] = child0;
+		ptr->children[1] = child1;
+		ptr->children[2] = child2;
+		ptr->children[3] = child3;
+
+		matrix[x][y]->index     = 0;
+		matrix[x+1][y]->index   = 1;
+		matrix[x][y+1]->index   = 2;
+		matrix[x+1][y+1]->index = 3;
+	}
+
+	if(child0 == NULL)
+	{
+		req.ptr = matrix[x][y];
+		kmem_free(&req);
+	}
+	else
+		child0->parent = ptr;
+  
+	if(child1 == NULL)
+	{
+		req.ptr = matrix[x+1][y];
+		kmem_free(&req);
+	}
+	else
+		child1->parent = ptr;
+
+	if(child2 == NULL)
+	{
+		req.ptr = matrix[x][y+1];
+		kmem_free(&req);
+	}
+	else
+		child2->parent = ptr;
+
+	if(child3 == NULL)
+	{
+		req.ptr = matrix[x+1][y+1];
+		kmem_free(&req);
+	}
+	else
+		child3->parent = ptr;
+
+	ptr->cores_nr  = cores_nr;
+	ptr->childs_nr = childs_nr;
+	
+	dqdt_dmsg(1, "%s: level %d, x %d, y %d, childs_nr %d, cores_nr %d, isUp %s, done\n", 
+		  __FUNCTION__, 
+		  level, 
+		  x, 
+		  y,
+		  cores_nr,
+		  childs_nr,
+		  (cluster == NULL) ? "No" : "Yes");
+
+	return ptr;
+}
+
+error_t arch_dqdt_build(struct boot_info_s *info)
+{
+	struct arch_bib_header_s *header;
+	struct dqdt_cluster_s ***current;
+	struct dqdt_cluster_s ***next;
+	uint_t xmax;
+	uint_t ymax;
+	uint_t level;
+	uint_t x;
+	uint_t y;
+	error_t err;
+
+	header = (struct arch_bib_header_s*) info->arch_info;
+	xmax   = CONFIG_MAX_CLUSTER_ROOT;
+	ymax   = xmax;
+	level  = 1;
+  
+	current = arch_dqdt_alloc_matrix(xmax, ymax);
+
+	if(current == NULL)
+		return -1;
+  
+	err = arch_dqdt_chip_init(current, 
+				  &clusters_tbl[0], 
+				  header->x_max, 
+				  header->y_max);
+  
+	if(err) return err;
+  
+	while(xmax > 2)
+	{
+		dqdt_dmsg(1, "%s: current level %d, current xmax %d\n", 
+			  __FUNCTION__, 
+			  level, 
+			  xmax);
+
+		next = arch_dqdt_alloc_matrix(xmax/2, ymax/2);
+    
+		if(next == NULL)
+			return -xmax;
+    
+		for(x = 0; x < xmax; x += 2)
+		{
+			for(y = 0; y < ymax; y += 2)
+			{
+				next[x/2][y/2] = arch_dqdt_make_cluster(current, level, x, y);
+
+				if(next[x/2][y/2] == NULL)
+					return -xmax;
+			}
+		}
+
+		level ++;
+		arch_dqdt_free_matrix(current, xmax, ymax);
+		current = next;
+		xmax = xmax/2;
+		ymax = ymax/2;
+	}
+
+	dqdt_dmsg(1, "%s: making dqdt_root, level %d\n", __FUNCTION__, level);
+
+	dqdt_root = arch_dqdt_make_cluster(current, level, 0, 0);
+	arch_dqdt_free_matrix(current, xmax, ymax);
+ 
+	return 0;
+}
+
+#endif
Index: trunk/kernel/arch/tsar/arch.h
===================================================================
--- trunk/kernel/arch/tsar/arch.h	(revision 1)
+++ trunk/kernel/arch/tsar/arch.h	(revision 1)
@@ -0,0 +1,130 @@
+/*
+ * arch.h - architecture specific implementation of kernel's HAL
+ * (see kern/hal-arch.h)
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _ARCH_H_
+#define _ARCH_H_
+
+#include <config.h>
+#include <types.h>
+
+#ifndef _HAL_ARCH_H_
+#error arch.h connot be included directly, use system.h instead
+#endif
+
+/* Thread structure size */
+#undef  ARCH_THREAD_PAGE_ORDER
+#define ARCH_THREAD_PAGE_ORDER CONFIG_THREAD_PAGE_ORDER
+
+/* CPUs/CLUSTERs Numbers */
+#define CACHE_LINE_SIZE      CONFIG_CACHE_LINE_SIZE
+
+#undef CLUSTER_NR
+#define CLUSTER_NR           CONFIG_MAX_CLUSTER_NR
+
+#undef DEVICE_NR
+#define DEVICE_NR           CONFIG_MAX_DEVICE_NR
+
+#undef CPU_PER_CLUSTER
+#define CPU_PER_CLUSTER      CONFIG_MAX_CPU_PER_CLUSTER_NR
+
+#undef ARCH_HAS_BARRIERS
+#define ARCH_HAS_BARRIERS    CONFIG_ARCH_HAS_BARRIERS
+
+inline uint32_t arch_onln_cpu_nr();
+inline uint32_t arch_onln_cluster_nr();
+
+/* Timer parameters macros */
+#undef CPU_CLOCK_TICK
+#undef CYCLES_PER_SECOND
+#undef MSEC_PER_TICK
+
+#define CPU_CLOCK_TICK       1000000//80000
+#define MSEC_PER_TICK        1
+#define CYCLES_PER_SECOND    (1000*MSEC_PER_TICK*CPU_CLOCK_TICK)
+
+/* Terminals related macros */
+#define TTY_DEV_NR           CONFIG_TTY_MAX_DEV_NR
+#define TTY_BUFFER_DEPTH     CONFIG_TTY_BUFFER_DEPTH
+
+/* Structures definitions */
+struct irq_action_s;
+struct device_s;
+
+struct arch_cpu_s
+{
+	struct irq_action_s *irq_vector[CONFIG_CPU_IRQ_NR];
+};
+
+
+struct arch_entry_s
+{
+	uint32_t          arch_cid;
+	struct device_s * xicu;
+	struct device_s * dma;
+};
+
+typedef struct arch_entry_s *arch_entry_t;
+	
+extern struct arch_entry_s arch_entrys[CLUSTER_NR];
+
+
+static inline uint32_t arch_cpu_gid(uint32_t cid, uint32_t lid)
+{
+	return (cid * arch_cpu_per_cluster()) + lid;
+}
+
+static inline uint32_t arch_cpu_lid(uint32_t cpu_gid)
+{
+	return (cpu_gid % arch_cpu_per_cluster());
+}
+
+static inline uint32_t arch_cpu_cid(uint32_t cpu_gid)
+{
+	return (cpu_gid / arch_cpu_per_cluster());
+}
+
+static inline arch_entry_t get_arch_entry(uint32_t cid)
+{
+	return &arch_entrys[cid];
+}
+
+static inline uint32_t arch_clst_arch_cid(cid_t cid)
+{
+	//assert(cid <= arch_onln_cluster_nr());
+	if((cid > CLUSTER_NR) || (get_arch_entry(cid)->arch_cid == 0x55555555))
+	{
+			cid = *((cid_t*)0x55555555);
+			while(1);
+	}
+	return get_arch_entry(cid)->arch_cid;
+}
+
+
+extern cid_t Arch_cid_To_Almos_cid[CLUSTER_NR]; 
+static inline cid_t arch_clst_cid(uint32_t arch_cid)
+{
+	//assert(cid <= arch_onln_cluster_nr());
+	return Arch_cid_To_Almos_cid[arch_cid];
+}
+
+#endif	/* _ARCH_H_ */
Index: trunk/kernel/arch/tsar/arch_init.c
===================================================================
--- trunk/kernel/arch/tsar/arch_init.c	(revision 1)
+++ trunk/kernel/arch/tsar/arch_init.c	(revision 1)
@@ -0,0 +1,616 @@
+/*
+ * hal_devices_init.c - Devices intialization operations for the TSAR architecture
+ *
+ * Authors Ghassan Almaless (2008,2009,2010,2011,2012)
+ *         Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner (2016)
+
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <types.h>
+#include <list.h>
+#include <bits.h>
+#include <cpu.h>
+#include <system.h>
+#include <cluster.h>
+#include <device.h>
+#include <driver.h>
+#include <thread.h>
+#include <process.h>
+#include <kmem.h>
+#include <ppm.h>
+#include <pmm.h>
+#include <page.h>
+#include <kdmsg.h>
+#include <devfs.h>
+#include <drvdb.h>
+#include <boot-info.h>
+#include <soclib_xicu.h>
+#include <soclib_iopic.h>
+#define _ARCH_BIB_SIGNATURE_
+#include <arch-bib.h>
+
+#define die(args...) do {boot_dmsg(args); while(1);} while(0)
+
+#define ICU_MASK     0xFFFFFFFF  // interrupt enabled for first 32 devices 
+#define KATTR     (PMM_HUGE | PMM_READ | PMM_WRITE | PMM_EXECUTE | PMM_CACHED | PMM_GLOBAL | PMM_DIRTY | PMM_ACCESSED)
+#define KDEV_ATTR (PMM_READ | PMM_WRITE | PMM_GLOBAL | PMM_DIRTY | PMM_ACCESSED)
+
+
+/*********************************************************************************************
+ * This function set the various masks for the XCU device in the local cluster. 
+ * It should be executed by core[0] after the local cluster manager initialisation,
+ * and after devices initialisation. The général policy is the following:
+ * - PTI : it routes one PTI per core (with index = lid) for TICK.
+ * - WTI : it routes one WTI per core (with index = lid) for wakup.
+ * - HWI : it routes all local HWI to core[0].
+ ********************************************************************************************/
+void hal_xcu_set_mask()
+{
+    uint32_t       lid;
+	cluster_t    * cluster;    // pointer on local cluster manager
+	uint32_t       cores;      // number of cores in cluster
+    device_t     * xcu;        // pointer on local XCU device descriptor	
+    uint32_t       hwi_mask;   // HWI mask for XCU
+    uint32_t       hwi_index;  // HWI index in XCU
+    list_entry_t * iter;       // iterator to scan the device list
+    device_t     * dev;        // pointer on local device descriptor
+    dev_type_t     type;       // device type        
+
+	cluster   = LOCAL_CLUSTER;
+	cores     = cluster->cores_nr;
+    xcu       = cluster->xcu;	
+
+    // loop on all local devices to compute the hwi_mask 
+    hwi_mask  = 0;
+    hwi_index = 0;
+    LIST_FOREACH( cluster->devlist , iter )
+    {
+        dev  = LIST_ELEMENT( iter , device_t , list );
+        type = dev->type;
+
+        // only replicated devices MMC and MWR generate HWI
+        if( (type == DEV_TYPE_MMC) || (type == DEV_TYPE_MWR) )
+        {
+            hwi_mask = hwi_mask |= (1<<hwi_index);
+            hwi_index++;
+        }
+    }
+
+    // set the  three XCU masks
+	for( lid = 0 ; lid < cores ; lid++ )
+	{
+        xcu_set_mask( xcu , (1<<lid) , XCU_PTI_TYPE , lid ); 
+        xcu_set_mask( xcu , (1<<lid) , XCU_WTI_TYPE , lid ); 
+        if( lid == 0 )
+        {
+            xcu_set_mask( xcu , hwi_mask , XCU_HWI_TYPE , lid ); 
+        }
+    }
+}  // end hal_xcu_set_mask()
+
+
+/*********************************************************************************************
+ * This function returns a pointer on a cluster descriptor from the drvid. 
+ ********************************************************************************************/
+device_t * hal_dev_locate( list_entry_t * devlist_root,
+                           uint32_t      drvid )
+{
+	struct list_entry *iter;
+	struct device_s *dev;
+  
+	list_foreach(devlist_root, iter)
+	{
+		dev = list_element(iter, struct device_s, list);
+		if(dev->op.drvid == drvid)
+			return dev;
+	}
+  
+	return NULL;
+}
+
+/*********************************************************************************************
+ * This function register all detected devices in given cluster.
+ ********************************************************************************************/
+void hal_dev_register( cluster_t       * cluster, 
+			           cluster_entry_s * entry )
+{
+	device_t     * xicu;
+	list_entry_t * iter;
+	device_t     * dev;
+    cpu_t        * cpu_ptr;
+	uint32_t       cpu;
+	error_t        err;
+
+	xicu = hal_dev_locate(&entry->devlist, SOCLIB_XICU_ID);
+	dev  = hal_dev_locate(&entry->devlist, SOCLIB_DMA_ID);
+
+	hal_entrys[entry->cxy].xicu = xicu;
+	hal_entrys[entry->cxy].dma  = dev;
+  
+	if((cluster->id == entry->cxy) && (xicu == NULL))
+		die("[ERROR]\tNo XICU is found for cluster %d\n", entry->cxy);
+		
+	//only local cluster get to set the irq
+	if(cluster->id != entry->cxy)
+		return;
+
+	list_foreach((&entry->devlist), iter)
+	{
+		dev = list_element(iter, struct device_s, list);	
+
+		if((dev != xicu) && (dev->irq != -1))
+		{
+			err = xicu->op.icu.bind(xicu, dev);
+      
+			if(err) 
+				die("[ERROR]\tFailed to bind device %s, irq %d, on xicu %s @%x [ err %d ]\n",
+				    dev->name, dev->irq, xicu->name, xicu, err);
+		}
+
+	}
+		
+	if(cluster->id != entry->cxy)
+		return;
+
+	hal_xicu_set_mask(cluster, xicu);
+
+	for(cpu = 0; cpu < cluster->cpu_nr; cpu++)
+	{
+		cpu_ptr = &cluster->cpu_tbl[cpu];
+		hal_cpu_set_irq_entry(cpu_ptr, 0, &xicu->action);
+	}
+}  // end hal_dev_register()
+
+//////////////////////////////////////////////////
+void hal_dev_iopic_register( cluster_t * cluster, 
+			struct cluster_entry_s *entry);
+
+/** HAL-ARCH CPUs & Clusters counters */
+static global_t hal_onln_cpus_nr;
+static global_t hal_cpus_per_cluster;
+static global_t hal_onln_clusters_nr;
+static global_t hal_boot_cxy_;
+
+/**/
+struct hal_entry_s hal_entrys[CLUSTER_NR];
+global_t __current_cxy;
+
+/** Return Platform CPUs Online Number */
+inline uint32_t hal_onln_cpu_nr(void)
+{
+	return hal_onln_cpus_nr.value;
+}
+
+/** Return Platform Clsuters Online Number */
+inline uint32_t hal_onln_cluster_nr(void)
+{
+	return hal_onln_clusters_nr.value;
+}
+
+inline uint32_t hal_cpu_per_cluster(void)
+{
+	return hal_cpus_per_cluster.value;
+}
+
+inline cxy_t hal_boot_cxy(void)
+{
+	return hal_boot_cxy_.value;
+}
+
+extern uint32_t cpu_gid_tbl[CPU_PER_CLUSTER] CACHELINE;
+
+inline void cpu_gid_tbl_init(struct boot_info_s *info)
+{
+	uint32_t i;
+	uint32_t cpu_nr;
+
+	cpu_nr = info->local_onln_cpu_nr;
+
+	if(CPU_PER_CLUSTER < cpu_nr)
+		while(1);//die("ERROR: This Kernel Is Compiled For only %d cpus per cluster\n", CPU_PER_CLUSTER);
+
+	for(i=0; i < cpu_nr; i++)
+		cpu_gid_tbl[i] = hal_cpu_gid(info->local_cluster_id, i); 
+}
+
+cxy_t Arch_cxy_To_Almos_cxy[CLUSTER_NR]; //address of info->hal_cxy_to_cxy array
+
+static void fill_hal_cxy_to_almos_array(struct hal_bib_header_s *header)
+{
+	int i;
+	cluster_info_t *cluster_tbl;
+
+	cluster_tbl = (cluster_info_t*)((uint32_t)header + sizeof(header_info_t));
+	assert(CLUSTER_NR >= header->onln_clstr_nr);
+
+	for(i = 0; i < header->onln_clstr_nr; i++)
+	{
+		if(cluster_tbl[i].hal_cxy >= CLUSTER_NR)
+			continue;
+		Arch_cxy_To_Almos_cxy[cluster_tbl[i].hal_cxy] = cluster_tbl[i].cxy;
+
+	}
+}
+
+/*********************************************************************************************
+ * This function makes the kernel virtual mapping of all hardware memory banks.
+ * Initialize the boot table entries.
+ ********************************************************************************************/
+void hal_state_init( boot_info_t * info )
+{
+	struct process_s *process;
+	struct thread_s *this;
+	header_info_t *header;
+	cluster_info_t *clusters;
+	cluster_info_t *cluster_ptr;
+	dev_info_t *dev_tbl;
+	uint32_t vaddr_start;
+	uint32_t vaddr_limit;
+	uint32_t size;
+	uint32_t cxy;
+	uint32_t i;
+	
+	header = (header_info_t*) info->hal_info;
+	
+
+	clusters        = (cluster_info_t*) ((uint32_t)header + sizeof(header_info_t));
+	cluster_ptr     = &clusters[info->local_cluster_id];
+	dev_tbl		= (dev_info_t*)(cluster_ptr->offset + (uint32_t)header);
+	cxy             = cluster_ptr->cxy;
+
+	/* Global variables init */
+	hal_onln_clusters_nr.value = header->onln_clstr_nr;
+	hal_onln_cpus_nr.value     = header->onln_cpu_nr;
+	hal_cpus_per_cluster.value = header->cpu_nr;
+	hal_boot_cxy_.value	    = info->boot_cluster_id;
+	__current_cxy.value = cxy;
+	fill_hal_cxy_to_almos_array(header);
+
+	//used by remote_sb->hal_cxy_...
+	for(i = 0; i < info->onln_clstr_nr; i++)
+	{
+		cluster_ptr = &clusters[i];
+		cxy = cluster_ptr->cxy;
+		hal_entrys[cxy].hal_cxy = cluster_ptr->hal_cxy;
+	}
+
+	cpu_gid_tbl_init(info);
+	kboot_tty_init(info);
+
+	size = dev_tbl[0].size;
+
+	if(size == 0)
+                die("[ERROR]\t%s: Unexpected memory size for cluster %u\n",             \
+                                __FUNCTION__, cxy);
+
+	this                         = CURRENT_THREAD;
+	process                         = this->process;
+
+	/* TODO: deal with offline clusters as well */
+	for(i = 0; i < info->onln_clstr_nr; i++)
+	{
+		cluster_ptr = &clusters[i];
+		cxy = cluster_ptr->cxy;
+   
+		if(cxy >= CLUSTER_NR)
+		{
+			die("\n[ERROR]\t%s: This kernel version support up to %d clusters, found %d\n",         \
+                                        __FUNCTION__, CLUSTER_NR, cxy);
+		}
+
+		dev_tbl = (dev_info_t*)(cluster_ptr->offset + (uint32_t)header);
+		if(dev_tbl[0].id == SOCLIB_RAM_ID)
+		{
+			vaddr_start	= dev_tbl[0].base;
+			size		= dev_tbl[0].size;
+		}else
+		{
+			vaddr_start = 0;
+			size = 0;
+		}
+
+		if((cluster_ptr->cpu_nr != 0) && (size == 0))
+			die("\n[ERROR]\t%s: This Kernel Version Do Not Support CPU-Only Clusters, cxy %d\n",    \
+                                        __FUNCTION__, cxy);
+
+		vaddr_limit          = vaddr_start + size;
+
+		if(cxy == info->local_cluster_id)
+		{
+			process->vmm.limit_addr         = vaddr_limit; 
+		}
+
+
+                boot_dmsg("[INFO]\tHardware initialization of cluster %u\t\t\t\t[ %d ]\n",          \
+                                cxy, cpu_time_stamp());
+
+		cluster_entry_init(cxy, vaddr_start, size);
+	}
+}
+
+/*********************************************************************************************
+ * This function makes the architecture specific initialisation.
+ * It makes the local cluster initialisation, dynamically detects the cluster devices,
+ * and associates the appropriate drivers.
+ ********************************************************************************************/
+void hal_init( boot_info_t * info )
+{
+	cluster_t      * cluster;
+	header_info_t  * header;
+	cluster_info_t * clusters;
+	cluster_info_t * cluster_ptr;
+	dev_info_t     * dev_tbl;
+	cxy_t            iopic_cxy;     // should be the IO_cluster
+	bool_t           iopic_found;
+	error_t          error;
+	uint32_t         rcxy;
+	cxy_t            cxy;
+	uint32_t         i;
+  
+/* Local variables init 
+	header = (header_info_t *)info->hal_info;
+
+	if( strncmp( header->signature , hal_bib_signature , 16 ) )
+    {
+		while(1);			// TODO no TTY yet ??? [AG]
+    }
+	if( strncmp( header->arch , "TSAR" , 16))
+    {
+		while(1);           // TODO no TTY yet ??? [AG]
+    }
+*/
+	iopic_found = false;
+	iopic_cxy   = 0;
+	clusters    = (cluster_info_t*)((uint32_t)header + sizeof(header_info_t));
+	cluster_ptr = &clusters[info->local_cluster_id];
+	dev_tbl     = (dev_info_t*)(cluster_ptr->offset + (uint32_t)header);
+	cxy         = cluster_ptr->cxy;
+
+	hal_state_init(info);
+
+	/* init cluster: also init current_{cxy, cluster} macros */
+	error = cluster_init(info, 
+			   dev_tbl[0].base, 
+			   dev_tbl[0].base + dev_tbl[0].size,
+			   clusters_tbl[cxy].vmem_start);
+	
+	if(err)
+                die("ERROR: Failed To Initialize Cluster %d, Err %d\n", cxy, err);
+
+	cluster           = current_cluster;
+	//TODO: move it to cluster.c
+	//!!! THis value include the io_cluster !
+	cluster->clstr_nr = info->onln_clstr_nr; // TODO: headr->x_max * header->y_max;
+  
+	for(i = 0; i < info->onln_clstr_nr; i++)
+	{
+		cluster_ptr = &clusters[i];
+
+		dev_tbl     = (dev_info_t*)(cluster_ptr->offset + (uint32_t)header);
+
+		rcxy = cluster_ptr->cxy;
+
+		boot_dmsg("\n[INFO]\tDevices initialization for cluster %d\t\t\t\t[ %d ]\n",    \
+                                rcxy, cpu_time_stamp());
+
+		if(hal_dev_init(cluster, &clusters_tbl[rcxy], dev_tbl, cluster_ptr))
+		{
+			iopic = true;
+			iopic_cxy = rcxy;
+		}
+	}
+
+	if(iopic) //&& (cluster->io_clstr == cluster->id)) // Now it's dynamique
+		hal_dev_iopic_register(cluster, &clusters_tbl[iopic_cxy]);
+
+}  // end hal_init()
+
+
+/*********************************************************************************************
+ * This function initialises all devices descriptors associated to peripherals
+ * contained in the local cluster, as specified by the boot_info structure.
+ *********************************************************************************************
+ * @ info    : pointer on the local boot-info structure.
+ * @ returns 0 if success / returns ENOMEM or EINVAL if error
+ ********************************************************************************************/
+error_t hal_devices_init( boot_info_t * info )
+{
+	drvdb_entry_t * entry;
+	list_entry_t  * devlist;	
+
+    boot_device_t * dev_tbl;         // pointer on array of devices in boot_info
+	uint32_t        dev_nr;          // actual number of devices in this cluster
+    cluster_t     * cluster;         // pointer on local cluster manager
+	cxy_t           local_cxy;       // local cluster identifier
+    cxy-t           target_cxy;      // target cluster identifier
+	device_t      * device;          // pointer on current device descriptor
+	xptr_t          base;            // remote pointer on segment base
+	uint32_t        size;            // segment size (bytes)
+    dev_type_t      type;            // device type
+
+	uint32_t        i;
+	bool_t          pic_found;
+	driver_t      * driver;
+	error_t         error;
+  
+    // get local cluster pointer and identifier
+    cluster = LOCAL_CLUSTER;
+    cxy     = cluster->cxy;
+
+    // get number of peripherals
+	dev_nr	    = info->devices_nr;
+    dev_tbl     = info->dev;
+
+    // loop on all peripherals in cluster
+	for( i = 0 ; i < dev_nr ; i++ )
+	{
+        type = dev_tbl[i].type;
+
+        // skip RAM and ROM
+	   	if( (type == DEV_TYPE_RAM) || (type == DEV_TYPE_ROM) ) continue;
+
+        // test PIC
+	   	if( dev_tbl[i].type == DEV_TYPE_PIC )  pic_found = true;
+
+        // replicated
+        if( (type == DEV_TYPE_XCU ) || (type == DEV_TYPE_MMC) || (type == DEV_TYPE_MWR) )
+        {
+		    device = device_alloc( local);
+		    if( device == NULL )
+            {
+			    printk(PANIC,"%s failed to allocate device descriptor in cluster %x\n",
+                   __FUNCTION__ , cxy );
+                return ENOMEM;
+            }
+        }
+        else
+        {
+
+		driver		= drvdb_entry_get_driver(entry);
+
+        // initialise device descriptor from boot_info
+		spinlock_init( &device->lock );
+
+        device->type    = dev_tbl[i].type;
+		device->base	= dev_tbl[i].base; 
+        device->size    = dev_tbl[i].size;
+		device->isr	    = dev_tbl[i].irq;
+
+		error = driver->init( dev );
+
+		if( error )
+        {
+			die("[ERROR]\tFailed To Initialize Device %s [Cluster %d, Dev %d, Err %d]\n",       
+			    drvdb_entry_get_name(entry), rcxy, i, err);
+        }
+
+		devfs_register( dev );
+		list_add_last( devlist , &dev->list);
+
+		boot_dmsg("[INFO]\tFound Device: %s\t\t\t\t\t\t[ %d ]\n[INFO]\t\tBase <0x%x> cxy %d Size <0x%x> Irq <%d>\t\t[ %d ]\n", \
+			  drvdb_entry_get_name(entry), cpu_time_stamp(), (uint32_t)dev_base,           \
+			  rcxy, dev_tbl[i].size, dev_tbl[i].irq, cpu_time_stamp());
+	} // end loop on peripherals
+
+	// register device descriptor in global list ???	
+	hal_dev_register( cluster , centry );  // TODO ???
+
+	return iopic_clstr;
+
+}  // end hal_devices_init()
+
+
+
+/*********************************************************************************************
+ ********************************************************************************************/
+void hal_xicu_set_wti(struct device_s *xicu, 
+			uint32_t cpu_inter, uint32_t wti_index, 
+			struct irq_action_s *action, 
+			struct device_s *dev)
+{
+	uint64_t mailbox;
+	uint32_t irq_out;
+	error_t err;
+
+	mailbox = xicu->base_paddr + (wti_index << 2);
+	irq_out = cpu_inter*OUTPUT_IRQ_PER_PROC;
+
+
+	xicu->op.icu.set_mask(xicu,
+				(1 << wti_index),
+				XICU_MSK_WTI_ENABLE,
+				irq_out);
+
+	boot_dmsg("[INFO]\t\t WTI %d <-> CPU %d (mailbox 0x%x%x)\t\t\t[ %d ]\n",        \
+                        wti_index, cpu_inter, MSB(mailbox), LSB(mailbox),               \
+                        cpu_time_stamp());
+
+	err = xicu->op.icu.bind_wti(xicu, action, wti_index);
+
+	  
+	if(err != 0) 
+		die("[ERROR]\tFailed to bind %s via wti_mailbox 0x%x:%x , on xicu %s @%x [ err %d ]\n", \
+			dev ? dev->name : "IPI", MSB(mailbox),LSB(mailbox), xicu->name, xicu, err); 
+	  
+	if(dev)
+                dev->mailbox = mailbox;
+	//The binding is (to be) done dynamically in the peripheral
+	//iopic->op.iopic.bind_wti_and_irq(iopic, mailbox, dev->irq);
+			
+}
+
+//TODO: distibute iopic devices on multiple cluster ?
+//For now all the devices of the IOPIC_Cluster (cluster 
+//without cpus) and there IRQs are handled by the IO_Cluster.
+void hal_dev_iopic_register(struct cluster_s *cluster, 
+			struct cluster_entry_s *entry)
+{
+	struct list_entry *iter;
+	struct device_s *iopic;
+	struct device_s *xicu;
+	struct device_s *dev;
+	uint32_t device_index;
+	uint32_t wti_index;
+	uint32_t cpu_inter;
+	uint32_t cpu_nr;
+	//error_t err;
+
+	cpu_inter = 0;
+	device_index = 0;
+	cpu_nr = cluster->cpu_nr;
+	wti_index = cpu_nr;//Leave one WTI per proc for IPI
+
+	xicu = hal_entrys[cluster->id].xicu;
+	iopic = hal_dev_locate(&entry->devlist, SOCLIB_IOPIC_ID);
+
+	if(xicu == NULL)
+                die("[ERROR]\tNo XICU Is Found for IOPIC cluster %d\n",                         \
+                                entry->cxy);
+
+        boot_dmsg("\n[INFO]\tIOPIC cluster configuration: cxy %d <0x%x,0x%x>\t[ %d ]\n",      \
+                        entry->cxy, iopic->base, (iopic->base+iopic->size), cpu_time_stamp());
+
+	list_foreach(&entry->devlist, iter)
+	{
+		dev = list_element(iter, struct device_s, list);
+
+		if(wti_index > (IOPIC_WTI_PER_CLSTR - cpu_nr))
+			die("[ERROR]\tNo enough WTI in cluster %d\n", cluster->id);
+		
+			
+		if((dev != iopic) && (dev->irq != -1))
+		{
+			boot_dmsg("[INFO]\tLinking device %s to XICU on cluster %d through IOPIC cluster\t[ %d ]\n",  \
+                                        dev->name, xicu->cxy, cpu_time_stamp());
+
+			hal_xicu_set_wti(xicu, device_index%cpu_nr, wti_index, &dev->action, dev);
+
+			dev->iopic = iopic;
+
+			wti_index++;
+			device_index++;
+		}
+
+		devfs_register(dev);
+	}
+} // end hal_xcu_set_wti()
+
+
Index: trunk/kernel/arch/tsar/kdmsg.c
===================================================================
--- trunk/kernel/arch/tsar/kdmsg.c	(revision 1)
+++ trunk/kernel/arch/tsar/kdmsg.c	(revision 1)
@@ -0,0 +1,193 @@
+/*
+ * kdmsg.c - output kernel debug/trace/information to an available terminal
+ * (see kern/kdmsg.h)
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <cpu.h>
+#include <device.h>
+#include <soclib_tty.h>
+#include <arch-config.h>
+#include <spinlock.h>
+#include <distlock.h>
+#include <mcs_sync.h>
+#include <libk.h>
+#include <kdmsg.h>
+
+#define MSB(paddr) ((uint_t)((paddr)>>32))
+#define LSB(paddr) ((uint_t)(paddr))
+
+//spinlock_t printk_lock;
+DISTLOCK_DECLARE(printk_lock);
+//spinlock_t isr_lock;
+DISTLOCK_DECLARE(isr_lock);
+
+DISTLOCK_DECLARE(boot_lock);
+
+kdmsg_channel_t klog_tty = {{.id = 1}};
+kdmsg_channel_t kisr_tty = {{.id = 1}};
+kdmsg_channel_t kexcept_tty = {{.id = 1}};
+
+void kdmsg_init()
+{
+	uint_t tty_count;
+  
+	tty_count = 0;
+	while((tty_count < TTY_DEV_NR) && (ttys_tbl[tty_count++] != NULL));
+  
+	if(tty_count >= 3)
+	{
+		kisr_tty.id = 3;
+		kexcept_tty.id = 3;
+	}
+	
+}
+
+uint_t boot_cluster;
+uint_t kboot_tty_cid;
+uint_t kboot_tty_base;
+
+void kboot_tty_init(boot_info_t *info)
+{
+	kboot_tty_base  = info->tty_base;
+
+	kboot_tty_cid   = info->tty_cid;
+
+	boot_cluster	= info->boot_cluster_id;
+}
+
+//TODO ?
+int early_boot_dmsg (const char *fmt, ...)
+{
+	va_list ap;
+	int count;
+
+	//if(current_cluster->cid != boot_cluster) 
+	//	return 0;
+
+	va_start (ap, fmt);
+
+	count = iprintk ((char*)kboot_tty_base, kboot_tty_cid, 0, (char *) fmt, ap);
+
+	va_end (ap);
+	
+	return count;
+}
+
+int __arch_boot_dmsg (const char *fmt, ...)
+{
+	va_list ap;
+	int count;
+
+
+	va_start (ap, fmt);
+		
+	distlock_lock(&boot_lock);
+
+	count = iprintk ((char*)kboot_tty_base, kboot_tty_cid, 0, (char *) fmt, ap);
+
+	distlock_unlock(&boot_lock);
+
+	va_end (ap);
+
+	return count;
+}
+
+int __fprintk (int tty, ktty_lock_t ktty, const char *fmt, ...)
+{
+	va_list ap;
+	int count;
+	//uint_t irq_state;
+	distlock_t *lock;
+
+	va_start (ap, fmt);
+
+	switch(ktty)
+	{
+		case PRINTK_KTTY_LOCK:
+			lock = &printk_lock;
+			break;
+		case ISR_KTTY_LOCK:
+			lock = &isr_lock;
+			break;
+		default:
+		case NO_KTTY_LOCK:
+			lock = NULL;
+			break;
+	}
+
+	if(lock)
+	{
+		distlock_lock(lock);
+	}
+  
+	count = iprintk ((char*)(ttys_tbl[tty]->base + TTY_WRITE_REG), 
+			ttys_tbl[tty]->cid, 0, (char *) fmt, ap);
+   
+	if(lock)
+	{
+		distlock_unlock(lock);
+	}
+
+	va_end (ap);
+
+	return count;
+}
+
+#include <thread.h>
+
+int __perror (int fatal, const char *fmt, ...)
+{
+	va_list ap;
+	int count;
+
+	va_start (ap, fmt);
+	count = iprintk ((char*)(ttys_tbl[kexcept_tty.id]->base + TTY_WRITE_REG), 
+				ttys_tbl[kexcept_tty.id]->cid, 
+				0, (char *) fmt, ap);
+
+	va_end (ap);
+   
+	if(fatal) while(1);
+	return count;
+}
+
+#if 0
+//FIXME add 40 bits support
+void bdump(uint8_t *buff, size_t count)
+{
+	uint8_t b1, b2;
+	char *tab = "0123456789ABCDEF";
+
+	spinlock_lock(&ttys_tbl[klog_tty.id]->lock);
+
+	while(count--) 
+	{
+		b1 = tab[(*buff & 0xF0)>>4];
+		b2 = tab[*buff & 0x0F];
+		buff++;
+		*(char*)(ttys_tbl[klog_tty.id]->base + TTY_WRITE_REG) = b1;
+		*(char*)(ttys_tbl[klog_tty.id]->base + TTY_WRITE_REG) = b2;
+	}
+	*(char*)(ttys_tbl[klog_tty.id]->base + TTY_WRITE_REG) = '\n';
+	spinlock_unlock (&ttys_tbl[klog_tty.id]->lock);
+}
+#endif
Index: trunk/kernel/arch/tsar/kldscript.h
===================================================================
--- trunk/kernel/arch/tsar/kldscript.h	(revision 1)
+++ trunk/kernel/arch/tsar/kldscript.h	(revision 1)
@@ -0,0 +1,56 @@
+/*
+ * kldscript.h - kernel ldscript
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define _CONFIG_H_
+#include "arch-config.h"
+
+vaddr = CONFIG_KERNEL_OFFSET;
+
+SECTIONS
+{
+  .ktext vaddr : {
+    __ktext_start = .;
+    *(.kentry)
+    __kentry_end = .;
+    __uspace_start = .;
+    *(.uspace)
+    __uspace_end   = .;
+    __virtual_end  = .;
+      *(.text) 
+      *(.rodata*) 
+      . = ALIGN(0x1000); 
+    __ktext_end = .;
+  }
+
+  .kdata : {
+    __kdata_start = .;
+    *(.data*) 
+      *(.bss*) 
+      *(COMMON*) 
+      *(.scommon*) 
+      . = ALIGN(0x1000); 
+    __kdata_end = .;
+    __heap_start = .;
+    *(.kheader)//this will be overwriten by the heap manager
+  }
+}
+
Index: trunk/kernel/arch/tsar/mmu-info.c
===================================================================
--- trunk/kernel/arch/tsar/mmu-info.c	(revision 1)
+++ trunk/kernel/arch/tsar/mmu-info.c	(revision 1)
@@ -0,0 +1,63 @@
+/*
+ * mmu-info.c - TSAR MMU exceptions related informations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#define _USE_MMU_INFO_H_
+#include <mmu-info.h>
+#include <bits.h>
+
+#define MMU_UNKNOWN_ERR  0x0000
+
+static mmu_except_info_t mmu_except_db[] = 
+{{0x0001, "MMU_WRITE_PT1_UNMAPPED", "Write access : Page fault on Table 1 (invalid PTE)", "Non Fatal Error"},
+ {0x0002, "MMU_WRITE_PT2_UNMAPPED", "Write access : Page fault on Table 2 (invalid PTE)", "Non Fatal Error"},
+ {0x0004, "MMU_WRITE_PRIVILEGE_VIOLATION", "Write access : Protected access in user mode", "User Error"},
+ {0x0008, "MMU_WRITE_ACCES_VIOLATION","Write access : Write to a non writable page", "User error"},
+ {0x0020, "MMU_WRITE_UNDEFINED_XTN","Write access : Undefined external access address","User error"},
+ {0x0040, "MMU_WRITE_PT1_ILLEGAL_ACCESS","Write access : Bus Error in Table1 access","Kernel error"},
+ {0x0080, "MMU_WRITE_PT2_ILLEGAL_ACCESS","Write access : Bus Error in Table2 access","Kernel error"},
+ {0x0100, "MMU_WRITE_DATA_ILLEGAL_ACCESS","Write access : Bus Error during the cache access","Kernel error"},
+ {0x1001, "MMU_READ_PT1_UNMAPPED","Read access : Page fault on Table1 (invalid PTE)","non fatal error"},
+ {0x1002, "MMU_READ_PT2_UNMAPPED","Read access : Page fault on Table 2 (invalid PTE)","non fatal error"},
+ {0x1004, "MMU_READ_PRIVILEGE_VIOLATION","Read access : Protected access in user mode","User error"},
+ {0x1010, "MMU_READ_EXEC_VIOLATION","Read access : Exec access to a non exec page","User error"},
+ {0x1020, "MMU_READ_UNDEFINED_XTN","Read access : Undefined external access address","User error"},
+ {0x1040, "MMU_READ_PT1_ILLEGAL_ACCESS","Read access : Bus Error in Table1 access","Kernel error"},
+ {0x1080, "MMU_READ_PT2_ILLEGAL_ACCESS","Read access : Bus Error in Table2 access","Kernel error"},
+ {0x1100, "MMU_READ_DATA_ILLEGAL_ACCESS","Read access : Bus Error during the cache access","Kernel error"},
+ {MMU_UNKNOWN_ERR, "UNKNOWN", "Exception Detected but no MMU Error code has been found", "Disfunction of MMU's Error Report"}}; 
+
+
+
+inline mmu_except_info_t* mmu_except_get_entry(uint_t mmu_err_val)
+{
+	uint_t entry = 0;
+
+	while(mmu_except_db[entry].err != MMU_UNKNOWN_ERR)
+	{
+		if(mmu_except_db[entry].err == mmu_err_val)
+			break;
+
+		entry ++;
+	}
+  
+	return &mmu_except_db[entry];
+}
Index: trunk/kernel/arch/tsar/mmu-info.h
===================================================================
--- trunk/kernel/arch/tsar/mmu-info.h	(revision 1)
+++ trunk/kernel/arch/tsar/mmu-info.h	(revision 1)
@@ -0,0 +1,70 @@
+/*
+ * mmu-info.h - TSAR MMU registers & exceptions related informations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _MMU_INFO_H_
+#define _MMU_INFO_H_
+
+#ifndef _USE_MMU_INFO_H_
+#error This file must not be used directly
+#endif
+
+/* MMU Registers Interface */
+#define MMU_PTPR 	        0 	/* Page Table Pointer Register 	              R/W  */
+#define MMU_MODE 	        1 	/* Mode Register 	                      R/W  */
+#define MMU_ICACHE_FLUSH 	2 	/* Instruction Cache flush 	              W    */
+#define MMU_DCACHE_FLUSH 	3 	/* Data Cache flush 	                      W    */
+#define MMU_ITLB_INVAL 	        4 	/* Instruction TLB line invalidation 	      W    */
+#define MMU_DTLB_INVAL        	5 	/* Data TLB line Invalidation 	              W    */
+#define MMU_ICACHE_INVAL 	6 	/* Instruction Cache line invalidation 	      W    */
+#define MMU_DCACHE_INVAL 	7 	/* Data Cache line invalidation 	      W    */
+#define MMU_ICACHE_PREFETCH 	8 	/* Instruction Cache line prefetch 	      W    */
+#define MMU_DCACHE_PREFETCH 	9 	/* Data Cache line prefetch 	              W    */
+#define MMU_SYNC 	        10 	/* Complete pending writes 	              W    */
+#define MMU_IETR 	        11 	/* Instruction Exception Type Register 	      R    */
+#define MMU_DETR 	        12 	/* Data Exception Type Register 	      R    */
+#define MMU_IBVAR 	        13 	/* Instruction Bad Virtual Address Register   R    */
+#define MMU_DBVAR 	        14 	/* Data Bad Virtual Address Register 	      R    */
+#define MMU_PARAMS 	        15 	/* Caches & TLBs hardware parameters 	      R    */
+#define MMU_RELEASE 	        16 	/* Generic MMU release number 	              R    */
+#define MMU_WORD_LO 	        17 	/* Lowest part of a double word 	      R/W  */
+#define MMU_WORD_HI 	        18 	/* Highest part of a double word 	      R/W  */
+#define MMU_ICACHE_PA_INV 	19 	/* Instruction cache inval physical adressing W    */
+#define MMU_DCACHE_PA_INV 	20 	/* Data cache inval physical addressing       W    */
+#define MMU_DOUBLE_LL 	        21 	/* Double word linked load 	              W    */
+#define MMU_DOUBLE_SC 	        22 	/* Double word store conditional 	      W    */ 
+
+#include <types.h>
+
+/* MMU Exception Descriptor */
+struct mmu_except_info_s
+{
+	uint_t err;
+	char *name;
+	char *info;
+	char *severty;
+};
+
+typedef struct mmu_except_info_s mmu_except_info_t;
+
+inline mmu_except_info_t* mmu_except_get_entry(uint_t mmu_err_val);
+
+#endif	/* _MMU_INFO_H_ */
Index: trunk/kernel/arch/tsar/rt_timer.c
===================================================================
--- trunk/kernel/arch/tsar/rt_timer.c	(revision 1)
+++ trunk/kernel/arch/tsar/rt_timer.c	(revision 1)
@@ -0,0 +1,61 @@
+/*
+ * rt_timer.c - real-time timer related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <errno.h>
+#include <rt_timer.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
+
+struct device_s rt_timer;
+
+/** Initialize Real-Time timer source */
+error_t rt_timer_init(uint_t period, uint_t withIrq)
+{
+	return 0;
+}
+
+/** Read Real-Time timer current value  */
+error_t rt_timer_read(uint_t *time)
+{
+	*time = cpu_time_stamp();
+	return 0;
+}
+
+/** Set Real-Time timer's current value */
+error_t rt_timer_set(uint_t time)
+{
+	return ENOSYS;
+}
+
+/** Set Real-Time timer's period */
+error_t rt_timer_setperiod(uint_t period)
+{
+	return ENOSYS;
+}
+
+/** Send commands to Real-Time timer device */
+error_t rt_timer_ctrl(struct rt_params_s *param)
+{
+	return ENOSYS;
+}
Index: trunk/kernel/devices/:w
===================================================================
--- trunk/kernel/devices/:w	(revision 1)
+++ trunk/kernel/devices/:w	(revision 1)
@@ -0,0 +1,109 @@
+/*
+ * dev_iox.h - IOX (bridge to external I/O) generic device API.
+ *
+ * Authors   Alain Greiner  (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTIOXLAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DEV_IOX_H_
+#define _DEV_IOX_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <spinlock.h>
+
+/*****************************************************************************************
+ *     Generic IOX (bridge to external IO peripherals) definition.
+ *
+ * The IOX device is used to access external peripherals. It implements an IO-MMU service 
+ * for DMA transactions launched by DMA capable external peripherals.
+ * This IOX peripheral is acting as a dynamically configurable bridge, used for others 
+ * I/O operations. Therefore, ALMOS-MKH does not use the IOX device waiting queue,
+ * and calls directly the IOX driver blocking functions, using the device lock to 
+ * get exclusive access to the IOX bridge internal state.
+ ****************************************************************************************/
+ 
+
+/*****************************************************************************************
+ * This enum defines the various implementations of the IOX generic device.
+ * This array must be kept consistent with the define in arch_info.h file
+ ****************************************************************************************/
+
+enum iox_impl_e
+{
+    IMPL_IOX_IOB =   0,         /* vci_iob component used in TSAR                       */
+    IMPL_IOX_I86 =   1,         /* TBD                                                  */
+}
+iox_impl_t;
+
+/*****************************************************************************************
+ * This function initializes the IOX device descriptor with IOMMU disabled.
+ *****************************************************************************************
+ * @ dev_xp     : extended pointer on IOX device descriptor.
+ ****************************************************************************************/
+void dev_iox_init( xptr_t dev_xp );
+
+/*****************************************************************************************
+ * This function activates the IOMMU for the IOX device identified by its
+ * extended pointer.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ ****************************************************************************************/
+void dev_iox_iommu_enable( xptr_t dev_xp );
+
+/*****************************************************************************************
+ * This function desactivates the IO-MMU for the IOX device identified by its
+ * extended pointer.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ ****************************************************************************************/
+void dev_iox_iommu_disable( xptr_t dev_xp );
+
+/*****************************************************************************************
+ * This function set a new value in the IO-MMU PTPR register.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ * @ wdata    : value to be written in PTPR register.
+ ****************************************************************************************/
+void dev_iox_set_ptpr( xptr_t    dev_xp,
+                       uint32_t  wdata );
+                        
+/*****************************************************************************************
+ * This function invalidates an IOMMU TLB entry identified by its vpn.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ * @ vpn      : virtual page number in IO virtual space.
+ ****************************************************************************************/
+void dev_iox_inval_page( xptr_t  dev_xp,
+                         vpn_t   vpn );
+
+/*****************************************************************************************
+ * This function return informations relative to an error reported by the IOMMU.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ * @ error    : [out] pointer on buffer for erro type.
+ * @ bvar     : [out] pointer on buffer for bad virtual address.
+ * @ srcid    : [out] pointer on buffer for faulty peripheral index.
+ ****************************************************************************************/
+void dev_iox_get_status( xptr_t     dev_xp,
+                         uint32_t * error,
+                         uint32_t * bvar,
+                         uint32_t * srcid );
+
+#endif  /* _DEV_IOX_H_ */
Index: trunk/kernel/devices/dev_dma.c
===================================================================
--- trunk/kernel/devices/dev_dma.c	(revision 690)
+++ 	(revision )
@@ -1,181 +1,0 @@
-/*
- * dev_dma.c - DMA (Interrupt Controler Unit) generic device API implementation.
- *
- * Authors   Alain Greiner  (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTDMALAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <chdev.h>
-#include <thread.h>
-#include <cluster.h>
-#include <printk.h>
-#include <memcpy.h>
-#include <dev_dma.h>
-#include <hal_drivers.h>
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Extern global variables
-/////////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
-
-//////////////////////////////////
-void dev_dma_init( chdev_t * dma )
-{
-    // get channel from chdev descriptor
-    uint32_t channel = dma->channel;
-
-    // set dma name
-    snprintk( dma->name , 16 , "dma%d_%x" , channel , local_cxy );
-
-    // call driver init function
-    hal_drivers_dma_init( dma );
-
-    // bind IRQ to the core defined by the DMA channel 
-    dev_pic_bind_irq( channel , dma );
-
-    // enable IRQ
-    dev_pic_enable_irq( channel, XPTR( local_cxy , dma ) );
-
-    // create server thread
-    thread_t * new_thread;
-    error_t    error;
-
-    lid_t lid = cluster_select_local_core( local_cxy );
-
-    error = thread_kernel_create( &new_thread,
-                                  THREAD_DEV,
-                                  &chdev_server_func,
-                                  dma,
-                                  lid );
-    if( error )
-    {
-        assert( __FUNCTION__, false , "cannot create server thread" );
-    }
-
-    // initialises server field in chdev descriptor
-    dma->server = new_thread;
-
-    // initializes chdev field in thread descriptor
-    new_thread->chdev = dma;
-    
-    // unblock server thread
-    thread_unblock( XPTR( local_cxy , new_thread ) , THREAD_BLOCKED_GLOBAL );
-
-} // dev_dma_init()
-
-////////////////////////////////////////////////
-error_t dev_dma_async_memcpy( xptr_t    dst_xp,
-                              xptr_t    src_xp,
-                              uint32_t  size )
-{
-    thread_t * this = CURRENT_THREAD;
-
-#if DEBUG_DEV_DMA
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONGIG_DEBUG_DEV_DMA < cycle )
-printk("\n[DBG] %s : thread %x enters / dst %l / src %l / size = %x\n",
-__FUNCTION__ , this, dst_xp, src_xp, size );
-#endif
-
-    // select DMA channel corresponding to core lid
-    uint32_t channel = this->core->lid;
-
-    // get extended pointer on selected DMA chdev descriptor
-    xptr_t  dev_xp = chdev_dir.dma[channel];
-
-// check DMA chdev definition
-assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "undefined DMA chdev descriptor" );
-
-    // register command in calling thread descriptor
-    this->dma_cmd.sync    = false;
-    this->dma_cmd.dev_xp  = dev_xp;
-    this->dma_cmd.dst_xp  = dst_xp;
-    this->dma_cmd.src_xp  = src_xp;
-    this->dma_cmd.size    = size;
-
-    // register the client thread in waiting queue, activate the server thread,
-    // block the client thread on THREAD_BLOCKED_IO, and deschedule.
-    // it is re-activated by the server thread  when the transfer is completed.
-    chdev_register_command( dev_xp );
-
-#if DEBUG_DEV_DMA
-cycle = (uint32_t)hal_get_cycles();
-if( CONGIG_DEBUG_DEV_DMA < cycle )
-printk("\n[DBG] %s : thread %x exit / dst %l / src %l / size = %x\n",
-__FUNCTION__ , this, dst_xp, src_xp, size );
-#endif
-
-    // return I/O operation status from calling thread descriptor
-    return this->dma_cmd.error;  
-
-}  // dev_dma_async_memcpy()
-
-//////////////////////////////////////////////
-error_t dev_dma_sync_memcpy( xptr_t    dst_xp,
-                             xptr_t    src_xp,
-                             uint32_t  size )
-{
-    thread_t * this = CURRENT_THREAD;
-
-#if DEBUG_DEV_DMA
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( CONGIG_DEBUG_DEV_DMA < cycle )
-printk("\n[DBG] %s : thread %x enters / dst %l / src %l / size = %x\n",
-__FUNCTION__ , this, dst_xp, src_xp, size );
-#endif
-
-    // select DMA channel corresponding to core lid
-    uint32_t channel = this->core->lid;
-
-    // get extended pointer on selected DMA chdev descriptor
-    xptr_t  dev_xp = chdev_dir.dma[channel];
-
-// check DMA chdev definition
-assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "undefined DMA chdev descriptor" );
-
-    // register command in calling thread descriptor
-    this->dma_cmd.sync    = true;
-    this->dma_cmd.dev_xp  = dev_xp;
-    this->dma_cmd.dst_xp  = dst_xp;
-    this->dma_cmd.src_xp  = src_xp;
-    this->dma_cmd.size    = size;
-
-    // get driver command function
-    cxy_t       dev_cxy = GET_CXY( dev_xp );
-    chdev_t   * dev_ptr = GET_PTR( dev_xp );
-    dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ) );
-
-    // call directly the blocking driver function
-    cmd( XPTR( local_cxy , this ) );
-
-#if DEBUG_DEV_DMA
-cycle = (uint32_t)hal_get_cycles();
-if( CONGIG_DEBUG_DEV_DMA < cycle )
-printk("\n[DBG] %s : thread %x exit / dst %l / src %l / size = %x\n",
-__FUNCTION__ , this, dst_xp, src_xp, size );
-#endif
-
-    // return I/O operation status from calling thread descriptor
-    return this->dma_cmd.error;  
-
-}  // dev_dma_sync_memcpy()
-
Index: trunk/kernel/devices/dev_dma.h
===================================================================
--- trunk/kernel/devices/dev_dma.h	(revision 690)
+++ 	(revision )
@@ -1,114 +1,0 @@
-/*
- * dev_dma.h - DMA (Direct Memory Access) generic device API definition.
- *
- * Authors   Alain Greiner  (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTDMALAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _DEV_DMA_H_
-#define _DEV_DMA_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-
-/*****************************************************************************************
- *     Generic Multi-channels DMA controller definition
- *
- * The DMA device describes a generic, multi-channels DMA controller, that can be used 
- * by the kernel to speedup memory copies. It is an "internal" device, replicated in all
- * clusters. It can only be configured by a local kernel thread, but it can move data
- * to/from remote clusters. The burst size is defined by the cache line size.
- * Each DMA channel is described by a specific chdev descriptor, handling its private
- * waiting threads queue. It implements two blocking commands :
- * - move synchronously data from a remote source buffer to a remote destination buffer,
- *   using a polling policy to wait completion (No DMA_IRQ use).
- * - move synchronously data from a remote source buffer to a remote destination buffer,
- *   using a descheduling policy to wait completion (reactivated bythe IDMA_IRQ).
- ****************************************************************************************/
- 
-/****  Forward declarations  ****/
-
-struct chdev_s;
-
-/*****************************************************************************************
- * This defines the (implementation independant) command passed to the driver.
- ****************************************************************************************/
-
-typedef struct dma_command_s
-{
-    bool_t      sync;      /*! polling policy if true / descheduling policy if false     */
-    xptr_t      dev_xp;    /*! extended pointer on the DMA chdev descriptor              */
-    xptr_t      src_xp;    /*! extended pointer on source buffer.                        */
-    xptr_t      dst_xp;    /*! extended pointer on destination buffer.                   */
-    uint32_t    size;      /*! number of bytes to move.                                  */
-    uint32_t    error;     /*! operation status (0 if success)                           */
-}
-dma_command_t;
-
-/*****************************************************************************************
- * This enum defines the various implementations of the DMA internal interrupt controller.
- * This array must be kept consistent with the define in arch_info.h file
- ****************************************************************************************/
-
-enum dma_impl_e
-{
-    IMPL_DMA_SCL =   0,         /* vci_xdma component used in TSAR                      */
-    IMPL_DMA_I86 =   1          /* TBD                                                  */
-}
-dma_impl_t;
-
-/*****************************************************************************************
- * This function makes two initialisations:
- * - It initialises the DMA specific fields of the chdev descriptor.
- * - it initialises the implementation specific DMA hardware device and associated
- *   data structures if required.
- * It must be called by a local thread.
- *****************************************************************************************
- * @ chdev   : pointer on DMA chdev descriptor.
- ****************************************************************************************/
-void dev_dma_init( struct chdev_s * chdev );
-
-/*****************************************************************************************
- * This blocking function register a DMA request in the device queue.
- * It uses a descheduling policy to wait completion, 
- * It return an error status when the transfer is completed.
- *****************************************************************************************
- * @ dst_xp     : extended pointer on destination buffer.
- * @ src_xp     : extended pointer on source buffer.
- * @ size       : number of bytes to move.
- ****************************************************************************************/
-error_t dev_dma_async_memcpy( xptr_t     dst_xp,
-                              xptr_t     src_xp,
-                              uint32_t   size );    
-
-/*****************************************************************************************
- * This blocking function register a DMA request in the device queue.
- * It uses a polling policy to wait completion.
- * It return an error status when the transfer is completed.
- *****************************************************************************************
- * @ dst_xp     : extended pointer on destination buffer.
- * @ src_xp     : extended pointer on source buffer.
- * @ size       : number of bytes to move.
- ****************************************************************************************/
-error_t dev_dma_sync_memcpy( xptr_t     dst_xp,
-                             xptr_t     src_xp,
-                             uint32_t   size );    
-
-
-#endif  /* _DEV_DMA_H_ */
Index: trunk/kernel/devices/dev_fbf.c
===================================================================
--- trunk/kernel/devices/dev_fbf.c	(revision 690)
+++ 	(revision )
@@ -1,1118 +1,0 @@
-/*
- * dev_fbf.c - FBF (Frame Buffer) generic device API implementation.
- * 
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MK
- *
- * ALMOS-MKH.is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH.is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-kernel; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_gpt.h>
-#include <hal_drivers.h>
-#include <hal_irqmask.h>
-#include <hal_macros.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <thread.h>
-#include <printk.h>
-#include <string.h>
-#include <memcpy.h>
-#include <chdev.h>
-#include <dev_fbf.h>
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Extern global variables
-/////////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
-
-///////////////////////////////////////////
-char * dev_fbf_cmd_str( uint32_t cmd_type )
-{
-    if     ( cmd_type == FBF_GET_CONFIG     )  return "GET_CONFIG";
-    else if( cmd_type == FBF_CREATE_WINDOW  )  return "CREATE_WINDOW";
-    else if( cmd_type == FBF_ACTIVE_WINDOW  )  return "ACTIVE_WINDOW";
-    else if( cmd_type == FBF_DELETE_WINDOW  )  return "DELETE_WINDOW";
-    else if( cmd_type == FBF_MOVE_WINDOW    )  return "MOVE_WINDOW";
-    else if( cmd_type == FBF_REFRESH_WINDOW )  return "REFRESH_WINDOW";
-    else if( cmd_type == FBF_FRONT_WINDOW   )  return "FRONT_WINDOW";
-    else if( cmd_type == FBF_RESIZE_WINDOW  )  return "RESIZE_WINDOW";
-
-    else if( cmd_type == FBF_DIRECT_WRITE   )  return "DIRECT_WRITE";
-    else if( cmd_type == FBF_DIRECT_READ    )  return "DIRECT_READ";
-    else                                       return "undefined";
-}
-
-////////////////////////////////////////////////
-xptr_t dev_fbf_get_xptr_from_wid( uint32_t wid )
-{
-    thread_t  * this  = CURRENT_THREAD;
-    pid_t       pid   = this->process->pid;
-    trdid_t     trdid = this->trdid;
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // build extended pointer on windows_tbl[wid] 
-    xptr_t entry_xp  = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_tbl[wid] );
-
-    // get pointers on searched window 
-    xptr_t         window_xp  = hal_remote_l64( entry_xp );
-    cxy_t          window_cxy = GET_CXY( window_xp );
-    fbf_window_t * window_ptr = GET_PTR( window_xp );
-
-    if( window_xp == XPTR_NULL )
-    {
-        printk("\n[ERROR] in %s / client thread[%x,%x] request a non registered wid (%d)\n",
-        __FUNCTION__, pid, trdid, wid );
-        return XPTR_NULL;
-    }
-
-    // get owner process PID from window descriptor
-    pid_t owner_pid = hal_remote_l32( XPTR( window_cxy , &window_ptr->pid ) );
-
-    if( pid != owner_pid )
-    {
-        printk("\n[ERROR] in %s / client thread[%x,%x] not owner of wid (%d) / owner is (%x)\n",
-        __FUNCTION__, pid, trdid, owner_pid, wid );
-        return XPTR_NULL;
-    }
-
-    return window_xp;
-
-}  // end dev_fbf_get_xptr_from_wid()
-
-////////////////////////////////////
-void dev_fbf_init( chdev_t  * fbf )
-{
-    uint32_t wid;
-
-    // set chdev name
-    strcpy( fbf->name, "fbf" );
-
-    // initialize lock protecting the windows
-    remote_rwlock_init( XPTR( local_cxy , &fbf->ext.fbf.windows_lock ),
-                        LOCK_FBF_WINDOWS ); 
-
-    // initialize root of windows xlist
-    xlist_root_init( XPTR( local_cxy , &fbf->ext.fbf.windows_root ) );
-
-    // initialize windows_tbl[] array
-    for( wid = 0 ; wid < CONFIG_FBF_WINDOWS_MAX_NR ; wid++ ) 
-    {
-        fbf->ext.fbf.windows_tbl[wid] = XPTR_NULL;
-    }
-
-    // initialize wid allocator bitmap
-    bitmap_init( fbf->ext.fbf.windows_bitmap , CONFIG_FBF_WINDOWS_MAX_NR );
-
-    // call driver init function to initialize the harware FBF
-    // and initialize the width, height, and subsampling FBF chdev fields
-    hal_drivers_fbf_init( fbf );
-
-}  // end dev_fbf_init()
-
-//////////////////////////////////////////
-void dev_fbf_get_config( uint32_t * width,
-                         uint32_t * height,
-                         uint32_t * type )
-{
-    // get extended pointer on FBF chdev descriptor
-    xptr_t  dev_xp = chdev_dir.fbf[0];
-
-assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "undefined FBF chdev descriptor" );
-
-    // get FBF chdev cluster and local pointer
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
-
-    // return values
-    *width  = hal_remote_l32( XPTR( dev_cxy , &dev_ptr->ext.fbf.width ) );
-    *height = hal_remote_l32( XPTR( dev_cxy , &dev_ptr->ext.fbf.height ) );
-    *type   = hal_remote_l32( XPTR( dev_cxy , &dev_ptr->ext.fbf.subsampling ) );
-
-}  // end dev_fbf_get_config()
-
-/////////////////////////////////////////////////
-uint32_t dev_fbf_create_window( uint32_t   nlines,
-                                uint32_t   npixels,
-                                uint32_t   l_min,
-                                uint32_t   p_min,
-                                intptr_t * user_buffer )
-{
-    fbf_window_t * window;      // window descriptor (created in local cluster)
-    vseg_t       * vseg;        // vseg descriptor (created in reference cluster)
-    intptr_t       vseg_base;   // vseg base address in user space  
-
-    // get local pointers on calling thread and process
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_DEV_FBF
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] enter : nlines %d / npixels %d / l_min %d / p_min %d / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, nlines, npixels, l_min, p_min, cycle );
-#endif
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-// check fbf_xp definition
-assert( __FUNCTION__, (fbf_xp != XPTR_NULL) , "undefined FBF chdev descriptor" );
-
-    // get FBF width and height
-    uint32_t fbf_width  = hal_remote_l32( XPTR( fbf_cxy , &fbf_ptr->ext.fbf.width ) );
-    uint32_t fbf_height = hal_remote_l32( XPTR( fbf_cxy , &fbf_ptr->ext.fbf.height ) );
-
-    // check new window size and coordinates
-    if( (((l_min + nlines) > fbf_height) || ((p_min + npixels) > fbf_width)) )
-    {
-        printk("\n[ERROR] in %s / thread[%x,%x]" 
-        "illegal new coordinates (%d,%d) for window (%d,%d) in fbf (%d,%d)\n",
-        process->pid, this->trdid, p_min, l_min, npixels, nlines, fbf_width, fbf_height );
-        return -1;
-    }
-
-    // build extended pointers on windows lock, root, and wid allocator 
-    xptr_t windows_lock_xp   = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-    xptr_t windows_root_xp   = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_root );
-    xptr_t windows_bitmap_xp = XPTR( fbf_cxy ,  fbf_ptr->ext.fbf.windows_bitmap );
- 
-    // allocate memory for the window descriptor in local cluster
-    window  = kmem_alloc( bits_log2(sizeof(fbf_window_t)) , AF_ZERO );
-
-    if( window == NULL )
-    {
-        printk("\n[ERROR] in %s / thread[%x,%x] cannot allocate window descriptor\n",
-        __FUNCTION__, process->pid, this->trdid );
-        return -1;
-    }
-
-#if (DEBUG_DEV_FBF & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] created window descriptor %x / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, window, cycle );
-#endif
-
-    // getpointers on reference process
-    xptr_t      ref_xp  = process->ref_xp;
-    process_t * ref_ptr = GET_PTR( ref_xp );
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-    // allocate a new vseg, and introduce it in the reference process VSL
-    if( ref_cxy == local_cxy )
-    {
-        vseg = vmm_create_vseg( process,            // owner process
-                                VSEG_TYPE_ANON,     // localised, public
-                                0,                  // base, unused for ANON
-                                nlines * npixels,   // size
-                                0,                  // file_offset, unused for ANON 
-                                0,                  // file_size, unused for ANON
-                                XPTR_NULL,          // mapper_xp, unused for ANON
-                                local_cxy );        // mapping cluster
-    }
-    else
-    {
-        rpc_vmm_create_vseg_client( ref_cxy,
-                                    ref_ptr,
-                                    VSEG_TYPE_ANON,
-                                    0,                 // base, unused for ANON
-                                    nlines * npixels,  // size
-                                    0,                 // file_offset, unused for ANON
-                                    0,                 // file size, unused for ANON
-                                    XPTR_NULL,         // mapper_xp, unused for ANON
-                                    local_cxy,
-                                    &vseg );
-    } 
-        
-    if( vseg == NULL )
-    {
-        printk("\n[ERROR] in %s / thread[%x,%x] cannot create vseg in reference cluster\n",
-        __FUNCTION__, process->pid, this->trdid );
-        kmem_free( window , bits_log2(sizeof(fbf_window_t)) );
-        return -1;
-    }
-
-    // get vseg base
-    vseg_base = (intptr_t)hal_remote_lpt( XPTR( ref_cxy , &vseg->min ) );
-
-#if (DEBUG_DEV_FBF & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] allocated vseg / base %x / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, vseg_base, cycle );
-#endif
-
-    // take the lock protecting windows in write mode
-    remote_rwlock_wr_acquire( windows_lock_xp );
-
-    // allocate a wid from allocator in FBF descriptor extension
-    uint32_t wid = bitmap_remote_alloc( windows_bitmap_xp , CONFIG_FBF_WINDOWS_MAX_NR );
-
-    if( wid == 0xFFFFFFFF )
-    {
-        printk("\n[ERROR] in %s / thread[%x,%x] cannot allocate buffer for window\n",
-        __FUNCTION__, process->pid, this->trdid );
-        kmem_free( window , bits_log2(sizeof(fbf_window_t)) );
-        vmm_remove_vseg( process , vseg );
-        return -1;
-    }
- 
-    // initialize window descriptor
-    window->pid     = process->pid;
-    window->wid     = wid;
-    window->height  = nlines;
-    window->width   = npixels;
-    window->l_min   = l_min;
-    window->p_min   = p_min;
-    window->hidden  = true;
-    window->buffer  = (uint8_t *)vseg_base;
-
-    // register new window in xlist rooted in FBF extension
-    xlist_add_last( windows_root_xp , XPTR( local_cxy , &window->xlist ) );
-
-    // build extended pointer on relevant entry in windows_tbl[] array
-    xptr_t windows_tbl_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_tbl[wid] );
-
-    // register new window in windows_tbl[] stored in FBF extension
-    hal_remote_s64( windows_tbl_xp , XPTR( local_cxy , window ) );
-
-    // release the lock protecting windows in write mode
-    remote_rwlock_wr_release( windows_lock_xp );
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit / wid %d / buffer %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, wid , window->buffer, cycle );
-#endif
-
-    // return pointer on allocated buffer
-    *user_buffer = vseg_base;
-
-    return wid;
-
-}  // end dev_fbf_create_window()
-
-/////////////////////////////////////////////
-error_t dev_fbf_active_window( uint32_t  wid,
-                               uint32_t  active )
-{
-
-#if DEBUG_DEV_FBF
-thread_t  * thi   = CURRENT_THREAD;
-uint32_t    cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] enters : wid %d / active %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, wid, active, cycle );
-#endif
-
-    // get extended pointer on window to be activated
-    xptr_t window_xp  = dev_fbf_get_xptr_from_wid( wid );
-
-    if( window_xp == XPTR_NULL ) return -1;
-
-    // get cluster and local pointer on target window
-    cxy_t          window_cxy = GET_CXY( window_xp );
-    fbf_window_t * window_ptr = GET_PTR( window_xp );
-
-    // set/reset hidden flag in window descriptor
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->hidden ) , (active == 0) ? 1 : 0 );
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-
-    return 0;
-
-}  // end dev_fbf_active_window()
-
-////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by dev_fbf_refresh_window(), dev_fbf_move_window(),
-// dev_fbf_front_window(), dev_fbf_delete_window(), and dev_fbf_resize_window().
-// It updates all lines of a pseudo window identified by the <p_min>, <p_max>, <l_min>, 
-// and <l_max> arguments, that are dynamically computed by the caller. 
-// This function scan all registered windows to take into account the overlap priorities
-// defined by the FBF xlist of windows. It takes the lock protecting xlist in read mode. 
-////////////////////////////////////////////////////////////////////////////////////////
-// Implementation Note:
-// This function contains two loops.
-// - the external loop builds one line of the pseudo window per iteraiion in a local
-//   line_buffer. One line  contains [p_max - p_min] pixels. Then, it calls the FBF
-//   driver (one driver call per line) to write this line into the Frame Buffer.
-// - the internal loop scan the list of the registered windows in increasing priority,
-//   and for each registered window that has a non empty intersection with the handled
-//   line, it updates the line_buffer, using the hal_copy_from_uspace() function
-//   to get the most up-to-date user-defined data.
-////////////////////////////////////////////////////////////////////////////////////////
-// @ p_min   : [in]  upper left corner X coordinate in FBF reference
-// @ p_max   : [in]  upper left corner Y coordinate in FBF reference.
-// @ l_min   : [in]  lower right corner X coordinate in FBF reference (excluded).
-// @ l_max   : [in]  lower right corner Y coordinate in FBF reference (excluded).
-////////////////////////////////////////////////////////////////////////////////////////
-error_t fbf_update( uint32_t    p_min,
-                    uint32_t    l_min,
-                    uint32_t    p_max,
-                    uint32_t    l_max )
-{
-    uint32_t       line;                     // iterator to scan the FBF lines
-    uint32_t       pixel;                    // iterator to scan pixels in one FBF line
-    xptr_t         iter_xp;                  // iterator to scan the list of windows
-    error_t        error;
-
-    // this intermediate buffer to build one pseudo-window line
-    uint8_t  line_buffer[CONFIG_FBF_WINDOWS_MAX_WIDTH];
-
-    // get pointer on calling thread and core lid
-    thread_t  * this = CURRENT_THREAD;
-
-#if DEBUG_DEV_FBF
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] enter : p_min %d / l_min %d / p_max %d / l_max %d / cycle %d\n",
-__FUNCTION__, p_min, l_min, p_max, l_max, cycle );
-#endif
-
-    // get pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // get frame buffer width and height
-    uint32_t fbf_width  = hal_remote_l32( XPTR( fbf_cxy , &fbf_ptr->ext.fbf.width ) );
-    uint32_t fbf_height = hal_remote_l32( XPTR( fbf_cxy , &fbf_ptr->ext.fbf.height ) );
-
-// check arguments
-assert( __FUNCTION__, (p_min < fbf_width)  && (p_max <= fbf_width) && 
-        (l_min < fbf_height) && (l_max <= fbf_height) , "illegal arguments" );
-
-    // get pointer on driver command function
-    dev_cmd_t * cmd = hal_remote_lpt( XPTR( fbf_cxy , &fbf_ptr->cmd ) );
-
-    // build extended pointers on windows xlist root and lock
-    xptr_t  windows_root_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_root );
-    xptr_t  windows_lock_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-
-    error = 0;
-
-    // 1. external loop on pseudo window lines (in FBF reference) 
-    for( line = l_min ; line < l_max ; line++ )
-    {
-        // reset the line buffer to default value
-        for( pixel = 0 ; pixel < (p_max - p_min) ; pixel++ ) line_buffer[pixel] = 127;
-
-        // take the lock in read mode
-        remote_rwlock_rd_acquire( windows_lock_xp );
-
-        // 2. internal loop on all registered windows
-        XLIST_FOREACH( windows_root_xp , iter_xp )
-        {
-            // get pointers on current target window
-            xptr_t         tgt_xp  = XLIST_ELEMENT( iter_xp , fbf_window_t , xlist );
-            fbf_window_t * tgt_ptr = GET_PTR( tgt_xp );
-            cxy_t          tgt_cxy = GET_CXY( tgt_xp );
-
-            // get target window min and max coordinates in FBF reference
-            bool_t    hidden   = hal_remote_l32( XPTR( tgt_cxy , &tgt_ptr->hidden ) );
-            uint32_t  w_l_min  = hal_remote_l32( XPTR( tgt_cxy , &tgt_ptr->l_min ) );
-            uint32_t  w_p_min  = hal_remote_l32( XPTR( tgt_cxy , &tgt_ptr->p_min ) );
-            uint32_t  w_height = hal_remote_l32( XPTR( tgt_cxy , &tgt_ptr->height ) );
-            uint32_t  w_width  = hal_remote_l32( XPTR( tgt_cxy , &tgt_ptr->width  ) );
-            uint32_t  w_l_max  = w_l_min + w_height;
-            uint32_t  w_p_max  = w_p_min + w_width;
-
-            // does nothing when target window is hidden
-            // or the pseudo window line does not overlap the target window
-            if( (hidden == true)   ||
-                (line  <  w_l_min) ||
-                (line  >= w_l_max) ||
-                (p_max <  w_p_min) ||
-                (p_min >= w_p_max) ) continue;
-
-            // get pointer on buffer associated to target window in user space
-            uint8_t * w_buffer = hal_remote_lpt( XPTR( tgt_cxy , &tgt_ptr->buffer ) ); 
-
-            // get min & max indexes for pixels to be moved in FBF reference
-            uint32_t f_pixel_min = (p_min < w_p_min) ? w_p_min : p_min;
-            uint32_t f_pixel_max = (p_max < w_p_max) ? p_max : w_p_max;
-
-            // compute number of pixels to move from w_buffer to f_buffer
-            uint32_t npixels = f_pixel_max - f_pixel_min;
-
-            // compute offset in line_buffer
-            uint32_t line_offset = f_pixel_min - p_min; 
-
-            // compute line index in window  
-            uint32_t w_line = line - w_l_min;
-
-            // compute offset in window buffer
-            uint32_t w_offset = (w_line * w_height) + f_pixel_min - w_p_min;
-
-            // move pixels from w_buffer (user space) to line_buffer (kernel space)
-            hal_copy_from_uspace( XPTR( local_cxy  , &line_buffer[line_offset] ),
-                                  &w_buffer[w_offset], 
-                                  npixels );
-        }  // end for windows
-
-        // release the lock 
-        remote_rwlock_rd_release( windows_lock_xp );
-
-        // compute offset in FBF
-        uint32_t fbf_offset = p_min + (line * fbf_width);
-
-        // register command in calling thread descriptor
-        this->fbf_cmd.dev_xp    = fbf_xp;
-        this->fbf_cmd.type      = FBF_DRIVER_KERNEL_WRITE;
-        this->fbf_cmd.buffer    = line_buffer;
-        this->fbf_cmd.npixels   = p_max - p_min;
-        this->fbf_cmd.offset    = fbf_offset;
-
-        // call driver to display one line
-        cmd( XPTR( local_cxy , this ) );
-
-        error |= this->fbf_cmd.error;
-    
-    }  // end for lines
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] exit / cycle %d\n",
-__FUNCTION__, cycle );
-#endif
-
-    // return I/O operation status
-    return error;
-
-}  // end fbf_update()
-
-//////////////////////////////////////////////
-error_t dev_fbf_delete_window( uint32_t  wid )
-{
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_DEV_FBF
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] enters : wid %d / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, wid, cycle );
-#endif
-
-    // get extended pointer on window to be deleted
-    xptr_t window_xp  = dev_fbf_get_xptr_from_wid( wid );
-
-    if( window_xp == XPTR_NULL ) return -1;
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // build extended pointers on windows lock, windows_tbl[wid] and wid allocator 
-    xptr_t windows_lock_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-    xptr_t wid_bitmap_xp   = XPTR( fbf_cxy ,  fbf_ptr->ext.fbf.windows_bitmap );
-    xptr_t windows_tbl_xp  = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_tbl[wid] );
-
-    // get cluster and local pointer on window
-    cxy_t          window_cxy = GET_CXY( window_xp );
-    fbf_window_t * window_ptr = GET_PTR( window_xp );
-
-    // get relevant info from window descriptor
-    uint32_t   p_min   = hal_remote_l32( XPTR( window_cxy , &window_ptr->p_min ) );
-    uint32_t   l_min   = hal_remote_l32( XPTR( window_cxy , &window_ptr->l_min ) );
-    uint32_t   npixels = hal_remote_l32( XPTR( window_cxy , &window_ptr->width ) );
-    uint32_t   nlines  = hal_remote_l32( XPTR( window_cxy , &window_ptr->height ) );
-    uint8_t  * buffer  = hal_remote_lpt( XPTR( window_cxy , &window_ptr->buffer ) );
-
-    // 1. set the hidden bit in window descriptor
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->hidden ) , true );
-
-    // 2. refresh the window in FBF
-    fbf_update( p_min, l_min, p_min + npixels, l_min + nlines );
-
-    // 3. take the lock protecting windows in write mode
-    remote_rwlock_wr_acquire( windows_lock_xp );
-
-    // 4. remove the window from windows_tbl[] array
-    hal_remote_s64( windows_tbl_xp , XPTR_NULL );
-
-    // 5. remove the window from xlist      
-    xlist_unlink( XPTR( window_cxy , &window_ptr->xlist ) );
-
-    // 6. release wid to bitmap
-    bitmap_remote_clear( wid_bitmap_xp , wid );
-
-    // 7. release the lock protecting windows in write mode
-    remote_rwlock_wr_release( windows_lock_xp );
- 
-    // 8. release memory allocated for window descriptor
-    kmem_remote_free( window_cxy , window_ptr , bits_log2(sizeof(fbf_window_t)) );
-
-    // 9. release the associated vseg
-    vmm_global_delete_vseg( process , (intptr_t)buffer );
-    
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, cycle );
-#endif
-
-    return 0;
-
-}  // end dev_fbf_delete_window()
-
-////////////////////////////////////////////
-error_t dev_fbf_move_window( uint32_t  wid,
-                             uint32_t  l_new,
-                             uint32_t  p_new )
-{
-
-#if DEBUG_DEV_FBF
-thread_t  * this  = CURRENT_THREAD;
-uint32_t    cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] enters : wid %d / l_new %d / p_new %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, wid, l_new, p_new, cycle );
-#endif
-
-    // get extended pointer on window to be moved
-    xptr_t window_xp  = dev_fbf_get_xptr_from_wid( wid );
-
-    if( window_xp == XPTR_NULL ) return -1;
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // build extended pointers on windows lock and root 
-    xptr_t windows_lock_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-    xptr_t windows_root_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_root );
-
-
-    // get cluster and local pointer on target window
-    cxy_t          window_cxy = GET_CXY( window_xp );
-    fbf_window_t * window_ptr = GET_PTR( window_xp );
-
-    // get target window coordinates, width and height
-    uint32_t p_old     = hal_remote_l32( XPTR( window_cxy , &window_ptr->p_min ) );
-    uint32_t l_old     = hal_remote_l32( XPTR( window_cxy , &window_ptr->l_min ) );
-    uint32_t nlines    = hal_remote_l32( XPTR( window_cxy , &window_ptr->height ) );
-    uint32_t npixels   = hal_remote_l32( XPTR( window_cxy , &window_ptr->width ) );
-
-    // build extended pointer on window xlist_entry
-    xptr_t xlist_entry_xp =  XPTR( window_cxy , &window_ptr->xlist );
-
-    // does nothing if no change
-    if( (p_new == p_old) && (l_new == l_old) )  return 0;
-
-    // 1. set the "hidden" flag in window descriptor
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->hidden ) , true );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] hidden set\n", __FUNCTION__ );
-#endif
-
-    // 2. update the FBF for the old window position
-    fbf_update( p_old , l_old , p_old + npixels, l_old + nlines );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] refreshed old window\n", __FUNCTION__ );
-#endif
-
-    // 3. take the lock protecting windows in write mode
-    remote_rwlock_wr_acquire( windows_lock_xp );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] lock taken\n", __FUNCTION__ );
-#endif
-
-    // 4. set the new coordinates in the window descriptor,
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->l_min ), l_new );
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->p_min ), p_new );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] l_min & p_min updated\n", __FUNCTION__ );
-#endif
-
-    // 5. gives the window the highest priority 
-    xlist_unlink( xlist_entry_xp );
-    xlist_add_last( windows_root_xp , xlist_entry_xp );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] set high priority\n", __FUNCTION__ );
-#endif
-
-    // 6. release the lock protecting windows in write mode
-    remote_rwlock_wr_release( windows_lock_xp );
- 
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] lock released\n", __FUNCTION__ );
-#endif
-
-    // 7. reset the "hidden" flag in window descriptor
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->hidden ) , false );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] hidden reset\n", __FUNCTION__ );
-#endif
-
-    // 8. update the FBF for the new window position
-    fbf_update( p_new , l_new , p_new + npixels, l_new + nlines );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] refresh new new window\n", __FUNCTION__ );
-#endif
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-
-    return 0;
-
-}  // end dev_fbf_move_window()
-
-/////////////////////////////////////////////
-error_t dev_fbf_resize_window( uint32_t  wid,
-                               uint32_t  width,
-                               uint32_t  height )
-{
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_DEV_FBF
-uint32_t    cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] enters : wid %d / width %d / height %d / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , wid, width , height , cycle );
-#endif
-
-    // get extended pointer on window to be resized
-    xptr_t window_xp  = dev_fbf_get_xptr_from_wid( wid );
-
-    if( window_xp == XPTR_NULL ) return -1;
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // build extended pointers on windows lock and root 
-    xptr_t windows_lock_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-    xptr_t windows_root_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_root );
-
-    // get cluster and local pointer on target window 
-    cxy_t          window_cxy = GET_CXY( window_xp );
-    fbf_window_t * window_ptr = GET_PTR( window_xp );
-
-    // get process owner PID, width, height, and buffer
-    uint32_t p_min   = hal_remote_l32( XPTR( window_cxy , &window_ptr->p_min ) );
-    uint32_t l_min   = hal_remote_l32( XPTR( window_cxy , &window_ptr->l_min ) );
-    uint32_t nlines  = hal_remote_l32( XPTR( window_cxy , &window_ptr->height ) );
-    uint32_t npixels = hal_remote_l32( XPTR( window_cxy , &window_ptr->width ) );
-    void   * base    = hal_remote_lpt( XPTR( window_cxy , &window_ptr->buffer ) );
-
-    // build extended pointer on window xlist_entry
-    xptr_t xlist_entry_xp =  XPTR( window_cxy , &window_ptr->xlist );
-
-    // does nothing if no change
-    if( (width == npixels) && (height == nlines) ) return 0;
-
-    // compute old_size and new size
-    uint32_t old_size = nlines * npixels;
-    uint32_t new_size = width * height;
-
-    // 1. set the "hidden" flag in window descriptor
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->hidden ) , true );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] hidden set\n", __FUNCTION__ );
-#endif
-
-    // 2. refresh the FBF for the current window size
-    fbf_update( p_min , l_min , p_min + npixels, l_min + nlines );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] refreshed old window\n", __FUNCTION__ );
-#endif
-
-    // 3. take the lock protecting windows in write mode
-    remote_rwlock_wr_acquire( windows_lock_xp );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] lock taken\n", __FUNCTION__ );
-#endif
-
-    // 4. set the new width & height in the window descriptor,
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->width  ), width );
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->height ), height );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] width & height updated\n", __FUNCTION__ );
-#endif
-
-    // 5. resize vseg if required
-    vmm_global_resize_vseg( process, (intptr_t)base, (intptr_t)base, width * height );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] vseg resized\n", __FUNCTION__ );
-#endif
-
-    // 6. fill buffer extension if required
-    if( new_size > old_size )  memset( base + old_size , 0 , new_size - old_size );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] buffer extension initialized\n", __FUNCTION__ );
-#endif
-
-    // 7. gives the window the highest priority 
-    xlist_unlink( xlist_entry_xp );
-    xlist_add_last( windows_root_xp , xlist_entry_xp );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] set high priority\n", __FUNCTION__ );
-#endif
-
-    // 8. release the lock protecting windows in write mode
-    remote_rwlock_wr_release( windows_lock_xp );
- 
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] lock released\n", __FUNCTION__ );
-#endif
-
-    // 9. reset the "hidden" flag in window descriptor
-    hal_remote_s32( XPTR( window_cxy , &window_ptr->hidden ) , false );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] hidden reset\n", __FUNCTION__ );
-#endif
-
-    // 10. refresh the FBF for the new window position
-    fbf_update( p_min , l_min , p_min + width, l_min + height );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] refreshed new window\n", __FUNCTION__ );
-#endif
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, cycle );
-#endif
-
-    return 0;
-
-}  // end dev_fbf_resize_window()
-
-//////////////////////////////////////////////
-error_t dev_fbf_refresh_window( uint32_t  wid,
-                                uint32_t  line_min,
-                                uint32_t  line_max )
-{
-
-#if DEBUG_DEV_FBF
-thread_t  * thi   = CURRENT_THREAD;
-uint32_t    cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] enters for wid %d / first %d / last %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, wid, line_min, line_max, cycle );
-#endif
-
-    // get extended pointer on window to be refreshed
-    xptr_t window_xp  = dev_fbf_get_xptr_from_wid( wid );
-
-    if( window_xp == XPTR_NULL ) return -1;
-
-    // get cluster and local pointer on target window 
-    cxy_t          window_cxy = GET_CXY( window_xp );
-    fbf_window_t * window_ptr = GET_PTR( window_xp );
-
-    // get p_min, l_min, nlines  & npixels from window descriptor
-    uint32_t p_min   = hal_remote_l32( XPTR( window_cxy , &window_ptr->p_min ) ); 
-    uint32_t l_min   = hal_remote_l32( XPTR( window_cxy , &window_ptr->l_min ) ); 
-    uint32_t npixels = hal_remote_l32( XPTR( window_cxy , &window_ptr->width ) ); 
-    uint32_t nlines  = hal_remote_l32( XPTR( window_cxy , &window_ptr->height ) ); 
-
-    // check <line_min> and <line_max> arguments
-    if( (line_min >= nlines) || (line_max > nlines) || (line_min >= line_max) )
-    {
-        printk("\n[ERROR] in %s : illegal arguments / l_first %d / l_last %d / nlines %d\n",
-        __FUNCTION__, line_min, line_max, nlines );
-        return -1;
-    }
-
-    // update FBF 
-    fbf_update( p_min , l_min + line_min , p_min + npixels , l_min + line_max );
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit for wid %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, wid, cycle );
-#endif
-
-    return 0;
-
-}  // end dev_fbf_refresh_window()
-
-////////////////////////////////////////////
-error_t dev_fbf_front_window( uint32_t wid )
-{
-
-#if DEBUG_DEV_FBF
-thread_t  * this  = CURRENT_THREAD;
-uint32_t    cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] enters for wid %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, wid, cycle );
-#endif
-
-    // get extended pointer on window to be refreshed
-    xptr_t window_xp  = dev_fbf_get_xptr_from_wid( wid );
-
-    if( window_xp == XPTR_NULL ) return -1;
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // build extended pointer on windows lock and root
-    xptr_t  windows_lock_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-    xptr_t  windows_root_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_root );
-
-    // get cluster and local pointers on window 
-    cxy_t          window_cxy = GET_CXY( window_xp );
-    fbf_window_t * window_ptr = GET_PTR( window_xp );
-
-    // get target window coordinates, width, height, and hidden
-    uint32_t p_min     = hal_remote_l32( XPTR( window_cxy , &window_ptr->p_min ) );
-    uint32_t l_min     = hal_remote_l32( XPTR( window_cxy , &window_ptr->l_min ) );
-    uint32_t nlines    = hal_remote_l32( XPTR( window_cxy , &window_ptr->height ) );
-    uint32_t npixels   = hal_remote_l32( XPTR( window_cxy , &window_ptr->width ) );
-    bool_t   hidden    = hal_remote_l32( XPTR( window_cxy , &window_ptr->hidden ) );
-
-    // build extended pointer on window xlist_entry
-    xptr_t xlist_entry_xp =  XPTR( window_cxy , &window_ptr->xlist );
-
-    // 1. take the lock protecting windows in write mode
-    remote_rwlock_wr_acquire( windows_lock_xp );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] lock taken\n", __FUNCTION__ );
-#endif
-
-    // 2. gives the window the highest priority 
-    xlist_unlink( xlist_entry_xp );
-    xlist_add_last( windows_root_xp , xlist_entry_xp );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] set high priority \n", __FUNCTION__ );
-#endif
-
-    // 3. release the lock protecting windows from write mode
-    remote_rwlock_wr_release( windows_lock_xp );
- 
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] lock released\n", __FUNCTION__ );
-#endif
-
-    // 4. update the FBF for this window when not hidden
-    if( hidden == false ) fbf_update( p_min , l_min , p_min + npixels, l_min + nlines );
-
-#if ( DEBUG_DEV_FBF & 1 )
-printk("\n[%s] refresh window in FBF\n", __FUNCTION__ );
-#endif
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit for wid %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, wid, cycle );
-#endif
-
-    return 0;
-
-}   // end dev_fbf_front_window()
-
-/////////////////////////////////////////
-void dev_fbf_display_windows( pid_t pid )
-{
-    xptr_t  iter_xp;
-
-    // display header
-    printk("\n***** registered FBF windows *****\n"
-           "   wid   | hide  | lzero | pzero | lines | pixel | pid\n" );
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // build extended pointer on windows lock and root
-    xptr_t  lock_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-    xptr_t  root_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_root );
-
-    // take the lock in read mode
-    remote_rwlock_rd_acquire( lock_xp );
-
-    XLIST_FOREACH_BACKWARD( root_xp , iter_xp )
-    {
-        xptr_t         w_xp  = XLIST_ELEMENT( iter_xp , fbf_window_t , xlist );
-        fbf_window_t * w_ptr = GET_PTR( w_xp );
-        cxy_t          w_cxy = GET_CXY( w_xp );
-
-        uint32_t wid       = hal_remote_l32( XPTR( w_cxy , &w_ptr->wid   ) );
-        uint32_t owner_pid = hal_remote_l32( XPTR( w_cxy , &w_ptr->pid   ) );
-        uint32_t hide      = hal_remote_l32( XPTR( w_cxy , &w_ptr->hidden ) );
-        uint32_t lzero     = hal_remote_l32( XPTR( w_cxy , &w_ptr->l_min ) );
-        uint32_t pzero     = hal_remote_l32( XPTR( w_cxy , &w_ptr->p_min ) );
-        uint32_t lines     = hal_remote_l32( XPTR( w_cxy , &w_ptr->height ) );
-        uint32_t pixels    = hal_remote_l32( XPTR( w_cxy , &w_ptr->width ) );
-
-        if( (pid == 0) || (pid == owner_pid) )
-        { 
-            printk("%d\t | %d\t | %d\t | %d\t | %d\t | %d\t | %x\n",
-                    wid,   hide,  lzero, pzero, lines, pixels, pid );
-        }
-    }
-
-    // release the lock
-    remote_rwlock_rd_release( lock_xp );
-
-}  // end dev_fbf_display_windows()
-
-/////////////////////////////////
-void dev_fbf_cleanup( pid_t pid )
-{
-    xptr_t  iter_xp;
-
-    // get cluster and pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // build extended pointer on windows lock and root
-    xptr_t  lock_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_lock );
-    xptr_t  root_xp = XPTR( fbf_cxy , &fbf_ptr->ext.fbf.windows_root );
-
-    // take the lock in read mode
-    remote_rwlock_rd_acquire( lock_xp );
-
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        xptr_t         w_xp  = XLIST_ELEMENT( iter_xp , fbf_window_t , xlist );
-        fbf_window_t * w_ptr = GET_PTR( w_xp );
-        cxy_t          w_cxy = GET_CXY( w_xp );
-
-        // get owner process PID and WID
-        uint32_t   owner_pid  = hal_remote_l32( XPTR( w_cxy , &w_ptr->pid ) );
-        uint32_t   wid        = hal_remote_l32( XPTR( w_cxy , &w_ptr->wid ) );
-
-        // delete matching window
-        if( pid == owner_pid ) dev_fbf_delete_window( wid );
-    }
-
-    // release the lock from read mode
-    remote_rwlock_rd_release( lock_xp );
-
-}  // end dev_fbf_cleanup()
-
-
-
-
-///////////////////////////////////////////////
-// TODO Deprecated : january 2020 [AG]
-///////////////////////////////////////////////
-error_t dev_fbf_move_data( bool_t     is_write,
-                           void     * user_buffer,
-                           uint32_t   npixels,
-                           uint32_t   offset )
-{
-    // get pointer on calling thread
-    thread_t * this = CURRENT_THREAD;
-
-#if DEBUG_DEV_FBF
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] :  buffer %x / npixels %d / offset %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid,  
-user_buffer, npixels, offset, cycle );
-#endif
-
-    // get pointers on FBF chdev
-    xptr_t      fbf_xp  = chdev_dir.fbf[0];
-    cxy_t       fbf_cxy = GET_CXY( fbf_xp );
-    chdev_t   * fbf_ptr = GET_PTR( fbf_xp );
-
-    // get frame buffer width and height
-    uint32_t width  = hal_remote_l32 ( XPTR( fbf_cxy , &fbf_ptr->ext.fbf.width ) );
-    uint32_t height = hal_remote_l32 ( XPTR( fbf_cxy , &fbf_ptr->ext.fbf.height ) );
-
-    // check offset and npixels versus FBF size
-    if( ((offset + npixels) > (width * height)) )
-    {
-        printk("\n[ERROR] in %s : offset (%d) + npixels (%d) / width (%d) / height (%d)\n",
-        __FUNCTION__, offset, npixels, width, height ); 
-        return -1;
-    }
-
-    // register command in calling thread descriptor
-    this->fbf_cmd.dev_xp    = fbf_xp;
-    this->fbf_cmd.type      = is_write ? FBF_DRIVER_USER_WRITE : FBF_DRIVER_USER_READ;
-    this->fbf_cmd.buffer    = user_buffer;
-    this->fbf_cmd.offset    = offset;
-    this->fbf_cmd.npixels   = npixels;
-
-    // get driver command function
-    dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( fbf_cxy , &fbf_ptr->cmd ) );
-
-    // call driver 
-    cmd( XPTR( local_cxy , this ) );
-
-    error_t error = this->fbf_cmd.error;
-
-#if DEBUG_DEV_FBF
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_FBF < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-
-    // return I/O operation status
-    return error;
-
-}  // end dev_fbf_move_data()
-
-
Index: trunk/kernel/devices/dev_fbf.h
===================================================================
--- trunk/kernel/devices/dev_fbf.h	(revision 690)
+++ 	(revision )
@@ -1,419 +1,0 @@
-/*
- * dev_fbf.h - FBF (Frame Buffer) generic device API definition.
- * 
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-kernel; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _DEV_FBF_H
-#define _DEV_FBF_H
-
-#include <hal_kernel_types.h>
-#include <shared_fbf.h>
-#include <remote_rwlock.h>
-#include <bits.h>
-
-/****  Forward declarations  ****/
-
-struct chdev_s;
-
-/*****************************************************************************************
- *      Frame Buffer Controler API definition
- *
- * This device provide access to an external graphic display, that is seen
- * as a fixed size frame buffer, mapped in the kernel address space.
- * The only pixel encoding type in the current ALMOS-MKH implementation (oct 2020)
- * is one byte per pixel (256 levels of gray).
- *
- * It supports a first API, for the user syscalls, implementing a simple windows manager.
- * This windows manager allows any process to create and use for display one (or several) 
- * window(s). Each window defines a private buffer, dynamically allocated in user space,
- * that can be directly accessed by the owner process.
- * These windows can be moved in the frame buffer, they can be resized, they can overlap
- * other windows, but a window must be entirely contained in the frame buffer.
- *
- * To avoid contention, the window descriptor, and the associated user buffer are not
- * allocated in the cluster containing the FBF chdev, but are distributed: each window
- * is allocated in the cluster defined by the thread that required the window creation.
- *
- * Each window has a single process owner, but all the windows are registered in the FBF
- * chdev as a windows_tbl[] array, indexed by the window identifier (wid), and each entry
- * contains an extended pointer on the window descriptor. All windows are also registered
- * in a trans-cluster xlist, defining the overlapping order (last window in xlist has the
- * highest priority). 
- *
- * To refresh a window <wid>, the owner process calls the dev_fbf_refresh_window()
- * function, that sends parallel RPC_FBF_DISPLAY requests to other cores. All cores
- * synchronously execute the dev_fbf_display() function. This function scan all windows
- * to respect the overlaping order, and updates all pixels of the <wid> window.
- * 
- * 1) This "syscall" API defines five syscalls : 
- * - FBF_GET_CONFIG     : returns the FBF width, height, and pixel encoding type.
- * - FBF_CREATE_WINDOW  : create a new window , owned by the calling process.
- * - FBF_DELETE_WINDOW  : delete a registered window. 
- * - FBF_MOVE_WINDOW    : move in FBF a registered window.
- * - FBF_REFRESH_WINDOW : request refresh of a given window.
- *
- * These 5 operations do not use the FBF device waiting queue, the associated
- * device thread and the FBF IRQ, as the client thread does NOT deschedule,
- * and does NOT call the FBF driver.
- *
- * 2) Two extra syscalls exist but are deprecated:
- * - FBF_DIRECT_WRITE   : move synchronously pixels from an user buffer to the FBF.
- * - FBF_DIRECT_READ    : move synchronously pixels from the FBF to an user buffer.
- * For these deprecated operations, the client thread calls
- * directly the driver to move data between the user buffer and the FBF.
- * 
- * 3) The FBF device defines defines four command types to access FBF driver(s) :
- * - FBF_DRIVER_KERNEL_WRITE : move pixels from a kernel window to the FBF.
- * - FBF_DRIVER_KERNEL_READ  : move pixels from the FBF to a kernel window.
- * - FBF_DRIVER_USER_WRITE   : move bytes from an user buffer to the FBF. 
- * - FBF_DRIVER_USER_READ    : move bytes from the FBF to an user buffer. 
- *
- * Note: As we don't use any external DMA to move data to or from the frame buffer,
- * but only software memcpy, there is no L2/L3 coherence issue for this device.
- *
- *****************************************************************************************/
-
-/******************************************************************************************
- * This defines the (implementation independant) extension for the generic FBF device.
- *****************************************************************************************/
-
-typedef struct fbf_extend_s
-{
-    remote_rwlock_t windows_lock;        /*! lock protecting windows xlist               */
-    xlist_entry_t   windows_root;        /*! root of the windows xlist                   */
-
-    xptr_t          windows_tbl[CONFIG_FBF_WINDOWS_MAX_NR];         /*! window desc.     */
-    bitmap_t        windows_bitmap[CONFIG_FBF_WINDOWS_MAX_NR >> 5]; /*! wid allocator    */
-
-    uint32_t        width;               /*! Frame Buffer number of pixels per line.     */
-    uint32_t        height;              /*! Frame Buffer total number of lines.         */
-    uint32_t        subsampling;         /*! Frame Buffer pixel encoding type.           */
-}
-fbf_extend_t;
-
-/******************************************************************************************
- * This enum defines the various implementations of the generic FBF peripheral.
- * It must be kept consistent with the define in arch_info.h file.
- *****************************************************************************************/
-
-typedef enum
-{
-    IMPL_FBF_SCL =   0,     
-    IMPL_FBF_I86 =   1,  
-} 
-fbf_impl_t;
-
-/******************************************************************************************
- * This structure defines the FBF command for all drivers implementing the FBF device.
- *****************************************************************************************/
-
-typedef enum
-{
-    FBF_DRIVER_USER_READ     = 1,
-    FBF_DRIVER_USER_WRITE    = 2,
-    FBF_DRIVER_KERNEL_READ   = 3,
-    FBF_DRIVER_KERNEL_WRITE  = 4,
-}
-fbf_driver_cmd_type_t;
-
-typedef struct fbf_command_s
-{
-    xptr_t      dev_xp;        /*! extended pointer on device descriptor                 */
-    uint32_t    type;          /*! requested driver operation type.                      */
-    uint32_t    npixels;       /*! number of bytes.                                      */
-    uint32_t    offset;        /*! offset in frame buffer (pixels)                       */
-    void      * buffer;        /*! pointer on memory buffer (kernel or user)             */
-    uint32_t    error;         /*! operation status (0 if success)                       */
-}
-fbf_command_t;
-
-/******************************************************************************************
- * This structure defines an FBF window descriptor, allocated to a given user process.
- * The window descriptor and the associated buffer are allocated in the cluster where
- * is running the thread requesting the window creation.
- * The <wid> allocator, the window_tbl[] array, and the root of the xlist of windows are
- * imlemented in the FBF device extension.
- *****************************************************************************************/
-
-typedef struct fbf_window_s
-{
-    pid_t          pid;         /*! owner process identifier                             */
-    uint32_t       wid;         /*! window identifier                                    */
-    uint32_t       height;      /*! number of lines in window                            */
-    uint32_t       width;       /*! number of pixels per line in window                  */
-    uint32_t       l_min;       /*! first line index in FBF                              */
-    uint32_t       p_min;       /*! first pixel index in FBF                             */
-    uint8_t      * buffer;      /*! pointer on buffer in user space                      */
-    bool_t         hidden;      /*! no display on FBF when true                          */
-    xlist_entry_t  xlist;       /*! member of registered FBF windows list                */
-}
-fbf_window_t;
-
-
-/******************************************************************************************
- * This function returns a printable string for a given FBF user command  <cmd_type>.
- * WARNING : It must be kept consistent with the enum in the <shared_fbf.h> file
- ******************************************************************************************
- * @ cmd_type   :  FBF user command type (defined in shared_fbf.h file).
- * @ returns a string pointer.
- *****************************************************************************************/
-char * dev_fbf_cmd_str( uint32_t cmd_type );
-
-/******************************************************************************************
- * This function checks that the calling process is the owner of the window identified
- * by the <wid> argument, and returns an extended pointer on the window descriptor.
- * It can be called by a thread running in any cluster.
- ******************************************************************************************
- * @ wid        :  FBF window kernel identifier.
- * @ returns XPTR on the window if success / return XPT_NULL if not owner or undefined.
- *****************************************************************************************/
-xptr_t dev_fbf_get_xptr_from_wid( uint32_t wid );
-
-/******************************************************************************************
- * This function completes the FBF chdev descriptor initialisation.
- * It calls the specific driver initialisation function, to initialise the hardware
- * device, and the chdev extension. It must be called by a local thread.
- ******************************************************************************************
- * @ chdev      : pointer on FBF chdev descriptor.
- *****************************************************************************************/
-void dev_fbf_init( struct chdev_s * chdev );
-
-/******************************************************************************************
- * This function implements the fbf_get_config() syscall, and returns the FBF
- * size and type. It can be called by a client thread running in any cluster.
- * It does NOT access the hardware, as the size and type have been registered
- * in the chdev descriptor extension by the dev_fbf_init() function.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ width     : [out] number of pixels per line.
- * @ height    : [out] total number of lines.
- * @ type      : [out] pixel encoding type.
- *****************************************************************************************/
-void dev_fbf_get_config( uint32_t  * width,
-                         uint32_t  * height,
-                         uint32_t  * type );
-
-/******************************************************************************************
- * This function implements the fbf_create_window() syscall.
- * It registers a new window in the windows_tbl[] array, and the windows list,
- * registers in the reference cluster an ANON vseg, that will be mapped in local cluster. 
- * The window index <wid> is dynamically allocated. The owner is the calling process.
- * The FBF window is defined by the <nlines>, <npixels>, <l_min>, <p_min> arguments.
- * It can be called by any thread running in any cluster. As the vseg is not directly 
- * mapped to the frame buffer, the owner process can access this private buffer without
- * syscall. As for any vseg, the physical memory is allocated on demand at each page fault.
- * The created vseg base address in user space is returned in the <user_base> argument.
- * The created window is set in "hidden" mode.
- ******************************************************************************************
- * Implementation note:
- * 1. it allocates memory in the local cluster for the window descriptor,
- * 2. it creates in the associated vseg,
- * 3. it initializes the window descriptor,
- * 4. it takes the lock protecting the windows in write mode,
- * 5. it allocates a new  <wid>,
- * 6. it registers the window in the window_tbl[] array,
- * 7. it registers the window in the FBF rooted windows list,
- * 8. it releases the lock protecting windows.
- ******************************************************************************************
- * @ nlines      : [in]  number of lines in window.
- * @ npixels     : [in]  number of pixels per line in window.
- * @ l_min       : [in]  first pixel index in FBF reference.
- * @ p_min       : [in]  first line index in FBF reference.
- * @ user_base   : [out] pointer on allocated buffer base in user space.
- * @ return the <wid> index if success / returns -1 if failure
- *****************************************************************************************/
-uint32_t dev_fbf_create_window( uint32_t   nlines,
-                                uint32_t   npixels,
-                                uint32_t   l_min,
-                                uint32_t   p_min,
-                                intptr_t * user_base );
-
-
-/******************************************************************************************
- * This function implements the fbf_active_wiindow syscall. It set or reset the "hidden"
-*  flag for the window identified by the <wid> argument as specified by <active> argument.
- ******************************************************************************************
- * @ wid       : [in] window index in window_tbl[].
- * @ active    : [in] set hidden flag if zero / rest hidden flag if non zero.
- * @ returns 0 if success / returns -1 if wid not registered.
- *****************************************************************************************/
-error_t dev_fbf_active_window( uint32_t wid,
-                               uint32_t active );
-
-/******************************************************************************************
- * This function implements the fbf_delete_window() syscall to delete a FBF window,
- * and release all memory allocated for this window and for the associated vseg.
- * releases the memory allocated for the window buffer and for the window descriptor.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * Implementation note:
- * 1. it set the "hidden" flag in the window descriptor,
- * 2. it refresh the window in FBF,
- * 3. it takes the lock protecting windows in write mode,
- * 4. it removes the window from windows_tbl[] array,
- * 5. it removes the window from xlist,      
- * 6. it releases the wid to bitmap,
- * 7. it releases the lock protecting windows from write mode,
- * 8. it releases the memory allocated for window descriptor,
- * 9. it deletes the associated vseg in all clusters
- ******************************************************************************************
- * @ wid       : [in] window index in window_tbl[].
- * @ returns 0 if success / returns -1 if wid not registered.
- *****************************************************************************************/
-error_t dev_fbf_delete_window( uint32_t wid );
-                                
-/******************************************************************************************
- * This function implements the fbf_move_window() syscall.
- * It moves a window identified by the <wid> argument to a new position in the FBF,
- * defined by the <l_min> and <p_min> arguments.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * Implementation note:
- * 1. it set the "hidden" flag in window descriptor,
- * 2. it refresh the FBF for the current window position,
- * 3. it takes the lock protecting windows in write mode,
- * 4. it set the new coordinates in the window descriptor,
- * 5. it gives the modified window the highest priority,
- * 6. it releases the lock protecting windows,
- * 7. it reset the "hidden" flag in window descriptor,
- * 8. it refresh the FBF for the new window position,
- ******************************************************************************************
- * @ wid       : [in] window index in window_tbl[].
- * @ l_min     : [in] new first pixel index in FBF reference.
- * @ p_min     : [in] new first line index in FBF reference.
- * @ returns 0 if success / returns -1 if illegal arguments.
- *****************************************************************************************/
-error_t dev_fbf_move_window( uint32_t wid,
-                             uint32_t l_min,
-                             uint32_t p_min );
-
-/******************************************************************************************
- * This function implements the fbf_resize_window() syscall.
- * It changes the <width> and <height> of a window identified by the <wid> argument.
- * It updates the associated vseg "size" if required, but does not change the vseg "base".
- * When the new window buffer is larger than the existing one, it is 0 filled.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * Implementation note:
- * 1.  it set the "hidden" flag in window descriptor,
- * 2.  it refresh the FBF for the current window,
- * 3.  it takes the lock protecting windows in write mode,
- * 4.  it set the new size in the window descriptor,
- * 5.  it resizes the associated vseg if required,
- * 6.  it fill the user buffer with zero if required,
- * 7.  it gives the modified window the highest priority,
- * 8.  it releases the lock protecting windows,
- * 9.  it reset the "hidden" flag in window descriptor,
- * 10. it refresh the FBF for the new window,
- ******************************************************************************************
- * @ wid       : [in] window index in window_tbl[].
- * @ width     : [in] new number of pixels per line.
- * @ height    : [in] new number of lines.
- * @ returns 0 if success / returns -1 if illegal arguments.
- *****************************************************************************************/
-error_t dev_fbf_resize_window( uint32_t wid,
-                               uint32_t width,
-                               uint32_t height );
-
-/******************************************************************************************
- * This function implements the fbf_refresh_window() syscall.
- * It allows an owner process to signal the windows manager that some lines of a window
- * identified by the <wid>, <line_min>, and <line_max> argument have been modified, and
- * must be refreshed in the FBF.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * Implementation note:
- * it simply checks the arguments, and calls the fbf_update() function.
- ******************************************************************************************
- * @ wid        : [in] window index in window_tbl[]
- * @ line_min   : [in] first line index in window in window referencd.
- * @ line_max   : [in] last line index in window in window reference (excluded).
- * @ returns 0 if success / returns -1 if wid not registered.
- *****************************************************************************************/
-error_t dev_fbf_refresh_window( uint32_t wid,
-                                uint32_t line_min,
-                                uint32_t line_max );
-
-/******************************************************************************************
- * This function implements the fbf_front_window() syscall.
- * It gives the highest priority to the window identified by the <wid> argument,
- * and refresh the FBF accordingly.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * Implementation note:
- * 1. it takes the lock protecting windows in write mode,
- * 2. it modify the xlist of windows rooted in FBF,
- * 3. it releases the lock from write mode,
- * 4. it refresh the window in FBF,
- ******************************************************************************************
- * @ wid        : [in] window index in window_tbl[]
- * @ returns 0 if success / returns -1 if wid not registered.
- *****************************************************************************************/
-error_t dev_fbf_front_window( uint32_t wid );
-
-/******************************************************************************************
- * This function displays on the TXT0 kernel terminal the list of registered FBF windows
- * rooted in the FBF device - in decreasing priority order - owned by the process
- * identified by the <pid> argument. It displays all windows when pid value is 0.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ pid       : [in] target process identifier / all processes when pid == 0
- *****************************************************************************************/
-void dev_fbf_display_windows( pid_t pid );
-
-/******************************************************************************************
- * This function deletes all FBF windows owned by the process identified by 
- * the <pid> argument. It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ pid       : [in] target process identifier.
- *****************************************************************************************/
-void dev_fbf_cleanup( pid_t pid );
-
-
-
-
-
-
-
-/******************************************************************************************
- * TODO : This function is deprecated ( january 2020 [AG] ). It was defined 
- * to implement the fbf_read() and fbf_write() deprecated syscalls.
- ******************************************************************************************
- * It  moves <length> bytes between the frame buffer, starting from pixel defined
- * by the <offset> argument, and an user buffer defined by the <user_buffer> argument.
- * The transfer direction are defined by the <is_write> argument.
- * An error is returned when <offset> + <npixels> is larger than the FBF size.
- * The request is registered in the client thread descriptor, but the client thread is
- * not descheduled, and calls directly the FBF driver.
- * It can be called by a client thread running in any cluster.
- ******************************************************************************************
- * @ is_write    : [in] write FBF weh true / read FBF when false
- * @ user_buffer : [in] pointer on memory buffer in user space.
- * @ npixels     : [in] number of bytes.
- * @ offset      : [in] first byte in frame buffer.    
- * @ returns 0 if success / returns -1 if error.
- *****************************************************************************************/
-error_t dev_fbf_move_data( bool_t     is_write,
-                           void     * user_buffer,
-                           uint32_t   npixels,
-                           uint32_t   offset );
-
-#endif	/* _DEV_FBF_H */
Index: trunk/kernel/devices/dev_icu.c
===================================================================
--- trunk/kernel/devices/dev_icu.c	(revision 1)
+++ trunk/kernel/devices/dev_icu.c	(revision 1)
@@ -0,0 +1,492 @@
+/*
+ * dev_icu.c - ICU (Interrupt Controler Unit) generic device API implementation.
+ *
+ * Authors   Alain Greiner  (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <hal_types.h>
+#include <hal_special.h>
+#include <device.h>
+#include <thread.h>
+#include <cluster.h>
+#include <printk.h>
+#include <memcpy.h>
+#include <spinlock.h>
+#include <soclib_xcu.h>
+#include <dev_icu.h>
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Extern global variables
+/////////////////////////////////////////////////////////////////////////////////////////
+
+extern devices_directory_t  devices_dir;         // allocated in kernel_init.c
+
+extern devices_input_irq_t  devices_input_irq;   // allocated in kernel_init.c
+
+
+///////////////////////////////////
+void dev_icu_init( xptr_t   dev_xp,
+                   uint32_t hwi_nr,
+                   uint32_t wti_nr,
+                   uint32_t pti_nr )
+{
+    // get ICU device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    if( dev_cxy != local_cxy )
+    {
+        printk("\n[PANIC] %s for cluster %x must be local\n",
+               __FUNCTION__ , local_cxy );
+        hal_core_sleep();
+    }
+
+    // set ICU device extension fields
+    dev_ptr->ext.icu.hwi_nr     = hwi_nr;
+    dev_ptr->ext.icu.wti_nr     = wti_nr;
+    dev_ptr->ext.icu.pti_nr     = pti_nr;
+    dev_ptr->ext.icu.wti_bitmap = 0;
+    spinlock_init( &dev_ptr->ext.icu.wti_lock );
+   
+    // get implementation index from ICU device descriptor
+    uint32_t impl = dev_ptr->impl;
+
+    // set field "name" in device descriptor
+    // and call the relevant driver init function
+    if( impl == IMPL_ICU_XCU )
+    {
+        memcpy( dev_ptr->name , "ICU_XCU" , 16 );
+
+        uint32_t     lid;
+        cluster_t  * cluster = LOCAL_CLUSTER;
+        for( lid = 0 ; lid < cluster->cores_nr ; lid++ )
+        {
+            soclib_xcu_init( dev_ptr , lid );
+        }
+    }
+    else
+    {
+        printk("\n[PANIC] %s : undefined ICU implementation for cluste %x\n",
+               __FUNCTION__ , local_cxy );
+        hal_core_sleep();
+    }
+} // end dev_icu_init()
+
+/////////////////////////////////////////////////////////////////////////////////////
+// This static function check the irq_type / irq_index arguments for a remote ICU.
+// It is called by the dev_icu_enable_irq() & dev_icu_disable_irq() functions.
+// returns 0 if OK / returns non zero if invalid arguments
+/////////////////////////////////////////////////////////////////////////////////////
+static inline void dev_icu_check_irq( xptr_t     icu_xp,
+                                      uint32_t   irq_type,
+                                      uint32_t   irq_index )
+{
+    // get cluster and local pointer on remote ICU
+    cxy_t      icu_cxy = GET_CXY( icu_xp );
+    device_t * icu_ptr = (device_t *)GET_PTR( icu_xp );
+
+    if( irq_type == HWI_TYPE ) 
+    {
+        if( irq_index >= hal_remote_lw( XPTR( icu_cxy , &icu_ptr->ext.icu.hwi_nr ) ) )
+        {
+            printk("\n[PANIC] in %s : illegal HWI index = %d for ICU in cluster %x\n",
+                   __FUNCTION__ , irq_index , icu_cxy );
+            hal_core_sleep();
+        }
+    }
+    if( irq_type == WTI_TYPE )
+    {
+        if( irq_index >= hal_remote_lw( XPTR( icu_cxy , &icu_ptr->ext.icu.wti_nr ) ) )
+        {
+            printk("\n[PANIC] in %s : illegal WTI index = %d for ICU in cluster %x\n",
+                   __FUNCTION__ , irq_index , icu_cxy );
+            hal_core_sleep();
+        }
+    }
+    if( irq_type == PTI_TYPE )
+    {
+        if( irq_index >= hal_remote_lw( XPTR( icu_cxy , &icu_ptr->ext.icu.pti_nr ) ) )
+        {
+            printk("\n[PANIC] in %s : illegal PTI index = %d for ICU in cluster %x\n",
+                   __FUNCTION__ , irq_index , icu_cxy );
+            hal_core_sleep();
+        }
+    }
+}  // end dev_icu check irq()
+
+////////////////////////////////////////////
+void dev_icu_enable_irq( cxy_t      icu_cxy,
+                         lid_t      lid,
+                         uint32_t   irq_type,
+                         uint32_t   irq_index,
+                         xptr_t     src_dev_xp )
+{
+    // get extended pointer & local pointer on remote ICU device
+    xptr_t     icu_xp  = devices_dir.icu[icu_cxy];
+    device_t * icu_ptr = (device_t *)GET_PTR( icu_xp );
+
+    // check IRQ type and index
+    dev_icu_check_irq( icu_xp , irq_type , irq_index );
+
+    // (1) call implementation specific ICU driver to enable IRQ
+    if( icu_ptr->impl == IMPL_ICU_XCU ) 
+    {
+        soclib_xcu_enable_irq( icu_xp , 1<<irq_index , irq_type , lid );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s : undefined ICU implementation" , __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // (2) get selected remote core local pointer, and register
+    // source device xptr in relevant interrupt vector
+
+    core_t * core_ptr = hal_remote_lpt( XPTR( icu_cxy , &LOCAL_CLUSTER->core_tbl[lid] ) );
+    xptr_t   core_xp  = XPTR( icu_cxy , core_ptr );
+	core_set_irq_vector_entry( core_xp , irq_type , irq_index , src_dev_xp );
+
+    // (3) get extended pointer on source device, and 
+    // register IRQ type and index in source device descriptor
+
+    cxy_t      src_dev_cxy = GET_CXY( src_dev_xp );
+    device_t * src_dev_ptr = (device_t *)GET_PTR( src_dev_xp );
+
+    hal_remote_sw( XPTR( src_dev_cxy , &src_dev_ptr->irq_type ) , irq_type );
+    hal_remote_sw( XPTR( src_dev_cxy , &src_dev_ptr->irq_id   ) , irq_index );
+
+}  // end dev_icu_enable_irq()
+
+/////////////////////////////////////////////
+void dev_icu_disable_irq( cxy_t      icu_cxy,
+                          lid_t      lid,
+                          uint32_t   irq_type,
+                          uint32_t   irq_index )
+{
+    // get extended pointer & local pointer on remote ICU device
+    xptr_t  icu_xp = devices_dir.icu[icu_cxy];
+    device_t * icu_ptr = (device_t *)GET_PTR( icu_xp );
+
+    // check IRQ type and index
+    dev_icu_check_irq( icu_xp , irq_type , irq_index );
+
+    // (1) call the implementation specific ICU driver to disable IRQ 
+    if( icu_ptr->impl == IMPL_ICU_XCU ) 
+    {
+        soclib_xcu_disable_irq( icu_xp , 1<<irq_index , irq_type , lid );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s : undefined ICU implementation" , __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // (2) get selected remote core local pointer, and remove
+    // the source device xptr from relevant interrupt vector
+
+    core_t * core_ptr = hal_remote_lpt( XPTR( icu_cxy , &LOCAL_CLUSTER->core_tbl[lid] ) );
+    xptr_t   core_xp  = XPTR( icu_cxy , core_ptr );
+	core_set_irq_vector_entry( core_xp , irq_type , irq_index , XPTR_NULL );
+
+} // end dev_icu_disable_irq()
+
+//////////////////////////////////////////////
+void dev_icu_set_period( uint32_t   pti_index,
+                         uint32_t   period )
+{
+    // get pointer on local ICU device descriptor
+    core_t   * core = CURRENT_CORE;
+    device_t * icu  = core->icu;
+
+    // check PTI index
+    if( pti_index >= icu->ext.icu.pti_nr ) 
+    {
+        printk("\n[PANIC] in %s : illegal PTI index = %d\n", __FUNCTION__ , pti_index );
+        hal_core_sleep();
+    }
+
+    // call the implementation specific driver ICU to set period 
+    if( icu->impl == IMPL_ICU_XCU ) 
+    {
+        soclib_xcu_set_period( icu , pti_index , period );
+    }
+}  // end dev_icu_set_period()
+
+////////////////////////////////////////////
+void dev_icu_ack_timer( uint32_t pti_index )
+{
+    // get pointer on local ICU device descriptor
+    core_t   * core = CURRENT_CORE;
+    device_t * icu  = core->icu;
+
+    // check PTI index
+    if( pti_index >= icu->ext.icu.pti_nr ) 
+    {
+        printk("\n[PANIC] in %s : illegal PTI index = %d\n", __FUNCTION__ , pti_index );
+        hal_core_sleep();
+    }
+
+    // call the implementation specific driver ICU to acknowledge PTI IRQ
+    if( icu->impl == IMPL_ICU_XCU ) 
+    {
+        soclib_xcu_ack_timer( icu , pti_index );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s : undefined ICU implementation" , __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+}  // end dev_icu_ack_timer()
+
+////////////////////////////////////
+void dev_icu_send_ipi( cxy_t    cxy,
+                       lid_t    lid )
+{
+    // check arguments 
+    cluster_t * cluster  = LOCAL_CLUSTER;
+    uint32_t    y_width  = cluster->y_width;
+    uint32_t    x_size   = cluster->x_size;
+    uint32_t    y_size   = cluster->y_size;
+    uint32_t    cores_nr = cluster->cores_nr;
+    uint32_t    x = cxy >> y_width;
+    uint32_t    y = cxy & ((1<<y_width)-1);
+
+    if( (x >= x_size) || (y >= y_size) )
+    {
+        hal_core_sleep("%s : illegal cluster identifier = %x\n", __FUNCTION__ , cxy );
+    } 
+    if( lid >= cores_nr )
+    {
+        hal_core_sleep("%s : illegal core local index = %d\n", __FUNCTION__ , lid );
+    } 
+
+    // get extended pointer on target ICU device
+    xptr_t icu_xp = devices_dir.icu[cxy];
+
+     // get target ICU cluster and local pointer
+    cxy_t      cxy_icu = GET_CXY( icu_xp );
+    device_t * ptr_icu = (device_t *)GET_PTR( icu_xp );
+
+    // get driver implementation from target ICU device
+    uint32_t impl = hal_remote_lw( XPTR( cxy_icu , &ptr_icu->impl ) );   
+
+    // call the implementation specific ICU driver to send IPI
+    if( impl == IMPL_ICU_XCU ) 
+    {
+        soclib_xcu_send_ipi( icu_xp , lid );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s : undefined ICU implementation" , __FUNCTION__ );
+        hal_core_sleep();
+    }
+}  // end dev_icu_send_ipi()
+
+//////////////////////////
+void dev_icu_irq_handler()
+{
+    uint32_t   hwi_status;   // HWI index + 1  / no pending HWI if 0
+    uint32_t   wti_status;   // WTI index + 1  / no pending WTI if 0
+    uint32_t   pti_status;   // PTI index + 1  / no pending PTI if 0
+    xptr_t     src_dev_xp;   // extended pointer on source device descriptor
+    cxy_t      src_dev_cxy;  // source device cluster
+    device_t * src_dev_ptr;  // source device local pointer
+    uint32_t   index;        // IRQ index
+
+    // get pointer on local ICU device descriptor
+    core_t   * core = CURRENT_CORE;
+    device_t * icu  = core->icu;
+
+    // call the implementation specific ICU driver  
+    // to return highest priority pending IRQ of each type
+    if( icu->impl == IMPL_ICU_XCU )
+    {
+        soclib_xcu_get_status( icu , core->lid , &hwi_status , &wti_status , &pti_status );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s : undefined ICU implementation" , __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // analyse ICU status and handle up to 3 pending IRQ (one WTI, one HWI, one PTI)
+
+    if( wti_status )          // pending WTI TODO what about IPIs ???  [AG]
+	{
+        index = wti_status - 1;
+
+        // get extended pointer on IRQ source device
+		src_dev_xp  = core->wti_vector[index];
+        src_dev_cxy = GET_CXY( src_dev_xp );
+        src_dev_ptr = (device_t *)GET_PTR( src_dev_xp );
+
+		if( src_dev_xp == XPTR_NULL )        // strange, but not fatal => disable IRQ
+		{
+            printk("\n[WARNING] in %s : no handler for WTI %d on core %d in cluster %x\n",
+                   __FUNCTION__ , index , core->lid , local_cxy );
+	        core->spurious_irqs ++;
+            dev_icu_disable_irq( local_cxy , core->lid , WTI_TYPE , index ); 
+		}
+        else if( src_dev_cxy != local_cxy )  // WTI must be handled in device cluster
+        {
+            printk("\n[PANIC] in %s : non local WTI %d on core %d in cluster %x\n",
+                   __FUNCTION__ , index , core->lid , local_cxy );
+            hal_core_sleep();
+        }
+        else                                 // call relevant ISR
+        {
+		    icu_dmsg("\n[INFO] %s received WTI : index = %d for cpu %d in cluster %d\n",
+                     __FUNCTION__ , index , core->lid , local_cxy );
+
+	        src_dev_ptr->isr( src_dev_ptr );
+        }
+	}
+
+	if( hwi_status )      // pending HWI
+	{
+        index = hwi_status - 1;
+
+        // get pointer on IRQ source device
+		src_dev_xp  = core->wti_vector[index];
+        src_dev_cxy = GET_CXY( src_dev_xp );
+        src_dev_ptr = (device_t *)GET_PTR( src_dev_xp );
+
+		if( src_dev_xp == XPTR_NULL )        // strange, but not fatal => disable IRQ
+		{
+            printk("\n[WARNING] in %s : no handler for HWI %d on core %d in cluster %x\n",
+                   __FUNCTION__ , index , core->lid , local_cxy );
+	        core->spurious_irqs ++;
+            dev_icu_disable_irq( local_cxy , core->lid , HWI_TYPE , index ); 
+		}
+        else if( src_dev_cxy != local_cxy )  // HWI must be handled in device cluster
+        {
+            printk("\n[PANIC] in %s : non local HWI %d on core %d in cluster %x\n",
+                   __FUNCTION__ , index , core->lid , local_cxy );
+            hal_core_sleep();
+        }
+        else                    // call relevant ISR
+        {
+		    icu_dmsg("\n[INFO] %s received HWI : index = %d for cpu %d in cluster %d\n",
+                     __FUNCTION__ , index , core->lid , local_cxy );
+
+		    src_dev_ptr->isr( src_dev_ptr );
+        }
+	}
+
+    if( pti_status )      // pending PTI
+	{
+        index = pti_status - 1;
+
+		icu_dmsg("\n[INFO] %s received PTI : index = %d for cpu %d in cluster %d\n",
+                 __FUNCTION__ , index , core->lid , local_cxy );
+
+        // acknowledge PTI
+        dev_icu_ack_timer( index );
+
+        // execute all actions related to TICK event
+        core_clock( core );
+	}
+}  // end dev_icu_irq_handler()
+
+////////////////////////////
+uint32_t dev_icu_wti_alloc()
+{
+    // get pointer on local ICU device descriptor
+    core_t   * core = CURRENT_CORE;
+    device_t * icu  = core->icu;
+
+    // get bitmap pointer, lock, and size
+    bitmap_t   * bitmap = &icu->ext.icu.wti_bitmap;
+    spinlock_t * lock   = &icu->ext.icu.wti_lock;
+    uint32_t     size   =  icu->ext.icu.wti_nr;
+
+    // get lock protecting WTI allocator
+    spinlock_lock( lock );
+
+    // get first free mailbox index
+    uint32_t index = (uint32_t)bitmap_ffc( bitmap , size );
+  
+    // set bitmap entry if found
+    if( index < size ) bitmap_set( bitmap , index );
+
+    // release lock
+    spinlock_unlock( lock );
+
+    return index;
+}  // end dev_icu_wti_alloc()
+
+//////////////////////////////////////////
+void dev_icu_wti_release( uint32_t index )
+{
+    // get pointer on local ICU device descriptor
+    core_t   * core = CURRENT_CORE;
+    device_t * icu  = core->icu;
+
+    // get bitmap pointer, lock, and size
+    bitmap_t   * bitmap = &icu->ext.icu.wti_bitmap;
+    spinlock_t * lock   = &icu->ext.icu.wti_lock;
+    uint32_t     size   =  icu->ext.icu.wti_nr;
+
+    // check index
+    if( index >= size )
+    {
+        printk("\n[PANIC] in %s : illegal WTI index = %d on core %d in cluster %x\n",
+               __FUNCTION__ , index , core->lid , local_cxy );
+        hal_core_sleep();
+    }
+
+    // get lock protecting WTI allocator
+    spinlock_lock( lock );
+
+    // clear bitmap entry 
+    bitmap_clear( bitmap , index );
+
+    // release lock
+    spinlock_unlock( lock );
+}  // end dev_icu_wti_release()
+
+///////////////////////////////////////
+xptr_t dev_icu_wti_xptr( cxy_t     cxy,
+                         uint32_t  wti_id )
+{
+    uint32_t * ptr = NULL;    // local pointer on mailbox
+    
+    // get pointer on local ICU device descriptor
+    core_t   * core = CURRENT_CORE;
+    device_t * icu  = core->icu;
+
+    // call implementation specific ICU driver
+    if( icu->impl == IMPL_ICU_XCU )
+    {
+        ptr = soclib_xcu_wti_ptr( icu , wti_id );   
+    }
+    else
+    {
+        printk("\n[PANIC] in %s : undefined ICU implementation" , __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // return extended pointer on mailbox
+    return XPTR( cxy , ptr );
+
+}   // end dev_icu_wti_xptr()
+
+
Index: trunk/kernel/devices/dev_icu.h
===================================================================
--- trunk/kernel/devices/dev_icu.h	(revision 1)
+++ trunk/kernel/devices/dev_icu.h	(revision 1)
@@ -0,0 +1,260 @@
+/*
+ * dev_icu.h - ICU (Interrupt Controler Unit) generic device API.
+ *
+ * Authors   Alain Greiner  (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DEV_ICU_H_
+#define _DEV_ICU_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <spinlock.h>
+
+/*****************************************************************************************
+ *     Generic Internal Interrupt Controler definition
+ *
+ * The ICU (Interrupt Controller Unit) device describes an internal peripheral, 
+ * acting in all clusters containing cores. He is in charge of concentrating all IRQs
+ * (interrupt requests) generated by peripherals to signal the completion of an I/O 
+ * operation. Each IRQ should be routed to the core that started the I/O operation. 
+ * The ICU device must also help the kernel to select the ISR (Interrupt Service Routine)
+ * that must be executed by the target core.
+ *
+ * This component can be implemented as a dedicated hardware, centralized or distributed
+ * in all clusters, or emulated in software, as long as it implements the specified API.
+ * For the TSAR architecture, this generic ICU device is implemented by the two hardware
+ * components soclib_xicu and and soclib_iopic, and their associated drivers.
+ *
+ * ALMOS-MKH defines three types of IRQs, that are handled iby this ICU device:
+ * - HWI : The HardWare Interrupts are generated by local internal peripherals.
+ *   They are connected to the local ICU, to be routed to a given local core.
+ * - WTI : The Write Triggered Interrupts are actually mailboxes implemented in the
+ *   local ICU. They are used to implement software IPIs (Inter-Processor-Interrupts),
+ *   or to route an IRQ generated by an external peripheral to a local core.
+ * - PTI : The Programmable Timer Interrupts are actually timers generating periodic
+ *   interrupts controled by softare and contained in the local ICU, and routed to
+ *   a local core.
+ *
+ * The max numbers of interrupts of each type in a given cluster are defined by the 
+ * CONFIG_IRQ_HWI_MAX, CONFIG_IRQ_WTI_MAX, and CONFIG_IRQ_PTI_MAX parameters. 
+ * The actual numbers (hwi_nr / wti_nr / pti_nr) for a given manycore architecture
+ * are defined in the boot_info file and stored in the ICU device extension.
+ *
+ * The generic ICU device provides three main services:
+ * 1) It allows the kernel to selectively enable/disable any IRQ (identified by its type
+ *    and index) for a given core. It is the kernel responsibility to enable a given IRQ
+ *    to the core that started the I/O operation core, as a given IRQ event should be 
+ *    handled by only one core.
+ * 2) It makes a global OR between all enabled IRQs for a given core, to interrupt
+ *    the core when at least one enabled IRQ is active.
+ * 3) It is capable to return the highest priority active IRQ of each type. The priority 
+ *    scheme depends on the ICU device implementation.
+ *
+ * To select the ISR to be executed for a given IRQ routed to a given core, ALMOS-MKH 
+ * uses three interrupts vectors, implemented as three arrays (HWI/WTI/PTI),
+ * stored in the core descriptor. Each entry in one interrupt vector array contains
+ * an extended pointer on the device descriptor that is the "source" of the interrupt.
+ * This device descriptor contains a link to the ISR to be executed.
+ *
+ * The ICU peripheral does not execute I/O operations, but is just acting as a 
+ * dynamically configurable interrupt router for another I/O operation.
+ * Therefore, ALMOS-MKH does not use the iCU device waiting queue, but calls directly 
+ * the ICU driver blocking functions, using the device lock to get exclusive access to 
+ * the ICU device state.
+ ****************************************************************************************/
+ 
+/****  Forward declarations  ****/
+
+struct device_s;
+
+/*****************************************************************************************
+ * This defines the (implementation independant) extension for the generic ICU device.
+ ****************************************************************************************/
+
+typedef struct icu_extend_s
+{
+    uint32_t    hwi_nr;         /*! actual number of HWI IRQs in the ICU device         */
+    uint32_t    wti_nr;         /*! actual number of WTI IRQs in the ICU device         */
+    uint32_t    pti_nr;         /*! actual number of PTI IRQs in the ICU device         */
+    uint32_t    wti_bitmap;     /*! WTI mailbox allocator / 0 == free entry             */
+    spinlock_t  wti_lock;       /*! lock protecting WTI mailbox allocator               */
+}
+icu_extend_t;
+
+/*****************************************************************************************
+ * This enum defines the various implementations of the ICU internal interrupt controller.
+ * This array must be kept consistent with the define in arch_info.h file
+ ****************************************************************************************/
+
+enum icu_impl_e
+{
+    IMPL_ICU_XCU =   0,         /* vci_xicu component used in TSAR                      */
+    IMPL_ICU_I86 =   1          /* TBD                                                  */
+}
+icu_impl_t;
+
+/*****************************************************************************************
+ * This enum defines the three types of interrupts.
+ ****************************************************************************************/
+
+typedef enum irq_type
+{
+    HWI_TYPE,                   /*! Hardware Interrupt                                  */
+    WTI_TYPE,                   /*! Write Triggered Interrupt                           */
+    PTI_TYPE                    /*! Programmable Timer Interrupt                        */
+}
+irq_type_t;
+
+
+/*****************************************************************************************
+ * This function makes two initialisations:
+ * - It initialises the ICU specific fields of the device descriptor.
+ * - it initialises the implementation specific ICU hardware device and associated
+ *   data structures if required.
+ * It must be executed once in the cluster containing the ICU device descriptor.
+ *****************************************************************************************
+ * @ icu_xp     : extended pointer on ICU device descriptor.
+ * @ hwi_nr     : number of HWI irqs.
+ * @ wti_nr     : number of WTI irqs.
+ * @ pti_nr     : number of PTI irqs.
+ ****************************************************************************************/
+void dev_icu_init( xptr_t    icu_xp,
+                   uint32_t  hwi_nr,
+                   uint32_t  wti_nr,
+                   uint32_t  pti_nr );
+
+/*****************************************************************************************
+ * This function enables the routing of a given IRQ, to a given core in a remote cluster.
+ * This IRQ is identified by its type (HWI/WTI/PTI) and index in the remote ICU.
+ * The target core is identified by its local index.
+ * As it uses remote accesses, it can be executed by any thread in any cluster.
+ * - It unmask the selected IRQ in the remote ICU. 
+ * - It registers the extended pointer on the "source" device descriptor in the
+ *   relevant interrupt vector of the selected core.
+ * - It register the IRQ type and index in the "source" device descriptor.
+ *****************************************************************************************
+ * @ cxy        : remote cluster identifier (can be the local custer).
+ * @ lid        : local index of selected core in remote cluster.
+ * @ irq_type   : HWI/WTI/PTI.
+ * @ irq_id     : IRQ index in remote ICU
+ * @ src_dev_xp : extended pointer on device descriptor source of IRQ.
+ ****************************************************************************************/
+void dev_icu_enable_irq( cxy_t      cxy,
+                         lid_t      lid,
+                         uint32_t   irq_type,
+                         uint32_t   irq_id,
+                         xptr_t     src_dev_xp );
+
+/*****************************************************************************************
+ * This function disables one given IRQ for a given core in a remote cluster.
+ * This IRQ is identified by its type (HWI/WTI/PTI) and index in the remote ICU.
+ * The core is identified by its local index.
+ * As it uses remote accesses, it can be executed by any thread in any cluster.
+ * - It mask the selected IRQ in the remote ICU. 
+ * - It removes the extended pointer on the "source" device descriptor from the
+ *   relevant interrupt vector of the selected core.
+ * - The IRQ type and index fields are not modified in the "source" device descriptor.
+ *****************************************************************************************
+ * @ cxy       : remote cluster identifier (can be the local custer).
+ * @ lid       : local index of selected core in remote cluster.
+ * @ irq_type  : HWI/WTI/PTI.
+ * @ irq_id    : IRQ index.
+ ****************************************************************************************/
+void dev_icu_disable_irq( cxy_t      cxy,
+                          lid_t      lid,
+                          uint32_t   irq_type,
+                          uint32_t   irq_id );
+                        
+/*****************************************************************************************
+ * This function set the period value for a timer identified by the PTI index,
+ * in the local ICU device descriptor.
+ *****************************************************************************************
+ * @ pti_id    : PTI index.
+ * @ period    : number of cycles.
+ ****************************************************************************************/
+void dev_icu_set_period( uint32_t   pti_id,
+                         uint32_t   period );
+
+/*****************************************************************************************
+ * This function acknowledge a PTI IRQ for a timer identified by the PTI index,
+ * in the local ICU device descriptor.
+ *****************************************************************************************
+ * @ pti_id    : PTI index.
+ ****************************************************************************************/
+void dev_icu_ack_timer( uint32_t   pti_id );
+
+/*****************************************************************************************
+ * This function send an IPI (Inter Processor Interrupt) to a core identified by
+ * its cluster identifier and local index. 
+ * This IPI force a context switch, and the handling of pending RPC(s).
+ *****************************************************************************************
+ * @ cxy      : destination cluster identifier.
+ * @ lid      : destination core local index.
+ * @ return 0 if success (IPI registered) / returns EINVAL if illegal cxy or lid.
+ ****************************************************************************************/
+void dev_icu_send_ipi( cxy_t    cxy,
+                       lid_t    lid );
+
+/*****************************************************************************************
+ * This function is called by a core when it receives an IRQ from the ICU device.
+ * It access the local ICU device descriptor to get the highest priority IRQ
+ * of each type (HWI / WTI / PTI).
+ * - If it is a WTI or an HWI, the function uses the calling core interrupt-vectors
+ *   to call the relevant ISR, registered in the source device descriptor.
+ * - If it is a PTI, the source device descriptor is the ICU device itself, and it 
+ *   call the core_clock() function to execute all operations related to the TICK event.
+ ****************************************************************************************/
+void dev_icu_irq_handler();
+
+/*****************************************************************************************
+ * This function implements the WTI mailbox allocator. It is used by all I/O operations
+ * for completion signaling.
+ * If there is no mailbox available, the client thread must deschedule and retry later.
+ * If N is the total number of WTI mailboxes in a cluster, and NC the number of cores,
+ * the number of dynamically allocatable WTI mailboxes is (N-NC) because the first N
+ * WTI mailboxes are used by the IPIs (one IPI per core).
+ * It does not access the hardware device.
+ *****************************************************************************************
+ * @ return WTI index if success / returns 0xFFFFFFFF if no mailbox available.
+ ****************************************************************************************/
+uint32_t dev_icu_wti_alloc();
+
+/*****************************************************************************************
+ * This function releases a dynamically allocated WTI mailbox.
+ * It does not access the hardware device.
+ *****************************************************************************************
+ * @ wti_id   : WTI mailbox index.
+ ****************************************************************************************/
+void dev_icu_wti_release( uint32_t wti_id );
+
+/*****************************************************************************************
+ * This function returns an extended pointer on a WTI mailbox identified by its
+ * cluster identifier and local index in ICU.
+ * WARNING: we assume that all ICU hardware devices have the same local base address.
+ *****************************************************************************************
+ * @ cxy      : mailbox cluster identifier
+ * @ wti_id   : mailbox WTI index.
+ * @ returns extended pointer on mailbox register.
+ ****************************************************************************************/
+xptr_t  dev_icu_wti_xptr( cxy_t    cxy,
+                          uint32_t wti_id );
+
+#endif  /* _DEV_ICU_H_ */
Index: trunk/kernel/devices/dev_iob.c
===================================================================
--- trunk/kernel/devices/dev_iob.c	(revision 690)
+++ 	(revision )
@@ -1,133 +1,0 @@
-/*
- * dev_iob.c - IOB (bridge to external I/O) generic device API implementation.
- *
- * Authors   Alain Greiner  (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTIOBLAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <remote_busylock.h>
-#include <chdev.h>
-#include <printk.h>
-#include <string.h>
-#include <hal_drivers.h>
-#include <dev_iob.h>
-
-////////////////////////////////////
-void dev_iob_init( chdev_t * chdev )
-{
-    // set chdev name
-    strcpy( chdev->name , "iob" );
-
-    // call driver init function
-    hal_drivers_iob_init( chdev );
-}
-
-//////////////////////////////////////////
-void dev_iob_iommu_enable( xptr_t dev_xp )
-{
-    // get IOB chdev descriptor cluster and local pointer
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-
-    // get pointer on set_active function
-    iob_set_active_t * f = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->ext.iob.set_active ) );
-
-    // call relevant driver function
-    remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-    f( dev_xp , 1 );
-    remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-}
-
-///////////////////////////////////////////
-void dev_iob_iommu_disable( xptr_t dev_xp )
-{
-    // get IOB chdev descriptor cluster and local pointer
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-
-    // get pointer on set_active function
-    iob_set_active_t * f = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->ext.iob.set_active ) );
-
-    // call driver function
-    remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-    f( dev_xp , 0 );
-    remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-}
-
-////////////////////////////////////////
-void dev_iob_set_ptpr( xptr_t    dev_xp,
-                       uint32_t  wdata )
-{
-    // get IOB chdev descriptor cluster and local pointer
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-
-    // get pointer on set_ptpr function
-    iob_set_ptpr_t * f = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->ext.iob.set_ptpr ) );
-
-    // call driver function
-    remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-    f( dev_xp , wdata );
-    remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-
-}
-
-////////////////////////////////////////
-void dev_iob_inval_page( xptr_t  dev_xp,
-                         vpn_t   vpn )
-{
-    // get IOB chdev descriptor cluster and local pointer
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-
-    // get pointer on inval_page function
-    iob_inval_page_t * f = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->ext.iob.inval_page ) );
-
-    // call driver function
-    remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-    f( dev_xp , vpn );
-    remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-}
-
-///////////////////////////////////////////
-void dev_iob_get_status( xptr_t     dev_xp,
-                         uint32_t * error,
-                         uint32_t * bvar,
-                         uint32_t * srcid )
-{
-    // get IOB chdev descriptor cluster and local pointer
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-
-    // get pointer on the functions
-    iob_get_error_t * f_get_error = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->ext.iob.get_error ) );
-    iob_get_srcid_t * f_get_srcid = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->ext.iob.get_srcid ) );
-    iob_get_bvar_t  * f_get_bvar  = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->ext.iob.get_bvar  ) );
-
-    // call driver function
-    remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-    *error = f_get_error( dev_xp );
-    *srcid = f_get_srcid( dev_xp );
-    *bvar  = f_get_bvar( dev_xp );
-    remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
-}
-
Index: trunk/kernel/devices/dev_iob.h
===================================================================
--- trunk/kernel/devices/dev_iob.h	(revision 690)
+++ 	(revision )
@@ -1,134 +1,0 @@
-/*
- * dev_iob.h - IOB (bridge to external I/O) generic device API.
- *
- * Authors   Alain Greiner  (2016)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTIOBLAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _DEV_IOB_H_
-#define _DEV_IOB_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-
-/*****************************************************************************************
- *     Generic IOB (bridge to external IO peripherals) definition.
- *
- * The IOB device is used to access external peripherals. It implements an IO-MMU service 
- * for DMA transactions launched by DMA capable external peripherals.
- *
- * This IOB peripheral is acting as a dynamically configurable bridge, used for others 
- * I/O operations. Therefore, ALMOS-MKH does not use the IOB device waiting queue,
- * and calls directly the IOB driver blocking functions, using the device lock to 
- * get exclusive access to the IOB bridge internal state.
- ****************************************************************************************/
- 
-/****  Forward declarations  ****/
-
-struct chdev_s;
-
-/*****************************************************************************************
- * This defines the specific extension for the IOB chdev descriptor.
- ****************************************************************************************/
-
-typedef void     (iob_set_active_t) ( xptr_t iob_xp, uint32_t value );
-typedef void     (iob_set_ptpr_t)   ( xptr_t iob_xp, uint32_t value );
-typedef void     (iob_inval_page_t) ( xptr_t iob_xp, vpn_t vpn );
-typedef uint32_t (iob_get_bvar_t)   ( xptr_t iob_xp );
-typedef uint32_t (iob_get_srcid_t)  ( xptr_t iob_xp );
-typedef uint32_t (iob_get_error_t)  ( xptr_t iob_xp );
-
-typedef struct iob_extend_s
-{
-    iob_set_active_t  * set_active;
-    iob_set_ptpr_t    * set_ptpr;
-    iob_inval_page_t  * inval_page;
-    iob_get_bvar_t    * get_bvar;
-    iob_get_srcid_t   * get_srcid;
-    iob_get_error_t   * get_error;
-}
-iob_extend_t;
-
-/*****************************************************************************************
- * This enum defines the various implementations of the IOB generic device.
- * This array must be kept consistent with the define in arch_info.h file
- ****************************************************************************************/
-
-enum iob_impl_e
-{
-    IMPL_IOB_TSR =   0,         /* vci_iob component used in TSAR                       */
-    IMPL_IOB_I86 =   1,         /* TBD                                                  */
-}
-iob_impl_t;
-
-/*****************************************************************************************
- * This function initializes the IOB device descriptor with IOMMU disabled.
- *****************************************************************************************
- * @ chdev      :  pointer on IOB chdev descriptor.
- ****************************************************************************************/
-void dev_iob_init( struct chdev_s * chdev );
-
-/*****************************************************************************************
- * This function activates the IOMMU for the IOB device identified by its
- * extended pointer.
- *****************************************************************************************
- * @ dev_xp   : extended pointer on IOB device descriptor.
- ****************************************************************************************/
-void dev_iob_iommu_enable( xptr_t dev_xp );
-
-/*****************************************************************************************
- * This function desactivates the IO-MMU for the IOB device identified by its
- * extended pointer.
- *****************************************************************************************
- * @ dev_xp   : extended pointer on IOB device descriptor.
- ****************************************************************************************/
-void dev_iob_iommu_disable( xptr_t dev_xp );
-
-/*****************************************************************************************
- * This function set a new value in the IO-MMU PTPR register.
- *****************************************************************************************
- * @ dev_xp   : extended pointer on IOB device descriptor.
- * @ wdata    : value to be written in PTPR register.
- ****************************************************************************************/
-void dev_iob_set_ptpr( xptr_t    dev_xp,
-                       uint32_t  wdata );
-                        
-/*****************************************************************************************
- * This function invalidates an IOMMU TLB entry identified by its vpn.
- *****************************************************************************************
- * @ dev_xp   : extended pointer on IOB device descriptor.
- * @ vpn      : virtual page number in IO virtual space.
- ****************************************************************************************/
-void dev_iob_inval_page( xptr_t  dev_xp,
-                         vpn_t   vpn );
-
-/*****************************************************************************************
- * This function return informations relative to an error reported by the IOMMU.
- *****************************************************************************************
- * @ dev_xp   : extended pointer on IOB device descriptor.
- * @ error    : [out] pointer on buffer for erro type.
- * @ bvar     : [out] pointer on buffer for bad virtual address.
- * @ srcid    : [out] pointer on buffer for faulty peripheral index.
- ****************************************************************************************/
-void dev_iob_get_status( xptr_t     dev_xp,
-                         uint32_t * error,
-                         uint32_t * bvar,
-                         uint32_t * srcid );
-
-#endif  /* _DEV_IOB_H_ */
Index: trunk/kernel/devices/dev_ioc.c
===================================================================
--- trunk/kernel/devices/dev_ioc.c	(revision 690)
+++ trunk/kernel/devices/dev_ioc.c	(revision 1)
@@ -1,6 +1,6 @@
 /*
  * dev_ioc.c - IOC (Block Device Controler) generic device API implementation.
- *
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
+ * 
+ * Author  Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -8,9 +8,9 @@
  * This file is part of ALMOS-MK
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,15 +18,18 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_gpt.h>
-#include <hal_drivers.h>
+#include <soclib_bdv.h>
+#include <soclib_hba.h>
+//#include <soclib_sdc.h>
+//#include <soclib_spi.h>
+//#include <soclib_rdk.h>
 #include <thread.h>
 #include <printk.h>
-#include <chdev.h>
 #include <dev_ioc.h>
 
@@ -35,268 +38,263 @@
 /////////////////////////////////////////////////////////////////////////////////////////
 
-extern chdev_directory_t  chdev_dir;     // allocated in kernel_init.c
+extern devices_directory_t  devices_dir;         // allocated in kernel_init.c
+
+extern devices_input_irq_t  devices_input_irq;   // allocated in kernel_init.c
+
+//////////////////////////////////
+void dev_ioc_init( xptr_t dev_xp )
+{
+    // get IOC device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // set driver specific fields in device descriptor
+    // and call driver init function
+    if( impl == IMPL_IOC_BDV )
+    {
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_bdv_command );
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_bdv_isr );
+        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+                           XPTR( local_cxy , "IOC_BDV" ) , 16 );
+        soclib_bdv_init( dev_xp );
+    }
+    else if( impl == IMPL_IOC_HBA )
+    {
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_hba_command );
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_hba_isr );
+        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+                           XPTR( local_cxy , "IOC_HBA" ) , 16 );
+        soclib_hba_init( dev_xp );
+    }
+//    else if( impl == IMPL_IOC_SDC )
+//    {
+//        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_sdc_command );
+//        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_sdc_isr );
+//        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+//                           XPTR( local_cxy , "IOC_SDC" ) , 16 );
+//        soclib_sdc_init( dev_xp );
+//    }
+//    else if( impl == IMPL_IOC_SPI )
+//    {
+//        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_spi_command );
+//        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_spi_isr );
+//        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+//                           XPTR( local_cxy , "IOC_SPI" ) , 16 );
+//        soclib_spi_init( dev_xp );
+//    }
+//    else if( impl == IMPL_IOC_RDK )
+//    {
+//        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_rdk_command );
+//        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_rdk_isr );
+//        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+//                           XPTR( local_cxy , "IOC_RDK" ) , 16 );
+//        soclib_rdk_init( dev_xp );
+//    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined IOC device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // create server thread
+    thread_t * new_thread_ptr;
+    xptr_t     new_thread_xp;
+    error_t    error;
+
+    if( dev_cxy == local_cxy )         // device cluster is local
+    {
+        error = thread_kernel_create( &new_thread_ptr,
+                                      THREAD_DEV,
+                                      &dev_ioc_server,
+                                      dev_ptr,
+                                      cluster_select_local_core() ); 
+
+        new_thread_xp = XPTR( local_cxy , new_thread_ptr );
+    }
+    else                                    // device cluster is remote
+    {
+        rpc_thread_kernel_create_client( dev_cxy,
+                                         THREAD_DEV,
+                                         &dev_ioc_server,
+                                         dev_ptr,
+                                         &new_thread_xp,
+                                         &error );
+
+        new_thread_ptr = (thread_t *)GET_PTR( new_thread_xp );
+    }
+    if( error )
+    {
+        printk("\n[PANIC] in %s : cannot create server thread\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // set "server" field in device descriptor
+    hal_remote_spt( XPTR( dev_cxy , &dev_ptr->server ) , new_thread_ptr );
+    
+    // start server thread
+    thread_unblock( new_thread_xp , THREAD_BLOCKED_GLOBAL );
+ 
+}  // end dev_ioc_init()
+
+//////////////////////////////////////////////////////////////////////////////////
+// This static function is called by dev_ioc_read() & dev_ioc_write() functions.
+// It builds and registers the command in the calling thread descriptor, after
+// translation of buffer virtual address to physical address. 
+// Then, it registers the calling thead in device waiting queue.
+// Finally it blocks on the THREAD_BLOCKED_DEV condition and deschedule.
+////////////////////////////////////i/////////////////////////////////////////////
+static error_t dev_ioc_access( bool_t    to_mem,
+                               char    * buffer,
+                               uint32_t  lba,
+                               uint32_t  count )
+{
+    thread_t  * this      = CURRENT_THREAD;              // pointer on client thread
+    cxy_t       local_cxy = local_cxy;                   // client thread cluster
+
+    error_t     error;
+    paddr_t     buf_paddr;
+    bool_t      ident = CONFIG_KERNEL_IDENTITY;
+
+    // Get buffer physical address
+    error = vmm_v2p_translate( ident , buffer , &buf_paddr );
+ 
+    if( error )  return EINVAL;
+
+    ioc_dmsg("\n[INFO] in %s : thread %x in process %x"
+             " for lba = %x / vaddr = %x / paddr = %llx\n", 
+             __FUNCTION__ , this->trdid , this->process->pid , 
+             lba , (uint32_t)buffer , buf_paddr );
+
+#if USE_IOB    // software L2/L3 cache coherence for memory buffer 
+
+    if ( to_mem )  dev_mmc_inval( buf_paddr, count<<9 );
+    else           dev_mmc_sync( buf_paddr, count<<9 );
+
+#endif     // end software L2/L3 cache coherence
+
+    // get extended pointer on IOC device descriptor
+    xptr_t  dev_xp = devices_dir.ioc;
+
+    if ( dev_xp == XPTR_NULL )
+    {
+        printk("\n[PANIC] in %s : undefined IOC device descriptor\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get a free WTI mailbox  
+    uint32_t wti_id;
+    while( 1 )
+    {
+        wti_id = dev_icu_wti_alloc();
+        if( wti_id == -1 )  sched_yield();
+        else                break;
+    }
+
+    // enable WTI IRQ in local ICU and update WTI interrupt vector
+    dev_icu_enable_irq( local_cxy, CURRENT_CORE->lid , WTI_TYPE , wti_id , dev_xp );
+
+    // link IOC IRQ to WTI mailbox in PIC component 
+    uint32_t irq_id = devices_input_irq.ioc; 
+    dev_pic_bind_irq( irq_id , local_cxy , wti_id );
+
+    // store command in thread descriptor
+    this->dev.ioc.dev_xp    = dev_xp;
+    this->dev.ioc.to_mem    = to_mem;
+    this->dev.ioc.buf_xp    = XPTR( local_cxy , buffer );
+    this->dev.ioc.lba       = lba;
+    this->dev.ioc.count     = count;
+
+    // register client thread in waiting queue, activate server thread,
+    // block client thread on THREAD_BLOCKED_IO and deschedule.
+    // it is re-activated by the ISR signaling IO operation completion.
+    device_register_command( dev_xp , this );
+
+    // access PIC to unlink the IOC IRQ
+    dev_pic_unbind_irq( irq_id );
+
+    // disable WTI IRQ in ICU and update interrupt vector
+    dev_icu_disable_irq( local_cxy , CURRENT_CORE->lid , WTI_TYPE , wti_id );
+
+    // release  WTI mailbox
+    dev_icu_wti_release( wti_id );
+
+    ioc_dmsg("\n[INFO] in %s : thread %x in process %x completes / error = %d\n", 
+             __FUNCTION__ , this->trdid , this->process->pid , this->dev.ioc.error );
+
+    // return I/O operation status
+    return this->dev.ioc.error;  
+
+}  // end dev_ioc_access()
 
 ////////////////////////////////////////////
-char * dev_ioc_cmd_str( ioc_cmd_type_t cmd )
-{
-    if     ( cmd == IOC_READ       )  return "READ";
-    else if( cmd == IOC_WRITE      )  return "WRITE";
-    else if( cmd == IOC_SYNC_READ  )  return "SYNC_READ";
-    else if( cmd == IOC_SYNC_WRITE )  return "SYNC_WRITE";
-    else                              return "undefined";
+error_t dev_ioc_read( char         * buffer,
+                      uint32_t       lba,
+                      uint32_t       count )
+{
+    return dev_ioc_access( true , buffer , lba , count ); 
+}  
+
+////////////////////////////////////////////
+error_t dev_ioc_write( char         * buffer,
+                       uint32_t       lba,
+                       uint32_t       count )
+{
+    return dev_ioc_access( false , buffer , lba , count ); 
 }
-
-//////////////////////////////////
-void dev_ioc_init( chdev_t * ioc )
-{
-    // get channel from chdev descriptor
-    uint32_t  channel = ioc->channel;
-
-    // set chdev name
-    snprintk( ioc->name , 16 , "ioc%d" , channel );
-
-    // call driver init function
-    hal_drivers_ioc_init( ioc );
-
-    // select a core to execute the IOC server thread
-    lid_t lid = cluster_select_local_core( local_cxy );
-
-    // bind the IOC IRQ to the selected core
-    dev_pic_bind_irq( lid , ioc );
-
-    // enable IRQ
-    dev_pic_enable_irq( lid , XPTR( local_cxy , ioc ) );
-
-    // create server thread
-    thread_t * new_thread;
-    error_t    error;
-
-    error = thread_kernel_create( &new_thread,
-                                  THREAD_DEV,
-                                  &chdev_server_func,
-                                  ioc,
-                                  lid );
-
-assert( __FUNCTION__, (error == 0) , "cannot create server thread" );
-
-    // set "server" field in chdev descriptor
-    ioc->server = new_thread;
-
-    // set "chdev" field in thread descriptor
-    new_thread->chdev = ioc;
-
-    // unblock server thread
-    thread_unblock( XPTR( local_cxy , new_thread ) , THREAD_BLOCKED_GLOBAL );
-
-}  // end dev_ioc_init()
-
-////////////////////////////////////////////////////////////////////////////////////
-// This static function executes an asynchronous SYNC_READ or SYNC_WRITE request.
-// thread in the IOC device waiting queue, activates the server thread, blocks on 
-// the THREAD_BLOCKED_IO condition and deschedules.
-// The clent is re-activated by the server thread after IO operation completion.
-////////////////////////////////////////////////////////////////////////////////////
-static error_t dev_ioc_move( uint32_t   cmd_type,
-                             xptr_t     buffer_xp,
-                             uint32_t   lba,
-                             uint32_t   count )
-{
-    thread_t * this = CURRENT_THREAD;              // pointer on client thread
-
-    // get extended pointer on IOC chdev descriptor
-    xptr_t      ioc_xp  = chdev_dir.ioc[0];
-
-// check dev_xp
-assert( __FUNCTION__, (ioc_xp != XPTR_NULL) , "undefined IOC chdev descriptor" );
-
-    // register command in client thread  
-    this->ioc_cmd.dev_xp    = ioc_xp;
-    this->ioc_cmd.type      = cmd_type;
-    this->ioc_cmd.buf_xp    = buffer_xp;
-    this->ioc_cmd.lba       = lba;
-    this->ioc_cmd.count     = count;
-
-    // register client thread in IOC queue, blocks and deschedules 
-    chdev_register_command( ioc_xp );
-
-    // return I/O operation status
-    return this->ioc_cmd.error;
-
-}  // end dev_ioc_move()
-
-////////////////////////////////////////////////////////////////////////////////////
-// This static function executes a synchronous READ or WRITE request.
-// It register the command in the client thread descriptor, and calls directly
-// the driver cmd function.
-////////////////////////////////////////////////////////////////////////////////////
-error_t dev_ioc_sync_move( uint32_t   cmd_type,
-                           xptr_t     buffer_xp,
-                           uint32_t   lba,
-                           uint32_t   count )
-{
-    thread_t * this = CURRENT_THREAD;              // pointer on client thread
-
-    // get extended pointer on IOC chdev descriptor
-    xptr_t      ioc_xp  = chdev_dir.ioc[0];
-
-// check dev_xp
-assert( __FUNCTION__, (ioc_xp != XPTR_NULL) , "undefined IOC chdev descriptor" );
-
-    // register command in calling thread descriptor
-    this->ioc_cmd.dev_xp    = ioc_xp;
-    this->ioc_cmd.type      = cmd_type;
-    this->ioc_cmd.buf_xp    = buffer_xp;
-    this->ioc_cmd.lba       = lba;
-    this->ioc_cmd.count     = count;
-
-    // get driver command function
-    cxy_t       ioc_cxy = GET_CXY( ioc_xp );
-    chdev_t   * ioc_ptr = GET_PTR( ioc_xp );
-    dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( ioc_cxy , &ioc_ptr->cmd ) );
-
-    // call driver function whithout blocking & descheduling
-    cmd( XPTR( local_cxy , this ) );
-
-    // return I/O operation status
-    return this->ioc_cmd.error;
-
-}  // end dev_ioc_sync_move()
-
-///////////////////////////////////////////
-error_t dev_ioc_read( xptr_t     buffer_xp,
-                      uint32_t   lba,
-                      uint32_t   count )
-{
-
-#if DEBUG_DEV_IOC_RX
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_RX < cycle )
-printk("\n[%s] thread[%x,%x] enters IOC_READ / lba  %x / buffer[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, lba,
-GET_CXY(buffer_xp), GET_PTR(buffer_xp), cycle );
-#endif
-
-    // software L2/L3 cache coherence for memory buffer
-    if( chdev_dir.iob ) dev_mmc_inval( buffer_xp , count<<9 );
-
-    // request an asynchronous transfer
-    error_t error = dev_ioc_move( IOC_READ,
-                                  buffer_xp,
-                                  lba,
-                                  count );
-#if(DEBUG_DEV_IOC_RX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_RX < cycle )
-printk("\n[%s] thread[%x,%x] exit IOC_READ / cycle %d\n",
-__FUNCTION__, this->process->pid , this->trdid , cycle );
-#endif
-
-    return error;
-
-}  // end dev_ioc_read()
-
-///////////////////////////////////////////
-error_t dev_ioc_write( xptr_t     buffer_xp,
-                       uint32_t   lba,
-                       uint32_t   count )
-{
-
-#if DEBUG_DEV_IOC_TX
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_TX < cycle )
-printk("\n[%s] thread[%x,%x] enters IOC_WRITE / lba  %x / buffer[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, lba,
-GET_CXY(buffer_xp), GET_PTR(buffer_xp), cycle );
-#endif
-
-    // software L2/L3 cache coherence for memory buffer
-    if( chdev_dir.iob ) dev_mmc_sync ( buffer_xp , count<<9 );
-
-    // request a blocking, but asynchronous, transfer
-    error_t error = dev_ioc_move( IOC_WRITE,
-                          buffer_xp,
-                          lba,
-                          count );
-#if(DEBUG_DEV_IOC_TX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_TX < cycle )
-printk("\n[%s] thread[%x,%x] exit IOC_WRITE / cycle %d\n",
-__FUNCTION__, this->process->pid , this->trdid , cycle );
-#endif
-
-    return error;
-
-}  // end dev_ioc_write()
-
-
-///////////////////////////////////////////
-error_t dev_ioc_sync_read( xptr_t     buffer_xp,
-                           uint32_t   lba,
-                           uint32_t   count )
-{
-
-#if DEBUG_DEV_IOC_RX
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_RX < cycle )
-printk("\n[%s] thread[%x,%x] enters IOC_SYNC_READ / lba  %x / buffer[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, lba,
-GET_CXY(buffer_xp), GET_PTR(buffer_xp), cycle );
-#endif
-
-    // software L2/L3 cache coherence for memory buffer
-    if( chdev_dir.iob ) dev_mmc_inval( buffer_xp , count<<9 );
-
-    // request an asynchronous transfer
-    error_t error = dev_ioc_sync_move( IOC_SYNC_READ,
-                                       buffer_xp,
-                                       lba,
-                                       count );
-#if(DEBUG_DEV_IOC_RX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_RX < cycle )
-printk("\n[%s] thread[%x,%x] exit IOC_SYNC_READ / cycle %d\n",
-__FUNCTION__, this->process->pid , this->trdid , cycle );
-#endif
-
-    return error;
-
-}  // end dev_ioc_sync_read()  
-
-/////////////////////////////////////////////////
-error_t dev_ioc_sync_write( xptr_t     buffer_xp,
-                            uint32_t   lba,
-                            uint32_t   count )
-{
-
-#if DEBUG_DEV_IOC_TX
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_TX < cycle )
-printk("\n[%s] thread[%x,%x] enters IOC_SYNC_WRITE / lba  %x / buffer[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, lba,
-GET_CXY(buffer_xp), GET_PTR(buffer_xp), cycle );
-#endif
-
-    // software L2/L3 cache coherence for memory buffer
-    if( chdev_dir.iob ) dev_mmc_sync ( buffer_xp , count<<9 );
-
-    // request a blocking, but asynchronous, transfer
-    error_t error = dev_ioc_sync_move( IOC_SYNC_WRITE,
-                                       buffer_xp,
-                                       lba,
-                                       count );
-#if(DEBUG_DEV_IOC_TX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_IOC_TX < cycle )
-printk("\n[%s] thread[%x,%x] exit IOC_SYNC_WRITE / cycle %d\n",
-__FUNCTION__, this->process->pid , this->trdid , cycle );
-#endif
-
-    return error;
-
-}  // end dev_ioc_sync_write() 
-
-
+                        
+/////////////////////////////////////
+void dev_ioc_server( device_t * dev )
+{
+    xptr_t     client_xp;    // extended pointer on waiting thread
+    cxy_t      client_cxy;   // cluster of client thread
+    thread_t * client_ptr;   // local pointer on client thread
+    thread_t * server;       // local pointer on server thread
+    xptr_t     root_xp;      // extended pointer on device waiting queue root
+
+    server    = CURRENT_THREAD;
+
+    root_xp   = XPTR( local_cxy , &dev->wait_root );
+
+	// infinite loop handling commands registered in the IOC waiting queue
+    // TODO If we want to implement an "elevator" mecanism (i.e. sort all
+    // pending command on the LBA to optimize physical device accesses),
+    // it should be done in this loop...
+
+    while( 1 )
+    {
+        // get lock protecting queue
+        remote_spinlock_lock( XPTR( local_cxy , &dev->wait_lock ) );
+
+        // block and deschedule server thread if waiting queue empty 
+        if( xlist_is_empty( root_xp ) )
+        {
+            thread_block( server , THREAD_BLOCKED_DEV_QUEUE );
+            remote_spinlock_unlock( XPTR( local_cxy , &dev->wait_lock ) );
+            sched_yield();
+        }
+        else
+        {
+            remote_spinlock_unlock( XPTR( local_cxy , &dev->wait_lock ) );
+        } 
+
+        // get extended pointer on first client thread
+        client_xp = XLIST_FIRST_ELEMENT( root_xp , thread_t , wait_list );
+
+        // call driver command function to start I/O operation
+        dev->cmd( client_xp );
+        
+        // get client thread cluster and local pointer
+        client_cxy = GET_CXY( client_xp );
+        client_ptr = (thread_t *)GET_PTR( client_xp );
+
+        // remove the client thread from waiting queue
+        remote_spinlock_lock( XPTR( local_cxy , &dev->wait_lock ) );
+        xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) );
+        remote_spinlock_unlock( XPTR( local_cxy , &dev->wait_lock ) );
+
+    }  // end while
+
+}  // end dev_ioc_server()
Index: trunk/kernel/devices/dev_ioc.h
===================================================================
--- trunk/kernel/devices/dev_ioc.h	(revision 690)
+++ trunk/kernel/devices/dev_ioc.h	(revision 1)
@@ -2,5 +2,5 @@
  * dev_ioc.h - IOC (Block Device Controler) generic device API definition.
  * 
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
+ * Author  Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,10 +25,9 @@
 #define _DEV_IOC_H
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 
 /****  Forward declarations  ****/
 
-struct chdev_s;
+struct device_s;
 
 /*****************************************************************************************
@@ -38,30 +37,27 @@
  * magnetic hard disk or a SD card, that can store blocks of data in a linear array
  * of sectors indexed by a simple lba (logic block address).
+ * It supports two command types:
+ * - READ  : move a given number of contiguous blocks from device to a memory buffer.
+ * - WRITE : move a given number of contiguous blocks from a memory buffer to device.
  *
- * It supports four command types:
- * - READ       : move blocks from device to memory, with a descheduling policy.
- * - WRITE      : move blocks from memory to device, with a descheduling policy.
- * - SYNC_READ  : move blocks from device to memory, with a busy waiting policy.
- * - SYNC_WRITE : move blocks from memory to device, with a busy waiting policy.
- *
- * For the READ or WRITE operations, the client thread is descheduled, and the work
- * is done by the server thread associated to the IOC device:
- * The client thread calls the dev_ioc_move_data() kernel functions that (i) registers
- * the command in the client thread descriptor, (ii) registers the client thread 
- * in the IOC device waiting queue, and (iii) blocks on the THREAD_BLOCKED_IO condition
- * and deschedules.
- * The server thread attached to the IOC device descriptor handles the commands
- * registered in the waiting queue, calling the IOC driver function.
- * Most IOC device implementations have a DMA capability, but some implementations,
- * such as the RDK (Ram Disk) implementation does not use DMA.
- * When the server thread completes an I/O operation, it reactivates the client thread.
- *
- * The SYNC_READ and SYNC_WRITE operations are used by the kernel in the initialisation
- * phase, to update the FAT (both the FAT mapper and the FAT on IOC device), or to update
- * a directory on IOC device when a new file is created. 
- * These synchronous operations do not not use the IOC device waiting queue, 
- * the server thread, and the IOC IRQ. The client thread does not deschedules:
- * it registers the command in the thread descriptor, calls directly the IOC driver,
- * and uses a busy-waiting policy to poll the IOC device status.
+ * An I/O operation requires dynamic ressource allocation, and is always blocking for
+ * the client thread. The general scenario is detailed below.
+ * A) the client thread start the I/O operation, by calling the dev_ioc_read()
+ *    or the dev_ioc_write() kernel functions that perform the following actions: 
+ *    1) it get a free WTI mailbox from the client cluster WTI allocator.
+ *    2) it enables the WTI IRQ on the client cluster ICU and update interrupt vector.
+ *    3) it access the PIC to link the WTI mailbox to the IOC IRQ.
+ *    4) it builds the command descriptor.
+ *    5) it registers in the IOCdevice waiting queue. 
+ *    6) itblock on the THREAD_BLOCKED_IO condition and deschedule.
+ * B) The server thread attached to the IOC device descriptor handles the commands
+ *    registered in the waiting queue, calling the IOC driver function.
+ *    Most hardware implementation have a DMA capability, but some implementations,
+ *    such as the RDK (Ram Disk) implementation does not use DMA.
+ * C) The ISR signaling the I/O operation completion reactivates the client thread,
+ *    that releases the allocated resources:
+ *    1) access the PIC to unlink the IOC IRQ.
+ *    2) disable the WTI IRQ in the client cluster ICU and update interrupt vector.
+ *    3) release the WTI mailbox to the client cluster WTI allocator.
  *****************************************************************************************/
 
@@ -82,5 +78,5 @@
  *****************************************************************************************/
 
-typedef enum
+enum ioc_impl_e
 {
     IMPL_IOC_BDV =   0,     
@@ -93,23 +89,14 @@
 
 /******************************************************************************************
- * This structure defines the IOC command for all drivers implementing the IOC device.
+ * This defines the (implementation independant)  command passed to the driver.
  *****************************************************************************************/
-
-typedef enum
-{
-    IOC_READ       = 0,
-    IOC_WRITE      = 1,
-    IOC_SYNC_READ  = 2,
-    IOC_SYNC_WRITE = 3,
-}
-ioc_cmd_type_t;
 
 typedef struct ioc_command_s
 {
-    xptr_t      dev_xp;     /*! extended pointer on IOC device descriptor                */
-    uint32_t    type;       /*! command type above                                       */
+    xptr_t      dev_xp;      /*! extended pointer on device descriptor                    */
+    uint32_t    to_mem;     /*! requested operation (WRITE if zero / READ if non-zero)   */
     uint32_t    lba;        /*! first block index                                        */
     uint32_t    count;      /*! number of blocks                                         */
-    xptr_t      buf_xp;     /*! extended pointer on kernel memory buffer                 */
+    xptr_t      buf_xp;     /*! extended pointer on memory buffer                        */
     uint32_t    error;      /*! operation status (0 if success)                          */
 }
@@ -117,95 +104,68 @@
 
 /******************************************************************************************
- * This function returns a printable string for a IOC command type.
+ * This function completes the IOC device descriptor initialisation,
+ * namely the link with the implementation specific driver.
+ * The func, impl, channel, is_rxt, base, and size fields must be previously initialised.
+ * It calls the specific driver initialisation function, to initialise the hardware
+ * device and the specific data structures when required.
+ * It creates the associated server thread.
+ * It can be executed in another cluster than the cluster containing the device descriptor
+ * or the hardware device itself.
  ******************************************************************************************
- * @ cmd  : command type.
- * @ return pointer on string.
+ * @ xp_dev     : extended pointer on IOC device descriptor.
  *****************************************************************************************/
-char * dev_ioc_cmd_str( ioc_cmd_type_t cmd );
+void dev_ioc_init( xptr_t  xp_dev );
 
 /******************************************************************************************
- * This function completes the IOC chdev descriptor initialisation,
- * namely the link with the implementation specific driver.
- * The func, impl, channel, is_rx, base fields have been previously initialised.
- * It calls the specific driver initialisation function, to initialise the hardware
- * device and the specific data structures when required.
- * It creates the associated server thread and allocates a WTI from local ICU.
- * It must de executed by a local thread.
+ * This blocking function try to tranfer one or several contiguous blocks of data
+ * from the block device to a memory buffer. The corresponding request is actually
+ * registered in the device pending request queue, and the calling thread is descheduled,
+ * waiting on transfer completion. It will be resumed by the IRQ signaling completion.
+ * It must be called in the client cluster.
  ******************************************************************************************
- * @ chdev     : local pointer on IOC chdev descriptor.
+ * @ buffer    : local pointer on target buffer in memory.
+ * @ lba       : first block index on device.
+ * @ count     : number of blocks to transfer.
+ * @ returns 0 if success / returns EINVAL if error.
  *****************************************************************************************/
-void dev_ioc_init( struct chdev_s * chdev );
+error_t dev_ioc_read( char         * buffer,
+                      uint32_t       lba,
+                      uint32_t       count );
 
 /******************************************************************************************
- * This blocking function register an asynchronous READ request : move <count> contiguous
- * blocks from the block device, starting from block defined by the <lba> argument, to a
- * kernel buffer defined by the <buffer_xp> argument.
- * It register the request in the client thread descriptor, it register the client thread
- * in the IOC device queue, it blocks on the THREAD_BLOCKED_IO condition, and deschedules.
- * It will be reactivated by the DEV server thread when the transfer is completed.
- * It can be executed by a thread running in any cluster.
+ * This blocking function try to tranfer one or several contiguous blocks of data
+ * from a memory buffer to the block device. The corresponding request is actually
+ * registered in the device pending request queue, and the calling thread is descheduled,
+ * waiting on transfer completion. It will be resumed by the IRQ signaling completion.
+ * It must be called in the client cluster.
  ******************************************************************************************
- * @ buffer_xp : extended pointer on kernel buffer in memory (must be block aligned).
+ * @ buffer    : local pointer on source buffer in memory.
  * @ lba       : first block index on device.
  * @ count     : number of blocks to transfer.
- * @ returns 0 if success / returns -1 if error.
+ * @ returns 0 if success / returns EINVAL if error.
  *****************************************************************************************/
-error_t dev_ioc_read( xptr_t    buffer_xp,
-                      uint32_t  lba,
-                      uint32_t  count );
+error_t dev_ioc_write( char         * buffer,
+                       uint32_t       lba,
+                       uint32_t       count );
 
 /******************************************************************************************
- * This blocking function register an asynchronous WRITE request : move <count> contiguous
- * blocks from a kernel buffer defined by the <buffer_xp> argument to the block device,
- * starting from block defined by the <lba> argument.
- * It register the request in the client thread descriptor, it register the client thread
- * in the IOC device queue, it blocks on the THREAD_BLOCKED_IO condition, and deschedules.
- * It will be reactivated by the DEV server thread when the transfer is completed.
- * It can be executed by a thread running in any cluster.
+ * This function is executed by the server thread associated to the IOC device descriptor. 
+ * This thread is created and activated by the dev_ioc_init() function.
+ * It executes an infinite loop to handle sequencially all commands registered 
+ * by the client threads in the device waiting queue, calling the driver CMD function. 
+ *  
+ * - If the peripheral can only handle one single command, the driver block the server 
+ *   thread on the THREAD_BLOCKED_DEV_ISR condition, waiting I/O operation conmpletion.
+ *   The server thread must be reacticated by the driver ISR function.
+ * - If the peripheral can handle several commands in parallel (AHCI is an example), the
+ *   driver does not block the server thread (it is only descheduled if the number of
+ *   commands exceeeds the max number of parallel commands supported by the peripheral.
+ *
+ * When the waiting queue is empty, the server thread blocks on the THREAD_BLOCKED_CMD
+ * condition and deschedule. It is re-activated by a client thread registering a command.
  ******************************************************************************************
- * @ buffer_xp : extended pointer on kernel buffer in memory (must be block aligned).
- * @ lba       : first block index on device.
- * @ count     : number of blocks to transfer.
- * @ returns 0 if success / returns -1 if error.
+ * @ dev     : local pointer on IOC device descriptor.
  *****************************************************************************************/
-error_t dev_ioc_write( xptr_t    buffer_xp,
-                       uint32_t  lba,
-                       uint32_t  count );
-
-/******************************************************************************************
- * This blocking function executes a synchronous SYNC_READ request : it moves <count>
- * contiguous blocks of data from the block device, starting from block defined by the
- * <lba> argument to a kernel memory buffer, defined by the <buffer_xp> argument. 
- * The request is registered in the calling thread descriptor, but the client thread calls
- * directly the driver cmd function, that is also a blocking function returning only
- * when the transfer is completed.
- * It can be executed by a thread running in any cluster.
- ******************************************************************************************
- * @ buffer_xp : extended pointer on kernel buffer in memory (must be block aligned).
- * @ lba       : first block index on device.
- * @ count     : number of blocks to transfer.
- * @ returns 0 if success / returns -1 if error.
- *****************************************************************************************/
-error_t dev_ioc_sync_read( xptr_t    buffer_xp,
-                           uint32_t  lba,
-                           uint32_t  count );
-
-/******************************************************************************************
- * This blocking function executes a synchronous SYNC_WRITE request : it moves <count>
- * contiguous blocks of data from a kernel memory buffer, defined by the <buffer_xp>
- * argument to the block device, starting from block defined by the <lba> argument. 
- * The request is registered in the calling thread descriptor, but the client thread calls
- * directly the driver cmd() function, that is also a blocking function returning only
- * when the transfer is completed.
- * It can be executed by a thread running in any cluster.
- ******************************************************************************************
- * @ buffer_xp : extended pointer on kernel buffer in memory (must be block aligned).
- * @ lba       : first block index on device.
- * @ count     : number of blocks to transfer.
- * @ returns 0 if success / returns -1 if error.
- *****************************************************************************************/
-error_t dev_ioc_sync_write( xptr_t    buffer_xp,
-                            uint32_t  lba,
-                            uint32_t  count );
+void dev_ioc_server( struct device_s * dev );
 
 #endif	/* _DEV_IOC_H */
Index: trunk/kernel/devices/dev_iox.c
===================================================================
--- trunk/kernel/devices/dev_iox.c	(revision 1)
+++ trunk/kernel/devices/dev_iox.c	(revision 1)
@@ -0,0 +1,181 @@
+/*
+ * dev_iox.c - IOX (bridge to external I/O) generic device API implementation.
+ *
+ * Authors   Alain Greiner  (2017)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTIOXLAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <hal_special.h>
+#include <remote_spinlock.h>
+#include <device.h>
+#include <printk.h>
+#include <soclib_iob.h>
+#include <dev_iox.h>
+
+//////////////////////////////////
+void dev_iox_init( xptr_t dev_xp )
+{
+    // get IOX device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // call driver init function
+    if( impl == IMPL_IOX_IOB )
+    {
+        soclib_iob_init( dev_xp );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined IOX device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+}
+
+//////////////////////////////////////////
+void dev_iox_iommu_enable( xptr_t dev_xp )
+{
+    // get IOX device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // call driver function
+    if( impl == IMPL_IOX_IOB )
+    {
+        remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+        soclib_iob_set_active( dev_xp , 1 );
+        remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined IOX device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+}
+
+///////////////////////////////////////////
+void dev_iox_iommu_disable( xptr_t dev_xp )
+{
+    // get IOX device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // call driver function
+    if( impl == IMPL_IOX_IOB )
+    {
+        remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+        soclib_iob_set_active( dev_xp , 0 );
+        remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined IOX device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+}
+
+////////////////////////////////////////
+void dev_iox_set_ptpr( xptr_t    dev_xp,
+                       uint32_t  wdata )
+{
+    // get IOX device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // call driver function
+    if( impl == IMPL_IOX_IOB )
+    {
+        remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+        soclib_iob_set_ptpr( dev_xp , wdata );
+        remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined IOX device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+}
+                        
+////////////////////////////////////////
+void dev_iox_inval_page( xptr_t  dev_xp,
+                         vpn_t   vpn )
+{
+    // get IOX device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // call driver function
+    if( impl == IMPL_IOX_IOB )
+    {
+        remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+        soclib_iob_inval_page( dev_xp , vpn );
+        remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined IOX device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+}
+
+///////////////////////////////////////////
+void dev_iox_get_status( xptr_t     dev_xp,
+                         uint32_t * error,
+                         uint32_t * bvar,
+                         uint32_t * srcid )
+{
+    // get IOX device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // call driver function
+    if( impl == IMPL_IOX_IOB )
+    {
+        remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+        *error = soclib_iob_get_error( dev_xp );
+        *srcid = soclib_iob_get_srcid( dev_xp );
+        *bvar  = soclib_iob_get_bvar( dev_xp );
+        remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined IOX device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+}
+
Index: trunk/kernel/devices/dev_iox.h
===================================================================
--- trunk/kernel/devices/dev_iox.h	(revision 1)
+++ trunk/kernel/devices/dev_iox.h	(revision 1)
@@ -0,0 +1,109 @@
+/*
+ * dev_iox.h - IOX (bridge to external I/O) generic device API.
+ *
+ * Authors   Alain Greiner  (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTIOXLAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DEV_IOX_H_
+#define _DEV_IOX_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <spinlock.h>
+
+/*****************************************************************************************
+ *     Generic IOX (bridge to external IO peripherals) definition.
+ *
+ * The IOX device is used to access external peripherals. It implements an IO-MMU service 
+ * for DMA transactions launched by DMA capable external peripherals.
+ * This IOX peripheral is acting as a dynamically configurable bridge, used for others 
+ * I/O operations. Therefore, ALMOS-MKH does not use the IOX device waiting queue,
+ * and calls directly the IOX driver blocking functions, using the device lock to 
+ * get exclusive access to the IOX bridge internal state.
+ ****************************************************************************************/
+ 
+
+/*****************************************************************************************
+ * This enum defines the various implementations of the IOX generic device.
+ * This array must be kept consistent with the define in arch_info.h file
+ ****************************************************************************************/
+
+enum iox_impl_e
+{
+    IMPL_IOX_IOB =   0,         /* vci_iob component used in TSAR                       */
+    IMPL_IOX_I86 =   1,         /* TBD                                                  */
+}
+iox_impl_t;
+
+/*****************************************************************************************
+ * This function initializes the IOX device descriptor with IOMMU disabled.
+ *****************************************************************************************
+ * @ dev_xp     : extended pointer on IOX device descriptor.
+ ****************************************************************************************/
+void dev_iox_init( xptr_t dev_xp );
+
+/*****************************************************************************************
+ * This function activates the IOMMU for the IOX device identified by its
+ * extended pointer.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ ****************************************************************************************/
+void dev_iox_iommu_enable( xptr_t dev_xp );
+
+/*****************************************************************************************
+ * This function desactivates the IO-MMU for the IOX device identified by its
+ * extended pointer.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ ****************************************************************************************/
+void dev_iox_iommu_disable( xptr_t dev_xp );
+
+/*****************************************************************************************
+ * This function set a new value in the IO-MMU PTPR register.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ * @ wdata    : value to be written in PTPR register.
+ ****************************************************************************************/
+void dev_iox_set_ptpr( xptr_t    dev_xp,
+                       uint32_t  wdata );
+                        
+/*****************************************************************************************
+ * This function invalidates an IOMMU TLB entry identified by its vpn.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ * @ vpn      : virtual page number in IO virtual space.
+ ****************************************************************************************/
+void dev_iox_inval_page( xptr_t  dev_xp,
+                         vpn_t   vpn );
+
+/*****************************************************************************************
+ * This function return informations relative to an error reported by the IOMMU.
+ *****************************************************************************************
+ * @ dev_xp   : extended pointer on IOX device descriptor.
+ * @ error    : [out] pointer on buffer for erro type.
+ * @ bvar     : [out] pointer on buffer for bad virtual address.
+ * @ srcid    : [out] pointer on buffer for faulty peripheral index.
+ ****************************************************************************************/
+void dev_iox_get_status( xptr_t     dev_xp,
+                         uint32_t * error,
+                         uint32_t * bvar,
+                         uint32_t * srcid );
+
+#endif  /* _DEV_IOX_H_ */
Index: trunk/kernel/devices/dev_mmc.c
===================================================================
--- trunk/kernel/devices/dev_mmc.c	(revision 690)
+++ trunk/kernel/devices/dev_mmc.c	(revision 1)
@@ -2,5 +2,5 @@
  * dev_mmc.c - MMC (Memory Cache Controler) generic device API implementation.
  * 
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
+ * Author  Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,11 +22,9 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <hal_drivers.h>
+#include <soclib_mmc.h>
 #include <printk.h>
-#include <chdev.h>
 #include <thread.h>
-#include <remote_busylock.h>
 #include <dev_mmc.h>
 
@@ -35,146 +33,144 @@
 /////////////////////////////////////////////////////////////////////////////////////////
 
-extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
+extern devices_directory_t  devices_dir;         // allocated in kernel_init.c
+
+extern devices_input_irq_t  devices_input_irq;   // allocated in kernel_init.c
 
 //////////////////////////////////
-void dev_mmc_init( chdev_t * mmc )
-{
-    // set mmc name
-    snprintk( mmc->name , 16 , "mmc_%x" , local_cxy );
-
-    // call driver init function
-    hal_drivers_mmc_init( mmc );
-
-    // bind IRQ to CP0
-    dev_pic_bind_irq( 0 , mmc );
-   
-    // enable IRQ
-    dev_pic_enable_irq( 0 , XPTR( local_cxy , mmc ) );
-
+void dev_mmc_init( xptr_t dev_xp )
+{
+    // get MMC device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // set driver specific fields in device descriptor
+    // and call driver init function
+    if( impl == IMPL_MMC_TSR )
+    {
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_mmc_command );
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_mmc_isr );
+        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+                           XPTR( local_cxy , "MMC_TSR" ) , 16 );
+        soclib_mmc_init( dev_xp );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined MMC device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 }  // end dev_mmc_init()
 
 /////////////////////////////////////////////////////////////////////////////
-// This static function is called by all MMC device access functions.
-// It makes some checking, takes the lock granting exclusive
-// access to MMC peripheral, call the driver to execute the command
+// This static function makes some checking, takes the lock granting
+// exclusive access to MMC peripheral, call the driver to execute the command
 // registered in the calling thread descriptor, and releases the lock.
 /////////////////////////////////////////////////////////////////////////////
-static error_t dev_mmc_access( thread_t * this )
-{
-    // get extended pointer on MMC device descriptor
-    xptr_t  dev_xp = this->mmc_cmd.dev_xp;
-
-    assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "target MMC device undefined" );
+static void dev_mmc_access( thread_t * this )
+{
+    mmc_dmsg("\n[INFO] %s enters for thread %x in process %x : command = %d\n", 
+                 __FUNCTION__ , this->trdid , this->process->pid , this->dev.mmc.type );
+
+    // get extended pointer on MMC device
+    xptr_t  dev_xp  = this->dev.mmc.dev_xp;
+
+    if ( dev_xp == XPTR_NULL )
+    {
+        printk("\n[PANIC] in %s : undefined MMC device descriptor "
+               "in cluster %x for thread %x in process %x\n",
+               __FUNCTION__ , local_cxy , this->trdid , this->process->pid );
+        hal_core_sleep();
+    }
 
     // get MMC device cluster identifier & local pointer
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
 
     // get driver command function pointer from MMC device descriptor
     dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ) );
 
-    // get the MMC device remote busylock
-    remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) );  
+    // get the MMC device remote spinlock
+    remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );  
 
     // call driver command
     cmd( XPTR( local_cxy , this ) );
     
-    // release the MMC device remote busylock
-    remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) );  
-
-    // return operation status
-    return this->mmc_cmd.error;  
+    // release the MMC device remote spinlock
+    remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );  
+
+    mmc_dmsg("\n[INFO] %s completes for thread %x in process %x / error = %d\n", 
+                 __FUNCTION__ , this->trdid , this->process->pid , this->dev.ioc.error );
 
 }  // end dev_mmc_access()
 
+////////////////////////////////////////////
+error_t dev_mmc_inval( paddr_t    buf_paddr,
+                       uint32_t   buf_size )
+{
+    // get calling thread local pointer
+    thread_t * this = CURRENT_THREAD;
+
+    // get target cluster from paddr
+    cxy_t cxy = CXY_FROM_PADDR( buf_paddr );
+
+    if ( buf_paddr & (CONFIG_CACHE_LINE_SIZE -1) )
+    {
+        printk("\n[PANIC] in %s : buffer not aligned on cache line "
+               "for thread %x / target cluster %x\n",
+               __FUNCTION__ , this->trdid , cxy );
+        hal_core_sleep();
+    }
+
+    // get extended pointer on MMC device descriptor
+    xptr_t  dev_xp = devices_dir.mmc[cxy];
+
+    // store command arguments in thread descriptor
+    this->dev.mmc.dev_xp    = dev_xp;
+    this->dev.mmc.type      = MMC_CC_INVAL;
+    this->dev.mmc.buf_paddr = buf_paddr;
+    this->dev.mmc.buf_size  = buf_size;
+
+    // execute operation
+    dev_mmc_access( this ); 
+
+    // return operation status
+    return this->dev.mmc.error;  
+}  
+
+/////////////////////////////////////
+error_t dev_mmc_sync( paddr_t    buf_paddr,
+                      uint32_t   buf_size )
+{
+    // get calling thread local pointer
+    thread_t * this = CURRENT_THREAD;
+
+    // get target cluster from paddr
+    cxy_t cxy = CXY_FROM_PADDR( buf_paddr );
+
+    if ( buf_paddr & (CONFIG_CACHE_LINE_SIZE -1) )
+    {
+        printk("\n[PANIC] in %s : buffer not aligned on cache line "
+               "for thread %x / target cluster %x\n",
+               __FUNCTION__ , this->trdid , cxy );
+        hal_core_sleep();
+    }
+
+    // store command arguments in thread descriptor
+    this->dev.mmc.dev_xp    = devices_dir.mmc[cxy];
+    this->dev.mmc.type      = MMC_CC_SYNC;
+    this->dev.mmc.buf_paddr = buf_paddr;
+    this->dev.mmc.buf_size  = buf_size;
+
+    // execute operation
+    dev_mmc_access( this ); 
+
+    // return operation status
+    return this->dev.mmc.error;  
+}  
+
 /////////////////////////////////////////
-error_t dev_mmc_inval( xptr_t     buf_xp,
-                       uint32_t   buf_size )
-{
-    error_t error;
-
-    // get calling thread local pointer
-    thread_t  * this    = CURRENT_THREAD;
-
-#if DEBUG_DEV_MMC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_MMC < cycle )
-printk("\n[%s] thread[%x,%x] enters / cluster %x / buffer %x\n", 
-__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
-#endif
-
-    // get buffer cluster and local pointer
-    cxy_t     buf_cxy = GET_CXY( buf_xp );
-    uint8_t * buf_ptr = GET_PTR( buf_xp );
-    
-    // force buffer align
-    uint32_t  delta = (uint32_t)buf_ptr & (CONFIG_CACHE_LINE_SIZE - 1); 
-    uint8_t * base  = buf_ptr - delta;
-    uint32_t  size  = buf_size + delta;
-
-    // store command arguments in thread descriptor
-    this->mmc_cmd.dev_xp    = chdev_dir.mmc[buf_cxy];
-    this->mmc_cmd.type      = MMC_CC_INVAL;
-    this->mmc_cmd.buf_ptr   = base;
-    this->mmc_cmd.buf_size  = size;
-
-    // call MMC driver
-    error = dev_mmc_access( this );
-
-#if DEBUG_DEV_MMC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_MMC < cycle )
-printk("\n[%s] thread[%x,%x] exit / cluster %x / buffer %x\n", 
-__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
-#endif
-
-    return error;
-}
-
-////////////////////////////////////////
-error_t dev_mmc_sync( xptr_t     buf_xp,
-                      uint32_t   buf_size )
-{
-    error_t error;
-
-    thread_t  * this    = CURRENT_THREAD;
-
-#if DEBUG_DEV_MMC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_MMC < cycle )
-printk("\n[%s] thread[%x,%x] enters / cluster %x / buffer %x\n", 
-__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
-#endif
-
-    // get buffer cluster and local pointer
-    cxy_t  buf_cxy = GET_CXY( buf_xp );
-    void * buf_ptr = GET_PTR( buf_xp );
-    
-    // force buffer align
-    uint32_t  delta = (uint32_t)buf_ptr & (CONFIG_CACHE_LINE_SIZE - 1); 
-    uint8_t * base  = buf_ptr - delta;
-    uint32_t  size  = buf_size + delta;
-
-    // store command arguments in thread descriptor
-    this->mmc_cmd.dev_xp    = chdev_dir.mmc[buf_cxy];
-    this->mmc_cmd.type      = MMC_CC_SYNC;
-    this->mmc_cmd.buf_ptr   = base;
-    this->mmc_cmd.buf_size  = size;
-
-    // call MMC driver
-    error = dev_mmc_access( this );
-
-#if DEBUG_DEV_MMC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_MMC < cycle )
-printk("\n[%s] thread[%x,%x] exit / cluster %x / buffer %x\n", 
-__FUNCTION__, this->process->pid, this->trdid, GET_CXY(buf_xp), GET_PTR(buf_xp) );
-#endif
-
-    return error;
-}
-
-/////////////////////////////////////////
-error_t dev_mmc_error_set( cxy_t     cxy,
+error_t dev_mmc_set_error( cxy_t     cxy,
                            uint32_t  index,
                            uint32_t  wdata )
@@ -184,15 +180,18 @@
 
     // store command arguments in thread descriptor
-    this->mmc_cmd.dev_xp    = chdev_dir.mmc[cxy];
-    this->mmc_cmd.type      = MMC_ERROR_SET;
-    this->mmc_cmd.reg_index = index;
-    this->mmc_cmd.reg_ptr   = &wdata;
-
-    // execute operation
-    return dev_mmc_access( this ); 
+    this->dev.mmc.dev_xp    = devices_dir.mmc[cxy];
+    this->dev.mmc.type      = MMC_SET_ERROR;
+    this->dev.mmc.reg_index = index;
+    this->dev.mmc.reg_ptr   = &wdata;
+
+    // execute operation
+    dev_mmc_access( this ); 
+
+    // return operation status
+    return this->dev.mmc.error;  
 }
                         
 //////////////////////////////////////////
-error_t dev_mmc_error_get( cxy_t      cxy,
+error_t dev_mmc_get_error( cxy_t      cxy,
                            uint32_t   index,
                            uint32_t * rdata )
@@ -202,28 +201,35 @@
 
     // store command arguments in thread descriptor
-    this->mmc_cmd.dev_xp    = chdev_dir.mmc[cxy];
-    this->mmc_cmd.type      = MMC_ERROR_GET;
-    this->mmc_cmd.reg_index = index;
-    this->mmc_cmd.reg_ptr   = rdata;
-
-    // execute operation
-    return dev_mmc_access( this ); 
+    this->dev.mmc.dev_xp    = devices_dir.mmc[cxy];
+    this->dev.mmc.type      = MMC_GET_ERROR;
+    this->dev.mmc.reg_index = index;
+    this->dev.mmc.reg_ptr   = rdata;
+
+    // execute operation
+    dev_mmc_access( this ); 
+
+    // return operation status
+    return this->dev.mmc.error;  
 }
-
-//////////////////////////////////////////
-error_t dev_mmc_instr_get( cxy_t      cxy,
-                           uint32_t   index,
-                           uint32_t * rdata )
-{
-    // get calling thread local pointer
-    thread_t * this = CURRENT_THREAD;
-
-    // store command arguments in thread descriptor
-    this->mmc_cmd.dev_xp    = chdev_dir.mmc[cxy];
-    this->mmc_cmd.type      = MMC_INSTR_GET;
-    this->mmc_cmd.reg_index = index;
-    this->mmc_cmd.reg_ptr   = rdata;
-
-    // execute operation
-    return dev_mmc_access( this ); 
+                        
+////////////////////////////////////////////////////
+error_t dev_mmc_get_instrumentation( cxy_t      cxy,
+                                     uint32_t   index,
+                                     uint32_t * rdata )
+{
+    // get calling thread local pointer
+    thread_t * this = CURRENT_THREAD;
+
+    // store command arguments in thread descriptor
+    this->dev.mmc.dev_xp    = devices_dir.mmc[cxy];
+    this->dev.mmc.type      = MMC_GET_INSTRU;
+    this->dev.mmc.reg_index = index;
+    this->dev.mmc.reg_ptr   = rdata;
+
+    // execute operation
+    dev_mmc_access( this ); 
+
+    // return operation status
+    return this->dev.mmc.error;  
 }
+
Index: trunk/kernel/devices/dev_mmc.h
===================================================================
--- trunk/kernel/devices/dev_mmc.h	(revision 690)
+++ trunk/kernel/devices/dev_mmc.h	(revision 1)
@@ -2,5 +2,5 @@
  * dev_mmc.h - MMC (Generic L2 cache controller) device API definition.
  *
- * Authors   Alain Greiner  (2016,2017,2018,2019,2020)
+ * Authors   Alain Greiner  (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,6 +25,7 @@
 #define _DEV_MMC_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
+#include <spinlock.h>
 
 /*****************************************************************************************
@@ -34,15 +35,10 @@
  * acting in all clusters containing a level 2 cache controller.
  *
- * It supports three different services:
- * 1) L2/L3 software cache-coherence operations.
- * 2) error reporting for architecture specific addressing error.
- * 3) architecture specific intrumentation registers access. 
- *
- * It supports therefore five command types: 
+ * It supports  five command types: 
  * - MMC_CC_INVAL   : invalidate all cache lines covering a given buffer in L2 cache.
  * - MMC_CC_SYNC    : synchronize all cache lines covering a given buffer to L3 cache.
- * - MMC_ERROR_GET  : return content of a given error signaling register.
- * - MMC_ERROR_SET  : set a given error signaling register.
- * - MMC_INSTR_GET  : return content of a given instrumentation register.
+ * - MMC_GET_ERROR  : return content of a given error signaling register.
+ * - MMC_SET_ERROR  : set a given error signaling register.
+ * - MMC_GET_INSTRU : return content of a given instrumentation register.
  *
  * As all L2 caches can be accessed by any thread running in any cluster, a calling
@@ -50,12 +46,8 @@
  * As these operations consume few cycles, and access conflicts are expected to be 
  * rare events, the calling threads use a busy waiting strategy to get the device
- * busylock, but do not register in the device waiting queue, and no server thread
+ * spinlock, do not register in the device waiting queue, and no server thread
  * is used for this device.
  ****************************************************************************************/
  
-/****  Forward declarations  ****/
-
-struct chdev_s;
-
 /******************************************************************************************
  * This enum defines the various implementations of the generic MMC peripheral.
@@ -78,17 +70,17 @@
     MMC_CC_INVAL   = 0,
     MMC_CC_SYNC    = 1,
-    MMC_ERROR_GET  = 2,
-    MMC_ERROR_SET  = 3,
-    MMC_INSTR_GET  = 4,
+    MMC_GET_ERROR  = 2,
+    MMC_SET_ERROR  = 3,
+    MMC_GET_INSTRU = 4,
 };
 
 typedef struct mmc_command_s
 {
-    xptr_t      dev_xp;     /*! extended pointer on target MMC device descriptor        */
+    xptr_t      dev_xp;     /*! extended pointer on the relevant MMC device descriptor  */
     uint32_t    type;       /*! CC_INVAL / CC_SYNC / GET_ERROR / SET_ERROR / GET_INSTRU */
-    void      * buf_ptr;    /*! local pointer on memory buffer    (used by INVAL/SYNC)  */
-    uint32_t    buf_size;   /*! memory buffer size (bytes)        (used by INVAL/SYNC)  */
-    uint32_t    reg_index;  /*! register index in MMC peripheral  (used by SET/GET)     */
-    uint32_t  * reg_ptr;    /*! local pointer on src/dst buffer   (used by SET/GET)     */
+    paddr_t     buf_paddr;  /*! buffer physical address          (used by INVAL/SYNC)   */
+    uint32_t    buf_size;   /*! buffer size in bytes             (used by INVAL/SYNC)   */
+    uint32_t    reg_index;  /*! register index in MMC peripheral (used by SET/GET)      */
+    uint32_t  * reg_ptr;    /*! local pointer on src/dst buffer  (used by SET/GET)      */
     error_t     error;      /*! operation status (0 if success)                         */
 }
@@ -96,40 +88,40 @@
 
 /*****************************************************************************************
- * This function initializes the driver specific fields in the local MMC chdev,  
- * and initializes the implementation specific MMC  driver.
+ * This function initializes the driver specific fields in the generic MMC device 
+ * descriptor, and the implementation specific driver.
  * It must be executed once in any cluster containing an L2 cache.
  *****************************************************************************************
- * @ chdev      : pointer on MMC device descriptor.
+ * @ mmc_xp     : extended pointer on MMC device descriptor.
  ****************************************************************************************/
-void dev_mmc_init( struct chdev_s * chdev );
+void dev_mmc_init( xptr_t  mmc_xp );
 
 /*****************************************************************************************
- * This function invalidates all cache lines covering a memory buffer  defined by 
- * the <buf_xp> and <buf_size> arguments.
+ * This function invalidates all cache lines covering a memory buffer 
+ * in the physical address space. 
  * It can be executed by any thread in any cluster, because it uses remote accesses
  * to access both the MMC device descriptor, and the L2 cache configuration interface.
  *****************************************************************************************
- * @ buf_xp     : extended pointer on memory buffer.
+ * @ buf_paddr  : buffer local physical addresse.
  * @ buf_size   : buffer size (bytes).
  * @ return 0 if success / return EINVAL if failure
  ****************************************************************************************/
-error_t dev_mmc_inval( xptr_t     buf_xp,
-                       uint32_t   buf_size );
+error_t dev_mmc_inval( paddr_t   buf_paddr,
+                       uint32_t  buf_size );
 
 /*****************************************************************************************
  * This function forces the L2 cache to synchronize the L3 cache for all cache lines
- * covering a memory buffer defined by the <buf_xp> and <buf_size> arguments.
+ * covering a memory buffer in the physical address space. 
  * It can be executed by any thread in any cluster, because it uses remote accesses
  * to access both the MMC device descriptor, and the L2 cache configuration interface.
  *****************************************************************************************
- * @ buf_xp     : extended pointer on memory buffer.
+ * @ buf_paddr  : buffer local physical addresse.
  * @ buf_size   : buffer size (bytes).
  * @ return 0 if success / return EINVAL if failure
  ****************************************************************************************/
-error_t dev_mmc_sync( xptr_t     buf_xp,
+error_t dev_mmc_sync( paddr_t    buf_paddr,
                       uint32_t   buf_size );
                         
 /*****************************************************************************************
- * This function set a value in one (architecture specific) MMC_ERROR register.
+ * This function set a value in one error signaling MMC register.
  * It can be executed by any thread in any cluster, because it uses remote accesses
  * to access the L2 cache instrumentation interface in any cluster.
@@ -140,12 +132,12 @@
  * @ return 0 if success / return EINVAL if failure
  ****************************************************************************************/
-error_t dev_mmc_error_set( cxy_t    cxy,
+error_t dev_mmc_set_error( cxy_t    cxy,
                            uint32_t index,
                            uint32_t wdata );
               
 /*****************************************************************************************
- * This function returns the value contained in one (architecture specific) MMC_ERROR
- * register. It can be executed by any thread in any cluster, because it uses remote
- * accesses to access the L2 cache instrumentation interface in any cluster.
+ * This function returns the value contained in one error signaling MMC register.
+ * It can be executed by any thread in any cluster, because it uses remote accesses
+ * to access the L2 cache instrumentation interface in any cluster.
  *****************************************************************************************
  * @ cxy     : MMC cluster identifier.
@@ -154,21 +146,22 @@
  * @ return 0 if success / return EINVAL if failure
  ****************************************************************************************/
-error_t dev_mmc_error_get( cxy_t      cxy,
+error_t dev_mmc_get_error( cxy_t      cxy,
                            uint32_t   index, 
                            uint32_t * rdata );
               
+
 /*****************************************************************************************
- * This function returns the value contained in one (architecture specific) MMC_INSTR
- * register. It can be executed by any thread in any cluster, because it uses remote
- * accesses to access the L2 cache instrumentation interface in any cluster.
+ * This function returns the value contained in one instrumentation MMC register.
+ * It can be executed by any thread in any cluster, because it uses remote accesses
+ * to access the L2 cache configuration interface in any cluster.
  *****************************************************************************************
  * @ cxy     : MMC cluster identifier.
- * @ index   : error register index in MMC peripheral.
+ * @ index   : instrumentation register index in MMC peripheral.
  * @ rdata   : local pointer on buffer for returned value.
  * @ return 0 if success / return EINVAL if failure
  ****************************************************************************************/
-error_t dev_mmc_instr_get( cxy_t      cxy,
-                           uint32_t   index, 
-                           uint32_t * rdata );
-              
+error_t dev_mmc_get_instrumentation( cxy_t      cxy,
+                                     uint32_t   index,
+                                     uint32_t * rdata );
+
 #endif  /* _DEV_MMC_H_ */
Index: trunk/kernel/devices/dev_mwr.h
===================================================================
--- trunk/kernel/devices/dev_mwr.h	(revision 1)
+++ trunk/kernel/devices/dev_mwr.h	(revision 1)
@@ -0,0 +1,120 @@
+/*
+ * dev_mwr.h - MWR (Multi Fifos DMA Controller) generic device API.
+ *
+ * Authors   Alain Greiner  (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTMWRLAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DEV_MWR_H_
+#define _DEV_MWR_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <spinlock.h>
+
+/*****************************************************************************************
+ *     Generic multi-fifos DMA controller for harware coprocessors.
+ *
+ ****************************************************************************************/
+ 
+struct device_s;
+
+/*****************************************************************************************
+ * This defines the (implementation independant) extension for the generic MWR device.
+ ****************************************************************************************/
+
+typedef struct mwr_extend_s
+{
+    uint32_t    to_coproc_nr;    /*! actual number of to_coproc FIFOs                   */
+    uint32_t    from_coproc_nr;  /*! actual number of from coproc FIFOs                 */
+    uint32_t    config_nr;       /*! actual number of configuration registers           */
+    uint32_t    status_nr;       /*! actual number of status registers                  */
+}
+mwr_extend_t;
+
+
+/*****************************************************************************************
+ * This function initializes the MWR specific fields of the device descriptor.
+ * It must be executed once in the cluster containing a MWR device descriptor.
+ *****************************************************************************************
+ * @ mwr_xp         : extended pointer on MWR device descriptor.
+ * @ to_coproc_nr   : number of to_coproc fifos.
+ * @ from_coproc_nr : number of from_coproc fifos.
+ * @ config_nr      : number of coprocessor configuration registers.
+ * # status_nr      : number of coprocessor status registers.
+ ****************************************************************************************/
+void dev_mwr_init( xptr_t    mwr_xp,
+                   uint32_t  to_coproc_nr,
+                   uint32_t  from_coproc_nr,
+                   uint32_t  config_nr,
+                   uint32_t  status_nr );
+
+/*****************************************************************************************
+ * This function set a value in one coprocessor register.
+ * It can only be executed by a local thread.
+ *****************************************************************************************
+ * @ cxy     : MMC cluster identifier.
+ * @ index   : register index in MMC peripheral.
+ * @ wdata   : value to be written.
+ ****************************************************************************************/
+void dev_mwr_set_coproc_register( cxy_t    cxy,
+                                  uint32_t index,
+                                  uint32_t wdata );
+
+/*****************************************************************************************
+ * This function returns the value contained in one coprocessor register.
+ * It can only be executed by a local thread.
+ *****************************************************************************************
+ * @ cxy     : MMC cluster identifier.
+ * @ index   : error register index in MMC peripheral.
+ * @ rdata   : local pointer on buffer for returned value.
+ ****************************************************************************************/
+void dev_mmc_get_coproc_register( cxy_t      cxy,
+                                  uint32_t   index, 
+                                  uint32_t * rdata );
+
+/*****************************************************************************************
+ * This function set a value in one channel register.
+ * It can only be executed by a local thread.
+ *****************************************************************************************
+ * @ cxy     : MMC cluster identifier.
+ * @ index   : register index in MMC peripheral.
+ * @ wdata   : value to be written.
+ ****************************************************************************************/
+void dev_mwr_set_channel_register( cxy_t    cxy,
+                                   uint32_t channel,
+                                   uint32_t index,
+                                   uint32_t wdata );
+
+/*****************************************************************************************
+ * This function returns the value contained in one channel register.
+ * It can only be executed by a local thread.
+ *****************************************************************************************
+ * @ cxy     : MMC cluster identifier.
+ * @ index   : error register index in MMC peripheral.
+ * @ rdata   : local pointer on buffer for returned value.
+ ****************************************************************************************/
+void dev_mmc_get_channel_register( cxy_t      cxy,
+                                   uint32_t channel,
+                                   uint32_t   index, 
+                                   uint32_t * rdata );
+
+
+
+#endif  /* _DEV_MWR_H_ */
Index: trunk/kernel/devices/dev_nic.c
===================================================================
--- trunk/kernel/devices/dev_nic.c	(revision 690)
+++ trunk/kernel/devices/dev_nic.c	(revision 1)
@@ -2,5 +2,5 @@
  * dev_nic.c - NIC (Network Controler) generic device API implementation.
  * 
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
+ * Author  Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,3046 +22,283 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <hal_uspace.h>
-#include <remote_buf.h>
-#include <memcpy.h>
 #include <printk.h>
-#include <chdev.h>
+#include <device.h>
 #include <thread.h>
-#include <ksocket.h>
-#include <hal_drivers.h>
+#include <soclib_nic.h>
 #include <dev_nic.h>
-#include <vfs.h>
-#include <shared_socket.h>
 
 /////////////////////////////////////////////////////////////////////////////////////////
-//                 Extern global variables
+// Extern global variables
 /////////////////////////////////////////////////////////////////////////////////////////
 
-extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
+extern devices_directory_t  devices_dir;         // allocated in kernel_init.c
+
+extern devices_input_irq_t  devices_input_irq;   // allocated in kernel_init.c
+
+
+//////////////////////////////////
+void dev_nic_init( xptr_t dev_xp )
+{
+    // get device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get "impl" , "channel" , "is_rx" fields from device descriptor
+    uint32_t  impl    = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+    uint32_t  is_rx   = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->is_rx ) );
+    uint32_t  channel = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->channel ) );
+
+    // set driver specific fields in device descriptor
+    // and call driver init function
+    if( impl == IMPL_NIC_SOC )
+    {
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_nic_cmd );
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_nic_isr );
+        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+                           XPTR( local_cxy , "NIC_SOC" ) , 16 );
+        soclib_nic_init( dev_xp );
+    }
+//    else if( impl == IMPL_NIC_I86)
+//    {
+//        hal_remote_spt( XPTR( cxy , &ptr->cmd ) , &i86_nic_cmd );
+//        hal_remote_spt( XPTR( cxy , &ptr->isr ) , &i86_nic_isr );
+//        hal_remote_memcpy( XPTR( cxy , &ptr->name ),
+//                           XPTR( local_cxy , "NIC_I86" ) , 16 );
+//        i86_nic_init( dev );
+//    }
+    else
+    {
+        printk("\n[PANIC] in %s : undefined NIC device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get a free WTI mailbox for this NIC device
+    uint32_t wti_id;
+    if( dev_cxy == local_cxy )                       // NIC device cluster is local
+    {
+        wti_id = dev_icu_wti_alloc();
+    }
+    else                                             // NIC device cluster is remote
+    {
+        rpc_icu_wti_alloc_client( dev_cxy , &wti_id ); 
+    }
+
+    if( wti_id == -1 )
+    {
+        printk("\n[PANIC] in %s : cannot allocate WTI mailbox\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // enable WTI IRQ in remote ICU and update WTI interrupt vector
+    dev_icu_enable_irq( dev_cxy, 0 , WTI_TYPE , wti_id , dev_xp );
+
+    // link NIC IRQ to WTI mailbox in PIC component 
+    uint32_t irq_id; 
+    if( is_rx ) irq_id = devices_input_irq.nic_rx[channel];
+    else        irq_id = devices_input_irq.nic_tx[channel];
+    dev_pic_bind_irq( irq_id , local_cxy , wti_id );
+
+    // create server thread
+    thread_t * new_thread_ptr;
+    xptr_t     new_thread_xp;
+    error_t    error;
+
+    if( dev_cxy == local_cxy )                        // device cluster is local
+    {
+        error = thread_kernel_create( &new_thread_ptr,
+                                      THREAD_DEV,
+                                      &dev_ioc_server,
+                                      dev_ptr,
+                                      cluster_select_local_core() ); 
+
+        new_thread_xp = XPTR( local_cxy , new_thread_ptr );
+    }
+    else                                              // device cluster is remote
+    {
+        rpc_thread_kernel_create_client( dev_cxy,
+                                         THREAD_DEV,
+                                         &dev_ioc_server,
+                                         dev_ptr,
+                                         &new_thread_xp,
+                                         &error );
+
+        new_thread_ptr = (thread_t *)GET_PTR( new_thread_xp );
+    }
+    if( error )
+    {
+        printk("\n[PANIC] in %s : cannot create server thread\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // set "server" field in device descriptor
+    hal_remote_spt( XPTR( dev_cxy , &dev_ptr->server ) , new_thread_ptr );
+    
+    // start server thread
+    thread_unblock( new_thread_xp , THREAD_BLOCKED_GLOBAL );
+
+}  // end dev_nic_init()
+
+///////////////////////////////////
+error_t dev_nic_read( pkd_t * pkd )
+{
+    error_t  error;
+
+    // get pointers on this NIC-RX kernel thread 
+    thread_t * thread_ptr = CURRENT_THREAD;
+    xptr_t     thread_xp  = XPTR( local_cxy , thread_ptr );
+
+    // get local pointer on core running this kernel thead
+    core_t * core = thread_ptr->core;
+
+    nic_dmsg("\n[INFO] %s enters for NIC-RX thread on core %d in cluster %x\n", 
+                 __FUNCTION__ , core->lid , local_cxy );
+
+    // get pointer on NIC-RX device descriptor
+    uint32_t   channel = thread_ptr->dev_channel; 
+    xptr_t     dev_xp  = devices_dir.nic_rx[channel];
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    if ( dev_xp == XPTR_NULL )
+    {
+        printk("\n[PANIC] in %s : undefined NIC device descriptor\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    if ( dev_cxy != local_cxy )
+    {
+        printk("\n[PANIC] in %s : device descriptor must be local\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialize command in thread descriptor
+    thread_ptr->dev.nic.dev_xp = dev_xp;
+
+    // call driver to test readable
+    thread_ptr->dev.nic.cmd = NIC_CMD_READABLE;
+    dev_ptr->cmd( thread_xp );
+
+    // check error
+    error = thread_ptr->dev.nic.error;
+    if( error ) return error;
+
+    // block and deschedule if queue non readable
+    if( thread_ptr->dev.nic.status == false )  
+    {
+        // get NIC-RX IRQ index and type
+        uint32_t   irq_type = dev_ptr->irq_type;
+        uint32_t   irq_id   = dev_ptr->irq_id;
+
+        // enable NIC-RX IRQ 
+        dev_icu_enable_irq( local_cxy , core->lid , irq_type , irq_id , dev_xp );
+
+        // block on THREAD_BLOCKED I/O condition and deschedule
+        thread_block( thread_ptr , THREAD_BLOCKED_IO );
+        sched_yield();
+
+        // disable NIC-RX channel IRQ 
+        dev_icu_disable_irq( local_cxy , core->lid , irq_type , irq_id );
+    }
+
+    // call driver for actual read 
+    thread_ptr->dev.nic.cmd     = NIC_CMD_READ;
+    thread_ptr->dev.nic.buffer  = pkd->buffer;
+    dev_ptr->cmd( thread_xp );
+
+    // check error
+    error = thread_ptr->dev.nic.error;
+    if( error ) return error;
+
+    // returns packet length   
+    pkd->length = thread_ptr->dev.nic.length;
+
+    nic_dmsg("\n[INFO] %s exit for NIC-RX thread on core %d in cluster %x\n", 
+             __FUNCTION__ , core->lid , local_cxy );
+
+    return 0;
+
+}   // end dev_nic_read()
+
 
 ////////////////////////////////////
-void dev_nic_init( chdev_t * chdev )
+error_t dev_nic_write( pkd_t * pkd )
 {
-
-assert( __FUNCTION__ , (chdev->func == DEV_FUNC_NIC) , 
-"bad func value");
-
-    thread_t * new_thread;
-    error_t    error;
-
-    // get "channel" & "is_rx" fields from chdev descriptor
-    uint32_t  channel = chdev->channel;
-    bool_t    is_rx   = chdev->is_rx;
-
-    // set chdev name
-    if( is_rx ) snprintk( chdev->name , 16 , "nic%d_rx" , channel );
-    else        snprintk( chdev->name , 16 , "nic%d_tx" , channel );
-
-    // initialize the root of the listening sockets list
-    xlist_root_init( XPTR( local_cxy , &chdev->ext.nic.root ) );
-
-    // initialize the lock protecting this list
-    remote_busylock_init( XPTR( local_cxy , &chdev->ext.nic.lock ),
-                          LOCK_LISTEN_SOCKET );
-
-    // call driver init function for this chdev
-    hal_drivers_nic_init( chdev );
-
-    // select a core to execute the NIC server thread
-    lid_t lid = cluster_select_local_core( local_cxy );
-
-    // bind the NIC IRQ to the selected core
-    dev_pic_bind_irq( lid , chdev );
-
-    // build pointer on server function
-    void * server_func = is_rx ? &dev_nic_rx_server : &dev_nic_tx_server;
-
-    // create server thread
-    error = thread_kernel_create( &new_thread,
-                                  THREAD_DEV,
-                                  server_func,
-                                  chdev,
-                                  lid ); 
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot create server thread\n", __FUNCTION__ );
-        return;
-    }
-
-    // set "server" field in chdev descriptor
-    chdev->server = new_thread;
-    
-    // set "chdev" field in thread descriptor
-    new_thread->chdev = chdev;
-
-    // unblock server thread
-    thread_unblock( XPTR( local_cxy , new_thread ) , THREAD_BLOCKED_GLOBAL );
-
-#if (DEBUG_DEV_NIC_TX || DEBUG_DEV_NIC_RX)
-thread_t * this = CURRENT_THREAD;
-if( is_rx )
-printk("\n[%s] thread[%x,%x] initialized NIC_RX[%d] / server %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, new_thread->trdid );
-else
-printk("\n[%s] thread[%x,%x] initialized NIC_TX[%d] / server %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, new_thread->trdid );
-#endif
-   
-}  // end dev_nic_init()
-
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//      Functions directly called by the client threads
-///////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////
-uint32_t dev_nic_get_key( uint32_t addr,
-                          uint16_t port )
-{
-    thread_t * this = CURRENT_THREAD;
-    
-    // get cluster and local pointer fo the nic_tx[0] chdev
-    xptr_t    dev_xp  = chdev_dir.nic_tx[0];
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-
-    if( dev_xp == XPTR_NULL )
-    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : nic_tx[0] chdev undefined in chdev_dir of cluster %x\n",
-__FUNCTION__, local_cxy );
-#endif
-        return -1;
-    }
-    
-    // set command arguments in client thread descriptor
-    this->nic_cmd.buffer = (uint8_t *)addr;
-    this->nic_cmd.length = (uint32_t)port;
-    this->nic_cmd.dev_xp = dev_xp;
-    this->nic_cmd.type   = NIC_CMD_GET_KEY;
-
-    // get cmd function pointer from nic_tx[0] chdev descriptor
-    dev_cmd_t * cmd = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ));
-    
-    // call driver 
-    cmd( XPTR( local_cxy , this ) );
-
-    // return command status 
-    return this->nic_cmd.status;
-
-}  // end dev_nic_get_key()
-
-//////////////////////////////////////////
-error_t dev_nic_set_run( uint32_t channel,
-                         uint32_t run )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    if( channel >= LOCAL_CLUSTER->nb_nic_channels ) return -1;
-
-    // get cluster and local pointer fo the nic_tx[channel] chdev
-    xptr_t    dev_xp  = chdev_dir.nic_tx[channel];
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-
-    if( dev_xp == XPTR_NULL ) 
-    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : nic_tx[%d] chdev undefined in chdev_dir of cluster %x\n",
-__FUNCTION__, channel, local_cxy );
-#endif
-        return -1;
-    }
-    
-    // set command arguments in client thread descriptor
-    this->nic_cmd.dev_xp = dev_xp;
-    this->nic_cmd.type   = NIC_CMD_SET_RUN;
-    this->nic_cmd.length = channel;
-    this->nic_cmd.status = run;
-
-    // get cmd function pointer from nic_tx[channel] chdev descriptor
-    dev_cmd_t * cmd = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ));
-    
-    // call driver 
-    cmd( XPTR( local_cxy , this ) );
-
-    // return "error" 
-    return this->nic_cmd.error;
-
-}  // end dev_nic_set_run()
-
-//////////////////////////////////
-error_t dev_nic_get_instru( void )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // get cluster and local pointer fo the nic_tx[0] chdev
-    xptr_t    dev_xp  = chdev_dir.nic_tx[0];
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    
-    if( dev_xp == XPTR_NULL ) 
-    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : nic_tx[0] chdev undefined in chdev_dir of cluster %x\n",
-__FUNCTION__, local_cxy );
-#endif
-        return -1;
-    }
-    
-    // set command arguments in client thread descriptor
-    this->nic_cmd.dev_xp = dev_xp;
-    this->nic_cmd.type   = NIC_CMD_GET_INSTRU;
-
-    // get cmd function pointer from nic_tx[0] chdev descriptor
-    dev_cmd_t * cmd = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ));
-    
-    // call driver 
-    cmd( XPTR( local_cxy , this ) );
-
-    // return "error" 
-    return this->nic_cmd.error;
-
-}  // end dev_nic_get_instru()
-
-
-////////////////////////////////////
-error_t dev_nic_clear_instru( void )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // get cluster and local pointer fo the nic_tx[0] chdev
-    xptr_t    dev_xp  = chdev_dir.nic_tx[0];
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    
-    if( dev_xp == XPTR_NULL ) 
-    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : nic_tx[0] chdev undefined in chdev_dir of cluster %x\n",
-__FUNCTION__, local_cxy );
-#endif
-        return -1;
-    }
-    
-    // set command arguments in client thread descriptor
-    this->nic_cmd.dev_xp = dev_xp;
-    this->nic_cmd.type   = NIC_CMD_GET_INSTRU;
-
-    // get cmd function pointer from nic_tx[0] chdev descriptor
-    dev_cmd_t * cmd = hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ));
-    
-    // call driver 
-    cmd( XPTR( local_cxy , this ) );
-
-    // return "error" 
-    return this->nic_cmd.error;
-
-}  // end dev_nic_clear_instru()
-
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//      Static functions called by the NIC_RX server & NIC_TX server threads
-////////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is used by the dev_nic_rx_handle_tcp() function
-// to check acceptability of a given sequence number. It returns true when 
-// the <seq> argument is contained in a wrap-around window defined by the 
-// <min> and <max> arguments. The window wrap-around when (min > max).
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ seq   : [in] value to be checked.
-// @ min   : [in] first  base.
-// @ max   : [in] window size.
-////////////////////////////////////////////////////////////////////////////////////////////
-static inline bool_t is_in_window( uint32_t seq,
-                                   uint32_t min,
-                                   uint32_t max )
-{
-    if( max >= min )    // no wrap_around => only one window [min,max]
-    {
-        return( (seq >= min) && (seq <= max) ); 
-    }
-    else                // window wrap-around => two windows [min,0xFFFFFFFF] and [0,max]
-    {
-        return( (seq <= max) || (seq >= min) );
-    }
-}  
-
-////////////////////////////////////////////////////////////////////////////////////////
-// This static function computes the checksum for an IP packet header.
-// The "checksum" field itself is not taken into account for this computation.
-////////////////////////////////////////////////////////////////////////////////////////
-// @ buffer      : [in] pointer on IP packet header (20 bytes)
-// @ return the checksum value on 16 bits
-////////////////////////////////////////////////////////////////////////////////////////
-static uint16_t dev_nic_ip_checksum( uint8_t  * buffer )
-{
-    uint32_t   i;           
-    uint32_t   cs;      // 32 bits accumulator
-    uint16_t * buf;     
-    
-    buf = (uint16_t *)buffer;
-
-    // compute checksum 
-    for( i = 0 , cs = 0 ; i < 10 ; i++ )
-    {
-        if( i != 5 )  cs += buf[i];
-    }
-
-    // one's complement
-    return ~cs;
-}
-
-////////////////////////////////////////////////////////////////////////////////////////
-// This static function computes the checksum for a TCP segment or an UDP packet,
-// defined by the <buffer> and <length> arguments. 
-// It includes the "pseudo header "defined by the <src_ip_addr>, <dst_ip_addr>, and
-// <tcp_length> arguments, and by the UDP/TCP protocol code.
-////////////////////////////////////////////////////////////////////////////////////////
-// @ buffer      : [in] pointer on buffer containing the TCP segment or UDP packet.
-// @ length      : [in] number of bytes in this packet/segment (including header).
-// @ src_ip_addr : [in] source IP address (pseudo header).
-// @ dst_ip_addr : [in] destination IP address (pseudo header).
-// @ is_tcp      : [in] TCP if true / UDP if false (pseudo header).
-// @ return the checksum value on 16 bits
-////////////////////////////////////////////////////////////////////////////////////////
-static uint16_t dev_nic_tcp_udp_checksum( uint8_t  * buffer,
-                                          uint32_t   length,
-                                          uint32_t   src_ip_addr,
-                                          uint32_t   dst_ip_addr,
-                                          bool_t     is_tcp )
-{
-    uint32_t   i;           
-    uint32_t   carry;
-    uint32_t   cs;      // 32 bits accumulator
-    uint16_t * buf;
-    uint32_t   max;     // number of uint16_t in segment/paket
-
-    // compute max & buf
-    buf = (uint16_t *)buffer;
-    max = length >> 1;
-
-    // extend buffer[] if required
-    if( length & 1 )
-    {
-        max++;
-        buffer[length] = 0;
-    }
-
-    // compute checksum for TCP segment
-    for( i = 0 , cs = 0 ; i < max ; i++ )  cs += buf[i];
-
-    // complete checksum for pseudo-header
-    cs += (src_ip_addr & 0xFFFF);
-    cs += (src_ip_addr >> 16 );
-    cs += (dst_ip_addr & 0xFFFF);
-    cs += (dst_ip_addr >> 16 );
-    cs += length;
-    cs += (is_tcp ? PROTOCOL_TCP : PROTOCOL_UDP);
-
-    // handle carry
-    carry = (cs >> 16);
-    if( carry ) 
-    {
-        cs += carry; 
-        carry = (cs >> 16);
-        if( carry ) cs += carry;
-    } 
-
-    // one's complement
-    return ~cs;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the NIC_TX and NIC_RX server threads to unblock
-// the TX client thread after completion (success or error) of a TX command registered
-// in a socket identified by the <socket_xp> argument. 
-// The <status> argument defines the command success/failure status.
-// For all commands, it copies the status value in the tx_sts field, and print an error 
-// message on TXT0 in case of failure.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ socket_xp  : [in] extended pointer on socket
-// @ status     : [in] command status (see above)
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_unblock_tx_client( xptr_t   socket_xp,
-                                       int32_t  status )
-{
-    // get socket thread cluster and local pointer
-    socket_t * socket_ptr = GET_PTR( socket_xp );
-    cxy_t      socket_cxy = GET_CXY( socket_xp );
-
-    if( (status != CMD_STS_SUCCESS) && (status != CMD_STS_EOF) )
-    {
-        uint32_t sock_state = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->state ));
-        uint32_t cmd_type   = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_cmd ));
-        pid_t    pid        = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-        fdid_t   fdid       = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ));
-
-        printk("\n[WARNING] reported by %s : socket[%x,%d] / %s / cmd %s / status %s \n",
-        __FUNCTION__, pid, fdid, socket_state_str(sock_state),
-        socket_cmd_type_str(cmd_type), socket_cmd_sts_str(status) );
-    }
-
-    // set tx_sts field in socket descriptor
-    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->tx_sts ) , status );
-
-    // get extended point on TX client thread
-    xptr_t client_xp = hal_remote_l64( XPTR( socket_cxy , &socket_ptr->tx_client ));
-
-    // unblock the client thread
-    thread_unblock( client_xp , THREAD_BLOCKED_IO );
-
-}  // end dev_nic_unblock_tx_client()
-
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//               Functions called by the NIC_RX server thread
-///////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the NIC_RX server threads to unblock
-// the RX client thread after completion (success or error) of an RX command registered
-// in a socket identified by the <socket_xp> argument.
-// The <status> argument defines the command success/failure status. 
-// For all commands, it copies the status value in the rx_sts field, and print an error 
-// message on TXT0 in case of failure.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ socket_xp  : [in] extended pointer on socket
-// @ status     : [in] command status (see above)
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_unblock_rx_client( xptr_t   socket_xp,
-                                       int32_t  status )
-{
-    // get socket thread cluster and local pointer
-    socket_t * socket_ptr = GET_PTR( socket_xp );
-    cxy_t      socket_cxy = GET_CXY( socket_xp );
-
-    if( (status != CMD_STS_SUCCESS) && (status != CMD_STS_EOF) )
-    {
-        uint32_t sock_state = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->state ));
-        uint32_t cmd_type   = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->rx_cmd ));
-        pid_t    pid        = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-        fdid_t   fdid       = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ));
-
-        printk("\n[WARNING] reported by %s : socket[%x,%d] / %s / cmd %s / status %s\n",
-        __FUNCTION__, pid, fdid, socket_state_str(sock_state),
-        socket_cmd_type_str(cmd_type), socket_cmd_sts_str(status) );
-    }
-
-    // set rx_sts field in socket descriptor
-    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->rx_sts ) , status );
-
-    // get extended point on RX client thread
-    xptr_t client_xp = hal_remote_l64( XPTR( socket_cxy , &socket_ptr->rx_client ));
-
-    // unblock the client thread
-    thread_unblock( client_xp , THREAD_BLOCKED_IO );
-
-}  // end dev_nic_unblock_rx_client()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the dev_nic_rx_server() function.
-// It analyses an Ethernet frame contained in the kernel buffer defined
-// by the <buffer> argument, and returns in the  <ip_length> argument the length
-// of the IP packet contained in the Ethernet packet payload.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ buffer     : [in] pointer on a received Ethernet packet
-// @ ip_length  : [out] length of IP packet (in bytes).
-// @ return 0 if success / return -1 if illegal packet length. 
-///////////////////////////////////////////////////////////////////////////////////////////
-static error_t dev_nic_rx_check_eth( uint8_t  * buffer,
-                                     uint32_t * ip_length )
-{
-    uint32_t length = ((uint32_t)buffer[12] << 8) | (uint32_t)buffer[13];
-
-    *ip_length = length;
+    error_t error;
+
+    // get pointers on the NIC-TX kernel tread 
+    thread_t * thread_ptr = CURRENT_THREAD;
+    xptr_t     thread_xp  = XPTR( local_cxy , thread_ptr );
+
+    // get local pointer on core running this kernel thead
+    core_t * core = thread_ptr->core;
+
+    nic_dmsg("\n[INFO] %s enters for NIC-RX thread on core %d in cluster %x\n", 
+                 __FUNCTION__ , core->lid , local_cxy );
+
+    // get pointer on NIC-TX device descriptor
+    uint32_t   channel = thread_ptr->dev_channel; 
+    xptr_t     dev_xp  = devices_dir.nic_tx[channel];
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    if ( dev_xp == XPTR_NULL )
+    {
+        printk("\n[PANIC] in %s : undefined NIC device descriptor\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    if ( dev_cxy != local_cxy )
+    {
+        printk("\n[PANIC] in %s : device descriptor must be local\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialize command in thread descriptor
+    thread_ptr->dev.nic.dev_xp = dev_xp;
+
+    // call driver to test writable
+    thread_ptr->dev.nic.cmd    = NIC_CMD_WRITABLE;
+    dev_ptr->cmd( thread_xp );
+
+    // check error
+    error = thread_ptr->dev.nic.error;
+    if( error ) return error;
+
+    // block and deschedule if queue non writable
+    if( thread_ptr->dev.nic.status == false )  
+    {
+        // get NIC-TX IRQ index and type
+        uint32_t   irq_type = dev_ptr->irq_type;
+        uint32_t   irq_id   = dev_ptr->irq_id;
+
+        // enable NIC-TX IRQ 
+        dev_icu_enable_irq( local_cxy , core->lid , irq_type , irq_id , dev_xp );
+
+        // block on THREAD_BLOCKED I/O condition and deschedule
+        thread_block( thread_ptr , THREAD_BLOCKED_IO );
+        sched_yield();
+
+        // disable NIC-TX IRQ 
+        dev_icu_disable_irq( local_cxy , core->lid , irq_type , irq_id );
+    }
+
+    // call driver for actual write
+    thread_ptr->dev.nic.cmd    = NIC_CMD_WRITE;
+    thread_ptr->dev.nic.buffer = pkd->buffer;
+    thread_ptr->dev.nic.length = pkd->length;
+    dev_ptr->cmd( thread_xp );
+
+    // check error
+    error = thread_ptr->dev.nic.error;
+    if( error ) return error;
+
+    nic_dmsg("\n[INFO] %s exit for NIC-TX thread on core %d in cluster %x\n", 
+             __FUNCTION__ , core->lid , local_cxy );
 
     return 0;
-}
-   
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function analyses the IP packet contained in the kernel buffer
-// defined by the <buffer> argument, and returns in the <ip_src_addr>, <ip_dst_addr>, 
-// <header_length> and <protocol> arguments the informations contained in the IP header.
-// It checks the IP packet length versus the value contained in Ethernet header.
-// It checks the IP header checksum.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ buffer          : [in] pointer on the IP packet.
-// @ expected_length : [in] expected IP packet length (from Ethernet header). 
-// @ ip_src_addr     : [out] source IP address.
-// @ ip_dst_addr     : [out] destination IP address.
-// @ protocol        : [out] transport protocol type.
-// @ return 0 if success / return -1 if illegal packet. 
-///////////////////////////////////////////////////////////////////////////////////////////
-static error_t dev_nic_rx_check_ip( uint8_t  * buffer,
-                                    uint32_t   expected_length, 
-                                    uint32_t * ip_src_addr, 
-                                    uint32_t * ip_dst_addr,
-                                    uint32_t * trsp_protocol )
-{
-
-#if DEBUG_DEV_NIC_RX
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get packet length
-    uint32_t length = ((uint32_t)buffer[2] << 8) | (uint32_t)buffer[3];
-
-    // discard packet if eth_payload_length != ip_length
-    if( length != expected_length )
-    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] failure : length (%d) != expected_length (%d)\n",
-__FUNCTION__, this->process->pid, this->trdid, length, expected_length );
-#endif
-        return -1;
-    }
-
-    // get transport protocol type
-    uint8_t protocol = buffer[9];
-
-    // discard packet if unsupported protocol 
-    if( (protocol != PROTOCOL_TCP) && (protocol != PROTOCOL_UDP) )
-    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] failure : unsupported transport protocol (%d)\n",
-__FUNCTION__, this->process->pid, this->trdid, protocol );
-#endif
-        return -1;
-
-    }
-    // compute IP header checksum 
-    uint32_t computed_cs = (uint32_t)dev_nic_ip_checksum( buffer );
-
-    // extract IP header checksum
-    uint32_t received_cs = ((uint32_t)buffer[10] << 8) | ((uint32_t)buffer[11]);
-
-    // discard packet if bad checksum
-    if( received_cs != computed_cs )
-    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] failure : computed checksum (%d) != received checksum (%d)\n",
-__FUNCTION__, this->process->pid, this->trdid, computed_cs, received_cs );
-#endif
-        return -1;
-    }
-
-
-    *ip_src_addr = ((uint32_t)buffer[12] << 24) |
-                   ((uint32_t)buffer[13] << 16) |
-                   ((uint32_t)buffer[14] <<  8) |
-                   ((uint32_t)buffer[15]      ) ;
-
-    *ip_dst_addr = ((uint32_t)buffer[16] << 24) |
-                   ((uint32_t)buffer[17] << 16) |
-                   ((uint32_t)buffer[18] <<  8) |
-                   ((uint32_t)buffer[19]      ) ;
-
-    *trsp_protocol = protocol;
-   
-    return 0;
-
-}   // end dev_nic_rx_check_ip()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function analyses the UDP packet contained in the kernel buffer
-// defined by the <k_buf> and <k_length> arguments.
-// It checks the UDP checksum, and discard corrupted packets.
-// It scans the list of sockets attached to the NIC_RX chdev to find a matching socket,
-// and discard the received packet if no UDP socket found.
-// Finally, it copies the payload to the socket "rx_buf", as long as the packet payload
-// is not larger than the rx_buf. 
-// It set the "rx_valid" flip-flop, and unblock the client thread when the last expected
-// byte has been received.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ chdev         : [in] local pointer on local NIC_RX chdev descriptor.
-// @ k_buf         : [in] pointer on the UDP packet in local kernel buffer.
-// @ k_length      : [in] number of bytes in buffer (including UDP header).
-// @ pkt_src_addr  : [in] source IP address (from IP packet header).
-// @ pkt_dst_addr  : [in] destination IP address (from IP packet header).
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_rx_handle_udp_packet( chdev_t  * chdev,
-                                          uint8_t  * k_buf,
-                                          uint32_t   k_length,
-                                          uint32_t   pkt_src_addr,
-                                          uint32_t   pkt_dst_addr )
-{
-    xptr_t     root_xp;           // extended pointer on attached sockets list root 
-    xptr_t     lock_xp;           // extended pointer on chdev lock 
-    xptr_t     iter_xp;           // iterator on socket list
-    xptr_t     socket_xp;         // extended pointer on socket descriptor
-    cxy_t      socket_cxy;
-    socket_t * socket_ptr;
-    uint32_t   socket_type;       // socket type
-    uint32_t   socket_state;      // socket state
-    uint32_t   local_addr;        // local IP address from socket
-    uint32_t   local_port;        // local port from socket
-    uint32_t   remote_addr;       // remote IP address from socket
-    uint32_t   remote_port;       // remote port from socket
-    bool_t     match_socket;      // matching socket found
-    uint16_t   checksum;          // computed checksum
-    uint16_t   pkt_checksum;      // received checksum
-    xptr_t     socket_rbuf_xp;    // extended pointer on socket rx_buf
-    xptr_t     socket_lock_xp;    // extended pointer on socket lock
-    xptr_t     socket_rx_client;  // socket rx_client thread
-    bool_t     socket_rx_valid;   // socket rx_command valid
-    uint32_t   socket_rx_cmd;     // socket rx_command type
-    uint32_t   payload;           // number of bytes in payload
-    uint32_t   status;            // number of bytes in rx_buf
-    uint32_t   space;             // number of free slots in rx_buf
-    uint32_t   moved_bytes;       // number of bytes actually moved to rx_buf
-
-#if DEBUG_DEV_NIC_RX || DEBUG_DEV_NIC_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_DEV_NIC_RX
-uint32_t   fdid;
-uint32_t   pid;
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] enter / channel %d / plen %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, chdev->channel, k_length, cycle );
-if( (DEBUG_DEV_NIC_RX < cycle) && (DEBUG_DEV_NIC_RX & 1))
-putb("64 first bytes in k_buf" , k_buf , 64 );
-#endif
-
-    // build extended pointers on list of sockets attached to NIC_RX chdev
-    root_xp = XPTR( local_cxy , &chdev->wait_root );
-    lock_xp = XPTR( local_cxy , &chdev->wait_lock );
-
-    // extract checksum from received UDP packet header 
-    pkt_checksum = ((uint16_t)k_buf[6] << 8) | (uint16_t)k_buf[7];
-
-    // reset checksum field
-    k_buf[6] = 0;
-    k_buf[7] = 0; 
-
-    // compute checksum from received UDP packet
-    checksum = dev_nic_tcp_udp_checksum( k_buf,
-                                         k_length,
-                                         pkt_src_addr,
-                                         pkt_dst_addr,
-                                         false );        // is_not_tcp
-    // discard corrupted packet  
-    if( pkt_checksum != checksum )
-    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[WARNING] in %s : thread[%x,%x] discard corrupted packet on channel %d / cycle %d\n"
-"   expected checksum %x / received checksum %x\n",
-__FUNCTION__, this->process->pid, this->trdid, chdev->channel, cycle,
-(uint32_t)checksum, (uint32_t)pkt_checksum ); 
-#endif
-        return;
-    }
-    
-    // get src_port and dst_port from UDP header
-    uint32_t pkt_src_port = ((uint32_t)k_buf[0] << 8) | (uint32_t)k_buf[1];
-    uint32_t pkt_dst_port = ((uint32_t)k_buf[2] << 8) | (uint32_t)k_buf[3];
-
-    // take the lock protecting the sockets list
-    remote_busylock_acquire( lock_xp );
-
-    match_socket = false;
-
-    // scan sockets list to find a match
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        // get socket cluster and local pointer
-        socket_xp  = XLIST_ELEMENT( iter_xp , socket_t , rx_list );
-        socket_ptr = GET_PTR( socket_xp );
-        socket_cxy = GET_CXY( socket_xp );
-
-        // get socket type 
-        socket_type  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->type ));
-        socket_state = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->state ));
-                
-        // skip TCP socket
-        if( socket_type == SOCK_STREAM ) continue;
-
-        // get relevant info from socket descriptor
-        local_addr  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_addr )); 
-        remote_addr = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->remote_addr )); 
-        local_port  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_port )); 
-        remote_port = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->remote_port )); 
-
-        // compute matching
-        bool_t local_match  = (local_addr  == pkt_dst_addr) && 
-                              (local_port  == pkt_dst_port);
-
-        bool_t remote_match = (remote_addr == pkt_src_addr) &&
-                              (remote_port == pkt_src_port);
-
-        if (socket_state == UDP_STATE_ESTAB ) match_socket = local_match && remote_match;
-        else                                  match_socket = local_match;
-
-        // exit loop if matching
-        if( match_socket ) 
-        {
-
-#if DEBUG_DEV_NIC_RX
-fdid = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ) );
-pid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ) );
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] found matching UDP socket[%d,%d] / state %s\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, fdid, socket_state_str(socket_state) );
-#endif
-            break;
-        }
-    }
-
-    // release the lock protecting the sockets list
-    remote_busylock_release( lock_xp );
-
-    // discard unexpected packet
-    if( match_socket == false )
-    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[WARNING] in %s : thread[%x,%s] discard unexpected packet on channel %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, chdev->channel, cycle ); 
-#endif
-        return;
-    }
- 
-    // build extended pointers on socket.rx_buf and socket.lock
-    socket_rbuf_xp   = XPTR( socket_cxy , &socket_ptr->rx_buf );
-    socket_lock_xp   = XPTR( socket_cxy , &socket_ptr->lock ); 
-
-    // take the lock protecting the socket 
-    remote_queuelock_acquire( socket_lock_xp );
-
-    // get status & space from rx_buf
-    status = remote_buf_status( socket_rbuf_xp );
-    space  = (1 << CONFIG_SOCK_RX_BUF_ORDER) - status;
-
-    // get socket rx_client, rx_valid and rx_cmd values
-    socket_rx_client = hal_remote_l64( XPTR( socket_cxy , &socket_ptr->rx_client ) );
-    socket_rx_valid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->rx_valid ) );
-    socket_rx_cmd    = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->rx_cmd ) );
-
-    // get number of bytes in payload
-    payload = k_length - UDP_HEAD_LEN;
-
-    // compute number of bytes to move : min (space , seg_payload)
-    moved_bytes = ( space < payload ) ? space : payload;
-
-    // move payload from kernel buffer to socket rx_buf
-    remote_buf_put_from_kernel( socket_rbuf_xp,
-                                k_buf + UDP_HEAD_LEN,
-                                moved_bytes );
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] for socket[%d,%d] move %d bytes to rx_buf / buf_sts %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, fdid, 
-moved_bytes, remote_buf_status(socket_rbuf_xp), moved_bytes );
-#endif
-
-    // signal client thread if pending RECV command
-    if( (socket_rx_valid == true) && (socket_rx_cmd == CMD_RX_RECV) )
-    {
-        // reset rx_valid
-        hal_remote_s32( XPTR(socket_cxy , &socket_ptr->rx_valid), false );
-
-        // report success to RX client thread
-        dev_nic_unblock_rx_client( socket_xp , CMD_STS_SUCCESS );
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] for UDP socket[%x,%d] / unblock client thread\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, fdid );
-#endif
-
-    }
-    else
-    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] for socket[%x,%d] / no client thread\n"
-"    rx_valid %d / rx_cmd %s\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, fdid,
-socket_rx_valid , socket_cmd_type_str(socket_rx_cmd) );
-#endif
-
-    }
-
-    // release the lock protecting the socket
-    remote_queuelock_release( socket_lock_xp );
-
-}  // end dev_nic_rx_handle_udp_packet()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the dev_nic_rx_server() function to handle one RX
-// TCP segment contained in a kernel buffer defined by the <k_buf> & <k_length> arguments.
-// The <seg_remote_addr> and <seg_local_addr> arguments have been extracted from the IP
-// IP header. The local and remote ports are obtained from the TCP header.
-// It the received segment doesn't match any connected socket attached to the selected 
-// <chdev>, or any listening socket waiting connection, or if the segment is corrupted,
-// the segment is discarded. This function implement the TCP error recovery protocol,
-// as specified by the RFC. Depending on both the socket state, and the segment header:
-//  - it register data in the RX buffer,
-//  - it update the socket state and TCB,
-//  - it register acknolegce requests in the R2T queue,
-//  - it register connection requests in the CRQ queue,
-///////////////////////////////////////////////////////////////////////////////////////////
-// Implementation note:
-// A "connected" socket is actually a TCP socket already attached to a given NIC_RX[k]
-// chdev, and can therefore receive a TCP segment on the NIC channel <k>. A "listening"
-// socket is a TCP socket in the LISTEN state. This function operates in 6 steps:
-// 1) It checks the TCP checksum, and discard the corrupted segment if corrupted.
-// 2) It scans the list of sockets attached to the NIC_RX[k] chdev, to find one TCP
-//    socket matching the TCP segment header. 
-// 3) When a matching connected socket is found, it handles the received segment, including 
-//    the SYN, FIN, ACK and RST flags. It updates the socket state when required, moves 
-//    data to the rx_buf when possible, and return. It takes the lock protecting the socket,
-//    because a connected socket is accessed by both the NIC_TX and NIC_RX server threads.
-// 4) If no matching connected socket has been found, it scans the list of listening 
-//    sockets to find a matching listening socket. 
-// 5) When a matching listening socket is found, it simply registers a new connection
-//    request in the listening socket CRQ queue, when the SYN flag is set, and insert 
-//    a SYN-ACK request in the socket R2T queue.
-// 6) It discards the packet if no connected or listening socket has been found.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ chdev           : [in] local pointer on local NIC_RX chdev descriptor.
-// @ k_buf           : [in] pointer on the TCP packet in local kernel buffer.
-// @ k_length        : [in] number of bytes in buffer (including TCP header).
-// @ seg_remote_addr : [in] remote IP address (from IP packet header).
-// @ seg_local_addr  : [in] local IP address (from IP packet header).
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_rx_handle_tcp_segment( chdev_t  * chdev,
-                                           uint8_t  * k_buf,
-                                           uint32_t   k_length,
-                                           uint32_t   seg_remote_addr,
-                                           uint32_t   seg_local_addr )
-{
-    xptr_t     root_xp;            // extended pointer on connected sockets list root 
-    xptr_t     lock_xp;            // extended pointer on chdev lock 
-    xptr_t     iter_xp;            // iterator for these queues
-    bool_t     attached_match;     // true if one attached socket match 
-    bool_t     listening_match;    // true if one listening socket match
-    xptr_t     socket_xp;          // extended pointer on matching socket
-    cxy_t      socket_cxy;         // cluster identifier of matching socket
-    socket_t * socket_ptr;         // local pointer on matching socket
-    uint32_t   socket_local_addr;  // local IP address from socket
-    uint32_t   socket_local_port;  // local port from socket
-    uint32_t   socket_remote_addr; // remote IP address from socket
-    uint32_t   socket_remote_port; // remote port from socket
-    uint32_t   socket_state;       // socket state
-    uint32_t   socket_type;        // socket type
-    bool_t     socket_tx_valid;    // TX command valid
-    uint32_t   socket_tx_cmd;      // TX command type
-    uint32_t   socket_tx_nxt;      // next byte to send in TX stream
-    uint32_t   socket_tx_una;      // first unacknowledged byte in TX stream
-    uint32_t   socket_tx_len;      // number of bytes in tx_buf
-    uint32_t   socket_tx_ack;      // number of acknowledged bytes in tx_buf
-    bool_t     socket_rx_valid;    // RX command valid
-    uint32_t   socket_rx_cmd;      // TX command type
-    uint32_t   socket_rx_nxt;      // next expected byte in RX stream
-    uint32_t   socket_rx_wnd;      // current window value in RX stream
-    uint32_t   socket_rx_irs;      // initial sequence index in RX stream
-    xptr_t     socket_lock_xp;     // extended pointer on lock protecting socket state
-    xptr_t     socket_rx_buf_xp;   // extended pointer on socket rx_buf
-    xptr_t     socket_r2tq_xp;     // extended pointer on socket R2T queue
-    xptr_t     socket_crqq_xp;     // extended pointer on socket CRQ queue
-    uint16_t   checksum;           // computed TCP segment chechsum
-    error_t    error;
-
-    // get relevant infos from TCP segment header
-    uint32_t seg_remote_port = ((uint32_t)k_buf[0] << 8) | (uint32_t)k_buf[1];
-    uint32_t seg_local_port  = ((uint32_t)k_buf[2] << 8) | (uint32_t)k_buf[3];
-
-    uint32_t seg_seq_num  = ((uint32_t)k_buf[4]  << 24) | 
-                            ((uint32_t)k_buf[5]  << 16) |
-                            ((uint32_t)k_buf[6]  <<  8) |
-                            ((uint32_t)k_buf[7]       );
-
-    uint32_t seg_ack_num  = ((uint32_t)k_buf[8]  << 24) | 
-                            ((uint32_t)k_buf[9]  << 16) |
-                            ((uint32_t)k_buf[10] <<  8) |
-                            ((uint32_t)k_buf[11]      );
-
-    uint8_t  seg_hlen     = k_buf[12] << 2;       // TCP header length in bytes
- 
-    uint8_t  seg_flags    = k_buf[13];
-
-    bool_t   seg_ack_set  = ((seg_flags & TCP_FLAG_ACK) != 0);
-    bool_t   seg_syn_set  = ((seg_flags & TCP_FLAG_SYN) != 0);
-    bool_t   seg_fin_set  = ((seg_flags & TCP_FLAG_FIN) != 0);
-    bool_t   seg_rst_set  = ((seg_flags & TCP_FLAG_RST) != 0);
-
-    uint16_t seg_window   = ((uint32_t)k_buf[14] << 8) | (uint32_t)k_buf[15];
-
-    uint16_t seg_checksum = ((uint32_t)k_buf[16] << 8) | (uint32_t)k_buf[17];
-
-    uint32_t seg_data_len = k_length - seg_hlen;  // number of bytes in payload
-
-    uint32_t seg_data_dup;     // number of duplicated bytes in payload
-    uint32_t seg_data_new;     // number of new bytes in payload
-
-#if DEBUG_DEV_NIC_RX || DEBUG_DEV_NIC_ERROR
-uint32_t   fdid;
-pid_t      pid;
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] enters / tcp_length %d / tcp_flags %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, k_length, seg_flags , cycle );
-#endif
-
-    // reset checksum field
-    k_buf[16] = 0;
-    k_buf[17] = 0;
-
-    // compute TCP checksum
-    checksum = dev_nic_tcp_udp_checksum( k_buf,
-                                         k_length,
-                                         seg_remote_addr,
-                                         seg_local_addr,
-                                         true );            // is_tcp
-    // discard segment if corrupted 
-    if( seg_checksum != checksum )
-    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[WARNING] in %s : thread[%x,%x] / checksum failure on channel %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, chdev->channel, cycle );
-#endif
-        return;
-    }
-    
-    // build extended pointer on xlist of sockets attached to NIC_RX chdev
-    root_xp = XPTR( local_cxy , &chdev->wait_root );
-    lock_xp = XPTR( local_cxy , &chdev->wait_lock );
-
-    attached_match = false;
-
-    // take the lock protecting the list of attached sockets
-    remote_busylock_acquire( lock_xp );
-
-    // scan list of attached sockets to find a matching TCP socket
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        // get socket cluster and local pointer
-        socket_xp  = XLIST_ELEMENT( iter_xp , socket_t , rx_list );
-        socket_ptr = GET_PTR( socket_xp );
-        socket_cxy = GET_CXY( socket_xp );
-
-        // get socket type and state
-        socket_type  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->type ));
-        socket_state = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->state ));
-                
-        // skip UDP socket
-        if( socket_type == SOCK_DGRAM ) continue;
-
-        // get relevant socket infos for matching
-        socket_local_addr   = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_addr )); 
-        socket_remote_addr  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->remote_addr )); 
-        socket_local_port   = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_port )); 
-        socket_remote_port  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->remote_port )); 
-                
-        // compute matching condition for a connected socket
-        attached_match = (socket_local_addr  == seg_local_addr) && 
-                         (socket_local_port  == seg_local_port) &&
-                         (socket_remote_addr == seg_remote_addr) &&
-                         (socket_remote_port == seg_remote_port) ;
-
-        // exit loop if matching
-        if( attached_match ) 
-        {
-
-#if DEBUG_DEV_NIC_RX || DEBUG_DEV_NIC_ERROR
-fdid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ) );
-pid   = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ) );
-#endif
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] matching attached TCP socket[%d,%d] / state %s\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-            break;
-        }
-
-    }  // end loop on attached sockets
-
-    // release the lock protecting the list of attached sockets
-    remote_busylock_release( lock_xp );
-
-    // handle TCP segment for an attached socket
-    if( attached_match )
-    {
-        // The actions depend on both the socket state and the received segment flags :
-        // - update socket state,
-        // - move data to rx_buf,
-        // - register a request in R2T queue when required
- 
-        // build extended pointers on various socket fields
-        socket_lock_xp    = XPTR( socket_cxy , &socket_ptr->lock );
-        socket_rx_buf_xp  = XPTR( socket_cxy , &socket_ptr->rx_buf );
-        socket_r2tq_xp    = XPTR( socket_cxy , &socket_ptr->r2tq );
-
-        // take the lock protecting the matching socket
-        remote_queuelock_acquire( socket_lock_xp );
-
-        // get relevant socket infos from socket descriptor
-        socket_tx_valid = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->tx_valid ));
-        socket_tx_cmd   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->tx_cmd ));
-        socket_tx_nxt   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->tx_nxt )); 
-        socket_tx_una   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->tx_una ));
-        socket_tx_ack   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->tx_ack ));
-        socket_tx_len   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->tx_len ));
-
-        socket_rx_valid = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->rx_valid ));
-        socket_rx_cmd   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->rx_cmd ));
-        socket_rx_nxt   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->rx_nxt )); 
-        socket_rx_wnd   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->rx_wnd )); 
-        socket_rx_irs   = hal_remote_l32(XPTR( socket_cxy , &socket_ptr->rx_irs ));
-
-        // handle the received segment, depending on the matching socket state 
-        switch( socket_state )
-        {
-            ////////////////////////
-            case TCP_STATE_SYN_SENT:  // TCP client waiting for SYN-ACK 
-            {
-                // [1] & [2] check ACK and RST
-                if( seg_ack_set )
-                {
-                    bool_t ack_ok = (seg_ack_num == (CONFIG_SOCK_ISS_CLIENT + 1) );
-
-                    if( seg_rst_set && ack_ok )
-                    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s]  socket[%x,%d] %s RST received from remote TCP => close\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        // report RST to local TCP client thread
-                        dev_nic_unblock_tx_client( socket_xp , CMD_STS_RST );
-
-                        // update socket state
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                          TCP_STATE_BOUND );
-                        break;
-                    }
-
-                    if( seg_rst_set && (ack_ok == false) )
-                    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s RST but expect ack_num %x != rcvd %x => discard\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state),
-CONFIG_SOCK_ISS_CLIENT + 1, seg_ack_num );
-#endif
-                        break;
-                    }
-
-                    if( (seg_rst_set == false) && (ack_ok == false) )
-                    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s expected ack_num %x != rcvd %x => send RST\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state), 
-CONFIG_SOCK_ISS_CLIENT + 1, seg_ack_num );
-#endif
-                        // send RST to remote TCP
-                        socket_put_r2t_request( socket_r2tq_xp,
-                                                TCP_FLAG_RST,
-                                                chdev->channel );
-                        break;
-                    }
-                }
-
-                // [3] handle security & precedence TODO ... someday
-
-                // [4] handle SYN-ACK
-                if( seg_syn_set && seg_ack_set )  // received SYN and ACK => report success
-                { 
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : received expected SYN-ACK\n",
-__FUNCTION__, pid, fdid , socket_state_str(socket_state) );
-#endif
-                    // set socket.tx_una  
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_una), seg_ack_num );
-
-                    // set socket.rx_irs
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->rx_irs), seg_seq_num );
-
-                    // set socket.rx_nxt
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->rx_nxt), seg_seq_num + 1 );
-
-                    // update socket.state
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state), TCP_STATE_ESTAB );
-
-                    // make an ACK request to R2T queue
-                    socket_put_r2t_request( socket_r2tq_xp,
-                                            TCP_FLAG_ACK,
-                                            chdev->channel );
-
-                    // report succes to local TX client thread
-                    dev_nic_unblock_tx_client( socket_xp , CMD_STS_SUCCESS );
-                }
-                else        // SYN without ACK => TCP client becomes a TCP server
-                {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : received SYN without ACK => send a SYN_ACK\n",
-__FUNCTION__, pid, fdid , socket_state_str(socket_state) );
-#endif
-                    // update socket.state
-                    hal_remote_s32( XPTR(socket_cxy,&socket_ptr->state),
-                                    TCP_STATE_SYN_RCVD );
-
-                    // set socket.tx_nxt 
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_nxt),
-                                    CONFIG_SOCK_ISS_SERVER );
-
-                    // set socket.rx_nxt to seg_seq_num + 1
-                    hal_remote_s32( XPTR(socket_cxy,&socket_ptr->rx_nxt), seg_seq_num + 1 );
-
-                    // send SYN.ACK to remote TCP
-                    socket_put_r2t_request( socket_r2tq_xp,
-                                            TCP_FLAG_SYN | TCP_FLAG_ACK,
-                                            chdev->channel );
-                }
-                break;
-            }  // end state SYN_SENT
-
-            ////////////////////////    all "connected" states
-            case TCP_STATE_SYN_RCVD:
-            case TCP_STATE_ESTAB:
-            case TCP_STATE_FIN_WAIT1:
-            case TCP_STATE_FIN_WAIT2:
-            case TCP_STATE_CLOSE_WAIT:
-            case TCP_STATE_CLOSING:
-            case TCP_STATE_LAST_ACK:
-            case TCP_STATE_TIME_WAIT:
-            {
-                // [1] check SEQ_NUM 
-                // - we accept duplicate segments (i.e. seq_num < rx_next)
-                // - we don't accept out of order segment (i.e. seq_num_num > rx_next)
-                //   => seq_num must be in window [rx_nxt - rx_win , rx_nxt]
-
-                bool_t seq_ok =  is_in_window( seg_seq_num,
-                                               (socket_rx_nxt - socket_rx_wnd),
-                                               socket_rx_nxt );
-
-                if( seq_ok == false ) // SEQ_NUM not acceptable
-                {
-                    if( seg_rst_set )
-                    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s expect seq_num %x != rcvd %x and RST => discard\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state),
-CONFIG_SOCK_ISS_CLIENT + 1, seg_seq_num );
-#endif
-                        break;
-                    }
-                    else  // no RST
-                    {
-                        // send ACK to remote TCP
-                        socket_put_r2t_request( socket_r2tq_xp,
-                                                TCP_FLAG_ACK,
-                                                chdev->channel );
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s expect seq_num %x != rcvd %x => ACK and discard\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state),
-CONFIG_SOCK_ISS_CLIENT + 1, seg_seq_num );
-#endif
-                        break;
-                    }
-                }
-                else                   // SEQ_NUM acceptable
-                {
-                    // compute number of new bytes & number of duplicated bytes
-                    if( seg_seq_num != socket_rx_nxt )  // duplicate segment
-                    {
-                        seg_data_dup = socket_rx_nxt - seg_seq_num; 
-                        seg_data_new = (seg_data_len > seg_data_dup) ?
-                                       (seg_data_len - seg_data_dup) : 0;
-                    }
-                    else                                // expected segment
-                    {
-                        seg_data_dup = 0;
-                        seg_data_new = seg_data_len;
-                    }
-                    
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s seq_num %x / rx_nxt %x / len %d / new %d / dup %d\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state), 
-seg_seq_num, socket_rx_nxt, seg_data_len, seg_data_new, seg_data_dup );
-#endif
-                }
-
-                // [2] handle RST flag (depending on socket state)
-                if( seg_rst_set  ) 
-                {
-                    if( socket_state == TCP_STATE_SYN_RCVD )
-                    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s RST received from remote TCP => report to user\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        // report RST to local TX client thread
-                        dev_nic_unblock_tx_client( socket_xp , CMD_STS_RST );
-
-                        // update socket state
-                        hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state),
-                                        TCP_STATE_BOUND );
-                        break;
-                    }
-
-                    else if( (socket_state == TCP_STATE_ESTAB     ) ||
-                             (socket_state == TCP_STATE_FIN_WAIT1 ) ||
-                             (socket_state == TCP_STATE_FIN_WAIT2 ) ||
-                             (socket_state == TCP_STATE_CLOSE_WAIT) )
-                    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s / received RST flag\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        // report RST to local TX client thread
-                        if( socket_tx_valid ) dev_nic_unblock_tx_client( socket_xp, 
-                                                                         CMD_STS_RST );
-                        // report RST to local RX client thread
-                        if( socket_rx_valid ) dev_nic_unblock_rx_client( socket_xp, 
-                                                                         CMD_STS_RST );
-                        // update socket state
-                        hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state),
-                                        TCP_STATE_BOUND );
-                        break;
-                    }
-                    else  // states CLOSING / LAST_ACK / TIME_WAIT
-                    {
-                        // update socket state
-                        hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state),
-                                        TCP_STATE_BOUND );
-                        break;
-                    }
-                }
- 
-                // [3] handle security & precedence TODO ... someday
-
-                // [4] check SYN  
-                if( seg_syn_set )           // received SYN => send RST to remote
-                {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s socket[%x,%d] %s : received SYN flag => send RST-ACK\n",
-__FUNCTION__, pid, fdid , socket_state_str(socket_state) );
-#endif
-                    // send RST & ACK to remote TCP 
-                    socket_put_r2t_request( socket_r2tq_xp,
-                                            TCP_FLAG_RST | TCP_FLAG_ACK,
-                                            chdev->channel );
-
-                    // report RST to local TX client thread
-                    if( socket_tx_valid ) dev_nic_unblock_tx_client( socket_xp, 
-                                                                     CMD_STS_RST );
-                    // report RST to local RX client thread
-                    if( socket_rx_valid ) dev_nic_unblock_rx_client( socket_xp, 
-                                                                     CMD_STS_RST );
-                    // update socket state
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state), 
-                                    TCP_STATE_BOUND );
-                    break;
-                }
-
-                // [5] handle ACK (depending on socket state)
-                if( seg_ack_set == false )           // missing ACK => discard segment
-                {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s / no ACK in segment => discard\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                    break;
-                }
-
-                // compute acceptable ACK
-                bool_t ack_ok = is_in_window( seg_ack_num,
-                                              socket_tx_una,
-                                              socket_tx_nxt );
-
-                if( socket_state == TCP_STATE_SYN_RCVD )
-                {
-                    if( ack_ok )                      //  acceptable ACK
-                    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : received expected ACK => update socket\n",
-__FUNCTION__, pid, fdid , socket_state_str(socket_state) );
-#endif
-                        // set socket.tx_una  
-                        hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_una), seg_ack_num );
-
-                        // update socket.state
-                        hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state), 
-                                        TCP_STATE_ESTAB );
-
-                        // report success to local TX client thread
-                        dev_nic_unblock_tx_client( socket_xp , CMD_STS_SUCCESS );
-                    }
-                    else                               // send RST to remote
-                    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s / ACK %x not in [%x,%x] => discard\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state),
-seg_ack_num, socket_tx_una, socket_tx_nxt );
-#endif
-                        // send RST & ACK to remote TCP 
-                        socket_put_r2t_request( socket_r2tq_xp,
-                                                TCP_FLAG_RST | TCP_FLAG_ACK,
-                                                chdev->channel );
-                        break;
-                    }
-                }
-
-                else if( (socket_state == TCP_STATE_ESTAB)      ||
-                         (socket_state == TCP_STATE_FIN_WAIT1)  ||
-                         (socket_state == TCP_STATE_FIN_WAIT2)  ||
-                         (socket_state == TCP_STATE_FIN_WAIT2)  ||
-                         (socket_state == TCP_STATE_CLOSE_WAIT) ||
-                         (socket_state == TCP_STATE_CLOSING)    )
-                {
-                    if( ack_ok )                      // acceptable ack
-                    {
-                        // compute number of acknowledged bytes 
-                        uint32_t ack_bytes =  seg_ack_num - socket_tx_una;
-
-                        if( ack_bytes )  // handle acknowledged bytes
-                        { 
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %d bytes acknowledged => update socket\n",
-__FUNCTION__, pid, fdid, ack_bytes );
-#endif
-                            // update socket.tx_una, socket.tx_ack, and socket.tx_wnd fields
-                            hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_una),
-                                            seg_ack_num );
-                            hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_ack),
-                                            socket_tx_ack + ack_bytes );
-                            hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_wnd),
-                                            seg_window );
-
-                            //  unblock the TX client thread if last byte acknowledged
-                            if( (socket_tx_ack + ack_bytes) == socket_tx_len )
-                            {
-                                // report success to TX client thread
-                                dev_nic_unblock_tx_client( socket_xp , CMD_STS_SUCCESS );
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : last ack => unblock TX client thread\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                            }
-                        }
-
-                        if( socket_state == TCP_STATE_FIN_WAIT1 )
-                        {
-                            // update socket state
-                            hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state),
-                                            TCP_STATE_FIN_WAIT2 );
-                        }
-                        if( socket_state == TCP_STATE_FIN_WAIT2 )
-                        {
-                            // TODO
-                        }
-                        else if( socket_state == TCP_STATE_CLOSING )
-                        {
-                            // update socket state
-                            hal_remote_s32( XPTR(socket_cxy , &socket_ptr->state),
-                                            TCP_STATE_TIME_WAIT );
-                        }
-                        else if( socket_state == TCP_STATE_CLOSING )
-                        {
-                            // TODO
-                        }
-                    }
-                    else                    // unacceptable ACK => discard segment
-                    {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s / ACK %x not in [%x,%x] => discard\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state),
-seg_ack_num, socket_tx_una, socket_tx_nxt );
-#endif
-                        break;
-                    }
-                }
-    
-                else if( socket_state == TCP_STATE_LAST_ACK )
-                {
-                    // TODO
-                }
-
-                else if( socket_state == TCP_STATE_TIME_WAIT )
-                {
-                    // TODO
-                }
-
-                // [6] handle URG flag  TODO ... someday
-
-                // [7] handle received data : update socket state,
-                // move data to rx_buf, register ACK request to R2T queue,
-                // unblock the RX client thread in case of pending RX_RECV command
-                if((socket_state == TCP_STATE_ESTAB)     ||
-                   (socket_state == TCP_STATE_FIN_WAIT1) ||
-                   (socket_state == TCP_STATE_FIN_WAIT2) )
-                {
-                    // register new bytes if requested 
-                    if( seg_data_new )
-                    {
-                        // get number of bytes already stored in rx_buf
-                        uint32_t status = remote_buf_status( socket_rx_buf_xp );
-
-                        // compute space in rx_buf and actual number of acceptable bytes
-                        // when (space < seg_data_new) the last new bytes are discarded
-                        uint32_t space = (1 << CONFIG_SOCK_RX_BUF_ORDER) - status;
-                        uint32_t rcv_bytes = (space < seg_data_new) ? space : seg_data_new;
-
-                        // move new bytes from k_buf to rx_buf
-                        remote_buf_put_from_kernel( socket_rx_buf_xp, 
-                                                    k_buf + seg_hlen + seg_data_dup,
-                                                    rcv_bytes );
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : move %d bytes to rx_buf\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state), rcv_bytes );
- #endif
-                        // update socket.rx_nxt and socket_rx_wnd fields
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->rx_nxt ),
-                                        socket_rx_nxt + rcv_bytes );
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->rx_wnd ),
-                                        socket_rx_wnd - rcv_bytes ); 
-
-                        // unblock RX client if required
-                        if( (socket_rx_valid == true) && (socket_rx_cmd == CMD_RX_RECV) )
-                        {
-                            // reset rx_valid
-                            hal_remote_s32( XPTR(socket_cxy,&socket_ptr->rx_valid), false );
-
-                            // report success to RX client thread
-                            dev_nic_unblock_rx_client( socket_xp , CMD_STS_SUCCESS );
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : last data => unblock RX client thread\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        }
-                    }
-
-                    // make an ACK request to remote 
-                    socket_put_r2t_request( socket_r2tq_xp,
-                                            TCP_FLAG_ACK,
-                                            chdev->channel );
-                }  // end payload handling
-
-                // [8] handle FIN flag depending on socket state
-                if( (socket_state == TCP_STATE_SYN_RCVD) ||
-                    (socket_state == TCP_STATE_ESTAB )   )
-                {
-                    if( seg_fin_set )      
-                    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : FIN-ACK => goes CLOSE_WAIT\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        // update socket.rx_nxt when FIN received
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->rx_nxt ),
-                                        socket_rx_nxt + 1 ); 
-
-                        // update socket state
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                        TCP_STATE_CLOSE_WAIT );
-
-                        // send ACK to remote TCP
-                        socket_put_r2t_request( socket_r2tq_xp,
-                                                TCP_FLAG_ACK,
-                                                chdev->channel );
-
-                        // check pending RX_RECV command
-                        if( (socket_rx_valid == true) && (socket_rx_cmd == CMD_RX_RECV) )
-                        {
-                            // reset rx_valid
-                            hal_remote_s32( XPTR(socket_cxy,&socket_ptr->rx_valid), false );
-
-                            // report FIN to RX client thread
-                            dev_nic_unblock_rx_client( socket_xp , CMD_STS_EOF );
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : unblock RX client waiting on RECV\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        } 
-                    }
-                }
-                else if( socket_state == TCP_STATE_FIN_WAIT1 )
-                {
-                    if( seg_fin_set ) 
-                    { 
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : FIN-ACK => goes CLOSING\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        // update socket.rx_nxt 
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->rx_nxt ),
-                                        socket_rx_nxt + 1 ); 
-
-                        // update socket state
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                        TCP_STATE_CLOSING );
-
-                        // send ACK request to remote
-                        socket_put_r2t_request( socket_r2tq_xp,
-                                                TCP_FLAG_ACK,
-                                                chdev->channel );
-                    }
-                    else              // received ACK only 
-                    {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : only ACK => goes FIN_WAIT2\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        // update socket state
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                        TCP_STATE_FIN_WAIT2 );
-                    }
-                }
-                else if( socket_state == TCP_STATE_FIN_WAIT2 )
-                {
-                    if( seg_fin_set )  // received ACK & FIN
-                    { 
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] socket[%x,%d] %s : FIN-ACK => goes CLOSED / unblock client\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-                        // update socket.rx_nxt when FIN received
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->rx_nxt ),
-                                        socket_rx_nxt + 1 ); 
-
-                        // update socket.state 
-                        hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                        TCP_STATE_CLOSED ); 
-
-                        // make an ACK request to R2T queue
-                        socket_put_r2t_request( socket_r2tq_xp,
-                                                TCP_FLAG_ACK,
-                                                chdev->channel );
-                
-                        // report success to TX client thread
-                        dev_nic_unblock_tx_client( socket_xp , CMD_STS_SUCCESS );
-                    }
-                }
-                else if( socket_state == TCP_STATE_CLOSING )   // received ACK
-                {
-                    // update socket.state
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                    TCP_STATE_CLOSED );  
-
-                    // report success to TX client thread
-                    dev_nic_unblock_tx_client( socket_xp , CMD_STS_SUCCESS );
-
-                }
-                else if( socket_state == TCP_STATE_CLOSE_WAIT )
-                {
-                    // do nothing 
-                }
-                else if( socket_state == TCP_STATE_LAST_ACK )
-                {
-                    // update socket.state when ACK received
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                    TCP_STATE_CLOSED );
-
-                    // unblock TX client thead for success
-                    dev_nic_unblock_tx_client( socket_xp , CMD_STS_SUCCESS );
-                }
-            }  // end case connected states
-        }  // end switch socket state
-
-        // release the lock protecting socket state
-        remote_queuelock_release( socket_lock_xp );
-
-        return;
-
-    }  // end if attached socket
-
-    // 4. scan the list of listening sockets
-    listening_match = false;
- 
-    // get pointers on NIC_RX[0] chdev
-    xptr_t    rx0_chdev_xp  = chdev_dir.nic_rx[0];
-    chdev_t * rx0_chdev_ptr = GET_PTR( rx0_chdev_xp );
-    cxy_t     rx0_chdev_cxy = GET_CXY( rx0_chdev_xp );
-   
-    // build extended pointers on list of listening sockets
-    xptr_t    rx0_root_xp = XPTR( rx0_chdev_cxy , &rx0_chdev_ptr->ext.nic.root );
-    xptr_t    rx0_lock_xp = XPTR( rx0_chdev_cxy , &rx0_chdev_ptr->ext.nic.lock );
-
-    // take the lock protecting the list of listening sockets
-    remote_busylock_acquire( rx0_lock_xp );
-
-    // scan the xlist of listening socket
-    XLIST_FOREACH( rx0_root_xp , iter_xp )
-    {
-        // get socket cluster and local pointer
-        socket_xp  = XLIST_ELEMENT( iter_xp , socket_t , rx_list );
-        socket_ptr = GET_PTR( socket_xp );
-        socket_cxy = GET_CXY( socket_xp );
-
-        // get relevant socket type and state
-        socket_type     = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->type ));
-        socket_state    = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->state ));
-                
-// check socket type and state
-assert( __FUNCTION__, (socket_type  == SOCK_STREAM ) , "illegal socket type" );
-assert( __FUNCTION__, (socket_state == TCP_STATE_LISTEN ) , "illegal socket state" );
-
-        // get relevant socket infos for matching
-        socket_local_addr   = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_addr )); 
-        socket_local_port   = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_port )); 
-                
-        // compute matching condition for a listening socket
-        listening_match = (socket_local_addr  == seg_local_addr) && 
-                          (socket_local_port  == seg_local_port);
-
-        // exit loop if matching
-        if( listening_match ) 
-        {
-
-#if DEBUG_DEV_NIC_RX || DEBUG_DEV_NIC_ERROR
-fdid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ) );
-pid   = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ) );
-#endif
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] matching listening socket[%d,%d] / state %s\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-            break;
-        }
-    }   // end loop on listening sockets
-
-    // release the lock protecting the list of listening sockets
-    remote_busylock_release( rx0_lock_xp );
-
-    // 5. handle TCP segment for a matching listening socket
-    if( listening_match )
-    {
-        // The actions depend on the received segment flags
-        // - discard segment for RST or ACK, 
-        // - for SYN, register the connect request in listening socket CRQ queue,
-        //   and  unblock the client thread in case of pending RX_ACCEPT command. 
- 
-        // [1] check RST
-        if( seg_rst_set )       // discard segment
-        {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s / received RST => discard segment\n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-            return;
-        }
-
-        // [2] check ACK
-        if( seg_ack_set )    // send RST to remote
-        {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : socket[%x,%d] %s received ACK => send RST & discard \n",
-__FUNCTION__, pid, fdid, socket_state_str(socket_state) );
-#endif
-            // make an RST request to R2T queue
-            socket_put_r2t_request( socket_r2tq_xp,
-                                    TCP_FLAG_RST,
-                                    chdev->channel );
-            return;
-        }
-
-        // [3] handle security & precedence TODO ... someday
-
-        // handle SYN == CONNECT request
-        if( seg_syn_set )
-        {
-            // build extended pointers on various listening socket fields
-            socket_lock_xp = XPTR( socket_cxy , &socket_ptr->lock );
-            socket_crqq_xp = XPTR( socket_cxy , &socket_ptr->crqq );
-            socket_r2tq_xp = XPTR( socket_cxy , &socket_ptr->r2tq );
-
-            // take the lock protecting the matching socket
-            remote_queuelock_acquire( socket_lock_xp );
-
-            // try to register request into CRQ queue
-            error = socket_put_crq_request( socket_crqq_xp,
-                                            seg_remote_addr, 
-                                            seg_remote_port,
-                                            seg_seq_num,
-                                            seg_window );
-            if ( error )   // CRQ full
-            {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : listening socket[%x,%d] %s receive SYN but CRQ full => send RST\n",
-__FUNCTION__, pid, fdid );
-#endif
-                // make an RST request to R2T queue 
-                socket_put_r2t_request( socket_r2tq_xp,
-                                        TCP_FLAG_RST,
-                                        chdev->channel );
-            }
-            else          // register request in listening socket CRQ
-            {
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-if( cycle > DEBUG_DEV_NIC_RX )
-printk("\n[%s] listening socket[%x,%d] register request in CRQ\n",
-__FUNCTION__, pid, fdid );
-#endif
-                bool_t   rx_valid = hal_remote_l32( XPTR(socket_cxy , &socket_ptr->rx_valid));
-                uint32_t rx_cmd   = hal_remote_l32( XPTR(socket_cxy , &socket_ptr->rx_cmd));
-                
-                // check pending ACCEPT command
-                if( rx_valid && (rx_cmd == CMD_RX_ACCEPT) )
-                {
-                    // reset rx_valid
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->rx_valid ), false );
-                     
-                    // report success to RX client thread, that will
-                    // create a new socket and request a SYN-ACK to TX server thread
-                    dev_nic_unblock_rx_client( socket_xp , CMD_STS_SUCCESS );
-
-#if DEBUG_DEV_NIC_RX
-if( DEBUG_DEV_NIC_RX < cycle )
-if( cycle > DEBUG_DEV_NIC_RX )
-printk("\n[%s] listening socket[%x,%d] unblock RX client thread\n", 
-__FUNCTION__, fdid );
-#endif
-                }
-            }   // end register request in CRQ
-
-            // release the lock protecting the matching socket
-            remote_queuelock_release( socket_lock_xp );
-
-        }   // end if SYN
-
-        return;
-
-    }  // end if listening_match
-
-    // 6. no attached socket found and no listening socket found => discard segment
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : thread[%x,%d] / unexpected TCP segment => discard / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, chdev->channel, cycle ); 
-#endif
-
-}  // end dev_nic_rx_handle_tcp_segment()
-
-
-/////////////////////////////////////////
-void dev_nic_rx_server( chdev_t * chdev )
-{
-    uint8_t       k_buf[2048];          // kernel buffer for one ETH/IP/UDP packet
-    uint32_t      pkt_src_addr;         // packet source IP address 
-    uint32_t      pkt_dst_addr;         // packet destination IP address
-    uint32_t      trsp_protocol;        // transport protocol (TCP / UDP)
-    uint32_t      eth_length;           // size of Ethernet packet (bytes)
-    uint32_t      ip_length;            // size of IP packet in bytes
-    error_t       error;
-
-    thread_t    * this = CURRENT_THREAD;
-    
-// check thread can yield
-thread_assert_can_yield( this , __FUNCTION__ );
-
-// check chdev direction and type
-assert( __FUNCTION__, (chdev->func == DEV_FUNC_NIC) && (chdev->is_rx == true) ,
-"illegal chdev type or direction" );
-
-#if DEBUG_DEV_NIC_RX || DEBUG_DEV_NIC_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_DEV_NIC_RX
-if( cycle > DEBUG_DEV_NIC_RX )
-printk("\n[%s] thread[%x,%x] starts / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-    // avoid warning
-    ip_length = 0;
-    error     = 0;
-
-    // get extended pointers on server tread and chdev 
-    xptr_t     thread_xp = XPTR( local_cxy , this );
-    xptr_t     chdev_xp  = XPTR( local_cxy , chdev );
-
-    while( 1 )
-    {
-        // call NIC driver to move one packet from NIC_RX queue to kernel buffer
-        this->nic_cmd.dev_xp  = chdev_xp;
-        this->nic_cmd.type    = NIC_CMD_READ;
-        this->nic_cmd.buffer  = k_buf;
-        chdev->cmd( XPTR( local_cxy , this ) );
-
-        // get packet length   
-        eth_length = this->nic_cmd.status;
-
-        // check success
-        if( eth_length == 0 )  // queue empty => block and deschedule 
-        {
-
-#if DEBUG_DEV_NIC_RX
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] NIC_RX_QUEUE empty => blocks on <ISR> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            // enable NIC_RX IRQ 
-            dev_pic_enable_irq( this->core->lid , chdev_xp );
-
-            // block and deschedule
-            thread_block( thread_xp , THREAD_BLOCKED_ISR );
-            sched_yield("client blocked on NIC_TX queue full");
-
-            // disable NIC-RX IRQ 
-            dev_pic_disable_irq( this->core->lid , chdev_xp );
-
-#if DEBUG_DEV_NIC_RX
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] resumes / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            // check possible error reported by NIC ISR
-            if( this->nic_cmd.error )  
-            {
-                printk("\n[PANIC] in %s : %s DMA engine cannot access RX_QUEUE / cycle %d\n",
-                __FUNCTION__, chdev->name , (uint32_t)hal_get_cycles() );
-            }
-        }
-        else                 // success => handle packet
-        {
-
-#if DEBUG_DEV_NIC_RX
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_RX < cycle )
-#endif
-
-            // analyse the ETH header
-            error = dev_nic_rx_check_eth( k_buf,
-                                          &ip_length );
-
-            // discard packet if error reported by Ethernet layer
-            if( error )
-            {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[WARNING] in %s : thread[%x,%x] discard ETH packet / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-                continue; 
-            }
-
-#if (DEBUG_DEV_NIC_RX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[%s] thread[%x,%x] successfully checked ETH packet / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            // analyse the IP header
-            error = dev_nic_rx_check_ip( k_buf + ETH_HEAD_LEN,
-                                         ip_length, 
-                                         &pkt_src_addr, 
-                                         &pkt_dst_addr,
-                                         &trsp_protocol );
-
-            // discard packet if error reported by IP layer
-            if( error ) 
-            {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[WARNING] in %s : thread[%x,%x] discard IP packet / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-                continue; 
-            }
-
-#if (DEBUG_DEV_NIC_RX & 1 )
-cycle = (uint32_t)hal_get_cycles();
-if( (DEBUG_DEV_NIC_RX < cycle) && (trsp_protocol == PROTOCOL_UDP) )
-printk("\n[%s] thread[%x,%x] successfully checked UDP packet / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-if( (DEBUG_DEV_NIC_RX < cycle) && (trsp_protocol == PROTOCOL_TCP) )
-printk("\n[%s] thread[%x,%x] successfully checked TCP segment / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-            // call relevant transport protocol
-            if( trsp_protocol == PROTOCOL_UDP )   
-            { 
-                dev_nic_rx_handle_udp_packet( chdev,
-                                              k_buf + ETH_HEAD_LEN + IP_HEAD_LEN,
-                                              ip_length - IP_HEAD_LEN,
-                                              pkt_src_addr,
-                                              pkt_dst_addr );
-            }
-            else if ( trsp_protocol == PROTOCOL_TCP)
-            {
-                dev_nic_rx_handle_tcp_segment( chdev,
-                                               k_buf + ETH_HEAD_LEN + IP_HEAD_LEN,
-                                               ip_length - IP_HEAD_LEN,
-                                               pkt_src_addr,
-                                               pkt_dst_addr );
-            }
-            else // discard packet if unsupported transport protocol
-            {
- 
-#if DEBUG_DEV_NIC_ERROR
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_RX < cycle )
-printk("\n[WARNING] in %s : thread[%x,%x] unsupported transport protocol %d / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, trsp_protocol, cycle );
-#endif
-                continue;
-            }
-        }   // end else success
-    }   // end of while loop
-}   // end dev_nic_rx_server()
-
-
-
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//              Functions used by the NIC_TX server thread
-///////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the dev_nic_tx_send_packet() function.
-// It moves one ETH/IP/UDP packet from the kernel buffer identified by the <buffer> and 
-// <length> arguments to the NIC_TX_QUEUE identified the <chdev> argument.
-// It blocks and deschedules on the BLOCKED_ISR condition if the queue is full.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ chdev   : [in] local pointer on NIC_TX chdev.
-// @ k_buf   : [in] pointer on a local kernel buffer (2K bytes).
-// @ length  : [in] actual Ethernet packet length in bytes.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_tx_move_packet( chdev_t  * chdev,
-                                    uint8_t  * k_buf,
-                                    uint32_t   length )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // get extended pointers on server tread and chdev 
-    xptr_t     thread_xp = XPTR( local_cxy , this );
-    xptr_t     chdev_xp  = XPTR( local_cxy , chdev );
-
-// check thread can yield
-thread_assert_can_yield( this , __FUNCTION__ );
-
-#if (DEBUG_DEV_NIC_TX & 1)
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_TX < cycle )
-printk("\n[%s] thread[%x,%x] enter / buf %x / length %d / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, k_buf, length, cycle );
-#endif
-
-    // initialize WRITE command in server thread descriptor
-    this->nic_cmd.dev_xp = chdev_xp;
-    this->nic_cmd.type   = NIC_CMD_WRITE;
-    this->nic_cmd.buffer = k_buf;
-    this->nic_cmd.length = length;
-    this->nic_cmd.error  = 0;
-
-    while( 1 )
-    {
-        // call driver to move TX packet
-        chdev->cmd( thread_xp );
-
-        // exit while if success
-        if( this->nic_cmd.status == length )    // exit while & return if success
-        {
-
-#if (DEBUG_DEV_NIC_TX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_TX < cycle )
-printk("\n[%s] thread[%x,%x] exit SUCCESS / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-           break; 
-        }
-        else                                    // block and deschedule if queue full
-        {
-
-#if (DEBUG_DEV_NIC_TX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_TX < cycle )
-printk("\n[%s] thread[%x,%x] NIC_TX_QUEUE full => blocks on ISR / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            // enable NIC_TX IRQ 
-            dev_pic_enable_irq( this->core->lid , chdev_xp );
-
-            // TX server thread blocks and deschedules
-            thread_block( thread_xp , THREAD_BLOCKED_ISR );
-            sched_yield("client blocked on NIC_TX queue full");
-
-            // disable NIC-TX IRQ 
-            dev_pic_disable_irq( this->core->lid , chdev_xp );
-
-#if (DEBUG_DEV_NIC_TX & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_NIC_TX < cycle )
-printk("\n[%s] thread[%x,%x] resumes / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        }
-    }
-}  // end dev_nic_tx_move_packet()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the dev_nic_tx_server() function to build an UDP
-// header in the kernel buffer defined by the <k_buf> arguement,  as specified by the 
-// <socket_xp> argument. The <length> argument defines the number of bytes in payload.
-// It set the "src_port", "dst_port", "total_length" and "checksum" fields in UDP header.
-// The payload must be previouly loaded in the kernel buffer.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ k_buf      : [in]  pointer on first byte of UDP header in kernel buffer.
-// @ socket_xp  : [in]  extended pointer on socket.
-// @ length     : [in]  number of bytes in payload.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_tx_build_udp_header( uint8_t  * k_buf,
-                                         xptr_t     socket_xp,
-                                         uint32_t   length )
-{
-    uint16_t   checksum;        // checksum value
-    uint32_t   total_length;    // total UDP packet length
-    uint32_t   local_addr;      // local IP address
-    uint32_t   remote_addr;     // remote IP address
-    uint32_t   local_port;      // local port
-    uint32_t   remote_port;     // remote port
-
-    // get socket cluster an local pointer
-    socket_t * socket_ptr = GET_PTR( socket_xp );
-    cxy_t      socket_cxy = GET_CXY( socket_xp );
-
-    // get relevant infos from socket
-    local_addr  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_addr )); 
-    remote_addr = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->remote_addr )); 
-    local_port  = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->local_port )); 
-    remote_port = hal_remote_l32(XPTR(socket_cxy , &socket_ptr->remote_port )); 
-
-    // compute UDP packet total length
-    total_length = length + UDP_HEAD_LEN;
-
-    // set src_port and dst_port in header
-    k_buf[0] = local_port >> 8; 
-    k_buf[1] = local_port; 
-    k_buf[2] = remote_port >> 8; 
-    k_buf[3] = remote_port; 
-
-    // reset checksum
-    k_buf[6] = 0;
-    k_buf[7] = 0;
-
-    // set packet length in header
-    k_buf[4] = total_length >> 8;
-    k_buf[5] = total_length;
-    
-    // compute UDP packet checksum
-    checksum = dev_nic_tcp_udp_checksum( k_buf,
-                                         total_length,
-                                         local_addr,
-                                         remote_addr,
-                                         false );       // is_not_tcp
-    // set checksum
-    k_buf[6] = checksum >> 8;
-    k_buf[7] = checksum;
-
-}  // end dev_nic_tx_build_udp_header()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the dev_nic_tx_server() function. 
-// It builds a TCP header in the kernel buffer defined by the <k_buf> argument.
-// The payload must have been previouly registered in this buffer (for checksum).
-// The "local_addr", "local_port", "remote_addr", "remote_port", seq_num", "ack_num",
-// and "window" fields are obtained from the <socket_xp> argument.
-// The <length> argument defines the number of bytes in payload, and the <flags> argument
-// defines the flags to be set in TCP header.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ k_buf      : [in]  pointer on first byte of TCP header in kernel buffer.
-// @ socket_xp  : [in]  extended pointer on socket.
-// @ length     : [in]  number of bytes in payload.
-// @ flags      : [in]  flags to be set in TCP header.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_tx_build_tcp_header( uint8_t  * k_buf,
-                                         xptr_t     socket_xp,
-                                         uint32_t   length,
-                                         uint8_t    flags )
-{
-    uint16_t   checksum;        // global segment checksum
-    uint32_t   total_length;    // total UDP packet length
-    uint32_t   src_addr;        // local IP address
-    uint32_t   dst_addr;        // remote IP address
-    uint16_t   src_port;        // local port
-    uint16_t   dst_port;        // remote port
-    uint32_t   seq_num;         // first byte of segment in TX stream
-    uint32_t   ack_num;         // next expected byte in RX stream
-    uint32_t   window;          // window of accepted segments in RX stream
-
-    // get socket cluster an local pointer
-    socket_t * sock_ptr = GET_PTR( socket_xp );
-    cxy_t      sock_cxy = GET_CXY( socket_xp );
-
-    // get relevant infos from socket
-    src_addr = hal_remote_l32(XPTR( sock_cxy , &sock_ptr->local_addr )); 
-    dst_addr = hal_remote_l32(XPTR( sock_cxy , &sock_ptr->remote_addr )); 
-    src_port = hal_remote_l32(XPTR( sock_cxy , &sock_ptr->local_port )); 
-    dst_port = hal_remote_l32(XPTR( sock_cxy , &sock_ptr->remote_port )); 
-    seq_num  = hal_remote_l32(XPTR( sock_cxy , &sock_ptr->tx_nxt ));
-    ack_num  = hal_remote_l32(XPTR( sock_cxy , &sock_ptr->rx_nxt ));
-    window   = hal_remote_l32(XPTR( sock_cxy , &sock_ptr->rx_wnd ));
-
-    // compute TCP segment total length
-    total_length = length + TCP_HEAD_LEN;
-
-    // set "src_port" and "dst_port" 
-    k_buf[0]  = src_port >> 8; 
-    k_buf[1]  = src_port; 
-    k_buf[2]  = dst_port >> 8; 
-    k_buf[3]  = dst_port; 
-
-    // set "seq_num"  
-    k_buf[4]  = seq_num >> 24;
-    k_buf[5]  = seq_num >> 16;
-    k_buf[6]  = seq_num >>  8;
-    k_buf[7]  = seq_num;
-
-    // set "ack_num"  
-    k_buf[8]  = ack_num >> 24;
-    k_buf[9]  = ack_num >> 16;
-    k_buf[10] = ack_num >>  8;
-    k_buf[11] = ack_num;
-
-    // set "hlen"
-    k_buf[12] = 5;
-
-    // set "flags"
-    k_buf[13] = flags & 0x3F;
-
-    // set "window"
-    k_buf[14] = window >> 8;
-    k_buf[15] = window;
-
-    // reset "checksum"
-    k_buf[16] = 0;
-    k_buf[17] = 0;
-    
-    // set "urgent_ptr"
-    k_buf[18] = 0;
-    k_buf[19] = 0;
-  
-    // compute TCP segment checksum
-    checksum = dev_nic_tcp_udp_checksum( k_buf,
-                                         total_length,
-                                         src_addr,
-                                         dst_addr,
-                                         true );       // is_tcp
-    // set "checksum"
-    k_buf[16] = checksum >> 8;
-    k_buf[17] = checksum;
-
-}  // end dev_nic_tx_build_tcp_header()
-
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the dev_nic_tx_server() function.
-// It builds the IP header in the 20 first bytes of <buffer>.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ buffer     : pointer on first byte of IP header in kernel buffer
-// @ src_addr   : source IP address.
-// @ dst_addr   : destination IP address.
-// @ length     : number of bytes in IP packet payload.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_tx_build_ip_header( uint8_t * buffer,
-                                        uint32_t  src_addr,
-                                        uint32_t  dst_addr,
-                                        uint8_t   protocol,
-                                        uint16_t  length )
-{
-    uint16_t   hcs;
-
-    uint16_t   total = length + IP_HEAD_LEN;
-
-    buffer[0]  = 0x45;         // IPV4 / IHL = 20 bytes  
-    buffer[1]  = 0;            // DSCP / ECN
-    buffer[2]  = total >> 8;  
-    buffer[3]  = total;  
-
-    buffer[4]  = 0x40;         // Don't Fragment
-    buffer[5]  = 0; 
-    buffer[6]  = 0;
-    buffer[7]  = 0; 
-
-    buffer[8]  = 0xFF;         // TTL
-    buffer[9]  = protocol;     // transport protocol 
-    
-    buffer[12] = src_addr >> 24; 
-    buffer[13] = src_addr >> 16; 
-    buffer[14] = src_addr >> 8; 
-    buffer[15] = src_addr; 
-
-    buffer[16] = dst_addr >> 24; 
-    buffer[17] = dst_addr >> 16; 
-    buffer[18] = dst_addr >> 8;
-    buffer[19] = dst_addr; 
-
-    // compute IP header checksum
-    hcs = dev_nic_ip_checksum( buffer ); 
-
-    // set checksum 
-    buffer[10] = hcs >> 8;
-    buffer[11] = hcs; 
-
-}  // end dev_nic_tx_build_ip_header
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the dev_nic_tx_server() function.
-// It builds the Ethernet header in the 14 first bytes of <buffer>.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ buffer     : pointer on first byte of Ethernet header in kernel buffer
-// @ src_mac_54 : two MSB bytes in source MAC address.
-// @ src_mac_32 : two MED bytes in source MAC address.
-// @ src_mac_10 : two LSB bytes in source MAC address.
-// @ dst_mac_54 : two MSB bytes in destination MAC address.
-// @ dst_mac_32 : two MED bytes in destination MAC address.
-// @ dst_mac_10 : two LSB bytes in destination MAC address.
-// @ length     : number of bytes in Ethernet frame payload.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dev_nic_tx_build_eth_header( uint8_t * buffer,
-                                         uint8_t   src_mac_5,
-                                         uint8_t   src_mac_4,
-                                         uint8_t   src_mac_3,
-                                         uint8_t   src_mac_2,
-                                         uint8_t   src_mac_1,
-                                         uint8_t   src_mac_0,
-                                         uint8_t   dst_mac_5,
-                                         uint8_t   dst_mac_4,
-                                         uint8_t   dst_mac_3,
-                                         uint8_t   dst_mac_2,
-                                         uint8_t   dst_mac_1,
-                                         uint8_t   dst_mac_0,
-                                         uint32_t  length )
-{
-    buffer[0]  = dst_mac_5;
-    buffer[1]  = dst_mac_4;
-    buffer[2]  = dst_mac_3;
-    buffer[3]  = dst_mac_2;
-    buffer[4]  = dst_mac_1;
-    buffer[5]  = dst_mac_0;
-
-    buffer[6]  = src_mac_5;
-    buffer[7]  = src_mac_4;
-    buffer[8]  = src_mac_3;
-    buffer[9]  = src_mac_2;
-    buffer[10] = src_mac_1;
-    buffer[11] = src_mac_0;
-
-    buffer[12] = length >> 8;
-    buffer[13] = length;
-
-}  // end dev_nic_tx_build_eth_header()
-
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function implement the TCP protocol as specified by the RFC.
-// It is called by the dev_nic_tx_server() function to handle one TX command, 
-// or one R2T request, for the socket identified by the <socket_xp> argument. 
-// It builds an ETH/IP/UDP packet or ETH/IP/TCP segment, in the 2 Kbytes kernel buffer,
-// defined by the <k_buf> argument from informations found in socket descriptor.
-// It returns a command status code (defined in the ksocket.h file), and returns in the
-// <total_length> argument the actual packet length.
-// It updates the "socket.state", "socket.tx_nxt", "socket.r2tq", "socket.crqq",
-// "socket.todo" fields as required by the command type, but it does NOT reset 
-// the "socket.tx_valid" field and does NOT unblock the client thread.
-// It does NOt take the socket lock, that is taken by the dev_nic_server().
-///////////////////////////////////////////////////////////////////////////////////////////
-// To build a packet, it makes the following actions:
-// 1) it get the command arguments from socket descriptor.
-// 2) it build an UDP packet or a TCP segment, and update socket state. 
-// 3) it build the IP header.
-// 4) it build the ETH header.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ socket_xp    : [in]  extended pointer on client socket.  
-// @ k_buf        : [in]  local pointer on kernel buffer (2 Kbytes).
-// @ total_length : [out] total number of bytes written in k_buf.
-// @ return command status.
-///////////////////////////////////////////////////////////////////////////////////////////
-static socket_cmd_sts_t dev_nic_tx_build_packet( xptr_t     socket_xp,
-                                                 uint8_t  * k_buf,
-                                                 uint32_t * total_length )
-{
-    socket_t  * socket_ptr;
-    cxy_t       socket_cxy;
-    xptr_t      client_xp;       // extended pointer on client thread  
-    bool_t      cmd_valid;       // valid user command
-    bool_t      r2t_valid;       // valid R2T queue request
-    uint32_t    cmd_type;        // NIC command type
-    uint8_t   * tx_buf;          // local pointer on socket buffer for payload
-    uint32_t    len;             // tx_buf length (bytes)
-    uint32_t    todo;            // number of bytes not yet sent
-    uint32_t    socket_type;     // socket type (UDP/TCP)
-    uint32_t    socket_state;    // socket state        
-    xptr_t      socket_r2tq_xp;  // extended pointer on R2T queue
-    uint32_t    src_ip_addr;     // source IP address
-    uint32_t    dst_ip_addr;     // destination IP address
-    uint32_t    tx_nxt;          // next sequence number in TX stream
-    uint32_t    nbytes;          // number of bytes in UDP/TCP packet payload
-    uint8_t   * k_trsp_base;     // pointer on UDP/TCP packet in kernel buffer
-    uint32_t    trsp_length;     // length of TCP/UDP packet
-    uint8_t     trsp_protocol;   // transport protocol type (UDP/TCP)
-    uint8_t     r2t_flags;       // flags defined by one R2T queue request
- 
-    // get socket cluster and local pointer
-    socket_cxy = GET_CXY( socket_xp );
-    socket_ptr = GET_PTR( socket_xp );
-
-#if DEBUG_DEV_NIC_TX  || DEBUG_DEV_NIC_ERROR
-uint32_t   cycle       = (uint32_t)hal_get_cycles();
-uint32_t   socket_fdid = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ));
-uint32_t   socket_pid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-#endif
-
-    // build extended pointer on socket r2t queue 
-    socket_r2tq_xp = XPTR( socket_cxy , &socket_ptr->r2tq );
-
-    // get cmd_valid & t2t_valid from socket descriptor
-    cmd_valid = (bool_t)hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_valid ));
-    r2t_valid = (bool_t)remote_buf_status( XPTR( socket_cxy , &socket_ptr->r2tq ));
-
-#if DEBUG_DEV_NIC_TX 
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] enter for socket[%x,%d] : cmd_val %d / r2t_val %d / cycle %d\n",
-__FUNCTION__, socket_pid, socket_fdid, cmd_valid, r2t_valid, cycle );
-#endif
-
-    // 1. get relevant socket infos
-    socket_type  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->type ));
-    socket_state = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->state ));
-    src_ip_addr  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->local_addr ));
-    dst_ip_addr  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->remote_addr ));
-
-    // compute UDP/TCP packet base in local kernel buffer
-    k_trsp_base = k_buf + ETH_HEAD_LEN + IP_HEAD_LEN;
-
-    // default value
-    trsp_length = 0;
-
-    if( cmd_valid )  // handle TX command depending on type 
-    {
-        // get command arguments from socket
-        cmd_type  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_cmd ));
-        tx_buf    = hal_remote_lpt( XPTR( socket_cxy , &socket_ptr->tx_buf ));
-        len       = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_len ));
-        todo      = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_todo ));
-        client_xp = hal_remote_l64( XPTR( socket_cxy , &socket_ptr->tx_client ));
-        
-#if DEBUG_DEV_NIC_TX 
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] socket[%x,%d] / %s / command %s \n",
-__FUNCTION__, socket_pid, socket_fdid, 
-socket_cmd_type_str(cmd_type),socket_state_str(socket_state) );
-#endif
-
-        //////////////////////////////////////////////////////////
-        // 2. UDP : build UDP packet and update UDP socket state
-        if( socket_type == SOCK_DGRAM )        
-        {
-            trsp_protocol = PROTOCOL_UDP;
-
-            if( socket_state != UDP_STATE_ESTAB )
-            {
-                return  CMD_STS_BADSTATE;
-            }
-            else if( cmd_type == CMD_TX_SEND ) 
-            {
-                // compute payload length
-                nbytes = ( CONFIG_SOCK_PAYLOAD_MAX < todo ) ? CONFIG_SOCK_PAYLOAD_MAX : todo;
-
-                // move payload from remote socket tx_buf to local kernel buffer
-                hal_remote_memcpy( XPTR( local_cxy  , k_trsp_base + UDP_HEAD_LEN ),
-                                   XPTR( socket_cxy , tx_buf + (len - todo) ),
-                                   nbytes );
-
-                // build UDP header 
-                dev_nic_tx_build_udp_header( k_trsp_base,
-                                             socket_xp,
-                                             nbytes );
-
-                // update "tx_todo" in socket descriptor 
-                hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_todo), todo - nbytes );
-
-                // set UDP packet length
-                trsp_length = UDP_HEAD_LEN + nbytes;
-
-#if DEBUG_DEV_NIC_TX 
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] socket[%x,%d] UDP packet build / %d bytes\n",
-__FUNCTION__, socket_pid, socket_fdid, nbytes );
-#endif
-            }
-            else // CONNECT, ACCEPT, or CLOSE commands are illegal for UDP
-            {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : bad state %s for socket[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_state_str(socket_state), socket_pid, socket_fdid, cycle );
-#endif
-                return  CMD_STS_BADCMD;
-            }
-        }  // end UDP
-
-        ///////////////////////////////////////////////////////////
-        // 2. TCP : build TCP segment and update TCP socket state
-        else if( socket_type == SOCK_STREAM ) 
-        {
-            trsp_protocol = PROTOCOL_TCP;
-
-            // handle R2T request / initialize r2t_flags
-            if( r2t_valid )
-            {
-                // build extended pointers on r2t queue
-                socket_r2tq_xp = XPTR( socket_cxy , &socket_ptr->r2tq );
-        
-                // get one request from R2T queue, and update R2T queue
-                socket_get_r2t_request( socket_r2tq_xp , &r2t_flags );
-            }
-            else
-            {
-                r2t_flags = 0;
-            }
-
-            ////////////////////////////////
-            if( cmd_type == CMD_TX_CONNECT )  // always executed by a TCP client
-            {
-                if( (socket_state == TCP_STATE_BOUND) ||
-                    (socket_state == TCP_STATE_LISTEN) )  // send a SYN segment
-                {
-                    // initialises socket tx_nxt, and rx_wnd
-                    hal_remote_s32(XPTR(socket_cxy , &socket_ptr->tx_nxt), 
-                                   CONFIG_SOCK_ISS_CLIENT );
-                    hal_remote_s32(XPTR(socket_cxy , &socket_ptr->rx_wnd),
-                                   CONFIG_SOCK_MAX_WINDOW );
-
-                    // build TCP SYN segment
-                    dev_nic_tx_build_tcp_header( k_trsp_base,
-                                                 socket_xp,
-                                                 0,        // length
-                                                 TCP_FLAG_SYN );   
-                    // set TCP packet length
-                    trsp_length = TCP_HEAD_LEN;
-
-                    // update socket.state 
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                          TCP_STATE_SYN_SENT );
-
-                    // update socket.tx_nxt
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->tx_nxt ),
-                                          CONFIG_SOCK_ISS_CLIENT + 1 );
-#if DEBUG_DEV_NIC_TX 
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] socket[%x,%d] %s / CONNECT / TCP SYN build\n",
-__FUNCTION__, socket_pid, socket_fdid, socket_state_str(socket_state) );
-#endif
-                } 
-                else                      // report error for all other socket states
-                {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : bad state %s socket[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_state_str(socket_state), socket_pid, socket_fdid, cycle );
-#endif
-                    return CMD_STS_BADSTATE; 
-                }
-            }
-            ////////////////////////////////////
-            else if( cmd_type == CMD_TX_ACCEPT )   // always executed by a TCP server
-            {
-
-                if( socket_state == TCP_STATE_SYN_RCVD )  // send a SYN-ACK segment
-                {
-                    // initialize socket tx_nxt, and rx_wnd
-                    hal_remote_s32(XPTR(socket_cxy , &socket_ptr->tx_nxt),
-                                        CONFIG_SOCK_ISS_SERVER );
-                    hal_remote_s32(XPTR(socket_cxy , &socket_ptr->rx_wnd),
-                                        (1 << CONFIG_SOCK_RX_BUF_ORDER) );
-                
-                    // build TCP ACK-SYN segment
-                    dev_nic_tx_build_tcp_header( k_trsp_base,
-                                                 socket_xp,
-                                                 0,         //  length
-                                                 TCP_FLAG_SYN | TCP_FLAG_ACK );
-                    // set TCP packet length
-                    trsp_length = TCP_HEAD_LEN;
-
-                    // update socket.state 
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ),
-                                          TCP_STATE_SYN_RCVD );
-
-                    // update socket.tx_nxt
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->tx_nxt ),
-                                          CONFIG_SOCK_ISS_SERVER + 1 );
-#if DEBUG_DEV_NIC_TX 
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] socket[%x,%d] %s / ACCEPT / SYN-ACK build\n",
-__FUNCTION__, socket_pid, socket_fdid, socket_state_str(socket_state) );
-#endif
-                }
-                else                     // report error in all other socket states
-                {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : bad state %s for socket[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_state_str(socket_state), socket_pid, socket_fdid, cycle );
-#endif
-                    return CMD_STS_BADSTATE; 
-                }
-            }
-            ///////////////////////////////////
-            else if( cmd_type == CMD_TX_CLOSE )
-            {
-                if( (socket_state == TCP_STATE_SYN_RCVD  ) ||
-                    (socket_state == TCP_STATE_ESTAB     ) ||
-                    (socket_state == TCP_STATE_CLOSE_WAIT) )   // send a FIN-ACK segment
-                {
-                    // get  "tx_nxt" from socket descriptor
-                    tx_nxt = hal_remote_l32( XPTR(socket_cxy , &socket_ptr->tx_nxt ));
-
-                    // compute next state
-                    uint32_t state = (socket_state == TCP_STATE_CLOSE_WAIT) ?
-                                     TCP_STATE_LAST_ACK : TCP_STATE_FIN_WAIT1;
-
-                    // update socket state 
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->state ), state );
-
-                    // build TCP FIN segment
-                    dev_nic_tx_build_tcp_header( k_trsp_base,
-                                                 socket_xp,
-                                                 0,         // length
-                                                 TCP_FLAG_FIN | TCP_FLAG_ACK );   
-
-                    // update "tx_nxt" in socket descriptor
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_nxt), tx_nxt + 1 );
-
-                    // set TCP packet length
-                    trsp_length = TCP_HEAD_LEN;
-
-#if DEBUG_DEV_NIC_TX 
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] socket[%x,%d] %s / CLOSE / FIN-ACK build\n",
-__FUNCTION__, socket_pid, socket_fdid, socket_state_str(socket_state) );
-#endif
-                }
-                else                                 // all other states => signal error
-                {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : bad state %s for socket[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_state_str(socket_state),  socket_pid, socket_fdid, cycle );
-#endif
-                    return CMD_STS_BADSTATE; 
-                }
-            }
-            //////////////////////////////////
-            else if( cmd_type == CMD_TX_SEND )
-            {
-                if( (socket_state == TCP_STATE_ESTAB     ) ||
-                    (socket_state == TCP_STATE_CLOSE_WAIT) )
-                {
-                    // get  "tx_nxt" from socket descriptor
-                    tx_nxt = hal_remote_l32( XPTR(socket_cxy , &socket_ptr->tx_nxt ));
-
-                    // compute actual payload length
-                    nbytes = ( CONFIG_SOCK_PAYLOAD_MAX < todo ) ? 
-                             CONFIG_SOCK_PAYLOAD_MAX : todo;
-
-                    // move payload from remote tx_buf to local kernel buffer
-                    hal_remote_memcpy( XPTR( local_cxy  , k_trsp_base + TCP_HEAD_LEN ),
-                                       XPTR( socket_cxy , tx_buf + (len - todo) ),
-                                       nbytes );
-
-                    // build TCP header 
-                    dev_nic_tx_build_tcp_header( k_trsp_base,
-                                                 socket_xp,
-                                                 nbytes,                       // payload
-                                                 TCP_FLAG_ACK | r2t_flags );   // flags
-
-                    // update "tx_todo" in socket descriptor
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_todo), todo - nbytes );
-
-                    // update "tx_nxt" in socket descriptor
-                    hal_remote_s32( XPTR(socket_cxy , &socket_ptr->tx_nxt), tx_nxt + nbytes );
-
-                    // set TCP packet length
-                    trsp_length = TCP_HEAD_LEN + nbytes;
-
-#if DEBUG_DEV_NIC_TX 
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] socket[%x,%d] %s / SEND / %d bytes\n",
-__FUNCTION__, socket_pid, socket_fdid, socket_state_str(socket_state), nbytes );
-#endif
-                }
-                else  // all other socket states
-                {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : bad state %s for socket[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_state_str(socket_state), socket_pid, socket_fdid, cycle );
-#endif
-                    return CMD_STS_BADSTATE; 
-                }
-            }
-            ///////////////////////////////////
-            else  // undefined TX command type
-            {
-
-#if DEBUG_DEV_NIC_ERROR
-printk("\n[ERROR] in %s : undefined command type for socket[%x,%x] %s / cycle %d\n",
-__FUNCTION__, socket_pid, socket_fdid, socket_state_str(socket_state), cycle );
-#endif
-                return CMD_STS_BADCMD; 
-            }
-        }  // end TCP 
-    }
-    else         // no valid TX command => handle R2T request only
-    {
-
-assert( __FUNCTION__ , (socket_type == SOCK_STREAM) , "don't use R2T queue for UDP" );
- 
-        // get one request from R2T queue 
-        socket_get_r2t_request( socket_r2tq_xp , &r2t_flags );
-
-#if DEBUG_DEV_NIC_TX 
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] socket[%x,%d] %s / send only flags %x / no data\n",
-__FUNCTION__, socket_pid, socket_fdid, socket_state_str(socket_state), r2t_flags );
-#endif
-        // build TCP header 
-        dev_nic_tx_build_tcp_header( k_trsp_base,
-                                     socket_xp,
-                                     0,             // no payload
-                                     r2t_flags );   // flags
-        // set protocol
-        trsp_protocol = PROTOCOL_TCP;
-
-        // set TCP packet length
-        trsp_length   = TCP_HEAD_LEN;
-    }
-
-    // 3. build IP header
-    dev_nic_tx_build_ip_header( k_buf + ETH_HEAD_LEN,
-                                src_ip_addr,
-                                dst_ip_addr,
-                                trsp_protocol,
-                                trsp_length );
-
-    // 4. build ETH header
-    dev_nic_tx_build_eth_header( k_buf,
-                                 (uint8_t)DST_MAC_5,
-                                 (uint8_t)DST_MAC_4,
-                                 (uint8_t)DST_MAC_3,
-                                 (uint8_t)DST_MAC_2,
-                                 (uint8_t)DST_MAC_1,
-                                 (uint8_t)DST_MAC_0,
-                                 (uint8_t)SRC_MAC_5,
-                                 (uint8_t)SRC_MAC_4,
-                                 (uint8_t)SRC_MAC_3,
-                                 (uint8_t)SRC_MAC_2,
-                                 (uint8_t)SRC_MAC_1,
-                                 (uint8_t)SRC_MAC_0,
-                                 IP_HEAD_LEN + trsp_length );
-
-#if DEBUG_DEV_NIC_TX
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] exit for socket[%x,%d] / packet build / cycle %d\n",
-__FUNCTION__, socket_pid, socket_fdid, cycle );
-#endif
-
-    // return success and total packet length
-    *total_length = ETH_HEAD_LEN + IP_HEAD_LEN + trsp_length;
-    return CMD_STS_SUCCESS;
-
-}  // end dev_nic_tx_build_packet()
-
-/////////////////////////////////////////
-void dev_nic_tx_server( chdev_t * chdev )
-{
-    uint8_t           k_buf[CONFIG_SOCK_PKT_BUF_SIZE];  // buffer for one packet
-
-    xptr_t            queue_lock_xp;       // extended pointer on lock for sockets list
-    xptr_t            root_xp;             // extended pointer on sockets list root
-    xptr_t            iter_xp;             // iterator for loop on sockets list
-    xptr_t            list_xp;             // extended pointer on socket tx_list field
-    xptr_t            socket_xp;           // extended pointer on found socket 
-    socket_t        * socket_ptr;          // local pointer on found socket
-    cxy_t             socket_cxy;          // found socket cluster identifier
-    xptr_t            socket_lock_xp;      // extented pointer on found socket lock
-    bool_t            cmd_valid;           // TX command valid in socket descriptor
-    bool_t            r2t_valid;           // valid R2T request in socket descriptor
-    uint32_t          sock_type;           // socket type
-    socket_cmd_sts_t  cmd_sts;             // value returned by dev_nic_tx_build_packet()
-    socket_cmd_type_t tx_cmd;              // socket TX command type
-    uint32_t          tx_todo;             // socket number of bytes not sent yet
-    uint32_t          total_length;        // length of the ETH/IP/TCP packet (bytes)
-    bool_t            found;               // one active socket found
-    
-    thread_t * this = CURRENT_THREAD;
-
-#if DEBUG_DEV_NIC_TX
-uint32_t cycle = (uint32_t)hal_get_cycles();
-uint32_t pid;
-uint32_t fdid;
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] thread[%x,%x] starts / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-// check chdev direction and type
-assert( __FUNCTION__, (chdev->func == DEV_FUNC_NIC) && (chdev->is_rx == false) ,
-"illegal chdev type or direction" );
-
-    // build extended pointers on client sockets queue lock 
-    queue_lock_xp = XPTR( local_cxy , &chdev->wait_lock );
-
-    // build extended pointers on client sockets queue root and first item 
-    root_xp  = XPTR( local_cxy , &chdev->wait_root );
-
-    while( 1 )  // TX server infinite loop
-    {
-        // take the lock protecting the client sockets queue
-        remote_busylock_acquire( queue_lock_xp );
-
-        found = false;
-
-        // scan registered sockets to find one active socket
-        // with a round robin priority between the registered sockets
-        if( xlist_is_empty( root_xp ) == false )  
-        {
-            XLIST_FOREACH( root_xp , iter_xp )
-            {
-                // get client socket cluster and pointers
-                socket_xp  = XLIST_ELEMENT( iter_xp , socket_t , tx_list );
-                socket_ptr = GET_PTR( socket_xp );
-                socket_cxy = GET_CXY( socket_xp );
-
-                // build extended pointer on socket tx_list field
-                list_xp = XPTR( socket_cxy , &socket_ptr->tx_list );
-
-                // get cmd_valid & r2t_valid from socket descriptor
-                cmd_valid = (bool_t)hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_valid ));
-
-                // get r2t_valid from socket descriptor
-                r2t_valid = (bool_t)remote_buf_status( XPTR( socket_cxy , &socket_ptr->r2tq ));
-
-                if( cmd_valid || r2t_valid )    // active => move socket, and exit loop
-                {
-                    // move selected socket to last position for round-robin
-                    xlist_unlink( list_xp );
-                    xlist_add_last( root_xp , list_xp );
-
-                    // exit loop
-                    found = true;
-                    break;
-                }
-            }   // end loop on sockets
-        }
-        
-        // release the lock protecting the client sockets queue
-        remote_busylock_release( queue_lock_xp );
-
-        if( found == false ) // block & deschedule if no active socket 
-        {
- 
-#if DEBUG_DEV_NIC_TX
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] thread[%x,%x] no active socket => blocks on <CLIENT> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            // block and deschedule
-            thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_CLIENT );
-            sched_yield( "waiting client" );
-
-#if DEBUG_DEV_NIC_TX
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] thread[%x,%x] resumes / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        }
-        else              // handle active socket request
-        {
-            // avoid warning
-            total_length = 0;
- 
-            // build extended pointer on socket lock
-            socket_lock_xp = XPTR( socket_cxy , &socket_ptr->lock );
-
-            // take socket lock
-            remote_queuelock_acquire( socket_lock_xp );
-
-#if DEBUG_DEV_NIC_TX
-cycle = (uint32_t)hal_get_cycles();
-pid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-fdid = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->fdid ));
-#endif
-
-#if DEBUG_DEV_NIC_TX
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] thread[%x,%x] select socket[%x,%d] / cmd_val %d / r2t_val %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, fdid, cmd_valid, r2t_valid, cycle );
-#endif
-            // build one UDP packet / TCP segment 
-            cmd_sts = dev_nic_tx_build_packet( socket_xp,
-                                               k_buf,
-                                               &total_length );
-#if DEBUG_DEV_NIC_TX
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] thread[%x,%x] for socket[%x,%x] build packet / %d bytes / sts %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, fdid, total_length, cmd_sts, cycle );
-#endif
-            // release socket lock
-            remote_queuelock_release( socket_lock_xp );
-
-            if( cmd_sts == CMD_STS_SUCCESS )    // move packet to TX queue
-            {
-                // move packet to NIC_TX queue 
-                dev_nic_tx_move_packet( chdev,
-                                        k_buf,
-                                        total_length );
-#if DEBUG_DEV_NIC_TX
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-dev_nic_packet_display( pid, fdid, cycle, k_buf );
-#endif
-                // get socket.type, socket.tx_cmd and socket.tx_todo values 
-                tx_cmd    = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_cmd ));
-                tx_todo   = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->tx_todo ));
-                sock_type = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->type ));
-
-                // client signaling depends on command type and socket type
-                if( (tx_cmd == CMD_TX_SEND) &&  (tx_todo == 0) )
-                {
-                    // reset tx_valid for both UDP and TCP
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->tx_valid), false );
-
-                    // unblock client thread for UDP only
-                    if(sock_type == SOCK_DGRAM)
-                    dev_nic_unblock_tx_client( socket_xp , CMD_STS_SUCCESS );
-                }
-                else  // type is CONNECT / ACCEPT / CLOSE 
-                {
-                    // reset tx_valid
-                    hal_remote_s32( XPTR( socket_cxy , &socket_ptr->tx_valid), false );
-                }
-            }
-            else                          // signal error to client thread
-            {
-                // reset tx_valid
-                hal_remote_s32( XPTR( socket_cxy , &socket_ptr->tx_valid), false );
-
-                // unblock tx_client thread
-                dev_nic_unblock_tx_client( socket_xp , cmd_sts );
-            }
-        }   // end active socket handling
-    }   // end infinite while loop
-}  // end dev_nic_tx_server()
-
-
-
-
-
-//////////////////////////////////////////////////
-void dev_nic_packet_display( pid_t     socket_pid,
-                             uint32_t  socket_fdid,
-                             uint32_t  cycle,
-                             uint8_t * buf )
-{
-    // get ETH header fields
-    uint64_t eth_dst_mac = ((uint64_t)buf[5]  << 40) |
-                           ((uint64_t)buf[4]  << 32) |
-                           ((uint64_t)buf[3]  << 24) |
-                           ((uint64_t)buf[2]  << 16) |
-                           ((uint64_t)buf[1]  <<  8) |
-                           ((uint64_t)buf[0]       ) ;
-
-    uint64_t eth_src_mac = ((uint64_t)buf[11] << 40) |
-                           ((uint64_t)buf[10] << 32) |
-                           ((uint64_t)buf[9]  << 24) |
-                           ((uint64_t)buf[8]  << 16) |
-                           ((uint64_t)buf[7]  <<  8) |
-                           ((uint64_t)buf[6]       ) ;
-
-    uint16_t eth_length  = ((uint16_t)buf[12] <<  8) |
-                           ((uint16_t)buf[13]      ) ;
-
-    // get IP header fields
-    uint8_t  ip_version  = buf[14];
-    uint8_t  ip_tos      = buf[15];
-    uint16_t ip_length   = ((uint16_t)buf[16] << 8) |
-                           ((uint16_t)buf[17]     ) ;
-
-    uint16_t ip_ident    = ((uint16_t)buf[18] << 8) |
-                           ((uint16_t)buf[19]     ) ;
-    uint16_t ip_offset   = ((uint16_t)buf[20] << 8) |
-                           ((uint16_t)buf[21]     ) ;
-
-    uint8_t  ip_ttl      = buf[22];
-    uint8_t  ip_protocol = buf[23];
-    uint16_t ip_checksum = ((uint16_t)buf[24] << 8) |
-                           ((uint16_t)buf[25]     ) ;
-
-    uint32_t ip_src_addr = ((uint32_t)buf[26] << 24) |
-                           ((uint32_t)buf[27] << 16) |
-                           ((uint32_t)buf[28] <<  8) |
-                           ((uint32_t)buf[29]      ) ;
-
-    uint32_t ip_dst_addr = ((uint32_t)buf[30] << 24) |
-                           ((uint32_t)buf[31] << 16) |
-                           ((uint32_t)buf[32] <<  8) |
-                           ((uint32_t)buf[33]      ) ;
-    
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 chdev lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-    nolock_printk("\n***** packet sent by NIC_TX server for socket[%x,%d] / cycle %d\n",
-    socket_pid, socket_fdid, cycle );
-
-    nolock_printk(" ETH header\n");
-    nolock_printk(" - dst_mac  [6] = %l\n" , eth_dst_mac );
-    nolock_printk(" - src_mac  [6] = %l\n" , eth_src_mac );
-    nolock_printk(" - length   [2] = %d\n" , (uint32_t)eth_length );
-    nolock_printk(" IP  header\n");
-    nolock_printk(" - version  [1] = %x\n" , (uint32_t)ip_version );
-    nolock_printk(" - tos      [1] = %x\n" , (uint32_t)ip_tos );
-    nolock_printk(" - length   [2] = %d\n" , (uint32_t)ip_length );
-    nolock_printk(" - ident    [2] = %x\n" , (uint32_t)ip_ident  );
-    nolock_printk(" - offset   [2] = %x\n" , (uint32_t)ip_offset );
-    nolock_printk(" - ttl      [1] = %x\n" , (uint32_t)ip_ttl );
-    nolock_printk(" - protocol [1] = %x\n" , (uint32_t)ip_protocol );
-    nolock_printk(" - checksum [2] = %x\n" , (uint32_t)ip_checksum );
-    nolock_printk(" - src_addr [4] = %x\n" , (uint32_t)ip_src_addr );
-    nolock_printk(" - dst_addr [4] = %x\n" , (uint32_t)ip_dst_addr );
-
-    // get UDP / TCP fields
-    if ( ip_protocol == PROTOCOL_UDP )
-    {
-        uint16_t udp_src_port = ((uint16_t)buf[34] << 8) |
-                                ((uint16_t)buf[35]     ) ;
-        uint16_t udp_dst_port = ((uint16_t)buf[36] << 8) |
-                                ((uint16_t)buf[37]     ) ;
-
-        nolock_printk(" UDP header\n");
-        nolock_printk(" - src_port [2] = %d\n" , (uint32_t)udp_src_port );
-        nolock_printk(" - dst_port [2] = %d\n" , (uint32_t)udp_dst_port );
-    }
-    else if( ip_protocol == PROTOCOL_TCP )
-    {
-        uint16_t tcp_src_port = ((uint16_t)buf[34] << 8) |
-                                ((uint16_t)buf[35]     ) ;
-        uint16_t tcp_dst_port = ((uint16_t)buf[36] << 8) |
-                                ((uint16_t)buf[37]     ) ;
-
-        uint32_t tcp_seq_num  = ((uint32_t)buf[38] << 24) |
-                                ((uint32_t)buf[39] << 16) |
-                                ((uint32_t)buf[40] <<  8) |
-                                ((uint32_t)buf[41]      ) ;
-
-        uint32_t tcp_ack_num  = ((uint32_t)buf[42] << 24) |
-                                ((uint32_t)buf[43] << 16) |
-                                ((uint32_t)buf[44] <<  8) |
-                                ((uint32_t)buf[45]      ) ;
-
-        uint8_t  tcp_hlen      = buf[46];
-        uint8_t  tcp_flags     = buf[47];
-        uint16_t tcp_window    = ((uint16_t)buf[48] << 8) |
-                                 ((uint16_t)buf[49]     ) ;
-
-        uint16_t tcp_checksum  = ((uint16_t)buf[50] << 8) |
-                                 ((uint16_t)buf[51]     ) ;
-        uint16_t tcp_urgent    = ((uint16_t)buf[52] << 8) |
-                                 ((uint16_t)buf[53]     ) ;
-
-        nolock_printk(" TCP header\n");
-        nolock_printk(" - src_port [2] = %x\n" , (uint32_t)tcp_src_port );
-        nolock_printk(" - dst_port [2] = %x\n" , (uint32_t)tcp_dst_port );
-        nolock_printk(" - seq_num  [4] = %x\n" , (uint32_t)tcp_seq_num );
-        nolock_printk(" - ack_num  [4] = %x\n" , (uint32_t)tcp_ack_num );
-        nolock_printk(" - hlen     [1] = %d\n" , (uint32_t)tcp_hlen );
-        nolock_printk(" - flags    [1] = %x\n" , (uint32_t)tcp_flags );
-        nolock_printk(" - window   [2] = %x\n" , (uint32_t)tcp_window );
-        nolock_printk(" - checksum [2] = %x\n" , (uint32_t)tcp_checksum );
-        nolock_printk(" - urgent   [2] = %x\n" , (uint32_t)tcp_urgent );
-    }
-    else
-    {
-        nolock_printk("!!!!! undefined transport protocol !!!!!\n");
-    }
-
-    // release TXT0 lock 
-    remote_busylock_release( lock_xp );
-
-}  // end dev_nic_packet_display()
-
+}  // end dev_nic_write()
+
+
+
Index: trunk/kernel/devices/dev_nic.h
===================================================================
--- trunk/kernel/devices/dev_nic.h	(revision 690)
+++ trunk/kernel/devices/dev_nic.h	(revision 1)
@@ -2,5 +2,5 @@
  * dev_nic.h - NIC (Network Controler) generic device API definition.
  * 
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
+ * Author  Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,176 +25,101 @@
 #define _DEV_NIC_H
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <remote_busylock.h>
-#include <remote_buf.h>
-#include <xlist.h>
-
-/****  Forward declarations  ****/
-
-struct chdev_s;
+#include <almos_config.h>
+#include <hal_types.h>
 
 /*****************************************************************************************
  *     Generic Network Interface Controler definition
  *
- * This device provides access to a generic Gigabit Ethernet network controler.
- * It assumes that the NIC hardware peripheral handles two packets queues for sent (TX)
- * and received (RX) packets.
- *
- * The supported protocols stack is : Ethernet / IPV4 / TCP or UDP
+ * This device provide access to an external Gigabit Ethernet network controler.
+ * It assume that the NIC hardware peripheral handles two packets queues for sent (TX)
+ * and received (RX) packets. Packets are (Ethernet/IPV4).
  * 
- * 1) hardware assumptions
- *
- * The NIC device is handling two (infinite) streams of packets to or from the network. 
+ * The NIC device is handling an (infinite) stream of packets to or from the network. 
  * It is the driver responsibility to move the RX packets from the NIC to the RX queue,
  * and the TX packets from the TX queue to the NIC.
  *
- * AS the RX and TX queues are independant, there is one NIC_RX device descriptor 
- * to handle RX packets, and another NIC_TX device descriptor to handle TX packets.
- *
- * In order to improve throughput, the NIC controller can implement multiple (N) channels.
- * In this case, the channel index is defined by an hash function computed from the remote
- * IP address and port. This index is computed by the hardware for an RX packet, and is 
- * computed by the kernel for a TX packet, using a specific driver function. 
- * The 2*N chdevs, and the associated server threads implementing the protocols stack,
- * are distributed in 2*N different clusters.
- *
- * 2) User API
- * 
- * On the user side, ALMOS-MKH implements the POSIX socket API. 
- * The following kernel functions implement the socket related syscalls :
- * - socket_build()     : create a local socket registered in process fd_array[].
- * - socket_bind()      : attach a local IP address and port to a local socket.
- * - socket_listen()    : local server makes a passive open.
- * - socket_connect()   : local client makes an active open to a remote server.
- * - socket_accept()    : local server accept a new remote client.
- * - socket_send()      : send data on a connected socket.
- * - socket_recv()      : receive data on a connected socket.
- * - socket_sendto()    : send a packet to a remote (IP address/port). 
- * - socket_recvfrom()  : receive a paket from a remote (IP address/port).
- *
- * 3) NIC TX and NIC_RX server threads
- *
- * The dev_nic_tx_server() & dev_nic_rx_server() functions defined below execute 
- * the user commands stored in the sockets to implement the [ETH / IP / TCP or UDP] 
- * protocols stack, as defined in the <ksocket.c> and <ksocket.h> files.
- *
- * 4) NIC driver API
- *
- * The generic NIC device "driver" API defines the following commands, used by the
- * NIC_TX and NIC_RX server threads, running in the cluster containing the relevant chdev,
- * to access the NIC_TX and NIC_RX packets queues:
- *
- * - READ     : consume one packet from the NIC_RX queue.
- * - WRITE    : produce one packet to the NIC_TX queue.
- *
- * All RX or TX paquets are sent or received in standard 2 Kbytes kernel buffers,
- * that are dynamically allocated by the protocols stack. 
- * The actual TX an RX queues structures depends on the hardware NIC implementation,
- * and are defined in the HAL specific driver code. 
- *
- * Moreover, the generic NIC device "driver" API defines the following commands,
- * used directly by a client thread running in any cluster, to access the NIC device
- * configuration or status registers:
- *
- * - GET_KEY      : get channel index from remote IP address and port 
- * - SET_RUN      : activate/desactivate one channel (both directions)
- * - GET_INSTRU   : get one instrumentation counter value
- * - CLEAR_INSTRU : reset all instrumentation counters
+ * AS the RX and TX queues are independant, there is one NIC-RX device descriptor 
+ * to handle RX packets, and another NIC-TX device descriptor to handle TX packets.
+ * In order to improve throughput, the hardware NIC controller can optionnally implement
+ * multiple channels:
+ * - The RX channels are indexed by an hash key derived from the source IP address.
+ * - The TX channels are indexed by an hash key derived from the destination IP address.
+ * These 2*N devices, and 2*N associated server threads, are distributed in 2*N clusters.
+ * The  2*N server threads implement the protocols stack. The RX server threads block
+ * and deschedule when the RX queue is empty. The TX server stack block and deschedule
+ * when the queue is full. 
+ *
+ * It is the driver responsibily to re-activate a blocked server thread when
+ * the queue state is modified: not full for TX, or not empty for RX.
  *
  * WARNING: the WTI mailboxes used by the driver ro receive events from the hardware
  * (available RX packet, or available free TX slot, for a given channel), must be 
  * statically allocated during the kernel initialisation phase, and must be 
- * routed to the cluster containing the associated TX/RX chdev and server thread.
- *
+ * routed to the cluster containing the associated device descriptor and server thread.
+ * to simplify the server thread re-activation.
+ *
+ * Finally, the generic NIC device API defines the following commands:
+ * - READABLE : returns true if at least one RX paquet is available in RX queue.
+ * - WRITABLE : returns true if atleast one empty slot is available in TX queue.
+ * - READ     : consume one packet from the RX queue.
+ * - WRITE    : produce one packet fto the TX queue.
+ * All RX or TX paquets are sent or received in standard 2 Kbytes kernel buffers,
+ * that are dynamically allocated by the protocols stack. The structure pkd_t
+ * defining a packet descriptor is defined below, and contain the buffer pointer
+ * and the actual Ethernet packet Length.
+ *
+ * The actual TX an RX queues structures depends on the hardware NIC implementation,
+ * and are defined in the driver code. 
  *****************************************************************************************/
 
 /****  Forward declarations  ****/
 
-struct chdev_s;
-
-/*****************************************************************************************
- *   Various constants used by the protocols stack
- ****************************************************************************************/
-
-#define SRC_MAC_5              0x66         // This is a temporary short-cut for debug
-#define SRC_MAC_4              0x55
-#define SRC_MAC_3              0x44
-#define SRC_MAC_2              0x33
-#define SRC_MAC_1              0x22
-#define SRC_MAC_0              0x11
-
-#define DST_MAC_5              0x66         // This is a temporary short-cut for debug
-#define DST_MAC_4              0x55
-#define DST_MAC_3              0x44
-#define DST_MAC_2              0x33
-#define DST_MAC_1              0x22
-#define DST_MAC_0              0x11
-
-#define TCP_HEAD_LEN           20
-#define UDP_HEAD_LEN           8
-#define IP_HEAD_LEN            20
-#define ETH_HEAD_LEN           14
-
-#define PROTOCOL_UDP           0x11
-#define PROTOCOL_TCP           0x06
-
-#define TCP_FLAG_FIN           0x01
-#define TCP_FLAG_SYN           0x02
-#define TCP_FLAG_RST           0x04
-#define TCP_FLAG_PSH           0x08
-#define TCP_FLAG_ACK           0x10
-#define TCP_FLAG_URG           0x20
-
-/*****************************************************************************************
- * This structure defines the specific chdev extension for NIC device:
- * - queue : local pointer on the memory mapped queue of TX or RX packets, used
- *   by the NIC driver to move packets to/from the NIC hardware. The actual descriptor
- *   depends on the NIC implementation.
- * - root  : root of an xlist of sockets that are in the LISTEN state, waiting one or
- *   several TCP connection requests from remote processes. It is only used by the
- *   NIC_RX server thread attached to a NIC_RX chdev. 
- * - lock  : lock protecting concurrent access to the litening sockets list.
- ****************************************************************************************/
+struct device_s;
+
+/******************************************************************************************
+ * This defines the extension for the generic IOC device.
+ * The actual queue descriptor depends on the implementation.
+ *****************************************************************************************/
 
 typedef struct nic_extend_s
 {
-    void            * queue;    /*! pointer on NIC packets queue descriptor (RX or TX)  */
-    xlist_entry_t     root;     /*! root of listening sockets list (only used in RX[0]) */
-    remote_busylock_t lock;     /*! lock protecting this list  (only used in RX[0]      */
+    void     * queue;     /*! local pointer on the packets queue descriptor (RX or TX)   */
 }
 nic_extend_t;
 
-/*****************************************************************************************
+/******************************************************************************************
+ * This structure defines the Ethernet/IPV4 packet descriptor, that is sent to,
+ * or received from, the protocols stack.
+ *****************************************************************************************/
+
+typedef struct pkd_s
+{
+    char      * buffer;   /*! local pointer on 2 Kbytes buffer containing packet         */  
+    uint32_t    length;   /*! actual number of bytes                                     */
+}
+pkd_t;
+
+/******************************************************************************************
  * This enum defines the various implementations of the generic NIC peripheral.
  * This array must be kept consistent with the define in the arch_info.h file.
- ****************************************************************************************/
-
-typedef enum nic_impl_e
-{
-    IMPL_NIC_CBF =   0,     
+ *****************************************************************************************/
+
+enum nic_impl_e
+{
+    IMPL_NIC_SOC =   0,     
     IMPL_NIC_I86 =   1,
 }
 nic_impl_t;
 
-/****************************************************************************************
- * This defines the (implementation independant) commands to access the NIC hardware.
- * There is two types of commands
- * - The first 2 commands are used by the NIC_TX and NIC_RX server threads, and stored
- *   in the server thread descriptor, to access the NIC_RX & NIC_TX packet queues.
- *   The buffer is always a 2K bytes kernel buffer, containing an Ethernet packet.
- * - The next 4 synchronous commands are used by the client thread, and stored in the 
- *   client thread descriptor, to directly access the NIC registers. 
- ****************************************************************************************/
+/******************************************************************************************
+ * This defines the (implementation independant) command  passed to the NIC driver.
+ *****************************************************************************************/
 
 typedef enum nic_cmd_e
 {
-    NIC_CMD_WRITE        = 10,  /*! put one (given length) packet to TX queue           */
-    NIC_CMD_READ         = 11,  /*! get one (any length) packet from RX queue           */
-
-    NIC_CMD_GET_KEY      = 20,  /*! return channel index from IP address and port       */ 
-    NIC_CMD_SET_RUN      = 21,  /*! enable/disable one NIC channel                      */
-    NIC_CMD_GET_INSTRU   = 22,  /*! return one intrumentation register value            */
-    NIC_CMD_CLEAR_INSTRU = 23,  /*! reset all instrumentation registers                 */
+    NIC_CMD_WRITABLE = 0,  /*! test TX queue not full (for a given length packet)        */
+    NIC_CMD_WRITE    = 1,  /*! put one (given length) packet to TX queue                 */
+    NIC_CMD_READABLE = 2,  /*! test RX queue not empty (for any length packet)           */
+    NIC_CMD_READ     = 3,  /*! get one (any length) packet from RX queue                 */
 }
 nic_cmd_t;
@@ -202,137 +127,100 @@
 typedef struct nic_command_s
 {
-    xptr_t      dev_xp;       /*! extended pointer on NIC chdev descriptor              */
-    nic_cmd_t   type;         /*! command type                                          */
-    uint8_t   * buffer;       /*! local pointer on kernel buffer (when READ / WRITE)    */  
-    uint32_t    length;       /*! number of bytes in buffer (when READ / WRITE )        */
-    uint32_t    status;       /*! return value (depends on command type)                */
-    uint32_t    error;        /*! return an error from the hardware (0 if no error)     */
+    xptr_t      dev_xp;   /*! extended pointer on device descriptor                      */
+    nic_cmd_t   cmd;      /*! requested operation type                                   */
+    char      * buffer;   /*! local pointer on 2 Kbytes buffer containing packet         */  
+    uint32_t    length;   /*! actual number of bytes                                     */
+    bool_t      status;   /*! return true if writable or readable (depend on command)    */
+    uint32_t    error;    /*! return an error from the hardware (0 if no error)          */
 }
 nic_command_t;
 
 /******************************************************************************************
- * This function completes the NIC-RX and NIC-TX chdev descriptors initialisation.
- * namely the link with the implementation specific driver.
- * The func, impl, channel, is_rx, base fields have been previously initialised.
- * It calls the specific driver initialisation function, to initialise the hardware
- * device and the specific data structures when required.
- * It creates the associated server thread and allocates a WTI from local ICU.
- * For a TX_NIC chedv, it allocates and initializes the R2T queue used by the 
- * NIC_RX[channel] server to send direct requests to the NIC_TX[channel] server,
- * and the CRQ queue used to register connection requests.
- * It must de executed by a local thread.
- * For NIC_TX and NIC_RX chdevs, the "wait_root" field is actually a list of sockets.
- ******************************************************************************************
- * @ chdev    : local pointer on NIC chdev descriptor.
- *****************************************************************************************/
-void dev_nic_init( struct chdev_s * chdev );
-
-/* Functions directly called by a client thread in any cluster */
- 
-/******************************************************************************************
- * This function compute a channel index in range [0,nic_channels[ from the remote IP
- * address <addr> and <port>, by calling the relevant driver command.
- ******************************************************************************************
- * @ addr     : [in] IP address.
- * @ port     : [in] TCP/UDP port.
- * @ return the selected channel index
- *****************************************************************************************/
-uint32_t dev_nic_get_key( uint32_t addr,
-                          uint16_t port );
-
-/******************************************************************************************
- * This function activate / de-activate a NIC channel DMA engine identified by the
- * <channel> argument, as defined by the <run> argument.
- ******************************************************************************************
- * @ channel  : [in] NIC channel index.
- * @ run      : [in] activate if non-zero / desactivate if zero.
- * @ return 0 if success / return -1 if error.
- *****************************************************************************************/
-error_t dev_nic_set_run( uint32_t channel,
-                         uint32_t run );
-
-/******************************************************************************************
- * This instrumentation function displays on the TXT0 kernel terminal the content
- * of the instrumentation registers contained in the NIC device.
- ******************************************************************************************
- * @ return 0 if success / return -1 if error.
- *****************************************************************************************/
-error_t dev_nic_get_instru( void );
-
-/******************************************************************************************
- * This instrumentation function reset all instrumentation registers contained
- * in the NIC device.
- ******************************************************************************************
- * @ return 0 if success / return -1 if error.
- *****************************************************************************************/
-error_t dev_nic_clear_instru( void );
-
-/* Functions executed by the TX and RX server threads */ 
- 
-/******************************************************************************************
- * This function is executed by the server thread associated to a NIC_TX[channel] chdev. 
- * This TX server thread is created by the dev_nic_init() function.
- * It build and send UDP packets or TCP segments for all clients threads registered in
- * the NIC_TX[channel] chdev. The command types are (CONNECT / ACCEPT / CLOSE / SEND).
- * It takes into account the request registered by the RX server thread in the R2T queues.
- * The loop on registered sockets implements a round-robin priority between sockets.
- * When no registered socket is active, it blocks on the THREAD_BLOCKED_CLIENT condition
- * and deschedules. It is re-activated by a client thread registering a command.
- * When the NIC_TX packet queue is full, it blocks on the THREAD_BLOCKED_ISR condition
- * and deschedules. It is reactivated by the NIC_TX DMA engine.
- ******************************************************************************************
- * Implementation note:
- * At each iteration in the infinite loop, it takes the lock protecting the registered
- * client sockets queue to find one active socket (tx_valid or r2t_valid flags set).
- * For each registered socket, it takes the lock protecting the socket state, and 
- * exit the scan when an active socket has been found, without releasing the socket state.
- * When the scan is completed, it release the lock protecting the queue, before handling
- * the found active socket. The socket lock is released only when the requested packet
- * has been build, and the active socket state has been updated.
- * To handle a socket request, it calls the transport layer to build the UDP packet or
- * TCP segment in a local 2K bytes kernel buffer, calls the IP layer to add the IP header, 
- * calls the ETH layer to add the ETH header, and moves the packet to the NIC_TX_QUEUE.
- ******************************************************************************************
- * @ chdev    : [in] local pointer on one local NIC_TX[channel] chdev descriptor.
- *****************************************************************************************/
-void dev_nic_tx_server( struct chdev_s * chdev );
-
-
-/******************************************************************************************
- * This function is executed by the server thread associated to a NIC_RX[channel] chdev. 
- * This RX server thread is created by the dev_nic_init() function.
- * It handles all UDP packets or TCP segments received by the sockets attached to 
- * the NIC_RX[channel] chdev. It writes the received data in the socket rcv_buf, and
- * unblocks the client thread waiting on a RECV command.
- * To implement the three steps handshahke required by a TCP connection, it posts direct
- * requests to the TX server, using the R2T queue attached to the involved socket. 
- * It blocks on the THREAD_BLOCKED_ISR condition and deschedules when the NIC_RX_QUEUE
- * is empty, and is re-activated by the NIC_RX_ISR, when the queue becomes non empty.
- ******************************************************************************************
- * Implementation note:
- * It executes an infinite loop in which it extracts one packet from the NIC_RX_QUEUE
- * of received packets, copies this packet in a local 2 kbytes kernel buffer, checks 
- * the Ethernet header, checks the IP header, calls the relevant (TCP or UDP) transport
- * protocol that search a matching socket for the received packet. It copies the payload 
- * to the relevant socket rcv_buf when the packet is acceptable, and unblocks the client
- * thread. It discard the packet if no socket found.
- ******************************************************************************************
- * @ chdev    : [in] local pointer on one local NIC_RX[channel] chdev descriptor.
- *****************************************************************************************/
-void dev_nic_rx_server( struct chdev_s * chdev );
-
-/******************************************************************************************
- * This debug function can be called by the dev_nic_tx_server() function to display
- * on TXT0 the header of a TX [ETH/IP/TCP] segment or [ETH/IP/UDP] packet. 
- ******************************************************************************************
- * @ pid     : [in] process identifier.
- * @ fdid    : [in] socket identifier.
- * @ cycle   : [in] date (number of cycles).
- * @ buf     : [in] local pointer on kernel buffer containing the packet.
- *****************************************************************************************/
-void dev_nic_packet_display( pid_t     pid,
-                             uint32_t  fdid,
-                             uint32_t  cycle,
-                             uint8_t * buf );
+ * This function completes the NIC-RX and NIC-TX devices descriptors initialisation.
+ * The func, impl, channel, is_rx, base, and size have been previously initialised.
+ * It calls the driver initialisation function.
+ ******************************************************************************************
+ * @ dev_xp     : extended pointer on NIC-RX or NIC-TX device descriptor.
+ *****************************************************************************************/
+void dev_nic_init( xptr_t  dev_xp );
+
+/******************************************************************************************
+ * This blocking function must be called by the kernel thread running in the cluster
+ * containing the NIC_RX channel device descriptor.
+ * It read one packet (Ethernet/IPV4) from the NIC_RX queue associated to the NIC channel.
+ * It calls directly the NIC driver, without registering in a waiting queue, because 
+ * only this NIC_RX thread can access this packets queue.
+ * 1) It test the packets queue status, using the NIC_CMD_WRITABLE command.
+ *    If it is empty, it unmask the NIC-RX channel IRQ, blocks and deschedule.
+ *    It is re-activated by the NIC-RX ISR (generated by the NIC) as soon as the queue
+ *    becomes not empty.
+ * 2) if the queue is not empty, it get one packet, using the driver NIC_CMD_READ command.
+ * Both commands are successively registered in the NIC-RX server thread descriptor
+ * to be passed to the driver. 
+ *
+ * WARNING : for a RX packet the initiator is the NIC hardware, and the protocols
+ * stack is traversed upward, from the point of view of function calls.
+ ******************************************************************************************
+ * @ pkd     : pointer on packet descriptor (expected).
+ * @ returns 0 if success / returns non zero if ENOMEM, or error reported from NIC.
+ *****************************************************************************************/
+error_t dev_nic_read( pkd_t * pkd );
+
+/******************************************************************************************
+ * This blocking function must be called by the kernel thread running in the cluster
+ * containing the NIC_TX channel device descriptor.
+ * It writes one packet (Ethernet/IPV4) to the NIC_RX queue associated to the NIC channel.
+ * It calls directly the NIC driver, without registering in a waiting queue, because 
+ * only this NIC_TX thread can access this packets queue.
+ * 1) It test the packets queue status, using the NIC_CMD_READABLE command.
+ *    If it is full, it unmask the NIC-TX channel IRQ, blocks and deschedule.
+ *    It is re-activated by the NIC-TX ISR (generated by the NIC) as soon as the queue
+ *    is not full.
+ * 2) If the queue is not empty, it put one packet, using the driver NIC_CMD_WRITE command.
+ * Both commands are successively registered in the NIC-TX server thread descriptor
+ * to be passed to the driver. 
+ *
+ * WARNING : for a TX packet the initiator is the "client" thread, and the protocols
+ * stack is traversed downward from the point of view of function calls.
+ ******************************************************************************************
+ * @ pkd     : pointer on packet descriptor (to be filed).
+ * @ returns 0 if success / returns if length > 2K, undefined key, or error from NIC.
+ *****************************************************************************************/
+error_t dev_nic_write( pkd_t * pkd );
+
+
+/******************************************************************************************
+ * This function is executed by the server thread associated to a NIC channel device 
+ * descriptor (RX or TX). This thread is created by the dev_nic_init() function.
+ * It executes an infinite loop, handling one packet per iteration.
+ *
+ * -- For a TX channel --
+ * 1) It allocates a 2 Kbytes buffer.
+ * 2) It copies the client TCP/UDP packet in this buffer.
+ * 3) It calls the IP layer to add the IP header.
+ * 4) It calls the ETH layer to add the ETH header.
+ * 5) It calls the dev_nic_write() blocking function to move the packet to the TX queue.
+ * 6) It releases the 2 Kbytes buffer.
+ *
+ * When the waiting threads queue is empty, it blocks on the THREAD_BLOCKED_IO_CMD
+ * condition and deschedule. It is re-activated by a client thread registering a command.
+ *
+ * -- For a RX channel --
+ * 1) It allocates a 2 Kbytes buffer.
+ * 2  It calls the dev_nic_read() blocking function to move the ETH packet to this buffer.
+ * 3) It calls the ETH layer to analyse the ETH header.
+ * 4) It calls the IP layer to analyse the IP header. TODO ???
+ * 5) It calls the transport (TCP/UDP) layer. TODO ???
+ * 5) It deliver the packet to the client thread. TODO ???
+ * 6) It releases the 2 Kbytes buffer.
+ *
+ * When the RX packets queue is empty, it blocks on the THREAD_BLOCKED_IO_CMD
+ * condition and deschedule. It is re-activated by the NIC driver when this queue
+ * becomes non empty. 
+ ******************************************************************************************
+ * @ dev     : local pointer on NIC channel device descriptor.
+ *****************************************************************************************/
+void dev_nic_server( struct device_s * dev );
+
 
 #endif	/* _DEV_NIC_H */
Index: trunk/kernel/devices/dev_pic.c
===================================================================
--- trunk/kernel/devices/dev_pic.c	(revision 690)
+++ trunk/kernel/devices/dev_pic.c	(revision 1)
@@ -2,5 +2,5 @@
  * dev_pic.c - PIC (External Interrupt Controler) generic device API implementation.
  *
- * Authors   Alain Greiner  (2016,2017,2018)
+ * Authors   Alain Greiner  (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -8,9 +8,9 @@
  * This file is part of ALMOS-MKH.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTPICLAR PURPOSE.  See the GNU
@@ -18,18 +18,16 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <chdev.h>
+#include <dev_icu.h>
+#include <device.h>
+#include <memcpy.h>
 #include <printk.h>
-#include <string.h>
-#include <thread.h>
-#include <remote_busylock.h>
-#include <hal_drivers.h>
+#include <soclib_pic.h>
 #include <dev_pic.h>
-#include <cluster.h>
 
 /////////////////////////////////////////////////////////////////////////////////////////
@@ -37,219 +35,93 @@
 /////////////////////////////////////////////////////////////////////////////////////////
 
-extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
-extern iopic_input_t      iopic_input;       // allocated in kernel_init.c
+extern devices_directory_t  devices_dir;         // allocated in kernel_init.c
+
+extern devices_input_irq_t  devices_input_irq;   // allocated in kernel_init.c
+
+
 
 ///////////////////////////////////
-void dev_pic_init( chdev_t  * pic )
+void dev_pic_init( xptr_t   dev_xp,
+                   uint32_t irq_nr )
 {
-    // set chdev name
-    strcpy( pic->name , "pic" );
+    // get PIC device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
 
-    // call the implementation-specific PIC driver
-    hal_drivers_pic_init( pic );
-}
+    // set PIC device extension field
+    dev_ptr->ext.pic.irq_nr = irq_nr;
 
-/////////////////////////////////////////////////
-void dev_pic_extend_init( uint32_t * lapic_base )
+    // get implementation index from PIC device descriptor
+    uint32_t impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // set the "name" field in PIC device descriptor
+    // and call the relevant driver init function
+    if( impl == IMPL_PIC_SOC )
+    {
+        memcpy( dev_ptr->name , "PIC_TSR" , 16 );
+        soclib_pic_init( dev_xp );
+    }
+    else
+    {
+        printk("PANIC in %s: illegal PIC device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+} // end dev_pic_init()
+
+/////////////////////////////////////////
+void dev_pic_bind_irq( uint32_t   irq_id,
+                       cxy_t      cxy,
+                       uint32_t   wti_id )
 {
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
+    // get extended pointer on WTI mailbox
+    xptr_t wti_xp = dev_icu_wti_xptr( cxy , wti_id );
 
-    // get pointer on extend_init function
-    extend_init_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.extend_init ) ); 
+    // get extended pointer on PIC device from directory
+    xptr_t dev_xp = devices_dir.pic;
 
-    // call relevant driver function
-    f( lapic_base );
-}
+    // get PIC device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
 
-/////////////////////////////////////
-void dev_pic_bind_irq( lid_t     lid,
-                       chdev_t * src_chdev )
+    // get implementation index and segment base 
+    uint32_t impl   = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // call the implementation specific driver function
+    if( impl == IMPL_PIC_SOC )
+    {
+        soclib_pic_bind_irq( dev_xp , irq_id , wti_xp );
+    }
+    else
+    {
+        printk("PANIC in %s: illegal PIC device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+}  // end dev_pic_link_wti()
+
+//////////////////////////////////////////
+void dev_pic_unbind_irq( uint32_t irq_id )
 {
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
+    // get extended pointer on PIC device from directory
+    xptr_t dev_xp = devices_dir.pic;
 
-    // get pointer on bind_irq function
-    bind_irq_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.bind_irq ) );
+    // get PIC device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
 
-    // call relevant driver function
-    f( lid , src_chdev );
-}
+    // get implementation index 
+    uint32_t impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
 
-/////////////////////////////////////
-void dev_pic_enable_irq( lid_t   lid,
-                         xptr_t  src_chdev_xp )
-{
-
-#if DEBUG_DEV_PIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_PIC < cycle )
-printk("\n[DBG] %s : core[%x,%d] / src_chdev_cxy %x / src_chdev_ptr %x / cycle %d\n",
-__FUNCTION__, local_cxy, lid, GET_CXY(src_chdev_xp), GET_PTR(src_chdev_xp), cycle );
-#endif
-
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
-
-    // get pointer on enable_irq function
-    enable_irq_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_irq ) );
-
-    // call relevant driver function
-    f( lid , src_chdev_xp );
-}
-
-//////////////////////////////////////
-void dev_pic_disable_irq( lid_t   lid,
-                          xptr_t  src_chdev_xp )
-{
-
-#if DEBUG_DEV_PIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_PIC < cycle )
-printk("\n[DBG] %s : core[%x,%d] / src_chdev_cxy %x / src_chdev_ptr %x / cycle %d\n",
-__FUNCTION__, local_cxy, lid, GET_CXY(src_chdev_xp), GET_PTR(src_chdev_xp), cycle );
-#endif
-
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
-
-    // get pointer on disable_irq function
-    disable_irq_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.disable_irq ) );
-
-    // call relevant driver function
-    f( lid , src_chdev_xp );
-}
-
-////////////////////////////////////////////
-void dev_pic_enable_timer( uint32_t period )
-{
-
-#if DEBUG_DEV_PIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_PIC < cycle )
-printk("\n[DBG] %s : core[%x,%d] / period %d / cycle %d\n",
-__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , period, cycle );
-#endif
-
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
-
-    // get pointer on enable_timer function
-    enable_timer_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_timer ) );
-
-    // call relevant driver function
-    f( period );
-}
-
-/////////////////////////
-void dev_pic_enable_ipi( void )
-{
-
-#if DEBUG_DEV_PIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_PIC < cycle )
-printk("\n[DBG] %s : core[%x,%d] / cycle %d\n",
-__FUNCTION__ , local_cxy , CURRENT_THREAD->core->lid , cycle );
-#endif
-
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
-
-    // get pointer on enable_timer function
-    enable_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_ipi ) );
-
-    // call relevant driver function
-    f();
-}
-
-//////////////////////////////////
-void dev_pic_send_ipi( cxy_t  cxy,
-                       lid_t  lid )
-{
-
-#if DEBUG_DEV_PIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_PIC < cycle )
-printk("\n[DBG] %s : thread %x in process %x / tgt_core[%x,%d] / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, cxy, lid, cycle );
-#endif
-
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
-
-    // get pointer on send_ipi function
-    send_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.send_ipi ) );
-
-    // call relevant driver function
-    f( cxy , lid );
-}
-
-//////////////////////
-void dev_pic_ack_ipi( void )
-{
-
-#if DEBUG_DEV_PIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_PIC < cycle )
-printk("\n[DBG] %s : core[%x,%d] / cycle %d\n",
-__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cycle );
-#endif
-
-    // get pointer on PIC chdev
-    chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic );
-    cxy_t     pic_cxy = GET_CXY( chdev_dir.pic );
-
-    // get pointer on ack_ipi function
-    ack_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.ack_ipi ) );
-
-    // call relevant driver function
-    f();
-}
-
-///////////////////////////////////
-void dev_pic_inputs_display( void )
-{
-    uint32_t k;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 chdev lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock in busy waiting mode
-    remote_busylock_acquire( lock_xp );
-
-    nolock_printk("\n***** iopic_inputs\n");
-
-    for( k = 0 ; k < CONFIG_MAX_IOC_CHANNELS ; k++ )
+    // call the implementation specific driver function
+    if( impl == IMPL_PIC_SOC )
     {
-        nolock_printk(" - IOC[%d]    hwi_id = %d\n", k , iopic_input.ioc[k] );
+        soclib_pic_unbind_irq( dev_xp , irq_id );
     }
-
-    for( k = 0 ; k < CONFIG_MAX_TXT_CHANNELS ; k++ )
+    else
     {
-        nolock_printk(" - TXT_TX[%d] hwi_id = %d\n", k , iopic_input.txt_tx[k] );
-        nolock_printk(" - TXT_RX[%d] hwi_id = %d\n", k , iopic_input.txt_rx[k] );
+        printk("PANIC in %s: illegal PIC device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
     }
-
-    for( k = 0 ; k < CONFIG_MAX_NIC_CHANNELS ; k++ )
-    {
-        nolock_printk(" - NIC_TX[%d] hwi_id = %d\n", k , iopic_input.nic_tx[k] );
-        nolock_printk(" - NIC_RX[%d] hwi_id = %d\n", k , iopic_input.nic_rx[k] );
-    }
-
-    // release TXT0 lock
-    remote_busylock_release( lock_xp );
-}
+   
+} // end dev_pic_disable_irq()
 
 
Index: trunk/kernel/devices/dev_pic.h
===================================================================
--- trunk/kernel/devices/dev_pic.h	(revision 690)
+++ trunk/kernel/devices/dev_pic.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * dev_pic.h - PIC (Programmable Interrupt Controler) generic device API definition.
+ * dev_pic.h - PIC (External Interrupt Controler) generic device API definition.
  *
- * Authors   Alain Greiner  (2016,2017,2018)
+ * Authors   Alain Greiner  (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,127 +25,39 @@
 #define _DEV_PIC_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 
 /*****************************************************************************************
- *     Generic Programmable Interrupt Controler definition
+ *     Generic External Interrupt Controler definition
  *
- * The PIC generic device describes the the programmable hardware infrastructure used
- * to route a given IRQ to a given core, in a given cluster, and to help the interrupt
- * handler to select  and execute the relevant ISR (Interrupt Service Routine).
- * It handles the four following types of interrupts:
+ * The PIC generic device describes an external interrupt Controler, that translates 
+ * N input IRQs generated by external peripherals to N WTI IRQs, that will be routed 
+ * to a dynamically allocated WTI mailbox in a given cluster. 
  *
- * 1) EXT_IRQ (External IRQ) generated by the external (shared) peripherals.
- * 2) INT_IRQ (Internal IRQ) generated by the internal (replicated) peripherals.
- * 3) TIM_IRQ (Timer IRQ) generated by the timers (one timer per core).
- * 4) IPI_IRQ (Inter Processor IRQ) generated by software (one IPI per core).
+ * The max number of input IRQs is defined by the CONFIG_MAX_IRQS_PER_PIC parameter. 
+ * The actual number of connected IRQs is defined in the ''arch_info'' file, and stored 
+ * in the PIC device extension.  
+ * The "source" device for each input IRQ is also defined in the ''arch_info'' file,
+ * and are stored in the ''devices_input_irq'' global variable in kernel initialization.
  *
- * In supported manycores architectures, the PIC device contains two types 
- * of hardware components: 
- * - the IOPIC is an external component, handling all external peripherals IRQs.
- * - The LAPIC is an internal component, replicated in each cluster, handling local
- *   peripherals IRQS, Timer IRQs and IPIs (inter-processor-interupts).
- *
- * The "source" device for each input IRQ to the external IOPIC component, is defined
- * in the "arch_info" file, and registered in the "iopic_input" global variable
- * at kernel initialization.
- *
- * The "source" device for each input IRQ to the replicated LAPIC components, is defined
- * in the "arch_info" file, and stored in the "lapic_input" global variable
- * at kernel initialization.
- *
- * The PIC device defines generic commands that can be used by each kernel instance,
- * - to create in local cluster the PIC implementation specific interupt vector(s),
- * - to bind a given IRQ (internal or external IRQ to a given core in the local cluster,
- * - to configure and activate the TICK timer for a given core in the local cluster,
- * - to allows the software to send an IPI to any core in any cluster. 
- * This API is detailed below, and must be implemented by all PIC implementations.
- *
- * In each cluster, a PIC implementation specific structure can be linked to the
- * cluster manager or to the core descriptors to register the interrupt vectors
- * used by the kernel to select the relevant ISR when an interrupt is received 
- * by a given core in a given cluster.
- 
- * This PIC device does not execute itself I/O operations. It is just acting as a 
- * configurable interrupt router for I/O operation executed by other peripherals.
- * Therefore, ALMOS-MKH does not use the PIC device waiting queue, does not creates
- * a server thread for the PIC device, and does not register the command in the calling 
- * thread descriptor, but call directly the relevant driver function.
+ * This external peripheral does not execute I/O operations, but is just acting as a 
+ * dynamically configurable interrupt router for another I/O operation. Therefore, 
+ * ALMOS-MKH does not use the PIC device waiting queue, but call directly the relevant 
+ * driver blocking functions to dynamically "bind" or "unbind" an external IRQ to a
+ * WTI mailbox.
  ****************************************************************************************/
  
-/****  Forward declarations  ****/
-
-struct chdev_s;
-
 /*****************************************************************************************
- * This defines the specific extension for the PIC chdev descriptor.
- * It contains the function pointers for all functions that mus be implemented
- * by all implementation specific drivers. 
+ * This defines the (implementation independant) extension for the generic ICU device.
  ****************************************************************************************/
 
-typedef void   (bind_irq_t)     ( lid_t lid , struct chdev_s * src_chdev );
-typedef void   (enable_irq_t)   ( lid_t lid , xptr_t src_chdev_xp );
-typedef void   (disable_irq_t)  ( lid_t lid , xptr_t src_chdev_xp );
-typedef void   (enable_timer_t) ( uint32_t period );
-typedef void   (enable_ipi_t)   ( void );
-typedef void   (send_ipi_t)     ( cxy_t cxy , lid_t lid );
-typedef void   (ack_ipi_t)      ( void );
-typedef void   (extend_init_t)  ( uint32_t * lapic_base );
-  
 typedef struct pic_extend_s
 {
-    bind_irq_t      * bind_irq;      /*! pointer on the driver "bind_irq" function      */ 
-    enable_irq_t    * enable_irq;    /*! pointer on the driver "enable_irq" function    */ 
-    disable_irq_t   * disable_irq;   /*! pointer on the driver "disable_irq" function   */ 
-    enable_timer_t  * enable_timer;  /*! pointer on the driver "enable_timer" function  */
-    enable_ipi_t    * enable_ipi;    /*! pointer on the driver "enable_ipi" function    */
-    send_ipi_t      * send_ipi;      /*! pointer on the driver "send_ipi" function      */
-    ack_ipi_t       * ack_ipi;       /*! pointer on the driver "ack_ipi" function       */
-    extend_init_t   * extend_init;   /*! pointer on the driver "init_extend" function   */
+    uint32_t    irq_nr;     /*! actual number of input IRQs to the PIC device           */
 }
 pic_extend_t;
 
 /*****************************************************************************************
- * This structure defines the input IRQS for the external IOPIC controller, that is used 
- * by external peripherals (IOC, NIC, TXT, etc.) to signal completion of an I/O operation.
- * It describes the hardware wiring of IRQs between external peripherals and the IOPIC,
- * as each entry contains the input IRQ index in IOPIC. 
- * For a multi-channels/multi_IRQ peripheral, there is one chdev per IRQ.
- * This structure is replicated in each cluster. It is allocated as a global variable
- * in the kernel_init.c file.
- *****************************************************************************************/
-
-typedef struct iopic_input_s
-{
-    uint32_t   ioc[CONFIG_MAX_IOC_CHANNELS];
-    uint32_t   txt_rx[CONFIG_MAX_TXT_CHANNELS];
-    uint32_t   txt_tx[CONFIG_MAX_TXT_CHANNELS];
-    uint32_t   nic_rx[CONFIG_MAX_NIC_CHANNELS];
-    uint32_t   nic_tx[CONFIG_MAX_NIC_CHANNELS];
-    uint32_t   iob;
-}
-iopic_input_t;
-
-/******************************************************************************************
- * This structure defines the input IRQS for the internal LAPIC controllers, that are used
- * by internal peripherals IRQS (DMA, MMC) to signal completion of an I/O operation. 
- * It describes the hardware wiring of IRQs between internal peripherals and ICU, 
- * as each entry contains the input IRQ index in the LAPIC component.
- * For a multi-channels peripheral, there is one chdev and one IRQ per channel.
- * This structure is replicated in each cluster. It is allocated as a global variable
- * in the kernel_init.c file.
- *****************************************************************************************/
-
-typedef struct lapic_input_s
-{
-    uint32_t   dma[CONFIG_MAX_DMA_CHANNELS];
-    uint32_t   mmc;                             // MMC is single channel
-    uint32_t   mtty;                            // Multi Tty (backup tty in cluster 0)
-    uint32_t   sdcard;                          // SD card on cluster 00
-}
-lapic_input_t;
-
-/*****************************************************************************************
- * This enum defines the various implementations of the PIC device.
+ * This enum defines the various implementations of the PIC external interrupt controller.
  * This array must be kept consistent with the define in arch_info.h file
  ****************************************************************************************/
@@ -153,5 +65,5 @@
 enum pic_impl_e
 {
-    IMPL_PIC_SCL =   0,     
+    IMPL_PIC_SOC =   0,     
     IMPL_PIC_I86 =   1,
 }
@@ -159,97 +71,34 @@
 
 /*****************************************************************************************
- * This function makes two initialisations :
- * - It initializes the PIC specific fields of the chdev descriptor.
- * - it initializes the implementation specific PIC hardware registers.
- * It is executed once in cluster containing the PIC chdev, during kernel initialisation.
- * The calling core goes to sleep in case of failure.
+ * This function makes two initialisations:
+ * - It initializes the PIC specific fields of the device descriptor.
+ * - it initializes the implementation specific PIC hardware device.
+ * It must be executed once in the kernel initialisation phase.
  *****************************************************************************************
- * @ pic        : local pointer on PIC device descriptor.
+ * @ xp_dev     : extended pointer on PIC device descriptor.
+ * @ uint32_t   : actual number of input IRQs.
  ****************************************************************************************/
-void dev_pic_init( struct chdev_s * pic );
+void dev_pic_init( xptr_t   xp_dev,
+                   uint32_t irq_nr );
 
 /*****************************************************************************************
- * This function completes the PIC infrastructure initialisation in each cluster.
- * It allocates memory for the local PIC extensions in the core descriptors and/or
- * in the cluster manager, as required by the specific PIC implementation.
- * This function is called by CPO in all clusters, during kernel initialisation phase.
- * The calling core goes to sleep in case of failure.
+ * This function link a WTI mailbox to the PIC input IRQ identified by its index,
+ * and unmask the selected input IRQ, calling the relevant driver.
  *****************************************************************************************
- * @ lapic_base  : local pointer on LAPIC component segment base.
+ * @ irq_id    : input IRQ index.
+ * @ cxy       : WTI mailbox cluster.
+ * @ wti_id    : WTI mailbox index in cluster.
  ****************************************************************************************/
-void dev_pic_extend_init( uint32_t * lapic_base );
+void dev_pic_bind_irq( uint32_t   irq_id,
+                       cxy_t      cxy,
+                       uint32_t   wti_id );
 
 /*****************************************************************************************
- * This function configure the PIC device to route the IRQ generated by a local chdev,
- * defined by the <src_chdev> argument, to a local core identified by the <lid> argument.
- * This is a static binding, defined during kernel init: IRQ can be enabled/disabled,
- * but the binding cannot be released. It can be used for both internal & external IRQs.
- * The configuration is actually done by the - implementation specific - driver,
- * and this function just call the relevant driver.
- * WARNING : the IRQ must be explicitely enabled by the dev_pic_enable_irq() function.
+ * This function mask a PIC input IRQ identified by its index, calling te relevant driver.
  *****************************************************************************************
- * @ lid        : target core local index.
- * @ src_chdev  : local pointer on source chdev descriptor.
+ * @ irq_id    : input IRQ index.
  ****************************************************************************************/
-void dev_pic_bind_irq( lid_t            lid,
-                       struct chdev_s * src_chdev );
-
-/*****************************************************************************************
- * This function enables the IRQ generated by a remote chdev, defined by the 
- * <src_chdev_xp> argument. It can be called by any thread running in any cluster,
- * and can be used for both internal & external IRQs.
- *****************************************************************************************
- * @ lid           : target core local index (in cluster containing the source chdev).
- * @ src_chdev_xp  : extended  pointer on source chdev descriptor.
- ****************************************************************************************/
-void dev_pic_enable_irq( lid_t   lid,
-                         xptr_t  src_chdev_xp );
-
-/*****************************************************************************************
- * This function disables remote IRQ generated by a remote chdev, defined by the 
- * <src_chdev_xp> argument. It can be called by any thread running in any cluster,
- * and can be used for both INT_IRq & EXT_IRQ.
- *****************************************************************************************
- * @ lid           : target core local index (in cluster containing the source chdev).
- * @ src_chdev_xp  : extended pointer on sour chdev descriptor.
- ****************************************************************************************/
-void dev_pic_disable_irq( lid_t   lid,
-                          xptr_t  src_chdev_xp );
-
-/*****************************************************************************************
- * This function activates the TIM_IRQ for the calling core.
- * The <period> argument is a number of milli-seconds between two successive IRQs.
- * It is converted to a number of cycles by the PIC driver implementation.
- *****************************************************************************************
- * @ period      : number of milliseconds.
- ****************************************************************************************/
-void dev_pic_enable_timer( uint32_t period );
-
-/*****************************************************************************************
- * This function activates the IPI_IRQ for the calling core.
- ****************************************************************************************/
-void dev_pic_enable_ipi( void );
-
-/*****************************************************************************************
- * This function allows the calling thread to send an IPI to any core in any cluster.
- * The target core is identified by the <cxy> & <lid> arguments.
- *****************************************************************************************
- * @ cxy        : target core cluster.
- * @ lid        : target core local index.
- ****************************************************************************************/
-void dev_pic_send_ipi( cxy_t  cxy,
-                       lid_t  lid );
-
-/*****************************************************************************************
- * This function acknowledges the IPI identified by the calling core local index,
- * in the local LAPIC component.
- ****************************************************************************************/
-void dev_pic_ack_ipi( void );
-
-/*****************************************************************************************
- * This debug function displays the content of the iopic_input structure,
- * that register the input IRQS for the external IOPIC controller.
- ****************************************************************************************/
-void dev_pic_inputs_display( void );
+void dev_pic_unbind_irq( uint32_t   irq_id );
+                        
 
 #endif  /* _DEV_PIC_H_ */
Index: trunk/kernel/devices/dev_txt.c
===================================================================
--- trunk/kernel/devices/dev_txt.c	(revision 690)
+++ trunk/kernel/devices/dev_txt.c	(revision 1)
@@ -1,6 +1,6 @@
 /*
  * dev_txt.c - TXT (Text Terminal) generic device API implementation.
- *
- * Author  Alain Greiner    (2016,2017,2018,2019)
+ * 
+ * Author  Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,11 +22,9 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <hal_remote.h>
-#include <hal_drivers.h>
+#include <soclib_tty.h>
 #include <thread.h>
-#include <remote_busylock.h>
-#include <chdev.h>
 #include <rpc.h>
 #include <printk.h>
@@ -37,99 +35,185 @@
 /////////////////////////////////////////////////////////////////////////////////////////
 
-extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
-
-
-#if (DEBUG_SYS_READ & 1)
-extern uint32_t enter_txt_read;
-extern uint32_t exit_txt_read;
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-extern uint32_t enter_txt_write;
-extern uint32_t exit_txt_write;
-#endif
-
-///////////////////////////////////////////////////
-const char * dev_txt_type_str( dev_txt_cmd_t type )
-{
-    switch (type)
-    {
-        case (TXT_SYNC_WRITE): return "TXT_SYNC_WRITE";
-        case (TXT_READ):       return "TXT_READ";
-        case (TXT_WRITE):      return "TXT_WRITE";
-        default:               return "undefined";
-    }
-}
+extern devices_directory_t  devices_dir;         // allocated in kernel_init.c
+
+extern devices_input_irq_t  devices_input_irq;   // allocated in kernel_init.c
 
 //////////////////////////////////
-void dev_txt_init( chdev_t * txt )
-{
-    // For all TXT channels other than the TXT0 (kernel terminal), 
-    // the PIC chdev must be initialized before the TXT chdev, because
-    // the TXT chdev initialization requires the routing of an external IRQ
-
-    xptr_t    pic_xp  = chdev_dir.pic;
-    uint32_t  channel = txt->channel;
-    uint32_t  impl    = txt->impl;
-    bool_t    is_rx   = txt->is_rx;
-
-assert( __FUNCTION__, ((pic_xp != XPTR_NULL) || (channel == 0)) ,
-"PIC not initialised before TXT" );
-
-    // set chdev name
-    if( is_rx ) snprintk( txt->name , 16 , "txt%d_rx" , channel );
-    else        snprintk( txt->name , 16 , "txt%d_tx" , channel );
-
-    // set TXT chdev extension
-    txt->ext.txt.owner_xp = XPTR_NULL;
-    xlist_root_init( XPTR( local_cxy, &txt->ext.txt.root ) );
-    remote_busylock_init( XPTR( local_cxy , &txt->ext.txt.lock ), LOCK_CHDEV_TXTLIST );
+void dev_txt_init( xptr_t  dev_xp )
+{
+    // get device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get implementation index from device descriptor
+    uint32_t  impl = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->impl ) );
+
+    // get channel index from device descriptor
+    // uint32_t  channel = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->channel ) );
+
+    // set fields "cmd", "isr", and "name" in device descriptor
+    // and call implementation specific init function
+
+    // TODO replace fixed "TXT_TTY" name by a channel indexed "TXT_TTY%d" name
+    // as soon as the sprintk() function is available
+
+    if( impl == IMPL_TXT_TTY )
+    {
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->cmd ) , &soclib_tty_command );
+        hal_remote_spt( XPTR( dev_cxy , &dev_ptr->isr ) , &soclib_tty_isr );
+        // sprintk( name , "TXT_TTY%d" , channel )
+        hal_remote_memcpy( XPTR( dev_cxy , &dev_ptr->name ),
+                           XPTR( local_cxy , "TXT_TTY" ) , 16 );
+        soclib_tty_init( dev_xp );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s: undefined TXT device implementation\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // create server thread
+    xptr_t     new_thread_xp;
+    thread_t * new_thread_ptr;
+    error_t    error;
+
+    if( dev_cxy == local_cxy )         // device cluster is local
+    {
+        error = thread_kernel_create( &new_thread_ptr,
+                                      THREAD_DEV,
+                                      &dev_txt_server,
+                                      dev_ptr,
+                                      cluster_select_local_core() );
+ 
+        new_thread_xp = XPTR( local_cxy , new_thread_ptr );
+    }
+    else                                        // device cluster is remote
+    {
+        rpc_thread_kernel_create_client( dev_cxy,
+                                         THREAD_DEV,
+                                         &dev_txt_server,
+                                         dev_ptr,
+                                         &new_thread_xp,
+                                         &error );
+
+        new_thread_ptr = (thread_t *)GET_PTR( new_thread_xp );
+    }
+    if( error )
+    {
+        printk("\n[PANIC] in %s : cannot create server thread\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialises server field in device descriptor
+    hal_remote_spt( XPTR( dev_cxy , &dev_ptr->server ) , new_thread_ptr );
     
-    // call driver init function
-    hal_drivers_txt_init( txt );
-
-    // no server thread and no IRQ routing for TXT0 
-    // except for LETI where there MUST be IRQ routing
-    // no server thread for IMPL_TXT_RS2 (multiplexed in software, not hardware)
-    if( channel != 0 && impl != IMPL_TXT_RS2 )
-    {
-        // select a core to execute the server thread
-        lid_t lid = cluster_select_local_core( local_cxy );
-
-        // The unique IRQ from cluster 00's MTTY must be bound to a RX chdev
-        // so that all IRQs are considered as RX IRQs and treated as such
-        // Indeed, IRQs are raised by the MTTY only on user keystroke, so IRQs must
-        // always be considered as RX IRQs.
-        if ( ( impl != IMPL_TXT_MTY ) || ( channel == 1 && is_rx == 1 ) ) 
+    // start server thread
+    thread_unblock( new_thread_xp , THREAD_BLOCKED_GLOBAL );
+
+} // end dev_txt_init()
+
+
+//////////////////////////////////////////////////////////////////////////////////
+// This static function is called by dev_txt_read(), dev_txt_write(), and
+// dev_txt_sync_write() functions. 
+// For the TXT_READ and TXT_WRITE operation types:
+//  - it build the command, and registers it in the calling thread descriptor. 
+//  - then, it registers the calling thead in device waiting queue.
+//  - finally, it blocks on the THREAD_BLOCKED_DEV condition and deschedule.
+// For the TXT_SYNC_WRITE operation type:
+//  - it directly call the relevant driver, using a busy waiting policy.
+////////////////////////////////////i/////////////////////////////////////////////
+static error_t dev_txt_access( uint32_t   type,
+                               uint32_t   channel,
+                               char     * buffer,
+                               uint32_t   count )
+{
+    thread_t * this = CURRENT_THREAD;
+
+    txt_dmsg("\n[INFO] in %s : thread %x in process %x enters\n", 
+                 __FUNCTION__ , this->trdid , this->process->pid );
+
+    // check channel argument
+    if( channel >= CONFIG_MAX_TXT_CHANNELS )
+    {
+        printk("\n[PANIC] in %s : illegal channel index = %d\n", __FUNCTION__ , channel );
+        hal_core_sleep();
+    }
+
+    // get extended pointer on remote TXT device descriptor
+    xptr_t  dev_xp = devices_dir.txt[channel];
+
+    if ( dev_xp == XPTR_NULL )
+    {
+        printk("\n[PANIC] in %s : undefined TXT device descriptor for channel %d\n",
+               __FUNCTION__ , channel );
+        hal_core_sleep();
+    }
+
+    // register command in calling thread descriptor
+    this->dev.txt.dev_xp  = dev_xp;
+    this->dev.txt.type    = type;
+    this->dev.txt.buf_xp  = XPTR( local_cxy , buffer );
+    this->dev.txt.count   = count;
+
+
+    if( (type == TXT_READ) || (type == TXT_WRITE) )  // descheduling policy
+    {
+        // get a free WTI mailbox  
+        uint32_t wti_id;
+        while( 1 )
         {
-        // bind IRQ to the selected core
-        dev_pic_bind_irq( lid , txt );
-
-        // enable IRQ
-        dev_pic_enable_irq( lid , XPTR( local_cxy , txt ) );
+            wti_id = dev_icu_wti_alloc();
+            if( wti_id == -1 )  sched_yield();
+            else                break;
         }
 
-        // create server thread
-        thread_t * new_thread;
-        error_t    error;
-
-        error = thread_kernel_create( &new_thread,
-                                      THREAD_DEV,
-                                      &chdev_server_func,
-                                      txt,
-                                      lid );
-
-        assert( __FUNCTION__, (error == 0) , "cannot create server thread" );
-
-        // set "server" field in chdev descriptor
-        txt->server = new_thread;
-
-        // set "chdev" field in thread descriptor
-        new_thread->chdev = txt;
-
-        // unblock server thread
-        thread_unblock( XPTR( local_cxy , new_thread ) , THREAD_BLOCKED_GLOBAL );
-    }
-}  // end dev_txt_init()
+        // enable WTI IRQ in local ICU and update WTI interrupt vector
+        dev_icu_enable_irq( local_cxy , CURRENT_CORE->lid , WTI_TYPE , wti_id , dev_xp );
+
+        // link TXT IRQ to WTI mailbox in PIC component 
+        uint32_t irq_id = devices_input_irq.txt[channel];
+        dev_pic_bind_irq( irq_id , local_cxy , wti_id );
+
+        // register client thread in waiting queue, activate server thread
+        // block client thread on THREAD_BLOCKED_IO and deschedule.
+        // it is re-activated by the ISR signaling IO operation completion.
+        device_register_command( dev_xp , this );
+
+        // access PIC to unlink the IOC IRQ
+        dev_pic_unbind_irq( irq_id );
+
+        // disable WTI IRQ in ICU and update interrupt vector
+        dev_icu_disable_irq( local_cxy , CURRENT_CORE->lid , WTI_TYPE , wti_id );
+
+        // release  WTI mailbox
+        dev_icu_wti_release( wti_id );
+
+        txt_dmsg("\n[INFO] in %s : thread %x in process %x completes / error = %d\n", 
+                     __FUNCTION__ , this->trdid , this->process->pid , this->dev.txt.error );
+    }
+    else if( type == TXT_SYNC_WRITE )            // busy waiting policy
+    {
+        // get driver command function pointer from remote TXT device descriptor
+        cxy_t       dev_cxy = GET_CXY( dev_xp );
+        device_t  * dev_ptr = (device_t *)GET_PTR( dev_xp );
+        dev_cmd_t * cmd = (dev_cmd_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->cmd ) );
+
+        // take the TXT device lock, because the calling thread does NOT
+        // register in device waiting queue for this synchronous command,
+        // and has exclusive access to the terminal...
+        remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+ 
+        // call directly driver command 
+        cmd( XPTR( local_cxy , this ) );
+
+        // release the TXT device lock
+        remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+    }    
+
+    // return I/O operation status from calling thread descriptor
+    return this->dev.txt.error;  
+
+}  // end dev_txt_access()
 
 /////////////////////////////////////////
@@ -138,182 +222,71 @@
                        uint32_t   count )
 {
-    error_t error;
-
-#if (DEBUG_SYS_WRITE & 1)
-enter_txt_write = hal_time_stamp();
-#endif
-
-    thread_t * this = CURRENT_THREAD;
-
-#if DEBUG_DEV_TXT_TX
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_TXT_TX < cycle )
-printk("\n[%s] thread[%x,%x] enters for <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, buffer, cycle );
-#endif
-
-// check channel argument
-assert( __FUNCTION__, (channel < CONFIG_MAX_TXT_CHANNELS) , "illegal channel index" );
-
-    // get pointers on chdev
-    xptr_t    dev_xp  = chdev_dir.txt_tx[channel];
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-
-// check dev_xp 
-assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "undefined TXT chdev descriptor" );
-
-    // If we use MTTY (vci_multi_tty), we do a synchronous write on TXT[0]
-    // If we use TTY  (vci_tty_tsar), we do a standard asynchronous write
-    // TODO this is not very clean ... [AG]
-
-    if( dev_ptr->impl == IMPL_TXT_MTY )  
-    {
-        // get driver command function
-        dev_aux_t * aux = (dev_aux_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->aux ) );
-
-        // build arguments structure
-        txt_sync_args_t  args;
-        args.dev_xp = dev_xp;
-        args.buffer = buffer;
-        args.count  = count;
-        args.channel = channel;
-
-        // call directly the driver function
-        aux( &args );
-
-        error = 0;
-    }
-    else
-    {
-        // register command in calling thread descriptor
-        this->txt_cmd.dev_xp  = dev_xp;
-        this->txt_cmd.type    = TXT_WRITE;
-        this->txt_cmd.buf_xp  = XPTR( local_cxy , buffer );
-        this->txt_cmd.count   = count;
-
-        // register client thread in waiting queue, activate server thread
-        // block client thread on THREAD_BLOCKED_IO and deschedule.
-        // it is re-activated by the ISR signaling IO operation completion.
-        chdev_register_command( dev_xp );
-
-        // get I/O operation status from calling thread descriptor
-        error = this->txt_cmd.error;
-
-        if( error )
-        {
-            printk("\n[ERROR] in %s : cannot write string %s / cycle %d\n",
-            __FUNCTION__, buffer, (uint32_t)hal_get_cycles() );
-        }
-    }
-
-#if DEBUG_DEV_TXT_TX
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_TXT_TX < cycle )
-printk("\n[%s] thread[%x,%x] exit /  cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-exit_txt_write = hal_time_stamp();
-#endif
-
-    return error;
-
-}  // end dev_txt_write()
-
+    return dev_txt_access( TXT_WRITE , channel , buffer , count );
+}
+ 
+///////////////////////////////////////////////
+error_t dev_txt_sync_write( uint32_t   channel,
+                            char     * buffer,
+                            uint32_t   count )
+{
+    return dev_txt_access( TXT_SYNC_WRITE , channel , buffer , count );
+}
+ 
 /////////////////////////////////////////
 error_t dev_txt_read( uint32_t   channel,
                       char     * buffer )
 {
-    error_t error;
-
-#if (DEBUG_SYS_READ & 1)
-enter_txt_read = hal_time_stamp();
-#endif
-
-    thread_t * this = CURRENT_THREAD;
-
-#if DEBUG_DEV_TXT_RX
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_TXT_RX < cycle )
-printk("\n[%s] thread[%x,%x] enters / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-// check channel argument
-assert( __FUNCTION__, (channel < CONFIG_MAX_TXT_CHANNELS) , "illegal channel index" );
-
-    // get pointers on chdev
-    xptr_t    dev_xp  = chdev_dir.txt_rx[channel];
-
-// check dev_xp 
-assert( __FUNCTION__, (dev_xp != XPTR_NULL) , "undefined TXT chdev descriptor" );
-
-    // register command in calling thread descriptor
-    this->txt_cmd.dev_xp  = dev_xp;
-    this->txt_cmd.type    = TXT_READ;
-    this->txt_cmd.buf_xp  = XPTR( local_cxy , buffer );
-    this->txt_cmd.count   = 1;
-
-    // register client thread in waiting queue, activate server thread
-    // block client thread on THREAD_BLOCKED_IO and deschedule.
-    // it is re-activated by the ISR signaling IO operation completion.
-    chdev_register_command( dev_xp );
-
-    // get I/O operation status from calling thread descriptor
-    error = this->txt_cmd.error;
-
-    if( error )
-    {
-         printk("\n[ERROR] in %s : cannot write string %s / cycle %d\n",
-         __FUNCTION__, buffer, (uint32_t)hal_get_cycles() );
-    }
-
-#if DEBUG_DEV_TXT_RX
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEV_TXT_RX < cycle )
-printk("\n[%s] thread[%x,%x] get character <%c> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, *buffer, cycle );
-#endif
-
-#if (DEBUG_SYS_READ & 1)
-exit_txt_read = hal_time_stamp();
-#endif
-
-    return error;
-
-}  // end dev_txt_read()
-
-////////////////////////////////////////////////
-error_t dev_txt_sync_write( const char * buffer,
-                            uint32_t     count )
-{
-    // get extended pointers on TXT[0] chdev
-    xptr_t    dev_xp  = chdev_dir.txt_tx[0];
-    cxy_t     dev_cxy = GET_CXY( dev_xp );
-    chdev_t * dev_ptr = GET_PTR( dev_xp );
-
-    if( dev_xp != XPTR_NULL) 
-    {
-        // get driver command function
-        dev_aux_t * aux = (dev_aux_t *)hal_remote_lpt( XPTR( dev_cxy , &dev_ptr->aux ) );
-
-        // build arguments structure
-        txt_sync_args_t  args;
-        args.dev_xp = dev_xp;
-        args.buffer = buffer;
-        args.count  = count;
-        args.channel = 0;
-
-        // call driver function
-        aux( &args );
-
-        return 0;
-    }
-    else
-    {
-        return -1;
-    }
-}   // end dev_txt_sync_write() 
-
+    return dev_txt_access( TXT_READ , channel , buffer , 1 );
+}
+
+/////////////////////////////////////
+void dev_txt_server( device_t * dev )
+{
+    xptr_t          client_xp;    // extended pointer on waiting thread
+    cxy_t           client_cxy;   // cluster of client thread
+    thread_t      * client_ptr;   // local pointer on client thread
+    thread_t      * server;       // local pointer on server thread
+    xptr_t          root_xp;      // extended pointer on device waiting queue root
+
+    server = CURRENT_THREAD;
+
+    root_xp = XPTR( local_cxy , &dev->wait_root );
+
+	// infinite loop handling commands of threads 
+    // registered in the TXT waiting queue
+    while( 1 )
+    {
+        // get lock protecting queue
+        remote_spinlock_lock( XPTR( local_cxy , &dev->wait_lock ) );
+
+        // block and deschedule server thread if waiting queue empty 
+        if( xlist_is_empty( root_xp ) )
+        {
+            thread_block( server , THREAD_BLOCKED_DEV_QUEUE );
+            remote_spinlock_unlock( XPTR( local_cxy , &dev->wait_lock ) );
+            sched_yield();
+        }
+        else
+        {
+            remote_spinlock_unlock( XPTR( local_cxy , &dev->wait_lock ) );
+        } 
+
+        // get extended pointer on first client thread
+        client_xp = XLIST_FIRST_ELEMENT( root_xp , thread_t , wait_list );
+
+        // call driver command function to start I/O operation
+        dev->cmd( client_xp );
+        
+        // get client thread cluster and local pointer
+        client_cxy = GET_CXY( client_xp );
+        client_ptr = (thread_t *)GET_PTR( client_xp );
+
+        // remove the client thread from waiting queue
+        remote_spinlock_lock( XPTR( local_cxy , &dev->wait_lock ) );
+        xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) );
+        remote_spinlock_unlock( XPTR( local_cxy , &dev->wait_lock ) );
+
+    }  // end while
+
+}  // end dev_txt_server()
+
Index: trunk/kernel/devices/dev_txt.h
===================================================================
--- trunk/kernel/devices/dev_txt.h	(revision 690)
+++ trunk/kernel/devices/dev_txt.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
  * dev_txt.h - TXT (Text Terminal) generic device API definition.
- *
- * Author  Alain Greiner    (2016,2017,2018,2019))
+ * 
+ * Author  Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,40 +25,23 @@
 #define _DEV_TXT_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <xlist.h>
-#include <remote_busylock.h>
+#include <almos_config.h>
+#include <hal_types.h>
 
 /****  Forward declarations  ****/
 
-struct chdev_s ;
+struct device_s ;
 
 /******************************************************************************************
  *     Generic Text Terminal device definition.
  *
- * This multi-channels generic TXT device provides access to a text terminal.
- *
- * It supports two operations that must be implemented by the driver cmd() function:
+ * This multi-channels generic TXT device provide access to a text terminal.
+ * It supports three operation types :
  * - TXT_READ : read a single character from the text terminal identified by its channel
  *   index, using a descheduling strategy for the calling thread.
  * - TXT_WRITE : write a character string to the text terminal identified by its channel
  *   index, using a descheduling strategy for the calling thread.
- *
- * It supports one operation, that must be implemented by the driver aux() function  
- * - TXT_SYNC_WRITE write a character string to the TXT0 kernel terminal, using a busy 
- *   waiting strategy for the calling thread. 
+ * - TXT_SYNC_WRITE : write a character string to the terminal identified by its channel
+ *   index, using a busy waiting strategy for the calling thread. 
  *****************************************************************************************/
-
-/******************************************************************************************
- * This defines the (implementation independant) extension for the generic TXT device.
- *****************************************************************************************/
-
-typedef struct txt_extend_s
-{
-    xptr_t            owner_xp;  /*! ext. pointer on current process owner (reference)   */
-    xlist_entry_t     root;      /*! root of list of processes attached to same TXT      */
-    remote_busylock_t lock;      /*! lock protecting this list                           */
-}
-txt_extend_t;
 
 /******************************************************************************************
@@ -69,25 +52,24 @@
 enum txt_impl_e
 {
-    IMPL_TXT_TTY =   0,
-    IMPL_TXT_RS2 =   1,
-    IMPL_TXT_MTY =   2,
+    IMPL_TXT_TTY =   0,     
+    IMPL_TXT_X86 =   1,  
 }
 txt_impl_t;
 
 /******************************************************************************************
- * This defines the arguments passed to the driver CMD function.
+ * This defines the (implementation independant) command passed to the driver.
  *****************************************************************************************/
 
-typedef enum
+enum
 {
     TXT_READ       = 0,
     TXT_WRITE      = 1,
     TXT_SYNC_WRITE = 2,
-} dev_txt_cmd_t;
+};
 
 typedef struct txt_command_s
 {
     xptr_t      dev_xp;    /*! extended pointer on the relevant TXT device descriptor    */
-    uint32_t    type;      /*! TXT_READ / TXT_WRITE                                      */
+    uint32_t    type;      /*! TXT_READ / TXT_WRITE / TXT_SYNC_WRITE                     */
     xptr_t      buf_xp;    /*! extended pointer on characters array                      */
     uint32_t    count;     /*! number of characters in buffer (must be 1 if to_mem)      */
@@ -97,42 +79,23 @@
 
 /******************************************************************************************
- * This defines the arguments passed to the driver AUX function.
- * This function implement the TXT_SYNC_WRITE operation.
+ * This function completes the TXT device descriptor initialisation,
+ * namely the link with the implementation specific driver.
+ * The func, impl, channel, is_rxt, base, and size fields must be previously initialised.
+ * It calls the specific driver initialisation function, to initialise the hardware
+ * device and the driver specific data structures when required.
+ * It creates the associated server thread.
+ * It can be executed in another cluster than cluster containing the device descriptor
+ * or the hardware device itself.
+ ******************************************************************************************
+ * @ xp_dev     : extended pointer on TXT device descriptor.
  *****************************************************************************************/
-
-typedef struct txt_sync_args_s
-{
-    xptr_t       dev_xp;    /*! extended pointer on the TXT0_TX device descriptor        */
-    const char * buffer;    /*! local pointer on characters array                        */
-    uint32_t     count;     /*! number of characters in buffer                           */
-    uint32_t     channel;   /*! channel, aka which tty to write to                       */
-}
-txt_sync_args_t;
+void dev_txt_init( xptr_t xp_dev );
 
 /******************************************************************************************
- * This function returns a printable string for the command type.
- ******************************************************************************************
- * @ type     : command type (TXT_READ / TXT_WRITE / TXT_SYNC_WRITE)
- *****************************************************************************************/
-const char * dev_txt_type_str( dev_txt_cmd_t type );
-
-/******************************************************************************************
- * This function completes the TXT chdev descriptor initialisation,
- * namely the link with the implementation specific driver.
- * The func, impl, channel, is_rxt, base fields have been previously initialised.
- * It calls the specific driver initialisation function, to initialise the hardware
- * device and the driver specific data structures when required.
- * It creates the associated server thread and allocates a WTI from local ICU.
- * It must be executed by a thread running in cluster containing the chdev descriptor.
- ******************************************************************************************
- * @ chdev     : local pointer on TXT device descriptor.
- *****************************************************************************************/
-void dev_txt_init( struct chdev_s * chdev );
-
-/******************************************************************************************
- * This blocking function reads a single character from the terminal identified
+ * This blocking function read a single character from the terminal identified
  * by the "channel" argument. The corresponding request is actually registered in the
- * chdev requests queue, and the calling thread is descheduled, blocked until
- * transfer completion. It can be called by any thread running in any cluster.
+ * device pending requests queue, and the calling thread is descheduled, blocked until
+ * transfer completion.
+ * It must be called in the client cluster.
  ******************************************************************************************
  * @ channel   : TXT channel index.
@@ -144,8 +107,9 @@
 
 /******************************************************************************************
- * This blocking function writes characters on the terminal identified
+ * This blocking function writes a character string on the terminal identified
  * by the "channel" argument. The corresponding request is actually registered in the
- * chdev requests queue, and the calling thread is descheduled, blocked until
- * transfer completion. It can be called by any thread running in any cluster.
+ * device pending requests queue, and the calling thread is descheduled, blocked until
+ * transfer completion.
+ * It must be called in the client cluster.
  ******************************************************************************************
  * @ channel   : TXT channel index.
@@ -158,18 +122,35 @@
                        uint32_t        count );
 
-/***************************************************************************************
- * This blocking function is used by the kernel to display a string on the TXT0
- * terminal, without descheduling the calling thread, without registering it
- * in the TXT0 device waiting queue, without using the TXT0 irq, and without
- * interfering with another possible TXT access to another terminal.
- * As it is used for debug, the command arguments <buffer> and <count> are registerd
- * in a specific "txt_sync_args_t" structure passed to the driver "aux" function.
+ /***************************************************************************************
+ * This low-level blocking function is used by the kernel to display one character on a 
+ * given TXT channel without descheduling the calling thread,  without registering it 
+ * in the TXT device waiting queue, and without using the TXT irq. 
  ****************************************************************************************
+ * @ channel   : TXT channel index.
  * @ buffer    : local pointer on source buffer containing the string.
  * @ count     : number of characters.
  * @ returns 0 if success / returns EINVAL if error.
  ***************************************************************************************/
-error_t dev_txt_sync_write( const char     * buffer,
-                            uint32_t         count );
+error_t dev_txt_sync_write( uint32_t   channel,
+                            char     * buffer,
+                            uint32_t   count );
+
+/******************************************************************************************
+ * This function is executed by the server thread associated to the TXT device descriptor.
+ * This thread is created and lauched by the dev_txt_init() function, and is used
+ * by the TXT_READ and TXT_WRITE operation types. It executes an infinite loop to handle
+ * sequencially all commands registered by the client threads in the device waiting queue.
+ *  
+ * The driver CMD function is blocking, and returns only when the command is completed.
+ * can use a busy waiting policy, or block the server thread on the THREAD_BLOCKED_IO_ISR
+ * condition and deschedule, using the ISR to reactivate the server thread.
+ *
+ * When the waiting queue is empty, the server thread blocks on the THREAD_BLOCKED_IO_CMD
+ * condition and deschedule. It is re-activated by a client thread registering a command.
+ ******************************************************************************************
+ * @ dev     : local pointer on device descriptor.
+ *****************************************************************************************/
+void dev_txt_server( struct device_s * dev );
+
 
 #endif	/* _DEV_TXT_H_ */
Index: trunk/kernel/drivers/ibmpc/ata.c
===================================================================
--- trunk/kernel/drivers/ibmpc/ata.c	(revision 1)
+++ trunk/kernel/drivers/ibmpc/ata.c	(revision 1)
@@ -0,0 +1,228 @@
+/*
+ * ata.c - ATA hard disk driver
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <device.h>
+#include <driver.h>
+#include <cpu.h>
+#include <thread.h>
+#include <scheduler.h>
+#include <kmem.h>
+#include <sysio.h>
+#include <string.h>
+#include <event.h>
+#include <cpu-trace.h>
+#include <cpu-io.h>
+#include <ata.h>
+
+#define ATA_BASE(x)  ((x) & 0xFFFF)
+#define ATA_DRIVE(x) ((x) >> 16)
+
+static void ata_start_request(struct device_s *dev, dev_request_t *rq, uint32_t type)
+{
+	uint16_t base  = ATA_BASE((uint32_t)dev->base);
+	uint16_t drive = ATA_DRIVE((uint32_t)dev->base);
+	uint32_t lba   = (uint32_t)rq->src;
+
+	cpu_io_out8(base + ATA_ERROR_REG, 0x00);
+	cpu_io_out8(base + ATA_COUNT_REG, rq->count);
+	cpu_io_out8(base + ATA_LBA_LOW_REG, (uint8_t)lba); 
+	cpu_io_out8(base + ATA_LBA_MID_REG, (uint8_t)(lba >> 8));
+	cpu_io_out8(base + ATA_LBA_HIGH_REG,(uint8_t)(lba >> 16));
+	cpu_io_out8(base + ATA_DRIVE_REG, 0xE0 | (drive << 4) | ((lba >> 24) & 0x0F));
+	cpu_io_out8(base + ATA_CMD_REG, type);
+}
+
+error_t ata_busy_wait(uint_t base)
+{
+	uint_t val;
+	uint_t val2;
+
+	while((val=cpu_io_in8(base + ATA_STATUS_REG)) & ATA_BSY)
+		val ++;
+  
+	val2 = val;
+
+	return val2 - val;
+}
+
+static void ata_finalize_request(struct device_s *dev, dev_request_t *rq, uint32_t type)
+{
+	register uint16_t val;
+	register uint16_t base;
+	register uint_t index;
+	register uint8_t *buffer;  
+	error_t err;
+
+	base = ATA_BASE((uint32_t)dev->base);
+	buffer = (uint8_t*) rq->dst;
+
+	if((err=ata_busy_wait(base)))
+	{
+		printk(ERROR, "ERROR: ata_finalize_request: time out [dev %x, cmd %x, start lba %d, count %d]\n", 
+		       dev->base, 
+		       type, 
+		       (uint32_t)rq->src, 
+		       rq->count);
+
+		return;
+	}
+
+	if(type == ATA_READ_CMD)
+	{
+		for (index = 0; index < 256 * rq->count; index++) 
+		{
+			val = cpu_io_in16(base + ATA_DATA_REG);
+			buffer[index * 2    ] = (uint8_t) val;
+			buffer[index * 2 + 1] = (uint8_t)(val >> 8);
+		}
+		return;
+	}
+  
+	for (index = 0; index < 256 * rq->count; index++) 
+	{
+		val = (buffer[index * 2 + 1] << 8) | buffer[index * 2];
+		cpu_io_out16(base + ATA_DATA_REG, val);
+	}
+}
+
+void __attribute__ ((noinline)) ata_irq_handler(struct irq_action_s *action)
+{
+	register struct device_s *hdd;
+	register struct ata_context_s *ctx;
+	uint16_t base;
+	uint8_t status;
+
+	cpu_trace_write(CURRENT_THREAD->local_cpu, ata_irq_handler);
+
+	hdd = action->dev;
+	base = ATA_BASE((uint32_t)hdd->base);
+	ctx = (struct ata_context_s*)hdd->data;
+
+	status = cpu_io_in8(base + ATA_STATUS_REG); /* IRQ ACK */
+
+	isr_dmsg(INFO, "INFO: Recived irq on DevBlk %x, Drive %d, status %x\n", 
+		 base, 
+		 ATA_DRIVE((uint32_t)hdd->base), 
+		 status);
+}
+
+
+int32_t __attribute__ ((noinline)) ata_request(struct device_s *blk_dev, dev_request_t *rq, uint32_t type)
+{
+	struct ata_context_s *ctx;
+
+	cpu_trace_write(CURRENT_THREAD->local_cpu, ata_request);
+  
+	ctx = (struct ata_context_s*)blk_dev->data;
+
+	if((rq->count + ((uint_t)rq->src)) > ctx->params.blk_count)
+		return -1;
+
+	ata_start_request(blk_dev, rq, type);
+	ata_finalize_request(blk_dev, rq, type);
+
+	return 0;
+}
+
+
+static sint_t ata_read(struct device_s *blk_dev, dev_request_t *rq)
+{
+	return ata_request(blk_dev, rq, ATA_READ_CMD);
+}
+
+
+static sint_t ata_write(struct device_s *blk_dev, dev_request_t *rq)
+{
+	return ata_request(blk_dev, rq, ATA_WRITE_CMD);
+}
+
+
+static sint_t ata_get_params(struct device_s *blk_dev, dev_params_t *params) 
+{
+	struct ata_context_s *ctx = (struct ata_context_s*) blk_dev->data;
+	params->blk.count = ctx->params.blk_count;
+	params->blk.size = ctx->params.blk_size;
+	return 0;
+}
+
+void ibmpc_ata_init(struct device_s *hdd, void *base, uint_t irq)
+{
+	struct ata_context_s *ctx;
+	error_t err;
+	uint_t index;
+	uint16_t *buffer;
+	uint16_t dev_base;
+	uint16_t drive;
+
+	spinlock_init(&hdd->lock);
+	hdd->base = base;
+	hdd->irq = irq;
+	hdd->type = DEV_BLK;
+
+	hdd->action.dev = hdd;
+	hdd->action.irq_handler = &ata_irq_handler;
+	hdd->action.data = NULL;
+
+	strcpy(hdd->name, "BLK-DEV");
+	metafs_init(&hdd->node, hdd->name);
+
+	hdd->op.dev.open = NULL;
+	hdd->op.dev.read = &ata_read;
+	hdd->op.dev.write = &ata_write;
+	hdd->op.dev.close = NULL;
+	hdd->op.dev.lseek = NULL;
+	hdd->op.dev.get_params = &ata_get_params;
+	hdd->op.dev.set_params = NULL;
+
+	ctx = kbootMem_calloc(sizeof(*ctx));
+	list_root_init(&ctx->request_queue);
+	wait_queue_init(&ctx->pending, hdd->name);
+  
+	dev_base = ATA_BASE((uint32_t)base);
+	drive = ATA_DRIVE((uint32_t)base);
+
+	cpu_io_out8(dev_base + ATA_DRIVE_REG, 0xA0 | (drive << 4));
+	cpu_io_out8(dev_base + ATA_CMD_REG, ATA_IDENTIFY_CMD);
+  
+	if((err=ata_busy_wait(dev_base)))
+	{
+		printk(ERROR, "ERROR: ibmpc_ata_init: dev %x, ATA_IDENTIFY_CMD time out\n", dev_base);
+		return;
+	}
+
+	buffer = (uint16_t *)&ctx->params.info;
+
+	for(index = 0; index < 256; index++)
+		buffer[index] = cpu_io_in16(dev_base + ATA_DATA_REG);
+  
+	assert((ctx->params.info.capabilities & ATA_LBA_CAP) && "LBA mode is mandatory");
+  
+	ctx->params.blk_size = 512;
+	ctx->params.blk_count = ctx->params.info.sectors;
+	hdd->data = (void *)ctx;
+	
+	printk(INFO, "INFO: ATA(%x) Drive(%d): (size,count) %d:%d\n", 
+	       dev_base, 
+	       drive, 
+	       ctx->params.blk_size, 
+	       ctx->params.blk_count);
+}
Index: trunk/kernel/drivers/ibmpc/ata.h
===================================================================
--- trunk/kernel/drivers/ibmpc/ata.h	(revision 1)
+++ trunk/kernel/drivers/ibmpc/ata.h	(revision 1)
@@ -0,0 +1,109 @@
+/*
+ * ata.h - ATA interface registers
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _ATA_H_
+#define _ATA_H_
+
+#include <types.h>
+#include <list.h>
+#include <driver.h>
+
+/* ATA Task File offsets */
+#define ATA_DATA_REG	        0
+#define ATA_ERROR_REG	        1
+#define ATA_PRECOMPENSATION_REG	1
+#define ATA_COUNT_REG           2
+#define ATA_LBA_LOW_REG	        3
+#define ATA_LBA_MID_REG	        4
+#define ATA_LBA_HIGH_REG	5
+#define ATA_DRIVE_REG	        6
+#define ATA_STATUS_REG          7
+#define ATA_CMD_REG             7
+
+#define ATA_DOR_PORT         0x3F6
+
+/* ATA Status Register bits */
+#define ATA_ERR              0x01
+#define ATA_IDX              0x02
+#define ATA_CORR             0x04
+#define ATA_DRQ              0x08
+#define ATA_DSC              0x10
+#define ATA_WFT              0x20
+#define ATA_DRDY	     0x40
+#define ATA_BSY	             0x80
+
+
+/* ATA Error Register bits */
+
+/* Block device status */
+#define ATA_IDLE	        0
+#define ATA_BUSY	        1
+#define ATA_READ_SUCCESS	2
+#define ATA_WRITE_SUCCESS	3
+#define ATA_READ_ERROR	        4
+#define ATA_WRITE_ERROR	        5
+#define ATA_ERROR	        6
+
+#define ATA_READ_CMD            0x020
+#define ATA_WRITE_CMD           0x030
+#define ATA_IDENTIFY_CMD        0x0EC
+
+#define ATA_LBA_CAP             0x0100
+
+struct device_s;
+
+struct ata_identify_s
+{
+	uint16_t general;
+	uint16_t geometry[6];
+	uint16_t vendor_id1[3];
+	uint16_t info1[37];
+	uint16_t vendor_id2;
+	uint16_t info2;
+	uint16_t capabilities;
+	uint16_t info3[10];
+	uint32_t sectors;
+	//uint16_t lblock_lo;
+	//uint16_t lblock_hi;
+	uint32_t info4;
+	uint16_t reserved1[64];
+	uint16_t vendor_id3[32];
+	uint16_t reserved2[96];
+} __attribute__ ((packed));
+
+struct ata_params_s
+{
+	uint32_t blk_count;
+	uint32_t blk_size;
+	struct ata_identify_s info;
+};
+
+struct ata_context_s
+{
+	struct list_entry request_queue;
+	struct wait_queue_s pending;
+	struct ata_params_s params;
+};
+
+void ibmpc_ata_init(struct device_s *hdd, void *base, uint_t irq);
+
+#endif /* _ATA_H_ */
Index: trunk/kernel/drivers/ibmpc/pci-bus.h
===================================================================
--- trunk/kernel/drivers/ibmpc/pci-bus.h	(revision 1)
+++ trunk/kernel/drivers/ibmpc/pci-bus.h	(revision 1)
@@ -0,0 +1,79 @@
+/*
+ * pci.c - PCI bus related registers and access functions
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _PCI_BUS_H_
+#define _PCI_BUS_H_
+
+#include <types.h>
+#include <cpu-io.h>
+
+#define PCI_TGT_MAX_CONFIG_SPACE      256
+#define PCI_TGT_MAX_CONFIG_REG        64
+#define PCI_BUS_MAX_NR                255
+#define PCI_BUS_DEV_MAX_NR            32
+#define PCI_DEV_FUNC_MAX_NR           8
+
+#define PCI_CONFIG_ADDR               0xCF8
+#define PCI_CONFIG_DATA               0xCFC
+
+#define PCI_STD_DEV_TYPE              0x00
+#define PCI_BRIDGE_TYPE               0x01
+#define PCI_CARDBUS_BRIDGE_TYPE       0x02
+
+#define PCI_VENDOR_ID                 0x00
+#define PCI_DEVCIE_ID                 0x02
+#define PCI_CMD_REG                   0x04
+#define PCI_STATUS_REG                0x06
+#define PCI_REVISION_ID               0x08
+
+#define PCI_CLASS_ID                  0x0A
+#define PCI_HEADER_TYPE               0x0E
+
+#define PCI_BAR0                      0x10
+#define PCI_BAR1                      0x14
+#define PCI_BAR2                      0x18
+#define PCI_BAR3                      0x1C
+#define PCI_BAR4                      0x20
+#define PCI_BAR5                      0x24
+
+#define PCI_INT_INFO 0x3C
+
+#define pci_mkconfig1_addr(_bus,_dev,_func,_offset)	\
+	((uint32_t)(0x80000000    | ((_bus) << 16) |	\
+		    ((_dev) << 11) | ((_func) << 8) |	\
+		    ((_offset) & 0xfc)))
+
+
+static inline uint16_t pci_config_read(uint_t bus, uint_t slot, uint_t func, uint_t offset)
+{ 
+	uint32_t addr;
+	uint32_t val; 
+
+	addr = pci_mkconfig1_addr(bus,slot,func,offset);
+
+	cpu_io_out32(PCI_CONFIG_ADDR, addr);
+	val = cpu_io_in32(PCI_CONFIG_DATA);
+
+	return val >> ((offset & 3) * 8);
+}
+
+#endif	/* _PCI_BUS_H_ */
Index: trunk/kernel/drivers/ibmpc/pic.c
===================================================================
--- trunk/kernel/drivers/ibmpc/pic.c	(revision 1)
+++ trunk/kernel/drivers/ibmpc/pic.c	(revision 1)
@@ -0,0 +1,153 @@
+/*
+ * pic.h - Programmable Interrupt Controller driver implementation
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
+#include <cpu-io.h>
+#include <kmem.h>
+#include <string.h>
+#include <kdmsg.h>
+#include <pic.h>
+
+#define PIC_PRIMARY_PIO    0x20
+#define PIC_SECONDARY_PIO  0xA0
+
+struct irq_action_s *irq_vector[PIC_IRQ_MAX];
+
+static void pic_set_mask(struct device_s *pic, uint_t mask, uint_t type, uint_t output_irq)
+{
+	switch(type)
+	{
+	case 0:
+		cpu_io_out8(PIC_PRIMARY_PIO + PIC_IMR_REG, ~(mask & 0xFF));
+		break;
+	case 1:
+		cpu_io_out8(PIC_SECONDARY_PIO + PIC_IMR_REG, ~(mask & 0xFF));
+		break;
+	default:
+		printk(ERROR, "ERROR: Un expected mask value, PIC has 16 IRQ line only [ type 0 & 1 ]");
+	}
+}
+
+static uint_t pic_get_mask(struct device_s *icu, uint_t type, uint_t output_irq)
+{
+	register uint_t mask = ~0;
+  
+	switch(type)
+	{
+	case 0:
+		mask = cpu_io_in8(PIC_PRIMARY_PIO + PIC_IMR_REG);
+		break;
+	case 1:
+		mask = cpu_io_in8(PIC_SECONDARY_PIO + PIC_IMR_REG);
+		break;
+	default:
+		printk(ERROR, "ERROR: Un expected mask value, PIC has 16 IRQ line only [ type 0 & 1 ]");
+	}
+  
+	return ((~mask) & 0xFF);
+}
+
+static sint_t pic_get_highest_irq(struct device_s *icu, uint_t type, uint_t output_irq)
+{
+	return -1;
+}
+
+static void pic_default_irq_handler(struct irq_action_s *action)
+{
+	register unsigned int irq_num = (unsigned int) action->data;
+	register unsigned int cpu_id  = cpu_get_id();
+  
+	isr_dmsg(WARNING, "WARNING: No ISR registered handler for IRQ %d on CPU %d\n",irq_num, cpu_id);
+}
+
+static void pic_ICWs()
+{
+	/* ICW1 */
+	cpu_io_out8(PIC_PRIMARY_PIO + PIC_CMD_REG, 0x11); /* Put Primary PIC in Initialization mode with ICW4 enabled */
+	cpu_io_out8(PIC_SECONDARY_PIO + PIC_CMD_REG, 0x11); /* Same ICW1 as Primary */
+
+	/* ICW2 */
+	cpu_io_out8(PIC_PRIMARY_PIO + PIC_DATA_REG, 0x20); /* Set Primary PIC's interrupt vector base number */
+	cpu_io_out8(PIC_SECONDARY_PIO + PIC_DATA_REG, 0x28); /* Set Secondary PIC's interrupt vector base number */
+
+	/* ICW3 */
+	cpu_io_out8(PIC_PRIMARY_PIO + PIC_DATA_REG, 0x4); /* Informe Primary that Secondary is connected to line 2 */
+	cpu_io_out8(PIC_SECONDARY_PIO + PIC_DATA_REG, 0x2); /* Inform Secondary of it's identification */
+
+	/* ICW4 */
+	cpu_io_out8(PIC_PRIMARY_PIO + PIC_DATA_REG, 0x1); /* Put Primary in x86 mode */
+	cpu_io_out8(PIC_SECONDARY_PIO + PIC_DATA_REG, 0x1); /* Put Primary in x86 mode */
+
+	/* CLEAR DATA REGISTERS */
+	cpu_io_out8(PIC_PRIMARY_PIO + PIC_DATA_REG, 0);
+	cpu_io_out8(PIC_SECONDARY_PIO + PIC_DATA_REG, 0);
+}
+
+
+void pic_irq_handler(struct irq_action_s *action)
+{
+	register uint_t irq = (uint_t)action->data;
+	irq_vector[irq]->data = (void*)irq;
+	irq_vector[irq]->irq_handler(irq_vector[irq]);
+}
+
+void ibmpc_pic_init(struct device_s *pic, void *base, uint_t irq)
+{
+	register uint_t _irq;
+	struct irq_action_s *action_ptr;
+
+	pic->base = base;
+	pic->type = DEV_ICU;
+	pic->action.irq_handler = &pic_irq_handler;
+
+	strcpy(pic->name, "PIC");
+	metafs_init(&pic->node, pic->name);
+  
+	pic->op.icu.set_mask = &pic_set_mask;
+	pic->op.icu.get_mask = &pic_get_mask;
+	pic->op.icu.get_highest_irq = &pic_get_highest_irq;
+
+	for(_irq=0; _irq < PIC_IRQ_MAX; _irq++)
+	{
+		action_ptr = kbootMem_calloc(sizeof(*action_ptr));
+		action_ptr->dev = pic;
+		action_ptr->irq_handler = &pic_default_irq_handler;
+		action_ptr->data = (void*) _irq;   
+		irq_vector[_irq] = action_ptr;
+	}
+  
+	pic_ICWs();
+}
+
+void ibmpc_pic_bind(struct device_s *pic, struct device_s *dev)
+{
+	assert(dev->irq < PIC_IRQ_MAX && "Unexpected IRQ, connot bind this device");
+
+	if(dev->irq < PIC_IRQ_MAX)
+	{
+		irq_vector[dev->irq] = &dev->action;
+		metafs_register(&pic->node, &dev->node);
+	}
+}
Index: trunk/kernel/drivers/ibmpc/pic.h
===================================================================
--- trunk/kernel/drivers/ibmpc/pic.h	(revision 1)
+++ trunk/kernel/drivers/ibmpc/pic.h	(revision 1)
@@ -0,0 +1,41 @@
+/*
+ * pic.h - Programmable Interrupt Controller driver interface
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _PIC_ICU_H_
+#define _PIC_ICU_H_
+
+#define PIC_IRQ_MAX          64    // IRQ input lines (see __kentry.S)
+
+/* PIC mapped registers offset */
+#define PIC_CMD_REG          0	        /* Command Register */
+#define PIC_STATUS_REG       0		/* Status Register  */
+#define PIC_IMR_REG	     1          /* Interrupt Mask Register */
+#define PIC_DATA_REG         1		/* Data Register */
+
+struct irq_action_s;
+struct device_s;
+extern struct irq_action_s *irq_vector[];
+
+void ibmpc_pic_init(struct device_s *pic, void *base, uint_t irq);
+void ibmpc_pic_bind(struct device_s *pic, struct device_s *dev);
+
+#endif	/* _PIC_ICU_H_ */
Index: trunk/kernel/drivers/ibmpc/tty.c
===================================================================
--- trunk/kernel/drivers/ibmpc/tty.c	(revision 1)
+++ trunk/kernel/drivers/ibmpc/tty.c	(revision 1)
@@ -0,0 +1,520 @@
+/*
+ * tty.c - a basic tty driver
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <system.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
+#include <cpu-io.h>
+#include <kmem.h>
+#include <libk.h>
+#include <tty.h>
+#include <rwlock.h>
+#include <cpu-trace.h>
+#include <thread.h>
+#include <mwmr.h>
+
+struct device_s ttys_tbl[TTY_DEV_NR];
+
+static void tty_clear(struct device_s *tty)
+{
+	register uint_t i = 0;
+	struct tty_context_s *ctx;
+	uint8_t *vga_ram;
+
+	ctx = (struct tty_context_s*)tty->data;
+	vga_ram = (uint8_t*)tty->base;
+
+	for(i = 0; i < TTY_SIZE; i+=2)
+	{
+		vga_ram[i] = 0;
+		vga_ram[i+1] = ctx->attr;
+	}
+}
+
+
+static sint_t tty_read(struct device_s *tty, dev_request_t *rq)
+{
+	struct tty_context_s *ctx; 
+	register size_t size;
+	uint_t irq_state;
+	register char *dst;
+	register size_t count;
+	register uint32_t eol = 0;
+   
+	cpu_trace_write(CURRENT_THREAD->local_cpu, tty_read);
+
+	ctx = (struct tty_context_s*)tty->data;
+	size = 0;
+	count = rq->count;
+	dst = rq->dst;
+   
+	if(rq->flags & DEV_RQ_NOBLOCK)
+		rwlock_rdlock(&ctx->rwlock);
+	else
+		rwlock_wrlock(&ctx->rwlock);
+
+	spinlock_lock_noirq(&tty->lock, &irq_state);
+
+	size = mwmr_read(ctx->in_channel, dst, count);
+	eol = ctx->eol;
+   
+	if((eol) || (size == count) || (rq->flags & DEV_RQ_NOBLOCK))
+	{
+		ctx->eol = 0;
+		spinlock_unlock_noirq(&tty->lock, irq_state);
+		rwlock_unlock(&ctx->rwlock);
+		return size;
+	}
+
+	rq->count -= size;
+	rq->dst = dst + size;
+	ctx->pending_rq = rq;
+
+	wait_on(&ctx->wait_queue, WAIT_LAST);
+	spinlock_unlock_noirq(&tty->lock, irq_state);
+	sched_sleep(CURRENT_THREAD);
+	rwlock_unlock(&ctx->rwlock);
+	return count - rq->count;
+}
+
+void tty_scrollup(struct device_s *tty, int n)
+{
+	struct tty_context_s *ctx;
+	uint8_t *vga_ram;
+	uint8_t *ptr;
+	uint8_t *limit = (uint8_t*)((uint_t)TTY_SIZE);
+
+	ctx = (struct tty_context_s*)tty->data;
+	vga_ram = (uint8_t*)tty->base;
+
+	for(; vga_ram < limit; vga_ram+=2)
+	{
+		ptr=&vga_ram[n*2*TTY_XSIZE];
+    
+		if(ptr < limit) 
+		{
+			*vga_ram = *ptr;
+			*(vga_ram + 1) = *(ptr+1);
+		}
+		else
+		{
+			*vga_ram = 0;
+			*(vga_ram+1) = 0x07;
+		}
+	}
+  
+	ctx->pos_Y -= n;
+	ctx->pos_Y = (ctx->pos_Y < 0) ? 0 : ctx->pos_Y;
+}
+
+static void tty_cleanup(struct device_s *tty)
+{
+	struct tty_context_s *ctx;
+
+	ctx = (struct tty_context_s*)tty->data;
+	tty_clear(tty);
+	ctx->pos_Y = 0;
+	ctx->pos_X = 0;
+}
+
+#define TTY_CURSOR_CMD        0x3d4
+#define TTY_CURSOR_DATA       0x3d5
+
+void tty_move_cursor(uint_t pos_X, uint_t pos_Y)
+{
+	uint_t pos;
+
+	pos = pos_Y * TTY_XSIZE + pos_X;
+	cpu_io_out8(TTY_CURSOR_CMD, 0x0f);
+	cpu_io_out8(TTY_CURSOR_DATA, pos);
+	cpu_io_out8(TTY_CURSOR_CMD, 0x0e);
+	cpu_io_out8(TTY_CURSOR_DATA, pos >> 8);
+}
+
+static void tty_putc(struct device_s *tty, uint8_t ch)
+{
+	struct tty_context_s *ctx;
+	uint8_t *vga_ram;
+	int offset;
+
+	ctx = (struct tty_context_s*)tty->data;
+	vga_ram = (uint8_t*)tty->base;
+
+	switch (ch)
+	{
+	case '\b':
+		ctx->pos_X --;
+		break;
+	case '\t':
+		ctx->pos_X += 8;
+		break;
+
+	case '\r':
+		ctx->pos_X = 0;
+		break;
+
+	case '\n':	
+		ctx->pos_X = 0;
+		ctx->pos_Y ++;
+		break;
+  
+	default:
+		offset = 2*TTY_XSIZE*ctx->pos_Y + 2*ctx->pos_X;
+		ctx->pos_X++;
+		vga_ram[offset] = ch;
+		vga_ram[offset + 1] = (uint8_t)(ctx->attr & 0xFF);
+	}
+
+	if(ctx->pos_X >= TTY_XSIZE)
+	{
+		ctx->pos_X = 0;
+		ctx->pos_Y ++;
+	}
+  
+#if 1
+	if(ctx->pos_Y >= TTY_YSIZE)
+	{
+		tty_cleanup(tty);
+		//ctx->pos_Y = 0;
+	}
+#endif
+}
+
+
+static sint_t tty_write(struct device_s *tty, dev_request_t *rq)
+{
+	struct tty_context_s *ctx; 
+	register unsigned int i;
+	register size_t size = rq->count;
+  
+	cpu_trace_write(CURRENT_THREAD->local_cpu, tty_write);
+  
+	ctx = (struct tty_context_s*)tty->data;
+  
+	if(!(rq->flags & DEV_RQ_NOBLOCK))
+		rwlock_wrlock(&ctx->rwlock);
+
+	for (i = 0; i < size; i++)
+		tty_putc(tty, *((uint8_t*)rq->src + i));
+
+	if(!(rq->flags & DEV_RQ_NOBLOCK))
+		rwlock_unlock(&ctx->rwlock);
+
+	return size;
+}
+
+
+static sint_t tty_get_params(struct device_s *tty, dev_params_t *params)
+{
+	params->chr.xSize = TTY_XSIZE;
+	params->chr.ySize = TTY_YSIZE;
+	params->size = 0;
+	return 0;
+}
+
+#define KEYBOARD_READ_REG     0x60
+#define KEYBOARD_WRITE_REG    0x60
+#define KEYBOARD_STATUS_REG   0x64
+#define KEYBORAD_CMD_REG      0x64
+
+#define KEY_IS_HOLD           0x80
+#define KEY_IS_LEFT_SHIFT     0x29
+#define KEY_IS_RIGHT_SHIFT    0x35
+#define KEY_IS_ALT            0x37
+#define KEY_IS_CTRL           0x1C
+#define KEY_IS_CAPSLOCK       0x39
+
+static uint_t isLeftShift;
+static uint_t isRightShift;
+static uint_t isAlt;
+static uint_t isCtrl;
+static uint_t isCAPSLOCK;
+
+static error_t tty_getc(struct device_s *tty)
+{
+	register uint8_t isUpper;
+	register uint8_t scode;
+	register error_t ch;
+	ch = -1;
+	scode = 0;
+
+	/* Waite KEYBOARD OUTPUT BUFFER */
+	do
+	{
+		scode = cpu_io_in8(KEYBOARD_STATUS_REG);
+	}while((scode & 0x1) == 0);
+    
+	scode = cpu_io_in8(KEYBOARD_READ_REG);
+	scode --;
+  
+	//  isr_dmsg(DEBUG, "scode %x\n", scode);
+  
+	if(scode < KEY_IS_HOLD)
+	{
+		switch (scode)
+		{
+		case KEY_IS_RIGHT_SHIFT:
+			isRightShift = 1;
+			break;
+		case KEY_IS_CTRL:
+			isCtrl = 1;
+			break;
+		case KEY_IS_ALT:
+			isAlt = 1;
+			break;
+		case KEY_IS_CAPSLOCK:
+			break;
+		case KEY_IS_LEFT_SHIFT:
+			isLeftShift = 1;
+			break;
+		default:
+			isUpper = (isRightShift || isLeftShift || isCAPSLOCK) ? 1 : 0;
+			ch = keyboard_map[(scode << 2) + isUpper + isAlt];
+		}
+	}
+	else
+	{
+		scode -= 0x80;
+		switch (scode)
+		{
+		case KEY_IS_RIGHT_SHIFT:
+			isRightShift = 0;
+			break;
+		case KEY_IS_CTRL:
+			isCtrl = 0;
+			break;
+		case KEY_IS_ALT:
+			isAlt = 0;
+			break;
+		case KEY_IS_CAPSLOCK:
+			isCAPSLOCK = (isCAPSLOCK) ? 0 : 1;
+			break;
+		case KEY_IS_LEFT_SHIFT:
+			isLeftShift = 0;
+			break;
+		default:
+			/* No action for other scan code */
+			break;
+		}
+	}
+  
+	struct tty_context_s *ctx = tty->data;
+	tty_move_cursor(ctx->pos_X, ctx->pos_Y);
+	return ch;
+}
+
+static void tty_irq_handler(struct irq_action_s *action)
+{
+	sint_t ch;
+	struct device_s *tty;
+	struct tty_context_s *ctx; 
+	register char *dst;
+	volatile uint32_t *base;
+   
+	cpu_trace_write(CURRENT_THREAD->local_cpu, tty_irq_handler);
+
+	tty = action->dev;
+	base = tty->base;
+	ctx = (struct tty_context_s*)tty->data;
+
+	if((ch = tty_getc(tty)) & 0x80)
+		return;
+
+	cpu_spinlock_lock(&tty->lock.val);
+
+	if(ctx->pending_rq != NULL)
+	{
+		dst = ctx->pending_rq->dst;
+		*(dst ++) = ch;
+		ctx->pending_rq->dst = dst;
+		ctx->pending_rq->count --;
+
+		if((ch == '\n') || (ctx->pending_rq->count == 0))
+		{
+			wakeup_one(&ctx->wait_queue, WAIT_FIRST);
+			ctx->pending_rq = NULL;
+		}
+	}
+	else
+	{
+		mwmr_write(ctx->in_channel, &ch, 1);
+		if(ch == '\n') ctx->eol = 1;
+	}
+
+#if CONFIG_TTY_ECHO_MODE
+	switch(ch)
+	{
+	case '\b':
+	case 0x7F:
+		tty_putc(tty, '\b');
+	tty_putc(tty, ' ');
+	tty_putc(tty, '\b');
+	break;
+	default:
+		tty_putc(tty, ch);
+	}
+#endif
+
+	cpu_spinlock_unlock(&tty->lock.val);
+}
+
+void ibmpc_tty_init(struct device_s *tty, void *base, uint_t irq, uint_t tty_id)
+{
+	struct tty_context_s *ctx;
+  
+	isRightShift = 0;
+	isLeftShift = 0;
+	isCtrl = 0;
+	isAlt = 0;
+	isCAPSLOCK = 0;
+
+	spinlock_init(&tty->lock);
+	tty->base = base;
+	tty->irq = irq;
+	tty->type = DEV_CHR;
+
+	tty->action.dev = tty;
+	tty->action.irq_handler = &tty_irq_handler;
+	tty->action.data = NULL;
+ 
+	tty->op.dev.open = NULL;
+	tty->op.dev.read = &tty_read;
+	tty->op.dev.write = &tty_write;
+	tty->op.dev.close = NULL;
+	tty->op.dev.lseek = NULL;
+	tty->op.dev.set_params = NULL;
+	tty->op.dev.get_params = &tty_get_params;
+
+	ctx = kbootMem_calloc(sizeof(*ctx));
+	ctx->id = tty_id;
+	ctx->in_channel = mwmr_init(1,TTY_BUFFER_DEPTH, 0);
+	rwlock_init(&ctx->rwlock);
+	ctx->eol = 0;
+	ctx->attr = 0x07;
+	tty->data = (void*) ctx;
+	sprintk(tty->name, "TTY%d", tty_id);
+	metafs_init(&tty->node, tty->name);
+	wait_queue_init(&ctx->wait_queue,tty->name);
+	tty_clear(tty);
+}
+
+
+uint8_t keyboard_map[] = { 0x1B, 0x1B, 0x1B, 0x1B,
+			   '&', '1', '1', '1',
+			   '~', '2', '2', '2',
+			   '"', '3', '3', '3',
+			   '\'','4', '{', '{',
+			   '(', '5', '5', '5',
+			   '-', '6', '|', '|',
+			   '`', '7', '7', '7',
+			   '_', '8', '\\', '\\',
+			   '^', '9', '9', '9',
+			   '@', '0', '0', '0',
+			   ')', ']', '-', '-',
+			   '=', '+', '}','}',
+			   '\b','\b', 0x7F,'\b',
+			   '\t','\t','\t','\t',
+			   'a', 'A', 'a', 'a',
+			   'z', 'Z', 'z', 'z',
+			   'e', 'E', 'e', 'e',
+			   'r', 'R', 'r', 'r',
+			   't', 'T', 't', 't',
+			   'y', 'Y', 'y', 'y',
+			   'u', 'U', 'u', 'u',
+			   'i', 'I', 'i', 'i',
+			   'o', 'O', 'o', 'o',
+			   'p', 'P', 'p', 'p',
+			   '[', '{', '[', '[',
+			   '$', '$', '$', ']',
+			   '\n','\n','\n','\n',
+			   0xFF, 0xFF, 0xFF, 0xFF,
+			   'q', 'A', 'a', 'a',
+			   's', 'S', 's', 's',
+			   'd', 'D', 'd', 'd',
+			   'f', 'F', 'f', 'f',
+			   'g', 'G', 'g', 'g',
+			   'h', 'H', 'h', 'h',
+			   'j', 'J', 'j', 'j',
+			   'k', 'K', 'k', 'k',
+			   'l', 'L', 'l', 'l',
+			   'm', 'M', ';', ';',
+			   '%', '%', '%', '%',
+			   0x28, 0x28, 0x28, 0x28,
+			   0x29, 0x29, 0x29, 0x29, /* Left Shift (41) */
+			   '*', '*', '*', '*',
+			   'w', 'W', 'w', 'w',
+			   'x', 'X', 'x', 'x',
+			   'c', 'C', 'c', 'c',
+			   'v', 'V', 'v', 'v',
+			   'b', 'B', 'b', 'b',
+			   'n', 'N', 'n', 'n',
+			   ',', '?', ',', ',',
+			   ';', '.', ';', ';',
+			   ':', '/', ':', ':',
+			   '!', '!', '!', '!',
+			   0x35, 0x35, 0x35, 0x35,	/*      Rshift  (0x35)  */
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   ' ', ' ', ' ', ' ',	        /*      space   */
+			   0x39, 0x39, 0x39, 0x39,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF, /* 0x40 */	
+			   0xFF, 0xFF, 0xFF, 0xFF, 
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF, /* 0x50 */
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   '<', '>', '<', '<',
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF,	
+			   0xFF, 0xFF, 0xFF, 0xFF, /* 0x60 */
+			   0xFF, 0xFF, 0xFF, 0xFF};
Index: trunk/kernel/drivers/ibmpc/tty.h
===================================================================
--- trunk/kernel/drivers/ibmpc/tty.h	(revision 1)
+++ trunk/kernel/drivers/ibmpc/tty.h	(revision 1)
@@ -0,0 +1,55 @@
+/*
+ * tty.c - a basic tty driver
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _TTY_H_
+#define _TTY_H_
+
+#include <driver.h>
+#include <scheduler.h>
+#include <rwlock.h>
+
+#define TTY_STATUS_REG  0
+#define TTY_READ_REG    1
+#define TTY_WRITE_REG   2
+
+struct device_s;
+struct fifomwmr_s;
+
+void ibmpc_tty_init(struct device_s *tty, void *base, uint_t irq, uint_t tty_id);
+
+struct thread_s;
+
+struct tty_context_s
+{
+	uint_t pos_X, pos_Y;
+	uint_t attr;
+	uint_t id;
+	dev_request_t *pending_rq;
+	unsigned int eol;		/* End Of Line */
+	struct rwlock_s rwlock;
+	struct wait_queue_s wait_queue;
+	struct fifomwmr_s *in_channel;
+	struct fifiomwmr_s *out_channel;
+};
+
+extern uint8_t keyboard_map[];
+#endif	/* _TTY_H_ */
Index: trunk/kernel/drivers/soclib/drvdb.c
===================================================================
--- trunk/kernel/drivers/soclib/drvdb.c	(revision 1)
+++ trunk/kernel/drivers/soclib/drvdb.c	(revision 1)
@@ -0,0 +1,109 @@
+/*
+ * drvdb.c - Dictionary of supported devices and associated drivers
+ *
+ * Authors Ghassan Almaless (2008,2009,2010,2011,2012)
+ *         Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <errno.h>
+#include <libk.h>
+#include <event.h>
+#include <device.h>
+#include <driver.h>
+#include <drvdb.h>
+#include <soclib_xicu.h>
+#include <soclib_icu.h>
+#include <soclib_tty.h>
+#include <soclib_timer.h>
+#include <soclib_dma.h>
+#include <soclib_block.h>
+#include <soclib_fb.h>
+#include <soclib_memc.h>
+#include <soclib_iopic.h>
+
+
+///////////////////////////////////////////////////////////////////////////////////////////
+// This global variable defines the array of supported devices and associated drivers.
+// It must be kept consistant with the enum in file drvdb.h.
+///////////////////////////////////////////////////////////////////////////////////////////
+
+static drvdb_entry_t drivers_db[DEV_TYPE_DRVID_NR] = 
+{
+	{DEV_TYPE_RAM     , "Random Access Memory"           , NULL},
+	{DEV_TYPE_TTY     , "Text Terminal Controler"        , &soclib_tty_driver},
+    {DEV_TYPE_FBF     , "Frame Buffer Controler"         , &soclib_fbf_driver},
+    {DEV_TYPE_IOB     , "I/O Bridge Component"           , &soclib_iob_driver},
+	{DEV_TYPE_IOC_BDV , "BDV Block Device Controler"     , &soclib_bdv_driver},
+	{DEV_TYPE_IOC_HBA , "HBA Block Device Controler"     , NULL},
+    {DEV_TYPE_IOC_SDC , "SDC Block Device Controler"     , NULL},
+    {DEV_TYPE_IOC_SPI , "SPI Block Device Controler"     , NULL},
+    {DEV_TYPE_IOC_RDK , "RDK Block device Controler"     , NULL},
+	{DEV_TYPE_MMC     , "L2 cache Configuration"         , &soclib_mmc_driver},
+	{DEV_TYPE_MWR_DMA , "DMA Coprocessor"                , NULL},
+	{DEV_TYPE_MWR_GCD , "GCD Coprocessor"                , NULL},
+	{DEV_TYPE_MWR_DCT , "DCT Coprocessor"                , NULL},
+	{DEV_TYPE_NIC     , "GMII-Compliant NIC Controller"  , NULL},
+	{DEV_TYPE_ROM     , "Read Only Memory"               , NULL},
+	{DEV_TYPE_CMA     , "Chained buffers DMA Controller" , NULL},
+	{DEV_TYPE_TIM     , "Real-Time Timer"                , &soclib_timer_driver},
+	{DEV_TYPE_XCU     , "Interrupt Controlier unit"      , &soclib_xicu_driver},
+	{DEV_TYPE_PIC     , "HWI to WTI translator"          , &soclib_iopic_driver},
+	{DEV_TYPE_NULL    , "End of Table Marker           " , NULL}
+};
+
+
+///////////////////////////////////////////////////
+drvdb_entry_t * drvdb_locate_byId( uint32_t drvid )
+{
+	if(drvid >= DEV_TYPE_RESERVED)
+		return NULL;
+
+	return &drivers_db[drvid];
+}
+
+//////////////////////////////////////////////
+drvdb_entry_t * drvdb_locate_byName( char * name )
+{
+	register uint32_t i;
+
+	for(i=0; drivers_db[i].id != DEV_TYPE_RESERVED; i++)
+		if(!strcmp(drivers_db[i].name, name))
+			return &drivers_db[i];
+
+	return NULL;
+}
+
+driver_t* drvdb_get_driver(uint32_t drvid)
+{
+	if(drvid >= DEV_TYPE_RESERVED)
+		return NULL;
+
+	return drivers_db[drvid].driver;
+}
+
+error_t drvdb_set_driver(uint32_t drvid, driver_t *driver)
+{
+	if(drvid >= DEV_TYPE_RESERVED)
+		return ERANGE;
+
+	drivers_db[drvid].driver = driver;
+	return 0;
+}
Index: trunk/kernel/drivers/soclib/drvdb.h
===================================================================
--- trunk/kernel/drivers/soclib/drvdb.h	(revision 1)
+++ trunk/kernel/drivers/soclib/drvdb.h	(revision 1)
@@ -0,0 +1,118 @@
+/*
+ * drvdb.h - a dictionary of supported devices and their drivers
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DRVDB_H_
+#define _DRVDB_H_
+
+#include <driver.h>
+
+
+/******************************************************************************************
+ * This enum defines the Supported Drivers types
+ * This enum must be kept consistent with the global array in drvdb.c file 
+ *****************************************************************************************/
+
+typedef enum
+{
+	SOCLIB_RAM_ID = 0,
+	SOCLIB_XICU_ID,
+	SOCLIB_TTY_ID,
+	SOCLIB_DMA_ID,
+	SOCLIB_BLKDEV_ID,
+	SOCLIB_FB_ID,
+	SOCLIB_ICU_ID,
+	SOCLIB_TIMER_ID,
+	SOCLIB_IOPIC_ID,
+	SOCLIB_MEMC_ID,
+	SOCLIB_MNIC_ID,
+	SOCLIB_CHDMA_ID,
+	SOCLIB_RESERVED_ID,
+	SOCLIB_DRVID_NR
+}soclib_drvid_t;
+
+/* Driver DataBase Entry */
+struct drvdb_entry_s;
+
+/* Entry Setters */
+#define drvdb_entry_set_id(entry,drvid)
+#define drvdb_entry_set_name(entry,name)
+#define drvdb_entry_set_info(entry,info)
+#define drvdb_entry_set_driver(entry,driver)
+
+/* Entry Getters */
+#define drvdb_entry_get_id(entry)
+#define drvdb_entry_get_name(entry)
+#define drvdb_entry_get_info(entry)
+#define drvdb_entry_get_driver(entry)
+
+
+/******************************************************************************************
+ * This structure define a Driver descriptor 
+ *****************************************************************************************/
+typedef struct drvdb_entry_s
+{
+	uint32_t   id;
+	char     * name;
+	char     * info;
+	driver_t * driver;
+}
+drvdb_entry_t;
+
+
+#define drvdb_entry_get_id(_entry)       ((_entry)->id)
+#define drvdb_entry_get_name(_entry)     ((_entry)->name)
+#define drvdb_entry_get_info(_entry)     ((_entry)->info)
+#define drvdb_entry_get_driver(_entry)   ((_entry)->driver)
+
+#define drvdb_entry_set_id(_entry,_drvid)      do {(_entry)->id = (_drvid);}      while(0)
+#define drvdb_entry_set_name(_entry,_name)     do {(_entry)->name = (_name);}     while(0)
+#define drvdb_entry_set_info(_entry,_info)     do {(_entry)->info = (_info);}     while(0)
+#define drvdb_entry_set_driver(_entry,_driver) do {(_entry)->driver = (_driver);} while(0)
+
+/******************************************************************************************
+ * This function returns a pointer on driver descriptor from its index.
+ * @ drvid   : index in the drivers descriptors array.
+ *****************************************************************************************/
+drvdb_entry_t * drvdb_locate_byId( uint32_t drvid );
+
+/******************************************************************************************
+ * This function returns a pointer on driver descriptor from its name.
+ * @ name    : name in the drivers descriptors array.
+ *****************************************************************************************/
+drvdb_entry_t * drvdb_locate_byName( char * name );
+
+/******************************************************************************************
+ * This function register a driver pointer in the driver descriptors array.
+ * @ drvid    : index in the drivers descriptors array.
+ * @ driver   : function pointer to be registered.
+ *****************************************************************************************/
+error_t drvdb_set_driver( uint32_t   drvid, 
+                          driver_t * driver );
+
+/******************************************************************************************
+ * This function returns a driver pointer from the driver index
+ * @ drvid    : index in the drivers descriptors array.
+ * @ returns  function pointer to be registered.
+ *****************************************************************************************/
+driver_t * drvdb_get_driver( uint32_t drvid );
+
+#endif	/* _DRVDB_H_ */
Index: trunk/kernel/drivers/soclib/soclib_bdv.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_bdv.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_bdv.c	(revision 1)
@@ -0,0 +1,149 @@
+/*
+ * soclib_bdv.c - soclib simple block device driver implementation.
+ *
+ * Author     Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <device.h>
+#include <dev_ioc.h>
+#include <soclib_bdv.h>
+#include <thread.h>
+#include <spinlock.h>
+
+
+/////////////////////////////////////
+void soclib_bdv_init( xptr_t dev_xp )
+{
+    // get IOC device descriptor cluster and local pointer
+    cxy_t      dev_cxy  = GET_CXY( dev_xp );
+    device_t * dev_ptr  = (device_t *)GET_PTR( dev_xp );
+  
+    // get extended pointer on SOCLIB_BDV peripheral base address
+	xptr_t  bdv_xp = hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get hardware device cluster and local pointer
+    cxy_t      bdv_cxy  = GET_CXY( bdv_xp );
+    uint32_t * bdv_ptr  = (uint32_t *)GET_PTR( bdv_xp );
+
+    // get block_size and block_count  
+	uint32_t block_size = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_BLOCK_SIZE_REG ) );
+	uint32_t block_count = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_SIZE_REG ) );
+
+    // set IOC device descriptor extension
+    hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.size  ) , block_size );
+    hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.count ) , block_count );
+
+} // end soclib_bdv_init()
+
+
+//////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_bdv_command( xptr_t th_xp )
+{
+    uint32_t   to_mem;       // command argument
+    uint32_t   lba;          // command argument
+    uint32_t   count;        // command argument
+    xptr_t     buf_xp;       // command argument
+    xptr_t     dev_xp;       // command argument
+
+    // get client thread cluster and local pointer
+    cxy_t      th_cxy = GET_CXY( th_xp );
+    thread_t * th_ptr = (thread_t *)GET_PTR( th_xp );
+
+    // get command arguments and extended pointer on IOC device
+    to_mem =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.to_mem ) );
+    lba    =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.lba    ) );
+    count  =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.count  ) );
+    buf_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.ioc.buf_xp ) );
+    dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.ioc.dev_xp ) );
+
+    // get IOC device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get extended pointer on SOCLIB-BDV peripheral
+    xptr_t     bdv_xp = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get SOCLIB_BDV device cluster and local pointer
+    cxy_t      bdv_cxy = GET_CXY( bdv_xp );
+    uint32_t * bdv_ptr = (uint32_t *)GET_PTR( bdv_xp );
+
+    // split buffer address in two 32 bits words
+    uint32_t   buf_lsb = (uint32_t)(buf_xp);
+    uint32_t   buf_msb = (uint32_t)(buf_xp>>32);
+
+    // get access type
+    uint32_t   type =  to_mem ? BDV_OP_READ : BDV_OP_WRITE; 
+
+    // set SOCLIB_BDV registers to start one I/O operation
+    hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_IRQ_ENABLE_REG ) , 1       );
+    hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_BUFFER_REG     ) , buf_lsb ); 
+    hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_BUFFER_EXT_REG ) , buf_msb ); 
+    hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_LBA_REG        ) , lba     );
+    hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_COUNT_REG      ) , count   );
+    hal_remote_sw( XPTR( bdv_cxy , bdv_ptr + BDV_OP_REG         ) , type    );
+
+    // Block and deschedule server thread
+    thread_block( CURRENT_THREAD , THREAD_BLOCKED_DEV_ISR );
+    sched_yield();
+    
+} // end soclib_bdv_cmd()
+
+
+////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_bdv_isr( device_t * dev )
+{
+    // get extended pointer on client thread
+    xptr_t root = XPTR( local_cxy , &dev->wait_root );
+    xptr_t client_xp = XLIST_FIRST_ELEMENT( root , thread_t , wait_list );
+
+    // get extended pointer on server thread
+    xptr_t server_xp = XPTR( local_cxy , &dev->server );
+
+    // get client thread cluster and local pointer
+    cxy_t      client_cxy = GET_CXY( client_xp );
+    thread_t * client_ptr = (thread_t *)GET_PTR( client_xp );
+
+    // get SOCLIB_BDV device cluster and local pointer
+    cxy_t      bdv_cxy  = GET_CXY( dev->base );
+    uint32_t * bdv_ptr  = (uint32_t *)GET_PTR( dev->base );
+
+    // get BDV status register and acknowledge IRQ
+	uint32_t status = hal_remote_lw( XPTR( bdv_cxy , bdv_ptr + BDV_STATUS_REG ) );   
+
+    // set operation status in command
+	if((status != BDV_READ_SUCCESS) && (status != BDV_WRITE_SUCCESS)) 
+    {
+        hal_remote_sw( XPTR( client_cxy , &client_ptr->dev.ioc.error ) , 1 );
+    }
+	else
+    {
+        hal_remote_sw( XPTR( client_cxy , &client_ptr->dev.ioc.error ) , 0 );
+    }
+
+    // unblock server thread 
+    thread_unblock( server_xp , THREAD_BLOCKED_DEV_ISR );
+
+    // unblock client thread
+    thread_unblock( client_xp , THREAD_BLOCKED_IO );
+
+} // end soclib_bdv_isr()
+
+
+
Index: trunk/kernel/drivers/soclib/soclib_bdv.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_bdv.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_bdv.h	(revision 1)
@@ -0,0 +1,105 @@
+/*
+ * soclib_bdv.h - SOCLIB_BDV (simple block device) driver definition.
+ *
+ * Author    Alain Greiner
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_BDV_H_
+#define _SOCLIB_BDV_H_
+
+#include <device.h>
+#include <hal_types.h>
+
+/********************************************************************************************
+ * This driver supports the SocLib VciBlockDevice component, that is a simgle channel,
+ * block oriented, external storage controler, supporting only one I/O transaction,
+ * at a given time.
+ *******************************************************************************************/
+
+/********************************************************************************************
+ *       SOCLIB_BDV registers offset 
+ *******************************************************************************************/
+
+enum SoclibBlockDeviceRegisters
+{
+    BDV_BUFFER_REG     = 0,
+    BDV_LBA_REG	       = 1,
+    BDV_COUNT_REG      = 2,
+    BDV_OP_REG	       = 3,
+    BDV_STATUS_REG	   = 4,
+    BDV_IRQ_ENABLE_REG = 5,
+    BDV_SIZE_REG       = 6,
+    BDV_BLOCK_SIZE_REG = 7,
+    BDV_BUFFER_EXT_REG = 8,
+};
+
+/********************************************************************************************
+ *       SOCLIB_BDV status values
+ *******************************************************************************************/
+
+#define BDV_IDLE	        0
+#define BDV_BUSY	        1
+#define BDV_READ_SUCCESS	2
+#define BDV_WRITE_SUCCESS	3
+#define BDV_READ_ERROR	    4
+#define BDV_WRITE_ERROR	    5
+#define BDV_ERROR	        6
+
+/********************************************************************************************
+ *        SOCLIB_BDV operations 
+ *******************************************************************************************/
+
+#define BDV_OP_NOP          0
+#define BDV_OP_READ         1
+#define BDV_OP_WRITE        2
+
+/********************************************************************************************
+ * This function access the SOCLIB_BDV hardware registers to get the block size and the
+ * number of blocks, and initialises the "extension" field of the IOC device descriptor.
+ ********************************************************************************************
+ * @ dev_xp     : extended pointer on the generic IOC device descriptor.
+ *******************************************************************************************/
+extern void soclib_bdv_init( xptr_t dev_xp );
+
+/********************************************************************************************
+ * This function is called by the server thread associated to the IOC device.
+ * It decode the IOC device command embedded in the calling thread descriptor,
+ * (format defined in the dev_ioc.h file) and starts execution of this generic command, 
+ * accessing the relevant SOCLIB_BDV hardware registers.
+ * Then it blocks on the THREAD_BLOCKED_DEV_ISR and deschedule, because the SOCLIB_BDV 
+ * device cannot register several commands. It is re-activated by the ISR signaling the
+ * I/O operation completion.
+ ********************************************************************************************
+ * @ thread_xp  : extended pointer on the client thread.
+ *******************************************************************************************/
+extern void soclib_bdv_command( xptr_t thread_xp );
+
+/********************************************************************************************
+ * This Interrupt Service Routine is executed when the IRQ signaling the completion of 
+ * an IOC command is received by a core. It acknowledge the IRQ by accessing the proper
+ * SOCLIB_BDV register, unblock the client thread, and unblock the server thread that
+ * can starts execution of a new command if the waiting queue is not emppty.
+ ********************************************************************************************
+ * @ dev     : local pointer on the generic IOC device descriptor.
+ *******************************************************************************************/
+extern void soclib_bdv_isr( device_t * dev );
+
+
+#endif /* _BLOCK_H_ */
Index: trunk/kernel/drivers/soclib/soclib_cma.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_cma.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_cma.c	(revision 1)
@@ -0,0 +1,329 @@
+/*
+ * soclib_nic.c - SOCLIB_NIC (Network Interface Controler) driver implementation.
+ *
+ * Author     Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <device.h>
+#include <dev_nic.h>
+#include <soclib_nic.h>
+#include <spinlock.h>
+
+
+/////////////////////////////////////
+void soclib_nic_init( xptr_t xp_dev )
+{
+    uint32_t    i;
+    kmem_req_t  req;
+    
+    // get NIC device descriptor cluster and local pointer
+    cxy_t      dev_cxy  = GET_CXY( dev );
+    device_t * dev_ptr  = (device_t *)GET_PTR( dev );
+  
+    // get hardware device base address
+	xptr_t     base = hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get hardware device cluster and local pointer
+    cxy_t      nic_cxy  = GET_CXY( base );
+    uint32_t * nic_ptr  = (uint32_t *)GET_PTR( base );
+
+    // initialize Soclib NIC global registers 
+    hal_remote_sw( XPTR( nic_cxy , &nic_ptr + NIC_G_BC_ENABLE ) , 0 );
+    hal_remote_sw( XPTR( nic_cxy , &nic_ptr + NIC_G_ON        ) , 0 );
+
+    // allocate memory for chbuf descriptor (one page)
+    if( sizeof(nic_chbuf_t) > CONFIG_PPM_PAGE_SIZE )
+    {
+        printk("PANIC in %s : chbuf descriptor exceeds one page\n", __FUNCTION__ );
+        hal_core_sleep;
+    }
+
+    req->type   = KMEM_PAGE;
+    req->size   = 0;
+    req_flags   = AF_KERNEL;
+
+    nic_chbuf_t * chbuf = (nic_chbuf_t *)kmem_alloc( &req );
+
+    if( chbuf == NULL )
+    {
+        printk("PANIC in %s : no more memory for chbuf desccriptor\n", __FUNCTION__ );
+        hal_core_sleep;
+    }
+
+    // initialise chbuf state
+    chbuf->cont_id  = 0;
+    chbuf->pkt_id   = 0;
+    chbuf->word_id  = 34;
+    
+    // allocate containers (one page per container)
+    // and complete chbuf descriptor initialization
+    if( CONFIG_PPM_PAGE_SIZE != 4096 )
+    {
+        printk("PANIC in %s : chbuf container must be 4 Kbytes\n", __FUNCTION__ );
+        hal_core_sleep;
+    }
+
+    for( i = 0 ; i < CONFIG_NIC_CHBUF_DEPTH ; i++ )
+    {
+        uint32_t * container = (uint32_t *)kmem_alloc( req );   
+
+        if( container == NULL )
+        {
+            printk("PANIC in %s : no more memory for container\n", __FUNCTION__ );
+            hal_core_sleep;
+        }
+        
+        chbuf->cont[i] = container;
+        chbuf->full[i] = (paddr_t)XPTR( local_cxy , container );
+    }
+
+    // get a free WTI mailbox
+    uint32_t wti_id = dev_icu_wti_alloc();
+    if( wti_id == -1 )
+    {
+        printk("PANIC in %s : cannot allocate WTI mailbox\n", __FUNCTION__ );
+        hal_core_sleep;
+    }
+
+    // enable WTI IRQ in local ICU and update WTI interrupt vector
+    dev_icu_enable_irq( WTI_TYPE , wti_id , xp_dev );
+
+    // link NIC IRQ to WTI mailbox in PIC component 
+    uint32_t irq_id; 
+    if( is_rx ) irq_id = devices_irq.nic_rx[channel];
+    else        irq_id = devices_irq.nic_tx[channel];
+    dev_pic_bind_irq( irq_id , local_cxy , wti_id );
+
+} // end soclib_nic_init()
+
+
+////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_nic_cmd()
+{
+    uint32_t       cmd;          // command type    
+    char         * buffer;       // pointer on command buffer   
+    uint32_t       length;       // Ethernet packet length
+    uint32_t       offset;       // offset in buffer
+    nic_chbuf_t  * chbuf;        // pointer on chbuf descriptor
+    uint32_t       cont_id;      // index of current container in chbuf
+    uint32_t       pkt_id;       // index of current packet in container
+    uint32_t       word_id;      // index of first word of current packet in container
+    uint32_t     * container;    // pointer on container (array of uint32_t)
+    uint16_t     * header;       // pointer on container header (array of uint16_t)
+    uint32_t       npackets;     // number of packets in current container
+
+    volatile uint64_t  sts;  // container descriptor (containing status)
+
+    thread_t * this = CURRENT_THREAD;
+
+    // get command arguments
+    cmd    = this->dev.nic.cmd;
+    buffer = this->dev.nic.buffer;
+    length = this->dev.nic.length;
+
+    // get chbuf descriptor pointer
+    chbuf = (nic_chbuf_t *)dev->ext.nic.queue;
+
+    // analyse command type
+    switch( cmd )
+    {
+        /////////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_READ:   // transfer one packet from RX queue to command buffer
+        {
+            // get current container index
+            cont_id = chbuf->cont_id;
+            
+            if( chbuf->full[cont_id] == 0 )  // container empty
+            {
+                printk("PANIC in %s : read an empty container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // get pointer on container and header 
+            container = chbuf->cont[cont_id];
+            header    = (uint16_t *)header;
+
+            // get  expected packet index and first word index in container
+            pkt_id  = chbuf->pkt_id;
+            word_id = chbuf->word_id;
+
+            // get packet length and number of packets from container header
+            length    = header[pkt_id + 2];
+            npackets  = header[0];
+
+            if( pkt_id >= npackets )  // packet index too large
+            {
+                printk("PANIC in %s : read a non readable container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // move the packet from container to buffer
+            memcpy( buffer , container + word_id , length );
+
+            // update current packet index and first word index
+            chbuf->pkt_id  = pkt_id + 1;
+            if( length & 0x3 ) chbuf->word_id = word_id + (length>>2) + 1;
+            else               chbuf->word_id = word_id + (length>>2);
+        }
+        break;    // end READ
+            
+        //////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_WRITE:  // move one packet from command buffer to TX queue
+        {
+            // get current TX container indexes
+            cont_id = chbuf->cont_id;
+            pkt_id  = chbuf->pkt_id;
+            word_id = chbuf->word_id;
+
+            if( chbuf->full[cont_id] != 0 )  // container full
+            {
+                printk("PANIC in %s : write to a full container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // get pointer on container and header 
+            container = chbuf->cont[cont_id];
+            header    = (uint16_t *)container;
+
+            if( length > ((1024 - word_id)<<2) )  // packet length too large
+            {
+                printk("PANIC in %s : write to a non writable container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // update packet length in container header
+            header[pkt_id + 2] = (uint16_t)length;
+
+            // move the packet from buffer to container
+            memcpy( container + word_id , buffer , length );
+
+            // update current packet index and first word index
+            chbuf->pkt_id  = pkt_id + 1;
+            if( length & 0x3 ) chbuf->word_id = word_id + (length>>2) + 1;
+            else               chbuf->word_id = word_id + (length>>2);
+        }
+        break;  // end WRITE
+
+        ////////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_WRITABLE:  // analyse chbuf status / update status if required
+        {
+            // get current container state 
+            cont_id = chbuf->cont_id;
+            word_id = chbuf->word_id;
+
+            // compute current container writable
+            bool_t ok = ( chbuf->full[cont_id] == 0 ) &&
+                        ( length <= ((1024 - word_id)<<2) );
+
+            if( ok )                // current container writable
+            {
+                // return chbuf writable
+                this->dev.nic.status = true;
+            }
+            else                    // current container not writable
+            {
+                // release current container
+                chbuf->full[cont_id] = 1;
+
+                // check next container 
+                cont_id = (cont_id + 1) % CONFIG_NIC_CHBUF_DEPTH;
+
+                if( chbuf->full[cont_id] == 0 ) // next container empty
+                {
+                    // update chbuf status
+                    chbuf->word_id = 34;
+                    chbuf->cont_id = cont-id;
+                    chbuf->pkt_id  = 0;
+                     
+                    // return chbuf writable
+                    this->dev.nic.status = true;
+                }
+                else                            // next container full     
+                {
+                    // return chbuf non writable
+                    this->dev.nic.status = false;
+                }
+            }
+        }
+        break;  // end WRITABLE
+
+        /////////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_READABLE:  // analyse chbuf status / update status if required
+        {
+            // get current container state
+            cont_id  = chbuf->cont_id;
+            pkt_id   = chbuf->pkt_id;
+            npackets = chbuf->cont[cont_id][0] & 0x0000FFFF; 
+            
+            // compute current container readable
+            bool_t ok = ( chbuf->full[cont_id] == 1 ) &&
+                        ( pkt_id < npackets );
+
+            if( ok )                    // current container readable
+            {
+                // return chbuf readable     
+                this->dev.nic.status = true;
+            }
+            else                        // current container non readable
+            {
+                // release current container
+                chbuf->full[cont_id] = 0;
+
+                // check next container
+                cont_id = (cont_id + 1) % CONFIG_NIC_CHBUF_DEPTH;
+
+                if( chbuf->full[cont_id] == 1 ) // next container full 
+                {
+                    // update chbuf status
+                    chbuf->word_id = 34;
+                    chbuf->cont_id = cont-id;
+                    chbuf->pkt_id  = 0;
+                     
+                    // return chbuf readable
+                    this->dev.nic.status = true;
+                }
+                else                            // next container empty    
+                {
+                    // return chbuf non readable
+                    this->dev.nic.status = false;
+                }
+            }
+   
+        }
+        break;  // end READABLE
+    } 
+} // end soclib_nic_cmd()
+
+
+////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_nic_isr( device_t * dev )
+{
+    cxy_t local_cxy = LOCAL_CUSTER->cxy;
+
+    // acknowledge WTI IRQ TODO
+
+    // unblock server thread 
+    thread_t * server = dev->server;
+    thread_unblock( XPTR( local_cxy , server ) , THREAD_BLOCKED_IO );
+
+} // end soclib_nic_isr()
+
+
+
Index: trunk/kernel/drivers/soclib/soclib_cma.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_cma.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_cma.h	(revision 1)
@@ -0,0 +1,216 @@
+/*
+ * soclib_nic.h - SOCLIB_NIC (Network Interface Controler) driver definition.
+ *
+ * Author    Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_NIC_H_
+#define _SOCLIB_NIC_H_
+
+#include <device.h>
+#include <hal_types.h>
+
+/********************************************************************************************
+ * This driver supports both the Soclib VciMultiNic component, that is a GMII compliant
+ * Gigabit Ethernet controler, and the associated VciChbufDma component, that is a chained
+ * buffers DMA controler, in charge of moving packets between the NIC hardware buffers,
+ * and the kernel memory buffers.
+ *
+ * - The VciMultiNic component supports N channels, indexed by the source IP address
+ *   for the RX packets, and by the destination IP address for the TX packets. 
+ * - The VciChbufDma component contains 2*N channels, to support the N TX queues,
+ *   and the N RX  queues. 
+ * 
+ * The Ethernet packet length can have any value, between 64 to 1538 bytes.
+ * The data transfer unit between software and the NIC is a 4 Kbytes "container",
+ * containing an integer number of variable size packets.
+ *
+ * Each DMA TX or TX channel transfers an (infinite) stream of "containers" between 
+ * the hardware "chbuf" contained in the VciMultiNic hardware components, and the software 
+ * "chbuf" located in a given cluster kernel memory, and implementing the TX or RX queue.
+ * Each NIC channel contains one two-containers RX chbuf, and one two-containers TX chbuf.
+ *
+ * The max number of packets in a container is 66 packets.
+ * The first 34 words of a container are the container header :
+ *
+ *     word0  	| 	NB_WORDS	|	NB_PACKETS	|
+ *     word1	|	PLEN[0]		|	PLEN[1]		|
+ *      ...	    |	.......		|	........	|
+ *     word33	|	PLEN[64]	|	PLEN[65]	|
+ *
+ *  - NB_PACKETS is the actual number of packets in the container.
+ *	- NB_WORDS   is the number of useful words in the container.
+ *	- PLEN[i]    is the number of bytes for the packet[i].
+ *
+ * Packets are stored in the (1024 - 34) following words, and the packets are word-aligned.
+ *
+ * 	- The first 4 Kbytes contain the RX_0 container data
+ * 	- The next  4 Kbytes contain the RX_1 container data
+ * 	- The next  4 Kbytes contain the TX_0 container data
+ * 	- The next  4 Kbytes contain the TX_1 container data
+ * 	- The next  4 Kbytes contain the channel addressable registers:
+ *      * NIC_RX_STS_0      : RX_0 status               (read/write)
+ *      * NIC_RX_STS_1      : RX_1 status               (read/write)
+ *      * NIC_TX_STS_0      : TX_0 status               (read/write)
+ *      * NIC_TX_STS_1      : TX_1 status               (read/write)
+ *      * NIC_RX_DESC_LO_0  : RX_0 descriptor low word  (read/write)
+ *      * NIC_RX_DESC_HI_0  : RX_0 descriptor high word (read/write)
+ *      * NIC_RX_DESC_LO_1  : RX_1 descriptor low word  (read/write)
+ *      * NIC_RX_DESC_HI_1  : RX_1 descriptor high word (read/write)
+ *      * NIC_TX_DESC_LO_0  : TX_0 descriptor low word  (read/write)
+ *      * NIC_TX_DESC_HI_0  : TX_0 descriptor high word (read/write)
+ *      * NIC_TX_DESC_LO_1  : TX_1 descriptor low word  (read/write)
+ *      * NIC_TX_DESC_HI_1  : TX_1 descriptor high word (read/write)
+ * 		* NIC_MAC_4         : MAC @ 32 LSB bits         (read_only)
+ * 		* NIC_MAC_2         : MAC @ 16 MSB bits         (read_only)
+ *      * NIC_RX_RUN        : RX channel X activated    (write_only)
+ *      * NIC_TX_RUN        : TX channel X activated    (write_only)
+ *
+ * To access both the container status, and the data contained in the container, the DMA
+ * uses two physical addresses, that are packed in a 64 bits "container descriptor". 
+ * - desc[25:0]  contain bits[31:6] of the status physical address.
+ * - desc[51:26] contain bits[31:6] of the buffer physical address.
+ * - desc[63:52] contain the common 12 physical address extension bits.
+ * Both the buffer address and its status address must be 64 bytes aligned.
+ *******************************************************************************************/
+
+/********************************************************************************************
+ *       SOCLIB_NIC registers offset 
+ *******************************************************************************************/
+
+enum SoclibMultiNicHyperRegisters {
+    NIC_G_VIS                        = 0,    * bitfield : bit N = 0 -> channel N disabled
+    NIC_G_ON                         = 1,    * boolean : NIC component activated
+    NIC_G_NB_CHAN                    = 2,    * Number of channels (read only)
+    NIC_G_BC_ENABLE                  = 3,    * boolean : Enable Broadcast if non zero
+    NIC_G_TDM_ENABLE                 = 4,    * boolean : TDM Scheduler if non zero
+    NIC_G_TDM_PERIOD                 = 5,    * TDM time slot value
+    NIC_G_BYPASS_ENABLE              = 6,    * boolean : Enable bypass for TX packets
+    NIC_G_MAC_4                      = 8,    * channel mac address 32 LSB bits array[8]
+    NIC_G_MAC_2                      = 16,   * channel mac address 16 MSB bits array[8]
+    NIC_G_NPKT_RX_G2S_RECEIVED       = 32,   * number of packets received on GMII RX port
+    NIC_G_NPKT_RX_G2S_DISCARDED      = 33,   * number of RX packets discarded by RX_G2S FSM
+
+    NIC_G_NPKT_RX_DES_SUCCESS        = 34,   * number of RX packets transmited by RX_DES FSM
+    NIC_G_NPKT_RX_DES_TOO_SMALL      = 35,   * number of discarded too small RX packets (<60B)
+    NIC_G_NPKT_RX_DES_TOO_BIG        = 36,   * number of discarded too big RX packets (>1514B)
+    NIC_G_NPKT_RX_DES_MFIFO_FULL     = 37,   * number of discarded RX packets fifo full
+    NIC_G_NPKT_RX_DES_CRC_FAIL       = 38,   * number of discarded RX packets CRC32 failure
+
+    NIC_G_NPKT_RX_DISPATCH_RECEIVED  = 39,   * number of packets received by RX_DISPATCH FSM
+    NIC_G_NPKT_RX_DISPATCH_BROADCAST = 40,   * number of broadcast RX packets received
+    NIC_G_NPKT_RX_DISPATCH_DST_FAIL  = 41,   * number of discarded RX packets DST MAC not found
+    NIC_G_NPKT_RX_DISPATCH_CH_FULL   = 42,   * number of discarded RX packets for channel full
+
+    NIC_G_NPKT_TX_DISPATCH_RECEIVED  = 43,   * number of packets received by TX_DISPATCH FSM
+    NIC_G_NPKT_TX_DISPATCH_TOO_SMALL = 44,   * number of discarded too small TX packets (<60B)
+    NIC_G_NPKT_TX_DISPATCH_TOO_BIG   = 45,   * number of discarded too big TX packets (>1514B)
+    NIC_G_NPKT_TX_DISPATCH_SRC_FAIL  = 46,   * number of discarded TX packets SRC MAC failed
+    NIC_G_NPKT_TX_DISPATCH_BROADCAST = 47,   * number of broadcast TX packets received
+    NIC_G_NPKT_TX_DISPATCH_BYPASS    = 48,   * number of bypassed TX->RX packets
+    NIC_G_NPKT_TX_DISPATCH_TRANSMIT  = 49,   * number of transmit TX packets
+
+    NIC_CHANNEL_SPAN                 = 0x2000,
+};
+
+enum SoclibMultiNicChannelRegisters 
+{
+    NIC_RX_STS_0              = 0,    * RX_0 status (full or empty)      (Read/Write)
+    NIC_RX_STS_1              = 16,   * RX_1 status (full or empty)      (Read/Write)
+    NIC_TX_STS_0              = 32,   * TX_0 status (full or empty)      (Read/Write)
+    NIC_TX_STS_1              = 48,   * TX_1 status (full or empty)      (Read/Write)
+    NIC_RX_DESC_LO_0          = 64,   * RX_0 descriptor low word         (Read/Write)
+    NIC_RX_DESC_HI_0          = 65,   * RX_0 descriptor high word        (Read/Write)
+    NIC_RX_DESC_LO_1          = 66,   * RX_1 descriptor low word         (Read/Write)
+    NIC_RX_DESC_HI_1          = 67,   * RX_1 descriptor high word        (Read/Write) 
+    NIC_TX_DESC_LO_0          = 68,   * TX_0 descriptor low word         (Read/Write)
+    NIC_TX_DESC_HI_0          = 69,   * TX_0 descriptor high word        (Read/Write) 
+    NIC_TX_DESC_LO_1          = 70,   * TX_1 descriptor low word         (Read/Write)
+    NIC_TX_DESC_HI_1          = 71,   * TX_1 descriptor high word        (Read/Write) 
+    NIC_MAC_4                 = 72,   * channel mac address 32 LSB bits  (Read Only)
+    NIC_MAC_2                 = 73,   * channel mac address 16 LSB bits  (Read Only)
+    NIC_RX_RUN                = 74,   * RX packets can be received       (write_only)
+    NIC_TX_RUN                = 75,   * TX packets can be transmitted    (write_only)
+};
+
+
+
+/********************************************************************************************
+ * This structure defines the chained buffer descriptor, used to implement both
+ * the RX and TX packets queues. Each buffer in a chbuf (called container) is a 4 Kbytes
+ * buffer containing a variable number of packets. All containers are allocated in 
+ * the same cluster as the associated NIC device descriptor. The chbuf descriptor contains:
+ * - an array of container pointers cont[], used by the kernet threads to access the
+ *   packets contained in the containers.
+ * - an array of set/reset Boolean full[] used by both the software threads and 
+ *   by the hardware FSMs for lock-less synchronisation. 
+ * - an array of containers descriptors containing the physical addresses of the
+ *   "full[i]" and "cont[i]" variables, used by the DMA FSMs. and an array of set/reset
+ * Moreover, It contains three pointers (cont_id, pkt_id, and word_id) that are private
+ * variables used by the software thread to store the chbuf global state. 
+ *******************************************************************************************/
+
+typedef struct nic_chbuf_s
+{
+    uint32_t * cont[CONFIG_NIC_CHBUF_DEPTH]; /*! container virtual base address            */
+    uint32_t   full[CONFIG_NIC_CHBUF_DEPTH]; /*! Boolean : container full if non zero      */
+    uint64_t   desc[CONFIG_NIC_CHBUF_DEPTH]  /*! container & status physical addresses     */
+    uint32_t   cont_id;                      /*! current container index                   */
+    uint32_t   pkt_id;                       /*! current packet index in container         */
+    uint32_t   word_id;                      /*! first word of current packet              */
+}
+nic_chbuf_t;
+
+/********************************************************************************************
+ *        SOCLIB_NIC driver access functions 
+ *******************************************************************************************/
+
+/********************************************************************************************
+ * This function initializes the SOCLIB_NIC hardware registers, allocates memory for
+ * the RX and TX containers, alocates and initializes the RX and TX chbuf descriptors.
+ * It allocates one WTI mailbox for the IRQ signaling availability of an RX full container,
+ * or a TX empty container, and route the WTI IRQ to the core running the server thread.
+ ********************************************************************************************
+ * @ dev     : extended pointer on the generic NIC device descriptor.
+ *******************************************************************************************/
+extern void soclib_nic_init( xptr_t dev );
+
+/********************************************************************************************
+ * This function implement the READ / WRITE / READABLE / WRITABLE commands.
+ * - READABLE : returns in the command status a boolean true if a packet is available.
+ *   It update the RX queue read pointer if required.
+ * - READ : move a packet from the RX queue to the command buffer, and returns the packet
+ *   length in the command. The READABLE command must be called before the READ command.
+ * - WRITABLE : returns in the command status a boolean true if a packet with a given length
+ *   can be written in the TX queue. It update the RX queue read pointer if required.
+ * - WRITE : move a packet from the command buffer to the TX queue. The WRITABLE command
+ *   must be called before the WRITE command.
+ *******************************************************************************************/
+extern void soclib_nic_cmd();
+
+/********************************************************************************************
+ * TODO
+ ********************************************************************************************
+ * @ dev     : local pointer on the generic IOC device descriptor.
+ *******************************************************************************************/
+extern void soclib_nic_isr( device_t * dev );
+
+
+#endif /* _BLOCK_H_ */
Index: trunk/kernel/drivers/soclib/soclib_dma.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_dma.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_dma.c	(revision 1)
@@ -0,0 +1,377 @@
+/*
+ * soclib_dma.c - soclib DMA driver
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
+#include <drvdb.h>
+#include <kmem.h>
+#include <scheduler.h>
+#include <thread.h>
+#include <task.h>
+#include <list.h>
+#include <event.h>
+#include <soclib_dma.h>
+#include <string.h>
+
+/* DMA mapped registers offset */
+#define DMA_SRC_REG          0
+#define DMA_DST_REG          1
+#define DMA_LEN_REG          2
+#define DMA_RESET_REG        3
+#define DMA_IRQ_DISABLED     4
+
+struct dma_context_s
+{
+	struct list_entry request_queue;
+	struct wait_queue_s pending;
+};
+
+static void dma_start_request(struct device_s *dma, dev_request_t *ptr)
+{
+	volatile uint32_t *base = dma->base;
+	dev_request_t *rq;
+
+	rq = (ptr->flags & DEV_RQ_NESTED) ? ptr->data : ptr;
+
+	base[DMA_SRC_REG]      = (unsigned int)rq->src;
+	base[DMA_DST_REG]      = (unsigned int)rq->dst;
+	base[DMA_IRQ_DISABLED] = 0;
+	base[DMA_LEN_REG]      = rq->count;
+}
+
+static void dma_irq_handler(struct irq_action_s *action)
+{
+	struct dma_context_s *ctx;
+	struct device_s *dma;
+	dev_request_t *rq;
+	dev_request_t *frag;
+	dev_request_t *new_rq;
+	error_t err;
+	volatile uint32_t *base;
+	struct thread_s *this;
+
+	dma  = action->dev;
+	base = dma->base;
+	ctx  = (struct dma_context_s*)dma->data;
+
+	cpu_spinlock_lock(&dma->lock.val);
+  
+	err = base[DMA_LEN_REG];
+	base[DMA_RESET_REG] = 0;
+
+	/* even if this case is realy low probable, we have to check for empty list ! */
+	if(list_empty(&ctx->request_queue))
+	{
+		cpu_spinlock_unlock(&dma->lock.val);
+		return;
+	}
+
+	rq = list_first(&ctx->request_queue, dev_request_t, list);
+
+	if(rq->flags & DEV_RQ_NESTED)
+	{
+		frag = rq->data;
+
+		event_set_error(&frag->event, err);
+		event_set_senderId(&frag->event, dma);
+		event_send(&frag->event, current_cpu->gid);
+
+		if((err == 0) && (frag->data != NULL))
+		{
+			rq->data = frag->data;
+			dma_start_request(dma,frag->data);
+			cpu_spinlock_unlock(&dma->lock.val);
+			return;
+		}
+	}
+
+	list_unlink(&rq->list);
+  
+	if(!(list_empty(&ctx->request_queue)))
+	{
+		new_rq = list_first(&ctx->request_queue, dev_request_t, list);
+		dma_start_request(dma,new_rq);
+	}
+  
+	if(!(rq->flags & DEV_RQ_NOBLOCK))
+	{
+		rq->err = err;
+		wakeup_one(&ctx->pending, WAIT_FIRST);
+		cpu_spinlock_unlock(&dma->lock.val);
+		return;
+	}
+  
+	cpu_spinlock_unlock(&dma->lock.val);
+
+	this = CURRENT_THREAD;
+ 
+	event_set_error(&rq->event, err);
+	event_set_senderId(&rq->event, dma);
+	event_send(&rq->event, current_cpu->gid);
+}
+
+static void dma_fraglist_destroy(dev_request_t *ptr)
+{
+	kmem_req_t req;
+	dev_request_t *frag;
+
+	req.type = KMEM_DMA_REQUEST;
+	frag     = ptr;
+
+	while(frag != NULL);
+	{
+		req.ptr = frag;
+		frag    = frag->data;
+
+		kmem_free(&req);
+	}
+}
+
+static EVENT_HANDLER(dma_async_frag_event)
+{
+	dev_request_t *frag;
+	kmem_req_t req;
+	error_t err;
+
+	frag = event_get_argument(event);
+	err  = event_get_error(event);
+
+	assert(frag != NULL && "corrupted frag");
+
+	if(err)
+	{
+		dma_fraglist_destroy(frag);
+		return 0;
+	}
+
+	req.type = KMEM_DMA_REQUEST;
+	req.ptr  = frag;
+
+	kmem_free(&req);
+	return 0;
+}
+
+static error_t dma_frag_init(dev_request_t *frag, uint_t src_start, uint_t dst_start, uint_t count)
+{
+	//FIXME(40) use extent registers
+	frag->src   = task_vaddr2paddr(current_task, (void*)src_start);
+	frag->dst   = task_vaddr2paddr(current_task, (void*)dst_start);
+	frag->count = count;
+	frag->flags = 0;
+
+	if((frag->src == NULL) || (frag->dst == NULL))
+		return EPERM;
+
+	event_set_priority(&frag->event, E_FUNC);
+	event_set_handler(&frag->event, &dma_async_frag_event);
+	event_set_argument(&frag->event, frag);
+	return 0;
+}
+
+static error_t dma_fraglist_build(dev_request_t *rq)
+{
+	kmem_req_t req;
+	dev_request_t *frag;
+	dev_request_t *parent_frag;
+	struct slist_entry *root;
+	struct slist_entry *iter;
+	uint_t src_start;
+	uint_t dst_start;
+	uint_t count;
+	error_t err;
+
+	if(rq->count == 0)
+		return EINVAL;
+
+	src_start = (uint_t)rq->src;
+	dst_start = (uint_t)rq->dst;
+
+	if((src_start + rq->count) <= ((src_start & ~PMM_PAGE_MASK) + PMM_PAGE_SIZE) &&
+	   (dst_start + rq->count) <= ((dst_start & ~PMM_PAGE_MASK) + PMM_PAGE_SIZE))
+	{
+		//FIXME(40) use extent registers
+		rq->src = task_vaddr2paddr(current_task, rq->src);
+		rq->dst = task_vaddr2paddr(current_task, rq->dst);
+
+		if((rq->src == NULL) || (rq->dst == NULL))
+			return EPERM;
+
+		return 0;
+	}
+
+	if((src_start & PMM_PAGE_MASK) || (dst_start & PMM_PAGE_MASK)) {
+		return ENOSYS;
+	}
+
+	req.type    = KMEM_DMA_REQUEST;
+	req.size    = sizeof(*rq);
+	req.flags   = AF_KERNEL;
+	root        = (struct slist_entry *)&rq->data;
+	iter        = (struct slist_entry *)&rq->list;
+	count       = rq->count;
+	rq->data    = NULL;
+	rq->flags  &= ~DEV_RQ_NESTED;
+	parent_frag = rq;
+
+	while(count)
+	{
+		frag = kmem_alloc(&req);
+
+		if(frag == NULL)
+		{
+			err = ENOMEM;
+			goto fail_nomem;
+		}
+
+		if(count >= PMM_PAGE_SIZE)
+		{
+			err = dma_frag_init(frag, src_start, dst_start, PMM_PAGE_SIZE);
+
+			if(err)
+				goto fail_init;
+
+			src_start += PMM_PAGE_SIZE;
+			dst_start += PMM_PAGE_SIZE;
+			count     -= PMM_PAGE_SIZE;
+		}
+		else
+		{
+			err = dma_frag_init(frag, src_start, dst_start, count);
+
+			if(err)
+				goto fail_init;
+
+			count -= count;
+		}
+
+		parent_frag->data = frag;
+		frag->data        = NULL;
+		parent_frag       = frag;
+	}
+
+	rq->flags |= DEV_RQ_NESTED;
+	return 0;
+
+fail_init:
+fail_nomem:
+	dma_fraglist_destroy(rq->data);
+	return err;
+}
+
+
+static sint_t dma_request(struct device_s *dma, dev_request_t *rq)
+{
+	struct dma_context_s *ctx;
+	uint_t irq_state;
+	sint_t err;
+
+	rq->err = 0;
+	ctx     = (struct dma_context_s*)dma->data;
+
+	err = dma_fraglist_build(rq);
+
+	if(err)
+		return err;
+
+	spinlock_lock_noirq(&dma->lock,&irq_state);
+
+	if(list_empty(&ctx->request_queue))
+	{
+		list_add(&ctx->request_queue, &rq->list);
+		dma_start_request(dma, rq);
+	}
+	else
+		list_add_last(&ctx->request_queue, &rq->list);
+
+	if(rq->flags & DEV_RQ_NOBLOCK)
+	{
+		spinlock_unlock_noirq(&dma->lock, irq_state);
+		return 0;
+	}
+
+	wait_on(&ctx->pending, WAIT_LAST);
+	spinlock_unlock_noirq(&dma->lock,irq_state);
+	sched_sleep(CURRENT_THREAD);
+
+	return rq->err;
+}
+
+static sint_t dma_open(struct device_s *dma, dev_request_t *rq)
+{
+	return EPERM;
+}
+
+struct device_s *__sys_dma;
+static uint_t dma_count = 0;
+
+error_t soclib_dma_init(struct device_s *dma)
+{
+	kmem_req_t req;
+	struct dma_context_s *ctx;
+
+	spinlock_init(&dma->lock,"DevDMA (SoCLib)");
+	dma->type = DEV_BLK;
+
+	dma->action.dev         = dma;
+	dma->action.irq_handler = &dma_irq_handler;
+	dma->action.data        = NULL;
+
+	if(dma_count == 0)
+		__sys_dma = dma;
+
+	sprintk(dma->name, 
+#if CONFIG_ROOTFS_IS_VFAT
+		"DMA%d"
+#else
+		"dma%d"
+#endif
+		,dma_count++);
+
+	metafs_init(&dma->node, dma->name);
+  
+	dma->op.dev.open       = &dma_open;
+	dma->op.dev.read       = &dma_request;
+	dma->op.dev.write      = &dma_request;
+	dma->op.dev.close      = NULL;
+	dma->op.dev.lseek      = NULL;
+	dma->op.dev.mmap       = NULL;
+	dma->op.dev.munmap     = NULL;
+	dma->op.dev.set_params = NULL;
+	dma->op.dev.get_params = NULL;
+	dma->op.drvid          = SOCLIB_DMA_ID;
+
+	req.type  = KMEM_GENERIC;
+	req.size  = sizeof(*ctx);
+	req.flags = AF_BOOT | AF_ZERO;
+  
+	if((ctx = kmem_alloc(&req)) == NULL)
+		return ENOMEM;
+
+	wait_queue_init(&ctx->pending, dma->name);
+	list_root_init(&ctx->request_queue);
+	dma->data = (void *)ctx;
+	return 0;
+}
+
+driver_t soclib_dma_driver = { .init = &soclib_dma_init };
Index: trunk/kernel/drivers/soclib/soclib_dma.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_dma.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_dma.h	(revision 1)
@@ -0,0 +1,28 @@
+/*
+ * soclib_dma.c - soclib DMA driver
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_DMA_H_
+#define _SOCLIB_DMA_H_
+
+extern struct driver_s soclib_dma_driver;
+
+#endif	/* _SOCLIB_DMA_H_ */
Index: trunk/kernel/drivers/soclib/soclib_fbf.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_fbf.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_fbf.c	(revision 1)
@@ -0,0 +1,23 @@
+/*
+ * soclib_fbf.c - soclib frame-buffer driver implementation.
+ *
+ * Author Alain greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH..
+ *
+ * ALMOS-MKH. is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH. is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
Index: trunk/kernel/drivers/soclib/soclib_fbf.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_fbf.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_fbf.h	(revision 1)
@@ -0,0 +1,28 @@
+/*
+ * soclib_fbf.h - soclib frame-buffer driver definition.
+ *
+ * Author Alain greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_FB_H_
+#define _SOCLIB_FB_H_
+
+
+#endif
Index: trunk/kernel/drivers/soclib/soclib_hba.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_hba.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_hba.c	(revision 1)
@@ -0,0 +1,277 @@
+/*
+ * soclib_hba.c - soclib AHCI block device driver implementation.
+ *
+ * Author     Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH..
+ *
+ * ALMOS-MKH. is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH. is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <printk.h>
+#include <hal_special.h>
+#include <device.h>
+#include <dev_ioc.h>
+#include <soclib_hba.h>
+#include <spinlock.h>
+#include <thread.h>
+
+//////////////////////////////////////////////////////////////////////////////////
+//   SOCLIB_HBA specific global variables
+//////////////////////////////////////////////////////////////////////////////////
+	
+// command list : up to 32 commands
+__attribute__((section(".kdata")))
+hba_cmd_desc_t     hba_cmd_list[32] __attribute__((aligned(0x40)));   
+
+// command tables array : one command table per entry in command list
+__attribute__((section(".kdata")))
+hba_cmd_table_t    hba_cmd_table[32] __attribute__((aligned(0x40))); 
+
+// extended pointer on the owner thread, for each slot
+__attribute__((section(".kdata")))
+xptr_t             hba_owner_thread[32];
+
+// bit vector of active slots
+__attribute__((section(".kdata")))
+uint32_t           hba_active_slots; 
+
+// spinlock protecting the command slot allocator
+__attribute__((section(".kdata")))
+spinlock_t         hba_lock;
+
+/////////////////////////////////////
+void soclib_hba_init( xptr_t dev_xp )
+{
+    // get IOC device descriptor cluster and local pointer 
+    cxy_t      dev_cxy  = GET_CXY( dev_xp );
+    device_t * dev_ptr  = (device_t *)GET_PTR( dev_xp );
+  
+    // get hardware device base address
+	xptr_t     hba_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get hardware device cluster and local pointer
+    cxy_t      hba_cxy  = GET_CXY( hba_xp );
+    uint32_t * hba_ptr  = (uint32_t *)GET_PTR( hba_xp );
+
+    // get block_size and block_count  
+	uint32_t block_size  = hal_remote_lw( XPTR( hba_cxy , hba_ptr + HBA_BLOCK_SIZE_REG ) );
+	uint32_t block_count = hal_remote_lw( XPTR( hba_cxy , hba_ptr + HBA_BLOCK_COUNT_REG ) );
+
+    // set device descriptor extension
+    hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.size  ) , block_size );
+    hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.count ) , block_count );
+
+	// reset SOCLIB_HBA driver global variables
+    hba_active_slots = 0;
+
+} // end soclib_hba_init()
+
+
+//////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_hba_command( xptr_t th_xp )
+{
+
+    uint32_t           to_mem;       // to_mem : command argument
+    uint32_t           lba;          // lba    : command argument
+    uint32_t           count;        // count  : command argument
+    xptr_t             buf_xp;       // buffer : command argument
+    xptr_t             dev_xp;       // device : command argument
+    uint32_t           cmd_id;       // current slot index in command bit_vector
+    hba_cmd_desc_t   * cmd_desc;     // command descriptor pointer   
+    hba_cmd_table_t  * cmd_table;    // command table pointer
+    bool_t             found;
+    uint32_t           iter; 
+
+    // get client thread cluster and local pointer
+    cxy_t      th_cxy = GET_CXY( th_xp );
+    thread_t * th_ptr = (thread_t *)GET_PTR( th_xp );
+
+    // get command arguments and extended pointer on IOC device
+    to_mem    =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.to_mem ) );
+    lba       =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.lba    ) );
+    count     =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.count  ) );
+    buf_xp    = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.ioc.buf_xp ) );
+    dev_xp    = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.ioc.dev_xp ) );
+
+    // get IOC device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get extended pointer on SOCLIB-HBA peripheral
+    xptr_t     hba_xp = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get SOCLIB_HBA device cluster and local pointer
+    cxy_t      hba_cxy = GET_CXY( hba_xp );
+    uint32_t * hba_ptr = (uint32_t *)GET_PTR( hba_xp );
+
+    // try to register the I/O operation in a free slot 
+    // returns if success, deschedule if no slot available
+    // we do not need a lock to access the slot allocator,
+    // because the driver is only called by the server thread.
+    while( 1 )
+    {
+        // try to find a free slot in the 32 slots command list
+        cmd_id = 0;
+        found  = false;
+        for ( iter = 0 ; iter < 32 ; iter++ )
+        {
+            if( (hba_active_slots & (1<<iter) ) == 0 )
+            {
+                found  = true;
+                cmd_id = iter;
+                hba_active_slots |= (1<<iter);
+                break;
+            }
+        }
+
+        if( found )  // register and starts the I/O operation
+        {
+            // compute pointers on command descriptor and command table    
+            cmd_desc  = &hba_cmd_list[cmd_id];
+            cmd_table = &hba_cmd_table[cmd_id];
+
+            // set  buffer descriptor in command table 
+            cmd_table->buffer.dba  = (uint32_t)(buf_xp);   
+            cmd_table->buffer.dbau = (uint32_t)(buf_xp >> 32);
+            cmd_table->buffer.dbc  = count * 512;
+
+            // initialize command table header
+            cmd_table->header.lba0 = (char)lba;
+            cmd_table->header.lba1 = (char)(lba>>8);
+            cmd_table->header.lba2 = (char)(lba>>16);
+            cmd_table->header.lba3 = (char)(lba>>24);
+            cmd_table->header.lba4 = 0;
+            cmd_table->header.lba5 = 0;
+
+            // initialise command descriptor
+            cmd_desc->prdtl[0] = 1;
+            cmd_desc->prdtl[1] = 0;
+            if( to_mem ) cmd_desc->flag[0] = 0x00;
+            else         cmd_desc->flag[0] = 0x40;     
+
+#if USE_IOB // software L2/L3 cache coherence 
+
+            // compute physical addresses 
+            paddr_t   cmd_desc_paddr;    // command descriptor physical address
+            paddr_t   cmd_table_paddr;   // command table header physical address
+            bool_t    ident = CONFIG_KERNEL_IDENTITY;
+            
+            error = vmm_v2p_translate( ident , cmd_table , &cmd_table_paddr );
+            if( error )
+            {
+                printk("\n[PANIC] in %s : cannot get paddr fo cmd_table\n", __FUNCTION__ );
+                hal_core_sleep()
+            }
+
+            error = vmm_v2p_translate( ident , cmd_desc , &cmd_desc_paddr );
+            if( error )
+            {
+                printk("\n[PANIC] in %s : cannot get paddr fo cmd_desc\n", __FUNCTION__ );
+                hal_core_sleep()
+            }
+
+            // update L3 for command table 
+            dev_mmc_sync( cmd_table_paddr , sizeof(hba_cmd_table_t) );
+
+            // update L3 for command descriptor
+            dev_mmc_sync( cmd_desc_paddr , sizeof(hba_cmd_desc_t) );
+
+#endif // end software L2/L3 cache coherence
+
+            // activates HBA interrupts 
+            hal_remote_sw( XPTR( hba_cxy , hba_ptr + HBA_PXIE_REG ) , 0x1 );
+
+            // set hba_owner_thread[slot] 
+            hba_owner_thread[cmd_id] = th_xp;
+
+            // set HBA_PXCI_REG to start transfer
+            hal_remote_sw( XPTR( hba_cxy , hba_ptr + HBA_PXCI_REG ) , 1<<cmd_id );
+
+            ioc_dmsg("INFO in %s : thread %x / buffer = %llx at cycle %d\n",
+            __FUNCTION__ , hal_remote_lw( XPTR( th_cxy , &th_ptr->trdid ) ) ,
+            buf_xp , hal_time_stamp() );
+
+            // exit the while 
+            break;
+        }
+        else   // deschedule if no slot available in SOCLIB_HBA
+        {
+            sched_yield();
+        }
+    }  // end while
+            
+} // end soclib_hba_cmd()
+
+
+////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_hba_isr( device_t * dev )
+{
+    // get extended pointer on client thread
+    xptr_t root      = XPTR( local_cxy , &dev->wait_root );
+    xptr_t client_xp = XLIST_FIRST_ELEMENT( root , thread_t , wait_list );
+
+    // get client thread cluster and local pointer
+    cxy_t      client_cxy = GET_CXY( client_xp );
+    thread_t * client_ptr = (thread_t *)GET_PTR( client_xp );
+
+    // get SOCLIB_HBA device cluster and local pointer
+    cxy_t      hba_cxy  = GET_CXY( dev->base );
+    uint32_t * hba_ptr  = (uint32_t *)GET_PTR( dev->base );
+
+    // get HBA_PXIS_REG and HBA_PXIS_REG current values
+    uint32_t current_pxis = hal_remote_lw( XPTR( hba_cxy , hba_ptr + HBA_PXIS_REG ) );
+    uint32_t current_pxci = hal_remote_lw( XPTR( hba_cxy , hba_ptr + HBA_PXCI_REG ) );
+
+    uint32_t  error    = (current_pxis & 0x40000000) >> 30;
+    uint32_t  fault_id = (current_pxis & 0x1F000000) >> 24;
+    uint32_t  iter;
+
+    // loop on active commands to signal one or several completed I/O operations
+    for( iter = 0 ; iter < 32 ; iter++ )
+    {
+        if ( ( (hba_active_slots & (1<<iter)) != 0 ) &&  // active command
+             ( (current_pxci     & (1<<iter)) == 0 ) )   // completed command
+        {
+            // release the slot
+            hba_active_slots &= ~(1<<iter);
+
+            // set operation status in client thread command
+            if( error && (iter == fault_id ) ) 
+            {
+                hal_remote_sw( XPTR( client_cxy , &client_ptr->dev.ioc.error ) , 1 );
+            }
+            else
+            {
+                hal_remote_sw( XPTR( client_cxy , &client_ptr->dev.ioc.error ) , 0 );
+            }
+
+            // unblock client thread
+            thread_unblock( client_xp , THREAD_BLOCKED_IO );
+ 
+            ioc_dmsg("INFO in %s : thread %x at cycle %d\n",
+            __FUNCTION__ , hal_remote_lw( XPTR( client_cxy , &client_ptr->trdid ) ) ,
+            hal_time_stamp() );
+        }
+    }
+
+    // reset HBA_PXIS_REG
+    hal_remote_sw( XPTR( hba_cxy , hba_ptr + HBA_PXIS_REG ) , 0 );
+
+} // end soclib_hba_isr()
+
+
+
Index: trunk/kernel/drivers/soclib/soclib_hba.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_hba.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_hba.h	(revision 1)
@@ -0,0 +1,160 @@
+/*
+ * soclib_hba.h - soclib AHCI block device driver definition.
+ *
+ * Author        Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_HBA_H_
+#define _SOCLIB_HBA_H_
+
+#include <device.h>
+#include <hal_types.h>
+
+/*****************************************************************************************
+ * This driver supports the SocLib VciMultiAhci component, that is a multi-channels,
+ * block oriented, external storage controler, respecting the AHCI standard.
+ *
+ * 1. Each HBA channel define an independant physical disk, but this driver
+ *    supports only channel 0, because ALMOS-MKH uses only one physical disk.
+ *
+ * 2. The SOCLIB HBA component support split memory buffers (several physical
+ *    buffers for one single command), but this driver supports only one
+ *    single buffer I/O operation.
+ *
+ * 3. The "command list" can register up to 32 independant commands, posted
+ *    by different user threads. The command list is filled by the server
+ *    thread associated to the device, using one free slot per command, until the
+ *    device waiting queue of client threads is empty.
+ *
+ * 4. As there is only one interrupt, and the registered I/O operation can complete
+ *    in any order, this interrupt is not linked to a specific I/O operation.
+ *    The associated HBA_ISR unblock all client threads that have a completed command,
+ *    using the "hba_active_slots" and "hba_owner_thread[32]" global variables.
+ ****************************************************************************************/
+
+/*****************************************************************************************
+ * HBA component registers offsets
+ ****************************************************************************************/
+
+enum SoclibMultiAhciRegisters 
+{
+  HBA_PXCLB_REG        = 0,         // command list base address 32 LSB bits
+  HBA_PXCLBU_REG       = 1,         // command list base address 32 MSB bits
+  HBA_PXIS_REG         = 4,         // interrupt status
+  HBA_PXIE_REG         = 5,         // interrupt enable
+  HBA_PXCMD_REG        = 6,         // run
+  HBA_BLOCK_SIZE_REG   = 7,         // number of bytes per block
+  HBA_BLOCK_COUNT_REG  = 8,         // number of blocks
+  HBA_PXCI_REG         = 14,        // command bit-vector     
+
+};
+
+/*****************************************************************************************
+ * This structure defines the command header  (16 bytes)
+ ****************************************************************************************/
+
+typedef struct hba_cmd_header_s  
+{
+    unsigned int        res0;       // reserved	
+    unsigned char	    lba0;	    // LBA 7:0
+    unsigned char	    lba1;	    // LBA 15:8
+    unsigned char	    lba2;	    // LBA 23:16
+    unsigned char	    res1;	    // reserved
+    unsigned char	    lba3;	    // LBA 31:24
+    unsigned char	    lba4;	    // LBA 39:32
+    unsigned char	    lba5;	    // LBA 47:40
+    unsigned char	    res2;	    // reserved
+    unsigned int        res3;       // reserved	
+
+} 
+hba_cmd_header_t;
+
+/*****************************************************************************************
+ * This structure defines the command buffer  (16 bytes)
+ ****************************************************************************************/
+
+typedef struct hba_cmd_buffer_s 
+{
+    unsigned int        dba;	    // Buffer base address 32 LSB bits
+    unsigned int        dbau;	    // Buffer base address 32 MSB bits
+    unsigned int        res0;	    // reserved
+    unsigned int        dbc;	    // Buffer byte count
+} 
+hba_cmd_buffer_t;
+
+/*****************************************************************************************
+ * This structure defines a command table  (32 bytes, because we support only one buffer)
+ ****************************************************************************************/
+
+typedef struct hba_cmd_table_s
+{
+    hba_cmd_header_t   header;      // contains LBA
+    hba_cmd_buffer_t   buffer;      // only one physical buffer
+}
+hba_cmd_table_t;
+
+/*****************************************************************************************
+ * This structure defines a command descriptor  (16 bytes)
+ ****************************************************************************************/
+
+typedef struct hba_cmd_desc_s
+{
+    unsigned char       flag[2];    // W in bit 6 of flag[0]
+    unsigned char       prdtl[2];	// Number of buffers
+    unsigned int        prdbc;		// Number of bytes actually transfered
+    unsigned int        ctba;		// Command Table base address 32 LSB bits
+    unsigned int        ctbau;		// Command Table base address 32 MSB bits
+}
+hba_cmd_desc_t;
+
+/********************************************************************************************
+ * This function access the SOCLIB_HBA hardware registers to get the block size and the
+ * number of blocks, and initialises the "extension" field of the IOC device descriptor.
+ ********************************************************************************************
+ * @ dev_xp     : extended pointer on the generic IOC device descriptor.
+ *******************************************************************************************/
+extern void soclib_hba_init( xptr_t dev_xp );
+
+/********************************************************************************************
+ * This function is called by the server thread associated to the IOC device.
+ * It decodes the IOC device command embedded in the calling thread descriptor,
+ * (format defined in the dev_ioc.h file) and starts execution of this generic command, 
+ * accessing the relevant SOCLIB_HBA hardware registers.
+ * It registers the command in the SOCLIB_HBA device and returns without blocking
+ * because this AHCI component supports up to 32 concurrent I/O operations. 
+ * It simply deschedules without blocking if the number of registered I/O operations
+ * becomes larger than 32, which should be a rare event.
+ ********************************************************************************************
+ * @ xp_thread  : extended pointer on the client thread.
+ *******************************************************************************************/
+extern void soclib_hba_command( xptr_t  thread_xp );
+
+/********************************************************************************************
+ * This Interrupt Service Routine is executed when the IRQ signaling the completion of 
+ * one or several I/O operations registered in the SOCLIB_AHCI device is received.
+ * It acknowledges the IRQ by accessing the proper SOCLIB_HBA register, and unblock
+ * all client thread that have an I/O operation completed.
+ ********************************************************************************************
+ * @ dev     : local pointer on the generic IOC device descriptor.
+ *******************************************************************************************/
+extern void soclib_hba_isr( device_t * dev );
+
+
+#endif /* _SOCLIB_HBA_H_ */
Index: trunk/kernel/drivers/soclib/soclib_iob.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_iob.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_iob.c	(revision 1)
@@ -0,0 +1,138 @@
+/*
+ * soclib_iob.c - soclib IOB driver API implementation.
+ *
+ * Alain Greiner    (2017)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <hal_remote.h>
+#include <soclib_iob.h>
+
+/////////////////////////////////////
+void soclib_iob_init( xptr_t iox_xp )
+{
+    // get IOX device cluster and local pointer
+    cxy_t      iox_cxy = GET_CXY( iox_xp );
+    device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
+
+    // get extended pointer on SOCLIB_IOB base_xp segment
+    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
+
+    // desactivate IOMMU
+    hal_remote_sw( base_xp + (IOB_IOMMU_ACTIVE<<2) , 0 );
+}
+
+////////////////////////////////////////////
+void soclib_iob_set_active( xptr_t   iox_xp,
+                            uint32_t value )
+{
+    // get IOX device cluster and local pointer
+    cxy_t      iox_cxy = GET_CXY( iox_xp );
+    device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
+
+    // get extended pointer on SOCLIB_IOB base_xp segment
+    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
+
+    // set ACTIVE register
+    hal_remote_sw( base_xp + (IOB_IOMMU_ACTIVE<<2) , value );
+}
+
+//////////////////////////////////////////
+void soclib_iob_set_ptpr( xptr_t   iox_xp,
+                          uint32_t value )
+{
+    // get IOX device cluster and local pointer
+    cxy_t      iox_cxy = GET_CXY( iox_xp );
+    device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
+
+    // get extended pointer on SOCLIB_IOB base_xp segment
+    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
+
+    // set PTPR register
+    hal_remote_sw( base_xp + (IOB_IOMMU_PTPR<<2) , value );
+}
+
+///////////////////////////////////////////
+void soclib_iob_inval_page( xptr_t  iox_xp,
+                            vpn_t   vpn )
+{
+    // get IOX device cluster and local pointer
+    cxy_t      iox_cxy = GET_CXY( iox_xp );
+    device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
+
+    // get extended pointer on SOCLIB_IOB base_xp segment
+    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
+
+    // invalidate TLB entry
+    hal_remote_sw( base_xp + (IOB_INVAL_PTE<<2) , vpn );
+}
+
+//////////////////////////////////////////////
+uint32_t soclib_iob_get_bvar( xptr_t  iox_xp )
+{
+    // get IOX device cluster and local pointer
+    cxy_t      iox_cxy = GET_CXY( iox_xp );
+    device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
+
+    // get extended pointer on SOCLIB_IOB base_xp segment
+    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
+
+    // get BVAR register
+    return hal_remote_lw( base_xp + (IOB_IOMMU_BVAR<<2) );
+}
+
+///////////////////////////////////////////////
+uint32_t soclib_iob_get_srcid( xptr_t  iox_xp )
+{
+    // get IOX device cluster and local pointer
+    cxy_t      iox_cxy = GET_CXY( iox_xp );
+    device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
+
+    // get extended pointer on SOCLIB_IOB base_xp segment
+    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
+
+    // get BVAR register
+    return hal_remote_lw( base_xp + (IOB_IOMMU_SRCID<<2) );
+}
+
+///////////////////////////////////////////////
+uint32_t soclib_iob_get_error( xptr_t  iox_xp )
+{
+    // get IOX device cluster and local pointer
+    cxy_t      iox_cxy = GET_CXY( iox_xp );
+    device_t * iox_ptr = (device_t *)GET_PTR( iox_xp );
+
+    // get extended pointer on SOCLIB_IOB base_xp segment
+    xptr_t base_xp = (xptr_t)hal_remote_lwd( XPTR( iox_cxy , &iox_ptr->base ) );
+
+    // get BVAR register
+    return hal_remote_lw( base_xp + (IOB_IOMMU_ERROR<<2) );
+}
+
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
+// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
+
Index: trunk/kernel/drivers/soclib/soclib_iob.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_iob.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_iob.h	(revision 1)
@@ -0,0 +1,129 @@
+/*
+ * soclib_iob.h - soclib IOB driver API definition.
+ *
+ * Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_IOB_H_
+#define _SOCLIB_IOB_H_
+
+#include <hal_types.h>
+#include <device.h>
+
+/******************************************************************************************
+ *    SOCLIB_IOB  Registers Mnemonics
+ *****************************************************************************************/
+
+enum IOB_registers 
+{
+    IOB_IOMMU_PTPR       = 0,      // R/W : Page Table Pointer Register
+    IOB_IOMMU_ACTIVE     = 1,      // R/W : IOMMU activated if not 0
+    IOB_IOMMU_BVAR       = 2,      // R   : Bad Virtual Address (unmapped) 
+    IOB_IOMMU_ERROR      = 3,      // R   : Error Type 
+    IOB_IOMMU_SRCID      = 4,      // R   : Faulty Peripheral Index (SRCID)
+    IOB_INVAL_PTE        = 5,      // W   : Invalidate a PTE (virtual address)
+    IOB_WTI_ENABLE       = 6,      // R/W : Enable WTIs (both IOMMU and peripherals)
+    IOB_WTI_ADDR_LO      = 7,      // W/R : 32 LSB bits for IOMMU WTI
+    IOB_WTI_ADDR_HI      = 8,      // W/R : 32 MSB bits for IOMMU WTI
+};
+
+enum mmu_error_type_e 
+{
+    MMU_NONE                      = 0x0000, // None
+    MMU_WRITE_ACCES_VIOLATION     = 0x0008, // Write access to a non writable page 
+    MMU_WRITE_PT1_ILLEGAL_ACCESS  = 0x0040, // Write Bus Error accessing Table 1       
+    MMU_READ_PT1_UNMAPPED 	      = 0x1001, // Read  Page fault on Page Table 1  	
+    MMU_READ_PT2_UNMAPPED 	      = 0x1002, // Read  Page fault on Page Table 2  
+    MMU_READ_PT1_ILLEGAL_ACCESS   = 0x1040, // Read  Bus Error in Table1 access      
+    MMU_READ_PT2_ILLEGAL_ACCESS   = 0x1080, // Read  Bus Error in Table2 access 	
+    MMU_READ_DATA_ILLEGAL_ACCESS  = 0x1100, // Read  Bus Error in cache access 
+};
+
+
+/******************************************************************************************
+ * This function initializes the SOCLIB IOB component:
+ ******************************************************************************************
+ * @ iob_xp     : extended pointer on the remote IOX device descriptor.
+ *****************************************************************************************/
+void soclib_iob_init( xptr_t iox_xp );
+
+/******************************************************************************************
+ * This function set a new value in the IOB_IOMMU_ACTIVE register.
+ ******************************************************************************************
+ * @ iob_xp     : extended pointer on the remote XCU device descriptor.
+ * @ value      : value to be written in register.
+ *****************************************************************************************/
+void soclib_iob_set_active( xptr_t   iox_xp,
+                            uint32_t value );
+
+/******************************************************************************************
+ * This function set a new value in the IOB_IOMMU_PTPR register.
+ ******************************************************************************************
+ * @ iob_xp     : extended pointer on the remote XCU device descriptor.
+ * @ value      : value to be written in register IOMMU.
+ *****************************************************************************************/
+void soclib_iob_set_ptpr( xptr_t   iob_xp,
+                          uint32_t value );
+
+/******************************************************************************************
+ * This function invaldates a TLB entry identified by its vpn.
+ ******************************************************************************************
+ * @ iox_xp     : extended pointer on the remote XCU device descriptor.
+ * @ vpn        : virtual page number.
+ *****************************************************************************************/
+void soclib_iob_inval_page( xptr_t  iox_xp,
+                            vpn_t   vpn );
+
+/******************************************************************************************
+ * This function returns the content of IOB_IOMMU_BVAR register.
+ ******************************************************************************************
+ * @ iox_xp     : extended pointer on the remote XCU device descriptor.
+ * @ return registered bad virtual address (after error reported by IOMMU).
+ *****************************************************************************************/
+uint32_t soclib_iob_get_bvar( xptr_t  iox_xp );
+
+/******************************************************************************************
+ * This function returns the content of IOB_IOMMU_SRCID register.
+ ******************************************************************************************
+ * @ iox_xp     : extended pointer on the remote XCU device descriptor.
+ * @ return registered faulty peripheral index (after error reported by IOMMU).
+ *****************************************************************************************/
+uint32_t soclib_iob_get_srcid( xptr_t  iox_xp );
+
+/******************************************************************************************
+ * This function returns the content of IOB_IOMMU_ERROR register.
+ ******************************************************************************************
+ * @ iox_xp     : extended pointer on the remote XCU device descriptor.
+ * @ return registered error type (after error reported by IOMMU).
+ *****************************************************************************************/
+uint32_t soclib_iob_get_error( xptr_t  iox_xp );
+
+
+
+#endif
+
+// Local Variables:
+// tab-width: 4
+// c-basic-offset: 4
+// c-file-offsets:((innamespace . 0)(inline-open . 0))
+// indent-tabs-mode: nil
+// End:
+// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
+
Index: trunk/kernel/drivers/soclib/soclib_memc.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_memc.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_memc.c	(revision 1)
@@ -0,0 +1,348 @@
+/*
+ * soclib_memc.c - soclib/tsar L2 Confugration Controller
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012,2013 Ghassan Almaless
+ * Copyright (c) 2011,2012,2013 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <bits.h>
+#include <device.h>
+#include <driver.h>
+#include <drvdb.h>
+#include <errno.h>
+#include <vfs.h>
+#include <string.h>
+#include <soclib_memc.h>
+#include <vmm.h>
+
+#define MEMC_CNF_FUNC         0x0
+#define MEMC_PRF_FUNC         0x1
+#define MEMC_ERR_FUNC         0x2
+
+#define MEMC_RD_MUPDT_SEL     0x0
+#define MEMC_WR_MINVL_SEL     0x1
+#define MEMC_LL_CLNUP_SEL     0x2
+#define MEMC_SC_MUPDTT_SEL    0x3
+#define MEMC_CS_MINVLT_SEL    0x4
+#define MEMC_XX_BINVLT_SEL    0x5
+
+#define MEMC_LOC_SEL          0x0
+#define MEMC_REM_SEL          0x1
+#define MEMC_OTH_SEL          0x2
+
+#define MEMC_DIRCT_SEL        0x0
+#define MEMC_COHER_SEL        0x1
+
+#define MEMC_LO_SEL           0x0
+#define MEMC_HI_SEL           0x1
+
+#define MEMC_REG_IDX(z,y,x,w)  (((z) << 6) | ((y) << 4) | ((x) << 1) | (w))
+#define MEMC_REG(func,idx)     (((func) << 9) | ((idx) << 2))
+
+/* ---------------------------------------- */
+/* PERFORMANCE REGISTERS FOR DIRECT TRAFFIC */
+/* ---------------------------------------- */
+
+#define MEMC_RD_LIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_LOC_SEL, MEMC_RD_MUPDT_SEL, MEMC_LO_SEL))
+#define MEMC_RD_RIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_REM_SEL, MEMC_RD_MUPDT_SEL, MEMC_LO_SEL))
+#define MEMC_RD_CIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_OTH_SEL, MEMC_RD_MUPDT_SEL, MEMC_LO_SEL))
+
+#define MEMC_WR_LIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_LOC_SEL, MEMC_WR_MINVL_SEL, MEMC_LO_SEL))
+#define MEMC_WR_RIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_REM_SEL, MEMC_WR_MINVL_SEL, MEMC_LO_SEL))
+#define MEMC_WR_CIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_OTH_SEL, MEMC_WR_MINVL_SEL, MEMC_LO_SEL))
+
+#define MEMC_LL_LIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_LOC_SEL, MEMC_LL_CLNUP_SEL, MEMC_LO_SEL))
+#define MEMC_LL_RIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_REM_SEL, MEMC_LL_CLNUP_SEL, MEMC_LO_SEL))
+#define MEMC_LL_CIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_OTH_SEL, MEMC_LL_CLNUP_SEL, MEMC_LO_SEL))
+
+#define MEMC_SC_LIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_LOC_SEL, MEMC_SC_MUPDTT_SEL, MEMC_LO_SEL))
+#define MEMC_SC_RIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_REM_SEL, MEMC_SC_MUPDTT_SEL, MEMC_LO_SEL))
+#define MEMC_SC_CIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_OTH_SEL, MEMC_SC_MUPDTT_SEL, MEMC_LO_SEL))
+
+#define MEMC_CS_LIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_LOC_SEL, MEMC_CS_MINVLT_SEL, MEMC_LO_SEL))
+#define MEMC_CS_RIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_REM_SEL, MEMC_CS_MINVLT_SEL, MEMC_LO_SEL))
+#define MEMC_CS_CIDX      (MEMC_REG_IDX(MEMC_DIRCT_SEL, MEMC_OTH_SEL, MEMC_CS_MINVLT_SEL, MEMC_LO_SEL))
+
+#define MEMC_RD_LOCAL      MEMC_REG(MEMC_PRF_FUNC, MEMC_RD_LIDX)
+#define MEMC_RD_REMOTE     MEMC_REG(MEMC_PRF_FUNC, MEMC_RD_RIDX)
+#define MEMC_RD_COST       MEMC_REG(MEMC_PRF_FUNC, MEMC_RD_CIDX)
+
+#define MEMC_WR_LOCAL      MEMC_REG(MEMC_PRF_FUNC, MEMC_WR_LIDX)
+#define MEMC_WR_REMOTE     MEMC_REG(MEMC_PRF_FUNC, MEMC_WR_RIDX)
+#define MEMC_WR_COST       MEMC_REG(MEMC_PRF_FUNC, MEMC_WR_CIDX)
+
+#define MEMC_LL_LOCAL      MEMC_REG(MEMC_PRF_FUNC, MEMC_LL_LIDX)
+#define MEMC_LL_REMOTE     MEMC_REG(MEMC_PRF_FUNC, MEMC_LL_RIDX)
+#define MEMC_LL_COST       MEMC_REG(MEMC_PRF_FUNC, MEMC_LL_CIDX)
+
+#define MEMC_SC_LOCAL      MEMC_REG(MEMC_PRF_FUNC, MEMC_SC_LIDX)
+#define MEMC_SC_REMOTE     MEMC_REG(MEMC_PRF_FUNC, MEMC_SC_RIDX)
+#define MEMC_SC_COST       MEMC_REG(MEMC_PRF_FUNC, MEMC_SC_CIDX)
+
+#define MEMC_CS_LOCAL      MEMC_REG(MEMC_PRF_FUNC, MEMC_CS_LIDX)
+#define MEMC_CS_REMOTE     MEMC_REG(MEMC_PRF_FUNC, MEMC_CS_RIDX)
+#define MEMC_CS_COST       MEMC_REG(MEMC_PRF_FUNC, MEMC_CS_CIDX)
+
+/* ------------------------------------------- */
+/* PERFORMANCE REGISTERS FOR COHERENCE TRAFFIC */
+/* ------------------------------------------- */
+
+#define MEMC_MUPDT_LIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_LOC_SEL, MEMC_RD_MUPDT_SEL, MEMC_LO_SEL))
+#define MEMC_MUPDT_RIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_REM_SEL, MEMC_RD_MUPDT_SEL, MEMC_LO_SEL))
+#define MEMC_MUPDT_CIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_OTH_SEL, MEMC_RD_MUPDT_SEL, MEMC_LO_SEL))
+
+#define MEMC_MINVL_LIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_LOC_SEL, MEMC_WR_MINVL_SEL, MEMC_LO_SEL))
+#define MEMC_MINVL_RIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_REM_SEL, MEMC_WR_MINVL_SEL, MEMC_LO_SEL))
+#define MEMC_MINVL_CIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_OTH_SEL, MEMC_WR_MINVL_SEL, MEMC_LO_SEL))
+
+#define MEMC_CLNUP_LIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_LOC_SEL, MEMC_LL_CLNUP_SEL, MEMC_LO_SEL))
+#define MEMC_CLNUP_RIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_REM_SEL, MEMC_LL_CLNUP_SEL, MEMC_LO_SEL))
+#define MEMC_CLNUP_CIDX      (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_OTH_SEL, MEMC_LL_CLNUP_SEL, MEMC_LO_SEL))
+
+#define MEMC_MUPDTT_TIDX     (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_OTH_SEL, MEMC_SC_MUPDTT_SEL, MEMC_LO_SEL))
+#define MEMC_MINVLT_TIDX     (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_OTH_SEL, MEMC_CS_MINVLT_SEL, MEMC_LO_SEL))
+#define MEMC_BINVLT_TIDX     (MEMC_REG_IDX(MEMC_COHER_SEL, MEMC_OTH_SEL, MEMC_XX_BINVLT_SEL, MEMC_LO_SEL))
+
+#define MEMC_MUPDT_LOCAL     MEMC_REG(MEMC_PRF_FUNC, MEMC_MUPDT_LIDX)
+#define MEMC_MUPDT_REMOTE    MEMC_REG(MEMC_PRF_FUNC, MEMC_MUPDT_RIDX)
+#define MEMC_MUPDT_COST      MEMC_REG(MEMC_PRF_FUNC, MEMC_MUPDT_CIDX)
+
+#define MEMC_MINVL_LOCAL     MEMC_REG(MEMC_PRF_FUNC, MEMC_MINVL_LIDX)
+#define MEMC_MINVL_REMOTE    MEMC_REG(MEMC_PRF_FUNC, MEMC_MINVL_RIDX)
+#define MEMC_MINVL_COST      MEMC_REG(MEMC_PRF_FUNC, MEMC_MINVL_CIDX)
+
+#define MEMC_CLNUP_LOCAL     MEMC_REG(MEMC_PRF_FUNC, MEMC_CLNUP_LIDX)
+#define MEMC_CLNUP_REMOTE    MEMC_REG(MEMC_PRF_FUNC, MEMC_CLNUP_RIDX)
+#define MEMC_CLNUP_COST      MEMC_REG(MEMC_PRF_FUNC, MEMC_CLNUP_CIDX)
+
+#define MEMC_MUPDT_TOTAL     MEMC_REG(MEMC_PRF_FUNC, MEMC_MUPDTT_TIDX)
+#define MEMC_MINVL_TOTAL     MEMC_REG(MEMC_PRF_FUNC, MEMC_MINVLT_TIDX)
+#define MEMC_BINVL_TOTAL     MEMC_REG(MEMC_PRF_FUNC, MEMC_BINVLT_TIDX)
+
+#define MEMC_REG_NR 27
+
+static const uint16_t reg_tbl[MEMC_REG_NR] = {
+		MEMC_RD_LOCAL,
+		MEMC_RD_REMOTE,
+		MEMC_RD_COST,
+		MEMC_WR_LOCAL,
+		MEMC_WR_REMOTE,
+		MEMC_WR_COST,
+		MEMC_LL_LOCAL,
+		MEMC_LL_REMOTE,
+		MEMC_LL_COST,
+		MEMC_SC_LOCAL,
+		MEMC_SC_REMOTE,
+		MEMC_SC_COST,
+		MEMC_CS_LOCAL,
+		MEMC_CS_REMOTE,
+		MEMC_CS_COST,
+		MEMC_MUPDT_LOCAL,
+		MEMC_MUPDT_REMOTE,
+		MEMC_MUPDT_COST,
+		MEMC_MINVL_LOCAL,
+		MEMC_MINVL_REMOTE,
+		MEMC_MINVL_COST,
+		MEMC_CLNUP_LOCAL,
+		MEMC_CLNUP_REMOTE,
+		MEMC_CLNUP_COST,
+		MEMC_MUPDT_TOTAL,
+		MEMC_MINVL_TOTAL,
+		MEMC_BINVL_TOTAL};
+
+static sint_t memc_read(struct device_s *memc, dev_request_t *rq)
+{	
+	register size_t count;
+	register uint_t i;
+	uint_t *dst;
+		      
+	assert(rq->file != NULL);
+  
+	count = rq->count >> 2;	/* 32 bits registers */
+	dst   = rq->dst;
+
+	count = (count > MEMC_REG_NR) ? MEMC_REG_NR : count;
+
+	for(i = 0; i < count; i++)
+	{
+		memcpy((void*)&dst[i], (void *)((uint_t)memc->base + reg_tbl[i]), 4);
+	}
+	return (count << 2);
+}
+
+static sint_t memc_write(struct device_s *memc, dev_request_t *rq)
+{
+	return -ENOTSUPPORTED;
+}
+
+static error_t memc_lseek(struct device_s *memc, dev_request_t *rq)
+{
+	return ENOTSUPPORTED;
+}
+
+static sint_t memc_get_params(struct device_s *memc, dev_params_t *params)
+{
+	params->size = MEMC_REG_NR * 4; /* 32 bits registers */
+	return 0;
+}
+
+static sint_t memc_open(struct device_s *memc, dev_request_t *rq)
+{
+	return 0;
+}
+
+static VM_REGION_PAGE_FAULT(memc_pagefault)
+{
+	return EFAULT;
+}
+
+static struct vm_region_op_s memc_vm_region_op = 
+{
+	.page_in     = NULL,
+	.page_out    = NULL,
+	.page_lookup = NULL,
+	.page_fault  = memc_pagefault
+};
+
+static error_t memc_mmap(struct device_s *memc, dev_request_t *rq)
+{
+	struct vfs_file_s *file;
+	struct vm_region_s *region;
+	struct pmm_s *pmm;
+	uint_t size;
+	pmm_page_info_t info;
+	vma_t current_vma;
+	error_t err;
+
+	file   = rq->file;
+	region = rq->region;
+	pmm    = &region->vmm->pmm;
+	size   = (uint_t) memc->data;
+  
+	if(size < (region->vm_limit - region->vm_start))
+	{
+		printk(WARNING, "WARNING: %s: asked size (%d) exceed real one (%d)\n", 
+		       __FUNCTION__, region->vm_limit - region->vm_start, size);
+		return ERANGE;
+	}
+
+	printk(INFO, "INFO: %s: started, file inode %p, region <0x%x - 0x%x>\n",
+	       __FUNCTION__, 
+	       file->f_inode, 
+	       region->vm_start, 
+	       region->vm_limit);
+
+	if((err = pmm_get_page(pmm, (vma_t)memc->base, &info)))
+		return err;
+
+	region->vm_flags |= VM_REG_DEV;
+	current_vma       = region->vm_start;
+	info.attr         = region->vm_pgprot & ~(PMM_CACHED);
+	info.cluster      = NULL;
+	size              = region->vm_limit - region->vm_start; 
+	size              = ARROUND_UP(size, PMM_PAGE_SIZE);
+
+	while(size)
+	{
+		if((err = pmm_set_page(pmm, current_vma, &info)))
+			return err;
+
+		info.ppn ++;
+		current_vma += PMM_PAGE_SIZE;
+		size -= PMM_PAGE_SIZE;
+	}
+  
+	region->vm_file = *file;
+	//region->vm_mapper = NULL;
+
+	region->vm_op = &memc_vm_region_op;
+	return 0;
+}
+
+static error_t memc_munmap(struct device_s *memc, dev_request_t *rq)
+{
+	struct vfs_file_s *file;
+	struct vm_region_s *region;
+	struct pmm_s *pmm;
+	uint_t size;
+	pmm_page_info_t info;
+	vma_t current_vma;
+	error_t err;
+
+	file   = rq->file;
+	region = rq->region;
+	pmm    = &region->vmm->pmm;
+	size   = (uint_t) memc->data;
+
+	if(size < (region->vm_limit - region->vm_start))
+	{
+		printk(ERROR, "ERROR: %s: asked size (%d) exceed real one (%d)\n", 
+		       __FUNCTION__, region->vm_limit - region->vm_start, size);
+		return ERANGE;
+	}
+
+	current_vma = region->vm_start;
+	info.attr   = 0;
+	info.ppn    = 0;
+	size        = region->vm_limit - region->vm_start;
+
+	while(size)
+	{    
+		if((err = pmm_set_page(pmm, current_vma, &info)))
+			return err;
+
+		current_vma += PMM_PAGE_SIZE;
+		size -= PMM_PAGE_SIZE;
+	}
+  
+	return 0;
+}
+
+static uint_t memc_count = 0;
+
+error_t soclib_memc_init(struct device_s *memc)
+{  
+	memc->type = DEV_CHR;
+
+	memc->op.dev.open       = &memc_open;
+	memc->op.dev.read       = &memc_read;
+	memc->op.dev.write      = &memc_write;
+	memc->op.dev.close      = NULL;
+	memc->op.dev.lseek      = &memc_lseek;
+	memc->op.dev.mmap       = &memc_mmap;
+	memc->op.dev.munmap     = &memc_munmap;
+	memc->op.dev.set_params = NULL;
+	memc->op.dev.get_params = &memc_get_params;
+	memc->op.drvid          = SOCLIB_MEMC_ID;
+
+	memc->data = (void*)memc->size;
+
+	sprintk(memc->name, 
+#if CONFIG_ROOTFS_IS_VFAT
+		"MEMC%d"
+#else
+		"memc%d"
+#endif
+		, memc_count++);
+
+	metafs_init(&memc->node, memc->name);
+	return 0;
+}
+
+
+driver_t soclib_memc_driver = { .init = &soclib_memc_init };
Index: trunk/kernel/drivers/soclib/soclib_memc.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_memc.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_memc.h	(revision 1)
@@ -0,0 +1,28 @@
+/*
+ * soclib_memc.h - soclib/tsar L2 Confugration Controller
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012,2013 Ghassan Almaless
+ * Copyright (c) 2011,2012,2013 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_MEMC_H_
+#define _SOCLIB_MEMC_H_
+
+extern driver_t soclib_memc_driver;
+
+#endif
Index: trunk/kernel/drivers/soclib/soclib_mmc.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_mmc.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_mmc.c	(revision 1)
@@ -0,0 +1,146 @@
+/*
+ * soclib_mmc.c - soclib simple block device driver implementation.
+ *
+ * Author     Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH..
+ *
+ * ALMOS-MKH. is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH. is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <hal_types.h>
+#include <device.h>
+#include <dev_mmc.h>
+#include <soclib_mmc.h>
+#include <spinlock.h>
+#include <thread.h>
+#include <printk.h>
+
+
+/////////////////////////////////////
+void soclib_mmc_init( xptr_t dev_xp )
+{
+    // get local pointer on MMC device descriptor
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get extended pointer on MMC peripheral from MMC device
+    xptr_t  mmc_xp = dev_ptr->base;
+
+    // get local pointer on MMC segment base
+    uint32_t * base = (uint32_t *)GET_PTR( mmc_xp );
+
+    // enable MMC IRQ
+    *(base + (SOCLIB_MMC_ERROR_FUNC << 7) + SOCLIB_MMC_ERROR_IRQ_ENABLE) = 1;
+} 
+
+
+//////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_mmc_command( xptr_t th_xp )
+{
+    xptr_t     dev_xp;       // extended pointer on MMC device
+    uint32_t   type;         // MMC command : type
+    uint64_t   buf_paddr;    // MMC command : buffer physical address
+    uint32_t   buf_size;     // MMC command : buffer size
+    uint32_t   reg_index;    // MMC command : register index in MMC peripheral
+    uint32_t * reg_ptr;      // MMC command : pointer on dst/src buffer in client cluster 
+
+    // get client thread cluster and local pointer
+    cxy_t      th_cxy = GET_CXY( th_xp );
+    thread_t * th_ptr = (thread_t *)GET_PTR( th_xp );
+
+    // get command type and extended pointer on MMC device
+    type   =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.mmc.type   ) );
+    dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.mmc.dev_xp ) );
+
+    // get MMC device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get extended pointer on SOCLIB-MMC peripheral
+    xptr_t     mmc_xp = hal_remote_lw( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get SOCLIB_MMC peripheral cluster and local pointer
+    cxy_t      mmc_cxy = GET_CXY( mmc_xp );
+    uint32_t * mmc_ptr = (uint32_t *)GET_PTR( mmc_xp );
+
+    if( (type == MMC_CC_INVAL) || (type == MMC_CC_SYNC) )
+    {
+        // get buffer paddr
+        buf_paddr = hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.mmc.buf_paddr ) );
+
+        // split buffer paddr in two 32 bits words
+        uint32_t   buf_lo = (uint32_t)( buf_paddr );
+        uint32_t   buf_hi = (uint32_t)( buf_paddr>>32 );
+
+        // get buffer size
+        buf_size   = hal_remote_lw( XPTR( th_cxy , &th_ptr->dev.mmc.buf_size ) );
+
+        // get command type
+        uint32_t cc_cmd = MMC_CC_INVAL ? SOCLIB_MMC_CC_INVAL : SOCLIB_MMC_CC_SYNC; 
+
+        // set SOCLIB_MMC registers to start INVAL/SYNC operation
+        hal_remote_sw( XPTR( mmc_cxy , mmc_ptr + SOCLIB_MMC_ADDR_LO    ) , buf_lo );
+        hal_remote_sw( XPTR( mmc_cxy , mmc_ptr + SOCLIB_MMC_ADDR_HI    ) , buf_hi );
+        hal_remote_sw( XPTR( mmc_cxy , mmc_ptr + SOCLIB_MMC_BUF_LENGTH ) , buf_size ); 
+        hal_remote_sw( XPTR( mmc_cxy , mmc_ptr + SOCLIB_MMC_CMD_TYPE   ) , cc_cmd ); 
+    }
+    else  // (type == MMC_GET_ERROR) or (type == MMC_GET_ERROR) pr (type == MMC_GET_INSTRU )
+    {
+        // get src/dst buffer local pointer and register index
+        reg_ptr   = (uint32_t *)hal_remote_lpt( XPTR( th_cxy , &th_ptr->dev.mmc.reg_ptr ) );
+        reg_index = hal_remote_lw( XPTR( th_cxy , &th_ptr->dev.mmc.reg_index ) );
+
+        // move register to/from local buffer 
+        if( (type == MMC_GET_ERROR) || (type == MMC_GET_INSTRU) )
+        {
+            *reg_ptr =  hal_remote_lw( XPTR( mmc_cxy , mmc_ptr + reg_index ) );
+        }
+        else  // type == MMC_SET_ERROR
+        {
+            hal_remote_sw( XPTR( mmc_cxy , mmc_ptr + reg_index ) , *reg_ptr );
+        }
+    }
+} // end soclib_mmc_cmd()
+
+
+////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_mmc_isr( device_t * dev )
+{
+    // get extended pointer on MMC peripheral from MMC device
+    xptr_t  mmc_xp = dev->base;
+
+    // get local pointer on MMC segment base
+    uint32_t * base = (uint32_t *)GET_PTR( mmc_xp );
+
+    // get faulty ADDRESS and SRCID from MMC registers
+    uint32_t paddr_lo = *(base + (SOCLIB_MMC_ERROR_FUNC << 7) + SOCLIB_MMC_ERROR_ADDR_LO);
+    uint32_t paddr_hi = *(base + (SOCLIB_MMC_ERROR_FUNC << 7) + SOCLIB_MMC_ERROR_ADDR_HI);
+    uint32_t srcid    = *(base + (SOCLIB_MMC_ERROR_FUNC << 7) + SOCLIB_MMC_ERROR_SRCID);
+
+    paddr_t paddr = (((paddr_t)paddr_hi)<<32) + ((paddr_t)paddr_lo);
+    
+    // reset MMC IRQ
+    *(base + (SOCLIB_MMC_ERROR_FUNC << 7) + SOCLIB_MMC_ERROR_IRQ_RESET) = 0;
+    
+    // print an error message on kernel terminal TODO : should be improved
+    printk("\n[ERROR] reported from MMC in cluster %x : faulty address = %l / srcid = %x\n",
+           paddr , srcid );
+
+} // end soclib_mmc_isr()
+
+
+
Index: trunk/kernel/drivers/soclib/soclib_mmc.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_mmc.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_mmc.h	(revision 1)
@@ -0,0 +1,185 @@
+/*
+ * soclib_mmc.h - SOCLIB_MMC (TSAR L2 cache) driver definition.
+ *
+ * Author    Alain Greiner
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_MMC_H_
+#define _SOCLIB_MMC_H_
+
+#include <device.h>
+#include <dev_mmc.h>
+#include <hal_types.h>
+
+/********************************************************************************************
+ * This driver supports the SocLib VciMemCache component, that is the L2 cache used
+ * by the TSAR architure.
+ *******************************************************************************************/
+
+/********************************************************************************************
+ *       SOCLIB_MMC registers offset 
+ *  - the register index is coded on 7 address bits : A[8:2]
+ *  - the functionnality is coded on 2 address bits : A[10:9]
+ *******************************************************************************************/
+
+enum SoclibMemCacheFunc
+{
+    SOCLIB_MMC_CC_FUNC    = 0,
+    SOCLIB_MMC_INSTR_FUNC = 1,
+    SOCLIB_MMC_ERROR_FUNC = 2,
+
+    SOCLIB_MMC_FUNC_SPAN  = 0x200
+};
+
+enum SoclibMemCacheCCRegs
+{
+    SOCLIB_MMC_ADDR_LO    = 0,
+    SOCLIB_MMC_ADDR_HI    = 1,
+    SOCLIB_MMC_BUF_LENGTH = 2,
+    SOCLIB_MMC_CMD_TYPE   = 3,
+};
+
+enum SoclibMemCacheConfigCmd
+{
+    SOCLIB_MMC_CC_NOP     = 0,
+    SOCLIB_MMC_CC_INVAL   = 1,
+    SOCLIB_MMC_CC_SYNC    = 2,
+};
+
+enum SoclibMemCacheInstrRegs 
+{
+
+    // NUMBER OF LOCAL TRANSACTIONS ON DIRECT NETWORK 
+
+    SOCLIB_MMC_LOCAL_READ_LO     = 0x00,
+    SOCLIB_MMC_LOCAL_READ_HI     = 0x01,
+    SOCLIB_MMC_LOCAL_WRITE_LO    = 0x02,
+    SOCLIB_MMC_LOCAL_WRITE_HI    = 0x03,
+    SOCLIB_MMC_LOCAL_LL_LO       = 0x04,
+    SOCLIB_MMC_LOCAL_LL_HI       = 0x05,
+    SOCLIB_MMC_LOCAL_SC_LO       = 0x06,
+    SOCLIB_MMC_LOCAL_SC_HI       = 0x07,
+    SOCLIB_MMC_LOCAL_CAS_LO      = 0x08,
+    SOCLIB_MMC_LOCAL_CAS_HI      = 0x09,
+
+    // NUMBER OF REMOTE TRANSACTIONS ON DIRECT NETWORK 
+
+    SOCLIB_MMC_REMOTE_READ_LO    = 0x10,
+    SOCLIB_MMC_REMOTE_READ_HI    = 0x11,
+    SOCLIB_MMC_REMOTE_WRITE_LO   = 0x12,
+    SOCLIB_MMC_REMOTE_WRITE_HI   = 0x13,
+    SOCLIB_MMC_REMOTE_LL_LO      = 0x14,
+    SOCLIB_MMC_REMOTE_LL_HI      = 0x15,
+    SOCLIB_MMC_REMOTE_SC_LO      = 0x16,
+    SOCLIB_MMC_REMOTE_SC_HI      = 0x17,
+    SOCLIB_MMC_REMOTE_CAS_LO     = 0x18,
+    SOCLIB_MMC_REMOTE_CAS_HI     = 0x19,
+
+    // COST OF TRANSACTIONS ON DIRECT NETWORK
+
+    SOCLIB_MMC_COST_READ_LO      = 0x20,
+    SOCLIB_MMC_COST_READ_HI      = 0x21,
+    SOCLIB_MMC_COST_WRITE_LO     = 0x22,
+    SOCLIB_MMC_COST_WRITE_HI     = 0x23,
+    SOCLIB_MMC_COST_LL_LO        = 0x24,
+    SOCLIB_MMC_COST_LL_HI        = 0x25,
+    SOCLIB_MMC_COST_SC_LO        = 0x26,
+    SOCLIB_MMC_COST_SC_HI        = 0x27,
+    SOCLIB_MMC_COST_CAS_LO       = 0x28,
+    SOCLIB_MMC_COST_CAS_HI       = 0x29,
+
+    // NUMBER OF LOCAL TRANSACTIONS ON CC NETWORK
+
+    SOCLIB_MMC_LOCAL_MUPDATE_LO  = 0x40,
+    SOCLIB_MMC_LOCAL_MUPDATE_HI  = 0x41,
+    SOCLIB_MMC_LOCAL_MINVAL_LO   = 0x42,
+    SOCLIB_MMC_LOCAL_MINVAL_HI   = 0x43,
+    SOCLIB_MMC_LOCAL_CLEANUP_LO  = 0x44,
+    SOCLIB_MMC_LOCAL_CLEANUP_HI  = 0x45,
+
+    // NUMBER OF REMOTE TRANSACTIONS ON CC NETWORK
+
+    SOCLIB_MMC_REMOTE_MUPDATE_LO = 0x50,
+    SOCLIB_MMC_REMOTE_MUPDATE_HI = 0x51,
+    SOCLIB_MMC_REMOTE_MINVAL_LO  = 0x52,
+    SOCLIB_MMC_REMOTE_MINVAL_HI  = 0x53,
+    SOCLIB_MMC_REMOTE_CLEANUP_LO = 0x54,
+    SOCLIB_MMC_REMOTE_CLEANUP_HI = 0x55,
+
+    // COST OF TRANSACTIONS ON CC NETWORK
+
+    SOCLIB_MMC_COST_MUPDATE_LO   = 0x60,
+    SOCLIB_MMC_COST_MUPDATE_HI   = 0x61,
+    SOCLIB_MMC_COST_MINVAL_LO    = 0x62,
+    SOCLIB_MMC_COST_MINVAL_HI    = 0x63,
+    SOCLIB_MMC_COST_CLEANUP_LO   = 0x64,
+    SOCLIB_MMC_COST_CLEANUP_HI   = 0x65,
+
+    // TOTAL
+
+    SOCLIB_MMC_TOTAL_MUPDATE_LO  = 0x68,
+    SOCLIB_MMC_TOTAL_MUPDATE_HI  = 0x69,
+    SOCLIB_MMC_TOTAL_MINVAL_LO   = 0x6A,
+    SOCLIB_MMC_TOTAL_MINVAL_HI   = 0x6B,
+    SOCLIB_MMC_TOTAL_BINVAL_LO   = 0x6C,
+    SOCLIB_MMC_TOTAL_BINVAL_HI   = 0x6D,
+};
+
+enum SoclibMemCacheRerrorRegs
+{
+    SOCLIB_MMC_ERROR_ADDR_LO     = 0,
+    SOCLIB_MMC_ERROR_ADDR_HI     = 1,
+    SOCLIB_MMC_ERROR_SRCID       = 2, 
+    SOCLIB_MMC_ERROR_IRQ_RESET   = 3,
+    SOCLIB_MMC_ERROR_IRQ_ENABLE  = 4,
+};
+
+
+#define MMC_REG(func,index) ((func<<7)|index) 
+
+
+/********************************************************************************************
+ * This function initializes the SOCLIB_MMC peripheral hardware registers related
+ * to error signaling to enable the MMC peripheral IRQ.
+ ********************************************************************************************
+ * @ dev_xp     : extended pointer on the generic MMC device descriptor.
+ *******************************************************************************************/
+extern void soclib_mmc_init( xptr_t dev_xp );
+
+/********************************************************************************************
+ * This blocking function can be called by any thread running in any cluster.
+ * It executes the command registered in the calling thread descriptor.
+ * The MMC device spinlock must have been taken by the calling thead.
+ ********************************************************************************************
+ * @ thread_xp  : extended pointer on the client thread.
+ *******************************************************************************************/
+extern void soclib_mmc_command( xptr_t thread_xp );
+
+/********************************************************************************************
+ * This Interrupt Service Routine is executed when the MMC IRQ signals a faulty address.
+ * The ISR should access the vci_mem_cache component to get the faulty physical address 
+ * and the associated SRCID, and acknowledges the IRQ.
+ ********************************************************************************************
+ * @ dev     : local pointer on the generic MMC device descriptor.
+ *******************************************************************************************/
+extern void soclib_mmc_isr( device_t * dev );
+
+
+#endif // SOCLIB_MMC_H_
Index: trunk/kernel/drivers/soclib/soclib_nic.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_nic.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_nic.c	(revision 1)
@@ -0,0 +1,334 @@
+/*
+ * soclib_nic.c - SOCLIB_NIC (Network Interface Controler) driver implementation.
+ *
+ * Author     Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <hal_types.h>
+#include <hal_remote.h>
+#include <hal_special.h>
+#include <device.h>
+#include <dev_nic.h>
+#include <spinlock.h>
+#include <kmem.h>
+#include <printk.h>
+#include <memcpy.h>
+#include <thread.h>
+#include <soclib_nic.h>
+
+
+/////////////////////////////////////
+void soclib_nic_init( xptr_t dev_xp )
+{
+    uint32_t    i;
+    kmem_req_t  req;
+    
+    // get NIC device descriptor cluster and local pointer
+    cxy_t      dev_cxy  = GET_CXY( dev_xp );
+    device_t * dev_ptr  = (device_t *)GET_PTR( dev_xp );
+  
+    // get hardware device base address
+	xptr_t     base = hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get hardware device cluster and local pointer
+    cxy_t      nic_cxy  = GET_CXY( base );
+    uint32_t * nic_ptr  = (uint32_t *)GET_PTR( base );
+
+    // initialize Soclib NIC global registers 
+    hal_remote_sw( XPTR( nic_cxy , &nic_ptr + NIC_G_BC_ENABLE ) , 0 );
+    hal_remote_sw( XPTR( nic_cxy , &nic_ptr + NIC_G_RUN       ) , 0 );
+
+    // allocate memory for chbuf descriptor (one page)
+    if( sizeof(nic_chbuf_t) > CONFIG_PPM_PAGE_SIZE )
+    {
+        printk("\n[PANIC] in %s : chbuf descriptor exceeds one page\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    req.type   = KMEM_PAGE;
+    req.size   = 0;
+    req.flags  = AF_KERNEL;
+
+    nic_chbuf_t * chbuf = (nic_chbuf_t *)kmem_alloc( &req );
+
+    if( chbuf == NULL )
+    {
+        hal_core_sleep("%s : no more memory for chbuf desccriptor\n", __FUNCTION__ );
+    }
+
+    // initialise chbuf state
+    chbuf->cont_id  = 0;
+    chbuf->pkt_id   = 0;
+    chbuf->word_id  = 34;
+    
+    // allocate containers (one page per container)
+    // and complete chbuf descriptor initialization
+    if( CONFIG_PPM_PAGE_SIZE != 4096 )
+    {
+        hal_core_sleep("%s : chbuf container must be 4 Kbytes\n", __FUNCTION__ );
+    }
+
+    for( i = 0 ; i < CONFIG_NIC_CHBUF_DEPTH ; i++ )
+    {
+        uint32_t * container = (uint32_t *)kmem_alloc( &req );   
+
+        if( container == NULL )
+        {
+            hal_core_sleep("%s : no more memory for container\n", __FUNCTION__ );
+        }
+        
+        chbuf->cont[i] = container;
+        chbuf->full[i] = (paddr_t)XPTR( local_cxy , container );
+    }
+
+} // end soclib_nic_init()
+
+
+//////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_nic_cmd( xptr_t thread_xp )
+{
+    uint32_t       cmd;          // command type    
+    char         * buffer;       // pointer on command buffer   
+    uint32_t       length;       // Ethernet packet length
+    xptr_t         dev_xp;       // extended pointer on NIC device
+    nic_chbuf_t  * chbuf;        // pointer on chbuf descriptor
+    uint32_t       cont_id;      // index of current container in chbuf
+    uint32_t       pkt_id;       // index of current packet in container
+    uint32_t       word_id;      // index of first word of current packet in container
+    uint32_t     * container;    // pointer on container (array of uint32_t)
+    uint16_t     * header;       // pointer on container header (array of uint16_t)
+    uint32_t       npackets;     // number of packets in current container
+
+    // get local pointer for client thread
+    thread_t * thread_ptr = (thread_t *)GET_PTR( thread_xp );
+
+    // get command arguments
+    cmd    = thread_ptr->dev.nic.cmd;
+    buffer = thread_ptr->dev.nic.buffer;
+    length = thread_ptr->dev.nic.length;
+    dev_xp = thread_ptr->dev.nic.dev_xp;
+
+    // get local pointer for device
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get chbuf descriptor pointer
+    chbuf = (nic_chbuf_t *)dev_ptr->ext.nic.queue;
+
+    // analyse command type
+    switch( cmd )
+    {
+        /////////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_READ:   // transfer one packet from RX queue to command buffer
+        {
+            // get current container index
+            cont_id = chbuf->cont_id;
+            
+            if( chbuf->full[cont_id] == 0 )  // container empty
+            {
+                printk("PANIC in %s : read an empty container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // get pointer on container and header 
+            container = chbuf->cont[cont_id];
+            header    = (uint16_t *)container;
+
+            // get  expected packet index and first word index in container
+            pkt_id  = chbuf->pkt_id;
+            word_id = chbuf->word_id;
+
+            // get packet length and number of packets from container header
+            length    = header[pkt_id + 2];
+            npackets  = header[0];
+
+            if( pkt_id >= npackets )  // packet index too large
+            {
+                printk("PANIC in %s : read a non readable container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // move the packet from container to buffer
+            memcpy( buffer , container + word_id , length );
+
+            // update current packet index and first word index
+            chbuf->pkt_id  = pkt_id + 1;
+            if( length & 0x3 ) chbuf->word_id = word_id + (length>>2) + 1;
+            else               chbuf->word_id = word_id + (length>>2);
+        }
+        break;    // end READ
+            
+        //////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_WRITE:  // move one packet from command buffer to TX queue
+        {
+            // get current TX container indexes
+            cont_id = chbuf->cont_id;
+            pkt_id  = chbuf->pkt_id;
+            word_id = chbuf->word_id;
+
+            if( chbuf->full[cont_id] != 0 )  // container full
+            {
+                printk("PANIC in %s : write to a full container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // get pointer on container and header 
+            container = chbuf->cont[cont_id];
+            header    = (uint16_t *)container;
+
+            if( length > ((1024 - word_id)<<2) )  // packet length too large
+            {
+                printk("PANIC in %s : write to a non writable container\n", __FUNCTION__ );
+                hal_core_sleep();
+            }
+
+            // update packet length in container header
+            header[pkt_id + 2] = (uint16_t)length;
+
+            // move the packet from buffer to container
+            memcpy( container + word_id , buffer , length );
+
+            // update current packet index and first word index
+            chbuf->pkt_id  = pkt_id + 1;
+            if( length & 0x3 ) chbuf->word_id = word_id + (length>>2) + 1;
+            else               chbuf->word_id = word_id + (length>>2);
+        }
+        break;  // end WRITE
+
+        ////////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_WRITABLE:  // analyse chbuf status / update status if required
+        {
+            // get current container state 
+            cont_id = chbuf->cont_id;
+            word_id = chbuf->word_id;
+
+            // compute current container writable
+            bool_t ok = ( chbuf->full[cont_id] == 0 ) &&
+                        ( length <= ((1024 - word_id)<<2) );
+
+            if( ok )                // current container writable
+            {
+                // return chbuf writable
+                thread_ptr->dev.nic.status = true;
+            }
+            else                    // current container not writable
+            {
+                // release current container
+                chbuf->full[cont_id] = 1;
+
+                // check next container 
+                cont_id = (cont_id + 1) % CONFIG_NIC_CHBUF_DEPTH;
+
+                if( chbuf->full[cont_id] == 0 ) // next container empty
+                {
+                    // update chbuf status
+                    chbuf->word_id = 34;
+                    chbuf->cont_id = cont_id;
+                    chbuf->pkt_id  = 0;
+                     
+                    // return chbuf writable
+                    thread_ptr->dev.nic.status = true;
+                }
+                else                            // next container full     
+                {
+                    // return chbuf non writable
+                    thread_ptr->dev.nic.status = false;
+                }
+            }
+        }
+        break;  // end WRITABLE
+
+        /////////////////////////////////////////////////////////////////////////////
+        case NIC_CMD_READABLE:  // analyse chbuf status / update status if required
+        {
+            // get current container state
+            cont_id  = chbuf->cont_id;
+            pkt_id   = chbuf->pkt_id;
+            npackets = chbuf->cont[cont_id][0] & 0x0000FFFF; 
+            
+            // compute current container readable
+            bool_t ok = ( chbuf->full[cont_id] == 1 ) &&
+                        ( pkt_id < npackets );
+
+            if( ok )                    // current container readable
+            {
+                // return chbuf readable     
+                thread_ptr->dev.nic.status = true;
+            }
+            else                        // current container non readable
+            {
+                // release current container
+                chbuf->full[cont_id] = 0;
+
+                // check next container
+                cont_id = (cont_id + 1) % CONFIG_NIC_CHBUF_DEPTH;
+
+                if( chbuf->full[cont_id] == 1 ) // next container full 
+                {
+                    // update chbuf status
+                    chbuf->word_id = 34;
+                    chbuf->cont_id = cont_id;
+                    chbuf->pkt_id  = 0;
+                     
+                    // return chbuf readable
+                    thread_ptr->dev.nic.status = true;
+                }
+                else                            // next container empty    
+                {
+                    // return chbuf non readable
+                    thread_ptr->dev.nic.status = false;
+                }
+            }
+   
+        }
+        break;  // end READABLE
+    } 
+} // end soclib_nic_cmd()
+
+
+////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_nic_isr( device_t * dev )
+{
+    // get base, size, channel, is_rx from NIC channel device NIC 
+    xptr_t     base    = dev->base;
+    uint32_t   channel = dev->channel;
+    bool_t     is_rx   = dev->is_rx;
+
+    // get NIC peripheral cluster and local pointer
+    cxy_t      cxy_nic = GET_CXY( base );
+    uint32_t * ptr_nic = (uint32_t *)GET_PTR( base );
+
+    // compute local pointer on status register 
+    uint32_t * offset;
+    if( is_rx ) offset = ptr_nic + (NIC_CHANNEL_SPAN * (channel + 1)) + NIC_RX_STATUS;
+    else        offset = ptr_nic + (NIC_CHANNEL_SPAN * (channel + 1)) + NIC_TX_STATUS;
+
+    // read NIC channel status and acknowledge IRQ
+    uint32_t status = hal_remote_lw( XPTR( cxy_nic , offset ) );
+
+    if( status != 0 ) hal_core_sleep("%s : illegal address\n", __FUNCTION__ );
+    
+    // unblock server thread 
+    thread_t * server = dev->server;
+    thread_unblock( XPTR( local_cxy , server ) , THREAD_BLOCKED_IO );
+
+} // end soclib_nic_isr()
+
+
+
Index: trunk/kernel/drivers/soclib/soclib_nic.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_nic.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_nic.h	(revision 1)
@@ -0,0 +1,203 @@
+/*
+ * soclib_nic.h - SOCLIB_NIC (Network Interface Controler) driver definition.
+ *
+ * Author    Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_NIC_H_
+#define _SOCLIB_NIC_H_
+
+#include <device.h>
+#include <hal_types.h>
+
+/********************************************************************************************
+ * This driver supports the Soclib VciMasterNic component, that is a GMII compliant
+ * multi-channels Gigabit Ethernet controler. 
+ *
+ * The VciMasterNic component supports up to 4 channels, indexed by the source IP address
+ * for the RX packets, and by the destination IP address for the TX packets. 
+ * 
+ * The Ethernet packet length can have any value, between 64 to 1538 bytes.
+ * The data transfer unit between software and the NIC is a 4 Kbytes "container",
+ * containing an integer number of variable size packets.
+ *
+ * The max number of packets in a container is 66 packets.
+ * The first 34 words of a container are the container header :
+ *
+ *     word0  	| 	NB_WORDS	|	NB_PACKETS	|
+ *     word1	|	PLEN[0]		|	PLEN[1]		|
+ *      ...	    |	.......		|	........	|
+ *     word33	|	PLEN[64]	|	PLEN[65]	|
+ *
+ *  - NB_PACKETS is the actual number of packets in the container.
+ *	- NB_WORDS   is the number of useful words in the container.
+ *	- PLEN[i]    is the number of bytes for the packet[i].
+ *
+ * Packets are stored in the (1024 - 34) following words, and the packets are word-aligned.
+ *
+ * The TX and RX queues are implemented as chained buffers, where each buffer is a 4 Kbytes
+ * container. Each container is protected by a SET/RESET synchronisation variable. 
+ * The structure implementing the chbuf descriptor is described below.
+ *
+ * To access both the container status, and the data contained in the container, the NIC
+ * uses two physical addresses, that are packed in a 64 bits "container descriptor". 
+ * - desc[25:0]  contain bits[31:6] of the status physical address.
+ * - desc[51:26] contain bits[31:6] of the buffer physical address.
+ * - desc[63:52] contain the common 12 physical address extension bits.
+ *******************************************************************************************/
+
+/********************************************************************************************
+ *       Addressable registers offsets 
+ *******************************************************************************************/
+
+enum SoclibMasterNicGlobalRegisters 
+{
+    NIC_G_RUN                        = 0,   /*! read_write : NIC component activated       */
+    NIC_G_NB_CHANNELS                = 1,   /*! read_only  : number of channels            */
+    NIC_G_BC_ENABLE                  = 2,   /*! read_write : broadcast enabled if non zero */ 
+    NIC_G_PERIOD                     = 3,   /*! read-write : container status poll period  */
+    NIC_G_MAC_4                      = 4,   /*! read-write : mac address 32 LSB bits       */
+    NIC_G_MAC_2                      = 5,   /*! read-write : mac address 16 MSB bits       */
+
+    NIC_G_NPKT_RX_G2S_RECEIVED       = 10,  /*! number of packets received                 */
+    NIC_G_NPKT_RX_G2S_DISCARDED      = 11,  /*! number of RX packets discarded by RX_G2S   */
+    NIC_G_NPKT_RX_DES_SUCCESS        = 12,  /*! number of RX packets transmited by RX_DES  */
+    NIC_G_NPKT_RX_DES_TOO_SMALL      = 13,  /*! number of discarded too small RX packets   */
+    NIC_G_NPKT_RX_DES_TOO_BIG        = 14,  /*! number of discarded too big RX packets     */
+    NIC_G_NPKT_RX_DES_MFIFO_FULL     = 15,  /*! number of discarded RX packets fifo full   */
+    NIC_G_NPKT_RX_DES_CRC_FAIL       = 16,  /*! number of discarded RX packets CRC32       */
+    NIC_G_NPKT_RX_DISPATCH_RECEIVED  = 17,  /*! number of packets received by RX_DISPATCH  */
+    NIC_G_NPKT_RX_DISPATCH_BROADCAST = 18,  /*! number of broadcast RX packets received    */
+    NIC_G_NPKT_RX_DISPATCH_DST_FAIL  = 19,  /*! number of discarded RX packets for DST MAC */
+    NIC_G_NPKT_RX_DISPATCH_CH_FULL   = 20,  /*! number of discarded RX packets cont full   */
+
+    NIC_G_NPKT_TX_DISPATCH_RECEIVED  = 41,  /*! number of packets received by TX_DISPATCH  */
+    NIC_G_NPKT_TX_DISPATCH_TOO_SMALL = 42,  /*! number of discarded too small TX packets   */
+    NIC_G_NPKT_TX_DISPATCH_TOO_BIG   = 43,  /*! number of discarded too big TX packets     */
+    NIC_G_NPKT_TX_DISPATCH_SRC_FAIL  = 44,  /*! number of discarded TX packets for SRC MAC */
+    NIC_G_NPKT_TX_DISPATCH_BROADCAST = 45,  /*! number of broadcast TX packets received    */
+    NIC_G_NPKT_TX_DISPATCH_TRANSMIT  = 46,  /*! number of transmit TX packets              */
+
+    NIC_GLOBAL_SPAN                  = 64   /*! 256 bytes for global registers             */
+};
+
+enum SoclibMasterNicChannelRegisters 
+{
+    NIC_RX_STATUS             = 0,    /*! read-only  : RX channel status                   */
+    NIC_RX_CHBUF_DESC_L0      = 1,    /*! read-write : RX chbuf descriptor 32 LSB bits     */ 
+    NIC_RX_CHBUF_DESC_HI      = 2,    /*! read-write : RX chbuf descriptor 32 MSB bits     */ 
+    NIC_RX_CHBUF_NBUFS        = 3,    /*! read-write : RX chbuf depth (number of buffers)  */
+    
+    NIC_TX_STATUS             = 8,    /*! read-only  : TX channel status                   */
+    NIC_TX_CHBUF_DESC_L0      = 9,    /*! read-write : TX chbuf descriptor 32 LSB bits     */ 
+    NIC_TX_CHBUF_DESC_HI      = 10,   /*! read-write : TX chbuf descriptor 32 MSB bits     */ 
+    NIC_TX_CHBUF_NBUFS        = 11,   /*! read-write : TX chbuf depth (number of buffers)  */
+
+    NIC_CHANNEL_SPAN          = 16    /*! 64 bytes per channel                             */
+};
+    
+
+
+/********************************************************************************************
+ * This structure defines the chained buffer descriptor, used to implement both
+ * the RX and TX packets queues. Each buffer in a chbuf is a 4 Kbytes container
+ * containing a variable number of packets. All containers are allocated in 
+ * the same cluster as the associated NIC device descriptor. The chbuf descriptor contains:
+ * - an array of container pointers cont[], used by the kernet threads to access the
+ *   packets contained in the containers.
+ * - an array of set/reset Boolean full[] used by both the software threads and 
+ *   by the hardware FSMs for lock-less synchronisation. 
+ * - an array of containers descriptors containing the physical addresses of the
+ *   "full[i]" and "cont[i]" variables, used by the DMA FSMs. 
+ * Moreover, It contains three pointers (cont_id, pkt_id, and word_id) that are private
+ * variables used by the software thread to scan the chbuf. 
+ *******************************************************************************************/
+
+typedef struct nic_chbuf_s
+{
+    uint32_t * cont[CONFIG_NIC_CHBUF_DEPTH]; /*! container virtual base address            */
+    uint32_t   full[CONFIG_NIC_CHBUF_DEPTH]; /*! Boolean : container full if non zero      */
+    uint64_t   desc[CONFIG_NIC_CHBUF_DEPTH]; /*! container & status physical addresses     */
+    uint32_t   cont_id;                      /*! current container index                   */
+    uint32_t   pkt_id;                       /*! current packet index in container         */
+    uint32_t   word_id;                      /*! first word of current packet              */
+}
+nic_chbuf_t;
+
+/********************************************************************************************
+ *        SOCLIB_NIC driver access functions 
+ *******************************************************************************************/
+
+/********************************************************************************************
+ * This function initializes the SOCLIB_NIC hardware registers, allocates memory for
+ * the RX and TX containers, allocates and initializes the RX and TX chbuf descriptors.
+ * It allocates one WTI mailbox for the IRQ signaling availability of an RX full container,
+ * or a TX empty container, and route the WTI IRQ to the core running the server thread.
+ ********************************************************************************************
+ * @ dev_xp  : extended pointer on the generic NIC device descriptor.
+ *******************************************************************************************/
+extern void soclib_nic_init( xptr_t dev_xp );
+
+/********************************************************************************************
+ * This function implement the READ / WRITE / READABLE / WRITABLE commands for TX/RX queues.
+ * These command don't access the NIC peripheral but only the TX and TX chbufs.
+ * It must be executed by a dedicated kernel thread running in the cluster containing
+ * the CHBUF implementing the TX/RX queues.
+ * It implements also the SET_MAC, SET_BC, SET_RUN configuration commands, that directly
+ * access the NIC peripheral registers.
+ * - READABLE 
+ *   Returns in the command "status" a non zero value if a packet is available in RX queue.
+ *   Update the RX queue read pointer if required.
+ * - READ 
+ *   Move a packet from the RX queue to the command "buffer", and returns the packet
+ *   "length" in the command. The READABLE command must be called before the READ command.
+ * - WRITABLE 
+ *   Returns in the command "status" a non zero value if a packet with a given "length"
+ *   can be written in the TX queue. Update the RX queue read pointer if required.
+ * - WRITE
+ *   Move a packet of a given "length" from the command "buffer" to the TX queue.
+ *   The WRITABLE command must be called before the WRITE command.
+ * - SET_MAC 
+ *   Set the values defined in the "length" and "status" command arguments,
+ *   into the NIC_C_MAC4 and NIG_G_MAC2  registers.
+ * - SET_BC
+ *   Enable/disable broadcast packets, as defined in the "status" command argument,
+ *   into the NIC_G_BC_ENABLE register.
+ * - SET_RUN
+ *   Enable/disable NIC, as defined in the "status" command argument, 
+ *   into the NIC_G_RUN register.
+ * @ dev_xp  : extended pointer on the generic NIC device descriptor.
+ ********************************************************************************************
+ $ @ thread_xp : extended pointer on client thread (containing the command arguments).
+ *******************************************************************************************/
+extern void soclib_nic_cmd( xptr_t thread_xp );
+
+/********************************************************************************************
+ * This ISR acknowledge the NIC_RX or NIC_TX channel ISR signaling that a new container
+ * has beeen moved, and reactivate the corresponding server thread.
+ * In case of address error reported by the NIC controler in accessing the kernel chbuf,
+ * it goes to kernel panic.
+ ********************************************************************************************
+ * @ dev     : local pointer on the generic IOC device descriptor.
+ *******************************************************************************************/
+extern void soclib_nic_isr( device_t * dev );
+
+
+#endif /* _BLOCK_H_ */
Index: trunk/kernel/drivers/soclib/soclib_pic.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_pic.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_pic.c	(revision 1)
@@ -0,0 +1,120 @@
+/*
+ * soclib_pic.c - soclib PIC driver implementation.
+ *
+ * Author  Alain Greiner (2016)
+ * *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH. is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH. is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <hal_types.h>
+#include <device.h>
+#include <soclib_pic.h>
+#include <soclib_xcu.h>
+#include <errno.h>
+#include <string.h>
+#include <vfs.h>
+
+
+//////////////////////////////////////
+void soclib_pic_init( xptr_t  dev_xp )
+{
+    // get PIC device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+  
+    // get extended pointer on PIC segment base from PIC device descriptor
+    xptr_t seg_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+ 
+    // get PIC controller segment cluster and local pointer
+    cxy_t      seg_cxy = (cxy_t)GET_CXY( seg_xp );
+    uint32_t * seg_ptr = (uint32_t *)GET_PTR( seg_xp );
+    uint32_t   i;
+
+    // reset the MASK registers for all input IRQs
+    for( i = 0 ; i < CONFIG_MAX_IRQS_PER_PIC ; i++ )
+    {
+        hal_remote_sw( XPTR( seg_cxy , seg_ptr + i*IOPIC_SPAN + IOPIC_MASK ) , 0 ); 
+    }
+}
+
+////////////////////////////////////////////
+void soclib_pic_bind_irq( xptr_t     dev_xp,
+                          uint32_t   irq_id,
+                          xptr_t     xp_wti )
+{
+    // get PIC device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+  
+    // get extended pointer on PIC segment base from PIC device descriptor
+    xptr_t seg_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+ 
+    // get PIC controller segment cluster and local pointer
+    cxy_t      seg_cxy = (cxy_t)GET_CXY( seg_xp);
+    uint32_t * seg_ptr = (uint32_t *)GET_PTR( seg_xp );
+
+    uint32_t lsb = (uint32_t)xp_wti;
+    uint32_t msb  = (uint32_t)(xp_wti>>32);
+
+	// set the IOPIC_ADDRESS and IOPIC_EXTEND registers
+    hal_remote_sw( XPTR( seg_cxy , seg_ptr+irq_id*IOPIC_SPAN+IOPIC_ADDRESS ) , lsb );
+    hal_remote_sw( XPTR( seg_cxy , seg_ptr+irq_id*IOPIC_SPAN+IOPIC_EXTEND  ) , msb );
+
+    // set IOPIC_MASK register
+    hal_remote_sw( XPTR( seg_cxy , seg_ptr+irq_id*IOPIC_SPAN+IOPIC_MASK    ) , 1   );
+}
+
+//////////////////////////////////////////////
+void soclib_pic_unbind_irq( xptr_t     dev_xp,
+                            uint32_t   irq_id )
+{
+    // get PIC device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+  
+    // get extended pointer on PIC segment base from PIC device descriptor
+    xptr_t seg_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+ 
+    // get PIC controller segment cluster and local pointer
+    cxy_t      seg_cxy = (cxy_t)GET_CXY( seg_xp);
+    uint32_t * seg_ptr = (uint32_t *)GET_PTR( seg_xp );
+
+    // set IOPIC_MASK register
+    hal_remote_sw( XPTR( seg_cxy , seg_ptr+irq_id*IOPIC_SPAN+IOPIC_MASK    ) , 0   );
+}
+
+//////////////////////////////////////////////
+void soclib_pic_get_status( xptr_t     dev_xp,
+                            uint32_t   irq_id,
+                            uint32_t * status)
+{
+    // get PIC device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+  
+    // get extended pointer on PIC segment base from PIC device descriptor
+    xptr_t seg_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+ 
+    // get PIC controller segment cluster and local pointer
+    cxy_t      seg_cxy = (cxy_t)GET_CXY( seg_xp);
+    uint32_t * seg_ptr = (uint32_t *)GET_PTR( seg_xp );
+
+    // return status
+	*status = hal_remote_lw( XPTR( seg_cxy , seg_ptr+irq_id*IOPIC_SPAN+IOPIC_STATUS ) );
+}
+
Index: trunk/kernel/drivers/soclib/soclib_pic.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_pic.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_pic.h	(revision 1)
@@ -0,0 +1,83 @@
+/*
+ * soclib_pic.c - soclib PIC driver definition.
+ *
+ * Author  Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_IOPIC_H_
+#define _SOCLIB_IOPIC_H_
+
+#include <hal_types.h>
+
+/******************************************************************************************
+ *  PIC register offsets (per input IRQ)
+ *****************************************************************************************/
+
+#define IOPIC_ADDRESS           0
+#define IOPIC_EXTEND            1
+#define IOPIC_STATUS            2
+#define IOPIC_MASK              3
+#define IOPIC_SPAN              4
+
+/******************************************************************************************
+ * This blocking function desactivates all input IRQs in a remote PIC controler.
+ * It can be called by any thread running on any cluster.
+ ******************************************************************************************
+ * @ dev_xp    : extended pointer on the PIC device descriptor.
+ *****************************************************************************************/
+void   soclib_pic_init( xptr_t dev_xp );
+
+/******************************************************************************************
+ * This blocking function returns the status for a given input IRQ in the remote
+ * PIC controler. It can be called by any thread running on any cluster.
+ ******************************************************************************************
+ * @ dev_xp    : extended pointer on the PIC device descriptor.
+ * @ irq_id    : input IRQ index.
+ * @ status    : pointer on local buffer for returned status.
+ *****************************************************************************************/
+void   soclib_pic_get_status( xptr_t     dev_xp,
+                              uint32_t   irq_id,
+                              uint32_t * status );
+
+/******************************************************************************************
+ * This blocking function unmask an input IRQ in a remote PIC controler, and bind it
+ * with a WTI mailbox, by registering the WTI mailbox extended pointer.
+ * It can be called by any thread running on any cluster.
+ ******************************************************************************************
+ * @ dev_xp    : extended pointer on the PIC device descriptor.
+ * @ irq_id    : input IRQ index.
+ * @ xp_wti    : extended pointer on the WTI mailbox.
+ *****************************************************************************************/
+void   soclib_pic_bind_irq( xptr_t    dev_xp,
+                            uint32_t  irq_id,
+                            xptr_t    wti_xp );
+
+/******************************************************************************************
+ * This blocking function mask an input IRQ in a remote PIC controler.
+ * It can be called by any thread running on any cluster.
+ ******************************************************************************************
+ * @ dev_xp    : extended pointer on the PIC device descriptor.
+ * @ irq_id    : input IRQ index. 
+ *****************************************************************************************/
+void   soclib_pic_unbind_irq( xptr_t    dev_xp,
+                              uint32_t  irq_id );
+
+
+#endif	/* _SOCLIB_IOPIC_H_ */
Index: trunk/kernel/drivers/soclib/soclib_tty.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_tty.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_tty.c	(revision 1)
@@ -0,0 +1,233 @@
+/*
+ * soclib_tty.c - soclib tty driver implementation.
+ *
+ * Author  Alain Greiner (2016)
+ *
+ * Copyright (c)  UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH..
+ *
+ * ALMOS-MKH. is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH. is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <dev_txt.h>
+#include <device.h>
+#include <soclib_tty.h>
+#include <remote_spinlock.h>
+#include <thread.h>
+#include <hal_special.h>
+
+/////////////////////////////////////
+void soclib_tty_init( xptr_t dev_xp )
+{
+    // get TXT device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get extended pointer on TTY-SOCLIB peripheral base address
+    xptr_t tty_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) ); 
+
+    // get SOCLIB_TTY device cluster and local pointer
+    cxy_t      tty_cxy = GET_CXY( tty_xp );
+    uint32_t * tty_ptr = (uint32_t *)GET_PTR( tty_xp );
+  
+    // mask both TTY_RX_IRQ and TTY_TX_IRQ
+    hal_remote_sw( XPTR( tty_cxy , tty_ptr + TTY_CONFIG_REG ) , 0 );
+
+}  // end soclib_tty_init()
+
+//////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_tty_command( xptr_t th_xp )
+{
+    // get client thread cluster and local pointer
+    cxy_t      th_cxy = GET_CXY( th_xp );
+    thread_t * th_ptr = (thread_t *)GET_PTR( th_xp );
+
+    // get command type and extended pointer on TXT device
+    uint32_t type   =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.txt.type ) );
+    xptr_t   dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.txt.dev_xp ) );
+    
+    // get TXT device cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( dev_xp );
+    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+
+    // get extended pointer on SOCLIB_TTY base segment
+    xptr_t tty_xp = (xptr_t)hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+
+    // get SOCLIB_TTY base segment cluster and local pointer
+    cxy_t      tty_cxy = GET_CXY( tty_xp );
+    uint32_t * tty_ptr = (uint32_t *)GET_PTR( tty_xp );
+
+    if( type == TXT_READ )              // descheduling strategy for calling thead
+    {
+        // unmask RX_IRQ (data transfer will be done by the TTY_RX ISR)
+        xptr_t config_xp = XPTR( tty_cxy , tty_ptr + TTY_CONFIG_REG );
+        uint32_t old = hal_remote_lw( config_xp );
+        uint32_t new = old | TTY_CONFIG_RX_ENABLE;
+        hal_remote_atomic_cas( config_xp , old , new );
+
+        // Block and deschedule server thread 
+        thread_block( CURRENT_THREAD , THREAD_BLOCKED_DEV_ISR );
+        sched_yield();
+    }
+    else if( type == TXT_WRITE )        // descheduling strategy for calling thread
+    {
+        // unmask TX_IRQ (data transfer will be done by the TTY_TX ISR)
+        xptr_t config_xp = XPTR( tty_cxy , tty_ptr + TTY_CONFIG_REG );
+        uint32_t old = hal_remote_lw( config_xp );
+        uint32_t new = old | TTY_CONFIG_TX_ENABLE;
+        hal_remote_atomic_cas( config_xp , old , new );
+
+        // Block and deschedule server thread 
+        thread_block( CURRENT_THREAD , THREAD_BLOCKED_DEV_ISR );
+        sched_yield();
+    }
+    else if( type == TXT_SYNC_WRITE )  // busy waiting strategy for calling thread
+    {
+        uint32_t   status;        
+        bool_t     empty;
+        uint32_t   i;
+
+        // get source buffer extended pointer & bytes count
+        uint32_t count  = hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.txt.count ) );
+        xptr_t   buf_xp = hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.txt.buf_xp ) );
+
+        // loop on characters 
+        for( i = 0 ; i < count ; i++ )
+        { 
+            do
+            {
+                // get TTY_STATUS_REG
+                status = hal_remote_lw( XPTR( tty_cxy , tty_ptr + TTY_STATUS_REG ) );
+                empty  = ( (status & TTY_STATUS_TX_FULL) == 0 );
+
+                if ( empty )  // TTY_TX empty => transfer one byte
+                {
+                    // get one byte from command buffer in client cluster
+                    char byte = (char)hal_remote_lb( buf_xp + i );
+
+                    // write byte to TTY_WRITE_REG in TTY cluster
+                    hal_remote_sb( XPTR( tty_cxy , tty_ptr + TTY_WRITE_REG ) , byte );
+                }
+            } 
+            while ( empty == false );
+        }
+    }
+}  // end soclib_tty_command()
+
+
+////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_tty_isr( device_t * dev )
+{
+    uint32_t   type;         // command type
+    uint32_t   count;        // number of bytes in buffer
+    xptr_t     buf_xp;       // Rextended pointer on buffer
+    uint32_t   status;       // TTY terminal status
+    char       byte;         // read byte
+    uint32_t   i;
+
+
+    // get extended pointer on client thread
+    xptr_t root = XPTR( local_cxy , &dev->wait_root );
+    xptr_t client_xp = XLIST_FIRST_ELEMENT( root , thread_t , wait_list );
+
+    // get client thread cluster and local pointer
+    cxy_t      client_cxy = GET_CXY( client_xp );
+    thread_t * client_ptr = (thread_t *)GET_PTR( client_xp );
+
+    // get command arguments
+    type    = hal_remote_lw ( XPTR( client_cxy , &client_ptr->dev.txt.type   ) );
+    count   = hal_remote_lw ( XPTR( client_cxy , &client_ptr->dev.txt.count  ) );
+    buf_xp  = hal_remote_lwd( XPTR( client_cxy , &client_ptr->dev.txt.buf_xp ) );
+
+    // get SOCLIB_TTY peripheral cluster and local pointer
+    cxy_t      tty_cxy = GET_CXY( dev->base );
+    uint32_t * tty_ptr = (uint32_t *)GET_PTR( dev->base );
+
+    if( type == TXT_READ )              // read one single character
+    {
+        // get TTY_STATUS_REG
+        status = hal_remote_lw( XPTR( tty_cxy , tty_ptr + TTY_STATUS_REG ) );
+
+        if( status & TTY_STATUS_RX_FULL )   // TTY_RX full => transfer one byte
+        {
+            // get a byte from TTY_READ_REG, and acknowledge RX_IRQ
+            byte = (char)hal_remote_lb( XPTR( tty_cxy , tty_ptr + TTY_READ_REG ) );
+
+            // write it to command buffer
+            hal_remote_sb( buf_xp , byte );
+
+            // update TTY_WRITE_REG if echo mode
+            if( CONFIG_TXT_ECHO_MODE )
+            {
+                if( (byte == '\b') || (byte == 0x7F) )
+		        {
+			        hal_remote_sb( XPTR( tty_cxy , tty_ptr + TTY_WRITE_REG ) , '\b' );
+			        hal_remote_sb( XPTR( tty_cxy , tty_ptr + TTY_WRITE_REG ) , ' '  );
+			        hal_remote_sb( XPTR( tty_cxy , tty_ptr + TTY_WRITE_REG ) , '\b' );
+		        }
+                else
+                {
+			        hal_remote_sw( XPTR( tty_cxy , tty_ptr + TTY_WRITE_REG ) , byte );
+		        }
+            }
+        }
+        else                               // buffer empty => exit ISR for retry
+        {
+            return;
+        }
+    }
+    else if( type == TXT_WRITE )         // write a string
+    {
+        // loop on characters 
+        for( i = 0 ; i < count ; i++ )
+        { 
+            // get TTY_STATUS_REG
+            status = hal_remote_lw( XPTR( tty_cxy , tty_ptr + TTY_STATUS_REG ) );
+
+            if( (status & TTY_STATUS_TX_FULL) == 0 ) // TTY_TX empty => transfer one byte
+            {
+                // get one byte from command buffer
+                byte = (char)hal_remote_lb( buf_xp + i );
+
+                // write byte to TTY_WRITE_REG, and acknowledge TX_IRQ
+                hal_remote_sb( XPTR( tty_cxy , tty_ptr + TTY_STATUS_REG ) , byte );
+            }
+            else         // TTY_TX full => update command arguments and exit ISR for retry
+            {
+                // update arguments in command for retry
+                hal_remote_sw ( XPTR( client_cxy , &client_ptr->dev.txt.count )  , count - i ); 
+                hal_remote_swd( XPTR( client_cxy , &client_ptr->dev.txt.buf_xp ) , buf_xp + i );
+                return;
+            }
+        }
+    }
+
+    // The I/O operation completed when we reach this point
+
+    // mask both TTY_RX_IRQ and TTY_TX_IRQ
+    hal_remote_sw( XPTR( tty_cxy , tty_ptr + TTY_CONFIG_REG ) , 0 );
+
+    // set I/O operation status in command
+    hal_remote_sw( XPTR( client_cxy , &client_ptr->dev.txt.error ) , 0 );
+
+    // unblock server thread
+    thread_unblock( XPTR( local_cxy , &dev->server ) , THREAD_BLOCKED_DEV_ISR );
+
+    // unblock client thread
+    thread_unblock( client_xp , THREAD_BLOCKED_IO );
+
+}  // end soclib_tty_isr()
+
+
Index: trunk/kernel/drivers/soclib/soclib_tty.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_tty.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_tty.h	(revision 1)
@@ -0,0 +1,97 @@
+/*
+ * soclib_tty.c - soclib tty driver definition.
+ *
+ * Author  Alain Greiner (2016)
+ *
+ * Copyright (c)  UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <dev_txt.h>
+#include <device.h>
+#include <spinlock.h>
+
+
+/****************************************************************************************
+ * This driver supports the soclib_multi_tty component.
+ * It implements the generic TXT device API:
+ * - transfer one single character from TTY to command "buffer" if to_mem is non-zero.
+ * - transfer "count" characters from command "buffer" to TTY if "to_mem is zero.
+ ***************************************************************************************/
+
+/****************************************************************************************
+ *     SOCLIB_TTY registers offsets  
+ ***************************************************************************************/
+
+#define TTY_WRITE_REG          0
+#define TTY_STATUS_REG         1
+#define TTY_READ_REG           2
+#define TTY_CONFIG_REG         3
+
+#define TTY_SPAN               4       // number of registers per channel
+
+/****************************************************************************************
+ * masks for TTY_STATUS_REG 
+ ***************************************************************************************/
+
+#define TTY_STATUS_RX_FULL     1       // TTY_READ_REG full if 1
+#define TTY_STATUS_TX_FULL     2       // TTY_WRITE_REG full if 1
+
+/****************************************************************************************
+ * masks for TTY_CONFIG_REG 
+ ***************************************************************************************/
+
+#define TTY_CONFIG_RX_ENABLE   1       // TTY_RX IRQ enabled if 1
+#define TTY_CONFIG_TX_ENABLE   2       // TTY_TX IRQ enabled if 1
+
+/****************************************************************************************
+ * This function masks both the TTY_RX and TTY_TX IRQs from the SOCLIB_TTY device.
+ * Thes IRQs are unmasked by the soclib_tty_cmd() function.
+ ****************************************************************************************
+ * @ dev     : extended pointer on the generic TXT device descriptor.
+ ***************************************************************************************/
+extern void soclib_tty_init( xptr_t dev_xp );
+
+/****************************************************************************************
+ * This function handles the command registered in the thread descriptor identified
+ * by the <xp_thread> argument.
+ * - For the TXT_READ and TXT_WRITE commands, it only unmask the proper TTY_RX / TTY_TX
+ *   IRQ, and blocks the TXT device server thread on the THREAD_BLOCKED_DEV_ISR, as the
+ *   data transfer is done by the ISR.
+ * - For the TXT_SYNC_READ command, that should be only used by the kernel do display
+ *   log or debug messages, it directly access the SOCLIB_TTY registers, using
+ *   a busy waiting policy if required.
+ ****************************************************************************************
+ * @ xp_thread : extended pointer on client thread descriptor.
+ ***************************************************************************************/
+extern void soclib_tty_command( xptr_t thread_xp );
+
+/****************************************************************************************
+ * This ISR should be executed only for the TXT_READ and TXT_WRITE commands.
+ * It get the command arguments from the first client thread in the TXT device queue:
+ * - if TXT_READ, it transfer one byte from the TTY_READ_REG to the command buffer.
+ *   It simply returns for retry if TTY_READ_REG is empty.
+ * - if TXT_WRITE, it tries to transfer several bytes from the command buffer to the 
+ *   TTY_WRITE_REG. If the TTY_WRITE_REG is full, it updates the "count" and "buffer" 
+ *   command arguments and returns for retry.
+ * When the I/O operation is completed, it set the status field in the command, unblock
+ * the server thread, and unblock the client thread. 
+ ****************************************************************************************
+ * @ dev     : local pointer on generic TXT device descriptor.
+ ***************************************************************************************/
+extern void soclib_tty_isr( device_t * dev );
+
Index: trunk/kernel/drivers/soclib/soclib_xcu.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_xcu.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_xcu.c	(revision 1)
@@ -0,0 +1,156 @@
+/*
+ * soclib_xcu.c - soclib XCU driver API implementation.
+ *
+ * Authors  Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <soclib_xcu.h>
+#include <hal_types.h>
+#include <core.h>
+#include <device.h>
+
+
+
+/////////////////////////////////////
+void soclib_xcu_init( device_t * icu,
+                      lid_t      lid )
+{
+    // get local ICU segment base address
+	uint32_t * base = (uint32_t *)GET_PTR( icu->base );
+
+    // write into registers
+    base[XCU_MSK_HWI_DISABLE << 5 | lid] = 0xFFFFFFFF;
+    base[XCU_MSK_WTI_DISABLE << 5 | lid] = 0xFFFFFFFF;
+    base[XCU_MSK_PTI_DISABLE << 5 | lid] = 0xFFFFFFFF;
+}
+
+///////////////////////////////////////////////
+void soclib_xcu_disable_irq( xptr_t     icu_xp,
+                             uint32_t   mask,
+                             uint32_t   type,
+                             lid_t      lid )
+{
+    // get remote ICU cluster and local pointer
+    cxy_t      icu_cxy = GET_CXY( icu_xp );
+    device_t * icu_ptr = (device_t *)GET_PTR( icu_xp );
+
+    // get remote XCU segment base address
+	xptr_t base = (xptr_t)hal_remote_lwd( XPTR( icu_cxy , &icu_ptr->base ) );
+
+    // compute xptr on relevant XCU mask register
+    xptr_t   reg_xp;
+	if     ( type == WTI_TYPE ) reg_xp = base + ((XCU_MSK_WTI_DISABLE << 5 | lid)<<2);
+	else if( type == HWI_TYPE ) reg_xp = base + ((XCU_MSK_HWI_DISABLE << 5 | lid)<<2);
+	else                        reg_xp = base + ((XCU_MSK_PTI_DISABLE << 5 | lid)<<2);
+
+    // reset relevant XCU mask register
+	hal_remote_sw( reg_xp , mask );
+}
+
+//////////////////////////////////////////////
+void soclib_xcu_enable_irq( xptr_t     icu_xp,
+                            uint32_t   mask,
+                            uint32_t   type,
+                            lid_t      lid )
+{
+    // get remote ICU cluster and local pointer
+    cxy_t      icu_cxy = GET_CXY( icu_xp );
+    device_t * icu_ptr = (device_t *)GET_PTR( icu_xp );
+
+    // get remote XCU segment base address
+	xptr_t base = (xptr_t)hal_remote_lwd( XPTR( icu_cxy , &icu_ptr->base ) );
+
+    // compute xptr on relevant XCU mask register
+    xptr_t   reg_xp;
+	if     ( type == WTI_TYPE ) reg_xp = base + ((XCU_MSK_WTI_ENABLE << 5 | lid)<<2);
+	else if( type == HWI_TYPE ) reg_xp = base + ((XCU_MSK_HWI_ENABLE << 5 | lid)<<2);
+	else                        reg_xp = base + ((XCU_MSK_PTI_ENABLE << 5 | lid)<<2);
+
+    // set relevant XCU mask register
+	hal_remote_sw( reg_xp , mask );
+}
+
+///////////////////////////////////////////
+void soclib_xcu_set_period( device_t * icu,
+                            uint32_t   index,
+                            uint32_t   period )
+{
+    // get local ICU segment base address
+	uint32_t * base = (uint32_t *)GET_PTR( icu->base );
+
+    // write into register
+    base[XCU_PTI_PER << 5 | index] = period;
+}
+
+//////////////////////////////////////////////
+uint32_t soclib_xcu_ack_timer( device_t * icu,
+                               uint32_t   index )
+{
+    // get local ICU segment base address
+	uint32_t * base = (uint32_t *)GET_PTR( icu->base );
+
+    // read from register
+	return base[XCU_PTI_ACK << 5 | index];
+}
+
+///////////////////////////////////////////////
+void soclib_xcu_get_status( device_t * icu,
+                            lid_t      lid,
+                            uint32_t * hwi_status,
+                            uint32_t * wti_status,
+                            uint32_t * pti_status )
+{
+    // get local ICU segment base address 
+    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
+
+    // read PRIO register
+	uint32_t prio = base[XCU_PRIO << 5 | lid];
+
+    if( prio & 0x4 ) *wti_status = ((prio >> 24) & 0x1F) + 1;
+    if( prio & 0x2 ) *hwi_status = ((prio >> 16) & 0x1F) + 1;
+    if( prio & 0x1 ) *pti_status = ((prio >>  8) & 0x1F) + 1;
+}
+
+/////////////////////////////////////////
+void soclib_xcu_send_ipi( xptr_t  xp_icu,
+                          lid_t   lid )
+{
+    // get target ICU device cluster and local pointer
+    cxy_t       cxy_icu = GET_CXY( xp_icu );
+    device_t  * ptr_icu = (device_t *)GET_PTR( xp_icu );
+
+    // get extended pointer on target ICU segment base
+    xptr_t  xp_base = (xptr_t)hal_remote_lwd( XPTR( cxy_icu , &ptr_icu->base ) );
+
+    // get remote ICU segment local pointer 
+	uint32_t  * base = (uint32_t *)GET_PTR( xp_base );
+
+    // send IPI to remote core
+	hal_remote_sw( XPTR( cxy_icu , &base[XCU_WTI_REG << 5 | lid] ) , 0 );
+}
+
+//////////////////////////////////////////////
+uint32_t * soclib_xcu_wti_ptr( device_t * icu,
+                               uint32_t   index )
+{
+    uint32_t * base = (uint32_t *)GET_PTR( icu->base );
+
+    return &base[XCU_WTI_REG << 5 | index];
+}
Index: trunk/kernel/drivers/soclib/soclib_xcu.h
===================================================================
--- trunk/kernel/drivers/soclib/soclib_xcu.h	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_xcu.h	(revision 1)
@@ -0,0 +1,153 @@
+/*
+ * soclib_xcu.h - soclib XCU driver API definition.
+ *
+ * Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SOCLIB_XCU_H_
+#define _SOCLIB_XCU_H_
+
+#include <hal_types.h>
+#include <device.h>
+
+/******************************************************************************************
+ *    SOCLIB_XCU  Registers Mnemonics
+ *****************************************************************************************/
+
+#define XCU_WTI_REG            0
+#define XCU_PTI_PER            1
+#define XCU_PTI_VAL            2
+#define XCU_PTI_ACK            3
+#define XCU_MSK_PTI            4
+#define XCU_MSK_PTI_ENABLE     5
+#define XCU_MSK_PTI_DISABLE    6
+#define XCU_PTI_ACTIVE         6
+#define XCU_MSK_HWI            8
+#define XCU_MSK_HWI_ENABLE     9
+#define XCU_MSK_HWI_DISABLE    10
+#define XCU_HWI_ACTIVE         10
+#define XCU_MSK_WTI            12
+#define XCU_MSK_WTI_ENABLE     13
+#define XCU_MSK_WTI_DISABLE    14
+#define XCU_WTI_ACTIVE         14
+#define XCU_PRIO               15
+#define XCU_CONFIG             16
+
+/******************************************************************************************
+ * This function initialises the local XCU device masks registers for a given
+ * core identified by its local index.
+ ******************************************************************************************
+ * @ icu       : pointer on the local ICU device descriptor
+ * @ lid       : core local index
+ *****************************************************************************************/
+void soclib_xcu_init( device_t * icu,
+                      lid_t      lid );
+
+/******************************************************************************************
+ * This function set bits in a remote XCU mask register for a given IRQ type,
+ * and a given core. As it uses remote accesses, it can be callet in any cluster.
+ * Only the bits with "1" value in mask argument are set, other bits are not modified.
+ * All input IRQs of requested types corresponding to "1" bits in mask are enabled.
+ ******************************************************************************************
+ * @ icu_xp     : extended pointer on the remote XCU device descriptor.
+ * @ mask       : mask value
+ * @ type       : HWI_TYPE / PTI_TYPE / WTI_TYPE
+ * @ lid        : local core index == output IRQ index
+ *****************************************************************************************/
+void  soclib_xcu_enable_irq( xptr_t     icu_xp,
+                             uint32_t   mask, 
+                             uint32_t   type, 
+                             lid_t      lid );
+
+/******************************************************************************************
+ * This function clear bits in a remote XCU mask register for a given IRQ type,
+ * and a given core. As it uses remote accesses, it can be callet in any cluster.
+ * Only the bits with "1" value in mask argument are cleared, other bits are not modified.
+ * All input IRQs of requested types corresponding to "1" bits in mask are disabled.
+ ******************************************************************************************
+ * @ icu_xp     : extended pointer on the remote XCU device descriptor.
+ * @ mask       : mask value
+ * @ type       : HWI_TYPE / PTI_TYPE / WTI_TYPE
+ * @ lid        : local core index == output IRQ index
+ *****************************************************************************************/
+void  soclib_xcu_disable_irq( xptr_t     icu_xp,
+                              uint32_t   mask, 
+                              uint32_t   type, 
+                              lid_t      lid );
+
+/******************************************************************************************
+ * This function set the period value for a local XCU timer.
+ ******************************************************************************************
+ * @ icu        : pointer on the local ICU device descriptor
+ * @ index      : timer index = PTI index
+ * @ period     : Value to be written 
+ *****************************************************************************************/
+void  soclib_xcu_set_period( device_t * icu,
+                             uint32_t   index,
+                             uint32_t   period );
+
+/******************************************************************************************
+ * This function acknowledge a PTI IRQ for a local XCU timer.
+ ******************************************************************************************
+ * @ icu        : pointer on the local ICU device descriptor
+ * @ index      : timer index = PTI index
+ * @ the returned value in not significant, but acknowledge requires a read.
+ *****************************************************************************************/
+uint32_t soclib_xcu_ack_timer( device_t * icu,
+                               uint32_t   index );
+
+/******************************************************************************************
+ * This function returns the highest priority active interrupt of each type.
+ * If no active interrupt => status == 0 / else => status = index + 1
+ ******************************************************************************************
+ * @ icu        : pointer on the local ICU device descriptor.
+ * @ lid        : core local index.
+ * @ hwi_status : buffer for returned HWI status
+ * @ wti_status : buffer for returned WTI status
+ * @ pti_status : buffer for returned PTI status
+ *****************************************************************************************/
+void  soclib_xcu_get_status( device_t * icu,
+                             lid_t      lid,
+                             uint32_t * hwi_status,
+                             uint32_t * wti_status,
+                             uint32_t * pti_status );
+
+/******************************************************************************************
+ * This function send an IPI (Inter Processor Interrupt) to a remote XCU,
+ * by writing in a WTI mailbox.
+ ******************************************************************************************
+ * @ icu_xp  : extended pointer on target ICU device descriptor.
+ * @ lid     : target core local index == WTI mailbox index.
+ *****************************************************************************************/
+void  soclib_xcu_send_ipi( xptr_t     icu_xp,
+                           lid_t      lid );
+
+/******************************************************************************************
+ * This function returns the local pointer on a WTI mailbox identified by its index.
+ * This function does not access the SOCLIB_XCU hardware device. 
+ ******************************************************************************************
+ * @ icu     : pointer on the local ICU device descriptor.
+ * @ index   : WTI mailbox index.
+ *****************************************************************************************/
+uint32_t * soclib_xcu_wti_ptr( device_t * icu,
+                               uint32_t   index );
+
+
+#endif	/* _SOCLIB_XCU_H_ */
Index: trunk/kernel/fs/devfs.c
===================================================================
--- trunk/kernel/fs/devfs.c	(revision 690)
+++ 	(revision )
@@ -1,822 +1,0 @@
-/*
- * devfs.c - DEVFS File system API implementation.
- *
- * Author   Mohamed Lamine Karaoui (2014,2015)
- *          Alain Greiner          (2016,2017,2018,2019,2020)
- *
- * Copyright (c) Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <hal_uspace.h>
-#include <printk.h>
-#include <string.h>
-#include <chdev.h>
-#include <thread.h>
-#include <dev_txt.h>
-#include <cluster.h>
-#include <vfs.h>
-#include <kmem.h>
-#include <devfs.h>
-
-/////////////////////////////////////////////////////////////////////////////////////////
-//     Extern variables
-/////////////////////////////////////////////////////////////////////////////////////////
-
-extern vfs_ctx_t            fs_context[];   // allocated in kernel_init.c
-extern chdev_directory_t    chdev_dir;      // allocated in kernel_init.c
-
-#if (DEBUG_SYS_READ & 1)
-extern uint32_t  enter_devfs_read;
-extern uint32_t  exit_devfs_read;
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-extern uint32_t  enter_devfs_write;
-extern uint32_t  exit_devfs_write;
-#endif
-
-///////////////////////////////////
-xptr_t devfs_ctx_alloc( cxy_t cxy )
-{
-    // allocates devfs context from target cluster 
-	void * ptr = kmem_remote_alloc( cxy,
-                                    bits_log2(sizeof(devfs_ctx_t)),
-                                    AF_ZERO );
-
-    if( ptr == NULL ) return XPTR_NULL;
-	else              return XPTR( cxy , ptr );
-}
-
-/////////////////////////////////////////////
-void devfs_ctx_init( xptr_t     devfs_ctx_xp,
-                     xptr_t     devfs_dev_inode_xp,
-                     xptr_t     devfs_external_inode_xp )
-{
-    // get cluster and local pointer on remote devfs context
-    devfs_ctx_t * devfs_ctx_ptr = GET_PTR( devfs_ctx_xp );
-    cxy_t         devfs_ctx_cxy = GET_CXY( devfs_ctx_xp );
-
-    // set values in remote devfs context
-    hal_remote_s64( XPTR( devfs_ctx_cxy  , &devfs_ctx_ptr->dev_inode_xp ),
-                    devfs_dev_inode_xp );
-
-    hal_remote_s64( XPTR( devfs_ctx_cxy  , &devfs_ctx_ptr->external_inode_xp ),
-                    devfs_external_inode_xp );
-
-    // register devfs context in the remote fs_context array[] 
-    hal_remote_spt( XPTR( devfs_ctx_cxy , &fs_context[FS_TYPE_DEVFS].extend ),
-                          devfs_ctx_ptr ); 
-}
-
-//////////////////////////////////////////////
-void devfs_ctx_destroy( xptr_t  devfs_ctx_xp )
-{
-    // get cluster and local pointer on devfs context
-    devfs_ctx_t * devfs_ctx_ptr = GET_PTR( devfs_ctx_xp );
-    cxy_t         devfs_ctx_cxy = GET_CXY( devfs_ctx_xp );
-
-    // release devfs context descriptor to remote cluster 
-    kmem_remote_free( devfs_ctx_cxy,
-                      devfs_ctx_ptr,
-                      bits_log2(sizeof(devfs_ctx_t)) );
-}
-
-/////////////////////////////////////////////////
-void devfs_global_init( xptr_t   root_inode_xp,
-                        xptr_t * devfs_dev_inode_xp,
-                        xptr_t * devfs_external_inode_xp )
-{
-    error_t       error;
-    xptr_t        unused_xp;   // required by vfs_add_child_in_parent()
-    vfs_inode_t * inode;
-
-    // get 
-
-    // create DEVFS "dev" inode in cluster 0
-    error = vfs_add_child_in_parent( 0,                // cxy
-                                     FS_TYPE_DEVFS,
-                                     root_inode_xp,
-                                     "dev",
-                                     &unused_xp,
-                                     devfs_dev_inode_xp );
-
-    // update inode "type" field
-    inode = GET_PTR( *devfs_dev_inode_xp );
-    inode->type = FILE_TYPE_DIR;
- 
-    // create dentries <.> and <..> in <dev>
-    error |= vfs_add_special_dentries( *devfs_dev_inode_xp,
-                                       root_inode_xp );
-
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot create <dev> directory\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-#if DEBUG_DEVFS_GLOBAL_INIT
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_DEVFS_GLOBAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <dev> inode / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-    // create DEVFS "external" inode in cluster 0
-    error = vfs_add_child_in_parent( 0,               // cxy
-                                     FS_TYPE_DEVFS,
-                                     *devfs_dev_inode_xp,
-                                     "external",
-                                     &unused_xp,
-                                     devfs_external_inode_xp );
-
-    // update inode "type" field
-    inode = GET_PTR( *devfs_external_inode_xp );
-    inode->type = FILE_TYPE_DIR;
- 
-    // create dentries <.> and <..> in <external>
-    error |= vfs_add_special_dentries( *devfs_external_inode_xp,
-                                       *devfs_dev_inode_xp );
-
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot create <external> directory\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-#if DEBUG_DEVFS_GLOBAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_GLOBAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <external> inode / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-}  // end devfs_global_init()
-
-///////////////////////////////////////////////////
-void devfs_local_init( xptr_t   devfs_dev_inode_xp,
-                       xptr_t   devfs_external_inode_xp )
-{
-    xptr_t        internal_inode_xp;   // extended pointer on <internal> inode
-    vfs_inode_t * internal_inode_ptr;  // local pointer on <internal> inode
-    char          node_name[16];
-    xptr_t        chdev_xp;
-    cxy_t         chdev_cxy;
-    chdev_t     * chdev_ptr;
-    xptr_t        inode_xp;
-    vfs_inode_t * inode_ptr;
-    uint32_t      channel;
-    xptr_t        unused_xp;           // required by add_child_in_parent()
-    error_t       error;
-    
-
-#if DEBUG_DEVFS_LOCAL_INIT 
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-    // create <internal> directory 
-    snprintk( node_name , 16 , "internal_%x" , local_cxy );
-
-    error = vfs_add_child_in_parent( local_cxy,              // target cluster
-                                     FS_TYPE_DEVFS,          // FS type
-                                     devfs_dev_inode_xp,     // parent inode
-                                     node_name,              // child name
-                                     &unused_xp,
-                                     &internal_inode_xp );   // child inode
-
-    // set <internal> inode "type" field
-    internal_inode_ptr       = GET_PTR( internal_inode_xp );
-    internal_inode_ptr->type = FILE_TYPE_DEV;
- 
-    // create dentries <.> and <..> in <internal>
-    error |= vfs_add_special_dentries( internal_inode_xp,
-                                       devfs_dev_inode_xp );
-
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot create <internal> directory\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-#if DEBUG_DEVFS_LOCAL_INIT 
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <%s> inode in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, node_name, local_cxy, cycle );
-#endif
-
-    // create MMC chdev inode
-    chdev_xp  = chdev_dir.mmc[local_cxy];
-    if( chdev_xp != XPTR_NULL)
-    {
-        chdev_ptr = GET_PTR( chdev_xp );
-        chdev_cxy = GET_CXY( chdev_xp );
-
-        if( chdev_cxy != local_cxy )
-        {
-            printk("\n[PANIC] in %s : illegal MMC chdev in cluster %x\n",
-            __FUNCTION__, local_cxy );
-            hal_core_sleep();
-        }
-
-        error = vfs_add_child_in_parent( local_cxy,
-                                         FS_TYPE_DEVFS,
-                                         internal_inode_xp,
-                                         chdev_ptr->name,
-                                         &unused_xp,
-                                         &inode_xp );
-
-        if( error )
-        {
-            printk("\n[PANIC] in %s : cannot create MMC inode in cluster %x\n",
-            __FUNCTION__, local_cxy );
-            hal_core_sleep();
-        }
-
-        // update child inode "extend" and "type" fields
-        inode_ptr = GET_PTR( inode_xp );
-        inode_ptr->extend = chdev_ptr;
-        inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <mmc> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-
-    }
-
-    // create DMA chdev inodes (one DMA channel per core)
-    for( channel = 0 ; channel < LOCAL_CLUSTER->cores_nr ; channel++ )
-    {
-        chdev_xp  = chdev_dir.dma[channel];
-        if( chdev_xp != XPTR_NULL)
-        {
-            chdev_ptr = GET_PTR( chdev_xp );
-            chdev_cxy = GET_CXY( chdev_xp );
-
-            if( chdev_cxy != local_cxy )
-            {
-                printk("\n[PANIC] in %s : illegal DMA chdev in cluster %x\n",
-                __FUNCTION__, local_cxy );
-                hal_core_sleep();
-            }
-
-            error = vfs_add_child_in_parent( local_cxy,
-                                             FS_TYPE_DEVFS,
-                                             internal_inode_xp,
-                                             chdev_ptr->name,
-                                             &unused_xp,
-                                             &inode_xp );
-            if( error )
-            {
-                printk("\n[PANIC] in %s : cannot create DMA inode in cluster %x\n",
-                __FUNCTION__, local_cxy );
-                hal_core_sleep();
-            }
-
-            // update child inode "extend" and "type" fields
-            inode_ptr = GET_PTR( inode_xp );
-            inode_ptr->extend = chdev_ptr;
-            inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread [%x,%x] created <dma[%d]> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
-#endif
-        }
-    }
-
-    // create an IOB inode in cluster containing IOB chdev
-    chdev_xp = chdev_dir.iob;
-    if( chdev_xp != XPTR_NULL )
-    {
-        chdev_cxy = GET_CXY( chdev_xp );
-        chdev_ptr = GET_PTR( chdev_xp );
-
-        if( chdev_cxy == local_cxy )
-        {
-            error = vfs_add_child_in_parent( local_cxy,
-                                             FS_TYPE_DEVFS,
-                                             devfs_external_inode_xp,
-                                             chdev_ptr->name,
-                                             &unused_xp,
-                                             &inode_xp );
-            if( error )
-            {
-                printk("\n[PANIC] in %s : cannot create IOB inode in cluster %x\n",
-                __FUNCTION__, local_cxy );
-                hal_core_sleep();
-            }
-
-            // update child inode "extend" and "type" fields
-            inode_ptr = GET_PTR( inode_xp );
-            inode_ptr->extend = chdev_ptr;
-            inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <iob> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-        }
-    }
-        
-    // create a PIC inode in cluster containing PIC chdev
-    chdev_xp = chdev_dir.pic;
-    if( chdev_xp != XPTR_NULL )
-    {
-        chdev_cxy = GET_CXY( chdev_xp );
-        chdev_ptr = GET_PTR( chdev_xp );
-
-        if( chdev_cxy == local_cxy )
-        {
-            error = vfs_add_child_in_parent( local_cxy,
-                                             FS_TYPE_DEVFS,
-                                             devfs_external_inode_xp,
-                                             chdev_ptr->name,
-                                             &unused_xp,
-                                             &inode_xp );
-
-            if( error )
-            {
-                printk("\n[PANIC] in %s : cannot create PIC inode in cluster %x\n",
-                __FUNCTION__, local_cxy );
-                hal_core_sleep();
-            }
-
-            // update child inode "extend" field
-            inode_ptr = GET_PTR( inode_xp );
-            inode_ptr->extend = chdev_ptr;
-            inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <pic> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-        }
-    }
-
-    // create a TXT_RX inode in each cluster containing a TXT_RX chdev
-    for( channel = 0 ; channel < CONFIG_MAX_TXT_CHANNELS ; channel++ )
-    {
-        chdev_xp = chdev_dir.txt_rx[channel];
-        if( chdev_xp != XPTR_NULL )
-        {
-            chdev_cxy = GET_CXY( chdev_xp );
-            chdev_ptr = GET_PTR( chdev_xp );
-
-            if( chdev_cxy == local_cxy )
-            {
-                error = vfs_add_child_in_parent( local_cxy,
-                                                 FS_TYPE_DEVFS,
-                                                 devfs_external_inode_xp,
-                                                 chdev_ptr->name,
-                                                 &unused_xp,
-                                                 &inode_xp );
-
-                if( error )
-                {
-                    printk("\n[PANIC] in %s : cannot create TXT_RX inode in cluster %x\n",
-                    __FUNCTION__, local_cxy );
-                    hal_core_sleep();
-                }
-
-                // update child inode "extend" and "type" fields
-                inode_ptr = GET_PTR( inode_xp );
-                inode_ptr->extend = chdev_ptr;
-                inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <txt_rx[%d]> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
-#endif
-            }
-        }
-    }
-
-    // create a TXT_TX inode in each cluster containing a TXT_TX chdev
-    for( channel = 0 ; channel < CONFIG_MAX_TXT_CHANNELS ; channel++ )
-    {
-        chdev_xp = chdev_dir.txt_tx[channel];
-        if( chdev_xp != XPTR_NULL )
-        {
-            chdev_cxy = GET_CXY( chdev_xp );
-            chdev_ptr = GET_PTR( chdev_xp );
-
-            if( chdev_cxy == local_cxy )
-            {
-                error = vfs_add_child_in_parent( local_cxy,
-                                                 FS_TYPE_DEVFS,
-                                                 devfs_external_inode_xp,
-                                                 chdev_ptr->name,
-                                                 &unused_xp,
-                                                 &inode_xp );
-                if( error )
-                {
-                    printk("\n[PANIC] in %s : cannot create TXT_TX inode in cluster %x\n",
-                    __FUNCTION__, local_cxy );
-                    hal_core_sleep();
-                }
-
-                // update child inode "extend" and "type" fields
-                inode_ptr = GET_PTR( inode_xp );
-                inode_ptr->extend = chdev_ptr;
-                inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT 
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <txt_tx[%d]> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
-#endif
-            }
-        }
-    }
-
-    // create an IOC inode in each cluster containing an IOC chdev 
-    for( channel = 0 ; channel < CONFIG_MAX_IOC_CHANNELS ; channel++ )
-    {
-        chdev_xp = chdev_dir.ioc[channel];
-        if( chdev_xp != XPTR_NULL )
-        {
-            chdev_cxy = GET_CXY( chdev_xp );
-            chdev_ptr = GET_PTR( chdev_xp );
-
-            if( chdev_cxy == local_cxy )
-            {
-                error = vfs_add_child_in_parent( local_cxy,
-                                                 FS_TYPE_DEVFS,
-                                                 devfs_external_inode_xp,
-                                                 chdev_ptr->name,
-                                                 &unused_xp,
-                                                 &inode_xp );
-                if( error )
-                {
-                    printk("\n[PANIC] in %s : cannot create IOC inode in cluster %x\n",
-                    __FUNCTION__, local_cxy );
-                    hal_core_sleep();
-                }
-
-                // update child inode "extend" and "type" fields
-                inode_ptr = GET_PTR( inode_xp );
-                inode_ptr->extend = chdev_ptr;
-                inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <ioc[%d]> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
-#endif
-            }
-        }
-    }
-
-    // create a FBF inode in each cluster containing a FBF chdev
-    for( channel = 0 ; channel < CONFIG_MAX_FBF_CHANNELS ; channel++ )
-    {
-        chdev_xp = chdev_dir.fbf[channel];
-        if( chdev_xp != XPTR_NULL )
-        {
-            chdev_cxy = GET_CXY( chdev_xp );
-            chdev_ptr = GET_PTR( chdev_xp );
-
-            if( chdev_cxy == local_cxy )
-            {
-                error = vfs_add_child_in_parent( local_cxy,
-                                                 FS_TYPE_DEVFS,
-                                                 devfs_external_inode_xp,
-                                                 chdev_ptr->name,
-                                                 &unused_xp,
-                                                 &inode_xp );
-                if( error )
-                {
-                    printk("\n[PANIC] in %s : cannot create FBF inode in cluster %x\n",
-                    __FUNCTION__, local_cxy );
-                    hal_core_sleep();
-                }
-
-                // update child inode "extend" and "type" fields
-                inode_ptr = GET_PTR( inode_xp );
-                inode_ptr->extend = chdev_ptr;
-                inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <fbf[%d]> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
-#endif
-            }
-        }
-    }
-
-    // create a NIC_RX inode in each cluster containing a NIC_RX chdev 
-    for( channel = 0 ; channel < CONFIG_MAX_NIC_CHANNELS ; channel++ )
-    {
-        chdev_xp = chdev_dir.nic_rx[channel];
-        if( chdev_xp != XPTR_NULL )
-        {
-            chdev_cxy = GET_CXY( chdev_xp );
-            chdev_ptr = GET_PTR( chdev_xp );
-
-            if( chdev_cxy == local_cxy )
-            {
-                error = vfs_add_child_in_parent( local_cxy,
-                                                 FS_TYPE_DEVFS,
-                                                 devfs_external_inode_xp,
-                                                 chdev_ptr->name,
-                                                 &unused_xp,
-                                                 &inode_xp );
-                if( error )
-                {
-                    printk("\n[PANIC] in %s : cannot create NIC_RX inode in cluster %x\n",
-                    __FUNCTION__, local_cxy );
-                    hal_core_sleep();
-                }
-
-                // update child inode "extend" and "type" fields
-                inode_ptr = GET_PTR( inode_xp );
-                inode_ptr->extend = chdev_ptr;
-                inode_ptr->type   = FILE_TYPE_DEV;
- 
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <nic_rx[%d]> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
-#endif
-            }
-        }
-    }
-
-    // create a NIC_TX inode in each cluster containing a NIC_TX chdev 
-    for( channel = 0 ; channel < CONFIG_MAX_NIC_CHANNELS ; channel++ )
-    {
-        chdev_xp = chdev_dir.nic_tx[channel];
-        if( chdev_xp != XPTR_NULL )
-        {
-            chdev_cxy = GET_CXY( chdev_xp );
-            chdev_ptr = GET_PTR( chdev_xp );
-
-            if( chdev_cxy == local_cxy )
-            {
-                error = vfs_add_child_in_parent( local_cxy,
-                                                 FS_TYPE_DEVFS,
-                                                 devfs_external_inode_xp,
-                                                 chdev_ptr->name,
-                                                 &unused_xp,
-                                                 &inode_xp );
-                if( error )
-                {
-                    printk("\n[PANIC] in %s : cannot create NIC_TX inode in cluster %x\n",
-                    __FUNCTION__, local_cxy );
-                    hal_core_sleep();
-                }
-
-                // update child inode "extend" and "type" fields
-                inode_ptr = GET_PTR( inode_xp );
-                inode_ptr->extend = chdev_ptr;
-                inode_ptr->type   = FILE_TYPE_DEV;
-        
-#if DEBUG_DEVFS_LOCAL_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_LOCAL_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created <nic_tx[%d]> inode in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, channel, local_cxy, cycle );
-#endif
-            }
-        }
-    }
-}  // end devfs_local_init()
-
-//////////////////////////////////////////
-int devfs_user_move( bool_t     to_buffer,
-                     xptr_t     file_xp,
-                     char     * u_buf,
-                     uint32_t   size )
-{
-    xptr_t           chdev_xp;
-    cxy_t            chdev_cxy;
-    chdev_t        * chdev_ptr;                    // associated chdev type
-    uint32_t         func;                         // chdev functionnal type
-    uint32_t         channel;                      // chdev channel index
-    uint32_t         burst;                        // number of bytes in a burst
-    uint32_t         todo;                         // number of bytes not yet moved
-    error_t          error;
-    uint32_t         i;
-
-    char             k_buf[CONFIG_TXT_KBUF_SIZE];  // local kernel buffer
-
-assert( __FUNCTION__, ( file_xp != XPTR_NULL ) , "file_xp == XPTR_NULL" );
-
-#if (DEBUG_SYS_READ & 1)
-enter_devfs_read = hal_time_stamp();
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-enter_devfs_write = hal_time_stamp();
-#endif
-
-#if DEBUG_DEVFS_MOVE
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_DEVFS_MOVE < cycle )
-printk("\n[%s] thread[%x,%x] enter / to_mem %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, to_buffer, cycle );
-#endif
-
-    // get extended pointer on chdev_xp
-    chdev_xp = chdev_from_file( file_xp );
-
-    // get cluster and local pointer on chdev
-    chdev_cxy  = GET_CXY( chdev_xp );
-    chdev_ptr  = (chdev_t *)GET_PTR( chdev_xp );
-
-    // get chdev functionnal type and channel
-    func    = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->func ) );
-    channel = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->channel ) );
-
-// Only TXT devices are associated to a pseudo-file
-assert( __FUNCTION__, ( func == DEV_FUNC_TXT ) , "illegal device func_type");
-
-    // initialise number of bytes to move
-    todo = size;
-
-    /////////////// TXT read
-    if( to_buffer )
-    { 
-        while( todo )
-        {
-            // set burst size
-            if( todo > CONFIG_TXT_KBUF_SIZE ) burst = CONFIG_TXT_KBUF_SIZE;
-            else                              burst = todo;
-
-            // read burst bytes from TXT device to kernel buffer
-            for( i = 0 ; i < burst ; i++ )
-            {
-                error = dev_txt_read( channel , &k_buf[i] );
-
-                if( error )  return -1;
-            }
-
-            // move burst bytes from k_buf to u_buf                   
-            hal_strcpy_to_uspace( u_buf,
-                                  XPTR( local_cxy , k_buf ),
-                                  burst );
-
-            // update loop variables
-            todo  -= burst;
-            u_buf += burst;
-        }
-
-#if DEBUG_DEVFS_MOVE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_MOVE < cycle )
-printk("\n[%s] thread[%x,%x] exit / to_mem %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, to_buffer, cycle );
-#endif
-
-#if (DEBUG_SYS_READ & 1)
-exit_devfs_read = hal_time_stamp();
-#endif
-            return size;
-    } 
-    ///////////// TXT write  
-    else                
-    {
-        while( todo )
-        {
-            // set burst size
-            if( todo > CONFIG_TXT_KBUF_SIZE ) burst = CONFIG_TXT_KBUF_SIZE;
-            else                              burst = todo;
-
-            // move burst bytes from u_buf to k_buf
-            hal_strcpy_from_uspace( XPTR( local_cxy , k_buf ) , u_buf , burst );
-
-            // write burst bytes from kernel buffer to TXT device
-            error = dev_txt_write( channel , k_buf , burst );
-
-            if( error ) return -1;
-
-            // update loop variables
-            todo  -= burst;
-            u_buf += burst;
-        } 
-
-#if DEBUG_DEVFS_MOVE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_MOVE < cycle )
-printk("\n[%s] thread[%x,%x] exit / to_mem %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, to_buffer, cycle );
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-exit_devfs_write = hal_time_stamp();
-#endif
-            return size;
-    }
-
-}  // end devfs_user_move()
-
-///////////////////////////////////////////////////////
-error_t devfs_get_user_dir( struct vfs_inode_s * inode,
-                            struct dirent      * array,
-                            uint32_t             max_dirent,
-                            uint32_t             min_dentry,
-                            bool_t               detailed,
-                            uint32_t           * entries,
-                            bool_t             * done )
-{
-    xptr_t         xhtab_xp;    // extended pointer on inode xhtab (children dentries)
-    xptr_t         dentry_xp;   // extended pointer on current dentry
-    vfs_dentry_t * dentry_ptr;  // local pointer on current dentry
-    uint32_t       dentry_id;   // dentry index in set of children dentry    
-    uint32_t       dirent_id;   // dirent index in array of dirent
-
-// detailed argument unused
-assert( __FUNCTION__, (detailed == false) , "detailed argument not supported\n");
- 
-    // One loop to scan the target inode xhtab containing the set of dentries
-    // exit loop if no more dentries, or dirent array full 
-
-#if DEBUG_DEVFS_GET_USER_DIR
-char       inode_name[CONFIG_VFS_MAX_NAME_LENGTH];
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-vfs_inode_get_name( XPTR( local_cxy , inode ) , inode_name );
-if( DEBUG_DEVFS_GET_USER_DIR < cycle )
-printk("\n[%s]  thread[%x,%x] enter for inode <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, inode_name , cycle );
-#endif
-
-    // get extended pointer on inode xhtab 
-    xhtab_xp  = XPTR( local_cxy , &inode->children );
-
-    // initialize loop variables
-    dentry_xp = xhtab_get_first( xhtab_xp );
-    dentry_id = 0;
-    dirent_id = 0;
-
-    while( (dentry_xp != XPTR_NULL ) && (dirent_id < max_dirent) )
-    {
-        if( dentry_id >= min_dentry )
-        {
-            // copy name into dirent array
-            dentry_ptr = GET_PTR( dentry_xp );
-            strcpy( array[dirent_id].d_name , dentry_ptr->name ); 
-
-            // increment dirent_id
-            dirent_id++;
-        }
-         
-        // update loop variables
-        dentry_xp = xhtab_get_next( xhtab_xp );
-        dentry_id++;
-    }
-
-    // return results of scan
-    *done    = (dentry_xp == XPTR_NULL);
-    *entries = dirent_id;
-
-#if DEBUG_DEVFS_GET_USER_DIR
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_DEVFS_GET_USER_DIR < cycle )
-printk("\n[%s]  thread[%x,%x] exit for inode <%s> / %d entries / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, inode_name, entries, cycle );
-#endif
-
-    return 0;
-    
-}  // en devfs_get_user_dir()
-
Index: trunk/kernel/fs/devfs.h
===================================================================
--- trunk/kernel/fs/devfs.h	(revision 690)
+++ 	(revision )
@@ -1,159 +1,0 @@
-/*
- * devfs.h - DEVFS File System API definition                                
- *
- * Authors       Mohamed Lamine Karaoui (2014,2015)
- *               Alain Greiner          (2016,2017,2018,2019,2020)
- *
- * Copyright (c) 2011,2012 UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _DEVFS_H_
-#define _DEVFS_H_
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// The DEVFS File System contains the inodes and dentries associated to the chdev
-// descriptors available in the architecture. 
-//
-// It is structured as a three levels tree structure :
-// - The "dev" directory inode is stored in cluster_IO. It is the root of the DEVFS
-//   file system. The parent inode is the "/" VFS root.
-// - There is one "internal_cxy" directory inode per cluster, that is the parent of
-//   the local children inodes associated to the local, internal chdev descriptors. 
-//   The parent dentry is stored in cluster_IO.
-// - The I/O cluster contains one "external" directory inode, that is the parent of 
-//   the remote children inodes associated to the remote external chdev descriptors.
-//   The parent dentry is stored in cluster_IO.
-//
-// The DEVFS extensions to the generic VFS are the following:
-// 1) The vfs_ctx_t "extend" field is pointing on the devfs_ctx_t structure.
-// 2) The vfs_inode_t "extend" field is pointing on the chdev descriptor.
-//////////////////////////////////////////////////////////////////////////////////////////
-
-/*****************************************************************************************
- * This structure defines the DEVFS context extension.
- ****************************************************************************************/
-
-typedef struct devfs_ctx_s
-{
-    xptr_t   dev_inode_xp;               /*! extended pointer on DEVFS root inode       */ 
-    xptr_t   external_inode_xp;          /*! extended pointer on DEVFS external inode   */ 
-}
-devfs_ctx_t;
-/*****************************************************************************************
- * This fuction allocates memory for a DEVFS context descriptor in cluster identified
- * by the <cxy> argument.
- *****************************************************************************************
- * @ cxy     : [in] target cluster identifier.
- * @ return an extended pointer on the created context / return NULL if failure.
- ****************************************************************************************/
-xptr_t  devfs_ctx_alloc( cxy_t cxy );
-
-/*****************************************************************************************
- * This function initialises the DEVFS context from arguments values, and link it
- * to the relevant VFS context in the local cluster.
- *****************************************************************************************
- * @ devfs_ctx               : [in]  extended pointer on DEVFS context.
- * @ devfs_dev_inode_xp      : [out] extended pointer on  <dev> inode.
- * @ devfs_external_inode_xp : [out] extended pointer on  <external> inode.
- ****************************************************************************************/
-void devfs_ctx_init( xptr_t    devfs_ctx_xp,
-                     xptr_t    devfs_dev_inode_xp,
-                     xptr_t    devfs_external_inode_xp );
-
-/*****************************************************************************************
- * This function releases memory dynamically allocated for the DEVFS context.
- *****************************************************************************************
- * @ devfs_ctx   : local pointer on DEVFS context.
- ****************************************************************************************/
-void devfs_ctx_destroy( xptr_t  devfs_ctx_xp );
-
-/*****************************************************************************************
- * This function starts to create the DEVFS subtree. 
- * This function creates in cluster 0 the "dev" and "external" DEVFS directories.
- * For each one, it creates the inode and the associated dentry. The DEVFS root inode
- * <dev is linked to the VFS parent inode identified by <parent_inode_xp>.
- *****************************************************************************************
- * @ parent_inode_xp         : [in]  extended pointer on the parent VFS inode.
- * @ devfs_dev_inode_xp      : [out] extended pointer on created <dev> inode.
- * @ devfs_external_inode_xp : [out] extended pointer on created <external> inode.
- ****************************************************************************************/
-void devfs_global_init( xptr_t   parent_inode_xp,
-                        xptr_t * devfs_dev_inode_xp,
-                        xptr_t * devfs_external_inode_xp );
-
-/*****************************************************************************************
- * This function completes the initialisation of the DEVFS subtree.
- * It should be called once in each cluster.
- * 1. In each cluster (i), it creates the "internal" directory, 
- *    linked to the DEVFS "dev" parent directory.
- * 2. In each cluster (i), it creates, for each external chdev in cluster (i), 
- *    a pseudo-file, linked to the DEVFS "external" parent directory.
- * 3. In each cluster (i), it creates, for each internal chdev in cluster (i),
- *    a pseudo-file, linked to the DEVFS "internal" parent directory.
- *****************************************************************************************
- * @ devfs_dev_inode_xp      : [in]  extended pointer on DEVFS root inode.
- * @ devfs_external_inode_xp : [in]  extended pointer on DEVFS external inode.
- ****************************************************************************************/
-void devfs_local_init( xptr_t   devfs_dev_inode_xp,
-                       xptr_t   devfs_external_inode_xp );
-                       
-/****************************************************************************************** 
- * This function is called by the sys_read() and sys_write() functions.
- * It moves <size> bytes between a TXT device, and an user space <u_buf> buffer. 
- * It uses the <file_xp> and <to_buffer> arguments, to call the relevant device function.
- * It uses a kernel buffer allocated in the calling thread kernel stack.
- * If the <size> argument is larger than CONFIG_TXT_KBUF_SIZE, the user buffer is split
- * in smaller chunks to be copied from the user buffer to this kernel buffer.
- ******************************************************************************************
- * @ to_buffer : device -> buffer if true / buffer -> device if false. 
- * @ file_xp   : extended pointer on the remote file descriptor.
- * @ u_buf     : user space buffer (virtual address).
- * @ size      : requested number of bytes from offset.
- * @ returns number of bytes actually moved if success / -1 if error.
- *****************************************************************************************/
-int devfs_user_move( bool_t   to_buffer,
-                     xptr_t   file_xp, 
-                     char   * u_buf,
-                     uint32_t size );
-
-/******************************************************************************************
- * As the DEVFS is dynamically build in memory during kernel init, all relevant
- * information is contained in the Inode Tree. Therefore, this function simply
- * access the xhtab contained in the <inode> descriptor, to get the  dentries 
- * to be copied in the dirent <array>.
- ******************************************************************************************
- * @ inode      : [in]  local pointer on directory inode.
- * @ array      : [in]  local pointer on array of dirents.
- * @ max_dirent : [in]  max number of slots in dirent array.
- * @ min_dentry : [in]  index of first dentry to be copied into array.
- * @ detailed   : [in]  dynamic inode creation if true.
- * @ entries    : [out] number of dentries actually copied into array.
- * @ done       : [out] Boolean true when last entry found.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-error_t devfs_get_user_dir( struct vfs_inode_s * inode,
-                            struct dirent      * array,
-                            uint32_t             max_dirent,
-                            uint32_t             min_dentry,
-                            bool_t               detailed,
-                            uint32_t           * entries,
-                            bool_t             * done );
-
-
-#endif	/* _DEVFS_H_ */
Index: trunk/kernel/fs/devfs/devfs-private.h
===================================================================
--- trunk/kernel/fs/devfs/devfs-private.h	(revision 1)
+++ trunk/kernel/fs/devfs/devfs-private.h	(revision 1)
@@ -0,0 +1,47 @@
+/*
+ * devfs/devfs-private.h - devfs internal functions and data types
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DEVFS_PRIVATE_H_
+#define _DEVFS_PRIVATE_H_
+
+#include <spinlock.h>
+#include <metafs.h>
+
+struct devfs_db_s
+{
+	spinlock_t lock;
+	struct metafs_s root;
+};
+
+extern struct devfs_db_s devfs_db;
+
+struct devfs_file_s
+{
+	struct metafs_iter_s iter;
+	struct device_s *dev;
+	struct devfs_context_s *ctx;
+};
+
+const struct vfs_inode_op_s devfs_i_op;
+const struct vfs_file_op_s devfs_f_op;
+
+#endif	/* _DEVFS_PRIVATE_H_ */
Index: trunk/kernel/fs/devfs/devfs.h
===================================================================
--- trunk/kernel/fs/devfs/devfs.h	(revision 1)
+++ trunk/kernel/fs/devfs/devfs.h	(revision 1)
@@ -0,0 +1,53 @@
+/*
+ * devfs.h - export devfs memory and context related operations
+ *
+ * Author     Ghassan Almaless (2008,2009,2010,2011,2012)
+ *            Mohamed Lamine Karaoui (2015)
+ *            Alain Greiner (2017)
+ *
+ * Copyright (c) Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DEVFS_H_
+#define _DEVFS_H_
+
+#include <metafs.h>
+#include <device.h>
+
+/******************************************************************************************
+ * This structure TODO
+ *****************************************************************************************/
+
+typedef struct devfs_context_s
+{
+	struct metafs_s * db;
+}
+devfs_context_t;
+
+/******************************************************************************************
+ * This function TODO
+ *****************************************************************************************/
+void devfs_root_init();
+
+/******************************************************************************************
+ * This function TODO
+ *****************************************************************************************/
+void devfs_register( device_t * dev );
+
+
+#endif	/* _DEVFS_H_ */
Index: trunk/kernel/fs/devfs/devfs_context.c
===================================================================
--- trunk/kernel/fs/devfs/devfs_context.c	(revision 1)
+++ trunk/kernel/fs/devfs/devfs_context.c	(revision 1)
@@ -0,0 +1,116 @@
+/*
+ * devfs/devfs_context.c - devfs context related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <device.h>
+#include <driver.h>
+#include <kmem.h>
+#include <string.h>
+#include <vfs.h>
+#include <errno.h>
+#include <metafs.h>
+#include <cpu.h>
+
+#include <devfs.h>
+#include <devfs-private.h>
+
+
+struct devfs_db_s devfs_db;
+
+void devfs_root_init(void)
+{
+	spinlock_init(&devfs_db.lock, "DevFs DB");
+
+	metafs_init(&devfs_db.root, 
+#if CONFIG_ROOTFS_IS_VFAT
+		    "DEV"
+#else
+		    "dev"
+#endif
+		);
+}
+
+void devfs_register(struct device_s *dev)
+{
+	spinlock_lock(&devfs_db.lock);
+	metafs_register(&devfs_db.root, &dev->node);
+	spinlock_unlock(&devfs_db.lock);
+}
+
+
+VFS_CREATE_CONTEXT(devfs_create_context)
+{
+	struct devfs_context_s *ctx;
+  
+	VFS_SET(context->ctx_flags, VFS_FS_LOCAL);
+	context->ctx_type    = FS_TYPE_DEVFS;
+	context->ctx_op      = (struct vfs_context_op_s *) &devfs_ctx_op;
+	context->ctx_inode_op = (struct vfs_inode_op_s *) &devfs_i_op;
+	context->ctx_file_op = (struct vfs_file_op_s *) &devfs_f_op;
+
+	ctx	= &context->ctx_devfs;
+	ctx->db = &devfs_db.root;
+
+	return 0;
+}
+
+VFS_DESTROY_CONTEXT(devfs_destroy_context)
+{
+	return 0;
+}
+
+VFS_READ_ROOT(devfs_read_root)
+{ 
+	root->i_links = 1;
+	root->i_size  = 0;
+	root->i_attr  = VFS_DIR;
+	root->i_number = vfs_inum_new(context);
+  
+	return 0;
+}
+
+VFS_WRITE_ROOT(devfs_write_root)
+{
+	return 0;
+}
+
+KMEM_OBJATTR_INIT(devfs_kmem_context_init)
+{
+	attr->type   = KMEM_DEVFS_CTX;
+	attr->name   = "KCM DevFs CTX";
+	attr->size   = sizeof(struct devfs_context_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_DEVFS_CTX_MIN;
+	attr->max    = CONFIG_DEVFS_CTX_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+	return 0;
+}
+
+
+const struct vfs_context_op_s devfs_ctx_op = 
+{
+	.create     = devfs_create_context,
+	.destroy    = devfs_destroy_context,
+	.read_root  = devfs_read_root,
+	.repli_root = NULL,
+	.write_root = devfs_write_root
+};
Index: trunk/kernel/fs/devfs/devfs_file.c
===================================================================
--- trunk/kernel/fs/devfs/devfs_file.c	(revision 1)
+++ trunk/kernel/fs/devfs/devfs_file.c	(revision 1)
@@ -0,0 +1,271 @@
+/*
+ * devfs/devfs_file.c - devfs file related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <device.h>
+#include <driver.h>
+#include <kmem.h>
+#include <string.h>
+#include <vfs.h>
+#include <errno.h>
+#include <metafs.h>
+#include <thread.h>
+
+#include <devfs.h>
+#include <devfs-private.h>
+
+
+KMEM_OBJATTR_INIT(devfs_kmem_file_init)
+{
+	attr->type   = KMEM_DEVFS_FILE;
+	attr->name   = "KCM DevFs File";
+	attr->size   = sizeof(struct devfs_file_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_DEVFS_FILE_MIN;
+	attr->max    = CONFIG_DEVFS_FILE_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+	return 0;
+}
+
+VFS_OPEN_FILE(devfs_open)
+{
+	register error_t err;
+	register struct devfs_context_s *ctx;
+	register struct devfs_file_s *info;
+	register struct device_s *dev;
+	struct vfs_inode_s *inode;
+	dev_request_t rq;
+	kmem_req_t req;
+
+	inode = file->fr_inode;
+
+	info = file->fr_pv;
+	ctx  = (struct devfs_context_s *)&inode->i_ctx->ctx_devfs;
+
+	if(!(inode->i_attr & VFS_DIR))
+	{
+		dev = (struct device_s*)inode->i_pv;
+    
+		if(dev->type == DEV_INTERNAL)
+			return EPERM;
+
+		if(dev->type == DEV_BLK)
+			VFS_SET(inode->i_attr,VFS_DEV_BLK);
+		else
+			VFS_SET(inode->i_attr,VFS_DEV_CHR);
+ 
+		if(dev->op.dev.open != NULL)
+		{
+			rq.fremote = file;
+			if((err=dev->op.dev.open(dev, &rq)))
+				return err;
+		}
+
+		priv->dev = (void*)dev;
+
+		return 0;
+	}
+
+	if(info == NULL)
+	{
+		req.type  = KMEM_DEVFS_FILE;
+		req.size  = sizeof(*info);
+		req.flags = AF_KERNEL;
+		info      = kmem_alloc(&req);
+	}
+
+	if(info == NULL) return ENOMEM;
+
+	metafs_iter_init(&devfs_db.root, &info->iter);
+	info->ctx  = ctx;
+	file->fr_pv = info;
+  
+	metafs_print(&devfs_db.root);
+	return 0;
+}
+
+#define TMP_BUFF_SZ 512
+//FIXME:
+//add a "while" loop for the case where the
+//buffer TMP_BUFF_SZ is smaller than
+//buffer->size
+VFS_READ_FILE(devfs_read)
+{
+	register struct device_s *dev;
+	dev_request_t rq;
+	uint_t count;
+        uint8_t buff[TMP_BUFF_SZ];
+
+	dev = (struct device_s*)file->f_private.dev;
+
+	rq.dst   = &buff[0];
+	rq.count = TMP_BUFF_SZ;
+	rq.flags = 0;
+	rq.file  = file;
+
+	if((count = dev->op.dev.read(dev, &rq)) < 0)
+		return count;
+
+        buffer->scpy_to_buff(buffer, &buff[0], count);
+	return count;
+}
+
+//FIXME: To improve this an avoid the extra copy,
+//we could set along with the buffer(src and dest) 
+//the functions to manipulate them, such as in 
+//do_exec.c
+VFS_WRITE_FILE(devfs_write)
+{
+	register struct device_s *dev;
+	uint8_t buff[TMP_BUFF_SZ];
+	dev_request_t rq;
+	
+	dev = (struct device_s*)file->f_private.dev;
+	
+	//FIXME avoid the extra copy ?
+	buffer->scpy_from_buff(buffer, (void*)&buff[0], TMP_BUFF_SZ);
+	rq.src   = (void*)&buff[0];
+	rq.count = buffer->size;
+	rq.flags = 0;
+	rq.file  = file;
+  
+	return dev->op.dev.write(dev, &rq);
+}
+
+VFS_LSEEK_FILE(devfs_lseek)
+{
+	register struct device_s *dev;
+	dev_request_t rq;
+
+	dev = (struct device_s*)file->fr_inode->i_pv;
+
+	if(dev->op.dev.lseek == NULL)
+		return VFS_ENOTUSED;
+  
+	rq.fremote = file;
+	return dev->op.dev.lseek(dev, &rq);
+}
+
+VFS_CLOSE_FILE(devfs_close)
+{
+	register struct device_s *dev;
+	dev_request_t rq;
+
+	if(file->fr_inode->i_attr & VFS_DIR)
+		return 0;
+
+	dev = (struct device_s*)file->fr_inode->i_pv;
+
+	if(dev->op.dev.close == NULL)
+		return 0;
+  
+	rq.fremote = file;
+	return dev->op.dev.close(dev, &rq);
+}
+
+VFS_RELEASE_FILE(devfs_release)
+{  
+	kmem_req_t req;
+
+	if(file->fr_pv == NULL) 
+		return 0;
+  
+	req.type = KMEM_DEVFS_FILE;
+	req.ptr  = file->fr_pv;
+	kmem_free(&req);
+
+	file->fr_pv = NULL;
+	return 0;
+}
+
+VFS_READ_DIR(devfs_readdir)
+{
+	register struct devfs_file_s *info;
+	register struct metafs_s *current;
+	register struct device_s *current_dev;
+  
+	info = file->fr_pv;
+  
+	if(file->fr_pv == NULL)
+		return ENOTDIR;
+
+	if((current = metafs_lookup_next(&devfs_db.root, &info->iter)) == NULL)
+		return EEODIR;
+
+	current_dev    = metafs_container(current, struct device_s, node);
+	dirent->u_attr = (current_dev->type == DEV_BLK) ? VFS_DEV_BLK : VFS_DEV_CHR;
+
+	strcpy((char*)dirent->u_name, metafs_get_name(current));
+
+	dirent->u_ino = (uint_t) current_dev->base_paddr;
+
+	return 0;
+}
+
+VFS_MMAP_FILE(devfs_mmap)
+{
+	register struct device_s *dev;
+	dev_request_t rq;
+  
+	dev = (struct device_s*)file->f_private.dev;
+
+	if(dev->op.dev.mmap == NULL)
+		return ENODEV;
+
+	rq.flags  = 0;
+	rq.file   = file;
+	rq.region = region;
+
+	return dev->op.dev.mmap(dev, &rq);
+}
+
+VFS_MMAP_FILE(devfs_munmap)
+{
+	register struct device_s *dev;
+	dev_request_t rq;
+
+	dev = (struct device_s*)file->f_private.dev;
+
+	if(dev->op.dev.munmap == NULL)
+		return ENODEV;
+
+	rq.flags  = 0;
+	rq.file   = file;
+	rq.region = region;
+
+	return dev->op.dev.munmap(dev, &rq);
+}
+
+
+const struct vfs_file_op_s devfs_f_op = 
+{
+	.open    = devfs_open,
+	.read    = devfs_read,
+	.write   = devfs_write,
+	.lseek   = devfs_lseek,
+	.mmap    = devfs_mmap,
+	.munmap  = devfs_munmap,
+	.readdir = devfs_readdir,
+	.close   = devfs_close,
+	.release = devfs_release
+};
Index: trunk/kernel/fs/devfs/devfs_node.c
===================================================================
--- trunk/kernel/fs/devfs/devfs_node.c	(revision 1)
+++ trunk/kernel/fs/devfs/devfs_node.c	(revision 1)
@@ -0,0 +1,187 @@
+/*
+ * devfs/devfs_node.c - devfs node related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <kmem.h>
+#include <string.h>
+#include <kdmsg.h>
+#include <device.h>
+#include <vfs.h>
+#include <cpu.h>
+
+#include <devfs.h>
+#include <devfs-private.h>
+
+
+
+VFS_INIT_NODE(devfs_init_node)
+{
+	inode->i_pv     = NULL;
+	return 0;
+}
+
+
+VFS_RELEASE_NODE(devfs_release_node)
+{
+	inode->i_pv = NULL;
+	return 0;
+}
+
+
+VFS_CREATE_NODE(devfs_create_node)
+{ 
+	return ENOTSUPPORTED;
+}
+
+error_t devfs_inode_create(struct vfs_dirent_s *dirent, 
+				struct vfs_inode_s *parent,
+				struct device_s *dev, size_t size)
+{
+	struct vfs_inode_s *inode;
+
+	inode = vfs_inode_new(dirent->d_ctx);//allocate inode
+	if(!inode) return ENOMEM;
+
+	inode->i_links  = 1;
+	inode->i_attr = dirent->d_attr;
+	inode->i_pv = (struct device_s*) dev;
+	inode->i_size = size;
+	inode->i_parent.ptr = parent;
+	inode->i_parent.cid = cpu_get_cid();
+	inode->i_parent.gc = parent->i_gc;
+	inode->i_number = vfs_inum_new(dirent->d_ctx);
+
+	vfs_icache_add(inode);
+
+	VFS_INODE_REF_SET(dirent->d_inode, inode, cpu_get_cid());
+
+	return 0;
+}
+
+VFS_LOOKUP_NODE(devfs_lookup_node)
+{
+	register struct metafs_s *meta_node;
+	register struct device_s *dev;
+	register error_t err;
+	dev_params_t params;
+
+	if(!(parent->i_attr & VFS_DIR))
+		return ENOTDIR;
+  
+
+	if((meta_node = metafs_lookup(&devfs_db.root, dirent->d_name)) == NULL)
+		return VFS_NOT_FOUND;
+
+	dev = metafs_container(meta_node, struct device_s, node);
+  
+	if((err=dev->op.dev.get_params(dev, &params)))
+	{
+		printk(ERROR,"ERROR: devfs_lookup_node: error %d while getting device parameters\n", err);
+		return err;
+	}
+  
+	switch(dev->type)
+	{
+	case DEV_BLK:
+		dirent->d_attr |= VFS_DEV_BLK;
+		break;
+	case DEV_CHR:
+		dirent->d_attr |= VFS_DEV_CHR;
+		break;
+	default:
+		dirent->d_attr |= VFS_DEV;
+	}
+
+	//Do a list of inode within the device struct to avoid 
+	//creating each time a new inode.
+	devfs_inode_create(dirent, parent, dev, params.size);
+
+	return VFS_FOUND;
+}
+
+VFS_STAT_NODE(devfs_stat_node)
+{
+	struct device_s *dev;
+	uint_t mode;
+
+	dev       = (struct device_s*)inode->i_pv;
+	mode      = 0;
+
+	inode->i_stat.st_dev     = (uint_t)dev;
+	inode->i_stat.st_ino     = (uint_t)dev;
+	inode->i_stat.st_nlink   = inode->i_links;
+	inode->i_stat.st_uid     = 0;
+	inode->i_stat.st_gid     = 0;
+	inode->i_stat.st_rdev    = FS_TYPE_DEVFS;
+	inode->i_stat.st_size    = inode->i_size;
+	inode->i_stat.st_blksize = 0;
+	inode->i_stat.st_blocks  = 0;
+	inode->i_stat.st_atime   = 0;
+	inode->i_stat.st_mtime   = 0;
+	inode->i_stat.st_ctime   = 0;
+
+	if(inode->i_attr & VFS_DIR)
+	{
+		VFS_SET(mode, VFS_IFDIR);
+	}
+	else if(inode->i_attr & VFS_FIFO)
+	{
+		VFS_SET(mode, VFS_IFIFO);
+	}
+	else if(inode->i_attr & VFS_PIPE)
+	{
+		VFS_SET(mode, VFS_IFIFO);
+	}
+	else if(inode->i_attr & VFS_DEV_CHR)
+	{
+		VFS_SET(mode, VFS_IFCHR);
+	}
+	else if(inode->i_attr & VFS_DEV_BLK)
+	{
+		VFS_SET(mode, VFS_IFBLK);
+	}
+ 
+	inode->i_stat.st_mode = mode;
+	return 0;
+}
+
+
+VFS_WRITE_NODE(devfs_write_node)
+{
+	return 0;
+}
+
+VFS_UNLINK_NODE(devfs_unlink_node)
+{
+	return ENOTSUPPORTED;
+}
+
+const struct vfs_inode_op_s devfs_i_op = 
+{
+	.init    = devfs_init_node,
+	.create  = devfs_create_node,
+	.lookup  = devfs_lookup_node,
+	.write   = devfs_write_node,
+	.release = devfs_release_node,
+	.unlink  = devfs_unlink_node,
+	.stat    = devfs_stat_node
+};
Index: trunk/kernel/fs/fatfs.c
===================================================================
--- trunk/kernel/fs/fatfs.c	(revision 690)
+++ 	(revision )
@@ -1,3269 +1,0 @@
-/*
- * fatfs.c - FATFS file system API implementation.
- *
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <printk.h>
-#include <thread.h>
-#include <kmem.h>
-#include <ppm.h>
-#include <vfs.h>
-#include <string.h>
-#include <rpc.h>
-#include <mapper.h>
-#include <cluster.h>
-#include <dev_ioc.h>
-#include <fatfs.h>
-
-#define LITTLE_ENDIAN  1
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//          Extern  variables         
-//////////////////////////////////////////////////////////////////////////////////////////
-
-extern vfs_ctx_t     fs_context[FS_TYPES_NR];   // allocated in kernel_init.c file
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//              FATFS specific static functions 
-//////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// These functions return the "offset" and "length" values of an 
-// [offset,length] constant defined in the fatfs.h file.
-//////////////////////////////////////////////////////////////////////////////////////////
-
-static inline int get_length( int offset __attribute__((unused)), int length ) { return length; }
-
-static inline int get_offset( int offset, int length __attribute__((unused)) ) { return offset; }
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function returns the LBA of the first sector of a FAT cluster.
-// This function can be called by any thread running in any cluster.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ ctx	  :	pointer on FATFS context.
-// @ cluster  :	cluster index in FATFS.
-// @ return the lba value.
-//////////////////////////////////////////////////////////////////////////////////////////
-static inline uint32_t fatfs_lba_from_cluster( fatfs_ctx_t * ctx,
-                                               uint32_t      cluster )
-{
-    return (ctx->cluster_begin_lba + ((cluster - 2) << 3));
-}
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This function return an integer record value (one, two, or four bytes) from a local
-// array of bytes, taking into account the global LITTLE_ENDIAN parameter:
-// if LITTLE_ENDIAN is true, the most significant byte has the highest address.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ offset        : first byte in array.
-// @ nbytes        : record length in bytes (1/2/4).
-// @ buffer        : local pointer on byte array.
-// @ return the integer value in a 32 bits word.
-//////////////////////////////////////////////////////////////////////////////////////////
-static uint32_t fatfs_get_record( uint32_t    offset,
-                                  uint32_t    nbytes,
-                                  uint8_t   * buffer )
-{
-    uint32_t i;
-    uint32_t res = 0;
-
-    if ( LITTLE_ENDIAN )
-    {
-        for( i = nbytes ; i > 0 ; i-- ) res = (res<<8) | buffer[offset+i-1];
-    }
-    else 
-    {
-        for( i = 0 ; i < nbytes ; i++ ) res = (res<<8) | buffer[offset+i];
-    }
-    return res;
-
-}  // end fatfs_get_record()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This function return an integer record value (one, two, or four bytes) from a remote
-// array of bytes, taking into account the global LITTLE_ENDIAN parameter:
-// if LITTLE_ENDIAN is true, the most significant byte has the highest address.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ offset        : first byte in array.
-// @ nbytes        : record length in bytes (1/2/4).
-// @ buffer_xp     : extended pointer on byte array.
-// @ return the integer value in a 32 bits word.
-//////////////////////////////////////////////////////////////////////////////////////////
-static uint32_t fatfs_get_remote_record( uint32_t   offset,
-                                         uint32_t   nbytes,
-                                         xptr_t     buffer_xp )
-{
-    uint32_t i;
-    uint32_t res = 0;
-
-    if ( LITTLE_ENDIAN )
-    {
-        for( i = nbytes ; i > 0 ; i-- )
-        {
-            res = (res<<8) | hal_remote_lb( buffer_xp + offset + i-1 );
-        }
-    }
-    else 
-    {
-        for( i = 0 ; i < nbytes ; i++ )
-        {
-            res = (res<<8) | hal_remote_lb( buffer_xp + offset + i );
-        }
-    }
-    return res;
-
-}  // end fatfs_get_remote_record()
-
-/*
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This function writes one, two, or four bytes from a 32 bits integer to a local
-// array of bytes, taking into account the global LITTLE_ENDIAN parameter:
-// if LITTLE_ENDIAN is true, the most significant byte has the highest address.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ offset        : first byte in array.
-// @ nbytes        : record length in bytes (1/2/4).
-// @ buffer        : local pointer on byte array.
-// @ value         : 32 bits integer value.
-//////////////////////////////////////////////////////////////////////////////////////////
-static void fatfs_set_record( uint32_t    offset,
-                              uint32_t    nbytes,
-                              uint8_t   * buffer,
-                              uint32_t    value )
-{
-    uint32_t i;
-
-    if ( LITTLE_ENDIAN )
-    {
-        for( i = nbytes ; i > 0 ; i-- ) buffer[offset+i-1] = (uint8_t)(value>>((i-1)<<3));
-    }
-    else
-    {
-        for( i = 0 ; i < nbytes ; i++ ) buffer[offset+i] = (uint8_t)(value>>((nbytes-1-i)<<3));
-    }
-
-}  // end fatfs_set_record()
-
-*/
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This function writes one, two, or four bytes from a 32 bits integer to a remote
-// array of bytes, taking into account the global LITTLE_ENDIAN parameter:
-// if LITTLE_ENDIAN is true, the most significant byte has the highest address.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ offset        : first byte in array.
-// @ nbytes        : record length in bytes (1/2/4).
-// @ buffer_xp     : extended pointer on byte array.
-// @ value         : 32 bits integer value.
-//////////////////////////////////////////////////////////////////////////////////////////
-static void fatfs_set_remote_record( uint32_t    offset,
-                                     uint32_t    nbytes,
-                                     xptr_t      buffer_xp,
-                                     uint32_t    value )
-{
-    uint32_t i;
-
-    if ( LITTLE_ENDIAN )
-    {
-        for( i = nbytes ; i > 0 ; i-- )
-        {
-            hal_remote_sb( (buffer_xp + offset + i-1 ) , (uint8_t)(value>>((i-1)<<3)) );
-        }
-    }
-    else
-    {
-        for( i = 0 ; i < nbytes ; i++ )
-        {
-            hal_remote_sb( (buffer_xp + offset + i) , (uint8_t)(value>>((nbytes-1-i)<<3)) );
-        }
-    }
-
-}  // end fatfs_set_record()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function retun in the <name> buffer a short name stored in
-// a SFN FATFS directory entry.
-/////////////////////////i////////////////////////////////////////////////////////////////
-// @ buffer   : pointer on buffer containing the directory entry.
-// @ name     : [out] buffer allocated by the caller.
-//////////////////////////////////////////////////////////////////////////////////////////
-static void fatfs_get_name_from_short( uint8_t * buffer,
-                                       char    * name )
-{
-    uint32_t i;
-    uint32_t j = 0;
-
-    // get name
-    for ( i = 0; i < 8 && buffer[i] != ' '; i++ )
-    {
-        name[j] = to_lower( buffer[i] );
-        j++;
-    }
-
-    // get extension
-    for ( i = 8; i < 8 + 3 && buffer[i] != ' '; i++ )
-    {
-        // we entered the loop so there is an extension. add the dot
-        if ( i == 8 )
-        {
-            name[j] = '.';
-            j++;
-        }
-
-        name[j] = to_lower( buffer[i] );
-        j++;
-    }
-
-    name[j] = '\0';
-
-}  // fatfs_get_name_from_short()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function retun in the <name> buffer a partial name stored in
-// a LFN FATFS directory entry.
-/////////////////////////i////////////////////////////////////////////////////////////////
-// @ buffer   : pointer on buffer containing the directory entry.
-// @ name     : [out] buffer allocated by the caller.
-//////////////////////////////////////////////////////////////////////////////////////////
-static void fatfs_get_name_from_long( uint8_t * buffer,
-                                      char    * name )
-{
-    uint32_t   name_offset   = 0;
-    uint32_t   buffer_offset = get_length(LDIR_ORD);
-    uint32_t   l_name_1      = get_length(LDIR_NAME_1);
-    uint32_t   l_name_2      = get_length(LDIR_NAME_2);
-    uint32_t   l_name_3      = get_length(LDIR_NAME_3);
-    uint32_t   l_attr        = get_length(LDIR_ATTR);
-    uint32_t   l_type        = get_length(LDIR_TYPE);
-    uint32_t   l_chksum      = get_length(LDIR_CHKSUM);
-    uint32_t   l_rsvd        = get_length(LDIR_RSVD);
-
-    uint32_t   j             = 0;
-    uint32_t   eof           = 0;
-
-    while ( (buffer_offset != DIR_ENTRY_SIZE)  && (!eof) )
-    {
-        while (j != l_name_1 && !eof )
-        {
-            if ( (buffer[buffer_offset] == 0x00) || 
-                 (buffer[buffer_offset] == 0xFF) )
-            {
-                eof = 1;
-                continue;
-            }
-            name[name_offset] = buffer[buffer_offset];
-            buffer_offset += 2;
-            j += 2;
-            name_offset++;
-        }
-
-        buffer_offset += (l_attr + l_type + l_chksum);
-        j = 0;
-
-        while (j != l_name_2 && !eof )
-        {
-            if ( (buffer[buffer_offset] == 0x00) || 
-                 (buffer[buffer_offset] == 0xFF) )
-            {
-                eof = 1;
-                continue;
-            }
-            name[name_offset] = buffer[buffer_offset];
-            buffer_offset += 2;
-            j += 2;
-            name_offset++;
-        }
-
-        buffer_offset += l_rsvd;
-        j = 0;
-
-        while (j != l_name_3 && !eof )
-        {
-            if ( (buffer[buffer_offset] == 0x00) || 
-                 (buffer[buffer_offset] == 0xFF) )
-            {
-                eof = 1;
-                continue;
-            }
-            name[name_offset] = buffer[buffer_offset];
-            buffer_offset += 2;
-            j += 2;
-            name_offset++;
-        }
-    }
-    name[name_offset] = 0;
-
-} // end fatfs_get_name_from_long()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function analyse the <name> input argument, and returns in other
-// output arguments various informations required to store the name in FATFS directory.
-// The <name> length cannot be larger than 31 characters :
-// - Short name (less than 13 characters) require 1 LFN entry.
-// - Medium names (from 14 to 26 characters require 2 LFN entries.
-// - Large names (up to 31 characters) require 3 LFN entries.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ name     : [in]  complete directory entry name.
-// @ length   : [out] total number of characters in name.
-// @ nb_lfn   : [out] number of LFN entries required to store the name.
-// @ sfn      : [out] a legal SFN name extracted from name / upper case and 8-3 format.
-// @ checksum : [out] checksum to be stored in SFN.
-// @ returns 0 on success / returns 1 if the name length is larger than 31 characters.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_name_format( const char  * name,
-                                  uint32_t    * length,
-                                  uint32_t    * nb_lfn,
-                                  char        * sfn,
-                                  uint8_t     * checksum )
-{
-    // compute name length
-    uint32_t name_length = strlen( name );
-    *length = name_length;
-
-    uint32_t suffix_length = 0;
-    uint32_t prefix_length = 0;
-    uint32_t dot_found     = 0;
-    uint32_t i;
-
-    // compute prefix and suffix length
-    // only the last '.' is taken into account
-    for ( i=0 ; i<name_length ; i++ )
-    {
-        if (name[i] == '.' )
-        {
-            if ( dot_found ) 
-            {
-                prefix_length += suffix_length + 1;
-                suffix_length =  0;
-            }
-            else
-            {
-                dot_found = 1;
-            }
-        }
-        else
-        { 
-            if ( dot_found)  suffix_length++;
-            else             prefix_length++;
-        }
-    } 
-
-    // build SFN prefix (8bits)
-    if (prefix_length <= 8)
-    {
-        for( i=0 ; i<8 ; i++)
-        {
-            if ( i<prefix_length ) sfn[i] = to_upper( name[i] );
-            else                   sfn[i] = 0x20;
-        }
-    }
-    else
-    {
-        for( i=0 ; i<6 ; i++)
-        {
-            sfn[i] = to_upper( name[i] );
-        }
-        sfn[6] = 0x7E;
-        sfn[7] = 0x31;
-    }
-
-    // build SFN suffix (3 bits)
-    if ( suffix_length == 0 )
-    {
-        sfn[8]  = 0x20;
-        sfn[9]  = 0x20;
-        sfn[10] = 0x20;
-    }
-    else if ( suffix_length == 1 )
-    {
-        sfn[8]  = to_upper( name[name_length-1] );
-        sfn[9]  = 0x20;
-        sfn[10] = 0x20;
-    }
-    else if ( suffix_length == 2 )
-    {
-        sfn[8]  = to_upper( name[name_length-2] );
-        sfn[9]  = to_upper( name[name_length-1] );
-        sfn[10] = 0x20;
-    }
-    else
-    {
-        sfn[8]  = to_upper( name[name_length-suffix_length] );
-        sfn[9]  = to_upper( name[name_length-suffix_length+1] );
-        sfn[10] = to_upper( name[name_length-suffix_length+2] );
-    }
-
-    // compute 8 bits checksum
-    uint8_t sum = 0;
-    for ( i=0 ; i<11 ; i++ )
-    {
-        sum = (((sum & 0x01)<<7) | ((sum & 0xFE)>>1)) + sfn[i];
-    }
-    *checksum = sum;
-
-    // set nb_lfn and length values
-    if      ( name_length <= 13 )
-    {
-        *nb_lfn  = 1;
-        return 0;
-    }
-    else if ( name_length <= 26 )
-    {
-        *nb_lfn  = 2;
-        return 0;
-    }
-    else if ( name_length <= 31 )
-    {
-        *nb_lfn  = 3;
-        return 0;
-    }
-    else
-    {
-        return 1;
-    }
-}   // end fatfs_name_format()  
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function synchronously updates the FAT on IOC device.
-// It scan the FAT mapper to copy on IOC device all dirty pages in the interval
-// defined by the <page_min> & <page_max> arguments.
-// It can be called by a thread running in any cluster.
-// WARNING : We don't take the lock protecting the FAT mapper, because the FAT lock
-// (in FATFS context) must be taken by the calling function.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ fatfs_ctx_xp  : extended pointer on FATFS context in FAT cluster.
-// @ page_min      : first page to be checked.
-// @ page_max      : last page to be checked
-// @ return 0 if success, return -1 if the FS_INFO sector cannot be updated.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_update_ioc_fat( xptr_t   fatfs_ctx_xp,
-                                     uint32_t page_min,
-                                     uint32_t page_max )
-{
-
-#if DEBUG_FATFS_UPDATE_IOC
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_UPDATE_IOC < cycle )
-printk("\n[%s] thread[%x,%x] enter / page_min %d / page_max %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, page_min, page_max, cycle );
-#endif
-
-    error_t       error;
-    cxy_t         fat_cxy;         // FAT cluster identifier
-    fatfs_ctx_t * fatfs_ctx;       // local pointer on FATFS context in FAT cluster
-    mapper_t    * fat_mapper_ptr;  // local pointer on FAT mapper
-    uint32_t      page_id;         // current page index in FAT mapper
-    xptr_t        rt_xp;           // extended pointer on FAT mapper radix tree
-    xptr_t        page_xp;         // extended pointer on current page in FAT mapper
-    page_t      * page_ptr;        // local pointer on current page
-    uint32_t      flags;           // current page flags
-
-    // get pointer and cluster on FATFS context in FAT cluster
-    fat_cxy   = GET_CXY( fatfs_ctx_xp );
-    fatfs_ctx = GET_PTR( fatfs_ctx_xp );
- 
-    // get FAT mapper pointer from FATFS context 
-    fat_mapper_ptr  = hal_remote_lpt( XPTR( fat_cxy , &fatfs_ctx->fat_mapper ) );
-
-    // build extended pointer on FAT mapper radix tree
-    rt_xp   = XPTR( fat_cxy , &fat_mapper_ptr->rt );
-
-    // scan all pages in [min,max] interval
-    for( page_id = page_min ; page_id <= page_max ; page_id++ )
-    {
-        // get extended pointer on page descriptor from FAT mapper
-        page_xp = grdxt_remote_lookup( rt_xp , page_id );
-
-        // check only existing pages
-        if ( page_xp != XPTR_NULL )
-        {
-            page_ptr = GET_PTR( page_xp );
-            flags    = hal_remote_l32( XPTR( fat_cxy , &page_ptr->flags ) );
-
-            // copy only dirty pages
-            if ( flags & PG_DIRTY )
-            {
-
-#if (DEBUG_FATFS_UPDATE_IOC & 1)
-if( DEBUG_FATFS_UPDATE_IOC < cycle )
-printk("\n[%s] thread[%x,%x] copy page %d from FAT mapper to IOC device\n",
-__FUNCTION__, page_id );
-#endif
-                // move page from mapper to device
-                error = fatfs_move_page( page_xp , IOC_SYNC_WRITE );
-
-                if ( error )  return -1;
-
-                // reset page dirty flag
-                ppm_page_undo_dirty( page_xp );
-            }
-        }
-    }  // end loop on pages
-
-#if DEBUG_FATFS_UPDATE_IOC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_UPDATE_IOC < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-
-    return 0;
-
-}  // end fatfs_update_ioc_fat()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function synchronously updates the FS_INFO sector on IOC device,
-// from values contained in the FATFS context in FAT cluster.
-// It uses and updates the FS_INFO buffer allocated in the FAT cluster.
-// It can be called by a thread running in any cluster.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ fatfs_ctx_xp  : extended pointer on FATFS context in FAT cluster.
-// @ return 0 if success, return -1 if the FS_INFO sector cannot be updated.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_update_ioc_fsinfo( xptr_t fatfs_ctx_xp )
-{
-    cxy_t         fat_cxy;             // FAT cluster identifier
-    fatfs_ctx_t * fatfs_ctx_ptr;       // local pointer on fatfs context in FAT cluster
-    uint32_t      free_clusters;       // current vale of "free_clusters" in fatfs context
-    uint32_t      free_cluster_hint;   // current vale of "free_cluster_hint" in fatfs context
-    uint8_t     * fs_info_buffer_ptr;  // local pointer on FS_INFO buffer in FAT cluster
-    xptr_t        fs_info_buffer_xp;   // extended pointer on FS_INFO buffer in FAT cluster
-    uint32_t      fs_info_lba;         // FS_INFO sector lba on IOC device
-
-    // get cluster and local pointer on FAT cluster context
-    fat_cxy       = GET_CXY( fatfs_ctx_xp ); 
-    fatfs_ctx_ptr = GET_PTR( fatfs_ctx_xp ); 
-
-    // force FATFS context update
-    hal_fence();
-
-    // get relevant info from fatfs context in FAT cluster
-    fs_info_lba        = hal_remote_l32( XPTR( fat_cxy , &fatfs_ctx_ptr->fs_info_lba ) );
-    free_clusters      = hal_remote_l32( XPTR( fat_cxy , &fatfs_ctx_ptr->free_clusters ) );
-    free_cluster_hint  = hal_remote_l32( XPTR( fat_cxy , &fatfs_ctx_ptr->free_cluster_hint ) );
-    fs_info_buffer_ptr = hal_remote_lpt( XPTR( fat_cxy , &fatfs_ctx_ptr->fs_info_buffer ) );
-
-    // build extended pointer on FS_INFO buffer in FAT cluster
-    fs_info_buffer_xp  = XPTR( fat_cxy , fs_info_buffer_ptr );
-    
-    // update the FS_INFO buffer in FAT cluster
-    fatfs_set_remote_record( FS_FREE_CLUSTERS     , fs_info_buffer_xp , free_clusters );
-    fatfs_set_remote_record( FS_FREE_CLUSTER_HINT , fs_info_buffer_xp , free_cluster_hint );
-    
-    // update the FS_INFO sector on IOC device
-    return dev_ioc_sync_write( fs_info_buffer_xp , fs_info_lba , 1 );
- 
-}  // end fatfs_update_ioc_fsinfo()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function decrements the  "free_clusters" variable, and updates the 
-// "free_cluster_hint" variable in the FATFS context in FAT cluster,  when a new 
-// <cluster_id> has been allocated from the FAT.
-// It synchronously updates the FS_INFO sector on the IOC device. 
-// The FATFS context in FAT cluster is identified by the <fat_ctx_xp> argument.
-// It can be called by a thead running in any cluster. 
-// It scan all slots in the FAT mapper seen as an array of 32 bits words, looking for the
-// first free slot larger than the <cluster_id>.
-// The lock protecting exclusive access to the FAT must be taken by the calling function. 
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ fatfs_ctx_xp  : extended pointer on FATFS context in FAT cluster. 
-// @ cluster_id    : recently allocated cluster index in FAT.
-// @ return 0 if success, return -1 if the FS_INFO sector cannot be updated.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_free_clusters_decrement( xptr_t    fatfs_ctx_xp,
-                                              uint32_t  cluster_id )
-{
-    error_t       error;
-    cxy_t         fat_cxy;         // FAT cluster identifier
-    fatfs_ctx_t * fat_ctx_ptr;     // local pointer on fatfs context in FAT cluster
-    mapper_t    * fat_mapper_ptr;  // local pointer on FAT mapper
-    xptr_t        fat_mapper_xp;   // extended pointer on FAT mapper
-    xptr_t        hint_xp;         // extended pointer on "free_cluster_hint" shared variable
-    xptr_t        numb_xp;         // extended pointer on "free_clusters" shared variable 
-    uint32_t      page_id;         // page index in FAT mapper
-    uint32_t      slot_id;         // slot index in one page of FAT (1024 slots per page)
-    uint32_t      page_max;        // max number of pages in FAT mapper
-    xptr_t        page_xp;         // extended pointer on current page in FAT mapper
-    xptr_t        base_xp;         // extended pointer on current page base
-    xptr_t        slot_xp;         // extended pointer on current slot in FAT mapper
-    uint32_t      found;           // free slot found when non zero
-
-#if DEBUG_FATFS_FREE_CLUSTERS
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_FREE_CLUSTERS < cycle )
-printk("\n[%s] thread[%x,%x] enter for allocated cluster_id %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cluster_id , cycle );
-#endif
-
-    // get FAT cluster an local pointer on fatfs context in FAT cluster
-    fat_cxy      = GET_CXY( fatfs_ctx_xp );
-    fat_ctx_ptr  = GET_PTR( fatfs_ctx_xp );
-    
-    // build extended pointers on free_clusters, and free_cluster_hint in fatfs context
-    hint_xp = XPTR( fat_cxy , &fat_ctx_ptr->free_cluster_hint );
-    numb_xp = XPTR( fat_cxy , &fat_ctx_ptr->free_clusters );
-
-    // get pointers on FAT mapper from FATFS context
-    fat_mapper_ptr = hal_remote_lpt( XPTR( fat_cxy , &fat_ctx_ptr->fat_mapper ) );
-    fat_mapper_xp  = XPTR( fat_cxy , fat_mapper_ptr );
-
-    // initialise the loop variables to scan the FAT mapper
-    page_id  = (cluster_id + 1) >> 10;
-    slot_id  = (cluster_id + 1) & 0x3FF;
-    page_max = hal_remote_l32( XPTR( fat_cxy, &fat_ctx_ptr->fat_sectors_count ) ) >> 3;
-    found    = 0;
-
-    // scan FAT mapper : first loop on pages
-    while ( (page_id < page_max) && (found == 0) )            
-    {
-        // get current page from mapper
-        page_xp = mapper_get_fat_page( fat_mapper_xp , page_id );
-
-        if( page_xp == XPTR_NULL )
-        {
-            printk("\n[ERROR] in %s : cannot access FAT mapper\n", __FUNCTION__ );
-            return -1;
-        }
-
-        // get extended pointer on page
-        base_xp = ppm_page2base( page_xp );
-
-        // scan the FAT mapper : second loop on slots
-        while ( (slot_id < 1024) && (found == 0) )
-        {
-            // get extended pointer on current slot
-            slot_xp = base_xp + (slot_id << 2);
-
-            // test slot value 
-            if ( hal_remote_l32( slot_xp ) == FREE_CLUSTER )
-            {
-                // exit both loops
-                found = 1;
-            }
-            else
-            {
-                // update slot_id if not found
-                slot_id++;
-            }
-        }  // end loop on slots
-
-        // update page_id & slot_id variables if not found
-        if( found == 0 )
-        {
-            page_id++;
-            slot_id = 0;
-        }
-    }  // end loop on pages
-
-    if( found )  // free cluster found
-    {
-        // update "free_clusters" and "free_cluster_hint" value in FATFS context
-        hal_remote_atomic_add( numb_xp , -1 );
-        hal_remote_s32( hint_xp , (page_id << 10) + slot_id - 1 );
-
-        // update FS_INFO sector on IOC device
-        error = fatfs_update_ioc_fsinfo( fatfs_ctx_xp );
-
-        if( error ) 
-        {
-            printk("\n[ERROR] in %s : cannot update FS_INFO on IOC\n", __FUNCTION__ );
-            return -1;
-        }
-
-#if DEBUG_FATFS_FREE_CLUSTERS 
-if( DEBUG_FATFS_FREE_CLUSTERS < cycle )
-printk("\n[%s] thread[%x,%x] exit / hint %x / free %x\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-hal_remote_l32(hint_xp), hal_remote_l32(numb_xp) );
-#endif
-        return 0;
-    }
-    else  // free cluster not found
-    {
-        printk("\n[ERROR] in %s : No free cluster_id found\n", __FUNCTION__ );
-        return -1;
-    }
-    
-}  // end fatfs_free_clusters_decrement()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function increments the "free_clusters" variable, and updates the
-// "free_cluster_hint" variables in the FATFS context in FAT cluster, identified 
-// by the <fat_ctx_xp> argument, when a FATFS <cluster_id> has been released.
-// If the released cluster index is smaller than the current (hint) value, 
-// it set "free_cluster_hint" <= cluster.
-// It does NOT update the  FS_INFO sector on the IOC device, as this is done by the
-// calling fatfs_release_inode() function.
-// It can be called by a thead running in any cluster. 
-// The lock protecting exclusive access to the FAT must be taken by the calling function. 
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ fatfs_ctx_xp  : extended pointer on FATFS context in FAT cluster. 
-// @ cluster_id    : recently released cluster index in FAT.
-// @ return 0 if success, return -1 if the FS_INFO sector cannot be updated.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_free_clusters_increment( xptr_t   fatfs_ctx_xp,
-                                              uint32_t cluster_id )
-{
-    cxy_t         fat_cxy;      // FAT cluster identifier
-    fatfs_ctx_t * fat_ctx_ptr;  // local pointer on fatfs context in FAT cluster
-    xptr_t        hint_xp;      // extended pointer on "free_cluster_hint" shared variable
-    xptr_t        numb_xp;      // extended pointer on "free_clusters" shared variable 
-    uint32_t      hint;         // "free_cluster_hint" variable current value
-    uint32_t      numb;         // "free_clusters" variable current value
-
-#if DEBUG_FATFS_FREE_CLUSTERS
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_FREE_CLUSTERS < cycle )
-printk("\n[%s] thread[%x,%x] enter for released cluster_id %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cluster_id , cycle );
-#endif
-
-    // get FAT cluster an local pointer on fatfs context in FAT cluster
-    fat_cxy      = GET_CXY( fatfs_ctx_xp );
-    fat_ctx_ptr  = GET_PTR( fatfs_ctx_xp );
-    
-    // build extended pointers on free_clusters, and free_cluster_hint
-    hint_xp = XPTR( fat_cxy , &fat_ctx_ptr->free_cluster_hint );
-    numb_xp = XPTR( fat_cxy , &fat_ctx_ptr->free_clusters );
-
-    // get current value of free_cluster_hint and free_clusters
-    hint = hal_remote_l32( hint_xp );
-    numb = hal_remote_l32( numb_xp );
-
-    // update "numb" and "hint" variables as required
-    numb++;
-    if ( (cluster_id - 1) < hint ) hint = cluster_id - 1;
-
-    // update free_clusters
-    hal_remote_s32( numb_xp , numb );
-    hal_remote_s32( hint_xp , hint );
-
-#if DEBUG_FATFS_FREE_CLUSTERS 
-if( DEBUG_FATFS_FREE_CLUSTERS < cycle )
-printk("\n[%s] thread[%x,%x] exit / hint %x / free %x\n",
-__FUNCTION__, this->process->pid, this->trdid,
-hal_remote_l32( hint_xp ), hal_remote_l32( numb_xp ) );
-#endif
-
-    return 0;
-
-}  // end fatfs_free_clusters_increment()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This recursive function is called by the generic function fatfs_release_inode().
-// It release all FATFS clusters allocated to a given inode to the FAT mapper.
-// It can be called by a thread running in any cluster, as it use remote pointers
-// to access both the FAT mapper and the FATFS context in the FAT cluster, defined
-// by the <fat_mapper_xp> and <fatfs_ctx_xp> arguments.
-// The removal is done in reverse order of the linked list (from last cluster to first).
-// It returns in the <dirty_page_min> and <dirty_page_max> buffers the indexes of the
-// modified pages in the FAT mapper.
-// It updates the FAT mapper and the free_cluster info in the FATFS context, but does NOT
-// update the FAT and the FS_INFO on IOC device.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ fat_mapper_xp  : [in]  extended pointer on FAT mapper.
-// @ fatfs_ctx_xp   : [in]  extended pointer on FATFS context in FAT cluster.
-// @ cluster        : [in]  index of cluster to be released from FAT mapper.
-// @ dirty_page_min : [out] pointer on buffer for min dirty page index.
-// @ dirty_page_max : [out] pointer on buffer for max dirty page index.
-// @ return 0 if success / return -1 if error.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_recursive_release( xptr_t      fat_mapper_xp,
-                                        xptr_t      fatfs_ctx_xp,
-                                        uint32_t    cluster,
-                                        uint32_t  * dirty_page_min,
-                                        uint32_t  * dirty_page_max )
-{
-    uint32_t next;       // next cluster index
-    uint32_t page_id;    // page index in FAT mapper
-    uint32_t word_id;    // word index in page
-
-    // get page index and word index from cluster
-    page_id = cluster >> 10;
-    word_id = cluster & 0x3FF;
-
-    // get next cluster index from FAT mapper
-    if ( mapper_remote_get_32( fat_mapper_xp,
-                               page_id,
-                               word_id,
-                               &next ) ) return -1;
-
-#if (DEBUG_FATFS_RELEASE_INODE & 1)
-thread_t * this = CURRENT_THREAD;
-if ( DEBUG_FATFS_RELEASE_INODE < (uint32_t)hal_get_cycles() )
-printk("\n[%s] thread[%x,%x] access FAT for cluster %x / next %x\n",
-__FUNCTION__, this->process->pid, this->trdid, cluster, next );
-#endif
-
-    if ( next < END_OF_CHAIN_CLUSTER_MIN )  // non terminal case
-    {
-        // call fatfs_recursive_release() on next cluster
-        if ( fatfs_recursive_release( fat_mapper_xp,
-                                      fatfs_ctx_xp,
-                                      next,
-                                      dirty_page_min,
-                                      dirty_page_max ) ) return -1;
-    }       
-
-    // update FAT mapper
-    if ( mapper_remote_set_32( fat_mapper_xp,
-                               page_id, 
-                               word_id,
-                               FREE_CLUSTER ) ) return -1;
-
-    // update dirty_page_min / dirty_page_max buffers
-    if( page_id < *dirty_page_min ) *dirty_page_min = page_id;
-    if( page_id > *dirty_page_max ) *dirty_page_max = page_id;
-
-    // Update free_cluster info in FATFS context 
-    return fatfs_free_clusters_increment( fatfs_ctx_xp , cluster );
-
-}  // end fatfs_recursive_release()
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function access the FAT mapper to allocate a new cluster in the FATFS,
-// and returns in <searched_cluster_id> the FATFS cluster index of a free cluster.
-// It updates the FAT mapper (handling miss from IOC device if required) :
-// - if the <last_cluster_id> is zero, the new cluster is the first allocated cluster,
-//   and the <searched_cluster_id> FAT slot is set to END_OF_CHAIN_CLUSTER.
-// - if the <last_cluster_id> argument is not zero, the new cluster is not the first,
-//   the <last_cluster_id> FAT slot is set to <searched_cluster_id>, 
-//   the <searched_cluster_id> FAT slot is set to END_OF_CHAIN_CLUSTER.
-// This function also updates the  two "free_cluster_hint" and "free_clusters" variables
-// stored in the FATFS context. It takes the rwlock stored in the FATFS context in the
-// FAT cluster to get exclusive access to the FAT.
-// This function synchronously updates the FAT region on IOC device. 
-// It can be called by a thread running in any cluster as it uses remote accesses.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ last_cluster_id      : [in]  previous last cluster index. 
-// @ searched_cluster_id  : [out] allocated cluster index.
-// @ return 0 if success / return -1 if no more free clusters on IOC device.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_cluster_alloc( uint32_t   last_cluster_id,
-                                    uint32_t * searched_cluster_id )
-{
-    error_t       error;
-    uint32_t      free_clusters;   // total number of free clusters
-    uint32_t      hint;            // hint + 1 is the first free cluster
-    uint32_t      new_cluster_id;  // allocated cluster index in FAT
-    uint32_t      new_page_id;     // allocated cluster page index in FAT mapper
-    uint32_t      new_slot_id;     // allocated cluster slot index in page (1024 slots per page)
-    xptr_t        new_page_xp;     // extended pointer on FAT page for allocated cluster
-    xptr_t        new_slot_xp;     // extended pointer on allocated cluster slot in FAT 
-    uint32_t      last_page_id;    // last cluster page index in FAT mapper
-    uint32_t      last_slot_id;    // last cluster slot index in page (1024 slots per page)
-    xptr_t        last_slot_xp;    // extended pointer on last cluster slot in FAT 
-    xptr_t        last_page_xp;    // extended pointer on FAT page for last cluster
-    vfs_ctx_t   * vfs_ctx;         // local pointer on VFS context (same in all clusters)
-    fatfs_ctx_t * loc_fatfs_ctx;   // local pointer on local FATFS context
-    fatfs_ctx_t * fat_fatfs_ctx;   // local pointer on FATFS context in FAT cluster
-    mapper_t    * fat_mapper_ptr;  // local pointer on FAT mapper
-    xptr_t        fat_mapper_xp;   // extended pointer on FAT mapper
-    cxy_t         fat_cxy;         // FAT mapper cluster identifier
-    xptr_t        lock_xp;         // extended pointer on lock protecting free clusters info
-    xptr_t        hint_xp;         // extended pointer on free_cluster_hint in FAT cluster
-    xptr_t        free_xp;         // extended pointer on free_clusters_number in FAT cluster
-    
-#if DEBUG_FATFS_CLUSTER_ALLOC
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_CLUSTER_ALLOC < cycle )
-printk("\n[%s] thread[%x,%x] enter / lats_cluster_id %x / cycle = %d\n",
-__FUNCTION__, this->process->pid, this->trdid, last_cluster_id, cycle );
-#endif
-
-    // get local pointer on VFS context (same in all clusters)
-    vfs_ctx = &fs_context[FS_TYPE_FATFS];
-
-    // get local pointer on local FATFS context
-    loc_fatfs_ctx = vfs_ctx->extend;
-
-    // get FAT cluster
-    fat_cxy = CONFIG_VFS_ROOT_CXY;
-
-    // get pointers on FAT mapper
-    fat_mapper_ptr = loc_fatfs_ctx->fat_mapper;
-    fat_mapper_xp  = XPTR( fat_cxy , fat_mapper_ptr );
-
-    // get local pointer on FATFS context in FAT cluster 
-    fat_fatfs_ctx = hal_remote_lpt( XPTR( fat_cxy , &vfs_ctx->extend ) );
-
-    // build relevant extended pointers on free clusters info in FAT cluster 
-    lock_xp = XPTR( fat_cxy , &fat_fatfs_ctx->lock );
-    hint_xp = XPTR( fat_cxy , &fat_fatfs_ctx->free_cluster_hint );
-    free_xp = XPTR( fat_cxy , &fat_fatfs_ctx->free_clusters );
-
-    // take the FAT lock in write mode
-    remote_rwlock_wr_acquire( lock_xp );
-
-    // get hint and free_clusters values from FATFS context in FAT cluster
-    hint          = hal_remote_l32( hint_xp );
-    free_clusters = hal_remote_l32( free_xp );
-        
-#if (DEBUG_FATFS_CLUSTER_ALLOC & 1)
-if( DEBUG_FATFS_CLUSTER_ALLOC < cycle )
-printk("\n[%s] thread[%x,%x] get free info : hint %x / free_clusters %x\n",
-__FUNCTION__, this->process->pid, this->trdid, hint, free_clusters );
-#endif
-
-    // check "free_clusters"
-    if ( free_clusters == 0 )
-    {
-        printk("\n[ERROR] in %s : no more free FATFS clusters\n", __FUNCTION__ );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-    else if ( free_clusters < CONFIG_VFS_FREE_CLUSTERS_MIN )
-    {
-        printk("\n[WARNING] in %s : only %d free FATFS clusters\n", 
-        __FUNCTION__, CONFIG_VFS_FREE_CLUSTERS_MIN );
-    }
-
-    // get new cluster, page & slot indexes in FAT
-    new_cluster_id = hint + 1; 
-    new_page_id    = new_cluster_id >> 10;
-    new_slot_id    = new_cluster_id & 0x3FF;
-
-    // get relevant FAT page descriptor from FAT mapper
-    new_page_xp = mapper_get_fat_page( fat_mapper_xp , new_page_id );
-
-    if( new_page_xp == XPTR_NULL )
-    {
-        printk("\n[ERROR] in %s : cannot acces FAT mapper\n", __FUNCTION__ );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-    // build extended pointer on new cluster slot in FAT mapper
-    new_slot_xp = ppm_page2base( new_page_xp ) + (new_slot_id << 2);
-         
-    // check selected cluster actually free
-    if( hal_remote_l32( new_slot_xp ) != FREE_CLUSTER )
-    { 
-        printk("\n[ERROR] in %s : selected cluster_id %x not free\n",
-        __FUNCTION__, new_cluster_id );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-    // update new_cluster slot in FAT mapper
-    hal_remote_s32( new_slot_xp  , END_OF_CHAIN_CLUSTER_MIN );
-
-    // handle last_cluster_id argument if non zero
-    if( last_cluster_id )
-    {
-        // get last cluster page & slot indexes in FAT
-        last_page_id    = last_cluster_id >> 10;
-        last_slot_id    = last_cluster_id & 0x3FF;
-
-        // get relevant FAT page descriptor from FAT mapper
-        last_page_xp = mapper_get_fat_page( fat_mapper_xp , last_page_id );
-
-        if( last_page_xp == XPTR_NULL )
-        {
-            printk("\n[ERROR] in %s : cannot acces FAT mapper\n", __FUNCTION__ );
-            remote_rwlock_wr_release( lock_xp );
-            return -1;
-        }
-
-        // build extended pointer on new cluster slot in FAT mapper
-        last_slot_xp = ppm_page2base( last_page_xp ) + (last_slot_id << 2);
-         
-        // check last cluster actually end of chain
-        if( hal_remote_l32( last_slot_xp ) != END_OF_CHAIN_CLUSTER_MIN )
-        { 
-            printk("\n[ERROR] in %s : last_cluster_id %x not END_OF_CHAIN\n",
-            __FUNCTION__, last_cluster_id );
-            remote_rwlock_wr_release( lock_xp );
-            return -1;
-        }
-
-        // update last_cluster slot in FAT mapper
-        hal_remote_s32( last_slot_xp , new_cluster_id );
-    }
-    else
-    {
-        last_page_xp = XPTR_NULL;
-    }
-
-    // update the FAT new_page on device
-    error = fatfs_move_page( new_page_xp , IOC_SYNC_WRITE );
-
-    if( error )
-    { 
-        printk("\n[ERROR] in %s : cannot update FAT on IOC device\n", __FUNCTION__ );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-    // update the FAT last_page on device when required
-    if( (last_page_xp != XPTR_NULL) && (last_page_xp != new_page_xp) )
-    {
-        error = fatfs_move_page( last_page_xp , IOC_SYNC_WRITE );
-
-        if( error )
-        { 
-            printk("\n[ERROR] in %s : cannot update FAT on IOC device\n", __FUNCTION__ );
-            remote_rwlock_wr_release( lock_xp );
-            return -1;
-        }
-    }
-
-    // update free cluster info in FATFS context and in FS_INFO sector
-    error = fatfs_free_clusters_decrement( XPTR( fat_cxy , fat_fatfs_ctx ) , new_cluster_id );
-
-    if( error )
-    { 
-        printk("\n[ERROR] in %s : cannot update free cluster info\n", __FUNCTION__ );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-    // release FAT lock
-    remote_rwlock_wr_release( lock_xp );
-
-#if DEBUG_FATFS_CLUSTER_ALLOC 
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_CLUSTER_ALLOC < cycle )
-printk("\n[%s] thread[%x,%x] exit / allocated cluster_id %x in FAT / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, new_cluster_id, cycle );
-#endif
-
-    *searched_cluster_id = new_cluster_id;
-    return 0;
-
-}  // end fatfs_cluster_alloc()
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function access the FAT (File Allocation Table), stored in the FAT mapper,
-// and returns in <searched_cluster_id> the FATFS cluster_id for a given page of a given 
-// inode, identified by the <searched_page_id> argument that is the page index in file
-// (i.e. the page index in file mapper). The entry point in the FAT is defined by the
-// <first_cluster_id> argument, that is the cluster_id of an already allocated cluster.
-// It can be the cluster_id of the first page of the file (always registered in the
-// fatfs_inode extension), or any page of the file whose <first_page_id> argument
-// is smaller than the searched <first_page_id> argument. 
-// This function can be called by a thread running in any cluster.
-// The FAT mapper being a WRITE-THROUGH cache, this function updates the FAT mapper 
-// from informations stored on IOC device in case of miss when scanning the FAT mapper.
-// The searched inode mapper being a WRITE-BACK cache, this function allocates a new
-// cluster_id when the searched page exist in the inode mapper, and there is no FATFS 
-// cluster allocated yet for this page. It updates the FAT, but it does NOT copy the
-// mapper page content to the File System.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ first_page_id       : [in]  index in file mapper for an existing page.
-// @ first_cluster_id	 : [in]  cluster_id for this existing page. 
-// @ searched_page_id    : [in]  index in file mapper for the searched page.
-// @ searched_cluster_id : [out] cluster_id for the searched page.
-// @ return 0 if success / return -1 if a FAT mapper miss cannot be solved,
-//                         or if a missing cluster_id cannot be allocated.
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_get_cluster( uint32_t   first_page_id,
-                                  uint32_t   first_cluster_id,
-                                  uint32_t   searched_page_id,
-                                  uint32_t * searched_cluster_id )
-{
-    uint32_t   current_page_id;        // index of page in file mapper
-    uint32_t   current_cluster_id;     // index of cluster in FATFS
-    xptr_t     lock_xp;                // extended pointer on FAT lock
-    xptr_t     fat_mapper_xp;          // extended pointer on FAT mapper
-    mapper_t * fat_mapper_ptr;         // local pointer on FAT mapper
-    cxy_t      fat_cxy;                // FAT cluster
-    error_t    error;
-
-assert( __FUNCTION__, (searched_page_id > first_page_id) ,
-"searched_page_id must be larger than first_page_id\n");
-
-#if DEBUG_FATFS_GET_CLUSTER
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_GET_CLUSTER < cycle )
-printk("\n[%s] thread[%x,%x] enter / frst_pid %x / frst_cid %x / srch_pid %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-first_page_id, first_cluster_id, searched_page_id, cycle );
-#endif
-
-    // get local pointer on VFS context (same in all clusters)
-    vfs_ctx_t * vfs_ctx = &fs_context[FS_TYPE_FATFS];
-
-    // get local pointer on local FATFS context
-    fatfs_ctx_t * loc_fatfs_ctx = vfs_ctx->extend;
-
-    // get FAT cluster
-    fat_cxy = CONFIG_VFS_ROOT_CXY;
-    
-    // get pointers on FAT mapper
-    fat_mapper_ptr = loc_fatfs_ctx->fat_mapper;
-    fat_mapper_xp  = XPTR( fat_cxy , fat_mapper_ptr );
-
-    // get local pointer on FATFS context in FAT cluster 
-    fatfs_ctx_t * fat_fatfs_ctx = hal_remote_lpt( XPTR( fat_cxy , &vfs_ctx->extend ) );
-
-    // build extended pointer on FAT lock in FAT cluster
-    lock_xp = XPTR( fat_cxy , &fat_fatfs_ctx->lock );
-
-    // take FAT lock in read mode
-    remote_rwlock_rd_acquire( lock_xp );
-
-    // initialize loop variables
-    current_page_id    = first_page_id;
-    current_cluster_id = first_cluster_id;
-
-    // scan FAT mapper (i.e. traverse FAT linked list)
-    // starting from first_page_id until searched_page_id 
-    // each iteration in this loop can change both
-    // the FAT page index and the slot index in FAT 
-    while( current_page_id < searched_page_id )
-    {
-        // FAT mapper page and slot indexes (1024 slots per FAT page)
-        uint32_t fat_page_index   = current_cluster_id >> 10;
-        uint32_t fat_slot_index   = current_cluster_id & 0x3FF;
-
-        // get pointer on current page descriptor in FAT mapper
-        xptr_t current_page_xp = mapper_get_fat_page( fat_mapper_xp , fat_page_index );
-
-        if( current_page_xp == XPTR_NULL )
-        {
-            printk("\n[ERROR] in %s : cannot get page %d from FAT mapper\n",
-            __FUNCTION__ , fat_page_index );
-            remote_rwlock_rd_release( lock_xp );
-            return -1;
-        }
-
-        // get pointer on buffer containing the FAT mapper page
-        xptr_t     base_xp = ppm_page2base( current_page_xp );
-        uint32_t * buffer  = (uint32_t *)GET_PTR( base_xp );
-
-        // get next_cluster_id from FAT slot  
-        uint32_t next_cluster_id = hal_remote_l32( XPTR( fat_cxy, &buffer[fat_slot_index] ) );
-
-        // allocate a new FAT cluster when END_OF_CHAIN found
-        if( next_cluster_id >= END_OF_CHAIN_CLUSTER_MIN ) 
-        {
-            // release the FAT lock in read mode,
-            remote_rwlock_rd_release( lock_xp );
-
-            // allocate a new cluster_id (and update both FAT mapper and FAT on device).
-            error = fatfs_cluster_alloc( current_cluster_id,
-                                         &next_cluster_id );
-            if( error )
-            {
-                printk("\n[ERROR] in %s : cannot allocate cluster on FAT32 for page %d\n",
-                __FUNCTION__ , current_page_id );
-                remote_rwlock_wr_release( lock_xp );
-                return -1;
-            }
-
-#if (DEBUG_FATFS_GET_CLUSTER & 1)
-if( DEBUG_FATFS_GET_CLUSTER < cycle )
-printk("\n[%s] allocated a new cluster_id %x in FATFS\n",
-__FUNCTION__, next_cluster_id );
-#endif
-            // take the FAT lock in read mode,
-            remote_rwlock_rd_acquire( lock_xp );
-        }
-
-#if (DEBUG_FATFS_GET_CLUSTER & 1)
-if( DEBUG_FATFS_GET_CLUSTER < cycle )
-printk("\n[%s] traverse FAT / current_cluster_id %x / next_cluster_id %x\n",
-__FUNCTION__, current_cluster_id , next_cluster_id );
-#endif
-
-        // update loop variables
-        current_cluster_id = next_cluster_id;
-        current_page_id++;
-    }
-   
-    // release FAT lock
-    remote_rwlock_rd_release( lock_xp );
-
-#if DEBUG_FATFS_GET_CLUSTER
-if( DEBUG_FATFS_GET_CLUSTER < cycle )
-printk("\n[%s] thread[%x,%x] exit / frst_pid %d / frst_cid %x / srch_pid %d / srch_cid %x\n",
-__FUNCTION__, this->process->pid, this->trdid,
-first_page_id, first_cluster_id, searched_page_id, current_cluster_id );
-#endif
-
-    *searched_cluster_id = current_cluster_id;
-    return 0;
-
-}  // end fatfs_get_cluster()
-
-//////////////////////////////////////////////////////////////////////////////////////////////
-// This static function scan the pages of a directory mapper, identified by the <mapper_xp> 
-// argument, to find the directory entry identified by the <name> argument, and returns
-// a pointer on the directory entry, described as an array of 32 bytes, and the index of 
-// this entry in the FAT32 mapper, seen as an array of 32 bytes entries. 
-// It makes a local copy of each directory entry to reduce the number of remote accesses.
-// It is called by the fatfs_new_dentry_from_mapper() function.
-// It can be called by a thread running in any cluster.
-//////////////////////////////////////////////////////////////////////////////////////////////
-// @ mapper_xp : [in]  extended pointer on directory mapper.
-// @ name      : [in]  searched directory entry name.
-// @ entry     : [out] buffer for the pointer on the 32 bytes directory entry (when found).
-// @ index     : [out] buffer for the directory entry index in mapper. 
-// @ return 0 if found / return 1 if not found / return -1 if mapper access error. 
-//////////////////////////////////////////////////////////////////////////////////////////////
-static error_t fatfs_scan_directory( xptr_t      mapper_xp,
-                                     char     *  name,
-                                     uint8_t  ** entry,
-                                     uint32_t *  index )
-{
-    uint8_t  buf[32];   // local buffer for one FAT32 directory entry
-
-// check arguments
-assert( __FUNCTION__, (mapper_xp != XPTR_NULL) , "mapper pointer is NULL\n" );
-assert( __FUNCTION__, (name      != NULL     ) , "child name is undefined\n" );
-
-#if DEBUG_FATFS_SCAN_DIRECTORY
-char          parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-uint32_t      cycle      = (uint32_t)hal_get_cycles();
-thread_t    * this       = CURRENT_THREAD;
-mapper_t    * mapper_ptr = GET_PTR( mapper_xp );
-cxy_t         mapper_cxy = GET_CXY( mapper_xp );
-vfs_inode_t * inode_ptr  = hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) );
-vfs_inode_get_name( XPTR( mapper_cxy , inode_ptr ) , parent_name );
-if( DEBUG_FATFS_SCAN_DIRECTORY < cycle )
-printk("\n[%s]  thread[%x,%x] enter to search child <%s> in parent <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name , parent_name , cycle );
-#endif
-
-    char       cname[CONFIG_VFS_MAX_NAME_LENGTH];  // name extracted from directory entry
-
-    char       lfn1[16];         // buffer for one partial cname
-    char       lfn2[16];         // buffer for one partial cname
-    char       lfn3[16];         // buffer for one partial cname
-    xptr_t     page_xp;          // extended pointer on one page descriptor
-    xptr_t     base_xp;          // extended pointer on one page base
-    uint8_t    attr;             // directory entry ATTR field
-    uint8_t    ord;              // directory entry ORD field
-    uint32_t   seq;              // sequence index
-    uint32_t   lfn       = 0;    // LFN entries number
-    int32_t    found     = 0;    // not yet = 0 / success = 1 / not found = 2 / error = -1
-    uint32_t   page_id   = 0;    // page index in mapper
-    uint32_t   offset    = 0;    // byte offset in page
-
-    // Two embedded loops to scan the directory mapper:
-    // - scan the parent directory mapper pages 
-    // - scan the directory entries in each 4 Kbytes page
-
-    // scan the mapper pages
-    while ( found == 0 )
-    {
-        // get one page
-        page_xp = mapper_get_page( mapper_xp , page_id );
-
-        if( page_xp == XPTR_NULL)
-        {
-            found = -1;
-        }
-
-        // get page base
-        base_xp = ppm_page2base( page_xp );
-
-#if (DEBUG_FATFS_SCAN_DIRECTORY & 1)
-if( DEBUG_FATFS_SCAN_DIRECTORY < cycle )
-mapper_display_page( mapper_xp , page_xp , 256 );
-#endif
-        // scan this page until end of directory, end of page, or name found
-        while( (offset < 4096) && (found == 0) )
-        {
-            // makes a local copy of current directory entry  (32 bytes)
-            hal_remote_memcpy( XPTR( local_cxy , buf ) , base_xp + offset , 32 );
-
-            // get attr and ord from local buffer
-            attr = fatfs_get_record( DIR_ATTR , buf );   
-            ord  = fatfs_get_record( LDIR_ORD , buf );   
-
-            if (ord == NO_MORE_ENTRY)                 // no more entry => break
-            {
-                found = 2;
-            }
-            else if ( ord == FREE_ENTRY )             // free entry => skip
-            {
-                offset = offset + 32;
-            }
-            else if ( attr == 0x28 )                  // volune_id => skip
-            {
-                offset = offset + 32;
-            }
-            else if ( attr == ATTR_LONG_NAME_MASK )   // LFN entry => get partial cname
-            {
-                seq = ord & 0x3;
-                lfn = (seq > lfn) ? seq : lfn;   
-                if      ( seq == 1 ) fatfs_get_name_from_long( buf , lfn1 );
-                else if ( seq == 2 ) fatfs_get_name_from_long( buf , lfn2 );
-                else if ( seq == 3 ) fatfs_get_name_from_long( buf , lfn3 );
-                offset = offset + 32;
-            }
-            else                                 // NORMAL entry
-            {
-                // build the extracted name
-                if      ( lfn == 0 )
-                {
-                    fatfs_get_name_from_short( buf , cname );
-                }
-                else if ( lfn == 1 )
-                {
-                    strcpy( cname      , lfn1 );
-                }   
-                else if ( lfn == 2 ) 
-                {
-                    strcpy( cname      , lfn1 );
-                    strcpy( cname + 13 , lfn2 );
-                }
-                else if ( lfn == 3 ) 
-                {
-                    strcpy( cname      , lfn1 );
-                    strcpy( cname + 13 , lfn2 );
-                    strcpy( cname + 26 , lfn3 );
-                }
-
-                // get dentry arguments if extracted cname == searched name
-                if ( strcmp( name , cname ) == 0 )
-                {
-                    uint8_t * base = GET_PTR( base_xp );
-                    *entry = base + offset;
-                    *index = ( (page_id << 12) + offset ) >> 5; 
-                    found  = 1;
-                }
-                offset = offset + 32;
-                lfn    = 0;
-            }
-
-        }  // end loop on directory entries in page
-
-        page_id++;
-        offset = 0;
-
-    }  // end loop on pages
-
-    if( found == 1 )
-    {
-
-#if DEBUG_FATFS_SCAN_DIRECTORY
-if( DEBUG_FATFS_SCAN_DIRECTORY < cycle )
-printk("\n[%s]  thread[%x,%x] exit / found child <%s> in <%s>\n",
-__FUNCTION__, this->process->pid, this->trdid, name, parent_name );
-#endif
-        return 0;
-    }
-    else if( found == 2 )
-    {
-
-#if DEBUG_FATFS_SCAN_DIRECTORY
-if( DEBUG_FATFS_SCAN_DIRECTORY < cycle )
-printk("\n[%s]  thread[%x,%x] exit / child <%s> in <%s> not found\n",
-__FUNCTION__, this->process->pid, this->trdid, name, parent_name );
-#endif
-        return 1;
-    }
-    else
-    {
-        printk("\n[ERROR] in %s : cannot get page %d from mapper\n",
-        __FUNCTION__, page_id );
-
-        return -1;
-    }
-}  // end fatfs_scan_directory()
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//              FATFS debug functions 
-//////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////
-void fatfs_display_ctx( cxy_t cxy )
-{
-    // get pointer on local FATFS context
-    vfs_ctx_t   * vfs_ctx = &fs_context[FS_TYPE_FATFS];
-	fatfs_ctx_t * ctx     = hal_remote_lpt( XPTR( cxy , &vfs_ctx->extend ) );
-
-    uint32_t fat_sectors       = hal_remote_l32( XPTR( cxy , &ctx->fat_sectors_count ) );
-    uint32_t sector_size       = hal_remote_l32( XPTR( cxy , &ctx->bytes_per_sector ) );
-    uint32_t sec_per_clus      = hal_remote_l32( XPTR( cxy , &ctx->sectors_per_cluster ) );
-    uint32_t fat_lba           = hal_remote_l32( XPTR( cxy , &ctx->fat_begin_lba ) );
-    uint32_t data_lba          = hal_remote_l32( XPTR( cxy , &ctx->cluster_begin_lba ) );
-    uint32_t fsinfo_lba        = hal_remote_l32( XPTR( cxy , &ctx->fs_info_lba ) );
-    uint32_t root_dir_clus     = hal_remote_l32( XPTR( cxy , &ctx->root_dir_cluster ) );
-    uint32_t free_clusters     = hal_remote_l32( XPTR( cxy , &ctx->free_clusters ) );
-    uint32_t free_cluster_hint = hal_remote_l32( XPTR( cxy , &ctx->free_cluster_hint ) );
-    void   * fat_mapper        = hal_remote_lpt( XPTR( cxy , &ctx->fat_mapper ) );
-    void   * fs_info_buffer    = hal_remote_lpt( XPTR( cxy , &ctx->fs_info_buffer ) );
-
-    printk("\n*** FAT context in cluster %x\n" 
-           "- fat_sectors       = %d\n"
-           "- sector size       = %d\n"
-           "- cluster size      = %d\n"
-           "- fat_lba           = %x\n"
-           "- data_lba          = %x\n"
-           "- fsinfo_lba        = %x\n"
-           "- root_dir_cluster  = %x\n"
-           "- free_clusters     = %x\n"
-           "- free_cluster_hint = %x\n"
-           "- fat_mapper        = %x\n"
-           "- fs_info_buffer    = %x\n",
-           cxy,
-           fat_sectors,
-           sector_size,
-           sector_size * sec_per_clus,
-           fat_lba,
-           data_lba,
-           fsinfo_lba,
-           root_dir_clus,
-           free_clusters,
-           free_cluster_hint,
-           fat_mapper,
-           fs_info_buffer );
-
-}  // end fatfs_display_ctx()
-
-//////////////////////////////////////////
-void fatfs_display_fat( uint32_t  min_slot,
-                        uint32_t  nb_slots )
-{
-    // one FAT mapper page contains 1024 slots = 128 lines of 8 slots
-
-    uint32_t   page_id;
-    uint32_t   line;
-    cxy_t      fat_cxy;         // FAT cluster
-    mapper_t * mapper;          // local pointer on FAT mapper
-    xptr_t     mapper_xp;       // extended pointer on fat_mapper
-    uint32_t   min_cluster_id;  // index of min slot to be displayed
-    uint32_t   min_page_id;     // index of min page to be displayed
-    uint32_t   min_line_id;     // index of min line in min page ( < 128 )
-    uint32_t   max_cluster_id;  // index of max slot to be displayed
-    uint32_t   max_page_id;     // index of max page to be displayed
-    uint32_t   max_line_id;     // index of max line in max page ( < 128 )
-
-    // compute min values
-    min_cluster_id = min_slot & 0xFFFFFFF8;
-    min_line_id    = (min_cluster_id & 0x3FF) >> 3;
-    min_page_id    = min_cluster_id >> 10;
-
-    // compute max values
-    max_cluster_id = min_slot + nb_slots - 1;
-    max_line_id    = (max_cluster_id & 0x3FF) >> 3;
-    max_page_id    = max_cluster_id >> 10;
-
-    // get pointer on local FATFS context
-    vfs_ctx_t   * vfs_ctx       = &fs_context[FS_TYPE_FATFS];
-    fatfs_ctx_t * loc_fatfs_ctx = (fatfs_ctx_t *)vfs_ctx->extend;
-
-    // get FAT cluster
-    fat_cxy = CONFIG_VFS_ROOT_CXY;
-
-    // get pointers on FAT mapper (in FAT cluster)
-    mapper    = loc_fatfs_ctx->fat_mapper;
-    mapper_xp = XPTR( fat_cxy , mapper );
-
-    // get pointer on FATFS context in FAT cluster
-    fatfs_ctx_t * fat_fatfs_ctx = hal_remote_lpt( XPTR( fat_cxy , &vfs_ctx->extend ) );
- 
-    // get current value of hint and free_clusters
-    uint32_t hint = hal_remote_l32( XPTR( fat_cxy , &fat_fatfs_ctx->free_cluster_hint ) );
-    uint32_t free = hal_remote_l32( XPTR( fat_cxy , &fat_fatfs_ctx->free_clusters ) );
-
-    printk("\n***** FAT mapper / cxy %x / free_clusters %x / hint %x\n", fat_cxy, free, hint );
-
-    // scan all pages as required by min_page_id and max_page_id
-    for( page_id = min_page_id ; page_id <= max_page_id ; page_id++ )
-    {
-        // get extended pointer on requested page descriptor in FAT mapper 
-        xptr_t page_xp = mapper_get_fat_page( mapper_xp , page_id );
-
-        // get extended pointer on requested page base
-        xptr_t     base_xp  = ppm_page2base( page_xp );
-
-        // compute min_line & max_line in current page
-        uint32_t min_line = (page_id == min_page_id) ? min_line_id : 0;
-        uint32_t max_line = (page_id == max_page_id) ? max_line_id : 127;
-
-        // loop on lines in current page
-        for( line = min_line ; line <= max_line ; line++ )
-        {
-            printk("%x : %X | %X | %X | %X | %X | %X | %X | %X\n",
-            (page_id << 10) + (line <<3 ),
-            hal_remote_l32( base_xp + ((line<<5)      ) ),
-            hal_remote_l32( base_xp + ((line<<5) + 4  ) ),
-            hal_remote_l32( base_xp + ((line<<5) + 8  ) ),
-            hal_remote_l32( base_xp + ((line<<5) + 12 ) ),
-            hal_remote_l32( base_xp + ((line<<5) + 16 ) ),
-            hal_remote_l32( base_xp + ((line<<5) + 20 ) ),
-            hal_remote_l32( base_xp + ((line<<5) + 24 ) ),
-            hal_remote_l32( base_xp + ((line<<5) + 28 ) ) );
-        }
-    }
-}  // end fatfs_display_fat()
-
-/////////////////////////////////////
-error_t fatfs_check_free_info( void )
-{
-    error_t       error;
-    fatfs_ctx_t * fatfs_ctx_ptr;              // local pointer on fatfs context in cluster 0
-    uint32_t      ctx_free_clusters;          // number of free clusters from fatfs context
-    uint32_t      ctx_free_cluster_hint;      // free cluster hint from fatfs context
-    uint32_t      ioc_free_clusters;          // number of free clusters from fatfs context
-    uint32_t      ioc_free_cluster_hint;      // free cluster hint from fatfs context
-    uint32_t      fs_info_lba;                // lba of FS_INFO sector on IOC device
-    uint8_t     * fs_info_buffer;             // local pointer on FS_INFO buffer in cluster 0
-    xptr_t        fs_info_buffer_xp;          // extended pointer on FS_INFO buffer in cluster 0
-    uint8_t       tmp_buf[512];               // 512 bytes temporary buffer 
-    xptr_t        tmp_buf_xp;                 // extended pointer on temporary buffer
-
-#if DEBUG_FATFS_SYNC_FSINFO
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_SYNC_FSINFO < cycle )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-
-    // get pointer on fatfs context in cluster 0
-    fatfs_ctx_ptr = hal_remote_lpt( XPTR( 0 , &fs_context[FS_TYPE_FATFS].extend ) );
-
-    // get "free_clusters" and "free_cluster_hint" from fatfs context in cluster 0
-    ctx_free_clusters     = hal_remote_l32( XPTR( 0 , &fatfs_ctx_ptr->free_clusters ) );
-    ctx_free_cluster_hint = hal_remote_l32( XPTR( 0 , &fatfs_ctx_ptr->free_cluster_hint ) );
-
-    // get fs_info_lba 
-    fs_info_lba = hal_remote_l32( XPTR( 0 , &fatfs_ctx_ptr->fs_info_lba ) );
-
-    // build extended pointer on temporary buffer
-    tmp_buf_xp = XPTR( local_cxy , tmp_buf );
-
-    // copy FS_INFO sector from IOC to local buffer
-    error = dev_ioc_sync_read( tmp_buf_xp , fs_info_lba , 1 );
-
-    if ( error )
-    {
-        printk("\n[ERROR] in %s : cannot access FS_INFO on IOC device\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get current values of "free_clusters" and "free_cluster_hint" from FS_INFO on IOC
-    ioc_free_clusters     = fatfs_get_remote_record( FS_FREE_CLUSTERS     , tmp_buf_xp );
-    ioc_free_cluster_hint = fatfs_get_remote_record( FS_FREE_CLUSTER_HINT , tmp_buf_xp );
-
-#if DEBUG_FATFS_SYNC_FSINFO
-if( DEBUG_FATFS_SYNC_FSINFO < cycle )
-printk("\n[%s] thread[%x,%x] / ctx_free %x / ioc_free %x / ctx_hint %x / ioc_hint %x\n",
-__FUNCTION__ , this->process->pid, this->trdid, 
-ctx_free_clusters, ioc_free_clusters, ctx_free_cluster_hint, ioc_free_cluster_hint );
-#endif
-
-    // check values
-    if( (ioc_free_clusters     != ctx_free_clusters) || 
-        (ioc_free_cluster_hint != ctx_free_cluster_hint) )
-    {
-        printk("\n[WARNING] in %s : unconsistent free clusters info\n"
-        " ioc_free %x / ctx_free %x / ioc_hint %x / ctx_hint %x\n",
-        __FUNCTION__, ioc_free_clusters, ctx_free_clusters,
-        ioc_free_cluster_hint, ctx_free_cluster_hint );
-
-        // get pointers on FS_INFO buffer in cluster 0
-        fs_info_buffer    = hal_remote_lpt( XPTR( 0 , &fatfs_ctx_ptr->fs_info_buffer ) );
-        fs_info_buffer_xp = XPTR( 0 , fs_info_buffer );
-
-        // update FS_INFO buffer in cluster 0 
-        fatfs_set_remote_record(FS_FREE_CLUSTERS    ,fs_info_buffer_xp,ctx_free_clusters );
-        fatfs_set_remote_record(FS_FREE_CLUSTER_HINT,fs_info_buffer_xp,ctx_free_cluster_hint);
-
-        // update the FS_INFO sector on IOC device
-        error = dev_ioc_sync_write( fs_info_buffer_xp , fs_info_lba , 1 );
-
-        if ( error )
-        {
-            printk("\n[ERROR] in %s : cannot update FS_INFO on IOC device\n", __FUNCTION__ );
-            return -1;
-        }
-    }
-
-#if DEBUG_FATFS_SYNC_FSINFO
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_SYNC_FSINFO < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-
-    return 0;
-
-}  // end fatfs_check_free_info()
-
-
-
-
-
-///////////////////////////////////////////////////////////////////////////////////////
-// Generic API : the following functions are called by the kernel VFS
-//               and must be defined by all supported file systems.
-///////////////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////
-xptr_t  fatfs_ctx_alloc( cxy_t  cxy )
-{
-    // allocate memory from remote cluster
-    void * ptr = kmem_remote_alloc( cxy,
-                                    bits_log2(sizeof(fatfs_ctx_t)),
-                                    AF_ZERO );
-
-    if( ptr == NULL ) return XPTR_NULL;
-    else              return XPTR( cxy , ptr );
-
-}  //end faffs_ctx_alloc()
-
-///////////////////////////////////////////////
-error_t  fatfs_ctx_init( xptr_t  fatfs_ctx_xp )
-{
-    error_t       error;
-    cxy_t         cxy;             // FATFS context cluster identifier
-    fatfs_ctx_t * fatfs_ctx_ptr;   // local pointer on FATFS context
-    uint8_t     * buffer;          // local pointer on 512 bytes buffer
-    xptr_t        buffer_xp;       // extended pointer on 512 bytes buffer
-    xptr_t        fat_mapper_xp;   // extended pointer on FAT mapper
-    mapper_t    * fat_mapper;      // local pointer on FAT mapper
-
-    // get FATFS context cluster and local pointer
-    cxy           = GET_CXY( fatfs_ctx_xp );        
-    fatfs_ctx_ptr = GET_PTR( fatfs_ctx_xp );
-    
-#if DEBUG_FATFS_CTX_INIT
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_CTX_INIT < cycle )
-printk("\n[%s] thread[%x,%x] enter for fatfs_ctx (%x,%x) / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cxy, fatfs_ctx_ptr , cycle );
-#endif
-
-    // allocate a 512 bytes buffer in remote cluster, used to store
-    // temporarily the BOOT sector, and permanently the FS_INFO sector
-	buffer = kmem_remote_alloc( cxy, 
-                                9,
-                                AF_ZERO );
-    if( buffer == NULL ) 
-    {
-        printk("\n[PANIC] in %s : cannot allocate buffer in cluster %x\n",
-        __FUNCTION__ , cxy );
-        return -1;
-    }
-     
-    // build extended pointer on buffer
-    buffer_xp = XPTR( cxy , buffer );
-
-    // load the BOOT record from device
-    error = dev_ioc_sync_read( buffer_xp , 0 , 1 );
-
-    if ( error )
-    {
-        printk("\n[PANIC] in %s : cannot access boot record\n", __FUNCTION__ );
-        return -1;
-    }
-
-#if (DEBUG_FATFS_CTX_INIT & 0x1)
-uint8_t bs[256];
-hal_remote_memcpy( XPTR( local_cxy , bs ) , buffer_xp , 256 );
-if( DEBUG_FATFS_CTX_INIT < cycle )
-putb( "boot record", bs , 256 );
-#endif
-
-    // get sector size from boot record
-    uint32_t sector_size = fatfs_get_remote_record( BPB_BYTSPERSEC , buffer_xp );
-
-    if ( sector_size != 512 )
-    {
-        printk("\n[PANIC] in %s : sector size must be 512 bytes\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get cluster size from boot record
-    uint32_t nb_sectors = fatfs_get_remote_record( BPB_SECPERCLUS , buffer_xp );
-
-    if ( nb_sectors != 8 )
-    {
-        printk("\n[PANIC] in %s : cluster size must be 8 sectors\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get number of FAT copies from boot record
-    uint32_t nb_fats = fatfs_get_remote_record( BPB_NUMFATS , buffer_xp );
-
-    if ( nb_fats != 1 )
-    {
-        printk("\n[PANIC] in %s : number of FAT copies must be 1\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get number of sectors in FAT from boot record
-    uint32_t fat_sectors = fatfs_get_remote_record( BPB_FAT32_FATSZ32 , buffer_xp );
-
-    if ( (fat_sectors & 0xF) != 0 )
-    {
-        printk("\n[PANIC] in %s : FAT size not multiple of 16 sectors\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get root cluster from boot record
-    uint32_t root_cluster = fatfs_get_remote_record( BPB_FAT32_ROOTCLUS , buffer_xp );
-
-    if ( root_cluster != 2 ) 
-    {
-        printk("\n[PANIC] in %s : root cluster index must be 2\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get FAT lba from boot record
-    uint32_t fat_lba = fatfs_get_remote_record( BPB_RSVDSECCNT , buffer_xp );
-
-    // get FS_INFO sector lba from boot record
-    uint32_t fs_info_lba = fatfs_get_remote_record( BPB_FAT32_FSINFO , buffer_xp );
-
-    // load the FS_INFO record from device
-    error = dev_ioc_sync_read( buffer_xp , fs_info_lba , 1 );
-
-    if ( error )
-    {
-        printk("\n[PANIC] in %s : cannot access FS_INFO record\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get free_clusters number from FS_INFO record
-    uint32_t free_clusters = fatfs_get_remote_record( FS_FREE_CLUSTERS , buffer_xp );
-
-    if ( free_clusters >= fat_sectors << 7 )
-    {
-        printk("\n[PANIC] in %s : unconsistent free_clusters\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // get free_cluster_hint from FS_INFO record
-    uint32_t free_hint = fatfs_get_remote_record( FS_FREE_CLUSTER_HINT , buffer_xp );
-
-    if ( free_hint >= fat_sectors << 7 )
-    {
-        printk("\n[PANIC] in %s : unconsistent free_cluster_hint\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // allocate a mapper for the FAT in remote cluster
-    fat_mapper_xp  = mapper_create( cxy , FS_TYPE_FATFS );
-
-    // get local pointer on FAT mapper
-    fat_mapper = GET_PTR( fat_mapper_xp );
-
-    if ( fat_mapper == NULL )
-    {
-        printk("\n[PANIC] in %s : no memory for FAT mapper in cluster %x\n",
-        __FUNCTION__ , cxy );
-        return -1;
-    }
-
-#if (DEBUG_FATFS_CTX_INIT & 0x1)
-if( DEBUG_FATFS_CTX_INIT < cycle )
-printk("\n[%s] sector_size %d / nb_sectors %d / fat_sectors %x / hint %x\n",
-__FUNCTION__, sector_size, nb_sectors, fat_sectors, free_hint );
-#endif
-
-    // the inode field is NULL for the FAT mapper
-    hal_remote_spt( XPTR( cxy , &fat_mapper->inode ) , NULL );
-
-    // initialize the FATFS context
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->fat_begin_lba       ), fat_lba );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->fat_sectors_count   ), fat_sectors );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->bytes_per_sector    ), sector_size );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->sectors_per_cluster ), nb_sectors );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->cluster_begin_lba   ), fat_lba + fat_sectors );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->root_dir_cluster    ), 2 );
-    hal_remote_spt( XPTR( cxy , &fatfs_ctx_ptr->fat_mapper          ), fat_mapper );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->fs_info_lba         ), fs_info_lba );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->free_clusters       ), free_clusters );
-    hal_remote_s32( XPTR( cxy , &fatfs_ctx_ptr->free_cluster_hint   ), free_hint );
-    hal_remote_spt( XPTR( cxy , &fatfs_ctx_ptr->fs_info_buffer      ), buffer );
-
-    // initialize FATFS lock
-    remote_rwlock_init( XPTR( cxy , &fatfs_ctx_ptr->lock ) , LOCK_FATFS_FAT );
-
-#if DEBUG_FATFS_CTX_INIT
-if( DEBUG_FATFS_CTX_INIT < cycle )
-printk("\n[%s]  thread[%x,%x] exit for fatfs_ctx (%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, cxy, fatfs_ctx_ptr );
-#endif
-
-	return 0;
-
-}  // end fatfs_ctx_init()
-
-//////////////////////////////////////////////
-void fatfs_ctx_destroy( xptr_t  fatfs_ctx_xp )
-{
-    mapper_t   * fat_mapper;
-    uint8_t    * fs_info_buffer;
-
-    // get FATFS context cluster and local pointer
-    fatfs_ctx_t * fatfs_ctx_ptr = GET_PTR( fatfs_ctx_xp );
-    cxy_t         fatfs_ctx_cxy = GET_CXY( fatfs_ctx_xp );
-
-    // get pointer on FAT mapper
-    fat_mapper = hal_remote_lpt( XPTR( fatfs_ctx_cxy , &fatfs_ctx_ptr->fat_mapper ) );
-
-    // release FAT mapper
-    mapper_destroy( XPTR( fatfs_ctx_cxy , fat_mapper ) );
-
-    // get pointer on FS_INFO buffer
-    fs_info_buffer = hal_remote_lpt( XPTR( fatfs_ctx_cxy , &fatfs_ctx_ptr->fs_info_buffer ) );
-
-    // release FS_INFO buffer (512 bytes)
-    kmem_remote_free( fatfs_ctx_cxy,
-                      fs_info_buffer,
-                      9 );               
-
-    // release FATFS context descriptor
-    kmem_remote_free( fatfs_ctx_cxy,
-                      fatfs_ctx_ptr,
-                      bits_log2(sizeof(fatfs_ctx_t)) );
-
-}  // end fatfs_ctx_destroy()
-
-/////////////////////////////////////////////////////////
-error_t fatfs_add_dentry( xptr_t         parent_inode_xp,
-                          vfs_dentry_t * dentry_ptr )
-{
-    error_t       error;
-    vfs_inode_t * parent_inode_ptr;   // parent inode local pointer
-    cxy_t         parent_cxy;         // pparent inode cluster
-    xptr_t        child_inode_xp;     // extended pointer on child inode 
-    cxy_t         child_cxy;          // child inode cluster
-    vfs_inode_t * child_inode_ptr;    // child inode local pointer
-    uint32_t      length;             // dentry name length
-    uint32_t      nb_lfn;             // number or required LFN
-    char          sfn[11];            // buffer for SFN name
-    uint8_t       checksum;           // name checksum 
-    mapper_t    * mapper_ptr;         // local pointer on parent directory mapper
-    xptr_t        mapper_xp;          // extended pointer on parent directory mapper
-    uint32_t      size;               // child inode size
-    uint32_t      type;               // child inode type
-    void        * extend;             // child inode extension
-    uint32_t      cluster_id;         // child inode first cluster_id in FATFS 
-
-    char          child_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    uint8_t       buf[32];            // local buffer for one FAT32 directory entry
- 
-// check arguments
-assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
-assert( __FUNCTION__, (dentry_ptr      != NULL)      , "dentry_ptr argument is NULL\n" );
-
-    // get directory inode cluster and local pointer 
-    parent_cxy       = GET_CXY( parent_inode_xp );
-    parent_inode_ptr = GET_PTR( parent_inode_xp );
-
-    // get extended pointers on child inode
-    child_inode_xp  = hal_remote_l64( XPTR( parent_cxy , &dentry_ptr->child_xp ) );
-    child_cxy       = GET_CXY( child_inode_xp );
-    child_inode_ptr = GET_PTR( child_inode_xp );
-
-    // get a local copy of the child name
-    vfs_inode_get_name( child_inode_xp  , child_name );
-
-#if DEBUG_FATFS_ADD_DENTRY
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-char       parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( parent_inode_xp , parent_name );
-if( DEBUG_FATFS_ADD_DENTRY < cycle )
-printk("\n[%s]  thread[%x,%x] enter for <%s> in <%s> directory / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name, cycle );
-#endif
-
-    // get pointers on parent directory mapper
-    mapper_ptr = hal_remote_lpt( XPTR( parent_cxy , &parent_inode_ptr->mapper ) );
-    mapper_xp  = XPTR( parent_cxy , mapper_ptr );
-
-#if (DEBUG_FATFS_ADD_DENTRY & 1)
-mapper_display_page( mapper_xp , 0 , 512 );
-#endif
-
-    // get relevant infos from child inode
-    type       = hal_remote_l32( XPTR( child_cxy , &child_inode_ptr->type ) );
-    size       = hal_remote_l32( XPTR( child_cxy , &child_inode_ptr->size ) );
-    extend     = hal_remote_lpt( XPTR( child_cxy , &child_inode_ptr->extend ) );
-    cluster_id = (uint32_t)(intptr_t)extend;
-
-    // analyse child name
-    error = fatfs_name_format( child_name,
-                               &length,
-                               &nb_lfn,
-                               sfn,
-                               &checksum );
-    if ( error )
-    {
-        printk("\n[ERROR] in %s : dentry name > 31 bytes\n", __FUNCTION__ );
-        return -1;
-    }
-                               
-    // Search end of directory with two embedded loops:
-    // - scan the pages in the mapper
-    // - scan the entries in each page to find NO_MORE_ENTRY
-
-    xptr_t     page_xp;                 // extended pointer on page descriptor
-    xptr_t     base_xp;                 // extended pointer on page base
-
-    // initialise loop variables
-    uint32_t   page_id = 0;             // page index in mapper
-    uint32_t   offset  = 0;             // position in page
-    uint32_t   found   = 0;             // NO_MORE_ENTRY found
-
-    // loop on pages in mapper
-    while ( found == 0 )
-    {
-        // get extended pointer on page descriptor in mapper 
-        page_xp  = mapper_get_page( mapper_xp , page_id );
-
-        if ( page_xp == XPTR_NULL )
-        {
-            printk("\n[ERROR] in %s : cannot extend directory mapper\n",
-            __FUNCTION__ );
-            return -1;
-        }
-        
-        // get pointer on page base
-        base_xp = ppm_page2base( page_xp );
-
-        // loop on directory entries in this page
-        while ( (offset < 4096) && (found == 0) )
-        {
-            if ( fatfs_get_remote_record( LDIR_ORD, (base_xp + offset) ) == NO_MORE_ENTRY )
-            {
-                found = 1;
-            }  
-            else
-            {
-                offset = offset + 32;
-            }
-        }  // end loop on entries
-
-        if ( found == 0 )
-        {
-            page_id++;
-            offset = 0;
-        }
-    }  // end loop on pages
-
-#if (DEBUG_FATFS_ADD_DENTRY & 1)
-if( DEBUG_FATFS_ADD_DENTRY < cycle )
-printk("\n[%s]  thread[%x,%x] found NO_MORE_ENTRY : page_id %d / offset %d\n",
-__FUNCTION__, this->process->pid, this->trdid, page_id, offset );
-#endif
-
-    // Modify the directory mapper: depending on the name length,
-    // the new child requires to write (3, 4, or 5) directory entries.
-    // We build one complete directory entry in a local buffer
-    // before copying it the remote mapper. We use use a 5 steps FSM 
-    // (one state per entry to be written), that is traversed as :
-    // LFN3 -> LFN2 -> LFN1 -> NORMAL -> NOMORE 
-    // At most two pages are modified:
-    // - the page containing the NO_MORE_ENTRY is always modified
-    // - the following page can be modified if the name spread on two pages.
-
-    uint32_t step;          // FSM state
-
-    if      ( nb_lfn == 1 ) step = 3;
-    else if ( nb_lfn == 2 ) step = 4;
-    else if ( nb_lfn == 3 ) step = 5;
-    
-    uint32_t   i;           // byte index in one 32 bytes directory
-    uint32_t   c;           // character index in name
-
-    while ( step )   
-    {
-        // this block is only executed when the new name spread 
-        // on two pages, and we need to access a new page in mapper
-        if ( offset >= 4096 )
-        {
-            // copy the modified page to IOC device
-            error = fatfs_move_page( page_xp , IOC_SYNC_WRITE );   
-
-            if ( error )
-            {
-                printk("\n[ERROR] in %s : cannot update directory on device\n",
-                __FUNCTION__ );
-                return -1;
-            }
-
-            // get the next page in directory mapper
-            page_xp  = mapper_get_page( mapper_xp , page_id + 1 );
-
-            if ( page_xp == XPTR_NULL )
-            {
-                printk("\n[ERROR] in %s : cannot extend directory mapper\n",
-                __FUNCTION__ );
-                return -1;
-            }
-        
-            // get pointer on page base
-            base_xp = ppm_page2base( page_xp );
-            
-            // update offset
-            offset = 0;
-        }
-
-#if (DEBUG_FATFS_ADD_DENTRY & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_ADD_DENTRY < cycle )
-printk("\n[%s] FSM step = %d / offset = %x / nb_lfn = %d / cycle %d\n",
-__FUNCTION__, step, offset, nb_lfn, cycle );
-#endif
-
-        // write one FATFS directory entry (32 bytes) per iteration
-        switch ( step )
-        {
-            case 5:   // write LFN3 entry
-            {
-                c = 26;
-
-                // write 32 bytes in local buf
-                for ( i = 0 ; i < 32 ; i++ )
-                {
-                    if (i == 0)
-                    {
-                        if ( nb_lfn == 3) buf[i] = 0x43;
-                        else              buf[i] = 0x03;
-                    }
-                    else if ( ( ((i >= 1 ) && (i<=10) && ((i&1)==1))   ||
-                                ((i >= 14) && (i<=25) && ((i&1)==0))   ||
-                                ((i >= 28) && (i<=31) && ((i&1)==0)) ) &&
-                              ( c < length ) )
-                    {
-                                          buf[i] = child_name[c];
-                                          c++;
-                    }
-                    else if (i == 11)     buf[i] = 0x0F;
-                    else if (i == 13)     buf[i] = checksum;
-                    else                  buf[i] = 0x00;
-                }
-
-                // copy 32 bytes from local buffer to remote mapper
-                hal_remote_memcpy( base_xp + offset , XPTR( local_cxy  , buf ) , 32 );
-
-                step--;
-                break;
-            }
-            case 4:   // write LFN2 entry  
-            {
-                c = 13;
-
-                // write 32 bytes in local buf
-                for ( i = 0 ; i < 32 ; i++ )
-                {
-                    if (i == 0)
-                    {
-                        if ( nb_lfn == 2) buf[i] = 0x42;
-                        else              buf[i] = 0x02;
-                    }
-                    else if ( ( ((i >= 1 ) && (i<=10) && ((i&1)==1))   ||
-                                ((i >= 14) && (i<=25) && ((i&1)==0))   ||
-                                ((i >= 28) && (i<=31) && ((i&1)==0)) ) &&
-                              ( c < length ) )
-                    {
-                                          buf[i] = child_name[c];
-                                          c++;
-                    }
-                    else if (i == 11)     buf[i] = 0x0F;
-                    else if (i == 13)     buf[i] = checksum;
-                    else                  buf[i] = 0x00;
-                }
-
-                // copy 32 bytes from local buffer to remote mapper
-                hal_remote_memcpy( base_xp + offset , XPTR( local_cxy  , buf ) , 32 );
-
-                step--;
-                break;
-            }
-            case 3:   // Write LFN1 entry   
-            {
-                c = 0;
-
-                // write 32 bytes in local buf
-                for ( i = 0 ; i < 32 ; i++ )
-                {
-                    if (i == 0)
-                    {
-                        if ( nb_lfn == 1) buf[i] = 0x41;
-                        else              buf[i] = 0x01;
-                    }
-                    else if ( ( ((i >= 1 ) && (i<=10) && ((i&1)==1))   ||
-                                ((i >= 14) && (i<=25) && ((i&1)==0))   ||
-                                ((i >= 28) && (i<=31) && ((i&1)==0)) ) &&
-                              ( c < length ) )
-                    {
-                                          buf[i] = child_name[c];
-                                          c++;
-                    }
-                    else if (i == 11)     buf[i] = 0x0F;
-                    else if (i == 13)     buf[i] = checksum;
-                    else                  buf[i] = 0x00;
-                }
-
-                // copy 32 bytes from local buffer to remote mapper
-                hal_remote_memcpy( base_xp + offset , XPTR( local_cxy  , buf ) , 32 );
-
-                step--;
-                break;
-            }
-            case 2:   // write NORMAL entry     
-            {
-                // write 32 bytes in local buf
-                for ( i = 0 ; i < 32 ; i++ )
-                {
-                    if      ( i < 11 )                               // 8.3 SFN
-                    {
-                                          buf[i] = sfn[i];
-                    }
-                    else if (i == 11)                                // ATTR
-                    {
-                        if (type == FILE_TYPE_DIR)  buf[i] = 0x10;
-                        else                         buf[i] = 0x20;
-                    }
-                    else if (i == 20)     buf[i] = cluster_id>>16;   // cluster.B2
-                    else if (i == 21)     buf[i] = cluster_id>>24;   // cluster.B3
-                    else if (i == 26)     buf[i] = cluster_id>>0;    // cluster.B0
-                    else if (i == 27)     buf[i] = cluster_id>>8;    // cluster.B1
-                    else if (i == 28)     buf[i] = size>>0;          // size.B0
-                    else if (i == 29)     buf[i] = size>>8;          // size.B1
-                    else if (i == 30)     buf[i] = size>>16;         // size.B2
-                    else if (i == 31)     buf[i] = size>>24;         // size.B3
-                    else                  buf[i] = 0x00;
-                }
-
-                // copy 32 bytes from local buffer to remote mapper
-                hal_remote_memcpy( base_xp + offset , XPTR( local_cxy  , buf ) , 32 );
-
-                // set the dentry "extend" field 
-                hal_remote_spt( XPTR( parent_cxy , &dentry_ptr->extend ),
-                                (void *)(intptr_t)(((page_id << 12) + offset) >> 5 ) );
-                step--;
-                break;
-            }
-            case 1:   // write NOMORE entry  
-            {
-                hal_remote_s32( base_xp + offset , 0 );
-
-                step--;
-                break;
-            }
-
-        } // end switch step
-
-        offset += 32;
-
-    } // end while     
-
-    // copy the modified page to the IOC device
-    error = fatfs_move_page( page_xp , IOC_SYNC_WRITE );   
-
-    if ( error )
-    {
-        printk("\n[ERROR] in %s : cannot update directory on device\n",
-        __FUNCTION__ );
-        return -1;
-    }
-
-#if DEBUG_FATFS_ADD_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_ADD_DENTRY < cycle )
-printk("\n[%s]  thread[%x,%x] exit for <%s> in <%s> directory\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name );
-#endif
-
-#if (DEBUG_FATFS_ADD_DENTRY & 1)
-mapper_display_page( mapper_xp , 0 , 512 );
-#endif
-
-    return 0;
-
-}  // end fatfs_add_dentry()
-
-////////////////////////////////////////////////////////////
-error_t fatfs_remove_dentry( xptr_t         parent_inode_xp,
-                             vfs_dentry_t * dentry_ptr )
-{
-    error_t       error;
-    vfs_inode_t * parent_inode_ptr;   // parent inode local pointer
-    cxy_t         parent_cxy;         // pparent inode cluster
-    xptr_t        child_inode_xp;     // extended pointer on child inode 
-    cxy_t         child_cxy;          // child inode cluster
-    vfs_inode_t * child_inode_ptr;    // child inode local pointer
-    xptr_t        mapper_xp;          // extended pointer on mapper
-    mapper_t    * mapper_ptr;         // local pointer on mapper
-    xptr_t        page_xp;            // extended pointer on mapper page descriptor
-    xptr_t        base_xp;            // extended pointer on mapper page base
-    uint32_t      dentry_id;          // FAT32 directory entry index
-    uint32_t      page_id;            // page index in directory mapper
-    uint32_t      offset;             // offset in this mapper page
-
-    char          child_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-// check arguments
-assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
-assert( __FUNCTION__, (dentry_ptr      != NULL)      , "dentry_ptr argument is NULL\n" );
-
-    // get directory inode cluster and local pointer 
-    parent_cxy       = GET_CXY( parent_inode_xp );
-    parent_inode_ptr = GET_PTR( parent_inode_xp );
-
-    // get extended pointers on child inode
-    child_inode_xp  = hal_remote_l64( XPTR( parent_cxy , &dentry_ptr->child_xp ) );
-    child_cxy       = GET_CXY( child_inode_xp );
-    child_inode_ptr = GET_PTR( child_inode_xp );
-
-    // get a local copy of the child name
-    vfs_inode_get_name( child_inode_xp  , child_name );
-
-#if DEBUG_FATFS_REMOVE_DENTRY
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-char       parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( parent_inode_xp , parent_name );
-if( DEBUG_FATFS_REMOVE_DENTRY < cycle )
-printk("\n[%s]  thread[%x,%x] enter for <%s> in <%s> directory / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name, cycle );
-#endif
-
-    // get pointers on directory mapper
-    mapper_ptr = hal_remote_lpt( XPTR( parent_cxy , &parent_inode_ptr->mapper ) );
-    mapper_xp  = XPTR( parent_cxy , mapper_ptr );
-
-    // compute number of LFN entries
-    uint32_t nb_lfn;
-    uint32_t name_length = strlen( child_name );
-
-    if      ( name_length <= 13 ) nb_lfn  = 1;
-    else if ( name_length <= 26 ) nb_lfn  = 2;
-    else                          nb_lfn  = 3;
-
-    // We must invalidate (2,3,4) 32 bytes entries:
-    // - the NORMAL entry, registered in dentry->extend.
-    // - the (1,2,3) preceding LFN entries.
-    // At most two pages are modified:
-    // - the page containing the NORMAL entry is always modified.
-    // - the preceding page is modified when the name spread on two pages. 
-
-    // get NORMAL entry index from dentry extension 
-    dentry_id  = (uint32_t)(intptr_t)hal_remote_lpt( XPTR( parent_cxy , &dentry_ptr->extend ) ); 
-
-    // get page index and offset in parent directory mapper
-    page_id  = dentry_id >> 7;
-    offset   = (dentry_id & 0x7F)<<5;
-
-#if DEBUG_FATFS_REMOVE_DENTRY & 1
-if( DEBUG_FATFS_REMOVE_DENTRY < cycle )
-printk("\n[%s] dentry_id %x / page_id %x / offset %x\n",
-__FUNCTION__, dentry_id, page_id, offset );
-#endif
-
-    // get extended pointer on page descriptor 
-    page_xp  = mapper_get_page( mapper_xp , page_id );
-
-    if ( page_xp == XPTR_NULL )
-    {
-        printk("\n[ERROR] in %s : cannot access directory mapper\n", __FUNCTION__ );
-        return -1;
-    }
-        
-    // get extended pointer on page base
-    base_xp = ppm_page2base( page_xp );
-
-    // invalidate NORMAL entry in directory cache
-    hal_remote_sb( base_xp + offset , 0xE5 );
-
-    // invalidate LFN entries
-    while ( nb_lfn )
-    {
-        // this block is only executed when the removed name
-        // spread on two mapper pages
-        if (offset == 0)  // we must load page (page_id - 1)
-        {
-            // copy the modified page to the IOC device
-            error = fatfs_move_page( page_xp , IOC_SYNC_WRITE );   
-
-            if ( error )
-            {
-                printk("\n[ERROR] in %s : cannot update directory on device\n",
-                __FUNCTION__ );
-                return -1;
-            }
-
-            // get extended pointer on page descriptor 
-            page_xp  = mapper_get_page( mapper_xp , page_id );
-
-            if ( page_xp == XPTR_NULL )
-            {
-                printk("\n[ERROR] in %s : cannot access directory mapper\n", __FUNCTION__ );
-                return -1;
-            }
-        
-            // get extended pointer on page base
-            base_xp = ppm_page2base( page_xp );
-
-            // update offset
-            offset = 4096;
-        }
-
-        offset = offset - 32;
-
-// check for LFN entry
-assert( __FUNCTION__, (fatfs_get_remote_record( DIR_ATTR, base_xp + offset ) == ATTR_LONG_NAME_MASK ),
-"this directory entry must be a LFN\n");
-
-        // invalidate LFN entry
-        hal_remote_sb( base_xp + offset , 0xE5 );
-
-        nb_lfn--;
-    }     
-
-    // copy the modified page to the IOC device
-    error = fatfs_move_page( page_xp , IOC_SYNC_WRITE );   
-    
-    if ( error )
-    {
-        printk("\n[ERROR] in %s : cannot update directory on device\n",
-        __FUNCTION__ );
-        return -1;
-    }
-
-#if DEBUG_FATFS_REMOVE_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_REMOVE_DENTRY < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> in <%s> directory\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name );
-#endif
-
-    return 0;
-
-}  // end fatfs_remove_dentry
-
-/////////////////////////////////////////////////////////////////////
-error_t fatfs_new_dentry_from_mapper( xptr_t         parent_inode_xp,
-                                      vfs_dentry_t * dentry_ptr )
-{
-    uint32_t       cluster_id;        // directory entry first FATFS cluster
-    uint32_t       size;              // directory entry size
-    bool_t         is_dir;            // directory entry type (file/dir)
-    cxy_t          parent_cxy;        // parent inode cluster  
-    vfs_inode_t  * parent_inode_ptr;  // parent inode local pointer
-    mapper_t     * parent_mapper;     // pointer on parent directory mapper
-    xptr_t         child_inode_xp;    // extended pointer on child inode
-    cxy_t          child_cxy;         // child inode cluster  
-    vfs_inode_t  * child_inode_ptr;   // child inode local pointer
-    error_t        error;
-
-    uint8_t        buf[32];           // FAT32 directory entry local copy
-
-    char           parent_name[CONFIG_VFS_MAX_NAME_LENGTH];     // local parent name copy
-    char           child_name[CONFIG_VFS_MAX_NAME_LENGTH];      // local child name copy
-
-// check arguments
-assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL)  , "parent_inode_xp is NULL\n" );
-assert( __FUNCTION__, (dentry_ptr      != NULL ) , "dentry_ptr is NULL\n" );
-
-    // get parent inode cluster and local pointer
-    parent_cxy       = GET_CXY( parent_inode_xp );
-    parent_inode_ptr = GET_PTR( parent_inode_xp );
-
-    // get child inode cluster and pointers
-    child_inode_xp  = hal_remote_l64( XPTR( parent_cxy , &dentry_ptr->child_xp ) );
-    child_cxy       = GET_CXY( child_inode_xp );
-    child_inode_ptr = GET_PTR( child_inode_xp );
-
-    // get child and parent names
-    vfs_inode_get_name( parent_inode_xp , parent_name );
-    vfs_inode_get_name( child_inode_xp  , child_name );
-
-#if DEBUG_FATFS_NEW_DENTRY_FROM
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_NEW_DENTRY_FROM < cycle )
-printk("\n[%s]  thread[%x,%x] enter for child <%s> in parent <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name , parent_name , cycle );
-#endif
-
-    // get local pointer on parent mapper
-    parent_mapper = hal_remote_lpt( XPTR( parent_cxy , &parent_inode_ptr->mapper ) );
-
-    // try to get pointer and index of directory entry in mapper 
-    uint8_t      * entry = NULL;
-    uint32_t       index = 0;
-
-    error  = fatfs_scan_directory( XPTR( parent_cxy , parent_mapper ),
-                                   child_name, 
-                                   &entry,
-                                   &index );
-    
-    // an error can be non fatal, for a new (created) entry
-    if( error )  return -1;
-
-    // get local copy of found directory entry
-    hal_remote_memcpy( XPTR( local_cxy  , buf ),
-                       XPTR( parent_cxy , entry ), 32 );
-
-    // get relevant infos from directory entry
-    cluster_id = (fatfs_get_record( DIR_FST_CLUS_HI , buf ) << 16) |
-                 (fatfs_get_record( DIR_FST_CLUS_LO , buf )      ) ;
-    is_dir     = (fatfs_get_record( DIR_ATTR        , buf ) & ATTR_DIRECTORY );
-    size       =  fatfs_get_record( DIR_FILE_SIZE   , buf );
-
-    // update the child inode "type", "size", and "extend" fields
-    vfs_file_type_t type = (is_dir) ? FILE_TYPE_DIR : FILE_TYPE_REG;
-
-    hal_remote_s32( XPTR( child_cxy , &child_inode_ptr->type   ) , type );
-    hal_remote_s32( XPTR( child_cxy , &child_inode_ptr->size   ) , size );
-    hal_remote_s32( XPTR( child_cxy , &child_inode_ptr->extend ) , cluster_id );
-
-    // update the dentry "extend" field
-    hal_remote_spt( XPTR( parent_cxy , &dentry_ptr->extend ) , (void *)(intptr_t)index );
-
-#if DEBUG_FATFS_NEW_DENTRY_FROM
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_NEW_DENTRY_FROM < cycle )
-printk("\n[%s]  thread[%x,%x] exit for <%s> in <%s> / cluster_id %x / size %d\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name, cluster_id, size );
-#endif
-
-#if (DEBUG_FATFS_NEW_DENTRY_FROM & 1)
-if( DEBUG_FATFS_NEW_DENTRY_FROM < cycle )
-fatfs_display_fat( cluster_id , 32 );
-#endif
-
-    return 0;
-
-}  // end fatfs_new_dentry_from_mapper()
-
-///////////////////////////////////////////////////////////////////
-error_t fatfs_new_dentry_to_mapper( xptr_t         parent_inode_xp,
-                                    vfs_dentry_t * dentry_ptr )
-{
-    uint32_t       cluster_id;        // directory entry cluster
-    cxy_t          parent_cxy;        // parent inode cluster identifier  
-    vfs_inode_t  * parent_inode_ptr;  // child inode local pointer
-    xptr_t         child_inode_xp;    // extended pointer on child inode
-    cxy_t          child_cxy;         // child inode cluster identifier  
-    vfs_inode_t  * child_inode_ptr;   // child inode local pointer
-    error_t        error;
-
-    char           parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-    char           child_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-// check arguments
-assert( __FUNCTION__, (parent_inode_xp != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
-assert( __FUNCTION__, (dentry_ptr      != NULL)      , "dentry_ptr argument NULL\n" );
-
-    // get child inode cluster and local pointer
-    parent_cxy       = GET_CXY( parent_inode_xp );
-    parent_inode_ptr = GET_PTR( parent_inode_xp );
-
-    // get child inode cluster and pointers
-    child_inode_xp  = hal_remote_l64( XPTR( parent_cxy , &dentry_ptr->child_xp ) );
-    child_cxy       = GET_CXY( child_inode_xp );
-    child_inode_ptr = GET_PTR( child_inode_xp );
-
-    // get child and parent names
-    vfs_inode_get_name( parent_inode_xp , parent_name );
-    vfs_inode_get_name( child_inode_xp  , child_name );
-
-#if DEBUG_FATFS_NEW_DENTRY_TO_MAP
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_NEW_DENTRY_TO_MAP < cycle )
-printk("\n[%s]  thread[%x,%x] enter for child <%s> in parent <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name , parent_name , cycle );
-#endif
-
-    // 1. allocate one FATFS cluster (update FAT and FSINFO) 
-    error = fatfs_cluster_alloc( 0 , &cluster_id );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot find a free cluster_id\n",
-        __FUNCTION__ );
-        return -1;
-    }
-       
-    // 2. register cluster_id in inode descriptor
-    hal_remote_spt( XPTR( child_cxy , &child_inode_ptr->extend ),
-                    (void*)(intptr_t)cluster_id );
-    
-    // 3. introduce dentry in the directory mapper
-    error = fatfs_add_dentry( parent_inode_xp , dentry_ptr );
-        
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot update parent directory mapper\n",
-        __FUNCTION__ );
-        // TODO release cluster_id [AG]
-        return -1;
-    }
-
-#if DEBUG_FATFS_NEW_DENTRY_TO_MAP
-if( DEBUG_FATFS_NEW_DENTRY_TO_MAP < cycle )
-printk("\n[%s]  thread[%x,%x] exit for <%s> in <%s> / cluster_id %x\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name, cluster_id );
-#endif
-
-    return 0;
-
-}  // end fatfs_new_dentry_to mapper()
-
-
-////////////////////////////////////////////////////////////
-error_t fatfs_update_dentry( xptr_t         parent_inode_xp,
-                             vfs_dentry_t * dentry_ptr )
-{
-    cxy_t         parent_cxy;        // parent directory cluster identifier
-    vfs_inode_t * parent_inode_ptr;  // extended pointer on parent directory inode
-    mapper_t    * parent_mapper_ptr; // local pointer on parent directory mapper
-    xptr_t        parent_mapper_xp;  // extended pointer on parent directory mapper
-    xptr_t        child_inode_xp;    // extended pointer on child inode
-    cxy_t         child_cxy;         // child inode cluster identifier
-    vfs_inode_t * child_inode_ptr;   // extended pointer on child inode
-
-    uint32_t      current_size;      // current size in directory mapper 
-    uint32_t      new_size;          // new size (from child inode) 
-    
-    uint32_t      entry_id;          // directory entry index in parent directory mapper
-    uint32_t      page_id;           // page_index in parent directory mapper
-    uint32_t      offset;            // directory entry offset in page
-    xptr_t        page_xp;           // extended pointer on page descriptor
-    xptr_t        base_xp;           // extended pointer on page base 
-    xptr_t        entry_xp;          // extended pointer on directory entry
-
-    error_t       error;
-
-    char       parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-    char       child_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-// check arguments
-assert( __FUNCTION__, (parent_inode_xp  != XPTR_NULL) , "parent_inode_xp argument is NULL\n" );
-assert( __FUNCTION__, (dentry_ptr       != NULL)      , "dentry_ptr argument is NULL\n" );
-
-    // get parent directory cluster ans local pointer
-    parent_inode_ptr = GET_PTR( parent_inode_xp );
-    parent_cxy       = GET_CXY( parent_inode_xp );
-
-    // get extended pointer on child inode
-    child_inode_xp  = hal_remote_l64( XPTR( parent_cxy , &dentry_ptr->child_xp ) );
-
-    // get child and parent names
-    vfs_inode_get_name( parent_inode_xp , parent_name );
-    vfs_inode_get_name( child_inode_xp  , child_name );
-
-#if DEBUG_FATFS_UPDATE_DENTRY
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_UPDATE_DENTRY < cycle )
-printk("\n[%s]  thread[%x,%x] enter for <%s> in <%s> / new_size %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, child_name, parent_name, new_size, cycle );
-#endif
-
-    // get child inode cluster and local pointer
-    child_cxy       = GET_CXY( child_inode_xp );
-    child_inode_ptr = GET_PTR( child_inode_xp );
- 
-    // get size from child inode
-    new_size = hal_remote_l32( XPTR( child_cxy , &child_inode_ptr->size ) );
- 
-    // get local and extended pointers on parent directory mapper
-    parent_mapper_ptr = hal_remote_lpt( XPTR( parent_cxy , &parent_inode_ptr->mapper ) );
-    parent_mapper_xp  = XPTR( parent_cxy , parent_mapper_ptr );
-
-    // get directory entry index from dentry extension
-    entry_id = (intptr_t)hal_remote_lpt( XPTR( parent_cxy , &dentry_ptr->extend ) );
-
-    // get page index and offset in parent directory mapper
-    page_id  = entry_id >> 7;
-    offset   = (entry_id & 0x7F) << 5;
-
-    // get extended pointers on page descriptor and page base
-    page_xp = mapper_get_page( parent_mapper_xp , page_id );     
-    base_xp = ppm_page2base( page_xp ); 
-
-    // build extended pointer on directory entry
-    entry_xp = base_xp + offset;
-
-    // get current size from directory mapper
-    current_size = fatfs_get_remote_record( DIR_FILE_SIZE , entry_xp );
-
-    // update dentry in mapper & device only if required
-    if( new_size != current_size )
-    {
-        // set size field in FAT32 directory entry
-        fatfs_set_remote_record( DIR_FILE_SIZE , entry_xp , new_size );
-
-        // synchronously update the modified mapper page on device
-        error = fatfs_move_page( page_xp , IOC_SYNC_WRITE );
-
-        if( error )
-        { 
-            printk("\n[ERROR] in %s : cannot update parent directory <%s> on device\n",
-            __FUNCTION__, parent_name );
-            return -1;
-        }
-    }
-
-#if DEBUG_FATFS_UPDATE_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_UPDATE_DENTRY < cycle )
-printk("\n[%s]  thread[%x,%x] exit for <%s> in <%s> directory / size %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, parent_name, child->name, new_size, cycle );
-#endif
-
-    return 0;
-
-}  // end fatfs_update_dentry()
-
-///////////////////////////////////////////////////////
-error_t fatfs_get_user_dir( struct vfs_inode_s * inode,
-                            struct dirent      * array, 
-                            uint32_t             max_dirent,
-                            uint32_t             min_dentry,
-                            bool_t               detailed,
-                            uint32_t           * entries,
-                            bool_t             * done )
-{
-    // Two embedded loops to scan the directory mapper:
-    // - scan the parent directory mapper pages starting always from page 0
-    // - scan the 32 bytes NORMAL/LFN directory entries in each page
-    // Only valid dentries are copied : dentry_id >= min_dentry && dirent_id < dirent_max
-
-#if DEBUG_FATFS_GET_USER_DIR
-char       inode_name[CONFIG_VFS_MAX_NAME_LENGTH];
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-vfs_inode_get_name( XPTR( local_cxy , inode ) , inode_name );
-if( DEBUG_FATFS_GET_USER_DIR < cycle )
-printk("\n[%s]  thread[%x,%x] enter for inode <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, inode_name , cycle );
-#endif
-
-    mapper_t * mapper    = inode->mapper;
-    xptr_t     mapper_xp = XPTR( local_cxy , mapper );
-
-// check mapper pointer
-assert( __FUNCTION__, (mapper != NULL) , "mapper is NULL\n");
-    
-// TODO handle the detailed flag
-assert( __FUNCTION__, (detailed == false), "detailed argument not supported/n");
-
-    char       cname[CONFIG_VFS_MAX_NAME_LENGTH];  // name extracted from each dentry
-
-    char       lfn1[16];           // buffer for one partial cname
-    char       lfn2[16];           // buffer for one partial cname
-    char       lfn3[16];           // buffer for one partial cname
-    xptr_t     page_xp;            // extended pointer on page descriptor
-    xptr_t     base_xp;            // extended pointer on page base
-    uint8_t  * base;               // local pointer on page base
-    uint8_t    attr;               // directory entry ATTR field
-    uint8_t    ord;                // directory entry ORD field
-    uint32_t   seq;                // sequence index
-    uint32_t   lfn       = 0;      // LFN entries number
-    uint32_t   offset    = 0;      // byte offset in page
-    uint32_t   page_id   = 0;      // page index in mapper
-    uint32_t   dentry_id = 0;      // valid (i.e. copied) dentry index in mapper 
-    uint32_t   dirent_id = 0;      // slot index in dirent array to initialize
-    bool_t     end       = false;  // true if end of directory found
-
-    // loop on mapper pages
-    while ( (end == false) && (dirent_id < max_dirent) )
-    {
-        // get one page from mapper
-        page_xp = mapper_get_page( mapper_xp , page_id );
-
-        if( page_xp == XPTR_NULL) return -1;
-
-        // get page base
-        base_xp = ppm_page2base( page_xp );
-        base    = (uint8_t *)GET_PTR( base_xp );
-
-#if (DEBUG_FATFS_GET_USER_DIR & 0x1)
-if( DEBUG_FATFS_GET_USER_DIR < cycle )
-mapper_display_page( mapper_xp , page_id , 256 );
-#endif 
-        // loop on NORMAL/LFN (32 bytes) directory entries in this page
-        while( (end == false) && (offset < 4096) )
-        {
-            // compute condition to copy one dentry to dirent array
-            bool_t valid = (dentry_id >= min_dentry) && (dirent_id <  max_dirent );
-
-            attr = fatfs_get_record( DIR_ATTR , base + offset );   
-            ord  = fatfs_get_record( LDIR_ORD , base + offset );   
-
-            if (ord == NO_MORE_ENTRY)                 // no more entry => break
-            {
-                end = true;
-            }
-            else if ( ord == FREE_ENTRY )             // free entry => skip
-            {
-                offset = offset + 32;
-            }
-            else if ( attr == 0x28 )                  // volune_id => skip
-            {
-                offset = offset + 32;
-            }
-            else if ( attr == ATTR_LONG_NAME_MASK )   // LFN entry
-            {
-                if( valid )
-                {
-                    // get partial cname
-                    seq = ord & 0x3;
-                    lfn = (seq > lfn) ? seq : lfn;   
-                    if      ( seq == 1 ) fatfs_get_name_from_long( base + offset, lfn1 );
-                    else if ( seq == 2 ) fatfs_get_name_from_long( base + offset, lfn2 );
-                    else if ( seq == 3 ) fatfs_get_name_from_long( base + offset, lfn3 );
-                }
-                offset = offset + 32;
-            }
-            else                                     // NORMAL entry
-            {
-                // increment dentry_id
-                dentry_id++;
-
-                if( valid )
-                {
-                    // build the complete cname
-                    if      ( lfn == 0 )
-                    {
-                        fatfs_get_name_from_short( base + offset , cname );
-                    }
-                    else if ( lfn == 1 )
-                    {
-                        strcpy( cname      , lfn1 );
-                    }   
-                    else if ( lfn == 2 ) 
-                    {
-                        strcpy( cname      , lfn1 );
-                        strcpy( cname + 13 , lfn2 );
-                    }
-                    else if ( lfn == 3 ) 
-                    {
-                        strcpy( cname      , lfn1 );
-                        strcpy( cname + 13 , lfn2 );
-                        strcpy( cname + 26 , lfn3 );
-                    }
-                    
-                    // copy cname into dirent array
-                    strcpy( array[dirent_id].d_name , cname ); 
-
-                    // increment dirent_id
-                    dirent_id++;
-                }
-                offset = offset + 32;
-                lfn    = 0;
-            }
-        }  // end loop on directory entries in page
-
-        page_id++;
-        offset = 0;
-
-    }  // end loop on pages
-
-    // return result of scan
-    *done    = end;
-    *entries = dirent_id;
-
-#if DEBUG_FATFS_GET_USER_DIR
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_GET_USER_DIR < cycle )
-printk("\n[%s]  thread[%x,%x] exit for inode <%s> / %d entries / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, inode_name, dirent_id, cycle );
-#endif
-
-    return 0;
-
-}  // end fatfs_get_user_dir()
-
-///////////////////////////////////////////
-error_t fatfs_sync_inode( xptr_t inode_xp )
-{
-    cxy_t         inode_cxy;      // remote inode cluster
-    vfs_inode_t * inode_ptr;      // remote inode local pointer
-    mapper_t    * mapper;         // remote inode mapper local pointer
-    uint32_t      size;           // remote inode size in bytes
-    uint32_t      type;           // remote inode type
-    xptr_t        rt_xp;          // extended pointer on mapper radix tree
-    uint32_t      npages;         // number of pages in mapper
-    uint32_t      page_id;        // current page index in mapper
-    xptr_t        page_xp;        // extended pointer on current page
-    page_t      * page_ptr;       // local pointer on current page
-    uint32_t      flags;          // current page flags
-    error_t       error;
-
-// check inode pointer and cluster index
-assert( __FUNCTION__, (inode_xp != XPTR_NULL)          , "inode pointer undefined\n" );
-
-#if DEBUG_FATFS_SYNC_INODE
-char       name[CONFIG_VFS_MAX_NAME_LENGTH];
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-vfs_inode_get_name( inode_xp , name );
-if( DEBUG_FATFS_SYNC_INODE < cycle )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, name, cycle );
-#endif
-
-    // get inode cluster and local pointer
-    inode_cxy = GET_CXY( inode_xp );
-    inode_ptr = GET_PTR( inode_xp );
-
-    //get inode mapper pointer
-    mapper    = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL\n" );     
-
-    // get inode type and size
-    size = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->size ) );
-    type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-
-assert( __FUNCTION__, (type == FILE_TYPE_REG) , "inode is not a file\n" );     
-
-    // compute number of pages
-    npages = size >> CONFIG_PPM_PAGE_ORDER;
-    if( size & CONFIG_PPM_PAGE_MASK ) npages++; 
-         
-    // build pointers on mapper radix tree
-    rt_xp = XPTR( inode_cxy , &mapper->rt );
-
-    // scan all pages
-    for( page_id = 0 ; page_id < npages ; page_id++ )
-    {
-        // get page descriptor from mapper
-        page_xp = grdxt_remote_lookup( rt_xp , page_id );
-
-        // check all existing pages
-        if ( page_xp != XPTR_NULL )
-        {
-            // get page cluster and local pointer
-            page_ptr = GET_PTR( page_xp );
-
-            // get page flags
-            flags = hal_remote_l32( XPTR( inode_cxy , &page_ptr->flags ) );
-   
-            if ( flags & PG_DIRTY )
-            {
-
-#if (DEBUG_FATFS_SYNC_INODE & 1)
-if( DEBUG_FATFS_SYNC_INODE < cycle )
-printk("\n[%s] thread[%x,%x] synchronizes page %d of <%s> mapper to IOC device\n",
-__FUNCTION__, page_id, name );
-#endif
-                // move page from mapper to device
-                error = fatfs_move_page( page_xp , IOC_WRITE );
-
-                if ( error )  return -1;
-
-                // reset page dirty flag
-                ppm_page_undo_dirty( page_xp );
-            }
-        }
-    }  // end loop on pages
-
-#if DEBUG_FATFS_SYNC_INODE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_SYNC_INODE < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s>\n",
-__FUNCTION__ , this->process->pid, this->trdid, name );
-#endif
-
-    return 0;
-
-}  // end fatfs_sync_inode()
-
-//////////////////////////////
-error_t fatfs_sync_fat( void )
-{
-
-    fatfs_ctx_t * fatfs_ctx; 
-    cxy_t         fat_cxy;
-    mapper_t    * mapper_ptr;
-    xptr_t        mapper_xp;
-    uint32_t      start_page_id;
-    uint32_t      found_page_id;
-    page_t      * page_ptr;
-    xptr_t        page_xp;
-    uint32_t      flags;
-    error_t       error;
-
-#if DEBUG_FATFS_SYNC_FAT
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_FATFS_SYNC_FAT < cycle )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-    
-    // get FAT cluster
-    fat_cxy = CONFIG_VFS_ROOT_CXY;
-    
-    // get FAT mapper pointers  
-    fatfs_ctx  = fs_context[FS_TYPE_FATFS].extend;
-    mapper_ptr = fatfs_ctx->fat_mapper;
-    mapper_xp  = XPTR( fat_cxy , mapper_ptr );
-
-    // get pointers on remote FAT mapper radix tree
-    grdxt_t  * rt_ptr = &mapper_ptr->rt;
-    xptr_t     rt_xp  = XPTR( fat_cxy , rt_ptr );
-
-    // initialise page_id
-    start_page_id = 0;
-
-    // scan FAT mapper
-    while( 1 )
-    {
-        // get one page
-        page_xp = grdxt_remote_get_first( rt_xp , start_page_id , &found_page_id );
-
-        // exit loop when no more page found 
-        if ( page_xp != XPTR_NULL ) break;
-
-        // get page flags
-        page_ptr = GET_PTR( page_xp );
-        flags    = hal_remote_l32( XPTR( fat_cxy , &page_ptr->flags ) );
-
-        if ( flags & PG_DIRTY )
-        {
-
-#if (DEBUG_FATFS_SYNC_FAT & 1)
-if( DEBUG_FATFS_SYNC_FAT < cycle )
-printk("\n[%s] thread[%x,%x] synchronizes page %d from FAT mapper to IOC device\n",
-__FUNCTION__, page_id );
-#endif
-            // move page from mapper to device
-            error = fatfs_move_page( page_xp , IOC_SYNC_WRITE );
-
-            if ( error )  return -1;
-
-            // reset page dirty flag
-            ppm_page_undo_dirty( page_xp );
-        }
-
-        // update loop variable
-        start_page_id = found_page_id + 1;
-
-    }  // end loop on pages
-
-#if DEBUG_FATFS_SYNC_FAT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_SYNC_FAT < cycle )
-printk("\n[%s] thread[%x,%x] exit\n",
-__FUNCTION__ , this->process->pid, this->trdid );
-#endif
-
-    return 0;
-
-}  // end fatfs_sync_fat()
-
-//////////////////////////////////////////////
-error_t fatfs_release_inode( xptr_t inode_xp )
-{
-    vfs_ctx_t   * vfs_ctx;           // local pointer on VFS context (same in all clusters)
-    cxy_t         fat_cxy;           // FAT cluster identifier
-    fatfs_ctx_t * fatfs_ctx_ptr;     // local pointer on FATFS context in FAT cluster
-    xptr_t        fatfs_ctx_xp;      // extended pointer on FATFS-context in FAT cluster
-    mapper_t    * fat_mapper_ptr;    // local pointer on FAT mapper
-    xptr_t        fat_mapper_xp;     // extended pointer on FAT mapper
-    xptr_t        lock_xp;           // extended pointer on lock protecting FAT.
-    xptr_t        first_xp;          // extended pointer on inode extension
-    uint32_t      first_cluster_id;  // first cluster index for released inode
-    vfs_inode_t * inode_ptr;         // local pointer on target inode
-    cxy_t         inode_cxy;         // target inode cluster identifier
-    error_t       error;
-
-// check inode pointer 
-assert( __FUNCTION__, (inode_xp != XPTR_NULL) , "inode pointer is NULL\n" );
-
-    // get inode cluster and local pointer
-    inode_ptr     = GET_PTR( inode_xp );
-    inode_cxy     = GET_CXY( inode_xp );
-
-    // get first_cluster_id from inode extension
-    first_xp         = XPTR( inode_cxy , &inode_ptr->extend );
-    first_cluster_id = (uint32_t)(intptr_t)hal_remote_lpt( first_xp );
-
-// check first cluster index
-assert( __FUNCTION__, (first_cluster_id != 0) , "inode extend is NULL\n" );
-
-#if DEBUG_FATFS_RELEASE_INODE
-char       name[CONFIG_VFS_MAX_NAME_LENGTH];
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-vfs_inode_get_name( inode_xp , name );
-if( DEBUG_FATFS_RELEASE_INODE < cycle )
-printk("\n[%s] thread[%x,%x] enter for <%s> / first_cluster_id %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, name, first_cluster_id, cycle );
-#endif
-
-    // get local pointer on VFS context (same in all clusters)
-    vfs_ctx = &fs_context[FS_TYPE_FATFS];
-
-    // get FAT cluster
-    fat_cxy = CONFIG_VFS_ROOT_CXY;
-
-    // get pointers on FATFS context in FAT cluster 
-    fatfs_ctx_ptr = hal_remote_lpt( XPTR( fat_cxy , &vfs_ctx->extend ) );
-    fatfs_ctx_xp  = XPTR( fat_cxy , fatfs_ctx_ptr ); 
-
-    // get FAT mapper pointers
-    fat_mapper_ptr = hal_remote_lpt( XPTR( fat_cxy , &fatfs_ctx_ptr->fat_mapper ) );
-	fat_mapper_xp  = XPTR( fat_cxy , fat_mapper_ptr );
-    
-    // build extended pointer on FAT lock in FAT cluster
-    lock_xp = XPTR( fat_cxy , &fatfs_ctx_ptr->lock );
-
-    // take FAT lock in write mode
-    remote_rwlock_wr_acquire( lock_xp );
-
-#if (DEBUG_FATFS_RELEASE_INODE & 0x11 == 0x11)
-mapper_display_page( fat_mapper_xp , 0 , 4096 );
-#endif
-
-    // call the recursive function to release all clusters from FAT mapper
-    uint32_t dirty_page_min = 0xFFFFFFFF;
-    uint32_t dirty_page_max = 0;
-
-    if ( fatfs_recursive_release( fat_mapper_xp,
-                                  fatfs_ctx_xp,
-                                  first_cluster_id,
-                                  &dirty_page_min,
-                                  &dirty_page_max ) )
-    {
-        printk("\n[ERROR] in %s : cannot update FAT mapper\n", __FUNCTION__ );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-#if (DEBUG_FATFS_RELEASE_INODE & 1)
-if( DEBUG_FATFS_RELEASE_INODE < cycle )
-printk("\n[%s] inode <%s> removed from FAT mapper\n", __FUNCTION__, name );
-#endif
-
-#if (DEBUG_FATFS_RELEASE_INODE & 0x11 == 0x11)
-mapper_display_page( fat_mapper_xp , 0 , 4096 );
-#endif
-
-    // update FAT on IOC device (from FAT mapper)
-    error = fatfs_update_ioc_fat( fatfs_ctx_xp,
-                                  dirty_page_min,
-                                  dirty_page_max );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot update FAT on IOC device\n", __FUNCTION__ );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-#if (DEBUG_FATFS_RELEASE_INODE & 1)
-if( DEBUG_FATFS_RELEASE_INODE < cycle )
-printk("\n[%s] inode <%s> removed from FAT on IOC device\n", __FUNCTION__, name );
-#endif
-
-    // update FS-INFO on IOC device (from FATFS context)
-    error = fatfs_update_ioc_fsinfo( fatfs_ctx_xp );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s: cannot update FSINFO on IOC device\n", __FUNCTION__ );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-#if (DEBUG_FATFS_RELEASE_INODE & 1)
-if( DEBUG_FATFS_RELEASE_INODE < cycle )
-printk("\n[%s] updated FS_INFO on IOC device for >%s>\n", __FUNCTION__, name );
-#endif
-
-    // release FAT lock
-    remote_rwlock_wr_release( lock_xp );
-
-#if DEBUG_FATFS_RELEASE_INODE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_FATFS_RELEASE_INODE < cycle )
-printk("\n[%s] thread[%x,%x] removed <%s> inode from FATFS / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, name, cycle );
-#endif
-
-    return 0;
-
-}  // end fatfs_release_inode()
-
-/////////////////////////////////////////////////
-error_t fatfs_move_page( xptr_t          page_xp,
-                         ioc_cmd_type_t  cmd_type )
-{
-    error_t       error = 0;
-
-    vfs_inode_t * inode_ptr;
-    mapper_t    * mapper_ptr;      
-    uint32_t      page_id;     // page index in mapper
-
-#if DEBUG_FATFS_MOVE_PAGE
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-char       name[CONFIG_VFS_MAX_NAME_LENGTH];
-#endif
-
-    // get page cluster and local pointer
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    // get mapper pointer and page index from page descriptor
-    mapper_ptr = hal_remote_lpt( XPTR( page_cxy , &page_ptr->mapper ) );
-    page_id    = hal_remote_l32( XPTR( page_cxy , &page_ptr->index ) );
-
-    // get pointer on local FATFS context
-    fatfs_ctx_t * fatfs_ctx = fs_context[FS_TYPE_FATFS].extend;
-
-    // get page base address
-    xptr_t    buffer_xp  = ppm_page2base( page_xp );
- 
-    // get inode pointer from mapper
-    inode_ptr  = hal_remote_lpt( XPTR( page_cxy , &mapper_ptr->inode ) );
-
-    //////////////////////////////  FAT mapper  /////////////////////////////////////////
-    if( inode_ptr == NULL )
-    {
-
-#if DEBUG_FATFS_MOVE_PAGE
-if( DEBUG_FATFS_MOVE_PAGE < cycle )
-printk("\n[%s] thread[%x,%x] enters %s for  page %d in FAT mapper / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, dev_ioc_cmd_str(cmd_type), page_id, cycle );
-#endif
-        // get lba from FATFS context and page_id 
-        uint32_t      lba = fatfs_ctx->fat_begin_lba + (page_id << 3);
- 
-        // access IOC device
-        if     (cmd_type == IOC_SYNC_WRITE) error = dev_ioc_sync_write( buffer_xp, lba, 8 );
-        else if(cmd_type == IOC_SYNC_READ ) error = dev_ioc_sync_read( buffer_xp, lba, 8 );
-        else
-        {
-            printk("\n[ERROR] in %s : illegal asynchronous FAT access\n", __FUNCTION__ );
-        }
-
-        if( error )
-        {
-            printk("\n[ERROR] in %s : cannot access IOC device\n", __FUNCTION__ );
-            return -1;
-        }
-
-#if DEBUG_FATFS_MOVE_PAGE
-if( DEBUG_FATFS_MOVE_PAGE < cycle )
-printk("\n[%s] thread[%x,%x] exit %s for page %d in FAT mapper\n",
-__FUNCTION__, this->process->pid, this->trdid, dev_ioc_cmd_str(cmd_type), page_id );
-#endif
-
-    }
-    /////////////////////////  inode mapper  ////////////////////////////////////////////
-    else                       
-    {
-
-#if DEBUG_FATFS_MOVE_PAGE
-if( DEBUG_FATFS_MOVE_PAGE < cycle )
-{
-    vfs_inode_get_name( XPTR( page_cxy , inode_ptr ) , name );
-    printk("\n[%s] thread[%x,%x] enters %s for page %d in <%s> mapper / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 
-    dev_ioc_cmd_str( cmd_type ), page_id, name, cycle );
-}
-#endif
-
-        uint32_t  searched_cluster_id;
-        uint32_t  first_cluster_id;
-
-        // get first_cluster_id from inode extension
-        void * extend    = hal_remote_lpt( XPTR( page_cxy , &inode_ptr->extend ) );
-        first_cluster_id = (uint32_t)(intptr_t)extend;
-
-        // compute searched_cluster_id
-        if( page_id == 0 )            // no need to access FAT mapper
-        {
-            // searched cluster is first cluster
-            searched_cluster_id = first_cluster_id;
-        }
-        else                        // FAT mapper access required
-        {
-            // scan FAT mapper to get searched_cluster_id
-            error = fatfs_get_cluster( 0,                    // first page in mapper
-                                       first_cluster_id,
-                                       page_id,
-                                       &searched_cluster_id );
-            if( error )
-            {
-                printk("\n[ERROR] in %s : cannot get cluster_id\n", __FUNCTION__ );
-                return -1;
-            }
-        }
-
-        // get lba for searched_cluster
-        uint32_t lba = fatfs_lba_from_cluster( fatfs_ctx , searched_cluster_id );
-
-        // access IOC device
-        if     (cmd_type == IOC_WRITE     ) error = dev_ioc_write( buffer_xp, lba, 8 );
-        else if(cmd_type == IOC_READ      ) error = dev_ioc_read( buffer_xp, lba, 8 );
-        else if(cmd_type == IOC_SYNC_READ ) error = dev_ioc_sync_read( buffer_xp, lba, 8 );
-        else if(cmd_type == IOC_SYNC_WRITE) error = dev_ioc_sync_write( buffer_xp, lba, 8 );
-        else
-        {
-            printk("\n[ERROR] in %s : illegal cmd_type\n", __FUNCTION__ );
-        }
-
-        if( error )
-        {
-            printk("\n[ERROR] in %s : cannot access device\n", __FUNCTION__ );
-            return -1;
-        }
-
-#if DEBUG_FATFS_MOVE_PAGE
-if( DEBUG_FATFS_MOVE_PAGE < cycle )
-{
-    printk("\n[%s] thread[%x,%x] exit %s for page %d in <%s> mapper / cluster_id %x\n",
-    __FUNCTION__, this->process->pid, this->trdid, 
-    dev_ioc_cmd_str( cmd_type ), page_id, name, searched_cluster_id );
-}
-#endif
-
-#if (DEBUG_FATFS_MOVE_PAGE & 1)
-if( DEBUG_FATFS_MOVE_PAGE < cycle )
-fatfs_display_fat( searched_cluster_id , 64 );
-#endif
-
-    }
-
-    return 0;
-
-}  // end fatfs_move_page()
-
-
Index: trunk/kernel/fs/fatfs.h
===================================================================
--- trunk/kernel/fs/fatfs.h	(revision 690)
+++ 	(revision )
@@ -1,506 +1,0 @@
-/*
- * fatfs.h - FATFS file system API definition.
- *
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _FATFS_H_
-#define _FATFS_H_
-
-#include <hal_kernel_types.h>
-#include <remote_rwlock.h>
-#include <vfs.h>
-#include <dev_ioc.h>
-
-
-/******************************************************************************************
- * The FATFS File System implements a FAT32 read/write file system.
- *
- * The FATFS specific extensions to the generic VFS are the following:
- * 1) The vfs_ctx_t "extend" field contains a local pointer on the local 
- *    fatfs_ctx_t structure.
- *
- * 2) The vfs_inode_t "extend" contains, for each inode,
- *    the first FATFS cluster_id (after cast to intptr).
- *
- * 3) The vfs_dentry_t "extend" field contains a local pointer on the local
- *    FATFS directory entry (32 bytes) in the directory mapper.
- *
- * In the FAT32 File System, the File Allocation Table is is actually an array 
- * of uint32_t slots. Each slot in this array contains the index (called cluster_id)
- * of another slot in this array, to form one linked list for each file stored on
- * device in the FAT32 File System. This index in the FAT array is also the index of
- * the FATFS cluster on the device. One FATFS cluster is supposed to contain one PPM page. 
- * For a given file, the entry point in the FAT is the cluster_id of the FATFS cluster 
- * containing the first page of the file, but it can be any cluster_id already allocated
- * to the file. 
- *****************************************************************************************/
- 
-/*************** Partition Boot Sector Format **********************************/
-//                                     offset |  length
-#define BS_JMPBOOT                          0 ,  3
-#define BS_OEMNAME                          3 ,  8
-#define BPB_BYTSPERSEC                     11 ,  2
-#define BPB_SECPERCLUS                     13 ,  1
-#define BPB_RSVDSECCNT                     14 ,  2
-#define BPB_NUMFATS                        16 ,  1
-#define BPB_ROOTENTCNT                     17 ,  2
-#define BPB_TOTSEC16                       19 ,  2
-#define BPB_MEDIA                          21 ,  1
-#define BPB_FATSZ16                        22 ,  2
-#define BPB_SECPERTRK                      24 ,  2
-#define BPB_NUMHEADS                       26 ,  2
-#define BPB_HIDDSEC                        28 ,  4
-#define BPB_TOTSEC32                       32 ,  4
-#define BPB_PARTITION_TABLE               446 , 64 
-
-// FAT 32
-#define BPB_FAT32_FATSZ32                  36 ,  4
-#define BPB_FAT32_EXTFLAGS                 40 ,  2
-#define BPB_FAT32_FSVER                    42 ,  2
-#define BPB_FAT32_ROOTCLUS                 44 ,  4
-#define BPB_FAT32_FSINFO                   48 ,  2
-#define BPB_FAT32_BKBOOTSEC                50 ,  2
-#define BS_FAT32_DRVNUM                    64 ,  1
-#define BS_FAT32_BOOTSIG                   66 ,  1
-#define BS_FAT32_VOLID                     67 ,  4
-#define BS_FAT32_VOLLAB                    71 , 11
-#define BS_FAT32_FILSYSTYPE                82 ,  8
-
-// Partitions
-#define FIRST_PARTITION_ACTIVE            446 ,  8
-#define FIRST_PARTITION_BEGIN_LBA         454 ,  4
-#define FIRST_PARTITION_SIZE              458 ,  4 
-#define SECOND_PARTITION_ACTIVE           462 ,  8
-#define SECOND_PARTITION_BEGIN_LBA        470 ,  4
-#define SECOND_PARTITION_SIZE             474 ,  4
-#define THIRD_PARTITION_ACTIVE            478 ,  8
-#define THIRD_PARTITION_BEGIN_LBA         486 ,  4
-#define THIRD_PARTITION_SIZE              490 ,  4
-#define FOURTH_PARTITION_ACTIVE           494 ,  8
-#define FOURTH_PARTITION_BEGIN_LBA        502 ,  4
-#define FOURTH_PARTITION_SIZE             506 ,  4    
-/*******************************************************************************/
-
-#define MBR_SIGNATURE_POSITION            510 , 2
-#define MBR_SIGNATURE_VALUE               0xAA55  
-
-/************** FAT_FS_INFO SECTOR  ********************************************/
-#define FS_SIGNATURE_VALUE_1              0x52526141
-#define FS_SIGNATURE_VALUE_2              0x72724161
-#define FS_SIGNATURE_VALUE_3              0x000055AA  
-#define FS_SIGNATURE_POSITION_1           0   , 4  
-#define FS_SIGNATURE_POSITION_2           484 , 4
-#define FS_SIGNATURE_POSITION_3           508 , 4  
-#define FS_FREE_CLUSTERS                  488 , 4
-#define FS_FREE_CLUSTER_HINT              492 , 4
-/*******************************************************************************/
-
-#define DIR_ENTRY_SIZE          32
-                   
-#define NAME_MAX_SIZE           31
-
-/******* SFN Directory Entry Structure (32 bytes) ******************************/
-//                            offset | length
-#define DIR_NAME                   0 , 11   // dir_entry name
-#define DIR_ATTR                  11 ,  1   // attributes
-#define DIR_NTRES                 12 ,  1   // reserved for the OS        
-#define DIR_CRT_TIMES_TENTH       13 ,  1 
-#define DIR_FST_CLUS_HI           20 ,  2   // cluster index 16 MSB bits
-#define DIR_WRT_TIME              22 ,  2   // time of last write
-#define DIR_WRT_DATE              24 ,  2   // date of last write
-#define DIR_FST_CLUS_LO           26 ,  2   // cluster index 16 LSB bit
-#define DIR_FILE_SIZE             28 ,  4   // dir_entry size (up to 4 Gbytes)
-/*******************************************************************************/
-
-/******* LFN Directory Entry Structure  (32 bytes) *****************************/
-//                            offset | length
-#define LDIR_ORD                   0 ,  1   // Sequence number (from 0x01 to 0x0f)    
-#define LDIR_NAME_1                1 , 10   // name broken into 3 parts 
-#define LDIR_ATTR                 11 ,  1   // attributes (must be 0x0F) 
-#define LDIR_TYPE                 12 ,  1   // directory type (must be 0x00)
-#define LDIR_CHKSUM               13 ,  1   // checksum of name in short dir  
-#define LDIR_NAME_2               14 , 12 
-#define LDIR_RSVD                 26 ,  2   // artifact of previous fat (must be 0)
-#define LDIR_NAME_3               28 ,  4   
-/*******************************************************************************/
-
-/***********************  DIR_ATTR values  (attributes) ************************/
-#define ATTR_READ_ONLY            0x01
-#define ATTR_HIDDEN               0x02
-#define ATTR_SYSTEM               0x04
-#define ATTR_VOLUME_ID            0x08
-#define ATTR_DIRECTORY            0x10
-#define ATTR_ARCHIVE              0x20
-#define ATTR_LONG_NAME_MASK       0x0f      // READ_ONLY|HIDDEN|SYSTEM|VOLUME_ID
-/*******************************************************************************/
-
-/********************* DIR_ORD special values **********************************/
-#define FREE_ENTRY                0xE5     // this entry is free in the directory
-#define NO_MORE_ENTRY             0x00     // no more entry in the directory
-/*******************************************************************************/
-
-/******************** CLuster Index Special Values *****************************/
-#define FREE_CLUSTER              0x00000000
-#define RESERVED_CLUSTER          0x00000001
-#define BAD_CLUSTER               0x0FFFFFF7
-#define END_OF_CHAIN_CLUSTER_MIN  0x0ffffff8
-#define END_OF_CHAIN_CLUSTER_MAX  0x0fffffff
-/*******************************************************************************/
-
-/****  Forward declarations  ****/
-
-struct mapper_s;
-struct page_s;
-struct vfs_ctx_s;
-struct vfs_inode_s;
-struct vfs_dentry_s;
-
-/*****************************************************************************************
- * This structure defines a FATFS specific context extension to the VFS context.
- * This fatfs context is replicated in all clusters.
- * It contains read-only informations such as the total number of sectors in FAT region,
- * the number of bytes per sector, the number of sectors per cluster, the lba of FAT,
- * the lba of data region, the cluster_id for the root directory, and an extended 
- * pointer on the FAT mapper.
- *
- * WARNING 1 : All access to the FAT are protected by a remote_rwlock. 
- * - it is taken in READ mode by the fatfs_get_cluster() function to scan the
- *   linked list associated to a given inode. 
- * - it is taken in WRITE mode by the fatfs_cluster_alloc() and fatfs_release_inode()
- *   functions to modify the FAT in both the FAT mapper and on IOC device.
- *
- * WARNING 2 : Most fields are constant values, but <free_cluster_hint>, <free_clusters>,
- * <lock>, and the buffer pointed by the <fs_info_xp> are shared variables, that can
- * modified by any thread running in any cluster. The <fs_info_buffer>  contains
- * a copy of the FS_INFO sector, and is only allocated in the FAT cluster. 
- * It is used to synchronously update the free clusters info on IOC device.
- *  => For all these variables, only the values stored in the FAT cluster must be used.
- ****************************************************************************************/
-
-typedef struct fatfs_ctx_s
-{
-    /* read-only constants replicated in all clusters                                   */
-    uint32_t            fat_sectors_count;     /*! number of sectors in FAT region      */
-    uint32_t            bytes_per_sector;      /*! number of bytes per sector           */
-    uint32_t            sectors_per_cluster;   /*! number of sectors per cluster        */
-    uint32_t            fat_begin_lba;         /*! lba of FAT region                    */
-    uint32_t            cluster_begin_lba;     /*! lba of data region                   */
-    uint32_t            fs_info_lba;           /*! lba of FS_INFO sector                */
-    uint32_t            root_dir_cluster;      /*! cluster index for  root directory    */
-    struct mapper_s   * fat_mapper;            /*! local pointer on FAT mapper          */
-
-    /* shared variables (only the copy in FAT cluster must be used)                     */
-    uint32_t            free_cluster_hint;     /*! free_cluster_hint + 1 is first free  */
-    uint32_t            free_clusters;         /*! number of free clusters              */
-    remote_rwlock_t     lock;                  /*! exclusive access to FAT              */
-    uint8_t           * fs_info_buffer;        /*! local pointer on FS_INFO buffer      */
-}
-fatfs_ctx_t;
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//              FATFS specific extern functions  
-//////////////////////////////////////////////////////////////////////////////////////////
-
-/*****************************************************************************************
- * This debug function display the content of the FATFS context copy in cluster
- * identified by the <cxy> argument.
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ cxy       :  target cluster identifier.
- ****************************************************************************************/
-void fatfs_display_ctx( cxy_t cxy );
-
-/*****************************************************************************************
- * This debug function access the FAT mapper to display the current FAT state,
- * as defined by the <min_slot>, and <nb_slots> arguments.
- * It display as many lines (8 slots par line) as required to display <nb_slots>,
- * starting from the <min_slot>. The displayed slots can spread on several FAT mapper
- * pages. It loads the missing pages from IOC to mapper if required.
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ min_slot   : first FATFS cluster index.
- * @ nb_slots   : number of slots (one slot is 4 bytes.
- ****************************************************************************************/
-void fatfs_display_fat( uint32_t  min_slot,
-                        uint32_t  nb_slots );
-
-/*****************************************************************************************
- * This function checks the current values of the "free_clusters" and "free_cluster_hint" 
- * variables in the FS_INFO sector on IOC, versus the values stored in the fatfs context.
- * As these values are synchronously updated on IOC device at each modification, 
- * it does nothing if the values are equal. It updates the FS_INFO sector on IOC device,
- * and displays a warning message on TXT0 if they are not equal.
- * This function can be called by any thread running in any cluster. 
- *****************************************************************************************
- * @ return 0 if success / return -1 if failure during IOC device access.
- ****************************************************************************************/
-error_t fatfs_check_free_info( void );
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// Generic API: These functions are called by the kernel VFS,
-//              and must be implemented by all File Systems.
-//////////////////////////////////////////////////////////////////////////////////////////
-
-/*****************************************************************************************
- * This fuction allocates memory for a FATFS context descriptor in a cluster
- * identified by the <cxy> argument.
- *****************************************************************************************
- * @ cxy   : target cluster identifier.
- * @ return an extended pointer on the created context / return XPTR_NULL if failure.
- ****************************************************************************************/
-xptr_t  fatfs_ctx_alloc( cxy_t  cxy );
-
-/*****************************************************************************************
- * This fuction initialize a fatfs context identified by the <fatfs_ctx_xp> argument
- * from informations found in the IOC device boot record. This initialisation includes
- * allocation of the FS_INFO buffer and creation of the FAT mapper in the same cluster.
- *****************************************************************************************
- * @ fatfs_ctx_xp   : extended pointer on fatfs context.
- * @ return 0 if success / return -1 if failure.
- ****************************************************************************************/
-error_t  fatfs_ctx_init( xptr_t  fatfs_ctx_xp );
-
-/*****************************************************************************************
- * This function releases memory dynamically allocated for the FATFS context.
- *****************************************************************************************
- * @ vfs_ctx_xp   : extended pointer on FATFS context.
- ****************************************************************************************/
-void fatfs_ctx_destroy( xptr_t  fatfs_ctx_xp );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_add_dentry() function for the FATFS.
- *****************************************************************************************
- * This function introduces in a directory mapper identified by the <parent_inode_xp>
- * argument a new directory entry identified by the <dentry_ptr> argument.
- * The dentry descriptor and the associated inode descriptor must have been previously
- * allocated, initialized, and registered in the Inode Tree. 
- * The dentry descriptor defines the "name" field.
- * The inode descriptor defines the "type", "size", and "cluster_id" fields.
- * The "extension field" in dentry descriptor is set : index in the FAT32 directory.
- * All modified pages in the directory mapper are synchronously updated on IOC device.
- * This function can be called by any thread running in any cluster.
- *
- * Implementation note : this function works in two steps:
- * - It scan the set of 32 bytes FATFS directry entries, using two embedded loops  
- *   to find the end of directory (NO_MORE_ENTRY marker).
- * - Then it writes 3, 4, or 5 directory entries (depending on the name length), using 
- *   a 5 steps FSM (one state per entry to be written), and updates on IOC device the 
- *   modified pages.
- *****************************************************************************************
- * @ parent_inode_xp : [in]  extended pointer on parent directory inode.
- * @ dentry_ptr      : [in]  local pointer on dentry (in parent directory cluster).
- * @ index           : [out] index of the new entry in the FAT32 directory.
- * @ return 0 if success / return -1 if failure.
- ****************************************************************************************/
-error_t fatfs_add_dentry( xptr_t                parent_inode_xp,
-                          struct vfs_dentry_s * dentry_ptr );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_remove_dentry() function for the FATFS.
- *****************************************************************************************
- * This function updates a directory identified by the <parent_inode_xp> argument
- * to remove a directory entry identified by the <dentry_ptr> argument.
- * All modified pages in directory mapper are synchronously updated on IOC device.
- * This function can be called by any thread running in any cluster.
- *
- * Implementation note: this function uses the dentry extension to directly access 
- * the NORMAL directory entry and invalidate all involved LFN entries. Then it
- * updates the modified pages on IOC device.
- *****************************************************************************************
- * @ parent_inode_xp   : [in] extended pointer on parent directory inode.
- * @ dentry_ptr        : [in] local pointer on dentry (in parent directory cluster).
- * @ return 0 if success / return -1 if failure.
- ****************************************************************************************/
-error_t fatfs_remove_dentry( xptr_t                parent_inode_xp,
-                             struct vfs_dentry_s * dentry_ptr );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_new_dentry_from_mapper() for the FATFS.
- *****************************************************************************************
- * It scan a parent directory mapper, identified by the <parent_inode_xp> argument 
- * to find a directory entry name defined by the <dentry_ptr> argument, and completes
- * the initialization of the dentry and the associated child_inode descriptors,
- * from informations found in the parent directory mapper :
- * - It set the "type", "size", and "extend" fields in the child inode descriptor.
- * - It set the " extend" field in the dentry descriptor.
- * The child inode descriptor, and the dentry descriptor must have been previously
- * allocated and introduced in the Inode Tree.
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ parent_inode_xp : extended pointer on parent inode (directory).
- * @ dentry_ptr      : local pointer on new dentry (in parent inode cluster).
- * @ return 0 if success / return -1 if failure.
- ****************************************************************************************/
-error_t fatfs_new_dentry_from_mapper( xptr_t                parent_inode_xp,
-                                      struct vfs_dentry_s * dentry_ptr );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_new_dentry_to_mapper() for the FATFS.
- *****************************************************************************************
- * This function  introduces a brand new dentry identified by the <dentry_ptr> argument
- * in the mapper of a directory identified by the <parent_inode_xp> argument.
- * It is called by the vfs_lookup() function.
- * The child inode descriptor, and the dentry descriptor must have been previously
- * allocated and introduced in the Inode Tree. The dentry descriptor contains the name.
- * 1. It allocates a new FATFS cluster_id,
- * 2. It registers the allocated cluster_id in the child inode extension,
- * 3. It add a new entry (32 bytes) in the directory mapper,
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ parent_inode_xp : [in]  extended pointer on parent inode (directory).
- * @ dentry_ptr      : [in]  local pointer on dentry (in parent inode cluster).
- * @ return 0 if success / return -1 if failure.
- ****************************************************************************************/
-error_t fatfs_new_dentry_to_mapper( xptr_t                parent_inode_xp,
-                                    struct vfs_dentry_s * dentry_ptr );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_update_dentry() function for the FATFS.
- *****************************************************************************************
- * It update the "size" of a directory entry identified by the <dentry_ptr> argument in
- * the mapper of a directory identified by the <parent_inode_xp> argument, from the
- * value registered in the inode descriptor.
- * It scan the directory mapper to find the entry such as name == dentry_ptr->name.
- * It set the "size" field in the directory mapper, and updates the modified directory
- * page on the IOC device.
- * This function can be called by any thread running in any cluster.
- *
- * TODO the current implementation uses the fatfs_scan_directory to access the 
- * FAT32 directory by name. We can access directly this directory entry if we use
- * the dentry "extend" field...
- *****************************************************************************************
- * @ parent_inode_xp : extended pointer on inode (directory).
- * @ dentry_ptr      : local pointer on dentry (in parent directory cluster).
- * @ return 0 if success / return -1 if child not found.
- ****************************************************************************************/
-error_t fatfs_update_dentry( xptr_t                parent_inode_xp,
-                             struct vfs_dentry_s * dentry_ptr );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_get_user_dir() function for the FATFS.
- *****************************************************************************************
- * It is called by the remote_dir_create() function to scan the mapper of a directory 
- * identified by the <inode> argument, and copy up to <max_dirent> valid dentries to a 
- * local dirent array, defined by the <array> argument. The <min_dentry> argument defines
- * the index of the first dentry to be copied to the target dirent array.
- * This function returns in the <entries> buffer the number of dentries actually written,
- * and signals in the <done> buffer when the last valid entry has been found.
- * If the <detailed> argument is true, a dentry/inode couple that does not exist in
- * the Inode Tree is dynamically created, and all dirent fields are documented in the
- * dirent array. Otherwise, only the dentry name is documented.
- *
- * WARNING : It must be called by a thread running in the cluster containing the
- * target directory inode.
- *****************************************************************************************
- * @ parent_inode_xp  : [in]  extended pointer on directory inode.
- * @ array      : [in]  local pointer on array of dirents.
- * @ max_dirent : [in]  max number of slots in dirent array.
- * @ min_dentry : [in]  index of first dentry to be copied into array.
- * @ detailed   : [in]  dynamic inode creation if true.
- * @ entries    : [out] number of dentries actually copied into array.
- * @ done       : [out] Boolean true when last entry found.
- * @ return 0 if success / return -1 if failure.
- ****************************************************************************************/
-error_t fatfs_get_user_dir( struct vfs_inode_s * inode,
-                            struct dirent      * array, 
-                            uint32_t             max_dirent,
-                            uint32_t             min_dentry,
-                            bool_t               detailed,
-                            uint32_t           * entries,
-                            bool_t             * done );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_sync_inode() function for the FATFS.
- *****************************************************************************************
- * It updates the FATFS on the IOC device for a given inode identified by 
- * the <inode_xp> argument. It scan all pages registered in the associated mapper,
- * and copies from mapper to device each page marked as dirty.
- * WARNING : The target <inode> cannot be a directory, because all modifications in a 
- * directory are synchronously done on the IOC device by the two fatfs_add_dentry() 
- * and fatfs_remove_dentry() functions.
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ inode_xp   : extended pointer on inode.
- * @ return 0 if success / return -1 if failure. 
- ****************************************************************************************/
-error_t fatfs_sync_inode( xptr_t  inode_xp );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_sync_fat() function for the FATFS.
- *****************************************************************************************
- * It updates the FAT on the IOC device for the FAT itself.
- * It scan all clusters registered in the FAT mapper, and copies from mapper to device 
- * each page marked as dirty.
- * This function can be called by any thread running in any cluster. 
- *
- * Implementation note : this function uses the grdxt_remote_get_first() function
- * to test only the pages actually registered in the FAT mapper.
- *****************************************************************************************
- * @ return 0 if success / return -1 if failure during IOC device access.
- ****************************************************************************************/
-error_t fatfs_sync_fat( void );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_release_inode() function for the FATFS.
- *****************************************************************************************
- * This function is used to remove a given file or directory from the FATFS file system.
- * It releases all clusters allocated to a file/directory identified by the <inode_xp>
- * argument. All released clusters are marked FREE_CLUSTER in the FAT mapper. 
- * This function calls the recursive function fatfs_cluster_release() to release 
- * the clusters in reverse order of the linked list (from last to first). 
- * When the FAT mapper has been updated, it calls the fatfs_sync_fat() function to
- * synchronously update all modified pages in the FAT mapper to the IOC device.
- * Finally the FS-INFO sector on the IOC device is updated.
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ inode_xp   : extended pointer on inode.
- * @ return 0 if success / return EIO if failure during device access.
- ****************************************************************************************/
-error_t fatfs_release_inode( xptr_t inode_xp );
-
-/*****************************************************************************************
- * This function implements the generic vfs_fs_move_page() function for the FATFS.
- *****************************************************************************************
- * This function moves a page from/to the mapper to/from the FATFS file system on device.
- * The page must have been previously allocated and registered in the mapper.   
- * The pointer on the mapper and the page index in file are found in the page descriptor.
- * It is used for both a regular file/directory mapper, and the FAT mapper.
- * - For the FAT mapper, it read/write the FAT region on IOC device.
- * - For a regular file, it scan the FAT mapper to get the cluster_id on IOC device,
- *   and read/write this cluster.
- * This function can be called by any thread running in any cluster.
- *
- * WARNING : For the FAT mapper, the inode field in the mapper MUST be NULL, as this
- *           is used to indicate that the corresponding mapper is the FAT mapper.
- *****************************************************************************************
- * @ page_xp   : extended pointer on page descriptor.
- * @ cmd_type  : IOC_READ / IOC_WRITE / IOC_SYNC_READ / IOC_SYNC_WRITE
- * @ return 0 if success / return EIO if error during device access. 
- ****************************************************************************************/
-error_t fatfs_move_page( xptr_t          page_xp,
-                         ioc_cmd_type_t  cmd_type );
-
-
-
-
-
-
-#endif	/* _FATFS_H_ */
Index: trunk/kernel/fs/fatfs/fat32_access.c
===================================================================
--- trunk/kernel/fs/fatfs/fat32_access.c	(revision 1)
+++ trunk/kernel/fs/fatfs/fat32_access.c	(revision 1)
@@ -0,0 +1,635 @@
+/*
+ * fat32_access.c - FAT32 access functions implementation
+ *
+ * Author    Ghassan Almaless (2008,2009,2010,2011,2012)
+ *           Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <driver.h>
+#include <device.h>
+#include <string.h>
+#include <rwlock.h>
+#include <page.h>
+#include <pmm.h>
+#include <thread.h>
+#include <cluster.h>
+#include <mapper.h>
+#include <vfs.h>
+
+#include <fat32.h>
+#include "fat32-private.h"
+
+#if VFAT_INSTRUMENT
+uint32_t blk_rd_count ;
+uint32_t rd_count     ;
+uint32_t wr_count     ;
+#endif
+
+RPC_DECLARE(__vfat_cluster_count, RPC_RET(RPC_RET_PTR(int, count)), 
+			RPC_ARG(RPC_ARG_VAL(struct vfat_context_s*, ctx),
+			RPC_ARG_VAL(vfat_cluster_t, cluster_index)))
+{
+	int cnt;
+	vfat_cluster_t next_cluster_index = 0;
+
+	cnt = 0;
+	while(next_cluster_index < 0x0FFFFFF8) {
+		vfat_query_fat(ctx, cluster_index, &next_cluster_index);
+		cluster_index = next_cluster_index;
+		cnt++;
+	}
+	*count = cnt;
+}
+
+int vfat_cluster_count(struct vfat_context_s *ctx, vfat_cluster_t cluster_index) 
+{
+	int count;
+	RCPC(ctx->fat_cid, RPC_PRIO_FS, __vfat_cluster_count, 
+					RPC_RECV(RPC_RECV_OBJ(count)), 
+					RPC_SEND(RPC_SEND_OBJ(ctx),
+					RPC_SEND_OBJ(cluster_index)));
+	return count;
+}
+
+RPC_DECLARE(__vfat_query_fat, RPC_RET(RPC_RET_PTR(error_t, err), 
+			RPC_RET_PTR(vfat_cluster_t, next_cluster_index)),
+
+			RPC_ARG(RPC_ARG_VAL(struct vfat_context_s*, ctx),
+			RPC_ARG_VAL(vfat_cluster_t, cluster_index)))
+			
+{
+	vfat_cluster_t *data;
+	vfat_cluster_t cluster_offset;
+	struct page_s *page;
+	struct mapper_s *mapper;
+	uint32_t page_id;
+
+	mapper = ctx->mapper;
+
+	cluster_offset = ctx->fat_begin_lba * ctx->bytes_per_sector + (cluster_index * 4);
+	page_id = cluster_offset >> PMM_PAGE_SHIFT;
+
+	vfat_dmsg(1, "%s: TID %x, Query FAT at page_id %d to get next cluster of %u\n",
+		  __FUNCTION__, CURRENT_THREAD, page_id, cluster_index);
+
+	if ((page = mapper_get_page(mapper, page_id, MAPPER_SYNC_OP)) == NULL)
+	{
+		*err = -1;	
+		return;
+	}
+
+	vfat_dmsg(1, "%s: cluster offset %d, offset %d\n", __FUNCTION__, cluster_offset, cluster_offset % PMM_PAGE_SIZE);
+
+	data = (vfat_sector_t*) ppm_page2addr(page);
+	data = (vfat_sector_t*)((uint8_t*) data + (cluster_offset % PMM_PAGE_SIZE));
+	*next_cluster_index = *data & 0x0FFFFFFF;
+
+	vfat_dmsg(1, "%s: next cluster for %u is %u\n", __FUNCTION__, cluster_index, *next_cluster_index);
+	*err = 0;
+}
+
+error_t vfat_query_fat(struct vfat_context_s* ctx,
+		vfat_cluster_t cluster_index,
+		vfat_cluster_t *next_cluster_index)
+{
+	error_t err;
+	vfat_cluster_t next;
+
+	RCPC(ctx->fat_cid, RPC_PRIO_FS, __vfat_query_fat, 
+				RPC_RECV(RPC_RECV_OBJ(err), RPC_RECV_OBJ(next)),
+				RPC_SEND(RPC_SEND_OBJ(ctx), RPC_SEND_OBJ(cluster_index)));
+
+	*next_cluster_index = next;
+	return err;
+}
+
+
+RPC_DECLARE(__vfat_alloc_fat_entry, RPC_RET(RPC_RET_PTR(error_t, err), RPC_RET_PTR(vfat_cluster_t,new_cluster)), 
+					RPC_ARG(RPC_ARG_VAL(struct vfat_context_s*, ctx)))
+{
+	struct page_s *page;
+	struct mapper_s *mapper;
+	vfat_sector_t EOF_sector;
+	vfat_sector_t last_allocated_sector;
+	vfat_sector_t sector;
+	uint32_t last_allocated_index;
+	uint32_t index;
+	uint32_t sectors_per_page;
+	uint32_t *buffer;
+	uint32_t found;
+	uint32_t sector_size;
+	uint32_t page_id;
+	uint32_t old_page_id;
+
+	sector_size = ctx->bytes_per_sector;
+	sectors_per_page = PMM_PAGE_SIZE / sector_size;
+	EOF_sector = ctx->fat_begin_lba + ctx->fat_blk_count;
+	*new_cluster = 0;
+	*err = 0;
+	found = 0;
+	old_page_id = 0xFFFFFFFF;
+	mapper = ctx->mapper;
+	page = NULL;
+
+	rwlock_wrlock(&ctx->lock);
+	last_allocated_sector = ctx->last_allocated_sector;
+	last_allocated_index = ctx->last_allocated_index;
+	vfat_dmsg(2, "%s: Started, last allocated sector %u\n", __FUNCTION__, last_allocated_sector);
+
+	for(sector = last_allocated_sector; (sector < EOF_sector) && (!found); sector ++)
+	{
+		vfat_dmsg(2, "%s: sector %u\n", __FUNCTION__, sector);
+		page_id = sector / sectors_per_page;
+
+		if (page_id != old_page_id) // Let's not reload the same page everytime
+		{  
+			vfat_dmsg(2, "%s: current page #%d, next page #%d\n", __FUNCTION__, old_page_id, page_id);
+
+			page = mapper_get_page(mapper, page_id, MAPPER_SYNC_OP);
+
+			if(page == NULL)
+			{
+				printk(WARNING, "WARNING: alloc_fat: error reading sector %d\n", sector);
+				*err = VFS_IO_ERR;
+				goto VFAT_ALLOC_CLUSTER_ERROR;
+			}
+		}
+
+		buffer = ppm_page2addr(page);
+		buffer = buffer + ((sector % sectors_per_page) * (sector_size / 4));
+
+		for(index = last_allocated_index; index < (sector_size/4); index ++)
+		{
+			vfat_dmsg(2, "%s: index %d\n", __FUNCTION__, index);
+
+			if((buffer[index] & 0x0FFFFFFF) == 0x00000000)
+			{
+				found = 1;
+
+				page_lock(page);
+				buffer[index] = 0x0FFFFFF8;
+				mapper->m_ops->set_page_dirty(page);
+				page_unlock(page);
+
+#if VFAT_INSTRUMENT
+				wr_count ++;
+#endif
+				vfat_dmsg(1,"%s: page #%d (@%x) is set to delayed write\n", __FUNCTION__, page->index, page);
+
+				if(index != ((sector_size/4) - 1))
+				{
+					ctx->last_allocated_sector = sector;
+					ctx->last_allocated_index = (index + 1) % (sector_size/4);
+				} 
+				else
+				{
+					last_allocated_sector = sector + 1;
+
+					if(last_allocated_sector == EOF_sector) 
+					{
+						ctx->last_allocated_sector = ctx->fat_begin_lba;
+						ctx->last_allocated_index = 2;
+					} 
+					else 
+					{
+						ctx->last_allocated_sector = last_allocated_sector;
+						ctx->last_allocated_index = (index + 1) % (sector_size/4);
+					}
+				}
+
+				index += (sector - ctx->fat_begin_lba) * (sector_size/4);
+				vfat_dmsg(2, "%s: found: cluster %u\n",  __FUNCTION__, index);
+				*new_cluster = index;
+				break;
+			}
+		}
+
+		last_allocated_index = 0;
+		old_page_id = page_id;
+	}
+
+	//if(page)
+	// page_refcount_down(page);
+
+VFAT_ALLOC_CLUSTER_ERROR:
+	rwlock_unlock(&ctx->lock);
+	vfat_dmsg(2, "%s: new_cluster %u, hasError ? %d\n", __FUNCTION__, *new_cluster, *err);
+}
+
+
+error_t vfat_alloc_fat_entry(struct vfat_context_s* ctx, vfat_cluster_t *new_cluster)
+{
+	error_t err;
+	vfat_cluster_t new;
+
+	RCPC(ctx->fat_cid, RPC_PRIO_FS, __vfat_alloc_fat_entry, 
+				RPC_RECV(RPC_RECV_OBJ(err), 
+					RPC_RECV_OBJ(new)),
+				RPC_SEND(RPC_SEND_OBJ(ctx)));
+
+	*new_cluster=new;
+
+	return err;
+}
+
+
+RPC_DECLARE(__vfat_extend_cluster, RPC_RET(RPC_RET_PTR(error_t, err), 
+					RPC_RET_PTR(vfat_cluster_t, next_cluster)), 
+					RPC_ARG(RPC_ARG_VAL(struct vfat_context_s*, ctx), 
+					RPC_ARG_VAL(vfat_cluster_t, current_vfat_cluster)))
+{
+	struct page_s *page;
+	struct mapper_s *mapper;
+	vfat_sector_t lba;
+	vfat_cluster_t val;
+	size_t sector_size;
+	uint32_t sectors_per_page;
+	uint32_t *buffer;
+
+	sector_size = ctx->bytes_per_sector;
+	sectors_per_page = PMM_PAGE_SIZE / sector_size;
+	mapper = ctx->mapper;
+
+	if((*err = vfat_alloc_fat_entry(ctx, next_cluster)))
+		return;
+
+	if(*next_cluster == 0)
+	{
+		*err=0;
+	}
+
+	lba = ctx->fat_begin_lba + ((current_vfat_cluster *4) / sector_size);
+
+	page = mapper_get_page(mapper, lba / sectors_per_page, MAPPER_SYNC_OP);
+
+	if(page == NULL) goto VFAT_EXTEND_CLUSTER_ERROR;
+
+	vfat_dmsg(1, "%s: extending cluster %u\n", __FUNCTION__, current_vfat_cluster);
+
+	buffer = (uint32_t*) ppm_page2addr(page);
+	buffer += (lba % sectors_per_page) * (sector_size/4);
+
+	page_lock(page);
+
+	val = buffer[current_vfat_cluster % (sector_size/4)] & 0x0FFFFFFF;
+
+	if( val >= 0x0FFFFFF8)
+		buffer[current_vfat_cluster % (sector_size/4)] = *next_cluster;
+	else
+	{
+		vfat_dmsg(1,"%s: %u already extended !\n", __FUNCTION__, current_vfat_cluster);
+		vfat_dmsg(1,"%s: freeing %u\n", __FUNCTION__, *next_cluster);
+
+		page_unlock(page);
+		//page_refcount_down(page);
+
+		lba = ctx->fat_begin_lba + ((*next_cluster *4) / sector_size);
+
+		if((page = mapper_get_page(mapper, lba / sectors_per_page, MAPPER_SYNC_OP)) == NULL)
+			goto VFAT_EXTEND_CLUSTER_ERROR;
+
+		buffer = (uint32_t*) ppm_page2addr(page);
+		buffer += (lba % sectors_per_page) * (sector_size/4);
+		page_lock(page);
+		buffer[*next_cluster % (sector_size/4)] = 0x00;
+	}
+
+#if VFAT_INSTRUMENT
+	wr_count ++;
+#endif
+
+	mapper->m_ops->set_page_dirty(page);
+
+	page_unlock(page);
+	vfat_dmsg(1,"%s: page #%d (@%x) is set to delayed write\n", __FUNCTION__, page->index, page);
+
+
+	vfat_dmsg(1,"%s: cluster %u's FAT entry is set to %u, FAT's sector %u is set as delayed write\n",
+		  __FUNCTION__, 
+		  current_vfat_cluster, 
+		  *next_cluster,
+		  lba);
+
+	vfat_dmsg(1,"%s: allocated cluster %u for asked cluster %u\n",
+		  __FUNCTION__, 
+		  *next_cluster, 
+		  current_vfat_cluster);
+	*err = 0;
+	return;
+
+VFAT_EXTEND_CLUSTER_ERROR:
+	vfat_free_fat_entry(ctx,*next_cluster);
+	*next_cluster = 0;
+	*err = -1;
+}
+
+error_t vfat_extend_cluster(struct vfat_context_s* ctx,
+		vfat_cluster_t current_vfat_cluster,
+		vfat_cluster_t *next_cluster)
+{
+	error_t err;
+	vfat_cluster_t next;
+
+	RCPC(ctx->fat_cid, RPC_PRIO_FS, __vfat_extend_cluster, 
+					RPC_RECV(RPC_RECV_OBJ(err), 
+						RPC_RECV_OBJ(next)),
+					RPC_SEND(RPC_SEND_OBJ(ctx), 
+						RPC_SEND_OBJ(current_vfat_cluster)));
+
+	*next_cluster=next;
+
+	return err;
+}
+
+
+RPC_DECLARE(__vfat_free_fat_entry, RPC_RET(RPC_RET_PTR(error_t, err)), 
+			RPC_ARG(RPC_ARG_VAL(struct vfat_context_s*, ctx),
+			RPC_ARG_VAL(vfat_cluster_t, start_cluster)))
+{
+	struct page_s *page;
+	struct mapper_s *mapper;
+	vfat_sector_t *sector;
+	vfat_cluster_t current_index;
+	vfat_cluster_t next_index;
+	vfat_sector_t lba;
+	size_t sector_size;
+	uint32_t sectors_per_page;
+
+	sector_size = ctx->bytes_per_sector;
+	sectors_per_page = PMM_PAGE_SIZE / sector_size;
+	current_index = start_cluster;
+	mapper = ctx->mapper;
+
+	vfat_dmsg(1,"%s: freeling fat entries starting by %u\n",  __FUNCTION__, start_cluster);
+
+	while((current_index > 0) && (current_index < 0x0FFFFFF7))
+	{
+		lba =  ctx->fat_begin_lba + ((current_index *4) / sector_size);
+
+		vfat_dmsg(1,"%s: query FAT at %d lba to get next cluster index of %u\n",
+			  __FUNCTION__, lba, current_index);
+
+		page = mapper_get_page(mapper, lba / sectors_per_page, MAPPER_SYNC_OP);
+
+		if(page == NULL)
+		{
+			*err= VFS_IO_ERR;
+			return;
+		}
+
+		sector = (vfat_sector_t*) ppm_page2addr(page);
+		sector += (lba%sectors_per_page) * (sector_size/4);
+
+		page_lock(page);
+		next_index = sector[current_index % (sector_size/4)] & 0x0FFFFFFF;
+		sector[current_index % (sector_size/4)] = 0x00;
+		mapper->m_ops->set_page_dirty(page);
+		page_unlock(page);
+		vfat_dmsg(1,"%s: page #%d (@%x) is set to delayed write\n", __FUNCTION__, page->index, page);
+		//page_refcount_down(page);
+
+#if VFAT_INSTRUMENT
+		wr_count ++;
+#endif
+
+		vfat_dmsg(1,"%s: content of %d is set to 0, next cluster in the list is %d\n",
+				__FUNCTION__, current_index, next_index);
+		current_index = next_index;
+	}
+	*err = 0;
+}
+
+
+error_t vfat_free_fat_entry(struct vfat_context_s* ctx, vfat_cluster_t start_cluster)
+{
+	error_t err;
+	RCPC(ctx->fat_cid, RPC_PRIO_FS, __vfat_free_fat_entry, 
+					RPC_RECV(RPC_RECV_OBJ(err)), 
+					RPC_SEND(RPC_SEND_OBJ(ctx),
+					RPC_SEND_OBJ(start_cluster)));
+	return err;
+}
+
+//RPC_DECLARE(__vfat_locate_entry, RPC_RET(RPC_RET_PTR(error_t, err), RPC_RET_PTR(uint_t, entry_index)), 
+//	RPC_ARG(RPC_ARG_PTR(char, entry_name), RPC_ARG_PTR(struct vfat_entry_request_s, rq)))
+error_t vfat_locate_entry(struct vfat_entry_request_s *rq)
+{
+	struct vfat_context_s *ctx;
+	struct vfat_DirEntry_s *dir;
+	struct page_s *page;
+	struct mapper_s *mapper;
+	struct vfs_inode_s *parent;
+	struct vfat_inode_s *parent_info;
+	uint_t entries_nr;
+	uint_t entry;
+	uint_t entry_id;
+	uint_t current_page;
+	size_t current_offset;
+	char name[VFS_MAX_NAME_LENGTH + 1]; /* +1 for string null termination */
+	uint32_t found;
+
+	ctx = rq->ctx;
+	dir = NULL;
+	page = NULL;
+	parent = rq->parent;
+	mapper = parent->i_mapper;
+	parent_info = parent->i_pv;
+	entries_nr = PMM_PAGE_SIZE / sizeof(struct vfat_DirEntry_s);
+	current_page = 0;
+	current_offset = 0;
+	found = 0;
+	entry_id = 0;
+
+	vfat_dmsg(1,"%s: started, node %s\n", __FUNCTION__, rq->entry_name);
+
+	while(!found) 
+	{
+		page = mapper_get_page(mapper, current_page, MAPPER_SYNC_OP);
+
+		if(page == NULL){ return VFS_IO_ERR;}
+
+		page_lock(page);
+
+		dir = (struct vfat_DirEntry_s*) ppm_page2addr(page);
+
+		for(entry=0; entry < entries_nr; entry ++)
+		{
+			if(dir[entry].DIR_Name[0] == 0x00)
+			{
+				//page_refcount_down(page);
+				page_unlock(page);
+				return VFS_NOT_FOUND;
+			}
+
+			if(dir[entry].DIR_Name[0] == 0xE5)
+				continue;
+
+			if(dir[entry].DIR_Name[0] == '.')
+				continue;
+
+			if(rq->entry_name == NULL)
+			{
+				page_unlock(page);
+				return VFS_ENOTEMPTY;
+			}
+
+			if(dir[entry].DIR_Attr == 0x0F)
+				continue;
+
+			vfat_getshortname((char *)dir[entry].DIR_Name, name);
+
+			if(!strcmp(name,rq->entry_name))
+			{
+				found = 1;
+
+				if (rq->entry != NULL)
+					memcpy(rq->entry, &dir[entry], sizeof(*dir));
+
+				vfat_dmsg(1, "%s: entries_nr %d, entry_id %d, entry %d\n",
+						__FUNCTION__,
+						entries_nr,
+						entry_id,
+						entry);
+
+				*rq->entry_index = (entry_id * entries_nr) + entry;
+				break;
+			}
+
+			current_offset += sizeof (struct vfat_DirEntry_s);
+		}
+
+		entry_id++;
+		current_page++;
+		page_unlock(page);
+	}
+
+	vfat_dmsg(1,"%s: found %d, entry_index %d\n", __FUNCTION__, found, *rq->entry_index);
+
+	return (found) ? VFS_FOUND : VFS_NOT_FOUND;
+}
+
+
+RPC_DECLARE(__vfat_cluster_lookup, RPC_RET(RPC_RET_PTR(error_t, err), 
+			RPC_RET_PTR(vfat_cluster_t, cluster_index),
+			RPC_RET_PTR(uint_t, extended)),
+
+			RPC_ARG(RPC_ARG_VAL(struct vfat_context_s*, ctx),
+			RPC_ARG_VAL(vfat_cluster_t, node_cluster),
+			RPC_ARG_VAL(vfat_cluster_t, cluster_rank)))
+			
+{
+	struct page_s* page;
+	struct mapper_s* mapper;
+	register vfat_cluster_t i, current_vfat_cluster;
+	vfat_cluster_t next_cluster;
+	vfat_cluster_t cluster_offset, old_cluster_offset;
+	vfat_sector_t *sector;
+	uint32_t sectors_per_page;
+	uint32_t old_page_id, page_id;
+
+	sectors_per_page = PMM_PAGE_SIZE / ctx->bytes_per_cluster;
+	*extended = 0;
+	current_vfat_cluster = node_cluster;
+	next_cluster = 0;
+
+	old_cluster_offset = ctx->fat_begin_lba*(ctx->bytes_per_sector/4) + current_vfat_cluster;
+	old_page_id = old_cluster_offset / (PMM_PAGE_SIZE/4);
+
+	mapper = ctx->mapper;
+	page = mapper_get_page(mapper, old_page_id, MAPPER_SYNC_OP);
+
+	if(page == NULL) {*err = VFS_IO_ERR; return;}
+
+	sector = (vfat_sector_t*) ppm_page2addr(page);
+
+	vfat_dmsg(1,"%s: started, first cluster %u, cluster rank %d\n",__FUNCTION__, node_cluster, cluster_rank);
+
+	for(i=0; i < cluster_rank; i++) 
+	{
+		vfat_dmsg(5,"%s: loop %d/%d\n",__FUNCTION__,i+1,cluster_rank);
+		next_cluster = sector[old_cluster_offset % (PMM_PAGE_SIZE/4)] & 0x0FFFFFFF;
+		vfat_dmsg(5,"%s: next cluster found %u\n",__FUNCTION__, next_cluster);
+
+		if(next_cluster == 0x0FFFFFF7)  // bad block
+			{*err = VFS_EBADBLK; return;}
+
+		if(next_cluster >= 0x0FFFFFF8)
+		{ 
+			if(vfat_extend_cluster(ctx, current_vfat_cluster, &next_cluster))
+				// error while trying to extend
+				{*err = VFS_IO_ERR; return;}
+
+			if(next_cluster == 0)
+				// no more space for another cluster
+				{*err = VFS_ENOSPC; return;}
+
+			*extended = 1;
+		}
+
+		current_vfat_cluster = next_cluster;
+		cluster_offset = ctx->fat_begin_lba * (ctx->bytes_per_sector/4) + current_vfat_cluster;
+		page_id = cluster_offset / (PMM_PAGE_SIZE/4);
+
+		if(page_id != old_page_id)
+		{
+			//page_refcount_down(page);
+
+			page = mapper_get_page(mapper, page_id, MAPPER_SYNC_OP);
+
+			if(page == NULL) {*err = VFS_IO_ERR; return;}
+
+			sector = (vfat_sector_t*) ppm_page2addr(page);
+
+			vfat_dmsg(3, "%s: loading page %d for cluster %u\n", __FUNCTION__, page_id, next_cluster);
+			old_page_id = page_id;
+		}
+
+		old_cluster_offset = cluster_offset;
+	}
+
+	vfat_dmsg(1, "%s: cluster found: %u\n", __FUNCTION__, current_vfat_cluster);
+	//page_refcount_down(page);
+	*cluster_index = current_vfat_cluster;
+	*err = 0;
+}
+
+error_t vfat_cluster_lookup(struct vfat_context_s* ctx,
+			    vfat_cluster_t node_cluster,
+			    vfat_cluster_t cluster_rank,
+			    vfat_cluster_t *cluster_index,
+			    uint_t *extended)
+{
+	error_t err;
+	vfat_cluster_t index;
+	uint_t extd;
+
+	RCPC(ctx->fat_cid, RPC_PRIO_FS, __vfat_cluster_lookup, 
+					RPC_RECV(RPC_RECV_OBJ(err), 
+						RPC_RECV_OBJ(index),
+						RPC_RECV_OBJ(extd)), 
+
+					RPC_SEND(RPC_SEND_OBJ(ctx),
+						RPC_SEND_OBJ(node_cluster), 
+						RPC_SEND_OBJ(cluster_rank)));
+	*extended = extd;
+	*cluster_index = index;
+	return err;
+}
Index: trunk/kernel/fs/fatfs/fat32_context.c
===================================================================
--- trunk/kernel/fs/fatfs/fat32_context.c	(revision 1)
+++ trunk/kernel/fs/fatfs/fat32_context.c	(revision 1)
@@ -0,0 +1,231 @@
+/*
+ * fat32/fat32_context.c - fat32 context related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <kdmsg.h>
+#include <device.h>
+#include <driver.h>
+#include <kmem.h>
+#include <rwlock.h>
+#include <string.h>
+#include <page.h>
+#include <cluster.h>
+#include <thread.h>
+#include <mapper.h>
+#include <atomic.h>
+#include <vfs.h>
+ 
+#include <fat32.h>
+#include <fat32-private.h>
+
+static error_t vfat_context_init(struct vfat_context_s *ctx)
+{
+	size_t blk_sz;
+	dev_params_t params;
+	struct vfat_bpb_s *bpb;
+	struct page_s *page;
+	struct mapper_s *mapper;
+  
+	if((ctx->dev->op.dev.get_params(ctx->dev, &params)))
+		return -1;
+
+	blk_sz                = params.sector_size;
+	ctx->bytes_per_sector = blk_sz;
+	mapper                = ctx->mapper;
+       
+	page = mapper_get_page(mapper, 0, MAPPER_SYNC_OP);
+
+	if(page == NULL) 
+	{
+		printk(ERROR, "ERROR: VFAT context_init: I/O error, could not read bpb from the device.\n");
+		return -1;
+	}
+
+	bpb = (struct vfat_bpb_s *) ppm_page2addr(page);
+
+	ctx->bytes_per_sector = bpb->BPB_BytsPerSec;
+
+	if (blk_sz != ctx->bytes_per_sector)
+		PANIC("VFAT drv error: bpb/device block size mismatch bpb block %d, devBlk %d\n",
+		      ctx->bytes_per_sector, blk_sz);
+
+	ctx->fat_begin_lba         = bpb->BPB_RsvdSecCnt;
+	ctx->fat_blk_count         = bpb->BPB_FATSz32;
+	ctx->cluster_begin_lba     = ctx->fat_begin_lba + (bpb->BPB_NumFATs * bpb->BPB_FATSz32);
+	ctx->sectors_per_cluster   = bpb->BPB_SecPerClus;
+	ctx->rootdir_first_cluster = bpb->BPB_RootClus;
+	ctx->bytes_per_cluster     = ctx->bytes_per_sector * ctx->sectors_per_cluster;
+	ctx->last_allocated_sector = ctx->fat_begin_lba;
+	ctx->last_allocated_index  = 2;
+
+	vfat_dmsg(1, 
+		  "%s:\n\tbegin_lba %d\n\tblk_count %d\n\tcluster_begin_lba %d\n\t"
+		  "sectors_per_cluster %d\n\trootdir_first_cluster  %d\n\tbytes_per_cluster %d\n\t"
+		  "MediaType %x (@%x)\n",
+		  __FUNCTION__,
+		  ctx->fat_begin_lba, 
+		  ctx->fat_blk_count,
+		  ctx->cluster_begin_lba, 
+		  ctx->sectors_per_cluster,
+		  ctx->rootdir_first_cluster, 
+		  ctx->bytes_per_cluster,
+		  bpb->BPB_Media,
+		  &bpb->BPB_Media);
+
+	vfat_dmsg(1, "DEBUG: context_init: last allocated sector %d, last allocated index %d\n",
+		  ctx->last_allocated_sector, ctx->last_allocated_index);
+
+	
+	return 0;
+}
+
+VFS_CREATE_CONTEXT(vfat_create_context)
+{
+	kmem_req_t req;
+	struct vfat_context_s *vfat_ctx;
+	struct mapper_s *mapper;
+	error_t err;
+
+	vfat_dmsg(1, "%s: started\n", __FUNCTION__);
+  
+	vfat_ctx = &context->ctx_vfat;
+
+	vfat_ctx->dev = context->ctx_dev;//necessary ?
+
+	rwlock_init(&vfat_ctx->lock);
+
+	req.type = KMEM_MAPPER;
+	req.size = sizeof(*mapper);
+	mapper   = kmem_alloc(&req);
+
+	if(mapper == NULL)
+	{
+		err = ENOMEM;
+		goto fail_mapper;
+	}
+
+	err = mapper_init(mapper, &vfat_inode_mapper_op, NULL, vfat_ctx);
+
+	if(err)
+	{
+		printk(ERROR, "ERROR: %s: failed to init mapper, err %d\n", __FUNCTION__, err);
+		goto fail_mapper_init;
+	}
+
+	vfat_ctx->mapper = mapper;
+	vfat_ctx->fat_cid = current_cid;
+
+	if ((err = vfat_context_init(vfat_ctx)))
+	{
+		printk(ERROR, "ERROR: vfat_create_context: INITIALIZING VFAT CONTEXT err %d\n",err);
+		goto fail_ctx_init;
+	}
+
+	context->ctx_flags	|= VFS_FS_USE_MAPPER;
+	context->ctx_type	= VFS_VFAT_TYPE;
+	context->ctx_blksize	= vfat_ctx->bytes_per_sector;
+	context->ctx_op		= (struct vfs_context_op_s *) &vfat_ctx_op;
+	context->ctx_inode_op	= (struct vfs_inode_op_s *) &vfat_i_op;
+	context->ctx_dirent_op	= (struct vfs_dirent_op_s *) &vfat_d_op;
+	context->ctx_file_op	= (struct vfs_file_op_s *) &vfat_f_op;
+
+	return 0;
+
+fail_ctx_init:
+fail_mapper_init:
+	mapper_destroy(mapper, false);
+	req.type = KMEM_MAPPER;
+	req.ptr  = mapper;
+	kmem_free(&req);
+
+fail_mapper:
+	req.type = KMEM_VFAT_CTX;
+	req.ptr  = vfat_ctx;
+	kmem_free(&req);
+
+	rwlock_destroy(&vfat_ctx->lock);
+	return err;
+}
+
+VFS_DESTROY_CONTEXT(vfat_destroy_context)
+{
+	struct vfat_context_s *ctx;
+
+	ctx = &context->ctx_vfat;
+	mapper_destroy(ctx->mapper, true);
+	rwlock_destroy(&ctx->lock);
+	return 0;
+}
+
+
+VFS_READ_ROOT(vfat_read_root)
+{
+	struct vfat_context_s *ctx;
+	struct vfat_inode_s * i_info;
+	
+	ctx = &context->ctx_vfat;
+
+	root->i_type		|= VFS_DIR;//?
+	root->i_links		= 1;
+	root->i_attr		|= VFS_DIR;
+	root->i_size		= vfat_cluster_count(ctx, ctx->rootdir_first_cluster);//does a dir has a size?
+	root->i_mapper->m_inode = root;
+	root->i_mapper->m_ops	= &vfat_inode_mapper_op;
+	root->i_number		= vfs_inum_new(context);
+
+	assert(root->i_pv);
+	i_info                 = root->i_pv;
+	i_info->flags          = VFAT_ATTR_DIRECTORY;
+	i_info->first_cluster  = ctx->rootdir_first_cluster;
+	//i_info->parent_cluster = 0;
+	//i_info->entry_index    = 0;
+
+	return 0;
+}
+
+
+VFS_WRITE_ROOT(vfat_write_root)
+{
+	return 0;
+}
+
+
+KMEM_OBJATTR_INIT(vfat_kmem_context_init)
+{
+	attr->type   = KMEM_VFAT_CTX;
+	attr->name   = "KCM VFAT CTX";
+	attr->size   = sizeof(struct vfat_context_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_VFAT_CTX_MIN;
+	attr->max    = CONFIG_VFAT_CTX_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+	return 0;
+}
+
+const struct vfs_context_op_s vfat_ctx_op =
+{
+	.create     = vfat_create_context,
+	.destroy    = vfat_destroy_context,
+	.read_root  = vfat_read_root,
+	.write_root = vfat_write_root,
+	.repli_root = NULL
+};
Index: trunk/kernel/fs/fatfs/fat32_file.c
===================================================================
--- trunk/kernel/fs/fatfs/fat32_file.c	(revision 1)
+++ trunk/kernel/fs/fatfs/fat32_file.c	(revision 1)
@@ -0,0 +1,162 @@
+/*
+ * fat32/fat32_file.c - fat32 file related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+#include <kmem.h>
+#include <string.h>
+#include <ppm.h>
+#include <pmm.h>
+#include <page.h>
+#include <mapper.h>
+#include <vfs.h>
+#include <ppn.h>
+#include <thread.h>
+#include <sys-vfs.h>
+
+#include <fat32.h>
+#include <fat32-private.h>
+
+VFS_OPEN_FILE(vfat_open) 
+{
+	return 0;
+}
+
+VFS_LSEEK_FILE(vfat_lseek)
+{
+	return 0;
+}
+
+VFS_CLOSE_FILE(vfat_close) 
+{
+	return 0;
+}
+
+VFS_RELEASE_FILE(vfat_release) 
+{
+	assert(file->fr_pv == NULL);
+	return 0;
+}
+
+
+VFS_READ_DIR(vfat_readdir) 
+{
+	struct vfat_DirEntry_s dir;
+	struct page_s *page;
+	struct mapper_s *mapper;
+	vfat_cluster_t node_cluster;
+	uint8_t *buff;
+	uint32_t found;
+
+	mapper    = file->fr_inode->i_mapper;
+	found     = 0;
+
+	/* TODO: dont call mapper every time, as page can be reused */
+	while(!found) 
+	{
+		//FIXME: synchro : either use a lock or force the writer to
+		//write the first byte of the name as the last thing he do
+		//when adding an entry
+		//also lock file offset ?
+		if ((page = mapper_get_page(mapper, 
+					    file->fr_offset >> PMM_PAGE_SHIFT, 
+					    MAPPER_SYNC_OP)) == NULL)
+			return VFS_IO_ERR;
+
+		buff  = ppm_page2addr(page);
+		buff += file->fr_offset % PMM_PAGE_SIZE;
+
+		memcpy(&dir, buff, sizeof(dir));
+
+		if(dir.DIR_Name[0] == 0x00) {
+			vfat_dmsg(3,"vfat_readdir: entries termination found (0x00)\n");
+			goto VFS_READ_DIR_EODIR;
+		}
+
+		if(dir.DIR_Name[0] == 0xE5) {
+			vfat_dmsg(3,"entry was freeed previously\n");
+			vfat_getshortname((char*)dir.DIR_Name, (char*)dirent->u_name);
+			vfat_dmsg(3,"it was %s\n",dirent->u_name);
+			goto VFS_READ_DIR_NEXT;
+		}
+
+		if(dir.DIR_Attr == 0x0F) {
+			vfat_dmsg(3,"this entry is a long one\n");
+			vfat_getshortname((char*)dir.DIR_Name, (char*)dirent->u_name);
+			vfat_dmsg(3,"trying to read its name %s\n",dirent->u_name);
+			goto VFS_READ_DIR_NEXT;
+		}
+
+		if(dir.DIR_Name[0] == '.')
+			goto VFS_READ_DIR_NEXT;
+
+		found = 1;
+		vfat_getshortname((char *)dir.DIR_Name, (char*)dirent->u_name);
+
+		//dirent->d_size = dir.DIR_FileSize;
+		dirent->u_attr = 0;
+
+		if(dir.DIR_Attr & VFAT_ATTR_DIRECTORY)
+			dirent->u_attr = VFS_DIR;
+
+		if(dir.DIR_Attr & VFAT_ATTR_SYSTEM)
+			dirent->u_attr |= VFS_SYS;
+
+		if(dir.DIR_Attr & VFAT_ATTR_ARCHIVE)
+			dirent->u_attr |= VFS_ARCHIVE;
+
+		if(dir.DIR_Attr & VFAT_ATTR_READ_ONLY)
+			dirent->u_attr |= VFS_RD_ONLY;
+
+		node_cluster  = dir.DIR_FstClusHI << 16;
+		node_cluster |= (0x0000FFFF & dir.DIR_FstClusLO);
+
+		if((!node_cluster) && (dirent->u_attr & VFS_SYS)
+		   && (dirent->u_attr & VFS_RD_ONLY) && (dirent->u_attr & VFS_DIR)) {
+			dirent->u_attr |= VFS_DEV;
+			dirent->u_attr &= ~(VFS_SYS | VFS_RD_ONLY | VFS_DIR);
+		}
+		else
+			if((!node_cluster) && (dirent->u_attr & VFS_SYS) && (dirent->u_attr & VFS_RD_ONLY)) {
+				dirent->u_attr |= VFS_FIFO;
+				dirent->u_attr &= ~(VFS_SYS | VFS_RD_ONLY);
+			}
+
+	VFS_READ_DIR_NEXT:
+		file->fr_offset += sizeof(struct vfat_DirEntry_s);
+	}
+
+VFS_READ_DIR_EODIR:
+	return (found) ? 0 : VFS_EODIR;
+}
+
+const struct vfs_file_op_s vfat_f_op =
+{
+	.open    = vfat_open,
+	.read    = vfs_default_read,
+	.write   = vfs_default_write,
+	.lseek   = NULL,
+	.readdir = vfat_readdir,
+	.close   = vfat_close,
+	.release = vfat_release,
+	.mmap    = vfs_default_mmap_file,
+	.munmap  = vfs_default_munmap_file
+};
Index: trunk/kernel/fs/fatfs/fat32_mapper.c
===================================================================
--- trunk/kernel/fs/fatfs/fat32_mapper.c	(revision 1)
+++ trunk/kernel/fs/fatfs/fat32_mapper.c	(revision 1)
@@ -0,0 +1,313 @@
+/*
+ * fat32/fat32_mapper.c - fat32 mapper related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+#include <page.h>
+#include <ppm.h>
+#include <pmm.h>
+#include <vfs.h>
+#include <thread.h>
+#include <driver.h>
+#include <blkio.h>
+#include <mapper.h>
+#include <list.h>
+
+#include <fat32.h>
+#include <fat32-private.h>
+
+//TODO: remove 
+struct vfat_file_s
+{
+	struct vfat_context_s *ctx;
+	vfat_cluster_t  first_cluster;
+	vfat_cluster_t  pg_current_cluster;
+	vfat_cluster_t  pg_current_rank;
+};
+
+static inline error_t vfat_pgio_fat(struct vfat_context_s* ctx, struct page_s *page, uint_t flags) 
+{
+	struct blkio_s *blkio;
+	struct device_s* dev;
+	uint_t sectors_per_page;
+	vfat_cluster_t lba_start;
+	uint_t vaddr;
+	error_t err;
+
+	dev              = ctx->dev;
+	sectors_per_page = PMM_PAGE_SIZE / ctx->bytes_per_sector;
+	lba_start        = page->index * sectors_per_page;
+  
+	if((err = blkio_init(dev, page, 1)) != 0)
+		return err;
+
+	vaddr = (uint_t) ppm_page2addr(page);
+
+	blkio                 = list_first(&page->root, struct blkio_s, b_list);
+	blkio->b_dev_rq.src   = (void*)lba_start;
+	blkio->b_dev_rq.dst   = (void*)vaddr;
+	blkio->b_dev_rq.count = sectors_per_page;
+
+	err = blkio_sync(page,flags);
+	blkio_destroy(page);
+	return err;
+}
+
+//TODO: remove file info ?
+static inline error_t vfat_pgio_reg(struct vfat_file_s *file_info, struct page_s *page, uint_t flags)
+{
+	struct vfat_context_s* ctx;
+	struct slist_entry *iter;
+	struct blkio_s *blkio;
+	vfat_cluster_t cluster_rank;
+	vfat_cluster_t effective_rank;
+	vfat_cluster_t current_vfat_cluster;
+	uint_t sector_start;
+	uint_t sector_count;
+	uint_t blkio_nr;
+	uint_t clusters_per_page;
+	uint_t vaddr;
+	error_t err;
+
+	ctx = file_info->ctx;
+
+	clusters_per_page = (ctx->bytes_per_cluster <= PMM_PAGE_SIZE) ? 
+		PMM_PAGE_SIZE / ctx->bytes_per_cluster : 1;
+
+	vfat_cluster_t cluster_index[clusters_per_page];
+	uint_t extended[clusters_per_page];
+
+	current_vfat_cluster = file_info->pg_current_cluster;
+	cluster_rank     = (page->index << PMM_PAGE_SHIFT) / ctx->bytes_per_cluster;
+	effective_rank   = cluster_rank;
+	cluster_index[0] = current_vfat_cluster;
+	extended[0]      = 0;
+
+	vfat_dmsg(1, "%s: %d clusters per page, %d is the first clstr, current clstr %d, rank %d\n",
+		  __FUNCTION__, 
+		  clusters_per_page, 
+		  file_info->first_cluster, 
+		  current_vfat_cluster, 
+		  cluster_rank);
+
+	if(cluster_rank != file_info->pg_current_rank)
+	{
+		if(cluster_rank > file_info->pg_current_rank)
+			effective_rank -= file_info->pg_current_rank;
+		else
+			current_vfat_cluster = file_info->first_cluster;
+
+		vfat_dmsg(1, "%s: pgindex %d, cluster_rank %d, effective_rank %d, current_cluster %d\n",
+			  __FUNCTION__, 
+			  page->index, 
+			  cluster_rank, 
+			  effective_rank, 
+			  current_vfat_cluster);
+  
+		if(effective_rank != 0)
+		{
+			err = vfat_cluster_lookup(ctx, 
+						  current_vfat_cluster, 
+						  effective_rank, 
+						  &cluster_index[0], 
+						  &extended[0]);
+
+			if(err) return err;
+		}
+
+		current_vfat_cluster = cluster_index[0];
+	}
+
+	current_vfat_cluster = cluster_index[0];
+	vfat_dmsg(1, "%s: %d is the first cluster to be read\n", __FUNCTION__, current_vfat_cluster);
+  
+	for (blkio_nr = 1; blkio_nr < clusters_per_page; blkio_nr++) 
+	{
+		if((err = vfat_cluster_lookup(ctx,
+					      current_vfat_cluster,
+					      1,
+					      &cluster_index[blkio_nr],
+					      &extended[blkio_nr])) != 0) 
+		{
+			if (err == VFS_ENOSPC && (flags & BLKIO_RD))
+			{
+				extended[blkio_nr] = 1; /* to adjust the i counter */
+				break;
+			}
+			return err;
+		}
+		current_vfat_cluster = cluster_index[blkio_nr];
+	}
+
+	uint_t i = clusters_per_page;
+
+	if (flags & BLKIO_RD)
+	{
+		for (i = 0; i < clusters_per_page; i++)
+			if (extended[i])
+				break;
+	}
+  
+	current_vfat_cluster = cluster_index[0];
+	sector_start = VFAT_CONVERT_CLUSTER(ctx,current_vfat_cluster);
+  
+	if (i == 0) // Nothing to read because it's a new cluster.
+		return 0;
+
+	if(ctx->bytes_per_cluster <= PMM_PAGE_SIZE) 
+	{
+		// mutliple clusters per page
+		sector_count = ctx->sectors_per_cluster;
+	}
+	else 
+	{
+		// clusters in multiple pages
+		sector_count = PMM_PAGE_SIZE / ctx->bytes_per_sector;
+		blkio_nr     = page->index % (ctx->bytes_per_cluster >> PMM_PAGE_SHIFT);
+		sector_start = sector_start + blkio_nr * sector_count;
+	}
+  
+	// initializing the blkio structures
+	if((err = blkio_init(ctx->dev, page, i)))
+		return err;
+
+	vaddr = (uint_t) ppm_page2addr(page);
+	i = 0;
+
+	vfat_dmsg(1, "%s, new page %p\n", __FUNCTION__, vaddr);
+  
+	// we initialize the dev requests for each sector
+	list_foreach(&page->root, iter) 
+	{
+		blkio = list_element(iter, struct blkio_s, b_list);
+		blkio->b_dev_rq.src   = (void*)sector_start;
+		blkio->b_dev_rq.dst   = (void*)vaddr;
+		blkio->b_dev_rq.count = sector_count;
+		i++;
+
+		// lookup the next cluster
+		if((clusters_per_page > 1) && (i < clusters_per_page))  
+		{
+			current_vfat_cluster = cluster_index[i];
+			sector_start         = VFAT_CONVERT_CLUSTER(ctx,current_vfat_cluster);
+			vaddr               += ctx->bytes_per_cluster;
+			cluster_rank ++;
+		}
+	}
+
+	err = blkio_sync(page,flags);
+	blkio_destroy(page);
+	file_info->pg_current_cluster = current_vfat_cluster;
+	file_info->pg_current_rank    = cluster_rank;
+
+	return err;
+}
+
+MAPPER_READ_PAGE(vfat_node_read_page)
+{
+	struct mapper_s *mapper;
+	struct vfs_inode_s *inode;
+	struct vfat_inode_s *node_info;
+	struct vfat_file_s file_info;
+	uint_t op_flags;
+
+	op_flags = (flags & MAPPER_SYNC_OP) ? BLKIO_SYNC | BLKIO_RD : BLKIO_RD;
+
+	mapper = page->mapper;
+
+	if(mapper->m_inode == NULL)
+		return vfat_pgio_fat(mapper->m_data, page, op_flags);
+
+	inode                        = mapper->m_inode;
+	node_info                    = inode->i_pv;
+	file_info.ctx                = &inode->i_ctx->ctx_vfat;
+	file_info.first_cluster       = node_info->first_cluster;
+	file_info.pg_current_cluster = node_info->first_cluster;
+	file_info.pg_current_rank    = 0;
+
+	return vfat_pgio_reg(&file_info, page, op_flags);
+}
+
+MAPPER_WRITE_PAGE(vfat_node_write_page) 
+{
+	struct mapper_s *mapper;
+	struct vfs_inode_s *inode;
+	struct vfat_inode_s *node_info;
+	struct vfat_file_s file_info;
+	uint_t op_flags;
+
+	op_flags = (flags & MAPPER_SYNC_OP) ? BLKIO_SYNC : 0;
+
+	mapper = page->mapper;
+
+	if(mapper->m_inode == NULL)
+		return vfat_pgio_fat(mapper->m_data, page, op_flags);
+
+	inode                        = page->mapper->m_inode;
+	node_info                    = inode->i_pv;
+	file_info.ctx                = &inode->i_ctx->ctx_vfat;
+	file_info.first_cluster       = node_info->first_cluster;
+	file_info.pg_current_cluster = node_info->first_cluster;
+	file_info.pg_current_rank    = 0;
+
+	return vfat_pgio_reg(&file_info, page, op_flags);
+}
+
+MAPPER_READ_PAGE(vfat_file_read_page) 
+{
+	uint_t op_flags;
+	struct mapper_s *mapper;
+	struct vfat_file_s file_info;
+	struct vfs_inode_s *inode;
+	struct vfat_inode_s *node_info;
+
+	op_flags = (flags & MAPPER_SYNC_OP) ? BLKIO_SYNC | BLKIO_RD : BLKIO_RD;
+
+	mapper = page->mapper;
+	inode                        = mapper->m_inode;
+	node_info                    = inode->i_pv;
+	file_info.ctx                = &inode->i_ctx->ctx_vfat;
+	file_info.first_cluster       = node_info->first_cluster;
+	file_info.pg_current_cluster = node_info->first_cluster;
+	file_info.pg_current_rank    = 0;
+
+	return vfat_pgio_reg(&file_info, page, op_flags);
+}
+
+const struct mapper_op_s vfat_file_mapper_op =
+{
+	.writepage        = vfat_node_write_page,
+	.readpage         = vfat_file_read_page,
+	.sync_page        = mapper_default_sync_page,
+	.set_page_dirty   = mapper_default_set_page_dirty,
+	.clear_page_dirty = mapper_default_clear_page_dirty,
+	.releasepage      = mapper_default_release_page,
+};
+
+const struct mapper_op_s vfat_inode_mapper_op =
+{
+	.writepage        = vfat_node_write_page,
+	.readpage         = vfat_node_read_page,
+	.sync_page        = mapper_default_sync_page,
+	.set_page_dirty   = mapper_default_set_page_dirty,
+	.clear_page_dirty = mapper_default_clear_page_dirty,
+	.releasepage      = mapper_default_release_page,
+};
Index: trunk/kernel/fs/fatfs/fat32_node.c
===================================================================
--- trunk/kernel/fs/fatfs/fat32_node.c	(revision 1)
+++ trunk/kernel/fs/fatfs/fat32_node.c	(revision 1)
@@ -0,0 +1,781 @@
+/*
+ * fat32/fat32_node.c - fat32 node related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <kmem.h>
+#include <string.h>
+#include <thread.h>
+#include <cluster.h>
+#include <ppm.h>
+#include <pmm.h>
+#include <page.h>
+#include <mapper.h>
+#include <vfs.h>
+
+#include <fat32.h>
+#include <fat32-private.h>
+
+
+KMEM_OBJATTR_INIT(vfat_kmem_inode_init)
+{
+	attr->type   = KMEM_VFAT_NODE;
+	attr->name   = "KCM VFAT Node";
+	attr->size   = sizeof(struct vfat_inode_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_VFAT_NODE_MIN;
+	attr->max    = CONFIG_VFAT_NODE_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+	return 0;
+}
+
+
+inline void vfat_getshortname(char *from, char *to) {
+	char *p = to;
+	char *q = from;
+	uint_fast8_t d;
+
+	for(d=0; (d < 8 && *q != ' '); d++)
+		*p++ = *q++;
+
+	if (*(q = &from[8]) != ' ')
+	{
+		*p++ = '.';
+		d = 0;
+		while (d++ < 3 && *q != ' ')
+			*p++ = *q++;
+	}
+
+	*p = 0;
+}
+
+static inline void vfat_convert_name(char *str1, char *str2) {
+	uint_fast8_t i;
+	char *extention_ptr;
+
+	extention_ptr = str2 + 8;
+	memset(str2,' ',11);
+
+	for(i=0; ((*str1) && (*str1 != '.') && (i<11)) ; i++)
+		*str2++ = *str1++;
+
+	if((i<=8) && (*str1 == '.')) {
+		str1++;
+		memcpy(extention_ptr,str1,3);
+	}
+}
+
+
+VFS_INIT_NODE(vfat_init_node)
+{
+	struct vfat_inode_s *inode_info;
+	kmem_req_t req;
+
+	if(inode->i_type != VFS_VFAT_TYPE)
+		return VFS_EINVAL;
+
+	assert(inode->i_mapper);
+
+	if(inode->i_pv != NULL)
+		inode_info = (struct vfat_inode_s*)inode->i_pv;//?
+	else 
+	{
+		req.flags = AF_USER;//?
+		req.type = KMEM_VFAT_NODE;
+		req.size = sizeof(*inode_info);
+    
+		if((inode_info = kmem_alloc(&req)) == NULL)
+		{
+			return VFS_ENOMEM;
+		}
+     
+		inode->i_pv = (void *) inode_info;
+	}
+
+	memset(inode_info, 0, sizeof(*inode_info));    
+	return 0;
+}
+
+
+VFS_RELEASE_NODE(vfat_release_node)
+{
+	kmem_req_t req;
+  
+	if(inode->i_pv != NULL)
+	{
+		req.type = KMEM_VFAT_NODE;
+		req.ptr  = inode->i_pv;
+		kmem_free(&req);
+		inode->i_pv = NULL;
+	}
+  
+	return 0;
+}
+
+
+VFS_ICREATE_NODE(vfat_icreate)
+{
+	struct vfat_inode_s *inode_info;
+	struct vfat_context_s *ctx;
+	struct page_s *tmp_page;
+	kmem_req_t req;
+	error_t err;
+
+	
+	err				= 0;
+	ctx				= &ic->ctx->ctx_vfat;
+	inode_info			= inode->i_pv;
+	assert(inode->i_mapper);
+	inode->i_mapper->m_ops		= &vfat_file_mapper_op;
+
+	inode_info->flags		= ic->vfat_icreate.fat_attr;
+	inode_info->first_cluster	= ic->vfat_icreate.first_cluster;
+
+	vfat_dmsg(1, "Creating new inode with flags %x\n", inode_info->flags);
+
+
+	if(ic->attr & VFS_DIR) 
+	{
+		inode->i_mapper->m_ops = &vfat_inode_mapper_op;
+
+		if(ic->new)
+		{
+			req.type  = KMEM_PAGE;
+			req.size  = 0;
+			req.flags = AF_USER | AF_ZERO;
+			tmp_page  = kmem_alloc(&req);
+	      
+			if(tmp_page != NULL)
+				err = mapper_add_page(inode->i_mapper, tmp_page, 0);
+			else 
+				err = ENOMEM;
+
+			if(err)
+			{
+				if(tmp_page != NULL)
+				{
+					req.ptr = tmp_page;
+					kmem_free(&req);
+				}
+				return err;
+			}
+			/* FIXME: we should also create dot & dotdot entries */
+		}
+ 
+	}
+
+	return err;
+}
+
+//parent must be refcounted!
+//dentry must be set as INLOAD: no other thread can
+//deleted or insert it's entry!
+VFS_CREATE_NODE(vfat_create) 
+{
+	struct vfat_dentry_s *dentry_info;
+	struct vfat_inode_s *parent_info;
+	struct vfat_context_s *ctx;
+	struct page_s *page;
+	struct mapper_s *mapper;
+	struct vfat_DirEntry_s *dir;
+	struct page_s *tmp_page;
+	kmem_req_t req;
+	uint_t current_page;
+	uint_t entries_nr;
+	uint_t entry;
+	vfat_cluster_t new_cluster;
+	size_t current_offset;
+	error_t err;
+
+	ctx         = &parent->i_ctx->ctx_vfat;
+	entries_nr  = PMM_PAGE_SIZE / sizeof(struct vfat_DirEntry_s);
+	mapper      = parent->i_mapper;
+	dir         = NULL;
+	parent_info = NULL;
+	new_cluster = 0;
+	err         = 0;
+	entry       = 0;
+	page        = NULL;
+
+	vfat_dmsg(1,"vfat_create started, dentry/node to be created %s, its parent %s\n",
+		  dentry->d_name, parent->i_number);
+
+	if(dentry->d_ctx->ctx_type != VFS_VFAT_TYPE)
+		return VFS_EINVAL;
+
+	// find a first cluster for the new file
+	if(!(dentry->d_attr & (VFS_FIFO | VFS_DEV)))
+	{
+		if(vfat_alloc_fat_entry(ctx, &new_cluster))
+			return VFS_IO_ERR;
+    
+		if(new_cluster == 0)
+			return -VFS_ENOSPC;
+	}
+
+	dentry_info    = &dentry->d_vfat;
+	parent_info    = (struct vfat_inode_s*) parent->i_pv;
+	current_page   = 0;
+	current_offset = 0;
+
+	while(1) 
+	{
+		//TODO: lock the page in read_only to read it and then lock it back to lock to modify it or 
+		//use CAS to allocate entrys ?
+		if ((page = mapper_get_page(mapper, current_page, MAPPER_SYNC_OP)) == NULL)
+		{
+			err = VFS_IO_ERR;
+			goto VFAT_CREATE_NODE_ERR;
+		}
+
+		dir = (struct vfat_DirEntry_s*) ppm_page2addr(page);
+    
+		page_lock(page);
+    
+		for(entry=0; entry < entries_nr; entry ++)
+		{
+			if((dir[entry].DIR_Name[0] == 0x00) || (dir[entry].DIR_Name[0] == 0xE5))
+			{
+				vfat_dmsg(1,"%s: found entry %d in page %d, name[0] %d\n",
+					  __FUNCTION__,
+					  entry, 
+					  current_page, 
+					  dir[entry].DIR_Name[0]);
+				goto FREE_ENTRY_FOUND;
+			}
+			current_offset += sizeof (struct vfat_DirEntry_s);
+		}
+    
+		page_unlock(page);
+		current_page ++;
+	}
+
+FREE_ENTRY_FOUND:
+	current_offset += sizeof (struct vfat_DirEntry_s);
+	// we need to set the next entry to 0 if we got the last one
+	if (dir[entry].DIR_Name[0] == 0x00) 
+	{
+		if(entry == entries_nr - 1) 
+		{
+			req.type  = KMEM_PAGE;
+			req.size  = 0;
+			req.flags = AF_USER | AF_ZERO;
+			tmp_page  = kmem_alloc(&req);
+      
+			if(tmp_page != NULL)
+				err = mapper_add_page(mapper, tmp_page, current_page + 1);
+			else 
+				err = ENOMEM;
+
+			if(err)
+			{
+				page_unlock(page);
+
+				if(tmp_page != NULL)
+				{
+					req.ptr = tmp_page;
+					kmem_free(&req);
+				}
+
+				goto VFAT_CREATE_NODE_ERR;
+			}
+      		
+			mapper->m_ops->set_page_dirty(tmp_page);
+
+			if (current_offset == parent->i_size)
+				parent->i_size += ctx->bytes_per_cluster;
+		}
+		else
+			dir[entry+1].DIR_Name[0] = 0x00;
+	}
+
+	dir[entry].DIR_FstClusHI = new_cluster >> 16;
+	dir[entry].DIR_FstClusLO = new_cluster & 0xFFFF;
+	dir[entry].DIR_FileSize  = 0;
+	dir[entry].DIR_Attr      = 0;
+
+	if((dentry->d_attr & (VFS_SYS | VFS_FIFO | VFS_DEV)))
+		dir[entry].DIR_Attr |= VFAT_ATTR_SYSTEM;
+
+	if(dentry->d_attr & VFS_ARCHIVE)
+		dir[entry].DIR_Attr |= VFAT_ATTR_ARCHIVE;
+
+	if((dentry->d_attr & (VFS_RD_ONLY | VFS_FIFO | VFS_DEV)))
+		dir[entry].DIR_Attr |= VFAT_ATTR_READ_ONLY;
+
+	if(dentry->d_attr & VFS_DIR)
+		dir[entry].DIR_Attr  |= VFAT_ATTR_DIRECTORY;
+
+	vfat_convert_name(dentry->d_name,(char *)dir[entry].DIR_Name);  /* FIXME: name may be long */
+
+
+#if VFAT_INSTRUMENT
+	wr_count ++;
+#endif
+
+	dentry_info->entry_index    = current_page*entries_nr + entry;
+	dentry_info->first_cluster  = new_cluster;
+	page_unlock(page);
+
+	uint32_t ino = vfs_inum_new(parent->i_ctx);
+	/* As a dir has alwas a page allocated */
+	uint32_t isize = dentry->d_attr & VFS_DIR ? ctx->bytes_per_cluster : 0;
+
+	struct vfs_icreate_s ic = 
+			{.ctx = parent->i_ctx, 
+			.dentry = dentry, 
+			.parent = {.ptr = parent, 
+				.gc = parent->i_gc, 
+				.cid = current_cid},
+			.ino = ino,
+			.size = isize,
+			.attr = dentry->d_attr
+			};
+
+	ic.vfat_icreate.first_cluster = new_cluster;
+	ic.vfat_icreate.fat_attr = dir[entry].DIR_Attr;
+
+	err = vfs_create_inode(&ic);
+
+	if(!err)
+		return 0;
+
+	//find the page of dir, lock it and remove the entry!
+	page_lock(page); //FIXME: is the page still valid ?
+	dir->DIR_Name[0] = (dir[1].DIR_Name[0] == 0x00) ? 0x00 : 0xE5;
+	page_unlock(page);
+
+VFAT_CREATE_NODE_ERR:
+	vfat_free_fat_entry(ctx, new_cluster);
+	return err;
+}
+
+
+//Synchro: since the corresponding dentry is set INLOAD
+//no one can delete the dentry
+VFS_LOOKUP_NODE(vfat_lookup)
+{
+	struct vfat_context_s *ctx;
+	struct vfat_inode_s *parent_info;
+	struct vfat_dentry_s *dentry_info;
+	struct vfat_entry_request_s rq;
+	struct vfat_DirEntry_s dir;
+	size_t isize;
+	vfat_cluster_t first_cluster;
+	uint_t entry_index;
+	error_t err;
+
+	ctx         = &parent->i_ctx->ctx_vfat;
+	parent_info = parent->i_pv;
+	dentry_info = &dentry->d_vfat;
+	err         = 0;
+	isize	    = 0;
+
+	if(!(parent_info->flags & VFAT_ATTR_DIRECTORY))
+		return VFS_ENOTDIR;
+
+	rq.ctx         = ctx;
+	rq.parent      = parent;
+	rq.entry       = &dir;
+	rq.entry_name  = dentry->d_name;
+	rq.entry_index = &entry_index;
+
+	if((err=vfat_locate_entry(&rq)))
+		return err;
+
+#if 0
+	if(((node->i_attr & VFS_DIR) && 1) ^ ((dir.DIR_Attr & VFAT_ATTR_DIRECTORY) && 1))
+		return VFS_ENOTDIR;
+#else
+	if((dentry->d_attr & VFS_DIR) && !(dir.DIR_Attr & VFAT_ATTR_DIRECTORY))
+		return VFS_ENOTDIR;
+#endif
+
+	if(dir.DIR_Attr & VFAT_ATTR_DIRECTORY)
+		dentry->d_attr |= VFS_DIR;
+	else
+		isize = dir.DIR_FileSize;
+
+	if(dir.DIR_Attr & VFAT_ATTR_SYSTEM)    dentry->d_attr |= VFS_SYS;
+	if(dir.DIR_Attr & VFAT_ATTR_ARCHIVE)   dentry->d_attr |= VFS_ARCHIVE;
+	if(dir.DIR_Attr & VFAT_ATTR_READ_ONLY) dentry->d_attr |= VFS_RD_ONLY;
+ 
+	first_cluster			= dir.DIR_FstClusHI << 16;
+	first_cluster			|= (0x0000FFFF & dir.DIR_FstClusLO);
+
+	if((!first_cluster)   && 
+	   (dentry->d_attr & VFS_SYS)     && 
+	   (dentry->d_attr & VFS_RD_ONLY) && 
+	   (dentry->d_attr & VFS_DIR)) 
+	{
+		dentry->d_attr |= VFS_DEV;
+		dentry->d_attr &= ~(VFS_SYS | VFS_RD_ONLY | VFS_DIR);
+	} 
+	else
+	{
+		if((!first_cluster) && 
+		   (dentry->d_attr & VFS_SYS)   && 
+		   (dentry->d_attr & VFS_RD_ONLY)) 
+		{
+			dentry->d_attr |= VFS_FIFO;
+			dentry->d_attr &= ~(VFS_SYS | VFS_RD_ONLY);
+		}
+	}
+
+	if((first_cluster) && (dentry->d_attr & VFS_DIR))
+		isize = vfat_cluster_count(ctx, first_cluster) * ctx->bytes_per_cluster;
+
+	dentry_info->entry_index	= entry_index;
+	dentry_info->first_cluster	= first_cluster;
+
+	uint32_t ino = vfs_inum_new(parent->i_ctx);
+	/* As a dir has alwas a page allocated */
+
+	struct vfs_icreate_s ic = 
+			{.ctx = parent->i_ctx, 
+			.dentry = dentry, 
+			.parent = {.ptr = parent, 
+				.gc = parent->i_gc, 
+				.cid = current_cid},
+			.ino = ino,
+			.size = isize,
+			.attr = dentry->d_attr,
+			};
+
+	ic.vfat_icreate.first_cluster = first_cluster;
+	ic.vfat_icreate.fat_attr = dir.DIR_Attr;
+
+	err = vfs_create_inode(&ic);
+
+	//drop page ?
+	if(err)	return err;
+
+	return VFS_FOUND;
+}
+
+VFS_STAT_NODE(vfat_stat_node)
+{
+	struct vfat_inode_s *inode_info;
+
+	inode_info = inode->i_pv;
+
+	return vfs_stat_inode(inode, inode_info->first_cluster);
+}
+
+RPC_DECLARE(__vfat_write_inode, RPC_RET(RPC_RET_PTR(error_t, err)),
+		RPC_ARG(RPC_ARG_VAL(struct vfs_dentry_s*, dentry), 
+		RPC_ARG_VAL(size_t, size),
+		RPC_ARG_VAL(uint32_t, attr)))
+{
+	struct page_s *page;
+	struct mapper_s *mapper;
+	struct vfs_inode_s *parent;
+	struct vfat_dentry_s *dentry_info;
+	struct vfat_DirEntry_s *dir;
+	uint_t entry_index_page;
+
+	parent		= dentry->d_parent;
+	mapper          = parent->i_mapper;
+	dentry_info	= &dentry->d_vfat;
+	entry_index_page = dentry_info->entry_index * sizeof(struct vfat_DirEntry_s*) >> PMM_PAGE_SHIFT;
+	dentry->d_attr	= attr; 
+
+	*err = VFS_EINVAL;
+	if(dentry->d_ctx->ctx_type != VFS_VFAT_TYPE)
+		return;	
+
+	*err = VFS_IO_ERR;
+	//rd_lock is enough since we are supposed to be holding the dentry above with the INLOAD flag
+	if ((page = mapper_get_page(mapper, entry_index_page, MAPPER_SYNC_OP)) == NULL)
+		return;	
+
+	//do the locking of mapper_get_page, like : MAPPER_PAGE_RD_LOCK
+	page_lock(page);
+
+	dir  = (struct vfat_DirEntry_s*) ppm_page2addr(page);
+	dir += dentry_info->entry_index;
+
+	if(attr & VFS_DIR) dir->DIR_Attr |= VFAT_ATTR_DIRECTORY;
+	if(attr & VFS_SYS) dir->DIR_Attr |= VFAT_ATTR_SYSTEM;
+	if(attr & VFS_ARCHIVE) dir->DIR_Attr |= VFAT_ATTR_ARCHIVE;
+	if(attr & VFS_RD_ONLY) dir->DIR_Attr |= VFAT_ATTR_READ_ONLY;
+
+	dir->DIR_FileSize = size;
+
+	mapper->m_ops->set_page_dirty(page);
+
+	page_unlock(page);
+
+	*err = 0;
+}
+
+//update the dentry of this inode 
+//FIXME: check syncro
+VFS_WRITE_NODE(vfat_write_node)
+{
+	struct vfs_dentry_s *dentry;
+	cid_t dentry_cid;
+	error_t err;
+	uint32_t attr;
+	size_t isize;
+
+	dentry          = inode->i_dentry;
+	dentry_cid      = inode->i_parent.cid;
+	isize		= inode->i_size;
+	attr		= inode->i_attr;
+
+	RCPC(dentry_cid, RPC_PRIO_FS_WRITE, __vfat_write_inode, RPC_RECV(RPC_RECV_OBJ(err)),
+		RPC_SEND(RPC_SEND_OBJ(dentry), RPC_SEND_OBJ(isize), RPC_SEND_OBJ(attr)));
+
+#if VFAT_INSTRUMENT
+	wr_count ++;
+#endif
+	return err;
+}
+
+#if 1
+/* Check if dir is empty and	*
+ * empty dir/files
+ * return 0 if success
+ * else return 1		*
+ * The deletion of the inode is *
+ * no necesseray for the FAT fs *
+ * (as inode does not exist).	*/
+VFS_DELETE_NODE(vfat_delete)
+{
+	struct vfat_inode_s *inode_info;
+	struct vfat_DirEntry_s dir;
+	struct vfat_context_s *ctx;
+	struct mapper_s *mapper;
+	struct page_s *page;
+	uint8_t *buff;
+	uint32_t found;
+	uint32_t offset; //64 bits?
+	error_t err;
+
+	ctx		= &inode->i_ctx->ctx_vfat;
+	inode_info	= inode->i_pv;
+	mapper		= inode->i_mapper;
+	found		= 0;
+	offset		= 0;
+	err		= 0;
+
+	if(!(inode->i_attr & VFS_DIR) )
+		goto FREE_CNT;
+
+
+	/* TODO: dont call mapper every time, as page can be reused */
+	while(!found) 
+	{
+		if ((page = mapper_get_page(mapper, 
+					    offset >> PMM_PAGE_SHIFT, 
+					    MAPPER_SYNC_OP)) == NULL)
+			return VFS_IO_ERR;
+
+		page_lock(page);
+
+		buff  = ppm_page2addr(page);
+		buff += offset % PMM_PAGE_SIZE;
+
+		//is a memcpy necessary?
+		memcpy(&dir, buff, sizeof(dir));
+
+		if(dir.DIR_Name[0] == 0x00) {
+			vfat_dmsg(3,"vfat_readdir: entries termination found (0x00)\n");
+			page_unlock(page);
+			break;
+		}
+
+		if(dir.DIR_Name[0] == 0xE5) {
+			vfat_dmsg(3,"entry was freeed previously\n");
+			goto VFS_READ_DIR_NEXT;
+		}
+
+		if(dir.DIR_Attr == 0x0F) {
+			vfat_dmsg(3,"this entry is a long one\n");
+			// FIXME should not delete dirs who contain long name ? 
+			// knowink that we can't read them.
+			//goto VFS_READ_DIR_NEXT;
+			//found = 1;
+			page_unlock(page);
+			break;
+		}
+
+		if(dir.DIR_Name[0] == '.') // dot and dot_dot entries: since fat doesnot support hiden file!
+			goto VFS_READ_DIR_NEXT;
+
+		vfat_dmsg(1, "DIR NOT empty (%s), name: %s\n",__FUNCTION__, dir.DIR_Name);
+		found = 1;
+
+	VFS_READ_DIR_NEXT:
+		page_unlock(page);
+		if(found) break;
+		offset += sizeof(struct vfat_DirEntry_s);
+	}
+
+FREE_CNT:
+
+	//Free content if not fifo
+	if(!(inode->i_attr & VFS_FIFO))
+		err=vfat_free_fat_entry(ctx, inode_info->first_cluster);
+
+	assert(!err);
+
+	return found ? VFS_ENOTEMPTY : 0;
+}
+
+VFS_UNLINK_NODE(vfat_unlink_node)
+{
+	struct vfat_entry_request_s rq;
+	struct page_s *page;
+	struct page_s *page2;
+	struct mapper_s *mapper;
+	struct vfat_context_s *ctx;
+	struct vfat_dentry_s *dentry_info;
+	struct vfat_DirEntry_s *dir;
+	struct vfat_DirEntry_s *last_dir;
+	uint_t entry_index;
+	uint_t entry_index_page;
+	error_t err;
+	uint_t val;
+
+	page2		= NULL;
+	err		= 0;
+	ctx		= &dentry->d_ctx->ctx_vfat;
+	dentry_info	= &dentry->d_vfat;
+	mapper		= parent->i_mapper;
+
+	//Free FAT name directory entry
+	if((dentry->d_attr & VFS_FIFO) && (dentry->d_op != &vfat_d_op)) //?
+	{
+		rq.entry       = NULL;
+		rq.ctx         = ctx;
+		rq.parent      = parent;
+		rq.entry_name  = dentry->d_name;
+		rq.entry_index = &entry_index;
+
+		if((err=vfat_locate_entry(&rq)))
+			return err;
+
+	} else 
+	{
+		entry_index = dentry_info->entry_index;
+	}
+
+	entry_index_page = (entry_index*sizeof(struct vfat_DirEntry_s)) >> PMM_PAGE_SHIFT;
+	page = mapper_get_page(mapper, entry_index_page, MAPPER_SYNC_OP);
+
+	if(page == NULL)
+	{ 
+		val = entry_index_page;
+		err = VFS_IO_ERR;
+		goto UNLINK_IOERR;
+	}
+
+	dir = (struct vfat_DirEntry_s*) ppm_page2addr(page);
+	dir += entry_index % (PMM_PAGE_SIZE / sizeof(struct vfat_DirEntry_s));
+
+	uint_t entries_nr = PMM_PAGE_SIZE / sizeof(struct vfat_DirEntry_s);
+	val = 0;
+
+	// we are at the last entry in the page, looking for the next page
+	if (entry_index == (entries_nr - 1))
+	{
+		page2 = mapper_get_page(mapper, entry_index_page+1, MAPPER_SYNC_OP);
+
+		if(page2 == NULL)
+		{
+			val = entry_index_page + 1;
+			err = VFS_IO_ERR;
+			goto UNLINK_IOERR;
+		}
+		
+		last_dir = (struct vfat_DirEntry_s*) ppm_page2addr(page2);
+	} 
+	else 
+	{
+		last_dir = &dir[1];
+	}
+
+	//TODO: set page up (here) when the cache can shrink
+
+	//TODO: negatif dentry should be handled in the upper layer
+	assert(dentry->d_inode.cid != CID_NULL);
+	
+	/*  For dirs, this function also check that it is empty.*/
+	err=vfs_unlink_inode(&dentry->d_inode);
+	if(err)
+		goto UNLINK_IOERR;
+
+	if(page2) page_lock(page2);
+	page_lock(page);
+
+	if (last_dir->DIR_Name[0] == 0x00)
+		dir->DIR_Name[0] = 0x00;
+	else
+		dir->DIR_Name[0] = 0xE5;
+
+	mapper->m_ops->set_page_dirty(page);
+	page_unlock(page);
+
+	if(page2) page_unlock(page2);
+
+#if VFAT_INSTRUMENT
+	wr_count ++;
+#endif
+
+UNLINK_IOERR:
+
+	if (err == VFS_IO_ERR)
+	{
+		printk(WARNING,"%s: unable to load page #%d of inode %d while removing node %s\n",
+		       __FUNCTION__,
+		       val,
+		       parent->i_number,
+		       dentry->d_name);
+	}
+	return err;
+}
+#endif
+
+const struct vfs_inode_op_s vfat_i_op =
+{
+	.init    = vfat_init_node,
+	.create  = vfat_create,
+	.icreate = vfat_icreate,
+	.lookup  = vfat_lookup,
+	.write   = vfat_write_node,
+	.release = vfat_release_node,
+	.unlink  = vfat_unlink_node,
+	.delete  = vfat_delete,
+	.stat    = vfat_stat_node,
+	.trunc	 = NULL
+};
+
+VFS_COMPARE_DIRENT(vfat_compare)
+{
+	return strcasecmp(first, second);//TODO
+}
+
+const struct vfs_dentry_op_s vfat_d_op =
+{
+	.compare    = vfat_compare
+};
Index: trunk/kernel/fs/fatfs/fatfs.c
===================================================================
--- trunk/kernel/fs/fatfs/fatfs.c	(revision 1)
+++ trunk/kernel/fs/fatfs/fatfs.c	(revision 1)
@@ -0,0 +1,142 @@
+/*
+ * fatfs.c - FATFS file system API implementation.
+ *
+ * Author    Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <hal_types.h>
+#include <hal_special.h>
+#include <printk.h>
+#include <kmem.h>
+#include <vfs.h>
+#include <fatfs.h>
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// FATFS specific functions : these static functions cannot be directly
+//                            called by the VFS 
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// Generic API : the following functions are called by the VFS, 
+//               and must be defined by all supported file systems.
+///////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+error_t fatfs_inode_create( struct vfs_inode_s * vfs_inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    kmem_req_t      req;
+    error_t         error;
+    fatfs_inode_t * fatfs_inode;
+    uint32_t        cluster;        // allocated cluster index
+
+    // allocate memory for fatfs inode
+	req.type    = KMEM_FATFS_INODE;
+	req.size    = sizeof(fatfs_inode_t);
+    req.flags   = AF_KERNEL | AF_ZERO;
+	fatfs_inode = (fatfs_inode_t *)kmem_alloc( &req );
+
+    if( fatfs_inode == NULL ) return ENOMEM;
+
+    // initialise ramfs_inode 
+    fatfs_inode->first_cluster = 0;   // TODO ???
+    fatfs_inode->ctx           = (fatfs_ctx_t *)vfs_inode->ctx->extend;
+ 
+    // link vfs_inode to ramfs_inode
+    inode->extend    = ramfs_inode;
+    ramfs->vfs_inode = vfs_inode;
+
+    return 0;
+
+}
+
+//////////////////////////////////////////////////////
+void fatfs_inode_destroy( struct vfs_inode_s * inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+}
+
+////////////////////////////////////////////////
+error_t fatfs_write_page( struct page_s * page )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    // get pointer on mapper and page index from page descriptor
+    mapper_t * mapper = page->mapper;
+    uint32_t   index  = page->index;
+
+    if( mapper == NULL)
+    {
+        printk("\n[PANIC] in %s : no mapper for this page\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get VFS inode pointer from mapper
+    vfs_inode_t * vfs_inode = mapper->inode;
+
+    // get FATFS inode pointer for VFS inode
+    fatfs_inode_t * fatfs_inode = (fatfs_inode_t)vfs_inode->extend;
+
+    // get FATFS context and first cluster from FATFS inode
+    fatfs_ctx_t * fatfs_ctx     = fatfs_inode->ctx;
+    uint32_t      first_cluster = fatfs_inode->first_cluster;
+
+
+}
+
+///////////////////////////////////////////////
+error_t fatfs_read_page( struct page_s * page )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    // get pointer on mapper and page index from page descriptor
+    mapper_t * mapper = page->mapper;
+    uint32_t   index  = page->index;
+
+    if( mapper == NULL)
+    {
+        printk("\n[PANIC] in %s : no mapper for this page\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get VFS inode pointer from mapper
+    vfs_inode_t * vfs_inode = mapper->inode;
+
+    // get FATFS inode pointer for VFS inode
+    fatfs_inode_t * fatfs_inode = (fatfs_inode_t)vfs_inode->extend;
+
+    // get FATFS context and first cluster from FATFS inode
+    fatfs_ctx_t * fatfs_ctx     = fatfs_inode->ctx;
+    uint32_t      first_cluster = fatfs_inode->first_cluster;
+
+
+}
+
Index: trunk/kernel/fs/fatfs/fatfs.h
===================================================================
--- trunk/kernel/fs/fatfs/fatfs.h	(revision 1)
+++ trunk/kernel/fs/fatfs/fatfs.h	(revision 1)
@@ -0,0 +1,143 @@
+/*
+ * fatfs.h - FATFS file system API definition.
+ *
+ * Author    Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _FATFS_H_
+#define _FATFS_H_
+
+#include <hal_types.h>
+#include <rwlock.h>
+
+/****  Forward declarations  ****/
+
+struct mapper_s;
+struct device_s;
+struct vfs_inode_s;
+struct page_s;
+
+/*****************************************************************************************
+ * This structure defines a FATFS context descriptor 
+ ****************************************************************************************/
+
+typedef struct fatfs_ctx_s
+{
+    xptr_t            dev_xp;                /*! extended pointer on remote IOC device  */ 
+    rwlock_t          lock;                  /*! TODO protect what ???                  */
+    uint32_t          fat_begin_lba;
+    uint32_t          fat_sectors_count;
+    uint32_t          bytes_per_sector;
+    uint32_t          bytes_per_cluster;
+    uint32_t          cluster_begin_lba;
+    uint32_t          sectors_per_cluster;
+    uint32_t          rootdir_first_cluster;
+    uint32_t          last_allocated_sector;
+    uint32_t          last_allocated_index;  /*! TODO last allocated cluster ???        */
+    struct mapper_s * mapper;                /*! mapper for the FAT itself              */ 
+}
+fatfs_ctx_t;
+
+/*****************************************************************************************
+ * This structure defines the FAT specific inode extension (versus the VFS inode).
+ ****************************************************************************************/
+
+typedef struct fatfs_inode_s
+{
+    struct fatfs_ctx_s * ctx;                /*! local pointer on the FATFS context     */ 
+	uint32_t             first_cluster;      /*! first cluster on device                */ 
+}
+fatfs_inode_t;
+
+/*****************************************************************************************
+ * This structure defines a FAT specific extension to the generic vfs_dentry_t.
+ * TODO a-ton vraiment besoin de cette structure [AG]
+ ****************************************************************************************/
+
+struct fat_dentry_s
+{
+	uint32_t          entry_index;           /*! TODO ???                               */  
+	uint32_t          first_cluster;         /*! TODO ???                               */
+}
+fat_dentry_t;
+
+
+
+
+
+/*****************************************************************************************
+ * This function allocates memory for a FATFS inode, initializes it,
+ * and link it to the VFS inode.
+ * TODO [AG] : faut-il rechercher le fichier correspondant sur le disque,
+ * ou faut-il allouer un nouveau cluster?
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ * @ return 0 if success / return ENOMEM if error. 
+ ****************************************************************************************/
+error_t fatfs_inode_create( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function releases memory allocated for a FATFS inode.
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ ****************************************************************************************/
+void fatfs_inode_destroy( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function allocates memory for a FATFS context, initialises it, 
+ * and link it to the local VFS context.
+ *****************************************************************************************
+ * @ inode   : local pointer on VFS context.
+ * @ return 0 if success / return ENOMEM if error. 
+ ****************************************************************************************/
+error_t fatfs_context_create( struct vfs_ctx_s * ctx );
+
+/*****************************************************************************************
+ * This function releases memory allocated for a FATFS context.
+ *****************************************************************************************
+ * @ ctx   : local pointer on VFS context.
+ ****************************************************************************************/
+void fatfs_inode_destroy( struct vfs_ctx_s * ctx );
+
+/*****************************************************************************************
+ * This function moves a page from the mapper to the FATFS file system.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+ *****************************************************************************************
+ * @ page    : local pointer on page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t fatfs_write_page( struct page_s * page );
+
+/*****************************************************************************************
+ * This function moves a page from the FATFS file system on device to the mapper.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+ *****************************************************************************************
+ * @ page    : local pointer on page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t fatfs_read_page( struct page_s * page );
+
+
+#endif	/* _FATFS_H_ */
Index: trunk/kernel/fs/fatfs/fatfs_private.h
===================================================================
--- trunk/kernel/fs/fatfs/fatfs_private.h	(revision 1)
+++ trunk/kernel/fs/fatfs/fatfs_private.h	(revision 1)
@@ -0,0 +1,159 @@
+/*
+ * fatfs_private.h - fat32 partition descriptors & helper functions
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __VFAT_PRIVATE_H__
+#define __VFAT_PRIVATE_H__
+
+#include <stdint.h>
+#include <rwlock.h>
+
+#define VFAT_DEBUG      CONFIG_VFAT_DEBUG
+#define VFAT_INSTRUMENT CONFIG_VFAT_INSTRUMENT
+
+struct vfat_bpb_s
+{
+	uint8_t     BS_jmpBoot[3];
+	uint8_t     BS_OEMName[8];
+	uint16_t    BPB_BytsPerSec;
+	uint8_t	    BPB_SecPerClus;
+	uint16_t    BPB_RsvdSecCnt;
+	uint8_t	    BPB_NumFATs;
+	uint16_t    BPB_RootEntCnt;
+	uint16_t	BPB_TotSec16;
+	uint8_t	    BPB_Media;
+	uint16_t	BPB_FATSz16;
+	uint16_t	BPB_SecPerTrk;
+	uint16_t	BPB_NumHeads;
+	uint32_t	BPB_HiddSec;
+	uint32_t	BPB_TotSec32;
+	uint32_t	BPB_FATSz32;
+	uint16_t	BPB_ExtFlags;
+	uint16_t	BPB_VFVer;
+	uint32_t	BPB_RootClus;
+	uint16_t	BPB_FSInfo;
+	uint16_t	BPB_BkBootSec;
+	uint8_t	    BPB_Reserved[12];
+	uint8_t	    BS_DrvNum;
+	uint8_t     BS_Reserved1;
+	uint8_t	    BS_BootSig;
+	uint32_t    BS_VolID;
+	uint8_t     BS_VolLab[11];
+	uint8_t     BS_FilSysType[8];
+} __attribute__ ((packed));
+
+
+struct vfat_DirEntry_s
+{
+	uint8_t	    DIR_Name[11];
+	uint8_t	    DIR_Attr;
+	uint8_t	    DIR_NTRes;
+	uint8_t	    DIR_CrtTimeTenth;
+	uint16_t	DIR_CrtTime;
+	uint16_t	DIR_CrtDate;
+	uint16_t	DIR_LstAccTime;
+	uint16_t	DIR_FstClusHI;
+	uint16_t	DIR_WrtTime;
+	uint16_t	DIR_WrtDate;
+	uint16_t	DIR_FstClusLO;
+	uint32_t	DIR_FileSize;
+} __attribute__ ((packed));
+
+
+#define VFAT_ATTR_READ_ONLY	0x01
+#define VFAT_ATTR_HIDDEN	0x02
+#define VFAT_ATTR_SYSTEM	0x04
+#define VFAT_ATTR_VOLUME_ID	0x08
+#define VFAT_ATTR_DIRECTORY	0x10
+#define VFAT_ATTR_ARCHIVE	0x20
+#define VFAT_ATTR_LONG_NAME	0x0F
+
+
+struct device_s;
+struct rwlock_s;
+
+
+struct vfat_inode_s
+{
+	uint32_t flags;
+	vfat_cluster_t first_cluster;
+};
+
+struct vfat_entry_request_s
+{
+	struct vfat_DirEntry_s *entry;
+	struct vfat_context_s *ctx;
+	struct vfs_inode_s *parent;
+	char *entry_name;
+	uint_t *entry_index;
+};
+
+extern const struct vfs_inode_op_s vfat_i_op;
+extern const struct vfs_dirent_op_s vfat_d_op;
+extern const struct vfs_file_op_s vfat_f_op;
+extern const struct mapper_op_s vfat_file_mapper_op;
+extern const struct mapper_op_s vfat_inode_mapper_op;
+
+
+/**
+ * Gives the LBA of the first sector of a vfat cluster.
+ *
+ * @ctx		vfat_context
+ * @cluster	cluster to be converted
+ */
+#define VFAT_CONVERT_CLUSTER(ctx,cluster) (ctx)->cluster_begin_lba +	\
+					       ((cluster) - 2) * (ctx)->sectors_per_cluster
+
+int vfat_cluster_count(struct vfat_context_s *ctx, vfat_cluster_t cluster_index);
+
+error_t vfat_query_fat(struct vfat_context_s* ctx,
+		       vfat_cluster_t cluster_index,
+		       vfat_cluster_t *next_cluster_index);
+
+error_t vfat_alloc_fat_entry(struct vfat_context_s* ctx,
+			     vfat_cluster_t *new_cluster);
+
+error_t vfat_extend_cluster(struct vfat_context_s* ctx,
+			    vfat_cluster_t current_vfat_cluster,
+			    vfat_cluster_t *next_cluster);
+
+error_t vfat_free_fat_entry(struct vfat_context_s* ctx,
+			    vfat_cluster_t start_cluster);
+
+error_t vfat_locate_entry(struct vfat_entry_request_s *rq);
+
+inline void vfat_getshortname(char *from, char *to);
+
+error_t vfat_cluster_lookup(struct vfat_context_s* ctx,
+			    vfat_cluster_t node_cluster,
+			    vfat_cluster_t cluster_rank,
+			    vfat_cluster_t *cluster_index,
+			    uint_t *extended);
+
+
+#if VFAT_INSTRUMENT
+extern uint32_t blk_rd_count;
+extern uint32_t rd_count;
+extern uint32_t wr_count;
+#endif
+
+
+#endif
Index: trunk/kernel/fs/ramfs.c
===================================================================
--- trunk/kernel/fs/ramfs.c	(revision 690)
+++ 	(revision )
@@ -1,54 +1,0 @@
-/*
- * ramfs.c  RAMFS file system API implementation.
- *
- * Authors   Mohamed Lamine Karaoui (2014,2015)
- *           Alain Greiner (2016,2017)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <vfs.h>
-#include <cluster.h>
-#include <ramfs.h>
-
-
-//////////////////////////////////////////////
-error_t ramfs_mount( xptr_t   parent_inode_xp,
-                     char   * ramfs_root_name )
-{
-    xptr_t        dentry_xp;     // unused but required by vfs_add_child_in_parent() 
-    xptr_t        inode_xp;
-    vfs_inode_t * inode_ptr;
- 
-    cxy_t     cxy = cluster_random_select();
-
-    // create VFS dentry and VFS inode for RAMFS root directory
-    return  vfs_add_child_in_parent( cxy,
-                                     FS_TYPE_RAMFS,
-                                     parent_inode_xp,
-                                     ramfs_root_name,
-                                     &dentry_xp,
-                                     &inode_xp );
-    // update inode type field
-    inode_ptr = GET_PTR( inode_xp );
-    inode_ptr->type = FILE_TYPE_DIR;
-}
-
Index: trunk/kernel/fs/ramfs.h
===================================================================
--- trunk/kernel/fs/ramfs.h	(revision 690)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/*
- * ramfs.h  RAMFS file system API definition.
- *
- * Authors   Mohamed Lamine Karaoui (2014,2015)
- *           Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _RAMFS_H_
-#define _RAMFS_H_
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// The RAMFS File System does not uses any external device to store data.
-// It stores the dynamically created files and directories in the VFS mappers.
-// The RAMFS cannot be used as the root File System.
-//
-// There is no RAMFS context extension, and no RAMFS inode extension.
-///////////////////////////////////////////////////////////////////////////////////////////
-
-
-
-/******************************************************************************************
- * This function mount a RAMFS on a given inode of the root FS.
- * It actually creates a new VFS dentry in the cluster containing the parent inode,
- * and create a new VFS inode in another cluster.
- ******************************************************************************************
- * @ parent_inode_xp : extended pointer on the parent inode in VFS.
- * @ ramfs_root_name : RAMFS root directory name.
- *****************************************************************************************/
-error_t ramfs_mount( xptr_t   parent_inode_xp,
-                     char   * ramfs_root_name );
-
-#endif	/* _RAMFS_H_ */
Index: trunk/kernel/fs/ramfs/ramfs.c
===================================================================
--- trunk/kernel/fs/ramfs/ramfs.c	(revision 1)
+++ trunk/kernel/fs/ramfs/ramfs.c	(revision 1)
@@ -0,0 +1,92 @@
+/*
+ * ramfs.c  RAMFS file system API implementation.
+ *
+ * Authors   Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <hal_types.h>
+#include <hal_special.h>
+#include <printk.h>
+#include <kmem.h>
+#include <vfs.h>
+#include <ramfs.h>
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// RAMFS specific functions : these static functions cannot be called by the VFS 
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// Generic API : the following functions are called by the VFS, 
+//               and must be defined by all supported file systems.
+///////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+error_t ramfs_inode_create( struct vfs_inode_s * vfs_inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    kmem_req_t      req;
+    error_t         error;
+    ramfs_inode_t * ramfs_inode;
+
+    // allocate memory for ramfs inode
+	req.type    = KMEM_RAMFS_INODE;
+	req.size    = sizeof(ramfs_inode_t);
+    req.flags   = AF_KERNEL | AF_ZERO;
+	ramfs_inode = (ramfs_inode_t *)kmem_alloc( &req );
+
+    if( ramfs_inode == NULL ) return ENOMEM;
+
+    // initialise ramfs_inode TODO
+
+    // link vfs_inode to ramfs_inode
+    inode->extend    = ramfs_inode;
+    ramfs->vfs_inode = vfs_inode;
+
+    return 0;
+}
+
+//////////////////////////////////////////////////////
+void ramfs_inode_destroy( struct vfs_inode_s * inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+}
+
+/////////////////////////////////////////////////
+error_t ramfs_write_page( struct page_s  * page )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+}
+
+////////////////////////////////////////////////
+error_t ramfs_read_page( struct page_s  * page )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+}
+   
Index: trunk/kernel/fs/ramfs/ramfs.h
===================================================================
--- trunk/kernel/fs/ramfs/ramfs.h	(revision 1)
+++ trunk/kernel/fs/ramfs/ramfs.h	(revision 1)
@@ -0,0 +1,85 @@
+/*
+ * ramfs.h  RAMFS file system API definition.
+ *
+ * Authors   Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _RAMFS_H_
+#define _RAMFS_H_
+
+/****  Forward declarations  ****/
+
+struct vfs_inode_s;
+struct page_s;
+
+/*****************************************************************************************
+ * This structure defines the RAMFS inode specific extension (versus the VFS inode).
+ ****************************************************************************************/
+
+typedef struct ramfs_inode_s
+{
+    struct vfs_inode_s * vfs_inode;   /*! local pointer on VFS inode                    */
+}
+ramfs_inode_t;
+
+
+
+
+/*****************************************************************************************
+ * This function allocates memory for a RAMFS inode, and link it to the VFS inode.
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ * @ return 0 if success / return ENOMEM if error. 
+ ****************************************************************************************/
+error_t ramfs_inode_create( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function releases memory allocated for a RAMFS inode.
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ ****************************************************************************************/
+void ramfs_inode_destroy( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function moves a page from the mapper to the RAMFS file system.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+******************************************************************************************
+ * @ page    : local pointer on source page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t ramfs_write_page( struct page_s  * page );
+
+/*****************************************************************************************
+ * This function moves a page from the RAMFS file system to the mapper.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+ *****************************************************************************************
+ * @ page    : local pointer on destination page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t ramfs_read_page( struct page_s  * page );
+
+
+   
+#endif	/* _RAMFS_H_ */
Index: trunk/kernel/fs/sysfs/sysfs-private.h
===================================================================
--- trunk/kernel/fs/sysfs/sysfs-private.h	(revision 1)
+++ trunk/kernel/fs/sysfs/sysfs-private.h	(revision 1)
@@ -0,0 +1,48 @@
+/*
+ * sysfs/sysfs-private.h - sysfs internal functions and data types
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SYSFS_PRIVATE_H_
+#define _SYSFS_PRIVATE_H_
+
+#include <vfs.h>
+#include <sysfs.h>
+
+struct metafs_s;
+
+struct sysfs_node_s
+{
+	struct metafs_s *node;
+};
+
+struct sysfs_file_s
+{
+	struct metafs_iter_s iter;
+	struct metafs_s *node;
+	sysfs_entry_t *entry;
+	uint_t current_index;
+	sysfs_request_t rq;
+};
+
+extern const struct vfs_inode_op_s sysfs_i_op;
+extern const struct vfs_file_op_s sysfs_f_op;
+
+#endif	/* _SYSFS_PRIVATE_ */
Index: trunk/kernel/fs/sysfs/sysfs.h
===================================================================
--- trunk/kernel/fs/sysfs/sysfs.h	(revision 1)
+++ trunk/kernel/fs/sysfs/sysfs.h	(revision 1)
@@ -0,0 +1,139 @@
+/*
+ * sysfs.h - sysfs interface 
+ *
+ * Authors   Ghassan Almaless (2008,2009,2010,2011,2012)
+ *           Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SYSFS_H_
+#define _SYSFS_H_
+
+#include <hal_types.h>
+#include <metafs.h>
+
+
+struct sysfs_op_s;
+struct sysfs_entry_s;
+struct sysfs_request_s;
+
+
+/*******************************************************************************************
+ * This structure TODO
+ ******************************************************************************************/
+
+typedef struct sysfs_context_s
+{
+	void * empty;
+}
+sysfs_context_t;
+
+/*******************************************************************************************
+ * Operations definition must be provided by underlying kernel subsystem.
+ ******************************************************************************************/
+
+typedef error_t (sysfs_request_func_t)( struct sysfs_entry_s   * entry, 
+                                        struct sysfs_request_s * rq, 
+                                        uint32_t               * offset );
+
+typedef struct sysfs_op_s
+{
+	sysfs_request_func_t *open;
+	sysfs_request_func_t *read;
+	sysfs_request_func_t *write;
+	sysfs_request_func_t *close;
+}
+sysfs_op_t;
+
+/*******************************************************************************************
+ * This structure TODO  
+ ******************************************************************************************/
+
+typedef struct sysfs_request_s
+{
+	void     * data;
+	uint32_t   count;
+	uint8_t    buffer[CONFIG_SYSFS_BUFFER_SIZE];
+}
+sysfs_request_t;
+
+/*******************************************************************************************
+ * This structure TODO  
+ ******************************************************************************************/
+
+typedef struct sysfs_entry_s
+{
+	sysfs_op_t   op;
+	metafs_t     node;
+}
+sysfs_entry_t;
+
+/*******************************************************************************************
+ *        Extern Variable : sysfs root node.
+ ******************************************************************************************/
+
+extern sysfs_entry_t       sysfs_root_entry;
+
+/*******************************************************************************************
+ * This function initializes the sysfs root.
+ ******************************************************************************************/
+static inline void sysfs_root_init()
+{
+    if( CONFIG_ROOTFS_IS_VFAT ) metafs_init( &sysfs_root_entry.node , "SYS" );
+    else                        metafs_init( &sysfs_root_entry.node , "sys" );
+}
+
+
+/*******************************************************************************************
+ * This function initializes a given sysfs entry.
+ ******************************************************************************************/
+static inline void sysfs_entry_init( sysfs_entry_t * entry,
+                                     sysfs_op_t    * op,
+                                     char          * name )
+{
+	metafs_init( &entry->node , name );
+
+	if(op == NULL) return;
+  
+	entry->op.open  = op->open;
+	entry->op.read  = op->read;
+	entry->op.write = op->write;
+	entry->op.close = op->close;
+}
+
+/*******************************************************************************************
+ * This function registers a given sysfs entry into it's parent list.
+ ******************************************************************************************/
+static inline void sysfs_entry_register( sysfs_entry_t * parent,
+                                         sysfs_entry_t * entry )
+{
+	metafs_register( &parent->node , &entry->node );
+}
+
+/*******************************************************************************************
+ * This function removes a given sysfs entry from it's parent list.
+ ******************************************************************************************/
+static inline void sysfs_entry_unregister( sysfs_entry_t * parent,
+                                           sysfs_entry_t * entry )
+{
+	metafs_unregister( &parent->node , &entry->node );
+}
+
+#endif	/* _SYSFS_H_ */
Index: trunk/kernel/fs/sysfs/sysfs_context.c
===================================================================
--- trunk/kernel/fs/sysfs/sysfs_context.c	(revision 1)
+++ trunk/kernel/fs/sysfs/sysfs_context.c	(revision 1)
@@ -0,0 +1,89 @@
+ /*
+ * sysfs/sysfs_context.c - sysfs context related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <device.h>
+#include <driver.h>
+#include <kmem.h>
+#include <string.h>
+#include <vfs.h>
+#include <errno.h>
+#include <metafs.h>
+
+#include <sysfs.h>
+#include <sysfs-private.h>
+
+sysfs_entry_t sysfs_root_entry;
+
+VFS_CREATE_CONTEXT(sysfs_create_context)
+{ 
+	context->ctx_type    = FS_TYPE_SYSFS;
+	VFS_SET(context->ctx_flags, VFS_FS_LOCAL);
+	context->ctx_op      = (struct vfs_context_op_s *) &sysfs_ctx_op;
+	context->ctx_inode_op = (struct vfs_inode_op_s *) &sysfs_i_op;
+	context->ctx_file_op = (struct vfs_file_op_s *) &sysfs_f_op;
+	return 0;
+}
+
+VFS_DESTROY_CONTEXT(sysfs_destroy_context)
+{
+	return 0;
+}
+
+VFS_READ_ROOT(sysfs_read_root)
+{ 
+	struct sysfs_node_s *info;
+  
+	root->i_links = 1;
+	root->i_size  = 0;
+	root->i_attr  = VFS_DIR;
+	root->i_number = vfs_inum_new(context);
+
+	//info has been allocated by sysfs_init
+	info         = root->i_pv;
+	info->node   = &sysfs_root_entry.node;
+  
+	return 0;
+}
+
+VFS_REPLI_ROOT(sysfs_repli_root)
+{ 
+	struct sysfs_node_s *info;
+
+	info         = root->i_pv;
+	info->node   = &sysfs_root_entry.node;
+  
+	return 0;
+}
+
+VFS_WRITE_ROOT(sysfs_write_root)
+{
+	return 0;
+}
+
+const struct vfs_context_op_s sysfs_ctx_op = 
+{
+	.create     = sysfs_create_context,
+	.destroy    = sysfs_destroy_context,
+	.read_root  = sysfs_read_root,
+	.repli_root = sysfs_repli_root,
+	.write_root = sysfs_write_root
+};
Index: trunk/kernel/fs/sysfs/sysfs_file.c
===================================================================
--- trunk/kernel/fs/sysfs/sysfs_file.c	(revision 1)
+++ trunk/kernel/fs/sysfs/sysfs_file.c	(revision 1)
@@ -0,0 +1,186 @@
+/*
+ * sysfs/sysfs_file.c - sysfs file related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <device.h>
+#include <driver.h>
+#include <kmem.h>
+#include <kdmsg.h>
+#include <string.h>
+#include <vfs.h>
+#include <errno.h>
+#include <metafs.h>
+#include <thread.h>
+#include <task.h>
+
+#include <sysfs.h>
+#include <sysfs-private.h>
+
+KMEM_OBJATTR_INIT(sysfs_kmem_file_init)
+{
+	attr->type   = KMEM_SYSFS_FILE;
+	attr->name   = "KCM SysFs File";
+	attr->size   = sizeof(struct sysfs_file_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_SYSFS_FILE_MIN;
+	attr->max    = CONFIG_SYSFS_FILE_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+	return 0;
+}
+
+
+VFS_OPEN_FILE(sysfs_open)
+{
+	register struct sysfs_file_s *f_info;
+	register struct sysfs_node_s *n_info;
+	register sysfs_entry_t *entry;
+	kmem_req_t req;
+
+	n_info = file->fr_inode->i_pv;
+	f_info = file->fr_pv;
+  
+	if((file->fr_pv == NULL))
+	{
+		req.type  = KMEM_SYSFS_FILE;
+		req.size  = sizeof(*f_info);
+		req.flags = AF_KERNEL;
+
+		f_info    = kmem_alloc(&req);
+	}
+
+	if(f_info == NULL)
+		return ENOMEM;
+
+	f_info->node          = n_info->node;
+	entry                 = metafs_container(f_info->node, sysfs_entry_t, node);
+	f_info->entry         = entry;
+	f_info->current_index = 0;
+	file->fr_pv            = f_info;
+  
+	if(file->fr_inode->i_attr & VFS_DIR)
+	{
+		metafs_iter_init(f_info->node, &f_info->iter);
+		return 0;
+	}
+  
+	if(entry->op.open)
+		return entry->op.open(entry, &f_info->rq, &file->fr_offset);
+  
+	return 0;
+}
+
+VFS_READ_FILE(sysfs_read)
+{
+	register struct sysfs_file_s *info;
+	register uint_t size;
+	register error_t err;
+
+	//TODO: handle the case where the this fs is
+	//accessed remotly  
+	assert(file->f_inode.cid == current_cid);
+
+	info = file->f_remote->fr_pv;
+
+	if(info->entry->op.read == NULL)
+		return ENOSYS;
+  
+	if(info->current_index == 0)
+	{
+		if((err = info->entry->op.read(info->entry, &info->rq, &file->f_remote->fr_offset)))
+		{
+			printk(INFO, "INFO: sysfs_read: error %d\n", err);
+			return err;
+		}
+	}
+
+	size = buffer->size;
+	if(size > info->rq.count)
+		size = info->rq.count;
+   
+	buffer->scpy_to_buff(buffer, &info->rq.buffer[info->current_index], size);
+  
+	info->rq.count     -= size;
+	info->current_index = (info->rq.count) ? info->current_index + size : 0;
+
+	return size;
+}
+
+VFS_WRITE_FILE(sysfs_write)
+{
+	return ENOTSUPPORTED;
+}
+
+VFS_LSEEK_FILE(sysfs_lseek)
+{
+	return ENOTSUPPORTED;
+}
+
+VFS_CLOSE_FILE(sysfs_close)
+{
+	return 0;
+}
+
+VFS_RELEASE_FILE(sysfs_release)
+{  
+	kmem_req_t req;
+  
+	if(file->fr_pv == NULL)
+		return 0;
+  
+	req.type   = KMEM_SYSFS_FILE;
+	req.ptr    = file->fr_pv;
+	kmem_free(&req);
+	file->fr_pv = NULL;
+
+	return 0;
+}
+
+VFS_READ_DIR(sysfs_readdir)
+{
+	register struct sysfs_file_s *info;
+	register struct metafs_s *current;
+  
+	info = file->fr_pv;
+
+	if((current = metafs_lookup_next(info->node, &info->iter)) == NULL)
+		return EEODIR;
+
+	dirent->u_attr = (metafs_hasChild(current)) ? VFS_DIR : 0;
+	strcpy((char*)dirent->u_name, metafs_get_name(current));
+  
+	//FIXME: better inode number
+	dirent->u_ino = (uint_t) current;
+
+	return 0;
+}
+
+const struct vfs_file_op_s sysfs_f_op = 
+{
+	.open    = sysfs_open,
+	.read    = sysfs_read,
+	.write   = sysfs_write,
+	.lseek   = sysfs_lseek,
+	.readdir = sysfs_readdir,
+	.close   = sysfs_close,
+	.release = sysfs_release,
+};
Index: trunk/kernel/fs/sysfs/sysfs_node.c
===================================================================
--- trunk/kernel/fs/sysfs/sysfs_node.c	(revision 1)
+++ trunk/kernel/fs/sysfs/sysfs_node.c	(revision 1)
@@ -0,0 +1,169 @@
+/*
+ * sysfs/sysfs_node.c - sysfs node related operations
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <kmem.h>
+#include <string.h>
+#include <kdmsg.h>
+#include <vfs.h>
+#include <cpu.h>
+
+#include <sysfs.h>
+#include <sysfs-private.h>
+
+KMEM_OBJATTR_INIT(sysfs_kmem_node_init)
+{
+	attr->type   = KMEM_SYSFS_NODE;
+	attr->name   = "KCM SysFs Node";
+	attr->size   = sizeof(struct sysfs_node_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_SYSFS_NODE_MIN;
+	attr->max    = CONFIG_SYSFS_NODE_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+	return 0;
+}
+
+
+VFS_INIT_NODE(sysfs_init_node)
+{
+	register struct sysfs_node_s *node_info;
+	kmem_req_t req;
+  
+	node_info = inode->i_pv;
+
+	if(inode->i_pv == NULL)
+	{
+		req.type  = KMEM_SYSFS_NODE;
+		req.size  = sizeof(*node_info);
+		req.flags = AF_KERNEL;
+
+		node_info = kmem_alloc(&req);
+	}
+
+	if(node_info == NULL)
+		return ENOMEM;
+  
+	inode->i_pv = node_info;
+	return 0;
+}
+
+
+VFS_RELEASE_NODE(sysfs_release_node)
+{
+	kmem_req_t req;
+
+	req.type   = KMEM_SYSFS_NODE;
+	req.ptr    = inode->i_pv;
+	kmem_free(&req);
+	inode->i_pv = NULL;
+	return 0;
+}
+
+
+VFS_CREATE_NODE(sysfs_create_node)
+{ 
+	return ENOTSUPPORTED;
+}
+
+
+error_t sysfs_inode_create(struct vfs_dirent_s *dirent, 
+				struct vfs_inode_s *parent,
+				struct metafs_s *meta, size_t size)
+{
+	struct vfs_inode_s *inode;
+
+	inode = vfs_inode_new(dirent->d_ctx);//allocate inode
+	if(!inode) return ENOMEM;
+
+	inode->i_links  = 1;
+	inode->i_attr = dirent->d_attr;
+	((struct sysfs_node_s *)inode->i_pv)->node = meta;
+	inode->i_size = size;
+	inode->i_parent.ptr = parent;
+	inode->i_parent.cid = cpu_get_cid();
+	inode->i_parent.gc = parent->i_gc;
+	inode->i_number = vfs_inum_new(dirent->d_ctx);
+	
+	vfs_icache_add(inode);
+
+	dirent->d_inode.cid = cpu_get_cid();
+	dirent->d_inode.ptr = inode;
+
+	return 0;
+}
+
+VFS_LOOKUP_NODE(sysfs_lookup_node)
+{
+	register struct sysfs_node_s *parent_info;
+	register struct metafs_s *meta;
+	register uint_t hasChild;
+	size_t size;
+  
+	size = 0;
+	parent_info = parent->i_pv;
+  
+	sysfs_dmsg(1, "DEBUG: sysfs_lookup: %s, attr %x\n", dirent->d_name, dirent->d_attr);
+
+	if((meta = metafs_lookup(parent_info->node, dirent->d_name)) == NULL)
+		return VFS_NOT_FOUND;
+
+	hasChild = metafs_hasChild(meta);
+
+	if(hasChild && !(dirent->d_attr & VFS_DIR))
+		return EISDIR;
+  
+	if(!(hasChild) && (dirent->d_attr & VFS_DIR))
+		return ENOTDIR;
+
+	if(hasChild)
+		dirent->d_attr |= VFS_DIR;
+	else
+		size = SYSFS_BUFFER_SIZE;
+
+	sysfs_inode_create(dirent, parent, meta, size);
+  
+	return VFS_FOUND;
+}
+
+
+VFS_WRITE_NODE(sysfs_write_node)
+{
+	return 0;
+}
+
+VFS_UNLINK_NODE(sysfs_unlink_node)
+{
+	return ENOTSUPPORTED;
+}
+
+const struct vfs_inode_op_s sysfs_i_op = 
+{
+	.init    = sysfs_init_node,
+	.create  = sysfs_create_node,
+	.lookup  = sysfs_lookup_node,
+	.write   = sysfs_write_node,
+	.release = sysfs_release_node,
+	.unlink  = sysfs_unlink_node,
+	.stat    = NULL,
+	.delete  = NULL
+};
Index: trunk/kernel/fs/vfs.c
===================================================================
--- trunk/kernel/fs/vfs.c	(revision 690)
+++ 	(revision )
@@ -1,4094 +1,0 @@
-/*
- * vfs.c - Virtual File System implementation.
- *
- * Author  Mohamed Lamine Karaoui (2014,2015)
- *         Alain Greiner          (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_atomic.h>
-#include <hal_special.h>
-#include <printk.h>
-#include <list.h>
-#include <xlist.h>
-#include <slist.h>
-#include <xhtab.h>
-#include <string.h>
-#include <errno.h>
-#include <kmem.h>
-#include <mapper.h>
-#include <thread.h>
-#include <chdev.h>
-#include <pipe.h>
-#include <process.h>
-#include <cluster.h>
-#include <vfs.h>
-#include <fatfs.h>
-#include <ramfs.h>
-#include <devfs.h>
-#include <syscalls.h>
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//           Extern global variables         
-//////////////////////////////////////////////////////////////////////////////////////////
-
-extern vfs_ctx_t          fs_context[FS_TYPES_NR];    // allocated in kernel_init.c
-extern chdev_directory_t  chdev_dir;                  // allocated in kernel_init.c  
-extern char *             lock_type_str[];            // allocated in kernel_init.c
-extern process_t          process_zero;               // allocated in kernel_init.c
-  
-///////////////////////////////////////////////////////////////////////////////////////////
-//           VFS Context related functions
-//////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////
-void vfs_ctx_init( cxy_t           cxy,
-                   vfs_fs_type_t   fs_type,
-	               uint32_t        total_clusters,
-	               uint32_t        cluster_size,
-	               xptr_t          vfs_root_xp,
-                   void          * extend )
-{
-    // get pointer on relevant VFS context (same in all clusters) 
-    vfs_ctx_t * vfs_ctx_ptr = &fs_context[fs_type];
-
-    // initialise VFS context fields 
-    hal_remote_s32( XPTR( cxy , &vfs_ctx_ptr->type           ) , fs_type );
-    hal_remote_s32( XPTR( cxy , &vfs_ctx_ptr->total_clusters ) , total_clusters );
-    hal_remote_s32( XPTR( cxy , &vfs_ctx_ptr->cluster_size   ) , cluster_size );
-    hal_remote_s64( XPTR( cxy , &vfs_ctx_ptr->vfs_root_xp    ) , vfs_root_xp );
-    hal_remote_spt( XPTR( cxy , &vfs_ctx_ptr->extend         ) , extend );
-
-    // initialize VFS context lock
-    remote_busylock_init( XPTR( cxy , &vfs_ctx_ptr->lock ) , LOCK_VFS_CTX );
-
-    // initialize inum allocator
-    bitmap_remote_init( XPTR( cxy , &vfs_ctx_ptr->bitmap ),
-                        BITMAP_SIZE(CONFIG_VFS_MAX_INODES) ); 
-
-} // end vfs_ctx_init()
-
-///////////////////////////////////////////////
-error_t vfs_ctx_inum_alloc( xptr_t      ctx_xp,
-                            uint32_t  * inum )
-{
-    // get context cluster and local pointer
-    cxy_t       ctx_cxy = GET_CXY( ctx_xp );
-    vfs_ctx_t * ctx_ptr = GET_PTR( ctx_xp );
-
-    // build extended pointer on lock protecting the inum allocator
-    xptr_t lock_xp = XPTR( ctx_cxy , &ctx_ptr->lock );
-
-    // build extended pointer on inum bitmap
-    xptr_t bitmap_xp = XPTR( ctx_cxy , &ctx_ptr->bitmap );
-
-    // get lock on inum allocator
-    remote_busylock_acquire( lock_xp );
-
-    // get lid from local inum allocator
-    uint32_t lid = bitmap_remote_ffc( bitmap_xp , CONFIG_VFS_MAX_INODES );
-
-    if( lid == 0xFFFFFFFF )   // no more free slot => error
-    {
-        // release lock
-        remote_busylock_release( lock_xp );
-
-        // return error
-        return -1;
-    }
-    else              // found => return inum
-    {
-        // set slot allocated
-        bitmap_remote_set( bitmap_xp , lid );
-
-        // release lock
-        remote_busylock_release( lock_xp );
-
-        // return inum
-        *inum = (((uint32_t)local_cxy) << 16) | (lid & 0xFFFF);
-        return 0;
-    }
-}  // end vfs_ctx_inum_alloc()
-
-/////////////////////////////////////////////
-void vfs_ctx_inum_release( xptr_t     ctx_xp,
-                           uint32_t   inum )
-{
-    // get context cluster and local pointer
-    cxy_t       ctx_cxy = GET_CXY( ctx_xp );
-    vfs_ctx_t * ctx_ptr = GET_PTR( ctx_xp );
-
-    // build extended pointer on inum bitmap
-    xptr_t bitmap_xp = XPTR( ctx_cxy , &ctx_ptr->bitmap );
-
-    // build extended pointer on lock
-    xptr_t lock_xp = XPTR( ctx_cxy , &ctx_ptr->lock );
-
-    // get lock 
-    remote_busylock_acquire( lock_xp );
-
-    bitmap_remote_clear( bitmap_xp , inum & 0xFFFF ); 
-
-    // release lock
-    remote_busylock_release( lock_xp );
-
-}  // end vfs_ctx_inum_release()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//           VFS inode descriptor related functions
-//////////////////////////////////////////////////////////////////////////////////////////
-
-const char * vfs_inode_type_str( vfs_file_type_t type )
-{
-    switch ( type ) 
-    {
-        case FILE_TYPE_REG: return "FILE";
-        case FILE_TYPE_DIR:  return "DIR ";
-        case FILE_TYPE_FIFO: return "FIFO";
-        case FILE_TYPE_PIPE: return "PIPE";
-        case FILE_TYPE_SOCK: return "SOCK";
-        case FILE_TYPE_DEV:  return "DEV ";
-        case FILE_TYPE_BLK:  return "BLK ";
-        case FILE_TYPE_SYML: return "SYML";
-        default:              return "undefined";
-    }
-}
-
-////////////////////////////////////////////////
-error_t vfs_inode_create( cxy_t             cxy,
-                          vfs_fs_type_t     fs_type,
-                          uint32_t          attr,
-                          uint32_t          rights,
-                          uid_t             uid,
-                          gid_t             gid,
-                          xptr_t          * inode_xp )
-{
-    xptr_t             mapper_xp;    // extended pointer on associated mapper
-    mapper_t         * mapper_ptr;   // local pointer on associated mapper
-    vfs_inode_t      * inode_ptr;    // local pointer on allocated inode
-    uint32_t           inum;         // inode identifier (to be allocated)
-    vfs_ctx_t        * ctx;          // file system context 
-    error_t            error;
-
-#if DEBUG_VFS_INODE_CREATE || DEBUG_VFS_ERROR
-uint32_t       cycle      = (uint32_t)hal_get_cycles();
-thread_t *     this       = CURRENT_THREAD;
-pid_t          pid        = this->process->pid;
-trdid_t        trdid      = this->trdid;
-#endif
-
-    // check fs type and get pointer on context
-    if     ( fs_type == FS_TYPE_FATFS ) ctx = &fs_context[FS_TYPE_FATFS];
-    else if( fs_type == FS_TYPE_RAMFS ) ctx = &fs_context[FS_TYPE_RAMFS];
-    else if( fs_type == FS_TYPE_DEVFS ) ctx = &fs_context[FS_TYPE_DEVFS];
-    else
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal FS type / cycle %d\n",
-__FUNCTION__ , pid , trdid, cycle );
-#endif
-        return -1;
-    }
-
-// check inode descriptor contained in one page
-assert( __FUNCTION__, (sizeof(vfs_inode_t) <= CONFIG_PPM_PAGE_SIZE),
-"inode descriptor must fit in one page" );
-
-    // allocate inum
-    error = vfs_ctx_inum_alloc( XPTR( cxy , ctx ) , &inum );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate inum / cycle %d\n",
-__FUNCTION__ , pid , trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // allocate memory for mapper in cluster cxy
-    mapper_xp = mapper_create( cxy , fs_type );
-
-    if( mapper_xp == XPTR_NULL )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate mapper / cycle %d\n",
-__FUNCTION__ , pid , trdid, cycle );
-#endif
-        vfs_ctx_inum_release( XPTR( cxy , ctx ) , inum );
-        return -1;
-    }
-
-    mapper_ptr = GET_PTR( mapper_xp );
-
-    // allocate memory for inode descriptor
-	inode_ptr  = kmem_remote_alloc( cxy,
-                                    bits_log2(sizeof(vfs_inode_t)),
-                                    AF_ZERO );
-    if( inode_ptr == NULL )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate inode / cycle %d\n",
-__FUNCTION__ , pid , trdid, cycle );
-#endif
-        vfs_ctx_inum_release( XPTR( cxy , ctx ) , inum );
-        mapper_destroy( mapper_xp );
-        return -1;
-    }
-
-    // initialise inode field in mapper
-    hal_remote_spt( XPTR( cxy , &mapper_ptr->inode ) , inode_ptr );
- 
-    // initialize inode descriptor
-    hal_remote_s32( XPTR( cxy , &inode_ptr->type   ) , FILE_TYPE_REG );  // default value
-    hal_remote_s32( XPTR( cxy , &inode_ptr->inum   ) , inum );  
-    hal_remote_s32( XPTR( cxy , &inode_ptr->attr   ) , attr );  
-    hal_remote_s32( XPTR( cxy , &inode_ptr->rights ) , rights );  
-    hal_remote_s32( XPTR( cxy , &inode_ptr->links  ) , 0 );
-    hal_remote_s32( XPTR( cxy , &inode_ptr->uid    ) , uid );  
-    hal_remote_s32( XPTR( cxy , &inode_ptr->gid    ) , gid );  
-    hal_remote_spt( XPTR( cxy , &inode_ptr->ctx    ) , ctx );  
-    hal_remote_spt( XPTR( cxy , &inode_ptr->mapper ) , mapper_ptr );  
-    hal_remote_spt( XPTR( cxy , &inode_ptr->extend ) , NULL );  
-
-    // initialize chidren dentries xhtab
-    xhtab_init( XPTR( cxy , &inode_ptr->children ) , XHTAB_DENTRY_TYPE );
-
-    // initialize parents dentries xlist
-    xlist_root_init( XPTR( cxy , &inode_ptr->parents ) );
- 
-    // initialize lock protecting size 
-    remote_rwlock_init( XPTR( cxy , &inode_ptr->size_lock ), LOCK_VFS_SIZE );
-
-    // initialise lock protecting inode tree traversal
-    remote_rwlock_init( XPTR( cxy , &inode_ptr->main_lock ), LOCK_VFS_MAIN );
-
-    // return extended pointer on inode
-    *inode_xp = XPTR( cxy , inode_ptr );
-
-#if DEBUG_VFS_INODE_CREATE
-if( DEBUG_VFS_INODE_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] created inode (%x,%x) / ctx %x / fs_type %d / cycle %d\n",
-__FUNCTION__, pid, trdid, cxy, inode_ptr, ctx, ctx->type, cycle );
-#endif
- 
-    return 0;
-
-}  // end vfs_inode_create()  
-
-//////////////////////////////////////////
-void vfs_inode_destroy( xptr_t  inode_xp )
-{
-    // get cluster and local pointer
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get local pointer on mapper
-    mapper_t    * mapper_ptr = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ));
-
-    // release memory allocated for mapper
-    mapper_destroy( XPTR( inode_cxy , mapper_ptr ) );
-
-    // release memory allocated for inode descriptor
-	kmem_remote_free( inode_cxy,
-                      inode_ptr,
-                      bits_log2(sizeof(vfs_inode_t)) );
-
-}  // end vfs_inode_destroy()
-
-//////////////////////////////////////////////
-uint32_t vfs_inode_get_size( xptr_t inode_xp )
-{
-    // get inode cluster and local pointer
-    cxy_t         cxy = GET_CXY( inode_xp );
-    vfs_inode_t * ptr = GET_PTR( inode_xp );
-
-    // build extended pointers on lock & size 
-    xptr_t   lock_xp = XPTR( cxy , &ptr->size_lock );
-    xptr_t   size_xp = XPTR( cxy , &ptr->size );
-
-    // take lock in read mode 
-    remote_rwlock_rd_acquire( lock_xp );
-
-    // get size
-    uint32_t size = hal_remote_l32( size_xp );
-
-    // release lock from read mode
-    remote_rwlock_rd_release( lock_xp );
-
-    return size;
-}
-
-///////////////////////////////////////////////
-void vfs_inode_update_size( xptr_t    inode_xp,
-                            uint32_t  size )
-{
-    // get inode cluster and local pointer
-    cxy_t         cxy = GET_CXY( inode_xp );
-    vfs_inode_t * ptr = GET_PTR( inode_xp );
-
-    // build extended pointers on lock & size 
-    xptr_t   lock_xp = XPTR( cxy , &ptr->size_lock );
-    xptr_t   size_xp = XPTR( cxy , &ptr->size );
-
-    // take lock in write mode 
-    remote_rwlock_wr_acquire( lock_xp );
-
-    // get current size
-    uint32_t current_size = hal_remote_l32( size_xp );
-
-    // set size if required
-    if( current_size < size ) hal_remote_s32( size_xp , size );
-
-    // release lock from write mode
-    remote_rwlock_wr_release( lock_xp );
-}
-
-////////////////////////////////////////
-void vfs_inode_unlock( xptr_t inode_xp )
-{
-    // get inode cluster and local pointer
-    cxy_t         cxy = GET_CXY( inode_xp );
-    vfs_inode_t * ptr = GET_PTR( inode_xp );
-
-    // release the main lock
-    remote_busylock_release( XPTR( cxy , &ptr->main_lock ) );
-}
-
-//////////////////////////////////////
-void vfs_inode_lock( xptr_t inode_xp )
-{
-    // get inode cluster and local pointer
-    cxy_t         cxy = GET_CXY( inode_xp );
-    vfs_inode_t * ptr = GET_PTR( inode_xp );
-
-    // get the main lock
-    remote_busylock_acquire( XPTR( cxy , &ptr->main_lock ) );
-}
-
-///////////////////////////////////////////
-void vfs_inode_get_name( xptr_t   inode_xp,
-                         char   * name )
-{
-    cxy_t          inode_cxy;          // inode cluster identifier 
-    vfs_inode_t  * inode_ptr;          // local pointer on inode
-    xptr_t         parents_root_xp;    // extended pointer on inode parents root
-    
-    // get inode cluster and local pointer
-    inode_ptr = GET_PTR( inode_xp );
-    inode_cxy = GET_CXY( inode_xp );
-
-    // build extended pointer on parents dentries root
-    parents_root_xp  = XPTR( inode_cxy , &inode_ptr->parents );
-
-    // check VFS root 
-    if( xlist_is_empty( parents_root_xp ) )  // inode is the VFS root
-    {
-        strcpy( name , "/" );
-    }
-    else                                     // not the VFS root
-    {
-        xptr_t         dentry_xp;
-        cxy_t          dentry_cxy;
-        vfs_dentry_t * dentry_ptr;
-
-        // get first name in list of parents
-        dentry_xp  = XLIST_FIRST( parents_root_xp , vfs_dentry_t , parents );
-        dentry_cxy = GET_CXY( dentry_xp );
-        dentry_ptr = GET_PTR( dentry_xp );
-
-        hal_remote_strcpy( XPTR( local_cxy  , name ) , 
-                           XPTR( dentry_cxy , dentry_ptr->name ) );
-    }
-
-}  // end vfs_inode_get_name()
-
-////////////////////////////////////////////////////
-error_t vfs_inode_load_all_pages( xptr_t  inode_xp )
-{
-    uint32_t   page_id;
-    xptr_t     page_xp;
-
-
-    // get inode cluster and local pointer
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get pointer on mapper and size
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-    uint32_t   size   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->size ) );
-
-#if DEBUG_VFS_INODE_LOAD_ALL || DEBUG_VFS_ERROR
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-#endif
-
-#if DEBUG_VFS_INODE_LOAD_ALL
-char name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( inode_xp , name );
-if( DEBUG_VFS_INODE_LOAD_ALL < cycle )
-printk("\n[%s] thread[%x,%x] enter for <%s> in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, inode_cxy, cycle );
-#endif
-
-    // compute number of pages
-    uint32_t npages = size >> CONFIG_PPM_PAGE_ORDER;
-    if( (size & CONFIG_PPM_PAGE_MASK) || (size == 0) ) npages++;
-
-    // loop on pages 
-    for( page_id = 0 ; page_id < npages ; page_id ++ )
-    {
-        // If the mage is missing, this function allocates the missing page,
-        // and load the page from IOC device into mapper
-        page_xp = mapper_get_page( XPTR( inode_cxy , mapper ), page_id );
-
-        if( page_xp == XPTR_NULL )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate memory for mapper / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-    }
-
-#if DEBUG_VFS_INODE_LOAD_ALL
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_INODE_LOAD_ALL < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, name, inode_cxy );
-#endif
-
-    return 0;
-
-}  // end vfs_inode_load_all_pages()
-
-/////////////////////////////////////////
-void vfs_inode_display( xptr_t inode_xp )
-{
-    assert( __FUNCTION__, (inode_xp != XPTR_NULL), "inode pointer is NULL");
-
-    char  name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    vfs_inode_get_name( inode_xp , name );
-
-    // get inode cluster and local pointer
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-
-    vfs_file_type_t type    = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-    uint32_t         attr    = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->attr ) );
-    uint32_t         size    = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->size ) );
-    uint32_t         parents = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->links ) );
-    mapper_t       * mapper  = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-    void           * extend  = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->extend ) );
-
-    printk("\n**** inode <%s>\n"
-           " - type    = %s\n"
-           " - attr    = %x\n"
-           " - size    = %d\n"
-           " - parents = %d\n"
-           " - cxy     = %x\n"
-           " - inode   = %x\n"
-           " - mapper  = %x\n"
-           " - extend  = %x\n",
-           name,
-           vfs_inode_type_str( type ),
-           attr,
-           size,
-           parents,
-           inode_cxy,
-           inode_ptr,
-           mapper,
-           extend );
-
-}  // end vfs_inode_display()
-
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//          VFS dentry descriptor related functions
-//////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////
-error_t vfs_dentry_create( cxy_t           cxy,
-                           vfs_fs_type_t   fs_type,
-                           char          * name,
-                           xptr_t        * dentry_xp )
-{
-    vfs_ctx_t      * ctx = NULL;     // context descriptor
-    vfs_dentry_t   * dentry_ptr;     // dentry descriptor (to be allocated)
-
-#if DEBUG_VFS_DENTRY_CREATE || DEBUG_VFS_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_VFS_DENTRY_CREATE
-if( DEBUG_VFS_DENTRY_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enters for <%s> /  fs_type %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, fs_type, cycle );
-#endif
-
-    // get pointer on context
-    if     ( fs_type == FS_TYPE_FATFS ) ctx = &fs_context[FS_TYPE_FATFS];
-    else if( fs_type == FS_TYPE_RAMFS ) ctx = &fs_context[FS_TYPE_RAMFS];
-    else if( fs_type == FS_TYPE_DEVFS ) ctx = &fs_context[FS_TYPE_DEVFS];
-    else 
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / undefined fs_type %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, fs_type, cycle );
-#endif
-        return -1;
-    }
-
-    // get name length
-    uint32_t length = strlen( name );
-
-    if( length >= CONFIG_VFS_MAX_NAME_LENGTH ) return -1;
-
-    // allocate memory for dentry descriptor
-	dentry_ptr = kmem_remote_alloc( cxy,
-                                    bits_log2(sizeof(vfs_dentry_t)),
-                                    AF_ZERO );
-    if( dentry_ptr == NULL ) 
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate dentry descriptor / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // initialize dentry descriptor
-    hal_remote_spt( XPTR( cxy , &dentry_ptr->ctx    ) , ctx );
-    hal_remote_s32( XPTR( cxy , &dentry_ptr->length ) , length );
-    hal_remote_spt( XPTR( cxy , &dentry_ptr->extend ) , NULL );
-
-    // register name
-    hal_remote_strcpy( XPTR( cxy, dentry_ptr->name ),
-                       XPTR( local_cxy, name ) );
-
-    // return extended pointer on dentry 
-    *dentry_xp = XPTR( cxy , dentry_ptr );
-
-#if DEBUG_VFS_DENTRY_CREATE
-if( DEBUG_VFS_DENTRY_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> / dentry (%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, name, cxy, dentry_ptr );
-#endif
-
-    return 0;
-
-}  // end vfs_dentry_create()
-
-////////////////////////////////////////////
-void vfs_dentry_destroy( xptr_t  dentry_xp )
-{
-    // get cluster and local pointer
-    vfs_dentry_t * dentry_ptr = GET_PTR( dentry_xp );
-    cxy_t          dentry_cxy = GET_CXY( dentry_xp );
-  
-    // release memory allocated to dentry
-	kmem_remote_free( dentry_cxy,
-                      dentry_ptr,
-                      bits_log2(sizeof(vfs_dentry_t)) );
-
-}  // end vfs_dentry_destroy()
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//       VFS file descriptor related functions
-//////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////
-error_t vfs_file_create( xptr_t     inode_xp,
-                         uint32_t   attr,
-                         xptr_t   * file_xp )
-{
-    vfs_file_t   * file_ptr;
-    uint32_t       type;
-    mapper_t     * mapper;
-    pipe_t       * pipe;
-    vfs_ctx_t    * ctx;
-
-    // get inode cluster and local pointer
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-#if DEBUG_VFS_FILE_CREATE || DEBUG_VFS_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_VFS_FILE_CREATE
-if( DEBUG_VFS_FILE_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enter for inode (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, inode_cxy, inode_ptr, cycle );
-#endif
-
-    // allocate memory for new file descriptor
-	file_ptr  = kmem_remote_alloc( inode_cxy,
-                                   bits_log2(sizeof(vfs_file_t)),
-                                   AF_ZERO );
-
-    if( file_ptr == NULL )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot allocate memory / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // get type, ctx, mapper, and buffer from inode descriptor
-    type   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-    ctx    = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->ctx ) );
-    mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-    pipe   = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->pipe ) );
-
-    // initializes new file descriptor
-    hal_remote_s32( XPTR( inode_cxy , &file_ptr->type     ) , type );
-    hal_remote_s32( XPTR( inode_cxy , &file_ptr->attr     ) , attr );
-    hal_remote_spt( XPTR( inode_cxy , &file_ptr->ctx      ) , ctx );
-    hal_remote_s32( XPTR( inode_cxy , &file_ptr->offset   ) , 0 );
-    hal_remote_spt( XPTR( inode_cxy , &file_ptr->inode    ) , inode_ptr );
-    hal_remote_spt( XPTR( inode_cxy , &file_ptr->mapper   ) , mapper );
-    hal_remote_spt( XPTR( inode_cxy , &file_ptr->pipe     ) , pipe );
-
-    remote_rwlock_init( XPTR( inode_cxy , &file_ptr->lock ), LOCK_VFS_FILE );
-
-    *file_xp = XPTR( inode_cxy , file_ptr );
-
-#if DEBUG_VFS_FILE_CREATE
-if( (DEBUG_VFS_FILE_CREATE < cycle) && (type == FILE_TYPE_REG))
-{
-    char name[CONFIG_VFS_MAX_NAME_LENGTH];
-    vfs_file_get_name( XPTR( inode_cxy , file_ptr ) , name );
-    printk("\n[%s] thread[%x,%x] created file (%x,%x) / %s (%s)\n",
-    __FUNCTION__, this->process->pid, this->trdid,
-    inode_cxy, file_ptr, vfs_inode_type_str(type), name );
-}
-if( (DEBUG_VFS_FILE_CREATE < cycle) && (type != FILE_TYPE_REG))
-{
-    printk("\n[%s] thread[%x,%x] created file (%x,%x) / %s\n",
-    __FUNCTION__, this->process->pid, this->trdid,
-    inode_cxy, file_ptr, vfs_inode_type_str(type) );
-}
-#endif
-
-    return 0;
-
-}  // end vfs_file_create()
-
-////////////////////////////////////////
-void vfs_file_destroy( xptr_t  file_xp )
-{
-    // get file cluster and local pointer
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-    cxy_t        file_cxy = GET_CXY( file_xp );
-
-#if DEBUG_VFS_FILE_DESTROY
-char name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_file_get_name( file_xp , name );
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_FILE_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] enter / file_ptr %x / file_cxy %x / <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, file_ptr, file_cxy, name, cycle );
-#endif
-
-    // release file descriptor
-	kmem_remote_free( file_cxy,
-                      file_ptr,
-                      bits_log2(sizeof(vfs_file_t)) );
-
-#if DEBUG_VFS_FILE_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_FILE_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, file_ptr, file_cxy, name, cycle );
-#endif
-
-}  // end vfs_file_destroy() 
-
-///////////////////////////////////////
-void vfs_file_get_name( xptr_t file_xp,
-                        char * name )
-{
-    // get cluster and local pointer on remote file
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-    cxy_t        file_cxy = GET_CXY( file_xp );
-
-    // get pointers on remote inode
-    vfs_inode_t * inode_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) ); 
-    xptr_t        inode_xp  = XPTR( file_cxy , inode_ptr );
-
-    // call the relevant function
-    vfs_inode_get_name( inode_xp , name );
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//           "syscalls" API related functions
-//////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////
-error_t vfs_open( xptr_t      root_xp,
-		          char      * path,
-                  xptr_t      process_xp,
-		          uint32_t    flags,
-                  uint32_t    mode, 
-		          xptr_t    * new_file_xp,
-                  uint32_t  * new_file_id )
-{
-    error_t        error;
-    xptr_t         inode_xp;       // extended pointer on target inode
-    cxy_t          inode_cxy;      // inode cluster identifier       
-    vfs_inode_t  * inode_ptr;      // inode local pointer
-    uint32_t       file_attr;      // file descriptor attributes
-    uint32_t       lookup_mode;    // lookup working mode        
-    xptr_t         file_xp;        // extended pointer on created file descriptor
-    uint32_t       file_id;        // created file descriptor index in reference fd_array
-    xptr_t         vfs_root_xp;    // extended pointer on VFS root inode
-    vfs_inode_t  * vfs_root_ptr;   // local pointer on VFS root inode
-    cxy_t          vfs_root_cxy;   // VFS root inode cluster identifier
-    xptr_t         lock_xp;        // extended pointer on Inode Tree lock 
-
-#if DEBUG_VFS_OPEN || DEBUG_VFS_ERROR
-uint32_t    cycle   = (uint32_t)hal_get_cycles();
-thread_t  * this    = CURRENT_THREAD;
-pid_t       pid     = this->process->pid; 
-trdid_t     trdid   = this->trdid;
-#endif
-
-    if( mode != 0 )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : the mode parameter is not supported yet\n" );
-#endif
-        return -1;
-    }
-
-    // compute lookup working mode
-    lookup_mode = VFS_LOOKUP_OPEN;
-    if( (flags & O_DIR    )      )  lookup_mode |= VFS_LOOKUP_DIR;
-    if( (flags & O_CREAT  )      )  lookup_mode |= VFS_LOOKUP_CREATE;
-    if( (flags & O_EXCL   )      )  lookup_mode |= VFS_LOOKUP_EXCL;
- 
-#if DEBUG_VFS_OPEN
-if( DEBUG_VFS_OPEN < cycle )
-printk("\n[%s] thread[%x,%x] enter for <%s> / root_inode (%x,%x) / cycle %d\n",
-__FUNCTION__, pid, trdid, path, GET_CXY(root_xp), GET_PTR(root_xp), cycle );
-#endif
-
-    // compute attributes for the created file
-    file_attr = 0;
-    if( (flags & O_RDONLY ) == 0 )  file_attr |= FD_ATTR_WRITE_ENABLE;
-    if( (flags & O_WRONLY ) == 0 )  file_attr |= FD_ATTR_READ_ENABLE;
-    if( (flags & O_SYNC   )      )  file_attr |= FD_ATTR_SYNC;
-    if( (flags & O_APPEND )      )  file_attr |= FD_ATTR_APPEND;
-    if( (flags & O_CLOEXEC)      )  file_attr |= FD_ATTR_CLOSE_EXEC;
-
-    // build extended pointer on lock protecting Inode Tree
-    vfs_root_xp  = process_zero.vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    lock_xp      = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take lock protecting Inode Tree in read mode
-    remote_rwlock_rd_acquire( lock_xp );
-
-    // get extended pointer on target inode
-    error = vfs_lookup( root_xp,
-                        path,
-                        lookup_mode,
-                        &inode_xp,
-                        NULL );
-
-    // release lock protecting Inode Tree
-    remote_rwlock_rd_release( lock_xp );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot get inode <%s> / cycle %d\n",
-__FUNCTION__ , pid, trdid , path , cycle );
-#endif
-        return -1;
-    }
-
-    // get target inode cluster and local pointer
-    inode_cxy = GET_CXY( inode_xp );
-    inode_ptr = GET_PTR( inode_xp );
-    
-#if (DEBUG_VFS_OPEN & 1)
-if( DEBUG_VFS_OPEN < cycle )
-printk("\n[%s] thread[%x,%x] found inode(%x,%x) for <%s>\n",
-__FUNCTION__, pid, trdid, inode_cxy, inode_ptr, path );
-#endif
-
-    // create a new file descriptor in cluster containing inode
-    error = vfs_file_create( inode_xp , file_attr , &file_xp );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create file descriptor for <%s> / cycle %d\n",
-__FUNCTION__ , pid, trdid , path , cycle );
-#endif
-        return error;
-    }
-
-#if (DEBUG_VFS_OPEN & 1)
-if( DEBUG_VFS_OPEN < cycle )
-printk("\n[%s] thread[%x,%x] created file descriptor (%x,%x) for <%s>\n",
-__FUNCTION__, pid, trdid, GET_CXY(file_xp), GET_PTR(file_xp), path );
-#endif
-
-    // allocate and register a new file descriptor index in reference process
-    error = process_fd_register( process_xp , file_xp , &file_id );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register file descriptor for <%s> / cycle %d\n",
-__FUNCTION__ , pid, trdid , path , cycle );
-#endif
-        return error;
-    }
-
-    // get new file descriptor cluster and local pointer
-    cxy_t        file_cxy = GET_CXY( file_xp );
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-
-    //get file type
-    uint32_t file_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ));
-
-    // link the client thead to the pipe for a FIFO type
-    if( file_type == FILE_TYPE_FIFO )
-    {
-        // get local pointer on attached pipe
-        pipe_t * pipe = hal_remote_lpt( XPTR( file_cxy , &file_ptr->pipe ));
-
-        // build extended pointer on client thread
-        xptr_t thread_xp = XPTR( local_cxy , this );
-
-        // update pipe descriptor
-        if( flags & O_RDONLY ) hal_remote_s64( XPTR(file_cxy,&pipe->reader_xp) , thread_xp );
-        if( flags & O_WRONLY ) hal_remote_s64( XPTR(file_cxy,&pipe->writer_xp) , thread_xp );
-    }
-
-#if DEBUG_VFS_OPEN
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_OPEN < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> / fdid %d / file(%x,%x) / cycle %d\n",
-__FUNCTION__, pid, trdid, path, file_id,
-GET_CXY( file_xp ), GET_PTR( file_xp ), cycle );
-#endif
-
-    // success
-    *new_file_xp = file_xp;
-    *new_file_id = file_id;
-    return 0;
-
-}  // end vfs_open()
-
-///////////////////////////////////////////
-uint32_t vfs_user_move( bool_t   to_buffer,
-                        xptr_t   file_xp,
-                        void   * buffer,
-                        uint32_t count )
-{
-    cxy_t              file_cxy;       // remote file descriptor cluster 
-    vfs_file_t       * file_ptr;       // remote file descriptor local pointer
-    mapper_t         * mapper;         // local pointer on file mapper
-    vfs_inode_t      * inode;          // local pointer on file inode
-    vfs_file_type_t   type;           // inode type
-    uint32_t           offset;         // current offset in file
-    uint32_t           size;           // current file size
-    uint32_t           nbytes;         // number of bytes actually transfered
-    error_t            error;
-
-// check argument
-assert( __FUNCTION__, (file_xp != XPTR_NULL), "file_xp == XPTR_NULL" );
-
-    // get cluster and local pointer on remote file descriptor
-    file_cxy  = GET_CXY( file_xp );
-    file_ptr  = GET_PTR( file_xp );
-
-    // get various infos from remote file descriptor 
-    type   = hal_remote_l32( XPTR( file_cxy , &file_ptr->type   ) );
-    offset = hal_remote_l32( XPTR( file_cxy , &file_ptr->offset ) );
-    mapper = hal_remote_lpt( XPTR( file_cxy , &file_ptr->mapper ) );
-    inode  = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode  ) );
-    size   = hal_remote_l32( XPTR( file_cxy , &inode->size      ) );
-   
-// check inode type
-assert( __FUNCTION__, (type == FILE_TYPE_REG), "bad inode type" );
-
-#if DEBUG_VFS_USER_MOVE || DEBUG_VFS_ERROR
-uint32_t      cycle      = (uint32_t)hal_get_cycles();
-thread_t    * this       = CURRENT_THREAD;
-#endif
-
-#if DEBUG_VFS_USER_MOVE
-char          name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( XPTR( file_cxy , inode ) , name );
-if( cycle > DEBUG_VFS_USER_MOVE )
-{
-    if( to_buffer ) 
-    printk("\n[%s] thread[%x,%x] enter / %d bytes / map(%s) -> buf(%x) / offset %d / cycle %d\n",
-    __FUNCTION__ , this->process->pid, this->trdid, count, name, buffer, offset, cycle );
-    else            
-    printk("\n[%s] thread[%x,%x] enter / %d bytes / buf(%x) -> map(%s) / offset %d / cycle %d\n",
-    __FUNCTION__ , this->process->pid, this->trdid, count, buffer, name, offset, cycle );
-}
-#endif
-
-    if( to_buffer ) // => compute the number of bytes to move and make the move
-    {
-        // compute number of bytes to move
-        if     ( size <= offset )         nbytes = 0; 
-        else if( size < offset + count )  nbytes = size - offset;
-        else                              nbytes = count;
-
-        // move data from mapper to buffer when required
-        if( nbytes > 0 )
-        {      
-            error = mapper_move_user( XPTR( file_cxy , mapper ),
-                                      to_buffer,
-                                      offset,
-                                      buffer,
-                                      nbytes );
-        }
-        else
-        {
-            error = 0;
-        }
-    }
-    else // to mapper => make the move and update the file size if required
-    {
-        nbytes = count;
-
-        // move data from buffer to mapper
-        error = mapper_move_user( XPTR( file_cxy , mapper ),
-                                  to_buffer,
-                                  offset,
-                                  buffer,
-                                  count );
-
-        // update file size in inode if required
-        if( offset + count > size ) 
-        {
-            vfs_inode_update_size( XPTR( file_cxy , inode ) , offset + count );
-        }
-    }
-        
-    if( error ) 
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s thread[%x,%x] cannot move data / cycle %d",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // update file offset in file descriptor
-    hal_remote_atomic_add( XPTR( file_cxy , &file_ptr->offset ) , nbytes );
-
-#if DEBUG_VFS_USER_MOVE
-if( cycle > DEBUG_VFS_USER_MOVE )
-{
-    if( to_buffer ) 
-    printk("\n[%s] thread[%x,%x] exit / %d bytes moved from mapper to buffer\n",
-    __FUNCTION__ , this->process->pid, nbytes );
-    else            
-    printk("\n[%s] thread[%x,%x] exit / %d bytes moved from buffer to mapper\n",
-    __FUNCTION__ , this->process->pid, nbytes );
-}
-#endif
-
-    return nbytes;
-
-}  // end vfs_user_move()
-
-////////////////////////////////////////////
-error_t vfs_kernel_move( bool_t   to_buffer,
-                         xptr_t   file_xp,
-                         xptr_t   buffer_xp,
-                         uint32_t size )
-{
-    cxy_t              file_cxy;     // remote file descriptor cluster 
-    vfs_file_t       * file_ptr;     // remote file descriptor local pointer
-    uint32_t           file_offset;  // current offset in file
-    mapper_t         * mapper_ptr;   // remote mapper local pointer
-    xptr_t             mapper_xp;    // remote mapper extended pointer
-    error_t            error;
-
-// check argument
-assert( __FUNCTION__, (file_xp != XPTR_NULL) , "file_xp == XPTR_NULL" );
-
-#if DEBUG_VFS_KERNEL_MOVE || DEBUG_VFS_ERROR
-uint32_t      cycle      = (uint32_t)hal_get_cycles();
-thread_t    * this       = CURRENT_THREAD;
-#endif
-
-    // get cluster and local pointer on remote file descriptor
-    file_cxy  = GET_CXY( file_xp );
-    file_ptr  = GET_PTR( file_xp );
-
-    // get mapper pointers and file offset from file descriptor
-    file_offset = hal_remote_l32( XPTR( file_cxy , &file_ptr->offset ) );
-    mapper_ptr  = hal_remote_lpt( XPTR( file_cxy , &file_ptr->mapper ) );
-    mapper_xp   = XPTR( file_cxy , mapper_ptr );
-
-    // move data between mapper and buffer
-    error = mapper_move_kernel( mapper_xp,
-                                to_buffer,
-                                file_offset,
-                                buffer_xp,
-                                size );
-    if( error ) 
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot move data / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , cycle );
-#endif
-        return -1;
-
-    }
-
-#if DEBUG_VFS_KERNEL_MOVE
-char          name[CONFIG_VFS_MAX_NAME_LENGTH];
-cxy_t         buffer_cxy = GET_CXY( buffer_xp );
-void        * buffer_ptr = GET_PTR( buffer_xp );
-vfs_inode_t * inode      = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
-vfs_inode_get_name( XPTR( file_cxy , inode ) , name );
-if( cycle > DEBUG_VFS_KERNEL_MOVE )
-{
-    if( to_buffer ) 
-    printk("\n[%s] thread[%x,%x] moves %d bytes from <%s> mapper to buffer(%x,%x) / cycle %d\n",
-    __FUNCTION__ , this->process->pid, this->trdid, size, name, buffer_cxy, buffer_ptr );
-    else            
-    printk("\n[%s] thread[%x,%x] moves %d bytes from buffer(%x,%x) to <%s> mapper / cycle %d\n",
-    __FUNCTION__ , this->process->pid, this->trdid, size, buffer_cxy, buffer_ptr, name );
-}
-#endif
-
-    return 0;
-
-}  // end vfs_kernel_move()
-
-//////////////////////////////////////
-error_t vfs_lseek( xptr_t     file_xp,
-                   uint32_t   offset,
-                   uint32_t   whence, 
-                   uint32_t * new_offset )
-{
-    xptr_t         offset_xp;
-    xptr_t         lock_xp;
-    xptr_t         size_xp;
-    cxy_t          file_cxy;
-    vfs_file_t  *  file_ptr;
-    vfs_inode_t *  inode_ptr;
-    uint32_t       new;
-
-// check arguments
-assert( __FUNCTION__, (file_xp != XPTR_NULL) , "file_xp == XPTR_NULL" );
-assert( __FUNCTION__, (new_offset != NULL )  , "new_offset == NULL" );
-
-#if DEBUG_VFS_LSEEK || DEBUG_VFS_ERROR
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-#endif
-
-    // get cluster and local pointer on remote file descriptor
-    file_cxy = GET_CXY( file_xp );
-    file_ptr = GET_PTR( file_xp );
-
-    // get local pointer on remote inode
-    inode_ptr = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
-
-    // build extended pointers on lock, offset and size
-    offset_xp = XPTR( file_cxy , &file_ptr->offset );
-    lock_xp   = XPTR( file_cxy , &file_ptr->lock );
-    size_xp   = XPTR( file_cxy , &inode_ptr->size );
-
-    // take file descriptor lock
-    remote_rwlock_wr_acquire( lock_xp );
-
-    if      ( whence == SEEK_CUR )   // new = current + offset
-    {
-        new = hal_remote_l32( offset_xp ) + offset;
-    }
-    else if ( whence == SEEK_SET )   // new = offset
-    {
-        new = offset;
-    }
-    else if ( whence == SEEK_END )   // new = size + offset
-    { 
-        new = hal_remote_l32( size_xp ) + offset;
-    }
-    else
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / undefined whence value / cycle %d",
-__FUNCTION__ , this->process->pid , this->trdid , cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-#if DEBUG_VFS_LSEEK
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-char       name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( XPTR( file_cxy , inode_ptr ) , name );
-if( cycle > DEBUG_VFS_LSEEK )
-printk("\n[%s] thread[%x,%x] for <%s> / new offset %d / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, name, new, cycle );
-#endif
-
-    // set new offset
-    hal_remote_s32( offset_xp , new );
-
-    // release file descriptor lock
-    remote_rwlock_wr_release( lock_xp );
-
-    // success
-    *new_offset = new;
-    return 0;
-
-}  // vfs_lseek()
-
-////////////////////////////////////
-error_t vfs_close( xptr_t   file_xp,
-                   uint32_t file_id )
-{
-    cxy_t         file_cxy;         // cluster containing the file descriptor.
-    vfs_file_t  * file_ptr;         // local pointer on file descriptor
-    cxy_t         owner_cxy;        // process owner cluster
-    pid_t         pid;              // process identifier
-    lpid_t        lpid;             // process local index
-    xptr_t        root_xp;          // root of xlist (processes , or dentries)
-    xptr_t        lock_xp;          // lock protecting the xlist
-    xptr_t        iter_xp;          // iterator on xlist
-    mapper_t    * mapper_ptr;       // local pointer on associated mapper
-    vfs_inode_t * inode_ptr;        // local pointer on associated inode
-    uint32_t      size;             // current file size (from inode descriptor)
-    error_t       error;
-
-    char          name[CONFIG_VFS_MAX_NAME_LENGTH];  // file name
-
-// check argument
-assert( __FUNCTION__, (file_xp != XPTR_NULL) , "file_xp is XPTR_NULL" );
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-    cluster_t * cluster = LOCAL_CLUSTER;
-
-#if DEBUG_VFS_CLOSE || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get file name
-    vfs_file_get_name( file_xp , name );
-    
-#if DEBUG_VFS_CLOSE
-if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, name, cycle );
-#endif
-
-    // get cluster and local pointer on remote file descriptor
-    file_cxy = GET_CXY( file_xp );
-    file_ptr = GET_PTR( file_xp );
-
-    //////// 1) update all dirty pages from mapper to device
-
-    // get local pointer on mapper associated to file
-    mapper_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->mapper ) );
-
-    // copy all dirty pages from mapper to device
-    error = mapper_sync( XPTR( file_cxy , mapper_ptr ) );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot synchronise dirty pages for <%s> / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , name , cycle );
-#endif
-        return -1;
-    }
-
-#if DEBUG_VFS_CLOSE 
-if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] synchronised <%s> mapper to device\n",
-__FUNCTION__, process->pid, this->trdid, name );
-#endif
-
-    //////// 2) update file size in all parent directory mapper(s) and update device
-
-    // get local pointer on remote inode
-    inode_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
-
-    // get file size from remote inode
-    size = hal_remote_l32( XPTR( file_cxy , &inode_ptr->size ) );
-
-    // get root of list of parents dentry
-    root_xp = XPTR( file_cxy , &inode_ptr->parents );
-
-    // loop on all parents
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        // get pointers on parent directory dentry
-        xptr_t         parent_dentry_xp  = XLIST_ELEMENT( iter_xp , vfs_dentry_t , parents );
-        cxy_t          parent_cxy        = GET_CXY( parent_dentry_xp );
-        vfs_dentry_t * parent_dentry_ptr = GET_PTR( parent_dentry_xp );
-
-        // get local pointer on parent directory inode
-        vfs_inode_t * parent_inode_ptr = hal_remote_lpt( XPTR( parent_cxy, 
-                                                         &parent_dentry_ptr->parent ) );
-
-        // get local pointer on parent directory mapper
-        mapper_t * parent_mapper_ptr = hal_remote_lpt( XPTR( parent_cxy,
-                                                       &parent_inode_ptr->mapper ) );
- 
-        // update dentry size in parent directory mapper
-        error = vfs_fs_update_dentry( XPTR( parent_cxy , parent_inode_ptr ),
-                                      parent_dentry_ptr );
-
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot update size in parent / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , cycle );
-#endif
-            return -1;
-        }
-
-#if DEBUG_VFS_CLOSE 
-char parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( XPTR( parent_cxy , parent_inode_ptr ) , parent_name );
-if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] updated <%s> in <%s> / size = %d bytes\n",
-__FUNCTION__, process->pid, this->trdid, name, parent_name, size );
-#endif
-
-        // copy all dirty pages from parent mapper to device
-        error = mapper_sync( XPTR( parent_cxy , parent_mapper_ptr ) );
-
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot synchronise  mapper & device / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , cycle );
-#endif
-            return -1;
-        }
-
-#if DEBUG_VFS_CLOSE 
-if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] synchonized mapper of parent <%s> to device\n",
-__FUNCTION__, process->pid, this->trdid, parent_name );
-#endif
-
-    }
-
-    //////// 3) loop on the process copies to reset all fd_array[file_id] entries
-
-    // get owner process cluster and lpid
-    pid        = process->pid;
-    owner_cxy  = CXY_FROM_PID( pid );
-    lpid       = LPID_FROM_PID( pid );
-
-    // get extended pointers on copies root and lock
-    root_xp = XPTR( owner_cxy , &cluster->pmgr.copies_root[lpid] );
-    lock_xp = XPTR( owner_cxy , &cluster->pmgr.copies_lock[lpid] );
-
-    // take the lock protecting the list of copies
-    remote_queuelock_acquire( lock_xp );
-
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        xptr_t      process_xp  = XLIST_ELEMENT( iter_xp , process_t , copies_list );
-        cxy_t       process_cxy = GET_CXY( process_xp );
-        process_t * process_ptr = GET_PTR( process_xp );
-
-        xptr_t entry_xp = XPTR( process_cxy , &process_ptr->fd_array.array[file_id] );
-        hal_remote_s64( entry_xp , XPTR_NULL );
-        hal_fence();
-    }    
-
-    // release the lock protecting the list of copies
-    remote_queuelock_release( lock_xp );
-
-#if DEBUG_VFS_CLOSE 
-if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] reset all fd-array copies for <%s>\n",
-__FUNCTION__, process->pid, this->trdid, name );
-#endif
-
-    //////// 4) release memory allocated to file descriptor in remote cluster
-
-    vfs_file_destroy( file_xp );
-
-#if DEBUG_VFS_CLOSE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] exit / closed <%s> in process %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, name, process->pid, cycle );
-#endif
-
-    return 0;
-
-}  // end vfs_close()
-
-////////////////////////////////////
-error_t vfs_mkdir( xptr_t   root_xp,
-                   char   * path,
-                   uint32_t rights )
-{
-    error_t        error;
-    xptr_t         vfs_root_xp;        // extended pointer on VFS root inode
-    vfs_inode_t  * vfs_root_ptr;       // local pointer on VFS root inode
-    cxy_t          vfs_root_cxy;       // VFS root inode cluster identifier
-    xptr_t         lock_xp;            // extended pointer on lock protecting Inode Tree
-    xptr_t         inode_xp;           // extended pointer on new directory inode
-    vfs_inode_t  * inode_ptr;          // local pointer on new directory inode
-    cxy_t          inode_cxy;          // new directory inode cluster identifier
-    xptr_t         dentry_xp;          // extended pointer on new dentry
-    vfs_dentry_t * dentry_ptr;         // new dentry local pointer
-    xptr_t         parent_xp;          // extended pointer on parent inode
-    vfs_inode_t  * parent_ptr;         // local pointer on parent inode  
-    cxy_t          parent_cxy;         // parent inode cluster identifier
-    vfs_ctx_t    * parent_ctx_ptr;     // local pointer on parent inode context
-    uint32_t       parent_fs_type;     // parent inode file system type
-
-    xptr_t         parents_root_xp;    // extended pointer on parents field in inode (root)
-    xptr_t         parents_entry_xp;   // extended pointer on parents field in dentry
-    xptr_t         children_xhtab_xp;  // extended pointer on children field in inode (root)
-    xptr_t         children_entry_xp;  // extended pointer on children field in dentry
-
-    char           last_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-#if DEBUG_VFS_MKDIR || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_VFS_MKDIR
-char root_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( root_xp , root_name );
-if( DEBUG_VFS_MKDIR < cycle )
-printk("\n[%s] thread[%x,%x] enter / root <%s> / path <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, root_name, path, cycle );
-#endif
-
-    // build extended pointer on lock protecting Inode-Tree (in VFS root inode)
-    vfs_root_xp  = process->vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    lock_xp      = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take the lock protecting Inode Tree in write mode
-    remote_rwlock_wr_acquire( lock_xp );
-
-    // 1. get pointers on parent inode
-    error = vfs_lookup( root_xp,
-                        path,
-                        VFS_LOOKUP_DIR | VFS_LOOKUP_PARENT,
-                        &parent_xp,
-                        last_name );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot get parent inode for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path , cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-    // get parent inode cluster and local pointer
-    parent_cxy = GET_CXY( parent_xp );
-    parent_ptr = GET_PTR( parent_xp );
-
-#if( DEBUG_VFS_MKDIR & 1 )
-if( DEBUG_VFS_MKDIR < cycle )
-printk("\n[%s] thread[%x,%x] get parent inode (%x,%x) for <%s>\n",
-__FUNCTION__, process->pid, this->trdid, parent_cxy, parent_ptr, path );
-#endif
-
-    // get parent inode context, and FS type
-    parent_ctx_ptr = hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->ctx ) );
-    parent_fs_type = hal_remote_l32( XPTR( parent_cxy , &parent_ctx_ptr->type ) );
-
-    // 2. create one new dentry in parent cluster
-    error = vfs_dentry_create( parent_cxy,
-                               parent_fs_type,
-                               last_name,
-                               &dentry_xp );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create dentry in cluster %x for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, parent_cxy, path , cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-    // get local pointer on dentry 
-    dentry_ptr = GET_PTR( dentry_xp );
-
-#if( DEBUG_VFS_MKDIR & 1 )
-if( DEBUG_VFS_MKDIR < cycle )
-printk("\n[%s] thread[%x,%x] created new dentry (%x,%x) for <%s>\n",
-__FUNCTION__, process->pid, this->trdid, parent_cxy, dentry_ptr, path );
-#endif
-
-    // 3. create new directory inode
-    // TODO : define attr / uid / gid
-    uint32_t attr = 0;
-    uint32_t uid  = 0;
-    uint32_t gid  = 0;
-
-    // select a target cluster for new inode
-    inode_cxy = cluster_random_select();
-    
-    // create inode
-    error = vfs_inode_create( inode_cxy,
-                              parent_fs_type,
-                              attr,
-                              rights,
-                              uid,
-                              gid,
-                              &inode_xp );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create inode in cluster %x for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, parent_cxy, path , cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        vfs_dentry_destroy( dentry_xp );
-        return -1;
-    }
-
-    // get new inode local pointer
-    inode_ptr = GET_PTR( inode_xp );
-
-    // update inode "type" field
-    hal_remote_s32( XPTR( inode_cxy , &inode_ptr->type ) , FILE_TYPE_DIR ); 
-    
-#if(DEBUG_VFS_MKDIR & 1)
-if( DEBUG_VFS_MKDIR < cycle )
-printk("\n[%s] thread[%x,%x] created new inode (%x,%x) for <%s>\n",
-__FUNCTION__ , process->pid, this->trdid, inode_cxy, inode_ptr, path );
-#endif
-
-    // 4. register dentry in new inode list of parents
-    parents_root_xp  = XPTR( inode_cxy  , &inode_ptr->parents );
-    parents_entry_xp = XPTR( parent_cxy , &dentry_ptr->parents );
-    xlist_add_first( parents_root_xp , parents_entry_xp );
-    hal_remote_atomic_add( XPTR( inode_cxy , &inode_ptr->links ) , 1 );
-
-    // 5. register dentry in parent inode 
-    children_xhtab_xp = XPTR( parent_cxy , &parent_ptr->children );
-    children_entry_xp = XPTR( parent_cxy , &dentry_ptr->children );
-    xhtab_insert( children_xhtab_xp , last_name , children_entry_xp );
-
-    // 6. update "parent" and "child_xp" fields in dentry
-    hal_remote_s64( XPTR( parent_cxy , &dentry_ptr->child_xp ) , inode_xp );
-    hal_remote_spt( XPTR( parent_cxy , &dentry_ptr->parent ) , parent_ptr );
-
-#if(DEBUG_VFS_MKDIR & 1)
-if( DEBUG_VFS_MKDIR < cycle )
-printk("\n[%s] thread[%x,%x] updated Inode Tree for <%s>\n",
-__FUNCTION__, process->pid, this->trdid, path );
-#endif
-
-    // 7. create the two special dentries <.> and <..> in new directory
-    // both the new directory mapper, and the Inode Tree are updated
-    error = vfs_add_special_dentries( inode_xp,
-                                      parent_xp );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create <.> & <..> dentries for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path , cycle );
-#endif
-        vfs_remove_child_from_parent( dentry_xp );
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-    // release the lock protecting Inode Tree
-    remote_rwlock_wr_release( lock_xp );
-
-    // 8. update parent directory mapper 
-    //    and synchronize the parent directory on IOC device
-    error = vfs_fs_add_dentry( parent_xp,
-                               dentry_ptr );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot update parent directory for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path , cycle );
-#endif
-        vfs_remove_child_from_parent( dentry_xp );
-        return -1;
-    }
-
-#if(DEBUG_VFS_MKDIR & 1)
-if( DEBUG_VFS_MKDIR < cycle )
-printk("\n[%s] thread[%x,%x] created <%s> dir (Inode-Tree, Mapper and IOC)\n",
-__FUNCTION__, process->pid, this->trdid, path );
-#endif
-
-    return 0;
-
-}  // end vfs_mkdir()
-
-///////////////////////////////////////
-error_t vfs_link( xptr_t   old_root_xp,
-                  char   * old_path,
-                  xptr_t   new_root_xp,
-                  char   * new_path )
-{
-    error_t        error;
-    xptr_t         vfs_root_xp;        // extended pointer on VFS root inode
-    vfs_inode_t  * vfs_root_ptr;       // local pointer on VFS root inode
-    cxy_t          vfs_root_cxy;       // VFS root inode cluster identifier
-    xptr_t         lock_xp;            // extended pointer on lock protecting Inode Tree
-    xptr_t         inode_xp;           // extended pointer on target inode
-    vfs_inode_t  * inode_ptr;          // local pointer on target inode
-    cxy_t          inode_cxy;          // target inode cluster identifier
-    uint32_t       inode_type;         // target inode type
-    vfs_ctx_t    * inode_ctx_ptr;      // local pointer on target inode context
-    uint32_t       inode_fs_type;      // target inode file system type
-    xptr_t         dentry_xp;          // extended pointer on new dentry
-    vfs_dentry_t * dentry_ptr;         // target dentry local pointer
-    xptr_t         new_parent_xp;      // extended pointer on new parent inode
-    vfs_inode_t  * new_parent_ptr;     // local pointer on new parent inode  
-    cxy_t          new_parent_cxy;     // new parent inode cluster identifier
-
-    xptr_t         parents_root_xp;    // extended pointer on parents field in inode (root)
-    xptr_t         parents_entry_xp;   // extended pointer on parents field in dentry
-    xptr_t         children_xhtab_xp;  // extended pointer on children field in inode (root)
-    xptr_t         children_entry_xp;  // extended pointer on children field in dentry
-
-    char           new_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-#if DEBUG_VFS_LINK || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_VFS_LINK
-char old_root_name[CONFIG_VFS_MAX_NAME_LENGTH];
-char new_root_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( old_root_xp , old_root_name );
-vfs_inode_get_name( new_root_xp , new_root_name );
-if( DEBUG_VFS_LINK < cycle )
-printk("\n[%s] thread[%x,%x] enter / old_root <%s> / old_path <%s> / "
-"new_root <%s> / new_path <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid,
-old_root_name, old_path, new_root_name, new_path, cycle );
-#endif
-
-    // build extended pointer on lock protecting Inode Tree (in VFS root inode)
-    vfs_root_xp  = process->vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    lock_xp      = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take the lock protecting Inode Tree in write mode
-    remote_rwlock_wr_acquire( lock_xp );
-
-    // get extended pointer on target inode
-    error = vfs_lookup( old_root_xp,
-                        old_path,
-                        0,
-                        &inode_xp,
-                        NULL );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot get target inode for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, old_path , cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-#if( DEBUG_VFS_LINK & 1 )
-if( DEBUG_VFS_LINK < cycle )
-printk("\n[%s] thread[%x,%x] get child inode (%x,%x) for <%s>\n",
-__FUNCTION__, process->pid, this->trdid,
-GET_CXY(inode_xp), GET_PTR(inode_xp), old_path, cycle );
-#endif
-
-    // get extended pointer on parent inode in new path
-    error = vfs_lookup( new_root_xp,
-                        new_path,
-                        VFS_LOOKUP_PARENT,
-                        &new_parent_xp,
-                        new_name );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot get parent inode for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, new_path , cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-#if( DEBUG_VFS_LINK & 1 )
-if( DEBUG_VFS_LINK < cycle )
-printk("\n[%s] thread[%x,%x] get parent inode (%x,%x) for <%s>\n",
-__FUNCTION__, process->pid, this->trdid,
-GET_CXY(new_parent_xp), GET_PTR(new_parent_xp), new_path );
-#endif
-
-    // get target inode cluster and local pointer
-    inode_cxy = GET_CXY( inode_xp );
-    inode_ptr = GET_PTR( inode_xp );
-
-    // get target inode type, context, and FS type
-    inode_type        = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-    inode_ctx_ptr     = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->ctx ) );
-    inode_fs_type     = hal_remote_l32( XPTR( inode_cxy , &inode_ctx_ptr->type ) );
-
-    // get new parent inode cluster an local pointer
-    new_parent_ptr = GET_PTR( new_parent_xp );
-    new_parent_cxy = GET_CXY( new_parent_xp );
-
-    ///////////////////////////////////////////////////////////////////////
-    if( (inode_type == FILE_TYPE_REG) || (inode_type == FILE_TYPE_DIR) )
-    {
-        // 1. create one new dentry
-        error = vfs_dentry_create( new_parent_cxy,
-                                   inode_fs_type,
-                                   new_name,
-                                   &dentry_xp );
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create new dentry for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, new_path , cycle );
-#endif
-            remote_rwlock_wr_release( lock_xp );
-            return -1;
-        }
-
-        // get local pointer on dentry 
-        dentry_ptr = GET_PTR( dentry_xp );
-
-        // 2. register dentry in target inode 
-        parents_root_xp  = XPTR( inode_cxy      , &inode_ptr->parents );
-        parents_entry_xp = XPTR( new_parent_cxy , &dentry_ptr->parents );
-        xlist_add_first( parents_root_xp , parents_entry_xp );
-        hal_remote_atomic_add( XPTR( inode_cxy , &inode_ptr->links ) , 1 );
-
-        // 3. register dentry in parent inode 
-        children_xhtab_xp = XPTR( new_parent_cxy , &new_parent_ptr->children );
-        children_entry_xp = XPTR( new_parent_cxy , &dentry_ptr->children );
-        xhtab_insert( children_xhtab_xp , new_name , children_entry_xp );
-
-        // 4. update "parent" and "child_xp" fields in dentry
-        hal_remote_s64( XPTR( new_parent_cxy , &dentry_ptr->child_xp ) , inode_xp );
-        hal_remote_spt( XPTR( new_parent_cxy , &dentry_ptr->parent ) , new_parent_ptr );
-
-#if(DEBUG_VFS_LINK & 1)
-if( DEBUG_VFS_LINK < cycle )
-printk("\n[%s] thread[%x,%x] updated Inode Tree / old <%s> / new <%s>\n",
-__FUNCTION__, process->pid, this->trdid, old_path, new_path );
-vfs_display( new_parent_xp ); 
-#endif
-
-        // release the lock protecting Inode Tree
-        remote_rwlock_wr_release( lock_xp );
-
-        // 5. update new parent directory mapper in Inode Tree
-        //    and synchronize the parent directory on IOC device
-        if (new_parent_cxy == local_cxy)
-        error = vfs_fs_add_dentry( new_parent_xp,
-                                   dentry_ptr );
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot update parent directory for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, new_path , cycle );
-#endif
-            return -1;
-        }
-
-#if(DEBUG_VFS_LINK & 1)
-if( DEBUG_VFS_LINK < cycle )
-printk("\n[%s] thread[%x,%x] updated new parent dir (mapper and IOC) / old <%s> / new <%s>\n",
-__FUNCTION__, process->pid, this->trdid, old_path, new_path );
-#endif
-        return 0;
-    }
-    else
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / unsupported inode type %s / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, vfs_inode_type_str( inode_type ), cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-}  // end vfs_link()
-
-/////////////////////////////////////
-error_t vfs_unlink( xptr_t   root_xp,
-                    char   * path )
-{
-    error_t           error;
-    xptr_t            vfs_root_xp;        // extended pointer on VFS root inode
-    vfs_inode_t     * vfs_root_ptr;       // local_pointer on VFS root inode
-    cxy_t             vfs_root_cxy;       // VFS root inode cluster identifier
-    xptr_t            lock_xp;            // extended pointer on lock protecting Inode Tree
-    xptr_t            parent_xp;          // extended pointer on target inode
-    cxy_t             parent_cxy;         // target inode cluster identifier       
-    vfs_inode_t     * parent_ptr;         // target inode local pointer
-    xptr_t            inode_xp;           // extended pointer on target inode
-    cxy_t             inode_cxy;          // target inode cluster identifier       
-    vfs_inode_t     * inode_ptr;          // target inode local pointer
-    uint32_t          inode_links;        // target inode links count
-    vfs_file_type_t  inode_type;         // target inode type
-    uint32_t          inode_children;     // target inode number of children
-    xptr_t            dentry_xp;          // extended pointer on dentry to unlink
-    vfs_dentry_t    * dentry_ptr;         // local pointer on dentry to unlink
-    vfs_ctx_t       * ctx_ptr;            // local pointer on FS context
-    vfs_fs_type_t     fs_type;            // File system type
-
-    char              child_name[CONFIG_VFS_MAX_NAME_LENGTH];   // name of link to remove
-    char              parent_name[CONFIG_VFS_MAX_NAME_LENGTH];  // name of parent directory
-
-#if DEBUG_VFS_UNLINK || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_VFS_UNLINK
-char root_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( root_xp , root_name );
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] : enter for root <%s> / path <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, root_name, path, cycle );
-#endif
-
-    // build extended pointer on lock protecting Inode Tree (in VFS root inode)
-    vfs_root_xp  = process->vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    lock_xp      = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take the lock protecting Inode Tree
-    remote_rwlock_wr_acquire( lock_xp );
-
-    // get extended pointer on parent inode
-    error = vfs_lookup( root_xp,
-                        path,
-                        VFS_LOOKUP_PARENT,
-                        &parent_xp,
-                        child_name );
-    if( error ) 
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot get parent inode for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path , cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-    
-    // get parent inode name, cluster and local pointer
-    vfs_inode_get_name( parent_xp , parent_name );
-    parent_cxy = GET_CXY( parent_xp );
-    parent_ptr = GET_PTR( parent_xp );
- 
-#if( DEBUG_VFS_UNLINK & 1 )
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] : parent inode <%s> is (%x,%x)\n",
-__FUNCTION__, process->pid, this->trdid, parent_name, parent_cxy, parent_ptr );
-#endif
-
-    // build extended pointer on parent inode "children" xhtab
-    xptr_t children_xp = XPTR( parent_cxy , &parent_ptr->children );
-
-    // try to get extended pointer on dentry from Inode Tree
-    dentry_xp = xhtab_lookup( children_xp , child_name );
-    
-    // when dentry not found in Inode Tree, try to get it from mapper
-
-    if( dentry_xp == XPTR_NULL )           // miss target dentry in Inode Tree
-    {
-
-#if( DEBUG_VFS_UNLINK & 1 )
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] : inode <%s> not found => scan parent mapper <%s>\n",
-__FUNCTION__, process->pid, this->trdid, child_name , parent_name );
-#endif
-        // get parent inode FS type
-        ctx_ptr    = hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->ctx ) );
-        fs_type    = hal_remote_l32( XPTR( parent_cxy , &ctx_ptr->type ) );
-
-        // select a cluster for new inode
-        inode_cxy = cluster_random_select();
-
-        // speculatively insert a new child dentry/inode couple in inode tree
-        error = vfs_add_child_in_parent( inode_cxy,
-                                         fs_type, 
-                                         parent_xp, 
-                                         child_name, 
-                                         &dentry_xp,
-                                         &inode_xp );
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create node <%s> in Inode_Tree / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-            remote_rwlock_wr_release( lock_xp );
-            return -1;
-        }
-
-        // get local pointers on new dentry and new inode descriptors
-        inode_ptr  = GET_PTR( inode_xp );
-        dentry_ptr = GET_PTR( dentry_xp );
-
-        // scan parent mapper to find the missing dentry, and complete 
-        // initialisation of new dentry and new inode descriptors In Inode Tree
-        error = vfs_fs_new_dentry_from_mapper( parent_xp,
-                                               dentry_ptr );
-        if ( error ) 
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot get dentry  <%s> in parent <%s> mapper / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, child_name, parent_name, cycle );
-#endif
-            remote_rwlock_wr_release( lock_xp );
-            return -1;
-        }
-
-#if (DEBUG_VFS_UNLINK & 1)
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] : created missing inode & dentry <%s> in cluster %x\n",
-__FUNCTION__, process->pid, this->trdid, child_name, inode_cxy );
-#endif
-
-    }
-    else                                  // found target dentry in Inode Tree
-    {
-        dentry_ptr = GET_PTR( dentry_xp );
-       
-        // get pointer on target inode from dentry
-        inode_xp  = hal_remote_l64( XPTR( parent_cxy , &dentry_ptr->child_xp ) );
-        inode_cxy = GET_CXY( inode_xp );
-        inode_ptr = GET_PTR( inode_xp );
-    }
-
-    // At this point the Inode-Tree contains the parent dentry and child inode
-    // we can safely remove this dentry from both the parent mapper, and the Inode Tree.
-
-#if( DEBUG_VFS_UNLINK & 1 )
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] : dentry (%x,%x) / inode (%x,%x)\n",
-__FUNCTION__, process->pid, this->trdid, parent_cxy, dentry_ptr, inode_cxy, inode_ptr );
-#endif
-
-    // get target inode "type" and "links"
-    inode_type   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-    inode_links  = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->links ) );
-
-    ///////////////////////////////////////////////////////////////////////
-    if( (inode_type == FILE_TYPE_REG) || (inode_type == FILE_TYPE_DIR) )  
-    {
-
-#if( DEBUG_VFS_UNLINK & 1 )
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] : unlink inode <%s> / type %s / %d links\n",
-__FUNCTION__, process->pid, this->trdid, child_name, 
-vfs_inode_type_str(inode_type), inode_links );
-#endif
-        // 1. Release space allocated to inode on IOC device 
-        //    and synchronize the FAT on IOC device if last link.
-        if( inode_links == 1 ) 
-        {
-            // build extended pointer on target inode "children" number
-            xptr_t inode_children_xp = XPTR( inode_cxy , &inode_ptr->children.items );
-
-            // get target inode number of children 
-            inode_children = hal_remote_l32( inode_children_xp );
-
-            // check no children
-            if( inode_children != 0 )
-            {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot remove <%s> inode that has children / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-                remote_rwlock_wr_release( lock_xp );
-                return -1;
-            }
-
-            // release space on IOC device
-            error = vfs_fs_release_inode( inode_xp ); 
-
-            if( error )
-            {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot update FAT mapper to remove <s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-                remote_rwlock_wr_release( lock_xp );
-                return -1;
-            }
-
-#if(DEBUG_VFS_UNLINK & 1)
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] removed <%s> inode from FAT (mapper and IOC device)\n",
-__FUNCTION__, process->pid, this->trdid, path );
-#endif
-        }
-
-        // 2. update parent directory mapper
-        //    and synchronize the parent directory on IOC device
-        error = vfs_fs_remove_dentry( parent_xp,
-                                      dentry_ptr );
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot update parent directory on IOC for <s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-            remote_rwlock_wr_release( lock_xp );
-            return -1;
-        }
-
-#if(DEBUG_VFS_UNLINK & 1)
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] removed <%s> inode from parent dir (mapper and IOC device)\n",
-__FUNCTION__, process->pid, this->trdid, path );
-#endif
-        // 3. remove dentry from Inode Tree (and associated child inode when last link)
-        vfs_remove_child_from_parent( dentry_xp );
-
-        // release the lock protecting Inode Tree
-        remote_rwlock_wr_release( lock_xp );
-
-#if DEBUG_VFS_UNLINK
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] exit / removed <%s> inode from Inode Tree / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        return 0;
-    }
-    ////////////////////////////////////////
-    else if( inode_type == FILE_TYPE_FIFO )
-    {
-        // 1. destroy the associated pipe
-        pipe_t * pipe    = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->pipe )); 
-        pipe_destroy( XPTR( inode_cxy , pipe ) );
-
-#if(DEBUG_VFS_UNLINK & 1)
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] released <%s> pipe\n",
-__FUNCTION__, process->pid, this->trdid, path );
-#endif
-
-        // 2. remove dentry from Inode Tree (and associated child inode when last link)
-        vfs_remove_child_from_parent( dentry_xp );
-
-        // release the lock protecting Inode Tree
-        remote_rwlock_wr_release( lock_xp );
-
-#if DEBUG_VFS_UNLINK 
-if( DEBUG_VFS_UNLINK < cycle )
-printk("\n[%s] thread[%x,%x] exit / removed <%s> inode from Inode Tree / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        return 0;
-    }
-    else
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] unsupported inode type %d for <s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, vfs_inode_type_str( inode_type ), path, cycle );
-#endif
-        remote_rwlock_wr_release( lock_xp );
-        return -1;
-    }
-
-}  // end vfs_unlink() 
-
-////////////////////////////////////////////////
-error_t vfs_stat( xptr_t         root_inode_xp,
-                  char         * path,
-                  struct stat  * st )
-{
-    error_t       error;
-    xptr_t        inode_xp;           // extended pointer on target inode
-    vfs_inode_t * inode_ptr;          // local pointer on target inode
-    cxy_t         inode_cxy;          // target inode cluster identifier
-    xptr_t        vfs_root_xp;        // extended pointer on VFS root inode
-    vfs_inode_t * vfs_root_ptr;       // local_pointer on VFS root inode
-    cxy_t         vfs_root_cxy;       // VFS root inode cluster identifier
-    xptr_t        lock_xp;            // extended pointer on lock protecting Inode Tree
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_VFS_STAT || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // build extended pointer on lock protecting Inode Tree (in VFS root inode)
-    vfs_root_xp  = process->vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    lock_xp      = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // get the lock protecting Inode Tree in read mode
-    remote_rwlock_rd_acquire( lock_xp );
-
-    // get extended pointer on target inode
-    error = vfs_lookup( root_inode_xp,
-                        path,
-                        0,
-                        &inode_xp,
-                        NULL );
-
-    // release the lock protecting Inode Tree
-    remote_rwlock_rd_release( lock_xp );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot found inode <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        return -1;
-    }
-
-    // get cluster and local pointer on inode descriptor
-    inode_ptr = GET_PTR( inode_xp );
-    inode_cxy = GET_CXY( inode_xp );
-
-    // get relevant infos from inode descriptor
-    uint32_t inum   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->inum   ) );
-    uint32_t size   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->size   ) );
-    uint32_t uid    = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->uid    ) );
-    uint32_t gid    = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->gid    ) );
-    uint32_t type   = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type   ) );
-    uint32_t rights = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->rights ) );
-
-    // set stat structure fields 
-    st->st_ino  = inum;
-    st->st_gid  = gid;
-    st->st_uid  = uid;
-    st->st_size = size;
-    st->st_mode = (type << 16) | rights;
-
-#if DEBUG_VFS_STAT
-if( DEBUG_VFS_STAT < cycle )
-printk("\n[%s] thread[%x,%x] set stat for <%s> / %s / inum %d / size %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, vfs_inode_type_str( type ), inum, size, cycle );
-#endif
-
-    return 0;
-
-}  // end vfs_stat()
-
-////////////////////////////////////
-error_t vfs_chdir( xptr_t   root_xp,
-                   char   * path )
-{
-    error_t           error;
-    xptr_t            inode_xp;           // extended pointer on target inode
-    cxy_t             inode_cxy;          // target inode cluster identifier       
-    vfs_inode_t     * inode_ptr;          // target inode local pointer
-    vfs_file_type_t  inode_type;         // target inode type
-    xptr_t            vfs_root_xp;        // extended pointer on VFS root inode
-    vfs_inode_t     * vfs_root_ptr;       // local_pointer on VFS root inode
-    cxy_t             vfs_root_cxy;       // VFS root inode cluster identifier
-    xptr_t            main_lock_xp;       // extended pointer on lock protecting Inode Tree
-    xptr_t            ref_xp;             // extended pointer on reference process
-    process_t       * ref_ptr;            // local pointer on reference process
-    cxy_t             ref_cxy;            // reference process cluster
-    xptr_t            cwd_lock_xp;        // extended pointer on lock protecting CWD change
-    xptr_t            cwd_xp_xp;          // extended pointer on cwd_xp in reference process
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_VFS_CHDIR || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // build extended pointer on lock protecting Inode Tree (in VFS root inode)
-    vfs_root_xp  = process->vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    main_lock_xp = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take lock protecting Inode Tree in read mode
-    remote_rwlock_rd_acquire( main_lock_xp );
-
-    // get extended pointer on target inode
-    error = vfs_lookup( root_xp,
-                        path,
-                        VFS_LOOKUP_DIR,
-                        &inode_xp,
-                        NULL );
-
-    // release lock protecting Inode Tree in read mode
-    remote_rwlock_rd_release( main_lock_xp );
-
-    if( error ) 
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot found inode <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        return -1;
-    }
-
-    // get inode type from remote file
-    inode_cxy = GET_CXY( inode_xp );
-    inode_ptr = GET_PTR( inode_xp );
-    inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-
-    if( inode_type != FILE_TYPE_DIR )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / <%s> is not a directory / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        return -1;
-    }
-
-    // build extended pointer on cwd_lock and cwd_xp 
-    ref_xp       = process->ref_xp;
-    ref_ptr      = GET_PTR( ref_xp );
-    ref_cxy      = GET_CXY( ref_xp );
-    cwd_lock_xp  = XPTR( ref_cxy , &ref_ptr->cwd_lock );
-    cwd_xp_xp    = XPTR( ref_cxy , &ref_ptr->cwd_xp );
-
-    // take lock protecting CWD changes
-    remote_busylock_acquire( cwd_lock_xp );
-
-    // update cwd_xp field in reference process descriptor
-    hal_remote_s64( cwd_xp_xp , inode_xp );
-
-    // release lock protecting CWD changes
-    remote_busylock_release( cwd_lock_xp );
-
-#if DEBUG_VFS_CHDIR
-if( DEBUG_VFS_CHDIR < cycle )
-printk("\n[%s] thread[%x,%x] set new cwd <%s> / inode_xp (%x,%x) / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, inode_cxy, inode_ptr, cycle ); 
-#endif
-
-    return 0;
-
-}  // end vfs_chdir()
-
-///////////////////////////////////
-error_t vfs_chmod( xptr_t   cwd_xp,
-                   char   * path,
-                   uint32_t rights )
-{
-    error_t           error;
-    xptr_t            vfs_root_xp;        // extended pointer on VFS root inode
-    vfs_inode_t     * vfs_root_ptr;       // local_pointer on VFS root inode
-    cxy_t             vfs_root_cxy;       // VFS root inode cluster identifier
-    xptr_t            main_lock_xp;       // extended pointer on lock protecting Inode Tree
-    xptr_t            inode_xp;           // extended pointer on target inode
-    cxy_t             inode_cxy;          // inode cluster identifier       
-    vfs_inode_t     * inode_ptr;          // inode local pointer
-    vfs_file_type_t   inode_type;         // inode type    
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_VFS_CHMOD || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // build extended pointer on lock protecting Inode Tree (in VFS root inode)
-    vfs_root_xp  = process->vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    main_lock_xp = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take lock protecting Inode Tree in read mode
-    remote_rwlock_rd_acquire( main_lock_xp );
-
-    // get extended pointer on target inode
-    error = vfs_lookup( cwd_xp,
-                        path,
-                        0,
-                        &inode_xp,
-                        NULL );
-
-    // release lock protecting Inode Tree in read mode
-    remote_rwlock_rd_release( main_lock_xp );
-
-    if( error ) 
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot found inode <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        return -1;
-    }
-
-    // get inode cluster and local pointer
-    inode_cxy = GET_CXY( inode_xp );
-    inode_ptr = GET_PTR( inode_xp );
-    
-    // get inode type from remote inode
-    inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-
-    // TODO finalize implementation
-
-assert( __FUNCTION__, false , "not fully implemented" );
-
-    // set inode rights in remote inode
-    hal_remote_s32( XPTR( inode_cxy , &inode_ptr->rights ) , rights );
-
-#if DEBUG_VFS_CHMOD
-if( DEBUG_VFS_CHMOD < cycle )
-printk("\n[%s] thread[%x,%x] set access rights %x for <%s> / inode_xp (%x,%x) / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, rights, path, inode_cxy, inode_ptr, cycle ); 
-#endif
-
-    return 0;
-
-}   // end vfs_chmod()
-
-/////////////////////////////////////
-error_t vfs_mkfifo( xptr_t   root_xp,
-                    char   * path,
-                    uint32_t mode )
-{
-    error_t       error;
-    xptr_t        parent_inode_xp;         // extended pointer on parent inode in path
-    xptr_t        fifo_dentry_xp;          // extended pointer on created dentry
-    xptr_t        fifo_inode_xp;           // extended pointer on created inode
-    cxy_t         fifo_cxy;                // selected cluster for fifo inode
-
-    char          fifo_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    thread_t    * this    = CURRENT_THREAD;
-    process_t   * process = this->process;
-
-#if DEBUG_VFS_MKFIFO || DEBUG_VFS_ERROR
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // build extended pointer on lock protecting Inode Tree
-    xptr_t        vfs_root_xp  = process->vfs_root_xp;
-    vfs_inode_t * vfs_root_ptr = GET_PTR( vfs_root_xp );
-    cxy_t         vfs_root_cxy = GET_CXY( vfs_root_xp );
-    xptr_t        vfs_lock_xp  = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take the lock protecting the Inode-Tree in write mode
-    remote_rwlock_wr_acquire( vfs_lock_xp );
-
-    // 1. get extended pointer on parent inode and fifo name from vfs
-    error = vfs_lookup( root_xp,
-                        path,
-                        VFS_LOOKUP_PARENT,
-                        &parent_inode_xp,
-                        fifo_name );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot found parent inode for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        remote_rwlock_wr_release( vfs_lock_xp );
-        return -1;
-    }
-
-    // get parent inode cluster and local pointer
-    cxy_t         parent_cxy = GET_CXY( parent_inode_xp );
-    vfs_inode_t * parent_ptr = GET_PTR( parent_inode_xp );
-
-    // 2. select a cluster for new fifo inode 
-    fifo_cxy = cluster_random_select();
-
-    // get parent inode FS type
-    vfs_ctx_t    * ctx_ptr = hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->ctx ) );
-    vfs_fs_type_t  fs_type = hal_remote_l32( XPTR( parent_cxy , &ctx_ptr->type ) );
-
-    // 3. insert a new inode and dentry in Inode-Tree
-    error = vfs_add_child_in_parent( fifo_cxy,
-                                     fs_type, 
-                                     parent_inode_xp,
-                                     fifo_name,           
-                                     &fifo_dentry_xp,   
-                                     &fifo_inode_xp );
-   
-    // get fifo inode local pointer
-    vfs_inode_t * fifo_inode_ptr = GET_PTR( fifo_inode_xp );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create fifo inode for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        remote_rwlock_wr_release( vfs_lock_xp );
-        return -1;
-    }
-
-    // 4. allocate memory for a pipe descriptor, for the
-    //    remote_buf_t descriptor, and for the associated data buffer
-    pipe_t * pipe = pipe_create( fifo_cxy,
-                                 CONFIG_PIPE_BUF_SIZE ); 
-    if( pipe == NULL )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create pipe for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, cycle );
-#endif
-        vfs_remove_child_from_parent( fifo_dentry_xp );
-        remote_rwlock_wr_release( vfs_lock_xp );
-        return -1;
-    }
-
-    // 5. update fifo_inode "type", "pipe", and "rights" fields
-    hal_remote_s32( XPTR( fifo_cxy , &fifo_inode_ptr->type ) , FILE_TYPE_FIFO ); 
-    hal_remote_s32( XPTR( fifo_cxy , &fifo_inode_ptr->rights ) , mode ); 
-    hal_remote_spt( XPTR( fifo_cxy , &fifo_inode_ptr->pipe ) , pipe   );
-
-    // release the lock protecting the Inode-Tree from write mode
-    remote_rwlock_wr_release( vfs_lock_xp );
-
-#if DEBUG_VFS_MKDIR
-if( DEBUG_VFS_MKDIR < cycle )
-printk("\n[%s] thread[%x,%x] creared fifo <%s> / inode_xp [%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, path, fifo_cxy, fifo_inode_ptr, cycle ); 
-#endif
-
-    return 0;
-
-}   // end vfs_mkfifo()
-
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//       Distributed Inode Tree access related functions
-//////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////
-// This recursive function is called by the vfs_display() function.
-// that is supposed to take the TXT0 lock.
-//////////////////////////////////////////////////////////////////////////
-static void vfs_recursive_display( xptr_t   inode_xp,
-                                   xptr_t   name_xp,
-                                   uint32_t indent )
-{
-    cxy_t              inode_cxy;
-    vfs_inode_t      * inode_ptr;
-    vfs_file_type_t   inode_type;
-    uint32_t           inode_size;
-    uint32_t           inode_attr;
-    void             * inode_extd;
-
-    xptr_t             children_xp;    // extended pointer on children xhtab
-
-    xptr_t             child_dentry_xp;
-    cxy_t              child_dentry_cxy;
-    vfs_dentry_t     * child_dentry_ptr;
-    xptr_t             child_inode_xp;
-    xptr_t             child_dentry_name_xp;
-    mapper_t         * mapper_ptr;
-
-    char               name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    char *             indent_str[] = { "",                                  // level 0
-                                        "  ",                                // level 1
-                                        "    ",                              // level 2
-                                        "      ",                            // level 3
-                                        "        ",                          // level 4
-                                        "          ",                        // level 5
-                                        "            ",                      // level 6
-                                        "              ",                    // level 7
-                                        "                ",                  // level 8
-                                        "                  ",                // level 9
-                                        "                    ",              // level 10
-                                        "                      ",            // level 11
-                                        "                        ",          // level 12
-                                        "                          ",        // level 13
-                                        "                            ",      // level 14
-                                        "                              " };  // level 15
-
-assert( __FUNCTION__, (inode_xp != XPTR_NULL) , "inode_xp cannot be NULL" );
-assert( __FUNCTION__, (name_xp  != XPTR_NULL) , "name_xp cannot be NULL" );
-assert( __FUNCTION__, (indent < 16)           , "depth cannot be larger than 15" );
-    
-    // get current inode cluster and local pointer
-    inode_cxy = GET_CXY( inode_xp );
-    inode_ptr = GET_PTR( inode_xp );
-
-    // get inode type, size, attr, mapper, and inum
-    inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type   ) );
-    inode_size = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->size   ) );
-    inode_attr = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->attr   ) );
-    inode_extd = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->extend ) );
-    mapper_ptr = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-    // make a local copy of node name
-    hal_remote_strcpy( XPTR( local_cxy , name ) , name_xp );
-
-    // compute dirty
-    // inode_dirty = ((inode_attr & INODE_ATTR_DIRTY) != 0); unused [AG] dec 2019
-
-    // display inode
-    nolock_printk("%s<%s> : %s / extd %x / %d bytes / cxy %x / inode %x / mapper %x\n",
-    indent_str[indent], name, vfs_inode_type_str( inode_type ), (uint32_t)inode_extd,
-    inode_size, inode_cxy, inode_ptr, mapper_ptr );
-
-    // scan directory entries when current inode is a directory
-    // don't scan the the "." and ".." directories to break loops 
-    if( (inode_type == FILE_TYPE_DIR) && 
-        (strcmp( name , "." ) != 0)    &&
-        (strcmp( name , ".." ) != 0) )
-    {
-        // get extended pointer on directory entries xhtab
-        children_xp =  XPTR( inode_cxy , &inode_ptr->children );
-
-        // get xhtab lock
-        xhtab_lock( children_xp );
-
-        // get first dentry from xhtab
-        child_dentry_xp = xhtab_get_first( children_xp );
-
-        while( child_dentry_xp != XPTR_NULL )
-        {
-            // get dentry cluster and local pointer
-            child_dentry_cxy = GET_CXY( child_dentry_xp );
-            child_dentry_ptr = GET_PTR( child_dentry_xp );
-
-            // get extended pointer on child inode
-            child_inode_xp = hal_remote_l64( XPTR( child_dentry_cxy,
-                                                   &child_dentry_ptr->child_xp ) );
-
-            // get extended pointer on dentry name
-            child_dentry_name_xp = XPTR( child_dentry_cxy , &child_dentry_ptr->name );
-
-            // recursive call on inode display
-            vfs_recursive_display( child_inode_xp,
-                                   child_dentry_name_xp,
-                                   indent+1 );
-
-            // get next dentry
-            child_dentry_xp = xhtab_get_next( children_xp );
-        }
-
-        // release xhtab lock
-        xhtab_unlock( children_xp );
-    }
-}  // end vfs_recursive_display()
-
-///////////////////////////////////
-void vfs_display( xptr_t inode_xp )
-{
-    xptr_t         name_xp;
-    xptr_t         dentry_xp; 
-    cxy_t          dentry_cxy;
-    vfs_dentry_t * dentry_ptr;
-    xptr_t         parents_root_xp;   // root of parent dentries xlist
-
-    // get target inode cluster and local pointer 
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-
-    // build extended pointer on parents dentries root
-    parents_root_xp = XPTR( inode_cxy , &inode_ptr->parents );
-
-    // check VFS root     
-    if( xlist_is_empty( parents_root_xp ) )  // inode is the VFS root
-    {
-        // build extended pointer on root name
-        name_xp = XPTR( local_cxy , "/" );
-    }
-    else
-    {
-        // get first parent dentry cluster and pointers
-        dentry_xp  = XLIST_FIRST( parents_root_xp , vfs_dentry_t , parents );
-        dentry_cxy = GET_CXY( dentry_xp );
-        dentry_ptr = GET_PTR( dentry_xp );
-
-        // get extended pointer on dentry name
-        name_xp = XPTR( dentry_cxy , &dentry_ptr->name );
-    }
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 chdev lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock in busy waiting mode
-    remote_busylock_acquire( lock_xp );
-
-    // print header
-    nolock_printk("\n***** current VFS state\n\n");
-
-    // call recursive function
-    vfs_recursive_display( inode_xp , name_xp , 0 );
-
-    // release lock
-    remote_busylock_release( lock_xp );
-
-}  // end vfs_display()
-
-/*
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function is used by the vfs_lookup() function.
-// It takes an extended pointer on a remote inode (parent directory inode),
-// and check access_rights violation for the calling thread.
-// It can be used by any thread running in any cluster.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ inode_xp    : extended pointer on inode.
-// @ client_uid  : client thread user ID
-// @ client_gid  : client thread group ID
-// @ return true if access rights are violated.
-//////////////////////////////////////////////////////////////////////////////////////////
-static bool_t vfs_access_denied( xptr_t   inode_xp,
-                          uint32_t client_uid,
-                          uint32_t client_gid )
-{
-    // get found inode cluster and local pointer
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-
-    // get inode access mode, UID, and GID
-    // TODO uint32_t  mode = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->mode ) );
-    uid_t     uid  = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->uid  ) );
-    gid_t     gid  = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->gid  ) );
-
-    // TODO : me must use mode
-    if( (uid == client_uid) || (gid == client_gid) ) return false;
-    else                                             return true;
-}
-*/
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function is used by the vfs_lookup() function.
-// It takes an extended pointer on a remote parent directory inode, a directory 
-// entry name, and and scan the XHTAB associated to the parent inode to find the
-// searched dentry. It does NOT modify the inode tree in case of miss.
-// It can be used by any thread running in any cluster.
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ parent_xp   : extended pointer on parent inode in remote cluster.
-// @ name        : dentry name
-// @ child_xp    : [out] buffer for extended pointer on child inode.
-// @ return true if success / return false if not found.
-//////////////////////////////////////////////////////////////////////////////////////////
-static bool_t vfs_get_child( xptr_t   parent_xp,
-                             char   * name,
-                             xptr_t * child_xp )
-{
-    xptr_t         xhtab_xp;    // extended pointer on hash table for children dentries
-    xptr_t         dentry_xp;   // extended pointer on children dentry
-    cxy_t          dentry_cxy;
-    vfs_dentry_t * dentry_ptr;
-
-    // get parent inode cluster and local pointer
-    cxy_t         parent_cxy = GET_CXY( parent_xp );
-    vfs_inode_t * parent_ptr = GET_PTR( parent_xp );
-
-    // get extended pointer on hash table of children directory entries
-    xhtab_xp = XPTR( parent_cxy , &parent_ptr->children );
-
-    // get pointers on matching dentry
-    dentry_xp  = xhtab_lookup( xhtab_xp , name );
-    dentry_cxy = GET_CXY( dentry_xp );
-    dentry_ptr = GET_PTR( dentry_xp );
-
-    if( dentry_xp == XPTR_NULL ) 
-    {
-        return false;
-    }
-    else
-    {
-        *child_xp = (xptr_t)hal_remote_l64( XPTR( dentry_cxy , &dentry_ptr->child_xp ) );
-        return true;
-    }
-
-}  // end vfs_get_child()
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static function is used by the vfs_lookup() function.
-// It takes the <current> pointer on a buffer containing a complete pathname, and return
-// in the <name> buffer, allocated by the caller, a single name in the path.
-// It return also in the <next> pointer the next character to analyse in the path.
-// Finally it returns a <last> boolean, that is true when the returned <name> is the
-// last name in the path. The names are supposed to be separated by one or several '/'
-// characters, that are not written in  the <name> buffer.
-// 
-// WARNING: the leading characters '/' in the path are skiped before analysis.
-//          The path "/" identifies the VFS root, and is therefore anaysed as an empty
-//          string. This empty string is dignaled by the (-1) return value.  
-//////////////////////////////////////////////////////////////////////////////////////////
-// @ current   : pointer on first character to analyse in buffer containing the path.
-// @ name      : [out] pointer on buffer allocated by the caller for the returned name.
-// @ next      : [out] pointer on next character to analyse in buffer containing the path.
-// @ last      : [out] true if the returned name is the last (NUL character found).
-// @ return 0 if success / return -1 if string empty (first chracter is NUL).
-//////////////////////////////////////////////////////////////////////////////////////////
-static error_t vfs_get_name_from_path( char     * current,
-                                       char     * name,
-                                       char    ** next,
-                                       bool_t   * last )
-{
-    char * ptr = current;
-
-    // skip leading '/' characters
-    while( *ptr == '/' ) ptr++;
-
-    // signal empty string
-    if( *ptr == 0 )
-    {
-        *last = true;
-        return -1;
-    }
-
-    // copy all characters in name until NUL or '/'
-    while( (*ptr != 0) && (*ptr !='/') )  *(name++) = *(ptr++);
-
-    // set NUL terminating character in name buffer
-    *(name++) = 0;
-
-    // return last an next
-    if( *ptr == 0 )             // last found character is NUL => last name in path
-    {
-        *last = true;
-    }
-    else                        // last found character is '/' => skip it 
-    {
-        *last = false;
-        *next = ptr + 1;
-    }
-
-    return 0;
-
-}  // end vfs_get name_from_path()
-   
-///////////////////////////////////////////////
-error_t vfs_lookup( xptr_t             root_xp,
-                    char             * pathname,
-                    uint32_t           lookup_mode,
-					xptr_t           * inode_xp,
-					char             * last_name )
-{
-    char               name[CONFIG_VFS_MAX_NAME_LENGTH];   // one name in path 
-
-    xptr_t             parent_xp;    // extended pointer on parent inode
-    cxy_t              parent_cxy;   // cluster for parent inode
-    vfs_inode_t      * parent_ptr;   // local pointer on parent inode  
-    xptr_t             dentry_xp;    // extended pointer on dentry       
-    vfs_dentry_t     * dentry_ptr;   // local pointer on dentry
-    xptr_t             child_xp;     // extended pointer on child inode
-    cxy_t              child_cxy;    // cluster for child inode
-    vfs_inode_t      * child_ptr;    // local pointer on child inode
-    vfs_fs_type_t      fs_type;      // File system type
-    vfs_ctx_t        * ctx_ptr;      // local pointer on FS context
-    char             * current;      // current pointer on path
-    char             * next;         // next value for current pointer   
-    bool_t             last;         // true when the name is the last in path
-    bool_t             found;        // true when a child has been found
-    bool_t             create;       // searched inode must be created if not found
-    bool_t             excl;         // searched inode must not exist
-    bool_t             parent;       // searched inode is the parent
-    thread_t         * this;         // pointer on calling thread descriptor
-    process_t        * process;      // pointer on calling process descriptor
-    error_t            error;
-
-    this    = CURRENT_THREAD;
-    process = this->process;
-
-// check pathname / root_xp consistency
-assert( __FUNCTION__, ((pathname[0] != '/') || (root_xp == process->vfs_root_xp)), 
-"root inode must be VFS root for path <%s>", pathname );
-
-#if DEBUG_VFS_LOOKUP || DEBUG_VFS_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_VFS_LOOKUP
-char     root_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( root_xp , root_name );
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] enter / root <%s> / path <%s> / mode %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, root_name, pathname, lookup_mode, cycle );
-#endif
-
-#if ( DEBUG_VFS_LOOKUP & 1 )
-if( DEBUG_VFS_LOOKUP < cycle )
-vfs_display( root_xp );
-#endif
-
-    // compute lookup flags
-    create = (lookup_mode & VFS_LOOKUP_CREATE) == VFS_LOOKUP_CREATE;
-    excl   = (lookup_mode & VFS_LOOKUP_EXCL)   == VFS_LOOKUP_EXCL;
-    parent = (lookup_mode & VFS_LOOKUP_PARENT) == VFS_LOOKUP_PARENT;
-
-    // initialise loop variables
-    parent_xp = root_xp;
-    current   = pathname;
-    next      = NULL;
-    last      = false;
-    child_xp  = XPTR_NULL;
-    child_cxy = 0;
-    child_ptr = NULL;
-
-    // loop on nodes in pathname
-    // load from device if one node in path not found in Inode Tree
-    // exit loop when last name found (i.e. last == true)
-    while( 1 )
-    {
-        // get parent inode cluster and local pointer
-        parent_cxy = GET_CXY( parent_xp );
-        parent_ptr = GET_PTR( parent_xp );
-
-        // get one "name" from path, and "last" flag
-        error = vfs_get_name_from_path( current , name , &next , &last );
-
-        // handle VFS root case
-        if ( error )
-        {
-
-#if DEBUG_VFS_LOOKUP
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] exit / parent inode(%x,%x) / <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, parent_cxy, parent_ptr, pathname, cycle );
-#endif
-            *inode_xp = process->vfs_root_xp;
-            break;
-        }
-
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] search <%s> in <%s> / last = %d\n",
-__FUNCTION__, process->pid, this->trdid, name, pathname, last );
-#endif
-
-        // search the child dentry matching name in parent inode XHTAB
-        found = vfs_get_child( parent_xp,
-                               name,
-                               &child_xp );
-
-        if( found == false )                          // child not found in Inode Tree 
-        {
-            // when a inode is not found in the Inode Tree:
-            // - if (last and parent) the Inode Tree is not modified
-            // - else we speculatively introduce a new (dentry/inode) in inode tree,
-            //        and scan the parent directory mapper to initialise it.
-            //     . if it is not found in the parent mapper:
-            //         - if(last and create), a brand new file or directory is created
-            //         - else, an error is reported
-            //     . if it is found in parent mapper:
-            //         - if( last and excl ), an error is reported
-            //         - else the new child (inode & dentry) is initialised in Inode Tree
-            //         - if the child is a directory, the child mapper is loaded from device
-
-            if( last && parent )   //  does nothing
-            {
-
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] child not found but only parent requested in <%s>\n",
-__FUNCTION__, process->pid, this->trdid, pathname );
-#endif
-            }
-            else                                    // try to get it from parent mapper
-            {
-
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] miss <%s> inode in Inode Tree => build from parent mapper\n",
-__FUNCTION__, process->pid, this->trdid, name );
-#endif
-                // get parent inode FS type
-                ctx_ptr    = hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->ctx ) );
-                fs_type    = hal_remote_l32( XPTR( parent_cxy , &ctx_ptr->type ) );
-
-                // select a cluster for new inode
-                child_cxy = cluster_random_select();
-
-                // insert a new child dentry/inode couple in inode tree
-                error = vfs_add_child_in_parent( child_cxy,
-                                                 fs_type, 
-                                                 parent_xp, 
-                                                 name, 
-                                                 &dentry_xp,
-                                                 &child_xp );
-                if( error )
-                {
-
-#if DEBUG_VFS_ERROR  
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create inode <%s> in path <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, name, pathname, cycle );
-#endif
-                    return -1;
-                }
-
-                // get child inode and dentry local pointers
-                child_ptr  = GET_PTR( child_xp );
-                dentry_ptr = GET_PTR( dentry_xp );
-
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] created dentry/inode <%s> in cluster %x\n",
-__FUNCTION__, process->pid, this->trdid, name, child_cxy );
-#endif
-                // scan parent mapper to find the missing dentry, and complete 
-                // the initialisation of dentry and child inode descriptors
-                error = vfs_fs_new_dentry_from_mapper( parent_xp,
-                                                       dentry_ptr );
-
-                if ( error )  // an error can be fatal or non-fatal :
-                {
-                    if ( last && create )  // add a brand new dentry in parent directory
-                    {
-                        error = vfs_fs_new_dentry_to_mapper( parent_xp,                
-                                                             dentry_ptr );
-                        if ( error )
-                        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot add dentry <%s> in parent dir / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, name, cycle );
-#endif
-                            vfs_remove_child_from_parent( dentry_xp );
-                            return -1;
-                        }
-
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] child <%s> not found in parent mapper => created it\n",
-__FUNCTION__, process->pid, this->trdid, name );
-#endif
-                    }
-                    else                   // not last or not create => error
-                    {                       
-
-#if DEBUG_VFS_ERROR      
-printk("\n[ERROR] in %s : thread[%x,%x] cannot found node <%s> in parent for <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, name, pathname, cycle );
-#endif
-                        vfs_remove_child_from_parent( dentry_xp );
-                        return -1;
-                    }
-                }
-                else          // child has been found in parent mapper
-                {
-                    // check the excl
-                    if( last && create && excl )
-                    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] found an existing node <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, pathname, cycle );
-#endif
-                       return -1;
-                    }
-
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] initialised inode <%s> from parent mapper\n",
-__FUNCTION__, process->pid, this->trdid, name );
-#endif
-                    // load child mapper from device if child is a directory (prefetch)
-                    uint32_t type = hal_remote_l32( XPTR( child_cxy , &child_ptr->type ) );
-                    if( type == FILE_TYPE_DIR ) 
-                    {
-                        error = vfs_inode_load_all_pages( child_xp );
-
-                        if ( error )
-                        {
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot load <%s> from device / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, name, cycle );
-#endif
-                            vfs_remove_child_from_parent( dentry_xp );
-                            return -1;
-                        }
-
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] loaded directory mapper for <%s> from IOC\n",
-__FUNCTION__ , process->pid, this->trdid, name );
-#endif
-                    }
-                }
-            }
-        }
-        else                                    // child found in Inode Tree
-        {
-            // get child inode local pointer and cluster
-            child_ptr  = GET_PTR( child_xp );
-            child_cxy  = GET_CXY( child_xp );
-        
-#if (DEBUG_VFS_LOOKUP & 1)
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] found <%s> in Inode Tree / inode (%x,%x)\n",
-__FUNCTION__, process->pid, this->trdid, name, child_cxy, child_ptr );
-#endif
-            // check the excl flag
-            if( last && create && excl )
-            {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] found an existing node <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, pathname, cycle );
-#endif
-                return -1;
-            }
-        }
-
-        // TODO check access rights here [AG]
-        // error = vfs_access_denied( child_xp,
-        //                            client_uid,
-        //                            client_gid );
-        // if( error ) 
-        // {
-        //     #if DEBUG_VFS_ERROR
-        //     if( DEBUG_VFS_ERROR < cycle )
-        //     printk("\n[ERROR] in %s : thread[%x,%x] / permission denied for <%s>\n",
-        //     __FUNCTION__ , process->pid, this->trdid , pathname );
-        //     #endif
-        //
-        //     return -1;
-        // }
-
-        // exit when last
-        if ( last )           // last inode in path  => return relevant info
-        {
-            if ( parent )  // return parent inode and child name
-            {
-
-#if DEBUG_VFS_LOOKUP
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] exit / parent inode(%x,%x) / <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, parent_cxy, parent_ptr, pathname, cycle );
-#endif
-                *inode_xp = parent_xp;
-                strcpy( last_name , name );
-                break; 
-            }
-            else        // return child inode name     
-            {
-
-#if DEBUG_VFS_LOOKUP
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_LOOKUP < cycle )
-printk("\n[%s] thread[%x,%x] exit / child inode (%x,%x) / <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, child_cxy, child_ptr, pathname, cycle );
-#endif
-                *inode_xp = child_xp;
-                break;
-            }
-        }
-        else                     // not the last node in path => update loop variables
-        {
-            parent_xp = child_xp;
-            current   = next;
-        }
-    }  // end while loop on nodes in pathname
-
-#if ( DEBUG_VFS_LOOKUP & 1 )
-if( DEBUG_VFS_LOOKUP < cycle )
-vfs_display( root_xp );
-#endif
-
-    return 0;
-
-}  // end vfs_lookup()
-
-///////////////////////////////////////////////////
-error_t vfs_add_special_dentries( xptr_t  child_xp,
-                                  xptr_t  parent_xp )
-{
-    error_t         error;
-    vfs_inode_t   * child_ptr;         // local pointer on child inode directory
-    cxy_t           child_cxy;         // child inode directory cluster identifier
-    vfs_ctx_t     * ctx_ptr;           // local pointer on child inode FS context
-    vfs_fs_type_t   fs_type;           // FS type of child inode
-    xptr_t          dentry_xp;         // extended pointer on dentry (used for . and ..)
-    vfs_dentry_t  * dentry_ptr;        // local pointer on dentry (used for . and ..) 
-    xptr_t          children_xhtab_xp; // extended pointer on inode "children" field
-    xptr_t          children_entry_xp; // extended pointer on dentry "children" field
-
-#if DEBUG_VFS_ADD_SPECIAL || DEBUG_VFS_ERROR
-uint32_t    cycle   = (uint32_t)hal_get_cycles();
-thread_t  * this    = CURRENT_THREAD;
-process_t * process = this->process;
-#endif
-
-#if DEBUG_VFS_ADD_SPECIAL
-char child_name[CONFIG_VFS_MAX_NAME_LENGTH];
-char parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( child_xp  , child_name );
-vfs_inode_get_name( parent_xp , parent_name );
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] enter for child <%s> in parent <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, child_name, parent_name, cycle );
-#endif
-
-    // get child directory cluster and local pointer
-    child_cxy  = GET_CXY( child_xp );
-    child_ptr  = GET_PTR( child_xp );
-
-    // get child inode FS type
-    ctx_ptr    = hal_remote_lpt( XPTR( child_cxy , &child_ptr->ctx ) );
-    fs_type    = hal_remote_l32( XPTR( child_cxy , &ctx_ptr->type ) );
-
-    //////////////////////////// create <.> dentry //////////////////////
-    error = vfs_dentry_create( child_cxy,
-                               fs_type,
-                               ".",
-                               &dentry_xp );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create dentry <.> in cluster %x / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, child_cxy, cycle );
-#endif
-        return -1;
-    }
-
-    // get <.> dentry local pointer
-    dentry_ptr = GET_PTR( dentry_xp );
-
-#if(DEBUG_VFS_ADD_SPECIAL & 1)
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] created dentry <.> (%x,%x) / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, child_cxy, dentry_ptr, cycle );
-#endif
-
-    // register <.> dentry in child inode xhtab of children
-    children_xhtab_xp = XPTR( child_cxy , &child_ptr->children );
-    children_entry_xp = XPTR( child_cxy , &dentry_ptr->children );
-
-    error = xhtab_insert( children_xhtab_xp , "." , children_entry_xp );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register dentry <.> in xhtab / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-    
-    // update "parent" and "child_xp" fields in <.> dentry
-    hal_remote_s64( XPTR( child_cxy , &dentry_ptr->child_xp ) , child_xp );
-    hal_remote_spt( XPTR( child_cxy , &dentry_ptr->parent ) , child_ptr );
-
-#if(DEBUG_VFS_ADD_SPECIAL & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] linked dentry <.> to parent and child inodes / cycle %d\n", 
-__FUNCTION__, process->pid, this->trdid, cycle ); 
-#endif
-
-    // introduce <.> dentry into child directory mapper
-    // only if the target directory is not the root VFS
-    if( child_xp != parent_xp )
-    {
-        error = vfs_fs_add_dentry( child_xp,
-                                   dentry_ptr );
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register dentry <.> in mapper / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-
-#if(DEBUG_VFS_ADD_SPECIAL & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] registered dentry <.> in child mapper / cycle %d\n", 
-__FUNCTION__, process->pid, this->trdid, cycle ); 
-#endif
-
-    }
-
-    ///////////////////////////// create <..> dentry ///////////////////////
-    error = vfs_dentry_create( child_cxy,
-                               fs_type,
-                               "..",
-                               &dentry_xp );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create dentry <..> in cluster %x / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, child_cxy, cycle );
-#endif
-        return -1;
-    }
-
-    // get <..> dentry local pointer
-    dentry_ptr = GET_PTR( dentry_xp );
-
-#if(DEBUG_VFS_ADD_SPECIAL & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] created dentry <..> (%x,%x) / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, child_cxy, dentry_ptr, cycle );
-#endif
-
-    // register <..> dentry in child_inode xhtab of children
-    children_xhtab_xp = XPTR( child_cxy , &child_ptr->children );
-    children_entry_xp = XPTR( child_cxy , &dentry_ptr->children );
-
-    error = xhtab_insert( children_xhtab_xp , ".." , children_entry_xp );
-
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register dentry <..> in xhtab / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // don't register <..> dentry in parent_inode xlist of parents 
-
-    // update "parent" and "child_xp" fields in <..> dentry
-    hal_remote_s64( XPTR( child_cxy , &dentry_ptr->child_xp ) , parent_xp );
-    hal_remote_spt( XPTR( child_cxy , &dentry_ptr->parent ) , child_ptr );
-
-#if(DEBUG_VFS_ADD_SPECIAL & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] linked dentry <..> to parent and child inodes / cycle %d\n", 
-__FUNCTION__, process->pid, this->trdid, cycle ); 
-#endif
-
-    // introduce <..> dentry into child directory mapper
-    // only if the target directory is not the root VFS
-    if( child_xp != parent_xp )
-    {
-        error = vfs_fs_add_dentry( child_xp,
-                                   dentry_ptr );
-        if( error )
-        {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register dentry <..> in mapper / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-
-#if(DEBUG_VFS_ADD_SPECIAL & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] registered dentry <..> in child mapper / cycle %d\n", 
-__FUNCTION__, process->pid, this->trdid, cycle ); 
-#endif
-
-    }
-
-#if DEBUG_VFS_ADD_SPECIAL
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_ADD_SPECIAL < cycle )
-printk("\n[%s] thread[%x,%x] exit for child <%s> in parent <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, child_name, parent_name, cycle );
-#endif
-
-    return 0;
-
-}  // end vfs_add_special_dentries()
-
-//////////////////////////////////////////
-error_t vfs_get_path( xptr_t     inode_xp,
-                      char     * buffer,
-                      char    ** first,
-                      uint32_t   max_size )
-{
-	xptr_t         dentry_xp;        // extended pointer on current dentry
-    vfs_dentry_t * dentry_ptr;       // local pointer on current dentry
-    cxy_t          dentry_cxy;       // current dentry cluster identifier
-    xptr_t         name_xp;          // extended pointer on current dentry name
-	uint32_t       length;           // length of current dentry name
-	int32_t        index;            // slot index in buffer
-    xptr_t         current_xp;       // extended pointer on current inode
-    vfs_inode_t  * current_ptr;      // local pointer on current inode
-    cxy_t          current_cxy;      // current inode cluster identifier
-    xptr_t         vfs_root_xp;      // extended pointer on VFS root inode
-    vfs_inode_t  * vfs_root_ptr;     // local pointer on VFS root inode
-    cxy_t          vfs_root_cxy;     // VFS root inode cluster identifier
-    xptr_t         lock_xp;          // extended pointer on Inode Tree lock 
-    xptr_t         parents_root_xp;  // extended pointer on current inode parents root
-    bool_t         found;            // condition to exit the while loop
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_VFS_GET_PATH
-uint32_t    cycle   = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_VFS_GET_PATH
-if( DEBUG_VFS_GET_PATH < cycle )
-printk("\n[%s] thread[%x,%x] enter : inode (%x,%x) / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid,
-GET_CXY( inode_xp ), GET_PTR( inode_xp ), cycle );
-#endif
-
-	// set the NUL character in buffer / initialise buffer index
-	buffer[max_size - 1] = 0;
-    index    = (int32_t)(max_size - 1);
-
-    // initialize current inode
-    current_xp  = inode_xp;
-
-    // build extended pointer on lock protecting Inode Tree
-    vfs_root_xp  = process->vfs_root_xp;
-    vfs_root_ptr = GET_PTR( vfs_root_xp );
-    vfs_root_cxy = GET_CXY( vfs_root_xp );
-    lock_xp      = XPTR( vfs_root_cxy , &vfs_root_ptr->main_lock );
-
-    // take lock protecting Inode Tree in read mode
-    remote_rwlock_rd_acquire( lock_xp );
-
-    // traverse Inode Tree from target inode to VFS root
-    // selecting always the first parent dentry
-    // the buffer is written in "reverse order" (from target inode to root) 
-    // exit the while loop when the VFS root has been found
-	do
-    {
-        // get current inode cluster and local pointer
-        current_cxy = GET_CXY( current_xp );
-        current_ptr = GET_PTR( current_xp );
-
-        // build extended pointer on parents dentries root
-        parents_root_xp = XPTR( current_cxy , &current_ptr->parents );
-
-        // compute exit condition <=> current inode is VFS root    
-        found = xlist_is_empty( parents_root_xp );
-
-        if( found )                              // parent is the VFS root
-        {
-            if( index == (int32_t)(max_size - 1) )
-            {
-                // update index
-                index--;
-                 
-                // set separator  
-		        buffer[index] = '/';
-
-// check buffer overflow
-assert( __FUNCTION__, (index >= 0) , "kernel buffer too small" );
-
-            }
-        }
-        else                                     // not the VFS root
-        {
-            // get first parent dentry cluster and pointers
-            dentry_xp  = XLIST_FIRST( parents_root_xp , vfs_dentry_t , parents );
-            dentry_cxy = GET_CXY( dentry_xp );
-            dentry_ptr = GET_PTR( dentry_xp );
-
-            // get extended pointer on dentry name and name length
-            name_xp = XPTR( dentry_cxy , dentry_ptr->name );
-            length  = hal_remote_l32( XPTR( dentry_cxy , &dentry_ptr->length ) );
-
-#if (DEBUG_VFS_GET_PATH & 1)
-char debug_name[CONFIG_VFS_MAX_NAME_LENGTH];
-hal_remote_strcpy( XPTR( local_cxy , debug_name ) , name_xp );
-if( DEBUG_VFS_GET_PATH < cycle )
-printk("\n[%s] thread(%x,%s) get current dentry <%s> in cluster %x\n",
-__FUNCTION__ , process->pid, this->trdid, debug_name, current_cxy );
-#endif
-            // update index 
-            index -= (length + 1); 
-
-// check buffer overflow
-assert( __FUNCTION__, (index >= 0) , "kernel buffer too small" );
-
-            // update pathname
-            hal_remote_memcpy( XPTR( local_cxy , &buffer[index + 1] ) ,
-                               name_xp , length );
-
-            // set separator  
-		    buffer[index] = '/';
-
-            // get extended pointer on parent inode
-            current_xp = XPTR( dentry_cxy , 
-                               hal_remote_lpt( XPTR( dentry_cxy , &dentry_ptr->parent ) ) );
-        }
-    }
-    while( found == false );
-
-    // release lock protecting Inode Tree in read mode
-    remote_rwlock_rd_release( lock_xp );
-
-#if DEBUG_VFS_GET_PATH
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_GET_PATH < cycle )
-printk("\n[%s] thread[%x,%x] exit : path <%s> / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, &buffer[index], cycle );
-#endif
-
-    // return pointer on first character in buffer
-    *first = &buffer[index];
-	return 0;
-
-}  // end vfs_get_path()
-
-      
-//////////////////////////////////////////////////////////////
-error_t vfs_add_child_in_parent( cxy_t              child_cxy,
-                                 vfs_fs_type_t      fs_type,
-                                 xptr_t             parent_inode_xp,
-                                 char             * name,
-                                 xptr_t           * child_dentry_xp,
-                                 xptr_t           * child_inode_xp )
-{
-    error_t        error;
-    cxy_t          parent_cxy;          // parent inode cluster identifier
-    vfs_inode_t  * parent_inode_ptr;    // parent inode local pointer
-    xptr_t         new_dentry_xp;       // extended pointer on created dentry
-    vfs_dentry_t * new_dentry_ptr;      // created dentry local pointer
-    xptr_t         new_inode_xp;        // extended pointer on created child inode
-    vfs_inode_t  * new_inode_ptr;       // local pointer on created child inode
-
-    xptr_t         parents_root_xp;     // extended pointer on child inode  "parents" field
-    xptr_t         parents_entry_xp;    // extended pointer on child dentry "parents" field
-    xptr_t         children_xhtab_xp;   // extended pointer on parent inode "children" field
-    xptr_t         children_entry_xp;   // extended pointer on child dentry "children" field
-    
-    // get parent inode cluster and pointer
-    parent_cxy       = GET_CXY( parent_inode_xp );
-    parent_inode_ptr = GET_PTR( parent_inode_xp );
-
-#if DEBUG_VFS_ADD_CHILD || DEBUG_VFS_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD; 
-#endif
-
-#if DEBUG_VFS_ADD_CHILD
-char parent_name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( parent_inode_xp , parent_name );
-if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] enter / child <%s> / parent <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name,
-parent_name, (uint32_t)hal_get_cycles() );
-#endif
-
-    // 1. create dentry in parent cluster
-    error = vfs_dentry_create( parent_cxy,
-                               fs_type,
-                               name,
-                               &new_dentry_xp );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create dentry <%s> in cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid , name , parent_cxy, cycle );
-#endif
-        return -1;
-    }
-
-    // get dentry local pointer
-    new_dentry_ptr = GET_PTR( new_dentry_xp );
-
-#if(DEBUG_VFS_ADD_CHILD & 1)
-if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] created dentry <%s> : (%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, name, parent_cxy, new_dentry_ptr );
-#endif
-
-    // 2. create child inode in child cluster
-    // TODO : define attr / mode / uid / gid
-    uint32_t attr = 0;
-    uint32_t mode = 0;
-    uint32_t uid  = 0;
-    uint32_t gid  = 0;
-    
-    error = vfs_inode_create( child_cxy,
-                              fs_type,
-                              attr,
-                              mode,
-                              uid,
-                              gid,
-                              &new_inode_xp );
-    if( error )
-    {
-
-#if DEBUG_VFS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create inode in cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , child_cxy, cycle );
-#endif
- 
-        vfs_dentry_destroy( new_dentry_xp );
-        return -1;
-    }
-
-    // get new inode local pointer
-    new_inode_ptr = GET_PTR( new_inode_xp );
-    
-#if(DEBUG_VFS_ADD_CHILD & 1)
-if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] created inode <%s> : (%x,%x)\n",
-__FUNCTION__ , this->process->pid, this->trdid, name , child_cxy, new_inode_ptr );
-#endif
-
-    // 3. register new_dentry in new_inode xlist of parents 
-    parents_root_xp  = XPTR( child_cxy , &new_inode_ptr->parents );
-    parents_entry_xp = XPTR( parent_cxy, &new_dentry_ptr->parents );
-    xlist_add_first( parents_root_xp , parents_entry_xp );
-    hal_remote_atomic_add( XPTR( child_cxy , &new_inode_ptr->links ) , 1 );
-
-#if(DEBUG_VFS_ADD_CHILD & 1)
-if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] linked dentry(%x,%x) to child inode(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-parent_cxy, new_dentry_ptr, child_cxy, new_inode_ptr );
-#endif
-
-    // 4. register new_dentry in parent_inode xhtab of children
-    children_xhtab_xp = XPTR( parent_cxy , &parent_inode_ptr->children );
-    children_entry_xp = XPTR( parent_cxy , &new_dentry_ptr->children );
-    xhtab_insert( children_xhtab_xp , name , children_entry_xp );
-
-#if(DEBUG_VFS_ADD_CHILD & 1)
-if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] linked dentry(%x,%x) to parent inode(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-parent_cxy, new_dentry_ptr, parent_cxy, parent_inode_ptr );
-#endif
-
-    // 5. update "parent" and "child_xp" fields in new_dentry
-    hal_remote_s64( XPTR( parent_cxy , &new_dentry_ptr->child_xp ) , new_inode_xp );
-    hal_remote_spt( XPTR( parent_cxy , &new_dentry_ptr->parent ) , parent_inode_ptr );
-
-#if DEBUG_VFS_ADD_CHILD
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_ADD_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, cycle );
-#endif
-
-    // return extended pointer on dentry & child inode
-    *child_dentry_xp = new_dentry_xp;
-    *child_inode_xp  = new_inode_xp;
-    return 0;
-
-}  // end vfs_add_child_in_parent()
-
-/////////////////////////////////////////////////////
-void vfs_remove_child_from_parent( xptr_t dentry_xp )
-{
-    cxy_t          parent_cxy;         // parent inode cluster identifier
-    cxy_t          child_cxy;          // child inode cluster identifier
-    vfs_dentry_t * dentry_ptr;         // local pointer on dentry
-    xptr_t         child_inode_xp;     // extended pointer on child inode
-    vfs_inode_t  * child_inode_ptr;    // local pointer on child inode
-    vfs_inode_t  * parent_inode_ptr;   // local pointer on parent inode
-    uint32_t       links;              // number of child inode parents
-    error_t        error;
-
-#if DEBUG_VFS_REMOVE_CHILD 
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    char dentry_name[CONFIG_VFS_MAX_NAME_LENGTH];
-   
-    thread_t * this  = CURRENT_THREAD;
-
-    // get parent cluster and dentry local pointer
-    parent_cxy = GET_CXY( dentry_xp );
-    dentry_ptr = GET_PTR( dentry_xp );
-
-    // get a local copy of dentry name
-    hal_remote_strcpy( XPTR( local_cxy  , dentry_name ),
-                       XPTR( parent_cxy , &dentry_ptr->name ) );
-
-    // get parent_inode local pointer
-    parent_inode_ptr = hal_remote_lpt( XPTR( parent_cxy , &dentry_ptr->parent ) );
-  
-    // get child cluster and child_inode pointers 
-    child_inode_xp   = hal_remote_l64( XPTR( parent_cxy , &dentry_ptr->child_xp ) );
-    child_cxy        = GET_CXY( child_inode_xp ); 
-    child_inode_ptr  = GET_PTR( child_inode_xp );
-
-#if DEBUG_VFS_REMOVE_CHILD
-printk("\n[%s] thread[%x,%x] enter for dentry[%x,%x] / inode[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-parent_cxy, dentry_ptr, child_cxy, child_inode_ptr, cycle );
-#endif
-
-    // remove dentry from parent_inode
-    error = xhtab_remove( XPTR( parent_cxy , &parent_inode_ptr->children ),
-                          dentry_name,
-                          XPTR( parent_cxy , &dentry_ptr->children ) );
-
-    if( error )
-    { 
-        printk("\n[WARNING] in %s : thread[%x,%x] cannot remove dentry <%s> from parent\n",
-        __FUNCTION__ , this->process->pid , this->trdid , dentry_name );
-    }
-
-#if(DEBUG_VFS_REMOVE_CHILD & 1)
-if( DEBUG_VFS_REMOVE_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] removed dentry from parent inode\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // remove dentry from child_inode
-    xlist_unlink( XPTR( parent_cxy , &dentry_ptr->parents ) );
-
-    // get and update number of parents dentries
-    links = hal_remote_atomic_add( XPTR( child_cxy , &child_inode_ptr->links ) , -1 );
-
-#if(DEBUG_VFS_REMOVE_CHILD & 1)
-if( DEBUG_VFS_REMOVE_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] removed dentry from child inode\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // delete dentry descriptor
-    vfs_dentry_destroy( dentry_xp );
-
-#if DEBUG_VFS_REMOVE_CHILD
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_REMOVE_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] deleted dentry descriptor / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-    // delete child_inode descriptor if last link
-    if( links == 1 )
-    {
-        vfs_inode_destroy( child_inode_xp );
-
-#if DEBUG_VFS_REMOVE_CHILD
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VFS_REMOVE_CHILD < cycle )
-printk("\n[%s] thread[%x,%x] deleted child inode descriptor / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-    }
-}  // end vfs_remove_child_from_parent()
-
-
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//    API used by VFS to access a specific FS  
-//////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////
-error_t vfs_fs_add_dentry( xptr_t         inode_xp,
-                           vfs_dentry_t * dentry_ptr )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (inode_xp   != XPTR_NULL) , "inode_xp argument is NULL" );
-assert( __FUNCTION__, (dentry_ptr != NULL     ) , "dentry_ptr argument is NULL" );
-
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get inode mapper
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL");        
-
-    // get FS type
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( inode_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_add_dentry( inode_xp , dentry_ptr ); 
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        error = 0;     // does nothing for RAMFS
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        error = 0;     // does nothing for DEVFS
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-}  // end vfs_fs_add_dentry()
-
-//////////////////////////////////////////////////////
-error_t vfs_fs_remove_dentry( xptr_t         inode_xp,
-                              vfs_dentry_t * dentry_ptr )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (inode_xp   != XPTR_NULL) , "inode_xp argument is NULL" );
-assert( __FUNCTION__, (dentry_ptr != NULL     ) , "dentry_ptr argument is NULL" );
-
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get inode mapper
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL");        
-
-    // get FS type
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( inode_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_remove_dentry( inode_xp , dentry_ptr ); 
-
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        error = 0;     // does nothing for RAMFS
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        error = 0;     // does nothing for DEVFS
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-}  // end vfs_fs_remove_dentry()
-
-///////////////////////////////////////////////////////////////
-error_t vfs_fs_new_dentry_from_mapper( xptr_t         inode_xp,
-                                       vfs_dentry_t * dentry_ptr )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (inode_xp   != XPTR_NULL) , "inode_xp argument is NULL" );
-assert( __FUNCTION__, (dentry_ptr != NULL     ) , "dentry_ptr argument is NULL" );
-
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get inode mapper
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL");
-
-    // get FS type
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( inode_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_new_dentry_from_mapper( inode_xp , dentry_ptr );
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for DEVFS" );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-} // end vfs_fs_new_dentry_from_mapper()
-
-///////////////////////////////////////////////////////////////
-error_t vfs_fs_new_dentry_to_mapper( xptr_t         inode_xp,
-                                     vfs_dentry_t * dentry_ptr )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (inode_xp   != XPTR_NULL) , "inode_xp argument is NULL" );
-assert( __FUNCTION__, (dentry_ptr != NULL     ) , "dentry_ptr argument is NULL" );
-
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get inode mapper
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL");
-
-    // get FS type
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( inode_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_new_dentry_to_mapper( inode_xp , dentry_ptr );
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for DEVFS" );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-} // end vfs_fs_new_dentry_to_mapper()
-
-//////////////////////////////////////////////////////
-error_t vfs_fs_update_dentry( xptr_t         inode_xp,
-                              vfs_dentry_t * dentry_ptr )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (inode_xp   != XPTR_NULL) , "inode_xp argument is NULL" );
-assert( __FUNCTION__, (dentry_ptr != NULL     ) , "dentry_ptr argument is NULL" );
-
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get inode mapper
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL");
-
-    // get FS type
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( inode_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_update_dentry( inode_xp , dentry_ptr );
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for DEVFS" );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-} // end vfs_fs_update_dentry()
-
-///////////////////////////////////////////////////
-error_t vfs_fs_get_user_dir( vfs_inode_t   * inode,
-                             struct dirent * array,
-                             uint32_t        max_dirent,
-                             uint32_t        min_dentry,
-                             bool_t          detailed,
-                             uint32_t      * entries,
-                             bool_t        * done )
-{
-    error_t error = 0;
-
-// check arguments
-assert( __FUNCTION__, (inode != NULL) , "parent pointer is NULL");
-assert( __FUNCTION__, (array != NULL) , "child pointer is NULL");
-assert( __FUNCTION__, (detailed == false) , "detailed argument not supported\n");
-assert( __FUNCTION__, (inode->type == FILE_TYPE_DIR), "inode is not a directory\n");
-
-    // get parent inode FS type
-    vfs_fs_type_t fs_type = inode->ctx->type;
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_get_user_dir( inode, 
-                                    array,
-                                    max_dirent,
-                                    min_dentry,
-                                    detailed,
-                                    entries,
-                                    done );
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        error = devfs_get_user_dir( inode,
-                                    array,
-                                    max_dirent,
-                                    min_dentry,
-                                    detailed,
-                                    entries,
-                                    done );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-}  // end vfs_fs_get_user_dir()
- 
-/////////////////////////////////////////////
-error_t vfs_fs_sync_inode( xptr_t  inode_xp )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (inode_xp != XPTR_NULL) , "inode_xp argument is NULL");
-
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get inode mapper
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL");
-
-    // get FS type
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( inode_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_sync_inode( inode_xp );
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for DEVFS" );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-}  // end vfs_fs_sync_inode()
-
-////////////////////////////////////////////////
-error_t vfs_fs_sync_fat( vfs_fs_type_t fs_type )
-{
-    error_t error = 0;
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_sync_fat();
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for DEVFS" );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-}  // end vfs_fs_sync_fat()
-
-////////////////////////////////////////////////
-error_t vfs_fs_release_inode( xptr_t  inode_xp )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (inode_xp  != XPTR_NULL) , "inode_xp argument is NULL");
-
-    vfs_inode_t * inode_ptr = GET_PTR( inode_xp );
-    cxy_t         inode_cxy = GET_CXY( inode_xp );
-
-    // get local pointer on mapper 
-    mapper_t * mapper = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "mapper pointer is NULL");
-
-    // get FS type from mapper
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( inode_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_release_inode( inode_xp ); 
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for DEVFS" );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-    
-}  // end vfs_fs_release_inode()
-
-//////////////////////////////////////////////////
-error_t vfs_fs_move_page( xptr_t          page_xp,
-                          ioc_cmd_type_t  cmd_type )
-{
-    error_t error = 0;
-
-assert( __FUNCTION__, (page_xp != XPTR_NULL) , "page pointer is NULL" );
-
-    page_t * page_ptr = GET_PTR( page_xp );
-    cxy_t    page_cxy = GET_CXY( page_xp );
-
-    // get local pointer on  mapper
-    mapper_t * mapper = hal_remote_lpt( XPTR( page_cxy , &page_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper != NULL) , "no mapper for page" );
-
-    // get FS type
-    vfs_fs_type_t fs_type = hal_remote_l32( XPTR( page_cxy , &mapper->fs_type ) );
-
-    // call relevant FS function
-    if( fs_type == FS_TYPE_FATFS )
-    {
-        error = fatfs_move_page( page_xp , cmd_type ); 
-    }
-    else if( fs_type == FS_TYPE_RAMFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for RAMFS\n" );
-    }
-    else if( fs_type == FS_TYPE_DEVFS )
-    {
-        assert( __FUNCTION__, false , "should not be called for DEVFS\n" );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined file system type" );
-    }
-
-    return error;
-
-}  // end vfs_fs_move_page()
-
-
Index: trunk/kernel/fs/vfs.h
===================================================================
--- trunk/kernel/fs/vfs.h	(revision 690)
+++ 	(revision )
@@ -1,1076 +1,0 @@
-/*
- * vfs.h - Virtual File System definition.
- *
- * Author  Mohamed Lamine Karaoui (2014,2015)
- *         Alain Greiner          (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _VFS_H_
-#define _VFS_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_atomic.h>
-#include <remote_rwlock.h>
-#include <remote_busylock.h>
-#include <busylock.h>
-#include <list.h>
-#include <xlist.h>
-#include <bits.h>
-#include <xhtab.h>
-#include <errno.h>
-#include <shared_syscalls.h>
-#include <fatfs.h>
-#include <ramfs.h>
-#include <devfs.h>
-#include <dev_ioc.h>
-
-/****  Forward declarations  ***/
-
-struct vfs_inode_s;
-struct vfs_dentry_s;
-struct vfs_ctx_s;
-struct vfs_file_s;
-struct remote_buf_s;
-struct mapper_s;
-struct process_s;
-struct device_s;
-struct vseg_s;
-struct page_s;
-struct ksock_s;
-
-/******************************************************************************************
- * These flags are used to define the working mode of the vfs_lookup() function.  
- *****************************************************************************************/
-
-#define VFS_LOOKUP_DIR 	    0x01     /* the searched inode must be a directory           */
-#define VFS_LOOKUP_OPEN		0x02     /* the search is for an open/opendir                */
-#define VFS_LOOKUP_PARENT	0x04     /* return the parent inode (not the inode itself)   */
-#define VFS_LOOKUP_CREATE   0x10     /* file must be created if missing                  */
-#define VFS_LOOKUP_EXCL     0x20     /* file cannot previously exist                     */
-
-
-
-
-/******************************************************************************************
- * This structure defines a VFS context, that contains informations common to all inodes
- * and dentries for a given file system. As it is declared as a global variable in the
- * kdata segment (fs_context[] array), it is replicated in all clusters.
- * The <extend> field is a pointer on the FS specific context extension. 
- * This extension is dynamically allocated by kernel_init in all clusters.
- * In each cluster, the inum allocator can be accessed by any thread runing
- * in any cluster, and is therefore protected by a remote_busylock. 
- *****************************************************************************************/
-
-typedef enum
-{
-	FS_TYPE_RAMFS = 0,
-	FS_TYPE_DEVFS = 1,
-	FS_TYPE_FATFS = 2,
- 
-	FS_TYPES_NR   = 3,
-}
-vfs_fs_type_t;
-
-typedef enum
-{
-    CTX_ATTR_READ_ONLY    = 0x01,            /*! write access prohibited                 */
-    CTX_ATTR_SYNC         = 0x10,            /*! synchronise FS on each write            */
-}
-vfs_ctx_attr_t;
-
-typedef struct vfs_ctx_s
-{
-	vfs_fs_type_t      type;                 /*! File System type                        */
-	uint32_t           total_clusters;       /*! total number of clusters on device      */
-	uint32_t           cluster_size;         /*! cluster size on device (bytes)          */
-	xptr_t             vfs_root_xp;          /*! extended pointer on VFS root inode      */
-    remote_busylock_t  lock;                 /*! lock protecting inum allocator          */
-    uint32_t           bitmap[BITMAP_SIZE(CONFIG_VFS_MAX_INODES)];  /* inum allocator    */
-    void               * extend;             /*! FS specific context extension           */
-}
-vfs_ctx_t;
-
-/******************************************************************************************
- *        These functions access / modify  a VFS context.
- *****************************************************************************************/
-
-/****************************************************************************************** 
- * This function initialises a (statically allocated) VFS context in cluster identified
- * by the <cxy> argument. 
- * It is called by the kernel_init() function.
- ******************************************************************************************
- * @ cxy            : target cluster identifier.
- * @ fs_type        : file system type.
- * @ total_clusters : total number of clusters on device.
- * @ cluster_size   : cluster size on device (bytes).
- * @ vfs_root_xp    : extended pointer on VFS root inode.
- * @ extend         : fs_type_specific extension.
- *****************************************************************************************/
-void vfs_ctx_init( cxy_t           cxy,
-                   vfs_fs_type_t   type,
-	               uint32_t        total_clusters,
-	               uint32_t        cluster_size,
-	               xptr_t          vfs_root_xp,
-                   void          * extend );
-
-/****************************************************************************************** 
- * This function allocates an inode identifier from the local cluster inum allocator.
- * The inum respects a fixed format:
- * - the 16 MSB bits contain the cluster identifier : cxy
- * - the 16 LSB bits contains the local inode identifier  : lid
- ******************************************************************************************
- * @ ctx_xp   : [in]  extended pointer on file system context.
- * @ inum     : [out] buffer for allocated inode identifier.
- * @ return 0 if success / return non-zero if error.
- *****************************************************************************************/
-error_t vfs_ctx_inum_alloc( xptr_t     ctx_xp,
-                            uint32_t * inum );
-
-/****************************************************************************************** 
- * This function release an inode identifier.                                  
- ******************************************************************************************
- * @ ctx_xp   : [in] extended pointer on file system context.
- * @ inum     : [in] released inode identifier.
- *****************************************************************************************/
-void vfs_ctx_inum_release( xptr_t      ctx_xp,
-                           uint32_t    inum );
-
-
-
-
-
-
-/******************************************************************************************
- * This file structure describes an open file/directory for a given process.
- * It is not replicated, and is dynamically allocated in the cluster that contains
- * the associated inode / socket / pipe , when a thread makes an open(), opendir(),
- * socket(), or pipe() system call. It cannot exist a <file> structure without a 
- * a <mapper>, <socket>, or <pipe> structure (depending on type) in same cluster.
- * It can exist a <file> structure without an <inode> (for PIPE and SOCK types).
- *****************************************************************************************/
-
-/* this enum define the VFS file types                                                   */
-/* WARNING : this enum must be kept consistent with macros in <shared_stat.h> file       */
-/*           and with types in <shared_dirent.h> file.                                   */
-
-typedef enum   
-{
-    FILE_TYPE_REG   =     0,           /*! regular file                                  */
-    FILE_TYPE_DIR   =     1,           /*! directory                                     */
-    FILE_TYPE_FIFO  =     2,           /*! POSIX named fifo                              */
-    FILE_TYPE_PIPE  =     3,           /*! POSIX anonymous pipe                          */
-    FILE_TYPE_SOCK  =     4,           /*! POSIX anonymous socket                        */
-    FILE_TYPE_DEV   =     5,           /*! character device                              */
-    FILE_TYPE_BLK   =     6,           /*! block device                                  */
-    FILE_TYPE_SYML  =     7,           /*! symbolic link                                 */
-}
-vfs_file_type_t;
-
-typedef enum
-{
-    FD_ATTR_READ_ENABLE    = 0x01,     /*! read access possible                          */
-    FD_ATTR_WRITE_ENABLE   = 0x02,     /*! write access possible                         */
-    FD_ATTR_APPEND         = 0x04,     /*! append on each write                          */
-    FD_ATTR_CLOSE_EXEC     = 0x08,     /*! close file on exec                            */
-    FD_ATTR_SYNC           = 0x10,     /*! synchronise FS on each write                  */
-    FD_ATTR_IS_DIR         = 0x20,     /*! this is a directory                           */
-}
-vfs_file_attr_t;
-
-typedef struct vfs_file_s
-{
-	struct vfs_ctx_s      * ctx;        /*! local pointer on FS context.                 */
-	vfs_file_attr_t         attr;       /*! file attributes bit vector (see above)       */
-	vfs_file_type_t         type;       /*! same type as inode                           */
-	uint32_t                offset;     /*! seek position in file                        */
-	remote_rwlock_t         lock;       /*! protect offset modifications                 */
-	struct vfs_inode_s    * inode;      /*! local pointer on associated inode            */
-	struct mapper_s       * mapper;     /*! associated mapper (REG or DIR types only)    */
-    struct socket_s       * socket;     /*! associated socket (SOCK type only)           */
-    struct pipe_s         * pipe;       /*! associated pipe (FIFO or PIPE types only)    */
-	void                  * extend;     /*! FS specific extension                        */
-}
-vfs_file_t;
-
-/******************************************************************************************
- *        These low-level functions access / modify a VFS file descriptor
- *****************************************************************************************/
-
-/****************************************************************************************** 
- * This function allocates memory and initializes a new file descriptor in the
- * cluster defined by the <inode_xp> argument.
- * It can be called by any thread running in any cluster.
- ****************************************************************************************** 
- * @ inode_xp  : [in]  extended pointer on associated inode.
- * @ attr      : [in]  file descriptor attributes.
- * @ file_xp   : [out] buffer for extended pointer on created file descriptor.
- * @ return 0 if success / return ENOMEM if error.
- *****************************************************************************************/
-error_t vfs_file_create( xptr_t        inode_xp,
-                         uint32_t      attr,
-                         xptr_t      * file_xp );  
-
-/****************************************************************************************** 
- * This function releases memory allocated to file descriptor identified
- * by the <file_xp> argument.
- * It can be called by any thread running in any cluster.
- ****************************************************************************************** 
- * @ file_xp  : [in] extended pointer on file descriptor.
- *****************************************************************************************/
-void vfs_file_destroy( xptr_t  file_xp );  
-
-/****************************************************************************************** 
- * This debug function copies the name of a the file identified by <file_xp>
- * argument to a local buffer identified by the <name> argument.
- * The local buffer size must be at least CONFIG_VFS_MAX_NAME_LENGTH. 
- *****************************************************************************************
- * @ ionde_xp  : [in] extended pointer on the remote inode.
- * @ name      : [out] local string.
- ***************************************************************************************/
-void vfs_file_get_name( xptr_t inode_xp,
-                        char * name );
-
-
-
-
-/******************************************************************************************
- * This structure define a VFS inode.
- * An inode can have several children dentries (if it is a directory), an can have several
- * parents dentries (if it has several aliases links):
- * - The "parents" field is the root of the xlist of parents dentries, and the "links"
- *   fiels define the number of aliases parent dentries. only a FILE inode can have
- *   several parents (no hard links for directories). 
- * - The "children" field is an embedded xhtab containing pointers on all local children
- *   dentries. This set of children is empty for a FILE inode.
- * Synchronisation:
- * - the main_lock (remote_rwlock) is used during the inode tree traversal,
- *   or for inode modification (add/remove children in xhtab).
- * - the size_lock (remote_rwlock) is used during read/write accesses to the size
- *   field in the mapper. 
- * - access to the data stored in the associated mapper use the mapper remote_rwlock 
- *   protecting radix tree traversal and modifications.
- *****************************************************************************************/
-
-/* this enum define the VFS inode attributes values */
-
-typedef enum 
-{
-    INODE_ATTR_DIRTY   =     0x01,       /*! modified versus the value on device         */ 
-    INODE_ATTR_INLOAD  =     0x04,       /*! loading from device in progress             */
-    INODE_ATTR_NEW     =     0x08,       /*! not saved on device yet                     */
-}
-vfs_inode_attr_t;
-
-typedef struct vfs_inode_s
-{
-    struct vfs_ctx_s    * ctx;           /*! local pointer on FS context                 */
-    uint32_t              inum;          /*! inode identifier (unique in file system)    */
-    uint32_t              attr;          /*! inode attributes (see above)                */
-    vfs_file_type_t       type;          /*! inode type (see vfs_file_t)                 */
-    uint32_t              size;          /*! number of bytes                             */
-    uint32_t              uid;           /*! user owner identifier                       */
-    uint32_t              gid;           /*! group owner identifier                      */
-    uint32_t              rights;        /*! access rights                               */
-    xlist_entry_t         parents;       /*! root of list of parents dentries            */
-    uint32_t              links;         /*! number of parent dentries (hard links)      */
-    xhtab_t               children;      /*! embedded xhtab of children dentries         */
-    remote_rwlock_t       size_lock;     /*! protect read/write to size                  */
-    remote_rwlock_t       main_lock;     /*! protect inode tree traversal and modifs     */
-    struct mapper_s     * mapper;        /*! associated file (REG or DIR types only)     */
-    struct remote_buf_s * pipe;          /*! associated pipe (FIFO type only)            */
-    void                * extend;        /*! fs_type_specific inode extension            */
-}
-vfs_inode_t;
-
-/* This define the masks for the inode <rights> field  */
-
-#define VFS_ISUID	   0x0004000
-#define VFS_ISGID	   0x0002000
-#define VFS_ISVTX	   0x0001000
-
-#define VFS_IRWXU      0x0000700
-#define VFS_IRUSR      0x0000400
-#define VFS_IWUSR      0x0000200
-#define VFS_IXUSR      0x0000100
-
-#define VFS_IRWXG      0x0000070
-#define VFS_IRGRP      0x0000040
-#define VFS_IWGRP      0x0000020
-#define VFS_IXGRP      0x0000010
-
-#define VFS_IRWXO      0x0000007
-#define VFS_IROTH      0x0000004
-#define VFS_IWOTH      0x0000002
-#define VFS_IXOTH      0x0000001
-
-/******************************************************************************************
- *        These low-level functions access / modify a VFS inode descriptor
- *****************************************************************************************/
-
-/****************************************************************************************** 
- * This function returns a printable string for the inode type.
- *****************************************************************************************/
-const char * vfs_inode_type_str( vfs_file_type_t type );
-
-/****************************************************************************************** 
- * This function allocates memory in cluster identified by the <cxy> argument 
- * for an inode descriptor and for the associated mapper, and partially initialise 
- * this inode from arguments values.
- * It does NOT link it to the Inode Tree, as this is done by add_child_in_parent(). 
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ cxy        : [in]  target cluster identifier
- * @ fs_type    : [in]  file system type.
- * @ attr       : [in]  inode attributes.
- * @ rights     : [in]  inode access rights.
- * @ uid        : [in]  user owner ID.
- * @ gid        : [in]  group owner ID.
- * @ inode_xp   : [out] buffer for extended pointer on created inode.
- * @ return 0 if success / return -1 if error.
- *****************************************************************************************/
-error_t vfs_inode_create( cxy_t             cxy,
-                          vfs_fs_type_t     fs_type,
-                          uint32_t          attr,
-                          uint32_t          rights,
-                          uid_t             uid,
-                          gid_t             gid,
-                          xptr_t          * inode_xp );
-
-/****************************************************************************************** 
- * This function releases memory allocated to an inode descriptor, including
- * all memory allocated to the mapper (both mapper descriptor and radix tree).
- * The mapper should not contain any dirty page (should be synchronized before deletion).
- * It can be called by any thread running in any cluster.
- ****************************************************************************************** 
- * @ inode_xp  : extended pointer on inode descriptor.
- *****************************************************************************************/
-void vfs_inode_destroy( xptr_t  inode_xp );  
-
-/****************************************************************************************** 
- * This function returns the <size> of a file/dir from a remote inode,
- * taking the remote_rwlock protecting <size> in READ_MODE.
- * It can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ inode_xp  : extended pointer on the remote inode.
- * @ return the current size.
- *****************************************************************************************/
-uint32_t vfs_inode_get_size( xptr_t inode_xp );
-
-/****************************************************************************************** 
- * This function updates the "size" field of a remote inode identified by <inode_xp>.
- * It takes the rwlock protecting the file size in WRITE_MODE, and set the "size" field
- * when the current size is smaller than the requested <size> argument. 
- * It can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ inode_xp  : extended pointer on the remote inode.
- * @ size      : requested size value.
- *****************************************************************************************/
-void vfs_inode_update_size( xptr_t   inode_xp,
-                            uint32_t size );
-
-/****************************************************************************************** 
- * This function takes the main lock of a remote inode identified by the <inode_xp>.
- * This lock protect all inode fields, including the children dentries.
- * It can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ inode_xp  : extended pointer on the remote inode.
- *****************************************************************************************/
-void vfs_inode_lock( xptr_t inode_xp );
-
-/****************************************************************************************** 
- * This function releases the main lock of a remote inode identified by <inode_xp>.
- * This lock protect all inode fiels, including the children dentries.
- * It can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ inode_xp  : extended pointer on the remote inode.
- *****************************************************************************************/
-void vfs_inode_unlock( xptr_t inode_xp );
-
-/****************************************************************************************** 
- * This debug function copies the name of a remote inode identified by the <inode_xp>
- * argument to a local buffer identified by the <name> argument.
- * The local buffer size must be at least CONFIG_VFS_MAX_NAME_LENGTH. 
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ inode_xp  : extended pointer on the remote inode.
- * @ name      : local buffer pointer.
- *****************************************************************************************/
-void vfs_inode_get_name( xptr_t inode_xp,
-                         char * name );
-
-/******************************************************************************************
- * This function accesses successively all pages of a file identified by the <inode_xp>,
- * argument, to force misses, and load all pages into mapper.
- * The target inode can be a directory or a file, but this function is mainly used 
- * to prefetch a complete directory to the mapper.
- * This function does NOT take any lock.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ inode_xp  : extended pointer on inode.
- * @ return 0 if success / return -1 if device access failure.
- *****************************************************************************************/
-error_t vfs_inode_load_all_pages( xptr_t inode_xp );
-
-/****************************************************************************************** 
- * This debug function display the curren state of an inode descriptor.
- * It can be called by any thread running in any cluster.
- *****************************************************************************************/
-void vfs_inode_display( xptr_t inode_xp );
-
-
-
-
-
-
-/******************************************************************************************
- * This structure defines a directory entry.
- * A dentry contains the name of a remote file/dir, an extended pointer on the 
- * inode representing this file/dir, a local pointer on the inode representing 
- * the parent directory.
- * A dentry can be member of the set of children of a given directory inode (xhtab).
- * A dentry can be member of the set of parents  of a given inode (xlist).
- *****************************************************************************************/
-
-typedef struct vfs_dentry_s
-{
-    struct vfs_ctx_s   * ctx;            /*! local pointer on FS context                 */
-	char                 name[CONFIG_VFS_MAX_NAME_LENGTH];
-	uint32_t             length;         /*! name length (bytes)                         */
-    struct vfs_inode_s * parent;         /*! local pointer on parent inode               */
-    xptr_t               child_xp;       /*! extended pointer on child inode             */
-    xlist_entry_t        children;       /*! member of set of children dentries          */
-    xlist_entry_t        parents;        /*! member of set of parent dentries            */
-	void               * extend;         /*! FS specific extension                       */
-}
-vfs_dentry_t;
-
-/******************************************************************************************
- *        These low-level functions access / modify a VFS dentry descriptor
- *****************************************************************************************/
-
-/****************************************************************************************** 
- * This function allocates memory in cluster identified by the <cxy> argument
- * for a dentry descriptor, initialises it from  arguments values, and returns 
- * in <dentry_xp> the extended pointer on dentry.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ cxy        : [in]  target cluster identifier
- * @ fs_type    : [in]  file system type.
- * @ name       : [in]  directory entry file/dir name.
- * @ dentry_xp  : [out] buffer for extended pointer on created dentry.
- * @ return 0 if success / return ENOMEM or EINVAL if error.
- *****************************************************************************************/
-error_t vfs_dentry_create( cxy_t           cxy,
-                           vfs_fs_type_t   fs_type,
-                           char          * name,
-                           xptr_t        * dentry_xp );
- 
-/****************************************************************************************** 
- * This function removes the dentry from the parent inode xhtab, and releases the memory
- * allocated to the dentry descriptor.
- * It can be called by any thread running in any cluster.
- ****************************************************************************************** 
- * @ dentry_xp  : [in] extended pointer on dentry descriptor.
- *****************************************************************************************/
-void vfs_dentry_destroy( xptr_t  dentry_xp );  
-
-
-
-
-
-
-
-
-/******************************************************************************************
- *        These functions access / modify the distributed VFS Inode Tree
- *****************************************************************************************/
-
-/****************************************************************************************** 
- * This function returns in a kernel <buffer> allocated by the caller function,
- * the pathname of a file/dir identified by the <inode_xp> argument. 
- * It traverse the Inode Tree from the target node to the root.
- * It can be called by any thread running in any cluster.
- * As this buffer if filled in "reverse order" (i.e. from the target inode to the root),
- * the pathname is stored in the higher part of the buffer. 
- * A pointer on the first character of the pathname is returned in <first> buffer.
- *
- * WARNING : This function takes & releases the remote_rwlock protecting the Inode Tree.
- ******************************************************************************************
- * @ inode_xp    : [in]  extended pointer on target inode descriptor.
- * @ buffer      : [in]  kernel buffer for pathname (allocated by caller).
- * @ first       : [out] pointer on first character in buffer.
- * @ max_size    : [in]  max number of characters in buffer.
- * @ return 0 if success / return EINVAL if buffer too small.
- *****************************************************************************************/
-error_t vfs_get_path( xptr_t    inode_xp,
-                      char    * buffer,
-                      char   ** first,
-                      uint32_t  max_size );
-
-/******************************************************************************************
- * This function traverses the the Inode Tree, from inode identified by the <root_xp> 
- * argument, and returns in <inode_xp> the inode identified by the < pathname> argument. 
- * It can be called by a thread running in any cluster.
- * It supports the following flags that define the lookup modes :
- * - VFS_LOOKUP_DIR    : the searched inode must be a directory 
- * - VFS_LOOKUP_OPEN   : the search is for an open/opendir
- * - VFS_LOOKUP_PARENT : return the parent inode (not the inode itself) 
- * - VFS_LOOKUP_CREATE : file/directory must be created if missing on IOC 
- * - VFS_LOOKUP_EXCL   : file cannot previously exist
- * As the inode Tree is a cache, the search policy is the following :
- * - If a given directory name in the path is not found in the inode tree, it try to load
- *   the missing dentry/inode couple, from informations found in the parent directory.
- * - If this directory entry does not exist on IOC, it returns an error.
- * - If the file identified by the pathname does not exist on IOC but the
- *   flag CREATE is set, the inode is created. It returns an error otherwise.
- * - If the the file identified by the pathname exist on device, but both flags EXCL
- *   and CREATE are set, an error is returned.
- * - If the PARENT flag is set, it returns in <inode_xp> an extended pointer on the parent
- *   inode, and copies in <last_name> buffer a string containing the last name in path.
- *
- * WARNING : The lock protecting the Inode Tree must be taken in read mode by the caller. 
- *
- * TODO the access rights are not checked yet.
- ******************************************************************************************
- * @ root_xp     : [in]  extended pointer on root inode (can be root of a subtree). 
- * @ pathname    : [in]  path (can be relative or absolute).
- * @ lookup_mode : [in]  flags defining the searching mode.
- * @ inode_xp    : [out] buffer for extended pointer on searched inode.
- * @ last_name   : [out] pointer on buffer for last name in path.
- * @ return 0 if success / ENOENT if inode not found , EACCES if permisson denied,
- *****************************************************************************************/
-error_t vfs_lookup( xptr_t             root_xp,
-                    char             * pathname,
-                    uint32_t           lookup_mode,
-					xptr_t           * inode_xp,
-                    char             * last_name );
-
-/******************************************************************************************
- * This function creates a new couple dentry/inode, and insert it in the Inode-Tree.
- * Only the distributed Inode-Tree is modified: it does NOT modify the parent mapper, 
- * and does NOT update the FS on IOC device.
- * It set the inode type to the default FILE_TYPE_REG value.
- * It can be executed by any thread running in any cluster (can be different from both
- * the child cluster and the parent cluster).
- * The new child inode and the parent inode can have different FS types.
- *
- * WARNING : The lock protecting the Inode Tree must be taken in write mode by the caller. 
- ******************************************************************************************
- * Implementation note
- * As there are cross-references between inode and dentry, this function implements
- * a five steps scenario :
- * 1) The dentry descriptor is created in the cluster containing the existing <parent_xp>
- *    inode, and partially initialized, using the RPC_VFS_CREATE DENTRY if required.
- * 2) The inode and its associated mapper are created in cluster identified by <child_cxy>,
- *    and partially initialised, using the RPC_VFS_CREATE_INODE if required.
- * 3) The pointers on dentry in parent inode are updated, using remote access.
- * 4) The pointers on dentry in child inode are updated, using remotes access.
- * 5) The pointers on parent and child inode in dentry are updated, using remotes access.
- *****************************************************************************************
- * @ child_inode_cxy  : [in]  target cluster for child inode.
- * @ fs_type          : [in]  child inode FS type.
- * @ parent_inode_xp  : [in]  extended pointer on parent inode.
- * @ name             : [in]  new directory entry name.
- * @ dentry_xp        : [out] buffer for extended pointer on dentry
- * @ child_inode_xp   : [out] buffer for extended pointer on child inode.
- * @ return 0 if success / -1 if dentry or inode cannot be created.
- *****************************************************************************************/
-error_t vfs_add_child_in_parent( cxy_t              child_inode_cxy,
-                                 vfs_fs_type_t      fs_type,
-                                 xptr_t             parent_inode_xp,
-                                 char             * name,
-                                 xptr_t           * dentry_xp,   
-                                 xptr_t           * child_inode_xp );
-
-/******************************************************************************************
- * This function removes a remote dentry and the associated inode from the Inode-Tree.
- * - It removes the dentry from the parent inode xhtab ("children" field), and from the
- *   child inode xlist ("parents" field).
- * - It releases the memory allocated to the dentry descriptor.
- * - If the number of parents of the child inode is one, it also releases the memory
- *   allocated to the child inode.
- * Only the Inode Tree is modified: it does NOT modify the parent mapper, 
- * and does NOT update the FS on IOC device.
- * It can be executed by any thread running in any cluster (can be different from both
- * the inode cluster and the dentry cluster).
- *
- * WARNING : The lock protecting the Inode Tree must be taken in write mode by the caller. 
- ******************************************************************************************
- * @ dentry_xp   : extended pointer on removed dentry.
- *****************************************************************************************/
-void vfs_remove_child_from_parent( xptr_t dentry_xp );
-
-/******************************************************************************************
- * This function creates in the directory identified by the <child_inode_xp> argument, 
- * the two special dentries <.> and <..>. The parent directory inode is defined
- * by the <parent_inode_xp> argument. The two dentries are introduced in the Inode Tree.
- * They are also introduced in the child directory mapper, and the IOC device is updated.
- * This function is called by all functions creating a brand new directory : vfs_mkdir(),
- * devfs_global_init(), and devfs_local_init().
- *
- * WARNING : The lock protecting the Inode Tree must be taken in write mode by the caller. 
- ******************************************************************************************
- * @ child_xp    : extended pointer on new directory inode.
- * @ parent_xp   : extended pointer on parent directory inode.
- * @ return 0 if success / -1 if failure.
- *****************************************************************************************/
-error_t vfs_add_special_dentries( xptr_t  child_inode_xp,
-                                  xptr_t  parent_inode_xp );
-
-/******************************************************************************************
- * This recursive function diplays a complete inode/dentry sub-tree.
- * Any inode can be selected as the sub-tree root.
- *
- * TODO : this function should be protected against a concurrent Inode-Tree change.
- ******************************************************************************************
- * @ inode_xp   : extended pointer on sub-tree root inode.
- *****************************************************************************************/
-void vfs_display( xptr_t   inode_xp );
-
-/****************************************************************************************** 
- * This function mount a given file system type for a given process 
- * TODO non implemented [AG].     
- *****************************************************************************************/
-error_t vfs_mount_fs_root( struct device_s  * device,
-			               uint32_t           fs_type,
-			               struct process_s * process );
-
-
-
-
-/******************************************************************************************
- *        These functions define the VFS "syscalls" API (user commands)
- *****************************************************************************************/
-
-/****************************************************************************************** 
- * This function moves <size> bytes between a remote file mapper, identified by the 
- * <file_xp> argument, and a - possibly distributed - user space <buffer>, taken into 
- * account the offset in <file_xp>. The transfer direction is defined by <to_buffer>.
- * It is called by the sys_read() and sys_write() functions.
- * - for a read, it checks the actual file size (registered in the inode descriptor),
- *   against the (offset + count), and moves only the significant bytes.
- * - for a write, it updates the the file size in inode descriptor if required.
- * In case of write to the mapper, the "inode.size" field is updated as required.
- ******************************************************************************************
- * @ to_buffer : mapper -> buffer if true / buffer -> mapper if false. 
- * @ file_xp   : extended pointer on the remote file descriptor.
- * @ buffer    : user space pointer on buffer (can be physically distributed).
- * @ count     : requested number of bytes from offset.
- * @ returns number of bytes actually moved if success / -1 if error.
- *****************************************************************************************/
-uint32_t vfs_user_move( bool_t   to_buffer,
-                        xptr_t   file_xp, 
-                        void   * buffer,
-                        uint32_t count );
-
-/****************************************************************************************** 
- * This function moves <size> bytes between a remote file mapper, identified by the 
- * <file_xp> argument, and a - possibly remote - kernel <buffer_xp>, taken into 
- * account the offset in <file_xp>. The transfer direction is defined by <to_buffer>.
- * It is called by the elf_load_process() function.
- ******************************************************************************************
- * @ to_buffer : mapper -> buffer if true / buffer -> mapper if false. 
- * @ file_xp   : extended pointer on the remote file descriptor.
- * @ buffer_xp : user space pointer on buffer (can be physically distributed).
- * @ size      : requested number of bytes from offset.
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_kernel_move( bool_t   to_buffer,
-                         xptr_t   file_xp, 
-                         xptr_t   buffer_xp,
-                         uint32_t size );
-
-/****************************************************************************************** 
- * This function allocates a vfs_file_t structure in the cluster containing the inode
- * identified by the <root_xp> & <path> arguments.
- * It initializes it, register it in the reference process fd_array identified by the
- * <process_xp> argument, and returns both the extended pointer on the file descriptor,
- * and the allocated index in the <file_xp> and <file_id> buffers. 
- * The pathname can be relative to current directory or absolute.
- * If the inode does not exist in the inode cache, it try to find the file on the IOC
- * device, and creates an inode on a pseudo randomly selected cluster if found.
- * It the requested file does not exist on device, it creates a new inode if the
- * O_CREAT flag is set, and return an error otherwise. 
- *
- * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree.
- ****************************************************************************************** 
- * @ root_xp     : extended pointer on path root inode.
- * @ path        : file pathname (absolute or relative to current directory).
- * @ process_xp  : extended pointer on client reference process.
- * @ flags       : defined in vfs_file_t structure.
- * @ mode        : access rights (as defined by chmod).
- * @ file_xp     : [out] buffer for extended pointer on created remote file descriptor.
- * @ file_id     : [out] buffer for created file descriptor index in reference fd_array.
- * @ return 0 if success / return non-zero if error.
- *****************************************************************************************/
-error_t vfs_open( xptr_t             root_xp,
-		          char             * path,
-                  xptr_t             process_xp,
-		          uint32_t           flags,
-                  uint32_t           mode,
-		          xptr_t           * file_xp,
-		          uint32_t         * file_id );
-
-/****************************************************************************************** 
- * This function set a new value in the offset of the open file descriptor <file_xp>.
- * This value depends on the <whence> argument:
- * - if VFS_SEEK_SET, new value is <offset>
- * - if VFS_SEEK_CUR, new value is current_offset + <offset>
- * - if VFS_SEEK_END, new value is file_size + <offset>
- ****************************************************************************************** 
- * @ file_xp   : extended pointer on the remote open file descriptor.
- * @ offset    : local pointer on source kernel buffer.
- * @ whence    : VFS_SEEK_SET / VFS_SEEK_CUR / VFS_SEEK_END.
- * @ new_offset : [out] buffer for new offset value.
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_lseek( xptr_t     file_xp,
-                   uint32_t   offset,
-                   uint32_t   whence, 
-                   uint32_t * new_offset );
-
-/****************************************************************************************** 
- * This function close the - non-replicated - file descriptor identified by the <file_xp>
- * and <file_id> arguments. The <file_id> is required to reset the fd_array[] slot.
- * It can be called by a thread running in any cluster, and executes the following actions:
- * 1) It access the block device to updates all dirty pages from the mapper associated 
- *    to the file, and removes these pages from the dirty list, using an RPC if required.
- * 2) It updates the file size in all parent directory mapper(s), and update the modified
- *    pages on the block device, using RPCs if required, only if the size is modified.
- * 3) All entries in the fd_array copies are directly reset by the calling thread,
- *    using remote accesses. 
- * 4) The memory allocated to file descriptor in cluster containing the inode is released,
- *    using an RPC if cluster containing the file descriptor is remote.
- ******************************************************************************************
- * @ file_xp     : extended pointer on the file descriptor.
- * @ file_id     : file descriptor index in fd_array[].
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_close( xptr_t    file_xp,
-                   uint32_t  file_id );
-
-/****************************************************************************************** 
- * This function is called by the kernel to create in the file system a new directory 
- * identified by the <root_xp> & <path> arguments, with the access permission defined
- * by the <rights> argument. All nodes in the path - but the last -  must exist.
- *
- * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree.
- ******************************************************************************************
- * @ root_xp : extended pointer on path root inode (any inode in Inode Tree).
- * @ path    : pathname (absolute or relative to current directory).
- * @ rights  : access rights.
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_mkdir( xptr_t   root_xp,
-                   char   * path,
-                   uint32_t rights );
-
-/****************************************************************************************** 
- * This function is called by the kernel to create in the file system a new directory 
- * entry identified by the <new_root_xp> & <new_path> arguments, to be linked to an
- * existing inode, identified by the  <old_root_xp> & <old_path> arguments.
- * If the link is successful, the link count of the target inode is incremented.
- * The <new_path> and <old_path> share equal access rights to the underlying inode.
- * Both the IOC device and the Inode Tree are modified. 
- $
- * TODO This function should handle any type of node, but the current implementation
- * handles only the FILE and DIR types.
- *
- * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree.
- ******************************************************************************************
- * @ old_root_xp : extended pointer on old path root inode (any inode in Inode Tree).
- * @ old_path    : old pathname (absolute or relative to current directory).
- * @ nld_root_xp : extended pointer on new path root inode (any inode in Inode Tree).
- * @ new_path    : new pathname (absolute or relative to current directory).
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_link( xptr_t   old_root_xp,
-                  char   * old_path,
-                  xptr_t   new_root_xp,
-                  char   * new_path );
-
-/****************************************************************************************** 
- * This function is called by the kernel to remove from the file system a directory entry
- * identified by the  <root_xp> & <path> arguments.
- * The link count of the target node is decremented.
- * If the removed link is the last, the target inode is deleted.
- * Both the IOC device and the Inode Tree are modified. 
- *
- * TODO This function should handle any type of node, but the current implementation
- * handles only only the FILE and DIR types.
- *
- * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree.
- ******************************************************************************************
- * @ root_xp  : extended pointer on root inode (can be any inode in Inode Tree).
- * @ path     : pathname (absolute or relative to current directory).
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_unlink( xptr_t   root_xp,
-                    char   * path );
-
-/****************************************************************************************** 
- * This function returns, in the structure pointed by the <st> pointer, various
- * informations on the file  identified by the <root_inode_xp> and <patname> arguments.
- *
- * TODO : only partially implemented yet (only size and inum fields).
- *
- * WARNING : this function takes & releases the remote_rwlock protecting the Inode Tree.
- ******************************************************************************************
- * @ root_xp    : extended pointer on path root inode (any inode in Inode Tree)
- * @ pathname   : pathname to target inode.
- * @ st         : local pointer on the stat structure in kernel space.
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_stat( xptr_t        root_xp,
-                  char        * pathname,
-                  struct stat * st );
-
-/****************************************************************************************** 
- * This function  creates a new inode/dentry couple for a new directory, and registers it
- * in the Inode Tree, as defined by the <root_xp>,  <path>, and <mode> arguments.
- ******************************************************************************************
- * @ root_xp  : extended pointer on the path root directory.
- * @ path     : pathname (absolute or relative to CWD).                     
- * @ mode     : access rights (as defined by chmod)
- * @ returns 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_mkdir( xptr_t     root_xp,
-                   char     * path,
-                   uint32_t   mode );
-
-/****************************************************************************************** 
- * This function makes the directory identified by the <root_xp and <path> arguments 
- * to become the working directory for the calling process.
- ****************************************************************************************** 
- * @ root_xp  : extended pointer on the path root directory.
- * @ path     : pathname (absolute or relative to CWD).
- * return 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_chdir( xptr_t   root_xp,
-                   char   * path );
-
-/****************************************************************************************** 
- * This function change the access rigths for the file/directory identified by the 
- * <root_xp> and <path> arguments as defined by the <mode> argument value.
- * TODO not implemented yet
- ****************************************************************************************** 
- * @ root_xp  : extended pointer on the path root directory.
- * @ path     : pathname (absolute or relative to CWD).
- * @ mode     : access rights
- * return 0 if success / -1 if error.
- *****************************************************************************************/
-error_t vfs_chmod( xptr_t        root_xp,
-                   char        * path,
-                   uint32_t      mode );
-
-/****************************************************************************************** 
- * This function creates a new inode/dentry couple of FIFO type, and registers it
- * in the Inode Tree as specified by the <root_xp>, <path>, and <mode> arguments.
- ****************************************************************************************** 
- * @ root_xp  : [in] extended pointer on the root directory in path.
- * @ path     : [in] pathname (absolute or relative to CWD).
- * @ mode     : [in] access rights new value.
- *****************************************************************************************/
-error_t vfs_mkfifo( xptr_t       root_xp,
-                    char       * path,
-                    uint32_t     mode );
-
-
-
-
-
-/******************************************************************************************
- *      These functions define the VFS "FS" API to access a specific File System
- *****************************************************************************************/
-
-/******************************************************************************************
- * This function introduces in a directory mapper identified by the <parent_inode_xp>
- * argument, a new entry identified by the <dentry_ptr> argument. 
- * Depending on the file system type, it calls the proper, FS specific function.
- * All informations related to the new directory must be contained in the dentry 
- * descriptor, or in the associated child inode descriptor.
- * The dentry descriptor "extend" field is updated as required by the specific FS. 
- * Finally, it synchronously updates the parent directory on IOC device.
- * This function can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ parent  : local pointer on parent (directory) inode.
- * @ dentry  : local pointer on dentry containing name.
- * @ return 0 if success / return -1 if device access failure.
- *****************************************************************************************/
-error_t vfs_fs_add_dentry( xptr_t         parent_inode_xp,
-                           vfs_dentry_t * dentry_ptr );
-
-/******************************************************************************************
- * This function removes from a directory mapper identified by the <parent_inode_xp> 
- * argument, an entry identified by the <dentry_ptr> argument. 
- * Depending on the file system type, it calls the proper, FS specific function.
- * Finally, it synchronously updates the parent directory on IOC device.
- * This function can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ parent_inode_xp  : extended pointer on parent (directory) inode.
- * @ dentry_ptr       : local pointer on dentry containing name.
- * @ return 0 if success / return -1 if device access failure.
- *****************************************************************************************/
-error_t vfs_fs_remove_dentry( xptr_t         parent_inode_xp,
-                              vfs_dentry_t * dentry_ptr );
-
-/******************************************************************************************
- * This function scan a directory mapper, identified by the <parent_inode_xp> argument
- * to find a directory entry identified by the <dentry_ptr> argument,
- * and updates both the child inode descriptor, and the associated dentry descriptor:
- * - It set the "size", "type", and "extend" fields in inode descriptor.
- * - It set the "extend" field in dentry descriptor.
- * It is called by the vfs_lookup() function in case of miss, and does NOT take any lock.
- * Depending on the file system type, it calls the relevant, FS specific function.
- * This function can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ parent_inode_xp  : extended pointer on parent inode (directory).
- * @ dentry_ptr       : local pointer on new entry (in parent inode cluster).
- * @ return 0 if success / return -1 if dentry not found.
- *****************************************************************************************/
-error_t vfs_fs_new_dentry_from_mapper( xptr_t         parent_inode_xp,
-                                       vfs_dentry_t * dentry_ptr );
-
-/*****************************************************************************************
- * This function  introduces a brand new dentry identified by the <dentry_ptr> argument
- * in the mapper of a directory identified by the <parent_inode_xp> argument.
- * It is called by the vfs_lookup() function, and does NOT take any lock.
- * The child inode descriptor, and the dentry descriptor must have been previously
- * allocated and introduced in the Inode Tree. The dentry descriptor contains the name. 
- * Depending on the file system type, it calls the relevant, FS specific function.
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ parent_inode_xp : [in]  extended pointer on parent inode (directory).
- * @ dentry_ptr      : [in]  local pointer on dentry (in parent inode cluster).
- * @ return 0 if success / return -1 if failure.
- ****************************************************************************************/
-error_t vfs_fs_new_dentry_to_mapper( xptr_t         parent_inode_xp,
-                                     vfs_dentry_t * dentry_ptr );
-
-/******************************************************************************************
- * This function updates the "size" field of a directory entry identified by the 
- * <dentry_ptr> argument in a directory mapper identified by the <parent_inode_xp>
- * from the value contained in the inode descriptor.
- * The parent directory on device is synchronously updated.
- * It is called by the vfs_close() function.
- * Depending on the file system type, it calls the relevant, FS specific function.
- * This function can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ parent_inode_xp  : local pointer on parent inode (directory).
- * @ dentry_ptr       : local pointer on dentry (in parent directory cluster).
- * @ return 0 if success / return -1 if not found.
- *****************************************************************************************/
-error_t vfs_fs_update_dentry( xptr_t         parent_inode_xp,
-                              vfs_dentry_t * dentry_ptr );
-
-/******************************************************************************************
- * This function scan the mapper of an an existing parent inode directory, identified by
- * the <inode> argument and copy up to <max_dirent> valid dentries to a 
- * local dirent array, defined by the <array> argument. The <min_dentry> argument defines
- * the index of the first dentry to copied to the target dirent array.
- * This function returns in the <entries> buffer the number of dentries actually written,
- * and signals in the <done> buffer when the last valid entry has been found.
- * If the <detailed> argument is true, a dentry/inode couple that does not exist in
- * the Inode Tree is dynamically created, and all dirent fiels are documented in the
- * dirent array. Otherwise, only the dentry name is documented.
- * This function does NOT take any lock.
- * Depending on the file system type, it calls the relevant, FS specific function.
- *
- * WARNING : this function must be called by a thread running in the cluster containing
- * the target directory inode.
- ******************************************************************************************
- * @ inode      : [in]  local pointer on directory inode.
- * @ array      : [in]  local pointer on array of dirents.
- * @ max_dirent : [in]  max number of slots in dirent array.
- * @ min_dentry : [in]  index of first dentry to be copied into array.
- * @ detailed   : [in]  dynamic inode creation if true.
- * @ entries    : [out] number of dentries actually copied into array.
- * @ done       : [out] Boolean true when last entry found.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-error_t vfs_fs_get_user_dir( vfs_inode_t   * inode,
-                             struct dirent * array,
-                             uint32_t        max_dirent,
-                             uint32_t        min_dentry,
-                             bool_t          detailed,
-                             uint32_t      * entries,
-                             bool_t        * done );
- 
-/*****************************************************************************************
- * This function  updates the FS on the IOC device for a given inode identified by 
- * the <inode> argument. It scan all pages registered in the associated mapper,
- * and copies from mapper to device each page marked as dirty.
- * WARNING : The target <inode> cannot be a directory, because all modifications in a 
- * directory are synchronously done on the IOC device by the two vfs_fs_add_dentry() 
- * and vfs_fs_remove_dentry() functions.
- * Depending on the file system type, it calls the relevant, FS specific function.
- * This function can be called by any thread running in any cluster.
- *****************************************************************************************
- * @ inode_xp   : remote pointer on inode.
- * @ return 0 if success / return -1 if failure. 
- ****************************************************************************************/
-error_t vfs_fs_sync_inode( xptr_t inode_xp );
-
-/*****************************************************************************************
- * This function updates the FS defined by the <fs_type> argument on the IOC device
- * for the FAT itself. It scan all clusters registered in the FAT mapper, and copies 
- * to device each page marked as dirty.
- * Depending on the file system type, it calls the relevant, FS specific function.
- * It can be called by a thread running in any cluster.
- *****************************************************************************************
- * @ fs_type   : specific file system type.
- * @ return 0 if success / return EIO if failure during device access.
- ****************************************************************************************/
-error_t vfs_fs_sync_fat( vfs_fs_type_t fs_type );
-
-/******************************************************************************************
- * This function makes all I/O operations required to release all clusters allocated
- * on IOC device to a given inode, identified by the <inode_xp> argument.
- * Depending on the file system type, it calls the proper, FS specific function.
- * It is called by the vfs_unlink() function.
- * This function does NOT take any lock.
- * Depending on the file system type, it calls the relevant, FS specific function.
- * This function can be executed by any thread running in any cluster.
- ******************************************************************************************
- * @ inode_xp  : extended pointer on inode.
- * @ return 0 if success / return -1 if device access failure.
- *****************************************************************************************/
-error_t vfs_fs_release_inode( xptr_t  inode_xp ); 
-
-/******************************************************************************************
- * This function makes the I/O operation to move one page identified by the <page_xp>
- * argument to/from the IOC device from/to the mapper, as defined by the <cmd_type>.
- * It is used in case of MISS on the mapper (read), or when a dirty page in the mapper
- * must be updated in the File System (write).
- * The mapper pointer, and the page index in file are obtained from the page descriptor.
- * This function does NOT take any lock.
- * Depending on the file system type, it calls the proper, FS specific function.
- * This function can be executed by any thread running in any cluster.
- ******************************************************************************************
- * @ page_xp   : extended pointer on page descriptor (for mapper and page_id).
- * @ cmd_type  : IOC_READ / IOC_WRITE / IOC_SYNC_READ / IOC_SYNC_WRITE
- * @ returns 0 if success / return -1 if device access failure.
- *****************************************************************************************/
-error_t vfs_fs_move_page( xptr_t          page_xp,
-                          ioc_cmd_type_t  cmd_type );
-
-
-#endif	/* _VFS_H_ */
Index: trunk/kernel/kern/alarm.c
===================================================================
--- trunk/kernel/kern/alarm.c	(revision 690)
+++ 	(revision )
@@ -1,206 +1,0 @@
-/*
- * alarm.c - timer based kernel alarm implementation            
- *
- * Author     Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <printk.h>
-#include <list.h>
-#include <thread.h>
-#include <core.h>
-#include <alarm.h>
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function registers the alarm identified by the <alarm> & <cxy> arguments 
-// in the list of alarms rooted in the core identified by the <core> argument.
-// When the existing list of alarms is not empty, it scan the list to insert the new
-// alarm in the right place to respect the absolute dates ordering. 
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ cxy    : cluster containing both the new alarm and the core.
-// @ alarm  : local pointer on the alarm.
-// @ core   : local pointer on the core.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void alarm_register( cxy_t     cxy,
-                            alarm_t * alarm,
-                            core_t  * core )
-{
-    // get alarm date
-    cycle_t new_date = hal_remote_l64( XPTR( cxy , &alarm->date ) );
-
-    // build local pointer on root of alarms list 
-    list_entry_t * root = &core->alarms_root;
-
-    // build local pointer on new alarm list_entry
-    list_entry_t * new  = &alarm->list;
-
-    // insert new alarm to respect dates order
-    if( list_remote_is_empty( cxy , &core->alarms_root ) )  // list empty
-    {
-        list_remote_add_first( cxy , root , new ); 
-    }
-    else                                                   // list non empty
-    {
-        list_entry_t * iter;        // local pointer on current list_entry in existing list
-        alarm_t      * iter_alarm;  // local pointer on current alarm in existing list
-        cycle_t        iter_date;   // date of current alarm in existing list
-        bool_t         done = false;
-
-        for( iter = hal_remote_lpt( XPTR( cxy , &root->next ) ) ;
-             (iter != root) && (done == false) ;
-             iter = hal_remote_lpt( XPTR( cxy , &iter->next ) ) )
-        {
-            // get local pointer on pred and next for iter
-            list_entry_t * prev = hal_remote_lpt( XPTR( cxy , &iter->pred ) );
-
-            // get local pointer on current alarm 
-            iter_alarm = LIST_ELEMENT( iter , alarm_t , list );
-
-            // get date for current alarm 
-            iter_date = hal_remote_l64( XPTR( cxy , &iter_alarm->date ) );
-
-            // insert new alarm just before current when required
-            if( iter_date > new_date )  
-            {
-                hal_remote_spt( XPTR( cxy , &new->next ) , iter );
-                hal_remote_spt( XPTR( cxy , &new->pred ) , prev );
-
-                hal_remote_spt( XPTR( cxy , &iter->pred ) , new );
-                hal_remote_spt( XPTR( cxy , &prev->next ) , new );
-                
-                done = true;
-            }
-        }  // end for
-        
-        if( done == false ) // new_date is larger than all registered dates
-        {
-            list_remote_add_last( cxy, root , new );
-        }
-    }
-}  // end alarm_register()
-            
-
-///////////////////////////////////
-void alarm_init( alarm_t *  alarm )
-{
-    alarm->linked   = false;
-    list_entry_init( &alarm->list );
-}
-
-///////////////////////////////////////
-void alarm_start( xptr_t     thread_xp,
-                  cycle_t    date,
-                  void     * func_ptr,
-                  xptr_t     args_xp )
-{
-    // get cluster and local pointer on target thread
-    thread_t * tgt_ptr = GET_PTR( thread_xp );
-    cxy_t      tgt_cxy = GET_CXY( thread_xp );
-
-// check alarm state
-assert( __FUNCTION__ , (hal_remote_l32( XPTR(tgt_cxy,&tgt_ptr->alarm.linked)) == false ),
-"alarm already started");
-
-    // get local pointer on core running target thread
-    core_t * core = hal_remote_lpt( XPTR( tgt_cxy , &tgt_ptr->core ) );
-
-    // build extended pointer on lock protecting alarms list
-    xptr_t lock_xp = XPTR( tgt_cxy , &core->alarms_lock );
-  
-    // initialize alarm descriptor
-    hal_remote_s64( XPTR( tgt_cxy , &tgt_ptr->alarm.date     ) , date );
-    hal_remote_spt( XPTR( tgt_cxy , &tgt_ptr->alarm.func_ptr ) , func_ptr );
-    hal_remote_s64( XPTR( tgt_cxy , &tgt_ptr->alarm.args_xp  ) , args_xp );
-    hal_remote_s32( XPTR( tgt_cxy , &tgt_ptr->alarm.linked   ) , true );
-
-    // take the lock
-    remote_busylock_acquire( lock_xp );
-
-    // register alarm in core list
-    alarm_register( tgt_cxy , &tgt_ptr->alarm , core );
-
-    //release the lock
-    remote_busylock_release( lock_xp );
-
-}  // end alarm_start()
-
-
-/////////////////////////////////////
-void alarm_stop( xptr_t   thread_xp )
-{
-    // get cluster and local pointer on target thread
-    thread_t * tgt_ptr = GET_PTR( thread_xp );
-    cxy_t      tgt_cxy = GET_CXY( thread_xp );
-
-    // get local pointer on core running target thread
-    core_t * core = hal_remote_lpt( XPTR( tgt_cxy , &tgt_ptr->core ) );
-
-    // build extended pointer on lock protecting alarms list
-    xptr_t lock_xp = XPTR( tgt_cxy , &core->alarms_lock );
-  
-    // take the lock
-    remote_busylock_acquire( lock_xp );
-
-    // unlink the alarm from the list rooted in core
-    list_remote_unlink( tgt_cxy , &tgt_ptr->alarm.list );
-
-    // update alarm state
-    hal_remote_s32( XPTR( tgt_cxy , &tgt_ptr->alarm.linked ) , false );
-
-    //release the lock
-    remote_busylock_release( lock_xp );
-
-}  // end alarm_stop()
-
-
-//////////////////////////////////////
-void alarm_update( xptr_t   thread_xp,
-                   cycle_t  new_date )
-{
-    // get cluster and local pointer on target thread
-    thread_t * tgt_ptr = GET_PTR( thread_xp );
-    cxy_t      tgt_cxy = GET_CXY( thread_xp );
-
-    // get local pointer on core running target thread
-    core_t * core = hal_remote_lpt( XPTR( tgt_cxy , &tgt_ptr->core ) );
-
-    // build extended pointer on lock protecting alarms list
-    xptr_t lock_xp = XPTR( tgt_cxy , &core->alarms_lock );
-  
-    // take the lock
-    remote_busylock_acquire( lock_xp );
-
-    // unlink the alarm from the core list
-    list_remote_unlink( tgt_cxy , &tgt_ptr->alarm.list );
-
-    // update the alarm date and state
-    hal_remote_s64( XPTR( tgt_cxy , &tgt_ptr->alarm.date   ) , new_date );
-    hal_remote_s32( XPTR( tgt_cxy , &tgt_ptr->alarm.linked ) , true );
-
-    // register alarm in core list
-    alarm_register( tgt_cxy , &tgt_ptr->alarm , core );
-    
-    // release the lock
-    remote_busylock_release( lock_xp );
-
-}  // end alarm_update()
-
-
Index: trunk/kernel/kern/alarm.h
===================================================================
--- trunk/kernel/kern/alarm.h	(revision 690)
+++ 	(revision )
@@ -1,125 +1,0 @@
-/*
- * alarm.h - timer based kernel alarm specification            
- *
- * Author     Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#ifndef _ALARM_H_
-#define _ALARM_H_
-
-#include <hal_kernel_types.h>
-#include <list.h>
-
-/****  Forward declarations  ****/
-
-struct  thread_s;
-
-/******************************************************************************************
- *   This structure defines a generic, timer based, kernel alarm.
- *
- * - An alarm is attached to a given thread, and the alarm descriptor is embedded in the
- *   thread descriptor. A client thread can use the alarm_start() function to dynamically
- *   activate the alarm. It can use the alarm_stop() function to desactivate this alarm.
- * - This kernel alarm is generic, as the alarm handler (executed when the alarm rings),
- *   and the handler arguments are defined by two pointers: <func_ptr> and <args_xp>.
- * - When an alarm is created by a client thread, it is registered in the list of alarms
- *   rooted in the core running the client thread. When it is stopped, the alarm is simply
- *   removed from this list.
- * - When creating an alarm with the alarm_start() function, the client thread must define
- *   an absolute date (in cycles), the func_ptr pointer, and the args_xp extended pointer.
- * - The list of alarms is ordered by increasing dates. At each TICK received by a core,
- *   the date of the first registered alarm is compared to the current date (in the 
- *   core_clock() function). The alarm handler is executed when current_date >= alarm_date.
- * - It is the handler responsability to stop and delete a ringing alarm using the
- *   alarm_stop() function, or update the alarm date using the alarm_update() function.  
- * - The three alarm_start(), alarm_stop(), and alarm_update() access functions use
- *   the lock protecting the alarms list to handle concurrent accesses. These functions
- *   use extended pointers to access the alarm list, and can be called by a thread
- *   running in any cluster.
- * 
- * This embedded alarm mechanism is used by:
- * 1. the socket_accept(), socket_connect(), socket_send(), socket_close() functions,
- *    to implement the TCP retransmission machanism.
- * 2. the sys_thread_sleep() function, to implement the "sleep" mechanism.
- ******************************************************************************************/
-
-typedef struct alarm_s
-{
-    bool_t         linked;         /*! active when true (i.e linked to the core list)     */
-    cycle_t        date;           /*! absolute date for handler execution                */
-    void         * func_ptr;       /*! local pointer on alarm handler function            */
-    xptr_t         args_xp;        /*! local pointer on handler arguments                 */
-    list_entry_t   list;           /*! set of active alarms attached to the same core     */
-}
-alarm_t;
-
-/*******************************************************************************************
- * This defines the generic prototype for an alarm handler.
- ******************************************************************************************/
-
-typedef void (alarm_handler_t) ( xptr_t args_xp );
-
-/*******************************************************************************************
- * This function initialises the alarm state to "inactive".
- *******************************************************************************************
- * @ alarm     : local pointer on alarm.
- ******************************************************************************************/
-void alarm_init( alarm_t *  alarm );
-
-/*******************************************************************************************
- * This function initializes the alarm descriptor embedded in the thread identified by the
- * <thread_xp> argument from the <date>, <func_ptr>, <args_ptr> arguments, and registers
- * this alarm in the ordered list rooted in the core running this thread.
- * It takes the lock protecting the alarms list against concurrent accesses.
- *******************************************************************************************
- * @ thread_xp  : extended pointer on the target thread.
- * @ date       : absolute date (in cycles).
- * @ func_ptr   : local pointer on the handler to execute when the alarm rings.
- * @ args_xp    : extended pointer on the handler arguments.
- ******************************************************************************************/
-void alarm_start( xptr_t    thread_xp, 
-                  cycle_t   date,
-                  void    * func_ptr,
-                  xptr_t    args_xp );
-
-/*******************************************************************************************
- * This function updates the date of the alarm attached to the thread identified by the
- * <thread> argument. The list of alarms rooted in the core running the client thread 
- * is modified to respect the absolute dates ordering.
- * It takes the lock protecting the alarms list against concurrent accesses.
- *******************************************************************************************
- * @ thread_xp  : extended pointer on the target thread.
- * @ new_date   : absolute new date (in cycles).
- ******************************************************************************************/
-void alarm_update( xptr_t     thread_xp,
-                   cycle_t    new_date );
-
-/*******************************************************************************************
- * This function unlink an alarm identified by the <thread> argument from the list of
- * alarms rooted in the core descriptor.
- * It takes the lock protecting the alarms list against concurrent accesses.
- *******************************************************************************************
- * @ thread_xp  : extended pointer on the target thread.
- ******************************************************************************************/
-void alarm_stop( xptr_t    thread_xp );
-
-
-#endif	/* _ALARM_H_ */
Index: trunk/kernel/kern/blkio.c
===================================================================
--- trunk/kernel/kern/blkio.c	(revision 1)
+++ trunk/kernel/kern/blkio.c	(revision 1)
@@ -0,0 +1,259 @@
+/*
+ * blkio.c - provides per-page buffers I/O
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <cpu.h>
+#include <errno.h>
+#include <scheduler.h>
+#include <kmem.h>
+#include <thread.h>
+#include <device.h>
+#include <driver.h>
+#include <event.h>
+#include <atomic.h>
+#include <cluster.h>
+#include <page.h>
+#include <blkio.h>
+
+static EVENT_HANDLER(blkio_async)
+{
+	struct blkio_s *blkio;
+	struct blkio_s *info;
+	struct page_s *page;
+	struct thread_s *thread;
+	error_t err;
+	uint_t irq_state;
+
+	blkio = event_get_argument(event);
+	page  = blkio->b_page;
+	info  = list_head(&page->root, struct blkio_s, b_list);
+	err   = event_get_error(event);
+
+	if(err)
+	{
+		printk(WARNING, "WARNING: %s: Requested I/O is failed, blk %d\n", 
+		       __FUNCTION__, 
+		       blkio->b_dev_rq.src);
+	}
+
+	err = (err) ? 1 : 0;
+
+	spinlock_lock_noirq(&info->b_ctrl.lock, &irq_state);
+
+	info->b_ctrl.cntr ++;
+	info->b_ctrl.error = (info->b_ctrl.error) ? 1 : err;
+
+	if(info->b_ctrl.cntr == info->b_ctrl.count) 
+	{
+		thread = wakeup_one(&info->b_ctrl.wait, WAIT_ANY);
+
+#if CONFIG_BLKIO_DEBUG    
+		if(thread != NULL)
+		{
+			printk(INFO, "%s: cpu %d, wakeup tid %d on cpu %d [%u]\n",
+			       __FUNCTION__,
+			       cpu_get_id(),
+			       thread->info.order,
+			       thread_current_cpu(thread)->gid,
+			       cpu_time_stamp());
+		}
+#endif
+	}
+
+	spinlock_unlock_noirq(&info->b_ctrl.lock, irq_state);
+	return 0;
+}
+
+static void blkio_ctor(struct kcm_s *kcm, void *ptr) 
+{
+	struct blkio_s *blkio = (struct blkio_s *)ptr;
+
+	spinlock_init(&blkio->b_ctrl.lock, "BlkIO");
+	event_set_handler(&blkio->b_dev_rq.event, blkio_async);
+	event_set_priority(&blkio->b_dev_rq.event, E_BLK);
+	event_set_argument(&blkio->b_dev_rq.event, blkio);
+	wait_queue_init(&blkio->b_ctrl.wait, "BLKIO Sync");
+}
+
+KMEM_OBJATTR_INIT(blkio_kmem_init)
+{
+	attr->type = KMEM_BLKIO;
+	attr->name = "KCM BLKIO";
+	attr->size = sizeof(struct blkio_s);
+	attr->aligne = 0;
+	attr->min = CONFIG_BLKIO_MIN;
+	attr->max = CONFIG_BLKIO_MAX;
+	attr->ctor = blkio_ctor;
+	attr->dtor = NULL;
+	return 0;
+}
+
+///////////////////////////////////
+error_t blkio_init( device_t * dev,
+                    page_t   * page,
+                    uint32_t   count ) 
+{
+	kmem_req_t req;
+	struct blkio_s *blkio;
+	uint_t blkio_nr;
+
+	req.type  = KMEM_BLKIO;
+	req.size  = sizeof(*blkio);
+	req.flags = AF_KERNEL;
+  
+	slist_root_init(&page->root);
+	blkio_nr = count;
+
+#if CONFIG_BLKIO_DEBUG    
+	printk(INFO, "%s: cpu %d, count %d, pg @0x%x, index %d [%d]\n",
+	       __FUNCTION__, 
+	       cpu_get_id(),
+	       count, 
+	       page, 
+	       page->index,
+	       cpu_time_stamp());
+#endif
+
+	while(count)
+	{
+		if((blkio = kmem_alloc(&req)) == NULL) 
+		{
+			blkio_destroy(page);
+			return ENOMEM;
+		}
+    
+		blkio->b_flags = 0;
+		blkio->b_page  = page;
+		blkio->b_dev   = dev;
+
+		list_push(&page->root, &blkio->b_list);
+		count -= 1;
+	}
+
+	blkio = list_head(&page->root, struct blkio_s, b_list);
+
+	blkio->b_ctrl.count = blkio_nr;
+	blkio->b_ctrl.cntr  = 0;
+	blkio->b_ctrl.error = 0;
+
+	PAGE_SET(page, PG_BUFFER);
+	return 0;
+}  // end blkio_init()
+
+
+////////////////////////////////////
+error_t blkio_sync( page_t   * page,
+                    uint32_t   flags ) 
+{
+	slist_entry_t    * iter;
+	blkio_t          * blkio;
+	blkio_t          * info;
+	device_request_t * handler;
+	error_t            err;
+	uint32_t           irq_state;
+	uint32_t           cntr;
+
+	info = list_head(&page->root, struct blkio_s, b_list);
+	handler = (flags & BLKIO_RD) ? info->b_dev->op.dev.read : info->b_dev->op.dev.write;
+	cntr =  0;
+	err =  0;
+
+	list_foreach(&page->root, iter) 
+	{
+		blkio = list_element(iter, struct blkio_s, b_list);
+
+		if(blkio->b_flags & BLKIO_INIT)
+		{
+			blkio->b_flags &= ~BLKIO_INIT;
+			continue;
+		}
+
+		blkio->b_dev_rq.flags = DEV_RQ_NOBLOCK;
+
+#if CONFIG_BLKIO_DEBUG  
+		printk(INFO, "%s: cpu %d, Submitting blkio #%d, src %d, dst %x [%d]\n",
+		       __FUNCTION__, 
+		       cpu_get_id(),
+		       cntr, 
+		       blkio->b_dev_rq.src, 
+		       blkio->b_dev_rq.dst, 
+		       cpu_time_stamp());
+#endif
+
+		err = handler(blkio->b_dev, &blkio->b_dev_rq);
+    
+		if(err < 0) 
+		{
+			err = EIO;
+			break;
+		}
+
+		cntr ++;
+	}
+
+	if(flags & BLKIO_SYNC) 
+	{
+		spinlock_lock_noirq(&info->b_ctrl.lock, &irq_state);
+    
+		info->b_ctrl.cntr += (info->b_ctrl.count - cntr);
+
+		if(info->b_ctrl.cntr < info->b_ctrl.count) 
+		{
+			wait_on(&info->b_ctrl.wait, WAIT_ANY);
+			spinlock_unlock_noirq(&info->b_ctrl.lock, irq_state);
+			sched_sleep(CURRENT_THREAD);
+
+#if CONFIG_BLKIO_DEBUG
+			printk(INFO, "%s: cpu %d, tid %d, blkio ended, err %d\n",
+			       __FUNCTION__, 
+			       cpu_get_id(), 
+			       CURRENT_THREAD->info.order, 
+			       info->b_ctrl.error);
+#endif
+
+		}
+		else
+			spinlock_unlock_noirq(&info->b_ctrl.lock, irq_state);
+
+		return (info->b_ctrl.error) ? EIO : 0;
+	}
+
+	return err;
+}
+
+//////////////////////////////////////////
+error_t blkio_destroy(struct page_s *page) 
+{
+	kmem_req_t req;
+	struct slist_entry *iter;
+
+	req.type = KMEM_BLKIO;
+
+	list_foreach(&page->root, iter) 
+	{
+		req.ptr = list_element(iter, struct blkio_s, b_list);
+		kmem_free(&req);
+	}
+
+	page->private = 0;
+	PAGE_CLEAR(page, PG_BUFFER);
+	return 0;
+}
Index: trunk/kernel/kern/blkio.h
===================================================================
--- trunk/kernel/kern/blkio.h	(revision 1)
+++ trunk/kernel/kern/blkio.h	(revision 1)
@@ -0,0 +1,100 @@
+/*
+ * kern/blkio.c - Per-page buffers I/O interface
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef BLKIO_H_
+#define BLKIO_H_
+
+#include <list.h>
+
+#define BLKIO_RD        0x01
+#define BLKIO_SYNC      0x02
+
+#define BLKIO_INIT      0x01
+
+#include <page.h>
+#include <device.h>
+#include <list.h>
+
+/******************************************************************************************
+ *****************************************************************************************/
+typedef struct blkio_s 
+{
+	uint32_t            b_flags;        // BLKIO_INIT
+
+	struct
+	{
+		spinlock_t		    lock;		
+		uint16_t            count;	
+		uint16_t            cntr;	        
+		error_t             error;	
+		struct wait_queue_s wait;
+
+	}                     b_ctrl;         // Only used in head-blkio
+
+	dev_request_t       b_dev_rq;	// request for the block device
+	page_t         *    b_page;		// buffer page descriptor
+	device_t       *    b_dev;		// block device
+	slist_entry_t       b_list;	    // next buffer in this page
+	void           *	b_private;	// data for the I/O completion method
+}
+blkio_t;
+
+/**
+ * Macro to set a blkio to be skiped while first sync  
+ * 
+ * @b          pointer to blkio
+ */
+#define blkio_set_initial(b)			\
+	do{(b)->b_flags |= BLKIO_INIT;}while(0)
+
+KMEM_OBJATTR_INIT(blkio_kmem_init);
+
+/******************************************************************************************
+ * Initializes the blkio structure.
+ ******************************************************************************************
+ * @ dev    : pointer on block device.
+ * @ page   : buffer page to get blkio structures initialized
+ * @ count  : number of blocks in the page
+ * @ return	error code, 0 if OK
+ *****************************************************************************************/
+error_t blkio_init( device_t * dev,
+                    page_t   * page,
+                    uint32_t   count );
+
+/**
+ * Synchronizes all the buffers in a buffer page.
+ *
+ * @page	buffer page to be synced with the disk
+ * @flags	blkio flags
+ * @return	error code, 0 if OK
+ */
+error_t blkio_sync(struct page_s *page, uint_t flags);
+
+/**
+ * Destroys the blkio structures for a buffer page.
+ *
+ * @page	buffer page to have its blkio structures destroyed
+ * @return	error code, 0 if OK
+ */
+error_t blkio_destroy(struct page_s *page);
+
+#endif /* BLKIO_H_ */
Index: trunk/kernel/kern/chdev.c
===================================================================
--- trunk/kernel/kern/chdev.c	(revision 690)
+++ 	(revision )
@@ -1,630 +1,0 @@
-/*
- * chdev.c - channel device API implementation.
- *
- * Authors  Alain Greiner   (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH.is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH.is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <hal_remote.h>
-#include <hal_irqmask.h>
-#include <printk.h>
-#include <boot_info.h>
-#include <xlist.h>
-#include <kmem.h>
-#include <scheduler.h>
-#include <thread.h>
-#include <rpc.h>
-#include <chdev.h>
-#include <devfs.h>
-
-//////////////////////////////////////////////////////////////////////////////////////
-// Extern global variables
-//////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t    chdev_dir;         // allocated in kernel_init.c
-
-
-#if (DEBUG_SYS_READ & 1)
-extern uint32_t enter_chdev_cmd_read;
-extern uint32_t exit_chdev_cmd_read;
-extern uint32_t enter_chdev_server_read;
-extern uint32_t exit_chdev_server_read;
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-extern uint32_t enter_chdev_cmd_write;
-extern uint32_t exit_chdev_cmd_write;
-extern uint32_t enter_chdev_server_write;
-extern uint32_t exit_chdev_server_write;
-#endif
-
-////////////////////////////////////////////
-char * chdev_func_str( uint32_t func_type ) 
-{
-    switch ( func_type ) 
-    {
-        case DEV_FUNC_RAM: return "RAM";
-        case DEV_FUNC_ROM: return "ROM";
-        case DEV_FUNC_FBF: return "FBF";
-        case DEV_FUNC_IOB: return "IOB";
-        case DEV_FUNC_IOC: return "IOC";
-        case DEV_FUNC_MMC: return "MMC";
-        case DEV_FUNC_DMA: return "DMA";
-        case DEV_FUNC_NIC: return "NIC";
-        case DEV_FUNC_TIM: return "TIM";
-        case DEV_FUNC_TXT: return "TXT";
-        case DEV_FUNC_ICU: return "ICU";
-        case DEV_FUNC_PIC: return "PIC";
-        default:           return "undefined";
-    }
-}
-
-/////////////////////////////////////////
-chdev_t * chdev_create( uint32_t    func,
-                        uint32_t    impl,
-                        uint32_t    channel,
-                        uint32_t    is_rx,
-                        xptr_t      base )
-{
-    chdev_t    * chdev;
-
-    // allocate memory for chdev
-    chdev = kmem_alloc( bits_log2(sizeof(chdev_t)) , AF_ZERO | AF_KERNEL );
-
-    if( chdev == NULL ) return NULL;
-
-    // initialize lock
-    remote_busylock_init( XPTR( local_cxy , &chdev->wait_lock ), LOCK_CHDEV_QUEUE );
-
-    // initialise waiting queue
-    xlist_root_init( XPTR( local_cxy , &chdev->wait_root ) );
-
-    // initialize attributes
-    chdev->func    =  func;
-    chdev->impl    =  impl;
-    chdev->channel =  channel;
-    chdev->is_rx   =  is_rx;
-    chdev->base    =  base; 
-
-    return chdev;
-
-}  // end chdev_create()
-
-/////////////////////////////////////
-void chdev_display( xptr_t chdev_xp )
-{
-    chdev_t * chdev = GET_PTR( chdev_xp );
-    cxy_t     cxy   = GET_CXY( chdev_xp );
-
-    char      name[16];
-
-    hal_remote_memcpy( XPTR( local_cxy, name ),
-                       XPTR( cxy , &chdev->name ), 16 );
-
-    printk("\n - chdev     = [%x,%x]"
-           "\n - name      = %s"
-           "\n - base      = [%x,%x]"
-           "\n - cmd       = %x"
-           "\n - isr       = %x\n",
-           cxy,
-           chdev,
-           name,
-           GET_CXY( hal_remote_l64( XPTR( cxy , &chdev->base ))),
-           GET_PTR( hal_remote_l64( XPTR( cxy , &chdev->base ))),
-           hal_remote_lpt( XPTR( cxy , &chdev->cmd )),
-           hal_remote_lpt( XPTR( cxy , &chdev->isr )) );
-
-}  // end chdev_display()
-
-//////////////////////////////////////////////////
-void chdev_register_command( xptr_t     chdev_xp )
-{
-    thread_t * server_ptr;    // local pointer on server thread associated to chdev
-    xptr_t     server_xp;     // extended pointer on server thread
-    core_t   * core_ptr;      // local pointer on core running the server thread
-    uint32_t   server_lid;    // core running the server thread local index
-    xptr_t     lock_xp;       // extended pointer on lock protecting the chdev state
-
-#if (DEBUG_SYS_READ & 1)
-enter_chdev_cmd_read = (uint32_t)hal_get_cycles();
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-enter_chdev_cmd_write = (uint32_t)hal_get_cycles();
-#endif
-
-    thread_t * this      = CURRENT_THREAD;
-    xptr_t     client_xp = XPTR( local_cxy , this );
-
-    // get chdev cluster and local pointer
-    cxy_t     chdev_cxy = GET_CXY( chdev_xp );
-    chdev_t * chdev_ptr = GET_PTR( chdev_xp );
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // get local and extended pointers on server thread
-    server_ptr = (thread_t *)hal_remote_lpt( XPTR( chdev_cxy , &chdev_ptr->server) );
-    server_xp  = XPTR( chdev_cxy , server_ptr );
-
-    // get local pointer on core running the server thread
-    core_ptr   = (core_t *)hal_remote_lpt( XPTR( chdev_cxy , &server_ptr->core ) );
-
-    // get server core local index
-    server_lid = hal_remote_l32( XPTR( chdev_cxy , &core_ptr->lid ) );
-
-#if (DEBUG_CHDEV_CMD_RX || DEBUG_CHDEV_CMD_TX)
-bool_t      is_rx        = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->is_rx ) );
-trdid_t     server_trdid = hal_remote_l32( XPTR( chdev_cxy , &server_ptr->trdid ) ); 
-process_t * process_ptr  = hal_remote_lpt( XPTR( chdev_cxy , &server_ptr->process ) );
-pid_t       server_pid   = hal_remote_l32( XPTR( chdev_cxy , &process_ptr->pid ) );
-#endif
-    
-#if DEBUG_CHDEV_CMD_RX
-uint32_t rx_cycle = (uint32_t)hal_get_cycles();
-if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
-printk("\n[%s] client thread[%x,%x] enter for RX / server[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, server_pid, server_trdid, rx_cycle );
-#endif
-
-#if DEBUG_CHDEV_CMD_TX
-uint32_t tx_cycle = (uint32_t)hal_get_cycles();
-if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
-printk("\n[%s] client thread[%x,%x] enter for TX / server[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, server_pid, server_trdid, tx_cycle );
-#endif
-
-    // build extended pointer on client thread xlist
-    xptr_t  list_xp    = XPTR( local_cxy , &this->wait_list );
-
-    // build extended pointer on chdev waiting queue root
-    xptr_t  root_xp    = XPTR( chdev_cxy , &chdev_ptr->wait_root );
-
-    // build extended pointer on lock protecting chdev waiting queue
-    lock_xp            = XPTR( chdev_cxy , &chdev_ptr->wait_lock );
-
-    // The following actions are executed in critical section,
-    // (because the busylock_acquire / busylock_release) 
-    // (1) take the lock protecting the waiting queue
-    // (2) register client thread in server queue 
-    // (3) unblock the server thread and block client thread
-    // (4) send IPI to force server scheduling
-    // (5) release the lock protecting waiting queue
-
-    // 1. take the lock protecting chdev queue
-    remote_busylock_acquire( lock_xp );
-
-    // 2. register client thread in waiting queue 
-    xlist_add_last( root_xp , list_xp );
-
-#if (DEBUG_CHDEV_CMD_TX & 1)
-if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
-printk("\n[%s] client thread[%x,%x] registered write request in chdev\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
- 
-#if (DEBUG_CHDEV_CMD_RX & 1)
-if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
-printk("\n[%s] client thread[%x,%x] registered read request in chdev\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
- 
-    // 3. client thread unblocks server thread and blocks itself
-    thread_unblock( server_xp , THREAD_BLOCKED_CLIENT );
-    thread_block( client_xp , THREAD_BLOCKED_IO );
-
-#if (DEBUG_CHDEV_CMD_TX & 1)
-if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
-printk("\n[%s] client thread[%x,%x] unblock server thread[%x,%x] and block itsef\n",
-__FUNCTION__, this->process->pid, this->trdid, server_pid, server_trdid );
-#endif
-
-#if (DEBUG_CHDEV_CMD_RX & 1)
-if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
-printk("\n[%s] client thread[%x,%x] unblock server thread[%x,%x] and block itsef\n",
-__FUNCTION__, this->process->pid, this->trdid, server_pid, server_trdid );
-#endif
-
-    // 4. send IPI to core running the server thread when server core != client core
-    if( (server_lid != this->core->lid) || (local_cxy != chdev_cxy) )
-    {
-        dev_pic_send_ipi( chdev_cxy , server_lid ); 
-
-#if (DEBUG_CHDEV_CMD_TX & 1)
-if( (is_rx == 0)  && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
-printk("\n[%s] client thread[%x,%x] sent IPI to TX server thread[%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, server_pid, server_trdid );
-#endif
-
-#if (DEBUG_CHDEV_CMD_RX & 1)
-if( (is_rx)  && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
-printk("\n[%s] client thread[%x,%x] sent IPI to RX server thread[%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, server_pid, server_trdid );
-#endif
-
-    }
- 
-    // 5. release lock protecting chdev queue
-    remote_busylock_release( lock_xp );
-
-    // deschedule
-    sched_yield("blocked on I/O");
-
-#if DEBUG_CHDEV_CMD_RX
-rx_cycle = (uint32_t)hal_get_cycles();
-if( (is_rx) && (DEBUG_CHDEV_CMD_RX < rx_cycle) )
-printk("\n[%s] client thread[%x,%x] exit for RX / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, rx_cycle );
-#endif
-
-#if DEBUG_CHDEV_CMD_TX
-tx_cycle = (uint32_t)hal_get_cycles();
-if( (is_rx == 0) && (DEBUG_CHDEV_CMD_TX < tx_cycle) )
-printk("\n[%s] client thread[%x,%x] exit for TX / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, tx_cycle );
-#endif
-
-#if (DEBUG_SYS_READ & 1)
-exit_chdev_cmd_read = (uint32_t)hal_get_cycles();
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-exit_chdev_cmd_write = (uint32_t)hal_get_cycles();
-#endif
-
-}  // end chdev_register_command()
-
-/////////////////////////////////////////
-void chdev_server_func( chdev_t * chdev )
-{
-    xptr_t          client_xp;    // extended pointer on waiting thread
-    cxy_t           client_cxy;   // cluster of client thread
-    thread_t      * client_ptr;   // local pointer on client thread
-    thread_t      * server;       // local pointer on server thread
-    xptr_t          root_xp;      // extended pointer on device waiting queue root
-    xptr_t          lock_xp;      // extended pointer on lock ptotecting chdev queue
-
-    server = CURRENT_THREAD;
-
-#if( DEBUG_CHDEV_SERVER_RX || DEBUG_CHDEV_SERVER_TX )
-uint32_t rx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
-printk("\n[%s] RX server thread[%x,%x] enter / channel %d / cycle %d\n",
-__FUNCTION__ , server->process->pid, server->trdid, chdev->channel, rx_cycle );
-#endif
-
-#if DEBUG_CHDEV_SERVER_TX
-uint32_t tx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
-printk("\n[%s] TX server thread[%x,%x] enter / channel %d / cycle %d\n",
-__FUNCTION__ , server->process->pid, server->trdid, chdev->channel, tx_cycle );
-#endif
-
-    // build extended pointer on root & lock of client threads queue
-    root_xp = XPTR( local_cxy , &chdev->wait_root );
-    lock_xp = XPTR( local_cxy , &chdev->wait_lock );
-
-	// This infinite loop is executed by the DEV thread
-    // to handle commands registered in the chdev queue.
-    while( 1 )
-    {
-        // check server thread can yield
-        thread_assert_can_yield( server , __FUNCTION__ );
-
-        // get the lock protecting the waiting queue
-        remote_busylock_acquire( lock_xp );
-
-        // check waiting queue state
-        if( xlist_is_empty( root_xp ) )                      // waiting queue empty 
-        {
-            // release lock protecting the waiting queue
-            remote_busylock_release( lock_xp );
-
-#if DEBUG_CHDEV_SERVER_RX
-rx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
-printk("\n[%s] RX server thread[%x,%x] blocks & deschedules / cycle %d\n",
-__FUNCTION__ , server->process->pid, server->trdid, rx_cycle );
-#endif
-
-#if DEBUG_CHDEV_SERVER_TX
-tx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
-printk("\n[%s] TX server thread[%x,%x] blocks & deschedules / cycle %d\n",
-__FUNCTION__ , server->process->pid, server->trdid, tx_cycle );
-#endif
-            // block and deschedule
-            thread_block( XPTR( local_cxy , server ) , THREAD_BLOCKED_CLIENT ); 
-            sched_yield("clients queue empty");
-
-#if DEBUG_CHDEV_SERVER_RX
-rx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
-printk("\n[%s] RX server thread[%x,%x] resumes / cycle %d\n",
-__FUNCTION__ , server->process->pid, server->trdid, rx_cycle );
-#endif
-
-#if DEBUG_CHDEV_SERVER_TX
-tx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
-printk("\n[%s] TX server thread[%x,%x] resumes / cycle %d\n",
-__FUNCTION__ , server->process->pid, server->trdid, tx_cycle );
-#endif
-
-        } 
-        else                                               // waiting queue not empty
-        {
-            // get pointers on first client thread
-            client_xp  = XLIST_FIRST( root_xp , thread_t , wait_list );
-            client_cxy = GET_CXY( client_xp );
-            client_ptr = GET_PTR( client_xp );
-
-            // remove this client thread from chdev waiting queue
-            xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) );
-
-            // release lock protecting the waiting queue
-            remote_busylock_release( lock_xp );
-
-#if( DEBUG_CHDEV_SERVER_TX || DEBUG_CHDEV_SERVER_RX )
-process_t * process      = hal_remote_lpt( XPTR( client_cxy , &client_ptr->process ) );
-pid_t       client_pid   = hal_remote_l32( XPTR( client_cxy , &process->pid ) );
-trdid_t     client_trdid = hal_remote_l32( XPTR( client_cxy , &client_ptr->trdid ) );
-#endif
-
-#if DEBUG_CHDEV_SERVER_RX
-rx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
-printk("\n[%s] server thread[%x,%x] get command from client thread[%x,%x] / cycle %d\n",
-__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, rx_cycle );
-#endif
-
-#if DEBUG_CHDEV_SERVER_TX
-tx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
-printk("\n[%s] server thread[%x,%x] get command from client thread[%x,%x] / cycle %d\n",
-__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, tx_cycle );
-#endif
-
-#if (DEBUG_SYS_READ & 1)
-enter_chdev_server_read = (uint32_t)hal_get_cycles();
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-enter_chdev_server_write = (uint32_t)hal_get_cycles();
-#endif
-
-            // call the (blocking) driver command function
-            // to launch I/O operation AND wait completion
-            chdev->cmd( client_xp );
-        
-            // unblock client thread when driver returns
-            thread_unblock( client_xp , THREAD_BLOCKED_IO );
-
-#if DEBUG_CHDEV_SERVER_RX
-rx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx) && (DEBUG_CHDEV_SERVER_RX < rx_cycle) )
-printk("\n[%s] thread[%x,%x] completes command for client thread[%x,%x] / cycle %d\n",
-__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, rx_cycle );
-#endif
-
-#if DEBUG_CHDEV_SERVER_TX
-tx_cycle = (uint32_t)hal_get_cycles();
-if( (chdev->is_rx == 0) && (DEBUG_CHDEV_SERVER_TX < tx_cycle) )
-printk("\n[%s] thread[%x,%x] completes command for client thread[%x,%x] / cycle %d\n",
-__FUNCTION__, server->process->pid, server->trdid, client_pid, client_trdid, tx_cycle );
-#endif
-
-#if (DEBUG_SYS_READ & 1)
-exit_chdev_server_read = (uint32_t)hal_get_cycles();
-#endif
-
-#if (DEBUG_SYS_WRITE & 1)
-exit_chdev_server_write = (uint32_t)hal_get_cycles();
-#endif
-
-        }
-    }  // end while
-}  // end chdev_server_func()
-
-////////////////////////////////////////
-xptr_t chdev_from_file( xptr_t file_xp )
-{
-    cxy_t         file_cxy;
-    vfs_file_t  * file_ptr;
-    uint32_t      inode_type;
-    vfs_inode_t * inode_ptr;
-    chdev_t     * chdev_ptr;
-
-assert( __FUNCTION__, (file_xp != XPTR_NULL) ,
-"file_xp == XPTR_NULL" );
-
-    // get cluster and local pointer on remote file descriptor
-    // associated inode and chdev are stored in same cluster as the file desc.
-    file_cxy  = GET_CXY( file_xp );
-    file_ptr  = (vfs_file_t *)GET_PTR( file_xp );
-
-    // get inode type from file descriptor
-    inode_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-    inode_ptr  = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
-
-assert( __FUNCTION__, (inode_type == FILE_TYPE_DEV) ,
-"inode type %d is not FILE_TYPE_DEV", inode_type );
-
-    // get chdev local pointer from inode extension
-    chdev_ptr = (chdev_t *)hal_remote_lpt( XPTR( file_cxy , &inode_ptr->extend ) );
-
-    return XPTR( file_cxy , chdev_ptr );
-
-}  // end chdev_from_file()
-
-//////////////////////////////
-void chdev_dir_display( void )
-{
-    uint32_t  i;
-    cxy_t     cxy;
-    chdev_t * ptr;
-    uint32_t  base;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on TXT0 lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-    // header
-    nolock_printk("\n***** external chdevs directory *****\n");
-
-    // IOB
-    if (chdev_dir.iob != XPTR_NULL )
-    {
-        cxy  = GET_CXY( chdev_dir.iob );
-        ptr  = GET_PTR( chdev_dir.iob );
-        base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-        nolock_printk("  - iob       : cxy = %X / ptr = %X / base = %X\n", cxy, ptr, base);
-    }
-
-    // PIC
-    cxy  = GET_CXY( chdev_dir.pic );
-    ptr  = GET_PTR( chdev_dir.pic );
-    base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-    nolock_printk("  - pic       : cxy = %X / ptr = %X / base = %X\n", cxy, ptr, base);
-
-    // TXT
-    for( i = 0 ; i < LOCAL_CLUSTER->nb_txt_channels ; i++ )
-    {
-        cxy = GET_CXY( chdev_dir.txt_rx[i] );
-        ptr = GET_PTR( chdev_dir.txt_rx[i] );
-        base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-        nolock_printk("  - txt_rx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
-
-        cxy = GET_CXY( chdev_dir.txt_tx[i] );
-        ptr = GET_PTR( chdev_dir.txt_tx[i] );
-        base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-        nolock_printk("  - txt_tx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
-    }
-
-    // IOC
-    for( i = 0 ; i < LOCAL_CLUSTER->nb_ioc_channels ; i++ )
-    {
-        cxy = GET_CXY( chdev_dir.ioc[i] );
-        ptr = GET_PTR( chdev_dir.ioc[i] );
-        base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-        nolock_printk("  - ioc[%d]    : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
-    }
-
-    // FBF
-    for( i = 0 ; i < LOCAL_CLUSTER->nb_fbf_channels ; i++ )
-    {
-        cxy  = GET_CXY( chdev_dir.fbf[i] );
-        ptr  = GET_PTR( chdev_dir.fbf[i] );
-        base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-        nolock_printk("  - fbf[%d]    : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
-    }
-
-    // NIC
-    for( i = 0 ; i < LOCAL_CLUSTER->nb_nic_channels ; i++ )
-    {
-        cxy = GET_CXY( chdev_dir.nic_rx[i] );
-        ptr = GET_PTR( chdev_dir.nic_rx[i] );
-        base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-        nolock_printk("  - nic_rx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
-
-        cxy = GET_CXY( chdev_dir.nic_tx[i] );
-        ptr = GET_PTR( chdev_dir.nic_tx[i] );
-        base = (uint32_t)hal_remote_l64( XPTR( cxy , &ptr->base ) );
-        nolock_printk("  - nic_tx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base);
-    }
-
-    // release lock
-    remote_busylock_release( lock_xp );
-
-}  // end chdev_dir_display()
-
-///////////////////////////////////////////
-void chdev_queue_display( xptr_t chdev_xp )
-{
-    cxy_t       chdev_cxy;          // chdev cluster
-    chdev_t   * chdev_ptr;          // chdev local pointer
-    xptr_t      root_xp;            // extended pointer on waiting queuue root
-    char        name[16];           // local copie of chdev name
-    xptr_t      iter_xp;            // extended pointer on xlist_t field in waiting thread
-    xptr_t      thread_xp;          // extended pointer on thread registered in queue
-    cxy_t       thread_cxy;         // cluster identifier for waiting thread
-    thread_t  * thread_ptr;         // local pointer on waiting thread
-    trdid_t     trdid;              // waiting thread identifier
-    process_t * process;            // waiting thread process descriptor
-    pid_t       pid;                // waiting thread process identifier
-
-    // get cluster and local pointer on chdev
-    chdev_cxy = GET_CXY( chdev_xp );
-    chdev_ptr = GET_PTR( chdev_xp );
-
-    // get extended pointer on root of requests queue
-    root_xp = XPTR( chdev_cxy , &chdev_ptr->wait_root );
-
-    // get chdev name
-    hal_remote_strcpy( XPTR( local_cxy , name ), XPTR( chdev_cxy , chdev_ptr->name ) );
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on TXT0 lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-    // check queue empty
-    if( xlist_is_empty( root_xp ) )
-    {
-        nolock_printk("\n***** Waiting queue empty for chdev %s\n", name ); 
-    }
-    else
-    {
-        nolock_printk("\n***** Waiting queue for chdev %s\n", name ); 
-
-        // scan the waiting queue
-        XLIST_FOREACH( root_xp , iter_xp )
-        {
-            thread_xp  = XLIST_ELEMENT( iter_xp , thread_t , wait_list );
-            thread_cxy = GET_CXY( thread_xp );
-            thread_ptr = GET_PTR( thread_xp );
-            trdid      = hal_remote_l32 ( XPTR( thread_cxy , &thread_ptr->trdid   ) );
-            process    = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-			pid        = hal_remote_l32 ( XPTR( thread_cxy , &process->pid        ) );
-
-            nolock_printk("- thread[%x,%x]\n", pid, trdid );
-        }
-    }
-
-    // release TXT0 lock 
-    remote_busylock_release( lock_xp );
-
-}  // end chdev_queue_display()
-
Index: trunk/kernel/kern/chdev.h
===================================================================
--- trunk/kernel/kern/chdev.h	(revision 690)
+++ 	(revision )
@@ -1,297 +1,0 @@
-/*
- * chdev.h - channel device (chdev) descriptor and API definition.
- * 
- * Authors  Alain Greiner    (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CHDEV_H_
-#define _CHDEV_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <xlist.h>
-#include <remote_busylock.h>
-#include <dev_iob.h>
-#include <dev_ioc.h>
-#include <dev_nic.h>
-#include <dev_pic.h>
-#include <dev_fbf.h>
-#include <dev_txt.h>
-
-/****************************************************************************************
- *       Channel Device descriptor definition
- *
- * This file defines the kernel representation of a generic (i.e. implementation
- * independant) Channel Device descriptor (in brief "chdev").
- * ALMOS-MKH supports multi-channels peripherals, and defines one separated chdev 
- * descriptor for each channel (and for each RX/TX direction for NIC and TXT devices).
- * Each chdev contains a trans-clusters waiting queue, registering the "client threads",
- * and an associated "server thread", handling these requests.
- * These descriptors are physically distributed on all clusters to minimize contention.
- * Therefore a given I/O operation involve generally three clusters:
- * - the client cluster, containing the client thread,
- * - the server cluster, containing the chdev and the server thread,
- * - the I/O cluster, containing the physical device.
- ***************************************************************************************/
-
-/****  Forward declarations  ****/
-
-struct  chdev_s;
-struct  thread_s;
-struct  boot_info_s;
-
-/****************************************************************************************
- * These macros extract functionality and  implementation from the peripheral type.
- ***************************************************************************************/
- 
-#define FUNC_FROM_TYPE( type )    ((uint32_t)(type>>16))
-#define IMPL_FROM_TYPE( type )    ((uint32_t)(type & 0x0000FFFF))
-
-/****************************************************************************************
- * This defines the generic prototypes for the functions that must be defined
- * by all drivers implementing a generic device:
- * - "cmd"     : start a blocking I/O operation.
- * - "isr"     : complete an I/O operation.
- * - "aux"     : not for all drivers (implement special functions)
- * The "cmd", "isr", and "aux" driver functions are registered in the generic chdev
- * descriptor at kernel init, and are called to start and complete an I/O operation.  
-***************************************************************************************/
-
-typedef void (dev_ini_t) ( xptr_t dev );      
-typedef void (dev_cmd_t) ( xptr_t thread );  
-typedef void (dev_isr_t) ( struct chdev_s * dev );  
-typedef void (dev_aux_t) ( void * args );  
-
-/****************************************************************************************
- * This enum defines the supported generic device types.
- * These types are functionnal types: all (architecture specific) implementations 
- * provide the same set of operations and the same driver API.
- * This enum must be consistent with the enum in files arch_info.h, and arch_class.py.
- *
- * WARNING : The ICU device exist in boot_info to specify the base address of the 
- *           distributed LAPIC controler, but it does not exist as a chdev in the kernel,
- *           as it is hidden in the driver associated to the PIC device.
- ***************************************************************************************/
- 
-enum dev_func_type 
-{
-	DEV_FUNC_RAM   =  0,
-	DEV_FUNC_ROM   =  1,
-	DEV_FUNC_FBF   =  2,
-    DEV_FUNC_IOB   =  3,
-    DEV_FUNC_IOC   =  4,
-	DEV_FUNC_MMC   =  5,
-	DEV_FUNC_DMA   =  6,
-	DEV_FUNC_NIC   =  7,
-	DEV_FUNC_TIM   =  8,
-	DEV_FUNC_TXT   =  9,
-    DEV_FUNC_ICU   = 10,    
-    DEV_FUNC_PIC   = 11,
-
-    DEV_FUNC_NR    = 12,
-};
-
-/******************************************************************************************
- * This structure defines a chdev (channel device) descriptor.
- * This structure is NOT replicated, and can be located in any cluster.
- * One server thread is in charge of handling the commands registered in the queue
- * of clients associated to each chdev descriptor.
- *
- * For each device type ***, the specific extension is defined in the "dev_***.h" file.
- *
- * NOTE . For most chdevs, the busylock is used to protect the waiting queue changes,
- *        when a client registers in this queue, or is removed after service.
- *      . This busylock is also used to protect direct access to the shared
- *        kernel TXT0 terminal, that does not use the waiting queue.
- *      . For most chdevs, the client waiting queue is a list of threads, but it is
- *        a list of sockets for the NIC chdevs. It is unused for ICU, PIC, and IOB.
- *****************************************************************************************/
-
-typedef struct chdev_s
-{
-	uint32_t             func;        /*! peripheral functionnal type                    */
-	uint32_t             impl;        /*! peripheral implementation type                 */
-    uint32_t             channel;     /*! channel index                                  */
-    bool_t               is_rx;       /*! relevant for NIC and TXT peripherals           */
-	xptr_t               base;        /*! extended pointer on channel device segment     */
-    char                 name[16];    /*! name (required by DEVFS)                       */
-
-    dev_cmd_t          * cmd;         /*! local pointer on driver CMD function           */
-    dev_isr_t          * isr;         /*! local pointer on driver ISR function           */
-    dev_aux_t          * aux;         /*! local pointer on driver AUX function           */
-
-    struct thread_s    * server;      /*! local pointer on associated server thread      */
-
-    uint32_t             irq_type;    /*! associated IRQ type in local ICU               */
-    uint32_t             irq_id;      /*! associated IRQ index in local ICU              */
-
-	xlist_entry_t        wait_root;   /*! root of clients waiting queue                  */
-    remote_busylock_t    wait_lock;   /*! lock protecting waiting queue                  */
-    uint32_t             wait_nr;     /*! number of registered clients (NIC only)        */
-
-    union
-    {
-        iob_extend_t     iob;         /*! IOB specific extension                         */
-        ioc_extend_t     ioc;         /*! IOC specific extension                         */
-        nic_extend_t     nic;         /*! NIC specific extension                         */
-        pic_extend_t     pic;         /*! PIC specific extension                         */
-        fbf_extend_t     fbf;         /*! FBF specific extension                         */
-        txt_extend_t     txt;         /*! TXT specific extension                         */
-    } 
-    ext;
-}
-chdev_t;
-
-/******************************************************************************************
- * This structure defines the channel_devices descriptors directory.
- * Each entry in this structure contains an extended pointer on a chdev descriptor.
- * There is one entry per channel OR per cluster, depending on peripheral type.
- * This structure is replicated in each cluster, and is initialised during kernel init.
- * It is used for fast access to a device descriptor, from type and channel for an
- * external peripheral, or from type and cluster for an internal peripheral.
- * - a "shared" chdev can be accessed by any thread running in any cluster.
- * - a "private" chdev can only be accessed by a thread running in local cluster.
- *****************************************************************************************/
-
-typedef struct chdev_directory_s
-{
-    xptr_t   iob;                                // external / single channel / shared
-    xptr_t   pic;                                // external / single channel / shared
-
-    xptr_t   ioc[CONFIG_MAX_IOC_CHANNELS];       // external / multi-channels / shared
-    xptr_t   fbf[CONFIG_MAX_FBF_CHANNELS];       // external / multi-channels / shared
-    xptr_t   txt_rx[CONFIG_MAX_TXT_CHANNELS];    // external / multi-channels / shared
-    xptr_t   txt_tx[CONFIG_MAX_TXT_CHANNELS];    // external / multi-channels / shared
-    xptr_t   nic_rx[CONFIG_MAX_NIC_CHANNELS];    // external / multi-channels / shared
-    xptr_t   nic_tx[CONFIG_MAX_NIC_CHANNELS];    // external / multi-channels / shared
-
-    xptr_t   mmc[CONFIG_MAX_CLUSTERS];           // internal / single channel / shared
-
-    xptr_t   dma[CONFIG_MAX_DMA_CHANNELS];       // internal / multi-channels / private
-}
-chdev_directory_t;
-
-/****************************************************************************************
- * This function returns a printable string for a device functionnal types.
- ****************************************************************************************
- * @ func_type  : functionnal type.
- * @ return pointer on string.
- ***************************************************************************************/
-char * chdev_func_str( uint32_t func_type );
-
-/****************************************************************************************
- * This  function allocates memory and initializes a chdev descriptor in local cluster,
- * from arguments values.  It should be called by a local thread. 
- * The device specific fields are initialised later.
- ****************************************************************************************
- * @ func      : functionnal type.
- * @ impl      : implementation type.
- * @ channel   : channel index / for multi-channels peripherals.
- * @ is_rx     : for NIC peripheral / NIC RX if true / NIC TX if false.
- * @ base      : extended pointer on peripheral segment base.
- * @ return a local pointer on created chdev / return NULL if failure.
- ***************************************************************************************/
-chdev_t * chdev_create( uint32_t    func,
-                        uint32_t    impl,
-                        uint32_t    channel,
-                        bool_t      is_rx,
-                        xptr_t      base );
-
-/****************************************************************************************
- * This generic function is executed by an user thread requesting an IOC or TXT chdev
- * service. It registers the calling thread in the waiting queue of a the remote
- * chdev descriptor identified by the <chdev_xp> argument.
- * It activates (i.e. unblocks) the server thread associated to chdev, blocks itself,
- * and deschedule.  It is supposed to be re-activated by the server thread. 
- * It can be called by a thread running in any cluster.
- * It cannot be used for a NIC or FBF chdev, because it is only convenient for one shot
- * I/O operations, as the server thread removes the client thread from the waiting
- * queue when it starts to execute the command.
- ****************************************************************************************
- * Implementation Note:
- * The following actions are executed in a critical section, thanks to the
- * busylock_acquire / busylock_release mechanism :
- * 1) it takes the lock protecting the waiting queue.
- * 2) it registers client thread in the server queue. 
- * 3) it unblocks the server thread from the THREAD_BLOCKED_CLIENT condition.
- * 4) it blocks the client thread on the THREAD_BLOCKED_IO condition.
- * 5) it send an IPI to the core running the server thread to force scheduling.
- * 6) it releases the lock protecting waiting queue.
- * 7) it deschedules.
- ****************************************************************************************
- * @ chdev_xp  : extended pointer on remote chdev descriptor.
- ***************************************************************************************/
-void chdev_register_command( xptr_t chdev_xp );
-
-/****************************************************************************************
- * This generic function is executed by the server thread associated to an IOC or TXT
- * chdev identified by the <chdev> argument, to execute all commands registered in the
- * waiting queue attached to this chev. 
- * When the clients queue is empty, the server thread blocks on the THREAD_BLOCKED_CLIENT
- * condition and deschedules. It is supposed to be re-activated by a client thread 
- * registering a new command.
- * It cannot be used for a NIC or FBF chdev, because it is only convenient for one shot
- * I/O operations, as the server thread removes the client thread from the waiting
- * queue when it starts to execute the command.
- ****************************************************************************************
- * Implementation Note:
- * All driver CMD functions are supposed to be blocking, and return only when the command
- * is completed. These functions can use either a busy waiting policy, or a descheduling
- * policy, blocking on the THREAD_BLOCKED_ISR condition. In the descheduling scenario,
- * the server thread is supposed to be reactivated by the ISR attached to the hardware
- * interrupts signaling command completion.
- ****************************************************************************************
- * @ chdev   : local pointer on device descriptor.
- ***************************************************************************************/
-void chdev_server_func( chdev_t * chdev );
-
-/****************************************************************************************
- * This function returns an extended pointer on the chdev associated to a pseudo file
- * descriptor (type FILE_TYPE_DEV) identified by the <file_xp> argument.
- * It can be called by a thread running in any cluster.
- * It enters kernel panic if the inode has not the expected type.
- ****************************************************************************************
- * @ file_xp   : extended pointer on the pseudo file descriptor.
- * @ return an extended pointer on chdev.
- ***************************************************************************************/
-xptr_t chdev_from_file( xptr_t file_xp );
-
-/****************************************************************************************
- * This function display relevant values for a remote chdev descriptor.
- ****************************************************************************************
- * @ chdev_xp   : pointer on chdev.
- ***************************************************************************************/
-void chdev_display( xptr_t chdev_xp );
-
-/****************************************************************************************
- * This function displays the local copy of the external chdevs directory.
- * (global variable replicated in all clusters)
- ***************************************************************************************/
-void chdev_dir_display( void );
-
-/****************************************************************************************
- * This function displays the list of threads registered in the queue associated
- * to the chdev identified by the <chdev_xp>. 
- ****************************************************************************************
- * # root_xp  : extended pointer
- ***************************************************************************************/
-void chdev_queue_display( xptr_t chdev_xp );
-
-#endif	/* _CHDEV_H_ */
Index: trunk/kernel/kern/cluster.c
===================================================================
--- trunk/kernel/kern/cluster.c	(revision 690)
+++ trunk/kernel/kern/cluster.c	(revision 1)
@@ -1,8 +1,8 @@
 /*
  * cluster.c - Cluster-Manager related operations
- *
- * Author  Ghassan Almaless       (2008,2009,2010,2011,2012)
+ * 
+ * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
  *         Mohamed Lamine Karaoui (2015)
- *         Alain Greiner          (2016,2017,2018,2019,2020)
+ *         Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -24,19 +24,16 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_atomic.h>
 #include <hal_special.h>
-#include <hal_ppm.h>
-#include <hal_macros.h>
-#include <remote_fifo.h>
 #include <printk.h>
 #include <errno.h>
-#include <queuelock.h>
+#include <spinlock.h>
 #include <core.h>
-#include <chdev.h>
 #include <scheduler.h>
 #include <list.h>
 #include <cluster.h>
+#include <sysfs.h>
 #include <boot_info.h>
 #include <bits.h>
@@ -47,26 +44,28 @@
 #include <dqdt.h>
 
-/////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////////
 // Extern global variables
-/////////////////////////////////////////////////////////////////////////////////////
-
-extern process_t           process_zero;     // allocated in kernel_init.c
-extern chdev_directory_t   chdev_dir;        // allocated in kernel_init.c
-
-
-
-///////////////////////////////////////////////////
-void cluster_info_init( struct boot_info_s * info )
-{
-    boot_device_t * dev;      // pointer on external peripheral
-    uint32_t        func;     // external peripheral functionnal type
-    uint32_t        x;
-    uint32_t        y;
-    uint32_t        i;   
+///////////////////////////////////////////////////////////////////////////////////////////
+
+process_t process_zero;
+
+
+
+//////////////////////////////////
+void cluster_sysfs_register(void)
+{
+	// TODO
+}
+
+/////////////////////////////////////////////////
+error_t cluster_init( struct boot_info_s * info )
+{
+    lpid_t      lpid;     // local process_index
+    lid_t       lid;      // local core index
 
 	cluster_t * cluster = LOCAL_CLUSTER;
 
     // initialize cluster global parameters
-	cluster->paddr_width     = info->paddr_width;
+	cluster->paddr_width     = info->paddr_width; 
 	cluster->x_width         = info->x_width;
 	cluster->y_width         = info->y_width;
@@ -74,122 +73,34 @@
 	cluster->y_size          = info->y_size;
 	cluster->io_cxy          = info->io_cxy;
-	cluster->sys_clk         = info->sys_clk;
-
-    // initialize the cluster_info[][] array
-    for( x = 0 ; x < CONFIG_MAX_CLUSTERS_X ; x++ ) 
-    {
-        for( y = 0; y < CONFIG_MAX_CLUSTERS_Y ; y++ ) 
-        {
-            cluster->cluster_info[x][y] = info->cluster_info[x][y];
-        }
-    }
-
-    // initialize external peripherals channels
-    for( i = 0 ; i < info->ext_dev_nr ; i++ )
-    {
-        dev  = &info->ext_dev[i];
-        func = FUNC_FROM_TYPE( dev->type );   
-        if( func == DEV_FUNC_TXT ) cluster->nb_txt_channels = dev->channels;
-        if( func == DEV_FUNC_NIC ) cluster->nb_nic_channels = dev->channels;
-        if( func == DEV_FUNC_IOC ) cluster->nb_ioc_channels = dev->channels;
-        if( func == DEV_FUNC_FBF ) cluster->nb_fbf_channels = dev->channels;
-    }
-
-    // initialize number of local cores
-	cluster->cores_nr  = info->cores_nr;
-
-}  // end cluster_info_init()
-
-//////////////////////////////////////
-void cluster_info_display( cxy_t cxy )
-{
-    uint32_t  x;
-    uint32_t  y;
-    uint32_t  ncores;
-
-    cluster_t * cluster = LOCAL_CLUSTER;
-
-    // get x_size & y_size from target cluster
-    uint32_t  x_size = hal_remote_l32( XPTR( cxy , &cluster->x_size ) );
-    uint32_t  y_size = hal_remote_l32( XPTR( cxy , &cluster->y_size ) );
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-    nolock_printk("\n***** cluster_info in cluster %x / x_size %d / y_size %d\n",
-    cxy, x_size, y_size );
+
+    // initialize cluster local parameters
+	cluster->cores_nr        = info->cores_nr;
+    cluster->cores_in_kernel = info->cores_nr;   // all cpus start in kernel mode
+
+    // initialize kcm lock
+	spinlock_init( &cluster->kcm_lock );
+
+    // initialize txt0 lock
+	remote_spinlock_init( XPTR( local_cxy , &cluster->txt0_lock ) );
+
+    // initialises DQDT 
+    cluster->dqdt_root_level = dqdt_init( info->x_size, 
+                                          info->y_size, 
+                                          info->y_width );
+    cluster->threads_var = 0;
+    cluster->pages_var   = 0;
+
+    // initialises embedded PPM
+	ppm_init( &cluster->ppm,
+              info->pages_nr,
+              info->pages_offset );
+
+    // initialises embedded KHM
+	khm_init( &cluster->khm );
   
-    for( x = 0 ; x < x_size ; x++ )
-    {
-        for( y = 0 ; y < y_size ; y++ )
-        {
-            ncores = (uint32_t)hal_remote_lb( XPTR( cxy , &cluster->cluster_info[x][y] ) );
-            nolock_printk(" - ncores[%d][%d] = %d\n", x, y, ncores );
-        }
-    }
-
-    // release TXT0 lock
-    remote_busylock_release( lock_xp );
-
-}  // end cluster_info_display()
-
-/////////////////////////////////////////////////////////
-error_t cluster_manager_init( struct boot_info_s * info )
-{
-    error_t         error;
-    lpid_t          lpid;     // local process_index
-    lid_t           lid;      // local core index
-
-	cluster_t * cluster = LOCAL_CLUSTER;
-
-#if DEBUG_CLUSTER_INIT
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_CLUSTER_INIT < cycle )
-printk("\n[%s] thread[%x,%x] enters for cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy , cycle );
-#endif
-
-#if (DEBUG_CLUSTER_INIT & 1)
-cluster_info_display( local_cxy );
-#endif
-
-    // initialises embedded PPM
-	error = hal_ppm_init( info );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot initialize PPM in cluster %x\n",
-               __FUNCTION__ , local_cxy );
-        return ENOMEM;
-    }
-
-#if( DEBUG_CLUSTER_INIT & 1 )
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_INIT < cycle )
-printk("\n[%s] PPM initialized in cluster %x / cycle %d\n",
-__FUNCTION__ , local_cxy , cycle );
-#endif
-
-    // initialises embedded KCM
-    uint32_t  i;
-    for( i = 0 ; i < 6 ; i++ ) kcm_init( &cluster->kcm[i] , i+6 );
-
-#if( DEBUG_CLUSTER_INIT & 1 )
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_INIT < cycle )
-printk("\n[%s] KCM[6:11] initialized in cluster %x at cycle %d\n",
-__FUNCTION__ , local_cxy , hal_get_cycles() );
-#endif
-
-    // initialises all cores descriptors 
+    // initialises embedded KCM 
+	kcm_init( &cluster->kcm , KMEM_KCM ); 
+
+    // initialises cores
 	for( lid = 0 ; lid < cluster->cores_nr; lid++ )
 	{
@@ -198,31 +109,13 @@
 	               info->core[lid].gid );      // gid from boot_info_t
 	}
-
-#if( DEBUG_CLUSTER_INIT & 1 )
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_INIT < cycle )
-printk("\n[%s] cores initialized in cluster %x / cycle %d\n",
-__FUNCTION__ , local_cxy , cycle );
-#endif
-
-    // initialises RPC FIFOs
-	for( lid = 0 ; lid < cluster->cores_nr; lid++ )
-    {
-	    remote_fifo_init( &cluster->rpc_fifo[lid] );
-        cluster->rpc_threads[lid] = 0;
-    }
-
-#if( DEBUG_CLUSTER_INIT & 1 )
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_INIT < cycle )
-printk("\n[%s] RPC fifo inialized in cluster %x at cycle %d\n",
-__FUNCTION__ , local_cxy , hal_get_cycles() );
-#endif
+	
+    // initialises RPC fifo
+	rpc_fifo_init( &cluster->rpc_fifo );
 
     // initialise pref_tbl[] in process manager
-	queuelock_init( &cluster->pmgr.pref_lock , LOCK_CLUSTER_PREFTBL );
+	spinlock_init( &cluster->pmgr.pref_lock );
     cluster->pmgr.pref_nr = 0;
-    cluster->pmgr.pref_tbl[0] = XPTR( local_cxy , &process_zero );
-    for( lpid = 0 ; lpid < CONFIG_MAX_PROCESS_PER_CLUSTER ; lpid++ )
+    cluster->pmgr.pref_tbl[0] = XPTR( local_cxy , &process_zero );   
+    for( lpid = 1 ; lpid < CONFIG_MAX_PROCESS_PER_CLUSTER ; lpid++ )
     {
         cluster->pmgr.pref_tbl[lpid] = XPTR_NULL;
@@ -230,60 +123,39 @@
 
     // initialise local_list in process manager
-    xlist_root_init( XPTR( local_cxy , &cluster->pmgr.local_root ) );
+	spinlock_init( &cluster->pmgr.local_lock );
+    list_root_init( &cluster->pmgr.local_root );
     cluster->pmgr.local_nr = 0;
-	remote_queuelock_init( XPTR( local_cxy , &cluster->pmgr.local_lock ) ,
-                           LOCK_CLUSTER_LOCALS );
 
     // initialise copies_lists in process manager
-    for( lpid = 0 ; lpid < CONFIG_MAX_PROCESS_PER_CLUSTER ; lpid++ )
-    {
+    for( lpid = 1 ; lpid < CONFIG_MAX_PROCESS_PER_CLUSTER ; lpid++ )
+    {
+	    remote_spinlock_init( XPTR( local_cxy , &cluster->pmgr.copies_lock[lpid] ) );
         cluster->pmgr.copies_nr[lpid] = 0;
         xlist_root_init( XPTR( local_cxy , &cluster->pmgr.copies_root[lpid] ) );
-	    remote_queuelock_init( XPTR( local_cxy , &cluster->pmgr.copies_lock[lpid] ),
-                               LOCK_CLUSTER_COPIES );
-    }
-
-#if DEBUG_CLUSTER_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_INIT < cycle )
-printk("\n[%s] thread[%x,%x] exit for cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-
-    hal_fence();
+    }    
+
+    hal_wbflush();
+
+    // wait all clusters initialised on barrier located in cluster_io
+    remote_barrier( XPTR( cluster->io_cxy , &cluster->barrier ) ,
+                    cluster->x_size * cluster->y_size );
 
 	return 0;
-} // end cluster_manager_init()
-
-///////////////////////////////////
-cxy_t cluster_random_select( void )
-{
-    uint32_t  index;
-    uint32_t  x;    
-    uint32_t  y;
-    cxy_t     cxy;
-
-    uint32_t  x_size    = LOCAL_CLUSTER->x_size;
-    uint32_t  y_size    = LOCAL_CLUSTER->y_size;
-
-    do 
-    {
-        index     = ( hal_get_cycles() + hal_get_gid() ) % (x_size * y_size);
-        x         = index / y_size;
-        y         = index % y_size;
-        cxy       = HAL_CXY_FROM_XY( x , y );
-    }
-    while ( cluster_is_active( cxy ) == false );
-
-    return ( cxy );
-}
-
-/////////////////////////////////////////////
-inline bool_t cluster_is_active ( cxy_t cxy )
-{
-    uint32_t x = HAL_X_FROM_CXY( cxy );
-    uint32_t y = HAL_Y_FROM_CXY( cxy );
-
-    return ( LOCAL_CLUSTER->cluster_info[x][y] != 0 );
+} // end cluster_init()
+
+////////////////////////////////////////
+bool_t cluster_is_undefined( cxy_t cxy )
+{
+    cluster_t * cluster = LOCAL_CLUSTER;
+
+    uint32_t y_width = cluster->y_width;
+
+    uint32_t x = cxy >> y_width;
+    uint32_t y = cxy & ((1<<y_width)-1);
+
+    if( x >= cluster->x_size ) return true;  
+    if( y >= cluster->y_size ) return true;  
+
+    return false;
 }
 
@@ -292,134 +164,46 @@
 ////////////////////////////////////////////////////////////////////////////////////
 
-/////////////////////////////////////////////
-lid_t cluster_select_local_core( cxy_t  cxy )
-{
-    uint32_t      min = 1000000;
-    lid_t         sel = 0;
-    uint32_t      nthreads;
-    lid_t         lid;
-    scheduler_t * sched;
-    cluster_t   * cluster = LOCAL_CLUSTER;
-    uint32_t      ncores = hal_remote_l32( XPTR( cxy , &cluster->cores_nr ) );
-
-    for( lid = 0 ; lid < ncores ; lid++ )
-    {
-        sched  = &cluster->core_tbl[lid].scheduler;
-
-        nthreads = hal_remote_l32( XPTR( cxy , &sched->u_threads_nr ) ) +
-                   hal_remote_l32( XPTR( cxy , &sched->k_threads_nr ) );
-
-        if( nthreads < min )
+////////////////////////////////
+void cluster_core_kernel_enter()
+{
+    cluster_t * cluster = LOCAL_CLUSTER;
+	hal_atomic_inc( &cluster->cores_in_kernel );
+}
+
+///////////////////////////////
+void cluster_core_kernel_exit()
+{
+    cluster_t * cluster = LOCAL_CLUSTER;
+	hal_atomic_dec( &cluster->cores_in_kernel );
+}
+
+/////////////////////////////////
+lid_t cluster_select_local_core()
+{
+    uint32_t min = 100;
+    lid_t    sel = 0;
+    lid_t    lid;
+
+    cluster_t * cluster = LOCAL_CLUSTER;
+
+    for( lid = 0 ; lid < cluster->cores_nr ; lid++ )
+    {
+        if( cluster->core_tbl[lid].usage < min )
         {
-            min = nthreads;
+            min = cluster->core_tbl[lid].usage;
             sel = lid;
         }
-    }
+    } 
     return sel;
 }
 
 ////////////////////////////////////////////////////////////////////////////////////
-//  Process related functions
+//  Process management related functions
 ////////////////////////////////////////////////////////////////////////////////////
-
-
-//////////////////////////////////////////////////////
-xptr_t cluster_get_process_from_pid_in_cxy( cxy_t cxy,
-                                            pid_t pid )
-{
-    xptr_t      root_xp;       // xptr on root of list of processes in owner cluster
-    xptr_t      lock_xp;       // xptr on lock protecting this list
-    xptr_t      iter_xp;       // iterator
-    xptr_t      current_xp;    // xptr on current process descriptor
-    bool_t      found;
-
-    cluster_t * cluster = LOCAL_CLUSTER;
-
-    // get owner cluster and lpid
-    cxy_t   owner_cxy = CXY_FROM_PID( pid );
-    lpid_t  lpid      = LPID_FROM_PID( pid );
-
-    // get lock & root of list of copies from owner cluster
-    root_xp = XPTR( owner_cxy , &cluster->pmgr.copies_root[lpid] );
-    lock_xp = XPTR( owner_cxy , &cluster->pmgr.copies_lock[lpid] );
-
-    // take the lock protecting the list of processes
-    remote_queuelock_acquire( lock_xp );
-
-    // scan list of processes
-    found = false;
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        current_xp  = XLIST_ELEMENT( iter_xp , process_t , copies_list );
-
-        if( GET_CXY( current_xp ) == cxy )
-        {
-            found = true;
-            break;
-        }
-    }
-
-    // release the lock protecting the list of processes
-    remote_queuelock_release( lock_xp );
-
-    // return extended pointer on process descriptor in owner cluster
-    if( found ) return current_xp;
-    else        return XPTR_NULL;
-
-}  // end cluster_get_process_from_pid_in_cxy()
-
-
-//////////////////////////////////////////////////////
-xptr_t cluster_get_owner_process_from_pid( pid_t pid )
-{
-    xptr_t      root_xp;       // xptr on root of list of processes in owner cluster
-    xptr_t      lock_xp;       // xptr on lock protecting this list
-    xptr_t      iter_xp;       // iterator
-    xptr_t      current_xp;    // xptr on current process descriptor
-    process_t * current_ptr;   // local pointer on current process
-    pid_t       current_pid;   // current process identifier
-    bool_t      found;
-
-    cluster_t * cluster = LOCAL_CLUSTER;
-
-    // get owner cluster and lpid
-    cxy_t  owner_cxy = CXY_FROM_PID( pid );
-
-    // get lock & root of list of process in owner cluster
-    root_xp = XPTR( owner_cxy , &cluster->pmgr.local_root );
-    lock_xp = XPTR( owner_cxy , &cluster->pmgr.local_lock );
-
-    // take the lock protecting the list of processes
-    remote_queuelock_acquire( lock_xp );
-
-    // scan list of processes in owner cluster
-    found = false;
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        current_xp  = XLIST_ELEMENT( iter_xp , process_t , local_list );
-        current_ptr = GET_PTR( current_xp );
-        current_pid = hal_remote_l32( XPTR( owner_cxy , &current_ptr->pid ) );
-
-        if( current_pid == pid )
-        {
-            found = true;
-            break;
-        }
-    }
-
-    // release the lock protecting the list of processes
-    remote_queuelock_release( lock_xp );
-
-    // return extended pointer on process descriptor in owner cluster
-    if( found ) return current_xp;
-    else        return XPTR_NULL;
-
-}  // end cluster_get_owner_process_from_pid()
-
 
 //////////////////////////////////////////////////////////
 xptr_t cluster_get_reference_process_from_pid( pid_t pid )
-{
-    xptr_t ref_xp;   // extended pointer on reference process descriptor
+{ 
+    xptr_t xp;   // extended pointer on process descriptor
 
     cluster_t * cluster = LOCAL_CLUSTER;
@@ -429,38 +213,35 @@
     lpid_t lpid      = LPID_FROM_PID( pid );
 
-    // Check valid PID
-    if( lpid >= CONFIG_MAX_PROCESS_PER_CLUSTER )  return XPTR_NULL;
+    // Check valid PID 
+    if( lpid >= CONFIG_MAX_PROCESS_PER_CLUSTER )
+    {
+        printk("\n[PANIC] in %s : illegal PID\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     if( local_cxy == owner_cxy )   // local cluster is owner cluster
-    {
-        ref_xp = cluster->pmgr.pref_tbl[lpid];
+    { 
+        xp = cluster->pmgr.pref_tbl[lpid];
     }
     else                              // use a remote_lwd to access owner cluster
     {
-        ref_xp = (xptr_t)hal_remote_l64( XPTR( owner_cxy , &cluster->pmgr.pref_tbl[lpid] ) );
-    }
-
-    return ref_xp;
-}
-
-///////////////////////////////////////////////
-error_t cluster_pid_alloc( process_t * process,
-                           pid_t     * pid )
-{
+        xp = (xptr_t)hal_remote_lwd( XPTR( owner_cxy , &cluster->pmgr.pref_tbl[lpid] ) );
+    }
+
+    return xp;
+}
+
+////////////////////////////////////////////////
+error_t cluster_pid_alloc( xptr_t    process_xp,
+                           pid_t   * pid )
+{
+    error_t     error;
     lpid_t      lpid;
     bool_t      found;
 
-#if DEBUG_CLUSTER_PID_ALLOC
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_CLUSTER_PID_ALLOC < cycle )
-printk("\n[%s] thread[%x,%x] enters in cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , local_cxy , cycle );
-#endif
-
     pmgr_t    * pm         = &LOCAL_CLUSTER->pmgr;
 
-    // get the lock protecting pref_tbl
-    queuelock_acquire( &pm->pref_lock );
+    // get the process manager lock
+    spinlock_lock( &pm->pref_lock );
 
     // search an empty slot
@@ -478,5 +259,5 @@
     {
         // register process in pref_tbl[]
-        pm->pref_tbl[lpid] = XPTR( local_cxy , process );
+        pm->pref_tbl[lpid] = process_xp;
         pm->pref_nr++;
 
@@ -484,23 +265,15 @@
         *pid = PID( local_cxy , lpid );
 
-        // release the processs_manager lock
-        queuelock_release( &pm->pref_lock );
-
-        return 0;
+        error = 0;
     }
     else
     {
-        // release the lock
-        queuelock_release( &pm->pref_lock );
-
-        return 0xFFFFFFFF;
-    }
-
-#if DEBUG_CLUSTER_PID_ALLOC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_PID_ALLOC < cycle )
-printk("\n[%s] thread[%x,%x] exit in cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , local_cxy , cycle );
-#endif
+        error = EAGAIN;
+    }   
+
+    // release the processs_manager lock
+    spinlock_unlock( &pm->pref_lock );
+
+    return error;
 
 } // end cluster_pid_alloc()
@@ -509,28 +282,18 @@
 void cluster_pid_release( pid_t pid )
 {
-
-#if DEBUG_CLUSTER_PID_RELEASE
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_CLUSTER_PID_ALLOC < cycle )
-printk("\n[%s] thread[%x,%x] enters in cluster %x / pid %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , local_cxy , pid, cycle );
-#endif
-
     cxy_t  owner_cxy  = CXY_FROM_PID( pid );
     lpid_t lpid       = LPID_FROM_PID( pid );
 
+    // check pid argument
+    if( (lpid >= CONFIG_MAX_PROCESS_PER_CLUSTER) || (owner_cxy != local_cxy) )
+    {
+        printk("\n[PANIC] in %s : illegal PID\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
     pmgr_t  * pm = &LOCAL_CLUSTER->pmgr;
 
-    // check lpid 
-    assert( __FUNCTION__, (lpid < CONFIG_MAX_PROCESS_PER_CLUSTER),
-    "illegal LPID = %d" , lpid );
-
-    // check owner cluster
-    assert( __FUNCTION__, (owner_cxy == local_cxy) ,
-    "local_cluster %x !=  owner_cluster %x" , local_cxy , owner_cxy );
-
-    // get the lock protecting pref_tbl
-    queuelock_acquire( &pm->pref_lock );
+    // get the process manager lock
+    spinlock_lock( &pm->pref_lock );
 
     // remove process from pref_tbl[]
@@ -539,12 +302,5 @@
 
     // release the processs_manager lock
-    queuelock_release( &pm->pref_lock );
-
-#if DEBUG_CLUSTER_PID_RELEASE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_PID_ALLOC < cycle )
-printk("\n[%s] thread[%x,%x] exit in cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , local_cxy , cycle );
-#endif
+    spinlock_unlock( &pm->pref_lock );
 
 } // end cluster_pid_release()
@@ -553,26 +309,19 @@
 process_t * cluster_get_local_process_from_pid( pid_t pid )
 {
-    xptr_t         process_xp;
-    process_t    * process_ptr;
-    xptr_t         root_xp;
-    xptr_t         iter_xp;
-    bool_t         found;
-
-    found   = false;
-    root_xp = XPTR( local_cxy , &LOCAL_CLUSTER->pmgr.local_root );
-
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        process_xp  = XLIST_ELEMENT( iter_xp , process_t , local_list );
-        process_ptr = (process_t *)GET_PTR( process_xp );
-        if( process_ptr->pid == pid )
+    process_t    * ret     = NULL;
+    list_entry_t * root    = &LOCAL_CLUSTER->pmgr.local_root;
+    list_entry_t * iter;
+    process_t    * process;
+    
+    LIST_FOREACH( root , iter )
+    {
+        process = LIST_ELEMENT( iter , process_t , local_list );
+        if( process->pid == pid )
         {
-            found = true;
+            ret = process;
             break;
         }
     }
-
-    if (found ) return process_ptr;
-    else        return NULL;
+    return ret;
 
 }  // end cluster_get_local_process_from_pid()
@@ -583,17 +332,12 @@
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
 
-    // get extended pointers on local process list root & lock
-    xptr_t root_xp = XPTR( local_cxy , &pm->local_root );
-    xptr_t lock_xp = XPTR( local_cxy , &pm->local_lock );
-
-    // get lock protecting the local list
-    remote_queuelock_acquire( lock_xp );
-
-    // register process in local list
-    xlist_add_last( root_xp , XPTR( local_cxy , &process->local_list ) );
+    // get lock protecting the process manager local list
+    spinlock_lock( &pm->local_lock );
+
+    list_add_first( &pm->local_root , &process->local_list );
     pm->local_nr++;
 
-    // release lock protecting the local list
-    remote_queuelock_release( lock_xp );
+    // release lock protecting the process manager local list
+    spinlock_unlock( &pm->local_lock );
 }
 
@@ -603,16 +347,12 @@
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
 
-    // get extended pointers on local process list lock
-    xptr_t lock_xp = XPTR( local_cxy , &pm->local_lock );
-
-    // get lock protecting the local list
-    remote_queuelock_acquire( lock_xp );
-
-    // remove process from local list
-    xlist_unlink( XPTR( local_cxy , &process->local_list ) );
+    // get lock protecting the process manager local list
+    spinlock_lock( &pm->local_lock );
+
+    list_unlink( &process->local_list );
     pm->local_nr--;
 
-    // release lock protecting the local list
-    remote_queuelock_release( lock_xp );
+    // release lock protecting the process manager local list
+    spinlock_unlock( &pm->local_lock );
 }
 
@@ -621,12 +361,4 @@
 {
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
-
-#if DEBUG_CLUSTER_PROCESS_COPIES
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_CLUSTER_PROCESS_COPIES < cycle )
-printk("\n[%s] thread[%x,%x] enters for process %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , process->pid , cycle );
-#endif
 
     // get owner cluster identifier CXY and process LPID
@@ -636,30 +368,21 @@
 
     // get extended pointer on lock protecting copies_list[lpid]
-    xptr_t copies_lock  = XPTR( owner_cxy , &pm->copies_lock[lpid] );
+    xptr_t copies_lock  = hal_remote_lwd( XPTR( owner_cxy , &pm->copies_lock[lpid] ) );
 
     // get extended pointer on the copies_list[lpid] root
-    xptr_t copies_root  = XPTR( owner_cxy , &pm->copies_root[lpid] );
+    xptr_t copies_root  = hal_remote_lwd( XPTR( owner_cxy , &pm->copies_root[lpid] ) );
 
     // get extended pointer on the local copies_list entry
     xptr_t copies_entry = XPTR( local_cxy , &process->copies_list );
 
-    // get lock protecting copies_list[lpid]
-    remote_queuelock_acquire( copies_lock );
-
-    // add copy to copies_list
+    // get lock protecting copies_list[lpid] 
+    remote_spinlock_lock( copies_lock );
+
     xlist_add_first( copies_root , copies_entry );
     hal_remote_atomic_add( XPTR( owner_cxy , &pm->copies_nr[lpid] ) , 1 );
 
-    // release lock protecting copies_list[lpid]
-    remote_queuelock_release( copies_lock );
-
-#if DEBUG_CLUSTER_PROCESS_COPIES
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_PROCESS_COPIES < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , process->pid , cycle );
-#endif
-
-}  // end cluster_process_copies_link()
+    // release lock protecting copies_list[lpid] 
+    remote_spinlock_unlock( copies_lock );
+}
 
 /////////////////////////////////////////////////////////
@@ -667,12 +390,4 @@
 {
     pmgr_t * pm = &LOCAL_CLUSTER->pmgr;
-
-#if DEBUG_CLUSTER_PROCESS_COPIES
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_CLUSTER_PROCESS_COPIES < cycle )
-printk("\n[%s] thread[%x,%x] enters for process %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , process->pid , cycle );
-#endif
 
     // get owner cluster identifier CXY and process LPID
@@ -682,104 +397,214 @@
 
     // get extended pointer on lock protecting copies_list[lpid]
-    xptr_t copies_lock  = XPTR( owner_cxy , &pm->copies_lock[lpid] );
+    xptr_t copies_lock  = hal_remote_lwd( XPTR( owner_cxy , &pm->copies_lock[lpid] ) );
 
     // get extended pointer on the local copies_list entry
     xptr_t copies_entry = XPTR( local_cxy , &process->copies_list );
 
-    // get lock protecting copies_list[lpid]
-    remote_queuelock_acquire( copies_lock );
-
-    // remove copy from copies_list
+    // get lock protecting copies_list[lpid] 
+    remote_spinlock_lock( copies_lock );
+
     xlist_unlink( copies_entry );
     hal_remote_atomic_add( XPTR( owner_cxy , &pm->copies_nr[lpid] ) , -1 );
 
-    // release lock protecting copies_list[lpid]
-    remote_queuelock_release( copies_lock );
-
-#if DEBUG_CLUSTER_PROCESS_COPIES
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_CLUSTER_PROCESS_COPIES < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , process->pid , cycle );
+    // release lock protecting copies_list[lpid] 
+    remote_spinlock_unlock( copies_lock );
+}
+
+////////////////////////////////////////////////////////////////////////////////////////
+// TODO Il me semble que la seule chose que fait ce kernel thread à chaque réveil
+// est de mettre à jour la DQDT, et de se rendormir... A-t-on besoin d'un thread ? [AG] 
+//////////////////////////////////////////////////////////////////////////////////////////
+
+#if 0
+void * cluster_manager_thread( void * arg )
+{
+	register struct dqdt_cluster_s * root;
+	register struct cluster_s      * root_home;
+
+	register uint32_t                tm_start;
+	register uint32_t                tm_end;
+	register uint32_t                cpu_id;
+	struct cluster_s               * cluster;
+	struct thread_s                * this;
+	struct event_s                   event;
+	struct alarm_info_s              info;
+	register uint32_t                cntr;
+	register bool_t                  isRootMgr;
+	register uint32_t                period;
+
+	cpu_enable_all_irq( NULL );
+
+	cluster   = arg;
+	this      = CURRENT_THREAD;
+	cpu_id    = cpu_get_id();
+	root      = dqdt_root;
+	root_home = dqdt_root->home;
+	isRootMgr = (cluster == root_home) ? true : false;
+	cntr      = 0;
+	period    = (isRootMgr) ? 
+		CONFIG_DQDT_ROOTMGR_PERIOD * MSEC_PER_TICK : 
+		CONFIG_DQDT_MGR_PERIOD * MSEC_PER_TICK;
+
+	event_set_senderId(&event, this);
+	event_set_priority(&event, E_CHR);
+	event_set_handler(&event, &manager_alarm_event_handler);
+  
+	info.event = &event;
+	thread_preempt_disable(CURRENT_THREAD);
+
+    // infinite loop
+	while(1)
+	{
+		tm_start = cpu_time_stamp();
+		dqdt_update();
+		tm_end   = cpu_time_stamp();
+
+		if(isRootMgr)
+		{
+			if((cntr % 10) == 0)
+			{
+				printk(INFO, "INFO: cpu %d, DQDT update ended [ %u - %u ]\n", 
+				       cpu_id, 
+				       tm_end, 
+				       tm_end - tm_start);
+
+				dqdt_print_summary(root);
+			}
+		}
+
+		alarm_wait( &info , period );
+		sched_sleep(this);
+		cntr ++;
+	}
+
+	return NULL;
+} // end cluster_manager_thread()
+
+//////////////////////////////////////////
+EVENT_HANDLER(manager_alarm_event_handler)
+{
+	struct thread_s *manager;
+ 
+	manager = event_get_senderId(event);
+ 
+	thread_preempt_disable(CURRENT_THREAD);
+
+	//printk(INFO, "%s: cpu %d [%u]\n", __FUNCTION__, cpu_get_id(), cpu_time_stamp());
+
+	sched_wakeup(manager);
+  
+	thread_preempt_enable(CURRENT_THREAD);
+
+	return 0;
+}
+
+///////////////////////////////////////////////
+EVENT_HANDLER(cluster_key_create_event_handler)
+{
+	struct cluster_s *cluster;
+	struct thread_s *sender;
+	ckey_t *ckey;
+	uint32_t key;
+
+	sender  = event_get_senderId(event);
+	ckey    = event_get_argument(event);
+	cluster = current_cluster;
+	key     = cluster->next_key;
+
+	while((key < CLUSTER_TOTAL_KEYS_NR) && (cluster->keys_tbl[key] != NULL))
+		key ++;
+
+	if(key < CLUSTER_TOTAL_KEYS_NR)
+	{
+		ckey->val = key;
+		cluster->keys_tbl[key] = (void *) 0x1; // Reserved 
+		cluster->next_key = key;
+		event_set_error(event, 0);
+	}
+	else
+		event_set_error(event, ENOSPC);
+
+	sched_wakeup(sender);
+	return 0;
+}
+
+///////////////////////////////////////////////
+EVENT_HANDLER(cluster_key_delete_event_handler)
+{
+	struct cluster_s *cluster;
+	struct thread_s *sender;
+	ckey_t *ckey;
+	uint32_t key;
+
+	sender  = event_get_senderId(event);
+	ckey    = event_get_argument(event);
+	cluster = current_cluster;
+	key     = ckey->val;
+
+	if(key < cluster->next_key)
+		cluster->next_key = key;
+
+	cluster->keys_tbl[key] = NULL;
+	event_set_error(event, 0);
+
+	sched_wakeup(sender);
+	return 0;
+}
+
+#define _CKEY_CREATE  0x0
+#define _CKEY_DELETE  0x1
+
+error_t cluster_do_key_op(ckey_t *key, uint32_t op)
+{
+	struct event_s event;
+	struct thread_s *this;
+	struct cluster_s *cluster;
+	struct cpu_s *cpu;
+
+	this = CURRENT_THREAD;
+
+	event_set_priority(&event, E_FUNC);
+	event_set_senderId(&event, this);
+	event_set_argument(&event, key);
+
+	if(op == _CKEY_CREATE)
+		event_set_handler(&event, cluster_key_create_event_handler);
+	else
+		event_set_handler(&event, cluster_key_delete_event_handler);
+
+	cluster = current_cluster;
+	cpu     = cluster->bscluster->bscpu;
+	event_send(&event, &cpu->re_listner);
+
+	sched_sleep(this);
+
+	return event_get_error(&event);
+}
+
+error_t cluster_key_create(ckey_t *key)
+{
+	return cluster_do_key_op(key, _CKEY_CREATE);
+}
+
+error_t cluster_key_delete(ckey_t *key)
+{
+	return cluster_do_key_op(key, _CKEY_DELETE);
+}
+
+void* cluster_getspecific(ckey_t *key)
+{
+	struct cluster_s *cluster;
+
+	cluster = current_cluster;
+	return cluster->keys_tbl[key->val];
+}
+
+void  cluster_setspecific(ckey_t *key, void *val)
+{
+	struct cluster_s *cluster;
+
+	cluster = current_cluster;
+	cluster->keys_tbl[key->val] = val;
+}
 #endif
-
-}  // end cluster_process_copies_unlink()
-
-////////////////////////////////////////////
-void cluster_processes_display( cxy_t   cxy,
-                                bool_t  owned )
-{
-    xptr_t        root_xp;
-    xptr_t        lock_xp;
-    xptr_t        iter_xp;
-    xptr_t        process_xp;
-    process_t   * process_ptr;
-    cxy_t         process_cxy;
-    pid_t         pid;
-    cxy_t         txt0_cxy;
-    chdev_t     * txt0_ptr;
-    xptr_t        txt0_xp;
-    xptr_t        txt0_lock_xp;
-    uint32_t      pref_nr;       // number of owned processes in cluster cxy
-
-assert( __FUNCTION__, (cluster_is_active( cxy ) ), "illegal cluster index" );
-
-    // get extended pointer on root and lock for local process list in cluster
-    root_xp = XPTR( cxy , &LOCAL_CLUSTER->pmgr.local_root );
-    lock_xp = XPTR( cxy , &LOCAL_CLUSTER->pmgr.local_lock );
-
-    // get number of owned processes in cluster cxy
-    pref_nr = hal_remote_l32( XPTR( cxy , &LOCAL_CLUSTER->pmgr.pref_nr ) );
-
-    // display nothing if no user process in cluster cxy
-    if( (owned != false) && (pref_nr < 2) ) return;
-    
-    // get pointers on TXT0 chdev
-    txt0_xp  = chdev_dir.txt_tx[0];
-    txt0_cxy = GET_CXY( txt0_xp );
-    txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on TXT0 lock
-    txt0_lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get lock on local process list 
-    remote_queuelock_acquire( lock_xp );
-
-    // get TXT0 lock
-    remote_busylock_acquire( txt0_lock_xp );
-     
-    nolock_printk("\n***** processes in cluster %x / cycle %d\n",
-    cxy , (uint32_t)hal_get_cycles() );
-
-    // loop on all processes in cluster cxy 
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        process_xp  = XLIST_ELEMENT( iter_xp , process_t , local_list );
-        process_ptr = GET_PTR( process_xp );
-        process_cxy = GET_CXY( process_xp );
-
-        // get process PID
-        pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) );
-
-        if( owned )  // display only user & owned processes 
-        {
-            if( (CXY_FROM_PID( pid ) == cxy) && (LPID_FROM_PID( pid ) != 0) )
-            {
-                process_display( process_xp );
-            }
-        }
-        else         // display all local processes
-        {
-            process_display( process_xp );
-        }
-    }
-
-    // release TXT0 lock 
-    remote_busylock_release( txt0_lock_xp );
-
-    // release lock on local process list
-    remote_queuelock_release( lock_xp );
-
-}  // end cluster_processes_display() 
-
-
Index: trunk/kernel/kern/cluster.h
===================================================================
--- trunk/kernel/kern/cluster.h	(revision 690)
+++ trunk/kernel/kern/cluster.h	(revision 1)
@@ -1,8 +1,8 @@
 /*
  * cluster.h - Cluster-Manager definition
- *
- * authors  Ghassan Almaless       (2008,2009,2010,2011,2012)
+ * 
+ * authors  Ghassan Almaless (2008,2009,2010,2011,2012)
  *          Mohamed Lamine Karaoui (2015)
- *          Alain Greiner          (2016,2017,2018,2019,2020)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -27,9 +27,10 @@
 #define _CLUSTER_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <bits.h>
-#include <queuelock.h>
-#include <remote_queuelock.h>
+#include <spinlock.h>
+#include <readlock.h>
+#include <remote_barrier.h>
 #include <list.h>
 #include <xlist.h>
@@ -39,4 +40,5 @@
 #include <ppm.h>
 #include <kcm.h>
+#include <khm.h>
 #include <rpc.h>
 #include <core.h>
@@ -47,4 +49,5 @@
 struct core_s;
 struct process_s;
+struct device_s;
 
 
@@ -52,38 +55,34 @@
  * This structure defines the process manager, that is part of the cluster manager.
  * For any process P, the process descriptor is replicated in all clusters containing
- * at least one thread of process P, but only the "reference" cluster descriptor contains
- * the reference (complete) GPT, VSL, and FDT structures. 
- * The "owner" cluster K is in charge to allocate a lpid (local process index), 
- * to the owned processes, and to register the "reference" cluster for these processes.
- *
- * Warning : the "owner" cluster, and the "reference" cluster can be different clusters.
- *
- * The process manager of a cluster K maintains three sets of process descriptors:
- *
- * 1) pref_tbl[] is an array indexed by lpid. There is one entry per owned process.
+ * at least one thread of process P, but only the "reference" cluster descriptor contains 
+ * the reference (complete) structures such as the GPT, the VSL, or the FDT.
+ * The "owner" cluster is in charge to allocate a lpid (local process index), 
+ * for all process owned by a cluster K, and to register the "reference" cluster for
+ * all process owned by K. 
+ *
+ * Warning : the "owner" cluster, and the "reference" cluster can be different clusters. 
+ *
+ * The process manager of a cluster K maintains three structures:
+ * 1) The pref_tbl[] is an array indexed by lpid, for all processes owned by cluster K.
  *    Each entry contains an extended pointer on the reference process descriptor.
- *
- * 2) The local_root is the root of the local list of all process descriptors in cluster K.
+ * 2) The local_root is the root of the local list of process descriptors in cluster K.
  *    A process descriptor P is present in K, as soon as P has a thread in cluster K.
- *    We use an xlist, because this list can be traversed by remote threads.
- *
- * 3) The copies_root[] array is indexed by lpid. There is one entry per owned process,
- *    and each each entry contains the root of the xlist of copies for this process.
- $    We use an xlist, because process copies are distributed in all clusters. 
+ * 3) The copies_root[] array is indexed by lpid. Each entry contains the root of
+ *    the xlist of copies for a given process owned by cluster K.   
  ******************************************************************************************/
 
 typedef struct process_manager_s
 {
-	xptr_t             pref_tbl[CONFIG_MAX_PROCESS_PER_CLUSTER];  /*! owned  processes    */
-	queuelock_t        pref_lock;              /*! lock protecting pref_tbl               */
-    uint32_t           pref_nr;                /*! number of processes owned by cluster   */
-
-    xlist_entry_t      local_root;            /*! root of list of process in cluster      */
-    remote_queuelock_t local_lock;            /*! lock protecting local list              */
-    uint32_t           local_nr;              /*! number of process in cluster            */
-
-    xlist_entry_t      copies_root[CONFIG_MAX_PROCESS_PER_CLUSTER];  /*! roots of lists   */
-    remote_queuelock_t copies_lock[CONFIG_MAX_PROCESS_PER_CLUSTER];  /*! one  per list    */
-    uint32_t           copies_nr[CONFIG_MAX_PROCESS_PER_CLUSTER];    /*! number of copie  */
+	xptr_t            pref_tbl[CONFIG_MAX_PROCESS_PER_CLUSTER];  /*! reference  process   */
+	spinlock_t        pref_lock;              /*! lock protecting lpid allocation/release */
+    uint32_t          pref_nr;                /*! number of processes owned by cluster    */
+
+    list_entry_t      local_root;             /*! root of list of process in cluster      */
+    spinlock_t        local_lock;             /*! lock protecting access to local list    */
+    uint32_t          local_nr;               /*! number of process in cluster            */
+
+    xlist_entry_t     copies_root[CONFIG_MAX_PROCESS_PER_CLUSTER];  /*! roots of lists    */ 
+    remote_spinlock_t copies_lock[CONFIG_MAX_PROCESS_PER_CLUSTER];  /*! one lock per list */
+    uint32_t          copies_nr[CONFIG_MAX_PROCESS_PER_CLUSTER];    /*! number of copies  */
 }
 pmgr_t;
@@ -91,61 +90,60 @@
 /*******************************************************************************************
  * This structure defines a cluster manager.
- * It contains both global platform information, and cluster specific resources
- * controled by the local kernel instance.
+ * It contains both global platform informations, and cluster specific ressources
+ * managed by the local kernel instance.
  ******************************************************************************************/
 
 typedef struct cluster_s
 {
+	spinlock_t        kcm_lock;           /*! local, protect creation of KCM allocators   */
+    remote_barrier_t  barrier;            /*! used to synchronize kernel parallel init    */
+    remote_spinlock_t txt0_lock;          /*! global, only cluster_io lock is used        */
 
     // global parameters
-    uint32_t        paddr_width;       /*! numer of bits in physical address              */
-    uint32_t        x_width;           /*! number of bits to code x_size  (can be 0)      */
-    uint32_t        y_width;           /*! number of bits to code y_size  (can be 0)      */
-    uint32_t        x_size;            /*! number of clusters in a row    (can be 1)      */
-    uint32_t        y_size;            /*! number of clusters in a column (can be 1)      */
-    uint32_t        io_cxy;            /*! io cluster identifier                          */
-    uint32_t        sys_clk;           /*! system_clock frequency (in Hertz)              */
-    uint32_t        dqdt_root_level;   /*! index of root node in dqdt_tbl[]               */
-    uint32_t        nb_txt_channels;   /*! number of TXT channels                         */
-    uint32_t        nb_nic_channels;   /*! number of NIC channels                         */
-    uint32_t        nb_ioc_channels;   /*! number of IOC channels                         */
-    uint32_t        nb_fbf_channels;   /*! number of FBF channels                         */
-
-    // number of cores for each cluster in the mesh
-    uint8_t         cluster_info[CONFIG_MAX_CLUSTERS_X][CONFIG_MAX_CLUSTERS_Y];
+
+	uint32_t          paddr_width;        /*! numer of bits in physical address           */
+    uint32_t          x_width;            /*! number of bits to code x_size  (can be 0)   */
+    uint32_t          y_width;            /*! number of bits to code y_size  (can be 0)   */
+	uint32_t          x_size;             /*! number of clusters in a row    (can be 1)   */
+	uint32_t          y_size;             /*! number of clusters in a column (can be 1)   */
+	cxy_t             io_cxy;             /*! io cluster identifier                       */
+    uint32_t          dqdt_root_level;    /*! index of root node in dqdt_tbl[]            */
 
     // local parameters
-    uint32_t        cores_nr;          /*! actual number of cores in cluster              */
-    uint32_t        ram_size;          /*! physical memory size                           */
-    uint32_t        ram_base;          /*! physical memory base (local address)           */
-
-	core_t          core_tbl[CONFIG_MAX_LOCAL_CORES];    /*! embedded cores               */
-
-    list_entry_t    dev_root;          /*! root of list of devices in cluster             */
-
-    // physical memory allocators: one PPM and severa KCM
-    ppm_t           ppm;
-    kcm_t           kcm[CONFIG_PPM_PAGE_ORDER - CONFIG_CACHE_LINE_ORDER];
-
-    // RPC
-    remote_fifo_t   rpc_fifo[CONFIG_MAX_LOCAL_CORES];    /*! one RPC FIFO per core        */
-    uint32_t        rpc_threads[CONFIG_MAX_LOCAL_CORES]; /*! RPC threads per core         */
-
-    // DQDT
-    dqdt_node_t     dqdt_tbl[CONFIG_DQDT_LEVELS_NR];     /*! embedded DQDT nodes          */
-
-    xptr_t          dqdt_root_xp;      /*! extended pointer on DQDT root node             */
-
-    // Local process manager
-    pmgr_t          pmgr;              /*! embedded process manager                       */
-
-    void          * pic_extend;        /*! PIC implementation specific extension          */
-}
+
+	uint32_t          cores_nr;           /*! number of cores in cluster                  */
+    uint32_t          cores_in_kernel;    /*! number of cores currently in kernel mode    */
+
+	core_t            core_tbl[CONFIG_MAX_CORES_PER_CLUSTER];         /*! embedded cores  */
+
+	ppm_t             ppm;                /*! embedded kernel page manager                */
+	khm_t             khm;                /*! embedded kernel heap manager                */
+	kcm_t             kcm;                /*! embedded kernel cache manager (for KCMs)    */
+
+    kcm_t           * kcm_tbl[KMEM_TYPES_NR];         /*! pointers on allocated KCMs      */
+
+    uint32_t          ram_size;           /*! physical memory size                        */
+    uint32_t          ram_base;           /*! physical memory base (local address)        */
+
+	rpc_fifo_t        rpc_fifo;           /*! cluster RPC fifo (shared)                   */
+	list_entry_t      devlist;            /*! root of list of devices in cluster          */
+    struct device_s * icu;                /*! pointer on local XCU device                 */
+
+    int32_t           pages_var;          /*! pages number increment from last update     */
+    int32_t           threads_var;        /*! threads number increment from last update   */
+
+	dqdt_node_t       dqdt_tbl[CONFIG_MAX_DQDT_DEPTH];     /*! embedded DQDT nodes        */
+
+    pmgr_t            pmgr;               /*! embedded process manager                    */
+
+	char              name[CONFIG_SYSFS_NAME_LEN];  
+	sysfs_entry_t     node;
+} 
 cluster_t;
 
 /******************************************************************************************
  * This global variable is allocated in the kernel_init.c file.
- * There is one cluster_manager per cluster, with the same local address,
- * but different content, in all clusters containing a kernel instance.
+ * There is one cluster_manager per cluster, with the same local address, 
+ * but different value, in all clusters containing a kernel instance. 
  *****************************************************************************************/
 
@@ -159,98 +157,62 @@
 
 /******************************************************************************************
- * These two functions initialise the local cluster manager from information found
- * in the local boot-info structure <info> build by the boot-loader.
- * 1) the cluster_info_init() function is called first, to initialize the structural
- *    constants, including the cluster_info[x][y] array.
- *    It cannot use the TXT0 kernel terminal.
- * 2) the cluster_manager_init() function initializes various complex structures:
- *    - the local DQDT nodes,
- *    - the PPM, KHM, and KCM allocators,
- *    - the local core descriptors,
- *    - the local RPC FIFO,
- *    - the process manager.
- *    It can use the TXT0 kernel terminal.
+ * This generic function initialises the local cluster manager from informations found
+ * in the local boot-info structure. It initializes the following local resources:
+ * - the global platform parameters,
+ * - the specific cluster parameters,
+ * - the lock protecting KCM creation,
+ * - the local DQDT nodes,
+ * - the PPM, KHM, and KCM allocators,
+ * - the local core descriptors,
+ * - the local RPC FIFO,
+ * - the process manager.
+ * It does NOT initialise the local device descriptors.
  ******************************************************************************************
  * @ info : pointer on the local boot_info_t structure build by the bootloader.
  *****************************************************************************************/
-void    cluster_info_init( boot_info_t * info );
-error_t cluster_manager_init( boot_info_t * info );
-
-/******************************************************************************************
- * This debug function displays the current values stored in the cluster_info[][] array
- * of a remote cluster identified by the <cxy> argument.
- * It can be called by a thread running in any cluster.
- ******************************************************************************************
- * @ cxy   : remote cluster identifier.
- *****************************************************************************************/
-void cluster_info_display( cxy_t  cxy );
-
-/******************************************************************************************
- * This function access the local cluster_info[][] array and returns true when the 
- * cluster identified by the <cxy> argument is active (contains a kernel instance).
- ******************************************************************************************
- * @ cxy   : checked cluster identifier.
- * @ return true if cluster contains a kernel instance.
- *****************************************************************************************/
-bool_t cluster_is_active( cxy_t  cxy );
+error_t cluster_init( boot_info_t * info );         
+
+/******************************************************************************************
+ * This function cheks the validity of a cluster identifier. TODO useful ??? [AG]
+ ******************************************************************************************
+ * @ cxy    : cluster identifier to be checked.
+ * @ returns true if the identified cluster does not exist.
+ *****************************************************************************************/
+bool_t cluster_is_undefined( cxy_t cxy );
+
+/******************************************************************************************
+ * This function register sysfs information in cluster TODO ???  [AG]
+ *****************************************************************************************/
+void cluster_sysfs_register();
+
+
+/*****************************************************************************************/
+/***************   Process Management Operations   ***************************************/
+/*****************************************************************************************/
+
+/******************************************************************************************
+ * This function returns an extended pointer on the reference process descriptor
+ * from the process PID.  It can be called by any thread running in any cluster,
+ * as it uses a RPC to the owner cluster if the current cluster is not the owner.
+ ******************************************************************************************
+ * @ pid  : process identifier.
+ * @ return extended pointer on the reference process descriptor.
+ *****************************************************************************************/
+xptr_t cluster_get_reference_process_from_pid( pid_t pid );
 
 /****************************************************************************************** 
- * This function selects (pseudo) randomly a valid cluster.
- * It is called by the vfs_cluster_lookup() function to place a new (missing) inode.
- * It is called by the vmm_page_allocate() function to place a distributed vseg page.
- * It is called by the dev_nic_accept() function to place a new server socket.
- ******************************************************************************************
- * @ returns the selected cluster identifier.
- *****************************************************************************************/
-cxy_t cluster_random_select( void );
-
-/******************************************************************************************
- * This function returns an extended pointer on the process descriptor in owner cluster
- * from the process <pid>. This PID can be be different from the calling process PID.
- * It can be called by any thread running in any cluster,
- ******************************************************************************************
- * @ pid  : process identifier.
- * @ return extended pointer on owner process if found / XPTR_NULL if not found.
- *****************************************************************************************/
-xptr_t cluster_get_owner_process_from_pid( pid_t pid );
-
-/******************************************************************************************
- * This function returns an extended pointer on the reference process descriptor
- * from the process <pid>. This PID can be be different from the calling process PID.
- * It can be called by any thread running in any cluster,
- ******************************************************************************************
- * @ pid  : process identifier.
- * @ return extended pointer on reference process if found / XPTR_NULL if not found.
- *****************************************************************************************/
-xptr_t cluster_get_reference_process_from_pid( pid_t pid );
-
-/******************************************************************************************
- * This function returns an extended pointer on the process descriptor copy for the
- * process identified by <pid> in cluster defined by <cxy> argument.
- * This PID can be be different from the calling process PID.
- * It can be called by any thread running in any cluster,
- ******************************************************************************************
- * @ cxy  : target cluster identifier.
- * @ pid  : process identifier.
- * @ return extended pointer on reference process if found / XPTR_NULL if not found.
- *****************************************************************************************/
-xptr_t cluster_get_process_from_pid_in_cxy( cxy_t cxy,
-                                            pid_t pid );
-
-/******************************************************************************************
  * This function allocates a new PID in local cluster, that becomes the process owner.
- * It registers the process descriptor extended pointer in the local processs manager
- * pref_tbl[] array. The process descriptor itself is not modified.
- * This function is called by the process_make_fork() function, 
- * by the process_make_exec() function, and by the process_init_create() function.
- ******************************************************************************************
- * @ process    : pointer on process descriptor.
+ * It register the process descriptor extended pointer in the local processs manager 
+ * pref_tbl[] array. This function is called by the rpc_process_alloc_pid() function for
+ * remote registration, or by the process_init_create() function for local registration.
+ ******************************************************************************************
+ * @ process    : [in]  extended pointer on the process descriptor.
  * @ pid        : [out] allocated PID.
- * @ return 0 if success / return -1 if no PID slot available.
- *****************************************************************************************/
-error_t cluster_pid_alloc( struct process_s * process,
-                           pid_t            * pid );
-
-/******************************************************************************************
+ * @ return 0 if success / return EAGAIN if no PID slot available 
+ *****************************************************************************************/
+error_t cluster_pid_alloc( xptr_t    process_xp,
+                           pid_t   * pid );
+
+/****************************************************************************************** 
  * This function removes a PID from the local process manager pref_tbl[] array.
  * It checks that removed process is owned by the local cluster and the lpid is legal.
@@ -263,4 +225,6 @@
 /******************************************************************************************
  * This function returns a pointer on the local process descriptor from the PID.
+ * It uses the RPC
+ * to create a local process descriptor copy if it does not exist yet.
  ******************************************************************************************
  * @ pid     : searched process identifier.
@@ -274,5 +238,5 @@
  * @ process     : pointer on local process descriptor.
  *****************************************************************************************/
-void cluster_process_local_link( struct process_s * process );
+void cluster_process_local_link( struct process_s * process ); 
 
 /******************************************************************************************
@@ -281,5 +245,5 @@
  * @ process     : pointer on local process descriptor.
  *****************************************************************************************/
-void cluster_process_local_unlink( struct process_s * process );
+void cluster_process_local_unlink( struct process_s * process ); 
 
 /******************************************************************************************
@@ -289,5 +253,5 @@
  * @ process     : pointer on local process descriptor.
  *****************************************************************************************/
-void cluster_process_copies_link( struct process_s * process );
+void cluster_process_copies_link( struct process_s * process ); 
 
 /******************************************************************************************
@@ -297,28 +261,26 @@
  * @ process     : pointer on local process descriptor.
  *****************************************************************************************/
-void cluster_process_copies_unlink( struct process_s * process );
-
-/******************************************************************************************
- * This function displays on the kernel terminal TXT0 all user processes registered
- * in the cluster defined by the <cxy> argument.
- * It can be called by a thread running in any cluster.
- ******************************************************************************************
- * @ cxy   : cluster identifier.
- * @ owned : only owned process if non zero.
- *****************************************************************************************/
-void cluster_processes_display( cxy_t   cxy,
-                                bool_t  owned );
-
-/******************************************************************************************
- * This function selects the core that has the lowest usage in a - possibly remote -
- * cluster identified by the <cxy> argument.
- * It can be called by a thread running in any cluster.
- ******************************************************************************************
- * @ cxy    : target cluster identifier.
- * @ return the selected core local index.
- *****************************************************************************************/
-lid_t cluster_select_local_core( cxy_t  cxy );
-
-             
+void cluster_process_copies_unlink( struct process_s * process ); 
+
+
+
+/*****************************************************************************************/
+/***************   Cores Management Operations   *****************************************/
+/*****************************************************************************************/
+
+/******************************************************************************************
+ * This function increments the "cores_in_kernel" variable in cluster descriptor.
+ *****************************************************************************************/
+void cluster_core_kernel_enter();
+
+/******************************************************************************************
+ * This function decrements the "cores_in_kernel" variable in cluster descriptor.
+ *****************************************************************************************/
+void cluster_core_kernel_exit();
+
+/******************************************************************************************
+ * This function returns the core local index that has the lowest usage in local cluster.
+ *****************************************************************************************/
+lid_t cluster_select_local_core();
+
 #endif	/* _CLUSTER_H_ */
-
Index: trunk/kernel/kern/cond_var.c
===================================================================
--- trunk/kernel/kern/cond_var.c	(revision 1)
+++ trunk/kernel/kern/cond_var.c	(revision 1)
@@ -0,0 +1,109 @@
+/*
+ * kern/cond_var.c - condition variables implementation
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <errno.h>
+#include <thread.h>
+#include <kmem.h>
+#include <scheduler.h>
+#include <spinlock.h>
+#include <wait_queue.h>
+#include <kmagics.h>
+#include <semaphore.h>
+#include <cond_var.h>
+
+error_t cv_init(struct cv_s *cv)
+{  
+	spinlock_init(&cv->lock, "CondVar Sync");
+	cv->signature = COND_VAR_ID;
+	wait_queue_init(&cv->wait_queue, "Condition Variable Sync");
+	return 0;
+}
+
+error_t cv_wait(struct cv_s *cv, struct semaphore_s *sem)
+{  
+	int value;
+	register error_t err;
+	register struct thread_s *this;
+
+	this = current_thread;
+	(void)sem_getvalue(sem, &value);
+
+	if((sem->owner != this) || (value > 0))
+	{
+		if(sem->scope == SEM_SCOPE_SYS)
+		{
+			printk(ERROR,"ERROR: cv_wait: TID %x, sem %x is not owned or not locked [ value %d ]\n",
+			       this, 
+			       sem, 
+			       value);
+		}
+		return EINVAL;
+	}
+
+	spinlock_lock(&cv->lock);
+
+	if((err=sem_post(sem)))
+	{
+		spinlock_unlock(&cv->lock);
+		return err;
+	}
+
+	wait_on(&cv->wait_queue, WAIT_LAST);
+
+	spinlock_unlock_nosched(&cv->lock);
+	sched_sleep(current_thread);
+
+	return sem_wait(sem);
+}
+
+error_t cv_signal(struct cv_s *cv)
+{
+	struct thread_s *thread;
+
+	spinlock_lock(&cv->lock);
+	thread = wakeup_one(&cv->wait_queue, WAIT_FIRST); 
+	spinlock_unlock(&cv->lock);
+	return 0;
+}
+
+error_t cv_broadcast(struct cv_s *cv)
+{
+	spinlock_lock(&cv->lock);
+	wakeup_all(&cv->wait_queue); 
+	spinlock_unlock(&cv->lock);
+	return 0;
+}
+
+error_t cv_destroy(struct cv_s *cv)
+{
+	register error_t err = 0;
+
+	spinlock_lock(&cv->lock);
+
+	if(!(wait_queue_isEmpty(&cv->wait_queue)))
+		err = EBUSY;
+    
+	spinlock_unlock(&cv->lock);
+  
+	return err;
+}
Index: trunk/kernel/kern/cond_var.h
===================================================================
--- trunk/kernel/kern/cond_var.h	(revision 1)
+++ trunk/kernel/kern/cond_var.h	(revision 1)
@@ -0,0 +1,58 @@
+/*
+ * kern/cond_var.h - condition variables interface
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _COND_VAR_H_
+#define _COND_VAR_H_
+
+#include <types.h>
+#include <spinlock.h>
+#include <wait_queue.h>
+
+typedef enum
+{
+	CV_INIT,
+	CV_WAIT,
+	CV_SIGNAL,
+	CV_BROADCAST,
+	CV_DESTROY
+} cv_operation_t;
+
+struct cv_s
+{
+	spinlock_t lock;
+	uint_t signature;
+	struct wait_queue_s wait_queue;
+};
+
+struct semaphore_s;
+
+error_t cv_init(struct cv_s *cv);
+error_t cv_wait(struct cv_s *cv, struct semaphore_s *sem);
+error_t cv_signal(struct cv_s *cv);
+error_t cv_broadcast(struct cv_s *cv);
+error_t cv_destroy(struct cv_s *cv);
+
+int sys_cond_var(struct cv_s **cv, uint_t operation, struct semaphore_s **sem);
+
+KMEM_OBJATTR_INIT(cv_kmem_init);
+
+#endif	/* _COND_VAR_H_ */
Index: trunk/kernel/kern/core.c
===================================================================
--- trunk/kernel/kern/core.c	(revision 690)
+++ trunk/kernel/kern/core.c	(revision 1)
@@ -1,7 +1,8 @@
 /*
  * core.c - core descriptor access function.
- *
+ * 
  * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
- *         Alain Greiner    (2016,2017,2018,2019,2020)
+ *         Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -23,21 +24,23 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
+#include <errno.h>
 #include <printk.h>
 #include <thread.h>
-#include <chdev.h>
-#include <alarm.h>
-#include <dev_pic.h>
+#include <dev_icu.h>
 #include <rpc.h>
 #include <cluster.h>
 #include <kmem.h>
+#include <sysfs.h>
+#include <dqdt.h>
 #include <core.h>
 
+
 /////////////////////////////////
-void core_init( core_t    * core,
-                lid_t       lid,
-                gid_t       gid )
+void core_init( core_t    * core, 
+                uint32_t    lid, 
+                uint32_t    gid )
 {
 	core->lid               = lid;
@@ -46,82 +49,21 @@
 	core->time_stamp        = 0;
 	core->ticks_nr          = 0;
+	core->ticks_period      = CONFIG_SCHED_TICK_PERIOD;
 	core->usage             = 0;
-	core->fpu_owner         = NULL;
-	core->rand_last         = hal_time_stamp() & 0xFFF;
-
-    // initialize the scheduler
+	core->spurious_irqs     = 0;
+    core->rpc_threads       = 0;
+
+	rpc_fifo_init( &core->rpc_fifo );
+
+    list_root_init( &core->rpc_free_list );
+
+    core->thread_rpc        = NULL;
+    core->thread_idle       = NULL;
+    core->fpu_owner         = NULL;
+	core->rand_last         =  hal_time_stamp() & 0xFFF;
+
 	sched_init( core );
 
-    // initialise the alarms lock
-    remote_busylock_init( XPTR( local_cxy , &core->alarms_lock ) , LOCK_CORE_ALARMS );
-
-    // initialise the alarms list 
-    list_root_init( &core->alarms_root );
-}
-
-////////////////////////////////////////////////////////////////////////////////////
-// This static function checks the alarms registered in the core, and calls the
-// relevant alarm handler for all alarms whose time is elapded.
-// It does not take the lock protecting the alarm list, because it access only
-// the first alarm in the list, and all modifications in he list are done
-// the low level access functions called by the handler(s). 
-////////////////////////////////////////////////////////////////////////////////////
-static void core_check_alarms( core_t * core )
-{
-    alarm_handler_t * handler;
-
-    // get pointer on root of alarms list
-    list_entry_t * root = &core->alarms_root;
-
-    // does nothing if list is empty
-    if( list_is_empty( root ) ) return;
-
-    while( 1 )
-    {
-        // get pointer on first alarm
-        alarm_t * alarm = LIST_FIRST( root , alarm_t , list );
-
-        // get first alarm date
-        cycle_t alarm_date = alarm->date; 
-
-        // get current date
-        cycle_t current_date = hal_get_cycles();
-
-        // call handler if delay elapsed, and retry
-        if( current_date >= alarm_date )
-        {
-            // get pointer on registered alarm handler
-            handler = (alarm_handler_t *)alarm->func_ptr;
-
-            // call alarm handler
-            handler( alarm->args_xp );
-        }
-        else   // exit loop when first alarm delay not elapsed
-        {
-            break;
-        }
-    }
-}   // end core_check_alarms()
-
-//////////////////////
-lid_t core_lid( void )
-{
-    uint32_t    i;
-
-    // get pointer on local cluser descriptor
-    cluster_t * cluster = LOCAL_CLUSTER;
-
-    // get core gid from hardware register
-    gid_t gid = hal_get_gid();
-
-    // makes an associative search in core_tbl[] from gid
-    for( i = 0 ; i < cluster->cores_nr ; i++ )
-    {
-        if( gid == cluster->core_tbl[i].gid ) return i;
-    }
-
-    assert( __FUNCTION__, false , "core not found" );
-
-    return 0;
+	core->icu               = NULL;          // TODO ??? [AG]
 }
 
@@ -129,23 +71,67 @@
 inline uint32_t core_get_rand( core_t * core )
 {
-	uint32_t value  = ((core->rand_last * CONFIG_RDNG_PARAM_A) +
-	                    CONFIG_RDNG_PARAM_C) ^ (hal_get_cycles() & 0xFFF);
-	core->rand_last = value;
-	return value;
+    uint32_t value  = ((core->rand_last * CONFIG_RDNG_PARAM_A) +
+                        CONFIG_RDNG_PARAM_C) ^ (hal_time_stamp() & 0xFFF);
+    core->rand_last = value;
+    return value;
+}
+
+////////////////////////////////////////////////
+inline uint64_t core_get_cycles( core_t * core )
+{
+    uint32_t elapsed;
+    uint64_t cycles;
+	uint32_t time_stamp = core->time_stamp;
+	uint32_t time_now   = hal_time_stamp();
+	
+	// compute number of elapsed cycles, taking into account 32 bits register wrap
+	if(time_now < time_stamp) elapsed = (0xFFFFFFFF - time_stamp) + time_now;
+	else                      elapsed = (time_now - time_stamp);
+
+    cycles = core->cycles + elapsed;
+
+    // update core time
+    core->time_stamp = time_now;
+    core->cycles     = cycles;
+	hal_wbflush();
+
+	return cycles;
 }
 
 ////////////////////////////////////
 void core_get_time( core_t   * core,
-                    uint32_t * tm_s, 
+                    uint32_t * tm_ms, 
                     uint32_t * tm_us )
 {
-    // get number of cycles
-    uint64_t cycles = core->cycles;
-
-    // get number of cycles per second
-    uint32_t cycles_per_second = LOCAL_CLUSTER->sys_clk;
-
-    *tm_s  = cycles / cycles_per_second;
-    *tm_us = (cycles * 1000000) % cycles_per_second;
+	// uint64_t cycles = core_get_cycles( core );
+
+    // TODO ces deux ligne ne compilent pas : "undefined referenc to __udivdi3"
+
+	// *tm_ms = (cycles / CONFIG_CYCLES_PER_MS);
+	// *tm_us = (cycles % CONFIG_CYCLES_PER_MS) / (CONFIG_CYCLES_PER_MS / 1000000);
+
+    printk("\n[PANIC] in %s : not implemented yet\n", __FUNCTION__ );
+}
+
+//////////////////////////////////////
+void core_time_update( core_t * core )
+{
+    uint32_t elapsed;
+	uint32_t ticks_nr   = core->ticks_nr;
+	uint64_t cycles     = core->cycles;
+	uint32_t time_stamp = core->time_stamp;
+	uint32_t time_now   = hal_time_stamp();
+
+    // compute number of elapsed cycles taking into account 32 bits register wrap 
+	if( time_now < time_stamp ) elapsed = (0xFFFFFFFF - time_stamp) + time_now;
+	else                        elapsed = time_now - time_stamp;
+    
+	cycles  += elapsed;
+	ticks_nr = elapsed / core->ticks_period;
+
+	core->time_stamp     = time_now;
+	core->cycles         = cycles + elapsed;
+	core->ticks_nr       = ticks_nr + (elapsed / core->ticks_period);
+	hal_wbflush();
 }
 
@@ -155,18 +141,25 @@
 	uint32_t ticks;
 
-	// update ticks counter
-	ticks = core->ticks_nr++;
-
-    // handle alarms
-    core_check_alarms( core );
-
- 	// handle scheduler
-	if( (ticks % CONFIG_SCHED_TICKS_PER_QUANTUM) == 0 ) sched_yield( "TICK");
+    // update cycles and ticks counter
+	core_time_update( core );
+
+    // get current ticks number
+	ticks = core->ticks_nr;
+
+    // handle pending alarms TODO ??? [AG]
+	// alarm_clock( &core->alarm_mgr , ticks );
+
+    // handle scheduler TODO  improve the scheduling condition ... AG
+    if( (ticks % 10) == 0 ) sched_yield();
+	
+    // update DQDT TODO  This update should depend on the cluster identifier,
+    // to avoid simultaneous updates from various clusters ... AG
+	if( ((ticks % CONFIG_DQDT_PERIOD) == 0) && (core->lid == 0) ) dqdt_global_update();
 }
 
 ////////////////////////////////////////
-void core_compute_stats( core_t * core )
-{
-	thread_t * idle  = core->scheduler.idle;
+void core_compute_stats( core_t * core ) 
+{
+	thread_t * idle  = core->thread_idle;
 	uint32_t   ticks = core->ticks_nr;
 
@@ -175,5 +168,5 @@
 	uint32_t   usage;
 
-	// compute cumulated usage
+    // compute cumulated usage       
 	ticks         = (ticks) ? ticks : 1;
 	idle_percent  = (idle->ticks_nr * 100) / ticks;
@@ -182,7 +175,12 @@
 	usage         = (busy_percent + core->usage) / 2;
 
-	// update core descriptor
+    // update core descriptor
 	core->usage = usage;
-	hal_fence();
+	hal_wbflush();
+
+#if CONFIG_SHOW_CPU_USAGE
+	printk(INFO, "INFO: core %d in cluster %x : busy_percent = %d / cumulated_usage = %d\n",
+	       core->lid, local_cxy , busy_percent , usage );
+#endif
 
 	core->ticks_nr = 0;
@@ -193,11 +191,29 @@
 void core_reset_stats( core_t * core )
 {
-	thread_t * idle  = core->scheduler.idle;
-
-	core->ticks_nr = 0;
-	core->usage    = 0;
-	idle->ticks_nr = 0;
-
-	hal_fence();
-}
-
+	core_time_update(core);
+
+	core->ticks_nr              = 0;
+	core->usage                 = 0;
+	core->thread_idle->ticks_nr = 0;
+	hal_wbflush();
+}
+
+///////////////////////////////////////////////////
+void core_set_irq_vector_entry( xptr_t     core_xp,
+                                uint32_t   irq_type,
+                                uint32_t   irq_id,
+                                xptr_t     dev_xp )
+{
+    // get core cluster and local pointer
+    cxy_t    core_cxy = GET_CXY( core_xp );
+    core_t * core_ptr = (core_t *)GET_PTR( core_xp );
+
+    // compute xptr on relevant interrupt vector entry
+    xptr_t   xp;
+    if     ( irq_type == WTI_TYPE ) xp = XPTR( core_cxy , &core_ptr->wti_vector[irq_id] );
+    else if( irq_type == HWI_TYPE ) xp = XPTR( core_cxy , &core_ptr->hwi_vector[irq_id] );
+    else                            xp = XPTR( core_cxy , &core_ptr->pti_vector[irq_id] );
+
+    // set relevant IRQ vector entry
+    hal_remote_swd( xp , dev_xp );
+}
Index: trunk/kernel/kern/core.h
===================================================================
--- trunk/kernel/kern/core.h	(revision 690)
+++ trunk/kernel/kern/core.h	(revision 1)
@@ -1,7 +1,8 @@
 /*
  * core.h - core descriptor and associated access functions définition
- *
+ * 
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
- *          Alain Greiner (2016,2017,2018)
+ *          Mohamed Lamine Karaoui (2015)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,27 +27,19 @@
 #define _CORE_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <busylock.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <list.h>
 #include <rpc.h>
 #include <scheduler.h>
+#include <sysfs.h>
 
 /****  Forward declarations  ****/
 
 struct thread_s;
-struct chdev_s;
+struct device_s;
+
 
 /****************************************************************************************
- * This structure defines a core descriptor.
- * Besides the core identifiers (gid,lid), it contains an embedded private scheduler
- * and a software cycles counter on 64 bits.
- * It contains also the root of local list of alarms, dynamically registered by the
- * threads running on this core. This local list is protected by a remote_busylock,
- * because it can be accessed by any thread, running in any cluster, and using the
- * access functions defined in the <alarm.c> & <alarm.h> files. 
- * It contains an architecture specific extension to store the interrupt vector(s).
- * The core_init()function must allocate memory for this extension, depending on the
- * PIC device implementation type.
+ * This structure defines the core descriptor
  ***************************************************************************************/
 
@@ -54,46 +47,49 @@
 {
 	lid_t               lid;            /*! core local index in cluster                */
-	gid_t               gid;            /*! core global identifier (hardware index)    */
-
-	scheduler_t         scheduler;      /*! embedded private scheduler                 */
-
+	gid_t               gid;            /*! core global identifier (hardware index)    */   
 	uint64_t            cycles;         /*! total number of cycles (from hard reset)   */
 	uint32_t            time_stamp;     /*! previous time stamp (read from register)   */
+	uint32_t            ticks_nr;       /*! number of elapsed ticks                    */
+	uint32_t            ticks_period;   /*! number of cycles between two ticks         */
+	uint32_t            usage;          /*! cumulated busy_percent (idle / total)      */
+	uint32_t            spurious_irqs;  /*! for instrumentation...                     */
+	struct thread_s   * thread_rpc;     /*! pointer on current RPC thread descriptor   */
+	struct thread_s   * thread_idle;    /*! pointer on idle thread descriptor          */
+	struct thread_s   * fpu_owner;      /*! pointer on current FPU owner thread        */ 
+    uint32_t            rand_last;      /*! last computed random value                 */
+	uint32_t            rpc_threads;    /*! total number of RPC threads for this core  */
+	list_entry_t        rpc_free_list;  /*! root of the list of free RPC threads       */
+	rpc_fifo_t          rpc_fifo;       /*! embedded private RPC fifo (one per core)   */
+	scheduler_t         scheduler;      /*! embedded private scheduler                 */
+    struct device_s   * icu;            /*! pointer on local ICU device descriptor     */
 
-    list_entry_t        alarms_root;    /*! root of list of attached alarms            */
-    remote_busylock_t   alarms_lock;    /*! lock protecting the list of alarms         */
+    xptr_t              hwi_vector[CONFIG_MAX_HWIS_PER_ICU];     /*! on source device  */
+    xptr_t              pti_vector[CONFIG_MAX_PTIS_PER_ICU];     /*! on source device  */
+    xptr_t              wti_vector[CONFIG_MAX_WTIS_PER_ICU];     /*! on source device  */
 
-	uint32_t            ticks_nr;       /*! number of elapsed ticks                    */
-	uint32_t            usage;          /*! cumulated busy_percent (idle / total)      */
-	struct thread_s   * fpu_owner;      /*! pointer on current FPU owner thread        */
-    uint32_t            rand_last;      /*! last computed random value                 */
-
-    void              * pic_extend;     /*! PIC implementation specific extension      */
-}
+	char                name[CONFIG_SYSFS_NAME_LEN];
+	sysfs_entry_t       node;
+} 
 core_t;
 
 /***************************************************************************************
- * This function initializes a core descriptor.
+ * This macro returns a pointer on the calling core descriptor.
+ **************************************************************************************/
+
+#define CURRENT_CORE  (CURRENT_THREAD->core)
+
+/***************************************************************************************
+ * TODO this initialisation must be completed for the thread_idle field... [AG]
+ * This function initializes a core descriptor from information found in arch_info.
  * It makes the association [gid] <=> [lid], as defined in arch_info, via the
  * boot_info_t structure build by the bootloader in each cluster.
- * It initializes the core scheduler structures, and the alarms list and lock.
- * It allocates memory for the PIC infrastructure specific core extension,
- * but it does NOT initialize the <pic_extend> fields, that must be completed later.
  ***************************************************************************************
  * @ core      : pointer on core descriptor to initialise.
- * @ lid       : local core index in cluster.
- * @ gid       : global core identifier (hardware index).
+ * @ lid       : local core index 
+ * @ gid       : global core identifier (hardware index)
  **************************************************************************************/
-void core_init( core_t          * core,
-                lid_t             lid,
-                gid_t             gid );
-
-/***************************************************************************************
- * This function returns the calling core local index (lid), making an associative
- * search in the local core_tbl[] array, based on the hardwired (gid).
- ***************************************************************************************
- * @ returns always the lid value.
- **************************************************************************************/
-lid_t core_lid( void );
+void core_init( core_t   * core, 
+                lid_t      lid, 
+                gid_t      gid );
 
 /***************************************************************************************
@@ -107,6 +103,19 @@
 
 /***************************************************************************************
- * This function returns the current date (seconds & micro-seconds) from 
- * the 64 bits calling core cycles counter.
+ * This function returns the current date (cycles) from both 
+ * the hardware 32 bits cycles counter and the core descriptor cycles counter, 
+ * taking into account the 32 bits hardware register overflow.
+ * The core descriptor time is updated.
+ ***************************************************************************************
+ * @ core       : pointer on core descriptor.
+ * @ returns the number of cycles.
+ **************************************************************************************/
+inline uint64_t core_get_cycles( core_t * core );
+
+/***************************************************************************************
+ * This function returns the current date (seconds & micro-seconds) from both
+ * the hardware 32 bits cycles counter and the core descriptor cycles counter, 
+ * taking into account the 32 bits hardware register overflow.
+ * The core descriptor time is updated.
  ***************************************************************************************
  * @ core      : pointer on core descriptor.
@@ -120,7 +129,8 @@
 /***************************************************************************************
  * This function must be called at each TICK.
- * - it updates the ticks counter in the calling core descriptor.
- * - it checks the registered alarms depending on the ticks counter value.
- * - it calls the scheduler, depending on the ticks counter value.
+ * It updates the  cycles and ticks counter in the calling core descriptor.
+ * It handles all pending alarms depending on the ticks counter value.
+ * It handles the scheduling, depending on the ticks counter value. 
+ * It handles the global DQDT update, depending on the ticks counter vakue.
  ***************************************************************************************
  * @ core       : pointer on core descriptor.
@@ -129,5 +139,5 @@
 
 /***************************************************************************************
- * This function updates the usage statistics for the calling core descriptor,
+ * This function updates the usage statistics for the calling core descriptor, 
  * based on the ratio between the idle_ticks and total_ticks.
  ***************************************************************************************
@@ -137,5 +147,5 @@
 
 /***************************************************************************************
- * This function reset the usage statistics.
+ * This function and reset the usage statistics.
  ***************************************************************************************
  * @ core       : pointer on core descriptor.
@@ -146,16 +156,16 @@
  * This function set/reset a selected entry in one interrupt vector for a remote core.
  * The written value is an extended pointer on the "source" device (or the XPTR_NULL
- * value in case of reset). As it uses remote access, this function can be called by
+ * value in case of reset). As it uses remote access, this function can be called by 
  * any thread in any cluster.
  ***************************************************************************************
- * @ core       : local pointer on the core descriptor.
+ * @ core_xp    : extended pointer on the core descriptor.
  * @ irq_type   : type of IRQ (HWI/WTI/PTI).
  * @ irq_id     : index in the IRQ vector.
- * @ chdev      : local pointer on the "source" chdev descriptor.
+ * @ dev_xp     : extended pointer on the "source" descriptor.
  **************************************************************************************/
-void core_set_irq_vector_entry( core_t          * core,
-                                uint32_t          irq_type,
-                                uint32_t          irq_id,
-                                struct chdev_s  * chdev );
+void core_set_irq_vector_entry( xptr_t     core_xp,
+                                uint32_t   irq_type,
+                                uint32_t   irq_id,
+                                xptr_t     dev_xp );
 
 
Index: trunk/kernel/kern/cpu-trace.h
===================================================================
--- trunk/kernel/kern/cpu-trace.h	(revision 1)
+++ trunk/kernel/kern/cpu-trace.h	(revision 1)
@@ -0,0 +1,108 @@
+/*
+ * kern/cpu-trace.h - Per-CPU, In-core trace system
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _CPU_TRACE_H_
+#define _CPU_TRACE_H_
+
+#include <config.h>
+#include <types.h>
+#include <kdmsg.h>
+
+/** Opaque CPU trace recorder */
+struct cpu_trace_recorder_s;
+
+/** Write CPU trace information to current CPU recorder */
+#define cpu_trace_write(_cpu,func)
+
+/** Dump CPU trace log to specified tty */
+static inline void cpu_trace_dump(struct cpu_s *cpu);
+
+
+///////////////////////////////////////////////////////////////////////
+//                         Private Section                           //
+///////////////////////////////////////////////////////////////////////
+
+#define CPU_TRACE_LOG_LENGTH      100
+
+/** Private trace info structure */
+typedef struct cpu_trace_info_s
+{
+	uint_t time_stamp;
+	void *func_addr;
+	uint_t stack_ptr;
+	void *thread_ptr;
+	uint_t line;
+}cpu_trace_info_t;
+
+/** Opaque CPU trace recorder */
+struct cpu_trace_recorder_s
+{
+	uint_t current_index;
+	cpu_trace_info_t log[CPU_TRACE_LOG_LENGTH];
+};
+
+
+#if CONFIG_CPU_TRACE
+#undef  cpu_trace_write
+#define cpu_trace_write(_cpu,func)					\
+	do{{								\
+			uint_t state;					\
+			cpu_disable_all_irq(&state);			\
+			cpu_trace_info_t *info = &(_cpu)->trace_recorder->log[(_cpu)->trace_recorder->current_index]; \
+			info->time_stamp = cpu_time_stamp();		\
+			info->func_addr  = (func);			\
+			info->stack_ptr  = cpu_get_stack();		\
+			info->thread_ptr = cpu_get_current_thread();	\
+			(_cpu)->trace_recorder->current_index = ((_cpu)->trace_recorder->current_index  + 1) % CPU_TRACE_LOG_LENGTH; \
+			cpu_restore_irq(state);				\
+		}}while(0)
+
+static inline void cpu_trace_dump(struct cpu_s *cpu)
+{
+	register uint_t i;
+	register cpu_trace_info_t *info;
+  
+	except_dmsg("------------------------------------------\n");
+	except_dmsg("TRACE DUMP FOR CPU %d\n", cpu->gid);
+
+	for(i=0; i < CPU_TRACE_LOG_LENGTH; i++)
+	{
+		info = &cpu->trace_recorder->log[i];
+		except_dmsg("Entry %d\n", i);
+		except_dmsg("\tTimeStamp %d\n\tFunction: %x\n\tLine %d\n\tStack %x\n\tThread %x\n",
+			    info->time_stamp, info->func_addr, info->line, info->stack_ptr, info->thread_ptr);
+	}
+	except_dmsg("---> Current_index: %d\n", cpu->trace_recorder->current_index);
+}
+
+#else
+
+#define cpu_trace_write(_cpu,func)
+
+static inline void cpu_trace_dump(struct cpu_s *cpu)
+{
+	/* Nothing to do */
+}
+
+#endif	/* CONFIG_CPU_TRACE */
+
+#endif	/* _CPU_TRACE_H_ */
Index: trunk/kernel/kern/device.c
===================================================================
--- trunk/kernel/kern/device.c	(revision 1)
+++ trunk/kernel/kern/device.c	(revision 1)
@@ -0,0 +1,162 @@
+/*
+ * device.c - device descriptor operations implementation
+ *
+ * Authors  Alain Greiner   (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <hal_special.h>
+#include <boot_info.h>
+#include <xlist.h>
+#include <kmem.h>
+#include <thread.h>
+#include <rpc.h>
+#include <device.h>
+
+////////////////////////////////////////////////////////////////////////////////////
+// This array defines printable strings for devices functionnal types.
+////////////////////////////////////////////////////////////////////////////////////
+
+char * device_func_str[DEV_FUNC_NR] = 
+{
+  	"RAM",
+	"ROM",
+	"TXT",
+    "FBF",
+    "IOB",
+    "IOC",
+    "MMC",
+    "MWR",
+    "NIC",
+    "CMA",
+    "XCU",
+    "PIC"
+};
+
+////////////////////////////////////////
+xptr_t device_alloc( boot_info_t * info,
+                     bool_t        is_local )
+{
+    xptr_t     dev_xp;
+    device_t * dev_ptr;
+    uint32_t   index;
+    uint32_t   x;
+    uint32_t   y;
+    cxy_t      target_cxy;
+    kmem_req_t req;
+    error_t    error;
+
+    if( is_local )  // forced local allocation
+    {
+        req.type   = KMEM_DEVICE;
+        req.flags  = AF_ZERO;
+        dev_ptr    = (device_t *)kmem_alloc( &req );
+
+        if( dev_ptr == NULL ) return XPTR_NULL;
+        else                  return ( XPTR( local_cxy , dev_ptr ) );
+    }
+    else            // likely remote allocation
+    {
+        // select (pseudo-randomly) a target cluster
+        index      = ( hal_time_stamp() + hal_get_gid() ) % (info->x_size * info->y_size);
+        x          = index / info->y_size;    
+        y          = index % info->y_size;
+        target_cxy = (x<<info->y_width) + y;
+
+        if( target_cxy == local_cxy )   // local allocation
+        {
+            req.type   = KMEM_DEVICE;
+            req.flags  = AF_ZERO;
+            dev_ptr    = (device_t *)kmem_alloc( &req );
+
+            if( dev_ptr == NULL ) return XPTR_NULL;
+            else                  return ( XPTR( local_cxy , dev_ptr ) );
+        }
+        else                          // remote allocation
+        {
+            rpc_device_alloc_client( target_cxy , &dev_xp , &error );
+            if( error ) return XPTR_NULL;
+            else        return ( dev_xp );
+             
+        }
+    }   
+} // end device_alloc()
+
+
+/////////////////////////////////////
+void device_init( xptr_t      device,
+                  uint32_t    func,
+                  uint32_t    impl,
+                  uint32_t    channel,
+                  uint32_t    is_rx,
+                  xptr_t      base,
+                  uint32_t    size )
+{
+    // get device cluster and local pointer
+    cxy_t      cxy = GET_CXY( device );
+    device_t * ptr = (device_t *)GET_PTR( device );
+
+    // initialize waiting threads queue and associated lock
+    remote_spinlock_init( XPTR( cxy , &ptr->wait_lock ) );
+    xlist_root_init( XPTR( cxy , &ptr->wait_root ) );
+
+    // initialize basic attributes
+    hal_remote_sw ( XPTR( cxy , &ptr->func    ) , (uint32_t)func    );
+    hal_remote_sw ( XPTR( cxy , &ptr->impl    ) , (uint32_t)impl    );
+    hal_remote_sw ( XPTR( cxy , &ptr->channel ) , (uint32_t)channel );
+    hal_remote_sw ( XPTR( cxy , &ptr->is_rx   ) , (uint32_t)is_rx   );
+    hal_remote_swd( XPTR( cxy , &ptr->base    ) , (uint64_t)base    ); 
+    hal_remote_sw ( XPTR( cxy , &ptr->size    ) , (uint64_t)size    ); 
+
+}  // end device_init()
+
+////////////////////////////////////////////////
+void device_register_command( xptr_t     xp_dev,
+                              thread_t * thread )
+{
+    thread_t * thread_ptr = CURRENT_THREAD;
+
+    // get device descriptor cluster and local pointer
+    cxy_t      dev_cxy = GET_CXY( xp_dev );
+    device_t * dev_ptr = (device_t *)GET_PTR( xp_dev );
+
+    // build extended pointers on client thread xlist and device root
+    xptr_t  xp_list = XPTR( local_cxy , &thread_ptr->wait_list );
+    xptr_t  xp_root = XPTR( dev_cxy , &dev_ptr->wait_root );
+
+    // get lock protecting queue
+    remote_spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+
+    // register client thread in waiting queue 
+    xlist_add_last( xp_root , xp_list );
+
+    // unblock server thread
+    thread_unblock( XPTR( dev_cxy , &dev_ptr->server ) , THREAD_BLOCKED_DEV_QUEUE );
+
+    // release lock
+    remote_spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );
+
+    // client thread goes to blocked state and deschedule
+    thread_block( thread_ptr , THREAD_BLOCKED_IO );
+    sched_yield();
+
+}  // end device register_command()
+
Index: trunk/kernel/kern/device.h
===================================================================
--- trunk/kernel/kern/device.h	(revision 1)
+++ trunk/kernel/kern/device.h	(revision 1)
@@ -0,0 +1,231 @@
+/*
+ * device.h - kernel definition of a device
+ * 
+ * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *          Mohamed Karaoui  (2015)
+ *          Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DEVICE_H_
+#define _DEVICE_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <xlist.h>
+#include <metafs.h>
+#include <remote_spinlock.h>
+#include <dev_ioc.h>
+#include <dev_nic.h>
+#include <dev_icu.h>
+#include <dev_pic.h>
+
+/****  Forward declarations  ****/
+
+struct  device_s;
+struct  thread_s;
+struct  boot_info_s;
+
+/******************************************************************************************
+ * These macros extract the functionality and the implementation from the peripheral type.
+ *****************************************************************************************/
+ 
+#define FUNC_FROM_TYPE( type )    ((uint32_t)(type>>16))
+#define IMPL_FROM_TYPE( type )    ((uint32_t)(type & 0x0000FFFF))
+
+/******************************************************************************************
+ * This define the generic prototypes for the three functions that must be defined
+ * by all drivers :
+ * - "init"    : device initialisation.
+ * - "command" : start an I/O operation.
+ * - "isr"     : complete an I/O operation.
+ * The "init" function is called by kernel_init() to initialise the hardware device.
+ * The "cmd" and "isr" are registered in the generic device descriptor by kernel_init(),
+ * and are called to start and complete an I/O operation.  
+*****************************************************************************************/
+
+typedef void (dev_ini_t) ( xptr_t dev );      
+typedef void (dev_cmd_t) ( xptr_t thread );  
+typedef void (dev_isr_t) ( struct device_s * dev );  
+
+/******************************************************************************************
+ * This enum defines the supported generic device types.
+ * These types are functionnal types: all (architecture specific) implementations 
+ * provide the same set of operations and the same driver API.
+ * This enum must be kept consistent with the enum in arch_info.h file
+ *****************************************************************************************/
+ 
+enum dev_func_type 
+{
+	DEV_FUNC_RAM   =  0,     /*! Random Access Memory                                    */
+	DEV_FUNC_ROM   =  1,     /*! Read Only Memory                                        */
+	DEV_FUNC_TXT   =  2,     /*! Text Terminal Controler                                 */
+    DEV_FUNC_FBF   =  3,     /*! Frame Buffer Controler                                  */
+    DEV_FUNC_IOB   =  4,     /*! I/O Bridge Component                                    */
+	DEV_FUNC_IOC   =  5,     /*! Block Device Controler                                  */
+	DEV_FUNC_MMC   =  6,     /*! L2 cache Configuration                                  */
+	DEV_FUNC_MWR   =  7,     /*! Hardware coprocessor                                    */
+	DEV_FUNC_NIC   =  8,     /*! GMII Network Interface Controler                        */
+	DEV_FUNC_CMA   =  9,     /*! Chained buffers DMA Controler                           */
+	DEV_FUNC_ICU   = 10,     /*! Interrupt Controler Unit                                */
+	DEV_FUNC_PIC   = 11,     /*! HWI to WTI translator                                   */
+
+    DEV_FUNC_NR    = 12,
+};
+
+/******************************************************************************************
+ * This structure defines a device descriptor.
+ * There is one device descriptor per peripheral channel.
+ * This structure is NOT replicated, and can be located in any cluster.
+ * One kernel thread, in charge of handling the commands registered in the waiting queue
+ * of client threads is associated to each device descriptor.
+ * The device specific extensions are defined in the relevant device file.
+ *****************************************************************************************/
+
+typedef struct device_s
+{
+	uint32_t             func;        /*! peripheral functionnal type                    */
+	uint32_t             impl;        /*! peripheral inplementation subtype              */
+    uint32_t             channel;     /*! channel index                                  */
+    bool_t               is_rx;       /*! relevant for NIC peripheral channels only      */
+	xptr_t               base;        /*! extended pointer on channel segment            */
+    uint32_t             size;        /*! channel_segment size                           */
+
+    dev_cmd_t          * cmd;         /*! local pointer on driver command function       */
+    dev_isr_t          * isr;         /*! local pointer on driver ISR function           */  
+    struct thread_s    * server;      /*! local pointer on associated server thread      */
+
+    uint32_t             irq_type;    /*! associated IRQ type in local ICU               */
+    uint32_t             irq_id;      /*! associated IRQ index in local ICU              */
+
+    metafs_t             node;        /*! Metafs node associated with this device        */
+	char                 name[16];    /*! device name in file system                     */
+
+	remote_spinlock_t    wait_lock;	  /*! lock protecting exclusive access to queue      */
+    xlist_entry_t        wait_root;   /*! root of waiting threads queue                  */
+
+    union
+    {
+        ioc_extend_t     ioc;         /*! IOC specific extension                         */
+        nic_extend_t     nic;         /*! NIC specific extension                         */
+        icu_extend_t     icu;         /*! ICU specific extension                         */
+        pic_extend_t     pic;         /*! PIC specific extension                         */
+    } 
+    ext;
+}
+device_t;
+
+/******************************************************************************************
+ * This structure defines the devices descriptors directory.
+ * Each entry in this structure contains an extended pointers on a device descriptor.
+ * There is one entry per channel for an external peripheral.
+ * There is one entry per cluster for an internal peripheral.
+ * This structure exists in each cluster, and is initialised during kernel init.
+ * It is used for fast access to a device descriptor, from type and channel for an
+ * external peripheral, or from type and cluster for an internal peripheral.
+ *****************************************************************************************/
+
+typedef struct devices_directory_s
+{
+    xptr_t   txt[CONFIG_MAX_TXT_CHANNELS];
+    xptr_t   ioc;
+    xptr_t   nic_rx[CONFIG_MAX_NIC_CHANNELS];
+    xptr_t   nic_tx[CONFIG_MAX_NIC_CHANNELS];
+    xptr_t   pic;
+    xptr_t   iob;
+    xptr_t   icu[CONFIG_MAX_CLUSTERS];
+    xptr_t   mmc[CONFIG_MAX_CLUSTERS];
+    xptr_t   mwr[CONFIG_MAX_CLUSTERS];
+}
+devices_directory_t;
+
+/******************************************************************************************
+ * This structure defines the input IRQS for the PIC and ICU devices.
+ * External peripherals IRQS (IOC, TXT, NIC) are connected to the PIC component, while
+ * internal peripherals IRQs (MMC, MWR) are connected to the local ICU component.
+ * Each entry in this structure contains the input IRQ index in PIC or ICU.
+ * Value is -1 if the IRQ for a peripheral channel is not connected.
+ * There is one entry per channel for an external peripheral.
+ * There is one entry per cluster for an internal peripheral.
+ * This structure exists in each cluster, and is initialised during kernel init.
+ * It is mainly used for fast PIC configuration when the kernel start a new I/O 
+ * operation to an external peripheral, as it gives the IRQ index from type and channel.
+ *****************************************************************************************/
+
+typedef struct devices_input_irq_s
+{
+    uint32_t   txt[CONFIG_MAX_TXT_CHANNELS];
+    uint32_t   ioc;
+    uint32_t   nic_rx[CONFIG_MAX_NIC_CHANNELS];
+    uint32_t   nic_tx[CONFIG_MAX_CMA_CHANNELS];
+    uint32_t   mmc[CONFIG_MAX_CLUSTERS];
+    uint32_t   mwr[CONFIG_MAX_CLUSTERS];
+}
+devices_input_irq_t;
+
+
+
+/******************************************************************************************
+ * This  function allocates memory for a device descriptor.
+ * - For a local (replicated) peripheral it allocates memory in local cluster.
+ * - For an external peripheral, it uses the global variable "device_alloc_index"
+ *   to select a remote cluster and send a RPC to make the allocation.
+ * In both cases it returns an extended pointer on the device descriptor.
+ ******************************************************************************************
+ * @ info       : pointer on local boot_info structure.
+ * @ is_local   : local (replicated) peripheral.
+ * @ returns an extended pointer on device if success / returns XPTR_NUL if error.
+ *****************************************************************************************/
+xptr_t device_alloc( struct boot_info_s * info,
+                     bool_t               is_local );
+
+/******************************************************************************************
+ * This  function initialises the basic fields from arguments values. 
+ * The device specific fields are initialised later.
+ * It uses remote_write accesses, and can be called in any cluster.
+ ******************************************************************************************
+ * @ dev       : extended pointer to device descriptor.
+ * @ func      : functionnal type.
+ * @ impl      : implementation type.
+ * @ channel   : channel index / for multi-channels peripherals.
+ * @ is_rx     : for NIC peripheral / NIC RX if true / NIC TX if false.
+ * @ base      : extended pointer on channel segment base.
+ * @ size      : channel segment size (bytes).
+ *****************************************************************************************/
+void device_init( xptr_t      dev,
+                  uint32_t    func,
+                  uint32_t    impl,
+                  uint32_t    channel,
+                  bool_t      is_rx,
+                  xptr_t      base,
+                  uint32_t    size );
+
+/******************************************************************************************
+ * This function registers a local client thread in the waiting queue of a remote 
+ * device descriptor, activates (i.e. unblock) the server thread associated to device,
+ * and blocks itself on the THREAD_BLOCKED_IO condition.
+ ******************************************************************************************
+ * @ dev     : extended pointer on remote device descriptor.
+ * @ thread  : local pointer on client thread.
+ *****************************************************************************************/
+void device_register_command( xptr_t            xp_dev,
+                              struct thread_s * thread );
+
+
+#endif	/* _DEVICE_H_ */
Index: trunk/kernel/kern/dma.h
===================================================================
--- trunk/kernel/kern/dma.h	(revision 1)
+++ trunk/kernel/kern/dma.h	(revision 1)
@@ -0,0 +1,37 @@
+/*
+ * kern/dma.h - DMA related access
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _DMA_H_
+#define _DMA_H_
+
+#include <types.h>
+#include <kmem.h>
+
+#define DMA_SYNC    0
+#define DMA_ASYNC   1
+
+int sys_dma_memcpy (void *src, void *dst, size_t size);
+error_t dma_memcpy (void *dst, void *src, size_t size, uint_t isAsync);
+
+KMEM_OBJATTR_INIT(dma_kmem_request_init);
+
+#endif	/* _DMA_H_ */
Index: trunk/kernel/kern/do_exec.c
===================================================================
--- trunk/kernel/kern/do_exec.c	(revision 1)
+++ trunk/kernel/kern/do_exec.c	(revision 1)
@@ -0,0 +1,657 @@
+/*
+ * kern/do_exec.c - excecutes a new user process, load init.
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012,2013,2014,2015 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdarg.h>
+#include <config.h>
+#include <errno.h>
+#include <types.h>
+#include <libk.h>
+#include <bits.h>
+#include <kmem.h>
+#include <process.h>
+#include <cpu.h>
+#include <pmm.h>
+#include <page.h>
+#include <process.h>
+#include <thread.h>
+#include <pid.h>
+#include <list.h>
+#include <vfs.h>
+#include <sys-vfs.h>
+#include <scheduler.h>
+#include <spinlock.h>
+#include <cluster.h>
+#include <ku_transfert.h>
+#include <dqdt.h>
+
+#define USR_LIMIT  (CONFIG_USR_LIMIT)
+
+#define DEV_STDIN   CONFIG_DEV_STDIN
+#define DEV_STDOUT  CONFIG_DEV_STDOUT
+#define DEV_STDERR  CONFIG_DEV_STDERR
+
+#define TASK_DEFAULT_HEAP_SIZE  CONFIG_TASK_HEAP_MIN_SIZE
+
+#define INIT_PATH   "/bin/init"
+
+/* FIXME : ecopy et estrlen attendent une adresse de vecteur dans l'espace utilisateur. Or pour
+ * l'instant l'environnement des processus est "forgé" dans do_exec(), c'est donc des buffers
+ * noyaux. Solution temporaire : on utilise kexec_copy et kexec_strlen.
+ */
+//////////////////////////////////////
+error_t args_len( char        ** vect, 
+                  uint32_t       pages_max, 
+		          uint32_t     * pages_nr,
+                  uint32_t     * entries_nr,
+		          exec_copy_t    ecopy, 
+                  exec_strlen_t  estrlen)
+{
+	uint32_t     cntr;
+	uint32_t     pgnr;
+	error_t      error;
+	uint32_t     count;
+	uint32_t     len;
+    char       * ptr;
+  
+	cntr  = 0;
+	count = 0;
+	pgnr  = 0;
+
+	while(1)
+	{
+		if((error = ecopy(&ptr, &vect[cntr], sizeof(ptr))))
+		{
+			printk(INFO, "INFO: %s:%s: EFAULT Has been Catched on vect, cntr %d, strlen &vect[%x] = %x\n",  \
+                                        __FUNCTION__, __LINE__, cntr, &vect[cntr], vect[cntr]);
+			return err;
+		}
+
+		if(ptr == NULL)
+                        break;
+
+		if((err=estrlen(ptr, &len)))
+		{
+                        printk(INFO, "INFO: %s:%s: EFAULT Has been Catched, cntr %d, strlen &vect[%x] = %x\n",          \
+                                        __FUNCTION__, __LINE__, cntr, &vect[cntr], vect[cntr]);
+			return err;
+		}
+		cntr  ++;
+		len   ++;
+		count += (ARROUND_UP(len, 8));
+		pgnr   = ARROUND_UP(count, PMM_PAGE_SIZE);
+    
+		if((pgnr >> PMM_PAGE_SHIFT) >= pages_max)
+			return E2BIG;
+	}
+
+	count       = (cntr + 1) * sizeof(char*);
+	*pages_nr   = (ARROUND_UP(count, PMM_PAGE_SIZE)) / PMM_PAGE_SIZE;
+	*entries_nr = cntr;
+	return 0;
+}
+
+//for now the pointers can be either be from uspace
+//or kernel space. Solutions :
+//first keep this binaroty and add a flag to
+//choose how to copy the arguments
+//second make them all user space ptr
+//third make them kernel space ptr
+//the first solution (although ugly), is the most
+//perfroming(compared to u->k) and simple 
+//(compared to k->u)
+
+//////////////////////////////////////////////
+//////////////////////////////////////////////
+error_t compute_args( process_t     * process, 
+		              char         ** vect,
+		              page_t       ** pgtbl,
+		              uint32_t        pages_max, 
+		              uint32_t        start,
+		              uint32_t      * current, 
+		              uint32_t      * pgnr,
+		              uint32_t      * pgindex,
+		              exec_copy_t     ecopy, 
+		              exec_strlen_t   estrlen)
+{
+	kmem_req_t req;
+	uint32_t   count;
+	uint32_t   cntr;
+	uint32_t   pages_nr;
+	char    ** args;
+	char     * ptr;
+	uint32_t   i;
+	uint32_t   len;
+	uint32_t   index;
+	uint32_t   paddr;
+	error_t    error;
+
+	req.type  = KMEM_PAGE;
+	req.size  = 0;
+	req.flags = AF_USER | AF_ZERO | AF_REMOTE;
+	req.ptr   = process->cluster;
+
+	pages_nr  = 0;
+	count     = 0;
+	cntr      = 0;
+	index     = *pgindex;
+
+	error = args_len(vect, pages_max, &pages_nr, &cntr, ecopy, estrlen);
+  
+	if( error ) return error;
+
+	*pgnr += pages_nr;
+
+	for(i = index; i < (pages_nr + index); i++)
+	{
+		pgtbl[i] = kmem_alloc(&req);
+    
+		if(pgtbl[i] == NULL) return ENOMEM;
+	}
+  
+	*current = start - (pages_nr * PMM_PAGE_SIZE);
+ 
+	paddr = (uint32_t) ppm_page2addr(pgtbl[index]);
+	count = (cntr + 1) * sizeof(char*);
+	args = (char **) paddr;
+	pages_nr = 0;
+
+	/* Copy the table of pointer */
+	while(count > PMM_PAGE_SIZE)
+	{
+		error = ecopy((void*)paddr, vect + (pages_nr << PMM_PAGE_SHIFT), PMM_PAGE_SIZE);
+
+		if( error ) return error;
+   
+		index ++;
+		paddr  = (uint32_t) ppm_page2addr(pgtbl[index]);
+		count -= PMM_PAGE_SIZE;
+		pages_nr ++;
+	}
+
+	if(count > 0)
+	{
+		error = ecopy((void*)paddr, vect + (pages_nr << PMM_PAGE_SHIFT), count);
+		if( error ) return error;
+	}
+
+	paddr += count;
+ 
+	/* Copy the the table of pointer content */
+	for(i=0; i < cntr; i++)
+	{
+		if((error = ecopy(&ptr, &vect[i], sizeof(ptr))))
+		{
+			printk(INFO, "INFO: %s: EFAULT Has been Catched on vect\n", __FUNCTION__);
+			return err;
+		}
+
+		error = estrlen(ptr, &len);
+		if(err) return err;
+		len++;
+
+
+		/* Update pointer */
+		args[i] = (char*)(*current + (pages_nr << PMM_PAGE_SHIFT) + count);
+    
+		/* The content could span multiple pages */
+		while(len)
+		{
+			if((PMM_PAGE_SIZE - count) > (ARROUND_UP(len, 8)))
+			{
+				error = ecopy((void*)paddr, ptr, len);
+				if(err) return err;
+				paddr += (ARROUND_UP(len, 8));
+				count += (ARROUND_UP(len, 8));
+				len = 0;
+			}
+			else
+			{
+				error = ecopy((void*)paddr, ptr, PMM_PAGE_SIZE - count);
+				if(err) return err;
+				ptr += (PMM_PAGE_SIZE - count);
+				len -= (PMM_PAGE_SIZE - count);
+				index ++;
+				paddr = (uint32_t) ppm_page2addr(pgtbl[index]);
+				pages_nr ++;
+				count = 0;
+			}
+		}
+	}
+
+	*pgindex = index + 1;  
+	return 0;
+}
+
+///////////////////////////////////////
+error_t map_args( process_s  * process,
+		          page_t    ** pgtbl, 
+		          uint32_t     start_index, 
+		          uint32_t     end_index,
+		          uint32_t     start_addr )
+{
+	struct pmm_s *pmm;
+	pmm_page_info_t info;
+	uint32_t current_vma;
+	error_t err;
+	uint32_t i;
+
+	pmm = &process->vmm.pmm;
+	info.attr = PMM_PRESENT | PMM_READ | PMM_WRITE | PMM_CACHED | PMM_USER; 
+	info.cluster = process->cluster;
+	current_vma = start_addr;
+
+	for(i = start_index; i < end_index; i++)
+	{    
+		info.ppn = ppm_page2ppn(pgtbl[i]);
+    
+		if((error = pmm_set_page(pmm, current_vma, &info)))
+			return err;
+
+		pgtbl[i] = NULL;
+		current_vma += PMM_PAGE_SIZE;
+	}
+  
+	return 0;
+}
+
+//////////////////////////////////////
+error_t do_exec( process_t  * process,
+ 	             char       * pathname,
+		         page_t     * pgtbl[],
+		         uint32_t     env_end,
+		         uint32_t     env_index,
+		         uint32_t     argv_end,    // user_stack_top
+		         uint32_t     argv_index,
+                 thread_t  ** new )
+{
+ 	error_t        error;
+ 	pthread_attr_t attr;
+ 	uint32_t       usr_stack_top;
+ 	int32_t        order;
+ 	thread_t     * main_thread;
+ 
+	attr.arg2     = (void*)env_end;	/* environ */
+	attr.arg1     = (void*)argv_end;	/* argv */
+	usr_stack_top = argv_end;
+ 
+    /* FIXME:
+     * zero should not be hard-coded. Use something like MAIN_KERNEL which represents the
+     * kernel with the init and sh processes (assuming that both of them are on the same kernel).
+     */
+
+	if( ((process->pid != PID_MIN_GLOBAL+1) && (current_cid == 0)) ||
+                ( (process->pid != PID_MIN_GLOBAL) && (current_cid != 0) ) )
+ 	{
+ 		vmm_destroy(&process->vmm);
+ 		pmm_release(&process->vmm.pmm);    
+		error = vmm_init(&process->vmm);
+		if(err) goto DO_EXEC_ERR;
+	}
+ 
+	attr.stack_addr = (void*)(usr_stack_top - CONFIG_PTHREAD_STACK_SIZE);
+	attr.stack_size = CONFIG_PTHREAD_STACK_SIZE;
+
+    // create stack vseg
+	error = (error_t) vmm_mmap( process,
+				                attr.stack_addr,                            // base
+				                USR_LIMIT - (uint32_t)attr.stack_addr,      // size
+                                VSEG_TYPE_STACK,                            // type
+				                VSEG_RD | VSEG_WR,                          // flags
+//				                PRIVATE | ANON | STACK | FIXED,  
+                                NULL,                                       // file
+                                0 );                                        // offset 
+  
+	if( error == VM_FAILURE )
+	{
+		error = CURRENT_THREAD->info.errno;
+		printk(INFO, "%s: failed to mmap main's stack for process %x / error = %d\n", 
+		       __FUNCTION__, process->pid , error );
+        return error;
+	}
+
+    // TODO ??? AG        
+	error = map_args(process, pgtbl, 0, env_index, (uint32_t)attr.arg2);
+ 	if( error )
+    {
+        return error;
+    }
+ 
+    // TODO ??? AG        
+	error = map_args(process, pgtbl, env_index, argv_index, (uint32_t)attr.arg1);
+ 	if(err)
+    {
+        return error;
+    }
+
+    // register "entry_point" in VMM, register "code" and "data" vsegs in VMM,
+    // using informations contained in the elf file identified by the pathname.
+	error = elf_load_process( path_name , process );
+	if( error )
+	{
+		printk(INFO, "%s: failed to access elf for process %x\n", 
+		       __FUNCTION__, process->pid );
+        return error;
+	}
+
+    // create "heap" vseg
+	error = (error_t) vmm_mmap( process,
+				                (void *)process->vmm.heap_start,            // base
+				                PROCESS_DEFAULT_HEAP_SIZE,                  // size
+                                VSEG_TYPE_HEAP,                             // type
+                                VSEG_RD | VSEG_WR,                          // flags
+//				                PRIVATE | ANON | HEAP | FIXED, 
+                                NULL,                                       // file
+                                0 );                                        // offset
+
+	if( error == VM_FAILURE )
+	{
+		error = CURRENT_THREAD->info.errno;
+		printk(INFO, "%s: failed to mmap heap for process %x\n", 
+		       __FUNCTION__, process->pid );
+		return error;
+	}
+
+	process->vmm.heap_current += TASK_DEFAULT_HEAP_SIZE;
+
+    // initialize pthread attributes
+    attr.pid          = exec_info->pid;
+    attr.entry_func   = (void*)process->vmm.entry_point;
+    attr.entry_args   = bloup;               // TODO [AG] 
+    attr.flags        = PT_FLAG_DETACH; 
+    attr.stack_size   = CONFIG_PTHREAD_STACK_SIZE;
+	attr.sched_policy = SCHED_RR;
+    attr.cxy          = LOCAL_CLUSTER;
+    attr.lid          = bloup;               // TODO [AG]  
+
+//	attr.flags = (CURRENT_THREAD->info.attr.flags | PT_ATTR_DETACH);
+//	attr.sched_policy = SCHED_RR;
+//	attr.cid = process->cluster->id;
+//	attr.cpu_lid = process->cpu->lid;
+//	attr.cpu_gid = process->cpu->gid;
+//	attr.entry_func = (void*)process->vmm.entry_point;
+//	attr.exit_func = NULL;
+//	attr.stack_size = attr.stack_size - SIG_DEFAULT_STACK_SIZE;
+//	attr.sigstack_addr = (void*)((uint32_t)attr.stack_addr + attr.stack_size);
+//	attr.sigstack_size = SIG_DEFAULT_STACK_SIZE;
+//	attr.sigreturn_func = 0;
+
+    // create and initialise thread descriptor,
+    // register the thread in local process descriptor
+	error = thread_user_create( &attr , &main_thread );
+	if( error )
+	{
+		printk(INFO, "%s: failed to create main thread for process %x\n"
+		       __FUNCTION__, process->pid );
+        return error;
+	}
+  
+	return 0;
+}  // end do_exec()
+
+//////////////////////////////////////////////////////////////////////
+//
+//////////////////////////////////////////////////////////////////////
+error_t prepare_args( process_t   * process,
+			          char       ** argv,
+                      char       ** envp,
+                      page_t      * pgtbl[],
+    	              uint32_t    * argv_index,
+                      uint32_t    * env_index,
+                      uint32_t    * argv_end,
+                      uint32_t    * env_end,
+                      exec_copy_t   ecopy,
+                      exec_strlen_t estrlen )
+{
+	uint32_t usr_stack_top = USR_LIMIT;
+	uint32_t pages_nr      = 0;
+	uint32_t pages_max     = CONFIG_TASK_ARGS_PAGES_MAX_NR;
+	uint32_t index         = 0;
+	error_t  error         = 0;
+
+	memset( &pgtbl[0] , 0 , pages_max*sizeof(page_t *) );
+
+    // env_index & env_end
+	error = compute_args( process,
+			              envp,
+			              &pgtbl[0],
+			              pages_max,
+			              USR_LIMIT,
+			              &usr_stack_top,
+			              &pages_nr,
+			              &index,
+			              ecopy,
+			              estrlen );
+
+	*env_index = index;
+	*env_end   = usr_stack_top;  	/* environ */
+
+	if( error ) return error;
+
+    // argv_index & argv_end
+	error = compute_args( process,
+			              argv,
+			              &pgtbl[0],
+			              pages_max - pages_nr,
+			              usr_stack_top,
+			              &usr_stack_top,
+			              &pages_nr,
+			              &index,
+			              ecopy,
+			              estrlen );
+
+	*argv_index = index;
+	*argv_end   = usr_stack_top;	/* argv */
+
+	return error;
+}
+
+//////////////////////////////////
+void free_args( page_t * pgtbl[] )
+{
+	uint32_t index;
+
+	for(index = 0; index < CONFIG_TASK_ARGS_PAGES_MAX_NR; index ++)
+	{
+		if(pgtbl[index] != NULL)
+			ppm_free_pages(pgtbl[index]);
+	}
+}
+
+/////////////////////////////////////////////
+error_t full_do_exec( process_t    * process,
+		              char         * path_name,
+		              char        ** argv,
+		              char        ** envp,
+		              uint32_t     * isFatal,
+		              thread_t    ** new,
+		              exec_copy_t    ecopy,
+		              exec_strlen_t  estrlen )
+{
+	error_t    err;
+	uint32_t   argv_index;
+	uint32_t   env_index;
+	uint32_t   argv_end;
+	uint32_t   env_end;
+    page_t   * pgtbl[CONFIG_TASK_ARGS_PAGES_MAX_NR];
+
+ 	*isFatal = 0;
+	error = prepare_args( process, 
+                        argv, 
+                        envp,
+			            pgtbl, 
+                        &argv_index,
+			            &env_index,
+			            &argv_end,
+			            &env_end,
+			            ecopy,
+			            estrlen );
+
+	if(err)
+		goto EXEC_EXIT;
+
+	error = do_exec( process, 
+                   path_name, 
+                   &pgtbl[0],  
+                   env_end, 
+			       env_index,
+                   argv_end, 
+                   argv_index,
+                   new );
+
+	if(err)
+ 	{
+		printk(INFO, "%s: do_exec failed",  __FUNCTION__);
+		*isFatal = 1;
+	}
+
+EXEC_EXIT:
+	if(err)
+	{
+		free_args(pgtbl);
+ 	}
+ 
+ 	return err;
+}
+
+
+///////////////////////////////////
+error_t kexec_copy( void     * dst,
+                    void     * src,
+                    uint32_t   count )
+{
+	memcpy( dst , src , count );
+	return 0;
+}
+
+/////////////////////////////////////
+error_t kexec_strlen( char     * dst,
+                      uint32_t * count)
+{
+	*count = strlen( dst );
+	return 0;
+}
+
+////////////////////////////////////////////////
+error_t process_load_init( process_t * process )
+{
+	process_t   * init;
+	dqdt_attr_t   attr;
+	thread_t    * main_thread;
+
+	struct vfs_file_s stdin;
+	struct vfs_file_s stdout;
+	struct vfs_file_s stderr;
+	struct ku_obj ku_path;
+
+	error_t err;
+	error_t err1;
+	error_t err2;
+	uint32_t isFatal;
+	char *environ[] = {"ALMOS_VERSION="CONFIG_ALMOS_VERSION, NULL};
+	char *argv[]    = {INIT_PATH, "init", NULL};
+
+	printk(INFO, "INFO: Loading Init Process [ %s ]\n", INIT_PATH);
+
+	error = dqdt_process_placement(dqdt_root, &attr);
+        /* Force init to be on current cluster */
+        attr.cid_exec = current_cid;
+
+	assert(error == 0);
+
+	if((error = process_create(&init, &attr, CPU_USR_MODE)))
+		return err;
+
+	error = vmm_init(&init->vmm);
+
+	if(err) goto INIT_ERR;
+
+	error = pmm_init(&init->vmm.pmm, current_cluster);
+
+	if(err) goto INIT_ERR;
+  
+	error = pmm_dup(&init->vmm.pmm, &process->vmm.pmm);
+  
+	if(err) goto INIT_ERR;
+  
+	vfs_file_up(&process->vfs_root);
+	init->vfs_root = process->vfs_root;
+
+	vfs_file_up(&process->vfs_root);
+	init->vfs_cwd  = process->vfs_root;
+
+	init->vmm.limit_addr = CONFIG_USR_LIMIT;
+	init->uid = 0;
+	init->parent = process->pid;
+	atomic_init(&init->childs_nr, 0);
+	atomic_init(&process->childs_nr, 1);
+  
+	list_add_last(&process->children, &init->list);
+
+	KK_BUFF(ku_path, ((void*) DEV_STDIN));
+	error  = vfs_open(&init->vfs_cwd, &ku_path,  VFS_O_RDONLY, 0, &stdin);
+	KK_BUFF(ku_path, ((void*) DEV_STDOUT));
+	err1 = vfs_open(&init->vfs_cwd, &ku_path, VFS_O_WRONLY, 0, &stdout);
+	KK_BUFF(ku_path, ((void*) DEV_STDERR));
+	err2 = vfs_open(&init->vfs_cwd, &ku_path, VFS_O_WRONLY, 0, &stderr);
+
+	if(error || err1 || err2)
+	{
+		if(!err)  vfs_close(&stdin,  NULL);
+		if(!err1) vfs_close(&stdout, NULL);
+		if(!err2) vfs_close(&stderr, NULL);
+    
+		printk(ERROR,"ERROR: do_exec: cannot open fds [%d, %d, %d]\n", err, err1, err2);
+		error = ENOMEM;
+    
+		goto INIT_ERR;
+	}
+
+	process_fd_set(init, 0, &stdin);
+	process_fd_set(init, 1, &stdout);
+	process_fd_set(init, 2, &stderr);
+
+	CURRENT_THREAD->info.attr.flags = PT_ATTR_AUTO_NXTT | PT_ATTR_MEM_PRIO | PT_ATTR_AUTO_MGRT;
+
+	error = full_do_exec(init, INIT_PATH, &argv[0], &environ[0], &isFatal, 
+				&main_thread, kexec_copy, kexec_strlen);
+  
+	if(error == 0)
+	{
+		assert(main_thread != NULL && (main_thread->signature == THREAD_ID));
+		init->state = TASK_READY;
+		error = sched_register(main_thread);
+		assert(error == 0); 		/* FIXME: ask DQDT for another core */
+
+#if CONFIG_ENABLE_TASK_TRACE
+		main_thread->info.isTraced = true;
+#endif
+		sched_add_created(main_thread);
+
+                printk(INFO, "INFO: Init Process Loaded [ %s ]\n", INIT_PATH);
+
+		return 0;
+	}
+
+INIT_ERR:
+	process_destroy(init);
+	return err;
+}
Index: trunk/kernel/kern/do_interrupt.c
===================================================================
--- trunk/kernel/kern/do_interrupt.c	(revision 1)
+++ trunk/kernel/kern/do_interrupt.c	(revision 1)
@@ -0,0 +1,96 @@
+/*
+ * kern/do_interrupt.c - kernel unified interrupt entry-point
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <cpu.h>
+#include <task.h>
+#include <thread.h>
+#include <cpu-trace.h>
+#include <device.h>
+#include <system.h>
+#include <signal.h>
+
+#define irq_cpu_dmsg(c,...)				\
+	do{						\
+		if(cpu_get_id() == (c))			\
+			isr_dmsg(INFO, __VA_ARGS__);	\
+	}while(0)
+
+void do_interrupt(struct thread_s *this, uint_t irq_num)
+{
+	register thread_state_t old_state;
+	struct irq_action_s *action;
+	struct cpu_s *cpu;
+	uint_t irq_state;
+	error_t ret;
+
+	cpu_trace_write(thread_current_cpu(this), do_interrupt);
+
+	cpu = thread_current_cpu(this);
+
+	cpu->irq_nr ++;
+	old_state = this->state;
+
+	if(old_state == S_USR)
+	{
+		this->state = S_KERNEL;
+		tm_usr_compute(this);
+	}
+
+	arch_cpu_get_irq_entry(cpu, irq_num, &action);
+	action->irq_handler(action);
+	   
+	cpu_yield();
+
+	if(old_state != S_USR)//and not a kernel thread ?
+		return;
+
+	/* it is safe to migrate as we are going to user *
+	 * space.					 */
+	if(thread_migration_isActivated(this))
+	{
+		thread_clear_cap_migrate(this);
+		cpu_enable_all_irq(&irq_state);
+		ret = thread_migrate(this,-1);
+		cpu_restore_irq(irq_state);
+
+		/* this pointer has expired */
+		this = CURRENT_THREAD;
+		cpu_wbflush();
+
+		if(ret == 0)	
+			thread_migration_deactivate(this);
+		else
+		{
+			isr_dmsg(INFO, 
+			"%s: cpu %d, migration failed for victim pid %d, tid %d, err %d\n", 
+			 __FUNCTION__, 
+			 cpu_get_id(),
+			 this->task->pid,
+			 this->info.order,
+			 ret);
+		}
+	}
+	
+	tm_sys_compute(this);
+	this->state = S_USR;
+	signal_notify(this);
+}
Index: trunk/kernel/kern/do_syscall.c
===================================================================
--- trunk/kernel/kern/do_syscall.c	(revision 690)
+++ 	(revision )
@@ -1,224 +1,0 @@
-/*
- * do_syscall.c - architecture independant entry-point for system calls.
- * 
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <do_syscall.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <syscalls.h>
-#include <shared_syscalls.h>
-#include <syscalls_numbers.h>
-
-///////////////////////////////////////////////////////////////////////////////////////
-// This ƒonction should never be called...
-///////////////////////////////////////////////////////////////////////////////////////
-int sys_undefined( void )
-{
-    assert( __FUNCTION__, false , "undefined system call" );
-    return 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////////////
-// This array of pointers define the kernel functions implementing the syscalls.
-// It must be kept consistent with the enum in <syscalls_numbers.h> file,
-// and with the SYS_OBJs defined in the kernel <Makefile>.
-///////////////////////////////////////////////////////////////////////////////////////
-
-typedef int (*sys_func_t) ();
-
-static const sys_func_t syscall_tbl[SYSCALLS_NR] = 
-{
-    sys_thread_exit,        // 0
-    sys_thread_yield,       // 1 
-    sys_thread_create,      // 2
-    sys_thread_join,        // 3
-    sys_thread_detach,      // 4
-    sys_thread_cancel,      // 5
-    sys_sem,                // 6
-    sys_condvar,            // 7
-    sys_barrier,            // 8
-    sys_mutex,              // 9
-
-    sys_rename,             // 10
-    sys_munmap,             // 11
-    sys_open,               // 12
-    sys_mmap,               // 13
-    sys_read,               // 14
-    sys_write,              // 15
-    sys_lseek,              // 16
-    sys_close,              // 17
-    sys_unlink,             // 18
-    sys_pipe,               // 19
-
-    sys_chdir,              // 20
-    sys_mkdir,              // 21
-    sys_mkfifo,             // 22
-    sys_opendir,            // 23
-    sys_readdir,            // 24
-    sys_closedir,           // 25
-    sys_getcwd,             // 26
-    sys_isatty,             // 27  
-    sys_alarm,              // 28
-    sys_rmdir,              // 29
-
-    sys_utls,               // 30
-    sys_chmod,              // 31
-    sys_signal,             // 32 
-    sys_timeofday,          // 33
-    sys_kill,               // 34
-    sys_getpid,             // 35
-    sys_fork,               // 36
-    sys_exec,               // 37
-    sys_stat,               // 38
-    sys_wait,               // 39
-
-    sys_get,                // 40
-    sys_display,            // 41
-    sys_place_fork,         // 42
-    sys_thread_sleep,       // 43
-    sys_thread_wakeup,      // 44
-    sys_trace,              // 45
-    sys_fg,                 // 46
-    sys_is_fg,              // 47
-    sys_fbf,                // 48
-    sys_undefined,          // 49   //
-
-    sys_exit,               // 50
-    sys_sync,               // 51
-    sys_fsync,              // 52
-    sys_socket,             // 53
-};
-
-////////////////////////////////////////////
-const char * syscall_str( syscalls_t index )
-{
-    switch (index) 
-    {
-    case SYS_THREAD_EXIT:                  return "THREAD_EXIT";      // 0
-    case SYS_THREAD_YIELD:                 return "THREAD_YIELD";     // 1
-    case SYS_THREAD_CREATE:                return "THREAD_CREATE";    // 2
-    case SYS_THREAD_JOIN:                  return "THREAD_JOIN";      // 3
-    case SYS_THREAD_DETACH:                return "THREAD_DETACH";    // 4
-    case SYS_THREAD_CANCEL:                return "THREAD_CANCEL";    // 5
-    case SYS_SEM :                         return "SEM";              // 6
-    case SYS_CONDVAR:                      return "CONDVAR";          // 7
-    case SYS_BARRIER:                      return "BARRIER";          // 8
-    case SYS_MUTEX :                       return "MUTEX";            // 9
-
-    case SYS_RENAME:                       return "RENAME";           // 10
-    case SYS_MUNMAP:                       return "MUNMAP";           // 11
-    case SYS_OPEN:                         return "OPEN";             // 12
-    case SYS_MMAP:                         return "MMAP";             // 13
-    case SYS_READ:                         return "READ";             // 14
-    case SYS_WRITE:                        return "WRITE";            // 15
-    case SYS_LSEEK:                        return "LSEEK";            // 16
-    case SYS_CLOSE:                        return "CLOSE";            // 17
-    case SYS_UNLINK:                       return "UNLINK";           // 18
-    case SYS_PIPE:                         return "PIPE";             // 19
-
-    case SYS_CHDIR:                        return "CHDIR";            // 20
-    case SYS_MKDIR:                        return "MKDIR";            // 21
-    case SYS_MKFIFO:                       return "MKFIFO";           // 22
-    case SYS_OPENDIR:                      return "OPENDIR";          // 23
-    case SYS_READDIR:                      return "READDIR";          // 24
-    case SYS_CLOSEDIR:                     return "CLOSEDIR";         // 25
-    case SYS_GETCWD:                       return "GETCWD";           // 26
-    case SYS_ISATTY:                       return "ISATTY";           // 27
-    case SYS_ALARM :                       return "ALARM";            // 28
-    case SYS_RMDIR :                       return "RMDIR";            // 29
-
-    case SYS_UTLS:                         return "UTLS";             // 30
-    case SYS_CHMOD :                       return "CHMOD";            // 31
-    case SYS_SIGNAL:                       return "SIGNAL";           // 32
-    case SYS_TIMEOFDAY:                    return "TIMEOFDAY";        // 33
-    case SYS_KILL:                         return "KILL";             // 34
-    case SYS_GETPID:                       return "GETPID";           // 35
-    case SYS_FORK:                         return "FORK";             // 36
-    case SYS_EXEC:                         return "EXEC";             // 37
-    case SYS_STAT:                         return "STAT";             // 38
-    case SYS_WAIT:                         return "WAIT";             // 39
-
-    case SYS_GET:                          return "GET";              // 40
-    case SYS_DISPLAY:                      return "DISPLAY";          // 41
-    case SYS_PLACE_FORK:                   return "PLACE_FORK";       // 42
-    case SYS_THREAD_SLEEP:                 return "THREAD_SLEEP";     // 43
-    case SYS_THREAD_WAKEUP:                return "THREAD_WAKEUP";    // 44
-    case SYS_TRACE:                        return "TRACE";            // 45
-    case SYS_FG:                           return "FG";               // 46
-    case SYS_IS_FG:                        return "IS_FG";            // 47
-    case SYS_FBF:                          return "FBF";              // 48
-
-    case SYS_EXIT:                         return "EXIT";             // 50
-    case SYS_SYNC:                         return "SYNC";             // 51
-    case SYS_FSYNC:                        return "FSYNC";            // 52
-    case SYS_SOCKET:                       return "SOCKET";           // 53
-
-    default:                               return "undefined";
-    }
-}
-
-
-//////////////////////////////////
-reg_t do_syscall( thread_t * this,
-                  reg_t      arg0,
-		          reg_t      arg1,
-		          reg_t      arg2,
-		          reg_t      arg3,
-		          reg_t      service_num )
-{
-	int  error = 0;
-	
-    assert( __FUNCTION__, (this == CURRENT_THREAD),
-    "wrong <this> argument\n" );
-
-    // update user time 
-	thread_time_update( this , 1 );  
-
-    // check syscall index
-	if( service_num >= SYSCALLS_NR )
-	{
-		printk("\n[ERROR] in %s : Undefined syscall %d, for thread %x\n",
-		       __FUNCTION__ , service_num , this );
-
-		this->errno = ENOSYS;
-	    hal_disable_irq(NULL);
-		return ENOSYS;;
-	}
-
-    // reset errno
-	this->errno = 0;
-
-    // call relevant kernel function
-	error = syscall_tbl[service_num] ( arg0 , arg1 , arg2 , arg3 );
-
-    // check kernel stack overflow
-    assert( __FUNCTION__, (CURRENT_THREAD->signature == THREAD_SIGNATURE),
-    "kernel stack overflow after for thread %x in cluster %x\n", CURRENT_THREAD, local_cxy );
-
-    // update kernel time
-	thread_time_update( this , 0 );
-
-	return error;
-}
Index: trunk/kernel/kern/do_syscall.h
===================================================================
--- trunk/kernel/kern/do_syscall.h	(revision 690)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
- * do_syscall.h - generic syscall handler.
- * 
- * Authors   Ghassan Almaless (2008,2009,2010,2011,2012)
- *           Mohamed Lamine Karaoui (2015)
- *           Alain Greiner (2016)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _DO_SYSCALL_H_
-#define _D0_SYSCALL_H_
-
-#include <hal_kernel_types.h>
-#include <thread.h>
-
-/**************************************************************************************
- * This function calls the kernel function defined by the <service_num> argument.
- * The possible values for service_num are defined in the syscalls/syscalls.h file.
- * It does NOT enable interrupts, that must be enabled by the kernel function
- * depending on the implemented service. 
- **************************************************************************************
- * @ this        : pointer on calling thread descriptor
- * @ arg0        : kernel function argument 0
- * @ arg1        : kernel function argument 1
- * @ arg2        : kernel function argument 2
- * @ arg3        : kernel function argument 3
- * @ service_num : kernel service index
- * @ return 0 if success / return non zero if failure.
- *************************************************************************************/
-reg_t do_syscall( thread_t * this,
-                  reg_t      arg0,
-		          reg_t      arg1,
-		          reg_t      arg2,
-		          reg_t      arg3,
-		          reg_t      service_num );
-
-#endif  // _DO_SYSCALL_H_
Index: trunk/kernel/kern/dqdt.c
===================================================================
--- trunk/kernel/kern/dqdt.c	(revision 690)
+++ trunk/kernel/kern/dqdt.c	(revision 1)
@@ -1,6 +1,6 @@
 /*
  * dqdt.c - Distributed Quaternary Decision Tree implementation.
- *
- * Author : Alain Greiner (2016,2017,2018,2019)
+ * 
+ * Author : Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -22,13 +22,10 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <hal_macros.h>
 #include <hal_atomic.h>
 #include <hal_remote.h>
-#include <thread.h>
 #include <printk.h>
-#include <chdev.h>
 #include <cluster.h>
 #include <bits.h>
@@ -36,555 +33,223 @@
 
 
-///////////////////////////////////////////////////////////////////////////////////////////
-//      Extern variables
-///////////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t  chdev_dir;  // defined in chdev.h / allocated in kernel_init.c
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static recursive function traverse the DQDT quad-tree from root to bottom.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void dqdt_recursive_print( xptr_t  node_xp )
-{
-	uint32_t x;
-	uint32_t y;
-    dqdt_node_t node;
-
-    // get node local copy
-    hal_remote_memcpy( XPTR( local_cxy , &node ), node_xp , sizeof(dqdt_node_t) );
-
-    // display node content
-	nolock_printk("- [%d,%x] : threads %x / pages %x / clusters %d / cores %d / parent_cxy %x\n",
-                  node.level, GET_CXY( node_xp ),
-                  node.threads, node.pages,
-                  node.clusters, node.cores,
-                  GET_CXY( node.parent ) );
+///////////////////////////////////////////
+void dqdt_local_print( dqdt_node_t * node )
+{
+	printk("DQDT node : level = %d / cluster = %x / threads = %x / pages = %x\n",
+	       node->level,
+	       local_cxy,
+	       node->threads,
+           node->pages );
+}
+
+/////////////////////////////////////////
+void dqdt_global_print( xptr_t  node_xp )
+{
+	uint32_t i;
+    dqdt_node_t local_node;
+
+    // get root node local copy
+    hal_remote_memcpy( XPTR( local_cxy , &local_node ), node_xp , sizeof(dqdt_node_t) );
+
+    // display DQDT node content
+    dqdt_local_print( &local_node );
 
     // recursive call on children if node is not terminal
-    if ( node.level > 0 )
-    {
-        for ( x = 0 ; x < 2 ; x++ )
+    if ( local_node.level > 0 )
+    {
+        for ( i = 0 ; i < 4 ; i++ )
         {
-            for ( y = 0 ; y < 2 ; y++ )
-            {
-                xptr_t iter_xp = node.children[x][y];
-                if ( iter_xp != XPTR_NULL ) dqdt_recursive_print( iter_xp );
-            }
+            if ( local_node.children[i] != XPTR_NULL ) dqdt_global_print( local_node.children[i] );
         }
     }
-}
-
-/////////////////////////
-void dqdt_display( void )
-{
-    // get extended pointer on DQDT root node
-	cluster_t * cluster = &cluster_manager;
-    xptr_t      root_xp = cluster->dqdt_root_xp;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock
-    remote_busylock_acquire( lock_xp );
-
-    // print header
-    nolock_printk("\n***** DQDT state\n\n");
-
-    // call recursive function
-    dqdt_recursive_print( root_xp );
-
-    // release TXT0 lock
-    remote_busylock_release( lock_xp );
-}
-
-///////////////////////////////////////////////////////////////////////////////////////
-// This static function initializes recursively, from top to bottom, the quad-tree
-// infrastructure. The DQDT nodes are allocated as global variables in each local
-// cluster manager. At each level in the quad-tree, this function initializes the
-// node identified by the <cxy> and <level> arguments, selects in each child 
-// macro-cluster the precise cluster where will be placed the subtree root node, 
-// and call recursively itself to initialize the child node in the selected cluster.
-///////////////////////////////////////////////////////////////////////////////////////
-// @ node cxy  : cluster containing the node to initialize
-// @ level     : level of node to be initialised
-// @ parent_xp : extended pointer on the parent node
-///////////////////////////////////////////////////////////////////////////////////////
-static void dqdt_recursive_build( cxy_t    node_cxy,
-                                  uint32_t level,
-                                  xptr_t   parent_xp )
-{
-    assert( __FUNCTION__, (level <= 5) , "illegal DQDT level\n" );
-  
-    uint32_t node_x;         // node X coordinate
-    uint32_t node_y;         // node Y coordinate
-    uint32_t mask;           // to compute associated macro-cluster coordinates
-    uint32_t node_base_x;    // associated macro_cluster X coordinate
-    uint32_t node_base_y;    // associated macro_cluster y coordinate
-    uint32_t half;           // associated macro-cluster half size
-    uint32_t cores;          // number of cores in macro cluster
-    uint32_t clusters;       // number of clusters in macro cluster
-
-    // get node cluster coordinates
-    node_x = HAL_X_FROM_CXY( node_cxy );
-    node_y = HAL_Y_FROM_CXY( node_cxy );
-        
-    // get macro-cluster mask and half-size
-    mask   = (1 << level) - 1;
-    half   = (level > 0) ? (1 << (level - 1)) : 0;
-
-    // get macro-cluster coordinates 
-    node_base_x = node_x & ~mask;
-    node_base_y = node_y & ~mask;
-
-    // get pointer on local cluster manager
-    cluster_t * cluster = LOCAL_CLUSTER;
-
-    // build local and extended pointer on node to be initialized
-    dqdt_node_t * node_ptr = &cluster->dqdt_tbl[level];
-    xptr_t        node_xp  = XPTR( node_cxy , node_ptr );
-
-#if DEBUG_DQDT_INIT
-printk("\n[%s] thread[%x,%x] : cxy(%d,%d) / level %d / mask %x / half %d / ptr %x\n",
-__FUNCTION__, node_x, node_y, level, mask, half, node_ptr );
-#endif
-  
-    // make remote node default initialisation
-    hal_remote_memset( node_xp , 0 , sizeof( dqdt_node_t ) );
-
-    // initialize <parent> field
-    hal_remote_s64( XPTR( node_cxy , &node_ptr->parent ) , parent_xp );
-
-    // initialize <level> field
-    hal_remote_s32( XPTR( node_cxy , &node_ptr->level ) , level );
-
-    // recursive initialisation 
-    if( level == 0 )                      // terminal case : cluster
-    {
-        // initialize <clusters> field in node
-        hal_remote_s32( XPTR( node_cxy , &node_ptr->clusters ) , 1 );
-
-        // initialize <cores> field in node
-        cores = hal_remote_l32( XPTR ( node_cxy , &cluster->cores_nr ) );
-        hal_remote_s32( XPTR( node_cxy , &node_ptr->cores ) , cores );
-    }
-    else                                  // non terminal : macro-cluster
-    {
-        bool_t        found;
-        uint32_t      x;
-        uint32_t      y;
-        cxy_t         child_cxy;
-        xptr_t        child_xp;
-        dqdt_node_t * child_ptr =  &cluster->dqdt_tbl[level-1];
-
-        // search an active cluster in child[0][0] macro-cluster
-        found = false; 
-        for( x = node_base_x ; 
-        (x < (node_base_x + half)) && (found == false) ; x++ )
-        {
-            for( y = node_base_y ; 
-            (y < (node_base_y + half)) && (found == false) ; y++ )
-            {
-                child_cxy = HAL_CXY_FROM_XY( x , y );
-
-                if( cluster_is_active( child_cxy ) )
-                {
-                    // initialize recursively selected child[0][0] node
-                    dqdt_recursive_build( child_cxy , level-1 , node_xp );
-
-                    // build extended pointer on child[0][0] node
-                    child_xp = XPTR( child_cxy , child_ptr );
-
-                    // update <cores> field in node
-                    cores = hal_remote_l32( XPTR ( child_cxy , &child_ptr->cores ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->cores ) , cores );
-
-                    // update <clusters> field in node
-                    clusters = hal_remote_l32( XPTR ( child_cxy , &child_ptr->clusters ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->clusters ) , clusters );
-
-                    // update <child[0][0]> field in node
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->children[0][0] ), child_xp );
-
-                    // udate <arity> field in node
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->arity ) , 1 );
-   
-                    // exit loops
-                    found = true;
-                }
-            }
-        }
-
-        // search an active cluster in child[0][1] macro-cluster
-        found = false; 
-        for( x = node_base_x ; 
-        (x < (node_base_x + half)) && (found == false) ; x++ )
-        {
-            for( y = (node_base_y + half) ; 
-            (y < (node_base_y + (half<<1))) && (found == false) ; y++ )
-            {
-                child_cxy = HAL_CXY_FROM_XY( x , y );
-
-                if( cluster_is_active( child_cxy ) )
-                {
-                    // initialize recursively selected child[0][1] node
-                    dqdt_recursive_build( child_cxy , level-1 , node_xp );
-
-                    // build extended pointer on child[0][1] node
-                    child_xp = XPTR( child_cxy , child_ptr );
-
-                    // update <cores> field in node
-                    cores = hal_remote_l32( XPTR ( child_cxy , &child_ptr->cores ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->cores ) , cores );
-
-                    // update <clusters> field in node
-                    clusters = hal_remote_l32( XPTR ( child_cxy , &child_ptr->clusters ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->clusters ) , clusters );
-
-                    // update <child[0][1]> field in node
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->children[0][1] ), child_xp );
-
-                    // udate <arity> field in node
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->arity ) , 1 );
-   
-                    // exit loops
-                    found = true;
-                }
-            }
-        }
-
-        // search an active cluster in child[1][0] macro-cluster
-        found = false; 
-        for( x = (node_base_x +half) ; 
-        (x < (node_base_x + (half<<1))) && (found == false) ; x++ )
-        {
-            for( y = node_base_y ; 
-            (y < (node_base_y + half)) && (found == false) ; y++ )
-            {
-                child_cxy = HAL_CXY_FROM_XY( x , y );
-
-                if( cluster_is_active( child_cxy ) )
-                {
-                    // initialize recursively selected child[1][0] node
-                    dqdt_recursive_build( child_cxy , level-1 , node_xp );
-
-                    // build extended pointer on child[1][0] node
-                    child_xp = XPTR( child_cxy , child_ptr );
-
-                    // update <cores> field in node
-                    cores = hal_remote_l32( XPTR ( child_cxy , &child_ptr->cores ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->cores ) , cores );
-
-                    // update <clusters> field in node
-                    clusters = hal_remote_l32( XPTR ( child_cxy , &child_ptr->clusters ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->clusters ) , clusters );
-
-                    // update <child[1][0]> field in node
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->children[1][0] ), child_xp );
-
-                    // udate <arity> field in node
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->arity ) , 1 );
-   
-                    // exit loops
-                    found = true;
-                }
-            }
-        }
-
-        // search an active cluster in child[1][1] macro-cluster
-        found = false; 
-        for( x = (node_base_x + half) ; 
-        (x < (node_base_x + (half<<1))) && (found == false) ; x++ )
-        {
-            for( y = (node_base_y + half) ; 
-            (y < (node_base_y + (half<<1))) && (found == false) ; y++ )
-            {
-                child_cxy = HAL_CXY_FROM_XY( x , y );
-
-                if( cluster_is_active( child_cxy ) )
-                {
-                    // initialize recursively selected child[1][1] node
-                    dqdt_recursive_build( child_cxy , level-1 , node_xp );
-
-                    // build extended pointer on child[1][1] node
-                    child_xp = XPTR( child_cxy , child_ptr );
-
-                    // update <cores> field in node
-                    cores = hal_remote_l32( XPTR ( child_cxy , &child_ptr->cores ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->cores ) , cores );
-
-                    // update <clusters> field in node
-                    clusters = hal_remote_l32( XPTR ( child_cxy , &child_ptr->clusters ) );
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->clusters ) , clusters );
-
-                    // update <child[1][1]> field in node
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->children[1][1] ), child_xp );
-
-                    // udate <arity> field in node
-                    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->arity ) , 1 );
-   
-                    // exit loops
-                    found = true;
-                }
-            }
-        }
-    }
-}  // end dqdt_recursive_build()
-
-//////////////////////
-void dqdt_init( void )
-{
-    // get x_size & y_size
-    cluster_t * cluster = LOCAL_CLUSTER;
-    uint32_t    x_size  = cluster->x_size;
-    uint32_t    y_size  = cluster->y_size;
-
-    assert( __FUNCTION__, ((x_size <= 16) && (y_size <= 16)) , "illegal mesh size\n");
- 
+}  
+    
+////////////////////////////////////
+uint32_t dqdt_init( uint32_t x_size,
+                    uint32_t y_size,
+                    uint32_t y_width )
+{
+    if( (x_size > 32) || (y_size > 32) )
+    {
+        printk("\n[PANIC] in %s : illegal mesh size for DQDT support\n",
+               __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+	dqdt_node_t * node;
+    cxy_t         p_cxy;         // cluster coordinates for parent node
+    cxy_t         c_cxy;         // cluster coordinates for child node
+    uint32_t      level;         // node level in quad tree
+    uint32_t      mask;          // mask on node coordinates to compute existence condition
+    uint32_t      pmask;         // mask to compute parent coordinates from child coordinates
+    cluster_t   * cluster;       // pointer on local cluster
+
+    cluster = LOCAL_CLUSTER;
+
     // compute level_max
     uint32_t  x_size_ext = POW2_ROUNDUP( x_size );
     uint32_t  y_size_ext = POW2_ROUNDUP( y_size );
-    uint32_t  size_ext   = MAX( x_size_ext , y_size_ext );
-    uint32_t  level_max  = bits_log2( size_ext );
-
-    // all CP0s register the DQDT root in local cluster manager
-    cluster->dqdt_root_xp = XPTR( 0 , &cluster->dqdt_tbl[level_max] );
-
-    // only CP0 in cluster 0 build the DQDT
-    if( local_cxy == 0 )
-    {
-
-#if DEBUG_DQDT_INIT
-thread_t * this = CURRENT_THREAD;
-printk("\n[%s] thread[%x,%x] enters : x_size = %d / y_size = %d / level_max = %d\n",
-__FUNCTION__, this->process->pid, this->trdid, x_size, y_size, level_max );
-#endif
-    
-    // only CP0 in cluster 0 call the recursive function to build the quad-tree
-    if (local_cxy == 0) dqdt_recursive_build( local_cxy , level_max , XPTR_NULL );
-
-#if DEBUG_DQDT_INIT
-dqdt_display();
-#endif
-
-    }
-}  // end dqdt_init()
+    uint32_t  size_ext   = MAX(x_size_ext , y_size_ext);
+    uint32_t  level_max  = (bits_log2(size_ext * size_ext) >> 1) + 1;
+
+    // get cluster coordinates
+    uint32_t    x       = local_cxy >> y_width;
+    uint32_t    y       = local_cxy & ((1<<y_width)-1);
+
+    // loop on local dqdt nodes (at most one node per level)
+    for( level = 0 ; level < level_max ; level++ )
+    {
+        // get pointer on the node to be initialised
+        node = &cluster->dqdt_tbl[level];
+
+        // set default values
+        node->level       = level;
+        node->arity       = 0;
+        node->threads     = 0;
+        node->pages       = 0;
+        node->parent      = XPTR_NULL;
+        node->children[0] = XPTR_NULL;
+        node->children[1] = XPTR_NULL;
+        node->children[2] = XPTR_NULL;
+        node->children[3] = XPTR_NULL;
+ 
+        // compute masks depending on level : 0x1, 0x3, 0x7, 0xF, 0x1F etc.
+        mask  = (1<<level)-1;
+        pmask = (1<<(level+1))-1;
+
+        // check the node  existence condition at each level
+        if( ((x & mask) == 0) && ((y & mask) == 0) );
+        {
+            // set parent extended pointer 
+            p_cxy = ((x & ~pmask)<<y_width) + (y & ~pmask);
+            node->parent = XPTR( p_cxy , &cluster->dqdt_tbl[level+1] );
+
+            // set child[0] extended pointer (same [x,y] coordinates) 
+            if ( level > 0 )
+            {
+                c_cxy = local_cxy;
+                node->children[0] = XPTR( c_cxy , &cluster->dqdt_tbl[level-1]);
+                node->arity++;
+            }
+
+            // set child[1] extended pointer (coordinates may overflow)
+            if ( (level > 0) && ((y + (1<<(level-1))) < y_size) )
+            {
+                c_cxy = local_cxy + (1<<(level-1));
+                node->children[1] = XPTR( c_cxy , &cluster->dqdt_tbl[level-1] );
+                node->arity++;
+            }
+
+            // set child[2] extended pointer (coordinates may overflow)
+            if ( (level > 0) && ((x + (1<<(level-1))) < x_size) )
+            {
+                c_cxy = local_cxy + ((1<<(level-1))<<y_width);
+                node->children[2] = XPTR( c_cxy , &cluster->dqdt_tbl[level-1]);
+                node->arity++;
+            }
+
+            // set child[3] extended pointer (coordinates may overflow)
+            if ( (level > 0) && ((x + (1<<(level-1))) < x_size)  && ((y + (1<<(level-1))) < y_size) )
+            {
+                c_cxy = local_cxy + ((1<<(level-1))<<y_width) + (1<<(level-1));
+                node->children[3] = XPTR( c_cxy , &cluster->dqdt_tbl[level-1]);
+                node->arity++;
+            }
+        }  // end if existence condition
+    }  // end for level
+
+    return level_max;
+
+} // end dqdt_init()
 
 
 ///////////////////////////////////////////////////////////////////////////
-// This recursive function is called by both the dqdt_increment_pages()
-// and by the dqdt_decrement_pages() functions.
+// This recursive function is called by the dqdt_global_update() function.
 // It traverses the quad tree from clusters to root.
 ///////////////////////////////////////////////////////////////////////////
-// @ node_xp    : extended pointer on current node
-// @ increment  : number of pages variation
-///////////////////////////////////////////////////////////////////////////
-static void dqdt_propagate_pages( xptr_t  node_xp,
-                                  int32_t increment )
+static void dqdt_propagate( xptr_t  node,         // extended pointer on current node
+                            int32_t threads_var,  // number of threads variation
+                            int32_t pages_var )   // number of pages variation
 {
     // get current node cluster identifier and local pointer
-    cxy_t         node_cxy = GET_CXY( node_xp );
-    dqdt_node_t * node_ptr = GET_PTR( node_xp );
+    cxy_t         cxy = (cxy_t)GET_CXY( node );
+    dqdt_node_t * ptr = (dqdt_node_t *)GET_PTR( node );
+
+    // update current node threads number
+    hal_remote_atomic_add( XPTR( cxy , &ptr->threads ) , threads_var );
 
     // update current node pages number
-    hal_remote_atomic_add( XPTR( node_cxy , &node_ptr->pages ) , increment );
+    hal_remote_atomic_add( XPTR( cxy , &ptr->pages ) , pages_var );
 
     // get extended pointer on parent node
-    xptr_t parent_xp = (xptr_t)hal_remote_l64( XPTR( node_cxy , &node_ptr->parent ) );
+    xptr_t parent = (xptr_t)hal_remote_lwd( XPTR( cxy , &ptr->parent ) );
 
     // propagate if required
-    if ( parent_xp != XPTR_NULL ) dqdt_propagate_pages( parent_xp, increment );
-}
-
-////////////////////////////////////////
-void dqdt_increment_pages( cxy_t    cxy,
-                           uint32_t order )
-{
-    // get local pointer on node[0] (same in all clusters)
-    dqdt_node_t * node_ptr = &LOCAL_CLUSTER->dqdt_tbl[0];
-
-    // update DQDT node[0] in remote cluster cxy
-    hal_remote_atomic_add( XPTR( cxy , &node_ptr->pages ) , (1 << order) );
-
-    // get extended pointer on parent node in remote cluster cxy
-    xptr_t parent_xp = hal_remote_l64( XPTR( cxy , &node_ptr->parent ) );
-
-     // propagate to DQDT upper levels
-    if( parent_xp != XPTR_NULL ) dqdt_propagate_pages( parent_xp , (1 << order) );
-
-#if DEBUG_DQDT_UPDATE_PAGES
-uint32_t cycle = hal_get_cycles();
-if( cycle > DEBUG_DQDT_UPDATE_PAGES )
-printk("\n[DBG] %s : thread %x in process %x / %x pages in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid,
-hal_remote_l32( XPTR( cxy , &node_ptr->pages ), cxy, cycle );
-#endif
-
-}
-
-////////////////////////////////////////
-void dqdt_decrement_pages( cxy_t    cxy,
-                           uint32_t order )
-{
-    // get local pointer on node[0] (same in all clusters)
-    dqdt_node_t * node_ptr = &LOCAL_CLUSTER->dqdt_tbl[0];
-
-    // update DQDT node[0] in remote cluster cxy
-    hal_remote_atomic_add( XPTR( cxy , &node_ptr->pages ) , -(1 << order) );
-
-    // get extended pointer on parent node in remote cluster cxy
-    xptr_t parent_xp = hal_remote_l64( XPTR( cxy , &node_ptr->parent ) );
-
-     // propagate to DQDT upper levels
-    if( parent_xp != XPTR_NULL ) dqdt_propagate_pages( parent_xp , -(1 << order) );
-
-#if DEBUG_DQDT_UPDATE_PAGES
-uint32_t cycle = hal_get_cycles();
-if( cycle > DEBUG_DQDT_UPDATE_PAGES )
-printk("\n[DBG] %s : thread %x in process %x / %x pages in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid,
-hal_remote_l32( XPTR( cxy , &node_ptr->pages ), cxy, cycle );
-#endif
-
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////
-// This recursive function is called by both the dqdt_increment_threads() 
-// and by the dqdt_decrement_threads functions.
-// It traverses the quad tree from clusters to root.
-///////////////////////////////////////////////////////////////////////////
-// @ node       : extended pointer on current node
-// @ increment  : number of pages variation
-///////////////////////////////////////////////////////////////////////////
-static void dqdt_propagate_threads( xptr_t  node,
-                                    int32_t increment )
-{
-    // get current node cluster identifier and local pointer
-    cxy_t         cxy = GET_CXY( node );
-    dqdt_node_t * ptr = GET_PTR( node );
-
-    // update current node threads number
-    hal_remote_atomic_add( XPTR( cxy , &ptr->threads ) , increment );
-
-    // get extended pointer on parent node
-    xptr_t parent = (xptr_t)hal_remote_l64( XPTR( cxy , &ptr->parent ) );
-
-    // propagate if required
-    if ( parent != XPTR_NULL ) dqdt_propagate_threads( parent, increment );
-}
-
-///////////////////////////////////
-void dqdt_increment_threads( void )
+    if ( parent != XPTR_NULL )
+    {
+        dqdt_propagate( parent, threads_var, pages_var );          
+    }
+}
+
+/////////////////////////
+void dqdt_global_update()
 {
 	cluster_t   * cluster = LOCAL_CLUSTER;
     dqdt_node_t * node    = &cluster->dqdt_tbl[0];
 
+    // get variations
+    int32_t      threads_var = cluster->threads_var;
+    int32_t      pages_var   = cluster->pages_var;
+
+    // propagate this variation to DQDT upper levels
+    if( (threads_var || pages_var) && (node->parent != XPTR_NULL) )
+    {
+        dqdt_propagate( node->parent, threads_var, pages_var );
+    }
+
+    // update variations
+    hal_atomic_add( &cluster->threads_var , -threads_var );
+    hal_atomic_add( &cluster->pages_var   , -pages_var   );
+}
+
+///////////////////////////////////////////////////
+void dqdt_local_update_threads( int32_t increment )
+{
+	cluster_t * cluster = LOCAL_CLUSTER;
+    
+    // register change for future propagation in DQDT 
+    hal_atomic_add( &cluster->threads_var , increment );
+
     // update DQDT node level 0
-    hal_atomic_add( &node->threads , 1 );
-
-    // propagate to DQDT upper levels
-    if( node->parent != XPTR_NULL ) dqdt_propagate_threads( node->parent , 1 );
-
-#if DEBUG_DQDT_UPDATE_THREADS
-uint32_t cycle = hal_get_cycles();
-if( cycle > DEBUG_DQDT_UPDATE_THREADS )
-printk("\n[DBG] %s : thread %x in process %x / %d threads in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 
-node->threads, local_cxy, cycle );
-#endif
-
-}
-
-///////////////////////////////////
-void dqdt_decrement_threads( void )
-{
-	cluster_t   * cluster = LOCAL_CLUSTER;
-    dqdt_node_t * node    = &cluster->dqdt_tbl[0];
+    hal_atomic_add( &cluster->dqdt_tbl[0].threads , increment );
+}
+
+/////////////////////////////////////////////////
+void dqdt_local_update_pages( int32_t increment )
+{
+	cluster_t * cluster = LOCAL_CLUSTER;
+    
+    // register change for future propagation in DQDT 
+    hal_atomic_add( &cluster->pages_var , increment );
 
     // update DQDT node level 0
-    hal_atomic_add( &node->threads , -1 );
-
-    // propagate to DQDT upper levels
-    if( node->parent != XPTR_NULL ) dqdt_propagate_threads( node->parent , -1 );
-
-#if DEBUG_DQDT_UPDATE_THREADS
-uint32_t cycle = hal_get_cycles();
-if( cycle > DEBUG_DQDT_UPDATE_THREADS )
-printk("\n[DBG] %s : thread %x in process %x / %d threads in cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, 
-node->threads, local_cxy, cycle );
-#endif
-
-}
-
-///////////////////////////////////
-xptr_t dqdt_get_root( cxy_t    cxy,
-                      uint32_t level )
-{
-    xptr_t        node_xp;
-    cxy_t         node_cxy;
-    dqdt_node_t * node_ptr;
-    uint32_t      current_level;
-
-assert( __FUNCTION__, (level <= 5) , "illegal DQDT level\n" );
-
-#if DEBUG_DQDT_GET_ROOT
-thread_t * this = CURRENT_THREAD;
-printk("\n[%s] thread[%x,%x] enters / cxy %x / level %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cxy, level );
-#endif
-
-    // check macro-cluster 
-    if( cluster_is_active( cxy ) )
-    {    
-        // initialise node_xp and current_level 
-        node_xp       = XPTR( cxy , &LOCAL_CLUSTER->dqdt_tbl[0] );
-        current_level = 0;
-
-        // traverse the quad-tree from bottom to root
-        while( current_level < level )
-        {
-            node_cxy = GET_CXY( node_xp );
-            node_ptr = GET_PTR( node_xp );
-
-            node_xp = hal_remote_l64( XPTR( node_cxy , &node_ptr->parent ) );
-            current_level++;
-        }
-    }
-    else
-    {
-        node_xp =  XPTR_NULL;
-    }
-
-#if DEBUG_DQDT_GET_ROOT
-printk("\n[%s] thread[%x,%x] exit / root_xp[%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, GET_CXY( node_xp ), GET_PTR( node_xp ) );
-#endif
-
-    return node_xp;
-    
-}
-
-/////////////////////////////////////////////////////////////////////////////////////
+    hal_atomic_add( &cluster->dqdt_tbl[0].pages , increment );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // This recursive function is called by both the dqdt_get_cluster_for_process()
-// and by the dqdt_get_cluster_for_memory() functions to select the cluster with the 
-// smallest number of threads per core, or the smallest number of pages per cluster.
+// and by the dqdt_get_cluster_for_memory() functions to select the cluster
+// with smallest number of thread, or smallest number of allocated pages.
 // It traverses the quad tree from root to clusters.
-/////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
 static cxy_t dqdt_select_cluster( xptr_t node,
                                   bool_t for_memory )
 {
     dqdt_node_t   node_copy;     // local copy of the current DQDT node
-    xptr_t        child_xp;      // extended pointer on a DQDT child node
-    uint32_t      x;             // child node X coordinate 
-    uint32_t      y;             // child node Y coordinate
-    uint32_t      select_x;      // selected child X coordinate
-    uint32_t      select_y;      // selected child Y coordinate
+    uint32_t      i;             // index in the loop on children
+    uint32_t      select;        // index of selected child
+    xptr_t        child;         // extended pointer on a DQDT child node
+    cxy_t         cxy;           // DQDT child node cluster identifier
+    dqdt_node_t * ptr;           // pointer on a DQDT child node
     uint32_t      load;          // load of the child (threads or pages)
     uint32_t      load_min;      // current value of the minimal load
@@ -598,75 +263,47 @@
     // analyse load for all children in non terminal node
     load_min = 0xFFFFFFFF;
-    select_x = 0;
-    select_y = 0;
-    for( x = 0 ; x < 2 ; x++ )
-    {
-        for( y = 0 ; y < 2 ; y++ )
+    for( i = 0 ; i < 4 ; i++ )
+    {
+        child = node_copy.children[i];
+        if( child != XPTR_NULL )
         {
-            child_xp = node_copy.children[x][y];
-            if( child_xp != XPTR_NULL )
-            {
-                cxy_t         cxy  = GET_CXY( child_xp );
-                dqdt_node_t * ptr  = GET_PTR( child_xp );
-
-                // compute average load  for each child
-                if( for_memory )
-                {
-                    load = hal_remote_l32( XPTR( cxy , &ptr->pages ) ) /
-                           hal_remote_l32( XPTR( cxy , &ptr->clusters ) );
-                }
-                else
-                {
-                    load = hal_remote_l32( XPTR( cxy , &ptr->threads ) ) /
-                           hal_remote_l32( XPTR( cxy , &ptr->cores ) );
-                }
-
-                // select children with smallest load
-                if( load <= load_min )
-                {
-                    load_min = load;
-                    select_x = x;
-                    select_y = y;
-                }
-            }
+            cxy  = (cxy_t)GET_CXY( child );
+            ptr  = (dqdt_node_t *)GET_PTR( child ); 
+            if( for_memory ) load = hal_remote_lw( XPTR( cxy , &ptr->pages ) );
+            else             load = hal_remote_lw( XPTR( cxy , &ptr->threads ) );
+            if( load < load_min )
+            {
+                load_min = load;
+                select   = i; 
+            }      
         }
     }
 
     // select the child with the lowest load
-    return dqdt_select_cluster( node_copy.children[select_x][select_y], for_memory );
-
-}  // end dqdt_select_cluster()
-
-
-///////////////////////////////////////////////////
-cxy_t dqdt_get_cluster_for_thread( xptr_t root_xp )
-{
+    return dqdt_select_cluster( node_copy.children[select], for_memory ); 
+}
+
+////////////////////////////////////
+cxy_t dqdt_get_cluster_for_process()
+{
+    // build extended pointer on DQDT root node
+	cluster_t * cluster = LOCAL_CLUSTER;
+    uint32_t    level   = cluster->dqdt_root_level;
+    xptr_t      root    = XPTR( 0 , &cluster->dqdt_tbl[level] );
+
     // call recursive function
-    cxy_t cxy = dqdt_select_cluster( root_xp , false );
-
-#if DEBUG_DQDT_SELECT_FOR_THREAD
-uint32_t cycle = hal_get_cycles();
-if( cycle > DEBUG_DQDT_SELECT_FOR_PROCESS )
-printk("\n[DBG] %s : thread %x in process %x select cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, cxy, cycle );
-#endif
-
-    return cxy;
-}
-
-///////////////////////////////////////////////////
-cxy_t dqdt_get_cluster_for_memory( xptr_t root_xp )
-{
+    return dqdt_select_cluster( root , false ); 
+}
+
+////////////////////////////////////
+cxy_t dqdt_get_cluster_for_memory()
+{
+    // build extended pointer on DQDT root node
+	cluster_t * cluster = LOCAL_CLUSTER;
+    uint32_t    level   = cluster->dqdt_root_level;
+    xptr_t      root    = XPTR( 0 , &cluster->dqdt_tbl[level] );
+
     // call recursive function
-    cxy_t cxy = dqdt_select_cluster( root_xp , true );
-
-#if DEBUG_DQDT_SELECT_FOR_MEMORY
-uint32_t cycle = hal_get_cycles();
-if( cycle > DEBUG_DQDT_SELECT_FOR_MEMORY )
-printk("\n[DBG] %s : thread %x in process %x select cluster %x / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, cxy, cycle );
-#endif
-
-    return cxy;
-}
-
+    return dqdt_select_cluster( root , true ); 
+}
+
Index: trunk/kernel/kern/dqdt.h
===================================================================
--- trunk/kernel/kern/dqdt.h	(revision 690)
+++ trunk/kernel/kern/dqdt.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
  * kern/dqdt.h - Distributed Quad Decision Tree
- *
- * Author : Alain Greiner (2016,2017,2018,2019)
+ * 
+ * Author : Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -25,29 +25,34 @@
 #define _DQDT_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_atomic.h>
 
 /****************************************************************************************
  * This DQDT infrastructure maintains a topological description of ressources usage
- * in each cluster: number of threads per core, and number of physical pages allocated.
+ * (number of threads, and number of physical pages allocated) in each cluster.
  *
- * It is organized as a quad-tree, where the leaf cells are the clusters, organised
- * as a 2D mesh. Each node in the quad-tree (including the root and the leaf cells,
- * covers a "macro-cluster", that is a square array of clusters where the number
- * in the macro-cluster is a power of 4, and the macro-cluster side is a power of two.
- * Each node contains informations on ressources usage (physical memory and cores)
- * in the covered macro-cluster.
- * This quad-tree can be truncated, if the physical mesh X_SIZE and Y_SIZE dimensions
- * are not equal, or are not power of 2, or if the physical mesh contains "holes".
- * The mesh size is supposed to contain at most 32*32 clusters in this implementation.
- *   . Level 0 nodes exist in all clusters and have no children.
- *   . Level 1 nodes can be placed in any cluster of the covered  2*2  macro-cluster.
- *   . Level 2 nodes can be placed in any cluster of the covered  4*4  macro-cluster.
- *   . Level 3 nodes can be placed in any cluster of the covered  8*8  macro-cluster.
- *   . Level 4 nodes can be placed in any cluster of the covered 16*16 macro-cluster.
- *   . Level 5 nodes can be placed in any cluster of the covered 32*32 macro-cluster.
- * The root node is placed in the cluster containing the core executing the dqdt_init()
- * function. Other (non level 0) nodes are placed pseudo-randomly.
+ * - If X_SIZE or Y_SIZE are equal to 1, it makes the assumption that the cluster
+ *   topology is a one dimensionnal vector, an build the smallest one-dimensionnal
+ *   quad-tree covering this one-dimensionnal vector. If the number of clusters 
+ *   is not a power of 4, the tree is truncated as required.
+ *   TODO : the mapping for the one dimensionnal topology is not implemented yet [AG].
+ * 
+ * - If both Y_SIZE and Y_SIZE are larger than 1, it makes the assumption that 
+ *   the cluster topology is a 2D mesh. The [X,Y] coordinates of a cluster are 
+ *   obtained from the CXY identifier using the following rules :  
+ *      X = CXY >> Y_WIDTH   /  Y = CXY & ((1<<Y_WIDTH)-1)
+ *   If the mesh X_SIZE and Y_SIZE dimensions are not equal, or are not power of 2, 
+ *   we build the smallest two dimensionnal quad-tree covering all clusters,
+ *   and this tree is truncated as required.
+ *   The root node is always implemented in cluster [0,0]
+ *   The mesh size is supposed to contain at most 32 * 32 clusters.
+ *   There are at most 6 DQDT nodes in a cluster 
+ *   . Level 0 nodes exist on all clusters and have no children.
+ *   . Level 1 nodes exist when both X and Y coordinates are multiple of 2 
+ *   . Level 2 nodes exist when both X and Y coordinates are multiple of 4
+ *   . Level 3 nodes exist when both X and Y coordinates are multiple of 8
+ *   . Level 4 nodes exist when both X and Y coordinates are multiple of 16
+ *   . Level 5 nodes exist when both X and Y coordinates are multiple of 32
  ***************************************************************************************/
 
@@ -55,17 +60,15 @@
  * This structure describes a node of the DQDT.
  * The max number of children is 4, but it can be smaller for some nodes.
- * Level 0 nodes have no children. The root node has no parent.
+ * Level 0 nodes are the clusters, and have no children.
+ * The root node has no parent, and is always stored in cluster[0,0].
  ***************************************************************************************/
-
 typedef struct dqdt_node_s
 {
-	uint32_t      level;            /*! node level                                     */
-	uint32_t      arity;            /*! actual children number in this node            */
-    uint32_t      threads;          /*! number of threads in macro-cluster             */
-    uint32_t      pages;            /*! number of allocated pages in macro-cluster     */
-    uint32_t      cores;            /*! number of active cores in macro cluster        */
-    uint32_t      clusters;         /*! number of active clusters in macro cluster     */ 
-	xptr_t        parent;           /*! extended pointer on parent node                */
-	xptr_t        children[2][2];   /*! extended pointers on children nodes            */
+	uint32_t            level;               // node level
+	uint32_t            arity;               // actual children number in this node
+    uint32_t            threads;             // current number of threads in subtree
+    uint32_t            pages;               // current number of pages in subtree
+	xptr_t              parent;              // extended pointer on parent node
+	xptr_t              children[4];         // extended pointers on children nodes
 }
 dqdt_node_t;
@@ -73,81 +76,80 @@
 
 /****************************************************************************************
- * This function recursively initializes the DQDT structure from informations
- * stored in cluster manager (x_size, y_size and cluster_info[x][y].
- * It is called in all clusters by the local CP0, to compute level_max and register
- * the DQDT root node in each cluster manager, but only CPO in cluster 0 build actually
- * the quad-tree covering all active clusters.
- * This initialisation can use remote_accesses, because the DQDT nodes are
- * allocated as global variables in the cluster_manager, and the local addresses
+ * This local function initializes the local DQDT structures. 
+ * The information describing the hardware platform topology and the cluster
+ * indexing policy is defined by the three arguments below.
+ * This initialisation is done in parallel, locally in each cluster, because the DQDT 
+ * is allocated as a global variable in the cluster_manager, and the local addresses
  * are identical in all clusters.
+ ****************************************************************************************
+ * @ x_size   : number of clusters (containing memory and CPUs) in a row
+ * @ y_size   : number of clusters (containing memory and CPUs) in a column
+ * @ y_width  : number of LSB used to code the Y value in CXY
+ * @ return the number of levels in quad-tree.
  ***************************************************************************************/
-void dqdt_init( void );
+uint32_t dqdt_init( uint32_t x_size,
+                    uint32_t y_size,
+                    uint32_t y_width );
 
 /****************************************************************************************
- * These local function update the total number of threads in level 0 DQDT node,
- * and immediately propagates the variation to the DQDT upper levels.
- * They are called on each thread creation or destruction.
+ * This recursive function displays usage information for all DQDT nodes in the subtree
+ * defined by the node argument. It traverses the quadtree from root to bottom.
+ ****************************************************************************************
+ * @ node_xp   : extended pointer on a DQDT node.
  ***************************************************************************************/
-void dqdt_increment_threads( void );
-
-void dqdt_decrement_threads( void );
+void dqdt_global_print( xptr_t  node_xp );
 
 /****************************************************************************************
- * These two functions can be called by any thread running in any cluster.
- * They increment/decrement the total number of 4 Kbytes pages allocated in a cluster
- * identified by the <cxy> argument, as specified by the <order> argument. The level 0 
- * DQDT node is udated, and this change is immediately propagated to upper levels.
- * They are called by PPM on each physical memory page allocation or release.
+ * This function displays summary usage information in a given DQDT local node.
  ****************************************************************************************
- * @ cxy     : target cluster identifier.
- * @ order   : ln2( number of 4 Kbytes pages )
+ * @ node   : local pointer on a DQDT node.
  ***************************************************************************************/
-void dqdt_increment_pages( cxy_t    cxy , 
-                           uint32_t order );
-
-void dqdt_decrement_pages( cxy_t    cxy,
-                           uint32_t order );
+void dqdt_local_print( dqdt_node_t * node );
 
 /****************************************************************************************
- * This function returns an extended pointer on the dqdt node that is the root of
- * the sub-tree covering the macro-cluster defined by the <level> argument and
- * containing the cluster defined by the <cxy> argument. It returns XPTR_NULL if
- * this macro-cluster is undefined (when the cxy cluster contains no core).
- ****************************************************************************************
- * @ cxy   : cluster identifier.
- * @ level   : level of the sub-tree.
- * @ returns  root_xp if success / return XPTR_NULL if no active core in macro_cluster.
+ * This recursive function traverses the DQDT quad-tree from bottom to root, to propagate
+ * the change in the threads number and allocated pages number in a leaf cluster,
+ * toward the upper levels of the DQDT quad-tree.
+ * It should be called periodically by each instance of the kernel.
  ***************************************************************************************/
-xptr_t dqdt_get_root( cxy_t    cxy,
-                      uint32_t level );
+void dqdt_global_update();
 
 /****************************************************************************************
- * This function can be called in any cluster. It traverses the DQDT tree from the
- * local root of a macro-cluster, defined by the <root_xp> argument, to the bottom.
- * It analyses the computing load & select the cluster containing the lowest number
- * ot threads.
+ * This local function updates both the total number of threads,
+ * in the level 0 DQDT node, and the variation of the number of threads
+ * for future propagation to the DQDT upper levels. 
+ * It should be called on each thread creation or destruction.
  ****************************************************************************************
- * @ root_xp  : extended pointer on DQDT node root.
+ * @ increment : increment (can be positive or negative)
+ ***************************************************************************************/
+void dqdt_local_update_threads( int32_t  increment );
+
+/****************************************************************************************
+ * This local function updates both the total number of allocated pages,
+ * in the level 0 DQDT node, and the variation of the number of pages
+ * for future propagation to the DQDT upper levels. 
+ * It should be called on each memory allocation or release.
+ ****************************************************************************************
+ * @ increment : increment (can be positive or negative)
+ ***************************************************************************************/
+void dqdt_local_update_pages( int32_t increment );
+
+/****************************************************************************************
+ * This function can be called in any cluster. It traverses the DQDT tree
+ * from the root to the bottom, to analyse the computing load and select the cluster
+ * with the lowest number ot threads to place a new process.
+ ****************************************************************************************
  * @ returns the cluster identifier with the lowest computing load.
  ***************************************************************************************/
-cxy_t dqdt_get_cluster_for_thread( xptr_t root_xp );
+cxy_t dqdt_get_cluster_for_process();
 
 /****************************************************************************************
- * This function can be called in any cluster. It traverses the DQDT tree from the
- * local root of a macro-cluster, defined by the <root_xp> argument, to the bottom.
- * It analyses the memory load & select the cluster with the lowest number of allocated
- * physical pages.
+ * This function can be called in any cluster. It traverses the DQDT tree
+ * from the root to the bottom, to analyse the memory load and select the cluster 
+ * with the lowest memory load for dynamic memory allocation with no locality constraint.
  ****************************************************************************************
- * @ root_xp  : extended pointer on DQDT node root.
  * @ returns the cluster identifier with the lowest memory load.
  ***************************************************************************************/
-cxy_t dqdt_get_cluster_for_memory( xptr_t root_xp );
-
-/****************************************************************************************
- * This function displays on kernel TXT0 the DQDT state for all nodes in the quad-tree.
- * It traverses the quadtree from the global root to bottom.
- * It can be called by a thread running in any cluster
- ***************************************************************************************/
-void dqdt_display( void );
+cxy_t dqdt_get_cluster_for_memory();
 
 
Index: trunk/kernel/kern/event.c
===================================================================
--- trunk/kernel/kern/event.c	(revision 1)
+++ trunk/kernel/kern/event.c	(revision 1)
@@ -0,0 +1,365 @@
+/*
+ * kern/event.c - Per-CPU Events-Manager
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <cpu.h>
+#include <cluster.h>
+#include <device.h>
+#include <pmm.h>
+#include <event.h>
+#include <cpu-trace.h>
+#include <thread.h>
+
+/** Initialize event */
+error_t event_init(struct event_s *event)
+{
+	/* nothing to do in this version */
+	return 0;
+}
+
+/** Destroy event */
+void event_destroy(struct event_s *event)
+{
+	/* nothing to do in this version */
+}
+
+/** Destroy event listner */
+void event_listner_destroy(struct event_listner_s *el)
+{
+	/* nothing to do in this version */
+}
+
+error_t event_listner_init(struct event_listner_s *el)
+{
+	error_t err;
+	register uint_t i;
+  
+	el->flags = 0;
+	el->prio = 0;
+	err = 0;
+
+	for(i=0; i < E_PRIO_NR; i++)
+	{
+		list_root_init(&el->tbl[i].root);
+		el->tbl[i].count = 0;
+	}
+
+
+	return 0;
+}
+
+
+static void local_event_send(struct event_s *event, struct event_listner_s *el, bool_t isFIFO) 
+{
+	uint_t prio;
+	uint_t irq_state;
+
+	prio = event_get_priority(event);
+
+	cpu_disable_all_irq(&irq_state);
+
+	if(isFIFO)
+		list_add_last(&el->tbl[prio].root, &event->e_list);
+	else
+		list_add_first(&el->tbl[prio].root, &event->e_list);
+
+	el->tbl[prio].count ++;
+	el->prio = (!(el->flags & EVENT_PENDING) || (el->prio > prio)) ? prio : el->prio;
+	el->flags |= EVENT_PENDING;
+
+	cpu_restore_irq(irq_state);
+
+#if CONFIG_SHOW_LOCAL_EVENTS
+	isr_dmsg(INFO, "%s: cpu %d, prio %d, el->prio %d [%d]\n", 
+		 __FUNCTION__, 
+		 cpu_get_id(), 
+		 prio, 
+		 el->prio,
+		 cpu_time_stamp());
+#endif
+}
+
+#if 0
+static EVENT_HANDLER(re_send_backoff_handler)
+{
+	uint_t cpu_gid;
+  
+	cpu_gid = (uint_t) event_get_argument(event);
+  
+	event_restore(event);
+  
+	event_send(event, cpu_gid);
+
+	printk(INFO, "INFO: %s, cpu %d, event %x sent to cpu_gid %d [%d]\n",
+	       __FUNCTION__,
+	       cpu_get_id(),
+	       event,
+	       cpu_gid,
+	       cpu_time_stamp());
+  
+	return 0;
+}
+
+static error_t __attribute__((noinline)) re_send_backoff(struct event_s *event, 
+							 uint_t cpu_gid, 
+							 uint_t tm_stamp)
+{
+	struct cpu_s *cpu;
+	uint_t tm_now;
+	uint_t irq_state;
+
+	tm_now = cpu_time_stamp();
+	cpu    = current_cpu;
+
+	if((tm_now - tm_stamp) < cpu_get_ticks_period(cpu))
+		return EAGAIN;
+
+	event_backup(event);
+  
+	event_set_priority(event, E_CHR);
+	event_set_handler(event, re_send_backoff_handler);
+	event_set_argument(event, (void*)cpu_gid);
+
+	cpu_disable_all_irq(&irq_state);
+	local_event_send(event, &cpu->le_listner, false);
+	cpu_restore_irq(irq_state);
+
+	printk(INFO, "INFO: %s, cpu %d, event %x sent to cpu_gid %d [%d]\n",
+	       __FUNCTION__,
+	       cpu->gid,
+	       event,
+	       cpu_gid,
+	       tm_now);
+
+	return 0;
+}
+
+/** This is the only function that handle remote data **/
+static void remote_event_send(struct event_s *event, 
+				struct event_listner_s *el, 
+				uint_t cid, uint_t cpu_gid)
+{ 
+	error_t retry;
+	uint_t tm_stamp;
+	uint_t prio;
+
+	tm_stamp = cpu_time_stamp();
+	prio     = event_get_priority(event);
+
+	while((retry = event_fifo_put(&el->tbl[prio].fifo, cid, event)) != 0)
+	{
+		retry = re_send_backoff(event, cpu_gid, tm_stamp);
+    
+		if(retry == 0)
+			break;
+	}
+
+
+#if 1
+	bool_t isPending;
+	uint_t flags = remote_lw((void*)&el->flags, cid);
+	isPending = (flags & EVENT_PENDING) ? true : false;
+
+	remote_sw((void*)&el->flags, cid, flags | EVENT_PENDING);
+	cpu_wbflush();
+	pmm_cache_flush_raddr((vma_t) &el->flags, cid, PMM_DATA);
+
+	if((prio < E_FUNC) && (isPending == false))
+	{
+		(void)arch_cpu_send_ipi(cpu_gid);
+	}
+#else
+
+	if((prio < E_FUNC))
+	{
+		(void)arch_cpu_send_ipi(cpu_gid);
+	}
+#endif
+}
+#endif
+
+/* must be called with all irq disabled */
+void event_send(struct event_s *event, uint_t cpu_gid)
+{
+	uint_t cid = arch_cpu_cid(cpu_gid);
+	uint_t lid = arch_cpu_lid(cpu_gid);
+
+	if (cid != current_cid)
+	{
+		PANIC("event not local cid [cpu %d, cid %d, cycle %u]\n", 
+		      cpu_get_id(), 
+		      cid,
+		      cpu_time_stamp());
+	}
+	
+	local_event_send(event, &cpu_lid2ptr(lid)->le_listner, true);
+}
+
+
+static void local_event_listner_notify(struct event_listner_s *el)
+{
+	register struct event_s *event;
+	register uint_t count;
+	register uint_t start_prio;
+	register uint_t current_prio;
+
+#if CONFIG_SHOW_LOCAL_EVENTS
+	register uint_t cntr;
+#endif
+  
+	count = 0;
+	assert((el->flags & EVENT_PENDING) && "event_notify is called but no event is pending");
+
+	el->flags   &= ~EVENT_PENDING;
+	start_prio   = el->prio ++;
+	current_prio = start_prio;
+
+	while(current_prio < E_PRIO_NR)
+	{
+		if(el->prio <= start_prio)
+		{
+			start_prio   = el->prio ++;
+			current_prio = start_prio;
+		}
+
+		while(el->tbl[current_prio].count != 0)
+		{
+			assert(!(list_empty(&el->tbl[current_prio].root)) && "pending event queue is empty");
+
+			event = list_first(&el->tbl[current_prio].root, struct event_s, e_list);
+			//printk(INFO, "%d Handling event %p with prio %d\n", current_cpu->gid, event, current_prio);
+			list_unlink(&event->e_list);
+      
+			el->tbl[current_prio].count --;
+      
+			cpu_enable_all_irq(NULL);
+			event_get_handler(event)(event);	 /* el->prio can be changed */
+			count ++;
+
+#if CONFIG_SHOW_LOCAL_EVENTS
+			cntr ++;
+#endif
+
+			cpu_disable_all_irq(NULL);
+		}
+
+#if CONFIG_SHOW_LOCAL_EVENTS    
+		cpu_enable_all_irq(NULL);
+		if(cntr)
+		{
+			printk(INFO, "INFO: cpu %d, %d pending events of priority %d have been Delivered [ %u ]\n",
+			       cpu_get_id(),
+			       cntr, 
+			       current_prio, 
+			       cpu_time_stamp());
+		}
+		cntr = 0;
+		cpu_disable_all_irq(NULL);
+#endif
+    
+		current_prio ++;
+	}
+
+	el->count += count;
+}
+
+
+#if 0
+static void remote_event_listner_notify(struct event_listner_s *el)
+{
+	struct event_listner_s *local_el;
+	struct event_s *event;
+	event_prio_t current_prio;
+	uint_t irq_state;
+	uint_t count;
+	error_t err;
+	uint_t cid;
+  
+	local_el = &current_cpu->le_listner;
+	cid = current_cid;
+	count    = 0;
+
+	do
+	{
+		el->flags &= ~EVENT_PENDING;
+		cpu_wbflush();
+		pmm_cache_flush_vaddr((vma_t)&el->flags, PMM_DATA);
+
+		cpu_disable_all_irq(&irq_state);
+
+		for(current_prio = E_CLK; current_prio < E_PRIO_NR; current_prio++, count++)
+		{
+			while((err = event_fifo_get(&el->tbl[current_prio].fifo, cid, (void**)&event)) == 0)
+				local_event_send(event, local_el, false);//event is local
+		}
+
+		cpu_restore_irq(irq_state);
+		el->count += count;
+
+	}while(el->flags & EVENT_PENDING);
+}
+#endif
+
+/* must be called with all irq disabled */
+void event_listner_notify(struct event_listner_s *el)
+{
+	local_event_listner_notify(el);
+}
+
+
+void* thread_event_manager(void *arg)
+{
+	struct thread_s *this;
+	struct cpu_s *cpu;
+	uint_t irq_state;
+
+	cpu_enable_all_irq(NULL);
+  
+	this = current_thread;
+	cpu  = current_cpu;
+
+	thread_preempt_disable(this);
+
+	while(1)
+	{
+#if 0
+		printk(INFO, "INFO: Event Handler on CPU %d, event is le pending %d [%d,%d]\n",
+		       cpu->gid,
+		       event_is_pending(&cpu->le_listner),
+		       cpu_time_stamp(),
+		       cpu_get_ticks(cpu)); 
+#endif
+   
+		cpu_disable_all_irq(&irq_state);
+
+		if(event_is_pending(&cpu->le_listner))
+			event_listner_notify(&cpu->le_listner);
+    
+		wait_on(&this->info.wait_queue, WAIT_ANY);
+
+		sched_sleep(this);
+
+		cpu_restore_irq(irq_state);
+	}
+
+	return NULL;
+}
Index: trunk/kernel/kern/event.h
===================================================================
--- trunk/kernel/kern/event.h	(revision 1)
+++ trunk/kernel/kern/event.h	(revision 1)
@@ -0,0 +1,257 @@
+/*
+ * kern/event.h - Per-CPU Events-Manager
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _EVENT_H_
+#define _EVENT_H_
+
+#include <types.h>
+#include <list.h>
+
+struct cpu_s;
+
+/** Private event flags */
+#define EVENT_PENDING     1
+
+//////////////////////////////////////////////////
+//              Public Section                  //
+//////////////////////////////////////////////////
+
+/** Local Events Priorities */
+typedef enum
+{
+	E_CLK = 0,			/* Fixed Priority */
+	E_TLB,
+	E_CHR,
+	E_BLK,
+	E_MIGRATE,
+	E_CREATE,
+	E_FORK,
+	E_EXEC,
+	E_FUNC,
+	E_PRIO_NR
+}event_prio_t;
+
+typedef enum
+{
+	EL_LOCAL,
+	EL_REMOTE
+}event_listner_type_t;
+
+/** Opaque event structure */
+struct event_s;
+
+/** Opaque events listner structure */
+struct event_listner_s;
+
+/** Get CPU of given listner */
+#define event_listner_get_cpu(el,name)
+
+/** Event handler type definition */
+#define EVENT_HANDLER(n)  sint_t (n)(struct event_s *event)
+typedef EVENT_HANDLER(event_handler_t);
+
+/** Set event's priority */
+#define event_set_priority(e, _prio)
+
+/** Set event's sender id */
+#define event_set_senderId(e,_id)
+
+/** Set event's handler */
+#define event_set_handler(e,_handler)
+
+/** Set event handler's argument */
+#define event_set_argument(e,_arg)
+
+/** Set handler execution error code */
+#define event_set_error(e,_error)
+
+/** Get event's priority */
+#define event_get_priority(e)
+
+/** Get event's sender id */
+#define event_get_senderId(e)
+
+/** Get event's handler */
+#define event_get_handler(e)
+
+/** Get handler's argument */
+#define event_get_argument(e)
+
+/** Get handler execution error code */
+#define event_get_error(e)
+
+/** True if event manager has a pending event */
+#define event_is_pending(el)
+
+
+/** Initialize event */
+error_t event_init(struct event_s *event);
+
+
+/** Destroy event */
+void event_destroy(struct event_s *event);
+
+
+/** 
+ * Send an event to local event listner 
+ * must be called with interrupts disabled
+ * Doing the same for a remote event listner
+ * is not required
+ */
+void event_send(struct event_s *event, uint_t cpu_gid);
+
+
+/** 
+ * Notify about all recived events,
+ * must be called with interrupts disabled
+ */
+void event_listner_notify(struct event_listner_s *el);
+
+
+/** Initialize event listner */
+error_t event_listner_init(struct event_listner_s *el);
+
+
+/** Destroy event listner */
+void event_listner_destroy(struct event_listner_s *el);
+
+/** Events Manager thread */
+void* thread_event_manager(void *arg);
+
+//////////////////////////////////////////////////
+//             Private Section                  //
+//////////////////////////////////////////////////
+
+
+/** 
+ * Private events list based database 
+ **/
+struct event_list_s
+{
+	volatile uint_t count;
+	struct list_entry root;
+};
+
+/** opaque events listner */
+struct event_listner_s
+{
+	uint_t count;
+	volatile uint_t flags;
+	volatile uint_t prio CACHELINE;
+	struct  event_list_s tbl[E_PRIO_NR];
+		
+};
+
+
+/** internal event info structure */
+typedef struct 
+{
+	/* event type */
+	uint_t prio;
+
+	/* event handler */
+	event_handler_t *handler;
+
+	/* event argument */
+	void *arg;
+
+	/* event sender id */
+	void *id;
+  
+	/* event error code */
+	error_t err;
+}event_info_t;
+
+
+/** Event opaque structure */
+struct event_s
+{
+	/* Event Primary Info */
+	event_info_t e_info;
+
+	/* Event List Chain */
+	struct list_entry e_list;
+
+	/* Event Backup Info */
+	event_info_t e_bckp;
+  
+	/* Event Private Data */
+	void *data;
+};
+
+#define event_backup(e)						\
+	do{							\
+		(e)->e_bckp.prio    = (e)->e_info.prio;		\
+		(e)->e_bckp.handler = (e)->e_info.handler;	\
+		(e)->e_bckp.arg     = (e)->e_info.arg;		\
+		(e)->e_bckp.id      = (e)->e_info.id;		\
+		(e)->e_bckp.err     = (e)->e_info.err;		\
+	}while(0)
+
+#define event_restore(e)					\
+	do{							\
+		(e)->e_info.prio    = (e)->e_bckp.prio;		\
+		(e)->e_info.handler = (e)->e_bckp.handler;	\
+		(e)->e_info.arg     = (e)->e_bckp.arg;		\
+		(e)->e_info.id      = (e)->e_bckp.id;		\
+		(e)->e_info.err     = (e)->e_bckp.err;		\
+	}while(0)
+
+
+#undef event_listner_get_cpu
+#define event_listner_get_cpu(_el,_name)		\
+	list_container((_el), struct cpu_s, _name)
+
+#undef event_set_priority
+#define event_set_priority(e, _prio)  do{(e)->e_info.prio = (_prio);}while(0)
+
+#undef event_set_senderId
+#define event_set_senderId(e,_id)     do{(e)->e_info.id = (_id);}while(0)
+
+#undef event_set_handler
+#define event_set_handler(e,_handler) do{(e)->e_info.handler = (_handler);}while(0)
+
+#undef event_set_argument
+#define event_set_argument(e,_arg)    do{(e)->e_info.arg = (_arg);}while(0)
+
+#undef event_set_error
+#define event_set_error(e,_error)     do{(e)->e_info.err = (_error);}while(0)
+
+#undef event_get_priority
+#define event_get_priority(e)   ((e)->e_info.prio)
+
+#undef event_get_senderId
+#define event_get_senderId(e)   ((e)->e_info.id)
+
+#undef event_get_handler
+#define event_get_handler(e)    ((e)->e_info.handler)
+
+#undef event_get_argument
+#define event_get_argument(e)   ((e)->e_info.arg)
+
+#undef event_get_error
+#define event_get_error(e)      ((e)->e_info.err)
+
+#undef event_is_pending
+#define event_is_pending(el)    ((el)->flags & EVENT_PENDING)
+
+#endif	/* _EVENT_H_ */
Index: trunk/kernel/kern/interrupt.h
===================================================================
--- trunk/kernel/kern/interrupt.h	(revision 1)
+++ trunk/kernel/kern/interrupt.h	(revision 1)
@@ -0,0 +1,55 @@
+/*
+ * kern/interrupt.h - kernel IRQs reservation interface
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ * 
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _INTERRUPT_H_
+#define _INTERRUPT_H_
+
+#include <types.h>
+
+#define IRQ_DYN     0x01	/* Dynamic Allocation */
+#define IRQ_SHD     0x02	/* Shared IRQ */
+
+/* Struct used from device.h */
+struct irq_action_s;
+
+/* Struct used form thread.h */
+struct thread_s;
+
+/* IRQ Manager initialize */
+error_t irq_manager_init();
+
+/* IRQ Ressources Allocation */
+error_t irq_manager_alloc(uint_t irq, uint_t irqs_nr, uint_t flags);
+
+/* IRQ Ressources Liberation */
+error_t irq_manager_free(uint_t irq, uint_t irqs_nr);
+
+/* IRQ Handler Registeration */
+error_t irq_handler_register(struct irq_action_s *info, uint_t irq, uint_t flags);
+
+/* IRQ Handler Unregisteration */
+error_t irq_handler_unregister(uint_t irq);
+
+/* Kernel entry point for interrupt handling */
+void do_interrupt(struct thread_s *this, uint_t irq_num);
+
+#endif	/* _INTERRUPT_H_ */
Index: trunk/kernel/kern/kcond_var.h
===================================================================
--- trunk/kernel/kern/kcond_var.h	(revision 1)
+++ trunk/kernel/kern/kcond_var.h	(revision 1)
@@ -0,0 +1,90 @@
+/*
+ * kern/kcond_var.h - kernel condition variables synchronization
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *  
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _KCOND_VAR_H_
+#define _KCOND_VAR_H_
+
+#include <types.h>
+#include <spinlock.h>
+#include <wait_queue.h>
+
+///////////////////////////////////////////////////
+///               Public Section                ///
+///////////////////////////////////////////////////
+
+/** Kernel Condition Variable Sync Type */
+typedef struct wait_queue_s kcv_t;		
+
+/** Initialize CondVar */
+#define kcv_init(cv,name)
+
+/** Wait on CondVar until condition completion */
+#define kcv_wait(cv,lock)
+
+/** Signal (notifiy) CondVar and Wakeup one waiting thread */
+#define kcv_signal(cv)
+
+/** Destroy CondVar */
+#define kcv_destroy(cv)
+
+/** Broadcast CondVar and return the number of notified threads */
+static inline uint_t kcv_broadcast(kcv_t *cv);
+
+
+///////////////////////////////////////////////////
+///               Private Section               ///
+///////////////////////////////////////////////////
+
+#undef kcv_init
+#define kcv_init(_cv,_name)				\
+	do{						\
+		wait_queue_init((_cv), (_name));	\
+	}while(0)
+
+#undef kcv_wait
+#define kcv_wait(_cv,_lock)				\
+	do{						\
+		wait_on((_cv), WAIT_LAST);		\
+		spinlock_unlock_nosched((_lock));	\
+		sched_sleep(CURRENT_THREAD);		\
+		spinlock_lock((_lock));			\
+	}while(0)
+
+#undef kcv_signal
+#define kcv_signal(_cv)					\
+	do{						\
+		(void)wakeup_one((_cv), WAIT_ANY);	\
+	}while(0)
+
+static inline uint_t kcv_broadcast(kcv_t *cv)
+{
+	return wakeup_all(cv); 
+}
+
+#undef kcv_destroy
+#define kcv_destroy(_cv)						\
+	do{								\
+		if(!(wait_queue_isEmpty((_cv))))			\
+			printk(ERROR,"ERROR: %s: kcv [%s] is busy\n", __FUNCTION__, (_cv)->name); \
+	}while(0)
+
+#endif	/* _KCOND_VAR_H_ */
Index: trunk/kernel/kern/kdmsg.h
===================================================================
--- trunk/kernel/kern/kdmsg.h	(revision 1)
+++ trunk/kernel/kern/kdmsg.h	(revision 1)
@@ -0,0 +1,297 @@
+/*
+ * kdmsg.h - printk like functions and trace messages
+ * 
+ * authors     Ghassan Almaless (2008,2009,2010,2011,2012)
+ *             Mohamed Lamine Karaoui (2015)
+ *             Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *  
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _KDMSG_H_
+#define _KDMSG_H_
+
+#include <hal_types.h>
+#include <spinlock.h>
+#include <stdarg.h>
+
+#define ERROR     DMSG_ERROR
+#define WARNING   DMSG_WARNING
+#define INFO      DMSG_INFO
+#define DEBUG     DMSG_DEBUG
+#define BOOT      DMSG_BOOT
+#define ASSERT    DMSG_ASSERT
+
+#define LEVEL     CONFIG_DMSG_LEVEL
+
+typedef enum
+{
+	PRINTK_KTTY_LOCK,
+	ISR_KTTY_LOCK,
+	NO_KTTY_LOCK
+} 
+ktty_lock_t;
+
+typedef struct kdmsg_channel_s
+{
+	union
+	{
+		global_t val;
+		uint_t id;
+	};
+}
+kdmsg_channel_t;
+
+extern kdmsg_channel_t klog_tty;
+extern kdmsg_channel_t kisr_tty;
+extern kdmsg_channel_t kexcept_tty;
+
+#define printk(level, args...)						\
+	do{								\
+		if((level) <= LEVEL)					\
+			__fprintk(klog_tty.id, PRINTK_KTTY_LOCK, args);	\
+	}while(0)
+
+
+#define isr_dmsg(level, args...)					\
+	do{								\
+		if((level) <= LEVEL)					\
+			__fprintk(kisr_tty.id, ISR_KTTY_LOCK, args);	\
+	}while(0)
+
+#define cpu_log_msg(...)					\
+	do{							\
+		__fprintk(cpu_get_id(), NO_KTTY_LOCK, __VA_ARGS__);	\
+	}while(0)
+
+
+#if (ERROR <= LEVEL)
+#define except_dmsg(args...) do { __fprintk(kexcept_tty.id, NO_KTTY_LOCK, args); } while(0)
+#else
+#define except_dmsg(args...)
+#endif
+
+#if (BOOT <= LEVEL)
+#if CONFIG_SHOW_ALL_BOOT_MSG
+#define boot_dmsg(args...)   do { __arch_boot_dmsg(args); } while(0)
+#else
+#define boot_dmsg(args...)   do { if ( current_cid == 0 ) __arch_boot_dmsg(args); } while(0)
+#endif
+#else
+#define boot_dmsg(args...)
+#endif
+
+void kdmsg_init();
+void kboot_tty_init(boot_info_t *info);
+void bdump(uint8_t *buff, size_t count);
+
+int __perror (int fatal, const char *fmt, ...);
+int __fprintk (int tty, ktty_lock_t ktl, const char *fmt, ...);
+int __arch_boot_dmsg (const char *fmt, ...);
+
+#define PANIC(MSG, ...)						\
+	do{								\
+		__perror(1,"PANIC at line: %d, file: %s , MSG: " MSG"\n", __LINE__,__FILE__, ##__VA_ARGS__);	\
+		while(1);											\
+	} while(0)
+
+
+/* Assert are not executed if the __OPTIMIZE__ macro is defined *
+ * This mean no important code should be put inside an assert	*/
+#if (ASSERT <= LEVEL) && (!defined (__OPTIMIZE__))
+//#if 1
+#define assert(expr) \
+(void) ((expr) ? 0 : __perror(0,"cpu %d: Assert "#expr" faild, line %d, file %s [%d]\n", cpu_get_id(), __LINE__, __FILE__, cpu_time_stamp()))
+#define bassert(expr) \
+(void) ((expr) ? 0 : __arch_boot_dmsg("Assert "#expr" faild, line %d, file %s [%d]\n", __LINE__, __FILE__, cpu_time_stamp()))
+#define assert2(_th,expr) \
+(void) ((expr) ? 0 : __perror(0,"[ %x ] Assert "#expr" faild, line %d, file %s, Thread [%x] on CPU [%d], Current Thread [%x] on CPU [%d], [%u]\n", cpu_time_stamp(), __LINE__,__FILE__, _th, thread_current_cpu((_th))->gid, current_thread, cpu_get_id(), cpu_time_stamp()))
+#else
+#define assert(expr) do{}while(0)
+#define assert2(_th,expr)do{}while(0)
+#define bassert(expr)do{}while(0)
+//#define full_assert(_th,expr)do{}while(0)
+#endif
+
+#define full_assert(_th,expr) \
+(void) ((expr) ? 0 : ({__perror(0,"[ %x ] Assert "#expr" faild, line %d, file %s, Thread [%x] on CPU [%d], Current Thread [%x] on CPU [%d], [%u]\n", cpu_time_stamp(), __LINE__,__FILE__, _th, thread_current_cpu((_th))->gid, current_thread, cpu_get_id(), cpu_time_stamp()); while(1);}))
+
+/////////////////////////////////////////////////////////////////////////
+//      per subsystem printk wrapper upon its debug configuration      //
+/////////////////////////////////////////////////////////////////////////
+
+#define dmsg(level, config, args...)		\
+	do					\
+	{					\
+		if((level) <= (config))		\
+			printk(DEBUG, args);	\
+	} while(0)
+
+#if CONFIG_IOC_DEBUG
+#define ioc_dmsg( args... )   printk( args )
+#else
+#define ioc_dmsg( args... )
+#endif
+
+#if CONFIG_VFAT_DEBUG
+#define vfat_dmsg(level, args...)		\
+	dmsg(level, CONFIG_VFAT_DEBUG, args)
+#else
+#define vfat_dmsg(args...)
+#endif
+
+#if CONFIG_EXT2_DEBUG
+#define ext2_dmsg(level, args...)		\
+	dmsg(level, CONFIG_EXT2_DEBUG, args)
+#else
+#define ext2_dmsg(args...)
+#endif
+
+#if CONFIG_DEVFS_DEBUG
+#define devfs_dmsg(level, args...)		\
+	dmsg(level, CONFIG_DEVFS_DEBUG, args)
+#else
+#define devfs_dmsg(args...)
+#endif
+
+#if CONFIG_SYSFS_DEBUG
+#define sysfs_dmsg(level, args...)		\
+	dmsg(level, CONFIG_SYSFS_DEBUG, args)
+#else
+#define sysfs_dmsg(args...)
+#endif
+
+#if CONFIG_VFS_DEBUG
+#define vfs_dmsg(level, args...)		\
+	dmsg(level, CONFIG_VFS_DEBUG, args)
+#else
+#define vfs_dmsg(args...)
+#endif
+
+#if CONFIG_MAPPER_DEBUG
+#define mapper_dmsg(level, args...)		\
+	dmsg(level, CONFIG_MAPPER_DEBUG, args)
+#else
+#define mapper_dmsg(args...)
+#endif
+
+#if CONFIG_KMEM_DEBUG
+#define kmem_dmsg(args...) boot_dmsg(args)//printk(DEBUG, args)
+#else
+#define kmem_dmsg(args...)
+#endif
+
+#if CONFIG_KHM_DEBUG
+#define khm_dmsg(args...) boot_dmsg(args)//printk(DEBUG, args)
+#else
+#define khm_dmsg(args...)
+#endif
+
+#if CONFIG_KCM_DEBUG
+#define kcm_dmsg(args...) printk(DEBUG, args)
+#else
+#define kcm_dmsg(args...)
+#endif
+
+#if CONFIG_VMM_DEBUG
+#define vmm_dmsg(level, args...)		\
+	dmsg(level, CONFIG_VMM_DEBUG, args)
+#else
+#define vmm_dmsg(args...)
+#endif
+
+#if CONFIG_VMM_REGION_DEBUG
+#define vmm_reg_dmsg(level, args...)			\
+	dmsg(level, CONFIG_VMM_REGION_DEBUG, args)
+#else
+#define vmm_reg_dmsg(args...)
+#endif
+
+#if CONFIG_DQDT_DEBUG
+#define dqdt_dmsg(level, args...)		\
+	dmsg(level, CONFIG_DQDT_DEBUG, args)
+#else
+#define dqdt_dmsg(args...)
+#endif
+
+#if CONFIG_KFIFO_DEBUG
+#define lffb_dmsg(level, args...)		\
+	dmsg(level, CONFIG_KFIFO_DEBUG, args)
+#else
+#define lffb_dmsg(args...)
+#endif
+
+#if CONFIG_FORK_DEBUG
+#define fork_dmsg(level, args...)		\
+	dmsg(level, CONFIG_FORK_DEBUG, args)
+#else
+#define fork_dmsg(args...)
+#endif
+
+#if CONFIG_SHOW_THREAD_MSG
+#define thread_dmsg(level, args...)		\
+	dmsg(level, CONFIG_SHOW_THREAD_MSG, args)
+#else
+#define thread_dmsg(args...)
+#endif
+
+#if CONFIG_ELF_DEBUG
+#define elf_dmsg(level, args...)		\
+	dmsg(level, CONFIG_ELF_DEBUG, args)
+#else
+#define elf_dmsg(args...)
+#endif
+
+
+#if CONFIG_PID_DEBUG
+#define pid_dmsg(level, args...)                \
+        dmsg(level, CONFIG_PID_DEBUG, args)
+#else
+#define pid_dmsg(args...)
+#endif
+
+#if CONFIG_SHOW_SIG_MSG
+#define sig_dmsg(level, args...)                \
+        dmsg(level, CONFIG_SHOW_SIG_MSG, args)
+#else
+#define sig_dmsg(args...)
+#endif
+
+#if CONFIG_HTBL_DEBUG
+#define htbl_dmsg(level, args...)                \
+        dmsg(level, CONFIG_HTBL_DEBUG, args)
+#else
+#define htbl_dmsg(args...)
+#endif
+
+#if CONFIG_SHOW_RPC_MSG
+#define rpc_dmsg(level, args...)                \
+        dmsg(level, CONFIG_SHOW_RPC_MSG, args)
+#else
+#define rpc_dmsg(args...)
+#endif
+
+#if CONFIG_EXEC_DEBUG
+#define exec_dmsg(level, args...)               \
+        dmsg(level, CONFIG_EXEC_DEBUG, args)
+#else
+#define exec_dmsg(args...)
+#endif
+/////////////////////////////////////////////////////////////
+
+#endif // _KDMSG_H_
Index: trunk/kernel/kern/kernel_init.c
===================================================================
--- trunk/kernel/kern/kernel_init.c	(revision 690)
+++ trunk/kernel/kern/kernel_init.c	(revision 1)
@@ -1,7 +1,6 @@
 /*
  * kernel_init.c - kernel parallel initialization
- *
- * Authors :  Mohamed Lamine Karaoui (2015)
- *            Alain Greiner          (2016,2017,2018,2019,2020)
+ * 
+ * Authors :  Alain Greiner  (2016)
  *
  * Copyright (c) Sorbonne Universites
@@ -23,337 +22,103 @@
  */
 
-#include <kernel_config.h>
+#include <almos_config.h>
 #include <errno.h>
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <hal_context.h>
-#include <hal_irqmask.h>
-#include <hal_macros.h>
-#include <hal_ppm.h>
-#include <barrier.h>
-#include <xbarrier.h>
-#include <remote_fifo.h>
+#include <remote_barrier.h>
 #include <core.h>
 #include <list.h>
-#include <xlist.h>
-#include <xhtab.h>
 #include <thread.h>
 #include <scheduler.h>
-#include <ksocket.h>
 #include <kmem.h>
 #include <cluster.h>
+#include <devfs.h>
+#include <sysfs.h>
 #include <string.h>
 #include <memcpy.h>
 #include <ppm.h>
-#include <kcm.h>
 #include <page.h>
-#include <chdev.h>
+#include <device.h>
 #include <boot_info.h>
 #include <dqdt.h>
+#include <dev_icu.h>
 #include <dev_mmc.h>
-#include <dev_dma.h>
-#include <dev_iob.h>
+#include <dev_mwr.h>
+#include <dev_iox.h>
 #include <dev_ioc.h>
-#include <dev_txt.h>
 #include <dev_pic.h>
 #include <printk.h>
 #include <vfs.h>
-#include <devfs.h>
-#include <mapper.h>
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// All the following global variables are replicated in all clusters.
+
+
+#define KERNEL_INIT_SYNCRO  0xA5A5B5B5
+
+///////////////////////////////////////////////////////////////////////////////////////////
+// All these global variables are replicated in all clusters.
 // They are initialised by the kernel_init() function.
-//
-// WARNING : The section names have been defined to control the base addresses of the
-// boot_info structure and the idle thread descriptors, through the kernel.ld script:
-// - the boot_info structure is built by the bootloader, and used by kernel_init.
-//   it must be the first object in the kdata segment.
-// - the array of idle threads descriptors must be placed on the first page boundary after
-//   the boot_info structure in the kdata segment.
-///////////////////////////////////////////////////////////////////////////////////////////
-
-// This variable defines the local boot_info structure
-__attribute__((section(".kinfo")))
-boot_info_t          boot_info;
-
-// This variable defines the "idle" threads descriptors array
-__attribute__((section(".kidle")))
-char                 idle_threads[CONFIG_THREAD_DESC_SIZE *
-                                   CONFIG_MAX_LOCAL_CORES]   CONFIG_PPM_PAGE_ALIGNED;
-
-// This variable defines the local cluster manager
-__attribute__((section(".kdata")))
-cluster_t            cluster_manager                         CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable defines the TXT_TX[0] chdev
-__attribute__((section(".kdata")))
-chdev_t              txt0_tx_chdev                           CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable defines the TXT_RX[0] chdev
-__attribute__((section(".kdata")))
-chdev_t              txt0_rx_chdev                           CONFIG_CACHE_LINE_ALIGNED;
-
-// This variables define the kernel process0 descriptor
-__attribute__((section(".kdata")))
-process_t            process_zero                            CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable defines a set of extended pointers on the distributed chdevs
-__attribute__((section(".kdata")))
-chdev_directory_t    chdev_dir                               CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable contains the input IRQ indexes for the IOPIC controller
-__attribute__((section(".kdata")))
-iopic_input_t        iopic_input                             CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable contains the input IRQ indexes for the LAPIC controller
-__attribute__((section(".kdata")))
-lapic_input_t        lapic_input                             CONFIG_CACHE_LINE_ALIGNED;
+///////////////////////////////////////////////////////////////////////////////////////////
+
+// This variable defines the local cluster manager 
+cluster_t            cluster_manager    CACHELINE_ALIGNED; 
+
+// This variable defines the kernel process descriptor and associated thread
+process_t            process_zero       CACHELINE_ALIGNED;            
+thread_t             thread_zero        CACHELINE_ALIGNED;
+
+// This variable contains the extended pointers on the device descriptors
+devices_directory_t  devices_dir        CACHELINE_ALIGNED;
+
+// This variable contains the input IRQ indexes for the PIC and ICU devices
+devices_input_irq_t  devices_input_irq   CACHELINE_ALIGNED;
+
+// This variable synchronizes the cores during kernel_init()
+volatile uint32_t    local_sync_init = 0;  
 
 // This variable defines the local cluster identifier
-__attribute__((section(".kdata")))
-cxy_t                local_cxy                               CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable is used for core[0] cores synchronisation in kernel_init()
-__attribute__((section(".kdata")))
-xbarrier_t           global_barrier                          CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable is used for local cores synchronisation in kernel_init()
-__attribute__((section(".kdata")))
-barrier_t            local_barrier                           CONFIG_CACHE_LINE_ALIGNED;
-
-// This variable defines the array of supported File System contexts
-__attribute__((section(".kdata")))
-vfs_ctx_t            fs_context[FS_TYPES_NR]                 CONFIG_CACHE_LINE_ALIGNED;
-
-// This array is used for debug, and describes the kernel locks usage,
-// It must be kept consistent with the defines in kernel_config.h file.
-__attribute__((section(".kdata")))
-char * lock_type_str[] =
-{
-    "unused_0",              //  0   must be unused to help debug
-
-    "CLUSTER_KCM",           //  1
-    "SCHED_STATE",           //  2
-    "VMM_STACK",             //  3
-    "VMM_MMAP",              //  4
-    "KCM_STATE",             //  5
-    "KHM_STATE",             //  6
-    "HTAB_STATE",            //  7
-    "CORE_ALARMS",           //  8
-
-    "VFS_CTX",               //  9
-    "PPM_FREE",              // 10
-    "THREAD_JOIN",           // 11
-    "XHTAB_STATE",           // 12
-    "CHDEV_QUEUE",           // 13
-    "CHDEV_TXT0",            // 14
-    "CHDEV_TXTLIST",         // 15
-    "PAGE_STATE",            // 16
-    "MUTEX_STATE",           // 17
-    "CONDVAR_STATE",         // 18
-    "SEM_STATE",             // 19
-    "PROCESS_CWD",           // 20
-    "BARRIER_STATE",         // 21
-    "LISTEN_SOCKET",         // 22
-
-    "CLUSTER_PREFTBL",       // 23
-
-    "SOCKET_STATE",          // 24
-    "PPM_DIRTY",             // 25
-    "CLUSTER_LOCALS",        // 26
-    "CLUSTER_COPIES",        // 27
-    "PROCESS_CHILDREN",      // 28
-    "PROCESS_USERSYNC",      // 29
-    "PROCESS_FDARRAY",       // 30
-    "PROCESS_DIR",           // 31
-    "VMM_VSL",               // 32
-
-    "PROCESS_THTBL",         // 33
-
-    "MAPPER_STATE",          // 34
-    "VFS_SIZE",              // 35
-    "VFS_FILE",              // 36
-    "VFS_MAIN",              // 37
-    "FATFS_FAT",             // 38
-    "FBF_WINDOWS",           // 39
-};        
-
-// debug variables to analyse the sys_read()  syscalls timing
-
-#if DEBUG_SYS_READ
-uint32_t   enter_sys_read;
-uint32_t   exit_sys_read;
-
-uint32_t   enter_devfs_read;
-uint32_t   exit_devfs_read;
-
-uint32_t   enter_txt_read;
-uint32_t   exit_txt_read;
-
-uint32_t   enter_chdev_cmd_read;
-uint32_t   exit_chdev_cmd_read;
-
-uint32_t   enter_chdev_server_read;
-uint32_t   exit_chdev_server_read;
-
-uint32_t   enter_tty_cmd_read;
-uint32_t   exit_tty_cmd_read;
-
-uint32_t   enter_tty_isr_read;
-uint32_t   exit_tty_isr_read;
-#endif
-
-// debug variables  to analyse the sys_write() syscall timing
-
-#if DEBUG_SYS_WRITE    
-uint32_t   enter_sys_write;
-uint32_t   exit_sys_write;
-
-uint32_t   enter_devfs_write;
-uint32_t   exit_devfs_write;
-
-uint32_t   enter_txt_write;
-uint32_t   exit_txt_write;
-
-uint32_t   enter_chdev_cmd_write;
-uint32_t   exit_chdev_cmd_write;
-
-uint32_t   enter_chdev_server_write;
-uint32_t   exit_chdev_server_write;
-
-uint32_t   enter_tty_cmd_write;
-uint32_t   exit_tty_cmd_write;
-
-uint32_t   enter_tty_isr_write;
-uint32_t   exit_tty_isr_write;
-#endif
-
-// intrumentation variables : cumulated costs per syscall type in cluster
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-__attribute__((section(".kdata")))
-uint32_t   syscalls_cumul_cost[SYSCALLS_NR];
-
-__attribute__((section(".kdata")))
-uint32_t   syscalls_occurences[SYSCALLS_NR];
-#endif
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This function displays the ALMOS_MKH banner.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void print_banner( uint32_t nclusters , uint32_t ncores )
-{
-    printk("\n"
-           "                    _        __    __     _____     ______         __    __    _   __   _     _   \n"
-           "          /\\       | |      |  \\  /  |   / ___ \\   / _____|       |  \\  /  |  | | / /  | |   | |  \n"
-           "         /  \\      | |      |   \\/   |  | /   \\ | | /             |   \\/   |  | |/ /   | |   | |  \n"
-           "        / /\\ \\     | |      | |\\  /| |  | |   | | | |_____   ___  | |\\  /| |  |   /    | |___| |  \n"
-           "       / /__\\ \\    | |      | | \\/ | |  | |   | | \\_____  \\ |___| | | \\/ | |  |   \\    |  ___  |  \n"
-           "      / ______ \\   | |      | |    | |  | |   | |       | |       | |    | |  | |\\ \\   | |   | |  \n"
-           "     / /      \\ \\  | |____  | |    | |  | \\___/ |  _____/ |       | |    | |  | | \\ \\  | |   | |  \n"
-           "    /_/        \\_\\ |______| |_|    |_|   \\_____/  |______/        |_|    |_|  |_|  \\_\\ |_|   |_|  \n"
-           "\n\n\t\t Advanced Locality Management Operating System / Multi Kernel Hybrid\n"
-           "\n\n\t\t %s / %d cluster(s) / %d core(s) per cluster\n\n",
-           CONFIG_VERSION , nclusters , ncores );
+cxy_t                local_cxy;
+
+
+///////////////////////////////////////////////////////////////////////////////////////////
+// This function displays the ALMOS_MKH.banner.
+///////////////////////////////////////////////////////////////////////////////////////////
+static void print_boot_banner()
+{ 
+        printk("\n           ____        ___        ___       ___    _______    ________         ___       ___   ___     ___   \n");
+        printk("          /    \\      |   |      |   \\     /   |  /  ___  \\  /  ____  |       |   \\     /   | |   |   /  / \n");
+        printk("         /  __  \\      | |        |   \\___/   |  |  /   \\  | | /    |_/        |   \\___/   |   | |   /  /  \n");
+        printk("        /  /  \\  \\     | |        |  _     _  |  | |     | | | |______   ___   |  _     _  |   | |__/  /     \n");
+        printk("       /  /____\\  \\    | |        | | \\   / | |  | |     | | \\______  \\ |___|  | | \\   / | |   |  __  <  \n");
+        printk("      /   ______   \\   | |     _  | |  \\_/  | |  | |     | |  _     | |        | |  \\_/  | |   | |  \\  \\  \n");
+        printk("     /   /      \\   \\  | |____/ | | |       | |  |  \\___/  | | \\____/ |        | |       | |   | |   \\  \\\n");
+        printk("    /_____/    \\_____\\|_________/|___|     |___|  \\_______/  |________/       |___|     |___| |___|   \\__\\\n");
+
+
+        printk("\n\n\t\t\t\t Multi-Kernel Advanced Locality Management Operating System\n");
+        printk("\t\t\t\t   %s \n\n\n", CONFIG_ALMOS_VERSION );
 }
 
 
 ///////////////////////////////////////////////////////////////////////////////////////////
-// This function initializes the TXT_TX[0] and TXT_RX[0] chdev descriptors, implementing
-// the "kernel terminal", shared by all kernel instances for debug messages. 
-// These chdev are implemented as global variables (replicated in all clusters),
-// because this terminal is used before the kmem allocator initialisation, but only 
-// the chdevs in cluster 0 are registered in the "chdev_dir" directory.
-// As this TXT0 chdev supports only the TXT_SYNC_WRITE command, we don't create
-// a server thread, we don't allocate a WTI, and we don't initialize the waiting queue.
-// Note: The TXT_RX[0] chdev is created, but is not used by ALMOS-MKH (september 2018).
+// This static function allocates memory for all devices descriptors associated 
+// to peripherals contained in the local cluster: 
+// - the internal (replicated) devices are placed in the local cluster.
+// - the external devices are pseudo-randomly distributed on all clusters. 
+// It initialises these device descriptors as specified by the boot_info_t structure,
+// including the dynamic linking with the driver for the specified implementation.
+// Finally, all copies of the devices directory are initialised.
+// TODO check that cluster IO contains a PIC and IOB [AG]
 ///////////////////////////////////////////////////////////////////////////////////////////
 // @ info    : pointer on the local boot-info structure.
 ///////////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__ ((noinline)) txt0_device_init( boot_info_t * info )
+static void devices_init( boot_info_t * info )
 {
     boot_device_t * dev_tbl;         // pointer on array of devices in boot_info
-    uint32_t        dev_nr;          // actual number of devices in this cluster
-    xptr_t          base;            // remote pointer on segment base
-    uint32_t        func;            // device functional index
-    uint32_t        impl;            // device implementation index
-    uint32_t        i;               // device index in dev_tbl
-    uint32_t        x;               // X cluster coordinate
-    uint32_t        y;               // Y cluster coordinate
-
-    // get number of peripherals and base of devices array from boot_info
-    dev_nr      = info->ext_dev_nr;
-    dev_tbl     = info->ext_dev;
-
-    // loop on external peripherals to find TXT device
-    for( i = 0 ; i < dev_nr ; i++ )
-    {
-        base        = dev_tbl[i].base;
-        func        = FUNC_FROM_TYPE( dev_tbl[i].type );
-        impl        = IMPL_FROM_TYPE( dev_tbl[i].type );
-
-        if (func == DEV_FUNC_TXT )
-        {
-            // initialize TXT_TX[0] chdev
-            txt0_tx_chdev.func    = func;
-            txt0_tx_chdev.impl    = impl;
-            txt0_tx_chdev.channel = 0;
-            txt0_tx_chdev.base    = base;
-            txt0_tx_chdev.is_rx   = false;
-            remote_busylock_init( XPTR( local_cxy , &txt0_tx_chdev.wait_lock ),
-                                  LOCK_CHDEV_TXT0 );
-            
-            // make TXT specific initialisations 
-            dev_txt_init( &txt0_tx_chdev );                 
-
-            // initialize TXT_RX[0] chdev
-            txt0_rx_chdev.func    = func;
-            txt0_rx_chdev.impl    = impl;
-            txt0_rx_chdev.channel = 0;
-            txt0_rx_chdev.base    = base;
-            txt0_rx_chdev.is_rx   = true;
-            remote_busylock_init( XPTR( local_cxy , &txt0_rx_chdev.wait_lock ),
-                                  LOCK_CHDEV_TXT0 );
-            
-            // make TXT specific initialisations 
-            dev_txt_init( &txt0_rx_chdev );
-
-            // register TXT_TX[0] & TXT_RX[0] in chdev_dir[x][y]
-            // for all valid clusters             
-            for( x = 0 ; x < info->x_size ; x++ )
-            {
-                for( y = 0 ; y < info->y_size ; y++ )
-                {
-                    cxy_t cxy = HAL_CXY_FROM_XY( x , y );
-
-                    if( cluster_is_active( cxy ) )
-                    {
-                        hal_remote_s64( XPTR( cxy , &chdev_dir.txt_tx[0] ) ,
-                                        XPTR( local_cxy , &txt0_tx_chdev ) );
-                        hal_remote_s64( XPTR( cxy , &chdev_dir.txt_rx[0] ) ,
-                                        XPTR( local_cxy , &txt0_rx_chdev ) );
-                    }
-                }
-            }
-
-            hal_fence();
-        }
-	} // end loop on devices
-}  // end txt0_device_init()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This function allocates memory and initializes the chdev descriptors for the internal
-// peripherals contained in the local cluster, other than the LAPIC, as specified by 
-// the boot_info, including the linking with the driver for the specified implementation.
-// The relevant entries in all copies of the devices directory are initialised.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ info    : pointer on the local boot-info structure.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__ ((noinline)) internal_devices_init( boot_info_t * info )
-{
-    boot_device_t * dev_tbl;         // pointer on array of internaldevices in boot_info
 	uint32_t        dev_nr;          // actual number of devices in this cluster
+	xptr_t          xp_dev;          // extended pointer on device descriptor
+	xptr_t          xp_dev_bis;      // extended pointer on second device descriptor
 	xptr_t          base;            // remote pointer on segment base
+	uint32_t        size;            // channel size (bytes)
+    uint32_t        type;            // peripheral type
     uint32_t        func;            // device functionnal index
     uint32_t        impl;            // device implementation index
@@ -362,1208 +127,380 @@
 	uint32_t        y;               // Y cluster coordinate
 	uint32_t        channels;        // number of channels
-	uint32_t        channel;         // channel index
-	chdev_t       * chdev_ptr;       // local pointer on created chdev
-
-    // get number of internal peripherals and base from boot_info
-	dev_nr	= info->int_dev_nr;
-    dev_tbl = info->int_dev;
-
-    // loop on internal peripherals
+	uint32_t        chl;             // channel index
+	uint32_t        p0;              // device parameter 0
+	uint32_t        p1;              // device parameter 1
+	uint32_t        p2;              // device parameter 2
+	uint32_t        p3;              // device parameter 3
+    bool_t          is_local;        // true for internal peripherals
+
+    // get number of peripherals from boot_info
+	dev_nr	    = info->devices_nr;
+    dev_tbl     = info->dev;
+
+    // loop on all peripherals in cluster
 	for( i = 0 ; i < dev_nr ; i++ )
 	{
-        base        = dev_tbl[i].base;
-        channels    = dev_tbl[i].channels;
-        func        = FUNC_FROM_TYPE( dev_tbl[i].type );
-        impl        = IMPL_FROM_TYPE( dev_tbl[i].type );
- 
-        //////////////////////////
-        if( func == DEV_FUNC_MMC )  
-        {
-            // create chdev in local cluster
-            chdev_ptr = chdev_create( func,
-                                      impl,
-                                      0,          // channel
-                                      false,      // direction
-                                      base );
-            if( chdev_ptr == NULL )
+        size     = dev_tbl[i].size;
+        base     = dev_tbl[i].base;
+        type     = dev_tbl[i].type;
+        channels = dev_tbl[i].channels;
+        p0       = dev_tbl[i].param0;
+        p1       = dev_tbl[i].param1;
+        p2       = dev_tbl[i].param2;
+        p3       = dev_tbl[i].param3;
+
+        func     = FUNC_FROM_TYPE( type );
+        impl     = IMPL_FROM_TYPE( type );
+
+        // do nothing for RAM and ROM functional types
+        if( (type == DEV_FUNC_RAM) || (type == DEV_FUNC_ROM) ) continue;
+
+        // loop on channels in peripheral
+        for( chl = 0 ; chl < channels ; chl++ )
+        { 
+            // target cluster is local for internal (replicated) peripherals
+            if( (func == DEV_FUNC_ICU) || 
+                (func == DEV_FUNC_MMC) ||
+                (func == DEV_FUNC_MWR) )   is_local = true;
+            else                           is_local = false;
+
+            // allocate memory and initialize device descriptor
+		    xp_dev = device_alloc( info , is_local );
+
+            if( xp_dev == XPTR_NULL ) hal_core_sleep();
+            
+            device_init( xp_dev ,
+                         func ,
+                         impl,
+                         chl,
+                         false,                    // TX
+                         base + size*chl,
+                         size );
+
+            // allocate memory and initialise another device descriptor if NIC, 
+            // ALMOS-MKH uses two separate devices descriptor for NIC_RX and NIC_TX
+            if( func == DEV_FUNC_NIC )
             {
-                printk("\n[PANIC] in %s : cannot create MMC chdev\n",
-                __FUNCTION__ );
-                hal_core_sleep();
-            }
-            
-#if (DEBUG_KERNEL_INIT & 0x1)
-if( hal_time_stamp() > DEBUG_KERNEL_INIT )
-printk("\n[%s] created chdev[%x,%x] for MMC\n",
-__FUNCTION__ , local_cxy , chdev_ptr );
-#endif
-            // make MMC specific initialisation
-            dev_mmc_init( chdev_ptr );
-
-            // set the MMC field in all chdev_dir[x][y] structures
+                xp_dev_bis = device_alloc( info , is_local );
+
+                if( xp_dev_bis == XPTR_NULL ) hal_core_sleep();
+
+                device_init( xp_dev_bis ,
+                             func ,
+                             impl,
+                             chl,
+                             true,                // RX
+                             (base + size*chl),
+                             size );
+             }
+
+            // TODO ??? AG
+		    // devfs_register( dev );
+
+            // make device type specific initialisation
+            // the number of parameters depends on the device type
+            if     ( func == DEV_FUNC_ICU ) dev_icu_init( xp_dev , p0 , p1 , p2 );     
+            else if( func == DEV_FUNC_MMC ) dev_mmc_init( xp_dev );
+// TODO     else if( func == DEV_FUNC_MWR ) dev_mwr_init( xp_dev , p0 , p1 , p2 , p3 );
+            else if( func == DEV_FUNC_IOB ) dev_iox_init( xp_dev );
+            else if( func == DEV_FUNC_IOC ) dev_ioc_init( xp_dev );
+            else if( func == DEV_FUNC_TXT ) dev_txt_init( xp_dev );
+            else if( func == DEV_FUNC_PIC ) dev_pic_init( xp_dev , p0 );
+            else if( func == DEV_FUNC_NIC ) dev_nic_init( xp_dev );
+            else                            hal_core_sleep();
+
+           // initialize the replicated devices_dir[x][y] structures
+           // defining the extended pointers on all devices descriptors 
+           xptr_t * ptr_dev;    
+           xptr_t * ptr_dev_bis;    
+
+           if( func == DEV_FUNC_ICU ) ptr_dev     = &devices_dir.icu[local_cxy];
+           if( func == DEV_FUNC_MMC ) ptr_dev     = &devices_dir.mmc[local_cxy];
+           if( func == DEV_FUNC_MWR ) ptr_dev     = &devices_dir.mwr[local_cxy];
+
+           if( func == DEV_FUNC_TXT ) ptr_dev     = &devices_dir.txt[chl];
+           if( func == DEV_FUNC_IOB ) ptr_dev     = &devices_dir.iob;
+           if( func == DEV_FUNC_IOC ) ptr_dev     = &devices_dir.ioc;
+           if( func == DEV_FUNC_PIC ) ptr_dev     = &devices_dir.pic;
+           if( func == DEV_FUNC_NIC ) ptr_dev     = &devices_dir.nic_tx[chl];
+           if( func == DEV_FUNC_NIC ) ptr_dev_bis = &devices_dir.nic_rx[chl];
+  
             for( x = 0 ; x < info->x_size ; x++ )
             {
                 for( y = 0 ; y < info->y_size ; y++ )
                 {
-                    cxy_t cxy = HAL_CXY_FROM_XY( x , y );
-
-                    if( cluster_is_active( cxy ) )
+                    cxy_t  cxy = (x<<info->y_width) + y;
+                     
+                    hal_remote_swd( XPTR( cxy , ptr_dev ) , xp_dev );
+
+                    if( func == DEV_FUNC_NIC )
                     {
-                        hal_remote_s64( XPTR( cxy , &chdev_dir.mmc[local_cxy] ), 
-                                        XPTR( local_cxy , chdev_ptr ) );
+                       hal_remote_swd( XPTR( cxy , ptr_dev_bis ) , xp_dev_bis );
                     }
                 }
             }
-
-#if( DEBUG_KERNEL_INIT & 0x1 )
-if( hal_time_stamp() > DEBUG_KERNEL_INIT )
-printk("\n[%s] initialised chdev[%x,%x] for MMC\n",
-__FUNCTION__ , local_cxy , chdev_ptr );
-#endif
-        }
-        ///////////////////////////////
-        else if( func == DEV_FUNC_DMA )
+           
+		    kinit_dmsg("[INFO] %s created device %s / channel %d / in cluster %x\n",
+                       __FUNCTION__ , device_func_str[func] , chl , dev_cxy );
+
+        } // end loop on channels
+
+        // initialize the replicated devices_irq[x][y] structures
+        // defining how peripherals are connected to PIC or ICU components
+        uint32_t   id;
+        uint8_t    valid;
+        uint32_t   dev_type;
+        uint8_t    channel;
+        uint8_t    is_rx;
+        uint32_t * ptr_irq; 
+
+        // default initiialization for devices_irq structure
+        
+        // only external peripherals can be connected to PIC
+        if( func == DEV_FUNC_PIC )  
         {
-            // create one chdev per channel in local cluster
-            for( channel = 0 ; channel < channels ; channel++ )
-            { 	
-                // create chdev[channel] in local cluster
-                chdev_ptr = chdev_create( func,
-                                          impl,
-                                          channel,
-                                          false,     // direction
-                                          base );
-                if( chdev_ptr == NULL )
+            // loop on PIC inputs
+            for( id = 0 ; id < CONFIG_MAX_IRQS_PER_PIC ; id++ )
+            {
+                valid     = dev_tbl[i].irq[id].valid;
+                dev_type  = dev_tbl[i].irq[id].dev_type;
+                channel   = dev_tbl[i].irq[id].channel;
+                is_rx     = dev_tbl[i].irq[id].is_rx;
+
+                // only valid IRQs are registered in the devices_input_irq structure
+                // ptr_irq is a local pointer on the entry to be set in devices_irq
+                if( valid )
                 {
-                    printk("\n[PANIC] in %s : cannot create DMA chdev\n",
-                    __FUNCTION__ );
-                    hal_core_sleep();
-                }
-            
-#if (DEBUG_KERNEL_INIT & 0x1)
-if( hal_time_stamp() > DEBUG_KERNEL_INIT )
-printk("\n[%s] cxy %x : created chdev[%x,%x] for DMA[%d]\n",
-__FUNCTION__ , local_cxy , chdev_ptr , channel );
-#endif
-                // make DMA specific initialisation
-                dev_dma_init( chdev_ptr );     
-
-                // initialize only the DMA[channel] field in the local chdev_dir[x][y]
-                // structure because the DMA device is not remotely accessible.
-                chdev_dir.dma[channel] = XPTR( local_cxy , chdev_ptr );
-
-#if( DEBUG_KERNEL_INIT & 0x1 )
-if( hal_time_stamp() > DEBUG_KERNEL_INIT )
-printk("\n[%s] initialised chdev[%x,%x] for DMA[%d]\n",
-__FUNCTION__ , local_cxy , chdev_ptr , channel );
-#endif
-            }
-        }
-    }
-}  // end internal_devices_init()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This function allocates memory and initializes the chdev descriptors for the  
-// external (shared) peripherals other than the IOPIC, as specified by the boot_info.
-// This includes the dynamic linking with the driver for the specified implementation.
-// These chdev descriptors are distributed on all clusters, using a modulo on a global 
-// index, identically computed in all clusters.
-// This function is executed in all clusters by the core[0], that computes a global index
-// for all external chdevs. Each core[0] core creates only the chdevs that must be placed  
-// in the local cluster, because the global index matches the local index. 
-// The relevant entries in all copies of the devices directory are initialised.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ info    : pointer on the local boot-info structure.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void external_devices_init( boot_info_t * info )
-{
-    boot_device_t * dev_tbl;         // pointer on array of external devices in boot_info
-	uint32_t        dev_nr;          // actual number of external devices 
-	xptr_t          base;            // remote pointer on segment base
-    uint32_t        func;            // device functionnal index
-    uint32_t        impl;            // device implementation index
-	uint32_t        i;               // device index in dev_tbl
-	uint32_t        x;               // X cluster coordinate
-	uint32_t        y;               // Y cluster coordinate
-	uint32_t        channels;        // number of channels
-	uint32_t        channel;         // channel index
-	uint32_t        directions;      // number of directions (1 or 2)
-	uint32_t        rx;              // direction index (0 or 1)
-    chdev_t       * chdev;           // local pointer on one channel_device descriptor
-    uint32_t        ext_chdev_gid;   // global index of external chdev
-
-    // get number of peripherals and base of devices array from boot_info
-    dev_nr      = info->ext_dev_nr;
-    dev_tbl     = info->ext_dev;
-
-    // initializes global index (PIC is already placed in cluster 0)
-    ext_chdev_gid = 1;
-
-    // loop on external peripherals
-    for( i = 0 ; i < dev_nr ; i++ )
-    {
-        base     = dev_tbl[i].base;
-        channels = dev_tbl[i].channels;
-        func     = FUNC_FROM_TYPE( dev_tbl[i].type );
-        impl     = IMPL_FROM_TYPE( dev_tbl[i].type );
-
-        // There is one chdev per direction for NIC and for TXT
-        if((func == DEV_FUNC_NIC) || (func == DEV_FUNC_TXT)) directions = 2;
-        else                                                 directions = 1;
-
-        // do nothing for ROM, that does not require a device descriptor.
-        if( func == DEV_FUNC_ROM ) continue;
-
-        // do nothing for PIC, that is already initialized
-        if( func == DEV_FUNC_PIC ) continue;
-
-        // check PIC device initialized
-        if( chdev_dir.pic == XPTR_NULL )
-        {
-            printk("\n[PANIC] in %s : PIC device must be initialized first\n",
-            __FUNCTION__ );
-            hal_core_sleep();
-        }
-
-        // check external device functionnal type
-        if( (func != DEV_FUNC_IOB) && 
-            (func != DEV_FUNC_IOC) && 
-            (func != DEV_FUNC_TXT) &&
-            (func != DEV_FUNC_NIC) && 
-            (func != DEV_FUNC_FBF) )
-        {
-            printk("\n[PANIC] in %s : undefined peripheral type\n",
-            __FUNCTION__ );
-            hal_core_sleep();
-        }
-
-        // loop on channels
-        for( channel = 0 ; channel < channels ; channel++ )
-        {
-            // loop on directions
-            for( rx = 0 ; rx < directions ; rx++ )
-            {
-                // skip TXT0 that has already been initialized
-                if( (func == DEV_FUNC_TXT) && (channel == 0) ) continue;
-
-                // all kernel instances compute the target cluster for all chdevs,
-                // and the global index ext_chdev_gid[func,channel,direction]
-                cxy_t target_cxy;
-                while( 1 )
-                {
-                    uint32_t offset     = ext_chdev_gid % ( info->x_size * info->y_size );
-                    uint32_t x          = offset / info->y_size;
-                    uint32_t y          = offset % info->y_size;
-
-                    target_cxy = HAL_CXY_FROM_XY( x , y );
-
-                    // exit loop if target cluster is active
-                    if( cluster_is_active( target_cxy ) ) break;
-                
-                    // increment global index otherwise
-                    ext_chdev_gid++;
-                }
-
-                // allocate and initialize a local chdev
-                // when local cluster matches target cluster
-                if( target_cxy == local_cxy )
-                {
-                    chdev = chdev_create( func,
-                                          impl,
-                                          channel,
-                                          rx,          // direction
-                                          base );
-
-                    if( chdev == NULL )
-                    {
-                        printk("\n[PANIC] in %s : cannot allocate chdev\n",
-                        __FUNCTION__ );
-                        hal_core_sleep();
-                    }
-
-#if (DEBUG_KERNEL_INIT & 0x1)
-if( hal_time_stamp() > DEBUG_KERNEL_INIT )
-printk("\n[%s] created chdev[%x,%x] for %s[%d] / is_rx %d\n",
-__FUNCTION__ , local_cxy , chdev , chdev_func_str(func) , channel , rx );
-#endif
-                    // make device type specific initialisation
-                    if     ( func == DEV_FUNC_IOB ) dev_iob_init( chdev );
-                    else if( func == DEV_FUNC_IOC ) dev_ioc_init( chdev );
-                    else if( func == DEV_FUNC_TXT ) dev_txt_init( chdev );
-                    else if( func == DEV_FUNC_NIC ) dev_nic_init( chdev );
-                    else if( func == DEV_FUNC_FBF ) dev_fbf_init( chdev );
-
-                    // all external (shared) devices are remotely accessible
-                    // initialize the replicated chdev_dir[x][y] structures
-                    // defining the extended pointers on chdev descriptors
-                    xptr_t * entry = NULL;
-
-                    if(func==DEV_FUNC_IOB             ) entry  = &chdev_dir.iob;
-                    if(func==DEV_FUNC_IOC             ) entry  = &chdev_dir.ioc[channel];
-                    if(func==DEV_FUNC_FBF             ) entry  = &chdev_dir.fbf[channel];
-                    if((func==DEV_FUNC_TXT) && (rx==0)) entry  = &chdev_dir.txt_tx[channel];
-                    if((func==DEV_FUNC_TXT) && (rx==1)) entry  = &chdev_dir.txt_rx[channel];
-                    if((func==DEV_FUNC_NIC) && (rx==0)) entry  = &chdev_dir.nic_tx[channel];
-                    if((func==DEV_FUNC_NIC) && (rx==1)) entry  = &chdev_dir.nic_rx[channel];
-
+                    uint16_t dev_func = FUNC_FROM_TYPE( dev_type );
+                    if( dev_func == DEV_FUNC_TXT )   
+                        ptr_irq = &devices_input_irq.txt[channel];
+                    if( dev_func == DEV_FUNC_IOC )                   
+                        ptr_irq = &devices_input_irq.ioc; 
+                    if( (dev_func == DEV_FUNC_NIC) && (is_rx == 0) ) 
+                        ptr_irq = &devices_input_irq.nic_tx[channel]; 
+                    if( (dev_func == DEV_FUNC_NIC) && (is_rx != 0) ) 
+                        ptr_irq = &devices_input_irq.nic_rx[channel]; 
+                   
+                    // all copies of devices_irq must be updated in all clusters
                     for( x = 0 ; x < info->x_size ; x++ )
                     {
                         for( y = 0 ; y < info->y_size ; y++ )
                         {
-                            cxy_t cxy = HAL_CXY_FROM_XY( x , y );
-
-                            if( cluster_is_active( cxy ) && ( entry != NULL ) )
-                            {
-                                hal_remote_s64( XPTR( cxy , entry ),
-                                                XPTR( local_cxy , chdev ) );
-                            }
+                            cxy_t  cxy = (x<<info->y_width) + y;
+                            hal_remote_sw( XPTR( cxy , ptr_irq ) , id );
+                        }	
+                    }
+                }
+            } // end loop on PIC inputs
+        } // end PIC
+
+        // only internal peripherals can be connected to ICU
+        if( func == DEV_FUNC_ICU )  
+        {
+            // loop on ICU inputs
+            for( id = 0 ; id < CONFIG_MAX_HWIS_PER_ICU ; id++ )
+            {
+                valid    = dev_tbl[i].irq[id].valid;
+                dev_type = dev_tbl[i].irq[id].dev_type;
+                channel  = dev_tbl[i].irq[id].channel;
+
+                // only valid IRQs are registered in the devices_input_irq structure
+                // ptr_irq is a local pointer on the entry to be set in devices_irq
+                if( valid )
+                {
+                    uint16_t dev_func = FUNC_FROM_TYPE( dev_type );
+                    if( dev_func == DEV_FUNC_MMC )  
+                        ptr_irq = &devices_input_irq.mmc[local_cxy];
+                    if( dev_func == DEV_FUNC_MWR )  
+                        ptr_irq = &devices_input_irq.mwr[local_cxy]; 
+                   
+                    // all copies of devices_irq must be updated in all clusters
+                    for( x = 0 ; x < info->x_size ; x++ )
+                    {
+                        for( y = 0 ; y < info->y_size ; y++ )
+                        {
+                            cxy_t  cxy = (x<<info->y_width) + y;
+                            hal_remote_sw( XPTR( cxy , ptr_irq ) , id );
                         }
                     }
-
-#if( DEBUG_KERNEL_INIT & 1 )
-if( hal_time_stamp() > DEBUG_KERNEL_INIT )
-printk("\n[%s] initialised chdev[%x,%x] for %s\n",
-__FUNCTION__ , local_cxy, chdev , chdev->name );
-#endif
-
-                }  // end if match
-
-                // increment chdev global index (matching or not)
-                ext_chdev_gid++;
-
-            } // end loop on directions
-        }  // end loop on channels
-	} // end loop on devices
-}  // end external_devices_init()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This function is called by core[0][0] to allocate memory and initialize the PIC
-// device, namely the informations attached to the external IOPIC controller, that
-// must be replicated in all clusters (struct iopic_input).
-// This initialisation must be done before other devices initialisation because the IRQ
-// routing infrastructure is required for both internal and external devices init.
+                }
+            }  // end loop on ICU inputs
+        }  // end ICU
+	} // end loop on peripherals
+}  // end devices_init()
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////////
+// This function is the entry point for the kernel initialisation.
+// It is executed by all cores in all clusters, but only core[0] in each cluster
+// initialize the cluster manager, ant the other local shared resources. 
+// To comply with the multi-kernels paradigm, it access only local cluster memory,
+// using only informations contained in the local boot_info_t structure, 
+// that has been set by the bootloader.
+// All cores TODO ...
 ///////////////////////////////////////////////////////////////////////////////////////////
 // @ info    : pointer on the local boot-info structure.
 ///////////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__ ((noinline)) iopic_init( boot_info_t * info )
+void kernel_init( boot_info_t * info )
 {
-    boot_device_t * dev_tbl;         // pointer on boot_info external devices array
-	uint32_t        dev_nr;          // actual number of external devices
-	xptr_t          base;            // remote pointer on segment base
-    uint32_t        func;            // device functionnal index
-    uint32_t        impl;            // device implementation index
-	uint32_t        i;               // device index in dev_tbl
-    uint32_t        x;               // cluster X coordinate
-    uint32_t        y;               // cluster Y coordinate
-    bool_t          found;           // IOPIC found
-	chdev_t       * chdev;           // pointer on PIC chdev descriptor
-
-    // get number of external peripherals and base of array from boot_info
-	dev_nr	    = info->ext_dev_nr;
-    dev_tbl     = info->ext_dev;
-
-    // avoid GCC warning
-    base        = XPTR_NULL;
-    impl        = 0;
-
-    // loop on external peripherals to get the IOPIC  
-	for( i = 0 , found = false ; i < dev_nr ; i++ )
-	{
-        func = FUNC_FROM_TYPE( dev_tbl[i].type );
-
-        if( func == DEV_FUNC_PIC )
+    uint32_t     core_lid;      // running core local index
+    cxy_t        core_cxy;      // running core cluster identifier
+    gid_t        core_gid;      // running core hardware identifier 
+    cluster_t  * cluster;       // pointer on local cluster manager
+    core_t     * core;          // pointer on running core descriptor
+    thread_t   * thread_idle;   // pointer on thread_idle  
+
+	uint32_t     i;
+    bool_t       found;
+    error_t      error;
+
+    // initialise global cluster identifier
+    local_cxy = info->cxy;
+
+    // each core get its global index from hardware register
+    core_gid = hal_get_gid(); 
+
+    // Each core makes an associative search in boot_info
+    // to get its (cxy,lid) composite index 
+    found    = false;
+    core_cxy = 0;
+    core_lid = 0;
+    for( i = 0 ; i < info->cores_nr ; i++ )
+    {
+        if( core_gid == info->core[i].gid )
         {
-            base     = dev_tbl[i].base;
-            impl     = IMPL_FROM_TYPE( dev_tbl[i].type );
-            found    = true;
+            core_lid = info->core[i].lid;
+            core_cxy = info->core[i].cxy;
+            found = true;
             break;
         }
     }
-
-    // check PIC existence
-    if( found == false )
-    {
-        printk("\n[PANIC] in %s : PIC device not found\n",
-        __FUNCTION__ );
+         
+    if ( found == false )
+    {
+        printk("PANIC in %s : Core %d not registered in cluster %x\n",
+               __FUNCTION__ , core_gid , local_cxy );
         hal_core_sleep();
     }
 
-    // allocate and initialize the PIC chdev in cluster 0
-    chdev = chdev_create( DEV_FUNC_PIC,
-                          impl,
-                          0,      // channel
-                          0,      // direction,
-                          base );
-
-    // check memory
-    if( chdev == NULL )
-    {
-        printk("\n[PANIC] in %s : no memory for PIC chdev\n",
-        __FUNCTION__ );
+    if ( core_cxy != local_cxy) 
+    {
+        printk("PANIC in %s : Core %d has wrong cxy in cluster %x\n",
+               __FUNCTION__ , core_gid , local_cxy );
         hal_core_sleep();
     }
 
-    // make PIC device type specific initialisation
-    dev_pic_init( chdev );
-
-    // register, in all clusters, the extended pointer
-    // on PIC chdev in "chdev_dir" array
-    xptr_t * entry = &chdev_dir.pic;    
-                
-    for( x = 0 ; x < info->x_size ; x++ )
-    {
-        for( y = 0 ; y < info->y_size ; y++ )
+    // from this point, only core[0] initialises local resources
+    if( core_lid == 0 )    
+    {
+        // initialize local cluster manager (cores and memory allocators)
+        error = cluster_init( info );
+        if ( error == 0 ) 
         {
-            cxy_t cxy = HAL_CXY_FROM_XY( x , y );
-
-            if( cluster_is_active( cxy ) )
-            {
-                hal_remote_s64( XPTR( cxy , entry ) , 
-                                XPTR( local_cxy , chdev ) );
-            }
-        }
-    }
-
-    // initialize, in all clusters, the "iopic_input" structure
-    // defining how external IRQs are connected to IOPIC 
-
-    // register default value for unused inputs 
-    for( x = 0 ; x < info->x_size ; x++ )
-    {
-        for( y = 0 ; y < info->y_size ; y++ )
-        {
-            cxy_t cxy = HAL_CXY_FROM_XY( x , y );
-
-            if( cluster_is_active( cxy ) )
-            {
-                hal_remote_memset( XPTR( cxy , &iopic_input ), 
-                                   0xFF , sizeof(iopic_input_t) );
-            }
-        }
-    }
-
-    // register input IRQ index for valid inputs 
-    uint32_t   id;             // input IRQ index
-    uint8_t    valid;          // input IRQ is connected
-    uint32_t   type;           // source device type
-    uint8_t    channel;        // source device channel
-    uint8_t    is_rx;          // source device direction
-    uint32_t * ptr = NULL;     // local pointer on one field in iopic_input stucture
-
-    for( id = 0 ; id < CONFIG_MAX_EXTERNAL_IRQS ; id++ )
-    {
-        valid   = dev_tbl[i].irq[id].valid;
-        type    = dev_tbl[i].irq[id].dev_type;
-        channel = dev_tbl[i].irq[id].channel;
-        is_rx   = dev_tbl[i].irq[id].is_rx;
-        func    = FUNC_FROM_TYPE( type );
-
-        // get pointer on relevant field in iopic_input
-        if( valid )
-        {
-            if     ( func == DEV_FUNC_IOC )                 ptr = &iopic_input.ioc[channel]; 
-            else if((func == DEV_FUNC_TXT) && (is_rx == 0)) ptr = &iopic_input.txt_tx[channel];
-            else if((func == DEV_FUNC_TXT) && (is_rx != 0)) ptr = &iopic_input.txt_rx[channel];
-            else if((func == DEV_FUNC_NIC) && (is_rx == 0)) ptr = &iopic_input.nic_tx[channel];
-            else if((func == DEV_FUNC_NIC) && (is_rx != 0)) ptr = &iopic_input.nic_rx[channel];
-            else if( func == DEV_FUNC_IOB )                 ptr = &iopic_input.iob;
-            else
-            {
-                printk("\n[PANIC] in %s : illegal source device for IOPIC input\n",
-                __FUNCTION__ );
-                hal_core_sleep();
-            }
-
-            // set one entry in all "iopic_input" structures
-            for( x = 0 ; x < info->x_size ; x++ )
-            {
-                for( y = 0 ; y < info->y_size ; y++ )
-                {
-                    cxy_t cxy = HAL_CXY_FROM_XY( x , y );
-
-                    if( cluster_is_active( cxy ) )
-                    {
-                        hal_remote_s64( XPTR( cxy , ptr ) , id ); 
-                    }
-                }
-            }
-        }
-    } 
-
-#if( DEBUG_KERNEL_INIT & 0x1 )
-if( hal_time_stamp() > DEBUG_KERNEL_INIT )
-{
-    printk("\n[%s] created PIC chdev in cluster %x at cycle %d\n",
-    __FUNCTION__ , local_cxy , (uint32_t)hal_time_stamp() );
-    dev_pic_inputs_display();
-}
-#endif
-    
-}  // end iopic_init()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This function is called by all core[0]s in all cluster to complete the PIC device
-// initialisation, namely the informations attached to the LAPIC controller.
-// This initialisation must be done after the IOPIC initialisation, but before other 
-// devices initialisation because the IRQ routing infrastructure is required for both
-// internal and external devices initialisation.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ info    : pointer on the local boot-info structure.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__ ((noinline)) lapic_init( boot_info_t * info )
-{
-    boot_device_t * dev_tbl;      // pointer on boot_info internal devices array
-    uint32_t        dev_nr;       // number of internal devices
-    uint32_t        i;            // device index in dev_tbl
-	xptr_t          base;         // remote pointer on segment base
-    uint32_t        func;         // device functionnal type in boot_info
-    bool_t          found;        // LAPIC found
-
-    // get number of internal peripherals and base 
-	dev_nr	    = info->int_dev_nr;
-    dev_tbl     = info->int_dev;
-
-    // loop on internal peripherals to get the lapic device 
-	for( i = 0 , found = false ; i < dev_nr ; i++ )
-	{
-        func = FUNC_FROM_TYPE( dev_tbl[i].type );
-
-        if( func == DEV_FUNC_ICU )
-        {
-            base     = dev_tbl[i].base;
-            found    = true;
-            break;
-        }
-    }
-
-    // if the LAPIC controller is not defined in the boot_info,
-    // we simply don't initialize the PIC extensions in the kernel, 
-    // making the assumption that the LAPIC related informations 
-    // are hidden in the hardware specific PIC driver. 
-    if( found )
-    {
-        // initialise the PIC extensions for
-        // the core descriptor and core manager extensions
-        dev_pic_extend_init( (uint32_t *)GET_PTR( base ) );
-
-        // initialize the "lapic_input" structure
-        // defining how internal IRQs are connected to LAPIC 
-        uint32_t        id;
-        uint8_t         valid;
-        uint8_t         channel;
-        uint32_t        func;
-
-        for( id = 0 ; id < CONFIG_MAX_INTERNAL_IRQS ; id++ )
-        {
-            valid    = dev_tbl[i].irq[id].valid;
-            func     = FUNC_FROM_TYPE( dev_tbl[i].irq[id].dev_type );
-            channel  = dev_tbl[i].irq[id].channel;
-
-            if( valid ) // only valid local IRQs are registered
-            {
-                if     ( func == DEV_FUNC_MMC ) lapic_input.mmc = id;
-                else if( func == DEV_FUNC_DMA ) lapic_input.dma[channel] = id;
-                else
-                {
-                    printk("\n[PANIC] in %s : illegal source device for LAPIC input\n",
-                    __FUNCTION__ );
-                    hal_core_sleep();
-                }
-            }
-        }
-    }
-}  // end lapic_init()
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function returns the identifiers of the calling core.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ info    : pointer on boot_info structure.
-// @ lid     : [out] core local index in cluster.
-// @ cxy     : [out] cluster identifier.
-// @ lid     : [out] core global identifier (hardware).
-// @ return 0 if success / return -1 if not found.
-///////////////////////////////////////////////////////////////////////////////////////////
-static error_t __attribute__ ((noinline)) get_core_identifiers( boot_info_t * info,
-                                                                lid_t       * lid,
-                                                                cxy_t       * cxy,
-                                                                gid_t       * gid )
-{
-    uint32_t   i;
-    gid_t      global_id;
-
-    // get global identifier from hardware register
-    global_id = hal_get_gid();
-
-    // makes an associative search in boot_info to get (cxy,lid) from global_id
-    for( i = 0 ; i < info->cores_nr ; i++ )
-    {
-        if( global_id == info->core[i].gid )
-        {
-            *lid = info->core[i].lid;
-            *cxy = info->core[i].cxy;
-            *gid = global_id;
-            return 0;
-        }
-    }
-    return -1;
-}
-
-
-
-
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This function is the entry point for the kernel initialisation.
-// It is executed by all cores in all clusters, but only core[cxy][0] initializes
-// the shared resources such as the cluster manager, or the local peripherals.
-// To comply with the multi-kernels paradigm, it accesses only local cluster memory, using
-// only information contained in the local boot_info_t structure, set by the bootloader.
-// Only core[0] in cluster 0 print the log messages.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ info    : pointer on the local boot-info structure.
-///////////////////////////////////////////////////////////////////////////////////////////
-void kernel_init( boot_info_t * info )
-{
-    lid_t        core_lid = -1;             // running core local index
-    cxy_t        core_cxy = -1;             // running core cluster identifier
-    gid_t        core_gid;                  // running core hardware identifier 
-    cluster_t  * cluster;                   // pointer on local cluster manager
-    core_t     * core;                      // pointer on running core descriptor
-    thread_t   * thread;                    // pointer on idle thread descriptor
-
-    xptr_t       vfs_root_inode_xp;         // extended pointer on VFS root inode
-    xptr_t       devfs_dev_inode_xp;        // extended pointer on DEVFS dev inode    
-    xptr_t       devfs_external_inode_xp;   // extended pointer on DEVFS external inode       
-
-    error_t      error;
-    reg_t        status;                    // running core status register
-
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 1 : Each core get its core identifier from boot_info, and makes 
-    //          a partial initialisation of its private idle thread descriptor.
-    //          core[0] initializes the "local_cxy" global variable.
-    //          core[0] in cluster[0] initializes the TXT0 chdev for log messages.
-    /////////////////////////////////////////////////////////////////////////////////
-
-    error = get_core_identifiers( info,
-                                  &core_lid,
-                                  &core_cxy,
-                                  &core_gid );
-
-    // core[0] initialize cluster identifier
-    if( core_lid == 0 ) local_cxy = info->cxy;
-
-    // each core gets a pointer on its private idle thread descriptor
-    thread = (thread_t *)( idle_threads + (core_lid * CONFIG_THREAD_DESC_SIZE) );
-
-    // each core registers this thread pointer in hardware register
-    hal_set_current_thread( thread );
-
-    // each core register core descriptor pointer in idle thread descriptor
-    thread->core = &LOCAL_CLUSTER->core_tbl[core_lid];
-
-    // each core initializes the idle thread locks counters
-    thread->busylocks = 0;
-
-#if DEBUG_BUSYLOCK
-    // each core initialise the idle thread list of busylocks
-    xlist_root_init( XPTR( local_cxy , &thread->busylocks_root ) );
-#endif
-
-    // core[0] initializes cluster info
-    if( core_lid == 0 ) cluster_info_init( info );
-
-    // core[0] in cluster[0] initialises TXT0 chdev descriptor
-    if( (core_lid == 0) && (core_cxy == 0) ) txt0_device_init( info );
-
-    // all cores check identifiers
-    if( error )
-    {
-        printk("\n[PANIC] in %s : illegal core : gid %x / cxy %x / lid %d",
-        __FUNCTION__, core_lid, core_cxy, core_lid );
-        hal_core_sleep();
-    }
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 1 : TXT0 initialized / cycle %d\n",
-__FUNCTION__, (uint32_t)hal_get_cycles() );
-#endif
-
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 2 : core[0] initializes the cluster manager,
-    //          including the physical memory allocators. 
-    /////////////////////////////////////////////////////////////////////////////////
-
-    // core[0] initialises DQDT (only core[0][0] build the quad-tree)
-    if( core_lid == 0 ) dqdt_init();
-    
-    // core[0] initialize other cluster manager complex structures
-    if( core_lid == 0 )
-    {
-        error = cluster_manager_init( info );
-
-        if( error )
-        {
-             printk("\n[PANIC] in %s : cannot initialize cluster manager in cluster %x\n",
-             __FUNCTION__, local_cxy );
-             hal_core_sleep();
-        }
-    }
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 2 : cluster manager initialized / cycle %d\n",
-__FUNCTION__, (uint32_t)hal_get_cycles() );
-#endif
-
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 3 : all cores initialize the idle thread descriptor.
-    //          core[0] initializes the process_zero descriptor,
-    //          including the kernel VMM (both GPT and VSL) 
-    /////////////////////////////////////////////////////////////////////////////////
-
-    // all cores get pointer on local cluster manager & core descriptor
-    cluster = &cluster_manager;
-    core    = &cluster->core_tbl[core_lid];
-
-    // all cores update the register(s) defining the kernel
-    // entry points for interrupts, exceptions and syscalls,
-    // this must be done before VFS initialisation, because 
-    // kernel_init() uses RPCs requiring IPIs...
-    hal_set_kentry();
-
-    // all cores initialize the idle thread descriptor
-    thread_idle_init( thread,
-                      THREAD_IDLE,
-                      &thread_idle_func,
-                      NULL,
-                      core_lid );
-
-    // core[0] initializes the process_zero descriptor,
-    if( core_lid == 0 ) process_zero_create( &process_zero , info );
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 3 : kernel processs initialized / cycle %d\n",
-__FUNCTION__, (uint32_t)hal_get_cycles() );
-#endif
-
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 4 : all cores initialize their private MMU 
-    //          core[0] in cluster 0 initializes the IOPIC device.
-    /////////////////////////////////////////////////////////////////////////////////
-
-    // all cores initialise their MMU
-    hal_mmu_init( &process_zero.vmm.gpt );
-
-    // core[0] in cluster[0] initializes the PIC chdev,
-    if( (core_lid == 0) && (local_cxy == 0) ) iopic_init( info );
-    
-    ////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    ////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 4 : MMU and IOPIC initialized / cycle %d\n",
-__FUNCTION__, (uint32_t)hal_get_cycles() );
-#endif
-
-    ////////////////////////////////////////////////////////////////////////////////
-    // STEP 5 : core[0] initialize the distibuted LAPIC descriptor.
-    //          core[0] initialize the internal chdev descriptors
-    //          core[0] initialize the local external chdev descriptors
-    ////////////////////////////////////////////////////////////////////////////////
-
-    // all core[0]s initialize their local LAPIC extension,
-    if( core_lid == 0 ) lapic_init( info );
-
-    // core[0] scan the internal (private) peripherals,
-    // and allocates memory for the corresponding chdev descriptors.
-    if( core_lid == 0 ) internal_devices_init( info );
-
-    // All core[0]s contribute to initialise external peripheral chdev descriptors.
-    // Each core[0][cxy] scan the set of external (shared) peripherals (but the TXT0),
-    // and allocates memory for the chdev descriptors that must be placed
-    // on the (cxy) cluster according to the global index value.
-
-    if( core_lid == 0 ) external_devices_init( info );
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 5 : chdevs initialised / cycle %d\n",
-__FUNCTION__, (uint32_t)hal_get_cycles() );
-#endif
-
-#if CONFIG_INSTRUMENTATION_CHDEVS
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-chdev_dir_display();
-#endif
-    
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 6 : All cores enable IPI (Inter Procesor Interrupt),
-    //          All cores unblock the idle thread, and register it in scheduler.
-    //          The core[0] in cluster defined by the CONFIG_VFS_ROOT_CXY parameter,
-    //          access the IOC device to initialize the VFS for the FS identified
-    //          by the CONFIG_VFS_ROOT_IS_*** parameter. It does the following
-    //          actions in the VFS_ROOT cluster :
-    //          1. allocate and initialize the selected FS context,
-    //          2. create and initializes the VFS root inodes,
-    //          3. initialize the VFS context for FATFS (in fs_context[] array),
-    //          4. create the <.> and <..> dentries in VFS root directory,
-    //          5. register the VFS root inode in process_zero descriptor, 
-    //          6. allocate the DEVFS context, 
-    //          7. initialize the VFS context for DEVFS (in fs_context[] array),
-    //          8. create the <dev> and <external> inodes,
-    //          9. initialize the DEVFS context.
-    /////////////////////////////////////////////////////////////////////////////////
-
-    // All cores enable IPI 
-    dev_pic_enable_ipi();
-    hal_enable_irq( &status );
-
-    // all cores unblock the idle thread, and register it in scheduler
-    thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
-    core->scheduler.idle = thread;
-
-    // core[O] in VFS_ROOT cluster creates the VFS root
-    if( (core_lid ==  0) && (local_cxy == CONFIG_VFS_ROOT_CXY ) ) 
-    {
-        // Only FATFS is supported yet,
-        // TODO other File System can be introduced below
-        if( CONFIG_VFS_ROOT_IS_FATFS )
-        {
-            // 1. allocate memory and initialize FATFS context in VFS_ROOT cluster
-            xptr_t  fatfs_ctx_xp = fatfs_ctx_alloc( CONFIG_VFS_ROOT_CXY );
-
-            if( fatfs_ctx_xp == XPTR_NULL )
-            {
-                printk("\n[PANIC] in %s : cannot allocate FATFS context in cluster %x\n",
-                __FUNCTION__ , CONFIG_VFS_ROOT_CXY );
-                hal_core_sleep();
-            }
-
-            // initialise FATFS context in VFS_ROOT cluster from IOC device (boot_record)
-            error = fatfs_ctx_init( fatfs_ctx_xp );
-
-            if( error )
-            {
-                printk("\n[PANIC] in %s : cannot initialize FATFS context in cluster %x\n",
-                __FUNCTION__ , CONFIG_VFS_ROOT_CXY );
-                hal_core_sleep();
-            }
-
-#if( DEBUG_KERNEL_INIT & 1 )
-printk("\n[%s] initialized FATFS context in cluster %x\n",
-__FUNCTION__, CONFIG_VFS_ROOT_CXY );
-#endif
-    
-            // get various informations from FATFS context
-            fatfs_ctx_t * fatfs_ctx_ptr = GET_PTR( fatfs_ctx_xp );
-
-            uint32_t root_dir_cluster    = hal_remote_l32( XPTR( CONFIG_VFS_ROOT_CXY,
-                                           &fatfs_ctx_ptr->root_dir_cluster ) );
-
-            uint32_t bytes_per_sector    = hal_remote_l32( XPTR( CONFIG_VFS_ROOT_CXY,
-                                           &fatfs_ctx_ptr->bytes_per_sector ) );
- 
-            uint32_t sectors_per_cluster = hal_remote_l32( XPTR( CONFIG_VFS_ROOT_CXY,
-                                           &fatfs_ctx_ptr->sectors_per_cluster ) );
- 
-            uint32_t cluster_size        = bytes_per_sector * sectors_per_cluster;
- 
-            uint32_t fat_sectors_count   = hal_remote_l32( XPTR( CONFIG_VFS_ROOT_CXY,
-                                           &fatfs_ctx_ptr->fat_sectors_count ) ) << 7;
-
-            uint32_t total_clusters      = fat_sectors_count << 7;
- 
-            // 2. create VFS root inode in VFS_ROOT cluster
-            // TODO define attr, rights, uid, gid
-            error = vfs_inode_create( CONFIG_VFS_ROOT_CXY,          // target cluster
-                                      FS_TYPE_FATFS,                // fs_type
-                                      0,                            // attr
-                                      0,                            // rights
-                                      0,                            // uid
-                                      0,                            // gid
-                                      &vfs_root_inode_xp );         // return
-            if( error )
-            {
-                printk("\n[PANIC] in %s : cannot create VFS root inode in cluster %x\n",
-                __FUNCTION__ , CONFIG_VFS_ROOT_CXY );
-                hal_core_sleep();
-            }
-
-#if( DEBUG_KERNEL_INIT & 1 )
-vfs_inode_t * root_inode = GET_PTR( vfs_root_inode_xp );
-printk("\n[%s] created </> root inode %x in cluster %x / ctx %x\n",
-__FUNCTION__, root_inode, CONFIG_VFS_ROOT_CXY, root_inode->ctx );
-#endif
-    
-            // update FATFS root inode "type" and "extend" fields  
-            vfs_inode_t * vfs_root_inode_ptr = GET_PTR( vfs_root_inode_xp );
-
-            hal_remote_s32( XPTR( CONFIG_VFS_ROOT_CXY , &vfs_root_inode_ptr->type ),
-                            FILE_TYPE_DIR );
-
-            hal_remote_spt( XPTR( CONFIG_VFS_ROOT_CXY , &vfs_root_inode_ptr->extend ), 
-                            (void*)(intptr_t)root_dir_cluster );
-
-            // 3. initialize the VFS context for FATFS in VFS_ROOT cluster
-            vfs_ctx_init( CONFIG_VFS_ROOT_CXY,                      // target cluster
-                          FS_TYPE_FATFS,                            // fs type
-	                      total_clusters,                           // number of clusters
-	                      cluster_size,                             // bytes
-	                      vfs_root_inode_xp,                        // VFS root
-                          fatfs_ctx_ptr );                          // extend
-
-#if( DEBUG_KERNEL_INIT & 1 )
-vfs_ctx_t * vfs_for_fatfs_ctx =  &fs_context[FS_TYPE_FATFS];
-printk("\n[%s] initialized VFS_for_FATFS context in cluster %x / ctx %x / fs_type %d\n",
-__FUNCTION__, CONFIG_VFS_ROOT_CXY, vfs_for_fatfs_ctx, vfs_for_fatfs_ctx->type );
-#endif
-        }
-        else
-        {
-            printk("\n[PANIC] in %s : unsupported VFS type in cluster %x\n",
-            __FUNCTION__ , CONFIG_VFS_ROOT_CXY );
+            printk("PANIC in %s : Failed to initialize cluster manager in cluster %x\n",
+                   __FUNCTION__ , local_cxy );
             hal_core_sleep();
         }
 
-        // 4. create the <.> and <..> dentries in VFS root directory
-        // the VFS root parent inode is the VFS root inode itself 
-        vfs_add_special_dentries( vfs_root_inode_xp,
-                                  vfs_root_inode_xp );
-
-        // 5. register VFS root inode in target cluster process_zero descriptor 
-        hal_remote_s64( XPTR( CONFIG_VFS_ROOT_CXY , &process_zero.vfs_root_xp ),
-                        vfs_root_inode_xp );
-        hal_remote_s64( XPTR( CONFIG_VFS_ROOT_CXY , &process_zero.cwd_xp ),
-                        vfs_root_inode_xp );
-
-        // 6. allocate memory for DEVFS context in VFS_ROOT cluster
-        xptr_t devfs_ctx_xp = devfs_ctx_alloc( CONFIG_VFS_ROOT_CXY );
-
-        if( devfs_ctx_xp == XPTR_NULL )
+        // initialize process_zero descriptor
+		process_zero_init( info );
+
+        // initialize thread_zero descriptor
+	    memset( &thread_zero , 0 , sizeof(thread_t) );
+	    thread_zero.type     = THREAD_KERNEL;
+	    thread_zero.process  = &process_zero;
+	    hal_set_current_thread( &thread_zero );
+
+        // initialise local devices descriptors
+        devices_init( info );
+
+        // TODO initialize devFS and sysFS
+		// devfs_root_init();
+		// sysfs_root_init();
+
+		// TODO dire précisément ce qu'on fait ici [AG]
+		// hal_arch_init( info );
+
+        // TODO ??? [AG]
+		// clusters_sysfs_register();
+
+        // initialize virtual file system
+        // vfs_init();
+
+        // TODO ??? [AG]
+		// sysconf_init();
+
+        // activate other cores in same cluster
+		local_sync_init = KERNEL_INIT_SYNCRO;
+		hal_wbflush();
+    }
+    else   // other cores                                  
+    {
+        // other cores wait synchro from core[0]
+		while( local_sync_init != KERNEL_INIT_SYNCRO )
         {
-            printk("\n[PANIC] in %s : cannot create DEVFS context in cluster %x\n",
-            __FUNCTION__ , CONFIG_VFS_ROOT_CXY );
-            hal_core_sleep();
+		   uint32_t retval = hal_time_stamp() + 1000;
+		   while( hal_time_stamp() < retval )  asm volatile ("nop");
         }
 
-        // 7. initialize the VFS context for DEVFS in VFS_ROOT cluster 
-        vfs_ctx_init( CONFIG_VFS_ROOT_CXY,                          // target cluster
-                      FS_TYPE_DEVFS,                                // fs type
-	                  0,                                            // total_clusters: unused
-	                  0,                                            // cluster_size: unused 
-	                  vfs_root_inode_xp,                            // VFS root
-                      GET_PTR( devfs_ctx_xp ) );                    // extend
-
-#if( DEBUG_KERNEL_INIT & 1 )
-vfs_ctx_t * vfs_for_devfs_ctx =  &fs_context[FS_TYPE_DEVFS];
-printk("\n[%s] initialized VFS_for_DEVFS context in cluster %x / ctx %x / fs_type %d\n",
-__FUNCTION__, CONFIG_VFS_ROOT_CXY, vfs_for_devfs_ctx, vfs_for_devfs_ctx->type );
-#endif
-
-        // 8. create "dev" and "external" inodes (directories)
-        devfs_global_init( vfs_root_inode_xp,
-                           &devfs_dev_inode_xp,
-                           &devfs_external_inode_xp );
-
-        // 9. initializes DEVFS context in VFS_ROOT cluster
-        devfs_ctx_init( devfs_ctx_xp,
-                        devfs_dev_inode_xp,
-                        devfs_external_inode_xp );
-    }
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == CONFIG_VFS_ROOT_CXY) ) 
-printk("\n[%s] exit barrier 6 : VFS root inode (%x) created in cluster (%x) / cycle %d\n",
-__FUNCTION__, GET_CXY(vfs_root_inode_xp), 
-GET_PTR(vfs_root_inode_xp), (uint32_t)hal_get_cycles() );
-#endif
-
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 7 : In all clusters other than the VFS_ROOT cluster, the core[0] makes
-    //          the following local actions to complete the VFS initialisation :
-    //          1. allocate a local context for the selected FS extension,
-    //          2. copy FS context from VFS_ROOT cluster to local cluster,
-    //          3. copy VFS_for_FATFS context from VFS_ROOT cluster to local cluster, 
-    //          4. allocate a local context for the DEVFS extension, 
-    //          5. copy DEVFS context from VFS_ROOT cluster to local cluster,
-    //          6. update the local "root_inode_xp" field in process_zero.
-    /////////////////////////////////////////////////////////////////////////////////
-
-    if( (core_lid ==  0) && (local_cxy != CONFIG_VFS_ROOT_CXY) ) 
-    {
-        // only FATFS is supported yet
-        // TODO other File System can be introduced below
-        if( CONFIG_VFS_ROOT_IS_FATFS )
-        {
-            // 1. allocate a local FATFS context extension
-            xptr_t local_fatfs_ctx_xp = fatfs_ctx_alloc( local_cxy );
-
-            if( local_fatfs_ctx_xp == XPTR_NULL )
-            {
-                printk("\n[PANIC] in %s : cannot create FATFS context in cluster %x\n",
-                __FUNCTION__ , local_cxy );
-                hal_core_sleep();
-            }
-
-            // get local pointer on VFS_for_FATFS context (same in all clusters) 
-            vfs_ctx_t * vfs_fat_ctx_ptr = &fs_context[FS_TYPE_FATFS];
-
-            // build extended pointer on VFS_for_FATFS "extend" field in VFS_ROOT cluster
-            xptr_t fatfs_extend_xp = XPTR( CONFIG_VFS_ROOT_CXY , &vfs_fat_ctx_ptr->extend );
-
-            // get local pointer on FATFS context in VFS_ROOT cluster 
-            fatfs_ctx_t * remote_fatfs_ctx_ptr = hal_remote_lpt( fatfs_extend_xp );
-
-            // build extended pointer on FATFS context in VFS_ROOT cluster
-            xptr_t remote_fatfs_ctx_xp = XPTR( CONFIG_VFS_ROOT_CXY , remote_fatfs_ctx_ptr );
-
-            // 2. copy FATFS context from VFS_ROOT cluster to local cluster
-            hal_remote_memcpy( local_fatfs_ctx_xp,
-                               remote_fatfs_ctx_xp,
-                               sizeof(fatfs_ctx_t) );
-
-            // build extended pointer on remote VFS_for_FATFS context
-            xptr_t remote_vfs_ctx_xp = XPTR( CONFIG_VFS_ROOT_CXY , vfs_fat_ctx_ptr );
-
-            // build extended pointer on local VFS_for_FATFS context
-            xptr_t local_vfs_ctx_xp = XPTR( local_cxy , vfs_fat_ctx_ptr );
- 
-            // 3. copy VFS_for_FATFS context from VFS_ROOT cluster to local cluster
-            hal_remote_memcpy( local_vfs_ctx_xp,
-                               remote_vfs_ctx_xp,
-                               sizeof(vfs_ctx_t) );
-
-            // update "extend" field in local VFS_for_FATFS context
-            vfs_fat_ctx_ptr->extend = GET_PTR( local_fatfs_ctx_xp );
-
-// check local FATFS and VFS context copies
-assert( __FUNCTION__, (((fatfs_ctx_t *)vfs_fat_ctx_ptr->extend)->sectors_per_cluster == 8),
-"illegal FATFS context" );
-
-        }
-        else
-        {
-            printk("\n[PANIC] in %s : unsupported VFS type in cluster %x\n",
-            __FUNCTION__ , local_cxy );
-            hal_core_sleep();
-        }
-
-        // 4. allocate a local DEVFS context extension, 
-        xptr_t local_devfs_ctx_xp = devfs_ctx_alloc( local_cxy );
-
-        // get local pointer on VFS_for_DEVFS context (same in all clusters) 
-        vfs_ctx_t * vfs_dev_ctx_ptr = &fs_context[FS_TYPE_DEVFS];
-
-        // build extended pointer on VFS_for_DEVFS extend field in VFS_ROOT cluster
-        xptr_t remote_extend_xp = XPTR( CONFIG_VFS_ROOT_CXY , &vfs_dev_ctx_ptr->extend );
-
-        // get local pointer on DEVFS context in VFS_ROOT cluster 
-        devfs_ctx_t * remote_devfs_ctx_ptr = hal_remote_lpt( remote_extend_xp );
-
-        // build extended pointer on FATFS context in VFS_ROOT cluster
-        xptr_t remote_devfs_ctx_xp = XPTR( CONFIG_VFS_ROOT_CXY , remote_devfs_ctx_ptr );
-
-        // 5. copy DEVFS context from VFS_ROOT cluster to local cluster
-        hal_remote_memcpy( local_devfs_ctx_xp,
-                           remote_devfs_ctx_xp,
-                           sizeof(devfs_ctx_t) );
-
-        // update "extend" field in local VFS_for_DEVFS context
-        vfs_dev_ctx_ptr->extend = GET_PTR( local_devfs_ctx_xp );
-
-        // get extended pointer on VFS root inode from VFS_ROOT cluster
-        vfs_root_inode_xp = hal_remote_l64( XPTR( CONFIG_VFS_ROOT_CXY,
-                                                  &process_zero.vfs_root_xp ) );
-
-        // 6. update local process_zero descriptor
-        process_zero.vfs_root_xp = vfs_root_inode_xp;
-        process_zero.cwd_xp      = vfs_root_inode_xp;
-    }
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 7 : VFS & DEVFS contexts replicated in all clusters / cycle %d\n",
-__FUNCTION__ , (uint32_t)hal_get_cycles() );
-#endif
-
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 8 : In all clusters in parallel, core[0] completes DEVFS initialization.
-    //          Each core[0] creates the local DEVFS "internal" directory,
-    //          and creates the pseudo-files for chdevs placed in local cluster.
-    /////////////////////////////////////////////////////////////////////////////////
-
+        // other cores initialise thread_zero descriptor 
+	    memset( &thread_zero , 0 , sizeof(thread_t) );
+	    thread_zero.type     = THREAD_KERNEL;
+	    thread_zero.process  = &process_zero;
+	    hal_set_current_thread( &thread_zero );
+    }
+
+
+    // each core get pointer on local cluster manager and on core descriptor
+    cluster = LOCAL_CLUSTER;
+  	core    = &cluster->core_tbl[core_lid];
+
+	// each core creates its private idle thread descriptor	
+	error = thread_kernel_create( &thread_idle,
+                                  THREAD_IDLE, 
+                                  &thread_idle_func, 
+                                  NULL,
+                                  core_lid );
+    if( error )
+	{
+		printk("ERROR in %s: failed to create idle thread for core %d in cluster %x\n",
+               __FUNCTION__ , core_lid , core_cxy );
+        hal_core_sleep();
+    }
+
+    // each core register thread_idle in scheduler 
+    core->scheduler.idle = thread_idle;
+
+    // each core register thread pointer in core hardware register
+    hal_set_current_thread( thread_idle );
+
+    kinit_dmsg("INFO %s  Created thread idle %x for core %d at cycle %d ]\n",
+               thread, hal_get_gid(), hal_time_stamp());
+
+    // global syncho for all core[0] in all clusters
     if( core_lid == 0 )
     {
-        // get local pointer on local DEVFS context
-        devfs_ctx_t * ctx = fs_context[FS_TYPE_DEVFS].extend;
-
-        // populate DEVFS in all clusters
-        devfs_local_init( ctx->dev_inode_xp,
-                          ctx->external_inode_xp );
-    }
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ), 
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 8 : DEVFS initialized in all clusters / cycle %d\n",
-__FUNCTION__, (uint32_t)hal_get_cycles() );
-#endif
-
-#if( DEBUG_KERNEL_INIT & 1 )
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-vfs_display( vfs_root_inode_xp );
-#endif
-
-    /////////////////////////////////////////////////////////////////////////////////
-    // STEP 9 : core[0] in cluster 0 creates the first user process (process_init).
-    //          This include the process VMM (GPT and VSL) creation.
-    //          Finally, it prints the ALMOS-MKH banner.
-    /////////////////////////////////////////////////////////////////////////////////
-
-    if( (core_lid == 0) && (local_cxy == 0) ) 
-    {
-        process_init_create();
-    }
-
-#if DEBUG_KERNEL_INIT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n[%s] exit barrier 9 : process_init created in cluster 0 / cycle %d\n",
-__FUNCTION__, (uint32_t)hal_get_cycles() );
-#endif
-
-    if( (core_lid == 0) && (local_cxy == 0) ) 
-    {
-        print_banner( (info->x_size * info->y_size) , info->cores_nr );
-    }
-
-#if CONFIG_INSTRUMENTATION_FOOTPRINT
-if( (core_lid ==  0) & (local_cxy == 0) ) 
-printk("\n\n***** memory fooprint for main kernel objects\n\n"
-                   " - thread descriptor  : %d bytes\n"
-                   " - process descriptor : %d bytes\n"
-                   " - cluster manager    : %d bytes\n"
-                   " - chdev descriptor   : %d bytes\n"
-                   " - core descriptor    : %d bytes\n"
-                   " - scheduler          : %d bytes\n"
-                   " - socket descriptor  : %d bytes\n"
-                   " - rpc fifo           : %d bytes\n"
-                   " - page descriptor    : %d bytes\n"
-                   " - mapper descriptor  : %d bytes\n"
-                   " - vseg descriptor    : %d bytes\n"
-                   " - ppm manager        : %d bytes\n"
-                   " - kcm manager        : %d bytes\n"
-                   " - vmm manager        : %d bytes\n"
-                   " - vfs inode          : %d bytes\n"
-                   " - vfs dentry         : %d bytes\n"
-                   " - vfs file           : %d bytes\n"
-                   " - vfs context        : %d bytes\n"
-                   " - xhtab root         : %d bytes\n"
-                   " - list item          : %d bytes\n"
-                   " - xlist item         : %d bytes\n"
-                   " - busylock           : %d bytes\n"
-                   " - remote busylock    : %d bytes\n"
-                   " - queuelock          : %d bytes\n"
-                   " - remote queuelock   : %d bytes\n"
-                   " - rwlock             : %d bytes\n"
-                   " - remote rwlock      : %d bytes\n",
-                   sizeof( thread_t           ),
-                   sizeof( process_t          ),
-                   sizeof( cluster_t          ),
-                   sizeof( chdev_t            ),
-                   sizeof( core_t             ),
-                   sizeof( scheduler_t        ),
-                   sizeof( socket_t           ),
-                   sizeof( remote_fifo_t      ),
-                   sizeof( page_t             ),
-                   sizeof( mapper_t           ),
-                   sizeof( vseg_t             ),
-                   sizeof( ppm_t              ),
-                   sizeof( kcm_t              ),
-                   sizeof( vmm_t              ),
-                   sizeof( vfs_inode_t        ),
-                   sizeof( vfs_dentry_t       ),
-                   sizeof( vfs_file_t         ),
-                   sizeof( vfs_ctx_t          ),
-                   sizeof( xhtab_t            ),
-                   sizeof( list_entry_t       ),
-                   sizeof( xlist_entry_t      ),
-                   sizeof( busylock_t         ),
-                   sizeof( remote_busylock_t  ),
-                   sizeof( queuelock_t        ),
-                   sizeof( remote_queuelock_t ),
-                   sizeof( rwlock_t           ),
-                   sizeof( remote_rwlock_t    ));
-#endif
-
-    // number of cycles per TICK (depends on the actual system clock frequency
-    uint32_t cycles_per_tick = cluster->sys_clk / CONFIG_SCHED_TICKS_PER_SECOND;
-
-    // each core activates its private TICK IRQ
-    dev_pic_enable_timer( cycles_per_tick );
-
-    /////////////////////////////////////////////////////////////////////////////////
-    if( core_lid == 0 ) xbarrier_wait( XPTR( 0 , &global_barrier ),
-                                        (info->x_size * info->y_size) );
-    barrier_wait( &local_barrier , info->cores_nr );
-    /////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_KERNEL_INIT 
-thread_t * this = CURRENT_THREAD;
-printk("\n[%s] : thread[%x,%x] on core[%x,%d] jumps to thread_idle_func() / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid,
-local_cxy, core_lid, (uint32_t)hal_get_cycles() );
-#endif
-
-    // each core jump to thread_idle_func
-    thread_idle_func();
-
-}  // end kernel_init()
-
+        remote_barrier( XPTR( info->io_cxy , &cluster->barrier ) , 
+                        (cluster->x_size * cluster->y_size) );
+    }
+
+    // local synchro for all cores in local cluster
+    remote_barrier( XPTR( local_cxy , &cluster->barrier ) , 
+                    cluster->cores_nr );
+
+    if( core_lid ==  0 )
+    {
+        kinit_dmsg("INFO %s completed for cluster %x at cycle %d\n",
+                   __FUNCTION__ , local_cxy , hal_time_stamp() );
+
+        if( local_cxy == info->io_cxy ) print_boot_banner();
+    }
+
+    // load idle thread context in calling core
+	hal_cpu_context_load( thread_idle );
+
+} // end kernel_init()
+
+
+
Index: trunk/kernel/kern/keysdb.c
===================================================================
--- trunk/kernel/kern/keysdb.c	(revision 1)
+++ trunk/kernel/kern/keysdb.c	(revision 1)
@@ -0,0 +1,243 @@
+/*
+ * keysdb.c - fixed radix-cache implementation
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ * 
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <libk.h>
+#include <kdmsg.h>
+#include <bits.h>
+#include <page.h>
+#include <ppm.h>
+#include <pmm.h>
+#include <thread.h>
+#include <task.h>
+#include <kmem.h>
+#include <keysdb.h>
+
+#define KEYS_PER_REC_LOG2   6
+
+////////////////////////////////////
+error_t keysdb_init( keysdb_t * db )
+                     uint32_t   key_width )
+{
+	page_t     * page;
+	kmem_req_t   req;
+  
+	db->records_nr   = CONFIG_PMM_PAGE_SIZE / sizeof(keys_record_t*);
+	db->records_bits = bits_log2(db->records_nr);
+
+    db->keys_nr      = KEYS_PER_RECORD;
+    db->keys_bits    = bits_log2( db->keys_nr );
+
+    // allocates one single page
+	req.type  = KMEM_PAGE;
+	req.size  = 0;
+	req.flags = AF_USER | AF_ZERO;
+	page = kmem_alloc(&req);
+	if(page == NULL) return ENOMEM;
+  
+	db->root = ppm_page2addr( page );
+	db->page = page;
+
+	return 0;
+}
+
+///////////////////////////////////////
+void keysdb_destroy( keysdb_t * db )
+{
+	kmem_req_t req;
+	uint32_t   i;
+
+	req.type = KMEM_KEYSREC;
+
+	for( i=0 ; i < db->records_nr ; i++ )
+	{
+		if(db->root[i] == NULL) continue;
+
+		req.ptr = db->root[i];
+		kmem_free(&req);
+	}
+
+	req.type = KMEM_PAGE;
+	req.ptr = db->page;
+	kmem_free(&req);
+}
+
+//////////////////////////////////
+void keysdb_print( keysdb_t * db,
+                   char     * name )
+{
+	uint32_t        i;  
+	uint32_t        j;
+    keys_record_t * rec;
+ 
+	printk(INFO, "%s / keys_per_record = %d / records = %d\n", 
+           name, db->keys_nr , db->records_nr );
+
+	for( i=0 ; i < db->records_nr; i++ )
+	{
+        rec = db_root[i];   
+		if( rec == NULL ) continue;
+    
+	    printk(INFO, "record[%d] @ = 0x%x] [", index , rec );
+	    for( j=0; j < db->keys_nr ; i++) printk(INFO, "  val[%d] = %x\n", j , rec->tbl[j]);
+	}
+}
+
+/////////////////////////////////////
+error_t keysdb_insert( keysdb_t * db,
+                       uint32_t   key,
+                       void     * value )
+{
+    // Check key 
+    if( key >> (db->keys_bits + db->records_bits) ) return EINVAL;
+
+    // compute indexes
+    uint32_t        bits      = db->keys_bits;
+	uint32_t        rec_index = key >> bits;              // index in records table
+	uint32_t        key_index = key & ((1 << bits) - 1);  // index in record
+
+	kmem_req_t      req;        // kmem request for new record
+	keys_record_t * rec;        // pointer on selected record
+	bool_t          isAtomic;
+
+    // get address of pointer on the selected record in first level table.
+    // it can be NULL if the selected record has not be allocated yet.
+	volatile keys_record_t ** recptr = &db->root[record_index];
+
+    // we must allocate memory for the selected record if record pointer is NULL,
+    // and atomically update the records table with the new record pointer.
+	while( *recptr == NULL )
+	{
+        // allocate memory for record
+        req.type = KMEM_KEYSREC;
+        req.size = sizeof(keys_record_t);
+        req.flags = AF_USER | AF_ZERO;
+        rec = kmem_alloc(&req);
+        if( rec == NULL) return ENOMEM;
+
+        // try to update records array
+		isAtomic = cpu_atomic_cas( &db->root[record_index] , 0 , (uint32_t)rec );
+
+        // release record memory if not atomic
+        if( isAtomic == false )
+	    {
+		    req.ptr = rec;
+		    kmem_free(&req);
+	    }
+	}
+
+    // get pointer on selected record.
+	rec = db->root[record_index];
+
+    // check selected slot empty in selected record
+	if(rec->tbl[key_index] != NULL) return EEXIST;
+
+    // register the value
+	rec->tbl[key_index] = value;
+
+	return 0;
+}
+
+////////////////////////////////////
+void * keysdb_remove( keysdb_t * db,
+                      uint32_t   key )
+{
+    // compute indexes
+    uint32_t        bits      = db->keys_bits;
+	uint32_t        rec_index = key >> bits;              // index in records table
+	uint32_t        key_index = key & ((1 << bits) - 1);  // index in record
+  
+    // get record pointer
+	keys_record_t * rec = db->root[record_index];
+ 
+	if(rec == NULL) return NULL;
+
+    // get value
+	void * value = rec->tbl[key_index];
+
+    // reset selected slot
+	rec->tbl[key_index] = NULL;
+	cpu_wbflush();
+
+	return value;
+}
+
+////////////////////////////////////
+void * keysdb_lookup( keysdb_t * db,
+                      uint32_t   key )
+{
+    // compute indexes
+    uint32_t        bits      = db->keys_bits;
+	uint32_t        rec_index = key >> db->keys_bits;
+	uint32_t        key_index = key & ((1 << bits) - 1);
+
+    // get record pointer
+	keys_record_t * recptr = db->root[rec_index]; 
+
+    // compute value
+	void * value = (recptr == NULL) ? NULL : recptr->tbl[key_index];
+
+	return value;
+}
+
+
+/*
+///////////////////////////////////
+error_t keysdb_bind( keysdb_t * db,
+                     uint32_t   key_start, 
+                     uint32_t   keys_nr,
+                     void     * value )
+{
+	error_t err;
+	uint32_t i;
+
+	err = 0;
+
+	for(i = 0; i < keys_nr; i++)
+	{
+		err = keysdb_insert(db, key_start + i, value);
+		if(err != 0) break;
+	}
+
+	while((err != 0) && (i != 0))
+	{
+		i--;
+		keysdb_remove(db, key_start + i);
+	}
+
+	return err;
+}
+
+/////////////////////////////////////
+error_t keysdb_unbind( keysdb_t * db,
+                       uint32_t   key_start,
+                       uint32_t   keys_nr )
+{
+	uint32_t i;
+
+	for(i = 0; i < keys_nr; i++)
+		(void)keysdb_remove(db , key_start + i);
+
+	return 0;
+}
+
+*/
Index: trunk/kernel/kern/keysdb.h
===================================================================
--- trunk/kernel/kern/keysdb.h	(revision 1)
+++ trunk/kernel/kern/keysdb.h	(revision 1)
@@ -0,0 +1,133 @@
+/*
+ * keysdb.h - Two Levels Radix-tree Interface
+ * 
+ * Authors Ghassan Almalless (2008,2009,2010,2011,2012)
+ *         Alain Greiner (2016)
+ *
+ * Copyright  UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _KEYS_DB_H_
+#define _KEYS_DB_H_
+
+#include <types.h>
+#include <kmem.h>
+
+#define KEYS_PER_REC        64
+
+/*******************************************************************************************
+ * This define the second level in the two level radix-tree, called a record.
+ * A record is an array of KEYS_PER_RECORD pointers.
+ * Each entry is a (void *) pointer on a key-addressable item.
+ * The memory is dynamically allocated for a record only if this record contains 
+ * a least one non NULL entry. 
+ ******************************************************************************************/
+
+typedef struct keys_record_s
+{
+	void * tbl[KEYS_PER_REC];
+}
+keys_record_t;
+
+/*******************************************************************************************
+ * This structure defines the two levels radix-tree descriptor.
+ * The key is split in two fields : a record_index (MSB) / a key_index (LSB)
+ * The first level in the two levels radix-tree is an array of pointers on records.
+ * The number of entries in this array is fixed as [sizeof(page) / sizeof(pointer)].
+ * The total number of key values is [sizeof(page) / sizeof(pointer)] * KEYS_PER_RECORD.
+ ******************************************************************************************/
+
+typedef struct keysdb_s
+{
+	keys_record_t ** root;           /*! pointer on array of records pointers             */
+	uint32_t         records_nr;     /*! number of entries in records array               */
+	uint32_t         records_bits;   /*! number of bits to code the record index          */
+    uint32_t         keys_nr;        /*! number of entries (keys) in a record             */
+	uint32_t         keys_bits;      /*! number of bits to code the key index             */
+	page_t         * page;           /*! page descriptor containing the records array     */
+}
+keysdb_t;
+
+
+/*******************************************************************************************
+ * This function initialises the two levels radix-tree descriptor, and allocates
+ * memory (one physical page) to store the records array.
+ * @ db      : pointer on the radix-tree descriptor.
+ * @ returns 0 if success / returns ENOMEM if no more memory.      
+ ******************************************************************************************/
+error_t keysdb_init( keysdb_t * db );
+
+/*******************************************************************************************
+ * This function releases all memory allocated to store the array of records pointers,
+ * and the records themselve. 
+ * @ db      : pointer on the radix-tree descriptor.
+ ******************************************************************************************/
+void keysdb_destroy( keysdb_t * db );
+
+/*******************************************************************************************
+ * This function insert a new item in the two level radix-tree.
+ * It dynamically allocates memory for a new record if required.
+ * @ db      : pointer on the radix-tree descriptor.
+ * @ key     : key value used to address the radix tree
+ * @ value   : pointer on item to be registered in radix-tree.
+ * @ returns 0 if success / returns EINVAL if illegal key value.
+ ******************************************************************************************/
+error_t keysdb_insert( keysdb_t * db,
+                       uint32_t   key,
+                       void     * value );
+
+/*******************************************************************************************
+ * This function removes an item identified by its key, and returns a pointer
+ * on the removed item.
+ * @ db      : pointer on the radix-tree descriptor.
+ * @ key     : key value.
+ * @ returns item pointer if success / returns NULL if failure.
+ ******************************************************************************************/
+void * keysdb_remove( keysdb_t * db,
+                      uint32_t   key );
+
+/*******************************************************************************************
+ * This function returns the pointer on the item identified by its key.
+ * @ db      : pointer on the radix-tree descriptor.
+ * @ key     : key value.
+ * @ returns item pointer if success / returns NULL if failure.
+ ******************************************************************************************/
+void * keysdb_lookup( keysdb_t * db, 
+                      uint32_t   key );
+
+/*******************************************************************************************
+ * This function displays the content of a two levels radix_tree.
+ * @ db      : pointer on the radix-tree descriptor.
+ * @ name    : string identifying the radix-tree.
+ ******************************************************************************************/
+void keysdb_print( keysdb_t * db,
+                   char     * name );
+
+
+/* TODO the two following functions deprecated [AG] */
+
+/*******************************************************************************************
+ ******************************************************************************************/
+error_t keysdb_bind( keysdb_t *db, uint32_t key_start, uint32_t keys_nr, void *value);
+
+/*******************************************************************************************
+ ******************************************************************************************/
+error_t keysdb_unbind( keysdb_t *db, uint32_t key_start, uint32_t keys_nr);
+
+#endif	/* _KEYS_DB_H_ */
+
Index: trunk/kernel/kern/kmagics.h
===================================================================
--- trunk/kernel/kern/kmagics.h	(revision 1)
+++ trunk/kernel/kern/kmagics.h	(revision 1)
@@ -0,0 +1,41 @@
+/*
+ * kern/kmagics.h - magic numbers used to identify kernel objects
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ * 
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _KMAGICS_H_
+#define _KMAGICS_H_
+
+#define MEM_CHECK_VAL     0xA5A5A5A5
+#define SCHED_CHECK_VAL   0xDEADBEEF
+#define LIST_NEXT_DEAD    0x0000b0C1
+#define LIST_PRED_DEAD    0x0000c0b1
+#define LIST_SNEXT_DEAD   0x0000A0A1
+#define POBJECT_CREATED   0x0000A5B5
+#define SEMAPHORE_ID      0xA0B1C0B3
+#define COND_VAR_ID       0xB1CA0BA5
+#define KCOND_VAR_ID      0xB3B0A3A3
+#define BARRIER_ID        0xCFA5B1A3
+#define RWLOCK_ID         0xD1A5B1EF
+#define THREAD_ID         0xDEEFBAAD
+#define PPM_ID            0xF0F0A5A5
+#define ALRM_INFO_ID      0xAF5FABE5
+
+#endif	/* _KMAGICS_H_ */
Index: trunk/kernel/kern/ksocket.c
===================================================================
--- trunk/kernel/kern/ksocket.c	(revision 690)
+++ 	(revision )
@@ -1,2317 +1,0 @@
-/*
- * ksocket.c - kernel socket implementation.
- *
- * Authors  Alain Greiner        (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <hal_uspace.h>
-#include <shared_socket.h>
-#include <process.h>
-#include <remote_buf.h>
-#include <bits.h>
-#include <printk.h>
-#include <kmem.h>
-#include <thread.h>
-#include <vfs.h>
-#include <alarm.h>
-#include <dev_nic.h>
-#include <ksocket.h>
-
-//////////////////////////////////////////////////////////////////////////////////////
-// Extern global variables
-//////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t  chdev_dir;         // allocated in kernel_init.c
-
-///////////////////////////////////////////
-char * socket_domain_str( uint32_t domain )
-{
-    switch( domain )
-    {
-        case AF_INET         : return "INET";
-        case AF_LOCAL        : return "LOCAL";
-
-        default              : return "undefined";
-    }
-}
-   
-///////////////////////////////////////
-char * socket_type_str( uint32_t type )
-{
-    switch( type )
-    {
-        case SOCK_DGRAM         : return "UDP";
-        case SOCK_STREAM        : return "TCP";
-
-        default                 : return "undefined";
-    }
-}
-   
-/////////////////////////////////////////
-char * socket_state_str( uint32_t state )
-{
-    switch( state )
-    {
-        case UDP_STATE_UNBOUND    : return "UDP_UNBOUND";
-        case UDP_STATE_BOUND      : return "UDP_BOUND";
-        case UDP_STATE_ESTAB      : return "UDP_ESTAB";
-
-        case TCP_STATE_UNBOUND    : return "TCP_UNBOUND";
-        case TCP_STATE_BOUND      : return "TCP_BOUND";
-        case TCP_STATE_LISTEN     : return "TCP_LISTEN";
-        case TCP_STATE_SYN_SENT   : return "TCP_SYN_SENT";
-        case TCP_STATE_SYN_RCVD   : return "TCP_SYN_RCVD";
-        case TCP_STATE_ESTAB      : return "TCP_ESTAB";
-        case TCP_STATE_FIN_WAIT1  : return "TCP_FIN_WAIT1";
-        case TCP_STATE_FIN_WAIT2  : return "TCP_FIN_WAIT2";
-        case TCP_STATE_CLOSING    : return "TCP_CLOSING";
-        case TCP_STATE_TIME_WAIT  : return "TCP_TIME_WAIT";
-        case TCP_STATE_CLOSE_WAIT : return "TCP_CLOSE_WAIT";
-        case TCP_STATE_LAST_ACK   : return "TCP_LAST_ACK";
-        case TCP_STATE_CLOSED     : return "TCP_CLOSED";
-
-        default                   : return "undefined";
-    }
-}
-
-///////////////////////////////////////////
-char * socket_cmd_type_str( uint32_t type )
-{
-    switch( type )
-    {
-        case CMD_TX_CONNECT  : return "TX_CONNECT";
-        case CMD_TX_ACCEPT   : return "TX_ACCEPT";
-        case CMD_TX_CLOSE    : return "TX_CLOSE";
-        case CMD_TX_SEND     : return "TX_SEND";
-
-        case CMD_RX_ACCEPT   : return "RX_ACCEPT";
-        case CMD_RX_RECV     : return "RX_RECV";
-        
-        default                 : return "undefined";
-    }
-}
-   
-///////////////////////////////////////////
-char * socket_cmd_sts_str( uint32_t sts )
-{
-    switch( sts )
-    {
-        case CMD_STS_SUCCESS  : return "SUCCESS";
-        case CMD_STS_EOF      : return "EOF";
-        case CMD_STS_RST      : return "RST";
-        case CMD_STS_BADACK   : return "BADACK";
-        case CMD_STS_BADSTATE : return "BADSTATE";
-        case CMD_STS_BADCMD   : return "BADCMD";
-        
-        default               : return "undefined";
-    }
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function implements the alarm handler used by a TX client thread to
-// handle a retransmission timeout for a TX command (ACCEPT / CONNECT / CLOSE / SEND).
-// The <args_xp> argument is actually an extended pointer on the involved socket.
-// First, it updates the retransmission timeout. Then, it get the type of TX command, 
-// and request the NIC_TX server thread to re-send the unacknowledged segment. 
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ sock_xp    : extended pointer on the involved socket.
-///////////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__((noinline)) socket_alarm_handler( xptr_t sock_xp )
-{
-    // get cluster and local pointer on socket descriptor
-    socket_t * sock_ptr = GET_PTR( sock_xp );
-    cxy_t      sock_cxy = GET_CXY( sock_xp );
-
-#if DEBUG_SOCKET_ALARM
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-   // build extended pointer on lock protecting socket
-    xptr_t socket_lock_xp = XPTR( sock_cxy , &sock_ptr->lock );
-
-    // take the socket lock
-    remote_queuelock_acquire( socket_lock_xp );
-
-    // get relevant infos from socket descriptor
-    uint32_t   tx_cmd    = hal_remote_l32( XPTR( sock_cxy , &sock_ptr->tx_cmd )); 
-    uint32_t   channel   = hal_remote_l32( XPTR( sock_cxy , &sock_ptr->nic_channel ));
-    xptr_t     thread_xp = hal_remote_l64( XPTR( sock_cxy , &sock_ptr->tx_client ));
-
-assert( __FUNCTION__, (thread_xp != XPTR_NULL), 
-"illegal tx_client field for a retransmission timeout" );
-
-    // get TX client thread cluster 
-    cxy_t      thread_cxy = GET_CXY( thread_xp );
-
-assert( __FUNCTION__, (thread_cxy == local_cxy),
-"the client thread must be running in the same cluster as the alarm handler" );
-
-    // get pointers on NIC_TX[index] chdev
-    xptr_t    tx_chdev_xp  = chdev_dir.nic_tx[channel];
-    chdev_t * tx_chdev_ptr = GET_PTR( tx_chdev_xp );
-    cxy_t     tx_chdev_cxy = GET_CXY( tx_chdev_xp );
-
-    // get pointers on NIC_TX[channel] server thread
-    thread_t * tx_server_ptr = hal_remote_lpt( XPTR( tx_chdev_cxy , &tx_chdev_ptr->server ));
-    xptr_t     tx_server_xp  = XPTR( tx_chdev_cxy , tx_server_ptr );
-
-    // update the date in alarm
-    alarm_update( thread_xp , hal_get_cycles() + CONFIG_SOCK_RETRY_TIMEOUT );
-    
-    //////////////////////////////
-    if( tx_cmd == CMD_TX_CONNECT )  
-    {
-
-#if DEBUG_SOCKET_ALARM
-if( DEBUG_SOCKET_ALARM < cycle )
-printk("\n[%s] rings for CONNECT : request a new SYN segment / cycle %d\n",
-__FUNCTION__ , cycle );
-#endif
-        // set tx_valid to request the NIC_TX server to send a new SYN segment
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->tx_valid ) , true );
-
-        // update socket state
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->state ) , TCP_STATE_BOUND );
-
-        // unblock the NIC_TX server thread 
-        thread_unblock( tx_server_xp , THREAD_BLOCKED_CLIENT );
-    }
-    /////////////////////////////
-    if( tx_cmd == CMD_TX_ACCEPT )  
-    {
-
-#if DEBUG_SOCKET_ALARM
-if( DEBUG_SOCKET_ALARM < cycle )
-printk("\n[%s] rings for ACCEPT : request a new SYN-ACK segment / cycle %d\n",
-__FUNCTION__ , cycle );
-#endif
-        // set tx_valid to request the NIC_TX server to send a new SYN-ACK segment
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->tx_valid ) , true );
-
-        // update socket state
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->state ) , TCP_STATE_SYN_RCVD );
-
-        // unblock the NIC_TX server thread 
-        thread_unblock( tx_server_xp , THREAD_BLOCKED_CLIENT );
-    }
-    ////////////////////////////
-    if( tx_cmd == CMD_TX_CLOSE )
-    {
-
-#if DEBUG_SOCKET_ALARM
-if( DEBUG_SOCKET_ALARM < cycle )
-printk("\n[%s] rings for CLOSE : request a new FIN-ACK segment / cycle %d\n",
-__FUNCTION__ , cycle );
-#endif
-        // set tx_valid to request the NIC_TX server to send a new FIN-ACK segment
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->tx_valid ) , true );
-
-        // update socket state
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->state ) , TCP_STATE_ESTAB );
-
-        // unblock the NIC_TX server thread 
-        thread_unblock( tx_server_xp , THREAD_BLOCKED_CLIENT );
-    }
-    ///////////////////////////
-    if( tx_cmd == CMD_TX_SEND )
-    {
-        // get get relevant infos from socket pointer
-        uint32_t  tx_una = hal_remote_l32( XPTR( sock_cxy , &sock_ptr->tx_una ));
-        uint32_t  tx_ack = hal_remote_l32( XPTR( sock_cxy , &sock_ptr->tx_ack ));
-        uint32_t  tx_len = hal_remote_l32( XPTR( sock_cxy , &sock_ptr->tx_len ));
-
-#if DEBUG_SOCKET_ALARM       
-if( DEBUG_SOCKET_ALARM < cycle )
-printk("\n[%s] rings for SEND : request %d bytes / cycle %d\n",
-__FUNCTION__ , tx_len , cycle );
-#endif
-        // update command fields in socket
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->tx_nxt    ) , tx_una );
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->tx_todo   ) , tx_len - tx_ack );
-        hal_remote_s32( XPTR( sock_cxy , &sock_ptr->tx_valid  ) , true );
-
-        // unblock the NIC_TX server thread 
-        thread_unblock( tx_server_xp , THREAD_BLOCKED_CLIENT );
-    }
-
-    // release the socket lock
-    remote_queuelock_release( socket_lock_xp );
-
-}   // end socket_alarm_handler()
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// This static function registers the socket defined by the <socket_xp> argument into
-// the lists of sockets attached to the relevant NIC_TX and NIC_TX chdevs identified
-// by the <channel> argument, and update the channel field in socket descriptor.
-/////////////////////////////////////////////////////////////////////////////////////////
-// @ socket_xp   : [in]  extended pointer on socket descriptor.
-// @ channel     : [in]  NIC channel index.
-/////////////////////////////////////////////////////////////////////////////////////////
-static void socket_link_to_servers( xptr_t   socket_xp,
-                                    uint32_t channel )
-{
-    cxy_t      socket_cxy = GET_CXY( socket_xp );
-    socket_t * socket_ptr = GET_PTR( socket_xp );
-
-#if DEBUG_SOCKET_LINK
-thread_t  * this        = CURRENT_THREAD;
-process_t * process     = this->process;
-pid_t       socket_pid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-fdid_t      socket_fdid = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-uint32_t   cycle        = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_LINK < cycle )
-printk("\n[%s] thread[%x,%x] enter for socket[%x,%d] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, socket_pid, socket_fdid, cycle ); 
-#endif
-
-    // get pointers on NIC_TX[channel] chdev
-    xptr_t    tx_chdev_xp  = chdev_dir.nic_tx[channel];
-    chdev_t * tx_chdev_ptr = GET_PTR( tx_chdev_xp );
-    cxy_t     tx_chdev_cxy = GET_CXY( tx_chdev_xp );
-
-    // build various TX extended pointers 
-    xptr_t    tx_root_xp = XPTR( tx_chdev_cxy , &tx_chdev_ptr->wait_root );
-    xptr_t    tx_lock_xp = XPTR( tx_chdev_cxy , &tx_chdev_ptr->wait_lock );
-    xptr_t    tx_list_xp = XPTR( socket_cxy   , &socket_ptr->tx_list );
-
-    // get pointers on NIC_RX[channel] chdev
-    xptr_t    rx_chdev_xp  = chdev_dir.nic_rx[channel];
-    chdev_t * rx_chdev_ptr = GET_PTR( rx_chdev_xp );
-    cxy_t     rx_chdev_cxy = GET_CXY( rx_chdev_xp );
-
-    // build various RX extended pointers
-    xptr_t    rx_root_xp = XPTR( rx_chdev_cxy , &rx_chdev_ptr->wait_root );
-    xptr_t    rx_lock_xp = XPTR( rx_chdev_cxy , &rx_chdev_ptr->wait_lock );
-    xptr_t    rx_list_xp = XPTR( socket_cxy   , &socket_ptr->rx_list );
-
-    // register socket in the NIC_TX[channel] chdev clients queue
-    remote_busylock_acquire( tx_lock_xp );
-    xlist_add_last( tx_root_xp , tx_list_xp );
-    remote_busylock_release( tx_lock_xp );
-
-    // register socket in the NIC_RX[channel] chdev clients queue
-    remote_busylock_acquire( rx_lock_xp );
-    xlist_add_last( rx_root_xp , rx_list_xp );
-    remote_busylock_release( rx_lock_xp );
-
-#if DEBUG_SOCKET_LINK
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_LINK < cycle )
-printk("\n[%s] thread[%x,%x] linked socket[%x,%d] to channel %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, socket_pid, socket_fdid, channel, cycle );
-#endif
-
-}  // end socket_link_to_servers()
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// This function removes the socket defined by the <socket_xp> argument from the
-// lists of sockets attached to the relevant NIC_TX and NIC_TX chdevs.
-/////////////////////////////////////////////////////////////////////////////////////////
-// @ socket_xp   : [in]  extended pointer on socket descriptor
-/////////////////////////////////////////////////////////////////////////////////////////
-static void socket_unlink_from_servers( xptr_t socket_xp )
-{
-    cxy_t      socket_cxy = GET_CXY( socket_xp );
-    socket_t * socket_ptr = GET_PTR( socket_xp );
-
-#if DEBUG_SOCKET_LINK
-thread_t  * this        = CURRENT_THREAD;
-process_t * process     = this->process;
-pid_t       socket_pid  = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-fdid_t      socket_fdid = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->pid ));
-uint32_t   cycle        = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_LINK < cycle )
-printk("\n[%s] thread[%x,%x] enter for socket[%x,%d] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, socket_pid, socket_fdid, cycle ); 
-#endif
-
-    // get NIC channel
-    uint32_t channel = hal_remote_l32( XPTR( socket_cxy , &socket_ptr->nic_channel ));
-
-    // get pointers on NIC_TX[channel] chdev
-    xptr_t    tx_chdev_xp  = chdev_dir.nic_tx[channel];
-    chdev_t * tx_chdev_ptr = GET_PTR( tx_chdev_xp );
-    cxy_t     tx_chdev_cxy = GET_CXY( tx_chdev_xp );
-
-    // build various TX extended pointers 
-    xptr_t    tx_lock_xp   = XPTR( tx_chdev_cxy , &tx_chdev_ptr->wait_lock );
-    xptr_t    tx_list_xp   = XPTR( socket_cxy   , &socket_ptr->tx_list );
-    xptr_t    tx_list_next = hal_remote_l64( tx_list_xp );
-    xptr_t    tx_list_pred = hal_remote_l64( tx_list_xp + sizeof(xptr_t) );
-
-    // get pointers on NIC_RX[channel] chdev
-    xptr_t    rx_chdev_xp  = chdev_dir.nic_rx[channel];
-    chdev_t * rx_chdev_ptr = GET_PTR( rx_chdev_xp );
-    cxy_t     rx_chdev_cxy = GET_CXY( rx_chdev_xp );
-
-    // build various RX extended pointers
-    xptr_t    rx_lock_xp   = XPTR( rx_chdev_cxy , &rx_chdev_ptr->wait_lock );
-    xptr_t    rx_list_xp   = XPTR( socket_cxy   , &socket_ptr->rx_list );
-    xptr_t    rx_list_next = hal_remote_l64( rx_list_xp );
-    xptr_t    rx_list_pred = hal_remote_l64( rx_list_xp + sizeof(xptr_t) );
-
-    // remove socket from the NIC_TX[channel] chdev clients queue if registered
-    if( (tx_list_next != XPTR_NULL) || (tx_list_pred != XPTR_NULL) )
-    {
-        remote_busylock_acquire( tx_lock_xp );
-        xlist_unlink( tx_list_xp );
-        remote_busylock_release( tx_lock_xp );
-    }
-
-    // remove socket from the NIC_RX[channel] chdev clients queue if registered
-    if( (rx_list_next != XPTR_NULL) || (rx_list_pred != XPTR_NULL) )
-    {
-        remote_busylock_acquire( rx_lock_xp );
-        xlist_unlink( rx_list_xp );
-        remote_busylock_release( rx_lock_xp );
-    }
-
-#if DEBUG_SOCKET_LINK
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_LINK < cycle )
-printk("\n[%s] thread[%x,%x] unlinked socket [%x,%d] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, socket_pid, socket_fdid, cycle ); 
-#endif
-
-}  // end socket_unlink_from_servers()
-        
-/////////////////////////////////////////////////////////////////////////////////////////
-// This function registers the socket defined by the <socket_xp> argument into the
-// list of listening sockets rooted in the nic_rx[0] chdev.
-/////////////////////////////////////////////////////////////////////////////////////////
-// @ socket_xp   : [in]  extended pointer on socket descriptor
-/////////////////////////////////////////////////////////////////////////////////////////
-static void socket_link_to_listen( xptr_t socket_xp )
-{
-    // get socket cluster and local pointer
-    socket_t * socket_ptr = GET_PTR( socket_xp );
-    cxy_t      socket_cxy = GET_CXY( socket_xp );
-
-    // get pointers on NIC_RX[0] chdev
-    xptr_t    rx0_chdev_xp  = chdev_dir.nic_rx[0];
-    chdev_t * rx0_chdev_ptr = GET_PTR( rx0_chdev_xp );
-    cxy_t     rx0_chdev_cxy = GET_CXY( rx0_chdev_xp );
-   
-    // build extended pointers on list of listening sockets
-    xptr_t    rx0_root_xp = XPTR( rx0_chdev_cxy , &rx0_chdev_ptr->ext.nic.root );
-    xptr_t    rx0_lock_xp = XPTR( rx0_chdev_cxy , &rx0_chdev_ptr->ext.nic.lock );
-
-    // build extended pointer on socket rx_list field
-    xptr_t    list_entry_xp = XPTR( socket_cxy , &socket_ptr->rx_list );
-
-    // register socket in listening sockets list
-    remote_busylock_acquire( rx0_lock_xp );
-    xlist_add_last( rx0_root_xp , list_entry_xp );
-    remote_busylock_release( rx0_lock_xp );
-
-}  // end socket_link_to_listen()
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// This function removes the socket defined by the <socket_xp> argument from the
-// list of listening sockets rooted in the nic_rx[0] chdev.
-/////////////////////////////////////////////////////////////////////////////////////////
-// @ socket_xp   : [in]  extended pointer on socket descriptor
-/////////////////////////////////////////////////////////////////////////////////////////
-static void socket_unlink_from_listen( xptr_t socket_xp )
-{
-    // get socket cluster and local pointer
-    socket_t * socket_ptr = GET_PTR( socket_xp );
-    cxy_t      socket_cxy = GET_CXY( socket_xp );
-
-    // get pointers on NIC_RX[0] chdev
-    xptr_t    rx0_chdev_xp  = chdev_dir.nic_rx[0];
-    chdev_t * rx0_chdev_ptr = GET_PTR( rx0_chdev_xp );
-    cxy_t     rx0_chdev_cxy = GET_CXY( rx0_chdev_xp );
-   
-    // build extended pointers on lock protecting list of listening sockets
-    xptr_t    rx0_lock_xp = XPTR( rx0_chdev_cxy , &rx0_chdev_ptr->ext.nic.lock );
-
-    // build extended pointer on socket rx_list field
-    xptr_t    list_entry_xp = XPTR( socket_cxy , &socket_ptr->rx_list );
-
-    // register socket in listening sockets list
-    remote_busylock_acquire( rx0_lock_xp );
-    xlist_unlink( list_entry_xp );
-    remote_busylock_release( rx0_lock_xp );
-
-}  // end socket_unlink_from_listen()
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the socket_build() and socket_accept() functions.
-// It allocates memory in cluster defined by the <cxy> argument for all structures
-// associated to a socket: file descriptor, socket descriptor, RX buffer, R2T queue,
-// and CRQ queue. It allocates an fdid, and register it in the process fd_array.
-// It initialise the socket desccriptor static fields, other than local_addr, 
-// local_port, remote_addr, remote_port), and set the socket state to UNBOUND.
-// It returns the local pointer on socket descriptor and the fdid value in buffers
-// defined by the <socket_ptr> & <fdid_ptr> arguments.
-/////////////////////////////////////////////////////////////////////////////////////////
-// @ cxy        : [in]  target cluster fo socket & file descriptors.
-// @ domain     : [in]  socket domain.
-// @ type       : [in]  socket type.
-// @ socket_ptr : [out] local pointer on buffer for socket pointer.
-// @ fdid_ptr   : [out] local pointer on buffer for fdid value.
-// # return 0 if success / return -1 if no memory.
-/////////////////////////////////////////////////////////////////////////////////////////
-static error_t socket_create( cxy_t       cxy,
-                              uint32_t    domain,
-                              uint32_t    type,
-                              socket_t ** socket_ptr,
-                              uint32_t  * fdid_ptr )
-{
-    uint32_t       fdid;
-    socket_t     * socket;
-    vfs_file_t   * file;
-    uint32_t       state;
-    void         * tx_buf;
-    error_t        error;
-
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SOCKET_CREATE || DEBUG_SOCKET_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_SOCKET_CREATE
-if( DEBUG_SOCKET_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle ); 
-#endif
-   
-    // 1. allocate memory for socket descriptor 
-    socket = kmem_remote_alloc( cxy , bits_log2(sizeof(socket_t)) , AF_ZERO );
-
-    if( socket == NULL )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : cannot allocate socket descriptor / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // 2. allocate memory for rx_buf data buffer
-    error = remote_buf_init( XPTR( cxy , &socket->rx_buf ),
-                             CONFIG_SOCK_RX_BUF_ORDER );
-
-    if( error )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : no memory for rx_buf / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        kmem_remote_free( cxy , socket , bits_log2(sizeof(socket_t)) );  // 1
-        return -1;
-    }
-
-    // 3. allocate memory for tx_buf 
-    tx_buf = kmem_remote_alloc( cxy , CONFIG_SOCK_TX_BUF_ORDER , AF_NONE );
-
-    if( tx_buf == NULL )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : no memory for tx_buf / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        remote_buf_release_data( XPTR( cxy , &socket->rx_buf ) );        // 2
-        kmem_remote_free( cxy , socket , bits_log2(sizeof(socket_t)) );  // 1 
-        return -1;
-    }
-
-    // 4. allocate memory for r2tq queue 
-    error = remote_buf_init( XPTR( cxy , &socket->r2tq ),
-                             bits_log2( CONFIG_SOCK_R2T_BUF_SIZE ) );
-    if( error )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : cannot allocate R2T queue / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        kmem_remote_free( cxy , tx_buf , CONFIG_SOCK_TX_BUF_ORDER );     // 3
-        remote_buf_release_data( XPTR( cxy , &socket->rx_buf ) );        // 2
-        kmem_remote_free( cxy , socket , bits_log2(sizeof(socket_t)) );  // 1 
-        return -1;
-    }
-
-    // don't allocate memory for CRQ queue / done by the socket_listen function
-
-    // 5. allocate memory for file descriptor
-	file = kmem_remote_alloc( cxy , bits_log2(sizeof(vfs_file_t)) , AF_ZERO );
-
-    if( file == NULL ) 
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : cannot allocate file descriptor / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        remote_buf_release_data( XPTR( cxy , &socket->r2tq ) );          // 4 
-        kmem_remote_free( cxy , tx_buf , CONFIG_SOCK_TX_BUF_ORDER );     // 3
-        remote_buf_release_data( XPTR( cxy , &socket->rx_buf ) );        // 2
-        kmem_remote_free( cxy , socket , bits_log2(sizeof(socket_t)) );  // 1 
-        return -1;
-    }
-    
-    // 6. get an fdid value, and register file descriptor in fd_array[]
-    error = process_fd_register( process->ref_xp,
-                                 XPTR( cxy , file ),
-                                 &fdid );
-    if ( error ) 
-    {
-
-#if DEBUG_SOCKET_ERROR
-if( DEBUG_SOCKET_ERROR < cycle )
-printk("\n[ERROR] in %s : cannot register file descriptor / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        kmem_remote_free( cxy , file , bits_log2(sizeof(vfs_file_t)) );  // 5
-        remote_buf_release_data( XPTR( cxy , &socket->r2tq ) );          // 4 
-        kmem_remote_free( cxy , tx_buf , CONFIG_SOCK_TX_BUF_ORDER );     // 3
-        remote_buf_release_data( XPTR( cxy , &socket->rx_buf ) );        // 2
-        kmem_remote_free( cxy , socket , bits_log2(sizeof(socket_t)) );  // 1 
-        return -1;
-    }
-
-    state = (type == SOCK_STREAM) ? TCP_STATE_UNBOUND : UDP_STATE_UNBOUND;
-
-    // initialise socket descriptor 
-    hal_remote_s32( XPTR( cxy , &socket->pid         ) , process->pid );
-    hal_remote_s32( XPTR( cxy , &socket->fdid        ) , fdid );
-    hal_remote_s32( XPTR( cxy , &socket->domain      ) , domain );
-    hal_remote_s32( XPTR( cxy , &socket->type        ) , type );
-    hal_remote_s32( XPTR( cxy , &socket->state       ) , state );
-    hal_remote_s64( XPTR( cxy , &socket->tx_client   ) , XPTR_NULL );
-    hal_remote_s64( XPTR( cxy , &socket->rx_client   ) , XPTR_NULL );
-    hal_remote_s32( XPTR( cxy , &socket->tx_valid    ) , false );
-    hal_remote_s32( XPTR( cxy , &socket->rx_valid    ) , false );
-    hal_remote_s32( XPTR( cxy , &socket->nic_channel ) , 0 );
-    hal_remote_spt( XPTR( cxy , &socket->tx_buf      ) , tx_buf );
-
-    // initialize file descriptor 
-    hal_remote_s32( XPTR( cxy , &file->type        ) , FILE_TYPE_SOCK );
-    hal_remote_spt( XPTR( cxy , &file->socket      ) , socket );
-
-    // initialize socket lock
-    remote_queuelock_init( XPTR( cxy , &socket->lock ) , LOCK_SOCKET_STATE );
-
-#if DEBUG_SOCKET_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] exit / socket[%x,%d] / xptr[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, cxy, socket, cycle );
-#endif
-   
-    // return success
-    *socket_ptr = socket;
-    *fdid_ptr   = fdid;
-
-    return 0;
-
-}  // end socket_create
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the socket_close() function to destroy a socket
-// identified by the <file_xp> argument.
-// It remove the associated file from the reference process fd_array. It unlink the
-// socket from the NIC_TX [k] and NIC_RX[k] chdevs. It release all memory allocated 
-// for the structures associated to the target socket : file descriptor, socket 
-// descriptor, RX buffer, R2T queue, CRQ queue.
-/////////////////////////////////////////////////////////////////////////////////////////
-// @ file_xp  : extended pointer on the file descriptor.
-/////////////////////////////////////////////////////////////////////////////////////////
-static void socket_destroy( xptr_t file_xp )
-{
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-// check file_xp argument 
-assert( __FUNCTION__, (file_xp != XPTR_NULL), "illegal argument\n" );
-
-    // get cluster & local pointer for file descriptor
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-    cxy_t        file_cxy = GET_CXY( file_xp );
-
-    // get local pointer for socket and file type
-    socket_t * socket_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-    uint32_t   file_type  = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-    
-// check file descriptor type
-assert( __FUNCTION__, (file_type == FILE_TYPE_SOCK), "illegal file type\n" );
-
-    // get socket nic_channel, state, pid and fdid
-    uint32_t state   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state ));
-    uint32_t fdid    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->fdid ));
-    
-#if DEBUG_SOCKET_DESTROY
-uint32_t cycle = (uint32_t)hal_get_cycles();
-pid_t    pid   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->pid ));
-if( DEBUG_SOCKET_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] enter / file[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, pid, fdid, cycle );
-#endif
-
-    // remove socket from NIC_TX & NIC_RX chdev queues
-    //  or from the listening sockets list
-    if( state == TCP_STATE_LISTEN ) 
-    {
-        socket_unlink_from_listen( XPTR( file_cxy , socket_ptr ) );
-    }
-    else
-    {
-        socket_unlink_from_servers( XPTR( file_cxy , socket_ptr ) );
-    }
-
-    // remove the file descriptor from the fd_array
-    process_fd_remove( process->owner_xp , fdid );
-
-    // release memory allocated for file descriptor
-    kmem_remote_free( file_cxy , file_ptr , bits_log2(sizeof(vfs_file_t)) );
-
-    // release memory allocated for buffers attached to socket descriptor
-    remote_buf_release_data( XPTR( file_cxy , &socket_ptr->crqq ) );
-    remote_buf_release_data( XPTR( file_cxy , &socket_ptr->r2tq ) );
-    remote_buf_release_data( XPTR( file_cxy , &socket_ptr->rx_buf ) );
-
-    // release memory allocated for socket descriptor
-    kmem_remote_free( file_cxy , socket_ptr , bits_log2(sizeof(socket_t)) );
-
-#if DEBUG_SOCKET_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-
-}  // end socket_destroy()
-
-////////////////////////////////////////////////
-void socket_put_r2t_request( xptr_t    queue_xp,
-                             uint8_t   flags,
-                             uint32_t  channel )
-{
-    xptr_t     chdev_xp;
-    cxy_t      chdev_cxy;
-    chdev_t  * chdev_ptr;
-    thread_t * server_ptr;
-    xptr_t     server_xp;
-
-    while( 1 )
-    {
-        // try to register R2T request
-        error_t error = remote_buf_put_from_kernel( queue_xp,
-                                                    &flags,
-                                                    1 );
-        if( error )
-        {
-            // queue full => wait and retry
-            sched_yield( "waiting R2T queue" );
-        }
-        else
-        {
-            // get NIC_TX chdev pointers
-            chdev_xp = chdev_dir.nic_tx[channel];
-            chdev_cxy = GET_CXY( chdev_xp );
-            chdev_ptr = GET_PTR( chdev_xp );
- 
-            // get NIC_TX server thread pointers
-            server_ptr = hal_remote_lpt( XPTR( chdev_cxy , &chdev_ptr->server ) );
-            server_xp  = XPTR( chdev_cxy , server_ptr );
-
-            // unblocks NIC_TX server thread
-            thread_unblock( server_xp , THREAD_BLOCKED_CLIENT );
-
-            return;
-        }
-    }
-}  // end socket_put_r2t_request()
-
-///////////////////////////////////////////////////
-error_t socket_get_r2t_request( xptr_t    queue_xp,
-                                uint8_t * flags )
-{
-    // get one request from R2T queue
-    return remote_buf_get_to_kernel( queue_xp,
-                                     flags,
-                                     1 );
-}  // end socket_get_r2T_request()
-  
-///////////////////////////////////////////////////
-error_t socket_put_crq_request( xptr_t    queue_xp,
-                                uint32_t  remote_addr,
-                                uint32_t  remote_port,
-                                uint32_t  remote_iss,
-                                uint32_t  remote_window )
-{
-    connect_request_t   req;
-
-    // build request
-    req.addr   = remote_addr;
-    req.port   = remote_port;
-    req.iss    = remote_iss;
-    req.window = remote_window;
-
-    // try to register request in CRQ
-    return remote_buf_put_from_kernel( queue_xp,
-                                       (uint8_t *)(&req),
-                                       sizeof(connect_request_t) );
-}  // end socket_put_crq_request()
-  
-////////////////////////////////////////////////////
-error_t socket_get_crq_request( xptr_t     queue_xp,
-                                uint32_t * remote_addr,
-                                uint32_t * remote_port,
-                                uint32_t * remote_iss,
-                                uint32_t * remote_window )
-{
-    connect_request_t   req;
-    error_t             error;
-
-    // get request from CRQ
-    error = remote_buf_get_to_kernel( queue_xp,
-                                      (uint8_t *)(&req),
-                                      sizeof(connect_request_t) );
-    // extract request arguments
-    *remote_addr   = req.addr;
-    *remote_port   = req.port;
-    *remote_iss    = req.iss;
-    *remote_window = req.window;
-
-    return error;
-
-}  // end socket_get_crq_request()
-  
-
-/////////////////////////////////////////////////////////////////////////////////////////
-//                 Functions implementing the SOCKET related syscalls
-/////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////
-int socket_build( uint32_t   domain,
-                  uint32_t   type )
-{
-    uint32_t    fdid;
-    socket_t  * socket;
-    error_t     error;
-
-#if DEBUG_SOCKET_BUILD
-uint32_t    cycle   = (uint32_t)hal_get_cycles();
-thread_t  * this    = CURRENT_THREAD;
-process_t * process = this->process;
-if( DEBUG_SOCKET_BUILD < cycle )
-printk("\n[%s] thread[%x,%x] enter / %s / %s / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, 
-socket_domain_str(domain), socket_type_str(type), cycle );
-#endif
-
-
-    // allocate memory for the file descriptor and for the socket
-    error = socket_create( local_cxy,
-                           domain,
-                           type,
-                           &socket, 
-                           &fdid );
-
-#if DEBUG_SOCKET_BUILD
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_BUILD < cycle )
-printk("\n[%s] thread[%x,%x] exit / socket %x / fdid %d / %s / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, socket, fdid, 
-socket_state_str(hal_remote_l32(XPTR(local_cxy , &socket->state))),
-cycle );
-#endif
-
-    if( error ) return -1;
-    return fdid;
-}
-
-////////////////////////////////
-int socket_bind( uint32_t  fdid,
-                 uint32_t  addr,
-                 uint16_t  port )
-{
-    vfs_file_type_t    file_type;
-    socket_t          * socket;
-    uint32_t            socket_type;
-    uint32_t            socket_state;
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SOCKET_BIND || DEBUG_SOCKET_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_SOCKET_BIND
-if( DEBUG_SOCKET_BIND < cycle )
-printk("\n[%s] thread[%x,%x] enter / socket[%x,%d] / addr %x / port %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, addr, port, cycle );
-#endif
-
-    // get pointers on file descriptor
-    xptr_t       file_xp  = process_fd_get_xptr_from_local( process , fdid );
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-    cxy_t        file_cxy = GET_CXY( file_xp );
-
-    // check file_xp
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : undefined fdid %d / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, fdid, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    file_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-    socket    = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-
-    // check file descriptor type
-    if( file_type != FILE_TYPE_SOCK )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal file type %s / thread[%x,%x] / cycle %d",
-__FUNCTION__, vfs_inode_type_str( file_type ), process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // get socket type
-    socket_type = hal_remote_l32(XPTR( file_cxy , &socket->type ));
-
-    // compute socket state
-    socket_state = (socket_type == SOCK_STREAM) ? TCP_STATE_BOUND : UDP_STATE_BOUND;
-
-    // update the socket descriptor
-    hal_remote_s32( XPTR( file_cxy , &socket->local_addr ) , addr );
-    hal_remote_s32( XPTR( file_cxy , &socket->local_port ) , port );
-    hal_remote_s32( XPTR( file_cxy , &socket->state      ) , socket_state );
-
-#if DEBUG_SOCKET_BIND
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_BIND < cycle )
-printk("\n[%s] thread[%x,%x] exit / socket[%x,%d] / %s / addr %x / port %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid,
-socket_state_str(hal_remote_l32( XPTR( file_cxy , &socket->state ))),
-hal_remote_l32( XPTR( file_cxy , &socket->local_addr )),
-hal_remote_l32( XPTR( file_cxy , &socket->local_port )),
-cycle );
-#endif
-
-    return 0;
-
-}  // end socket_bind()
-
-//////////////////////////////////
-int socket_listen( uint32_t fdid,
-                   uint32_t crq_depth )
-{
-    xptr_t              file_xp;
-    vfs_file_t        * file_ptr;
-    cxy_t               file_cxy;
-    vfs_file_type_t    file_type;
-    socket_t          * socket_ptr;
-    uint32_t            socket_type;
-    uint32_t            socket_state;
-    uint32_t            socket_local_addr;
-    uint32_t            socket_local_port;
-    error_t             error;
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SOCKET_LISTEN || DEBUG_SOCKET_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_SOCKET_LISTEN
-if( DEBUG_SOCKET_LISTEN < cycle )
-printk("\n[%s] thread[%x,%x] enter / socket[%x,%d] / crq_depth %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, crq_depth, cycle );
-#endif
-
-    // get pointers on file descriptor
-    file_xp  = process_fd_get_xptr_from_local( process , fdid );
-    file_ptr = GET_PTR( file_xp );
-    file_cxy = GET_CXY( file_xp );
-
-    // check file_xp
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : undefined fdid %d / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, fdid, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    file_type  = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-    socket_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-
-    // check file descriptor type
-    if( file_type != FILE_TYPE_SOCK )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal file type %s / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, vfs_inode_type_str(file_type), process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // get relevant infos from socket descriptor
-    socket_type       = hal_remote_l32( XPTR( file_cxy , &socket_ptr->type )); 
-    socket_state      = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state )); 
-    socket_local_addr = hal_remote_l32( XPTR( file_cxy , &socket_ptr->local_addr )); 
-    socket_local_port = hal_remote_l32( XPTR( file_cxy , &socket_ptr->local_port )); 
-
-    // check socket type 
-    if( socket_type != SOCK_STREAM )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal socket type %s / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_type_str(socket_type), process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-    
-    // check socket state
-    if( socket_state != TCP_STATE_BOUND )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal socket state %s / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_state_str(socket_state), process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-    
-    // compute CRQ queue depth : max( crq_depth , CONFIG_SOCK_CRQ_BUF_SIZE )
-    uint32_t depth = ( crq_depth > CONFIG_SOCK_CRQ_BUF_SIZE ) ? 
-                     crq_depth : CONFIG_SOCK_CRQ_BUF_SIZE;
-
-    // allocate memory for the CRQ queue
-    error = remote_buf_init( XPTR( file_cxy , &socket_ptr->crqq ),
-                                   bits_log2( depth * sizeof(connect_request_t)) );
-    if( error )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : cannot allocate CRQ queue / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // update socket.state
-    hal_remote_s32( XPTR( file_cxy , &socket_ptr->state ) , TCP_STATE_LISTEN );
-
-    // register socket in the list of listening socket
-    socket_link_to_listen( XPTR( file_cxy , socket_ptr ) );
-
-#if DEBUG_SOCKET_LISTEN
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_LISTEN < cycle )
-printk("\n[%s] thread[%x,%x] exit / socket[%x,%d] / %s / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid,
-socket_state_str(socket_state), cycle );
-#endif
-
-    return 0;
-
-}  // end socket_listen()
-
-///////////////////////////////////
-int socket_accept( uint32_t   fdid,
-                   uint32_t * remote_addr,
-                   uint16_t * remote_port )
-{
-    xptr_t              file_xp;             // extended pointer on remote file
-    vfs_file_t        * file_ptr;
-    cxy_t               file_cxy;
-    vfs_file_type_t     file_type;           // file descriptor type
-    socket_t          * socket_ptr;          // local pointer on remote waiting socket
-    uint32_t            socket_type;         // listening socket type    
-    uint32_t            socket_state;        // listening socket state
-    uint32_t            socket_domain;       // listening socket domain
-    uint32_t            socket_local_addr;   // listening socket local IP address
-    uint32_t            socket_local_port;   // listening socket local port
-    uint32_t            socket_tx_nxt;       // listening socket tx_nxt
-    bool_t              socket_tx_valid;     // listening socket tx_valid
-    xptr_t              socket_tx_client;    // listening socket tx_client thread
-    bool_t              socket_rx_valid;     // listening socket rx_valid
-    xptr_t              socket_rx_client;    // listening socket rx_client thread
-    xptr_t              socket_lock_xp;      // listening socket lock
-    xptr_t              crq_xp;              // listening socket CRQ queue
-    uint32_t            crq_status;          // number of bytes in CRQ
-    cxy_t               new_socket_cxy;      // new socket cluster identifier
-    socket_t          * new_socket_ptr;      // local pointer on new socket
-    xptr_t              new_socket_xp;       // extended pointer on new socket
-    volatile uint32_t   new_state;           // new socket state (modified by NIC_RX thread)
-    uint32_t            new_fdid;            // new socket file descriptor index
-    uint32_t            new_remote_addr;     // new socket remote IP address
-    uint32_t            new_remote_port;     // new socket remote port
-    uint32_t            new_remote_iss;      // new socket remote iss
-    uint32_t            new_remote_window;   // new socket receive window
-    xptr_t              tx_server_xp;        // extended pointer on TX server thread
-    thread_t          * tx_server_ptr;       // local pointer on TX server thread
-    uint32_t            cmd_status;          // command status (rx_sts or tx_sts)
-    bool_t              cmd_valid;           // valid command (rx_valid or tx_valid)
-    error_t             error;
-
-    thread_t  * this      = CURRENT_THREAD;
-    xptr_t      client_xp = XPTR( local_cxy , this );
-    process_t * process   = this->process;
-
-#if DEBUG_SOCKET_ACCEPT || DEBUG_SOCKET_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_SOCKET_ACCEPT 
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] enter for socket[%x,%d] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, cycle );
-#endif
-
-    // 1) get pointers on file descriptor
-    file_xp  = process_fd_get_xptr_from_local( process , fdid );
-    file_ptr = GET_PTR( file_xp );
-    file_cxy = GET_CXY( file_xp );
-
-    // check file_xp
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : undefined fdid %d / thead[%x,%x] / cycle %d",
-__FUNCTION__, fdid, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-  
-    file_type  = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-    socket_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-
-    // check file descriptor type
-    if( file_type != FILE_TYPE_SOCK )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal file type %s / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, vfs_inode_type_str(file_type), process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // build extended pointer on listening socket lock
-    socket_lock_xp = XPTR( file_cxy , &socket_ptr->lock );
-
-    // acquire listening socket lock
-    remote_queuelock_acquire( socket_lock_xp );
-                    
-    // get listening socket type, domain, state, local_addr, local_port & tx_nxt 
-    socket_type       = hal_remote_l32( XPTR( file_cxy , &socket_ptr->type )); 
-    socket_state      = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state )); 
-    socket_domain     = hal_remote_l32( XPTR( file_cxy , &socket_ptr->domain )); 
-    socket_local_addr = hal_remote_l32( XPTR( file_cxy , &socket_ptr->local_addr )); 
-    socket_local_port = hal_remote_l32( XPTR( file_cxy , &socket_ptr->local_port )); 
-    socket_tx_nxt     = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_nxt ));
-    socket_tx_valid   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_valid )); 
-    socket_tx_client  = hal_remote_l64( XPTR( file_cxy , &socket_ptr->tx_client ));
-    socket_rx_valid   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->rx_valid )); 
-    socket_rx_client  = hal_remote_l64( XPTR( file_cxy , &socket_ptr->rx_client ));
-
-    // check socket type 
-    if( socket_type != SOCK_STREAM )
-    {
-                    
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal socket type %s / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_type_str(socket_type), process->pid , this->trdid, cycle );
-#endif
-        remote_queuelock_release( socket_lock_xp );
-        return -1;
-    }
-    
-    // check socket state
-    if( socket_state != TCP_STATE_LISTEN ) 
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal socket state %s / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, socket_state_str(socket_state), process->pid, this->trdid, cycle );
-#endif
-        remote_queuelock_release( socket_lock_xp );
-        return -1;
-    }
-    
-    // check no previous RX command
-    if( (socket_rx_valid == true) || (socket_rx_client != XPTR_NULL) )
-    { 
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : previous RX cmd on socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-        remote_queuelock_release( socket_lock_xp );
-        return -1;
-    }
-
-    // check no previous TX command
-    if( (socket_tx_valid == true) || (socket_tx_client != XPTR_NULL) )
-    { 
-                    
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : previous TX cmd on socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-        remote_queuelock_release( socket_lock_xp );
-        return -1;
-    }
-
-    // 2) check the listenig socket CRQ
-    crq_xp  = XPTR( file_cxy , &socket_ptr->crqq );
-
-    // get CRQ status
-    crq_status = remote_buf_status( crq_xp );
-
-    // block & deschedule to wait a client request when CRQ empty
-    if( crq_status == 0 )
-    {
-        // register command arguments for NIC_RX server in listening socket
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->rx_cmd    ), CMD_RX_ACCEPT );
-        hal_remote_s64( XPTR( file_cxy , &socket_ptr->rx_client ), client_xp );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->rx_valid  ), true );
-
-        // release listening socket lock
-        remote_queuelock_release( socket_lock_xp );
-
-#if DEBUG_SOCKET_ACCEPT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] / CRQ empty => blocks on <IO> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, cycle );
-#endif
-        // block & deschedule when CRQQ empty
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_IO );
-        sched_yield( "CRQ queue empty");
-
-#if DEBUG_SOCKET_ACCEPT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] / resumes / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, cycle );
-#endif
-        // take listening socket lock
-        remote_queuelock_acquire( socket_lock_xp );
-
-        // get CRQ status & command status
-        cmd_valid    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->rx_valid ) );
-        cmd_status   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->rx_sts ) );
-        crq_status   = remote_buf_status( crq_xp );
-
-assert( __FUNCTION__,
-(((crq_status > 0) || (cmd_status!= CMD_STS_SUCCESS)) && (cmd_valid == false)),
-"illegal socket state when client thread resumes after RX_ACCEPT" );
-
-        // reset socket.rx_client
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->rx_client ) , XPTR_NULL );
-
-        if( cmd_status != CMD_STS_SUCCESS )
-        {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : reported for RX / socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-            remote_queuelock_release( socket_lock_xp );
-            return -1;
-        }
-    }  // end blocking on CRQ empty 
-
-    // from this point, we can extract a request from listening socket CRQ
-    error = socket_get_crq_request( crq_xp,
-                                    &new_remote_addr,
-                                    &new_remote_port,
-                                    &new_remote_iss,
-                                    &new_remote_window );
-assert( __FUNCTION__, (error == 0),
-"cannot get a connection request from a non-empty CRQ" ); 
-
-    // release listening socket lock
-    remote_queuelock_release( socket_lock_xp );
-
-#if DEBUG_SOCKET_ACCEPT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] / CRQ request [addr %x / port %x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid,
-new_remote_addr, new_remote_port, cycle );
-#endif
-
-    // 3) select a cluster for the new socket
-    new_socket_cxy = cluster_random_select();
-
-    // allocate memory for the new socket descriptor 
-    error = socket_create( new_socket_cxy,
-                           socket_domain,
-                           socket_type,
-                           &new_socket_ptr,
-                           &new_fdid );
-    if( error )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : cannot create new socket / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-   
-    // build extended poiner on new socket
-    new_socket_xp = XPTR( new_socket_cxy , new_socket_ptr );
-
-#if DEBUG_SOCKET_ACCEPT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] created new socket[%x,%d] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, new_fdid, cycle );
-#endif
-        
-    // compute NIC channel index from remote_addr and remote_port
-    uint32_t new_nic_channel = dev_nic_get_key( new_remote_addr , new_remote_port );
-
-    // update new socket descriptor 
-    hal_remote_s32(XPTR(new_socket_cxy , &new_socket_ptr->local_addr ) , socket_local_addr );
-    hal_remote_s32(XPTR(new_socket_cxy , &new_socket_ptr->local_port ) , socket_local_port );
-    hal_remote_s32(XPTR(new_socket_cxy , &new_socket_ptr->remote_addr) , new_remote_addr );
-    hal_remote_s32(XPTR(new_socket_cxy , &new_socket_ptr->remote_port) , new_remote_port );
-    hal_remote_s32(XPTR(new_socket_cxy , &new_socket_ptr->nic_channel) , new_nic_channel );
-    hal_remote_s32(XPTR(new_socket_cxy , &new_socket_ptr->state      ) , TCP_STATE_SYN_RCVD );
-
-    // set new socket TCB : increment tx_nxt / initialize rx_nxt, rx_irs, rx_wnd
-    hal_remote_s32( XPTR( new_socket_cxy , &new_socket_ptr->tx_nxt ), socket_tx_nxt + 1 );
-    hal_remote_s32( XPTR( new_socket_cxy , &new_socket_ptr->rx_nxt ), new_remote_iss + 1 );
-    hal_remote_s32( XPTR( new_socket_cxy , &new_socket_ptr->rx_irs ), new_remote_iss );
-    hal_remote_s32( XPTR( new_socket_cxy , &new_socket_ptr->rx_wnd ), new_remote_window );
-
-    // link new socket to chdev servers
-    socket_link_to_servers( new_socket_xp , new_nic_channel );
-
-    // 3) get pointers on NIC_TX[channel] chdev
-    xptr_t    tx_chdev_xp  = chdev_dir.nic_tx[new_nic_channel];
-    chdev_t * tx_chdev_ptr = GET_PTR( tx_chdev_xp );
-    cxy_t     tx_chdev_cxy = GET_CXY( tx_chdev_xp );
-
-    // get pointers on NIC_TX[channel] server thread
-    tx_server_ptr = hal_remote_lpt( XPTR( tx_chdev_cxy , &tx_chdev_ptr->server ));
-    tx_server_xp  = XPTR( tx_chdev_cxy , tx_server_ptr );
-
-    // register command arguments in new socket to request a SYN_ACK segment
-    hal_remote_s32( XPTR( new_socket_cxy , &new_socket_ptr->tx_cmd    ), CMD_TX_ACCEPT );
-    hal_remote_s64( XPTR( new_socket_cxy , &new_socket_ptr->tx_client ), client_xp );
-    hal_remote_s32( XPTR( new_socket_cxy , &new_socket_ptr->tx_valid  ), true );
-
-    // unblock NIC_TX server thread
-    thread_unblock( tx_server_xp , THREAD_BLOCKED_CLIENT );
-  
-    // start retransmission timer
-    alarm_start( client_xp,
-                 hal_get_cycles() + CONFIG_SOCK_RETRY_TIMEOUT,
-                 &socket_alarm_handler,
-                 new_socket_xp );
-
-#if DEBUG_SOCKET_ACCEPT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] for socket[%x,%d] request SYN-ACK & blocks on <IO> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, new_fdid, cycle );
-#endif
-
-    // client thread blocks & deschedules 
-    thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_IO );
-    sched_yield( "waiting new socket connection");
-
-#if DEBUG_SOCKET_ACCEPT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] new_socket[%x,%d] resumes  / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, new_fdid, cycle );
-#endif
-
-    // stop retransmission timer in thread descriptor
-    alarm_stop( client_xp );
-
-    // get new socket state, tx_valid and tx_sts
-    new_state  = hal_remote_l32( XPTR( new_socket_cxy , &new_socket_ptr->state ));
-    cmd_valid  = hal_remote_l32( XPTR( new_socket_cxy , &new_socket_ptr->tx_valid ));
-    cmd_status = hal_remote_l32( XPTR( new_socket_cxy , &new_socket_ptr->tx_sts ));
-
-assert( __FUNCTION__,
-(((new_state == TCP_STATE_ESTAB) || (cmd_status != CMD_STS_SUCCESS)) && (cmd_valid == false)), 
-"illegal socket state when client thread resumes after TX_ACCEPT" ); 
-
-    // reset socket.tx_client
-    hal_remote_s64( XPTR( new_socket_cxy , &new_socket_ptr->tx_client ) , XPTR_NULL );
-
-    if( cmd_status != CMD_STS_SUCCESS ) 
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s reported for TX / socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, new_fdid, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-    else
-    {
-
-#if DEBUG_SOCKET_ACCEPT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_ACCEPT < cycle )
-printk("\n[%s] thread[%x,%x] new_socket[%x,%d] / state %s / addr %x / port %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, new_fdid,
-socket_state_str(new_state), new_remote_addr, new_remote_port, cycle );
-#endif
-
-        // return success
-        *remote_addr = new_remote_addr;
-        *remote_port = new_remote_port;
-        return new_fdid;
-    }
- 
-}  // end socket_accept()
-
-//////////////////////////////////
-int socket_connect( uint32_t fdid,
-                    uint32_t remote_addr,
-                    uint16_t remote_port )
-{
-    vfs_file_type_t    file_type;
-    xptr_t              socket_xp;        // extended pointer on socket descriptor
-    socket_t          * socket_ptr;       // local pointer on socket descriptor
-    volatile uint32_t   socket_state;     // socket state (modified by the NIC_TX thread)
-    uint32_t            socket_type;      // socket type  
-    uint32_t            local_addr;       // local IP address
-    uint32_t            local_port;       // local port
-    xptr_t              tx_server_xp;     // extended pointer on TX server thread
-    thread_t          * tx_server_ptr;    // local pointer on TX server thread
-    uint32_t            nic_channel;      // NIC channel index
-    uint32_t            cmd_status;       // command status (tx_sts field)
-    bool_t              cmd_valid;        // command valid (tx_valid field)
-
-    thread_t  * this      = CURRENT_THREAD;
-    xptr_t      client_xp = XPTR( local_cxy , this );
-    pid_t       pid       = this->process->pid;
-    trdid_t     trdid     = this->trdid;
-
-#if DEBUG_SOCKET_CONNECT || DEBUG_SOCKET_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get pointers on file descriptor
-    xptr_t       file_xp  = process_fd_get_xptr_from_local( this->process , fdid );
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-    cxy_t        file_cxy = GET_CXY( file_xp );
-
-    // check file_xp
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : undefined fdid %d / thread[%x,%x] / cycle %d",
-__FUNCTION__, fdid, pid, trdid, cycle );
-#endif
-        return -1;
-    }
-
-    file_type  = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-    socket_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-    socket_xp  = XPTR( file_cxy , socket_ptr );
-
-#if DEBUG_SOCKET_CONNECT
-if( DEBUG_SOCKET_CONNECT < cycle )
-printk("\n[%s] thread[%x,%x] enter for socket[%x,%d] / addr %x / port %x / cycle %d\n",
-__FUNCTION__,  pid, trdid, pid, fdid, remote_addr, remote_port, cycle );
-#endif
-
-    // check file descriptor type
-    if( file_type != FILE_TYPE_SOCK )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal file type %s / thread[%x,%x] / cycle %d",
-__FUNCTION__, vfs_inode_type_str( file_type ), pid, trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // get relevant socket infos
-    socket_type   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->type ) );
-    socket_state  = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state ) );
-    local_addr    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->local_addr ) );
-    local_port    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->local_port ) );
-
-    if( socket_type == SOCK_DGRAM )       // UDP
-    {
-        if( socket_state != UDP_STATE_BOUND )
-        {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal socket state %s for type %s / thread[%x,%x] / cycle %d",
-__FUNCTION__, socket_state_str(socket_state), socket_type_str(socket_type), pid, trdid, cycle );
-#endif
-            return -1;
-        }
-    }
-    else if( socket_type == SOCK_STREAM )  // TCP
-    {
-        if( socket_state != TCP_STATE_BOUND )
-        {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal socket state %s for type %s / thread[%x,%x] / cycle %d",
-__FUNCTION__, socket_state_str(socket_state), socket_type_str(socket_type), pid, trdid, cycle );
-#endif
-            return -1;
-        }
-    }
-    else
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal socket type / thread[%x,%x] / cycle %d",
-__FUNCTION__, pid, trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // compute nic_channel index from remote_addr and remote_port
-    nic_channel = dev_nic_get_key( remote_addr , remote_port );
-
-    // link socket to chdev servers
-    socket_link_to_servers( XPTR( file_cxy , socket_ptr ), nic_channel );
-
-    // update the socket descriptor
-    hal_remote_s32( XPTR( file_cxy , &socket_ptr->remote_addr ) , remote_addr  );
-    hal_remote_s32( XPTR( file_cxy , &socket_ptr->remote_port ) , remote_port  );
-    hal_remote_s32( XPTR( file_cxy , &socket_ptr->nic_channel ) , nic_channel  );
-
-    // the actual connection mechanism depends on socket type
-    // UDP : client thread updates the local socket state without blocking
-    // TCP : client thread request TX server thread to start the 3 steps handshake
-
-    if( socket_type == SOCK_DGRAM )  // UDP
-    {
-        // directly update the local socket state
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->state ) , UDP_STATE_ESTAB );
-
-        return 0;
-    }
-    else                             // TCP
-    {
-        // get pointers on NIC_TX[channel] chdev
-        xptr_t    tx_chdev_xp  = chdev_dir.nic_tx[nic_channel];
-        chdev_t * tx_chdev_ptr = GET_PTR( tx_chdev_xp );
-        cxy_t     tx_chdev_cxy = GET_CXY( tx_chdev_xp );
-
-        // get pointers on NIC_TX[channel] server thread
-        tx_server_ptr = hal_remote_lpt( XPTR( tx_chdev_cxy , &tx_chdev_ptr->server ));
-        tx_server_xp  = XPTR( tx_chdev_cxy , tx_server_ptr );
-
-        // register command arguments in socket descriptor for a SYN segment
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_cmd    ), CMD_TX_CONNECT );
-        hal_remote_s64( XPTR( file_cxy , &socket_ptr->tx_client ), client_xp );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_valid  ), true );
-
-        // unblock NIC_TX server thread
-        thread_unblock( tx_server_xp , THREAD_BLOCKED_CLIENT );
- 
-        // start retransmission timer
-        alarm_start( client_xp,
-                     hal_get_cycles() + CONFIG_SOCK_RETRY_TIMEOUT,
-                     &socket_alarm_handler,
-                     socket_xp );
-
-#if DEBUG_SOCKET_CONNECT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_CONNECT < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] blocks on <IO> waiting connexion / cycle %d \n",
-__FUNCTION__, pid, trdid, pid, fdid, cycle );
-#endif
-        // block itself and deschedule
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_IO );
-        sched_yield( "waiting connection" );
-
-#if DEBUG_SOCKET_CONNECT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_CONNECT < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] / resumes / cycle %d \n",
-__FUNCTION__, pid, trdid, pid, fdid, cycle );
-#endif
-
-        // stop retransmission timer in thread descriptor
-        alarm_stop( client_xp );
-
-        // get socket state, tx_valid and tx_sts
-        cmd_valid    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_valid ));
-        cmd_status   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_sts ));
-        socket_state = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state ));
-
-assert( __FUNCTION__, (((socket_state == TCP_STATE_ESTAB) || (cmd_status != CMD_STS_SUCCESS))
-        && (cmd_valid == false)),
-"illegal socket state when client thread resumes after TX_CONNECT" );
-
-        // reset socket.tx_client
-        hal_remote_s64( XPTR( file_cxy , &socket_ptr->tx_client ) , XPTR_NULL );
-
-        if( cmd_status != CMD_STS_SUCCESS )
-        {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s reported by server / socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, pid, fdid, pid, trdid, cycle );
-#endif
-            return -1;
-        }
-        else
-        {
-
-#if DEBUG_SOCKET_CONNECT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_CONNECT < cycle )
-printk("\n[%s] thread[%x,%x] exit for socket[%x,%d] / %s / cycle %d \n",
-__FUNCTION__, pid, trdid, pid, fdid, socket_state_str(socket_state),cycle );
-#endif
-             return 0;
-        }
-    }  // end TCP
-
-}  // end socket_connect()
-
-///////////////////////////////////
-int socket_close( xptr_t   file_xp,
-                  uint32_t fdid )
-{
-    uint32_t     socket_type;
-    uint32_t     socket_state;
-    uint32_t     nic_channel;
-    uint32_t     cmd_status;      // socket.tx_sts
-    bool_t       cmd_valid;       // socket.tx_valid
-    thread_t   * tx_server_ptr;   // local pointer on NIC_TX server thread
-    xptr_t       tx_server_xp;    // extended pointer on NIC_TX server thread
-    xptr_t       socket_lock_xp;  // extended pointer on socket lock
-
-    thread_t   * this      = CURRENT_THREAD;
-    xptr_t       client_xp = XPTR( local_cxy , this );
-    pid_t        pid       = this->process->pid;
-    trdid_t      trdid     = this->trdid;
-
-#if DEBUG_SOCKET_CLOSE || DEBUG_SOCKET_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get pointers on socket descriptor
-    cxy_t        file_cxy   = GET_CXY( file_xp );
-    vfs_file_t * file_ptr   = GET_PTR( file_xp );
-    socket_t   * socket_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-    xptr_t       socket_xp  = XPTR( file_cxy , socket_ptr );
-
-assert( __FUNCTION__, (hal_remote_l32( XPTR( file_cxy , &socket_ptr->fdid )) == fdid),
-"unconsistent file_xp & fdid arguments");
-
-#if DEBUG_SOCKET_CLOSE
-if (DEBUG_SOCKET_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] enters for socket[%x,%d] / cycle %d\n",
-__FUNCTION__, pid, trdid, pid, fdid, cycle );
-#endif
-
-    // build extended pointer on lock protecting socket 
-    socket_lock_xp = XPTR( file_cxy , &socket_ptr->lock );
-
-    // take socket lock
-    remote_queuelock_acquire( socket_lock_xp );
-
-    // check no previous TX command
-    if( (hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_valid )) == true) || 
-        (hal_remote_l64( XPTR( file_cxy , &socket_ptr->tx_client)) != XPTR_NULL) )
-    { 
-                    
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : previous TX cmd on socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, pid, fdid, pid, trdid, cycle );
-#endif
-        remote_queuelock_release( socket_lock_xp );
-        return -1;
-    }
-
-    // get relevant socket infos
-    socket_type   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->type ));
-    nic_channel   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->nic_channel ));
-    socket_state  = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state ));
-
-
-    // the actual close mechanism depends on socket type and state:
-    // UDP or TCP not connected : client thread directly destroy the socket descriptor
-    // TCP connected : client thread request TX server thread to make the TCP close handshake
-
-    if( socket_type == SOCK_DGRAM )                   // UDP 
-    {
-
-#if DEBUG_SOCKET_CLOSE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] %s => directly destroy socket / cycle %d\n",
-__FUNCTION__, pid, trdid, pid, fdid, socket_state_str( socket_state ), cycle );
-#endif
-        // directly destroy socket
-        socket_destroy( file_xp );
-
-        return 0;
-    }
-    else if( (socket_state == TCP_STATE_BOUND) ||
-             (socket_state == TCP_STATE_LISTEN) ||
-             (socket_state == TCP_STATE_SYN_SENT) )   // TCP not connected
-    {
-
-#if DEBUG_SOCKET_CLOSE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_DEV_NIC_TX )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] %s => directly destroy socket / cycle %d\n",
-__FUNCTION__, pid, trdid, pid, fdid, socket_state_str( socket_state ), cycle );
-#endif
-        // directly destroy socket
-        socket_destroy( file_xp );
-
-        return 0;
-    }
-    else                                             // TCP connected
-    {
-        // get pointers on NIC_TX[index] chdev
-        xptr_t    tx_chdev_xp  = chdev_dir.nic_tx[nic_channel];
-        chdev_t * tx_chdev_ptr = GET_PTR( tx_chdev_xp );
-        cxy_t     tx_chdev_cxy = GET_CXY( tx_chdev_xp );
-
-        // get pointers on NIC_TX[channel] server thread
-        tx_server_ptr = hal_remote_lpt( XPTR( tx_chdev_cxy , &tx_chdev_ptr->server ));
-        tx_server_xp  = XPTR( tx_chdev_cxy , tx_server_ptr );
-
-        // register command arguments in socket descriptor
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_cmd    ), CMD_TX_CLOSE );
-        hal_remote_s64( XPTR( file_cxy , &socket_ptr->tx_client ), client_xp );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_valid  ), true );
-        
-        // release socket lock
-        remote_queuelock_release( socket_lock_xp );
-
-        // unblock NIC_TX server thread
-        thread_unblock( tx_server_xp , THREAD_BLOCKED_CLIENT );
-
-        // start retransmission timer
-        alarm_start( client_xp,
-                     hal_get_cycles() + CONFIG_SOCK_RETRY_TIMEOUT,
-                     &socket_alarm_handler,
-                     socket_xp );
-
-#if DEBUG_SOCKET_CLOSE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] %s => blocks on <IO> waiting close / cycle %d \n",
-__FUNCTION__, pid, trdid, pid, fdid, socket_state_str( socket_state ), cycle );
-#endif
-        // client thread block itself and deschedule
-        thread_block( client_xp , THREAD_BLOCKED_IO );
-        sched_yield( "blocked in close" );
-
-#if DEBUG_SOCKET_CLOSE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] / resumes / cycle %d \n",
-__FUNCTION__, pid, trdid, pid, fdid, cycle );
-#endif
-        // stop retransmission timer in thread descriptor
-        alarm_stop( client_xp );
-
-        // take socket lock
-        remote_queuelock_acquire( socket_lock_xp );
-
-        // get socket state & command status
-        socket_state = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state ) );
-        cmd_status   = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_sts) );
-        cmd_valid    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_valid ) );
-
-assert( __FUNCTION__,
-(((socket_state == TCP_STATE_CLOSED) || (cmd_status != CMD_STS_SUCCESS)) && (cmd_valid == false)),
-" socket_state = %s / cmd_status = %d / cmd_valid = %d",
-socket_state_str(socket_state), cmd_status, cmd_valid );
-
-        // reset socket.tx_client
-        hal_remote_s64( XPTR( file_cxy , &socket_ptr->tx_client ) , XPTR_NULL );
-
-        if( cmd_status != CMD_STS_SUCCESS )  // error reported
-        {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s for command TX_CLOSE / socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, pid, fdid, pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-        else                                 // success
-        {
-
-#if DEBUG_SOCKET_CLOSE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_CLOSE < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] / destroy socket / cycle %d\n",
-__FUNCTION__, pid, trdid, pid, fdid, socket_state_str(socket_state) , cycle );
-#endif
-            // destroy socket
-            socket_destroy( file_xp );
-
-            return 0;
-        }
-    }   // end if TCP
-}  // end socket_close()
-
-////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the two functions socket_send() & socket_recv().
-// It is used for both UDP and TCP sockets.
-////////////////////////////////////////////////////////////////////////////////////////
-// @ is_send   : send when true / receive when false.
-// @ fdid      : socket identifier.
-// @ u_buf     : pointer on user buffer in user space.
-// @ length    : number of bytes in buffer.
-////////////////////////////////////////////////////////////////////////////////////////
-// Implementation note : The behavior is different for SEND & RECV
-// - For a SEND, the client thread checks that there is no TX command registered
-//   in the socket. It registers the command arguments in the socket descriptor
-//   (tx_client, tx_cmd, tx_buf, tx_len). Then the client thread unblocks the 
-//   TX server thread from the BLOCKED_CLIENT condition, blocks itself on the
-//   BLOCKED_IO condition, and deschedules. It is unblocked by the TX server thread
-//   when the last byte has been sent (for UDP) or acknowledged (for TCP).
-//   When the client thread resumes, it reset the command in socket, and returns.
-// - For a RECV, the client thread checks that there is no RX command registered
-//   in the socket. It registers itself in socket (rx_client). It checks the status
-//   of the receive buffer. It the rx_buf is empty, it blocks on the BLOCKED_IO
-//   condition, and deschedules. It is unblocked by the RX server thread when an UDP
-//   packet or TCP segment has been writen in the rx_buf. When it resumes, it moves
-//   the available data from the rx_buf to the user buffer, reset its registration
-//   in socket (reset the rx_buf for an UDP socket), and returns.
-////////////////////////////////////////////////////////////////////////////////////////
-int socket_move_data( bool_t     is_send,
-                      uint32_t   fdid,
-                      uint8_t  * u_buf,
-                      uint32_t   length )
-{
-    vfs_file_type_t    file_type;       // file descriptor type
-    xptr_t              socket_xp;       // extended pointer on socket descriptor
-    socket_t          * socket_ptr;      // local pointer on socket descriptor
-    uint32_t            socket_state;    // current socket state
-    uint32_t            socket_type;     // socket type (UDP/TCP)
-    uint32_t            nic_channel;     // NIC channel for this socket
-    xptr_t              socket_lock_xp;  // extended pointer on socket lock
-    xptr_t              file_xp;         // extended pointer on file descriptor
-    vfs_file_t        * file_ptr;
-    cxy_t               file_cxy;
-    xptr_t              chdev_xp;        // extended pointer on NIC_TX[channel] chdev
-    chdev_t           * chdev_ptr;
-    cxy_t               chdev_cxy;
-    int32_t             moved_bytes;     // total number of moved bytes (fot return)
-    xptr_t              server_xp;       // ext pointer on NIC_TX / NIC_RX thread
-    thread_t          * server_ptr;      // local pointer on NIC_TX / NIC_RX thread
-    uint8_t           * tx_buf;          // pointer on kernel buffer for TX transfer
-    bool_t              cmd_valid;       // RX or TX command from socket descriptor
-    uint32_t            cmd_sts;         // RX or TX command from socket descriptor
-    uint32_t            tx_todo;         // number of bytes still to send
-    xptr_t              rx_buf_xp;       // extended pointer on socket rx_buf
-    uint32_t            rx_buf_sts;      // current status of socket rx_buf
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SOCKET_SEND || DEBUG_SOCKET_RECV || DEBUG_SOCKET_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_SOCKET_SEND || DEBUG_SOCKET_RECV 
-if( is_send )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] enter : SEND / buf %x / length %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, u_buf, length, cycle );
-else
-printk("\n[%s] thread[%x,%x] socket[%x,%d] enter : RECV / buf %x / length %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, u_buf, length, cycle );
-#endif
-
-    // build extended pointer on client thread
-    xptr_t client_xp = XPTR( local_cxy , this );
-
-    // get pointers on file descriptor identifying the socket
-    file_xp  = process_fd_get_xptr_from_local( process , fdid );
-    file_ptr = GET_PTR( file_xp );
-    file_cxy = GET_CXY( file_xp );
-
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : undefined fdid %d / thread%x,%x] / cycle %d\n",
-__FUNCTION__, fdid , process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
- 
-    // get file type and socket pointer
-    file_type  = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-
-    // get pointers on socket
-    socket_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-    socket_xp  = XPTR( file_cxy , socket_ptr );
-
-    // check file descriptor type
-    if( file_type != FILE_TYPE_SOCK )
-    {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : illegal file type thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // build extended pointer on lock protecting socket 
-    socket_lock_xp = XPTR( file_cxy , &socket_ptr->lock );
-
-    // take the socket lock
-    remote_queuelock_acquire( socket_lock_xp );
-
-    // get socket type, state, and channel
-    socket_type  = hal_remote_l32( XPTR( file_cxy , &socket_ptr->type ));
-    socket_state = hal_remote_l32( XPTR( file_cxy , &socket_ptr->state ));
-    nic_channel  = hal_remote_l32( XPTR( file_cxy , &socket_ptr->nic_channel ));
-
-    //////////////////////////////////////////////////////
-    if( is_send )                       // SEND command
-    {
-
-#if DEBUG_SOCKET_SEND
-cycle = (uint32_t)hal_get_cycles();
-if (DEBUG_SOCKET_SEND < cycle )
-printk("\n[%s] thread[%x,%x] / socket[%x,%d] get SEND / length %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, length, cycle );
-#endif
-
-        // check no previous TX command
-        if( hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_valid )) == true ) 
-        { 
-                    
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : previous TX command / socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-            remote_queuelock_release( socket_lock_xp );
-            return -1;
-        }
-
-        // get tx_buf pointer from socket pointer
-        tx_buf = (uint8_t*)hal_remote_lpt( XPTR( file_cxy , &socket_ptr->tx_buf ));
-
-        // copy data from user u_buf to kernel socket tx_buf   
-        hal_copy_from_uspace( XPTR( file_cxy , tx_buf ),
-                              u_buf,
-                              length );
-#if DEBUG_SOCKET_SEND
-if (DEBUG_SOCKET_SEND < cycle )
-printk("\n[%s] thread[%x,%x] / socket[%x,%d] copied %d bytes to tx_buf (%x,%x)\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, length, file_cxy, tx_buf );
-putb("tx_buf : 16 first data bytes" , tx_buf , 16 ); 
-#endif
-
-        // register command in socket descriptor
-        hal_remote_s64( XPTR( file_cxy , &socket_ptr->tx_client ) , client_xp );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_cmd    ) , CMD_TX_SEND );
-        hal_remote_spt( XPTR( file_cxy , &socket_ptr->tx_buf    ) , tx_buf );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_len    ) , length );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_todo   ) , length );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_ack    ) , 0 );
-        hal_remote_s32( XPTR( file_cxy , &socket_ptr->tx_valid  ) , true );
-
-        // release socket lock
-        remote_queuelock_release( socket_lock_xp );
-                    
-        // get pointers on relevant chdev
-        chdev_xp  = chdev_dir.nic_tx[nic_channel];
-        chdev_ptr = GET_PTR( chdev_xp );
-        chdev_cxy = GET_CXY( chdev_xp );
-
-        // get pointers on NIC_TX[channel] server thread
-        server_ptr = hal_remote_lpt( XPTR( chdev_cxy , &chdev_ptr->server ));
-        server_xp  = XPTR( chdev_cxy , server_ptr );
-
-        // unblocks the NIC_TX server thread
-        thread_unblock( server_xp , THREAD_BLOCKED_CLIENT );
-
-        // start retransmission timer for TCP socket
-        if( socket_type == SOCK_STREAM )  
-        {
-            alarm_start( client_xp,
-                         hal_get_cycles() + CONFIG_SOCK_RETRY_TIMEOUT,
-                         &socket_alarm_handler,
-                         socket_xp );
-        }
-
-#if DEBUG_SOCKET_SEND   
-if( DEBUG_SOCKET_SEND < cycle )
-printk("\n[%s] thread[%x,%x] / socket[%x,%d] registers SEND => blocks on <IO>\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid );
-#endif
-        // client thread blocks itself and deschedules
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_IO );
-        sched_yield( "blocked in nic_io" );
-
-#if DEBUG_SOCKET_SEND   
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_SEND < cycle )
-printk("\n[%s] thread[%x,%x] / socket[%x,%d] resumes for SEND / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, cycle );
-#endif
-        // stop retransmission timer for TCP socket
-        if( socket_type == SOCK_STREAM )
-        {
-            alarm_stop( client_xp );
-        }
-
-        // take socket lock 
-        remote_queuelock_acquire( socket_lock_xp );
-      
-        // get tx_valid, tx_todo, and tx_sts
-        tx_todo    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_todo ));
-        cmd_valid  = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_valid ));
-        cmd_sts    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->tx_sts ));
-
-        // reset tx_client in socket descriptor
-        hal_remote_s64( XPTR( file_cxy , &socket_ptr->tx_client  ) , XPTR_NULL );
-
-        // release socket lock
-        remote_queuelock_release( socket_lock_xp );
-      
-// check SEND command completed when TX client thread resumes
-assert( __FUNCTION__, 
-(((tx_todo == 0) || (cmd_sts != CMD_STS_SUCCESS)) && (cmd_valid == false)),
-"client thread resumes from SEND / bad state : tx_todo %d / tx_sts %d / tx_valid %d",
-tx_todo, cmd_sts, cmd_valid );
-
-        if( cmd_sts != CMD_STS_SUCCESS )
-        {
-
-#if DEBUG_SOCKET_ERROR    
-printk("\n[ERROR] in %s : reported for SEND / socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-        else
-        {
-
-#if DEBUG_SOCKET_SEND
-cycle = (uint32_t)hal_get_cycles();
-if (DEBUG_SOCKET_SEND < cycle )
-printk("\n[%s] thread[%x,%x] SEND success / socket[%x,%d] / bytes %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, length, cycle );
-#endif
-            return length;
-        }
-
-    }  // end SEND command
-
-    /////////////////////////////////////////////////////////////
-    else                                       // RECV command
-    {
-
-#if DEBUG_SOCKET_RECV
-if (DEBUG_SOCKET_RECV < cycle )
-printk("\n[%s] thread[%x,%x] / socket[%x,%d] get RECV / length %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, length, cycle );
-#endif
-        // check no previous RX command
-        if( hal_remote_l32( XPTR( file_cxy , &socket_ptr->rx_valid )) == true )
-        {
-                    
-#if DEBUG_SOCKET_ERROR    
-printk("\n[ERROR] in %s : previous RX command on socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-            remote_queuelock_release( socket_lock_xp );
-            return -1;
-        }
-
-        // return EOF for a TCP socket not in ESTAB state
-        if( (socket_type == SOCK_STREAM ) && (socket_state != TCP_STATE_ESTAB) )
-        { 
-            // release socket lock
-            remote_queuelock_release( socket_lock_xp );
-                    
-#if DEBUG_SOCKET_RECV  
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_RECV < cycle )
-printk("\n[%s] thread[%x,%x] / socket[%x,%d] TCP connection closed / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, cycle );
-#endif
-            return 0;
-        }
-
-        // build extended pointer on socket rx_buf
-        rx_buf_xp = XPTR( file_cxy , &socket_ptr->rx_buf );
-
-        // get socket rx_buf status
-        rx_buf_sts = remote_buf_status( rx_buf_xp );
-
-        // register RECV command and deschedule when rx_buf empty
-        if( rx_buf_sts == 0 )
-        {
-            // registers RX_RECV command in socket descriptor
-            hal_remote_s32( XPTR( file_cxy , &socket_ptr->rx_cmd    ) , CMD_RX_RECV );
-            hal_remote_s64( XPTR( file_cxy , &socket_ptr->rx_client ) , client_xp );
-            hal_remote_s32( XPTR( file_cxy , &socket_ptr->rx_valid  ) , true );
-
-            // release socket lock
-            remote_queuelock_release( socket_lock_xp );
-
-#if DEBUG_SOCKET_RECV  
-if( DEBUG_SOCKET_RECV < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] for RECV : rx_buf empty => blocks on <IO>\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid );
-#endif
-            // client thread blocks itself and deschedules
-            thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_IO );
-            sched_yield( "blocked in nic_io" );
-
-#if DEBUG_SOCKET_RECV  
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SOCKET_RECV < cycle )
-printk("\n[%s] thread[%x,%x] socket[%x,%d] for RECV : resumes / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, cycle );
-#endif
-            // take socket lock
-            remote_queuelock_acquire( socket_lock_xp );
-
-            // get command status, command valid, and rx_buf status
-            cmd_valid  = hal_remote_l32( XPTR( file_cxy , &socket_ptr->rx_valid ));
-            cmd_sts    = hal_remote_l32( XPTR( file_cxy , &socket_ptr->rx_sts ));
-            rx_buf_sts = remote_buf_status( rx_buf_xp );
-        
-assert( __FUNCTION__, (cmd_valid == false),
-"client thread resumes from RECV but rx_valid is true" );
-
-            if( cmd_sts == CMD_STS_EOF )           // EOF reported by RX server
-            {
-
-#if DEBUG_SOCKET_RECV
-if( DEBUG_SOCKET_RECV < cycle )
-printk("\n[%s] EOF received for socket[%x,%d] / thread[%x,%x]\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid );
-#endif
-                // release socket lock
-                remote_queuelock_release( socket_lock_xp );
-
-                return 0;
-            }
-            else if( cmd_sts != CMD_STS_SUCCESS )   // error reported by RX server
-            {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : rx_server for socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-                // release socket lock
-                remote_queuelock_release( socket_lock_xp );
-
-                return -1;
-            }
-            else if( rx_buf_sts == 0 )              // annormally empty rx_buf
-            {
-
-#if DEBUG_SOCKET_ERROR
-printk("\n[ERROR] in %s : rx_buf empty for socket[%x,%d] / thread[%x,%x] / cycle %d\n",
-__FUNCTION__, process->pid, fdid, process->pid, this->trdid, cycle );
-#endif
-                // release socket lock
-                remote_queuelock_release( socket_lock_xp );
-
-                return -1;
-            }
-        }
-
-        // number of bytes extracted from rx_buf cannot be larger than u_buf size
-        moved_bytes = ( length < rx_buf_sts ) ? length : rx_buf_sts;
-
-        // move data from kernel rx_buf to user u_buf
-        remote_buf_get_to_user( rx_buf_xp,
-                                u_buf,
-                                moved_bytes );
-#if DEBUG_SOCKET_RECV
-cycle = (uint32_t)hal_get_cycles();
-if (DEBUG_SOCKET_RECV < cycle )
-printk("\n[%s] thread[%x,%x] : RECV success / socket[%x,%d] / bytes %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, fdid, moved_bytes, cycle );
-#endif
-        // release socket lock
-        remote_queuelock_release( socket_lock_xp );
-
-        return moved_bytes;
-
-    }  // end RECV command
-} // end socket_move_data()
-
-///////////////////////////////////
-int socket_send( uint32_t    fdid,
-                 uint8_t   * u_buf,
-                 uint32_t    length )
-{
-    return socket_move_data( true,           // SEND
-                             fdid,
-                             u_buf,
-                             length );
-}  // end socket_send()
-
-///////////////////////////////////
-int socket_recv( uint32_t    fdid,
-                 uint8_t   * u_buf,
-                 uint32_t    length )
-{
-    return socket_move_data( false,          // RECV
-                             fdid,
-                             u_buf,
-                             length );
-} // end socket_recv()
-
-////////////////////////////////////
-int socket_sendto( uint32_t    fdid,
-                   uint8_t   * u_buf,
-                   uint32_t    length,
-                   uint32_t    remote_ip,
-                   uint16_t    remote_port )
-{
-    printk("\n[ERROR] in %s : this function is not implemented yet\n",
-    __FUNCTION__, fdid, u_buf, length, remote_ip, remote_port );
-    return -1;
-
-}  // end socket_sendto()
-
-//////////////////////////////////////
-int socket_recvfrom( uint32_t    fdid,
-                     uint8_t   * u_buf,
-                     uint32_t    length,
-                     uint32_t    remote_ip,
-                     uint16_t    remote_port )
-{
-    printk("\n[ERROR] in %s : this function is not implemented yet\n", 
-    __FUNCTION__, fdid, u_buf, length, remote_ip, remote_port );
-    return -1;
-
-} // end socket_recvfrom()
-
-////////////////////////////////////////////
-void socket_display( xptr_t       socket_xp,
-                     const char * func_str,
-                     const char * string )
-{
-    uint32_t   cycle = (uint32_t)hal_get_cycles();
-
-    socket_t * socket = GET_PTR( socket_xp );
-    cxy_t      cxy    = GET_CXY( socket_xp );
-
-    pid_t      pid         = hal_remote_l32( XPTR( cxy , &socket->pid ));
-    fdid_t     fdid        = hal_remote_l32( XPTR( cxy , &socket->fdid ));
-    uint32_t   state       = hal_remote_l32( XPTR( cxy , &socket->state ));
-    uint32_t   channel     = hal_remote_l32( XPTR( cxy , &socket->nic_channel ));
-    uint32_t   local_addr  = hal_remote_l32( XPTR( cxy , &socket->local_addr ));
-    uint32_t   local_port  = hal_remote_l32( XPTR( cxy , &socket->local_port ));
-    uint32_t   remote_addr = hal_remote_l32( XPTR( cxy , &socket->remote_addr ));
-    uint32_t   remote_port = hal_remote_l32( XPTR( cxy , &socket->remote_port ));
-    uint32_t   tx_valid    = hal_remote_l32( XPTR( cxy , &socket->tx_valid ));
-    xptr_t     tx_client   = hal_remote_l64( XPTR( cxy , &socket->tx_client ));
-    uint32_t   tx_cmd      = hal_remote_l32( XPTR( cxy , &socket->tx_cmd ));
-    uint32_t   tx_sts      = hal_remote_l32( XPTR( cxy , &socket->tx_sts ));
-    uint32_t   tx_len      = hal_remote_l32( XPTR( cxy , &socket->tx_len ));
-    uint32_t   tx_todo     = hal_remote_l32( XPTR( cxy , &socket->tx_todo ));
-    uint32_t   tx_una      = hal_remote_l32( XPTR( cxy , &socket->tx_una ));          
-    uint32_t   tx_nxt      = hal_remote_l32( XPTR( cxy , &socket->tx_nxt ));          
-    uint32_t   tx_wnd      = hal_remote_l32( XPTR( cxy , &socket->tx_wnd ));          
-    uint32_t   tx_ack      = hal_remote_l32( XPTR( cxy , &socket->tx_ack ));          
-    uint32_t   rx_valid    = hal_remote_l32( XPTR( cxy , &socket->rx_valid ));
-    xptr_t     rx_client   = hal_remote_l64( XPTR( cxy , &socket->rx_client ));
-    uint32_t   rx_cmd      = hal_remote_l32( XPTR( cxy , &socket->rx_cmd ));
-    uint32_t   rx_sts      = hal_remote_l32( XPTR( cxy , &socket->rx_sts ));
-    uint32_t   rx_nxt      = hal_remote_l32( XPTR( cxy , &socket->rx_nxt ));          
-    uint32_t   rx_wnd      = hal_remote_l32( XPTR( cxy , &socket->rx_wnd ));          
-    uint32_t   rx_irs      = hal_remote_l32( XPTR( cxy , &socket->rx_irs ));  
-
-    remote_queuelock_t * lock_ptr = &socket->lock;  
-    uint32_t   taken       = hal_remote_l32( XPTR( cxy , &lock_ptr->taken ));
-
-    thread_t * tx_ptr = GET_PTR( tx_client );
-    cxy_t      tx_cxy = GET_CXY( tx_client );
-    trdid_t    tx_tid = hal_remote_l32( XPTR( tx_cxy , &tx_ptr->trdid ));
-
-    thread_t * rx_ptr = GET_PTR( rx_client );
-    cxy_t      rx_cxy = GET_CXY( rx_client );
-    trdid_t    rx_tid = hal_remote_l32( XPTR( rx_cxy , &rx_ptr->trdid ));
-
-    if( string == NULL )
-    {
-        printk("\n****** socket[%x,%d] / lock %d / in %s / cycle %d *****\n",
-        pid, fdid, taken, func_str, cycle );
-    }
-    else
-    {
-        printk("\n***** socket[%x,%d] / lock %d / in %s %s / cycle %d *****\n",
-        pid, fdid, taken, func_str, string, cycle );
-    }
-    printk(" - state %s / channel %d / local [%x,%x] / remote[%x,%x]\n"
-           " - tx : valid %d / client [%x,%x] / cmd %s \n"
-           "        sts %d / len %x / todo %x / ack %x / una %x / nxt %x / wnd %x\n"
-           " - rx : valid %d / client [%x,%x] / cmd %s\n"
-           "        sts %d / nxt %x / wnd %x / irs %x\n",
-           socket_state_str(state), channel, 
-           local_addr, local_port, remote_addr, remote_port,
-           tx_valid, pid, tx_tid, socket_cmd_type_str(tx_cmd),
-           tx_sts, tx_len, tx_todo, tx_ack, tx_una, tx_nxt, tx_wnd,
-           rx_valid, pid, rx_tid, socket_cmd_type_str(rx_cmd),
-           rx_sts, rx_nxt, rx_wnd, rx_irs );
-
-}  // end socket_display()
-
-
-
-
-
Index: trunk/kernel/kern/ksocket.h
===================================================================
--- trunk/kernel/kern/ksocket.h	(revision 690)
+++ 	(revision )
@@ -1,678 +1,0 @@
-/*
- * ksocket.h - kernel socket definition.
- * 
- * Authors  Alain Greiner    (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _KSOCKET_H_
-#define _KSOCKET_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <xlist.h>
-#include <remote_buf.h>
-#include <remote_busylock.h>
-
-/***************************************************************************************** 
- * This structure defines a kernel socket descriptor, used for both UDP or TCP sockets.
- * A socket is a private resource used by a most two user threads : one TX client
- * thread to send packets, and one RX client thread, to receive packets. The TX client
- * thread and the RX client thread can be the same thread.
- * 
- * When the Network Interface Controller contains several channels, the set of all
- * existing sockets is split in as many subsets as the number of NIC channels, in order
- * to parallelize the transfers. The distribution key defining the channel index
- * is computed from the (remote_addr/remote_port) couple (by the NIC hardware for the
- * RX packets; by the software for the TX packets) using a dedicated NIC driver function.
- * All sockets that have the same key share the same channel, and each socket is
- * therefore linked to two chdevs : NIC_TX[key] & NIC_RX[key].
- * The socket allows the NIC-TX and NIC_RX server threads to access various buffers:
- * - the kernel "tx_buf" buffer contains the data to be send by the TX server thread.
- *   It is dynamically allocated, and used as retransmission buffer when required.
- * - the kernel "rx_buf" buffer contains the data received by the RX server thread.
- *   It is allocated in socket and handled as a single writer / single reader FIFO.
- * - the kernel "r2t" buffer allows the RX server thread to make direct requests
- *   to the associated TX server (mainly used to handle the TCP ACKs).
- * - the kernel "crq" buffer allows to store concurrent remote client connect requests
- *   to a local server socket. 
- *
- * The synchronisation mechanism between the client threads and the server threads
- * is different for the TX and RX directions:
- *
- * 1) TX direction (sent packets)
- *
- * - The internal API between the TX client thread and the NIC_TX server thread defines 
- *   four command types, stored in the "tx_cmd" variable of the socket descriptor:
- *   . SOCKET_TX_CONNECT : request to start the connection handshake (TCP client only).
- *   . SOCKET_TX_ACCEPT  : request to accept one connection request (TCP server only). 
- *   . SOCKET_TX_SEND    : local (UDP/TCP) request to send data to a remote (UDP/TCP).
- *   . SOCKET_TX_CLOSE   : local TCP socket request remote TCP socket to close connection.
- * - All commands are blocking for the TX client thread: to make a command, the TX client 
- *   registers the command type in the socket "tx_cmd",field, set the "tx_valid" field,
- *   reset the "tx_error" field, and registers itself in the "tx_client" field.
- *   Then, it unblocks the TX server thread from the BLOCKED_CLIENT condition, blocks itself 
- *   on the BLOCKED_IO condition, and deschedules. For a SEND, the client thread copies
- *   the payload contained in the "u_buf" user buffer to the socket "tx_buf" kernel buffer 
- *   that is used as retransmission buffer, when required.
- * - A command is valid for the TX server when the socket descriptor "tx_valid" is true.
- *   For a SEND command, the "tx_valid" is reset by the NIC_TX server thread when the last
- *   byte has been sent, but the TX client thread is unblocked by the NIC_RX server thread
- *   only when the last byte has been acknowledged, or to report an error.
- *   For the CONNECT, ACCEPT and CLOSE commands, the "tx_valid" is reset by the NIC_TX server
- *   when the first segment of the handshake has been sent, but the TX client thread is 
- *   unblocked by the NIC_RX server thread only when the handshake is actually completed.
- *   The TX server thread is acting as a multiplexer. It scans the list of attached sockets,
- *   to sequencially handle the valid commands: one UDP packet or TCP segment per iteration.
- *   The TX server blocks and deschedules on the BLOCKED_CLIENT condition when there is
- *   no more valid TX command or R2T request registered in any socket. It is unblocked 
- *   from BLOCKED_CLIENT by a client thread registering a TX command, or by the RX server
- *   thread registering a R2T request. The TX server thread signals an error to the TX client
- *   thread using the "tx_error" field in socket descriptor.
- *   When "tx_valid" or "r2t_valid" are true, the TX server thread build and send an UDP
- *   packet or TCP segment. A single SEND command can require a large number of TCP
- *   segments to move a big data buffer, before unblocking the client thread. 
- *   This TX server thread blocks and deschedules on the BLOCKED_ISR condition when there 
- *   the NIC_RX queue is full . It is unblocked by the hardware NIC_TX_ISR. 
- * - As multiple simultaneous TX accesses to the same socket are forbiden, the client
- *   thread makes a double check before posting a new TX command :
- *   the "tx_valid" field must be false, and the "tx_client" field must be XPTR_NULL.
- *   The "tx_valid" field is reset by the TX server thread, and the "tx_client"
- *   field is reset by the TX client thread itself, when it resumes after a TX command. 
- *   . For a SEND command on an UDP socket, the TX server thread reset "tx_valid" and
- *     unblocks the TX client thread as soon as the last data byte has been sent.
- *   . For a SEND command on a TCP socket, the TX server thread reset "tx_valid" when the 
- *     last data byte has been sent, but the TX client thread is unblocked by the TX server
- *     only when the last data byte has been acknowledged by the remote socket. 
- *   . For the CONNECT or ACCEPT commands, the "tx_valid" flag is reset and the TX client
- *     thread is unblocked by the RX server thread only when the command is completed, 
- *     and the local TCP socket is actually in the ESTAB state.
- *   . For a CLOSE command, the "tx_valid" flag is reset, and the TX client thread is
- *     unblocked by the RX server thread only when the remote socket is disconnected.
- *
- * 2) RX stream
- *
- * - The internal API between the RX client thread and the RX server thread defines two 
- *   command types stored in the rx_cmd variable of the socket descriptor:
- *   . SOCKET_RX_ACCEPT : TCP server request a connection request from CRQ queue.
- *   . SOCKET_RX_RECV   : local (UDP/TCP) socket expect data from a remote (UDP/TCP).
- *   For the RECV command the communication is done through the "rx_buf" buffer,
- *   attached to the socket, and handled as a single-writer / single reader-FIFO.
- *   For the ACCEPT command the communication is done through the CRQ buffer, attached
- *   to the socket, and handled as a single-writer / single reader-FIFO.
- *   These two commands are blocking for the RX client thread as long as the buffer is
- *   empty. The client thread set the socket "rx_valid" field, reset the "rx_error" field,
- *   registers itself in the "rx_client" field, and  blocks on the BLOCKED_IO condition.
- * - The RX server thread is acting as a demultiplexor: it handle one received TCP segment,
- *   or UDP packet per iteration in the loop on the NIC_RX queue, and moves the data to
- *   the relevant buffer of the socket matching the packet. It discard packets that don't
- *   match a registered socket. When a client thread is registered in the socket descriptor,
- *   the RX server thread reset the "rx_valid" field and unblocks the RX client thread from
- *   the BLOCKED_IO condition as soon as there is data available in the "rx_buf". 
- *   This RX server thread blocks and deschedules on the BLOCKED_ISR condition when there 
- *   is no more packets in the NIC_RX queue. It is unblocked by the hardware NIC_RX_ISR. 
- * - In order to detect and report error for multiple simultaneous RX accesses to the same
- *   socket, the RX client thread makes a double check before posting a new RX command :
- *   the "rx_valid" field must be false, and the "rx_client" field must be XPTR_NULL.
- *   The "rx_valid" field is reset by the RX server thread, and the "rx_client"
- *   field is reset by the RX client thread itself, when it resumes after an RX command. 
- *
- * 3) R2T queue
- *
- * The RX server thread can directly request the associated TX server thread to send 
- * control packets in  the TX stream, using a dedicate R2T (RX to TX) queue embedded in 
- * the socket descriptor, and implemented as a remote_buf_t FIFO.
- * It is used for TCP acknowledge and for the TCP three-steps handshake.
- * Each R2T request occupy exactly one single byte defining the TCP flags to be set.
- *
- * 4) CRQ queue
- *
- * The remote CONNECT requests received by a TCP socket (SYN segments) are stored in a
- * dedicated CRQ queue, and consumed  by the local client thread executing an ACCEPT.
- * This CRQ queue is embedded in the local socket descriptor,  and implemented as a
- * remote_buf_t FIFO. Each request occupy sizeof(connect_request_t) bytes in the queue.
- * The connect_request_t structure containing the request arguments is defined below.
- *
- * Note : the socket domains and types are defined in the "shared_socket.h" file.
- ****************************************************************************************/
-
-/***************************************************************************************** 
- * This enum defines the set of commands that can be registered in the socket
- * by the TX & RX client threads to be executed by the NIC_TX & NIC_TX server threads.
- ****************************************************************************************/
-typedef enum socket_cmd_type_e
-{
-    CMD_TX_CONNECT      = 20,         /*! request a SYN segment     (TCP only)          */
-    CMD_TX_ACCEPT       = 21,         /*! request a SYN-ACK segment (TCP only)          */
-    CMD_TX_CLOSE        = 22,         /*! request a RST segment     (TCP only)          */
-    CMD_TX_SEND         = 23,         /*! request to send data      (TCP or UDP)        */
-
-    CMD_RX_ACCEPT       = 30,         /*! wait request from CRQ     (TCP only)          */ 
-    CMD_RX_RECV         = 31,         /*! wait DATA from rx_buf     (TCP or UDP)        */
-}
-socket_cmd_type_t;
-
-/***************************************************************************************** 
- * This enum defines the set of command status that can be returned by the NIC_RX and
- * NIC_TX server threads to the TX & RX client threads.
- ****************************************************************************************/
-typedef enum socket_cmd_sts_e
-{
-    CMD_STS_SUCCESS     =  0,
-    CMD_STS_EOF         =  1,
-    CMD_STS_RST         =  2,
-    CMD_STS_BADACK      =  3,
-    CMD_STS_BADSTATE    =  4,
-    CMD_STS_BADCMD      =  5,
-}
-socket_cmd_sts_t;
-
-/***************************************************************************************** 
- * This enum defines the set of tates for an UDP socket.
- ****************************************************************************************/
-typedef enum udp_socket_state_e
-{
-    UDP_STATE_UNBOUND    = 0x00,
-    UDP_STATE_BOUND      = 0x01,
-    UDP_STATE_ESTAB      = 0x02,
-}
-udp_socket_state_t;
-
-/***************************************************************************************** 
- * This enum defines the set of tates for an TCP socket.
- ****************************************************************************************/
-typedef enum tcp_socket_state_e
-{
-    TCP_STATE_UNBOUND    = 0x10,
-    TCP_STATE_BOUND      = 0x11,
-    TCP_STATE_LISTEN     = 0x12,
-    TCP_STATE_SYN_SENT   = 0x13,
-    TCP_STATE_SYN_RCVD   = 0x14,
-    TCP_STATE_ESTAB      = 0x15,
-    TCP_STATE_FIN_WAIT1  = 0x16,
-    TCP_STATE_FIN_WAIT2  = 0x17,
-    TCP_STATE_CLOSING    = 0x18,
-    TCP_STATE_TIME_WAIT  = 0x19,
-    TCP_STATE_CLOSE_WAIT = 0x1A,
-    TCP_STATE_LAST_ACK   = 0x1B,
-    TCP_STATE_CLOSED     = 0x1C,
-}
-tcp_socket_state_t;
-
-/**************************************************************************************** 
- * This structure defines one connection request, registered in the CRQ queue.
- ***************************************************************************************/
-typedef struct connect_request_s
-{
-    uint32_t          addr;          /* requesting socket IP address                   */
-    uint32_t          port;          /* requesting socket port number                  */
-    uint32_t          iss;           /* requesting socket initial sequence number      */
-    uint32_t          window;        /* requesting socket receive window               */
-}         
-connect_request_t;
-
-/**************************************************************************************** 
- * This structure defines the socket descriptor.
- ***************************************************************************************/
-typedef struct socket_s
-{
-    remote_queuelock_t lock;         /*! lock protecting socket state                  */
-    pid_t              pid;          /*! owner process identifier                      */
-    uint32_t           fdid;         /*! associated file descriptor index              */
-    uint32_t           domain;       /*! domain : AF_LOCAL / AF_INET                   */
-    uint32_t           type;         /*! type : SOCK_DGRAM / SOCK_STREAM               */
-    uint32_t           state;        /*! socket state (see above)                      */
-    uint32_t           local_addr;   /*! local  socket IP address                      */
-    uint32_t           remote_addr;  /*! remote socket IP address                      */
-    uint32_t           local_port;   /*! local  socket port number                     */
-    uint32_t           remote_port;  /*! remote socket port number                     */
-    uint32_t           nic_channel;  /*! derived from (remote_addr,remote_port)        */
-
-    xlist_entry_t      tx_list;      /*! all sockets attached to same NIC_TX channel   */
-    xptr_t             tx_client;    /*! extended pointer on current TX client thread  */
-    bool_t             tx_valid;     /*! TX command valid                              */
-    socket_cmd_type_t  tx_cmd;       /*! TX command (CONNECT / ACCEPT / SEND / CLOSE)  */
-    uint32_t           tx_sts;       /*! signal a TX command success / failure         */
-    uint8_t         *  tx_buf;       /*! pointer on TX data buffer in kernel space     */
-    uint32_t           tx_len;       /*! number of data bytes for a SEND command       */
-    uint32_t           tx_todo;      /*! number of bytes not yet sent in tx_buf        */
-    uint32_t           tx_ack;       /*! number of bytes acknowledged in tx_buf        */
-
-    xlist_entry_t      rx_list;      /*! all sockets attached to same NIC_RX channel   */
-    xptr_t             rx_client;    /*! extended pointer on current RX client thread  */
-    bool_t             rx_valid;     /*! RX command valid                              */
-    socket_cmd_type_t  rx_cmd;       /*! RX command ( ACCEPT / RECV )                  */
-    uint32_t           rx_sts;       /*! signal a RX command success / failure         */
-    remote_buf_t       rx_buf;       /*! embedded receive buffer descriptor            */
-
-    remote_buf_t       r2tq;         /*! RX_to_TX requests queue descriptor            */
-    remote_buf_t       crqq;         /*! connection requests queue descriptor          */
-
-    /* the following fields defines the TCB (only used for a TCP connection)           */
-
-    uint32_t           tx_nxt;       /*! next byte to send in TX_data stream           */
-    uint32_t           tx_wnd;       /*! number of acceptable bytes in TX_data stream  */
-    uint32_t           tx_una;       /*! first unack byte in TX_data stream            */
-
-    uint32_t           rx_nxt;       /*! next expected byte in RX_data stream          */
-    uint32_t           rx_wnd;       /*! number of acceptable bytes in RX_data stream  */
-    uint32_t           rx_irs;       /*! initial sequence number in RX_data stream     */
-}
-socket_t;
-
-/****************************************************************************************
- * This function returns a printable string for a socket domain.
- ****************************************************************************************
- * domain   :  AF_INET / AF_LOCAL 
- ***************************************************************************************/
-char * socket_domain_str( uint32_t domain );
-
-/****************************************************************************************
- * This function returns a printable string for a socket type.
- ****************************************************************************************
- * type   :  SOCK_DGRAM / SOCK_STREAM
- ***************************************************************************************/
-char * socket_type_str( uint32_t type );
-
-/****************************************************************************************
- * This function returns a printable string for an UDP or TCP socket state.
- ****************************************************************************************
- * state  :  UDP_STATE_*** / TCP_STATE*** 
- ***************************************************************************************/
-char * socket_state_str( uint32_t state );
-
-/****************************************************************************************
- * This function returns a printable string for a command type.
- ****************************************************************************************
- * type  :  command type 
- ***************************************************************************************/
-char * socket_cmd_type_str( uint32_t type );
-
-/****************************************************************************************
- * This function returns a printable string for a command status.
- ****************************************************************************************
- * sts   : command status.
- ***************************************************************************************/
-char * socket_cmd_sts_str( uint32_t sts );
-
-
-
-/****************************************************************************************
- *      Functions used by the NIC_TX and NIC_RX server threads.
- ***************************************************************************************/
-
-/****************************************************************************************
- * This blocking function is called by the dev_nic_rx_handle_tcp() function, executed by
- * the NIC_RX[channel] server thread, to register a R2T request defined by the <flags>
- * argument in the socket R2T queue, specified by the <queue_xp> argument.
- * This function unblocks the NIC_TX[channel] server thread, identified by the <channel>
- * argumentfrom the THREAD_BLOCKED_CLIENT condition.
- *
- * WARNING : It contains a waiting loop and return only when an empty slot has been 
- * found in the R2T queue.
- ****************************************************************************************
- * @ queue_xp   : [in] extended pointer on the R2T qeue descriptor.
- * @ flags      : [in] flags to be set in the TCP segment.
- * @ channel    : [in] NIC channel (both TX & RX).
- ***************************************************************************************/
-void socket_put_r2t_request( xptr_t    queue_xp,
-                             uint8_t   flags,
-                             uint32_t  channel );
-
-/****************************************************************************************
- * This function is called by the nic_tx_server thread to extract an R2T request
- * (one byte) from a R2T queue, specified by the <queue_xp> argument, to the buffer
- * defined by the <flags> argument.
- *****************************************************************************************
- * @ queue_xp      : [in]  extended pointer on the CRQ queue descriptor.
- * @ flags         : [out] buffer for TCP flags to be set.
- * @ return 0 if success / return -1 if queue empty.
- ***************************************************************************************/
-error_t socket_get_r2t_request (xptr_t    queue_xp,
-                                uint8_t * flags );
-  
-/****************************************************************************************
- * This function is called by the dev_nic_rx_handle_tcp() function to register
- * a client connection request, defined by the <remote_addr>, <remote_port>,
- * <remote_iss>, and <remote_window> arguments, * in the CRQ queue, specified 
- * by the <queue_xp> argument.
- ****************************************************************************************
- * @ queue_xp      : [in] extended pointer on the CRQ queue descriptor.
- * @ remote_addr   : [in] remote socket IP address.
- * @ remote_port   : [in] remote socket port.
- * @ remote_iss    : [in] remote socket initial sequence number.
- * @ remote_window : [in] remote socket receive window
- * @ return 0 if success / return -1 if queue full.
- ***************************************************************************************/
-error_t socket_put_crq_request( xptr_t    queue_xp,
-                                uint32_t  remote_addr,
-                                uint32_t  remote_port,
-                                uint32_t  remote_iss,
-                                uint32_t  remote_window );
-
-/****************************************************************************************
- * This function is called by the socket_accept() function to extract a connection
- * request from a CRQ queue, specified by the <queue_xp> argument, to the buffers
- * defined by <remote_addr>, <remote_port>, <remote_iss>, and <remote_window>.
- *****************************************************************************************
- * @ queue_xp      : [in]  extended pointer on the CRQ qeue descriptor.
- * @ remote_addr   : [out] buffer for remote socket IP address.
- * @ remote_port   : [out] buffer for remote socket port.
- * @ remote_iss    : [out] buffer for remote socket initial sequence number.
- * @ remote_window : [out] buffer for remote socket receive window
- * @ return 0 if success / return -1 if queue empty.
- ***************************************************************************************/
-error_t socket_get_crq_request( xptr_t     queue_xp,
-                                uint32_t * remote_addr,
-                                uint32_t * remote_port,
-                                uint32_t * remote_iss,
-                                uint32_t * remote_window );
-
-/****************************************************************************************
- * This blocking function diplays the socket state (including the TCB).
- ****************************************************************************************
- * @ socket_xp     : [in] extended pointer on socket descriptor.
- * @ func_str      : [in] name of calling function.
- * @ string        : [in] string defining the calling context (can be NULL)
- ***************************************************************************************/
-void socket_display( xptr_t         socket_xp,
-                     const char   * func_str,
-                     const char   * string );
-
-
-
-/****************************************************************************************
- *      Functions implementing the socket related system calls
- ***************************************************************************************/
-
-/****************************************************************************************
- * This function implements the socket() syscall.
- * This function allocates and intializes in the calling thread cluster:
- * - a new socket descriptor, defined by the <domain> and <type> arguments,
- * - a new file descriptor, associated to this socket,
- * It registers the file descriptor in the reference process fd_array[],
- * set the socket state to UNBOUND, and returns the <fdid> value.
- ****************************************************************************************
- * @ domain  : [in] socket protocol family (AF_UNIX / AF_INET)
- * @ type    : [in] socket type (SOCK_DGRAM / SOCK_STREAM).
- * @ return a file descriptor <fdid> if success / return -1 if failure.
- ***************************************************************************************/
-int socket_build( uint32_t   domain,
-                  uint32_t   type );
-
-/****************************************************************************************
- * This function implements the bind() syscall.
- * It assigns an IP address, defined by the <local_addr> argument, and a port number,
- * defined by the <local_port> argument to an unnamed local socket, identified by the
- * <fdid> argument, and set the socket state to BOUND. It applies to UDP or TCP sockets.
- * It does not require any service from the NIC_TX and NIC_RX server threads.
- * It can be called by a thread running in any cluster.
- ****************************************************************************************
- * @ fdid         : [in] file descriptor index identifying the socket.
- * @ local_addr   : [in] local IP address.
- * @ local_port   : [in] local port.
- * @ return 0 if success / return -1 if failure.
- ***************************************************************************************/
-int socket_bind( uint32_t  fdid,
-                 uint32_t  addr,
-                 uint16_t  port );
-
-/****************************************************************************************
- * This function implements the listen() syscall().
- * It is called by a (local) server process to specify the max size of the CRQ queue
- * for a socket identified by the <fdid> argument, that expect connection requests
- * from one or several (remote) client processes. The selected socket CRQ is supposed
- * to register all connections requests, whatever the client IP address and port values. 
- * 
- * This function applies only to a TCP socket, that must be in the BOUND state.
- * The socket is set to the LISTEN state.
- * It does not require any service from the NIC_TX and NIC_RX server threads.
- * It can be called by a thread running in any cluster.
- ****************************************************************************************
- * Implementation notes : 
- * The number N of channels available in the NIC contrôler can be larger than 1.
- * Depending on the remote client IP address and port, the  connection request can be
- * received by any NIC_RX[k] server thread. To find the relevant listening socket, each
- * NIC_RX[k] server thread must be able to scan the set of all listening sockets.
- * Therefore a list of listening sockets is implemented as a dedicated xlist, rooted in
- * the NIC_RX[0] chdev extension, and using the listening socket <rx_list> field,
- * because a listening socket is never used to move data.  
- ****************************************************************************************
- * @ fdid      : [in] file descriptor index identifying the local server socket.
- * @ crq_depth : [in] depth of CRQ queue of pending connection requests.
- * @ return 0 if success / return -1 if failure
- ***************************************************************************************/
-int socket_listen( uint32_t fdid,
-                   uint32_t crq_depth );
-
-/****************************************************************************************
- * This blocking function implements the accept() syscall().
- * It applies only to TCP sockets in the LISTEN state.
- * It is executed by a server process, waiting for one (or several) client process(es)
- * requesting a connection on a listening socket identified by the <fdid> argument.
- * This socket must have been previouly created with socket(), bound to a local address
- * with bind(), and listening for connections after a listen(). It  blocks on the <IO>
- * condition if the CRQ is empty. Otherwise, it get a pending connection request from 
- * the listening socket CRQ queue, and creates a new socket with the same properties 
- * as the listening socket, allocating a new file descriptor for this new socket. 
- * It computes the nic_channel index [k] from <remote_addr> and <remote_port> values,
- * and initializes "remote_addr","remote_port", "nic_channel" in local socket.
- * It returns the new socket fdid as well as the remote IP address
- * and port, but only when the new socket is set to the ESTAB state. The new socket 
- * cannot accept connections, but the listening socket keeps open for new connections.  
- ****************************************************************************************
- * Implementation Note: 
- * This blocking function contains two blocking conditions because it requests services
- * to both the NIC_RX server thread, and he NIC_TX server thread.
- * It is structured in five steps:
- * 1) It makes several checkings on the listening socket domain, type, and state.
- * 2) If the socket CRQ queue is empty, the function makes an SOCKET_RX_ACCEPT command
- *    to the NIC_RX server thread, waiting registration of a connection request in the
- *    CRQ queue. Then it blocks on the <IO> condition and deschedules. It is unblocked 
- *    by the NIC_RX server thread receiving a valid TCP SYN segment.
- * 3) When it found a pending request, it creates a new socket with the same properties
- *    as the listening socket, and a new file descriptor for this socket. It initializes
- *    the new socket descriptor using the values in the registered connect_request_t
- *    structure, and set this new socket to the SYN_RECV state.
- * 4) Then it makes a SOCKET_TX_command to the NIC_TX thread, requesting a TCP SYN_ACK 
- *    segment to the remote socket. Then, it blocks on <IO> condition and dechedules.
- *    It is unblocked by the NIC_RX server thread when this SYN_ACK is acknowledged,
- *    and the new socket is set in ESTAB state (by the NIC_RX server).
- * 5) Finally, it returns the new socket fdid, and registers, in the <address> and
- *    <port> arguments, the remote client IP address & port. 
- ****************************************************************************************
- * @ fdid         : [in] file descriptor index identifying the listening socket.
- * @ address      : [out] server IP address.
- * @ port         : [out] server port address length in bytes.
- * @ return the new socket <fdid> if success / return -1 if failure
- ***************************************************************************************/
-int socket_accept( uint32_t   fdid,
-                   uint32_t * address,
-                   uint16_t * port );
-
-/****************************************************************************************
- * This blocking function implements the connect() syscall.
- * It is used by a client process to connect a local socket identified by 
- * the <fdid> argument, to a remote socket identified by the <remote_addr> and 
- * <remote_port> arguments. It can be used for both  UDP and TCP sockets. 
- * It computes the nic_channel index [k] from <remote_addr> and <remote_port> values,
- * and initializes "remote_addr","remote_port", "nic_channel" in local socket.
- * It registers the socket in the lists of sockets rooted in the NIC_RX[k] & NIC_TX[k]
- * chdevs. It can be called by a thread running in any cluster.
- * It returns only when the local socket is in the ESTAB state, or to report an error.
- ****************************************************************************************
- * Implementation Note:
- * - For a TCP socket, it updates the "remote_addr", "remote_port", "nic_channel" fields
- *   in the socket descriptor defined by the <fdid> argument, and register this socket,
- *   in the lists of sockets attached to the NIC_TX[k] and NIC_RX[k] chdevs.
- *   Then, it builds a TX_CONNECT command to the NIC_TX server thread to send a SYN to
- *   the remote socket, unblocks the NIC_TX server thread from the <CLIENT> condition,
- *   blocks itself on <IO> condition and deschedules. It is unblocked by the NIC_RX
- *   server thread when this thread receive the expected SYN-ACK, and the local socket
- *   has been set to the ESTAB state, or when an error is reported in "tx_error" field. 
- * - For an UDP socket, it simply updates "remote_addr", "remote_port", "nic_channel"
- *   in the socket descriptor defined by the <fdid> argument, and register this socket
- *   in the lists of sockets attached to the NIC_TX[k] and NIC_RX[k] chdevs.
- *   Then, it set the socket to the ESTAB state, or returns an error without blocking.
- ****************************************************************************************
- * @ fdid          : [in] file descriptor index identifying the socket.
- * @ remote_addr   : [in] remote IP address.
- * @ remote_port   : [in] remote port.
- * @ return 0 if success / return -1 if failure.
- ***************************************************************************************/
-int socket_connect( uint32_t  fdid,
-                    uint32_t  remote_addr,
-                    uint16_t  remote_port );
-
-/****************************************************************************************
- * This blocking function implements the send() syscall.
- * It is used to send data stored in the user buffer, identified the <u_buf> and <length>
- * arguments, to a connected (TCP or UDP) socket, identified by the <fdid> argument.
- * The work is actually done by the NIC_TX server thread, and the synchronisation
- * between the client and the server threads uses the "tx_valid" set/reset flip-flop:
- * The client thread registers itself in the socket descriptor, registers in the queue 
- * rooted in the NIC_TX[index] chdev, set "tx_valid", unblocks the server thread, and 
- * finally blocks on THREAD_BLOCKED_IO, and deschedules. 
- * When the TX server thread completes the command (all data has been sent for an UDP
- * socket, or acknowledged for a TCP socket), the server thread reset "rx_valid" and
- * unblocks the client thread.
- * This function can be called by a thread running in any cluster.
- * WARNING : This implementation does not support several concurent SEND commands
- * on the same socket, as only one TX thread can register in a given socket.
- ****************************************************************************************
- * @ fdid      : [in] file descriptor index identifying the socket.
- * @ u_buf     : [in] pointer on buffer containing packet in user space.
- * @ length    : [in] packet size in bytes.
- * @ return number of sent bytes if success / return -1 if failure.
- ***************************************************************************************/
-int socket_send( uint32_t    fdid,
-                 uint8_t   * u_buf,
-                 uint32_t    length );
-
-/****************************************************************************************
- * This blocking function implements the recv() syscall.
- * It is used to receive data that has been stored by the NIC_RX server thread in the
- * rx_buf of a connected socket, identified by the <fdid> argument.  
- * The synchronisation between the client and the server threads uses the "rx_valid"
- * set/reset flip-flop: If "rx_valid" is set, the client simply moves the available
- * data from the "rx_buf" to the user buffer identified by the <u_buf> and <length>
- * arguments, and reset the "rx_valid" flip_flop. If "rx_valid" is not set, the client
- * thread register itself in the socket descriptor, registers in the clients queue rooted
- * in the NIC_RX[index] chdev, and finally blocks on THREAD_BLOCKED_IO, and deschedules. 
- * The client thread is re-activated by the RX server, that set the "rx_valid" flip-flop 
- * as soon as data is available in the "rx_buf". The number of bytes actually transfered
- * can be less than the user buffer size.
- * This  function can be called by a thread running in any cluster.
- * WARNING : This implementation does not support several concurent RECV 
- * commands on the same socket, as only one RX thread can register in a given socket.
- ****************************************************************************************
- * @ fdid        : [in] file descriptor index identifying the local socket.
- * @ u_buf       : [in] pointer on buffer in user space.
- * @ length      : [in] buffer size in bytes.
- * @ return number of received bytes if success / return -1 if failure.
- ***************************************************************************************/
-int socket_recv( uint32_t    fdid,
-                 uint8_t   * u_buf,
-                 uint32_t    length );
-
-/****************************************************************************************
- * This blocking function implements the sendto() syscall.
- * It is used to send data stored in the user buffer, identified the <u_buf> and <length>
- * to a remote process identified by the <remote_ip> and <remote_port> arguments,
- * through a local, unconnected (UDP) socket, identified by the <fdid> argument.
- * The work is actually done by the NIC_TX server thread, and the synchronisation
- * between the client and the server threads uses the "rx_valid" set/reset flip-flop:
- * The client thread registers itself in the socket descriptor, registers in the queue 
- * rooted in the NIC_TX[index] chdev, set "rx_valid", unblocks the server thread, and 
- * finally blocks on THREAD_BLOCKED_IO, and deschedules. 
- * When the TX server thread completes the command (all data has been sent for an UDP
- * socket, or acknowledged for a TCP socket), the server thread reset "rx_valid" and
- * unblocks the client thread.
- * This function can be called by a thread running in any cluster.
- * WARNING : This implementation does not support several concurent SEND/SENDTO commands
- * on the same socket, as only one TX thread can register in a given socket.
- * TODO : this function is not implemented yet.
- ****************************************************************************************
- * @ fdid        : [in] file descriptor index identifying the local socket.
- * @ u_buf       : [in] pointer on buffer containing packet in user space.
- * @ length      : [in] packet size in bytes.
- * @ remote_ip   : [in] remote socket IP address.
- * @ remote_port : [in] remote socket port address.
- * @ return number of sent bytes if success / return -1 if failure.
- ***************************************************************************************/
-int socket_sendto( uint32_t   fdid,
-                   uint8_t  * u_buf,
-                   uint32_t   length,
-                   uint32_t   remote_ip,
-                   uint16_t   remote_port );
-
-/****************************************************************************************
- * This blocking function implements the recvfrom() syscall.
- * It is used to receive data that has been stored by the NIC_RX server thread in the
- * rx_buf of a non connected socket, identified by the <fdid> argument, from a
- * remote process identified by the <remote_ip> and <remote_port> arguments.
- * The synchronisation between the client and the server threads uses the "rx_valid"
- * set/reset flip-flop: If "rx_valid" is set, the client simply moves the available
- * data from the "rx_buf" to the user buffer identified by the <u_buf> and <length>
- * arguments, and reset the "rx_valid" flip_flop. If "rx_valid" is not set, the client
- * thread register itself in the socket descriptor, registers in the clients queue rooted
- * in the NIC_RX[index] chdev, and finally blocks on THREAD_BLOCKED_IO, and deschedules. 
- * The client thread is re-activated by the RX server, that set the "rx_valid" flip-flop 
- * as soon as data is available in the "rx_buf". The number of bytes actually transfered
- * can be less than the user buffer size.
- * This  function can be called by a thread running in any cluster.
- * WARNING : This implementation does not support several concurent RECV/RECVFROM 
- * commands on the same socket, as only one RX thread can register in a given socket.
- * TODO : this function is not implemented yet.
- ****************************************************************************************
- * @ fdid        : [in] file descriptor index identifying the local socket.
- * @ u_buf       : [in] pointer on buffer in user space.
- * @ length      : [in] buffer size in bytes.
- * @ remote_ip   : [in] remote socket IP address.
- * @ remote_port : [in] remote socket port address.
- * @ return number of received bytes if success / return -1 if failure.
- ***************************************************************************************/
-int socket_recvfrom( uint32_t    fdid,
-                     uint8_t   * u_buf,
-                     uint32_t    length,
-                     uint32_t    remote_ip,
-                     uint16_t    remote_port );
-
-/****************************************************************************************
- * This blocking function implements the close() syscall for a socket.
- * - For a UDP socket, it simply calls the static socket_destroy() function to release 
- *   all structures associated to the local socket, including the file descriptor.
- * - For a TCP socket, it makes a CLOSE command to NIC_TX, and blocks on the <IO>
- *   condition. The close TCP hanshake is done by the NIC_TX and NIC_RX threads.
- *   It is unblocked when the socket is in CLOSED state, or when an error is reported.
- *   Finally, it calls the static socket_destroy() function to release all structures 
- *   associated to the local socket, including the file descriptor.
- ****************************************************************************************
- * @ file_xp     : [in] extended pointer on file descriptor.
- * @ fdid        : [in] file descriptor index identifying the socket.
- * @ return 0 if success / return -1 if failure.
- ***************************************************************************************/
-int socket_close( xptr_t     file_xp,
-                  uint32_t   fdid );
-
-
-#endif	/* _KSOCKET_H_ */
-
-
-
Index: trunk/kernel/kern/kthread_create.c
===================================================================
--- trunk/kernel/kern/kthread_create.c	(revision 1)
+++ trunk/kernel/kern/kthread_create.c	(revision 1)
@@ -0,0 +1,88 @@
+/*
+ * kern/kthread_create.c - kernel-level threads creation
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012,2013,2014,2015 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <kmem.h>
+#include <cpu.h>
+#include <thread.h>
+#include <process.h>
+#include <list.h>
+#include <ppm.h>
+#include <pmm.h>
+#include <signal.h>
+#include <scheduler.h>
+#include <spinlock.h>
+#include <cluster.h>
+
+////////////////////////////////
+static void kthread_exit( void )
+{
+	thread_t * this = CURRENT_THREAD;
+	
+	thread_dmsg( 1, "Kernel Thread %x on CPU %d has finished\n",
+	             this, current_cpu->gid );
+	
+	sys_thread_exit(0); //sched_exit(this);
+	
+	PANIC ("Thread %x, CPU %d must never return", this, current_cpu->gid);
+}
+
+void thread_init(thread_t *thread);
+
+struct thread_s* kthread_create(struct process_s *process, kthread_t *kfunc, void *arg, uint_t cpu_lid)
+{
+	kmem_req_t req;
+	register struct page_s *page;
+	register thread_t *thread;
+  
+	req.type  = KMEM_PAGE;
+	req.size  = ARCH_THREAD_PAGE_ORDER;
+	req.flags = AF_KERNEL | AF_ZERO | AF_REMOTE;
+	//req.ptr   = clusters_tbl[cid].cluster;  
+	req.ptr   = current_cluster;  
+	page      = kmem_alloc(&req);
+  
+	if(page == NULL) return NULL;
+
+	thread = ppm_page2addr(page);
+
+	thread_init(thread);
+
+	//thread_set_current_cpu(thread, &clusters_tbl[cid].cluster->cpu_tbl[cpu_lid]);
+	thread_set_current_cpu(thread, &current_cluster->cpu_tbl[cpu_lid]);
+	thread->ecid		= current_cluster->id;
+	thread->egid		= current_cluster->cpu_tbl[cpu_lid].gid;
+	sched_setpolicy(thread, SCHED_RR);
+	
+	thread->process                 = process;
+	thread->type                 = KTHREAD;
+	thread->state		     = S_KERNEL;
+	thread->info.sig_mask        = SIG_DEFAULT_MASK;
+	thread->info.attr.entry_func = (void*)kfunc;
+	thread->info.attr.exit_func  = (void*)kthread_exit;
+	thread->info.attr.arg1       = arg;
+	thread->info.attr.tid        = (uint_t) thread;
+	thread->info.attr.pid        = process->pid;
+	thread->info.page            = page;
+  
+	cpu_context_init(&thread->pws, thread);
+	return thread;
+}
Index: trunk/kernel/kern/mcs_sync.c
===================================================================
--- trunk/kernel/kern/mcs_sync.c	(revision 1)
+++ trunk/kernel/kern/mcs_sync.c	(revision 1)
@@ -0,0 +1,195 @@
+/*
+ * kern/mcs_sync.c - ticket-based barriers and locks synchronization
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <config.h>
+#include <types.h>
+#include <mcs_sync.h>
+#include <thread.h>
+#include <cpu.h>
+#include <kdmsg.h>
+
+#define mcs_barrier_flush(_ptr)						\
+	do{								\
+		cpu_invalid_dcache_line(&(_ptr)->phase);		\
+		cpu_invalid_dcache_line(&(_ptr)->ticket);		\
+		cpu_invalid_dcache_line(&(_ptr)->ticket2);		\
+		cpu_invalid_dcache_line(&(_ptr)->cntr);			\
+	}while(0);
+
+/////////////////////////////////////////////////
+//FIXME: why all these dcache_invalidate ? [AG]
+/////////////////////////////////////////////////
+
+///////////////////////////////////////////
+void mcs_barrier_init( mcs_barrier_t * ptr,
+                       char          * name,
+                       uint32_t        count )
+{
+	ptr->val.value     = count;
+	ptr->phase.value   = 0;
+	ptr->cntr.value    = count;
+	ptr->ticket.value  = 0;
+	ptr->ticket2.value = 0;
+	ptr->name          = name;
+	
+	cpu_wbflush();
+	cpu_invalid_dcache_line(&ptr->val);
+	mcs_barrier_flush(ptr);
+}
+
+///////////////////////////////////////////
+void mcs_barrier_wait( mcs_barrier_t * ptr)
+{
+	register uint32_t   phase;
+	register uint32_t   order;
+	uint32_t          * current;
+	uint32_t          * next;
+ 
+	phase   = ptr->phase.value;
+	current = (phase == 0) ? &ptr->ticket.value : &ptr->ticket2.value;
+	order   = cpu_atomic_add((void*)&ptr->cntr.value, -1);
+
+	if(order == 1)
+	{
+		phase            = ~(phase) & 0x1;
+		next             =  (phase == 0) ? &ptr->ticket.value : &ptr->ticket2.value;
+		ptr->phase.value = phase;
+		ptr->cntr.value  = ptr->val.value;
+		*next            = 0;
+		*current         = 1;
+		cpu_wbflush();
+		mcs_barrier_flush(ptr);
+		return;
+	}
+
+	mcs_barrier_flush(ptr);
+
+	while(cpu_load_word(current) == 0)
+		;
+
+	cpu_invalid_dcache_line(current);
+}
+
+/////////////////////////////////////
+void mcs_lock_init( mcs_lock_t * ptr,
+                    char       * name )
+{
+	ptr->cntr.value   = 0;
+	ptr->ticket.value = 0;
+	ptr->name         = name;
+	
+	cpu_wbflush();
+	cpu_invalid_dcache_line(&ptr->cntr);
+	cpu_invalid_dcache_line(&ptr->ticket);
+}
+
+////////////////////////////////
+void mcs_lock( mcs_lock_t * ptr, 
+               uint32_t   * irq_state )
+{
+	uint32_t ticket;
+
+	cpu_disable_all_irq( irq_state );
+
+	ticket = cpu_atomic_add( &ptr->ticket.value , 1 );
+
+	while(ticket != cpu_load_word(&ptr->cntr.value))
+		;
+
+	CURRENT_THREAD->locks_count ++;
+}
+
+//////////////////////////////////
+void mcs_unlock( mcs_lock_t * ptr, 
+                 uint32_t     irq_state )
+{
+	register uint32_t next;
+	volatile uint32_t *val_ptr;
+	register struct thread_s *this;
+
+	this	 = CURRENT_THREAD;
+
+	val_ptr  = &ptr->cntr.value;
+	next     = ptr->cntr.value + 1;
+
+	cpu_wbflush();
+	cpu_invalid_dcache_line((void*)val_ptr);
+
+	*val_ptr = next;
+
+	cpu_wbflush();
+	cpu_invalid_dcache_line((void*)val_ptr);
+
+	full_assert(this, this->locks_count > 0);
+	this->locks_count --;
+	cpu_restore_irq(irq_state);
+
+    // pourquoi pas simplement le code ci-dessous ? [AG]
+    // ptr->cntr.value ++;
+	// cpu_wbflush();
+    // CURRENT_THREAD->locks_count --;
+	// cpu_restore_irq( irq_state );
+    
+}
+
+///////////////////////////////////////
+void mcs_lock_remote( mcs_lock_t * ptr,
+                      cid_t        cid, 
+                      uint32_t   * irq_state )
+{
+	uint32_t ticket;
+
+	cpu_disable_all_irq( irq_state );
+
+	ticket = remote_atomic_add( &ptr->ticket.value , cid , 1 );
+
+	while( ticket != remote_lw( &ptr->cntr.value , cid ) )
+		;
+
+	CURRENT_THREAD->distlocks_count ++;
+}
+
+/////////////////////////////////////////
+void mcs_unlock_remote( mcs_lock_t * ptr, 
+                        cid_t        cid, 
+                        uint32_t     irq_state )
+{
+	register uint32_t next;
+	volatile uint32_t *val_ptr;
+	register struct thread_s *this;
+
+	this	 = CURRENT_THREAD;
+	val_ptr  = &ptr->cntr.value;
+	next     = remote_lw((void*)val_ptr, cid) + 1;
+
+	cpu_wbflush();
+	cpu_invalid_dcache_line((void*)val_ptr);
+
+	remote_sw((void*)val_ptr, cid, next);
+
+	cpu_wbflush();
+	cpu_invalid_dcache_line((void*)val_ptr);
+
+	full_assert(this, this->distlocks_count > 0);
+	this->distlocks_count --;
+	cpu_restore_irq(irq_state);
+}
Index: trunk/kernel/kern/mcs_sync.h
===================================================================
--- trunk/kernel/kern/mcs_sync.h	(revision 1)
+++ trunk/kernel/kern/mcs_sync.h	(revision 1)
@@ -0,0 +1,73 @@
+/*
+ * kern/mcs_sync.h - ticket-based barriers and locks synchronization
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ * 
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _MCS_SYNC_H_
+#define _MCS_SYNC_H_
+
+#include <types.h>
+
+///////////////////////////////////////////////
+//             Public Section                //
+///////////////////////////////////////////////
+
+struct mcs_barrier_s;
+struct mcs_lock_s;
+
+typedef struct mcs_barrier_s mcs_barrier_t;
+typedef struct mcs_lock_s mcs_lock_t;
+
+void mcs_barrier_init(mcs_barrier_t *ptr, char *name, uint_t count);
+void mcs_barrier_wait(mcs_barrier_t *ptr);
+
+void mcs_lock_init(mcs_lock_t *ptr, char *name);
+
+void mcs_lock(mcs_lock_t *ptr, uint_t *irq_state);
+void mcs_unlock(mcs_lock_t *ptr, uint_t irq_state);
+
+void mcs_lock_remote(mcs_lock_t *ptr, cid_t cid, uint_t *irq_state);
+void mcs_unlock_remote(mcs_lock_t *ptr, cid_t cid, uint_t irq_state);
+
+//////////////////////////////////////////////
+//             Private Section              //
+//////////////////////////////////////////////
+
+struct mcs_barrier_s
+{
+	cacheline_t val;
+	cacheline_t phase;
+	cacheline_t cntr;
+	cacheline_t ticket;
+	cacheline_t ticket2;
+	char        *name CACHELINE;
+} mcs_barrier_t;
+
+
+struct mcs_lock_s
+{
+	cacheline_t cntr;
+	cacheline_t ticket;
+	char        *name CACHELINE;
+} mgs_lock_t;
+
+
+
+#endif	/* _MCS_SYNC_H_ */
Index: trunk/kernel/kern/metafs.h
===================================================================
--- trunk/kernel/kern/metafs.h	(revision 1)
+++ trunk/kernel/kern/metafs.h	(revision 1)
@@ -0,0 +1,245 @@
+/*
+ * metafs.h - Meta File-System manages parent-child accesses
+ * 
+ * Authors   Ghassan Almaless (2008,2009,2010,2011,2012)
+ *           Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _METAFS_H_
+#define _METAFS_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <list.h>
+#include <string.h>
+
+#define METAFS_HASH_SIZE    10
+
+/******************************************************************************************
+ * This structure define a node in the metafs tree.
+ *****************************************************************************************/
+
+typedef struct metafs_s
+{
+	char        * name;                         /*! name represented by this node        */
+	uint32_t      children_nr;                  /*! number of chidren for this node      */
+	list_entry_t  list;                         /*! child : member of a children list    */     
+	list_entry_t  hash_tbl[METAFS_HASH_SIZE];   /*! parent : array of roots of children  */
+                                                /*!          lists, sorted by key value  */
+}
+metafs_t;
+
+/******************************************************************************************
+ * This function compute the hash key for a given name.
+ ******************************************************************************************
+ * @ name     : string to be analysed.
+ * return the key value, from 0 to (METAFS_HASH_SIZE - 1)
+ *****************************************************************************************/
+static inline uint32_t metafs_hash_index( char * dev_name )
+{
+	register char    * str   = dev_name;
+	register uint32_t  index = 0;
+  
+	while(*str)
+		index = index + (*(str++) ^ index);
+
+	return index % METAFS_HASH_SIZE;
+}
+
+/******************************************************************************************
+ * This function initializes a node with zero children.
+ ******************************************************************************************
+ * @ node     : pointer on node to be initialized.
+ * @ name     : name for this node.
+ *****************************************************************************************/
+static inline void metafs_init( metafs_t * node,
+                                char     * name )
+{
+	register uint32_t i;
+  
+	node->name        = name;
+	node->children_nr = 0;
+
+	for(i=0; i < METAFS_HASH_SIZE; i++)
+		list_root_init( &node->hash_tbl[i] );  
+}
+
+/******************************************************************************************
+ * This function register a children metafs node in a parent metafs node
+ ******************************************************************************************
+ * @ parent   : pointer on parent node.
+ * @ child    : pointer on child node.
+ *****************************************************************************************/
+static inline void metafs_register( metafs_t * parent,
+                                    metafs_t * child )
+{
+	register uint32_t index;
+  
+	parent->children_nr ++;
+	index = metafs_hash_index( child->name );
+	list_add_last( &parent->hash_tbl[index], &child->list );
+}
+
+/******************************************************************************************
+ * This function search a child node by its name in a parent node.
+ ******************************************************************************************
+ * @ parent   : pointer on parent node.
+ * @ child    : pointer on child node.
+ * @ return pointer on child node if found / return NULL if not found.
+ *****************************************************************************************/
+static inline  metafs_t * metafs_lookup( metafs_t * parent,
+                                         char     * name )
+{
+	register  list_entry_t * iter;
+	register  metafs_t     * current;
+	register  uint32_t       index;
+
+	index = metafs_hash_index(name);
+
+	LIST_FOREACH( &parent->hash_tbl[index] , iter )
+	{
+		current = LIST_ELEMENT ( iter ,  metafs_t , list );
+		if( strcmp( current->name , name ) != 0 ) return current;
+	}
+	return NULL;
+}
+
+/******************************************************************************************
+ * This function remove a child from the children list of a parent node.
+ ******************************************************************************************
+ * @ parent   : pointer on parent node.
+ * @ child    : pointer on child node.
+ *****************************************************************************************/
+static inline void metafs_unregister( metafs_t * parent,
+                                      metafs_t * child )
+{
+    list_unlink( &child->list );
+	parent->children_nr --;
+}
+
+
+
+
+
+#define metafs_get_name(_node) ((_node)->name)
+
+#define metafs_set_name(_node, _ptr) do{(_node)->name = (_ptr);}while(0)
+
+#define metafs_get_children_nr(_parent) ((_parent)->children_nr)
+
+#define metafs_hasChild(_parent) ((_parent)->children_nr != 0)
+
+#define metafs_container(_metafs, _type, _member)	\
+	list_container(_metafs, _type, _member)
+
+
+#if CONFIG_METAFS_DEBUG
+#include <kdmsg.h>
+
+static inline void metafs_print( metafs_t * node )
+{
+	uint32_t       i;
+	list_entry_t * iter;
+  
+	printk("metafs_print [%s]\n", node->name);
+  
+	for(i=0; i<METAFS_HASH_SIZE; i++)
+	{
+		printk(DEBUG, "Entry %d: ", i);
+		list_foreach(&node->hash_tbl[i], iter)
+		{
+			printk(DEBUG, "%s, ", list_element(iter,  metafs_t, list)->name);
+		}
+		printk(DEBUG, "\n");
+	}
+}
+#else
+static inline void metafs_print( metafs_t * node )
+{
+}
+#endif	/* CONFIG_METAFS_DEBUG */
+
+/* deprecated
+
+////////////////////////////
+typedef struct metafs_iter_s
+{
+	uint32_t   hash_index;
+	metafs_t * current;
+}
+metafs_iter_t;
+
+
+//////////////////////////////////////////////////////////
+static inline void metafs_iter_init( metafs_t      * node,
+                                     metafs_iter_t * iter )
+{
+	register uint32_t i;
+
+	for(i=0; i < METAFS_HASH_SIZE; i++)
+	{
+		if( !(list_is_empty( &node->hash_tbl[i] ) ) )
+		{
+			iter->hash_index = i;
+			iter->current = LIST_FIRST( &node->hash_tbl[i] ,  metafs_t , list );
+			return;
+		}
+	}
+
+	iter->current = NULL;
+}
+
+/////////////////////////////////////////////////////////////////////
+static inline  metafs_t * metafs_lookup_next( metafs_t      * parent,
+                                              metafs_iter_t * iter )
+{
+	register  list_entry_t * next;
+	register  metafs_t     * child;
+	register  uint32_t       i;
+
+	if(iter->current == NULL)
+		return NULL;
+
+	child = iter->current;
+	i = iter->hash_index;
+
+	if((next = list_next(&parent->hash_tbl[i], &iter->current->list)) == NULL)
+	{ 
+		for(i = i + 1; i < METAFS_HASH_SIZE; i++)
+		{
+			if(!(list_empty(&parent->hash_tbl[i])))
+			{
+				iter->hash_index = i;
+				iter->current = list_first(&parent->hash_tbl[i],  metafs_t, list);
+				return child;
+			}
+		}
+		iter->current = NULL;
+		return child;
+	}
+   
+	iter->current = list_element(next,  metafs_t, list);
+	return child;
+}
+
+*/
+
+
+#endif	/* _METAFS_H_ */
Index: trunk/kernel/kern/mwmr.c
===================================================================
--- trunk/kernel/kern/mwmr.c	(revision 1)
+++ trunk/kernel/kern/mwmr.c	(revision 1)
@@ -0,0 +1,174 @@
+/*
+ * kern/mwmr.c - a basic FIFO buffer
+ * 
+ * Copyright (c) 2007,2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <mwmr.h>
+#include <kmem.h>
+#include <thread.h>
+#include <spinlock.h>
+
+struct fifomwmr_s
+{
+	spinlock_t lock;
+	uint_t isAtomic;
+	uint_t status;
+	uint_t read_ptr;
+	uint_t write_ptr;
+	char *data;
+	uint_t item;
+	uint_t length;
+};
+
+struct fifomwmr_s* mwmr_init(int item, int length, int isAtomic)
+{
+	kmem_req_t req;
+	struct fifomwmr_s *fifo;
+	char *data;
+
+	req.type  = KMEM_GENERIC;
+	req.size  = sizeof(*fifo);
+	req.flags = AF_BOOT | AF_ZERO;
+  
+	if((fifo = kmem_alloc(&req)) == NULL)
+		return NULL;
+  
+	req.size = sizeof (unsigned int) * item * length;
+
+	if((data = kmem_alloc(&req)) == NULL)
+	{
+		printk(WARNING, "WARNING: mwmr_init: MEMORY SHORTAGE\n");
+		req.ptr = fifo;
+		kmem_free(&req);
+		return NULL;
+	}
+
+	spinlock_init(&fifo->lock, "MWMR");
+	fifo->isAtomic = isAtomic;
+	fifo->item     = item;
+	fifo->length   = length * item;
+	fifo->data     = data;
+  
+	return fifo;
+}
+
+int mwmr_read(struct fifomwmr_s *fifo, void *buffer, size_t size)
+{
+	register int rnum;                    // number of words to read
+	register char *src;
+	register int i, size1, size2;
+	register char *buff = (char *) buffer;
+
+	if (size == 0)
+		return 0;
+
+	if(fifo->isAtomic)
+		spinlock_lock(&fifo->lock);
+
+	rnum = (size > fifo->status) ? fifo->status : size;
+
+	if (rnum)
+	{
+		src = fifo->data + fifo->read_ptr;
+		if ((fifo->read_ptr + rnum) <= fifo->length)
+			for (i = 0; i < rnum; i++)
+				buff[i] = src[i];
+		else
+		{
+			size1 = fifo->length - fifo->read_ptr;
+			size2 = rnum - size1;
+
+			for (i = 0; i < size1; i++)
+				buff[i] = src[i];
+
+			for (i = 0; i < size2; i++)
+				buff[size1 + i] = *(fifo->data + i);
+		}
+
+		fifo->status  -= rnum;
+		fifo->read_ptr = (fifo->read_ptr + rnum) % fifo->length;
+	}
+
+	if(fifo->isAtomic)
+		spinlock_unlock(&fifo->lock);
+
+	return rnum;
+}
+
+int mwmr_write(struct fifomwmr_s *fifo, void *buffer, size_t size)
+{
+	register int free_space;
+	register int wnum;                    // number of words to write
+	register char *dest;
+	register int i, size1, size2;
+	register char *buff = (char *) buffer;
+
+	if (size == 0)
+		return 0;
+
+	if(fifo->isAtomic)
+		spinlock_lock (&fifo->lock);
+
+	free_space = fifo->length - fifo->status;
+	wnum       = (size > free_space) ? free_space : size;
+
+	if (wnum)
+	{
+		dest = (fifo->data + fifo->write_ptr);
+
+		if ((fifo->write_ptr + wnum) <= fifo->length)
+			for (i = 0; i < wnum; i++)
+				dest[i] = buff[i];
+		else
+		{
+			size1 = fifo->length - fifo->write_ptr;
+			size2 = wnum - size1;
+
+			for (i = 0; i < size1; i++)
+				dest[i] = buff[i];
+
+			for (i = 0; i < size2; i++)
+				*(fifo->data + i) = buff[size1 + i];
+		}
+
+		fifo->status += wnum;
+		fifo->write_ptr = (fifo->write_ptr + wnum) % fifo->length;
+	}
+
+	if(fifo->isAtomic)
+		spinlock_unlock(&fifo->lock);
+
+	return wnum;
+}
+
+void mwmr_destroy(struct fifomwmr_s *fifo)
+{
+	kmem_req_t req;
+  
+	if(fifo == NULL) return;
+
+	req.type = KMEM_GENERIC;
+	req.ptr  = fifo->data;
+	kmem_free(&req);
+  
+	req.ptr  = fifo;
+	kmem_free(&req);
+}
Index: trunk/kernel/kern/mwmr.h
===================================================================
--- trunk/kernel/kern/mwmr.h	(revision 1)
+++ trunk/kernel/kern/mwmr.h	(revision 1)
@@ -0,0 +1,35 @@
+/*
+ * kern/mwmr.h - a basic FIFO buffer
+ * 
+ * Copyright (c) 2007,2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ * 
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _MWMR_H_
+#define _MWMR_H_
+
+#include <types.h>
+
+struct fifomwmr_s;
+
+struct fifomwmr_s* mwmr_init(int item, int length, int isAtomic);
+int mwmr_read(struct fifomwmr_s *fifo, void *buffer, size_t size);
+int mwmr_write(struct fifomwmr_s *fifo, void *buffer, size_t size);
+void mwmr_destroy(struct fifomwmr_s *fifo);
+
+#endif	/* _MWMR_H_ */
Index: trunk/kernel/kern/pipe.c
===================================================================
--- trunk/kernel/kern/pipe.c	(revision 690)
+++ 	(revision )
@@ -1,239 +1,0 @@
-/*
- * pipe.c - single writer, single reader pipe implementation            
- *
- * Author     Alain Greiner     (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <printk.h>
-#include <thread.h>
-#include <pipe.h>
-
-///////////////////////////////////
-pipe_t * pipe_create( cxy_t    cxy,
-                      uint32_t size )
-{
-    remote_buf_t * buf;
-    pipe_t       * pipe;
-    error_t        error;
-
-    // 2. allocate memory for remote_buf descriptor
-    buf = remote_buf_alloc( cxy );
-
-    if( buf == NULL )
-    {
-       return NULL;
-    }
-
-    // 1. initialize it, and allocate memory for associated data buffer
-    error = remote_buf_init( XPTR( cxy , buf ),
-                             bits_log2( size ) );
-    if( error )
-    {
-        remote_buf_destroy( XPTR( cxy , buf ) );
-        return NULL;
-    }
-
-    // 3. allocate memory for pipe descriptor
-    pipe = kmem_remote_alloc( cxy , bits_log2(sizeof(pipe_t)) , AF_ZERO );
-
-    if( pipe == NULL )
-    {
-        remote_buf_destroy( XPTR( cxy , buf ) );
-        return NULL;
-    }
-
-    // initialise it
-    hal_remote_spt( XPTR( cxy , &pipe->buffer ) , buf );
-
-    return pipe;
-
-}  // end pipe_create()
-
-///////////////////////////////////
-void pipe_destroy( xptr_t pipe_xp )
-{
-    pipe_t * pipe_ptr = GET_PTR( pipe_xp );
-    cxy_t    pipe_cxy = GET_CXY( pipe_xp );
-
-    // get pointer on remote_buf descriptor
-    remote_buf_t * buf = hal_remote_lpt( XPTR( pipe_cxy , &pipe_ptr->buffer ));
-
-    // release remote_buf descriptor and data buffer
-    remote_buf_destroy( XPTR( pipe_cxy , buf ) );
-
-    // release pipe descriptor
-    kmem_remote_free( pipe_cxy , pipe_ptr , bits_log2(sizeof(pipe_t)) );
-
-}  // end pipe_destroy()
-
-//////////////////////////////////////////
-void pipe_register_writer( xptr_t pipe_xp,
-                           xptr_t thread_xp )
-{
-    // get cluster and local pointer on pipe descriptor
-    cxy_t    pipe_cxy = GET_CXY( pipe_xp );
-    pipe_t * pipe_ptr = GET_PTR( pipe_xp );
-
-    // update "writer_xp" field
-    hal_remote_s64( XPTR( pipe_cxy , &pipe_ptr->writer_xp ) , thread_xp );
-
-}  // end pipe_register_writer()
-
-//////////////////////////////////////////
-void pipe_register_reader( xptr_t pipe_xp,
-                           xptr_t thread_xp )
-{
-    // get cluster and local pointer on pipe descriptor
-    cxy_t    pipe_cxy = GET_CXY( pipe_xp );
-    pipe_t * pipe_ptr = GET_PTR( pipe_xp );
-
-    // update "reader_xp" field
-    hal_remote_s64( XPTR( pipe_cxy , &pipe_ptr->reader_xp ) , thread_xp );
-
-}  // end pipe_register_reader()
-
-///////////////////////////////////////
-int pipe_user_move( bool_t   to_buffer,
-                    xptr_t   file_xp,
-                    void   * u_buf,
-                    uint32_t size )
-{
-    int        nbytes;      // number of bytes actually moved
-
-    thread_t * this  = CURRENT_THREAD;
-    
-assert( __FUNCTION__, ( file_xp != XPTR_NULL ) , "file_xp == XPTR_NULL" );
-
-#if DEBUG_PIPE_MOVE
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PIPE_MOVE < cycle )
-printk("\n[%s] thread[%x,%x] enter / to_user %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, to_buffer, cycle );
-#endif
-
-    // get cluster and local pointer on file descriptor
-    cxy_t        file_cxy = GET_CXY( file_xp );
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-
-    // get local pointer on remote pipe, and extended pointers on reader & writer
-    pipe_t * pipe_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->pipe ));
-    xptr_t reader_xp  = hal_remote_l64( XPTR( file_cxy , &pipe_ptr->reader_xp ));
-    xptr_t writer_xp  = hal_remote_l64( XPTR( file_cxy , &pipe_ptr->writer_xp ));
-
-assert( __FUNCTION__ , (pipe_ptr != NULL)       , "pipe_ptr cannot be NULL" );
-assert( __FUNCTION__ , (reader_xp != XPTR_NULL) , "reader_xp cannot be NULL" );
-assert( __FUNCTION__ , (writer_xp != XPTR_NULL) , "writer_xp cannot be NULL" );
-
-    // get pointers on associated remote_buf 
-    remote_buf_t * buf_ptr = hal_remote_lpt( XPTR( file_cxy , &pipe_ptr->buffer ));
-    xptr_t         buf_xp  = XPTR( file_cxy , buf_ptr );
-
-    ///////////////// pipe read
-    if( to_buffer )
-    {
-
-assert( __FUNCTION__, (reader_xp == XPTR(local_cxy , this)) , "illegal reader thread" );
-
-        // wait remote_buf_t non empty
-        while( 1 )
-        {
-            // get remote_buf status
-            int status = (int)remote_buf_status( buf_xp );
-
-            // move data when remote_buf non empty
-            if( status )    
-            {
-                // compute min(status , count)
-                nbytes = (status < (int)size) ? status : (int)size;
-
-                // move nbytes to user buffer
-                remote_buf_get_to_user( buf_xp,
-                                        u_buf,
-                                        nbytes );
-
-                // unblock writer thread
-                thread_unblock( writer_xp , THREAD_BLOCKED_IO );
-
-                // exit loop
-                break; 
-            }
-            else  // block and deschedule reader thread when remote_buf empty
-            {
-                thread_block( reader_xp , THREAD_BLOCKED_IO );
-                sched_yield( "pipe empty" );
-            }
-        }  // end while
-    }
-    ////////////////// pipe write
-    else
-    {
-
-assert( __FUNCTION__, (writer_xp == XPTR(local_cxy , this)) , "illegal writer thread" );
-
-        // wait remote_buf_t non full
-        while( 1 )
-        {
-            // get remote_buf status
-            int status = (int)remote_buf_status( buf_xp );
-
-            // get remote_buf length
-            int buflen  = 1 << hal_remote_l32( XPTR( file_cxy , &buf_ptr->order )); 
-
-            // move data when remote_buf non full
-            if( status < buflen )    
-            {
-                // compute min( buflen - status , size)
-                nbytes = ((buflen - status) < (int)size) ? (buflen - status) : (int)size;
-
-                // move nbytes from user buffer 
-                remote_buf_put_from_user( buf_xp,
-                                          u_buf,
-                                          nbytes );
-
-                // unblock reader thread
-                thread_unblock( reader_xp , THREAD_BLOCKED_IO );
-
-                // exit loop
-                break; 
-            }
-            else  // block and deschedule writer thread when remote_buf full
-            {
-                thread_block( writer_xp , THREAD_BLOCKED_IO );
-                sched_yield( "pipe full" );
-            }
-        }  // end while
-    }
-
-#if DEBUG_PIPE_MOVE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PIPE_MOVE < cycle )
-printk("\n[%s] thread[%x,%x] exit / to_user %d / nbytes %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, to_buffer, nbytes, cycle );
-#endif
-
-    return nbytes;
-
-}  // end pipe_user_move()
-
-
-
-
Index: trunk/kernel/kern/pipe.h
===================================================================
--- trunk/kernel/kern/pipe.h	(revision 690)
+++ 	(revision )
@@ -1,108 +1,0 @@
-/*
- * pipe.h - single writer, single reader pipe specification.  
- *
- * Author     Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-#ifndef _PIPE_H_
-#define _PIPE_H_
-
-#include <hal_kernel_types.h>
-
-/*******************************************************************************************
- * This structure defines a generic, single writer, single reader, inter-processes
- * communication channel, used to implement both the POSIX named fifos, and the POSIX
- * anonymous pipes.
- *
- * It uses the (lower level) remote_buf_t object and access functions, and can be
- * allocated in any cluster, and accessed by threads running in any cluster.
- * The default buffer size is defined by the CONFIG_PIPE_BUF_SIZE parameter.
- * It it accessed by the user processes through the POSIX read/write syscalls, that call
- * the pipe_move_user() to move data between the kernel remote buf and the user buffer.
- * These access functions are blocking when the kernel buffer is full (for a write),
- * or empty (for a read), and use a desheduling policy, blocking on THREAD_ BLOCKED_IO. 
- ******************************************************************************************/
- 
-typedef struct pipe_s
-{
-    remote_buf_t * buffer;       /*! local pointer on the remote_buf_t                    */
-    xptr_t         writer_xp;    /*! extended pointer on the writer thread                */
-    xptr_t         reader_xp;    /*! extended pointer on the reader thread                */
-}
-pipe_t;
-
-/*******************************************************************************************
- * This function allocates memory for the pipe descriptor, for the remote_buf descriptor,
- * and for the associated data buffer, in the cluster defined by the <cxy> argument.
- * The buffer size is defined by the <size> argument. 
- * The "buffer" field is set in the pipe descriptor, but the "writer_xp" and "reader_xp"
- * fields are not set by this function.
- *******************************************************************************************
- * @ cxy        : target cluster identifier.
- * @ size       : data buffer size (in bytes).
- * @ return a local pointer on pipe_t if success /:w NULL if error.
- ******************************************************************************************/
-pipe_t * pipe_create( cxy_t     cxy,
-                      uint32_t  size );
-
-/*******************************************************************************************
- * This function releases all memory allocated fo a pipe: pipe descriptor,
- * remote_buffer_t descriptor, and associated data buffer.
- *******************************************************************************************
- * @ pipe_xp    : extended pointer on target pipe.
- ******************************************************************************************/
-void pipe_destroy( xptr_t pipe_xp );
-
-/*******************************************************************************************
- * These two functions update the "writer_xp" or "reader_xp" field in the pipe descriptor.
- * They are called when the user process open a file descriptor to access the pipe.
- *******************************************************************************************
- * @ pipe_xp    : extended pointer on the target thread
- * @ thread_xp  : extended pointer on the client (writer/reader) thread.
- ******************************************************************************************/
-void pipe_register_writer( xptr_t pipe_xp,
-                           xptr_t thread_xp );
-
-void pipe_register_reader( xptr_t pipe_xp,
-                           xptr_t thread_xp );
-
-/*******************************************************************************************
- * This blocking function is called by the sys_read() and sys_write() functions.
- * It moves up to <size> bytes between an user buffer, defined by the <u_buf> argument,
- * and the kernel pipe, identified by the <file_xp> argument.
- * The file descriptor is always located in the same cluster as the pipe descriptor. 
- * The read/write direction is defined by the <to_buffer> argument. 
- * It returns the number of bytes actually moved.
- * It uses a desheduling policy, blocking on THREAD_ BLOCKED_IO. 
- *******************************************************************************************
- * @ to_buffer : pipe -> buffer if true / buffer -> pipe if false. 
- * @ file_xp   : extended pointer on the remote file descriptor.
- * @ u_buf     : user space buffer (virtual address).
- * @ size      : requested number of bytes to move.
- * @ return number of bytes actually moved if success / -1 if error.
- ******************************************************************************************/
-int pipe_user_move( bool_t   to_buffer,
-                    xptr_t   file_xp,
-                    void   * u_buf,
-                    uint32_t size );
-
-
-#endif	/* _PIPE_H_ */
Index: trunk/kernel/kern/printk.c
===================================================================
--- trunk/kernel/kern/printk.c	(revision 690)
+++ trunk/kernel/kern/printk.c	(revision 1)
@@ -2,5 +2,5 @@
  * printk.c - Kernel Log & debug messages API implementation.
  * 
- * authors  Alain Greiner (2016,2017,2018,2019,2020)
+ * authors  Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,102 +22,66 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_irqmask.h>
-#include <hal_special.h>
+#include <printk.h>
+#include <stdarg.h>
 #include <dev_txt.h>
-#include <remote_busylock.h>
+#include <remote_spinlock.h>
 #include <cluster.h>
-#include <thread.h>
-#include <chdev.h>
-#include <printk.h>
-#include <shared_syscalls.h>
 
 ///////////////////////////////////////////////////////////////////////////////////
-//      Extern 
+// This static function is called by printk(), nolock_printk() and user_printk()
 ///////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t  chdev_dir;  // defined in chdev.h / allocated in kernel_init.c
-
-//////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by printk(), nolock_printk(), and snprintk(),
-// functions to build a string from a printf-like <format>, and stores it 
-// in the buffer defined by the <string> and <size> arguments.
-// The <format> itself is supposed to be a NUL terminated string. The <string>
-// buffer <size> must be large enough to contains also the NUL terminating character.
-// If success, it returns the number of bytes actually copied in the <string> buffer,
-// but this length does NOT include the terminating NUL character.
-// It returns -2 in case of illegal format, it returns -1 if the formated string 
-// exceeds the <size> argument. 
-//////////////////////////////////////////////////////////////////////////////////////
-// @ string    : buffer allocated by caller.
-// @ size      : buffer size in bytes
-// @ format    : printf like format.
-// @ args      : va_list of arguments.
-// @ return string length if success / -1 if buffer too small / -2 if illegal format. 
-//////////////////////////////////////////////////////////////////////////////////////
-static int32_t format_to_string( char       * string,
-                                 uint32_t     size,
-                                 const char * format, 
-                                 va_list    * args ) 
-{
-
-#define TO_STRING(x) do { string[ps] = (x); ps++; if(ps==size) return -1; } while(0);
-
-    uint32_t   ps = 0;        // index in string buffer
-
-format_to_string_text:
-
-    // handle one character per iteration
-    while ( *format != 0 ) 
+static void kernel_printf( uint32_t   channel,
+                           char     * format, 
+                           va_list  * args ) 
+{
+
+printf_text:
+
+    while (*format) 
     {
-        if (*format == '%')   // copy argument to string
+        uint32_t i;
+        for (i = 0 ; format[i] && (format[i] != '%') ; i++);
+        if (i) 
+        {
+            dev_txt_sync_write( channel, format, i );
+            format += i;
+        }
+        if (*format == '%') 
         {
             format++;
-            goto format_to_string_arguments;
-        }
-        else                  // copy one char of format to string
-        {
-            TO_STRING( *format );
-            format++;
+            goto printf_arguments;
         }
     }
 
-    TO_STRING( 0 );      // NUL character written in buffer
-    return (ps - 1);     // but not counted in length
-
-format_to_string_arguments:
+    return;
+
+printf_arguments:
 
     {
-        char              buf[30];    // buffer to display one number
-        char *            pbuf;       // pointer on first char to display
-        uint32_t          len = 0;    // number of char to display
+        char      buf[20];
+        char    * pbuf = NULL;
+        uint32_t  len  = 0;
         static const char HexaTab[] = "0123456789ABCDEF";
-        uint32_t          i;
-        
-        switch (*format) 
+        uint32_t i;
+
+        switch (*format++) 
         {
-            case ('c'):             // one printable character 
-            {
-                buf[0] = (char)va_arg( *args , uint32_t );
-                pbuf   = buf;
-                len    = 1;
-                break;
-            }
-            case ('b'):             // one ASCII code value (2 hexadecimal digits)
-            {
-                uint8_t val = (uint8_t)va_arg( *args , uint32_t ); 
-                buf[1] = HexaTab[val & 0xF];
-                buf[0] = HexaTab[(val >> 4) & 0xF];
-                pbuf   = buf;
-                len    = 2;
-                break;
-            }            
-            case ('d'):            // one int32_t (up to 10 decimal digits after sign) 
-            {
-                int32_t val = va_arg( *args , int32_t );
+            case ('c'):             /* char conversion */
+            {
+                int val = va_arg( *args , int );
+                len = 1;
+                buf[0] = val;
+                pbuf = &buf[0];
+                break;
+            }
+            case ('d'):             /* 32 bits decimal signed  */
+            {
+                int val = va_arg( *args , int );
                 if (val < 0) 
                 {
-                    TO_STRING( '-' );
                     val = -val;
+                    dev_txt_sync_write( channel, "-" , 1 );
                 }
                 for(i = 0; i < 10; i++) 
@@ -130,5 +94,5 @@
                 break;
             }
-            case ('u'):           // one uint32_t (up to 10 decimal digits)
+            case ('u'):             /* 32 bits decimal unsigned  */
             {
                 uint32_t val = va_arg( *args , uint32_t );
@@ -142,15 +106,12 @@
                 break;
             }
-            case ('x'):           // one uint32_t (up to 8 hexa digits after "0x")
-
+            case ('x'):             /* 32 bits hexadecimal unsigned */
             {
                 uint32_t val = va_arg( *args , uint32_t );
-                TO_STRING( '0' );
-                TO_STRING( 'x' );
-                for(i = 0 ; i < 8 ; i++) 
-                {
-                    buf[7 - i] = HexaTab[val & 0xF];
-                    val = val >> 4;
-                    if(val == 0)  break;
+                dev_txt_sync_write( channel, "0x" , 2 );
+                for(i = 0; i < 8; i++) 
+                {
+                    buf[7 - i] = HexaTab[val % 16];
+                    if (!(val = (val>>4)))  break;
                 }
                 len =  i + 1;
@@ -158,29 +119,25 @@
                 break;
             }
-            case ('X'):         // one uint32_t (exactly 8 hexa digits after "0x")
+            case ('X'):             /* 32 bits hexadecimal unsigned  on 10 char*/
             {
                 uint32_t val = va_arg( *args , uint32_t );
-                TO_STRING( '0' );
-                TO_STRING( 'x' );
-                for(i = 0 ; i < 8 ; i++) 
-                {
-                    buf[7 - i] = (val != 0) ? HexaTab[val & 0xF] : '0';
-                    val = val >> 4;
-                }
-                len = 8;
-                pbuf = &buf[0];
-                break;
-            }
-            case ('l'):          // one uint64_t (up to 16 digits hexa after "0x")
-            {
-                uint64_t val = (((uint64_t)va_arg( *args, uint32_t)) << 32) |
-                               ((uint64_t)va_arg( *args, uint32_t));
-                TO_STRING( '0' );
-                TO_STRING( 'x' );
-                for(i = 0 ; i < 16 ; i++) 
-                {
-                    buf[15 - i] = HexaTab[val & 0xF];
-                    val = val >> 4;
-                    if( val == 0)  break;
+                dev_txt_sync_write( channel, "0x" , 2 );
+                for(i = 0; i < 8; i++) 
+                {
+                    buf[7 - i] = HexaTab[val % 16];
+                    val = (val>>4);
+                }
+                len =  8;
+                pbuf = buf;
+                break;
+            }
+            case ('l'):            /* 64 bits hexadecimal unsigned */
+            {
+                uint64_t val = va_arg( *args , uint64_t );
+                dev_txt_sync_write( channel, "0x" , 2 );
+                for(i = 0; i < 16; i++) 
+                {
+                    buf[15 - i] = HexaTab[val % 16];
+                    if (!(val /= 16))  break;
                 }
                 len =  i + 1;
@@ -188,468 +145,77 @@
                 break;
             }
-            case ('L'):          // one uint64_t (exactly 16 digits hexa after "0x")
-            {
-                uint64_t val = (((uint64_t)va_arg( *args, uint32_t)) << 32) |
-                               ((uint64_t)va_arg( *args, uint32_t));
-                TO_STRING( '0' );
-                TO_STRING( 'x' );
-                for(i = 0 ; i < 16 ; i++) 
-                {
-                    buf[15 - i] = (val != 0) ? HexaTab[val & 0xF] : '0';
-                    val = val >> 4;
-                }
-                len =  16;
-                pbuf = &buf[0];
-                break;
-            }
-            case ('s'):             /* one characters string */
+            case ('s'):             /* string */
             {
                 char* str = va_arg( *args , char* );
-                while (str[len]) { len++; }
+                while (str[len]) 
+                {
+                    len++;
+                }
                 pbuf = str;
                 break;
             }
-            default:       // unsupported argument type
-            {
-                return -2;
-            }
-        }  // end switch on  argument type
-
-        format++;
-
-        // copy argument sub-string to the string buffer
-        for( i = 0 ; i < len ; i++ )
-        {
-            TO_STRING( pbuf[i] );
+            default:
+            {
+                dev_txt_sync_write( channel ,
+                                    "\n[PANIC] in kernel_printf() : illegal format\n", 45 );
+            }
         }
+
+        if( pbuf != NULL ) dev_txt_sync_write( channel, pbuf, len );
         
-        goto format_to_string_text;
+        goto printf_text;
     }
-}   // end format_to_string()
-
-//////////////////////////////////
-void printk( char * format , ... )
-{
-    char          buffer[CONFIG_PRINTK_BUF_SIZE];
+
+}  // end kernel_printf()
+
+///////////////////////////////////////
+void nolock_printk( char* format, ...)
+{
+    va_list   args;
+
+    // call kernel_printf
+    va_start( args , format );
+    kernel_printf( 0, format , &args );
+    va_end( args );
+}
+
+////////////////////////////////
+void printk( char* format, ...)
+{
     va_list       args;
-    int32_t       length;
-
-    // build args va_list
+    uint32_t  save_sr;
+
+    // disable IRQs
+    hal_disable_irq( &save_sr );
+
+    // get TXT0 lock
+    cluster_t * cluster = LOCAL_CLUSTER;
+    remote_spinlock_lock( XPTR( cluster->io_cxy , &cluster->txt0_lock ) );
+
+    // call kernel_printf
     va_start( args , format );
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock
-    remote_busylock_acquire( lock_xp );
-
-    // build a string from format
-    length = format_to_string( buffer,
-                               CONFIG_PRINTK_BUF_SIZE,
-                               format,
-                               &args );
+    kernel_printf( 0, format , &args );
     va_end( args );
 
-    if( length > 0  )        // call TXT driver to display formated string on TXT0
-    {
-        dev_txt_sync_write( buffer , length );
-    }
-    else if( length == -2 )  // illegal format => display a warning on TXT0
-    {
-        thread_t * this = CURRENT_THREAD;
-
-        nolock_printk("\n[PANIC] from printk : illegal format\n"
-                      "thread[%x,%x] on core[%x,%d] at cycle %l\n",
-                      this->process->pid, this->trdid,
-                      local_cxy, this->core->lid, hal_get_cycles() );
-    }
-    else                     // format too long => display a warning on TXT0
-    {
-        thread_t * this = CURRENT_THREAD;
-
-        nolock_printk("\n[PANIC] from printk : formated string too long\n"
-                      "thread[%x,%x] on core[%x,%d] at cycle %l\n",
-                      this->process->pid, this->trdid,
-                      local_cxy, this->core->lid, hal_get_cycles() );
-    }
-
     // release TXT0 lock
-    remote_busylock_release( lock_xp );
-
-}   // end printk()
-
-/////////////////////////////////////////
-void nolock_printk( char * format , ... )
-{
-    char          buffer[CONFIG_PRINTK_BUF_SIZE];
-    va_list       args;
-    int32_t       length;
-
-    // build args va_list
+    remote_spinlock_unlock( XPTR( cluster->io_cxy , &cluster->txt0_lock ) );
+
+    // restore IRQs
+    hal_restore_irq( save_sr );
+}
+
+/////////////////////////////////////
+void user_printk( char* format, ...)
+{
+    va_list   args;
+
+    // get calling thread TXT channel TODO
+    uint32_t channel = 0;
+
+    // call kernel_printf
     va_start( args , format );
-
-    // build a string from format
-    length = format_to_string( buffer,
-                               CONFIG_PRINTK_BUF_SIZE,
-                               format,
-                               &args );
+    kernel_printf( channel, format , &args );
     va_end( args );
-
-    if( length > 0  )        // call TXT driver to display formated string on TXT0
-    {
-        dev_txt_sync_write( buffer , length );
-    }
-    else if( length == -2 )  // illegal format => display a warning on TXT0
-    {
-        thread_t * this = CURRENT_THREAD;
-
-        nolock_printk("\n[PANIC] from print : illegal format\n"
-                      "thread[%x,%x] on core[%x,%d] at cycle %l\n",
-                      this->process->pid, this->trdid,
-                      local_cxy, this->core->lid, hal_get_cycles() );
-    }
-    else                  // buffer too small => display a warning on TXT0
-    {
-        thread_t * this = CURRENT_THREAD;
-
-        nolock_printk("\n[PANIC] from printk : formated string too long\n"
-                      "thread[%x,%x] on core[%x,%d] at cycle %l\n",
-                      this->process->pid, this->trdid,
-                      local_cxy, this->core->lid, hal_get_cycles() );
-    }
-
-}   // end nolock_printk()
-
-//////////////////////////////////////
-void assert( const char   * func_name,
-             bool_t         expr,
-             char         * format , ... )
-{
-    if( expr == false )
-    {
-        thread_t * this  = CURRENT_THREAD;
-        trdid_t    trdid = this->trdid;
-        pid_t      pid   = this->process->pid;
-        uint32_t   lid   = this->core->lid;
-        uint32_t   cycle = (uint32_t)hal_get_cycles();
-
-        char       buffer[CONFIG_PRINTK_BUF_SIZE];
-        va_list    args;
-
-        va_start( args , format );
-
-        // build a string from format
-        int32_t   length = format_to_string( buffer,
-                                             CONFIG_PRINTK_BUF_SIZE,
-                                             format,
-                                             &args );
-        va_end( args );
-
-        if( length > 0  )  // display panic message on TXT0, including formated string
-        {
-            printk("\n[ASSERT] in %s / core[%x,%d] / thread[%x,%x] / cycle %d\n   <%s>\n",
-            func_name, local_cxy, lid, pid, trdid, cycle, buffer );
-        }
-        else              // display minimal panic message on TXT0
-        {
-            printk("\n[ASSERT] in %s / core[%x,%d] / thread[%x,%x] / cycle %d\n",
-            func_name, local_cxy, lid, pid, trdid, cycle );
-        }
-    }
-}   // end assert( __FUNCTION__,)
-   
-//////////////////////////////////////
-int32_t snprintk( char       * buffer,
-                  uint32_t     size,
-                  char       * format, ... )
-{
-    va_list       args;
-    int32_t       length;
-
-    // build args va_list
-    va_start( args , format );
-
-    // build a string from format
-    length = format_to_string( buffer , size , format , &args );
-
-    // release args list
-    va_end( args );
-
-    if( length < 0 )   return -1;
-    else               return length;
-
-}   // end snprintk()
-
-////////////////////////////////
-void puts( const char * string ) 
-{
-    uint32_t   n = 0;
-
-    // compute string length
-    while ( string[n] > 0 ) n++;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    if( txt0_xp != XPTR_NULL )
-    {
-        // get extended pointer on remote TXT0 lock
-        xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-        // display string on TTY0
-        remote_busylock_acquire( lock_xp );
-        dev_txt_sync_write( string , n );
-        remote_busylock_release( lock_xp );
-    }
-}   // end puts()
-
-///////////////////////////////////////
-void nolock_puts( const char * string ) 
-{
-    uint32_t   n = 0;
-
-    // compute string length
-    while ( string[n] > 0 ) n++;
-
-    // display string on TTY0
-    dev_txt_sync_write( string , n );
-  
-}   // end nolock_puts()
-
-
-
-/////////////////////////
-void putx( uint32_t val )
-{
-    static const char HexaTab[] = "0123456789ABCDEF";
-
-    char      buf[10];
-    uint32_t  c;
-
-    buf[0] = '0';
-    buf[1] = 'x';
-
-    // build buffer
-    for (c = 0; c < 8; c++) 
-    { 
-        buf[9 - c] = HexaTab[val & 0xF];
-        val = val >> 4;
-    }
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    if( txt0_xp != XPTR_NULL )
-    {
-        // get extended pointer on remote TXT0 chdev lock
-        xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-        // display buf on TTY0
-        remote_busylock_acquire( lock_xp );
-        dev_txt_sync_write( buf , 10 );
-        remote_busylock_release( lock_xp );
-    }
-}   // end putx()
-
-////////////////////////////////
-void nolock_putx( uint32_t val )
-{
-    static const char HexaTab[] = "0123456789ABCDEF";
-
-    char      buf[10];
-    uint32_t  c;
-
-    buf[0] = '0';
-    buf[1] = 'x';
-
-    // build buffer
-    for (c = 0; c < 8; c++) 
-    { 
-        buf[9 - c] = HexaTab[val & 0xF];
-        val = val >> 4;
-    }
-
-    // display buf on TTY0
-    dev_txt_sync_write( buf , 10 );
-
-}   // end nilock_putx()
-
-////////////////////////
-void putd( int32_t val )
-{
-    static const char HexaTab[] = "0123456789ABCDEF";
-
-    char      buf[10];
-    uint32_t  i;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 chdev lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    if( txt0_xp != XPTR_NULL )
-    {
-        // get TXT0 lock 
-        remote_busylock_acquire( lock_xp );
-
-        if (val < 0) 
-        {
-            val = -val;
-            dev_txt_sync_write( "-" , 1 );
-        }
-
-        for(i = 0; i < 10 ; i++) 
-        {
-            buf[9 - i] = HexaTab[val % 10];
-            if (!(val /= 10)) break;
-        }
-
-        // display buf on TTY0
-        dev_txt_sync_write( &buf[9-i] , i+1 );
-
-        // release TXT0 lock
-        remote_busylock_release( lock_xp );
-    }
-}   // end putd()
-
-///////////////////////////////
-void nolock_putd( int32_t val )
-{
-    static const char HexaTab[] = "0123456789ABCDEF";
-
-    char      buf[10];
-    uint32_t  i;
-
-    if (val < 0) 
-    {
-        val = -val;
-        dev_txt_sync_write( "-" , 1 );
-    }
-
-    for(i = 0; i < 10 ; i++) 
-    {
-        buf[9 - i] = HexaTab[val % 10];
-        if (!(val /= 10)) break;
-    }
-
-    // display buf on TTY0
-    dev_txt_sync_write( &buf[9-i] , i+1 );
-
-}   // end nolock_putd()
-
-/////////////////////////
-void putl( uint64_t val )
-{
-    static const char HexaTab[] = "0123456789ABCDEF";
-
-    char      buf[18];
-    uint32_t  c;
-
-    buf[0] = '0';
-    buf[1] = 'x';
-
-    // build buffer
-    for (c = 0; c < 16; c++) 
-    { 
-        buf[17 - c] = HexaTab[(unsigned int)val & 0xF];
-        val = val >> 4;
-    }
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    if( txt0_xp != XPTR_NULL )
-    {
-        // get extended pointer on remote TXT0 chdev lock
-        xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-        // display string on TTY0
-        remote_busylock_acquire( lock_xp );
-        dev_txt_sync_write( buf , 18 );
-        remote_busylock_release( lock_xp );
-    }
-}   // end putl()
-
-////////////////////////////////
-void nolock_putl( uint64_t val )
-{
-    static const char HexaTab[] = "0123456789ABCDEF";
-
-    char      buf[18];
-    uint32_t  c;
-
-    buf[0] = '0';
-    buf[1] = 'x';
-
-    // build buffer
-    for (c = 0; c < 16; c++) 
-    { 
-        buf[17 - c] = HexaTab[(unsigned int)val & 0xF];
-        val = val >> 4;
-    }
-
-    // display string on TTY0
-    dev_txt_sync_write( buf , 18 );
-
-}   // end nolock_putl()
-
-/////////////////////////////
-void putb( char     * string,
-           uint8_t  * buffer,
-           uint32_t   size )
-{
-    uint32_t line;
-    uint32_t byte;
-    uint32_t nlines;
-
-    nlines = size >> 4;
-    if( size & 0xF ) nlines++;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 chdev lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    if( txt0_xp != XPTR_NULL )
-    {
-        // get TXT0 lock 
-        remote_busylock_acquire( lock_xp );
-
-        // display string on TTY0
-        nolock_printk("\n***** %s *****\n", string );
-
-        for ( line = 0 , byte = 0 ; line < nlines ; line++ )
-        {
-            nolock_printk(" %X | %b %b %b %b | %b %b %b %b | %b %b %b %b | %b %b %b %b |\n",
-            buffer + byte,
-            buffer[byte+ 0],buffer[byte+ 1],buffer[byte+ 2],buffer[byte+ 3],
-            buffer[byte+ 4],buffer[byte+ 5],buffer[byte+ 6],buffer[byte+ 7],
-            buffer[byte+ 8],buffer[byte+ 9],buffer[byte+10],buffer[byte+11],
-            buffer[byte+12],buffer[byte+13],buffer[byte+14],buffer[byte+15] );
-
-            byte += 16;
-        }
-
-        // release TXT0 lock
-        remote_busylock_release( lock_xp );
-    }
-}   // end putb()
+}
 
 
Index: trunk/kernel/kern/printk.h
===================================================================
--- trunk/kernel/kern/printk.h	(revision 690)
+++ trunk/kernel/kern/printk.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
  * printk.h - Kernel Log & debug messages API definition.
- *
- * authors  Alain Greiner (2016,2017,2018,2019,2020)
+ * 
+ * authors  Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -24,17 +24,9 @@
 ///////////////////////////////////////////////////////////////////////////////////
 // The printk.c and printk.h files define the functions used by the kernel
-// to build, or display on terminal TXT0, formated strings.
-// In case ofdisplay, it calls synchronously the TXT0 driver, without descheduling.
-//
-// The supported formats are defined below :
-//   %c : single ascii character (8 bits)
-//   %b : exactly 2 hexadecimal digits (8 bits)
-//   %d : up to 10 digits decimal integer (32 bits)
-//   %u : up to 10 digits unsigned decimal (32 bits) 
-//   %x : up to 8 digits hexadecimal integer (32 bits) 
-//   %X : exactly 8 digits hexadecimal integer (32 bits) 
-//   %l : up to 16 digits hexadecimal integer (64 bits)
-//   %L : exactly 16 digits hexadecimal integer (64 bits)
-//   %s : NUL terminated character string
+// to display messages on the kernel text terminal, using a busy waiting
+// policy if required : these functions does not use the TXT kernel thread,
+// and does not deschedule if TXT peripheral is not available.
+// These functions use the generic TXT device to call the proper implementation
+// dependant TXT driver.
 ///////////////////////////////////////////////////////////////////////////////////
 
@@ -42,112 +34,131 @@
 #define _PRINTK_H
 
-#include <hal_kernel_types.h>
-#include <stdarg.h>
+///////////////////////////////////////////////////////////////////////////////////
+//       Access functions to kernel terminal TTY0 
+///////////////////////////////////////////////////////////////////////////////////
 
-#include <hal_special.h> 
+extern void         printk( char* format, ... );
 
-/**********************************************************************************
- * These functions display a formated string defined by the <format,...>
- * argument on the kernel terminal TXT0, with or without taking the TXT0 lock. 
- **********************************************************************************
- * Implementation note:
- * It uses a buffer allocated in the stack, defined by CONFIG_PRINTK_BUFFER_SIZE.
- * It calls the snprintk() function to build a printable string in this buffer, 
- * and calls directly the dev_txt_sync_write() driver function without using the
- * TXT server thread.
- * It displays a [PANIC] message on kernel TXT0 terminal if the formated string
- * exceeds the buffer size, or if the format is undefined. 
- **********************************************************************************
- * @ format     : formatted string.
- *********************************************************************************/
-void printk       ( char * format, ... );
-void nolock_printk( char * format, ... );
+extern void         nolock_printk( char* format, ... );
 
-/**********************************************************************************
- * This function displays an [ASSERT] message on kernel TXT0 terminal
- * if Boolean expression <expr> is false. It prints a detailed message including:
- * - the calling core [cxy,lpid]
- * - the calling thread[pid,trdid]
- * - the current cycle
- * - the <func_name> argument
- * - the <string> argument
- **********************************************************************************
- * @ func_name  : calling function name.
- * @ expr       : Boolean expression to be checked.
- * @ format     : formated message argument.
- *********************************************************************************/
-void assert( const char   * func_name,
-             bool_t         expr,
-             char         * format , ... );
+extern void         user_printk( char* format, ... );
 
-/**********************************************************************************
- * This function build a formated string in a buffer defined by the <buffer> 
- * and <buf_size> arguments, from the format defined by the <format,...> argument.
- * This function set the NUL terminating character in target <buffer>,
- * but the returned length does not include this NUL character.
- **********************************************************************************
- * @ buffer     : pointer on target buffer (allocated by caller).
- * @ buf_size   : target buffer length (number of bytes).
- * @ format     : format respecting the printf syntax.
- * @ returns  string length (not including NUL) if success / -1 if error.
- *********************************************************************************/
-int32_t snprintk( char       * buffer,
-                  uint32_t     buf_size,
-                  char       * format, ... );
+///////////////////////////////////////////////////////////////////////////////////
+//       Conditionnal debug macros
+///////////////////////////////////////////////////////////////////////////////////
 
-/**********************************************************************************
- * These functions displays a non-formated string on TXT0 terminal.
- * They are actually used for low level debug, and call directly the TXT driver,
- * without using the TXT server thread.
- **********************************************************************************
- * @ string   : non-formatted, NUL terminated string.
- *********************************************************************************/
-void puts( const char * string );
-void nolock_puts( const char * string );
+#if CONFIG_CORE_DEBUG
+#define core_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define core_dmsg(...)
+#endif
 
-/**********************************************************************************
- * These functions display a 32 bits value in hexadecimal on TXT0 terminal.
- * They are actually used for low level debug, and call directly the TXT driver,
- * without using the TXT server thread.
- **********************************************************************************
- * @ val   : 32 bits unsigned value.
- *********************************************************************************/
-void putx( uint32_t val );
-void nolock_putx( uint32_t val );
+#if CONFIG_DQDT_DEBUG
+#define dqdt_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define dqdt_dmsg(...)
+#endif
 
-/**********************************************************************************
- * These functions display a 32 bits signed value in decimal on TXT0 terminal.
- * They are actually used for low level debug, and call directly the TXT driver,
- * without using the TXT server thread.
- **********************************************************************************
- * @ val   : 32 bits signed value.
- *********************************************************************************/
-void putd( int32_t val );
-void nolock_putd( int32_t val );
+#if CONFIG_ELF_DEBUG
+#define elf_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define elf_dmsg(...)
+#endif
 
-/**********************************************************************************
- * These functions display a 64 bits value in hexadecimal on TXT0 terminal.
- * They are actually used low level debug, and call directly the TXT driver,
- * without using the TXT server thread.
- **********************************************************************************
- * @ val   : 64 bits unsigned value.
- *********************************************************************************/
-void putl( uint64_t val );
-void nolock_putl( uint64_t val );
+#if CONFIG_FORK_DEBUG
+#define fork_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define fork_dmsg(...)
+#endif
 
-/**********************************************************************************
- * This debug function displays on the TXT0 terminal the content of an
- * array of bytes defined by <buffer> and <size> arguments (16 bytes per line).
- * The <string> argument is displayed before the buffer content.
- * The line format is an address followed by 16 (hexa) bytes.
- **********************************************************************************
- * @ string   : buffer name or identifier.
- * @ buffer   : local pointer on bytes array.
- * @ size     : number of bytes to display.
- *********************************************************************************/
-void putb( char     * string,
-           uint8_t  * buffer,
-           uint32_t   size );
+#if CONFIG_EXEC_DEBUG
+#define exec_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define exec_dmsg(...)
+#endif
 
+#if CONFIG_ICU_DEBUG
+#define icu_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define icu_dmsg(...)
+#endif
+
+#if CONFIG_IOC_DEBUG
+#define ioc_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define ioc_dmsg(...)
+#endif
+
+#if CONFIG_KINIT_DEBUG
+#define kinit_dmsg(...) printk(__VA_ARGS__)
+#else
+#define kinit_dmsg(...)
+#endif
+
+#if CONFIG_KMEM_DEBUG
+#define kmem_dmsg(...) printk(__VA_ARGS__)
+#else
+#define kmem_dmsg(...)
+#endif
+
+#if CONFIG_MMC_DEBUG
+#define mmc_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define mmc_dmsg(...)
+#endif
+
+#if CONFIG_NIC_DEBUG
+#define nic_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define nic_dmsg(...)
+#endif
+
+#if CONFIG_PIC_DEBUG
+#define pic_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define pic_dmsg(...)
+#endif
+
+#if CONFIG_PROCESS_DEBUG
+#define process_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define process_dmsg(...)
+#endif
+
+#if CONFIG_RPC_DEBUG
+#define rpc_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define rpc_dmsg(...)
+#endif
+
+#if CONFIG_SCHED_DEBUG
+#define sched_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define sched_dmsg(...)
+#endif
+
+#if CONFIG_THREAD_DEBUG
+#define thread_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define thread_dmsg(...)
+#endif
+
+#if CONFIG_TXT_DEBUG
+#define txt_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define txt_dmsg(...)
+#endif
+
+#if CONFIG_VFS_DEBUG
+#define vfs_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define vfs_dmsg(...)
+#endif
+
+#if CONFIG_VMM_DEBUG
+#define vmm_dmsg(...)   printk(__VA__ARGS__)
+#else
+#define vmm_dmsg(...)
+#endif
 
 
Index: trunk/kernel/kern/process.c
===================================================================
--- trunk/kernel/kern/process.c	(revision 690)
+++ trunk/kernel/kern/process.c	(revision 1)
@@ -1,18 +1,18 @@
 /*
- * process.c - process related functions definition.
- *
- * Authors  Ghassan Almaless       (2008,2009,2010,2011,2012)
+ * process.c - process related management
+ * 
+ * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
  *          Mohamed Lamine Karaoui (2015)
- *          Alain Greiner          (2016,2017,2018,2019,2020)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
  *
- * This file is part of ALMOS-MKH.
+ * This file is part of ALMOS-MKH..
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-MKH. is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-MKH. is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -20,14 +20,12 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_remote.h>
 #include <hal_uspace.h>
-#include <hal_irqmask.h>
-#include <hal_vmm.h>
 #include <errno.h>
 #include <printk.h>
@@ -40,14 +38,7 @@
 #include <core.h>
 #include <thread.h>
-#include <chdev.h>
-#include <ksocket.h>
 #include <list.h>
-#include <string.h>
 #include <scheduler.h>
-#include <busylock.h>
-#include <queuelock.h>
-#include <remote_queuelock.h>
-#include <rwlock.h>
-#include <remote_rwlock.h>
+#include <remote_spinlock.h>
 #include <dqdt.h>
 #include <cluster.h>
@@ -56,6 +47,4 @@
 #include <process.h>
 #include <elf.h>
-#include <syscalls.h>
-#include <shared_syscalls.h>
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -63,6 +52,5 @@
 //////////////////////////////////////////////////////////////////////////////////////////
 
-extern process_t           process_zero;     // allocated in kernel_init.c
-extern chdev_directory_t   chdev_dir;        // allocated in kernel_init.c
+extern process_t process_zero;
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -70,315 +58,103 @@
 //////////////////////////////////////////////////////////////////////////////////////////
 
-////////////////////////////////////////////////////
-error_t process_reference_init( process_t * process,
-                                pid_t       pid,
-                                xptr_t      parent_xp )
-{
-    error_t     error;
-    xptr_t      process_xp;
-    cxy_t       parent_cxy;
-    process_t * parent_ptr;
-    xptr_t      stdin_xp;
-    xptr_t      stdout_xp;
-    xptr_t      stderr_xp;
-    uint32_t    stdin_id;
-    uint32_t    stdout_id;
-    uint32_t    stderr_id;
-    uint32_t    txt_id;
-    char        rx_path[40];
-    char        tx_path[40];
-    pid_t       parent_pid;
-    vmm_t     * vmm;
-
-#if DEBUG_PROCESS_REFERENCE_INIT || DEBUG_PROCESS_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // build extended pointer on reference process
-    process_xp = XPTR( local_cxy , process );
-
-    // get pointer on process vmm
-    vmm = &process->vmm;
-
-    // get parent process cluster and local pointer
-    parent_cxy = GET_CXY( parent_xp );
-    parent_ptr = GET_PTR( parent_xp );
-
-    // get parent_pid
-    parent_pid = hal_remote_l32( XPTR( parent_cxy , &parent_ptr->pid ) );
-
-#if DEBUG_PROCESS_REFERENCE_INIT
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] enter to initialize process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, cycle );
-#endif
-
-    // initialize pid, ref_xp, parent_xp, owner_xp, term_state fields
-	process->pid        = pid;
-    process->ref_xp     = XPTR( local_cxy , process );
-    process->owner_xp   = XPTR( local_cxy , process );
-    process->parent_xp  = parent_xp;
-    process->term_state = 0;
-
-    // initialize VFS root inode and CWD inode
-    process->vfs_root_xp = hal_remote_l64( XPTR( parent_cxy, &parent_ptr->vfs_root_xp ) );
-    process->cwd_xp      = hal_remote_l64( XPTR( parent_cxy, &parent_ptr->cwd_xp ) );
-
-    // initialize VSL as empty
-    vmm->vsegs_nr = 0;
-	xlist_root_init( XPTR( local_cxy , &vmm->vsegs_root ) );
-
-    // create an empty GPT as required by the architecture
-    error = hal_gpt_create( &vmm->gpt );
-    if( error ) 
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create empty GPT / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] created empty GPT for process %x\n",
-__FUNCTION__, parent_pid, this->trdid, pid );
-#endif
-
-    // initialize VSL lock
-	remote_rwlock_init( XPTR( local_cxy , &vmm->vsl_lock ) , LOCK_VMM_VSL );
-
-    // register kernel vsegs in user process VMM as required by the architecture
-    error = hal_vmm_kernel_update( process );
-    if( error ) 
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register kernel vsegs in VMM / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        printk("\n[ERROR] in %s : cannot register kernel vsegs in VMM\n", __FUNCTION__ );
-        return -1;
-    }
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] registered kernel vsegs in VSL for process %x\n",
-__FUNCTION__, parent_pid, this->trdid, pid );
-#endif
-
-    // create "args" and "envs" vsegs
-    // create "stacks" and "mmap" vsegs allocators 
-    // initialize locks protecting GPT and VSL
-    error = vmm_user_init( process );
-    if( error ) 
-    {
-        printk("\n[ERROR] in %s : cannot register user vsegs in VMM\n", __FUNCTION__ );
-        return -1;
-    }
- 
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] initialized vmm for process %x\n", 
-__FUNCTION__, parent_pid, this->trdid, pid );
-#endif
-
-    // initialize fd_array as empty
-    process_fd_init( process );
-
-    // define the stdin/stdout/stderr pseudo files <=> select a TXT terminal.
-    if( (pid == 1) || (parent_pid  == 1) )      // INIT or KSH  process
-    {
-        // select a TXT channel
-        if( pid == 1 )  txt_id = 0;                     // INIT
-        else            txt_id = process_txt_alloc();   // KSH
-
-        // attach process to TXT
-        process_txt_attach( process_xp , txt_id ); 
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] / process %x attached to TXT%d / cycle %d\n", 
-__FUNCTION__, parent_pid, this->trdid, pid, txt_id, cycle );
-#endif
-        // build path to TXT_RX[i] and TXT_TX[i] chdevs
-        snprintk( rx_path , 40 , "/dev/external/txt%d_rx", txt_id );
-        snprintk( tx_path , 40 , "/dev/external/txt%d_tx", txt_id );
-
-        // create stdin pseudo file          
-        error = vfs_open(  process->vfs_root_xp,
-                           rx_path,
-                           process_xp,
-                           O_RDONLY, 
-                           0,                // FIXME chmod
-                           &stdin_xp, 
-                           &stdin_id );
-        if( error )
-        {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot open stdin pseudo file / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-
-assert( __FUNCTION__, (stdin_id == 0) , "stdin index must be 0" );
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] / stdin open for process %x / cycle %d\n", 
-__FUNCTION__, parent_pid, this->trdid, pid, cycle );
-#endif
-
-        // create stdout pseudo file          
-        error = vfs_open(  process->vfs_root_xp,
-                           tx_path,
-                           process_xp,
-                           O_WRONLY, 
-                           0,                // FIXME chmod
-                           &stdout_xp, 
-                           &stdout_id );
-        if( error )
-        {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot open stdout pseudo file / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-
-assert( __FUNCTION__, (stdout_id == 1) , "stdout index must be 1" );
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] / stdout open for process %x / cycle %d\n", 
-__FUNCTION__, parent_pid, this->trdid, pid, cycle );
-#endif
-
-        // create stderr pseudo file          
-        error = vfs_open(  process->vfs_root_xp,
-                           tx_path,
-                           process_xp,
-                           O_WRONLY, 
-                           0,                // FIXME chmod
-                           &stderr_xp, 
-                           &stderr_id );
-        if( error )
-        {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot open stderr pseudo file / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-
-assert( __FUNCTION__, (stderr_id == 2) , "stderr index must be 2" );
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] / stderr open for process %x / cycle %d\n", 
-__FUNCTION__, parent_pid, this->trdid, pid, cycle );
-#endif
-
-    }
-    else                                            // normal user process 
-    {
-        // get parent process TXT index
-        txt_id = process_txt_get_index( parent_xp );
-
-        // attach child process to same TXT terminal as parent
-        process_txt_attach( process_xp , txt_id ); 
-
-        // recreate all open files from parent process fd_array to child process fd_array
-        error = process_fd_replicate( process_xp , parent_xp );
-
-        if( error )
-        {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot replicate fd_array / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            return -1;
-        }
-
-    }
-
-    // initialize lock protecting CWD changes
-    remote_busylock_init( XPTR( local_cxy , &process->cwd_lock ), LOCK_PROCESS_CWD );
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] / set fd_array for process %x / cycle %d\n", 
-__FUNCTION__, parent_pid, this->trdid, pid , cycle );
-#endif
-
-    // reset children list root 
+///////////////////////////
+process_t * process_alloc()
+{
+	kmem_req_t   req;
+
+    req.type  = KMEM_PROCESS;
+	req.size  = sizeof(process_t);
+	req.flags = AF_KERNEL;
+
+    return (process_t *)kmem_alloc( &req );
+}
+
+////////////////////////////////////////
+void process_free( process_t * process )
+{
+    kmem_req_t  req;
+
+	req.type = KMEM_PROCESS;
+	req.ptr  = process;
+	kmem_free( &req );
+}
+
+////////////////////////////////////////////
+void process_zero_init( boot_info_t * info )
+{
+    // reset process descriptor
+	memset( &process_zero , 0 , sizeof(process_t) );
+
+    // initialize kernel code & data vsegs base addresses
+	process_zero.vmm.code_vpn_base = (vpn_t)(info->kernel_code_start >> CONFIG_PPM_PAGE_SHIFT);
+	process_zero.vmm.data_vpn_base = (vpn_t)(info->kernel_data_start >> CONFIG_PPM_PAGE_SHIFT);
+
+    // reset threads and childs number
+	process_zero.th_nr       = 0;
+	process_zero.children_nr = 0;
+
+    // set PID 
+	process_zero.pid            = 0;
+}
+
+/////////////////////////////////////////////////
+void process_reference_init( process_t * process,
+                             pid_t       pid,
+                             pid_t       ppid )
+{
+    // reset signal manager  TODO [AG]
+
+    // reset the file descriptors array 
+	process_fd_init( process );
+
+    // reset the process files structures and cd_lock
+	process->vfs_root_xp     = XPTR_NULL;
+	process->vfs_cwd_xp      = XPTR_NULL;
+	process->vfs_bin_xp      = XPTR_NULL;
+
+    spinlock_init( &process->cd_lock );
+
+    // reset children list root
     xlist_root_init( XPTR( local_cxy , &process->children_root ) );
-    process->children_nr     = 0;
-    remote_queuelock_init( XPTR( local_cxy,
-                                 &process->children_lock ), LOCK_PROCESS_CHILDREN );
-
-    // reset semaphore / mutex / barrier / condvar list roots and lock
+	process->children_nr     = 0;
+
+    // reset semaphore list root
     xlist_root_init( XPTR( local_cxy , &process->sem_root ) );
-    xlist_root_init( XPTR( local_cxy , &process->mutex_root ) );
-    xlist_root_init( XPTR( local_cxy , &process->barrier_root ) );
-    xlist_root_init( XPTR( local_cxy , &process->condvar_root ) );
-    remote_queuelock_init( XPTR( local_cxy , 
-                                 &process->sync_lock ), LOCK_PROCESS_USERSYNC );
-
-    // reset open directories root and lock 
-    xlist_root_init( XPTR( local_cxy , &process->dir_root ) );
-    remote_queuelock_init( XPTR( local_cxy , 
-                                 &process->dir_lock ), LOCK_PROCESS_DIR );
-
-    // register new process in the local cluster manager pref_tbl[]
-    lpid_t lpid = LPID_FROM_PID( pid );
-    LOCAL_CLUSTER->pmgr.pref_tbl[lpid] = XPTR( local_cxy , process );
+	process->sem_nr          = 0;
+
+    // register new process in the parent children list
+    xptr_t entry = XPTR( local_cxy , &process->brothers_list );
+    xptr_t root  = XPTR( local_cxy , &process->children_root );
+    xlist_add_first( root , entry );
+    
+    // reset th_tbl[] array
+    uint32_t i;
+    for( i = 0 ; i < CONFIG_THREAD_MAX_PER_CLUSTER ; i++ )
+	{
+        process->th_tbl[i] = NULL;
+    }
+    process->th_nr  = 0;
+    spinlock_init( &process->th_lock );
+
+    // reset process VMM 
+	memset( &process->vmm , 0 , sizeof(vmm_t) );
+
+    // initialize PID and PPID
+	process->pid   = pid;
+    process->ppid  = ppid;
+
+    // set ref_xp field and is_ref flag
+    process->is_ref = true;
+    process->ref_xp = XPTR( local_cxy , process );
 
     // register new process descriptor in local cluster manager local_list
     cluster_process_local_link( process );
 
-    // register new process descriptor in local cluster manager copies_list 
+    // register new process descriptor in owner cluster manager copies_list
     cluster_process_copies_link( process );
 
-    // initialize th_tbl[] array and associated threads
-    uint32_t i;
-
-    for( i = 0 ; i < CONFIG_THREADS_MAX_PER_CLUSTER ; i++ )
-	{
-        process->th_tbl[i] = NULL;
-    }
-    process->th_nr  = 0;
-    rwlock_init( &process->th_lock , LOCK_PROCESS_THTBL );
-
-	hal_fence();
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_REFERENCE_INIT < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n", 
-__FUNCTION__, parent_pid, this->trdid, pid, cycle );
-#endif
-
-#if (DEBUG_PROCESS_REFERENCE_INIT & 1)
-hal_vmm_display( parent_xp , false );
-hal_vmm_display( XPTR( local_cxy , process ) , false );
-#endif
-
-    return 0;
-
-}  // process_reference_init()
+	hal_wbflush();
+
+} // end process_reference_init()
 
 /////////////////////////////////////////////////////
@@ -386,121 +162,39 @@
                            xptr_t      reference_process_xp )
 {
-    error_t   error;
-    vmm_t   * vmm;
-
-#if DEBUG_PROCESS_COPY_INIT || DEBUG_PROCESS_ERROR
-thread_t * this = CURRENT_THREAD;  
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get reference process cluster and local pointer
-    cxy_t       ref_cxy = GET_CXY( reference_process_xp );
-    process_t * ref_ptr = GET_PTR( reference_process_xp );
-
-    // get pointer on process vmm
-    vmm = &local_process->vmm;
-
-    // initialize PID, REF_XP, PARENT_XP, and STATE
-    local_process->pid        = hal_remote_l32(  XPTR( ref_cxy , &ref_ptr->pid ) );
-    local_process->parent_xp  = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->parent_xp ) );
-    local_process->ref_xp     = reference_process_xp;
-    local_process->owner_xp   = reference_process_xp;
-    local_process->term_state = 0;
-
-#if DEBUG_PROCESS_COPY_INIT
-if( DEBUG_PROCESS_COPY_INIT < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_process->pid, cycle );
-#endif
-
-// check user process
-assert( __FUNCTION__, (local_process->pid != 0), "LPID cannot be 0" );
-
-    // initialize VSL as empty
-    vmm->vsegs_nr = 0;
-	xlist_root_init( XPTR( local_cxy , &vmm->vsegs_root ) );
-
-    // create an empty GPT as required by the architecture
-    error = hal_gpt_create( &vmm->gpt );
-
-    if( error ) 
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create empty GPT / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // initialize GPT and VSL locks
-	remote_rwlock_init( XPTR( local_cxy , &vmm->vsl_lock ) , LOCK_VMM_VSL );
-
-    // register kernel vsegs in VMM as required by the architecture
-    error = hal_vmm_kernel_update( local_process );
-
-    if( error ) 
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register kernel vsegs in VMM / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
-
-    // create "args" and "envs" vsegs
-    // create "stacks" and "mmap" vsegs allocators 
-    // initialize locks protecting GPT and VSL
-    error = vmm_user_init( local_process );
-
-    if( error ) 
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot register user vsegs in VMM / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-        return -1;
-    }
- 
-#if (DEBUG_PROCESS_COPY_INIT & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_COPY_INIT < cycle )
-printk("\n[%s] thread[%x,%x] initialized vmm for process %x / cycle %d\n", 
-__FUNCTION__, parent_pid, this->trdid, pid, cycle );
-#endif
-
-    // set process file descriptors array
-	process_fd_init( local_process );
-
-    // set vfs_root_xp / vfs_bin_xp / cwd_xp fields
-    local_process->vfs_root_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->vfs_root_xp ) );
-    local_process->vfs_bin_xp  = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->vfs_bin_xp ) );
-    local_process->cwd_xp      = XPTR_NULL;
+    // replicate the remote process descriptor in new process descriptor
+    xptr_t local_process_xp = XPTR( local_cxy , local_process );
+    hal_remote_memcpy( local_process_xp , reference_process_xp , sizeof(process_t) );
+
+    // initalise signal manager TODO [AG]
+
+    // initialise file descriptors array TODO [AG]
+
+    // initialise process files structures TODO [AG]
+
+    // set the ref_xp field and clear the is_ref flag
+    local_process->ref_xp = reference_process_xp;
+    local_process->is_ref = false;
 
     // reset children list root (not used in a process descriptor copy)
     xlist_root_init( XPTR( local_cxy , &local_process->children_root ) );
-    local_process->children_nr   = 0;
-    remote_queuelock_init( XPTR( local_cxy , &local_process->children_lock ),
-                           LOCK_PROCESS_CHILDREN );
-
-    // reset children_list (not used in a process descriptor copy)
-    xlist_entry_init( XPTR( local_cxy , &local_process->children_list ) );
+    local_process->children_nr   = 0;           
+
+    // reset brothers list (not used in a process descriptor copy)
+    xlist_entry_init( XPTR( local_cxy , &local_process->brothers_list ) );
 
     // reset semaphores list root (not used in a process descriptor copy)
     xlist_root_init( XPTR( local_cxy , &local_process->sem_root ) );
-    xlist_root_init( XPTR( local_cxy , &local_process->mutex_root ) );
-    xlist_root_init( XPTR( local_cxy , &local_process->barrier_root ) );
-    xlist_root_init( XPTR( local_cxy , &local_process->condvar_root ) );
-
-    // initialize th_tbl[] array and associated fields
+    local_process->sem_nr        = 0;           
+
+    // initialize th_tbl[] array as empty
     uint32_t i;
-    for( i = 0 ; i < CONFIG_THREADS_MAX_PER_CLUSTER ; i++ )
+    for( i = 0 ; i < CONFIG_THREAD_MAX_PER_CLUSTER ; i++ )
 	{
         local_process->th_tbl[i] = NULL;
     }
     local_process->th_nr  = 0;
-    rwlock_init( &local_process->th_lock , LOCK_PROCESS_THTBL );
+    spinlock_init( &local_process->th_lock );
+
+    // initialise  process VMM TODO [AG]
 
     // register new process descriptor in local cluster manager local_list
@@ -510,491 +204,127 @@
     cluster_process_copies_link( local_process );
 
-	hal_fence();
-
-#if DEBUG_PROCESS_COPY_INIT 
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_COPY_INIT < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_process->pid, cycle );
-#endif
+	hal_wbflush();
 
     return 0;
 
-} // end process_copy_init()
+}  // end process_copy_init()
 
 ///////////////////////////////////////////
 void process_destroy( process_t * process )
 {
-    xptr_t      parent_xp;
-    process_t * parent_ptr;
-    cxy_t       parent_cxy;
-    xptr_t      children_lock_xp;
-    xptr_t      children_nr_xp;
-
-    pid_t       pid = process->pid;
-
-// check no more threads
-assert( __FUNCTION__, (process->th_nr == 0),
-"process %x in cluster %x contains threads", pid , local_cxy );
-
-#if DEBUG_PROCESS_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy, cycle );
-#endif
+	if( process->th_nr != 0 )  
+    {
+	    printk("\n[PANIC] in %s : process %x in cluster %x has still active threads\n",
+               __FUNCTION__ , process->pid , local_cxy );
+        hal_core_sleep();
+    }
+
+    // get local process manager pointer
+    pmgr_t * pmgr = &LOCAL_CLUSTER->pmgr;
+
+    // remove the process descriptor from local_list in local cluster manager 
+    spinlock_lock( &pmgr->local_lock );
+    xlist_unlink( XPTR( local_cxy , &process->local_list ) );
+    spinlock_unlock( &pmgr->local_lock );
+
+    // get extended pointer on copies_lock in owner cluster manager
+    cxy_t  owner_cxy    = CXY_FROM_PID( process->pid );
+	lpid_t lpid         = LPID_FROM_PID( process->pid );
+    xptr_t copies_lock  = hal_remote_lwd( XPTR( owner_cxy , &pmgr->copies_lock[lpid] ) );
+
+    // remove the local process descriptor from copies_list
+    remote_spinlock_lock( copies_lock );
+    xlist_unlink( XPTR( local_cxy , &process->copies_list ) );
+    remote_spinlock_unlock( copies_lock );
+    
+    // synchronize memory
+	hal_wbflush();
+
+    // From this point, the process descriptor is unreachable 
+
+    // release signal manager TODO [AG]
+
+    // delete all open file descriptors
+    process_fd_destroy( process );
+
+    // Close bin file and decrease refcount for root and cwd
+	if( process->vfs_bin_xp != XPTR_NULL ) vfs_close( process->vfs_bin_xp , NULL );
+    vfs_file_count_down( process->vfs_root_xp );
+    vfs_file_count_down( process->vfs_cwd_xp );
 
     // Destroy VMM
     vmm_destroy( process );
 
-#if (DEBUG_PROCESS_DESTROY & 1)
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] destroyed VMM for process %x in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy );
-#endif
-
-    // remove process from local_list in local cluster manager
-    cluster_process_local_unlink( process );
-
-#if (DEBUG_PROCESS_DESTROY & 1)
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] removed process %x in cluster %x from local list\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy );
-#endif
-
-    // remove process from copies_list in owner cluster manager
-    cluster_process_copies_unlink( process );
-
-#if (DEBUG_PROCESS_DESTROY & 1)
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] removed process %x in cluster %x from copies list\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy );
-#endif
-
-    // when target process cluster is the owner cluster
-    // - remove process from TXT list and transfer ownership
-    // - remove process from children_list 
-    // - release PID
-    if( CXY_FROM_PID( pid ) == local_cxy )
-    {
-        process_txt_detach( XPTR( local_cxy , process ) );
-
-#if (DEBUG_PROCESS_DESTROY & 1)
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] removed process %x from TXT list\n",
-__FUNCTION__, this->process->pid, this->trdid, pid );
-#endif
-
-        // get pointers on parent process
-        parent_xp  = process->parent_xp;
-        parent_cxy = GET_CXY( parent_xp );
-        parent_ptr = GET_PTR( parent_xp );
-
-        // get extended pointer on children_lock in parent process
-        children_lock_xp = XPTR( parent_cxy , &parent_ptr->children_lock );
-        children_nr_xp   = XPTR( parent_cxy , &parent_ptr->children_nr );
-
-        // remove process from children_list
-        remote_queuelock_acquire( children_lock_xp );
-        xlist_unlink( XPTR( local_cxy , &process->children_list ) );
-	    hal_remote_atomic_add( children_nr_xp , -1 );
-        remote_queuelock_release( children_lock_xp );
-
-#if (DEBUG_PROCESS_DESTROY & 1)
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] removed process %x from parent process children list\n",
-__FUNCTION__, this->process->pid, this->trdid, pid );
-#endif
-
-        // release the process PID to cluster manager
-        cluster_pid_release( pid );
-
-#if (DEBUG_PROCESS_DESTROY & 1)
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] released process PID %x to pmgr in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy );
-#endif
-
-    }
-
-    // FIXME decrement the refcount on file pointer for vfs_bin_xp [AG]
-
-    // FIXME close all open files [AG]
-
-    // FIXME synchronize dirty files [AG]
-
-    // release memory allocated to process descriptor
-	kmem_free( process , bits_log2(sizeof(process_t)) );
-
-#if DEBUG_PROCESS_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy, cycle );
-#endif
+	process_dmsg("\n[INFO] %s for pid %d / page_faults = %d\n",
+	         __FUNCTION__ , process->pid, process->vmm.pgfault_nr );
 
 }  // end process_destroy()
 
-///////////////////////////////////////////////////////////////////
-const char * process_action_str( process_sigactions_t action_type )
-{
-    switch ( action_type )
-    {
-        case BLOCK_ALL_THREADS:   return "BLOCK";
-        case UNBLOCK_ALL_THREADS: return "UNBLOCK";
-        case DELETE_ALL_THREADS:  return "DELETE";
-        default:                  return "undefined";
-    }
-}
-
 ////////////////////////////////////////
-void process_sigaction( pid_t       pid,
-                        uint32_t    type )
-{
-    cxy_t              owner_cxy;         // owner cluster identifier
-    lpid_t             lpid;              // process index in owner cluster
-    cluster_t        * cluster;           // pointer on cluster manager
-    xptr_t             root_xp;           // extended pointer on root of copies
-    xptr_t             lock_xp;           // extended pointer on lock protecting copies
-    xptr_t             iter_xp;           // iterator on copies list
-    xptr_t             process_xp;        // extended pointer on process copy
-    cxy_t              process_cxy;       // process copy cluster identifier
-    process_t        * process_ptr;       // local pointer on process copy
-    reg_t              save_sr;           // for critical section
-    thread_t         * client;            // pointer on client thread
-    xptr_t             client_xp;         // extended pointer on client thread
-    process_t        * local;             // pointer on process copy in local cluster
-    uint32_t           remote_nr;         // number of remote process copies
-    rpc_desc_t         rpc;               // shared RPC descriptor
-    uint32_t           responses;         // shared RPC responses counter
-
-    client    = CURRENT_THREAD;
-    client_xp = XPTR( local_cxy , client );
-    local     = NULL;
-    remote_nr = 0;
-
-    // check calling thread can yield
-    thread_assert_can_yield( client , __FUNCTION__ );
-
-#if DEBUG_PROCESS_SIGACTION
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] enter to %s process %x / cycle %d\n",
-__FUNCTION__ , client->process->pid, client->trdid,
-process_action_str( type ) , pid , cycle );
-#endif
-
-    // get pointer on local cluster manager
-    cluster = LOCAL_CLUSTER;
-
-    // get owner cluster identifier and process lpid
-    owner_cxy = CXY_FROM_PID( pid );
-    lpid      = LPID_FROM_PID( pid );
-
-    // get root of list of copies and lock from owner cluster
-    root_xp   = XPTR( owner_cxy , &cluster->pmgr.copies_root[lpid] );
-    lock_xp   = XPTR( owner_cxy , &cluster->pmgr.copies_lock[lpid] );
-
-// check action type
-assert( __FUNCTION__, ((type == DELETE_ALL_THREADS ) ||
-         (type == BLOCK_ALL_THREADS )  ||
-         (type == UNBLOCK_ALL_THREADS )), "illegal action type" );
-             
-    // This client thread send parallel RPCs to all remote clusters containing
-    // target process copies, wait all responses, and then handles directly 
-    // the threads in local cluster, when required.
-    // The client thread allocates a - shared - RPC descriptor in the stack,
-    // because all parallel, non-blocking, server threads use the same input 
-    // arguments, and use the shared RPC response field
-
-    // mask IRQs
-    hal_disable_irq( &save_sr);
-
-    // client thread blocks itself
-    thread_block( client_xp , THREAD_BLOCKED_RPC );
-
-    // initialize RPC responses counter
-    responses = 0;
-
-    // initialize shared RPC descriptor
-    // can be shared, because no out arguments
-    rpc.rsp       = &responses;
-    rpc.blocking  = false;
-    rpc.index     = RPC_PROCESS_SIGACTION;
-    rpc.thread    = client;
-    rpc.lid       = client->core->lid;
-    rpc.args[0]   = pid;
-    rpc.args[1]   = type;
-
-    // take the lock protecting process copies
-    remote_queuelock_acquire( lock_xp );
-
-    // scan list of process copies
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        // get extended pointers and cluster on process
-        process_xp  = XLIST_ELEMENT( iter_xp , process_t , copies_list );
-        process_cxy = GET_CXY( process_xp );
-        process_ptr = GET_PTR( process_xp );
-
-        if( process_cxy == local_cxy )    // process copy is local
-        { 
-            local = process_ptr;
+void process_kill( process_t * process )
+{
+    thread_t     * thread;    // pointer on current thead descriptor
+    uint32_t       ltid;      // index in process th_tbl
+    uint32_t       count;     // thread counter
+
+    // get lock protecting th_tbl[]
+    spinlock_lock( &process->th_lock );
+
+    // first loop on threads to send the THREAD_SIG_KILL signal to all peocess threads
+    // we use both "ltid" and "count" indexes, because it can exist "holes" in th_tbl
+    for( ltid = 0 , count = 0  ; 
+         (ltid < CONFIG_THREAD_MAX_PER_CLUSTER) && (count < process->th_nr) ; 
+         ltid++ )
+    {
+        thread = process->th_tbl[ltid];
+
+        if( thread != NULL )
+        {
+            thread_kill( thread );
+            count++;
         }
-        else                              // process copy is remote
+    }   
+    
+    volatile uint32_t ko;
+
+    // second loop on threads to wait acknowledge from scheduler,
+    // unlink thread from process and parent thread, and release thread descriptor
+    for( ltid = 0 , count = 0  ; 
+         (ltid < CONFIG_THREAD_MAX_PER_CLUSTER) && (count < process->th_nr) ;
+         ltid++ )
+    {
+        thread = process->th_tbl[ltid];
+
+        if( thread != NULL )
         {
-            // update number of remote process copies
-            remote_nr++;
-
-            // atomically increment RPC responses counter
-            hal_atomic_add( &responses , 1 );
-
-#if DEBUG_PROCESS_SIGACTION 
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] send RPC to cluster %x for process %x\n",
-__FUNCTION__, client->process->pid, client->trdid, process_cxy, pid );
-#endif
-            // call RPC in target cluster
-            rpc_send( process_cxy , &rpc );
+            // wait scheduler acknowledge
+            do { ko = (thread->signals & THREAD_SIG_KILL); } while( ko );
+
+            // unlink thread from brothers list if required
+            if( (thread->flags & THREAD_FLAG_DETACHED) == 0 ) 
+            xlist_unlink( XPTR( local_cxy , &thread->brothers_list ) );
+
+            // unlink thread from process
+            process_remove_thread( thread );
+
+            // release memory for thread descriptor
+            thread_destroy( thread );
+
+            count++;
         }
-    }  // end list of copies
-
-    // release the lock protecting process copies
-    remote_queuelock_release( lock_xp );
-
-    // restore IRQs
-    hal_restore_irq( save_sr);
-
-    // - if there is remote process copies, the client thread deschedules,
-    //   (it will be unblocked by the last RPC server thread). 
-    // - if there is no remote copies, the client thread unblock itself.
-    if( remote_nr )
-    {
-        sched_yield("blocked on rpc_process_sigaction");
-    } 
-    else
-    {
-        thread_unblock( client_xp , THREAD_BLOCKED_RPC );
-    }
-
-    // handle the local process copy if required
-    if( local != NULL )
-    {
-
-#if DEBUG_PROCESS_SIGACTION 
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] handles local process %x in cluster %x\n",
-__FUNCTION__, client->process->pid, client->trdid, pid , local_cxy );
-#endif
-        if     (type == DELETE_ALL_THREADS  ) process_delete_threads ( local , client_xp ); 
-        else if(type == BLOCK_ALL_THREADS   ) process_block_threads  ( local ); 
-        else if(type == UNBLOCK_ALL_THREADS ) process_unblock_threads( local );
-    }
-
-#if DEBUG_PROCESS_SIGACTION
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] exit after %s process %x / cycle %d\n",
-__FUNCTION__, client->process->pid, client->trdid,
-process_action_str( type ), pid, cycle );
-#endif
-
-}  // end process_sigaction()
-
-/////////////////////////////////////////////////
-void process_block_threads( process_t * process )
-{
-    thread_t          * target;         // pointer on target thread 
-    thread_t          * this;           // pointer on calling thread 
-    uint32_t            ltid;           // index in process th_tbl[]
-    uint32_t            count;          // requests counter
-    volatile uint32_t   ack_count;      // acknowledges counter
-
-    // get calling thread pointer
-    this = CURRENT_THREAD;
-
-#if DEBUG_PROCESS_SIGACTION
-pid_t pid = process->pid;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy , cycle );
-#endif
-
-// check target process is an user process
-assert( __FUNCTION__, (LPID_FROM_PID( process->pid ) != 0 ),
-"process %x is not an user process\n", process->pid );
-
-    // get lock protecting process th_tbl[]
-    rwlock_rd_acquire( &process->th_lock );
-
-    // loop on target process local threads 
-    // we use both "ltid" and "count" because it can exist "holes" in th_tbl
-    // - if the calling thread and the target thread are not running on the same
-    //   core, we ask the target scheduler to acknowlege the blocking
-    //   to be sure that the target thread is not running.
-    // - if the calling thread and the target thread are running on the same core,
-    //   we don't need confirmation from scheduler.
-            
-    for( ltid = 0 , count = 0 , ack_count = 0 ; count < process->th_nr ; ltid++ )
-    {
-        target = process->th_tbl[ltid];
-
-        if( target != NULL )                                 // thread exist
-        {
-            count++;
-
-            // set the global blocked bit in target thread descriptor.
-            thread_block( XPTR( local_cxy , target ) , THREAD_BLOCKED_GLOBAL );
-  
-            if( this->core->lid != target->core->lid )
-            {
-                // increment responses counter 
-                hal_atomic_add( (void*)&ack_count , 1 );
-
-                // set FLAG_REQ_ACK and &ack_rsp_count in target descriptor
-                thread_set_req_ack( target , (uint32_t *)&ack_count );
-
-                // force scheduling on target thread
-                dev_pic_send_ipi( local_cxy , target->core->lid );
-            }
-        }
-    }
-
-    // release lock protecting process th_tbl[]
-    rwlock_rd_release( &process->th_lock );
-
-    // wait other threads acknowledges  TODO this could be improved...
-    while( 1 )
-    {
-        // exit when all scheduler acknowledges received
-        if ( ack_count == 0 ) break;
-    
-        // wait 1000 cycles before retry
-        hal_fixed_delay( 1000 );
-    }
-
-#if DEBUG_PROCESS_SIGACTION
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy , cycle );
-#endif
-
-}  // end process_block_threads()
-
-/////////////////////////////////////////////////
-void process_delete_threads( process_t * process,
-                             xptr_t      client_xp )
-{
-    thread_t          * target;        // local pointer on target thread 
-    xptr_t              target_xp;     // extended pointer on target thread
-    cxy_t               owner_cxy;     // owner process cluster
-    uint32_t            ltid;          // index in process th_tbl
-    uint32_t            count;         // threads counter
-
-    // get calling thread pointer
-
-    // get target process owner cluster
-    owner_cxy = CXY_FROM_PID( process->pid );
-
-#if DEBUG_PROCESS_SIGACTION
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x n cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, local_cxy, cycle );
-#endif
-
-// check target process is an user process
-assert( __FUNCTION__, (LPID_FROM_PID( process->pid ) != 0),
-"process %x is not an user process\n", process->pid );
-
-    // get lock protecting process th_tbl[]
-    rwlock_wr_acquire( &process->th_lock );
-
-    // loop on target process local threads                       
-    // we use both "ltid" and "count" because it can exist "holes" in th_tbl
-    for( ltid = 0 , count = 0  ; count < process->th_nr ; ltid++ )
-    {
-        target = process->th_tbl[ltid];
-
-        if( target != NULL )    // valid thread  
-        {
-            count++;
-            target_xp = XPTR( local_cxy , target );
-
-            // main thread and client thread should not be deleted
-            if( ((ltid != 0) || (owner_cxy != local_cxy)) &&         // not main thread
-                (client_xp) != target_xp )                           // not client thread
-            {
-                // mark target thread for delete and block it
-                thread_delete_request( target_xp , true );                   // forced 
-            }
-        }
-    }
-
-    // release lock protecting process th_tbl[]
-    rwlock_wr_release( &process->th_lock );
-
-#if DEBUG_PROCESS_SIGACTION
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, local_cxy , cycle );
-#endif
-
-}  // end process_delete_threads()
-
-///////////////////////////////////////////////////
-void process_unblock_threads( process_t * process )
-{
-    thread_t          * target;        // pointer on target thead 
-    uint32_t            ltid;          // index in process th_tbl
-    uint32_t            count;         // requests counter
-
-#if DEBUG_PROCESS_SIGACTION
-thread_t * this  = CURRENT_THREAD;
-pid_t      pid   = process->pid;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy , cycle );
-#endif
-
-// check target process is an user process
-assert( __FUNCTION__, ( LPID_FROM_PID( process->pid ) != 0 ),
-"process %x is not an user process\n", process->pid );
-
-    // get lock protecting process th_tbl[]
-    rwlock_rd_acquire( &process->th_lock );
-
-    // loop on process threads to unblock all threads
-    // we use both "ltid" and "count" because it can exist "holes" in th_tbl
-    for( ltid = 0 , count = 0 ; count < process->th_nr ; ltid++ )
-    {
-        target = process->th_tbl[ltid];
-
-        if( target != NULL )             // thread found
-        {
-            count++;
-
-            // reset the global blocked bit in target thread descriptor.
-            thread_unblock( XPTR( local_cxy , target ) , THREAD_BLOCKED_GLOBAL );
-        }
-    }
-
-    // release lock protecting process th_tbl[]
-    rwlock_rd_release( &process->th_lock );
-
-#if DEBUG_PROCESS_SIGACTION
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy, cycle );
-#endif
-
-}  // end process_unblock_threads()
+    }
+
+    // release lock protecting th_tbl[]
+    spinlock_unlock( &process->th_lock );
+
+    // release memory allocated for process descriptor
+    process_destroy( process );
+
+}  // end process_kill()
+
+
+
+
+
 
 ///////////////////////////////////////////////
@@ -1002,30 +332,18 @@
 {
     error_t        error;
-    process_t    * process;       // local pointer on process
-    xptr_t         process_xp;    // extended pointer on process
-
-#if DEBUG_PROCESS_GET_LOCAL_COPY || DEBUG_PROCESS_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
+    bool_t         found;
+    list_entry_t * iter;
+    process_t    * process;     // pointer on local copy
 
     cluster_t * cluster = LOCAL_CLUSTER;
 
-#if DEBUG_PROCESS_GET_LOCAL_COPY
-if( DEBUG_PROCESS_GET_LOCAL_COPY < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, local_cxy, cycle );
-#endif
-
     // get lock protecting local list of processes
-    remote_queuelock_acquire( XPTR( local_cxy , &cluster->pmgr.local_lock ) );
+    spinlock_lock( &cluster->pmgr.local_lock );
 
     // scan the local list of process descriptors to find the process
-    xptr_t  iter;
-    bool_t  found = false;
-    XLIST_FOREACH( XPTR( local_cxy , &cluster->pmgr.local_root ) , iter )
-    {
-        process_xp  = XLIST_ELEMENT( iter , process_t , local_list );
-        process     = GET_PTR( process_xp );
+    found = false;
+    LIST_FOREACH( &cluster->pmgr.local_root , iter )
+    {
+        process = LIST_ELEMENT( iter , process_t , local_list );
         if( process->pid == pid )
         {
@@ -1036,65 +354,28 @@
 
     // release lock protecting local list of processes
-    remote_queuelock_release( XPTR( local_cxy , &cluster->pmgr.local_lock ) );
-
-    // allocate memory for a new local process descriptor
-    // and initialise it from reference cluster if not found
+    spinlock_unlock( &cluster->pmgr.local_lock );
+
+    // allocate memory for a local process descriptor 
+    // and initialise it from reference if required
     if( !found )
     {
         // get extended pointer on reference process descriptor
-        xptr_t ref_xp = cluster_get_reference_process_from_pid( pid );
-
-        assert( __FUNCTION__, (ref_xp != XPTR_NULL) , "illegal pid\n" );
+        xptr_t reference = cluster_get_reference_process_from_pid( pid );
 
         // allocate memory for local process descriptor
-        process = kmem_alloc( bits_log2(sizeof(process_t)) , AF_ZERO );
-
+        process = process_alloc();
         if( process == NULL )  return NULL;
 
         // initialize local process descriptor copy
-        error = process_copy_init( process , ref_xp );
-
-        if( error )
-        {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot initialize local process copy / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-            return NULL;
-        }
-    }
-
-#if DEBUG_PROCESS_GET_LOCAL_COPY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_GET_LOCAL_COPY < cycle )
-printk("\n[%s] thread[%x,%x] exit in cluster %x / process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, process, cycle );
-#endif
+        error = process_copy_init( process, reference );
+        if( error ) return NULL;
+
+        
+        // register process in global copies_list
+    }
 
     return process;
-
-}  // end process_get_local_copy()
-
-////////////////////////////////////////////
-pid_t process_get_ppid( xptr_t  process_xp )
-{
-    cxy_t       process_cxy;
-    process_t * process_ptr;
-    xptr_t      parent_xp;
-    cxy_t       parent_cxy;
-    process_t * parent_ptr;
-
-    // get process cluster and local pointer
-    process_cxy = GET_CXY( process_xp );
-    process_ptr = GET_PTR( process_xp );
-
-    // get pointers on parent process
-    parent_xp  = (xptr_t)hal_remote_l64( XPTR( process_cxy , &process_ptr->parent_xp ) );
-    parent_cxy = GET_CXY( parent_xp );
-    parent_ptr = GET_PTR( parent_xp );
-
-    return hal_remote_l32( XPTR( parent_cxy , &parent_ptr->pid ) );
-}
+} // end process_get_local_copy()
+
 
 //////////////////////////////////////////////////////////////////////////////////////////
@@ -1103,502 +384,153 @@
 
 ///////////////////////////////////////////
-char * process_fd_type_str( uint32_t type )
-{
-    switch( type )
-    {
-        case FILE_TYPE_REG : return "FILE";
-        case FILE_TYPE_DIR  : return "DIR";
-        case FILE_TYPE_FIFO : return "FIFO";
-        case FILE_TYPE_PIPE : return "PIPE";
-        case FILE_TYPE_SOCK : return "SOCK";
-        case FILE_TYPE_DEV  : return "DEV";
-        case FILE_TYPE_BLK  : return "BLK";
-        case FILE_TYPE_SYML : return "SYML";
-        
-        default              : return "undefined";
+void process_fd_init( process_t * process )
+{
+    uint32_t fd;
+
+    remote_spinlock_init( XPTR( local_cxy , &process->fd_array.lock ) );
+    process->fd_array.max       = CONFIG_PROCESS_FILE_MAX_NR;
+    process->fd_array.current   = 0;
+
+    // initialize array
+    for ( fd = 0 ; fd < process->fd_array.max ; fd++ )
+    {
+        process->fd_array.array[fd] = XPTR_NULL;
     }
 }
-   
-///////////////////////////////////////////
-void process_fd_init( process_t * process )
+
+//////////////////////////////////////////////
+void process_fd_destroy( process_t * process )
 {
     uint32_t fd;
 
-    // initialize lock
-    remote_queuelock_init( XPTR( local_cxy , &process->fd_array.lock ), LOCK_PROCESS_FDARRAY );
-
-    // initialize number of open files
-    process->fd_array.max = 0;
-
-    // initialize array
-    for ( fd = 0 ; fd < CONFIG_PROCESS_FILE_MAX_NR ; fd++ )
-    {
-        process->fd_array.array[fd] = XPTR_NULL;
+    // loop on all open file descriptors to close all open files 
+    for( fd = 0 ; fd < process->fd_array.max ; fd++ )
+    {
+        xptr_t file_xp = process->fd_array.array[fd];
+        if ( file_xp != XPTR_NULL ) vfs_close( file_xp , NULL );
     }
 }
 
-////////////////////////////////////////////////////
-error_t process_fd_register( xptr_t      process_xp,
-                             xptr_t      file_xp,
-                             uint32_t  * fdid )
+///////////////////////////////////////////////////
+bool_t process_fd_array_full( process_t * process )
+{
+	return ( process->fd_array.current >= process->fd_array.max);  
+}
+
+/////////////////////////////////////////////////
+error_t process_fd_allocate( process_t * process, 
+                             xptr_t      file_xp, 
+                             uint32_t   * ret_fd )
 {
     bool_t    found;
-    uint32_t  id;
-    uint32_t  max;             // current value of max non-free slot index
-    xptr_t    entry_xp;        // current value of one fd_array entry 
-    xptr_t    lock_xp;         // extended pointer on lock protecting fd_array
-    xptr_t    max_xp;          // extended pointer on max field in fd_array
-
-#if DEBUG_PROCESS_FD_REGISTER
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get target process cluster and local pointer
-    process_t * process_ptr = GET_PTR( process_xp );
-    cxy_t       process_cxy = GET_CXY( process_xp );
-
-// check target process is owner process
-assert( __FUNCTION__, (process_xp == hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp ) ) ),
-"process must be owner process\n" );
-
-#if DEBUG_PROCESS_FD_REGISTER
-pid_t  tgt_pid   = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid) );
-if( DEBUG_PROCESS_FD_REGISTER < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, tgt_pid, cycle );
-#endif
-
-    // build extended pointers on lock & max 
-    lock_xp = XPTR( process_cxy , &process_ptr->fd_array.lock );
-    max_xp  = XPTR( process_cxy , &process_ptr->fd_array.max );
-
-    // take lock protecting fd_array
-	remote_queuelock_acquire( lock_xp );
+    uint32_t  fd;
+
+	remote_spinlock_lock( XPTR( local_cxy , &process->fd_array.lock ) );
 
     found   = false;
 
-    // get current value of max_fdid
-    max = hal_remote_l32( max_xp );
-
-    for ( id = 0; id < CONFIG_PROCESS_FILE_MAX_NR ; id++ )
-    {
-        // get fd_array entry
-        entry_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[id] ) );
-        
-        // take the first empty slot
-        if ( entry_xp == XPTR_NULL )
+    for ( fd = 0; fd < process->fd_array.max; fd++ )
+    {
+        if ( process->fd_array.array[fd] == XPTR_NULL )
         {
-            // update  fd_array
-            hal_remote_s64( XPTR( process_cxy , &process_ptr->fd_array.array[id] ) , file_xp );
-
-            // update max when required
-            if( id > max ) hal_remote_s32( max_xp , id );
-
-            // exit loop
-			*fdid = id;
             found = true;
+            process->fd_array.array[fd] = file_xp;
+	        process->fd_array.current++;
+			*ret_fd = fd;
             break;
         }
     }
 
-    // release lock protecting fd_array
-	remote_queuelock_release( lock_xp );
-
-#if DEBUG_PROCESS_FD_REGISTER
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_FD_REGISTER < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / fdid %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, tgt_pid, id, cycle );
-#endif
-
-    if ( !found ) return -1;
+	remote_spinlock_unlock( XPTR( local_cxy , &process->fd_array.lock ) );
+
+    if ( !found ) return EMFILE;
     else          return 0;
-
-}  // end process_fd_register()
-
-/////////////////////////////////////////////
-void process_fd_remove( xptr_t    process_xp,
-                        uint32_t  fdid )
-{
-    pid_t       pid;           // target process PID 
-    lpid_t      lpid;          // target process LPID
-    xptr_t      file_xp;       // extended pointer on file descriptor
-    xptr_t      iter_xp;       // iterator for list of process copies
-    xptr_t      copy_xp;       // extended pointer on process copy
-    process_t * copy_ptr;      // local pointer on process copy  
-    cxy_t       copy_cxy;      // process copy cluster identifier
-
-    // get target process cluster and local pointer
-    process_t * process_ptr = GET_PTR( process_xp );
-    cxy_t       process_cxy = GET_CXY( process_xp );
-
-// check target process is owner process
-assert( __FUNCTION__, (process_xp == hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp ) ) ),
-"process must be owner process\n" );
-
-    // get target process pid and lpid
-    pid  = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid) );
-    lpid = LPID_FROM_PID( pid );
-
-#if DEBUG_PROCESS_FD_REMOVE
-uint32_t    cycle = (uint32_t)hal_get_cycles();
-thread_t  * this  = CURRENT_THREAD;
-if( DEBUG_PROCESS_FD_REMOVE < cycle )
-printk("\n[%s] thread[%x,%x] enter for fdid %d in process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, fdid, pid, cycle );
-#endif
-
-    // get extended pointer on file descriptor
-    file_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[fdid] ));
-
-    // build extended pointers on list_of_copies root and lock (in owner cluster)
-    xptr_t copies_root_xp = XPTR( process_cxy , &LOCAL_CLUSTER->pmgr.copies_root[lpid] );
-    xptr_t copies_lock_xp = XPTR( process_cxy , &LOCAL_CLUSTER->pmgr.copies_lock[lpid] );
- 
-    // build extended pointer on fd_array lock and max 
-    xptr_t fd_lock_xp = XPTR( process_cxy , &process_ptr->fd_array.lock );
-    xptr_t fd_max_xp  = XPTR( process_cxy , &process_ptr->fd_array.max );
-
-    // take lock protecting fd_array
-	remote_queuelock_acquire( fd_lock_xp );
-
-    // take the lock protecting the list of copies
-    remote_queuelock_acquire( copies_lock_xp );
-
-    // get max value
-    uint32_t max = hal_remote_l32( fd_max_xp );
-
-    // loop on list of process copies
-    XLIST_FOREACH( copies_root_xp , iter_xp )
-    {
-        // get pointers on process copy
-        copy_xp  = XLIST_ELEMENT( iter_xp , process_t , copies_list );
-        copy_ptr = GET_PTR( copy_xp );
-        copy_cxy = GET_CXY( copy_xp );
-
-        // release the fd_array entry in process copy
-        hal_remote_s64( XPTR( copy_cxy , &copy_ptr->fd_array.array[fdid] ), XPTR_NULL );
-    }
-
-    // update max when required
-    if( fdid == max ) hal_remote_s32( fd_max_xp , max-1 );
-
-    // release the lock protecting fd_array
-	remote_queuelock_release( fd_lock_xp );
-
-    // release the lock protecting the list of copies
-    remote_queuelock_release( copies_lock_xp );
-
-#if DEBUG_PROCESS_FD_REMOVE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_FD_REMOVE < cycle )
-printk("\n[%s] thread[%x,%x] exit for fdid %d in process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, fdid, pid, cycle );
-#endif
-
-}  // end process_fd_remove()
-
-//////////////////////////////////////////////
-void process_fd_clean_all( xptr_t process_xp )
-{
-    uint32_t  fdid;
-    xptr_t    file_xp;         // one fd_array entry
-    xptr_t    lock_xp;         // extendad pointer on lock protecting fd_array
-    uint32_t  max;             // number of registered files
-
-    // get process cluster, local pointer and PID
-    process_t * process_ptr = GET_PTR( process_xp );
-    cxy_t       process_cxy = GET_CXY( process_xp );
-
-// check target process is owner process
-assert( __FUNCTION__, (process_xp == hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp )) ),
-"process must be owner process\n" );
-
-#if DEBUG_PROCESS_FD_CLEAN_ALL
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_FD_CLEAN_ALL < cycle )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-
-process_fd_display( process_xp );
-#endif
-
-    // build extended pointer on lock protecting the fd_array
-    lock_xp = XPTR( process_cxy , &process_ptr->fd_array.lock );
-
-    // get max index for fd_array
-    max = hal_remote_l32( XPTR( process_cxy , &process_ptr->fd_array.max ));
-
-    // take lock protecting fd_array
-	remote_queuelock_acquire( lock_xp );
-
-    for( fdid = 0 ; fdid <= max ; fdid++ )
-    {
-        // get fd_array entry
-        file_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[fdid] ) );
-        
-        if ( file_xp != XPTR_NULL )
-        {
-            vfs_file_t * file_ptr = GET_PTR( file_xp );
-            cxy_t        file_cxy = GET_CXY( file_xp );
-
-            // get file type
-            uint32_t file_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ));
- 
-            if( file_type == FILE_TYPE_REG )
-            {
-                vfs_close( file_xp , fdid );
-            }
-            if( file_type == FILE_TYPE_SOCK )
-            {
-                socket_close( file_xp , fdid );
-            }
-        }
-    }
-
-    // release lock protecting fd_array
-	remote_queuelock_release( lock_xp );
-
-#if DEBUG_PROCESS_FD_CLEAN_ALL
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_FD_CLEAN_ALL < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, cycle );
-#endif
-
-}  // end process_fd_clean_all()
-
-//////////////////////////////////////////////////////////////
-xptr_t process_fd_get_xptr_from_owner( xptr_t      process_xp,
-                                       uint32_t    fdid )
-{
-    cxy_t       process_cxy = GET_CXY( process_xp );
-    process_t * process_ptr = GET_PTR( process_xp );
-
-assert( __FUNCTION__, (hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp )) == process_xp),
-"process_xp argument must be the owner process" );
-
-    // access owner process fd_array
-    return hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[fdid] ));
-
-}  // end process_fd_get_xptr_from_owner()
-
-///////////////////////////////////////////////////////////
-xptr_t process_fd_get_xptr_from_local( process_t * process,
-                                       uint32_t    fdid )
-{
-    xptr_t  file_xp;
-    xptr_t  lock_xp;
-
-    // access local copy of process descriptor
-    file_xp = process->fd_array.array[fdid];
-
-    if( file_xp == XPTR_NULL )
-    {
-        // get owner process cluster and local pointer
-        xptr_t      owner_xp  = process->owner_xp;
-        cxy_t       owner_cxy = GET_CXY( owner_xp );
-        process_t * owner_ptr = GET_PTR( owner_xp );
-
-        // build extended pointer on lock protecting fd_array
-        lock_xp = XPTR( owner_cxy , &owner_ptr->fd_array.lock );
-
-        // take lock protecting fd_array
-	    remote_queuelock_acquire( lock_xp );
-
-        // access owner process descriptor
-        file_xp = hal_remote_l64( XPTR( owner_cxy , &owner_ptr->fd_array.array[fdid] ) );
-
-        if( file_xp != XPTR_NULL )  
-        {
-           // update local fd_array 
-            process->fd_array.array[fdid] = file_xp;
-        }
-
-        // release lock protecting fd_array
-	    remote_queuelock_release( lock_xp );
-    }
-
-    return file_xp;
-
-}  // end process_fd_get_xptr_from_local()
-
-////////////////////////////////////////////
-error_t process_fd_replicate( xptr_t dst_xp,
-                              xptr_t src_xp )
-{
-    uint32_t fdid;      // current file descriptor index
-    xptr_t   old_xp;    // extended pointer on a file descriptor (stored in SRC fd_array) 
-    xptr_t   new_xp;    // extended pointer on a file descriptor (stored in DST fd_array)
-    error_t  error;
-
-    // get cluster and local pointer for SRC process
-    cxy_t       src_cxy = GET_CXY( src_xp );
-    process_t * src_ptr = GET_PTR( src_xp );
-
-assert( __FUNCTION__, (src_xp == hal_remote_l64( XPTR( src_cxy , &src_ptr->owner_xp ))),
-"src_xp process not in owner cluster" );
-
-    // get cluster and local pointer for DST fd_array
-    cxy_t       dst_cxy = GET_CXY( dst_xp );
-    process_t * dst_ptr = GET_PTR( dst_xp );
-
-assert( __FUNCTION__, (dst_xp == hal_remote_l64( XPTR( dst_cxy , &dst_ptr->owner_xp ))),
-"dst_xp process not in owner cluster" );
-
-    // build extende pointers on SRC fd_array lock and max fields
-    xptr_t  src_lock_xp = XPTR( src_cxy , &src_ptr->fd_array.lock );
-    xptr_t  src_max_xp  = XPTR( src_cxy , &src_ptr->fd_array.max );
-
-    // get the remote lock protecting the src fd_array
-	remote_queuelock_acquire( src_lock_xp );
- 
-    // loop on fd_array entries
-    for( fdid = 0 ; fdid <= hal_remote_l32( src_max_xp ) ; fdid++ )
-	{
-		old_xp = (xptr_t)hal_remote_l64( XPTR( src_cxy , &src_ptr->fd_array.array[fdid] ) );
-
-		if( old_xp != XPTR_NULL )
+} 
+
+////////////////////////////////////////////////
+error_t process_fd_release( process_t * process,
+                            uint32_t    fd )
+{
+    if ( (fd < 0) || (fd > process->fd_array.max) ) return EBADF;
+
+    remote_spinlock_lock( XPTR( local_cxy , &process->fd_array.lock ) );
+
+    process->fd_array.array[fd] = XPTR_NULL;
+	process->fd_array.current--;
+
+	remote_spinlock_unlock( XPTR( local_cxy , &process->fd_array.lock ) );
+
+    return 0;
+}
+
+///////////////////////////////////////
+void process_fd_copy( fd_array_t * dst,
+                      fd_array_t * src )
+{
+    uint32_t fd;
+    xptr_t   entry;
+
+    remote_spinlock_lock( XPTR( local_cxy , &src->lock ) );
+
+    // loop on all entries in source process fd_array        
+    for( fd = 0 ; fd < src->max ; fd++ )
+	{
+		entry = src->array[fd];
+
+		if( entry != XPTR_NULL )
 		{
-            // get the existing file descriptor cluster and local pointer
-            vfs_file_t * old_ptr = GET_PTR( old_xp );
-            cxy_t        old_cxy = GET_CXY( old_xp );
-
-            // get existing file attributes and local pointer on inode
-            uint32_t      attr      = hal_remote_l32( XPTR( old_cxy , &old_ptr->attr ) );
-            vfs_inode_t * inode_ptr = hal_remote_lpt( XPTR( old_cxy , &old_ptr->inode ) );
-
-            // create a new file descriptor in same cluster as the existing one
-            error = vfs_file_create( XPTR( old_cxy , inode_ptr ),
-                                     attr,
-                                     &new_xp );
-            if( error )
-            {
-
-#if DEBUG_PROCESS_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create file descriptor / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-                return -1;
-            }
-
-			// register new_xp in DST fd_array
-			hal_remote_s64( XPTR( dst_cxy , &dst_ptr->fd_array.array[fdid] ) , new_xp );
+            // increment file descriptor ref count
+            vfs_file_count_up( entry );
+
+			// copy entry in destination process fd_array
+			dst->array[fd] = entry;
 		}
 	}
 
     // release lock on source process fd_array
-	remote_queuelock_release( src_lock_xp );
-
-    return 0;
-
-}  // end process_fd_replicate()
-
-
-////////////////////////////////////
-bool_t process_fd_array_full( void )
-{
-    // get extended pointer on owner process
-    xptr_t owner_xp = CURRENT_THREAD->process->owner_xp;
-
-    // get owner process cluster and local pointer
-    process_t * owner_ptr = GET_PTR( owner_xp );
-    cxy_t       owner_cxy = GET_CXY( owner_xp );
-
-    // get number of open file descriptors from  fd_array
-    uint32_t max = hal_remote_l32( XPTR( owner_cxy , &owner_ptr->fd_array.max ));
-
-	return ( max == CONFIG_PROCESS_FILE_MAX_NR - 1 );
-}
-
-////////////////////////////////////////////
-void process_fd_display( xptr_t process_xp )
-{
-    uint32_t      fdid;
-    xptr_t        file_xp;
-    vfs_file_t *  file_ptr;
-    cxy_t         file_cxy;
-    uint32_t      file_type;
-    xptr_t        inode_xp;
-    vfs_inode_t * inode_ptr;
-
-    char          name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    // get process cluster and local pointer
-    process_t * process_ptr = GET_PTR( process_xp );
-    cxy_t       process_cxy = GET_CXY( process_xp );
-
-    // get process PID
-    pid_t  pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ));
-
-    // get pointers on owner process descriptor
-    xptr_t      owner_xp  = hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp ));
-    process_t * owner_ptr = GET_PTR( owner_xp );
-    cxy_t       owner_cxy = GET_CXY( owner_xp );
-
-    // get max fdid from owner process descriptor
-    uint32_t max = hal_remote_l32( XPTR( owner_cxy , &owner_ptr->fd_array.max ));
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-    nolock_printk("\n***** fd_array for pid %x in cluster %x / max %d *****\n",
-    pid, process_cxy, max );
-
-    for( fdid = 0 ; fdid <= max ; fdid++ )
-    {
-        // get pointers on file descriptor
-        file_xp  = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[fdid] ));
-        file_ptr = GET_PTR( file_xp );
-        file_cxy = GET_CXY( file_xp );
-
-        if( file_xp != XPTR_NULL )
-        {
-            // get file type
-            file_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type )); 
-
-            // get file name if inode exist
-            if( (file_type != FILE_TYPE_PIPE) && (file_type != FILE_TYPE_SOCK) )
-            {
-                // get inode pointers 
-                inode_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ));
-                inode_xp  = XPTR( file_cxy , inode_ptr );
-
-                // get file name
-                vfs_inode_get_name( inode_xp , name );
-
-                // display relevant file descriptor info
-                nolock_printk(" - %d : type %s / ptr %x (%s)\n",
-                fdid, process_fd_type_str(file_type), file_ptr, name );
-            }
-            else    // PIPE or SOCK types
-            {
-                // display relevant file decriptor info
-                nolock_printk(" - %d : type %s / ptr %x\n",
-                fdid , process_fd_type_str(file_type), file_ptr );
-            }
-        }
-        else
-        {
-            nolock_printk(" - %d : empty slot\n", fdid );
-        }
-    }
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-}   // end process_fd_display()
+	remote_spinlock_unlock( XPTR( local_cxy , &src->lock ) );
+} 
+
+///////////////////////////////////////////
+void process_fd_remote_copy( xptr_t dst_xp,
+                             xptr_t src_xp )
+{
+    uint32_t fd;
+    xptr_t   entry;
+
+    // get cluster and local pointer for src fd_array
+    cxy_t        src_cxy = GET_CXY( src_xp );
+    fd_array_t * src_ptr = (fd_array_t *)GET_PTR( src_xp );
+
+    // get cluster and local pointer for dst fd_array
+    cxy_t        dst_cxy = GET_CXY( dst_xp );
+    fd_array_t * dst_ptr = (fd_array_t *)GET_PTR( dst_xp );
+
+    // get the remote lock protecting the src fd_array
+	remote_spinlock_lock( XPTR( src_cxy , &src_ptr->lock ) );
+
+    // get number of entries in fd_array
+    uint32_t max = hal_remote_lw( XPTR( src_cxy , &src_ptr->max ) );
+
+    // loop on all entries in source process fd_array        
+    for( fd = 0 ; fd < max ; fd++ )
+	{
+		entry = (xptr_t)hal_remote_lwd( XPTR( src_cxy , &src_ptr->array[fd] ) );
+
+		if( entry != XPTR_NULL )
+		{
+            // increment file descriptor ref count
+            vfs_file_count_up( entry );
+
+			// copy entry in destination process fd_array
+			hal_remote_swd( XPTR( dst_cxy , &dst_ptr->array[fd] ) , entry );
+		}
+	}
+
+    // release lock on source process fd_array
+	remote_spinlock_unlock( XPTR( src_cxy , &src_ptr->lock ) );
+} 
+
+
 
 ////////////////////////////////////////////////////////////////////////////////////
@@ -1611,22 +543,21 @@
                                  trdid_t   * trdid )
 {
-    ltid_t         ltid;
-    ltid_t         ltid_min;
-
-    bool_t         found = false;
-    lpid_t         lpid  = LPID_FROM_PID( process->pid );
- 
-// check arguments
-assert( __FUNCTION__, (process != NULL) , "process argument is NULL" );
-assert( __FUNCTION__, (thread != NULL) , "thread argument is NULL" );
-
-    // get the lock protecting th_tbl for all threads but the idle thread 
-    if( thread->type != THREAD_IDLE ) rwlock_wr_acquire( &process->th_lock );
-
-    // compute ltid_min : 0 for an user thread / 1 for a kernel thread
-    ltid_min = (lpid == 0) ? 1 : 0;
- 
-    // scan th_tbl
-    for( ltid = ltid_min ; ltid < CONFIG_THREADS_MAX_PER_CLUSTER ; ltid++ )
+    ltid_t   ltid;
+    bool_t   found;
+
+    if( process == NULL )
+    {
+        printk("\n[PANIC] in %s : process argument is NULL\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+    if( thread == NULL )
+    {
+        printk("\n[PANIC] in %s : thread argument is NULL\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // search a free slot in th_tbl[]
+    found = false;
+    for( ltid = 0 ; ltid < CONFIG_THREAD_MAX_PER_CLUSTER ; ltid++ )
     {
         if( process->th_tbl[ltid] == NULL )
@@ -1647,1500 +578,267 @@
     }
 
-    // release the lock protecting th_tbl
-    if( thread->type != THREAD_IDLE ) rwlock_wr_release( &process->th_lock );
-
-    return (found) ? 0 : -1;
-
-}  // end process_register_thread()
-
-///////////////////////////////////////////////////
-uint32_t process_remove_thread( thread_t * thread )
-{
-    uint32_t count;  // number of threads in local process descriptor
-
-// check thread
-assert( __FUNCTION__, (thread != NULL) , "thread argument is NULL" );
-
+    return (found) ? 0 : ENOMEM;
+}
+    
+///////////////////////////////////////////////
+void process_remove_thread( thread_t * thread )
+{
+    if( thread == NULL )
+    {
+        printk("\n[PANIC] in %s : thread argument is NULL\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+    
     process_t * process = thread->process;
 
     // get thread local index
     ltid_t  ltid = LTID_FROM_TRDID( thread->trdid );
-    
-    // get the lock protecting th_tbl[]
-    rwlock_wr_acquire( &process->th_lock );
-
-    // get number of threads
-    count = process->th_nr;
-
-// check th_nr value
-assert( __FUNCTION__, (count > 0) , "process th_nr cannot be 0" );
 
     // remove thread from th_tbl[]
     process->th_tbl[ltid] = NULL;
-    process->th_nr = count-1;
-
-    // release lock protecting th_tbl
-    rwlock_wr_release( &process->th_lock );
-
-    return count;
-
-}  // end process_remove_thread()
-
-/////////////////////////////////////////////////////////
-error_t process_make_fork( xptr_t      parent_process_xp,
-                           xptr_t      parent_thread_xp,
-                           pid_t     * child_pid,
-                           thread_t ** child_thread )
-{
-    process_t * process;         // local pointer on child process descriptor
-    thread_t  * thread;          // local pointer on child thread descriptor
-    pid_t       new_pid;         // process identifier for child process
-    pid_t       parent_pid;      // process identifier for parent process
-    xptr_t      ref_xp;          // extended pointer on reference process
-    xptr_t      vfs_bin_xp;      // extended pointer on .elf file
-    error_t     error;
-
-    // get cluster and local pointer for parent process
-    cxy_t       parent_process_cxy = GET_CXY( parent_process_xp );
-    process_t * parent_process_ptr = GET_PTR( parent_process_xp );
-
-    // get parent process PID and extended pointer on .elf file
-    parent_pid = hal_remote_l32 (XPTR( parent_process_cxy , &parent_process_ptr->pid));
-    vfs_bin_xp = hal_remote_l64(XPTR( parent_process_cxy , &parent_process_ptr->vfs_bin_xp));
-
-    // get extended pointer on reference process
-    ref_xp = hal_remote_l64( XPTR( parent_process_cxy , &parent_process_ptr->ref_xp ) );
-
-// check parent process is the reference process
-assert( __FUNCTION__, (parent_process_xp == ref_xp ) ,
-"parent process must be the reference process" );
-
-#if DEBUG_PROCESS_MAKE_FORK || DEBUG_PROCESS_ERROR
-uint32_t   cycle  = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-trdid_t    trdid = this->trdid;
-pid_t      pid   = this->process->pid;
-#endif
-
-#if( DEBUG_PROCESS_MAKE_FORK & 1 )
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-printk("\n[%s] thread[%x,%x] enter / cluster %x / cycle %d\n",
-__FUNCTION__, pid, trdid, local_cxy, cycle );
-#endif
-
-    // allocate a process descriptor
-    process = kmem_alloc( bits_log2(sizeof(process_t)) , AF_ZERO );
+    process->th_nr--;
+}
+
+/////////////////////////////////////////////////////
+error_t process_make_exec( exec_info_t  * exec_info )
+{
+    char           * path;                            // pathname to .elf file
+    process_t      * process;                         // pointer on new process 
+    pid_t            pid;                             // new process pid
+    thread_t       * thread;                          // pointer on new thread
+    pthread_attr_t   attr;                            // main thread attributes
+    core_t         * core;                            // pointer on selected core
+    lid_t            lid;                             // selected core local index
+	error_t          error; 
+
+	// get pid and pathname to .elf file  
+	path  = exec_info->path;
+    pid   = exec_info->pid;
+    
+    if( CXY_FROM_PID( pid ) != local_cxy )
+    {
+        printk("\n[PANIC] in %s : illegal process PID %x in cluster %x\n",
+               __FUNCTION__ , pid , local_cxy );
+        hal_core_sleep();
+    }
+
+    exec_dmsg("\n[INFO] %s enters in cluster %x for process %x / path = %s\n",
+                __FUNCTION__ , local_cxy , pid , path );
+
+    // create new process descriptor
+    process = process_alloc();
 
     if( process == NULL )
     {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate process descriptor / cxy %x / cycle %d\n", 
-__FUNCTION__, pid, trdid, local_cxy, cycle ); 
-#endif
-        return -1;
-    }
-
-    // allocate a child PID from local cluster
-    error = cluster_pid_alloc( process , &new_pid );
-    if( error ) 
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot get PID / cxy %x / cycle %d\n", 
-__FUNCTION__, pid, trdid, local_cxy, cycle ); 
-#endif
-	    kmem_free( process , bits_log2(sizeof(process_t)) );
-        return -1;
-    }
-
-#if( DEBUG_PROCESS_MAKE_FORK & 1 )
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-printk("\n[%s] thread[%x,%x] allocated child_process %x\n",
-__FUNCTION__, pid, trdid, new_pid );
-#endif
-
-    // initializes child process descriptor from parent process descriptor 
-    error = process_reference_init( process,
-                                    new_pid,
-                                    parent_process_xp );
-    if( error ) 
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot initialize child process / cxy %x / cycle %d\n", 
-__FUNCTION__, pid, trdid, local_cxy, cycle ); 
-#endif
-        cluster_pid_release( new_pid );
-	    kmem_free( process , bits_log2(sizeof(process_t)) );
-        return -1;
-    }
-
-#if( DEBUG_PROCESS_MAKE_FORK & 1 )
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-printk("\n[%s] thread[%x,%x] initialized child_process %x\n",
-__FUNCTION__, pid, trdid, new_pid );
-#endif
-
-    // copy VMM from parent descriptor to child descriptor
-    error = vmm_fork_copy( process,
-                           parent_process_xp );
-    if( error )
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot copy VMM to child process / cxy %x / cycle %d\n", 
-__FUNCTION__, pid, trdid, local_cxy, cycle ); 
-#endif
-        cluster_pid_release( new_pid );
-	    kmem_free( process , bits_log2(sizeof(process_t)) );
-        return -1;
-    }
-
-#if( DEBUG_PROCESS_MAKE_FORK & 1 )
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-{
-    printk("\n[%s] thread[%x,%x] copied VMM from parent to child\n",
-    __FUNCTION__, pid, trdid );
-    hal_vmm_display( XPTR( local_cxy , process ) , true );
-}
-#endif
-
-    // if parent_process is INIT, or if parent_process is the TXT owner,
-    // the child_process becomes the owner of its TXT terminal
-    if( (parent_pid == 1) || process_txt_is_owner( parent_process_xp ) )
-    {
-        process_txt_set_ownership( XPTR( local_cxy , process ) );
-
-#if( DEBUG_PROCESS_MAKE_FORK & 1 )
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-printk("\n[%s] thread[%x,%x] / child_process %x takes TXT ownership\n",
-__FUNCTION__ , pid, trdid, new_pid );
-#endif
-
-    }
-
-    // update extended pointer on .elf file
-    process->vfs_bin_xp = vfs_bin_xp;
-
-    // create child thread descriptor from parent thread descriptor
-    error = thread_user_fork( parent_thread_xp,
-                              process,
-                              &thread );
-    if( error )
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create main thread / cxy %x / cycle %d\n", 
-__FUNCTION__, pid, trdid, local_cxy, cycle ); 
-#endif
-        cluster_pid_release( new_pid );
-	    kmem_free( process , bits_log2(sizeof(process_t)) );
-        return -1;
-    }
-
-// check main thread LTID
-assert( __FUNCTION__, (LTID_FROM_TRDID(thread->trdid) == 0) ,
-"main thread must have LTID == 0" );
-
-#if( DEBUG_PROCESS_MAKE_FORK & 1 )
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-printk("\n[%s] thread[%x,%x] created main thread %x\n", 
-__FUNCTION__, pid, trdid, thread );
-#endif
-
-    // set COW flag in DATA, ANON, REMOTE vsegs in parent process VMM
-    // this includes all parent process copies in all clusters
-    if( parent_process_cxy == local_cxy )   // reference is local
-    {
-        vmm_set_cow( parent_process_ptr );
-    }
-    else                                    // reference is remote
-    {
-        rpc_vmm_set_cow_client( parent_process_cxy,
-                                parent_process_ptr );
-    }
-
-    // set COW flag in DATA, ANON, REMOTE vsegs for child process VMM
-    vmm_set_cow( process );
+        printk("\n[ERROR] in %s : no memory in cluster %x for process %x / path = %s\n",
+               __FUNCTION__ , local_cxy , pid , path );
+        return ENOMEM;
+    }
+
+    // initialize the process descriptor as the reference
+    process_reference_init( process , pid , exec_info->ppid );
+                                
+    // restore from exec_info the extended pointer on vfs root, cwd, and bin 
+    process->vfs_root_xp = exec_info->vfs_root_xp;
+    process->vfs_cwd_xp  = exec_info->vfs_cwd_xp;
+    process->vfs_bin_xp  = exec_info->vfs_bin_xp;
+
+    // restore from exec_info the embedded fd_array
+    process_fd_remote_copy( XPTR( local_cxy , &process->fd_array ), exec_info->fd_array_xp );
+                            
+    exec_dmsg("\n[INFO] %s restaured fd-array in cluster %x for process %x / path = %s\n",
+                __FUNCTION__, local_cxy , pid , path );
+
+	// initialize signal manager TODO ??? [AG]
+	// signal_manager_init( process );
+
+    // initialize process VMM
+	vmm_init( process );
+
+    exec_dmsg("\n[INFO] %s initialized VMM in cluster %x for process %x / path = %s\n",
+                __FUNCTION__ , local_cxy , pid , path );
+
+    // register "code" and "data" vsegs as well a the process entry-point in VMM,
+    // using informations contained in the elf file.
+	error = elf_load_process( path , process );
+
+	if( error )
+	{
+		printk("\n[ERROR] in %s : failed to access elf file for process %x / path = %s\n", 
+		       __FUNCTION__, pid , path );
+        process_destroy( process );
+        return error;
+	}
+
+    // create "heap" vseg descriptor
+    vseg_t * heap_vseg = vmm_create_vseg( process,
+                                          CONFIG_VMM_HEAP_BASE,
+                                          CONFIG_VMM_HEAP_SIZE,
+                                          VSEG_TYPE_HEAP );
+    if( heap_vseg == NULL )
+	{
+		printk("\n[ERROR] in %s : cannot create heap vseg for process %x / path = %s\n",
+		       __FUNCTION__, pid , path );
+        process_destroy( process );
+        return error;
+	}
+
+    // create "stack" vseg descriptor for associated main thread
+    vseg_t * stack_vseg = vmm_create_vseg( process,
+                                           0,             // base defined by VMM
+                                           0,             // size defined by VMM
+                                           VSEG_TYPE_STACK );
+    if( stack_vseg == NULL )
+	{
+		printk("\n[ERROR] in %s : cannot create stack vseg for process %x / path = %s\n",
+		       __FUNCTION__, pid , path );
+        process_destroy( process );
+        return error;
+	}
+
+    // select a core in cluster
+    lid  = cluster_select_local_core();
+    core = &LOCAL_CLUSTER->core_tbl[lid];
+
+    // initialize pthread attributes for main thread
+    attr.pid          = pid;
+    attr.entry_func   = (void*)process->vmm.entry_point;
+    attr.entry_args   = exec_info->args_pointers; 
+    attr.flags        = PT_FLAG_DETACH;             // main thread always detached
+    attr.cxy          = local_cxy;
+    attr.lid          = lid;
+
+    // create and initialise thread descriptor, link thread & process
+	error = thread_user_create( &thread, 
+                                &attr,
+                                stack_vseg->min,
+                                stack_vseg->max - stack_vseg->min );
+	if( error )
+	{
+		printk("\n[ERROR] in %s : cannot create thread for process %x / path = %s\n",
+		       __FUNCTION__, pid , path );
+        process_destroy( process );
+        return error;
+	}
+
+	// Register thread in scheduler 
+	sched_register_thread( core , thread );
+
+	exec_dmsg("\n[INFO] %s created thread for process %x on core %d in cluster %x\n",
+               __FUNCTION__ , process->pid , core->lid , local_cxy );
+
+    // activate new thread 
+	thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
+
+	return 0;
+
+} // end process_make_exec()
+
+//////////////////////////
+void process_init_create()
+{
+	process_t   * process_init;  // process_init descriptor 
+	thread_t    * thread_init;   // process_init main thread descriptor
+    pid_t         init_pid;      // process_init pid
+    exec_info_t   exec_info;     // structure to be passed to process_make_exec()
+
+	error_t error1 = 0;
+	error_t error2 = 0;
+	error_t error3 = 0;
+
+	process_dmsg("\n[INFO] %s enters in cluster %x\n", __FUNCTION__ , local_cxy );
+
+    // allocate memory for process descriptor
+    process_init = process_alloc();
+    if( process_init == NULL )
+    {
+        printk("\n[PANIC] in %s : no memory for process descriptor in cluster %x\n",
+               __FUNCTION__ , local_cxy );
+        hal_core_sleep();
+    }
+
+    // get a pid from the local cluster 
+    xptr_t xp_process = XPTR( local_cxy , process_init );
+    error1 = cluster_pid_alloc( xp_process , &init_pid );
+    if( error1 )
+    {
+        printk("\n[PANIC] in %s : cannot get PID in cluster %x\n", 
+               __FUNCTION__ , local_cxy );
+		hal_core_sleep();
+    }
  
-#if( DEBUG_PROCESS_MAKE_FORK & 1 )
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-printk("\n[%s] thread[%x,%x] set COW in DATA / ANON / REMOTE for parent and child\n",
-__FUNCTION__, pid, trdid );
-#endif
-
-    // get extended pointers on parent children_root, children_lock and children_nr
-    xptr_t children_root_xp = XPTR( parent_process_cxy , &parent_process_ptr->children_root );
-    xptr_t children_lock_xp = XPTR( parent_process_cxy , &parent_process_ptr->children_lock );
-    xptr_t children_nr_xp   = XPTR( parent_process_cxy , &parent_process_ptr->children_nr   );
-
-    // register process in parent children list
-    remote_queuelock_acquire( children_lock_xp );
-	xlist_add_last( children_root_xp , XPTR( local_cxy , &process->children_list ) );
-	hal_remote_atomic_add( children_nr_xp , 1 );
-    remote_queuelock_release( children_lock_xp );
-
-    // return success
-    *child_thread = thread;
-    *child_pid    = new_pid;
-
-#if DEBUG_PROCESS_MAKE_FORK
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_MAKE_FORK < cycle )
-printk("\n[%s] thread[%x,%x] exit / created process %x / cycle %d\n",
-__FUNCTION__, pid, trdid, new_pid, cycle );
-#endif
-
-    return 0;
-
-}   // end process_make_fork()
-
-#if DEBUG_PROCESS_MAKE_EXEC
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// This static debug function displays the current state of the exec_info structure
-// embedded in the calling process descriptor.
-//
-// WARNING : It can be used after execution of the sys_exec function, but it cannot
-//           be used after execution of the process_make_exec() function, because the
-//           kernel pointers have been replaced by user pointers. 
-/////////////////////////////////////////////////////////////////////////////////////////
-static void process_exec_info_display( bool_t args_ok,
-                                       bool_t envs_ok )
-{
-    uint32_t   i;
-    char     * str;    // local pointer on a string
-
-    process_t * process = CURRENT_THREAD->process;
-
-    // get relevant info from calling process descriptor
-    pid_t       pid      = process->pid;
-
-    uint32_t    args_nr  = process->exec_info.args_nr;
-    char     ** args     = process->exec_info.args_pointers;
-
-    uint32_t    envs_nr  = process->exec_info.envs_nr;
-    char     ** envs     = process->exec_info.envs_pointers;
-
-    char      * path     = process->exec_info.path;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-    nolock_printk("\n***** exec_info for process %x in cluster %x / %s\n",
-    pid , local_cxy , path ); 
-
-    // display arguments if required
-    if( args_ok )
-    {
-        for( i = 0 ; i < args_nr ; i++ )
-        {
-            str = args[i];
-            if( str != NULL)         // display pointer and string
-            nolock_printk(" - &arg[%d] = %x / arg[%d] = <%s>\n", i, str, i, str );
-            else                     // display WARNING
-            nolock_printk(" - unexpected NULL pointer for &arg[%d]\n", i );
-        }
-    }
-
-    // display env variables if required
-    if( envs_ok )
-    {
-        for( i = 0 ; i < envs_nr ; i++ )
-        {
-            str = envs[i];
-            if( str != NULL)     // display pointer and string
-            nolock_printk(" - &env[%d] = %x / env[%d] = <%s>\n", i, str, i, str );
-            else                     // display WARNING 
-            nolock_printk(" - unexpected NULL pointer for &env[%d]\n", i );
-        }
-    }
-
-    // release TXT0 lock 
-    remote_busylock_release( lock_xp );
-
-}  // end process_exec_info_display()
-
-#endif // DEBUG_PROCESS_MAKE_EXEC
-
-/////////////////////////////////
-error_t process_make_exec( void )
-{
-    thread_t       * this;                    // local pointer on this thread
-    process_t      * process;                 // local pointer on this process
-    pid_t            pid;                     // this process identifier
-    trdid_t          trdid;                   // this thread identifier
-    xptr_t           ref_xp;                  // reference process for this process
-	error_t          error;                   // value returned by called functions
-    char           * elf_path;                // path to .elf file
-    xptr_t           file_xp;                 // extended pointer on .elf file descriptor
-    uint32_t         file_id;                 // file index in fd_array
-    vseg_t         * vseg;                    // local pointer on created vseg(s)
-    uint32_t         n;                       // index for loops
-
-    uint32_t         args_nr;                 // actual number of args (from exec_info)
-    intptr_t         args_base;               // args vseg base address in user space
-    uint32_t         args_size;               // args vseg size (bytes)
-
-    uint32_t         envs_nr;                 // actual number of envs (from exec_info)
-    intptr_t         envs_base;               // envs vseg base address in user space
-    uint32_t         envs_size;               // envs vseg size (bytes)
-
-#if DEBUG_PROCESS_MAKE_EXEC || DEBUG_PROCESS_ERROR
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get calling thread, process, pid, trdid, and ref_xp 
-    this    = CURRENT_THREAD;
-    process = this->process;
-    pid     = process->pid;
-    trdid   = this->trdid;
-    ref_xp  = process->ref_xp;
-
-	// get .elf pathname from exec_info structure
-	elf_path      = process->exec_info.path;
-
-#if DEBUG_PROCESS_MAKE_EXEC
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] enters for <%s> / cycle %d\n",
-__FUNCTION__, pid, trdid, elf_path, cycle );
-#endif
-
-    // 1. open the file identified by <path>
-    file_xp = XPTR_NULL;
-    file_id = 0xFFFFFFFF;
-	error   = vfs_open( process->vfs_root_xp,
-	                    elf_path,
-                        ref_xp,
-	                    O_RDONLY,
-	                    0,
-	                    &file_xp,
-	                    &file_id );
-	if( error )
-	{
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] failed to open file <%s> / cycle %d\n", 
-__FUNCTION__, pid, trdid, elf_path, cycle ); 
-#endif
-		return -1;
+    // initializes process_init descriptor as the reference
+	process_reference_init( process_init , init_pid , process_zero.pid );
+
+    // initialize process_init VMM
+	vmm_init( process_init );
+
+    // initializes vfs_root and vfs_cwd from process_zero
+	vfs_file_count_up( process_zero.vfs_root_xp );
+	process_init->vfs_root_xp = process_zero.vfs_root_xp;
+
+	vfs_file_count_up( process_zero.vfs_cwd_xp );
+	process_init->vfs_cwd_xp  = process_zero.vfs_cwd_xp;
+
+    // update children list in process_zero
+	xlist_add_last( XPTR( local_cxy , &process_zero.children_root ),
+                    XPTR( local_cxy , &process_init->brothers_list ) );
+	process_zero.children_nr = 1;
+
+    // TODO open stdin / stdout / stderr pseudo-files
+    xptr_t  stdin_xp;
+    xptr_t  stdout_xp;
+    xptr_t  stderr_xp; 
+
+	// error1 = vfs_open( process_init->vfs_cwd_xp, NULL, VFS_O_RDONLY, &stdin_xp );
+	// error2 = vfs_open( process_init->vfs_cwd_xp, NULL, VFS_O_WRONLY, &stdout_xp );
+	// error3 = vfs_open( process_init->vfs_cwd_xp, NULL, VFS_O_WRONLY, &stderr_xp );
+
+	if( error1 || error2 || error3 )
+	{
+		if( !error1 ) vfs_close( stdin_xp  , NULL );
+		if( !error2 ) vfs_close( stdout_xp , NULL );
+		if( !error3 ) vfs_close( stderr_xp , NULL );
+    
+		printk("\n[PANIC] in %s : cannot open stdin/stdout/stderr in cluster %x\n",
+               __FUNCTION__ , local_cxy );
+        hal_core_sleep();
 	}
 
-#if (DEBUG_PROCESS_MAKE_EXEC & 1)
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] opened file <%s>\n",
-__FUNCTION__, pid, trdid, elf_path );
-#endif
-
-    // 2. delete all threads other than this main thread in all clusters
-    process_sigaction( pid , DELETE_ALL_THREADS );
-
-#if (DEBUG_PROCESS_MAKE_EXEC & 1)
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] deleted existing threads\n",
-__FUNCTION__, pid, trdid );
-#endif
-
-    // 3. reset calling process VMM
-    vmm_user_reset( process );
-
-#if( DEBUG_PROCESS_MAKE_EXEC & 1 )
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-{
-    printk("\n[%s] thread[%x,%x] completed VMM reset\n",
-    __FUNCTION__, pid, trdid );
-    hal_vmm_display( ref_xp , true );
-}
-#endif
-
-    // 4. register the "args" vseg in VSL and map it in GPT, if args_nr != 0.
-    //    As this vseg contains an array of pointers, the kernel pointers 
-    //    are replaced by user pointers in new process space.
-    args_nr = process->exec_info.args_nr;
-
-    if( args_nr > 0 )
-    {
-        // get args vseg base and size in user space
-        args_base = CONFIG_VMM_UTILS_BASE << CONFIG_PPM_PAGE_ORDER;
-        args_size = CONFIG_VMM_ARGS_SIZE << CONFIG_PPM_PAGE_ORDER;
-
-        // create and register args vseg in VMM
-        vseg = vmm_create_vseg( process,
-                                VSEG_TYPE_DATA,
-                                args_base,
-                                args_size,
-                                0,                 // file_offset unused for DATA type
-                                0,                 // file_size unused for DATA type
-                                XPTR_NULL,         // mapper_xp unused for DATA type
-                                0 );               // cxy unused for DATA type
-        if( vseg == NULL )
-        {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create args vseg for <%s> / cycle %d\n", 
-__FUNCTION__, pid, trdid, elf_path, cycle ); 
-#endif
-		     return -1;
-        }
-
-#if( DEBUG_PROCESS_MAKE_EXEC & 1 )
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-{
-    printk("\n[%s] thread[%x,%x] args vseg registered in new process VSL\n",
-    __FUNCTION__, pid, trdid );
-    hal_vmm_display( ref_xp , true );
-}
-#endif
-        // map all pages for the "args" vseg
-        uint32_t fake_attr;   // required for hal_gpt_lock_pte()
-        ppn_t    fake_ppn;    // required for hal_gpt_lock_pte()
-
-        xptr_t   base_xp = XPTR( local_cxy , process->exec_info.args_pointers );
-        xptr_t   gpt_xp  = XPTR( local_cxy , &process->vmm.gpt );
-        uint32_t attr    = GPT_MAPPED | GPT_SMALL | GPT_READABLE | GPT_USER | GPT_CACHABLE;
-        vpn_t    vpn     = CONFIG_VMM_UTILS_BASE;
-        ppn_t    ppn     = ppm_base2ppn( base_xp );
-
-        for( n = 0 ; n < CONFIG_VMM_ARGS_SIZE ; n++ )  
-        {
-            // lock the PTE
-            if (hal_gpt_lock_pte( gpt_xp , vpn + n , &fake_attr , &fake_ppn ) )
-            {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot map vpn[%x] of args vseg for <%s> / cycle %d\n", 
-__FUNCTION__, pid, trdid,  vpn + n , elf_path , cycle ); 
-#endif
-		        return -1;
-            }
-
-            // map and unlock the PTE
-            hal_gpt_set_pte( gpt_xp , vpn + n , attr , ppn + n );
-       }
-
-#if( DEBUG_PROCESS_MAKE_EXEC & 1 )
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-{
-    printk("\n[%s] thread[%x,%x] args vseg mapped in new process GPT\n",
-    __FUNCTION__, pid, trdid );
-    hal_vmm_display( ref_xp , true );
-    process_exec_info_display( true , false );   // args & not envs
-}
-#endif
-
-        // build pointer on args buffer in kernel space
-        char  ** k_args = process->exec_info.args_pointers;
-
-        // build pointer on args buffer in user space
-        char  ** u_args = (char **)args_base;
-
-        // set user space pointers in kernel args buffer
-        for( n = 0 ; n < args_nr ; n++ )
-        {
-            k_args[n] = (char *)((intptr_t)k_args[n] + (intptr_t)u_args - (intptr_t)k_args);
-        } 
-
-#if( DEBUG_PROCESS_MAKE_EXEC & 1 )
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] args user pointers set in exec_info\n",
-__FUNCTION__, pid, trdid );
-#endif
-
-    }
-
-    // 5. register the "envs" vseg in VSL and map it in GPT, if envs_nr != 0.
-    //    As this vseg contains an array of pointers, the kernel pointers 
-    //    are replaced by user pointers in new process space.
-
-    envs_nr = process->exec_info.envs_nr;
-
-    if( envs_nr > 0 )
-    {
-        // get envs vseg base and size in user space from config
-        envs_base = (CONFIG_VMM_UTILS_BASE + CONFIG_VMM_ARGS_SIZE) << CONFIG_PPM_PAGE_ORDER;
-        envs_size = CONFIG_VMM_ENVS_SIZE << CONFIG_PPM_PAGE_ORDER;
-
-        // TODO (should be similar to the code for args above)
-
-#if( DEBUG_PROCESS_MAKE_EXEC & 1 )
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] envs user pointers set in exec_info\n",
-__FUNCTION__, pid, trdid );
-#endif
-
-    }
-
-
-    // 6. register code & data vsegs, and entry-point in process VMM,
-    // register extended pointer on .elf file in process descriptor
-	error = elf_load_process( file_xp , process );
-
-    if( error )
-	{
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] failed to access file <%s> / cycle %d\n", 
-__FUNCTION__, pid, trdid , elf_path , cycle ); 
-#endif
-        return -1;
-	}
-
-#if( DEBUG_PROCESS_MAKE_EXEC & 1 )
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-{
-    printk("\n[%s] thread[%x,%x] registered code/data vsegs / entry %x\n",
-    __FUNCTION__, pid, trdid, process->vmm.entry_point );
-    hal_vmm_display( ref_xp , true );
-}
-#endif
-
-    // 7. allocate an user stack vseg for main thread
-    vseg = vmm_create_vseg( process,
-                            VSEG_TYPE_STACK,
-                            LTID_FROM_TRDID( trdid ),
-                            0,                 // length unused
-                            0,                 // file_offset unused
-                            0,                 // file_size unused
-                            XPTR_NULL,         // mapper_xp unused
-                            local_cxy );
-    if( vseg == NULL )
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] failed to set u_stack vseg for <%s> / cycle %d\n", 
-__FUNCTION__, pid, trdid , elf_path , cycle ); 
-#endif
-		return -1;
-    }
-
-#if( DEBUG_PROCESS_MAKE_EXEC & 1 )
-if( DEBUG_PROCESS_MAKE_EXEC < cycle )
-{
-    printk("\n[%s] thread[%x,%x] registered stack vseg\n",
-    __FUNCTION__, pid, trdid );
-    hal_vmm_display( ref_xp , true );
-}
-#endif
-
-    // update user stack in thread descriptor
-    this->user_stack_vseg = vseg;
-
-    // 8. update the main thread descriptor ... and jumps (one way) to user code 
-    thread_user_exec( args_nr , args_base );
-
-    if( error )
-    {
-
-#if DEBUG_PROCESS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] failed to set main thread for <%s> / cycle %d\n", 
-__FUNCTION__, pid, trdid , elf_path , cycle ); 
-#endif
-        return -1;
-    }
-
-    // should not be reached, avoid a warning
-	return 0;
-
-}  // end process_make_exec()
-
-
-////////////////////////////////////////////////
-void process_zero_create( process_t   * process,
-                          boot_info_t * info )
-{
-    error_t error;
-    pid_t   pid;
-
-#if DEBUG_PROCESS_ZERO_CREATE
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] enter / cluster %x / cycle %d\n",
-__FUNCTION__, local_cxy, cycle );
-#endif
-
-    // get pointer on VMM
-    vmm_t * vmm = &process->vmm;
-
-    // get PID from local cluster manager for this kernel process
-    error = cluster_pid_alloc( process , &pid );
-
-    if( error || (LPID_FROM_PID( pid ) != 0) )
-    {
-        printk("\n[PANIC] in %s : cannot get valid PID in cluster %x / PID = %x\n",
-        __FUNCTION__ , local_cxy, pid );
-        hal_core_sleep();
-    }
-
-#if (DEBUG_PROCESS_ZERO_CREATE & 1)
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] allocated pid %x in cluster %x\n", __FUNCTION__, pid, local_cxy );
-#endif
-
-    // initialize PID, REF_XP, PARENT_XP, and STATE
-    // the kernel process_zero is its own parent_process,
-    // reference_process, and owner_process, and cannot be killed...
-    process->pid        = pid;
-    process->ref_xp     = XPTR( local_cxy , process );
-    process->owner_xp   = XPTR( local_cxy , process );
-    process->parent_xp  = XPTR( local_cxy , process );
-    process->term_state = 0;
-
-    // initialize VSL as empty
-    vmm->vsegs_nr = 0;
-	xlist_root_init( XPTR( local_cxy , &vmm->vsegs_root ) );
-
-#if (DEBUG_PROCESS_ZERO_CREATE & 1)
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] initialized VSL empty in cluster %x\n", __FUNCTION__, local_cxy );
-#endif
-
-    // initialize GPT as empty
-    error = hal_gpt_create( &vmm->gpt );
-
-    if( error ) 
-    {
-        printk("\n[PANIC] in %s : cannot create empty GPT\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-#if (DEBUG_PROCESS_ZERO_CREATE & 1)
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] initialized GPT empty in cluster %x\n", __FUNCTION__, local_cxy );
-#endif
-
-    // initialize VSL and GPT locks
-    remote_rwlock_init( XPTR( local_cxy , &vmm->vsl_lock ) , LOCK_VMM_VSL );
-    
-    // create kernel vsegs in GPT and VSL, as required by the hardware architecture
-    error = hal_vmm_kernel_init( info );
-
-    if( error ) 
-    {
-        printk("\n[PANIC] in %s : cannot create kernel vsegs in VMM\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-#if (DEBUG_PROCESS_ZERO_CREATE & 1)
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] initialized hal specific VMM in cluster%x\n", __FUNCTION__, local_cxy );
-hal_vmm_display( XPTR( local_cxy , process ) , true ); 
-#endif
-
-    // reset th_tbl[] array and associated fields
-    uint32_t i;
-    for( i = 0 ; i < CONFIG_THREADS_MAX_PER_CLUSTER ; i++ )
-	{
-        process->th_tbl[i] = NULL;
-    }
-    process->th_nr  = 0;
-    rwlock_init( &process->th_lock , LOCK_PROCESS_THTBL );
-
-#if (DEBUG_PROCESS_ZERO_CREATE & 1)
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] initialized th_tbl[] in cluster%x\n", __FUNCTION__, local_cxy );
-#endif
-
-    // reset children list as empty
-    xlist_root_init( XPTR( local_cxy , &process->children_root ) );
-    process->children_nr = 0;
-    remote_queuelock_init( XPTR( local_cxy , &process->children_lock ),
-                           LOCK_PROCESS_CHILDREN );
-
-#if (DEBUG_PROCESS_ZERO_CREATE & 1)
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] initialized children list in cluster%x\n", __FUNCTION__, local_cxy );
-#endif
-
-    // register kernel process in cluster manager local_list
-    cluster_process_local_link( process );
-    
-	hal_fence();
-
-#if DEBUG_PROCESS_ZERO_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_ZERO_CREATE < cycle )
-printk("\n[%s] exit / cluster %x / cycle %d\n",
-__FUNCTION__, local_cxy, cycle );
-#endif
-
-}  // end process_zero_create()
-
-////////////////////////////////
-void process_init_create( void )
-{
-    process_t      * process;       // local pointer on process descriptor
-    pid_t            pid;           // process_init identifier
-    thread_t       * thread;        // local pointer on main thread
-    pthread_attr_t   attr;          // main thread attributes
-    lid_t            lid;           // selected core local index for main thread
-    xptr_t           file_xp;       // extended pointer on .elf file descriptor
-    uint32_t         file_id;       // file index in fd_array
-    error_t          error;
-
-#if DEBUG_PROCESS_INIT_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_INIT_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-    // allocates memory for process descriptor from local cluster
-    process = kmem_alloc( bits_log2(sizeof(process_t)) , AF_ZERO );
-    if( process == NULL )
-    {
-        printk("\n[PANIC] in %s : cannot allocate process\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-    // set the CWD and VFS_ROOT fields in process descriptor
-    process->cwd_xp      = process_zero.vfs_root_xp;
-    process->vfs_root_xp = process_zero.vfs_root_xp;
-
-    // get PID from local cluster
-    error = cluster_pid_alloc( process , &pid );
-    if( error ) 
-    {
-        printk("\n[PANIC] in %s : cannot allocate PID\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-    if( pid != 1 ) 
-    {
-        printk("\n[PANIC] in %s : process PID must be 0x1\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-    // initialize process descriptor / parent is local process_zero
-    error = process_reference_init( process,
-                                    pid,
-                                    XPTR( local_cxy , &process_zero ) );  
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot initialize process\n", __FUNCTION__ );
-        hal_core_sleep();
-    }
-
-#if(DEBUG_PROCESS_INIT_CREATE & 1)
-if( DEBUG_PROCESS_INIT_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] initialized process descriptor\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // open the file identified by CONFIG_PROCESS_INIT_PATH
-    file_xp = XPTR_NULL;
-    file_id = -1;
-	error   = vfs_open( process->vfs_root_xp,
-	                    CONFIG_PROCESS_INIT_PATH,
-                        XPTR( local_cxy , process ),
-	                    O_RDONLY,
-	                    0,
-	                    &file_xp,
-	                    &file_id );
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot open file <%s>\n",
-         __FUNCTION__, CONFIG_PROCESS_INIT_PATH  );
-        hal_core_sleep();
-    }
-
-#if(DEBUG_PROCESS_INIT_CREATE & 1)
-if( DEBUG_PROCESS_INIT_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] open .elf file decriptor\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // register "code" and "data" vsegs as well as entry-point
-    // in process VMM, using information contained in the elf file.
-	error = elf_load_process( file_xp , process );
-
-    if( error ) 
-    {
-        printk("\n[PANIC] in %s : cannot access file <%s>\n",
-         __FUNCTION__, CONFIG_PROCESS_INIT_PATH  );
-        hal_core_sleep();
-    }
-
-
-#if(DEBUG_PROCESS_INIT_CREATE & 1)
-if( DEBUG_PROCESS_INIT_CREATE < cycle )
-{
-    printk("\n[%s] thread[%x,%x] registered code/data vsegs in VMM\n",
-    __FUNCTION__, this->process->pid, this->trdid );
-    hal_vmm_display( XPTR( local_cxy , process ) , true );
-}
-#endif
-
-    // get extended pointers on process_zero children_root, children_lock
-    xptr_t children_root_xp = XPTR( local_cxy , &process_zero.children_root );
-    xptr_t children_lock_xp = XPTR( local_cxy , &process_zero.children_lock );
-
-    // take lock protecting kernel process children list
-    remote_queuelock_acquire( children_lock_xp );
-
-    // register process INIT in parent local process_zero 
-	xlist_add_last( children_root_xp , XPTR( local_cxy , &process->children_list ) );
-	hal_atomic_add( &process_zero.children_nr , 1 );
-
-    // release lock protecting kernel process children list
-    remote_queuelock_release( children_lock_xp );
-
-#if(DEBUG_PROCESS_INIT_CREATE & 1)
-if( DEBUG_PROCESS_INIT_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] registered init process in parent\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // select a core in local cluster to execute the main thread
-    lid  = cluster_select_local_core( local_cxy );
-
-    // initialize pthread attributes for main thread
-    attr.attributes = PT_ATTR_DETACH | PT_ATTR_CLUSTER_DEFINED | PT_ATTR_CORE_DEFINED;
-    attr.cxy        = local_cxy;
-    attr.lid        = lid;
-
-    // create and initialize thread descriptor
-	error = thread_user_create( pid,
-                                (void *)process->vmm.entry_point,
-                                NULL,
-                                &attr,
-                                &thread );
-
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot create main thread\n", __FUNCTION__  );
-        hal_core_sleep();
-    }
-    if( thread->trdid != 0 )
-    {
-        printk("\n[PANIC] in %s : bad main thread trdid\n", __FUNCTION__  );
-        hal_core_sleep();
-    }
-
-#if(DEBUG_PROCESS_INIT_CREATE & 1)
-if( DEBUG_PROCESS_INIT_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] created main thread\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // activate thread
-	thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_GLOBAL );
-
-    hal_fence();
-
-#if DEBUG_PROCESS_INIT_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_INIT_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-#endif
-
-}  // end process_init_create()
-
-///////////////////////////////////////////////////
-uint32_t process_build_string( xptr_t   process_xp,
-                               char   * buffer,
-                               uint32_t size )
-{
-    int32_t       length;          // actual length of the string
-
-    process_t   * process_ptr;     // process descriptor local pointer
-    cxy_t         process_cxy;     // process descriptor cluster identifier
-
-    xptr_t        parent_xp;       // extended pointer on parent process
-    process_t   * parent_ptr;      // parent process local pointer
-    cxy_t         parent_cxy;      // parent process cluster identifier
-
-    xptr_t        owner_xp;        // extended pointer on owner process
-    process_t   * owner_ptr;       // owner process local pointer
-    cxy_t         owner_cxy;       // owner process cluster identifier
-
-    pid_t         pid;             // process identifier
-    pid_t         ppid;            // parent process identifier
-    lpid_t        lpid;            // local process identifier
-    uint32_t      state;           // terminaison state
-    uint32_t      th_nr;           // number of threads
-
-    xptr_t        txt_file_xp;     // extended pointer on TXT_RX file descriptor
-    xptr_t        txt_chdev_xp;    // extended pointer on TXT_RX chdev
-    chdev_t     * txt_chdev_ptr;
-    cxy_t         txt_chdev_cxy;
-    xptr_t        txt_owner_xp;    // extended pointer on TXT owner process 
-
-    xptr_t        elf_file_xp;     // extended pointer on .elf file 
-    cxy_t         elf_file_cxy;
-    vfs_file_t  * elf_file_ptr;
-    vfs_inode_t * elf_inode_ptr;   // local pointer on .elf inode
-
-    char          txt_name[CONFIG_VFS_MAX_NAME_LENGTH];
-    char          elf_name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-assert( __FUNCTION__ , (size >= 80 ) , "buffer size too small" );
-
-    // get cluster and local pointer on process
-    process_ptr = GET_PTR( process_xp );
-    process_cxy = GET_CXY( process_xp );
-
-    // get process PID, LPID, and state
-    pid   = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) );
-    lpid  = LPID_FROM_PID( pid );
-    state = hal_remote_l32( XPTR( process_cxy , &process_ptr->term_state ) );
-
-    // get process PPID
-    parent_xp  = hal_remote_l64( XPTR( process_cxy , &process_ptr->parent_xp ) );
-    parent_cxy = GET_CXY( parent_xp );
-    parent_ptr = GET_PTR( parent_xp );
-    ppid       = hal_remote_l32( XPTR( parent_cxy , &parent_ptr->pid ) );
-
-    // get number of threads
-    th_nr      = hal_remote_l32( XPTR( process_cxy , &process_ptr->th_nr ) );
-
-    // get pointers on owner process descriptor
-    owner_xp  = hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp ) );
-    owner_cxy = GET_CXY( owner_xp );
-    owner_ptr = GET_PTR( owner_xp );
-
-    // get process TXT name and .elf name
-    if( lpid )                                   // user process
-    {
-        // get extended pointer on file descriptor associated to TXT_RX 
-        txt_file_xp = hal_remote_l64( XPTR( owner_cxy , &owner_ptr->fd_array.array[0] ) );
-
-assert( __FUNCTION__, (txt_file_xp != XPTR_NULL) ,
-"process must be attached to one TXT terminal" ); 
-
-        // get TXT_RX chdev pointers
-        txt_chdev_xp  = chdev_from_file( txt_file_xp );
-        txt_chdev_cxy = GET_CXY( txt_chdev_xp );
-        txt_chdev_ptr = GET_PTR( txt_chdev_xp );
-
-        // get TXT_RX name and ownership
-        hal_remote_strcpy( XPTR( local_cxy , txt_name ) ,
-                           XPTR( txt_chdev_cxy , txt_chdev_ptr->name ) );
-    
-        // get TXT_owner process
-        txt_owner_xp = (xptr_t)hal_remote_l64( XPTR( txt_chdev_cxy, 
-                                                     &txt_chdev_ptr->ext.txt.owner_xp ) );
-        // get process .elf name
-        elf_file_xp   = hal_remote_l64( XPTR( process_cxy , &process_ptr->vfs_bin_xp ) );
-        elf_file_cxy  = GET_CXY( elf_file_xp );
-        elf_file_ptr  = GET_PTR( elf_file_xp );
-        elf_inode_ptr = hal_remote_lpt( XPTR( elf_file_cxy , &elf_file_ptr->inode ) );
-        vfs_inode_get_name( XPTR( elf_file_cxy , elf_inode_ptr ) , elf_name );
-    }
-    else                                         // kernel process_zero
-    {
-        // TXT name and .elf name are not registered in kernel process
-        strcpy( txt_name , "txt0_rx" );
-        txt_owner_xp = process_xp; 
-        strcpy( elf_name , "kernel.elf" );
-    }
-
-    // display process info
-    if( txt_owner_xp == process_xp )
-    {
-        length = snprintk( buffer, size,
-        "PID %X | %s (FG) | %X | PPID %X | TS %X | %d | %s\n", 
-        pid, txt_name, process_ptr, ppid, state, th_nr, elf_name );
-    }
-    else
-    {
-        length = snprintk( buffer, size,
-        "PID %X | %s (BG) | %X | PPID %X | TS %X | %d | %s\n", 
-        pid, txt_name, process_ptr, ppid, state, th_nr, elf_name );
-    }
-
-    // check length 
-    if( (length < 0) )
-    {
-        length = snprintk( buffer , size , 
-        "buffer too small for process %x in cluster %x", pid , process_cxy );
-    }
-
-    return length;  
-
-}  // end process_build_string()
-
-/////////////////////////////////////////
-void process_display( xptr_t process_xp )
-{
-    char  buffer[CONFIG_PROCESS_DISPLAY_BUF_SIZE];
-
-    // build the string to be displayed
-    process_build_string( process_xp,
-                          buffer,
-                          CONFIG_PROCESS_DISPLAY_BUF_SIZE ); 
-    // display the string
-    nolock_puts( buffer );
-
-}  // end process_display() 
-
-
-////////////////////////////////////////////////////////////////////////////////////////
-//     Terminals related functions
-////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////
-uint32_t process_txt_alloc( void )
-{
-    uint32_t  index;       // TXT terminal index
-    xptr_t    chdev_xp;    // extended pointer on TXT_RX chdev
-    chdev_t * chdev_ptr;   // local pointer on TXT_RX chdev
-    cxy_t     chdev_cxy;   // TXT_RX chdev cluster
-    xptr_t    root_xp;     // extended pointer on owner field in chdev
-
-    // scan the user TXT_RX chdevs (TXT0 is reserved for kernel)
-    for( index = 1 ; index < LOCAL_CLUSTER->nb_txt_channels ; index ++ )
-    {
-        // get pointers on TXT_RX[index]
-        chdev_xp  = chdev_dir.txt_rx[index];
-        chdev_cxy = GET_CXY( chdev_xp );
-        chdev_ptr = GET_PTR( chdev_xp );
-
-        // get extended pointer on root of attached process
-        root_xp = XPTR( chdev_cxy , &chdev_ptr->ext.txt.root );
-
-        // return free TXT index if found
-        if( xlist_is_empty( root_xp ) ) return index;  
-    }
-
-    assert( __FUNCTION__, false , "no free TXT terminal found" );
-
-    return -1;
-
-} // end process_txt_alloc()
-
-/////////////////////////////////////////////
-void process_txt_attach( xptr_t   process_xp,
-                         uint32_t txt_id )
-{
-    xptr_t      chdev_xp;     // extended pointer on TXT_RX chdev
-    cxy_t       chdev_cxy;    // TXT_RX chdev cluster
-    chdev_t *   chdev_ptr;    // local pointer on TXT_RX chdev
-    xptr_t      root_xp;      // extended pointer on list root in chdev
-    xptr_t      lock_xp;      // extended pointer on list lock in chdev
-
-    process_t * process_ptr = GET_PTR(process_xp );
-    cxy_t       process_cxy = GET_CXY(process_xp );
-
-// check process is in owner cluster
-assert( __FUNCTION__, (process_xp == hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp ))),
-"process descriptor not in owner cluster" );
-
-// check terminal index
-assert( __FUNCTION__, (txt_id < LOCAL_CLUSTER->nb_txt_channels) ,
-"illegal TXT terminal index" );
-
-    // get pointers on TXT_RX[txt_id] chdev
-    chdev_xp  = chdev_dir.txt_rx[txt_id];
-    chdev_cxy = GET_CXY( chdev_xp );
-    chdev_ptr = GET_PTR( chdev_xp );
-
-    // get extended pointer on root & lock of attached process list
-    root_xp = XPTR( chdev_cxy , &chdev_ptr->ext.txt.root );
-    lock_xp = XPTR( chdev_cxy , &chdev_ptr->ext.txt.lock );
-
-    // get lock protecting list of processes attached to TXT
-    remote_busylock_acquire( lock_xp );
-
-    // insert owner process in list of attached processes to same TXT
-    xlist_add_last( root_xp , XPTR( process_cxy , &process_ptr->txt_list ) );
-
-    // release lock protecting list of processes attached to TXT
-    remote_busylock_release( lock_xp );
-
-#if DEBUG_PROCESS_TXT
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_TXT < cycle )
-printk("\n[%s] thread[%x,%x] attached process %x to TXT %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-hal_remote_l32( XPTR( process_cxy , &process_ptr->pid, txt_id , cycle );
-#endif
-
-} // end process_txt_attach()
-
-/////////////////////////////////////////////
-void process_txt_detach( xptr_t  process_xp )
-{
-    process_t * process_ptr;  // local pointer on process in owner cluster
-    cxy_t       process_cxy;  // process owner cluster
-    pid_t       process_pid;  // process identifier
-    xptr_t      file_xp;      // extended pointer on stdin file
-    xptr_t      chdev_xp;     // extended pointer on TXT_RX chdev
-    cxy_t       chdev_cxy;    // TXT_RX chdev cluster
-    chdev_t *   chdev_ptr;    // local pointer on TXT_RX chdev
-    xptr_t      lock_xp;      // extended pointer on list lock in chdev
-
-    // get process cluster, local pointer, and PID
-    process_cxy = GET_CXY( process_xp );
-    process_ptr = GET_PTR( process_xp );
-    process_pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) );
-
-// check process descriptor in owner cluster
-assert( __FUNCTION__, (CXY_FROM_PID( process_pid ) == process_cxy ) ,
-"process descriptor not in owner cluster" );
-
-    // release TXT ownership (does nothing if not TXT owner)
-    process_txt_transfer_ownership( process_xp );
-
-    // get extended pointer on process stdin pseudo file
-    file_xp = (xptr_t)hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[0] ) );
-
-    // get pointers on TXT_RX chdev
-    chdev_xp  = chdev_from_file( file_xp );
-    chdev_cxy = GET_CXY( chdev_xp );
-    chdev_ptr = (chdev_t *)GET_PTR( chdev_xp );
-
-    // get extended pointer on lock protecting attached process list
-    lock_xp = XPTR( chdev_cxy , &chdev_ptr->ext.txt.lock );
-
-    // get lock protecting list of processes attached to TXT
-    remote_busylock_acquire( lock_xp );
-
-    // unlink process from attached process list
-    xlist_unlink( XPTR( process_cxy , &process_ptr->txt_list ) );
-
-    // release lock protecting list of processes attached to TXT
-    remote_busylock_release( lock_xp );
-
-#if DEBUG_PROCESS_TXT
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle  = (uint32_t)hal_get_cycles();
-uint32_t txt_id = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->channel ) );
-if( DEBUG_PROCESS_TXT < cycle )
-printk("\n[%s] thread[%x,%x] detached process %x from TXT%d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process_pid, txt_id, cycle );
-#endif
-
-} // end process_txt_detach()
-
-///////////////////////////////////////////////////
-uint32_t process_txt_get_index( xptr_t process_xp )
-{
-
-    // get target process cluster and local pointer
-    process_t * process_ptr = GET_PTR( process_xp );
-    cxy_t       process_cxy = GET_CXY( process_xp );
-
-assert( __FUNCTION__, (process_xp == hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp))),
-"process descriptor not in owner cluster" );
-
-    // get extended pointer on STDIN pseudo file in owner process descriptor
-    xptr_t file_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[0]));
-
-assert( __FUNCTION__, (file_xp != XPTR_NULL),
-"STDIN pseudo-file undefined in fd_array for process %x\n",
-hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) ) );
-
-    // get extended pointer on TXT chdev
-    xptr_t chdev_xp = chdev_from_file( file_xp );
- 
-assert( __FUNCTION__, (chdev_xp != XPTR_NULL),
-"chdev undefined for STDIN pseudo-file of process %x\n",
-hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) ) );
-
-    // get cluster and local pointer on chdev
-   cxy_t     chdev_cxy = GET_CXY( chdev_xp );
-   chdev_t * chdev_ptr = GET_PTR( chdev_xp );
- 
-   // get parent TXT terminal index
-   return hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->channel ) );
-
-}  // end process_txt_get_index()
-
-///////////////////////////////////////////////////
-void process_txt_set_ownership( xptr_t process_xp )
-{
-    process_t * process_ptr;
-    cxy_t       process_cxy;
-    xptr_t      file_xp;
-    xptr_t      txt_xp;     
-    chdev_t   * txt_ptr;
-    cxy_t       txt_cxy;
-
-    // get pointers on process in owner cluster
-    process_cxy = GET_CXY( process_xp );
-    process_ptr = GET_PTR( process_xp );
-
-    // check owner cluster
-    assert( __FUNCTION__, (process_xp == hal_remote_l64( XPTR( process_cxy , &process_ptr->owner_xp ))),
-    "process descriptor not in owner cluster" );
-
-    // get extended pointer on stdin pseudo file
-    file_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[0] ) );
-
-    // get pointers on TXT chdev
-    txt_xp  = chdev_from_file( file_xp );
-    txt_cxy = GET_CXY( txt_xp );
-    txt_ptr = GET_PTR( txt_xp );
-
-    // set owner field in TXT chdev
-    hal_remote_s64( XPTR( txt_cxy , &txt_ptr->ext.txt.owner_xp ) , process_xp );
-
-#if DEBUG_PROCESS_TXT
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle  = (uint32_t)hal_get_cycles();
-uint32_t txt_id = hal_remote_l32( XPTR( txt_cxy , &txt_ptr->channel ) );
-if( DEBUG_PROCESS_TXT < cycle )
-printk("\n[%s] thread[%x,%x] give TXT%d ownership to process / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, txt_id, cycle );
-#endif
-
-}  // end process_txt_set ownership()
-
-////////////////////////////////////////////////////////
-void process_txt_transfer_ownership( xptr_t process_xp )
-{
-    process_t * process_ptr;     // local pointer on process releasing ownership
-    cxy_t       process_cxy;     // process cluster
-    pid_t       process_pid;     // process identifier
-    xptr_t      file_xp;         // extended pointer on TXT_RX pseudo file
-    xptr_t      txt_xp;          // extended pointer on TXT_RX chdev
-    chdev_t   * txt_ptr;         // local pointer on TXT_RX chdev
-    cxy_t       txt_cxy;         // cluster of TXT_RX chdev
-    uint32_t    txt_id;          // TXT_RX channel 
-    xptr_t      owner_xp;        // extended pointer on current TXT_RX owner
-    xptr_t      root_xp;         // extended pointer on root of attached process list
-    xptr_t      lock_xp;         // extended pointer on lock protecting attached process list
-    xptr_t      iter_xp;         // iterator for xlist
-    xptr_t      current_xp;      // extended pointer on current process
-    bool_t      found;
-
-#if DEBUG_PROCESS_TXT
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle;
-#endif
-
-    // get pointers on target process 
-    process_cxy = GET_CXY( process_xp );
-    process_ptr = GET_PTR( process_xp );
-    process_pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) );
-
-// check owner cluster
-assert( __FUNCTION__, (process_cxy == CXY_FROM_PID( process_pid )) ,
-"process descriptor not in owner cluster" );
-
-    // get extended pointer on stdin pseudo file
-    file_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[0] ) );
-
-    // get pointers on TXT chdev
-    txt_xp  = chdev_from_file( file_xp );
-    txt_cxy = GET_CXY( txt_xp );
-    txt_ptr = GET_PTR( txt_xp );
-
-    // get relevant infos from chdev descriptor
-    owner_xp = hal_remote_l64( XPTR( txt_cxy , &txt_ptr->ext.txt.owner_xp ) );
-    txt_id   = hal_remote_l32( XPTR( txt_cxy , &txt_ptr->channel ) );
-
-    // transfer ownership only if target process is the TXT owner
-    if( (owner_xp == process_xp) && (txt_id > 0) )  
-    {
-        // get extended pointers on root and lock of attached processes list
-        root_xp = XPTR( txt_cxy , &txt_ptr->ext.txt.root );
-        lock_xp = XPTR( txt_cxy , &txt_ptr->ext.txt.lock );
-
-        if( process_get_ppid( process_xp ) != 1 )       // target process is not KSH
-        {
-            // get lock
-            remote_busylock_acquire( lock_xp );
-
-            // scan attached process list to find KSH process
-            found = false;
-            for( iter_xp = hal_remote_l64( root_xp ) ;
-                 (iter_xp != root_xp) && (found == false) ;
-                 iter_xp = hal_remote_l64( iter_xp ) )
-            {
-                current_xp = XLIST_ELEMENT( iter_xp , process_t , txt_list );
-
-                if( process_get_ppid( current_xp ) == 1 )  // current is KSH 
-                {
-                    // set owner field in TXT chdev 
-                    hal_remote_s64( XPTR( txt_cxy , &txt_ptr->ext.txt.owner_xp ) , current_xp );
-
-#if DEBUG_PROCESS_TXT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_TXT < cycle )
-printk("\n[%s] thread[%x,%x] transfered TXT%d ownership to KSH / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, txt_id, cycle );
-#endif
-                    found = true;
-                }
-            }
-
-            // release lock
-            remote_busylock_release( lock_xp );
-
-// It must exist a KSH process for each user TXT channel
-assert( __FUNCTION__, (found == true), "KSH process not found for TXT%d", txt_id );
-
-        }
-        else                                           // target process is KSH
-        {
-            // get lock
-            remote_busylock_acquire( lock_xp );
-
-            // scan attached process list to find another process 
-            found = false;
-            for( iter_xp = hal_remote_l64( root_xp ) ;
-                 (iter_xp != root_xp) && (found == false) ;
-                 iter_xp = hal_remote_l64( iter_xp ) )
-            {
-                current_xp  = XLIST_ELEMENT( iter_xp , process_t , txt_list );
-
-                if( current_xp != process_xp )            // current is not KSH 
-                {
-                    // set owner field in TXT chdev 
-                    hal_remote_s64( XPTR( txt_cxy , &txt_ptr->ext.txt.owner_xp ) , current_xp );
-
-#if DEBUG_PROCESS_TXT
-cycle  = (uint32_t)hal_get_cycles();
-cxy_t       current_cxy = GET_CXY( current_xp );
-process_t * current_ptr = GET_PTR( current_xp );
-uint32_t    new_pid     = hal_remote_l32( XPTR( current_cxy , &current_ptr->pid ) );
-if( DEBUG_PROCESS_TXT < cycle )
-printk("\n[%s] thread[%x,%x] transfered TXT%d ownership to process %x / cycle %d\n",
-__FUNCTION__,this->process->pid, this->trdid, txt_id, new_pid, cycle );
-#endif
-                    found = true;
-                }
-            }
-
-            // release lock
-            remote_busylock_release( lock_xp );
-
-            // no more owner for TXT if no other process found
-            if( found == false )
-            {
-                // set owner field in TXT chdev 
-                hal_remote_s64( XPTR( txt_cxy , &txt_ptr->ext.txt.owner_xp ) , XPTR_NULL );
-
-#if DEBUG_PROCESS_TXT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_TXT < cycle )
-printk("\n[%s] thread[%x,%x] released TXT%d (no attached process) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, txt_id, cycle );
-#endif
-            }
-        }
-    }
-    else
-    {
-
-#if DEBUG_PROCESS_TXT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_PROCESS_TXT < cycle )
-printk("\n[%s] thread[%x,%x] does nothing for process %x (not TXT owner) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process_pid, cycle );
-#endif
-
-    }
-
-}  // end process_txt_transfer_ownership()
-
-
-////////////////////////////////////////////////
-bool_t process_txt_is_owner( xptr_t process_xp )
-{
-    // get local pointer and cluster of process in owner cluster
-    cxy_t       process_cxy = GET_CXY( process_xp );
-    process_t * process_ptr = GET_PTR( process_xp );
-
-// check calling thread execute in target process owner cluster
-pid_t process_pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) );
-assert( __FUNCTION__, (process_cxy == CXY_FROM_PID( process_pid )) ,
-"process descriptor not in owner cluster" );
-
-    // get extended pointer on stdin pseudo file
-    xptr_t file_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[0] ) );
-
-    // get pointers on TXT chdev
-    xptr_t    txt_xp  = chdev_from_file( file_xp );
-    cxy_t     txt_cxy = GET_CXY( txt_xp );
-    chdev_t * txt_ptr = GET_PTR( txt_xp );
-
-    // get extended pointer on TXT_RX owner process 
-    xptr_t owner_xp = hal_remote_l64( XPTR( txt_cxy , &txt_ptr->ext.txt.owner_xp ) );
-
-    return (process_xp == owner_xp);
-
-}   // end process_txt_is_owner()
-
-////////////////////////////////////////////////     
-xptr_t process_txt_get_owner( uint32_t channel )
-{
-    xptr_t      txt_rx_xp  = chdev_dir.txt_rx[channel];
-    cxy_t       txt_rx_cxy = GET_CXY( txt_rx_xp );
-    chdev_t *   txt_rx_ptr = GET_PTR( txt_rx_xp );
-
-    return (xptr_t)hal_remote_l64( XPTR( txt_rx_cxy , &txt_rx_ptr->ext.txt.owner_xp ) );
-
-}  // end process_txt_get_owner()
-
-///////////////////////////////////////////
-void process_txt_display( uint32_t txt_id )
-{
-    xptr_t      chdev_xp;
-    cxy_t       chdev_cxy;
-    chdev_t   * chdev_ptr;
-    xptr_t      root_xp;
-    xptr_t      lock_xp;
-    xptr_t      current_xp;
-    xptr_t      iter_xp;
-    cxy_t       txt0_cxy;
-    chdev_t   * txt0_ptr;
-    xptr_t      txt0_xp;
-    xptr_t      txt0_lock_xp;
-    
-    assert( __FUNCTION__, (txt_id < LOCAL_CLUSTER->nb_txt_channels) ,
-    "illegal TXT terminal index" );
-
-    // get pointers on TXT0 chdev
-    txt0_xp  = chdev_dir.txt_tx[0];
-    txt0_cxy = GET_CXY( txt0_xp );
-    txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on TXT0 lock
-    txt0_lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get pointers on TXT_RX[txt_id] chdev
-    chdev_xp  = chdev_dir.txt_rx[txt_id];
-    chdev_cxy = GET_CXY( chdev_xp );
-    chdev_ptr = GET_PTR( chdev_xp );
-
-    // get extended pointer on root & lock of attached process list
-    root_xp = XPTR( chdev_cxy , &chdev_ptr->ext.txt.root );
-    lock_xp = XPTR( chdev_cxy , &chdev_ptr->ext.txt.lock );
-
-    // get lock on attached process list
-    remote_busylock_acquire( lock_xp );
-
-    // get TXT0 lock in busy waiting mode
-    remote_busylock_acquire( txt0_lock_xp );
-
-    // display header
-    nolock_printk("\n***** processes attached to TXT_%d / cycle %d\n",
-    txt_id , (uint32_t)hal_get_cycles() );
-
-    // scan attached process list 
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        current_xp  = XLIST_ELEMENT( iter_xp , process_t , txt_list );
-        process_display( current_xp );
-    }
-
-    // release TXT0 lock in busy waiting mode
-    remote_busylock_release( txt0_lock_xp );
-
-    // release lock on attached process list
-    remote_busylock_release( lock_xp );
-
-}  // end process_txt_display
+    // register stdin / stdout / stderr in the fd_array 3 first slots 
+	process_init->fd_array.array[0] = stdin_xp;
+	process_init->fd_array.array[1] = stdout_xp;
+	process_init->fd_array.array[2] = stderr_xp;
+    process_init->fd_array.current  = 3;
+
+    // initialize the exec_info structure
+    exec_info.pid          = process_init->pid;
+    exec_info.ppid         = process_init->ppid;
+    exec_info.fd_array_xp  = XPTR( local_cxy , &process_init->fd_array );
+    exec_info.vfs_root_xp  = process_init->vfs_root_xp;
+    exec_info.vfs_cwd_xp   = process_init->vfs_cwd_xp;
+    exec_info.vfs_bin_xp   = process_init->vfs_bin_xp;
+
+    // TODO thread_init ???
+    // exec_info.args_nr      = 1;
+    // exec_info.envs_nr      = 1;
+    // strcpy( exec_info.args[0] , "init" );
+    // strcpy( exec_info.envs[0] , "ALMOS-MKH.CONFIG = "CONFIG_ALMOS_VERSION );
+    // strcpy( exec_info.path    , INIT_PATHNAME );
+
+    // create process_init and thread_init
+	error1 = process_make_exec( &exec_info );
+	if( error1 )
+	{
+        printk("\n[PANIC] in %s : cannot create main thread in cluster %x\n",
+               __FUNCTION__ , local_cxy );
+		hal_core_sleep();
+    }
+
+	process_dmsg("\n[INFO] %s successfully exit in cluster %x\n", __FUNCTION__ , local_cxy );
+		
+    hal_wbflush();
+
+} // end process_init_create()
+
+
Index: trunk/kernel/kern/process.h
===================================================================
--- trunk/kernel/kern/process.h	(revision 690)
+++ trunk/kernel/kern/process.h	(revision 1)
@@ -1,8 +1,8 @@
 /*
- * process.h - process related functions definition.
- *
+ * process.h - process related management functions
+ * 
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
  *          Mohamed Lamine Karaoui (2015)
- *          Alain Greiner (2016,2017,2018,2019,2020)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -27,17 +27,14 @@
 #define _PROCESS_H_
 
-#include <kernel_config.h>
+#include <almos_config.h>
 #include <errno.h>
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <list.h>
 #include <xlist.h>
 #include <bits.h>
-#include <busylock.h>
-#include <rwlock.h>
-#include <queuelock.h>
-#include <remote_queuelock.h>
-#include <remote_rwlock.h>
+#include <spinlock.h>
 #include <hal_atomic.h>
 #include <vmm.h>
+#include <signal.h>
 #include <cluster.h>
 #include <vfs.h>
@@ -57,83 +54,29 @@
 
 /*********************************************************************************************
- * This enum defines the actions that can be executed by the process_sigaction() function.
- ********************************************************************************************/
-
-typedef enum 
-{
-    BLOCK_ALL_THREADS    = 0x11,
-    UNBLOCK_ALL_THREADS  = 0x22,
-    DELETE_ALL_THREADS   = 0x33, 
-} 
-process_sigactions_t;
+ * These macros are used to compose or decompose global thread identifier (TRDID)
+ * to or from cluster identifier / local thread index (CXY , LTID)
+ ********************************************************************************************/
+
+#define LTID_FROM_TRDID( trdid )   (ltid_t)(trdid & 0x0000FFFF) 
+#define CXY_FROM_TRDID( trdid )    (cxy_t)(trdid >> 16)
+#define TRDID( cxy , ltid )        (trdid_t)((cxy << 16) | ltid )
 
 /*********************************************************************************************
  * This structure defines an array of extended pointers on the open file descriptors
- * for a given process. The file descriptors are always stored in the same cluster 
- * as the object associated to the file descriptor (inode, socket, pipe, etc). 
- * A free entry in this array contains XPTR_NULL.
- * The array size is defined by the CONFIG_PROCESS_FILE_MAX_NR parameter.
- *
- * NOTE: - Only the fd_array[] in the owner cluster process contains the complete list
- *         of open files, and is protected by the lock against concurrent access.
- *       - the fd_array[] in a process copy is only used to speed the fdid -> xptr
- *         translation, but the "lock" and "max" fields are not significant in these copies.
- *       - The modifications made by the process_fd_register() function are only done
- *         in the owner cluster.
- *       - The modifications made by the process_fd_remove() function are done in the
- *         owner cluster, and in all process_copies.
- *       - In case of miss on a local fd_array, the process_fd_get_xptr() access the
- *         owner cluster fd_array, and update the fd_array local copy.
+ * for a given process. We use an extended pointer because the open file descriptor
+ * is always stored in the same cluster as the inode associated to the file.
+ * A free entry in this array contains the XPTR_NULL value.
+ * The array size is defined by a the CONFIG_PROCESS_FILE_MAX_NR parameter.
+ * All modifications (open/close) must be done by the reference cluster, and reported
  ********************************************************************************************/
 
 typedef struct fd_array_s
 {
-	remote_queuelock_t lock;                              /*! lock protecting fd_array      */
-    uint32_t           max;                               /*! max non-free slot index       */
-	xptr_t             array[CONFIG_PROCESS_FILE_MAX_NR]; /*! open file descriptors         */
+	remote_spinlock_t lock;             /*! lock protecting fd_array[] change.              */
+    uint32_t          current;          /*! current number of open files                    */
+    uint32_t          max;              /*! max number of open files (can be increased)     */
+	xptr_t            array[CONFIG_PROCESS_FILE_MAX_NR];  
 }
 fd_array_t;
-
-/*********************************************************************************************
- * This structure defines the information required by the process_make_exec() function
- * to create a new reference process descriptor, and the associated main thread.
- * All fields in this structure are filled by the sys_exec() function.
- *
- * It contains three parts:
- * - the "path" field is a string defining the pathname of the .elf file.
- * - the "args_pointers" & "args_nr" fields define the arguments (one arg == one string).
- * - the "envs_pointers" & "envs_nr" fields define the env variables (one env == one string).
- *
- * For both the arguments and the environment variables, the array of pointers and the
- * strings themselve are stored in the same kernel buffer. These kernel buffers contain
- * an integer number of contiguous pages, defined by the CONFIG_VMM_ARGS_SIZE and 
- * CONFIG_VMM_ENVS_SIZE parameters respectively.
- * Each kernel (args / envs) buffer contains :
- * - in the first bytes, a fixed size kernel array of pointers on the strings.
- * - in the following bytes, the strings themselves.
- * The size of these arrays of pointers is defined by the CONFIG_PROCESS_ARGS_MAX_NR and
- * CONFIG_PROCESS_ENVS_MAX_NR parameters respectively.
- *
- * WARNING (1) The "args_pointers[i]" & "envs_pointers[i] stored in the dynamically
- *             allocated kernel buffers are local pointers. They must be extended by the
- *             local cluster identifier to compute a valid PPN.
- * WARNING (2) The "args" & "envs" kernel buffers will be mapped to the "args" and "envs"
- *             user vsegs, to be accessed by the new user process. 
- *             The process_make_exec() function must therefore replace the kernel pointers
- *             set by sys_exec(), by user pointers in the new process user space.
- ********************************************************************************************/
-
-typedef struct exec_info_s
-{
-    char           path[CONFIG_VFS_MAX_PATH_LENGTH];  /*! .elf file path in kernel space    */
-
-    char        ** args_pointers;  /*! pointer on array of pointers on strings              */
-    uint32_t       args_nr;        /*! actual number of arguments                           */
-
-    char        ** envs_pointers;  /*! pointer on array of pointers on strings              */
-    uint32_t       envs_nr;        /*! actual number of environment variables               */
-    char         * envs_buf_free;  /*! local pointer on first free slot in strings buffer   */
-}
-exec_info_t;
 
 /*********************************************************************************************
@@ -142,84 +85,99 @@
  * - The PID 16 LSB bits contain the LPID (Local Process Index)
  * - The PID 16 MSB bits contain the owner cluster CXY.
- * In each cluster, the process manager allocates  the LPID values for the process that
- * are owned by this cluster.
- * The process descriptor is replicated in all clusters containing at least one thread 
- * of the PID process, with the following rules :
- * 1) The <pid>, <ppid>, <ref_xp>, <owner_xp>, <vfs_root_xp>, <vfs_bin_xp>  fields are 
- *    defined in all process descriptor copies.
- * 2) The <vfs_cwd_xp> and associated <cwd_lock>, that can be dynamically modified,
- *    are only defined in the reference process descriptor.
- * 2) The <vmm>, containing the VSL (list of registered vsegs), and the GPT (generic
- *    page table), are only complete in the reference process cluster, other copies 
- *    are actually use as read-only caches.
- * 3) the <fd_array>, containing extended pointers on the open file descriptors, is only
- *    complete in the owner process cluster, other copies are read-only caches.
- * 4) The <sem_root>, <mutex_root>, <barrier_root>, <condvar_root>, and the associated
- *    <sync_lock>, dynamically allocated, are only defined in the reference cluster.
- * 5) The <children_root>, <children_nr>, <children_list>, and <txt_list> fields are only
- *    defined in the reference cluster, and are undefined in other clusters.
- * 6) The <local_list>, <copies_list>, <th_tbl>, <th_nr>, <u_th_lock> or <k_th_lock> fields
- *    are specific in each cluster, and are defined in all process descriptors copies.
- * 7) The termination <flags> and <exit_status> are only defined in the reference cluster.
- *    (The term_state format is defined in the shared_syscalls.h file ).
+ * In each cluster, the process manager allocates LPID values for the process that are
+ * allocated to this cluster.
+ * The process descriptor for a PID process is replicated in all clusters containing
+ * at least one thread of the PID process, with some restrictions:
+ * - The list of registered vsegs, the page table (contained in vmm), and the fd_array[]
+ *   are only complete in the reference process descriptor, other copies are read-only caches.
+ * - The following fields are NOT defined in copies other than the reference:
+ *   children_root , children_list , children_nr , sig_mgr
  ********************************************************************************************/
 
 typedef struct process_s
 {
-    vmm_t              vmm;              /*! embedded virtual memory manager                 */
-
-    fd_array_t         fd_array;         /*! embedded open file descriptors array            */
-
-    exec_info_t        exec_info;        /*! embedded structure for args & envs              */
-
-    xptr_t             vfs_root_xp;      /*! extended pointer on VFS root inode              */
-    xptr_t             vfs_bin_xp;       /*! extended pointer on .elf file descriptor        */
-    pid_t              pid;              /*! process identifier                              */
-    xptr_t             ref_xp;           /*! extended pointer on reference process           */
-    xptr_t             owner_xp;         /*! extended pointer on owner process               */
-    xptr_t             parent_xp;        /*! extended pointer on parent process              */
-
-    xptr_t             cwd_xp;           /*! extended pointer on current working dir inode   */
-    remote_busylock_t  cwd_lock;         /*! lock protecting working directory changes       */
-
-    xlist_entry_t      children_root;    /*! root of the children process xlist              */
-    remote_queuelock_t children_lock;    /*! lock protecting children process xlist          */
-    uint32_t           children_nr;      /*! number of children processes                    */
-
-    xlist_entry_t      children_list;    /*! member of list of children of same parent       */
-    xlist_entry_t      local_list;       /*! member of list of process in same cluster       */
-    xlist_entry_t      copies_list;      /*! member of list of copies of same process        */
-    xlist_entry_t      txt_list;         /*! member of list of processes sharing same TXT    */
-
-    struct thread_s  * th_tbl[CONFIG_THREADS_MAX_PER_CLUSTER];       /*! local threads       */
-
-    uint32_t           th_nr;            /*! number of threads in this cluster               */
-    rwlock_t           th_lock;          /*! lock protecting th_tbl[]  i                     */ 
-
-    xlist_entry_t      sem_root;         /*! root of the user defined semaphore list         */
-    xlist_entry_t      mutex_root;       /*! root of the user defined mutex list             */
-    xlist_entry_t      barrier_root;     /*! root of the user defined barrier list           */
-    xlist_entry_t      condvar_root;     /*! root of the user defined condvar list           */
-    remote_queuelock_t sync_lock;        /*! lock protecting user defined synchro lists      */
-
-    xlist_entry_t      dir_root;         /*! root of the user defined DIR list               */
-    remote_queuelock_t dir_lock;         /*! lock protexting user defined DIR list           */
-
-    uint32_t           term_state;       /*! termination status (flags & exit status)        */
+	vmm_t            vmm;               /*! embedded virtual memory manager                 */
+
+	fd_array_t       fd_array;          /*! embedded file descriptors array                 */
+
+	xptr_t           vfs_root_xp;       /*! extende pointer on current file system root     */
+	xptr_t           vfs_cwd_xp;        /*! extended pointer on current working directory   */
+	xptr_t           vfs_bin_xp;        /*! extended pointer on associate .elf file         */
+
+	spinlock_t       cd_lock;           /*! lock protecting working directory changes       */
+ 
+	pid_t            pid;               /*! process identifier                              */
+	pid_t            ppid;              /*! parent process identifier                       */
+	bool_t           is_ref;            /*! this is the reference process if true           */
+    xptr_t           ref_xp;            /*! extended pointer on reference process           */
+
+	xlist_entry_t    children_root;     /*! root of the children process xlist              */
+    uint32_t         children_nr;       /*! number of children processes                    */
+
+	xlist_entry_t    brothers_list;     /*! member of list of children of same parent       */
+
+    list_entry_t     local_list;        /*! member of list of process in same cluster       */
+
+    xlist_entry_t    copies_list;       /*! member of list of copies of same process        */
+
+	spinlock_t       th_lock;           /*! lock protecting th_tbl[] concurrent access      */
+	uint32_t         th_nr;             /*! number of threads in this cluster               */
+
+	struct thread_s * th_tbl[CONFIG_THREAD_MAX_PER_CLUSTER]; /*! pointers on local threads  */
+
+    xlist_entry_t    sem_root;          /*! root of the process semaphores list             */
+    uint32_t         sem_nr;            /*! number of semaphores                            */
+
+	sig_mgr_t        sig_mgr;           /*! embedded signal manager TODO [AG]               */
 }
 process_t;
 
+/*********************************************************************************************
+ * This structure defines the minimal information required by the process_make_exec()
+ * function to build a new reference process descriptor, and the associated main thread.
+ ********************************************************************************************/
+
+typedef struct exec_info_s
+{
+    pid_t              pid;            /*! process identifier                               */
+    pid_t              ppid;           /*! parent process identifier                        */
+
+    xptr_t             fd_array_xp;    /*! extended pointer on parent process fd_array      */
+
+    xptr_t             vfs_root_xp;    /*! extended pointer on file system root             */
+    xptr_t             vfs_cwd_xp;     /*! extended pointer on current working directory    */
+    xptr_t             vfs_bin_xp;     /*! extended pointer on process .elf file            */
+
+    char               path[256];      /*! pathname for  .elf file                          */
+
+    char            ** args_pointers;  /*! physical base address of array of pointers       */
+    char             * args_buf_base;  /*! physical base address of kernel args buffer      */
+    uint32_t           args_nr;        /*! actual number of arguments                       */
+
+    char            ** envs_pointers;  /*! physical base address of array of pointers       */
+    char             * envs_buf_base;  /*! physical base address of kernel args buffer      */
+    char             * envs_buf_free;  /*! physical address of first free slot in envs_buf  */
+    uint32_t           envs_nr;        /*! actual number of environment variables           */
+}
+exec_info_t;
+
+/*********************************************************************************************
+ * This macro returns a pointer on the process descriptor for the calling thread.
+ ********************************************************************************************/
+
+#define CURRENT_PROCESS (hal_get_current_thread()->process)
+
 /***************   Process Descriptor Operations    *****************************************/
 
-/*********************************************************************************************
- * This function allocates memory in local cluster for a process descriptor.
- *********************************************************************************************
+/********************************************************************************************* 
+ * This function allocates memory in local cluster for a process descriptor. 
+ ********************************************************************************************* 
  * @ returns pointer on process descriptor if success / return NULL if failure
  ********************************************************************************************/
-process_t * process_alloc( void );
-
-/*********************************************************************************************
- * This function releases memory in local cluster for a process descriptor.
- *********************************************************************************************
+process_t * process_alloc();
+
+/********************************************************************************************* 
+ * This function releases memory in local cluster for a process descriptor. 
+ ********************************************************************************************* 
  * @ process      : pointer on process descriptor to release.
  ********************************************************************************************/
@@ -227,180 +185,76 @@
 
 /*********************************************************************************************
- * This function initialize, in each cluster, the kernel "process_zero", that contains
- * all kernel threads in a given cluster. It is called by the kernel_init() function.
- * The process_zero descriptor is allocated as a global variable in file kernel_init.c 
- * Both the PID and PPID fields are set to zero, the ref_xp is the local process_zero,
- * and the parent process is set to XPTR_NULL. The th_tbl[] is initialized as empty.
- * The process GPT is initialised as required by the target architecture.
- * The "kcode" and "kdata" segments are registered in the process VSL.
- * This function does not return an error code: in case of failure, it print a PANIC message
- * on kernel terminal TXT0, and the core goes to sleep mode.
- *********************************************************************************************
- * @ process  : [in] pointer on process descriptor to initialize.
- * @ info     : pointer on local boot_info_t (for kernel segments base and size). 
- ********************************************************************************************/
-void process_zero_create( process_t   * process,
-                          boot_info_t * info );
-
-/*********************************************************************************************
- * This function allocates memory and initializes the "process_init" descriptor and the
- * associated "thread_init" descriptor. It is called once at the end of the kernel_init() 
- * procedure. Its local process identifier is 1, and parent process is the kernel process.
- * The "process_init" is the first user process, and all other user processes will be forked
- * from this process. The code executed by "process_init" is stored in a .elf file, whose
- * pathname is defined by the CONFIG_PROCESS_INIT_PATH configuration variable. 
- * This function does not return an error code: in case of failure, it print a PANIC message
- * on kernel terminal TXT0, and the core goes to sleep mode.
- ********************************************************************************************/
-void process_init_create( void );
-
-/*********************************************************************************************
- * This function initializes a reference user process descriptor from another process
- * descriptor, defined by the <parent_xp> argument. The <process> and <pid> arguments 
- * are previously allocated by the caller. This function can be called by two functions:
- * -  process_init_create() : process is the INIT process, and parent is process-zero.
- * -  process_make_fork()   : the parent process descriptor is generally remote.
- * The following fields are initialised :
- * - It set the pid / ppid / ref_xp / parent_xp / state fields.
- * - It creates an empty GPT and an empty VSL.
- * - It initializes the locks protecting the GPT and the VSL.
- * - It registers the "kernel" vsegs in VSL, using the hal_vmm_kernel_update() function.
- * - It registers the "args" and "envs" vsegs in VSL, using the vmm_user_init() function.
- * - The "code and "data" must be registered later, using the elf_load_process() function.
- * - It initializes the FDT, defining the three pseudo files STDIN / STDOUT / STDERR.
- *   . if INIT process     => link to kernel TXT[0].
- *   . if KSH[i] process   => allocate a free TXT[i].
- *   . if USER process     => link to parent process TXT[i].
- * - It set the root_xp, bin_xp, cwd_xp fields.
- * - It reset the children list as empty, but does NOT register it in parent children list.
- * - It reset the TH_TBL list of threads as empty.
- * - It reset the semaphore / mutex / barrier / condvar lists as empty.
- * - It registers the process in the local_list, rooted in the local cluster manager.
- * - It registers the process in the copies_list, rooted in the owner cluster manager.
- * - It registers the process extended pointer in the local pref_tbl[] array.
- *********************************************************************************************
- * @ process      : [in] pointer on local process descriptor to initialize.
- * @ pid          : [in] process identifier.
- * @ parent_xp    : [in] extended pointer on parent process descriptor.
- * @ return 0 if success / return -1 if failure
- ********************************************************************************************/
-error_t process_reference_init( process_t * process,
-                                pid_t       pid,
-                                xptr_t      parent_xp );
-
-/*********************************************************************************************
- * This function initializes a copy process descriptor, in the local cluster,
- * from information defined in the reference remote process descriptor.
- * As the VSL and the GPT of a process copy are handled as local caches, the GPT copy is 
- * created empty, and the VSL copy contains only the "kernel", "args", and "envs" vsegs. 
- *********************************************************************************************
+ * This function initializes the kernel process_zero descriptor (global variable) from
+ * informations found in the boot_info.
+ ********************************************************************************************* 
+ * @ info      : pointer on local boot_info_t structure.
+ ********************************************************************************************/
+void process_zero_init( boot_info_t * info );
+
+/********************************************************************************************* 
+ * This function allocates memory and initialises the "process_init" descriptor and the
+ * associated thread descriptor from information found in the "process_zero" descriptor.
+ ********************************************************************************************* 
+ * Any error gives a kernel panic.
+ ********************************************************************************************/
+void process_init_create();
+
+/********************************************************************************************* 
+ * This function intializes a new process descriptor, in the reference cluster.
+ * The PID value must have been defined previously by the owner cluster manager.
+ * The reference cluster can be different from the owner cluster. 
+ * It set the pid / ppid / is_ref / pref / fields.
+ * It registers this process descriptor in three lists:
+ * - the children_list in the parent process descriptor.
+ * - the local_list, rooted in the reference cluster manager.
+ * - the copies_list, rooted in the owner cluster manager.
+ * It reset the embedded structures such as the VMM or the file descriptor array.
+ ********************************************************************************************* 
+ * @ process      : [in] pointer on process descriptor to initialize.
+ * @ pid          : [in] process identifier defined by owner cluster.
+ * @ ppid         : [in] parent process identifier.
+ ********************************************************************************************/
+void process_reference_init( process_t * process,
+                             pid_t       pid,
+                             pid_t       ppid );
+
+/********************************************************************************************* 
+ * This function intializes a copy process descriptor, in the local cluster,
+ * from informations defined in the reference remote process descriptor.
+ ********************************************************************************************* 
  * @ process              : [in] local pointer on process descriptor to initialize.
  * @ reference_process_xp : [in] extended pointer on reference process descriptor.
- * @ return 0 if success / return -1 if failure
+ * @ return 0 if success / return ENOMEM if failure
  ********************************************************************************************/
 error_t process_copy_init( process_t * local_process,
                            xptr_t      reference_process_xp );
 
-/*********************************************************************************************
+/********************************************************************************************* 
  * This function releases all memory allocated for a process descriptor in the local cluster,
- * including memory allocated for embedded sub-structures (fd_array, vmm, etc).
+ * after releasing memory allocated for embedded substructures (fd_array, vmm, etc).
  * The local th_tbl[] array must be empty.
- *********************************************************************************************
- * @ process     : [in] pointer on the process descriptor.
+ ********************************************************************************************* 
+ * @ process     : pointer on the process descriptor.
  ********************************************************************************************/
 void process_destroy( process_t * process );
 
-/*********************************************************************************************
- * This debug function diplays on the kernel terminal TXT0 detailed informations on a 
- * process descriptor identified by the <process_xp> argument.
- * It can be called by a thread running in any cluster.
- * WARNING: this function uses the nolock_printk() function, and the  TXT0 lock MUST be
- * taken by the caller function. 
- *********************************************************************************************
- * @ process_xp    : [in] extended pointer on process descriptor.
- ********************************************************************************************/
-void process_display( xptr_t process_xp );
-
-/*********************************************************************************************
- * This function returns a printable string defining the sigaction type.
- *********************************************************************************************
- * @ sigaction_type   : BLOCK_ALL_THREADS / UNBLOCK_ALL_THREADS / DELETE_ALL_THREADS
- * @ return a string pointer.
- ********************************************************************************************/
-const char * process_action_str( process_sigactions_t sigaction_type );
-
-/*********************************************************************************************
- * This function allows a client thread running in any cluster to block, unblock or delete 
- * all threads of a process identified by the <pid> argument, depending on the 
- * <action_type> argument.
- *
- * It uses the multicast, non blocking rpc_process_sigaction_client() function to send
- * parallel requests to all remote clusters containing process copies. 
- * Then it blocks and deschedule to wait completion of these parallel requests.
- *
- * It is used by the sys_kill() & sys_exit() functions to handle the "kill" & "exit" syscalls.
- * It is also used by the process_make_exec() function to handle the "exec" syscall.
- * It is also called by the TXT device ISR to execute the ctrl C & ctrl Z commands.
- *
- * WARNING (1) the DELETE action is NOT executed on the target process main thread
- * (thread 0 in process owner cluster), and not executed on the client thread itself.
- *
- * WARNING (2) the BLOCK action is executed on all target process threads, and this function
- * returns only when all threads BUT the client thread are actually blocked and not running.
- * When the client thread is also a target thread, it is blocked but not descheduled. 
- * 
- * WARNING (3) the UNBLOCK action is executed on all target process threads, as the
- * client thread cannot be a target thread.
- *
- * Implementation note:
- * This function allocates a - shared - RPC descriptor in client thread stack, 
- * and initializes it. This RPC descriptor can be shared because all parallel,
- * non-blocking, RPC server threads use the same input arguments, including the
- * RPC responses counter field.
- *********************************************************************************************
- * @ pid         : target process identifier.
- * @ action_type : BLOCK_ALL_THREADS / UNBLOCK_ALL_THREADS / DELETE_ALL_THREADS
- ********************************************************************************************/
-void process_sigaction( pid_t       pid,
-                        uint32_t    action_type );
-
-/*********************************************************************************************
- * This function marks for delete all threads for a given <process> in the local cluster.
- * It scan the list of local thread, and sets the THREAD_FLAG_REQ_DELETE bit for all
- * threads, BUT the main thread (thread 0 in owner cluster), and the client thread
- * identified by the <client_xp> argument. 
- * The actual delete will be done by the scheduler at the next scheduling point.
- *********************************************************************************************
+/********************************************************************************************* 
+ * This function kills an user process in a given cluster.
+ * It can be directly called in the reference cluster, or it can be called through the
+ * PROCESS_KILL RPC.
+ * - In a first loop, it set the THREAD_SIG_KILL signal to all threads of process.
+ * - In a second loop, it wait, for each thread the reset of the THREAD_SIG_KILL signal
+ *   by the scheduler, and completes the thread descriptor destruction. 
+ ********************************************************************************************* 
  * @ process     : pointer on the process descriptor.
- * @ client_xp   : extended pointer on the client thread that should not be marked.
- ********************************************************************************************/
-void process_delete_threads( process_t * process,
-                             xptr_t      client_xp );
-
-/*********************************************************************************************
- * This function blocks all threads for a given <process> in the local cluster. 
- * It scan the list of local thread, and sets the THREAD_BLOCKED_GLOBAL bit for all threads.
- * It request the relevant schedulers to acknowledge the blocking, using IPI if required, 
- * when the target thread is running on another core than the calling thread.
- * It returns only when all threads in cluster, including the caller are actually blocked.
- * The threads are not detached from the scheduler, and not detached from the local process.
- *********************************************************************************************
- * @ process     : pointer on the target process descriptor.
- ********************************************************************************************/
-void process_block_threads( process_t * process );
-
-/*********************************************************************************************
- * This function unblocks all threads of a given user process in a given cluster.
- *********************************************************************************************
- * @ process     : pointer on the process descriptor.
- ********************************************************************************************/
-void process_unblock_threads( process_t * process );
-
-/*********************************************************************************************
+ ********************************************************************************************/
+void process_kill( process_t * process );
+
+/********************************************************************************************* 
  * This function returns a pointer on the local copy of a process identified by its PID.
- * If this local copy does not exist yet, it is dynamically created, from the reference
+ * If this local copy does not exist yet, it is dynamically created, from the reference 
  * process descriptor, registered in the global copies_list, and registered in the local_list.
- * This function is used by the thread_user_create() function.
- *********************************************************************************************
+ * This function is used by both thread_user_create() and thread_user_copy() functions.
+ ********************************************************************************************* 
  * @ pid     : searched process identifier.
  * @ returns pointer on the local process descriptor if success / returns NULL if failure.
@@ -408,216 +262,111 @@
 process_t * process_get_local_copy( pid_t pid );
 
-/*********************************************************************************************
- * This function returns the parent process identifier for a remote process descriptor
- * identified by an extended pointer.
- *********************************************************************************************
- * @ process_xp   : extended pointer on remote process descriptor.
- * @ returns parent process dentifier.
- ********************************************************************************************/
-pid_t process_get_ppid( xptr_t process_xp );
-
-/*********************************************************************************************
- * This function implements the "execve" system call, and is called by sys_exec() function.
- * It must be called by the main thread of the calling "old" process.
- * The <exec_info> structure in process descriptor contains all informations required
- * to update both the calling process descriptor and the calling thread descriptor.
- * The "new" process keep the "old" process PID and PPID, all open files, and env variables,
- * the vfs_root and vfs_cwd, but build a brand new memory image (new VMM from the .elf file).
- * It is executed in the local cluster, that becomes both the "owner" and the "reference"
- * cluster for the "new" process.
- *********************************************************************************************
- * Implementation note:
- * It executes the following sequence:
- * 1) it creates a file descriptor for the .elf file (pathname in exec_info).
- * 2) it deletes all other threads than the main thread, in all clusters.
- * 3) it reset the existing VMM (remove all user vsegs).
- * 4) it build the "args" user vseg from process exec_info, and registers in the VMM. 
- * 5) TODO it build the "envs" user vseg from process exec_info, and registers in the VMM.
- * 6) it get the "code" and "data" user vsegs from the .elf file, and registers in the VMM.
- * 7) it allocates an user "stack" vseg, and registers in the VMM
- * 8) it calls thread_user_exec() to complete thread initialisation and jumps to user code.
- *********************************************************************************************
+/********************************************************************************************* 
+ * This function builds a new reference process descriptor and associated main thread.
+ * It is executed in the local cluster, that becomes both "owner" and "reference".
+ * The new process descriptor and the main_thread are initialised using only informations 
+ * found in the local exec_info structure, that must be build by the caller.
+ * - It can be called by the process_init_create() function to build the "init" process.
+ * - It can be called directly by the sys_exec() function in case of local exec.
+ * - It can be called through the rpc_process_exec_server() function in case of remote exec.
+ ********************************************************************************************* 
+ * @ exec_info   : [in]  pointer on the exec_info structure.
  * @ return 0 if success / return non-zero if error.
  ********************************************************************************************/
-error_t process_make_exec( void );
-
-/*********************************************************************************************
- * This function implements the "fork" system call, and is called by the sys_fork() function,
- * likely through the RPC_PROCESS_MAKE_FORK. 
- * It allocates memory and initializes a new child process descriptor, and the associated
- * child thread descriptor in local cluster. It involves up to three different clusters:
- * - the child (local) cluster can be any cluster selected by the sys_fork function.
- * - the parent cluster must be the reference cluster for the parent process.
- * - the client cluster containing the thread requesting the fork can be any cluster.
- * The new child process descriptor is initialised from informations found in the parent
- * reference process descriptor, containing the complete process description.
- * The new child thread descriptor is initialised from informations found in the parent
- * thread descriptor.
- *********************************************************************************************
- * @ parent_process_xp  : extended pointer on the reference parent process.
- * @ parent_thread_xp   : extended pointer on the parent thread requesting the fork.
- * @ child_pid          : [out] child process identifier.
- * @ child_thread_ptr   : [out] local pointer on child thread in target cluster.
- * @ return 0 if success / return non-zero if error.
- ********************************************************************************************/
-error_t process_make_fork(  xptr_t             parent_process_xp,
-                            xptr_t             parent_thread_xp,
-                            pid_t            * child_pid, 
-                            struct thread_s ** child_thread_ptr );
-
-
-/********************     fd_array  operations       ****************************************/
-
-
-/*********************************************************************************************
- * This function returns a printable string for a file descriptor type.
- * These file types are defined in the <vfs.h> file.
- *********************************************************************************************
- * @ type     : [in] file type.
- ********************************************************************************************/
-char * process_fd_type_str( uint32_t type );
-
-/*********************************************************************************************
- * This function initializes all entries of the local fd_array as empty.
- *********************************************************************************************
- * @ process  : [in] pointer on the local process descriptor.
+error_t process_make_exec( exec_info_t * exec_info );
+
+
+/********************   Signal Management Operations   **************************************/ 
+
+/********************************************************************************************* 
+ * This function TODO [AG]
+ ********************************************************************************************/
+void process_signal_handler( process_t * process );
+
+
+/********************   File Management Operations   ****************************************/ 
+
+/*********************************************************************************************
+ * This function reset the file descriptor array for a given process: no open file.
+ ********************************************************************************************* 
+ * @ process  : pointer on the local process descriptor.
  ********************************************************************************************/
 void process_fd_init( process_t * process );
 
 /*********************************************************************************************
- * This function allocates a free slot in the owner cluster process fd_array identified
- * by the <process_xp> argument, register the <file_xp> argument in the allocated slot,
- * and return the slot index in the <fdid> buffer.
- * It can be called by any thread in any cluster.
- * It takes the lock protecting the fd_array against concurrent slot allocations.
- * Note: we must use the owner process descriptor, because only this fd_array contains
- * all files open by a given process.
- *********************************************************************************************
- * @ process_xp : [in]  extended pointer on owner process.
- * @ file_xp    : [in]  extended pointer on the file descriptor to be registered.
- * @ fdid       : [out] buffer for allocated fd_array slot index.
- * @ return 0 if success / return -1 if array full.
- ********************************************************************************************/
-error_t process_fd_register( xptr_t      process_xp,
-                             xptr_t      file_xp,
-                             uint32_t  * fdid );
-
-/*********************************************************************************************
- * This function uses as many remote accesses as required, to reset one fd_array[] entry,
- * identified by the <fdid> argument, in all clusters containing a copy of the 
- * process descriptor, identified by the <process_xp> argument. 
- * It can be called by any thread in any cluster.
- * It takes the lock protecting the list of copies.
- * Note: we must use the owner process descriptor, because only this owner cluster contains
- * the complete list of process copies.
- *********************************************************************************************
- * @ process_xp  : [in] extended pointer on the owner process descriptor.
- * @ fdid        : [in] file descriptor index in the fd_array.
- ********************************************************************************************/
-void process_fd_remove( xptr_t     process_xp,
-                        uint32_t   fdid );
-
-/*********************************************************************************************
- * This function scan the fd_array to close all files (or sockets) registered in the process
- * fd_array identified by the <process_xp> argument. It call the sys_close() function for 
- * each registered entry, to release all allocated memory, and reset this entry in all
- * process descriptors copies.
- * It takes the lock protecting the fd_array against concurrent accesses.
- * Note: we must use the owner process descriptor, because only this owner cluster contains
- * the complete list of process copies.
- *********************************************************************************************
- * @ process_xp  : [in] extended pointer on the owner process descriptor.
- ********************************************************************************************/
-void process_fd_clean_all( xptr_t process_xp );
-
-/*********************************************************************************************
- * This function returns an extended pointer on a file descriptor identified by its <fdid>
- * index in fd_array of the local process, identified by the <process> argument.
- * It can be called by any thread running in any cluster.
- * It accesses first the local process descriptor. In case of local miss, it takes
- * the lock protecting the reference fd_array, and access the reference process descriptor.
- * It updates the local fd_array when the file descriptor exists in owner cluster. 
- * It release the lock protecting the reference fd_array.
- *********************************************************************************************
- * @ process  : local pointer on local process descriptor.
- * @ fdid     : file descriptor index in the fd_array.
- * @ return extended pointer on file descriptor if success / return XPTR_NULL if not found.
- ********************************************************************************************/
-xptr_t process_fd_get_xptr_from_local( process_t * process,
-                                       uint32_t    fdid );
-
-/*********************************************************************************************
- * This function returns an extended pointer on a file descriptor identified by its <fdid>
- * index in the fd_array of the owner process, identified by the <process_xp> argument,
- * accessing directly the fd_array in owner cluster. It can be called by any thread running
- * in any cluster, but the local fd_array copy is not updated.
- *********************************************************************************************
- * @ process_xp  : extended pointer on the owner process descriptor.
- * @ fdid        : file descriptor index in the fd_array.
- * @ return extended pointer on file descriptor if success / return XPTR_NULL if not found.
- ********************************************************************************************/
-xptr_t process_fd_get_xptr_from_owner( xptr_t      process_xp,
-                                       uint32_t    fdid );
-
-/*********************************************************************************************
- * This function scans all entries in a fd_array, identified by the <src_xp> argument, that
- * must be the process descriptor in owner cluster. For each non-zero entry, it allocates a
- * new file descriptor in the cluster containing the involved inode, and registers it in the
- * fd_array identified by the <dst_xp> argument, that must also be the process descriptor in
- * owner cluster. The calling thread itself can be running in any cluster.
- * It takes the lock protecting the <src_xp> fd_array against concurrent accesses.
- *********************************************************************************************
- * @ dst_xp   : extended pointer on the source process descriptor (in owner cluster).
- * @ src_xp   : extended pointer on the destination process descriptor (in owner cluster).
- * @ return 0 if success / return -1 if failure
- ********************************************************************************************/
-error_t process_fd_replicate( xptr_t dst_xp,
-                              xptr_t src_xp );
-
-/*********************************************************************************************
- * This function checks the current number of open files for a given process.
- * It can be called by any thread in any cluster, because it uses portable remote access
- * primitives to access the reference process descriptor.
- * It does not take the lock protecting the reference fd_array.
- *********************************************************************************************
+ * This function closes all open files and releases all file descriptors.
+ ********************************************************************************************* 
+ * @ process  : pointer on the local process descriptor.
+ ********************************************************************************************/
+void process_fd_destroy( process_t * process );
+
+/*********************************************************************************************
+ * This function checks the number of open files for a given process. 
+ ********************************************************************************************* 
+ * @ process  : pointer on the local process descriptor.
  * @ returns true if file descriptor array full.
  ********************************************************************************************/
-bool_t process_fd_array_full( void );
-
-/*********************************************************************************************
- * This debug function diplays on the kernel terminal TXT0 detailed informations on the
- * set of file descriptors registered in the fd_array of a process descriptor identified
- * by the <process_xp> argument. 
- *********************************************************************************************
- * @ process_xp    : [in] extended pointer on process descriptor.
- ********************************************************************************************/
-void process_fd_display( xptr_t process_xp );
-
-/*********************************************************************************************
- * This utility function builds in the buffer defined by the <buffer> and <size> arguments
- * a printable string describing the current state of a process descriptor identified 
- * by the <process_xp> argument, or a WARNING message if the buffer size is too small.
- *********************************************************************************************
- * @ process_xp  : extended pointer on target process descriptor.
- * @ buffer      : kernel buffer for string.
- * @ size        : buffer size in bytes.
- * @ return always the string length (not including NUL), that can be a warning message.
- ********************************************************************************************/
-uint32_t process_build_string( xptr_t   process_xp,
-                               char   * buffer,
-                               uint32_t size );
-
-/********************   Thread Related Operations   *****************************************/
-
-/*********************************************************************************************
- * This function atomically registers a new thread identified by the <thread> argument 
- * in the th_tbl[] array of the local process descriptor identified by the <process>
- * argument. It checks that there is an available slot in the local th_tbl[] array,
- * and allocates a new LTID using the relevant lock depending on the kernel/user type,
- * and returns the global thread identifier in the <trdid> buffer.
- *********************************************************************************************
- * @ process  : [in]  pointer on the local process descriptor.
- * @ thread   : [in]  pointer on new thread to be registered.
- * @ trdid    : [out] buffer for allocated trdid.
+bool_t process_fd_array_full( process_t * process );
+
+/*********************************************************************************************
+ * These functions allocates a slot in the fd_array for a given process,
+ * and returns the file descriptor index.
+ ********************************************************************************************* 
+ * @ process  : pointer on the local process descriptor.
+ * @ file     : extended pointer on the file descriptor.
+ * @ fd       : [out] file descriptor index
+ * @ return 0 if success / return EMFILE if array full.
+ ********************************************************************************************/
+error_t process_fd_allocate( process_t * process, 
+                             xptr_t      file_xp, 
+                             uint32_t  * fd );
+
+/*********************************************************************************************
+ * This function releases an existing file descriptor from the process fd_array. 
+ ********************************************************************************************* 
+ * @ process  : pointer on the local process descriptor.
+ * @ return 0 if success / return EBADF if illegal file descriptor.
+ ********************************************************************************************/
+error_t process_fd_release( process_t * process,
+                            uint32_t    fd );
+
+/*********************************************************************************************
+ * This function copies all non-zero entries from a local <src> fd_array,
+ * embedded in a process descriptor, to another local <dst_xp> fd_array, embedded
+ * in another process descriptor. 
+ * It takes the remote lock protecting the <src> fd_array during the copy.
+ * For each involved file descriptor, the refcount is incremented. 
+ ********************************************************************************************* 
+ * @ dst   : pointer on the destination fd_array_t.
+ * @ src   : pointer on the source fd_array_t.
+ ********************************************************************************************/
+void process_fd_local_copy( fd_array_t * dst,
+                            fd_array_t * src );
+
+/*********************************************************************************************
+ * This function copies all non-zero entries from a remote <src_xp> fd_array,
+ * embedded in a process descriptor, to another remote <dst_xp> fd_array, embedded
+ * in another process descriptor. The calling thread can be running in any cluster.
+ * It takes the remote lock protecting the <src_xp> fd_array during the copy.
+ * For each involved file descriptor, the refcount is incremented. 
+ ********************************************************************************************* 
+ * @ dst_xp   : extended pointer on the destination fd_array_t.
+ * @ src_xp   : extended pointer on the source fd_array_t.
+ ********************************************************************************************/
+void process_fd_remote_copy( xptr_t dst_xp,
+                             xptr_t src_xp );
+
+
+/********************   Thread Related Operations   *****************************************/ 
+
+/*********************************************************************************************
+ * This function registers a new thread in the local process descriptor.
+ * It checks that there is an available slot in the local th_tbl[] array,
+ * allocates a new LTID, and registers the new thread in the th_tbl[].
+ * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
+ ********************************************************************************************* 
+ * @ process  : pointer on the local process descriptor.
+ * @ thread   : pointer on new thread to be registered.
+ * @ trdid    : [out] address of buffer for allocated trdid.
  * @ returns 0 if success / returns non zero if no slot available.
  ********************************************************************************************/
@@ -627,108 +376,11 @@
 
 /*********************************************************************************************
- * This function atomically removes a thread identified by the <thread> argument from 
- * the local process descriptor th_tbl[] array, and returns the number of thread currently
- * registered in th_tbl[] array before this remove.
- *********************************************************************************************
- * @ thread   : pointer on thread to be removed.
- * @ returns number of threads registered in th_tbl before thread remove.
- ********************************************************************************************/
-uint32_t process_remove_thread( struct thread_s * thread );
-
-
-/***************   Terminals related operations  ********************************************/
-
-/*********************************************************************************************
- * This function scan the set of user TXT terminals to find a free terminal
- * (the list of attached processes is empty for a free TXT terminal).
- * It is called only by the process_reference_init() function when creating a KSH process.
- * It makes a kernel panic if no free TXT terminal is found.
- * The allocated TXT terminal is only released when the KSH process is deleted.
- *********************************************************************************************
- * @ return TXT terminal index if succes / kernel panic if no terminal found.
- ********************************************************************************************/
-uint32_t process_txt_alloc( void );
-
-/*********************************************************************************************
- * This function attach a process, identified by the <process_xp> argument to a TXT terminal,
- * identified by the <txt_id> channel index argument.
- * The process descriptor identified by the <process_xp> argument must be in the owner
- * cluster. It insert the process descriptor in the xlist rooted in the TXT_RX device.
- * It is called by the process_reference_init() function.
- *********************************************************************************************
- * @ process_xp : extended pointer on process descriptor in owner cluster.
- * @ txt_id     : TXT channel index.
- ********************************************************************************************/
-void process_txt_attach( xptr_t    process_xp,
-                         uint32_t  txt_id );
-
-/*********************************************************************************************
- * This function detach a process, identified by the <process_xp> argument,
- * from the list of process attached to a given TXT terminal. It transfer the TXT ownership
- * to another process, if the detached process is the TXT owner.
- * The process descriptor identified by the <process_xp> argument must be in the owner
- * cluster, but the calling thread can be running in any cluster. 
- *********************************************************************************************
- * @ process_xp  : extended pointer on process descriptor in owner cluster.
- ********************************************************************************************/
-void process_txt_detach( xptr_t  process_xp );                     
-
-/*********************************************************************************************
- * This function returns the TXT terminal index allocated to a process identified by the
- * <process_xp> argument. The process descriptor identified by the <process_xp> argument 
- * must be in the owner cluster, but the calling thread can be running in any cluster. 
- *********************************************************************************************
- * @ process_xp  : extended pointer on process descriptor in owner cluster.
- ********************************************************************************************/
-uint32_t process_txt_get_index( xptr_t process_xp );
-
-/*********************************************************************************************
- * This function gives a process identified by the <process_xp> argument the 
- * ownership of its attached TXT_RX terminal (i.e. put the process in foreground).
- * It can be called by a thread running in any cluster, but the target process descriptor
- * must be in the owner cluster.
- *********************************************************************************************
- * @ owner_xp  : extended pointer on process descriptor in owner cluster.
- ********************************************************************************************/
-void process_txt_set_ownership( xptr_t process_xp );
-
-/*********************************************************************************************
- * When the target process identified by the <owner_xp> argument has the exclusive ownership
- * of the TXT_RX terminal, this function transfer this ownership to another process attached
- * to the same terminal. The target process descriptor must be the process owner.
- * This function does nothing if the target process is not the TXT owner.
- * - If the current owner is not the KSH process, the new owner is the KSH process.
- * - If the current owner is the KSH process, the new owner is another attached process.
- * - If there is no other attached process, the TXT has no more defined owner. 
- *********************************************************************************************
- * @ process_xp  : extended pointer on process descriptor in owner cluster.
- ********************************************************************************************/
-void process_txt_transfer_ownership( xptr_t process_xp );
-
-/*********************************************************************************************
- * This function returns true if the  process identified by the <process_xp> argument
- * is the TXT owner. It can be called by a thread running in any cluster, but the
- * process_xp must be the owner cluster process descriptor. 
- *********************************************************************************************
- * @ returns true if target process is TXT owner.
- ********************************************************************************************/
-bool_t process_txt_is_owner( xptr_t process_xp );
-
-/*********************************************************************************************
- * This function returns an extended pointer on the current TXT owner process, 
- * for the TXT terminal identified by the <channel> index. 
- *********************************************************************************************
- * @ channel : TXT channel.
- * @ return extended pointer on TXT owner process.
- ********************************************************************************************/
-xptr_t process_txt_get_owner( uint32_t channel );
-
-/*********************************************************************************************
- * This debug function diplays on the kernel terminal the list of processes attached
- * to a given terminal identified by the <txt_id> argument.
- *********************************************************************************************
- * @ txt_id  : TXT terminal channel.
- ********************************************************************************************/
-void process_txt_display( uint32_t txt_id );
+ * This function removes a thread registration from the local process descriptor.
+ * WARNING : the lock protecting the th_tbl[] must be taken by the caller.
+ ********************************************************************************************* 
+ * @ thread   : local pointer on thread to be removed.
+ ********************************************************************************************/
+void process_remove_thread( struct thread_s * thread );
+
 
 
Index: trunk/kernel/kern/remote_sem.c
===================================================================
--- trunk/kernel/kern/remote_sem.c	(revision 1)
+++ trunk/kernel/kern/remote_sem.c	(revision 1)
@@ -0,0 +1,264 @@
+/*
+ * remote_sem.c - Kernel function implementing the semaphore related syscalls.
+ * 
+ * Author   Alain Greiner  (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <hal_types.h>
+#include <thread.h>
+#include <kmem.h>
+#include <printk.h>
+#include <process.h>
+#include <vmm.h>
+#include <remote_sem.h>
+
+
+///////////////////////////////////////////////
+xptr_t remote_sem_from_vaddr( intptr_t  vaddr )
+{
+    // get pointer on local process_descriptor
+    process_t * process = CURRENT_PROCESS;
+
+    // get extended pointer on reference process
+    xptr_t      ref_xp = process->ref_xp;
+
+    // get cluster and local pointer on reference process 
+    cxy_t          ref_cxy = GET_CXY( ref_xp );
+    process_t    * ref_ptr = (process_t *)GET_PTR( ref_xp );
+
+    // get extended pointer on root of semaphores list 
+    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->sem_root );
+   
+    // scan reference process semaphores list
+    xptr_t         iter_xp;
+    xptr_t         sem_xp;
+    cxy_t          sem_cxy;
+    remote_sem_t * sem_ptr;
+    intptr_t       ident;
+    bool_t         found = false;
+            
+    XLIST_FOREACH( root_xp , iter_xp )
+    {
+        sem_xp  = XLIST_ELEMENT( iter_xp , remote_sem_t , sem_list );
+        sem_cxy = GET_CXY( sem_xp );
+        sem_ptr = (remote_sem_t *)GET_PTR( sem_xp );
+        ident   = hal_remote_lw( XPTR( sem_cxy , &sem_ptr->ident ) );   
+        if( ident == vaddr )
+        {
+            found = true;
+            break;
+        }
+    }
+
+    if( found == false )  return XPTR_NULL;
+    else                  return sem_xp;
+
+}  // end remote_sem_from_vaddr()
+
+/////////////////////////////////////////
+error_t remote_sem_init( intptr_t  vaddr,
+                         uint32_t  value )
+{
+    xptr_t         sem_xp;
+    remote_sem_t * sem_ptr;
+
+    // get pointer on local process descriptor
+    process_t * process = CURRENT_PROCESS;
+
+    // get extended pointer on reference process
+    xptr_t      ref_xp = process->ref_xp;
+
+    cxy_t       ref_cxy = GET_CXY( ref_xp );
+    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
+
+    // allocate memory for new semaphore in reference cluster
+    if( ref_cxy == local_cxy )  // local cluster is the reference 
+    {
+        kmem_req_t req;   
+        req.type  = KMEM_SEM;
+        req.flags = AF_ZERO;
+        sem_ptr   = kmem_alloc( &req );
+        sem_xp    = XPTR( local_cxy , sem_ptr );
+    }
+    else                         // reference is remote
+    {
+        rpc_semaphore_alloc_client( ref_cxy , &sem_xp );
+    }
+
+    if( sem_xp == XPTR_NULL ) return ENOMEM;
+
+    // initialise semaphore lock
+    remote_spinlock_init( XPTR( ref_cxy , &sem_ptr->lock ) );
+
+    // initialise semaphore count
+    hal_remote_sw( XPTR( ref_cxy , &sem_ptr->count ) , value );
+
+    // initialise vaddr
+	hal_remote_spt( XPTR( ref_cxy , &sem_ptr->ident ) , (void *)vaddr );
+
+    // initialise waiting threads queue
+	xlist_root_init( XPTR( ref_cxy , &sem_ptr->wait_queue ) );
+
+    // register new semaphore in reference process xlist
+    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->sem_root );
+    xptr_t xp_list = XPTR( ref_cxy , &sem_ptr->sem_list );
+    xlist_add_first( root_xp , xp_list );
+
+    return 0;
+
+}  // en remote_sem_init()
+ 
+//////////////////////////////////
+void remote_sem_wait( xptr_t sem_xp )
+{ 
+    // get semaphore cluster and local pointer
+    cxy_t          sem_cxy = GET_CXY( sem_xp );
+    remote_sem_t * sem_ptr = (remote_sem_t *)GET_PTR( sem_xp );
+
+    // get lock protecting semaphore     
+	remote_spinlock_lock( XPTR( sem_cxy , &sem_ptr->lock ) );
+  
+    // get semaphore current value
+    uint32_t count = hal_remote_lw( XPTR( sem_cxy , &sem_ptr->count ) );
+
+	if( count > 0 )       // success
+	{
+        // decrement semaphore value
+        hal_remote_sw( XPTR( sem_cxy , &sem_ptr->count ) , count - 1 );
+
+        // release lock
+	    remote_spinlock_unlock( XPTR( sem_cxy , &sem_ptr->lock ) );
+	}
+	else                 // failure
+	{
+        thread_t * this = CURRENT_THREAD;
+
+        // register thread in waiting queue
+        xptr_t root_xp   = (xptr_t)hal_remote_lwd( XPTR( sem_cxy , &sem_ptr->wait_queue ) );
+        xptr_t thread_xp = XPTR( local_cxy , this );
+		xlist_add_last( root_xp , thread_xp );
+
+        // release lock
+	    remote_spinlock_unlock( XPTR( sem_cxy , &sem_ptr->lock ) );
+
+        // block and deschedule
+        thread_block( this , THREAD_BLOCKED_SEM );  
+        sched_yield();
+	}
+}  // end remote_sem_wait()
+
+/////////////////////////////////////
+void remote_sem_post( xptr_t sem_xp )
+{
+    // get semaphore cluster and local pointer
+    cxy_t          sem_cxy = GET_CXY( sem_xp );
+    remote_sem_t * sem_ptr = (remote_sem_t *)GET_PTR( sem_xp );
+
+    // get lock protecting semaphore
+	remote_spinlock_lock( XPTR( sem_cxy , &sem_ptr->lock ) );
+  
+    // get remote pointer on waiting queue root
+    xptr_t queue_xp = (xptr_t)hal_remote_lwd( XPTR( sem_cxy , &sem_ptr->wait_queue ) );
+  
+	if( xlist_is_empty( queue_xp ) )   // no waiting thread
+    {
+        // get semaphore current value
+        uint32_t count = hal_remote_lw( XPTR( sem_cxy , &sem_ptr->count ) );
+
+        // increment semaphore value
+        hal_remote_sw( XPTR( sem_cxy , &sem_ptr->count ) , count + 1 );
+    }
+    else
+    {
+        // get first waiting thread from queue
+        xptr_t thread_xp = XLIST_FIRST_ELEMENT( queue_xp , thread_t , wait_list );
+
+        // get thread cluster and local poiner
+        cxy_t      thread_cxy = GET_CXY( thread_xp );
+        thread_t * thread_ptr = (thread_t *)GET_PTR( thread_xp );
+
+        // remove the thread from the waiting queue, and unblock
+        xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_list ) );
+		thread_unblock( thread_xp , THREAD_BLOCKED_SEM );
+    }
+
+    // release lock
+	remote_spinlock_unlock( XPTR( sem_cxy , &sem_ptr->lock ) );
+
+}  // end remote_sem_post()
+
+////////////////////////////////////////
+void remote_sem_destroy( xptr_t sem_xp )
+{
+    // get semaphore cluster and local pointer
+    cxy_t          sem_cxy = GET_CXY( sem_xp );
+    remote_sem_t * sem_ptr = (remote_sem_t *)GET_PTR( sem_xp );
+
+    // get lock protecting semaphore
+    remote_spinlock_lock( XPTR( sem_cxy , &sem_ptr->lock ) );
+  
+    // get remote pointer on waiting queue 
+    xptr_t queue_xp = (xptr_t)hal_remote_lwd( XPTR( sem_cxy , &sem_ptr->wait_queue ) );
+  
+    if( !xlist_is_empty( queue_xp ) )   // user error
+    {
+        printk("WARNING in %s for thread %x in process %x : "
+               "destroy semaphore, but  waiting threads queue not empty\n", 
+               __FUNCTION__ , CURRENT_THREAD->trdid , CURRENT_PROCESS->pid );
+    }
+
+    // reset semaphore count
+    hal_remote_sw( XPTR( sem_cxy , &sem_ptr->count ) , 0 );
+
+    // remove semaphore from process
+    xptr_t xp_list = (xptr_t)hal_remote_lwd( XPTR( sem_cxy , &sem_ptr->sem_list ) );
+    xlist_unlink( xp_list );
+
+    // release lock
+    remote_spinlock_unlock( XPTR( sem_cxy , &sem_ptr->lock ) );
+
+    // release memory allocated
+    if( sem_cxy == local_cxy )         // reference is local
+    {
+        kmem_req_t  req;
+        req.type = KMEM_SEM;
+        req.ptr  = sem_ptr;
+        kmem_free( &req );
+    }
+    else                                // reference is remote
+    {
+        rpc_semaphore_free_client( sem_cxy , sem_ptr );
+    }
+
+}  // end remote_sem_destroy()
+
+//////////////////////////////////////////////
+void remote_sem_get_value( xptr_t      sem_xp,
+                           uint32_t  * data )
+{
+    // get semaphore cluster and local pointer
+    cxy_t          sem_cxy = GET_CXY( sem_xp );
+    remote_sem_t * sem_ptr = (remote_sem_t *)GET_PTR( sem_xp );
+
+    *data = hal_remote_lw( XPTR( sem_cxy , &sem_ptr->count ) );
+
+}  // end remote_sem_get_value()
+
+
Index: trunk/kernel/kern/remote_sem.h
===================================================================
--- trunk/kernel/kern/remote_sem.h	(revision 1)
+++ trunk/kernel/kern/remote_sem.h	(revision 1)
@@ -0,0 +1,144 @@
+/*
+ * remote_sem.h - POSIX unnammed semaphore definition.
+ * 
+ * Author   Alain Greiner    (2016)
+ *
+ * Copyright (c)  UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SEMAPHORE_H_
+#define _SEMAPHORE_H_
+
+#include <hal_types.h>
+#include <xlist.h>
+#include <remote_spinlock.h>
+
+/*********************************************************************************************
+ *      This file defines the the POSIX compliant unnamed semaphore.
+ *
+ * A semaphore is declared by a given user process as a "sem_t" global variable.
+ * The user "sem_t" structure is implemented as an unsigned long, but the value is not
+ * used by the kernel. ALMOS-MKH uses only the sem_t virtual address as an identifier.
+ * For each user semaphore, ALMOS-MKH creates a kernel "remote_sem_t" structure.
+ * - This structure is allocated in the reference cluster by the sem_init() syscall, 
+ *   and destroyed by the sem_destroy() syscall, using RPC if the calling thread is not
+ *   running in the reference cluster.
+ * - The threads accessing the semaphore with the sem_get_value(), sem_wait(), sem_post()
+ *   syscalls can be running in any cluster, as these syscalls access the "remote_sem_t"
+ *   structure with remote_read / remote_write access functions.
+ ********************************************************************************************/
+
+
+/*********************************************************************************************
+ * This structure defines the kernel remote_sem_t structure.
+ * It contains the root of a waiting threads queue, implemented as a distributed xlist.
+ * It contains an xlist of all semaphores, rooted in the reference process descriptor.
+ * It contains a lock protecting both the semaphore value and the waiting queue.
+ ********************************************************************************************/
+
+typedef struct remote_sem_s
+{
+	remote_spinlock_t lock;          /*! lock protecting both count and wait_queue          */
+	uint32_t          count;         /*! current value                                      */
+    intptr_t          ident;         /*! virtual address in user space == identifier        */
+    xlist_entry_t     wait_queue;    /*! root of waiting thread queue                       */
+    xlist_entry_t     sem_list;      /*! member of list of semaphores in same process       */
+}
+remote_sem_t;
+
+/*********************************************************************************************
+ * This enum defines the semaphore operation types supported by the sys_sem() function.
+ * It must be consistent with the values defined in the semaphore.c file (user library).
+ ********************************************************************************************/
+
+typedef enum
+{
+	SEM_INIT,
+	SEM_GETVALUE,
+	SEM_WAIT,
+	SEM_POST,
+	SEM_DESTROY
+} 
+sem_operation_t;
+
+
+
+/*********************************************************************************************
+ * This function returns an extended pointer on the remote semaphore identified
+ * by its virtual address in a given user process. It makes an associative search, scanning
+ * the list of semaphores rooted in the reference process descriptor.
+ *********************************************************************************************
+ * @ process  : pointer on local process descriptor.
+ * @ vaddr    : semaphore virtual address, used as identifier.
+ * @ returns extended pointer on semaphore if success / returns XPTR_NULL if not found. 
+ ********************************************************************************************/
+xptr_t remote_sem_from_vaddr( intptr_t  vaddr );
+
+/*********************************************************************************************
+ * This function implements the SEM_INIT operation.
+ * It allocates memory for a remote semaphore in reference cluster, using a RPC if required, 
+ * and initializes it, using remote accesses. 
+ *********************************************************************************************
+ * @ vaddr    : semaphore virtual address, used as identifier.
+ * @ value    : semaphore initial value.
+ * @ returns 0 if success / returns ENOMEM if error. 
+ ********************************************************************************************/
+error_t remote_sem_init( intptr_t  vaddr,
+                         uint32_t  value );
+ 
+/****************************yy***************************************************************
+ * This blocking function implements the SEM_WAIT operation.
+ * - It returns only when the remote semaphore has a non-zero value,
+ *   and has been atomically decremented.
+ * -  if the semaphore has a zero value, it register the calling thread in the semaphore
+ *    waiting queue, block the thread, and yield.
+ *********************************************************************************************
+ * @ sem_xp   : extended pointer on semaphore. 
+ ********************************************************************************************/
+void remote_sem_wait( xptr_t sem_xp );
+
+/****************************yy***************************************************************
+ * This function mplements the SEM_POST operation.
+ * - It atomically increments the remote semaphore if the semaphore waiting queue is empty. 
+ * - If the waiting queue is not empty, it wakes up the first waiting thread.
+ *********************************************************************************************
+ * @ sem_xp   : extended pointer on semaphore. 
+ ********************************************************************************************/
+void remote_sem_post( xptr_t sem_xp );
+
+/****************************yy***************************************************************
+ * This function implements the SEM_DESTROY operation.
+ * It desactivates the semaphore, and releases the physical memory allocated in the 
+ * reference cluster, using a RPC if required.
+ *********************************************************************************************
+ * @ sem_xp   : extended pointer on semaphore. 
+ ********************************************************************************************/
+void remote_sem_destroy( xptr_t sem_xp );
+
+/****************************yy***************************************************************
+ * This function implements the SEM_GETVALUE operation.
+ * It returns in the <data> buffer the semaphore current value. 
+ *********************************************************************************************
+ * @ sem_xp   : extended pointer on semaphore. 
+ * @ data     : [out] returned value.
+ ********************************************************************************************/
+void remote_sem_get_value( xptr_t      sem_xp,
+                           uint32_t  * data );
+
+
+#endif	/* _SEMAPHORE_H_ */
Index: trunk/kernel/kern/rpc.c
===================================================================
--- trunk/kernel/kern/rpc.c	(revision 690)
+++ trunk/kernel/kern/rpc.c	(revision 1)
@@ -1,6 +1,7 @@
 /*
- * rpc.c - RPC operations implementation.
+ * rpc.c - RPC related operations implementation.
  * 
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
+ * Authors Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -22,7 +23,6 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_vmm.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_atomic.h>
 #include <hal_remote.h>
@@ -30,9 +30,8 @@
 #include <hal_special.h>
 #include <printk.h>
-#include <user_dir.h>
 #include <remote_sem.h>
 #include <core.h>
 #include <mapper.h>
-#include <chdev.h>
+#include <device.h>
 #include <bits.h>
 #include <thread.h>
@@ -41,676 +40,328 @@
 #include <vfs.h>
 #include <fatfs.h>
+#include <dev_icu.h>
 #include <rpc.h>
 
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Array of function pointers and array of printable strings.
-// These arrays must be kept consistent with enum in rpc.h file. 
+/////////////////////////////////////////////////////////////////////////////////////////
+//      array of function pointers  (must be consistent with enum in rpc.h) 
 /////////////////////////////////////////////////////////////////////////////////////////
 
 rpc_server_t * rpc_server[RPC_MAX_INDEX] =
 {
-    &rpc_undefined,                        // 0
-    &rpc_undefined,                        // 1
-    &rpc_undefined,                        // 2
-    &rpc_process_make_fork_server,         // 3
-    &rpc_user_dir_create_server,           // 4
-    &rpc_user_dir_destroy_server,          // 5
-    &rpc_thread_user_create_server,        // 6
-    &rpc_thread_kernel_create_server,      // 7
-    &rpc_undefined,                        // 8
-    &rpc_process_sigaction_server,         // 9
-
-    &rpc_undefined,                        // 10
-    &rpc_undefined,                        // 11
-    &rpc_undefined,                        // 12
-    &rpc_undefined,                        // 13
-    &rpc_undefined,                        // 14
-    &rpc_vmm_resize_vseg_server,           // 15
-    &rpc_vmm_remove_vseg_server,           // 16 
-    &rpc_vmm_create_vseg_server,           // 17
-    &rpc_vmm_set_cow_server,               // 18
-    &rpc_undefined,                        // 19
+    &rpc_pmem_get_pages_server,         // 0
+    &rpc_process_pid_alloc_server,      // 1
+    &rpc_process_exec_server,           // 2
+    &rpc_process_kill_server,           // 3
+    &rpc_thread_user_create_server,     // 4
+    &rpc_thread_kernel_create_server,   // 5
+    &rpc_icu_wti_alloc_server,          // 6                       
+    &rpc_device_alloc_server,           // 7
+    &rpc_undefined,                     // 8
+    &rpc_undefined,                     // 9
+
+    &rpc_vfs_inode_create_server,       // 10  
+    &rpc_vfs_inode_destroy_server,      // 11  
+    &rpc_vfs_dentry_create_server,      // 12  
+    &rpc_vfs_dentry_destroy_server,     // 13  
+    &rpc_undefined,                     // 14
+    &rpc_undefined,                     // 15
+    &rpc_undefined,                     // 16
+    &rpc_undefined,                     // 17
+    &rpc_undefined,                     // 18
+    &rpc_undefined,                     // 19
+
+    &rpc_vmm_get_ref_vseg_server,       // 20
+    &rpc_vmm_get_pte_server,            // 21
+    &rpc_semaphore_alloc_server,        // 22
+    &rpc_semaphore_free_server,         // 23
+    &rpc_mapper_move_server,            // 24
+    &rpc_undefined,                     // 25
+    &rpc_undefined,                     // 26
+    &rpc_undefined,                     // 27
+    &rpc_undefined,                     // 28
+    &rpc_undefined,                     // 29
+
+    &rpc_fatfs_get_cluster_server       // 30
 };
 
-char * rpc_str[RPC_MAX_INDEX] =
-{
-    "undefined_0",               // 0
-    "undefined_1",               // 1
-    "undefined_2",               // 2
-    "PROCESS_MAKE_FORK",         // 3
-    "USER_DIR_CREATE",           // 4
-    "USER_DIR_DESTROY",          // 5
-    "THREAD_USER_CREATE",        // 6
-    "THREAD_KERNEL_CREATE",      // 7
-    "FBF_DISPLAY",               // 8
-    "PROCESS_SIGACTION",         // 9
-
-    "undefined_10",              // 10
-    "undefined_11",              // 11
-    "undefined_12",              // 12
-    "undefined_13",              // 13
-    "undefined_14",              // 14
-    "VMM_RESIZE_VSEG",           // 15
-    "VMM_REMOVE_VSEG",           // 16
-    "VMM_CREATE_VSEG",           // 17
-    "VMM_SET_COW",               // 18
-    "undefined_19",              // 19
-};
-
-//////////////////////////////////////////////////////////////////////////////////
-void __attribute__((noinline)) rpc_undefined( xptr_t xp __attribute__ ((unused)) )
-{
-	assert( __FUNCTION__, false , "called in cluster %x", local_cxy );
-}
-
-/***************************************************************************************/
-/************ Generic function supporting RPCs : client side ***************************/
-/***************************************************************************************/
-
-///////////////////////////////////////
-void rpc_send( cxy_t        server_cxy, 
-               rpc_desc_t * rpc )
-{
-    lid_t              server_core_lid;
-    lid_t              client_core_lid;
-    volatile error_t   full;
-    thread_t         * this;
-
-    full            = 0;
-    this            = CURRENT_THREAD;
-    client_core_lid = this->core->lid;
-
-    // check calling thread can yield when is not the IDLE thread
-    // RPCs executed by the IDLE thread during kernel_init do not deschedule
-    if( this->type != THREAD_IDLE ) thread_assert_can_yield( this , __FUNCTION__ );
-
-    // select a server_core : use client core index if possible / core 0 otherwise
-    if( client_core_lid < hal_remote_l32( XPTR( server_cxy , &LOCAL_CLUSTER->cores_nr ) ) )
-    {
-        server_core_lid = client_core_lid;
-    }
-    else
-    {   
-        server_core_lid = 0;
-    }
-
-    // register client_thread and client_core in RPC descriptor
-    rpc->thread = this;
-    rpc->lid    = client_core_lid;
-
-    // build extended pointer on the RPC descriptor
-	xptr_t   desc_xp = XPTR( local_cxy , rpc );
-
-    // get local pointer on rpc_fifo in remote cluster,
-    remote_fifo_t * rpc_fifo    = &LOCAL_CLUSTER->rpc_fifo[server_core_lid];
-    xptr_t          rpc_fifo_xp = XPTR( server_cxy , rpc_fifo );
-
-	// post RPC in remote fifo / deschedule without blocking if fifo full
-    do
-    { 
-        full = remote_fifo_put_item( rpc_fifo_xp , (uint64_t )desc_xp );
-
-	    if ( full ) 
-        {
-            printk("\n[WARNING] %s : cluster %x cannot post RPC to cluster %x\n",
-            __FUNCTION__ , local_cxy , server_cxy );
-
-            // deschedule without blocking 
-            sched_yield("RPC fifo full");
-        }
-    }
-    while( full );
- 
-#if DEBUG_RPC_CLIENT_GENERIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-uint32_t items = remote_fifo_items( rpc_fifo_xp );
-if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[%s] thread[%x,%x] / rpc %s / server[%x,%d] / items %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], 
-server_cxy, server_core_lid, items, cycle );
-#endif
-	
-   // send IPI to the selected server core
-   dev_pic_send_ipi( server_cxy , server_core_lid );
-
-    // wait RPC completion before returning if blocking RPC :
-    // - deschedule without blocking if thread idle (in kernel init)
-    // - block and deschedule policy for any other thread
-    if ( rpc->blocking )
-    {
-        if( this->type == THREAD_IDLE )  // deschedule without blocking policy
-        {
-  
-#if DEBUG_RPC_CLIENT_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[%s] thread[%x,%x] enter waiting loop for rpc %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
-#endif
-             while( 1 )
-             {
-                 // check responses counter
-                 if( hal_remote_l32( XPTR( local_cxy , rpc->rsp ) ) == 0 ) break;
-                   
-                 // deschedule
-                 sched_yield("busy_waiting RPC completion");
-             }
-
-#if DEBUG_RPC_CLIENT_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[%s] thread[%x,%x] received response for rpc %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
-#endif
- 
-        }
-        else                            // block and deschedule policy
-        {
-
-#if DEBUG_RPC_CLIENT_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[%s] thread[%x,%x] blocks & deschedules for rpc %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
-#endif
-
-        // block client thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
-
-        // deschedule
-        sched_yield("blocked on RPC");
-
-#if DEBUG_RPC_CLIENT_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[%s] thread[%x,%x] resumes after rpc %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
-#endif
-        }
-
-// response must be available for a blocking RPC
-assert( __FUNCTION__, (*rpc->rsp == 0) , "illegal response for RPC %s\n", rpc_str[rpc->index] );
-
-    }
-    else       // non blocking RPC
-    {
-
-#if DEBUG_RPC_CLIENT_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_CLIENT_GENERIC < cycle ) 
-printk("\n[%s] thread[%x,%x] returns for non blocking rpc %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, rpc_str[rpc->index], cycle );
-#endif
-
-    }
-}  // end rpc_send()
-
-
-/***************************************************************************************/
-/************ Generic functions supporting RPCs : server side **************************/
-/***************************************************************************************/
-
-////////////////////////////
-void rpc_server_func( void )
-{
-    error_t         empty;              // local RPC fifo state
-    xptr_t          desc_xp;            // extended pointer on RPC request
-    cxy_t           desc_cxy;           // RPC request cluster (client) 
-    rpc_desc_t    * desc_ptr;           // RPC request local pointer 
-    uint32_t        index;              // RPC request index 
-    thread_t      * client_ptr;         // local pointer on client thread
-    xptr_t          client_xp;          // extended pointer on client thread
-    lid_t           client_lid;         // local index of client core
-	thread_t      * server_ptr;         // local pointer on server thread
-    xptr_t          server_xp;          // extended pointer on server thread
-    lid_t           server_lid;         // local index of server core
-	remote_fifo_t * rpc_fifo;           // local pointer on RPC fifo
-    uint32_t      * rsp_ptr;            // local pointer on responses counter
-    xptr_t          rsp_xp;             // extended pointer on responses counter
-    uint32_t        responses;          // number of expected responses
-
-    // makes RPC thread not preemptable
-	hal_disable_irq( NULL );
-  
-	server_ptr      = CURRENT_THREAD;
-    server_xp       = XPTR( local_cxy , server_ptr );
-    server_lid      = server_ptr->core->lid;
-	rpc_fifo        = &LOCAL_CLUSTER->rpc_fifo[server_lid];
-
-    // "infinite" RPC thread loop
-	while(1)
-	{
-        // try to take RPC_FIFO ownership
-        if( hal_atomic_test_set( &rpc_fifo->owner , server_ptr->trdid ) ) 
-        {
-
-#if DEBUG_RPC_SERVER_GENERIC 
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_SERVER_GENERIC < cycle ) 
-printk("\n[%s] RPC thread[%x,%x] on core[%d] takes RPC_FIFO ownership / cycle %d\n",
-__FUNCTION__, server_ptr->process->pid, server_ptr->trdid, server_lid, cycle );
-#endif
-	        // try to consume one RPC request  
-  	        empty = remote_fifo_get_item( rpc_fifo , (uint64_t *)&desc_xp );
-
-            // release RPC_FIFO ownership
-            rpc_fifo->owner = 0;
-
-            // handle RPC request if success
-	        if ( empty == 0 )   
-            {
-                // get client cluster and pointer on RPC descriptor
-                desc_cxy = GET_CXY( desc_xp );
-                desc_ptr = GET_PTR( desc_xp );
-
-                // get relevant infos from RPC descriptor
-	            index      = hal_remote_l32( XPTR( desc_cxy , &desc_ptr->index ) );
-                client_ptr = hal_remote_lpt( XPTR( desc_cxy , &desc_ptr->thread ) );
-                rsp_ptr    = hal_remote_lpt( XPTR( desc_cxy , &desc_ptr->rsp ) );
-                client_lid = hal_remote_l32( XPTR( desc_cxy , &desc_ptr->lid ) );
-
-                rsp_xp     = XPTR( desc_cxy , rsp_ptr );
-                client_xp  = XPTR( desc_cxy , client_ptr );
-
-#if DEBUG_RPC_SERVER_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-uint32_t items = remote_fifo_items( XPTR( local_cxy , rpc_fifo ) );
-if( DEBUG_RPC_SERVER_GENERIC < cycle ) 
-printk("\n[%s] RPC thread[%x,%x] got rpc %s / client_cxy %x / items %d / cycle %d\n",
-__FUNCTION__, server_ptr->process->pid, server_ptr->trdid, rpc_str[index], desc_cxy, items, cycle );
-#endif
-                // register client thread in RPC thread descriptor
-                server_ptr->rpc_client_xp = client_xp;
- 
-                // call the relevant server function
-                rpc_server[index]( desc_xp );
-
-                // update responses counter
-                responses = hal_remote_atomic_add( rsp_xp , -1 );
-
-#if DEBUG_RPC_SERVER_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_SERVER_GENERIC < cycle ) 
-printk("\n[%s] RPC thread[%x,%x] completes rpc %s / responses %d / cycle %d\n",
-__FUNCTION__, server_ptr->process->pid, server_ptr->trdid, rpc_str[index], responses, cycle );
-#endif
-                // decrement expected responses counter 
-                // unblock client thread if last response
-                if( responses == 1 ) 
-                {
-                    // unblock client thread
-                    thread_unblock( client_xp , THREAD_BLOCKED_RPC );
-
-                    hal_fence();
-
-#if DEBUG_RPC_SERVER_GENERIC
-cycle = (uint32_t)hal_get_cycles();
-trdid_t     client_trdid = hal_remote_l32( XPTR( desc_cxy , &client_ptr->trdid ) );
-process_t * process      = hal_remote_lpt( XPTR( desc_cxy , &client_ptr->process ) );
-pid_t       client_pid   = hal_remote_l32( XPTR( desc_cxy , &process->pid ) );
-if( DEBUG_RPC_SERVER_GENERIC < cycle ) 
-printk("\n[%s] RPC thread[%x,%x] unblocked client thread[%x,%x] / cycle %d\n",
-__FUNCTION__, server_ptr->process->pid, server_ptr->trdid,
-client_pid, client_trdid, cycle );
-#endif
-                    // send IPI to client core
-                    dev_pic_send_ipi( desc_cxy , client_lid );
-                }
-            }  // end RPC handling if fifo non empty
-        }  // end if RPC_fIFO ownership successfully taken and released
-
-        // sucide if too many RPC threads 
-        if( LOCAL_CLUSTER->rpc_threads[server_lid] >= CONFIG_RPC_THREADS_MAX )
-	    {
-
-#if DEBUG_RPC_SERVER_GENERIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_SERVER_GENERIC < cycle ) 
-printk("\n[%s] RPC thread[%x,%x] suicides / cycle %d\n",
-__FUNCTION__, server_ptr->process->pid, server_ptr->trdid, cycle );
-#endif
-            // update RPC threads counter
-	        hal_atomic_add( &LOCAL_CLUSTER->rpc_threads[server_lid] , -1 );
-
-            // RPC thread blocks on GLOBAL
-	        thread_block( server_xp , THREAD_BLOCKED_GLOBAL );
-
-            // RPC thread set the REQ_DELETE flag to suicide
-            hal_remote_atomic_or( server_xp , THREAD_FLAG_REQ_DELETE );
-	    }
-        // block and deschedule otherwise
-        else
-        {
-
-#if DEBUG_RPC_SERVER_GENERIC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_SERVER_GENERIC < cycle ) 
-printk("\n[%s] RPC thread[%x,%x] blocks & deschedules / cycle %d\n",
-__FUNCTION__, server_ptr->process->pid, server_ptr->trdid, cycle );
-#endif
-            // RPC thread blocks on IDLE 
-            thread_block( server_xp , THREAD_BLOCKED_IDLE );
-
-            // RPC thread deschedules
-            sched_yield("RPC_FIFO empty");
-        }
-	} // end infinite loop
-
-} // end rpc_server_func()
-
-
-/***************************************************************************************/
-/************ Marshaling functions ordered by increasing index *************************/
-/***************************************************************************************/
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [0]           undefined                                               
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [1]           undefined                                               
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [2]           undefined                                               
-/////////////////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [3]           Marshaling function attached to RPC_MAKE_FORK           
+//////////////////////////////////////////////
+void __attribute__((noinline)) rpc_undefined()
+{
+    printk("\n[PANIC] ‰s called in cluster %x\n", __FUNCTION__ , local_cxy );
+    hal_core_sleep();
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_PMEM_GET_PAGES 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////
+void rpc_pmem_get_pages_client( cxy_t      cxy,
+                                uint32_t   order,      // in 
+                                error_t  * error,      // out 
+                                uint32_t * ppn )       // out 
+{
+    // any RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_PMEM_GET_PAGES;
+    rpc.response = 1;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)order;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
+
+    // get output arguments RPC descriptor
+    *error  = (error_t)rpc.args[0];     
+    *ppn    = (uint32_t)rpc.args[1];
+}
+
+///////////////////////////////////////////
+void rpc_pmem_get_pages_server( xptr_t xp )
+{
+    uint32_t order;  // input
+    error_t  error;  // output
+    uint32_t ppn;    // output
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input arguments from client RPC descriptor
+    order = hal_remote_lw( XPTR( cxy , &desc->args[0] ) );
+    
+    // call local pmem allocator
+    page_t * page = ppm_alloc_pages( order ); 
+    error = ( page == NULL ) ? ENOMEM : 0;
+    ppn   = ppm_page2ppn( page );
+
+    // set output arguments into client RPC descriptor
+    hal_remote_sw( XPTR( cxy , &desc->args[0] ) , error );
+    hal_remote_sw( XPTR( cxy , &desc->args[1] ) , ppn );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_PROCESS_PID_ALLOC
+/////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////
+void rpc_process_pid_alloc_client( cxy_t       cxy, 
+                                   process_t * process,  // in
+                                   error_t   * error,    // out
+                                   pid_t     * pid )     // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_PROCESS_PID_ALLOC;
+    rpc.response = 1;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)(intptr_t)process;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
+
+    // get output arguments RPC descriptor
+    *pid    = (pid_t)rpc.args[1];
+    *error  = (error_t)rpc.args[2];     
+}
+
+//////////////////////////////////////////////
+void rpc_process_pid_alloc_server( xptr_t xp )
+{
+    process_t * process;   // input  : client process descriptor
+    error_t     error;     // output : error status
+    pid_t       pid;       // output : process identifier
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input argument from client RPC descriptor
+    process = (process_t*)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+    
+    // call local pid allocator 
+    xptr_t xp_process = XPTR( client_cxy , process );
+    error = cluster_pid_alloc( xp_process , &pid ); 
+
+    // set output arguments into client RPC descriptor
+    hal_remote_sw( XPTR( client_cxy , &desc->args[0] ) , (uint64_t)error );
+    hal_remote_sw( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)pid );
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_PROCESS_EXEC 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////
+void rpc_process_exec_client( cxy_t         cxy,
+                              exec_info_t * info,     // in
+                              error_t     * error )   // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_PROCESS_EXEC;
+    rpc.response = 1;
+
+    // set input arguments in RPC descriptor  
+    rpc.args[0] = (uint64_t)(intptr_t)info;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
+
+    // get output arguments from RPC descriptor
+    *error  = (error_t)rpc.args[1];     
+}
+
+/////////////////////////////////////////
+void rpc_process_exec_server( xptr_t xp )
+{
+    exec_info_t * ptr;       // local pointer on remote exec_info structure
+    exec_info_t   info;      // local copy of exec_info structure
+    error_t       error;     // local error error status
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+
+    // get pointer on exec_info structure in client cluster from RPC descriptor
+    ptr = (exec_info_t*)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+
+    // copy exec_info structure from client buffer to server buffer
+    hal_remote_memcpy( XPTR( client_cxy , ptr ),
+                       XPTR( local_cxy , &info ),
+                       sizeof(exec_info_t) );
+
+    // call local kernel function
+    error = process_make_exec( &info ); 
+
+    // set output argument into client RPC descriptor
+    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_PROCESS_KILL 
 /////////////////////////////////////////////////////////////////////////////////////////
 
 ///////////////////////////////////////////////////
-void rpc_process_make_fork_client( cxy_t       cxy,
-                                   xptr_t      ref_process_xp,      // in
-                                   xptr_t      parent_thread_xp,    // in
-                                   pid_t     * child_pid,           // out
-                                   thread_t ** child_thread_ptr,    // out     
-                                   error_t   * error )              // out
-{
-#if DEBUG_RPC_PROCESS_MAKE_FORK
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_PROCESS_MAKE_FORK;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor  
-    rpc.args[0] = (uint64_t)ref_process_xp;
-    rpc.args[1] = (uint64_t)parent_thread_xp;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output arguments from RPC descriptor
-    *child_pid         = (pid_t)rpc.args[2];
-    *child_thread_ptr  = (thread_t *)(intptr_t)rpc.args[3];
-    *error             = (error_t)rpc.args[4];     
-
-#if DEBUG_RPC_PROCESS_MAKE_FORK
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-//////////////////////////////////////////////
-void rpc_process_make_fork_server( xptr_t xp )
-{
-#if DEBUG_RPC_PROCESS_MAKE_FORK
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    xptr_t     ref_process_xp;     // extended pointer on reference parent process
-    xptr_t     parent_thread_xp;   // extended pointer on parent thread
-    pid_t      child_pid;          // child process identifier
-    thread_t * child_thread_ptr;   // local copy of exec_info structure
-    error_t    error;              // local error status
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input arguments from cient RPC descriptor
-    ref_process_xp   = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    parent_thread_xp = (xptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-
-    // call local kernel function
-    error = process_make_fork( ref_process_xp,
-                               parent_thread_xp,
-                               &child_pid,
-                               &child_thread_ptr ); 
-
-    // set output argument into client RPC descriptor
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)child_pid );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)(intptr_t)child_thread_ptr );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
-
-#if DEBUG_RPC_PROCESS_MAKE_FORK
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PROCESS_MAKE_FORK )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [4]      Marshaling functions attached to RPC_USER_DIR_CREATE  
-/////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////
-void rpc_user_dir_create_client( cxy_t          cxy,
-                                 vfs_inode_t *  inode,
-                                 xptr_t         ref_xp,
-                                 user_dir_t  ** dir )
-{
-#if DEBUG_RPC_USER_DIR_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_USER_DIR_CREATE;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)inode;
-    rpc.args[1] = (uint64_t)ref_xp;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output argument from RPC descriptor
-    *dir = (user_dir_t *)(intptr_t)rpc.args[2];
-
-#if DEBUG_RPC_USER_DIR_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-////////////////////////////////////////////
-void rpc_user_dir_create_server( xptr_t xp )
-{
-#if DEBUG_RPC_USER_DIR_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    vfs_inode_t * inode;          // pointer on inode in server cluster
-    xptr_t        ref_xp;         // extended pointer on reference user process
-    user_dir_t  * dir;            // pointer on user_dir structure in server cluster 
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input argument from RPC descriptor
-    inode  = (vfs_inode_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-    ref_xp = (xptr_t)                 hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
-
-    // call kernel function
-    dir = user_dir_create( inode , ref_xp );
-
-    // set output argument into RPC descriptor
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (intptr_t)dir );
-
-#if DEBUG_RPC_USER_DIR_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [5]      Marshaling functions attached to RPC_USER_DIR_DESTROY 
-/////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////
-void rpc_user_dir_destroy_client( cxy_t         cxy,
-                                  user_dir_t  * dir,
-                                  xptr_t        ref_xp )
-{
-#if DEBUG_RPC_USER_DIR_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_USER_DIR_DESTROY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)dir;
-    rpc.args[1] = (uint64_t)ref_xp;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_USER_DIR_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////
-void rpc_user_dir_destroy_server( xptr_t xp )
-{
-#if DEBUG_RPC_USER_DIR_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    user_dir_t * dir;            // pointer on user_dir structure in server cluster 
-    xptr_t       ref_xp;         // extended pointer on reference process
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input argument from RPC descriptor
-    dir    = (user_dir_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-    ref_xp = (xptr_t)                hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
-
-    // call kernel function
-    user_dir_destroy( dir , ref_xp );
-
-#if DEBUG_RPC_USER_DIR_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_USER_DIR_DESTROY)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [6]      Marshaling functions attached to RPC_THREAD_USER_CREATE   
+void rpc_process_kill_client( process_t * process ) 
+{
+    // only reference cluster can send this RPC
+    if( !process->is_ref )
+    {
+        printk("PANIC in %s : caller is not the reference process\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get local process index in reference cluster
+    lpid_t lpid = LPID_FROM_PID( process->pid );
+
+    // get local process manager pointer
+    pmgr_t * pmgr = &LOCAL_CLUSTER->pmgr;
+
+    // get number of copies
+    uint32_t copies = pmgr->copies_nr[lpid];
+
+    // initialise RPC descriptor 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_PROCESS_KILL;
+    rpc.response = copies;
+    rpc.args[0]  = (uint64_t)process->pid;
+
+    // loop on list of copies to send RPC
+    xptr_t  iter;
+    XLIST_FOREACH( XPTR( local_cxy , &pmgr->copies_root[lpid] ) , iter )
+    {
+        // get cluster_identifier for current copy
+        cxy_t  target_cxy = GET_CXY( iter );
+
+        // register RPC request in remote RPC fifo ... but the reference
+        if( target_cxy != local_cxy ) rpc_send_sync( target_cxy , &rpc );
+    }
+}  
+
+/////////////////////////////////////////
+void rpc_process_kill_server( xptr_t xp )
+{
+    pid_t       pid;
+    process_t * process;  
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+
+    // get pid argument from RPC descriptor
+    pid = (pid_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+
+    // get process pointer to call local kernel function
+    process = cluster_get_local_process_from_pid( pid );
+
+    if( process == NULL )  // process not found => do nothing
+    {
+        printk("\n[WARNING] in %s : process %x not found in cluster %x\n",
+               __FUNCTION__ , pid , local_cxy );
+    }
+    else                   // destroy process 
+    {
+        process_kill( process ); 
+    }
+} 
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_THREAD_USER_CREATE               
 /////////////////////////////////////////////////////////////////////////////////////////
 
 /////////////////////////////////////////////////////////
 void rpc_thread_user_create_client( cxy_t            cxy,  
-                                    pid_t            pid,         // in
-                                    void           * start_func,  // in
-                                    void           * start_arg,   // in
                                     pthread_attr_t * attr,        // in
                                     xptr_t         * thread_xp,   // out 
                                     error_t        * error )      // out 
 {
-#if DEBUG_RPC_THREAD_USER_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-   
-    uint32_t responses = 1;
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("\n[PANIC] in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
     rpc.index    = RPC_THREAD_USER_CREATE;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)pid;
-    rpc.args[1] = (uint64_t)(intptr_t)start_func;
-    rpc.args[2] = (uint64_t)(intptr_t)start_arg;
-    rpc.args[3] = (uint64_t)(intptr_t)attr;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
+    rpc.args[0] = (uint64_t)(intptr_t)attr;
+
+    // register RPC request in remote RPC fifo 
+    rpc_send_sync( cxy , &rpc );
 
     // get output arguments from RPC descriptor
-    *thread_xp = (xptr_t)rpc.args[4];
-    *error     = (error_t)rpc.args[5];
-
-#if DEBUG_RPC_THREAD_USER_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
+    *thread_xp = (xptr_t)rpc.args[1];
+    *error     = (error_t)rpc.args[2];
 }
 
@@ -718,31 +369,20 @@
 void rpc_thread_user_create_server( xptr_t xp )
 {
-#if DEBUG_RPC_THREAD_USER_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
     pthread_attr_t * attr_ptr;   // pointer on attributes structure in client cluster 
     pthread_attr_t   attr_copy;  // attributes structure  copy in server cluster
     thread_t       * thread_ptr; // local pointer on thread descriptor
     xptr_t           thread_xp;  // extended pointer on thread descriptor
-
     pid_t            pid;        // process identifier
-    void           * start_func;
-    void           * start_arg;
-    error_t          error;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input arguments from RPC descriptor
-    pid        = (pid_t)                     hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-    start_func = (void *)(intptr_t)          hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
-    start_arg  = (void *)(intptr_t)          hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
-    attr_ptr   = (pthread_attr_t *)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[3]));
+    process_t      * process;    // local pointer on process descriptor
+    vseg_t         * vseg;       // local pointer on stack vseg
+
+    error_t          error = 0;
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // get pointer on attributes structure in client cluster from RPC descriptor
+    attr_ptr = (pthread_attr_t *)(intptr_t)hal_remote_lwd( XPTR(client_cxy , &desc->args[0]) );
 
     // makes a local copy of attributes structure
@@ -751,25 +391,50 @@
                        sizeof(pthread_attr_t) );
     
-    // call kernel function
-    error = thread_user_create( pid,
-                                start_func,
-                                start_arg,
-                                &attr_copy,
-                                &thread_ptr );
+    if( attr_copy.cxy != local_cxy )
+    {
+        printk("\n[PANIC] in %s : target cluster = %X / local_cluster = %x\n",
+               __FUNCTION__ , attr_copy.cxy , local_cxy );
+        hal_core_sleep();
+    }
+
+    // get local process descriptor
+    pid     = attr_copy.pid; 
+    process = cluster_get_local_process_from_pid( pid );
+
+    if( process == NULL )
+    {
+        printk("\n[ERROR] in %s : no process descriptor in cluster %x for pid = %x\n",
+               __FUNCTION__ , local_cxy , pid );
+        error = ENOMEM;
+       
+    }
+
+    // allocate a stack from local VMM 
+    vseg = vmm_create_vseg( process, 
+                            0,
+                            0,
+                            VSEG_TYPE_STACK );
+    if( vseg == NULL )
+    {
+        printk("\n[ERROR] in %s : cannot create stack vseg in cluster %x for pid %x\n",
+               __FUNCTION__ , local_cxy , pid );
+        error = ENOMEM;
+    } 
+
+    // create thread in local cluster
+    if( thread_user_create( &thread_ptr,
+                            &attr_copy,
+                            vseg->min,
+                            vseg->max - vseg->min ) ) error = ENOMEM;
+
+
     // set output arguments
     thread_xp = XPTR( local_cxy , thread_ptr );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)thread_xp );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
-
-#if DEBUG_RPC_THREAD_USER_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_USER_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [7]      Marshaling functions attached to RPC_THREAD_KERNEL_CREATE 
+    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_THREAD_KERNEL_CREATE
 /////////////////////////////////////////////////////////////////////////////////////////
 
@@ -782,19 +447,15 @@
                                       error_t * error )      // out
 {
-#if DEBUG_RPC_THREAD_KERNEL_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t responses = 1;
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
     rpc.index    = RPC_THREAD_KERNEL_CREATE;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
@@ -804,16 +465,9 @@
     
     // register RPC request in remote RPC fifo 
-    rpc_send( cxy , &rpc );
+    rpc_send_sync( cxy , &rpc );
 
     // get output arguments from RPC descriptor
     *thread_xp = (xptr_t)rpc.args[3];
     *error     = (error_t)rpc.args[4];
-
-#if DEBUG_RPC_THREAD_KERNEL_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
 }
 
@@ -821,12 +475,4 @@
 void rpc_thread_kernel_create_server( xptr_t xp )
 {
-#if DEBUG_RPC_THREAD_KERNEL_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
     thread_t       * thread_ptr;  // local pointer on thread descriptor
     xptr_t           thread_xp;   // extended pointer on thread descriptor
@@ -835,14 +481,14 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
 
     // get attributes from RPC descriptor
-    uint32_t  type = (uint32_t)       hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    void    * func = (void*)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-    void    * args = (void*)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
+    uint32_t  type = (uint32_t)       hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+    void    * func = (void*)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
+    void    * args = (void*)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
 
     // select one core
-    core_lid = cluster_select_local_core( local_cxy );
+    core_lid = cluster_select_local_core();
 
     // call local kernel function
@@ -851,837 +497,18 @@
     // set output arguments
     thread_xp = XPTR( local_cxy , thread_ptr );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
-
-#if DEBUG_RPC_THREAD_KERNEL_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_THREAD_KERNEL_CREATE)
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [8]      undefined
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [9]   Marshaling functions attached to RPC_PROCESS_SIGACTION 
-/////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////
-void rpc_process_sigaction_client( cxy_t        cxy,
-                                   pid_t        pid,
-                                   uint32_t     action )
-{
-#if DEBUG_RPC_PROCESS_SIGACTION
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_RPC_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : enter to %s process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid,
-process_action_str( action ), pid, cycle );
-#endif
-
-    uint32_t    responses = 1;
-    rpc_desc_t  rpc;
-
-    // initialise RPC descriptor header 
-    rpc.index    = RPC_PROCESS_SIGACTION;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)pid;
-    rpc.args[1] = (uint64_t)action;
-
-    // register RPC request in remote RPC fifo 
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_PROCESS_SIGACTION
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : exit after %s process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid,
-process_action_str( action ), pid, cycle );
-#endif
-}
-
-//////////////////////////////////////////////
-void rpc_process_sigaction_server( xptr_t xp )
-{
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy = GET_CXY( xp );
-    rpc_desc_t * desc       = GET_PTR( xp );
-
-    // get arguments from RPC descriptor
-    pid_t    pid    = (pid_t)   hal_remote_l64( XPTR(client_cxy , &desc->args[0]) );
-    uint32_t action = (uint32_t)hal_remote_l64( XPTR(client_cxy , &desc->args[1]) );
-
-#if DEBUG_RPC_PROCESS_SIGACTION
-uint32_t cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_RPC_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : enter to %s process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid,
-process_action_str( action ), pid, cycle );
-#endif
-
-    // get client thread pointers
-    thread_t * client_ptr = hal_remote_lpt( XPTR( client_cxy , &desc->thread ) );
-    xptr_t     client_xp  = XPTR( client_cxy , client_ptr );
-
-    // get local process descriptor
-    process_t * process = cluster_get_local_process_from_pid( pid );
-
-    // call relevant kernel function if found / does nothing if not found
-    if( process != NULL )
-    {
-        if ( action == DELETE_ALL_THREADS  ) process_delete_threads ( process , client_xp ); 
-        if ( action == BLOCK_ALL_THREADS   ) process_block_threads  ( process ); 
-        if ( action == UNBLOCK_ALL_THREADS ) process_unblock_threads( process );
-    }
-
-#if DEBUG_RPC_PROCESS_SIGACTION
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_PROCESS_SIGACTION < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : exit after %s process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid,
-process_action_str( action ), pid, cycle );
-#endif
-} 
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [10]          undefined                                          
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [11]          undefined                                          
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [12]          undefined                                         
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [13]          undefined                                        
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [14]          undefined                                        
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [15]          Marshaling functions attached to RPC_VMM_RESIZE_VSEG 
-/////////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////
-void rpc_vmm_resize_vseg_client( cxy_t          cxy,
-                                 pid_t          pid,
-                                 intptr_t       base,
-                                 intptr_t       new_base,
-                                 intptr_t       new_size )
-{
-#if DEBUG_RPC_VMM_RESIZE_VSEG
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_RESIZE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VMM_RESIZE_VSEG;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)pid;
-    rpc.args[1] = (uint64_t)base;
-    rpc.args[2] = (uint64_t)new_base;
-    rpc.args[3] = (uint64_t)new_size;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_VMM_RESIZE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_RESIZE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-////////////////////////////////////////////
-void rpc_vmm_resize_vseg_server( xptr_t xp )
-{
-#if DEBUG_RPC_VMM_RESIZE_VSEG
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_RESIZE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    pid_t       pid;
-    process_t * process;
-    intptr_t    base;
-    vseg_t    * vseg;
-    intptr_t    new_base;
-    intptr_t    new_size;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get arguments from client RPC descriptor
-    pid      = (pid_t)   hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    base     = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-    new_base = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
-    new_size = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
-
-    // get local pointer on target process
-    process = cluster_get_local_process_from_pid( pid );
-
-    // get target vseg from vaddr
-    vmm_get_vseg( process , base , &vseg );
-
-    // call relevant kernel function
-    vmm_resize_vseg( process,
-                     vseg,
-                     new_base,
-                     new_size );
-
-#if DEBUG_RPC_VMM_RESIZE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_RESIZE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [16]  Marshaling functions attached to RPC_VMM_REMOVE_VSEG 
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////
-void rpc_vmm_remove_vseg_client( cxy_t       cxy,
-                                 pid_t       pid,
-                                 intptr_t    base )
-{
-#if DEBUG_RPC_VMM_REMOVE_VSEG
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_REMOVE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t    responses = 1;
-    rpc_desc_t  rpc;
-
-    // initialise RPC descriptor header 
-    rpc.index    = RPC_VMM_REMOVE_VSEG;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)pid;
-    rpc.args[1] = (uint64_t)base;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_VMM_REMOVE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_REMOVE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-////////////////////////////////////////////
-void rpc_vmm_remove_vseg_server( xptr_t xp )
-{
-#if DEBUG_RPC_VMM_REMOVE_VSEG
-uint32_t cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_RPC_VMM_REMOVE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    pid_t       pid;
-    intptr_t    vaddr;
-    process_t * process;
-    vseg_t    * vseg;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy = GET_CXY( xp );
-    rpc_desc_t * desc       = GET_PTR( xp );
-
-    // get arguments from RPC descriptor
-    pid   = (pid_t)   hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    vaddr = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-
-    // get local pointer on target process
-    process = cluster_get_local_process_from_pid( pid );
-
-    // get target vseg from vaddr
-    vmm_get_vseg( process , vaddr , &vseg );
-
-    // call relevant kernel function
-    vmm_remove_vseg( process,
-                     vseg );
-
-#if DEBUG_RPC_VMM_REMOVE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_VMM_REMOVE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-} 
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [17]          Marshaling functions attached to RPC_VMM_CREATE_VSEG 
-/////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////
-void rpc_vmm_create_vseg_client( cxy_t              cxy,
-                                 struct process_s * process,
-                                 vseg_type_t        type,
-                                 intptr_t           base,
-                                 uint32_t           size,
-                                 uint32_t           file_offset,
-                                 uint32_t           file_size,
-                                 xptr_t             mapper_xp,
-                                 cxy_t              vseg_cxy,
-                                 struct vseg_s   ** vseg )
-{
-#if DEBUG_RPC_VMM_CREATE_VSEG
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_CREATE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VMM_CREATE_VSEG;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)process;
-    rpc.args[1] = (uint64_t)type;
-    rpc.args[2] = (uint64_t)base;
-    rpc.args[3] = (uint64_t)size;
-    rpc.args[4] = (uint64_t)file_offset;
-    rpc.args[5] = (uint64_t)file_size;
-    rpc.args[6] = (uint64_t)mapper_xp;
-    rpc.args[7] = (uint64_t)vseg_cxy;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *vseg = (vseg_t *)(intptr_t)rpc.args[8];
-
-#if DEBUG_RPC_VMM_CREATE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_CREATE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-////////////////////////////////////////////
-void rpc_vmm_create_vseg_server( xptr_t xp )
-{
-#if DEBUG_RPC_VMM_CREATE_VSEG
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_CREATE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        cxy  = GET_CXY( xp );
-    rpc_desc_t * desc = GET_PTR( xp );
-
-    // get input arguments from client RPC descriptor
-    process_t * process     = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0]));
-    vseg_type_t type        = (vseg_type_t)(uint32_t)hal_remote_l64( XPTR(cxy , &desc->args[1]));
-    intptr_t    base        = (intptr_t)             hal_remote_l64( XPTR(cxy , &desc->args[2]));
-    uint32_t    size        = (uint32_t)             hal_remote_l64( XPTR(cxy , &desc->args[3]));
-    uint32_t    file_offset = (uint32_t)             hal_remote_l64( XPTR(cxy , &desc->args[4]));
-    uint32_t    file_size   = (uint32_t)             hal_remote_l64( XPTR(cxy , &desc->args[5]));
-    xptr_t      mapper_xp   = (xptr_t)               hal_remote_l64( XPTR(cxy , &desc->args[6]));
-    cxy_t       vseg_cxy    = (cxy_t)(uint32_t)      hal_remote_l64( XPTR(cxy , &desc->args[7]));
-    
-    // call local kernel function
-    vseg_t * vseg = vmm_create_vseg( process,
-                                     type,
-                                     base,
-                                     size,
-                                     file_offset,
-                                     file_size,
-                                     mapper_xp,
-                                     vseg_cxy ); 
-
-    // set output arguments into client RPC descriptor
-    hal_remote_s64( XPTR( cxy , &desc->args[8] ) , (uint64_t)(intptr_t)vseg );
-
-#if DEBUG_RPC_VMM_CREATE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_CREATE_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [18]          Marshaling functions attached to RPC_VMM_SET_COW 
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////
-void rpc_vmm_set_cow_client( cxy_t       cxy,
-                             process_t * process )
-{
-#if DEBUG_RPC_VMM_SET_COW
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_SET_COW )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VMM_SET_COW;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)process;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_VMM_SET_COW
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_SET_COW )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-////////////////////////////////////////
-void rpc_vmm_set_cow_server( xptr_t xp )
-{
-#if DEBUG_RPC_VMM_SET_COW
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_SET_COW )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    process_t * process;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        cxy  = GET_CXY( xp );
-    rpc_desc_t * desc = GET_PTR( xp );
-
-    // get input arguments from client RPC descriptor
-    process = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0]));
-    
-    // call local kernel function
-    vmm_set_cow( process );
-
-#if DEBUG_RPC_VMM_SET_COW
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_SET_COW )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////
-//                            DEPRECATED RPCs
-/////////////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////////////
-
-/*
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [0]       RPC_PMEM_GET_PAGES deprecated [AG] May 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_pmem_get_pages_client( cxy_t      cxy,
-                                uint32_t   order,      // in 
-                                page_t  ** page )      // out 
-{
-#if DEBUG_RPC_PMEM_GET_PAGES
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index     = RPC_PMEM_GET_PAGES;
-    rpc.blocking  = true;
-    rpc.rsp       = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)order;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output arguments from RPC descriptor
-    *page = (page_t *)(intptr_t)rpc.args[1];
-
-#if DEBUG_RPC_PMEM_GET_PAGES
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-///////////////////////////////////////////
-void rpc_pmem_get_pages_server( xptr_t xp )
-{
-#if DEBUG_RPC_PMEM_GET_PAGES
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        cxy  = GET_CXY( xp );
-    rpc_desc_t * desc = GET_PTR( xp );
-
-    // get input arguments from client RPC descriptor
-    uint32_t order = (uint32_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
-    
-    // call local pmem allocator
-    page_t * page = ppm_alloc_pages( order ); 
-
-    // set output arguments into client RPC descriptor
-    hal_remote_s64( XPTR( cxy , &desc->args[1] ) , (uint64_t)(intptr_t)page );
-
-#if DEBUG_RPC_PMEM_GET_PAGES
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_GET_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [1]       RPC_PMEM_RELEASE_PAGES deprecated [AG] may 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_pmem_release_pages_client( cxy_t     cxy,
-                                    page_t  * page )      // out 
-{
-#if DEBUG_RPC_PMEM_RELEASE_PAGES
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_PMEM_RELEASE_PAGES;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)page;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_PMEM_RELEASE_PAGES
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-///////////////////////////////////////////////
-void rpc_pmem_release_pages_server( xptr_t xp )
-{
-#if DEBUG_RPC_PMEM_RELEASE_PAGES
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        cxy  = GET_CXY( xp );
-    rpc_desc_t * desc = GET_PTR( xp );
-
-    // get input arguments from client RPC descriptor
-    page_t * page = (page_t *)(intptr_t)hal_remote_l64( XPTR( cxy , &desc->args[0] ) );
-    
-    // release memory to local pmem 
-    kmem_req_t req;
-    req.type = KMEM_PPM;
-    req.ptr  = page;
-    kmem_free( &req );
-
-#if DEBUG_RPC_PMEM_RELEASE_PAGES
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PMEM_RELEASE_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [2]          RPC_PPM_DISPLAY deprecated [AG] May 2019    
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_ppm_display_client( cxy_t  cxy )
-{
-#if DEBUG_RPC_PPM_DISPLAY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PPM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_PPM_DISPLAY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_PPM_DISPLAY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PPM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-////////////////////////////////////////////////////////////////////
-void rpc_ppm_display_server( xptr_t __attribute__((__unused__)) xp )
-{
-#if DEBUG_RPC_PPM_DISPLAY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PPM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    // call local kernel function
-    ppm_display();
-
-#if DEBUG_RPC_PPM_DISPLAY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_PPM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [8]   RPC_VFS_FS_UPDATE_DENTRY deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vfs_fs_update_dentry_client( cxy_t          cxy,
-                                      vfs_inode_t  * inode,
-                                      vfs_dentry_t * dentry,
-                                      uint32_t       size,
-                                      error_t      * error )
-{
-#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_FS_UPDATE_DENTRY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)inode;
-    rpc.args[1] = (uint64_t)(intptr_t)dentry;
-    rpc.args[2] = (uint64_t)size;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *error   = (error_t)rpc.args[3];
-
-#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////
-void rpc_vfs_fs_update_dentry_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    error_t        error;
-    vfs_inode_t  * inode;
-    vfs_dentry_t * dentry;
-    uint32_t       size;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input arguments
-    inode  = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
-    size   = (uint32_t)               hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
-
-    // call the kernel function
-    error = vfs_fs_update_dentry( inode , dentry , size );
-
-    // set output argument
-    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_FS_UPDATE_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_UPDATE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [29]      RPC_VMM_DISPLAY deprecated [AG] June 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_hal_vmm_display_client( cxy_t       cxy,
-                             process_t * process,
-                             bool_t      detailed )
-{
-#if DEBUG_RPC_VMM_DISPLAY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VMM_DISPLAY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)process;
-    rpc.args[1] = (uint64_t)detailed;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_VMM_DISPLAY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-////////////////////////////////////////
-void rpc_hal_vmm_display_server( xptr_t xp )
-{
-#if DEBUG_RPC_VMM_DISPLAY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    process_t * process;
-    bool_t      detailed;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        cxy  = GET_CXY( xp );
-    rpc_desc_t * desc = GET_PTR( xp );
-
-    // get input arguments from client RPC descriptor
-    process  = (process_t *)(intptr_t)hal_remote_l64( XPTR(cxy , &desc->args[0]));
-    detailed = (bool_t)               hal_remote_l64( XPTR(cxy , &desc->args[1]));
-    
-    // call local kernel function
-    hal_vmm_display( process , detailed );
-
-#if DEBUG_RPC_VMM_DISPLAY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_DISPLAY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [10]  to RPC_VFS_INODE_CREATE   deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
+    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)thread_xp );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_VFS_INODE_CREATE 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////
 void rpc_vfs_inode_create_client( cxy_t          cxy,     
-                                  uint32_t       fs_type,    // in
+                                  xptr_t         dentry_xp,  // in
+                                  uint32_t       type,       // in
                                   uint32_t       attr,       // in
-                                  uint32_t       rights,     // in
+                                  uint32_t       mode,       // in
                                   uint32_t       uid,        // in
                                   uint32_t       gid,        // in
@@ -1689,40 +516,30 @@
                                   error_t      * error )     // out
 {
-#if DEBUG_RPC_VFS_INODE_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target cluster is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
     rpc.index    = RPC_VFS_INODE_CREATE;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)fs_type;
-    rpc.args[1] = (uint64_t)attr;
-    rpc.args[2] = (uint64_t)rights;
-    rpc.args[3] = (uint64_t)uid;
-    rpc.args[4] = (uint64_t)gid;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
+    rpc.args[0] = (uint64_t)dentry_xp;
+    rpc.args[1] = (uint64_t)type;
+    rpc.args[2] = (uint64_t)attr;
+    rpc.args[3] = (uint64_t)mode;
+    rpc.args[4] = (uint64_t)uid;
+    rpc.args[5] = (uint64_t)gid;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
 
     // get output values from RPC descriptor
-    *inode_xp = (xptr_t)rpc.args[5];
-    *error    = (error_t)rpc.args[6];
-
-#if DEBUG_RPC_VFS_INODE_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
+    *inode_xp = (xptr_t)rpc.args[6];
+    *error    = (error_t)rpc.args[7];
 }
 
@@ -1730,15 +547,8 @@
 void rpc_vfs_inode_create_server( xptr_t xp )
 {
-#if DEBUG_RPC_VFS_INODE_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t         fs_type;
+    xptr_t           dentry_xp;
+    uint32_t         type;
     uint32_t         attr;
-    uint32_t         rights;
+    uint32_t         mode;
     uint32_t         uid;
     uint32_t         gid;
@@ -1747,18 +557,20 @@
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
 
     // get input arguments from client rpc descriptor
-    fs_type    = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    attr       = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-    rights     = (uint32_t)  hal_remote_l64( XPTR( client_cxy , &desc->args[2] ) );
-    uid        = (uid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[3] ) );
-    gid        = (gid_t)     hal_remote_l64( XPTR( client_cxy , &desc->args[4] ) );
+    dentry_xp = (xptr_t)  hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+    type      = (uint32_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
+    attr      = (uint32_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
+    mode      = (uint32_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[3] ) );
+    uid       = (uid_t)   hal_remote_lwd( XPTR( client_cxy , &desc->args[4] ) );
+    gid       = (gid_t)   hal_remote_lwd( XPTR( client_cxy , &desc->args[5] ) );
 
     // call local kernel function
-    error = vfs_inode_create( fs_type,
+    error = vfs_inode_create( dentry_xp,
+                              type,
                               attr,
-                              rights,
+                              mode,
                               uid,
                               gid,
@@ -1766,49 +578,33 @@
 
     // set output arguments
-    hal_remote_s64( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)inode_xp );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_INODE_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [11]  to RPC_VFS_INODE_DESTROY   deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
+    hal_remote_swd( XPTR( client_cxy , &desc->args[6] ) , (uint64_t)inode_xp );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[7] ) , (uint64_t)error );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_VFS_INODE_DESTROY 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////
 void rpc_vfs_inode_destroy_client( cxy_t                cxy,
                                    struct vfs_inode_s * inode )
 {
-#if DEBUG_RPC_VFS_INODE_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t responses = 1;
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target cluster is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
     rpc.index    = RPC_VFS_INODE_DESTROY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
     rpc.args[0] = (uint64_t)(intptr_t)inode;
     
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_VFS_INODE_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
 }
 
@@ -1816,74 +612,53 @@
 void rpc_vfs_inode_destroy_server( xptr_t xp )
 {
-#if DEBUG_RPC_VFS_INODE_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
     vfs_inode_t * inode;
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get argument "inode" from client RPC descriptor
-    inode = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+
+    // get arguments "inode" from client RPC descriptor
+    inode = (vfs_inode_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
                        
     // call local kernel function
     vfs_inode_destroy( inode );
-
-#if DEBUG_RPC_VFS_INODE_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [12]  RPC_VFS_DENTRY_CREATE   deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_VFS_DENTRY_CREATE
+/////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////
 void rpc_vfs_dentry_create_client( cxy_t                  cxy,
                                    uint32_t               type,         // in
                                    char                 * name,         // in
+                                   struct vfs_inode_s   * parent,       // in
                                    xptr_t               * dentry_xp,    // out
                                    error_t              * error )       // out
 {
-#if DEBUG_RPC_VFS_DENTRY_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t responses = 1;
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target cluster is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
     rpc.index    = RPC_VFS_DENTRY_CREATE;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
     rpc.args[0] = (uint64_t)type;
     rpc.args[1] = (uint64_t)(intptr_t)name;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
+    rpc.args[2] = (uint64_t)strlen( name );
+    rpc.args[3] = (uint64_t)(intptr_t)parent;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
 
     // get output values from RPC descriptor
-    *dentry_xp = (xptr_t)rpc.args[2];
-    *error     = (error_t)rpc.args[3];
-
-#if DEBUG_RPC_VFS_DENTRY_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
+    *dentry_xp = (xptr_t)rpc.args[4];
+    *error     = (error_t)rpc.args[5];
 }
 
@@ -1891,80 +666,63 @@
 void rpc_vfs_dentry_create_server( xptr_t xp )
 {
-#if DEBUG_RPC_VFS_DENTRY_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
     uint32_t      type;
     char        * name;
+    vfs_inode_t * parent;
     xptr_t        dentry_xp;
+    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
+    uint32_t      length;
     error_t       error;
-    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get arguments "name", "type", and "parent" from client RPC descriptor
-    type   = (uint32_t)         hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    name   = (char *)(intptr_t) hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-
-    // makes a local copy of  name
-    hal_remote_strcpy( XPTR( local_cxy , name_copy ),
-                       XPTR( client_cxy , name ) );
-
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+
+    // get argument "name" & "length" from client RPC descriptor and makes a local copy
+    name   = (char *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
+    length = (uint32_t)        hal_remote_lwd( XPTR( client_cxy , &desc->args[2] ) );
+    hal_remote_memcpy( XPTR( local_cxy , name_copy ),
+                       XPTR( client_cxy , name ),
+					   length + 1 );               // +1 for the NUL char
+
+    // get arguments "type" and "parent" from client RPC descriptor
+    type   = (uint32_t)               hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+    parent = (vfs_inode_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[3] ) );
+                       
     // call local kernel function
     error = vfs_dentry_create( type,
                                name_copy,
+                               parent,
                                &dentry_xp );
+ 
     // set output arguments
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)dentry_xp );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_DENTRY_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [13]  RPC_VFS_DENTRY_DESTROY   deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
+    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)dentry_xp );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[5] ) , (uint64_t)error );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_VFS_DENTRY_DESTROY 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////
 void rpc_vfs_dentry_destroy_client( cxy_t          cxy,
                                     vfs_dentry_t * dentry )
 {
-#if DEBUG_RPC_VFS_DENTRY_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target cluster is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
     // initialise RPC descriptor header 
     rpc_desc_t  rpc;
     rpc.index    = RPC_VFS_DENTRY_DESTROY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
     rpc.args[0] = (uint64_t)(intptr_t)dentry;
     
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_VFS_DENTRY_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
 }
 
@@ -1972,531 +730,39 @@
 void rpc_vfs_dentry_destroy_server( xptr_t xp )
 {
-#if DEBUG_RPC_VFS_DENTRY_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
     vfs_dentry_t * dentry;
 
     // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
 
     // get arguments "dentry" from client RPC descriptor
-    dentry = (vfs_dentry_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
+    dentry = (vfs_dentry_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
                        
     // call local kernel function
     vfs_dentry_destroy( dentry );
-
-#if DEBUG_RPC_VFS_DENTRY_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_DENTRY_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [14]  RPC_VFS_FILE_CREATE  deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vfs_file_create_client( cxy_t                  cxy,
-                                 struct vfs_inode_s   * inode,       // in
-                                 uint32_t               file_attr,   // in
-                                 xptr_t               * file_xp,     // out
-                                 error_t              * error )      // out
-{
-#if DEBUG_RPC_VFS_FILE_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_FILE_CREATE;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)inode;
-    rpc.args[1] = (uint64_t)file_attr;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *file_xp = (xptr_t)rpc.args[2];
-    *error   = (error_t)rpc.args[3];
-
-#if DEBUG_RPC_VFS_FILE_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-////////////////////////////////////////////
-void rpc_vfs_file_create_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_FILE_CREATE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t      file_attr;
-    vfs_inode_t * inode;
-    xptr_t        file_xp;
-    error_t       error;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get arguments "file_attr" and "inode" from client RPC descriptor
-    inode     = (vfs_inode_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    file_attr = (uint32_t)               hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
-                       
-    // call local kernel function
-    error = vfs_file_create( inode,
-                             file_attr,
-                             &file_xp );
- 
-    // set output arguments
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)file_xp );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_FILE_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_CREATE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [15]  RPC_VFS_FILE_DESTROY    deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vfs_file_destroy_client( cxy_t        cxy,
-                                  vfs_file_t * file )
-{
-#if DEBUG_RPC_VFS_FILE_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_FILE_DESTROY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)file;
-    
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_VFS_FILE_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////
-void rpc_vfs_file_destroy_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_FILE_DESTROY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    vfs_file_t * file;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get arguments "dentry" from client RPC descriptor
-    file = (vfs_file_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-                       
-    // call local kernel function
-    vfs_file_destroy( file );
-
-#if DEBUG_RPC_VFS_FILE_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FILE_DESTROY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [16]  RPC_VFS_FS_GET_DENTRY   deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vfs_fs_new_dentry_client( cxy_t         cxy,
-                                   vfs_inode_t * parent_inode,    // in
-                                   char        * name,            // in
-                                   xptr_t        child_inode_xp,  // in
-                                   error_t     * error )          // out
-{
-#if DEBUG_RPC_VFS_FS_NEW_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_FS_NEW_DENTRY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)parent_inode;
-    rpc.args[1] = (uint64_t)(intptr_t)name;
-    rpc.args[2] = (uint64_t)child_inode_xp;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *error   = (error_t)rpc.args[3];
-
-#if DEBUG_RPC_VFS_FS_NEW_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-//////////////////////////////////////////////
-void rpc_vfs_fs_new_dentry_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_FS_NEW_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    error_t       error;
-    vfs_inode_t * parent;
-    xptr_t        child_xp;
-    char        * name;
-
-    char          name_copy[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get arguments "parent", "name", and "child_xp"
-    parent     = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-    name       = (char*)(intptr_t)       hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
-    child_xp   = (xptr_t)                hal_remote_l64(XPTR(client_cxy , &desc->args[2]));
-
-    // get name local copy
-    hal_remote_strcpy( XPTR( local_cxy , name_copy ) ,
-                       XPTR( client_cxy , name ) );
-
-    // call the kernel function
-    error = vfs_fs_new_dentry( parent , name_copy , child_xp );
-
-    // set output argument
-    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_FS_NEW_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_NEW_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [17]  RPC_VFS_FS_ADD_DENTRY  deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vfs_fs_add_dentry_client( cxy_t          cxy,
-                                   vfs_inode_t  * parent,     // in
-                                   vfs_dentry_t * dentry,     // in
-                                   error_t      * error )     // out
-{
-#if DEBUG_RPC_VFS_FS_ADD_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_FS_ADD_DENTRY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)parent;
-    rpc.args[1] = (uint64_t)(intptr_t)dentry;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *error   = (error_t)rpc.args[2];
-
-#if DEBUG_RPC_VFS_FS_ADD_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-//////////////////////////////////////////////
-void rpc_vfs_fs_add_dentry_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_FS_ADD_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    error_t        error;
-    vfs_inode_t  * parent;
-    vfs_dentry_t * dentry;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input arguments
-    parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
-
-    // call the kernel function
-    error = vfs_fs_add_dentry( parent , dentry );
-
-    // set output argument
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_FS_ADD_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_ADD_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [18]   RPC_VFS_FS_REMOVE_DENTRY    deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vfs_fs_remove_dentry_client( cxy_t          cxy,
-                                      vfs_inode_t  * parent,     // in
-                                      vfs_dentry_t * dentry,     // in
-                                      error_t      * error )     // out
-{
-#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_FS_REMOVE_DENTRY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)parent;
-    rpc.args[1] = (uint64_t)(intptr_t)dentry;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *error   = (error_t)rpc.args[2];
-
-#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////
-void rpc_vfs_fs_remove_dentry_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    error_t        error;
-    vfs_inode_t  * parent;
-    vfs_dentry_t * dentry;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input arguments
-    parent = (vfs_inode_t*)(intptr_t) hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-    dentry = (vfs_dentry_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[1]));
-
-    // call the kernel function
-    error = vfs_fs_remove_dentry( parent , dentry );
-
-    // set output argument
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_FS_REMOVE_DENTRY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_FS_REMOVE_DENTRY )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [19]   RPC_VFS_INODE_LOAD_ALL_PAGES deprecated [AG] dec 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vfs_inode_load_all_pages_client( cxy_t         cxy,
-                                          vfs_inode_t * inode,      // in
-                                          error_t     * error )     // out
-{
-#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VFS_INODE_LOAD_ALL_PAGES;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)inode;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *error   = (error_t)rpc.args[1];
-
-#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////
-void rpc_vfs_inode_load_all_pages_server( xptr_t xp )
-{
-#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    error_t       error;
-    vfs_inode_t * inode;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input argument
-    inode = (vfs_inode_t*)(intptr_t)hal_remote_l64(XPTR(client_cxy , &desc->args[0]));
-
-    // call the kernel function
-    error = vfs_inode_load_all_pages( inode );
-
-    // set output argument
-    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VFS_INODE_LOAD_ALL_PAGES )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [20]  RPC_VMM_GET_VSEG deprecated [AG] sept 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_vmm_get_vseg_client( cxy_t       cxy,      
-                              process_t * process,     // in  
-                              intptr_t    vaddr,       // in  
-                              xptr_t    * vseg_xp,     // out
-                              error_t   * error )      // out
-{
-#if DEBUG_RPC_VMM_GET_VSEG
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_VMM_GET_VSEG;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_VMM_GET_VSEG
+/////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////
+void rpc_vmm_get_ref_vseg_client( cxy_t       cxy,      
+                                  process_t * process,     // in  
+                                  intptr_t    vaddr,       // in  
+                                  xptr_t    * vseg_xp )    // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_VMM_GET_REF_VSEG;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
@@ -2504,360 +770,743 @@
     rpc.args[1] = (uint64_t)vaddr;
 
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
 
     // get output argument from rpc descriptor
     *vseg_xp = rpc.args[2];
-    *error   = (error_t)rpc.args[3];
-
-#if DEBUG_RPC_VMM_GET_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////
-void rpc_vmm_get_vseg_server( xptr_t xp )
-{
-#if DEBUG_RPC_VMM_GET_VSEG
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
+}
+
+/////////////////////////////////////////////
+void rpc_vmm_get_ref_vseg_server( xptr_t xp )
+{
     process_t   * process;
     intptr_t      vaddr;
     vseg_t      * vseg_ptr;
     xptr_t        vseg_xp;
-    error_t       error;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
 
     // get input argument from client RPC descriptor
-    process = (process_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    vaddr   = (intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
+    process = (process_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+    vaddr   = (intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
     
     // call local kernel function
-    error = vmm_get_vseg( process , vaddr , &vseg_ptr );
-
-    // set output arguments to client RPC descriptor
+    vseg_ptr = vmm_get_vseg( process , vaddr );
+
+    // set output argument to client RPC descriptor
     vseg_xp = XPTR( local_cxy , vseg_ptr );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)error );
-
-#if DEBUG_RPC_VMM_GET_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_VMM_GET_VSEG )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// [22]          RPC_KCM_ALLOC deprecated [AG] sept 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_kcm_alloc_client( cxy_t      cxy,
-                           uint32_t   kmem_type,   // in
-                           xptr_t   * buf_xp )     // out
-{
-#if DEBUG_RPC_KCM_ALLOC
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_ALLOC )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_KCM_ALLOC;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)vseg_xp );
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_VMM_GET_PTE 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////
+void rpc_vmm_get_pte_client( cxy_t       cxy,   
+                             process_t * process,  // in 
+                             vpn_t       vpn,      // in 
+                             uint32_t  * attr,     // out
+                             ppn_t     * ppn,      // out
+                             error_t   * error )   // out 
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_VMM_GET_PTE;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)kmem_type;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
+    rpc.args[0] = (uint64_t)(intptr_t)process;
+    rpc.args[1] = (uint64_t)vpn;
+
+    // register RPC request in remote RPC fifo (blocking function)
+    rpc_send_sync( cxy , &rpc );
+
+    // get output argument from rpc descriptor
+    *attr  = (uint32_t)rpc.args[2];
+    *ppn   = (ppn_t)rpc.args[3];
+    *error = (error_t)rpc.args[4];
+}
+
+////////////////////////////////////////
+void rpc_vmm_get_pte_server( xptr_t xp )
+{
+    process_t   * process;
+    vpn_t         vpn;
+    uint32_t      attr;
+    ppn_t         ppn;
+    error_t       error;
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc        = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input argument "process" & "vpn" from client RPC descriptor
+    process = (process_t *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
+    vpn     = (vpn_t)                hal_remote_lwd( XPTR( client_cxy , &desc->args[1] ) );
+    
+    // call local kernel function
+    error = vmm_get_pte( process , vpn , &attr , &ppn ); 
+
+    // set output argument "attr" & "ppn" to client RPC descriptor
+    hal_remote_swd( XPTR( client_cxy , &desc->args[2] ) , (uint64_t)attr );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)ppn );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_SEMAPHORE_ALLOC 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////
+void rpc_semaphore_alloc_client( cxy_t    cxy,
+                                 xptr_t * sem_xp )     // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_THREAD_USER_CREATE;
+    rpc.response = 1;
+
+    // register RPC request in remote RPC fifo 
+    rpc_send_sync( cxy , &rpc );
 
     // get output arguments from RPC descriptor
-    *buf_xp = (xptr_t)rpc.args[1];
-
-#if DEBUG_RPC_KCM_ALLOC
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_ALLOC )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-//////////////////////////////////////
-void rpc_kcm_alloc_server( xptr_t xp )
-{
-#if DEBUG_RPC_KCM_ALLOC
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_ALLOC )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input argument "kmem_type" from client RPC descriptor
-    uint32_t kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-
-    // allocates memory for kcm
+    *sem_xp = (xptr_t)rpc.args[0];
+}
+
+////////////////////////////////////////////
+void rpc_semaphore_alloc_server( xptr_t xp )
+{
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // allocates memory for semaphore
     kmem_req_t  req;
-    req.type  = kmem_type;
+    req.type  = KMEM_SEM;
     req.flags = AF_ZERO;
-    void * buf_ptr = kmem_alloc( &req );
+    remote_sem_t * sem_ptr = kmem_alloc( &req );
 
     // set output argument
-    xptr_t buf_xp = XPTR( local_cxy , buf_ptr );
-    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)buf_xp );
-
-#if DEBUG_RPC_KCM_ALLOC
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_ALLOC )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
+    xptr_t sem_xp = XPTR( local_cxy , sem_ptr );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[0] ) , (uint64_t)sem_xp );
 }   
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [23]          RPC_KCM_FREE deprecated [AG] sept 2019
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_kcm_free_client( cxy_t      cxy,
-                          void     * buf,          // in
-                          uint32_t   kmem_type )   // in
-{
-#if DEBUG_RPC_KCM_FREE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_FREE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_KCM_FREE;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+//               Marshaling functions attached to RPC_SEMAPHORE_FREE 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////
+void rpc_semaphore_free_client( cxy_t          cxy,
+                                remote_sem_t * sem )   // in
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_THREAD_USER_CREATE;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)(intptr_t)buf;
-    rpc.args[1] = (uint64_t)kmem_type;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-#if DEBUG_RPC_KCM_FREE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_FREE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-/////////////////////////////////////
-void rpc_kcm_free_server( xptr_t xp )
-{
-#if DEBUG_RPC_KCM_FREE
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_FREE )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get input arguments "buf" and "kmem_type" from client RPC descriptor
-    void     * buf = (void *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-    uint32_t   kmem_type = (uint32_t)hal_remote_l64( XPTR( client_cxy , &desc->args[1] ) );
+    rpc.args[0] = (uint64_t)(intptr_t)sem;
+
+    // register RPC request in remote RPC fifo 
+    rpc_send_sync( cxy , &rpc );
+}
+
+///////////////////////////////////////////
+void rpc_semaphore_free_server( xptr_t xp )
+{
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input argument "sem_ptr" from client RPC descriptor
+    void * sem = (void *)(intptr_t)hal_remote_lwd( XPTR( client_cxy , &desc->args[0] ) );
 
     // releases memory
     kmem_req_t  req;
-    req.type = kmem_type;
-    req.ptr  = buf;
-    kmem_free( &req );
-
-#if DEBUG_RPC_KCM_FREE
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_KCM_FREE )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
+    req.type = KMEM_SEM;
+    req.ptr  = sem;
+    kmem_free(&req);
 }   
 
 /////////////////////////////////////////////////////////////////////////////////////////
-// [24]          Marshaling functions attached to RPC_MAPPER_SYNC 
-/////////////////////////////////////////////////////////////////////////////////////////
-void rpc_mapper_sync_client( cxy_t             cxy,
-                             struct mapper_s * mapper,
-                             error_t         * error )
-{
-#if DEBUG_RPC_MAPPER_SYNC
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_MAPPER_SYNC )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    uint32_t responses = 1;
-
-    // initialise RPC descriptor header 
-    rpc_desc_t  rpc;
-    rpc.index    = RPC_MAPPER_SYNC;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
+//               Marshaling functions attached to RPC_MAPPER_MOVE
+/////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////
+void rpc_mapper_move_client( cxy_t        cxy,
+                             mapper_t   * mapper,      // in
+                             bool_t       read,        // in
+                             uint32_t     nb_frags,    // in
+                             fragment_t * frags,       // in
+                             error_t    * error )      // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_MAPPER_MOVE;
+    rpc.response = 1;
 
     // set input arguments in RPC descriptor 
     rpc.args[0] = (uint64_t)(intptr_t)mapper;
-
-    // register RPC request in remote RPC fifo
-    rpc_send( cxy , &rpc );
-
-    // get output values from RPC descriptor
-    *error   = (error_t)rpc.args[1];
-
-#if DEBUG_RPC_MAPPER_SYNC
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_MAPPER_SYNC )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
+    rpc.args[1] = (uint64_t)read;
+    rpc.args[2] = (uint64_t)nb_frags;
+    rpc.args[3] = (uint64_t)(intptr_t)frags;
+
+    // register RPC request in remote RPC fifo 
+    rpc_send_sync( cxy , &rpc );
+
+    // get output argument from rpc descriptor
+    *error = (error_t)rpc.args[4];
 }
 
 ////////////////////////////////////////
-void rpc_mapper_sync_server( xptr_t xp )
-{
-#if DEBUG_RPC_MAPPER_SYNC
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_MAPPER_SYNC )
-printk("\n[%s] thread[%x,%x] on core %d enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-
-    mapper_t * mapper;
+void rpc_mapper_move_server( xptr_t xp )
+{
+    mapper_t    * mapper;
+    bool_t        read;
+    uint32_t      nb;
+    void        * frags;
+    error_t       error;
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input arguments
+    mapper = (mapper_t*)(intptr_t)hal_remote_lpt( XPTR( client_cxy , &desc->args[0] ) );
+    read   = (bool_t)             hal_remote_lw ( XPTR( client_cxy , &desc->args[1] ) );
+    nb     = (uint32_t)           hal_remote_lw ( XPTR( client_cxy , &desc->args[2] ) );
+    frags  = (void*)(intptr_t)    hal_remote_lpt( XPTR( client_cxy , &desc->args[3] ) );
+
+    // call the mapper_move_fragments() function
+    error = mapper_move_fragments( mapper , read , nb , XPTR( client_cxy , frags ) );
+
+    // set output argument
+    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_ICU_WTI_ALLOC 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////
+void rpc_icu_wti_alloc_client( cxy_t      cxy,
+                               uint32_t * wti_id )    // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_ICU_WTI_ALLOC;
+    rpc.response = 1;
+
+    // register RPC request in remote RPC fifo 
+    rpc_send_sync( cxy , &rpc );
+
+    // get output argument from rpc descriptor
+    *wti_id = (uint32_t)rpc.args[0];
+}
+
+//////////////////////////////////////////
+void rpc_icu_wti_alloc_server( xptr_t xp )
+{
+    uint32_t      wti_id;
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // call icu_wti_alloc() function
+    wti_id = dev_icu_wti_alloc();
+
+    // set output argument
+    hal_remote_swd( XPTR( client_cxy , &desc->args[0] ) , (uint64_t)wti_id);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_DEVICE_ALLOC 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////
+void rpc_device_alloc_client( cxy_t     cxy,
+                              xptr_t  * dev_xp,      // out
+                              error_t * error )      // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_DEVICE_ALLOC;
+    rpc.response = 1;
+
+    // register RPC request in remote RPC fifo 
+    rpc_send_sync( cxy , &rpc );
+
+    // get output argument from rpc descriptor
+    *dev_xp = (xptr_t)rpc.args[0];
+    *error  = (error_t)rpc.args[1];
+}    
+
+/////////////////////////////////////////
+void rpc_device_alloc_server( xptr_t xp )
+{
+    error_t      error;
+    kmem_req_t   req;
+    device_t   * dev_ptr;  
+    xptr_t       dev_xp;
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // allocate memory for a device descriptor
+    req.type   = KMEM_DEVICE;
+    req.flags  = AF_ZERO;
+    dev_ptr    = (device_t *)kmem_alloc( &req );
+
+    // set output arguments
+    error  = ( dev_ptr == NULL );
+    dev_xp = XPTR( local_cxy , dev_ptr );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[0] ) , (uint64_t)dev_xp );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////////////
+//               Marshaling functions attached to RPC_FATFS_GET_CLUSTER 
+/////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////
+void rpc_fatfs_get_cluster_client( cxy_t      cxy,
+                                   mapper_t * mapper,    // in
+                                   uint32_t   first,     // in
+                                   uint32_t   page,      // in
+                                   uint32_t * cluster,   // out
+                                   error_t  * error )    // out
+{
+    // RPC must be remote
+    if( cxy == local_cxy ) 
+    {
+        printk("PANIC in %s : target is not remote\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialise RPC descriptor header 
+    rpc_desc_t  rpc;
+    rpc.index    = RPC_FATFS_GET_CLUSTER;
+    rpc.response = 1;
+
+    // set input arguments in RPC descriptor 
+    rpc.args[0] = (uint64_t)(intptr_t)mapper;
+    rpc.args[1] = (uint64_t)first;
+    rpc.args[2] = (uint64_t)page;
+
+    // register RPC request in remote RPC fifo 
+    rpc_send_sync( cxy , &rpc );
+
+    // get output argument from rpc descriptor
+    *cluster = (uint32_t)rpc.args[3];
+    *error   = (error_t)rpc.args[4];
+}
+
+//////////////////////////////////////////////
+void rpc_fatfs_get_cluster_server( xptr_t xp )
+{
+    mapper_t    * mapper;
+    uint32_t      first;
+    uint32_t      page;
+    uint32_t      cluster;
+    error_t       error;
+
+    // get client cluster identifier and pointer on RPC descriptor
+    cxy_t        client_cxy  = (cxy_t)GET_CXY( xp );
+    rpc_desc_t * desc = (rpc_desc_t *)GET_PTR( xp );
+
+    // get input arguments
+    mapper = (mapper_t*)(intptr_t)hal_remote_lpt( XPTR( client_cxy , &desc->args[0] ) );
+    first  = (uint32_t)           hal_remote_lw ( XPTR( client_cxy , &desc->args[1] ) );
+    page   = (uint32_t)           hal_remote_lw ( XPTR( client_cxy , &desc->args[2] ) );
+
+    // call the kernel function
+    error = fatfs_get_cluster( mapper , first , page , &cluster );
+
+    // set output argument
+    hal_remote_swd( XPTR( client_cxy , &desc->args[3] ) , (uint64_t)cluster );
+    hal_remote_swd( XPTR( client_cxy , &desc->args[4] ) , (uint64_t)error );
+}
+
+/***************************************************************************************/
+/************ Generic functions supporting RPCs : client side **************************/
+/***************************************************************************************/
+
+////////////////////////////////////////////
+void rpc_send_sync( cxy_t        server_cxy, 
+                    rpc_desc_t * rpc )
+{
+	thread_t * this = CURRENT_THREAD;
+    uint32_t   cores;
     error_t    error;
-
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy  = GET_CXY( xp );
-    rpc_desc_t * desc        = GET_PTR( xp );
-
-    // get arguments from client RPC descriptor
-    mapper  = (mapper_t *)(intptr_t)hal_remote_l64( XPTR( client_cxy , &desc->args[0] ) );
-
-    // call local kernel function
-    error = mapper_sync( mapper );
-
-    // set output argument to client RPC descriptor
-    hal_remote_s64( XPTR( client_cxy , &desc->args[1] ) , (uint64_t)error );
-
-#if DEBUG_RPC_MAPPER_SYNC
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_RPC_MAPPER_SYNC )
-printk("\n[%s] thread[%x,%x] on core %d exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid , cycle );
-#endif
-}
-
-*/
-
-
-
-/*
+    bool_t     first;
+    reg_t      sr_save;
+
+    // get client CPU and cluster coordinates
+    cxy_t      client_cxy = local_cxy;   
+    lid_t      client_lid = CURRENT_CORE->lid;
+
+    // allocate and initialise an extended pointer on the RPC descriptor
+	xptr_t   xp = XPTR( client_cxy , rpc );
+
+    // get local pointer on rpc_fifo in remote cluster with the 
+    // assumption that addresses are identical in all clusters
+    rpc_fifo_t * rf = &LOCAL_CLUSTER->rpc_fifo;
+
+	// try to post an item in remote fifo
+    // deschedule and retry if remote fifo full
+    do
+    { 
+        error = remote_fifo_put_item( XPTR( server_cxy , &rf->fifo ),
+                                      (void *)&xp,
+                                      sizeof(xptr_t), 
+                                      &first );
+
+	    if ( error ) 
+        {
+            printk("\n[WARNING] %s : core %d in cluster %x cannot post RPC to cluster %x\n",
+                   __FUNCTION__ , client_lid , client_cxy , server_cxy );
+            if( thread_can_yield() ) sched_yield();
+        }
+    }
+    while( error );
+ 
+    rpc_dmsg("\n[INFO] %s on core %d in cluster %x sent RPC %p to cluster %x\n", 
+              __FUNCTION__ , client_lid , client_cxy , rpc , server_cxy );
+	
+    // send IPI if this is the first RPC in remote FIFO
+    // and no CPU is in kernel mode in server cluster.
+    // the selected CPU in server has the same lid as the client CPU.
+	if( first )
+	{
+        // get number of cores in kernel mode in server cluster
+        cores = hal_remote_lw( XPTR( server_cxy , &LOCAL_CLUSTER->cores_in_kernel ) );
+
+		if( cores == 0 ) // no core in kernel mode in server
+		{
+		    dev_icu_send_ipi( server_cxy , client_lid );
+
+		    rpc_dmsg("\n[INFO] %s : core %d in cluster %x send IPI to core %d in cluster %x\n",
+                      __FUNCTION__, client_lid , client_cxy , client_lid , server_cxy );
+        }
+	}
+
+	// activate preemption to allow incoming RPC and avoid deadlock
+	if( this->type == THREAD_RPC ) hal_enable_irq( &sr_save );
+
+    // the sending thread poll the response slot until RPC completed
+	while( 1 )
+    {
+        if( rpc->response == 0 ) break;
+    }
+
+    // restore preemption
+	if( this->type == THREAD_RPC ) hal_restore_irq( sr_save );
+
+}  // end rpc_send_sync()
+
+
+
+/***************************************************************************************/
+/************ Generic functions supporting RPCs : server side **************************/
+/***************************************************************************************/
+
+///////////////////////////////////////////
+void rpc_fifo_init( rpc_fifo_t * rpc_fifo )
+{
+	rpc_fifo->count       = 0;
+	rpc_fifo->owner       = 0;
+	local_fifo_init( &rpc_fifo->fifo );
+}
+
+////////////////////////////////////////////////
+error_t rpc_execute_all( rpc_fifo_t * rpc_fifo )
+{
+	xptr_t         xp;             // extended pointer on RPC descriptor
+	uint32_t       count;          // handled RPC request counter
+	thread_t     * this;           // pointer on this RPC thread
+    core_t       * core;           // pointer on core running this thread
+    rpc_desc_t   * desc;           // pointer on RPC descriptor 
+    uint32_t       index;          // RPC index 
+    uint32_t       expected;       // number of expected responses 
+    cxy_t          client_cxy;     // client cluster identifier
+	error_t        error;
+      
+	this = CURRENT_THREAD; 
+    core = this->core;   
+
+
+    // handle up to CONFIG_RPC_PENDING_MAX requests before exit
+	count = 0;
+	do
+    {
+	    error = local_fifo_get_item( &rpc_fifo->fifo, 
+                                     &xp,
+                                     sizeof(xptr_t) );
+
+		if ( error == 0 )  // One RPC request successfully extracted from RPC_FIFO
+        {
+            rpc_dmsg("\n[INFO] %s : RPC_THREAD %x on core %x in cluster %x handles RPC %d\n"
+				     __FUNCTION__ , this->trdid , core->lid , local_cxy , count );
+
+            // get client cluster identifier and pointer on RPC descriptor
+            client_cxy = (cxy_t)GET_CXY( xp );
+            desc       = (rpc_desc_t *)GET_PTR( xp );
+
+            // get rpc index and expected responses from RPC descriptor
+	        index     = hal_remote_lw( XPTR( client_cxy , &desc->index ) );
+	        expected  = hal_remote_lw( XPTR( client_cxy , &desc->response ) );
+
+            // call the relevant server function
+            rpc_server[index]( xp );
+
+            // increment handled RPC counter
+  	        count++;
+
+            // notify RPC completion as required
+            if( expected == 1 ) hal_remote_sw( XPTR(client_cxy,&desc->response) , 0 );
+            if( expected >  1 ) hal_remote_atomic_add( XPTR(client_cxy,&desc->response) , -1 );
+		}
+	
+		// exit loop in three cases:
+        // - fifo is empty
+        // - look has been released (because descheduling)
+        // - max number of RPCs has been reached
+		if( error || 
+            (rpc_fifo->owner != this->trdid) || 
+            (count > CONFIG_RPC_PENDING_MAX) ) break;
+	}
+    while( 1 )
+
+	rpc_dmsg("\n[INFO] %s running on core %d in cluster %x exit\n"
+              __FUNCTION__ , CURRENT_CORE->lid , local_cxy );
+		
+    // update RPC_FIFO global counter
+	rpc_fifo->count += count;
+
+	return 0;
+}  // end rpc_execute_all()
+
 ////////////////////////////////////////////////////
-void rpc_fbf_display_client( cxy_t        cxy,
-                             xptr_t       window_xp,
-                             uint32_t     cores,
-                             error_t    * error )
-{
-#if DEBUG_RPC_FBF_DISPLAY
-uint32_t  cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_RPC_FBF_DISPLAY < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    uint32_t    responses = 1;
-    rpc_desc_t  rpc;
-
-    // initialise RPC descriptor header 
-    rpc.index    = RPC_FBF_DISPLAY;
-    rpc.blocking = true;
-    rpc.rsp      = &responses;
-
-    // set input arguments in RPC descriptor 
-    rpc.args[0] = (uint64_t)window_xp;
-    rpc.args[1] = (uint64_t)cores;
-
-    // register RPC request in remote RPC fifo 
-    rpc_send( cxy , &rpc );
-
-    // get output argument from RPC descriptor
-    *error     = (error_t)rpc.args[2];
-
-#if DEBUG_RPC_FBF_DISPLAY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_FBF_DISPLAY < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-}
-
-////////////////////////////////////////
-void rpc_fbf_display_server( xptr_t xp )
-{
-    // get client cluster identifier and pointer on RPC descriptor
-    cxy_t        client_cxy = GET_CXY( xp );
-    rpc_desc_t * desc       = GET_PTR( xp );
-
-    // get arguments from RPC descriptor
-    xptr_t   window_xp = (xptr_t  )hal_remote_l64( XPTR(client_cxy , &desc->args[0]) );
-    uint32_t ncores    = (uint32_t)hal_remote_l64( XPTR(client_cxy , &desc->args[1]) );
-
-#if DEBUG_RPC_FBF_DISPLAY
-uint32_t cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_RPC_FBF_DISPLAY < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-
-    // call relevant kernel function 
-    error_t error = dev_fbf_parallel_display( window_xp , ncores );
-
-    // WARNING : for parallel RPCs, the return error argument is shared
-    hal_remote_atomic_or( XPTR( client_cxy , &desc->args[2] ) , error );
-
-#if DEBUG_RPC_FBF_DISPLAY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_RPC_FBF_DISPLAY < cycle )
-printk("\n[%s] thread[%x,%x] on core %d : exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, this->core->lid, cycle );
-#endif
-} 
-*/
-
-
+error_t rpc_activate_thread( rpc_fifo_t * rpc_fifo )
+{
+	core_t      * core;
+	thread_t    * thread;
+	thread_t    * this;
+    scheduler_t * sched;
+	error_t       error;
+    bool_t        found;
+    reg_t         sr_save;
+
+	this   = CURRENT_THREAD;
+    core   = this->core;
+    sched  = &core->scheduler;
+    found  = false;
+
+    // calling thread must be the RPC_FIFO owner
+    if( this->trdid != rpc_fifo->owner )
+    {
+        printk("\n[PANIC] in %s : calling thread is not RPC_FIFO owner\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // makes the calling thread not preemptable
+    // during activation / creation of the RPC thread
+	hal_disable_irq( &sr_save );
+
+    // search a free RPC thread (must be in THREAD_BLOCKED_IDLE state)    
+    list_entry_t * iter;
+    LIST_FOREACH( &sched->k_root , iter )
+    {
+        thread = LIST_ELEMENT( iter , thread_t , sched_list );
+        if( (thread->type == THREAD_RPC) && (thread->blocked ==  THREAD_BLOCKED_IDLE ) ) 
+        {
+            found = true;
+            break;
+        }
+    }
+
+    if( found )                    // activate this idle RPC thread      
+    {
+        thread->blocked = 0;
+    }
+    else                           // create a new RPC thread
+    {
+        error = thread_kernel_create( &thread,
+                                      THREAD_RPC, 
+			                          &rpc_thread_func, 
+                                      NULL,
+			                          core->lid );
+	    if( error ) 
+        {
+	        hal_restore_irq( sr_save );
+            printk("\n[ERROR] in %s : no memory for new RPC thread in cluster %x\n",
+                   __FUNCTION__ , local_cxy );
+            return ENOMEM;
+        }
+
+        rpc_dmsg("\n[INFO] %s creates RPC thread %x on core %x in cluster %x at cycle %d\n", 
+		          __FUNCTION__ , thread , core->gid , local_cxy , hal_time_stamp() );
+
+        // update core descriptor counter  
+	    core->rpc_threads++;
+    }
+
+    // update owner in rpc_fifo
+    rpc_fifo->owner = thread->trdid;
+
+    rpc_dmsg ("\n[INFO] %s activates RPC thread %x on core %x in cluster %x at cycle %d\n",
+		      __FUNCTION__ , thread , core->gid , local_cxy , hal_time_stamp() );
+
+    // current thread deschedules / RPC thread start execution 
+	sched_switch_to( thread );
+
+    // restore IRQs for the calling thread 
+	hal_restore_irq( sr_save );
+
+    // return success
+	return 0;
+
+}  // end rpc_activate_thread()
+
+//////////////////
+bool_t rpc_check()
+{
+	thread_t   * this     = CURRENT_THREAD;
+	rpc_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
+    error_t      error;
+
+    // do nothing if light lock already taken or FIFO empty  
+	if( (rpc_fifo->owner != 0) || (local_fifo_is_empty( &rpc_fifo->fifo )) )
+    {
+        return false;
+    }
+
+	// The calling thread try to take the light lock,
+    // and activate an RPC thread if success
+    if( hal_atomic_test_set( &rpc_fifo->owner , this->trdid ) )
+	{
+        error = rpc_activate_thread( rpc_fifo );
+
+        if( error )    // cannot activate an RPC_THREAD 
+        {
+            rpc_fifo->owner = 0;
+
+            printk("\n[ERROR] in %s : no memory to create a RPC thread for core %d"
+                   " in cluster %x => do nothing\n",
+                   __FUNCTION__ , CURRENT_CORE->lid , local_cxy );
+        }
+
+        return true;
+    }
+    else  // light lock taken by another thread
+    {
+        return false;
+    }
+} // end __rpc_check()
+
+
+//////////////////////
+void rpc_thread_func()
+{
+    // makes the calling thread not preemptable
+	hal_disable_irq( NULL );
+  
+	thread_t   * this     = CURRENT_THREAD;
+	rpc_fifo_t * rpc_fifo = &LOCAL_CLUSTER->rpc_fifo;
+
+    rpc_dmsg("\n[INFO] RPC thread %x created on core %d in cluster %x at cycle %d\n",
+             this->trdid , this->core->lid , local_cxy , hal_time_stamp() );
+
+    // this infinite loop is not preemptable
+    // the RPC thread deschedule when the RPC_FIFO is empty
+	while(1)
+	{
+        // check fifo ownership (ownership should be given by rpc_activate()
+        if( this->trdid != rpc_fifo->owner )
+        {
+            printk("\n[PANIC] in %s : RPC_THREAD %x not owner of RPC_FIFO in cluster %x\n",
+                   __FUNCTION__ , this->trdid , local_cxy );
+            hal_core_sleep();
+        }
+ 
+        // executes pending RPC(s) 
+        rpc_execute_all( rpc_fifo );
+
+        // release rpc_fifo ownership (can be lost during RPC execution)
+        if( rpc_fifo->owner == this->trdid ) rpc_fifo->owner = 0;
+
+
+        // suicide if too much RPC threads for this core
+		if( this->core->rpc_threads > CONFIG_RPC_THREADS_MAX ) 
+		{
+            rpc_dmsg("\n[INFO] RPC thread %x suicide on core %d in cluster %x at cycle %d\n", 
+		             this->trdid , this->core->lid , local_cxy , hal_time_stamp() );
+
+            // update core descriptor counter
+			this->core->rpc_threads--;
+
+            // suicide
+			thread_exit();
+		}
+
+        // block and deschedule
+        rpc_dmsg("\n[INFO] RPC thread %x deschedule on core %d in cluster %x at cycle %d\n", 
+			      this->trdid , this->core->lid , local_cxy , hal_time_stamp() ); 
+
+		thread_block( this , THREAD_BLOCKED_IDLE );
+        sched_yield();
+
+		rpc_dmsg("\n[INFO] RPC thread %x wake up on core %d in cluster %x at cycle %d\n", 
+			      this->trdid , this->core->lid , local_cxy , hal_time_stamp() );
+	}
+} // end rpc_thread_func()
+
Index: trunk/kernel/kern/rpc.h
===================================================================
--- trunk/kernel/kern/rpc.h	(revision 690)
+++ trunk/kernel/kern/rpc.h	(revision 1)
@@ -2,5 +2,6 @@
  * rpc.h - RPC (Remote Procedure Call) operations definition.
  *
- * Author  Alain Greiner (2016,2017,2018,2019,2020)
+ * Authors Mohamed Karaoui (2015)
+ *         Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,9 +26,9 @@
 #define _RPC_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_atomic.h>
 #include <bits.h>
-#include <vseg.h>
+#include <spinlock.h>
 #include <remote_fifo.h>
 
@@ -35,18 +36,14 @@
 
 struct process_s;
-struct page_s;
 struct vseg_s;
 struct exec_info_s;
 struct pthread_attr_s;
 struct remote_sem_s;
-struct user_dir_s;
 struct fragment_s;
 struct vfs_inode_s;
 struct vfs_dentry_s;
-struct vfs_file_s;
 struct thread_s;
 struct mapper_s;
 
-
 /**********************************************************************************/
 /**************  structures for Remote Procedure Calls ****************************/
@@ -55,32 +52,32 @@
 /***********************************************************************************
  * This enum defines all RPC indexes.
- * It must be consistent with the rpc_server[] arrays defined in in the rpc.c file.
+ * It must be consistent with the rpc_server[] array defined in in the rpc.c file.
  **********************************************************************************/
 
 typedef enum
 {
-    RPC_UNDEFINED_0               = 0,   //
-    RPC_UNDEFINED_1               = 1,   //
-    RPC_UNDEFINED_2               = 2,   //      
-    RPC_PROCESS_MAKE_FORK         = 3,
-    RPC_USER_DIR_CREATE           = 4,
-    RPC_USER_DIR_DESTROY          = 5,
-    RPC_THREAD_USER_CREATE        = 6,
-    RPC_THREAD_KERNEL_CREATE      = 7,
-    RPC_UNDEFINED_8               = 8,
-    RPC_PROCESS_SIGACTION         = 9,
-
-    RPC_UNDEFINED_10              = 10,   //
-    RPC_UNDEFINED_11              = 11,   //
-    RPC_UNDEFINED_12              = 12,   // 
-    RPC_UNDEFINED_13              = 13,   //
-    RPC_UNDEFINED_14              = 14,   //
-    RPC_VMM_RESIZE_VSEG           = 15,
-    RPC_VMM_REMOVE_VSEG           = 16,
-    RPC_VMM_CREATE_VSEG           = 17,
-    RPC_VMM_SET_COW               = 18,
-    RPC_UNDEFINED_19              = 19,   //
-
-    RPC_MAX_INDEX                 = 20,
+    RPC_PMEM_GET_PAGES         = 0,
+    RPC_PROCESS_PID_ALLOC      = 1,
+    RPC_PROCESS_EXEC           = 2,
+    RPC_PROCESS_KILL           = 3,
+    RPC_THREAD_USER_CREATE     = 4,
+    RPC_THREAD_KERNEL_CREATE   = 5,
+	RPC_ICU_WTI_ALLOC          = 6,
+    RPC_DEVICE_ALLOC           = 7,
+
+    RPC_VFS_INODE_CREATE       = 10,
+    RPC_VFS_INODE_DESTROY      = 11,
+    RPC_VFS_DENTRY_CREATE      = 12,
+    RPC_VFS_DENTRY_DESTROY     = 13,
+
+    RPC_VMM_GET_REF_VSEG       = 20,
+    RPC_VMM_GET_PTE            = 21,
+    RPC_SEMAPHORE_ALLOC        = 22,
+    RPC_SEMAPHORE_FREE         = 23,
+    RPC_MAPPER_MOVE            = 24,
+
+    RPC_FATFS_GET_CLUSTER      = 30,
+
+    RPC_MAX_INDEX              = 31,
 }
 rpc_index_t;
@@ -94,18 +91,33 @@
 
 /***********************************************************************************
- *  This structure defines the RPC descriptor (100 bytes on a 32bits core)
+ *  This structure defines the RPC descriptor
  **********************************************************************************/
 
 typedef struct rpc_desc_s
 {
-	rpc_index_t         index;       /*! index of requested RPC service      ( 4) */
-	uint32_t          * rsp;         /*! local pointer ond responses counter ( 4) */
-    struct thread_s   * thread;      /*! local pointer on client thread      ( 4) */
-    uint32_t            lid;         /*! index of core running client thread ( 4) */ 
-    bool_t              blocking;    /*! simple RPC mode when true           ( 4) */
-    uint64_t            args[10];    /*! input/output arguments buffer       (80) */
+	rpc_index_t       index;       // index of requested RPC service
+	volatile uint32_t response;    // response valid when 0
+    uint64_t          args[8];     // input/output arguments buffer
 } 
 rpc_desc_t;
 
+/***********************************************************************************
+ * This structure defines the RPC fifo, containing a remote_fifo, the owner RPC
+ * thread TRDID (used as a light lock), and the intrumentation counter.
+ *
+ * Implementation note: the TRDID is a good owner identifier, because all
+ * RPC threads in a given cluster belong to the same process_zero kernel process,
+ * and RPC threads cannot have local index LTID = 0.
+ **********************************************************************************/
+
+typedef struct rpc_fifo_s
+{
+	trdid_t           owner;       // owner thread / 0 if no owner
+	uint64_t          count;       // total number of received RPCs (instrumentation) 
+	remote_fifo_t     fifo;        // embedded remote fifo
+} 
+rpc_fifo_t;
+
+
 /**********************************************************************************/
 /******* Generic functions supporting RPCs : client side **************************/
@@ -113,22 +125,16 @@
 
 /***********************************************************************************
- * This function is executed by the client thread in the client cluster. 
- * It puts one RPC descriptor defined by the <desc> argument in the remote fifo
- * defined by the <cxy> argument.  It sends an IPI to the server if fifo is empty.
- * The RPC descriptor must be allocated in the caller's stack, and initialised by
- * the caller. It exit with a Panic message if remote fifo is still full after 
- * (CONFIG_RPC_PUT_MAX_ITERATIONS) retries. 
- * - When the RPC <blocking> field is true, this function blocks and deschedule
- *   the client thread. It returns only when the server completes the RPC and
- *   unblocks the client thread.
- * - When the <blocking> field is false, this function returns as soon as the RPC
- *   has been registered in the FIFO, and the client thread must block itself when
- *   all RPCS have been registered in all target clusters.
+ * This blocking function executes on the client core. 
+ * It puts one RPC extended pointer in the remote fifo. 
+ * It sends an IPI if fifo is empty, and waits until RPC response available.
+ * The RPC descriptor must be allocated in the caller's stack
+ * and initialised by the caller.  Exit with a Panic message if remote fifo 
+ * is still full after (CONFIG_RPC_PUT_MAX_ITERATIONS) retries.
  ***********************************************************************************
  * @ cxy   : server cluster identifier
  * @ desc  : local pointer on RPC descriptor in client cluster
  **********************************************************************************/
-void rpc_send( cxy_t        cxy,    
-               rpc_desc_t * desc );
+void rpc_send_sync( cxy_t        cxy,    
+                    rpc_desc_t * desc );
 
 
@@ -139,23 +145,52 @@
 
 /***********************************************************************************
- * This function contains the infinite loop executed by a RPC server thread,
- * to handle pending RPCs registered in the RPC fifo attached to a given core.
- * In each iteration in this loop, it try to handle one RPC request:
- * - it tries to take the RPC FIFO ownership,
- * - it consumes one request when the FIFO is not empty,
- * - it releases the FIFO ownership,
- * - it execute the requested service,
- * - it unblock and send an IPI to the client thread,
- * - it suicides if the number of RPC threads for this core is to large,
- * - it block on IDLE and deschedule otherwise.  
- **********************************************************************************/
-void rpc_server_func( void );
+ * This function initialises the local RPC fifo and the lock protecting readers.
+ * The number of slots is defined by the CONFIG_REMOTE_FIFO_SLOTS parameter.
+ * Each slot contains an extended pointer on the RPC descriptor.
+ ***********************************************************************************
+ * @ rf     : pointer on the local RPC fifo.
+ **********************************************************************************/ 
+void rpc_fifo_init( rpc_fifo_t * rf );
+
+/***********************************************************************************
+ * This function is the entry point for RPC handling on the server side.
+ * It can be executed by any thread running (in kernel mode) on any core.
+ * It first checks the core private RPC fifo, an then the cluster shared RPC fifo.
+ * It calls the rpc_activate_thread() function to activate a dedicated RPC thread.
+ ***********************************************************************************
+ * @ returns true if at least one RPC found / false otherwise.
+ **********************************************************************************/
+bool_t rpc_check();
+
+/***********************************************************************************
+ * This function contains the loop to execute all pending RPCs on the server side.
+ * It should be called with irq disabled and after light lock acquisition.
+ ***********************************************************************************
+ * @ rpc_fifo  : pointer on the local RPC fifo
+ * @ returns 0 if success
+ **********************************************************************************/
+error_t rpc_execute_all( rpc_fifo_t * rpc_fifo );
+
+/**********************************************************************************
+ * This function is called by any thread running on any core in any cluster,
+ * that detected a non-empty RPC_FIFO and got the RPC_FIFO ownership.
+ * It activates one RPC thread, and immediately switches to the RPC thread.
+ * It gets the first free RPC thread from the core free-list, or creates a new one
+ * when the core free-list is empty. 
+ ***********************************************************************************
+ * @ rpc_fifo : pointer on the non-empty RPC fifo.
+ * @ return 0 if success / return ENOMEM if error.
+ **********************************************************************************/
+error_t rpc_activate_thread( rpc_fifo_t * rpc_fifo );
+
+/***********************************************************************************
+ * This function contains the infinite loop executed by each RPC thread.
+ **********************************************************************************/
+void rpc_thread_func();
 
 /***********************************************************************************
  * This function is executed in case of illegal RPC index.
  **********************************************************************************/
-void __attribute__((noinline)) rpc_undefined( xptr_t xp __attribute__ ((unused)) );
-
-
+void __attribute__((noinline)) rpc_undefined();
 
 /**********************************************************************************/
@@ -164,89 +199,73 @@
 
 /***********************************************************************************
- * [0] undefined
- **********************************************************************************/
-
-/***********************************************************************************
- * [1] undefined
- **********************************************************************************/
-
-/***********************************************************************************
- * [2] undefined
- **********************************************************************************/
-
-/***********************************************************************************
- * [3] The RPC_PROCESS_MAKE_FORK creates a "child" process descriptor, and the
- * associated "child" thread descriptor in a target remote cluster that can be 
- * any cluster.  The child process is initialized from informations found in the 
- * "parent" process descriptor (that must be the parent reference cluster),
- * and from the "parent" thread descriptor that can be in any cluster.
- ***********************************************************************************
- * @ cxy              : server cluster identifier.
- * @ ref_process_xp   : [in]  extended pointer on reference parent process.
- * @ parent_thread_xp : [in]  extended pointer on parent thread.
- * @ child_pid        : [out] child process identifier.
- * @ child_thread_ptr : [out] local pointer on child thread.
- * @ error            : [out]  error status (0 if success).
- **********************************************************************************/
-void rpc_process_make_fork_client( cxy_t              cxy,
-                                   xptr_t             ref_process_xp,
-                                   xptr_t             parent_thread_xp,
-                                   pid_t            * child_pid,
-                                   struct thread_s ** child_thread_ptr,
-                                   error_t          * error );
-
-void rpc_process_make_fork_server( xptr_t xp );
-
-/***********************************************************************************
- * [4] The RPC_USER_DIR_CREATE allows a client thread to create an user_dir_t
- * structure and the associated array of dirents in a remote cluster containing
- * the target directory <inode>. It creates an ANON vseg in the user reference 
- * process VMM identified by the <ref_xp>. This reference cluster cluster can be
- * different from both the client and server clusters.
- * It is called by the sys_opendir() function.
- ***********************************************************************************
- * @ cxy        : server cluster identifier.
- * @ inode      : [in]   local pointer on inode in server cluster.
- * @ ref_xp     : [in]   extended pointer on user reference process descriptor.
- * @ dir        : [out]  local pointer on created user_dir structure.
- **********************************************************************************/
-void rpc_user_dir_create_client( cxy_t                 cxy,
-                                 struct vfs_inode_s  * inode,
-                                 xptr_t                ref_xp,
-                                 struct user_dir_s  ** dir );
-
-void rpc_user_dir_create_server( xptr_t xp );
-
-/***********************************************************************************
- * [5] The RPC_USER_DIR_DESTROY allows a client thread to delete an user_dir_t
- * structure and the associated array of dirents in a remote cluster containing
- * the target directory inode. It is called by the sys_closedir() function.
- ***********************************************************************************
- * @ cxy        : server cluster identifier.
- * @ dir        : [in]  local pointer on created user_dir structure.
- * @ ref_xp     : [in]   extended pointer on user reference process descriptor.
- **********************************************************************************/
-void rpc_user_dir_destroy_client( cxy_t               cxy,
-                                  struct user_dir_s * dir,
-                                  xptr_t              ref_xp );
-
-void rpc_user_dir_destroy_server( xptr_t xp );
-
-/***********************************************************************************
- * [6] The RPC_THREAD_USER_CREATE creates an user thread in the server cluster,
- * as specified by the arguments. It returns an extended pointer on the new
- * thread descriptor in server cluster, and an error code.
- * It is called by the sys_thread_create() system call.
+ * The RPC_PMEM_GET_PAGES allocates one or several pages in a remote cluster,
+ * and returns the PPN of the first allocated page.
+ ***********************************************************************************
+ * @ cxy     : server cluster identifier
+ * @ order   : [in]  ln2( number of requested pages )
+ * @ error   : [out] error status (0 if success)
+ * @ ppn     : [out] first physical page number
+ **********************************************************************************/
+void rpc_pmem_get_pages_client( cxy_t      cxy,
+                                uint32_t   order,
+                                error_t  * error,
+                                uint32_t * ppn );
+
+void rpc_pmem_get_pages_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_PROCESS_PID_ALLOC allocates one new PID in a remote cluster, registers
+ * the new process in the remote cluster, and returns the PID, and an error code.
+ ***********************************************************************************
+ * @ cxy     : server cluster identifier.
+ * @ process : [in]  local pointer on process descriptor in client cluster.
+ * @ error   : [out] error status (0 if success).
+ * @ pid     : [out] new process identifier.
+ **********************************************************************************/
+void rpc_process_pid_alloc_client( cxy_t              cxy,
+                                   struct process_s * process,
+                                   error_t          * error,
+                                   pid_t            * pid );
+
+void rpc_process_pid_alloc_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_PROCESS_EXEC creates a process descriptor copy, in a remote cluster
+ * and initializes if from information found in the reference process descriptor.
+ * This remote cluster becomes the new reference cluster.
+ ***********************************************************************************
+ * @ cxy     : server cluster identifier.
+ * @ info    : [in]   pointer on local exec_info structure.
+ * @ error   : [out]  error status (0 if success).
+ **********************************************************************************/
+void rpc_process_exec_client( cxy_t                cxy,
+                              struct exec_info_s * info,
+                              error_t            * error );
+
+void rpc_process_exec_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_PROCESS_KILL is actually a multicast RPC sent by the reference cluster
+ * to other clusters containing a process descriptor copy, to destroy these copies.
+ ***********************************************************************************
+ * @ process  : local pointer on target process.
+ **********************************************************************************/
+void rpc_process_kill_client( struct process_s * process );
+
+void rpc_process_kill_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_THREAD_USER_CREATE creates an user thread in the server cluster,
+ * as specified by the pthread_attr_t argument. It returns the local pointer
+ * on the thread descriptor in server cluster, and an error code.
+ * It is called by the pthread_create system call.
  ***********************************************************************************
  * @ cxy       : server cluster identifier.
- * @ attr      : [in]  local pointer on pthread_attr_t in client cluster.
- * @ thread_xp : [out] buffer for thread extended pointer. 
+ * @ attr      : [in]  pointer on pthread_attr_t in client cluster.
+ * @ thread_xp : [out] pointer on buffer for thread extended pointer. 
  * @ error     : [out] error status (0 if success).
  **********************************************************************************/
 void rpc_thread_user_create_client( cxy_t                   cxy,
-                                    pid_t                   pid,
-                                    void                  * start_func,
-                                    void                  * start_arg,
-                                    pthread_attr_t        * attr,
+                                    struct pthread_attr_s * attr,
                                     xptr_t                * thread_xp,
                                     error_t               * error );
@@ -255,8 +274,8 @@
 
 /***********************************************************************************
- * [7] The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster,
+ * The RPC_THREAD_KERNEL_CREATE creates a kernel thread in the server cluster,
  * as specified by the type, func and args arguments. It returns the local pointer
  * on the thread descriptor in server cluster and an error code.
- * It is used by the dev_init() function to create the device server thread.
+ * It is used by the dev_init() function to cretae the device server thread.
  ***********************************************************************************
  * @ cxy       : server cluster identifier.
@@ -276,130 +295,225 @@
 void rpc_thread_kernel_create_server( xptr_t xp );
 
-/***********************************************************************************
- * [8] undefined
- **********************************************************************************/
-
-/***********************************************************************************
- * [9] The RPC_PROCESS_SIGACTION allows a client thread to request a remote cluster
- * to execute a given sigaction, defined by the <action_type> for a given process,
- * identified by the <pid> argument.  When this RPC is used in parallel mode,
- * the rpc_process_sigaction_client() function is not used. 
+/*********************************************************************************** 
+ * The RPC_VFS_INODE_CREATE creates an inode and the associated mapper in a
+ * remote cluster. The parent dentry must have been previously created.
+ * It returns an extended pointer on the created inode.
+ ***********************************************************************************
+ * @ cxy       :  server cluster identifier
+ * @ dentry_xp : [in]  extended pointer on parent dentry.
+ * @ type      : [in]  file system type.
+ * @ attr      : [in]  TODO ???
+ * @ mode      : [in]  access mode.
+ * @ uid       : [in]  user ID
+ * @ gid       : [in]  group ID
+ * @ inode_xp  : [out] buffer for extended pointer on created inode.
+ * @ error     : [out] error status (0 if success).
+ **********************************************************************************/
+void rpc_vfs_inode_create_client( cxy_t      cxy,
+                                  xptr_t     dentry_xp,
+                                  uint32_t   type,
+                                  uint32_t   attr,    
+                                  uint32_t   mode,  
+                                  uint32_t   uid,
+                                  uint32_t   gid,
+                                  xptr_t   * inode_xp,
+                                  error_t  * error );
+
+void rpc_vfs_inode_create_server( xptr_t xp );
+
+/*********************************************************************************** 
+ * The RPC_VFS_INODE_DESTROY releases memory allocated for an inode descriptor
+ * and for the associated mapper in a remote cluster. 
+ ***********************************************************************************
+ * @ cxy       :  server cluster identifier
+ * @ inode     : [in]  local pointer on inode.
+ **********************************************************************************/
+void rpc_vfs_inode_destroy_client( cxy_t                 cxy,
+                                   struct vfs_inode_s * inode );
+
+void rpc_vfs_inode_destroy_server( xptr_t xp );
+
+/*********************************************************************************** 
+ * The RPC_VFS_DENTRY_CREATE creates a dentry in a remote cluster. 
+ * It returns an extended pointer on the created dentry.
+ ***********************************************************************************
+ * @ cxy        :  server cluster identifier
+ * @ type       : [in]  file system type.
+ * @ name       : [in]  directory entry name.
+ * @ parent     : [in]  local pointer on parent inode.
+ * @ dentry_xp  : [out] buffer for extended pointer on created dentry.
+ * @ error      : [out] error status (0 if success).
+ **********************************************************************************/
+void rpc_vfs_dentry_create_client( cxy_t                  cxy,
+                                   uint32_t               type,
+                                   char                 * name,    
+                                   struct vfs_inode_s   * parent,
+                                   xptr_t               * dentry_xp,
+                                   error_t              * error );
+
+void rpc_vfs_dentry_create_server( xptr_t xp );
+
+/*********************************************************************************** 
+ * The RPC_VFS_DENTRY_DESTROY releases memory allocated for an dentry descriptor
+ * in a remote cluster. 
+ ***********************************************************************************
+ * @ cxy       :  server cluster identifier
+ * @ dentry     : [in]  local pointer on dentry.
+ **********************************************************************************/
+void rpc_vfs_dentry_destroy_client( cxy_t                 cxy,
+                                    struct vfs_dentry_s * dentry );
+
+void rpc_vfs_dentry_destroy_server( xptr_t xp );
+
+
+
+
+/***********************************************************************************
+ * The RPC_VMM_GET_REF_VSEG returns an extended pointer 
+ * on the vseg containing a given virtual address in a given process.
+ * The server cluster is supposed to be the reference cluster.
+ * It returns NULL if no vseg has been founded.
  ***********************************************************************************
  * @ cxy     : server cluster identifier.
- * @ pid     : [in] target process identifier.
- * @ action  : [in] sigaction index.
- **********************************************************************************/
-void rpc_process_sigaction_client( cxy_t     cxy,
-                                   pid_t     pid,
-                                   uint32_t  action );
-                             
-void rpc_process_sigaction_server( xptr_t xp );
-
-/*********************************************************************************** 
- * [10] undefined
- **********************************************************************************/
-
-/*********************************************************************************** 
- * [11] undefined
- **********************************************************************************/
-
-/*********************************************************************************** 
- * [12] undefined                                                       
- **********************************************************************************/
-
-/*********************************************************************************** 
- * [13] undefined                                       
- **********************************************************************************/
-
-/***********************************************************************************
- * [14] undefined
- **********************************************************************************/
-
-/***********************************************************************************
- * [15] The RPC_VMM_RESIZE_VSEG allows a client thread to request a remote cluster
- * to resize a vseg identified by the <base> argument in a process descriptor
- * identified by the <pid> argument, as defined by the <new_base> and <new_size>
- * arguments. Both the VSL and the GPT are updated in the remote cluster. 
- ***********************************************************************************
- * @ cxy         : server cluster identifier.
- * @ pid         : [in] process identifier.
- * @ base        : [in] vseg base.
- * @ new_base    : [in] new vseg base.
- * @ new_size    : [in] new vseg size.
- **********************************************************************************/
-void rpc_vmm_resize_vseg_client( cxy_t              cxy,
-                                 pid_t              pid,
-                                 intptr_t           base,
-                                 intptr_t           new_base,
-                                 intptr_t           new_size );
- 
-void rpc_vmm_resize_vseg_server( xptr_t xp );
-
-/***********************************************************************************
- * [16] The RPC_VMM_REMOVE_VSEG allows a client thread  to request a remote cluster
- * to delete a vseg identified by the <vaddr> argument in a process descriptor
- * identified by the <pid> argument.
- * Both the VSL and the GPT are updated in the remote cluster.
- ***********************************************************************************
- * @ cxy       : server cluster identifier.
- * @ pid       : [in] process identifier.
- * @ base      : [in] vseg base.
- **********************************************************************************/
-void rpc_vmm_remove_vseg_client( cxy_t      cxy,
-                                 pid_t      pid,
-                                 intptr_t   base );
- 
-void rpc_vmm_remove_vseg_server( xptr_t xp );
-
-/***********************************************************************************
- * [17] The RPC_VMM_CREATE_VSEG allows a client thread to request the remote 
- * reference cluster of a given process to allocate and register in the reference
- * process VMM a new vseg descriptor.
- * On the server side, this RPC uses the vmm_create_vseg() function, and returns
- * to the client the local pointer on the created vseg descriptor.
- ***********************************************************************************
- * @ cxy         : server cluster identifier.
- * @ process     : [in]  local pointer on process descriptor in server.
- * @ type        : [in]  vseg type.
- * @ base        : [in]  base address (unused for dynamically allocated vsegs).
- * @ size        : [in]  number of bytes.
- * @ file_offset : [in]  offset in file (for CODE, DATA, FILE types).
- * @ file_size   : [in]  can be smaller than size for DATA type.
- * @ mapper_xp   : [in]  extended pointer on mapper (for CODE, DATA, FILE types).
- * @ vseg_cxy    : [in]  target cluster for mapping (if not data type).
- * @ vseg        : [out] local pointer on vseg descriptor / NULL if failure.
- **********************************************************************************/
-void rpc_vmm_create_vseg_client( cxy_t              cxy,
-                                 struct process_s * process,
-                                 vseg_type_t        type,
-                                 intptr_t           base,
-                                 uint32_t           size,
-                                 uint32_t           file_offset,
-                                 uint32_t           file_size,
-                                 xptr_t             mapper_xp,
-                                 cxy_t              vseg_cxy,
-                                 struct vseg_s   ** vseg );
-
-void rpc_vmm_create_vseg_server( xptr_t xp );
-
-/***********************************************************************************
- * [18] The RPC_VMM_SET_COW allows a client thread to request the remote reference
- * cluster to set the COW flag and reset the WRITABLE flag of all GPT entries for
- * the DATA, MMAP and REMOTE vsegs of process identified by the <process> argument.
-
- * of a remote scheduler, identified by the <lid> argument.
- ***********************************************************************************
- * @ cxy         : server cluster identifier.
- * @ process     : [in]  local pointer on reference process descriptor.
- **********************************************************************************/
-void rpc_vmm_set_cow_client( cxy_t              cxy,
-                             struct process_s * process );
-
-void rpc_vmm_set_cow_server( xptr_t xp );
-
-/***********************************************************************************
- * [19] undefined
- **********************************************************************************/
-
+ * @ process : [in]   pointer on process descriptor in server cluster. 
+ * @ vaddr   : [in]   virtual address to be searched.
+ * @ vseg    : [out]  address of buffer for vseg pointer in client cluster.
+ **********************************************************************************/
+void rpc_vmm_get_ref_vseg_client( cxy_t              cxy,
+                                  struct process_s * process,
+                                  intptr_t           vaddr,
+                                  xptr_t           * vseg_xp );
+
+void rpc_vmm_get_ref_vseg_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_VMM_GET_PTE returns in the "ppn" and "attr" arguments the PTE value
+ * for a given VPN in a given process.
+ * The server cluster is supposed to be the reference cluster, and the vseg
+ * containing the VPN must be registered in the reference VMM.
+ * It returns an error if physical memory cannot be allocated for the PTE2, 
+ * or for the missing page itself.
+ ***********************************************************************************
+ * @ cxy     : server cluster identifier.
+ * @ process : [in]   pointer on process descriptor in server cluster. 
+ * @ vaddr   : [in]   virtual address to be searched.
+ * @ attr    : [out]  address of buffer for attributes.
+ * @ ppn     : [out]  address of buffer for PPN.
+ * @ error   : [out]  address of buffer for error code.
+ **********************************************************************************/
+void rpc_vmm_get_pte_client( cxy_t              cxy,
+                             struct process_s * process,
+                             vpn_t              vpn,
+                             uint32_t         * attr,
+                             ppn_t            * ppn,
+                             error_t          * error );
+
+void rpc_vmm_get_pte_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_SEMAPHORE_ALLOC allocates memory for a semaphore in a remote cluster,
+ * and returns an extended pointer on the created semaphore.
+  It returns NULL if physical memory cannot be allocated. 
+ ***********************************************************************************
+ * @ cxy     : server cluster identifier.
+ * @ sem_xp  : [out] buffer for extended pointer on semaphore. 
+ **********************************************************************************/
+void rpc_semaphore_alloc_client( cxy_t    cxy,
+                                 xptr_t * sem_xp );  
+
+void rpc_semaphore_alloc_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_SEMAPHORE_FREE releases memory allocated for a semaphore 
+ * in a remote cluster.
+ ***********************************************************************************
+ * @ cxy     : server cluster identifier.
+ * @ sem     : [in] local pointer on semaphore. 
+ **********************************************************************************/
+void rpc_semaphore_free_client( cxy_t                 cxy,
+                                struct remote_sem_s * sem );
+
+void rpc_semaphore_free_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_MAPPER_MOVE can be send by any thread running in a "client" cluster 
+ * to the "server" cluster containing the mapper of a given file. The service is 
+ * to move data between the mapper and an user buffer. This user buffer is described
+ * as a set of fragments. Each fragment is contained in one single physical page.
+ * It is defined by four parameters : size / file_offset / ppn / page_offset,
+ * defined in the mapper.h file. The client thread is in charge of building 
+ * the fragments array covering the user buffer. 
+ * As each fragments can be stored in a different cluster, and this fragment can 
+ * be stored in two successive pages in the radix tree, each fragment is moved 
+ * using one or two different hal_remote_memcpy().
+ ***********************************************************************************
+ * @ cxy      : server cluster identifier.
+ * @ inode    : [in]  local pointer on inode (in server cluster).
+ * @ read     : [in]  mapper to buffer if true / buffer to mapper if false.
+ * @ nb_frags : [in]  number of fragments in fragments array.
+ * @ frags    : [in]  local pointer on fragments array (in client cluster).
+ * @ error    : [out] local pointer on buffer for error code (in client cluster). 
+ **********************************************************************************/
+void rpc_mapper_move_client( cxy_t                cxy,
+                             struct mapper_s    * mapper,
+                             bool_t               read,
+                             uint32_t             nb_frags,
+                             struct fragment_s  * frags,
+                             error_t            * error );
+
+void rpc_mapper_move_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_ICU_WTI_ALLOC can be send by any thread running in a "client" cluster
+ * to get a WTI mailbox from the ICU of a "server" cluster.
+ * The WTI is allocated from the server ICU, but the WTI is not enabled,
+ * and no target core is selected in remote cluster.
+ * It returns wti_id == -1 if there is no free WTI in server cluster.
+ ***********************************************************************************
+ * @ cxy      : server cluster identifier.
+ * @ wti_id   : [out] local pointer on WTI index in client cluster (-1 if error).
+ **********************************************************************************/
+void rpc_icu_wti_alloc_client( cxy_t      cxy,
+                               uint32_t * wti_id );    
+
+void rpc_icu_wti_alloc_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_DEVICE_ALLOC can be send by any thread running in a "client" cluster
+ * to create a device descriptor in a remote "server" cluster.
+ * The WTI is allocated from the server ICU, but the WTI is not enabled,
+ * and no target core is selected in remote cluster.
+ * It returns wti_id == -1 if there is no free WTI in server cluster.
+ ***********************************************************************************
+ * @ cxy      : server cluster identifier.
+ * @ dev_xp   : [out] buffer for extended pointer on device (in client cluster).
+ * @ error    : [out] local pointer on buffer for error code (in client cluster). 
+ **********************************************************************************/
+void rpc_device_alloc_client( cxy_t     cxy,
+                              xptr_t  * dev_xp,           
+                              error_t * error );    
+
+void rpc_device_alloc_server( xptr_t xp );
+
+/***********************************************************************************
+ * The RPC_FATFS_GET_CLUSTER can be send by any thread running in a "client" cluster
+ * to scan the FAT mapper, stored in a remote "server" cluster, and get the FATFS 
+ * cluster index of a given page of a given file.
+ ***********************************************************************************
+ * @ cxy      : server cluster identifier.
+ * @ mapper   : [in]  local pointer on FAT mapper.
+ * @ first    : [in]  FATFS cluster index allocated to first page of file.
+ * @ page     : [in]  page index in file.
+ * @ cluster  : [out] local pointer on buffer for found FATFS cluster index.
+ * @ error    : [out] local pointer on buffer for error code (in client cluster). 
+ **********************************************************************************/
+void rpc_fatfs_get_cluster_client( cxy_t             cxy,
+                                   struct mapper_s * mapper,
+                                   uint32_t          first,
+                                   uint32_t          page,
+                                   uint32_t        * cluster,
+                                   error_t         * error );    
+
+void rpc_fatfs_get_cluster_server( xptr_t xp );
 
 #endif
Index: trunk/kernel/kern/rt_timer.h
===================================================================
--- trunk/kernel/kern/rt_timer.h	(revision 1)
+++ trunk/kernel/kern/rt_timer.h	(revision 1)
@@ -0,0 +1,56 @@
+/*
+ * kern/rt_timer.h - real-time timer interface
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef  _RT_TIMER_H_
+#define  _RT_TIMER_H_
+
+#include <types.h>
+
+/** Real-Time timer commands */
+#define RT_TIMER_STOP    0x00
+#define RT_TIMER_RUN     0x01
+#define RT_TIMER_ADJUST  0x02
+
+/** Real-Time timer parameters */
+struct rt_params_s
+{
+	uint_t rt_cmd;
+	sint_t rt_value;
+	void *pv_data;
+};
+
+/** Initialize Real-Time timer source */
+error_t rt_timer_init(uint_t period, uint_t withIrq);
+
+/** Read Real-Time timer current value  */
+error_t rt_timer_read(uint_t *time);
+
+/** Set Real-Time timer's current value */
+error_t rt_timer_set(uint_t time);
+
+/** Set Real-Time timer's period */
+error_t rt_timer_setperiod(uint_t period);
+
+/** Send commands to Real-Time timer device */
+error_t rt_timer_ctrl(struct rt_params_s *param);
+
+#endif	/* _RT_TIMER_H_ */
Index: trunk/kernel/kern/scheduler.c
===================================================================
--- trunk/kernel/kern/scheduler.c	(revision 690)
+++ trunk/kernel/kern/scheduler.c	(revision 1)
@@ -2,5 +2,5 @@
  * scheduler.c - Core scheduler implementation.
  * 
- * Author    Alain Greiner       (2016,2017,2018,2019,2020)
+ * Author    Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -22,394 +22,14 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_switch.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_irqmask.h>
 #include <hal_context.h>
 #include <printk.h>
 #include <list.h>
-#include <rpc.h>
 #include <core.h>
 #include <thread.h>
-#include <chdev.h>
 #include <scheduler.h>
 
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//         global variables
-///////////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t    chdev_dir;          // allocated in kernel_init.c
-extern process_t            process_zero;       // allocated in kernel_init.c
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//         private functions
-///////////////////////////////////////////////////////////////////////////////////////////
-
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function does NOT modify the scheduler state.
-// It just select a thread in the list of attached threads, implementing the following 
-// three steps policy: 
-// 1) It scan the list of kernel threads, from the next thread after the last executed one,
-//    and returns the first runnable found : not IDLE, not blocked, client queue not empty.
-//    It can be the current thread.
-// 2) If no kernel thread found, it scan the list of user thread, from the next thread after
-//    the last executed one, and returns the first runable found : not blocked.
-//    It can be the current thread.
-// 3) If no runable thread found, it returns the idle thread.
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ sched   : local pointer on scheduler.
-// @ returns pointer on selected thread descriptor
-////////////////////////////////////////////////////////////////////////////////////////////
-static thread_t * __attribute__((__noinline__))sched_select( scheduler_t * sched )
-{
-    thread_t     * thread;
-    list_entry_t * current;
-    list_entry_t * last;
-    list_entry_t * root;
-    bool_t         done;
-    uint32_t       count;
-
-    // first : scan the kernel threads list if not empty 
-    if( list_is_empty( &sched->k_root ) == false )
-    {
-        root    = &sched->k_root;
-        last    = sched->k_last;
-        done    = false;
-        count   = 0;
-        current = last;
-
-        while( done == false )
-        {
-            // get next entry in kernel list
-            current = current->next;
-
-            // check exit condition
-            if( current == last ) done = true;
-
-            // skip the root that does not contain a thread
-            if( current == root ) continue;
-            else                  count++;
-
-            // get thread pointer for this entry
-            thread = LIST_ELEMENT( current , thread_t , sched_list );
-
-            // select kernel thread if non blocked and non THREAD_IDLE
-            if( (thread->blocked == 0)  && (thread->type != THREAD_IDLE) ) return thread;
-
-        } // end loop on kernel threads
-    } // end kernel threads
-
-    // second : scan the user threads list if not empty 
-    if( list_is_empty( &sched->u_root ) == false )
-    {
-        root    = &sched->u_root;
-        last    = sched->u_last;
-        done    = false;
-        count   = 0;
-        current = last;
-
-        while( done == false )
-        {
-            // get next entry in user list
-            current = current->next;
-
-            // check exit condition
-            if( current == last ) done = true;
-
-            // skip the root that does not contain a thread
-            if( current == root ) continue;
-            else                  count++;
-
-            // get thread pointer for this entry
-            thread = LIST_ELEMENT( current , thread_t , sched_list );
-
-            // select thread if non blocked
-            if( thread->blocked == 0 )  return thread;
-
-        } // end loop on user threads
-    } // end user threads
-
-    // third : return idle thread if no other runnable thread
-    return sched->idle;
-
-}  // end sched_select()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is the only function that can actually delete a thread,
-// (and the associated process descriptor if required).
-// It is private, because it is only called by the sched_yield() public function.
-// It scan all threads attached to a given scheduler, and executes the relevant
-// actions for two types of pending requests: 
-//
-// - REQ_ACK : it checks that target thread is blocked, decrements the response counter
-//   to acknowledge the client thread, and reset the pending request. 
-// - REQ_DELETE : it removes the target thread from the process th_tbl[], remove it
-//   from the scheduler list, and release the memory allocated to thread descriptor.
-//   For an user thread, it destroys the process descriptor it the target thread is
-//   the last thread in the local process descriptor.
-//
-// Implementation note:
-// We use a while to scan the threads in scheduler lists, because some threads can
-// be destroyed, and we want not use a LIST_FOREACH()
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ core    : local pointer on the core descriptor.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void sched_handle_signals( core_t * core )
-{
-
-    list_entry_t * iter;
-    list_entry_t * root;
-    thread_t     * thread;
-    process_t    * process;
-    scheduler_t  * sched;
-    uint32_t       threads_nr;   // number of threads in scheduler list
-    ltid_t         ltid;         // thread local index
-    uint32_t       count;        // number of threads in local process
-
-    // get pointer on scheduler
-    sched = &core->scheduler;
-
-    ////////////////// scan user threads to handle ACK and DELETE requests
-    root = &sched->u_root;
-    iter = root->next;
-    while( iter != root )
-    {
-        // get pointer on thread
-        thread = LIST_ELEMENT( iter , thread_t , sched_list );
-
-        // increment iterator
-        iter = iter->next;
-
-        // handle REQ_ACK 
-        if( thread->flags & THREAD_FLAG_REQ_ACK )
-        {
-
-// check target thread blocked
-assert( __FUNCTION__, (thread->blocked & THREAD_BLOCKED_GLOBAL) , "thread not blocked" );
- 
-            // decrement response counter
-            hal_atomic_add( thread->ack_rsp_count , -1 );
-
-            // reset REQ_ACK in thread descriptor
-            thread_reset_req_ack( thread );
-        }
-
-        // handle REQ_DELETE only if target thread != calling thread
-        if( thread->flags & THREAD_FLAG_REQ_DELETE )
-        {
-
-// check calling thread != target thread
-assert( __FUNCTION__, (thread != CURRENT_THREAD) , "calling thread cannot delete itself" );
- 
-            // get thread process descriptor
-            process = thread->process;
-
-            // get thread ltid
-            ltid = LTID_FROM_TRDID( thread->trdid);
-
-            // take the lock protecting sheduler state
-            busylock_acquire( &sched->lock );
-
-            // update scheduler state
-            threads_nr = sched->u_threads_nr;
-            sched->u_threads_nr = threads_nr - 1;
-            list_unlink( &thread->sched_list );
-            if( sched->u_last == &thread->sched_list )
-            {
-                if( threads_nr == 1 ) 
-                {
-                    sched->u_last = NULL;
-                }
-                else if( sched->u_root.next == &thread->sched_list )
-                {
-                    sched->u_last = sched->u_root.pred;
-                }
-                else
-                {
-                    sched->u_last = sched->u_root.next;
-                }
-            }
-
-            // release the lock protecting sheduler state
-            busylock_release( &sched->lock );
-
-            // release memory allocated for thread 
-            count = thread_destroy( thread );
-
-            hal_fence();
-
-#if DEBUG_SCHED_HANDLE_SIGNALS
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SCHED_HANDLE_SIGNALS < cycle )
-printk("\n[%s] thread[%x,%x] on core[%x,%d] deleted / cycle %d\n",
-__FUNCTION__, process->pid, thread->trdid, local_cxy, thread->core->lid, cycle );
-#endif
-            // destroy process descriptor if last thread
-            if( count == 1 ) 
-            {
-                // delete process    
-                process_destroy( process );
-
-#if DEBUG_SCHED_HANDLE_SIGNALS
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SCHED_HANDLE_SIGNALS < cycle )
-printk("\n[%s] process %x in cluster %x deleted / cycle %d\n",
-__FUNCTION__ , process->pid , local_cxy , cycle );
-#endif
-            }
-        }
-    }  // end user threads
-
-    ///////////// scan kernel threads for DELETE only
-    root = &sched->k_root;
-    iter = root->next;
-    while( iter != root )
-    {
-        // get pointer on thread
-        thread = LIST_ELEMENT( iter , thread_t , sched_list );
-
-        // increment iterator
-        iter = iter->next;
-
-        // handle REQ_DELETE only if target thread != calling thread
-        if( (thread->flags & THREAD_FLAG_REQ_DELETE) && (thread != CURRENT_THREAD) )
-        {
-
-// check process descriptor is local kernel process
-assert( __FUNCTION__, ( thread->process == &process_zero ) , "illegal process descriptor");
-
-            // get thread ltid
-            ltid = LTID_FROM_TRDID( thread->trdid);
-
-            // take the lock protecting sheduler state
-            busylock_acquire( &sched->lock );
-
-            // update scheduler state
-            threads_nr = sched->k_threads_nr;
-            sched->k_threads_nr = threads_nr - 1;
-            list_unlink( &thread->sched_list );
-            if( sched->k_last == &thread->sched_list )
-            {
-                if( threads_nr == 1 ) 
-                {
-                    sched->k_last = NULL;
-                }
-                else if( sched->k_root.next == &thread->sched_list )
-                {
-                    sched->k_last = sched->k_root.pred;
-                }
-                else
-                {
-                    sched->k_last = sched->k_root.next;
-                }
-            }
-
-            // release the lock protecting sheduler state
-            busylock_release( &sched->lock );
-
-            // get number of threads in local kernel process
-            count = process_zero.th_nr;
-
-// check th_nr value
-assert( __FUNCTION__, (process_zero.th_nr > 0) , "kernel process th_nr cannot be 0" );
-
-            // remove thread from process th_tbl[]
-            process_zero.th_tbl[ltid] = NULL;
-            hal_atomic_add( &process_zero.th_nr , - 1 );
- 
-            // delete thread descriptor
-            thread_destroy( thread );
-
-#if DEBUG_SCHED_HANDLE_SIGNALS
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SCHED_HANDLE_SIGNALS < cycle )
-printk("\n[%s] thread[%x,%x] on core[%x,%d] deleted / cycle %d\n",
-__FUNCTION__ , process_zero.pid , thread->trdid , local_cxy , thread->core->lid , cycle );
-#endif
-        }
-    }
-} // end sched_handle_signals()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the sched_yield function when the RFC_FIFO
-// associated to the core is not empty. 
-// It search an idle RPC thread for this core, and unblock it if found. 
-// It creates a new RPC thread if no idle RPC thread is found.
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ sched   : local pointer on scheduler.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void sched_rpc_activate( scheduler_t * sched )
-{
-    error_t         error;
-    thread_t      * thread;  
-    list_entry_t  * iter;
-    lid_t           lid = CURRENT_THREAD->core->lid;
-    bool_t          found = false;
-
-    // search one IDLE RPC thread associated to the selected core   
-    LIST_FOREACH( &sched->k_root , iter )
-    {
-        thread = LIST_ELEMENT( iter , thread_t , sched_list );
-
-        if( (thread->type == THREAD_RPC) && 
-            (thread->blocked == THREAD_BLOCKED_IDLE ) ) 
-        {
-            found = true;
-            break;
-        }
-    }
-
-    if( found == false )     // create new RPC thread     
-    {
-        error = thread_kernel_create( &thread,
-                                      THREAD_RPC, 
-		                              &rpc_server_func, 
-                                      NULL,
-	                                  lid );
-        // check memory
-        if ( error )
-        {
-            printk("\n[ERROR] in %s : no memory to create a RPC thread in cluster %x\n",
-            __FUNCTION__, local_cxy );
-        }
-        else
-        {
-            // unblock created RPC thread
-            thread->blocked = 0;
-
-            // update RPC threads counter  
-            hal_atomic_add( &LOCAL_CLUSTER->rpc_threads[lid] , 1 );
-
-#if DEBUG_SCHED_RPC_ACTIVATE
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SCHED_RPC_ACTIVATE < cycle ) 
-printk("\n[%s] new RPC thread %x created for core[%x,%d] / total %d / cycle %d\n",
-__FUNCTION__, thread->trdid, local_cxy, lid, LOCAL_CLUSTER->rpc_threads[lid], cycle );
-#endif
-        }
-    }
-    else                 // RPC thread found => unblock it
-    {
-        // unblock found RPC thread
-        thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_IDLE );
-
-#if DEBUG_SCHED_RPC_ACTIVATE
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_SCHED_RPC_ACTIVATE < cycle ) 
-printk("\n[%s] idle RPC thread %x unblocked for core[%x,%d] / cycle %d\n",
-__FUNCTION__, thread->trdid, local_cxy, lid, cycle );
-#endif
-
-    }
-
-} // end sched_rpc_activate()
-
-
-
-///////////////////////////////////////////////////////////////////////////////////////////
-//         public functions
-///////////////////////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////
@@ -421,8 +41,8 @@
     sched->k_threads_nr   = 0;
 
-    sched->current        = CURRENT_THREAD;
-    sched->idle           = NULL;               // initialized in kernel_init()
-    sched->u_last         = NULL;               // initialized in sched_register_thread()
-    sched->k_last         = NULL;               // initialized in sched_register_thread()
+    sched->current        = NULL;
+    sched->idle           = NULL;
+    sched->u_last         = NULL;
+    sched->k_last         = NULL;
 
     // initialise threads lists
@@ -430,10 +50,4 @@
     list_root_init( &sched->k_root );
 
-    // init lock
-    busylock_init( &sched->lock , LOCK_SCHED_STATE );
-
-    sched->req_ack_pending = false;             // no pending request
-    sched->trace           = false;             // context switches trace desactivated
-
 }  // end sched_init()
 
@@ -445,12 +59,12 @@
     thread_type_t type  = thread->type;
 
-    // take lock protecting sheduler state
-    busylock_acquire( &sched->lock );
-
+    // take lock protecting sheduler lists
+    spinlock_lock( &sched->lock );
+
+    // register thread
     if( type == THREAD_USER )
     {
         list_add_last( &sched->u_root , &thread->sched_list );
         sched->u_threads_nr++;
-        if( sched->u_last == NULL ) sched->u_last = &thread->sched_list;
     }
     else // kernel thread
@@ -458,211 +72,288 @@
         list_add_last( &sched->k_root , &thread->sched_list );
         sched->k_threads_nr++;
-        if( sched->k_last == NULL ) sched->k_last = &thread->sched_list; 
     }
 
     // release lock 
-    busylock_release( &sched->lock );
-
-}  // end sched_register_thread()
-
-//////////////////////////////////////////////////////////////////
-void sched_yield( const char * cause __attribute__((__unused__)) )
-{
-    thread_t      * next;
-    thread_t      * current = CURRENT_THREAD;
-    core_t        * core    = current->core;
-    lid_t           lid     = core->lid;
-    scheduler_t   * sched   = &core->scheduler;
-    remote_fifo_t * fifo    = &LOCAL_CLUSTER->rpc_fifo[lid]; 
- 
-#if DEBUG_SCHED_YIELD
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if (DEBUG_SCHED_YIELD & 0x1)
-if( sched->trace || (cycle > DEBUG_SCHED_YIELD) )
-sched_remote_display( local_cxy , lid );
-#endif
-
-// This assert should always be true, as this check has been
-// done before, by any function that can possibly deschedule...
-assert( __FUNCTION__, (current->busylocks == 0),
-"current thread hold %d busylocks\n", current->busylocks ); 
-
-    // activate or create an RPC thread if RPC_FIFO non empty
-    if( remote_fifo_is_empty( fifo ) == false )  sched_rpc_activate( sched );
-
-    // disable IRQs / save SR in current thread descriptor
-    hal_disable_irq( &current->save_sr );
-
-    // take lock protecting sheduler state
-    busylock_acquire( &sched->lock );
-    
-    // select next thread 
-    next = sched_select( sched );
-
-// check next thread kernel_stack overflow
-assert( __FUNCTION__, (next->signature == THREAD_SIGNATURE),
-"kernel stack overflow for thread %x on core[%x,%d]", next, local_cxy, lid );
-
-// check next thread attached to same core as the current thread
-assert( __FUNCTION__, (next->core == current->core),
-"next_core_lid %d / current_core_lid %d", current->core->lid, next->core->lid );
-   
-// check next thread not blocked when type != IDLE
-assert( __FUNCTION__, ((next->blocked == 0) || (next->type == THREAD_IDLE)) ,
-"next thread %x (%s) is blocked on core[%x,%d]", 
-next->trdid , thread_type_str(next->type) , local_cxy , lid );
-
-    // switch contexts and update scheduler state if next != current
-	if( next != current )
-    {
-        // update scheduler 
-        sched->current = next;
-        if( next->type == THREAD_USER ) sched->u_last = &next->sched_list;
-        else                            sched->k_last = &next->sched_list;
-
-        // handle FPU ownership
-	    if( next->type == THREAD_USER )
+    spinlock_unlock( &sched->lock );
+
+}  // end sched_register()
+
+/////////////////////////////////////////////
+void sched_remove_thread( thread_t * thread )
+{
+    core_t       * core  = thread->core;
+    scheduler_t  * sched = &core->scheduler;
+    thread_type_t  type  = thread->type;
+
+    // take lock protecting sheduler lists
+    spinlock_lock( &sched->lock );
+
+    // remove thread
+    if( type == THREAD_USER )
+    {
+        list_unlink( &thread->sched_list );
+        sched->u_threads_nr--;
+    }
+    else // kernel thread 
+    {
+        list_unlink( &thread->sched_list );
+        sched->k_threads_nr--;
+    }
+
+    // release lock
+    spinlock_unlock( &sched->lock );
+
+}  // end sched_remove()
+
+///////////////////////////////////////////
+void sched_kill_thread( thread_t * thread )
+{
+    // check thread locks
+    if( thread_can_yield() == false )
+    {
+        printk("\n[ERROR] in %s : thread %x in process %x on core %d in cluster %x"
+               " did not released all locks\n",
+               __FUNCTION__ , thread->trdid , thread->process->pid, 
+               thread->core->lid , local_cxy ); 
+        hal_core_sleep();
+    }
+
+    // remove thread from scheduler
+    sched_remove_thread( thread );
+
+    // reset the THREAD_SIG_KILL signal
+    thread_reset_signal( thread , THREAD_SIG_KILL );
+
+}  // end sched_kill_thread()
+
+////////////////////////////////////////
+thread_t * sched_select( core_t * core )
+{
+    thread_t * thread;
+
+    scheduler_t * sched = &core->scheduler;
+
+    // take lock protecting sheduler lists
+    spinlock_lock( &sched->lock );
+
+    list_entry_t * current;
+    list_entry_t * last;
+
+    // first scan the kernel threads
+    last    = sched->k_last;
+    current = sched->k_last;
+    do
+    {
+        // get next entry in kernel list
+        current = list_next( &sched->k_root , current );
+
+        // skip the list root that does not contain a thread
+        if( current == NULL ) continue;
+
+        // get thread pointer
+        thread = LIST_ELEMENT( current , thread_t , sched_list );
+
+        // return thread if not blocked
+        if( thread->blocked == 0 ) 
         {
-	        if( next == current->core->fpu_owner )  hal_fpu_enable();
-	        else                                    hal_fpu_disable();
+            // release lock 
+            spinlock_unlock( &sched->lock );
+            return thread;
         }
-
-        // release lock protecting scheduler state
-        busylock_release( &sched->lock );
-
-#if DEBUG_SCHED_YIELD
-if( sched->trace || (cycle > DEBUG_SCHED_YIELD) )
-printk("\n[%s] core[%x,%d] / cause = %s\n"
-"      thread %x (%s) (%x,%x) => thread %x (%s) (%x,%x) / cycle %d\n",
-__FUNCTION__, local_cxy, lid, cause, 
-current, thread_type_str(current->type), current->process->pid, current->trdid,next ,
-thread_type_str(next->type) , next->process->pid , next->trdid , cycle );
-#endif
-
-        // switch CPU from current thread context to new thread context
-        hal_do_cpu_switch( current->cpu_context, next->cpu_context );
-    }
-    else
-    {
-        // release lock protecting scheduler state
-        busylock_release( &sched->lock );
-
-#if DEBUG_SCHED_YIELD 
-if( sched->trace || (cycle > DEBUG_SCHED_YIELD) )
-printk("\n[%s] core[%x,%d] / cause = %s\n"
-"      thread %x (%s) (%x,%x) continue / cycle %d\n",
-__FUNCTION__, local_cxy, lid, cause, current, thread_type_str(current->type),
-current->process->pid, current->trdid, (uint32_t)hal_get_cycles() );
-#endif
-
-    }
-
-    // handle pending requests for all threads executing on this core.
+    }
+    while( current != last );
+
+    // second scan the user threads
+    last    = sched->u_last;
+    current = sched->u_last;
+    do
+    {
+        // get next entry in user list
+        current = list_next( &sched->u_root , current );
+
+        // skip the list root that does not contain a thread
+        if( current == NULL ) continue;
+
+        // get thread pointer
+        thread = LIST_ELEMENT( current , thread_t , sched_list );
+
+        // return thread if not blocked
+        if( thread->blocked == 0 )
+        {
+            // release lock 
+            spinlock_unlock( &sched->lock );
+            return thread;
+        }
+    }
+    while( current != last );
+
+    // release lock 
+    spinlock_unlock( &sched->lock );
+
+    // third, return idle thread if no runnable thread
+    return sched->idle;
+
+}  // end sched_elect()
+
+//////////////////////////////////////////
+void sched_handle_signals( core_t * core )
+{
+    list_entry_t * iter;
+    thread_t     * thread;
+
+    scheduler_t  * sched = &core->scheduler;
+
+    // take lock protecting threads lists
+    spinlock_lock( &sched->lock );
+
+    // handle user threads
+    LIST_FOREACH( &sched->u_root , iter )
+    {
+        thread = LIST_ELEMENT( iter , thread_t , sched_list );
+        if( thread->signals & THREAD_SIG_KILL )  sched_kill_thread( thread );
+    }
+
+    // handle kernel threads
+    LIST_FOREACH( &sched->k_root , iter )
+    {
+        thread = LIST_ELEMENT( iter , thread_t , sched_list );
+        if( thread->signals & THREAD_SIG_KILL )  sched_kill_thread( thread );
+    }
+
+    // release lock 
+    spinlock_unlock( &sched->lock );
+
+} // end sched_handle_signals()
+
+//////////////////
+void sched_yield()
+{
+    uint32_t      sr_save;
+    thread_t    * next;
+
+    thread_t    * current = CURRENT_THREAD;
+    core_t      * core    = current->core;
+
+    if( thread_can_yield() == false )
+    {
+        printk("\n[PANIC] in %s : thread %x for process %x on core %d in cluster %x"
+               " has not released all locks\n",
+               __FUNCTION__, current->trdid, current->process->pid, core->lid, local_cxy );
+        hal_core_sleep();
+    }
+
+    // desactivate IRQs
+    hal_disable_irq( &sr_save );
+
+    // first loop on all threads to handle pending signals
     sched_handle_signals( core );
 
-    // exit critical section / restore SR from current thread descriptor
-    hal_restore_irq( CURRENT_THREAD->save_sr );
+    // second loop on threads to select next thread
+    next = sched_select( core );
+
+    // check stack overflow for selected thread
+    if( next->signature != THREAD_SIGNATURE )
+    {
+        printk("\n[PANIC] in %s : detected stack overflow for thread %x of process %x"
+               " on core %d in cluster %x\n",
+               __FUNCTION__, next->trdid, next->process->pid, core->lid, local_cxy);
+        hal_core_sleep();
+	}
+	
+	sched_dmsg("\n[INFO] %s on core %d in cluster %x / old thread = %x / new thread = %x\n",
+               __FUNCTION__, core->lid, cluster->cxy, current->trdid, next->trdid );
+
+    // switch contexts if new thread
+	if( next != current )  
+	{
+        hal_cpu_context_save( current );
+        hal_cpu_context_restore( next );
+	}
+
+    // restore IRQs
+    hal_restore_irq( sr_save );
+
+	if( current->type != THREAD_USER ) return;
+
+	if( current == core->fpu_owner )  hal_fpu_enable();
+	else                              hal_fpu_disable();
 
 }  // end sched_yield()
 
-
-/////////////////////////////////////
-void sched_remote_display( cxy_t cxy,
-                           lid_t lid )
-{
-    thread_t     * thread;
-
-    // get local pointer on target scheduler
-    core_t      * core  = &LOCAL_CLUSTER->core_tbl[lid];
-    scheduler_t * sched = &core->scheduler;
-
-    // get local pointer on current thread in target scheduler
-    thread_t * current = hal_remote_lpt( XPTR( cxy, &sched->current ) );
-
-    // get local pointer on the first kernel and user threads list_entry
-    list_entry_t * k_entry = hal_remote_lpt( XPTR( cxy , &sched->k_root.next ) );
-    list_entry_t * u_entry = hal_remote_lpt( XPTR( cxy , &sched->u_root.next ) );
-    
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 chdev lock
-    xptr_t  lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( lock_xp );
-
-    // get rpc_threads
-    uint32_t rpcs = hal_remote_l32( XPTR( cxy , &LOCAL_CLUSTER->rpc_threads[lid] ) );
- 
-    // display header
-    nolock_printk("\n***** threads on core[%x,%d] / current %x / rpc_threads %d / cycle %d\n",
-    cxy , lid, current, rpcs, (uint32_t)hal_get_cycles() );
-    nolock_printk("  type | pid        | trdid      | desc       | block      | flags      | func\n");
-
-    // display kernel threads
-    while( k_entry != &sched->k_root )
-    {
-        // get local pointer on kernel_thread
-        thread = LIST_ELEMENT( k_entry , thread_t , sched_list );
-
-        // get relevant thead info
-        thread_type_t type    = hal_remote_l32 ( XPTR( cxy , &thread->type ) );
-        trdid_t       trdid   = hal_remote_l32 ( XPTR( cxy , &thread->trdid ) );
-        uint32_t      blocked = hal_remote_l32 ( XPTR( cxy , &thread->blocked ) );
-        uint32_t      flags   = hal_remote_l32 ( XPTR( cxy , &thread->flags ) );
-        process_t *   process = hal_remote_lpt ( XPTR( cxy , &thread->process ) );
-        pid_t         pid     = hal_remote_l32 ( XPTR( cxy , &process->pid ) );
-
-        // display thread info
-        if (type == THREAD_DEV) 
-        {
-            char      name[16];
-            chdev_t * chdev = hal_remote_lpt( XPTR( cxy , &thread->chdev ) );
-            hal_remote_strcpy( XPTR( local_cxy , name ), XPTR( cxy , chdev->name ) );
-
-            nolock_printk(" - %s | %X | %X | %X | %X | %X | %s\n",
-            thread_type_str( type ), pid, trdid, thread, blocked, flags, name );
-        }
-        else
-        {
-            nolock_printk(" - %s | %X | %X | %X | %X | %X |\n",
-            thread_type_str( type ), pid, trdid, thread, blocked, flags );
-        }
-
-        // get next remote kernel thread list_entry
-        k_entry = hal_remote_lpt( XPTR( cxy , &k_entry->next ) );
-    }
-
-    // display user threads
-    while( u_entry != &sched->u_root )
-    {
-        // get local pointer on user_thread
-        thread = LIST_ELEMENT( u_entry , thread_t , sched_list );
-
-        // get relevant thead info
-        thread_type_t type    = hal_remote_l32 ( XPTR( cxy , &thread->type ) );
-        trdid_t       trdid   = hal_remote_l32 ( XPTR( cxy , &thread->trdid ) );
-        uint32_t      blocked = hal_remote_l32 ( XPTR( cxy , &thread->blocked ) );
-        uint32_t      flags   = hal_remote_l32 ( XPTR( cxy , &thread->flags ) );
-        process_t *   process = hal_remote_lpt ( XPTR( cxy , &thread->process ) );
-        pid_t         pid     = hal_remote_l32 ( XPTR( cxy , &process->pid ) );
-        void      *   func    = hal_remote_lpt ( XPTR( cxy , &thread->entry_func ) );
-
-        nolock_printk(" - %s | %X | %X | %X | %X | %X | %x\n",
-        thread_type_str( type ), pid, trdid, thread, blocked, flags, (uint32_t)func );
-
-        // get next user thread list_entry
-        u_entry = hal_remote_lpt( XPTR( cxy , &u_entry->next ) );
-    }
-
-    // release TXT0 lock
-    remote_busylock_release( lock_xp );
-
-}  // end sched_remote_display()
-
-
+//////////////////////////////////////
+void sched_switch_to( thread_t * new )
+{
+    uint32_t      sr_save;
+
+    thread_t    * current = CURRENT_THREAD;
+    core_t      * core    = current->core;
+    process_t   * process = current->process;
+
+    // check calling thread released all locks
+    if( thread_can_yield() == false )
+    {
+        printk("\n[PANIC] in %s : thread %x for process %x on core %d in cluster %x"
+               " has not released all locks\n",
+               __FUNCTION__, current->trdid, process->pid, core->lid, local_cxy );
+        hal_core_sleep();
+    }
+
+    // check new thread attached to same core as the calling thread
+    if( new->core != current->core )
+    {
+        printk("\n[PANIC] in %s : new thread %x is attached to core %d"
+               " different from core %d of current thread\n",
+               __FUNCTION__, new->trdid, new->core->lid, core->lid , current->trdid );
+        hal_core_sleep();
+    }
+
+    // check new thread not blocked
+    if( new->blocked == 0 )
+    {
+        printk("\n[PANIC] in %s for thread %x of process %x on core %d in cluster %x"
+               " : new thread %x is blocked\n",
+               __FUNCTION__, current->trdid, process->pid , core->lid, local_cxy , new->trdid );
+        hal_core_sleep();
+    }
+
+    // check stack overflow for new thread
+    if( new->signature != THREAD_SIGNATURE )
+    {
+        printk("\n[PANIC] in %s : stack overflow for new thread %x of process %x"
+               " on core %d in cluster %x\n",
+               __FUNCTION__, new->trdid, process->pid , core->lid , local_cxy );
+        hal_core_sleep();
+	}
+
+    // desactivate IRQs
+    hal_disable_irq( &sr_save );
+
+    // loop on all threads to handle pending signals
+    sched_handle_signals( core );
+
+    // check stack overflow for new thread
+    if( new->signature != THREAD_SIGNATURE )
+    {
+        printk("PANIC %s detected stack overflow for thread %x of process %x"
+               " on core %d in cluster %x\n",
+               __FUNCTION__, new->trdid, new->process->pid, core->lid, local_cxy);
+        hal_core_sleep();
+	}
+	
+	sched_dmsg("INFO : %s on core %d in cluster %x / old thread = %x / new thread = %x\n",
+               __FUNCTION__, core->lid, cluster->cxy, current->trdid, new->trdid );
+
+    // switch contexts if new thread
+    hal_cpu_context_save( current );
+    hal_cpu_context_restore( new );
+
+    // restore IRQs
+    hal_restore_irq( sr_save );
+
+	if( current->type != THREAD_USER ) return;
+
+	if( current == core->fpu_owner )  hal_fpu_enable();
+	else                              hal_fpu_disable();
+
+}  // end sched_switch_to()
+
Index: trunk/kernel/kern/scheduler.h
===================================================================
--- trunk/kernel/kern/scheduler.h	(revision 690)
+++ trunk/kernel/kern/scheduler.h	(revision 1)
@@ -2,5 +2,5 @@
  * scheduler.h - Core scheduler definition.
  * 
- * Author    Alain Greiner       (2016,2017,2018,2019,2020)
+ * Author    Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,7 +25,7 @@
 #define _SCHEDULER_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <list.h>
-#include <busylock.h>
+#include <spinlock.h>
 
 /****  Forward declarations  ****/
@@ -34,69 +34,108 @@
 struct thread_s;
 
-/*********************************************************************************************
+/***********************************************************************************************
  * This structure define the scheduler associated to a given core.
- ********************************************************************************************/
+ * WARNING : the idle thread is executed when there is no runable thread in the list 
+ * of attached threads, but is NOT part of the list of attached threads.
+ **********************************************************************************************/
 
 typedef struct scheduler_s
 {
-    busylock_t        lock;            /*! lock protecting scheduler state                  */
-    uint32_t          u_threads_nr;    /*! total number of attached user threads            */
-    uint32_t          k_threads_nr;    /*! total number of attached kernel threads          */
-    list_entry_t      u_root;          /*! root of list of user threads                     */
-    list_entry_t      k_root;          /*! root of list of kernel threads                   */
-    list_entry_t    * u_last;          /*! pointer on list_entry for last executed k_thread */
-    list_entry_t    * k_last;          /*! pointer on list entry for last executed u_thread */
-    struct thread_s * idle;            /*! pointer on idle thread                           */
-    struct thread_s * current;         /*! pointer on current running thread                */
-    volatile bool_t   req_ack_pending; /*! sequencialize ack requests when true             */
-    bool_t            trace;           /*! context switches trace activated if true         */
+    spinlock_t        lock;         /*! readlock protecting lists of threads                  */
+    uint16_t          u_threads_nr; /*! total numbre of attached user threads                 */
+    uint16_t          k_threads_nr; /*! total number of attached kernel threads               */
+    list_entry_t      u_root;       /*! root of list of user threads for this scheduler       */
+    list_entry_t      k_root;       /*! root of list of kernel threads for this scheduler     */
+    list_entry_t    * u_last;       /*! pointer on list_entry for last executed kernel thread */
+    list_entry_t    * k_last;       /*! pointer on list entry for last executed user thread   */
+    struct thread_s * idle;         /*! pointer on idle thread                                */
+    struct thread_s * current;      /*! pointer on current running thread                     */
 }
 scheduler_t;
 
-/*********************************************************************************************
- *  This function initialises the scheduler for a given core.
- ********************************************************************************************/  
+/***********************************************************************************************
+ *  This function initialises the scheduler for a ginen core.
+ **********************************************************************************************/  
 void sched_init( struct core_s * core );
 
-/*********************************************************************************************
- * This function atomically register a new thread in a given core scheduler.
- * Note: There is no specific sched_remove_thread(), as a thread is always deleted
- * by the ched_handle_signals() function, called by the sched_yield() function.
- *********************************************************************************************
+/***********************************************************************************************
+ * This function register a new thread in a given core scheduler.
+ ***********************************************************************************************
  * @ core    : local pointer on the core descriptor.
  * @ thread  : local pointer on the thread descriptor.
- ********************************************************************************************/  
+ **********************************************************************************************/  
 void sched_register_thread( struct core_s   * core,
                             struct thread_s * thread );
 
-/********************************************************************************************* 
- * This function is the only method to make a context switch. It is called in cas of TICK,
- * or when a thread explicitely requires to be descheduled.
- * It takes the scheduler busylock to atomically update the scheduled state.
- * It calls the sched_select() private function to select a new thread. After switch, it 
- * calls the sched_handle_signals() private function to handle the pending REQ_ACK and 
- * REQ_DELETE flagss for all threads attached to the scheduler: it deletes all threads 
- * marked for delete (and the process descriptor when the deleted thread is the main thread).
- * As the REQ_DELETE flag can be asynchronously set (between the select and the handle),
- * the sched_handle-signals() function check that the thread to delete is not the new thread,
- * because a thread cannot delete itself.
- * The cause argument is only used for debug by the sched_display() functions, and indicates
- * the scheduling cause.
- *********************************************************************************************
- * @ cause    : character string defining the scheduling cause.
- ********************************************************************************************/
-void sched_yield( const char * cause );
+/*********************************************************************************************** 
+ *  This function removes a thread from the set of threads attached to a given core.
+ ***********************************************************************************************
+ * @ thread  : local pointer on the thread descriptor.
+ **********************************************************************************************/  
+void sched_remove_thread( struct thread_s * thread );
 
-/********************************************************************************************* 
- * This debug function displays on TXT0 the internal state of a scheduler, 
- * identified by the target cluster identifier <cxy> and the core local index <lid>.
- * It can be called by a thread running in any cluster, as it uses remote accesses,
- * to scan the scheduler lists of threads.
- *********************************************************************************************
- * @ cxy      : target cluster identifier
- * @ lid      : local index of target core.
- ********************************************************************************************/
-void sched_remote_display( cxy_t  cxy,
-                           lid_t  lid );
+/*********************************************************************************************** 
+ * This function handles pending signals for all registered threads, and tries to make 
+ * a context switch for the core running the calling thread.
+ * - If there is a runable thread (other than the current thread or the idle thread),
+ *   the calling thread is descheduled, but its state is not modified.
+ * - If there is no other runable thread, the calling thread continues execution.
+ * - If there is no runable thread, the idle thread is executed.
+ **********************************************************************************************/
+void sched_yield();
+
+/*********************************************************************************************** 
+ * This function handles pending signals for all registered threads, and make 
+ * a context switch to the thread defined by the <thread> argument.
+ * If the selected thread is not attached to the same core as the calling thread,
+ * or is blocked, it causes a kernel panic.
+ ***********************************************************************************************
+ * @ new   : local pointer on the thread to run.
+ **********************************************************************************************/
+void sched_switch_to( struct thread_s * new );
+
+/***********************************************************************************************
+ * This function scan all threads attached to a given core scheduler, and executes
+ * the relevant actions for pending signals, such as the THREAD_SIG_KILL signal.
+ ***********************************************************************************************
+ * @ core    : local pointer on the core descriptor.
+ **********************************************************************************************/
+void sched_handle_signals( struct core_s * core );
+
+/*********************************************************************************************** 
+ * This function is used by the scheduler of a given core to actually kill a thread that has 
+ * the SIG_KILL signal set (following a thread_exit() or a thread_kill() event).
+ * - It checks that the thread has released all locks => panic otherwise...
+ * - It detach the thread from the local process descriptor.
+ * - It removes the thread from the scheduler.
+ * - It release physical memory allocated for thread descriptor.
+ ***********************************************************************************************
+ * @ thread  : local pointer on the thread descriptor.
+ **********************************************************************************************/
+void sched_kill_thread( struct thread_s * thread );
+
+/***********************************************************************************************
+ * This function does NOT modify the scheduler state.
+ * It just select a thread in the list of attached threads, implementing the following policy: 
+ * 1) it scan the list of kernel threads, from the next thread after the last executed one,
+ *    and returns the first runnable found (can be the current thread).
+ * 2) if no kernel thread found, it scan the list of user thread, from the next thread after
+ *    the last executed one, and returns the first runable found (can be the current thread).
+ * 3) if no runable thread found, it returns the idle thread.
+ ***********************************************************************************************
+ * @ core    : local pointer on the core descriptor.
+ * @ returns pointer on selected thread descriptor
+ **********************************************************************************************/
+struct thread_s * sched_select( struct core_s * core );
+
+/*********************************************************************************************** 
+ * This function scan the list of kernel threads to find an idle (blocked) RPC thread.
+ ***********************************************************************************************
+ * @ core    : local pointer on the core descriptor.
+ * @ returns pointer on RPC thread descriptor / returns NULL if no idle RPC thread.
+ **********************************************************************************************/
+struct thread_s * sched_get_rpc_thead( struct core_s * core );
+
+
 
 #endif	/* _SCHEDULER_H_ */
Index: trunk/kernel/kern/signal.c
===================================================================
--- trunk/kernel/kern/signal.c	(revision 1)
+++ trunk/kernel/kern/signal.c	(revision 1)
@@ -0,0 +1,255 @@
+/*
+ * signal.c - signal-management related operations implementation
+ * 
+ * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *         Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <hal_types.h>
+#include <errno.h>
+#include <thread.h>
+#include <process.h>
+#include <core.h>
+#include <signal.h>
+
+SIGNAL_HANDLER(kill_sigaction)
+{
+	struct thread_s *this;
+  
+	this = CURRENT_THREAD;
+	this->state = S_KERNEL;
+
+	printk(INFO, "INFO: Recieved signal %d, pid %d, tid %x, core %d  [ KILLED ]\n",
+	       sig,
+	       this->process->pid,
+	       this,
+	       cpu_get_id());
+
+	sys_thread_exit((void*)EINTR);
+}
+
+//////////////////////////////////////////////////
+void signal_manager_init( process_t * process )
+{
+	memset(&process->sig_mgr, 0, sizeof(process->sig_mgr));
+	process->sig_mgr.sigactions[SIGCHLD] = SIG_IGNORE;
+	process->sig_mgr.sigactions[SIGURG]  = SIG_IGNORE;
+}
+
+////////////////////////////////////////
+error_t signal_init( thread_t * thread )
+{
+	thread->info.sig_state = 0;
+	thread->info.sig_mask  = CURRENT_THREAD->info.sig_mask;
+	return 0;
+}
+
+////////////////////////////////////////////////////
+static error_t signal_rise_all( process_t * process, 
+                                uint32_t    sig )
+{
+	thread_t     * thread;
+	uint32_t       i;
+
+	spinlock_lock( &process->th_lock );
+
+	for( i = 0 ; i < process->th_nr ; i++ )
+	{
+		thread = process->th_tbl[i];
+		hal_atomic_or( &thread->signals , (1 << sig) );
+	}
+
+	spinlock_unlock( &process->th_lock );
+
+	sig_dmsg("\n[INFO] %s : %d threads have been signaled for process %d\n",
+                        __FUNCTION__, process->th_nr , process->pid );
+
+	return 0;
+}
+
+////////////////////////////////////////////////////
+static error_t signal_rise_one( process_t * process,
+                                uint32_t    sig )
+{
+	thread_t * thread;
+
+	spinlock_lock( &process->th_lock );
+
+//mdify to current_thread, not the one pointed by the sig_mgr ?
+	if(process->sig_mgr.handler == NULL)
+		thread = list_first(&process->th_root, struct thread_s, rope);
+	else
+		thread = process->sig_mgr.handler;
+
+	spinlock_lock( &thread->lock );
+	thread->info.sig_state |= (1 << sig);
+	spinlock_unlock( &thread->lock );
+
+	spinlock_unlock( &process->th_lock );
+
+    sig_dmsg("\n[INFO] %s : Thread %u of process %u has received signal %u. sig_state = %x\n",        \
+                        __FUNCTION__, thread_current_cpu(thread)->gid,                          \
+                        process->pid, sig, thread->info.sig_state);
+
+	return 0;
+}
+
+RPC_DECLARE( __signal_rise,                             \
+                RPC_RET( RPC_RET_PTR(error_t, err)),    \
+                RPC_ARG( RPC_ARG_VAL(pid_t,   pid),     \
+                         RPC_ARG_VAL(uint32_t,  sig))     \
+           )
+{
+         process_t   * process;
+        struct hnode_s  *hnode;
+
+        /* Avoid killing process0 and init */
+        /* FIXME: Zero should not be hard-coded but obtains with something like MAIN_KERN */
+        if( ((pid == PID_MIN_GLOBAL) || (pid == PID_MIN_GLOBAL+1))
+                        && (current_cid == 0) )
+        {
+                *err = EPERM;
+                sig_dmsg(1, "%s: can't kill process %u on cluster %u\n",           \
+                                __FUNCTION__, PID_GET_LOCAL(pid), current_cid);
+                goto SYS_RISE_ERR_PID;
+        }
+
+        /* Step 1 : lock the process manager */
+        processs_manager_lock();
+
+        /* Step 2 : Get the process' address */
+        /* Case 1 : current cluster is the anchor and the owner. */
+        if ( PID_GET_CLUSTER(pid) == current_cid )
+        {
+                sig_dmsg(1, "%s: process %u is in the processs manager array of cluster  %u\n",       \
+                                __FUNCTION__, pid, current_cid);
+                process = process_lookup(pid)->process;
+
+        }
+        else /* Case 2 : current cluster is not the anchor, so the struct
+              * process_s is in its hash table.
+              */
+        {
+                sig_dmsg(1, "%s: process %u is in the processs manager hash table of cluster  %u\n",  \
+                                __FUNCTION__, pid, current_cid);
+                hnode = hfind(processs_manager_get_htable(), (void*)pid);
+                process    = ( process_t*) container_of(hnode,          \
+                                 process_t, t_hnode);
+        }
+
+        /* Step 4 : check process' address */
+        if ( process == NULL )
+        {
+                *err = ESRCH;
+                goto SYS_RISE_ERR;
+        }
+
+        /* Step 5 : deliver signal */
+        if((sig == SIGTERM) || (sig == SIGKILL))
+                *err = signal_rise_all(process, sig);
+        else
+                *err = signal_rise_one(process, sig);
+
+        /* Step 6 : unlock processs manager */
+        processs_manager_unlock();
+
+        return;
+
+SYS_RISE_ERR:
+        processs_manager_unlock();
+SYS_RISE_ERR_PID:
+        sig_dmsg(1, "%s: Cluster %u has not deliver signal %u to process %u (err %u)\n",  \
+                        __FUNCTION__, current_cid, sig, err );
+
+        return;
+}
+
+//////////////////////////////////
+error_t signal_rise( pid_t    pid, 
+                     cxy_t    location, 
+                     uint32_t sig)
+{
+	error_t err;
+
+        /* Check location error */
+        if ( location == CID_NULL )
+        {
+                err = ESRCH;
+                printk(WARNING, "%s: there is no process with pid %u\n", \
+                                __FUNCTION__, pid);
+                return err;
+        }
+
+        err = EAGAIN;
+        RCPC( location, RPC_PRIO_SIG_RISE, __signal_rise,       \
+                        RPC_RECV( RPC_RECV_OBJ(err) ),          \
+                        RPC_SEND( RPC_SEND_OBJ(pid),            \
+                                  RPC_SEND_OBJ(sig))            \
+            );
+
+	return err;
+}
+
+////////////////////////////////////
+void signal_notify( thread_s * this)
+{
+	register uint32_t sig_state;
+	register uint32_t sig;
+	register struct sig_mgr_s *sig_mgr;
+	uint32_t irq_state;
+
+	sig_state = this->info.sig_state & this->info.sig_mask;
+	sig       = 0;
+ 
+	while((sig_state != 0) && ((sig_state & 0x1) == 0) && (sig < SIG_NR))
+	{
+		sig ++; 
+		sig_state >>= 1;
+	}
+  
+	if(sig)
+	{
+		cpu_disable_all_irq(&irq_state);
+
+		if(thread_isSignaled(this))
+		{
+			cpu_restore_irq(irq_state);
+			return;
+		}
+
+		thread_set_signaled(this);
+		cpu_restore_irq(irq_state);
+
+		spinlock_lock(&this->lock);
+		this->info.sig_state &= ~(1 << sig);
+		spinlock_unlock(&this->lock);
+
+		sig_mgr = &this->process->sig_mgr;
+
+		if(sig_mgr->sigactions[sig] == SIG_IGNORE)
+			return;
+
+		if(sig_mgr->sigactions[sig] == SIG_DEFAULT)
+			kill_sigaction(sig);
+
+		cpu_signal_notify(this, sig_mgr->sigactions[sig], sig);
+	}
+}
Index: trunk/kernel/kern/signal.h
===================================================================
--- trunk/kernel/kern/signal.h	(revision 1)
+++ trunk/kernel/kern/signal.h	(revision 1)
@@ -0,0 +1,180 @@
+/*
+ * signal.h - signal-management related operations
+ * 
+ * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *         Mohamed Lamine Karaoui (2015) 
+ *         Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SIGNAL_H_
+#define _SIGNAL_H_
+
+#include <hal_types.h>
+
+#define SIG_DEFAULT    (void*)0L
+#define SIG_IGNORE     (void*)1L
+#define SIG_ERROR     -1L
+
+#define SIGHUP     1       /*! hangup */
+#define SIGINT     2       /*! interrupt */
+#define SIGQUIT    3       /*! quit */
+#define SIGILL     4       /*! illegal instruction (not reset when caught) */
+#define SIGTRAP    5       /*! trace trap (not reset when caught) */
+#define SIGIOT     6       /*! IOT instruction */
+#define SIGABRT    6       /*! used by abort, replace SIGIOT in the future */
+#define SIGEMT     7       /*! EMT instruction */
+#define SIGFPE     8       /*! floating point exception */
+#define SIGKILL    9       /*! kill (cannot be caught or ignored) */
+#define SIGBUS     10      /*! bus error */
+#define SIGSEGV    11      /*! segmentation violation */
+#define SIGSYS     12      /*! bad argument to system call */
+#define SIGPIPE    13      /*! write on a pipe with no one to read it */
+#define SIGALRM    14      /*! alarm clock */
+#define SIGTERM    15      /*! software termination signal from kill */
+#define SIGURG     16      /*! urgent condition on IO channel */
+#define SIGSTOP    17      /*! sendable stop signal not from tty */
+#define SIGTSTP    18      /*! stop signal from tty */
+#define SIGCONT    19      /*! continue a stopped process */
+#define SIGCHLD    20      /*! to parent on child stop or exit */
+#define SIGCLD     20      /*! System V name for SIGCHLD */
+#define SIGTTIN    21      /*! to readers pgrp upon background tty read */
+#define SIGTTOU    22      /*! like TTIN for output if (tp->t_local&LTOSTOP) */
+#define SIGIO      23      /*! input/output possible signal */
+#define SIGPOLL    SIGIO   /*! System V name for SIGIO */
+#define SIGXCPU    24      /*! exceeded CPU time limit */
+#define SIGXFSZ    25      /*! exceeded file size limit */
+#define SIGVTALRM  26      /*! virtual time alarm */
+#define SIGPROF    27      /*! profiling time alarm */
+#define SIGWINCH   28      /*! window changed */
+#define SIGLOST    29      /*! resource lost (eg, record-lock lost) */
+#define SIGUSR1    30      /*! user defined signal 1 */
+#define SIGUSR2    31      /*! user defined signal 2 */
+#define SIG_NR     32      /*! signal 0 implied */
+
+#define SIG_DEFAULT_MASK         0xFFEEFFFF
+#define SIG_DEFAULT_STACK_SIZE   2048
+
+/****  Forward declarations  ****/
+
+struct process_s;
+struct thread_s;
+
+typedef uint32_t         sigval_t;
+typedef uint32_t         sigset_t;
+
+/*******************************************************************************************
+ * This structure ...
+ ******************************************************************************************/
+
+typedef struct siginfo_s
+{
+	int      si_signo;    /*! Signal number */
+	int      si_errno;    /*! An errno value */
+	int      si_code;     /*! Signal code */
+	pid_t    si_pid;      /*! Sending process ID */
+	uid_t    si_uid;      /*! Real user ID of sending process */
+	int      si_status;   /*! Exit value or signal */
+	clock_t  si_utime;    /*! User time consumed */
+	clock_t  si_stime;    /*! System time consumed */
+	sigval_t si_value;    /*! Signal value */
+	int      si_int;      /*! POSIX.1b signal */
+	void    *si_ptr;      /*! POSIX.1b signal */
+	void    *si_addr;     /*! Memory location which caused fault */
+	int      si_band;     /*! Band event */
+	int      si_fd;       /*! File descriptor */
+}
+siginfo_t;
+
+/*******************************************************************************************
+ * This structure ...
+ ******************************************************************************************/
+
+typedef void (sa_handler_t) ( uint32_t sig );
+
+typedef struct sigaction_s 
+{
+	sigset_t sa_mask;
+	uint32_t sa_flags;
+	union
+	{ 
+		sa_handler_t *sa_handler;
+		void (*sa_sigaction)(int, siginfo_t *, void *);
+	};
+}
+sigaction_t;
+
+/*******************************************************************************************
+ * This structure TODO
+ ******************************************************************************************/
+
+typedef struct sig_mgr_s
+{
+	sa_handler_t        * sigactions[SIG_NR];
+ ster   struct thread_s     * handler;
+}
+sig_mgr_t;
+
+
+/*******************************************************************************************
+ * This function TODO
+ ******************************************************************************************/
+int sys_signal ( uint32_t       sig, 
+                 sa_handler_t * handler );
+
+/*******************************************************************************************
+ * This function TODO
+ ******************************************************************************************/
+int sys_sigreturn_setup( void * sigreturn_func );
+
+/*******************************************************************************************
+ * This function TODO
+ ******************************************************************************************/
+int sys_kill( pid_t    pid,
+              uint32_t sig );
+
+/*******************************************************************************************
+ * This function TODO
+ ******************************************************************************************/
+error_t signal_manager_init( struct process_s * process );
+
+/*******************************************************************************************
+ * This function TODO
+ ******************************************************************************************/
+error_t signal_init( struct thread_s * thread );
+
+/*******************************************************************************************
+ * This function register the signal <sig> in the bit-vector of all threads of a given
+ * process identified by its <pid>, on all clusters containing a thread .
+ * It can be executed by any thread running in any cluster.
+ ******************************************************************************************/
+error_t signal_rise( pid_t     pid, 
+                     uint32_t  sig );
+
+/*******************************************************************************************
+ * This function TODO
+ ******************************************************************************************/
+void signal_notify( struct thread_s * this);
+
+/*******************************************************************************************
+ * This function do nothing in this implementation.
+ ******************************************************************************************/
+#define signal_manager_destroy(task)
+
+#endif	/*! _SIGNAL_H_ */
Index: trunk/kernel/kern/sys-vfs.h
===================================================================
--- trunk/kernel/kern/sys-vfs.h	(revision 1)
+++ trunk/kernel/kern/sys-vfs.h	(revision 1)
@@ -0,0 +1,58 @@
+/*
+ * kern/sys-vfs.h - exported file management services
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SYS_VFS_H_
+#define _SYS_VFS_H_
+
+#include <types.h>
+#include <vfs.h>
+
+struct vfs_usp_dirent_s;
+
+/* Files related system call */
+int sys_open (char *pathname, uint_t flags, uint_t mode);
+int sys_stat (char *path, struct vfs_stat_s *buf, int fd);
+int sys_creat (char *pathname, uint_t mode);
+int sys_read (uint_t fd, void *buf, size_t count);
+int sys_write (uint_t fd, void *buf, size_t count);
+int sys_lseek (uint_t fd, off_t offset, int whence);
+int sys_unlink (char *pathname);
+int sys_close (uint_t fd);
+
+/* Directories related system call */
+int sys_opendir (char *pathname);
+int sys_mkdir (char *pathname, uint_t mode);
+int sys_rmdir (char *pathname);
+int sys_chdir (char *pathname);
+int sys_readdir (uint_t fd, struct vfs_usp_dirent_s *dirent);
+int sys_closedir (uint_t fd);
+int sys_getcwd (char *buff, size_t size);
+
+/* Common */
+int sys_chmod (char *pathname, uint_t mode);
+int sys_fsync (uint_t fd);
+
+/* Anonymous/Named pipes related system call */
+int sys_pipe (uint_t *pipefd);
+int sys_mkfifo (char *pathname, uint_t mode);
+
+#endif
Index: trunk/kernel/kern/sysconf.c
===================================================================
--- trunk/kernel/kern/sysconf.c	(revision 1)
+++ trunk/kernel/kern/sysconf.c	(revision 1)
@@ -0,0 +1,85 @@
+/*
+ * kern/sysconf.c - interface to access system exported configurations
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <config.h>
+#include <libk.h>
+#include <system.h>
+#include <sysfs.h>
+#include <arch.h>
+#include <pmm.h>
+#include <thread.h>
+#include <sysconf.h>
+
+static sysfs_entry_t sysconf;
+static void sysconf_sysfs_op_init(sysfs_op_t *op);
+
+error_t sysconf_init(void)
+{
+	sysfs_op_t op;
+
+	sysconf_sysfs_op_init(&op);
+	sysfs_entry_init(&sysconf, &op, 
+#if CONFIG_ROOTFS_IS_VFAT
+			 "SYSCONF"
+#else
+			 "sysconf"
+#endif
+		);
+	sysfs_entry_register(&sysfs_root_entry, &sysconf);
+
+	return 0;
+}
+
+static error_t sysconf_sysfs_read_op(sysfs_entry_t *entry, sysfs_request_t *rq, uint_t *offset)
+{
+	struct thread_s *this;
+
+	if(*offset != 0)
+	{
+		*offset   = 0;
+		rq->count = 0;
+		return 0;
+	}
+  
+	this = current_thread;
+
+	sprintk((char*)rq->buffer, 
+		"CLUSTER_ONLN_NR %d\nCPU_ONLN_NR %d\nCPU_CACHE_LINE_SIZE %d\nPAGE_SIZE %d\nHEAP_MAX_SIZE %d\n",
+		arch_onln_cluster_nr(),
+		arch_onln_cpu_nr(), 
+		CACHE_LINE_SIZE, 
+		PMM_PAGE_SIZE,
+		CONFIG_TASK_HEAP_MAX_SIZE);
+  
+	rq->count = strlen((const char*)rq->buffer); 
+	*offset   = 0;
+	return 0;
+}
+
+static void sysconf_sysfs_op_init(sysfs_op_t *op)
+{
+	op->open  = NULL;
+	op->read  = sysconf_sysfs_read_op;
+	op->write = NULL;
+	op->close = NULL;
+}
Index: trunk/kernel/kern/sysconf.h
===================================================================
--- trunk/kernel/kern/sysconf.h	(revision 1)
+++ trunk/kernel/kern/sysconf.h	(revision 1)
@@ -0,0 +1,30 @@
+/*
+ * kern/sysconf.h - interface to access system exported configurations
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SYSCONF_H_
+#define _SYSCONF_H_
+
+#include <types.h>
+
+error_t sysconf_init(void);
+
+#endif	/* _SYSCONF_H_ */
Index: trunk/kernel/kern/thread.c
===================================================================
--- trunk/kernel/kern/thread.c	(revision 690)
+++ trunk/kernel/kern/thread.c	(revision 1)
@@ -1,17 +1,18 @@
 /*
- * thread.c -   thread operations implementation (user & kernel)
- *
+ * thread.c -  implementation of thread operations (user & kernel)
+ * 
  * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
- *         Alain Greiner    (2016,2017,2018,2019,2020)
+ *         Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
  *
- * This file is part of ALMOS-MKH.
+ * This file is part of ALMOS-MKH..
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-MKH. is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-MKH. is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -19,16 +20,14 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_context.h>
 #include <hal_irqmask.h>
 #include <hal_special.h>
 #include <hal_remote.h>
-#include <hal_vmm.h>
-#include <hal_switch.h>
 #include <memcpy.h>
 #include <printk.h>
@@ -36,5 +35,5 @@
 #include <process.h>
 #include <scheduler.h>
-#include <dev_pic.h>
+#include <dev_icu.h>
 #include <core.h>
 #include <list.h>
@@ -44,5 +43,4 @@
 #include <ppm.h>
 #include <thread.h>
-#include <rpc.h>
 
 //////////////////////////////////////////////////////////////////////////////////////
@@ -50,882 +48,323 @@
 //////////////////////////////////////////////////////////////////////////////////////
 
-extern process_t            process_zero;       // allocated in kernel_init.c
-extern char               * lock_type_str[];    // allocated in kernel_init.c
-extern chdev_directory_t    chdev_dir;          // allocated in kernel_init.c
+extern process_t      process_zero;
 
 //////////////////////////////////////////////////////////////////////////////////////
-// This function returns a printable string for the thread type.
+//   global variables for display / must be consistant with enum in "thread.h"
 //////////////////////////////////////////////////////////////////////////////////////
-const char * thread_type_str( thread_type_t type )
-{
-  switch ( type ) {
-  case THREAD_USER:   return "USR";
-  case THREAD_RPC:    return "RPC";
-  case THREAD_DEV:    return "DEV";
-  case THREAD_IDLE:   return "IDL";
-  default:            return "undefined";
-  }
-}
+
+const char* thread_type_name[THREAD_TYPES_NR] =
+{
+	"USER",
+	"RPC"
+	"KERNEL",
+	"IDLE",	
+};
 
 /////////////////////////////////////////////////////////////////////////////////////
-// This static function initializes a thread descriptor (kernel or user).
-// It can be called by the four functions:
+// This static function makes the actual allocation and initialisation for a thread
+// descriptor. It is called by the three functions:
 // - thread_user_create()
-// - thread_user_fork()
+// - thread_user_copy()
 // - thread_kernel_create()
-// - thread_idle_init()
-// The "type" and "trdid" fields must have been previously set.
-// It updates the local DQDT.
 /////////////////////////////////////////////////////////////////////////////////////
-// @ thread          : pointer on local thread descriptor
-// @ process         : pointer on local process descriptor.
-// @ type            : thread type.
-// @ trdid           : thread identifier
-// @ func            : pointer on thread entry function.
-// @ args            : pointer on thread entry function arguments.
-// @ core_lid        : target core local index.
-// @ user_stack_vseg : local pointer on user stack vseg (user thread only)
+// @ new_thread : buffer for new thread pointer.
+// @ process    : local pointer on process descriptor.
+// @ type       : thread type.
+// @ func       : local pointer on thread entry function.
+// @ args       : local pointer on thread entry function arguments.
+// @ core_lid   : target core local index.
 /////////////////////////////////////////////////////////////////////////////////////
-static error_t thread_init( thread_t      * thread,
-                            process_t     * process,
-                            thread_type_t   type,
-                            trdid_t         trdid,
-                            void          * func,
-                            void          * args,
-                            lid_t           core_lid,
-                            vseg_t        * user_stack_vseg )
-{
-
-// check type and trdid fields are initialized
-assert( __FUNCTION__, (thread->type == type)   , "bad type argument" );
-assert( __FUNCTION__, (thread->trdid == trdid) , "bad trdid argument" );
-
-#if DEBUG_THREAD_INIT
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_THREAD_INIT < cycle )
-printk("\n[%s] thread[%x,%x] enter for thread[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, thread->trdid, cycle );
-#endif
-
-    // compute thread descriptor size without kernel stack
-    uint32_t desc_size = (intptr_t)(&thread->signature) - (intptr_t)thread + 4; 
-
+static error_t __thread_create( thread_t     ** new_thread,
+                                process_t     * process,
+                                thread_type_t   type,
+                                void          * func,
+                                void          * args,
+                                lid_t           core_lid,
+                                intptr_t        u_stack_base,
+                                uint32_t        u_stack_size )
+{
+    error_t        error;
+	thread_t     * thread;     // pointer on thread descriptor
+	page_t       * page;       // pointer on page descriptor containing thread descriptor
+	kmem_req_t     req;        // kmem request 
+    trdid_t        trdid;      // allocated thread identifier
+
+	cluster_t    * local_cluster = LOCAL_CLUSTER;
+
+	// allocates memory for thread descriptor + kernel stack
+	req.type  = KMEM_PAGE;
+	req.size  = CONFIG_THREAD_PAGE_ORDER;
+	req.flags = AF_KERNEL | AF_ZERO;
+	page      = kmem_alloc( &req );
+	if( page == NULL ) return ENOMEM;
+
+    // get pointer on new thread descriptor
+	thread = (thread_t *)ppm_page2base( page );
+
+    // register new thread in local process descriptor, and get a TRDID
+    spinlock_lock( &process->th_lock );
+    error = process_register_thread( process, thread , &trdid );
+    spinlock_unlock( &process->th_lock );
+
+    if( error ) 
+    {
+        // release allocated memory for thread descriptor 
+	    req.type  = KMEM_PAGE;
+        req.ptr   = page;
+        kmem_free( &req );
+        return EAGAIN;
+    }
+ 
 	// Initialize new thread descriptor
+    thread->trdid           = trdid;
+	thread->type            = type;  
     thread->quantum         = 0;            // TODO
     thread->ticks_nr        = 0;            // TODO
-    thread->time_last_check = 0;            // TODO
-	thread->core            = &LOCAL_CLUSTER->core_tbl[core_lid];
+    thread->time_last_check = 0;
+	thread->core            = &local_cluster->core_tbl[core_lid];
 	thread->process         = process;
-    thread->busylocks       = 0;
-
-#if DEBUG_BUSYLOCK
-xlist_root_init( XPTR( local_cxy , &thread->busylocks_root ) );
-#endif
-
-    thread->user_stack_vseg = user_stack_vseg;
-    thread->k_stack_base    = (intptr_t)thread + desc_size;
-    thread->k_stack_size    = CONFIG_THREAD_DESC_SIZE - desc_size;
+    thread->page            = page;
+
+    thread->local_locks     = 0;
+    list_root_init( &thread->locks_root );
+
+    thread->remote_locks    = 0;
+    xlist_root_init( XPTR( local_cxy , &thread->xlocks_root ) );
+
+    thread->u_stack_base    = u_stack_base;     
+    thread->u_stack_size    = u_stack_size;
+    thread->k_stack_base    = (intptr_t)thread;     
+    thread->k_stack_size    = CONFIG_PPM_PAGE_SIZE << CONFIG_THREAD_PAGE_ORDER;
+
     thread->entry_func      = func;         // thread entry point
     thread->entry_args      = args;         // thread function arguments
-    thread->flags           = 0;            // all flags reset
+    thread->flags           = 0;            // all flags reset  
+    thread->signals         = 0;            // no pending signal
     thread->errno           = 0;            // no error detected
-    thread->fork_user       = 0;            // no user defined placement for fork
-    thread->fork_cxy        = 0;            // user defined target cluster for fork
-    thread->blocked         = THREAD_BLOCKED_GLOBAL;
-
-    // initialize sched list
+    thread->fork_user       = 0;            // no fork required 
+    thread->fork_cxy        = 0;
+
+    // thread blocked
+    thread->blocked = THREAD_BLOCKED_GLOBAL;
+
+    // reset children list
+    xlist_root_init( XPTR( local_cxy , &thread->children_root ) );
+    thread->children_nr = 0;
+
+    // reset sched list and brothers list
     list_entry_init( &thread->sched_list );
-
-    // initialize the embedded alarm 
-    list_entry_init( &thread->alarm.list );
-
-    // initialize waiting queue entries
-    list_entry_init( &thread->wait_list );
-    xlist_entry_init( XPTR( local_cxy , &thread->wait_xlist ) );
-
-    // initialize thread info
+    xlist_entry_init( XPTR( local_cxy , &thread->brothers_list ) );
+
+    // reset thread info
     memset( &thread->info , 0 , sizeof(thread_info_t) );
-
-    // initialize join_lock
-    remote_busylock_init( XPTR( local_cxy , &thread->join_lock ), LOCK_THREAD_JOIN );
 
     // initialise signature
 	thread->signature = THREAD_SIGNATURE;
 
-    // FIXME define and call an architecture specific hal_thread_init()
-    // function to initialise the save_sr field
-    thread->save_sr = 0xFF13;
-
-    // register new thread in core scheduler
+    // update local DQDT
+    dqdt_local_update_threads( 1 );
+
+    // register new thread in core scheduler 
     sched_register_thread( thread->core , thread );
 
-	// update DQDT 
-    dqdt_increment_threads();
-
-    // nitialize timer alarm
-    alarm_init( &thread->alarm );
-
-#if CONFIG_INSTRUMENTATION_PGFAULTS
-thread->info.false_pgfault_nr    = 0;
-thread->info.false_pgfault_cost  = 0;
-thread->info.false_pgfault_max   = 0;
-thread->info.local_pgfault_nr    = 0;
-thread->info.local_pgfault_cost  = 0;
-thread->info.local_pgfault_max   = 0;
-thread->info.global_pgfault_nr   = 0;
-thread->info.global_pgfault_cost = 0;
-thread->info.global_pgfault_max  = 0;
-#endif
-
-#if DEBUG_THREAD_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_INIT < cycle )
-printk("\n[%s] thread[%x,%x] exit for thread[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, thread->trdid, cycle );
-#endif
-
+    *new_thread = thread;
 	return 0;
-
-} // end thread_init()
-
-//////////////////////////////////////////////////
-error_t thread_user_create( pid_t             pid,
-                            void            * start_func,
-                            void            * start_arg,
+} // end __thread_create()
+
+
+/////////////////////////////////////////////////////////
+error_t thread_user_create( thread_t       ** new_thread,
                             pthread_attr_t  * attr,
-                            thread_t       ** new_thread )
+                            intptr_t          u_stack_base,
+                            uint32_t          u_stack_size )
 {
     error_t        error;
 	thread_t     * thread;       // pointer on created thread descriptor
-    trdid_t        trdid;        // created thred identifier
     process_t    * process;      // pointer to local process descriptor
     lid_t          core_lid;     // selected core local index
-    vseg_t       * us_vseg;      // user stack vseg
-
-assert( __FUNCTION__, (attr != NULL) , "pthread attributes must be defined" );
-
-#if DEBUG_THREAD_USER_CREATE
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enter in cluster %x for process %x / cycle %d\n",
-__FUNCTION__, this->process->pid , this->trdid , local_cxy , pid , cycle );
-#endif
+
+	cluster_t    * local_cluster = LOCAL_CLUSTER;
+
+    // select a target core in local cluster 
+    if( attr->flags & PT_FLAG_CORE_DEFINED ) core_lid = attr->lid;
+    else                                     core_lid = cluster_select_local_core();
+
+    // check core local index
+    if( core_lid >= local_cluster->cores_nr ) return EINVAL;
 
     // get process descriptor local copy
-    process = process_get_local_copy( pid );
-
-    if( process == NULL )
-    {
-		printk("\n[ERROR] in %s : cannot get process descriptor %x\n",
-        __FUNCTION__ , pid );
-        return -1;
-    }
-
-#if( DEBUG_THREAD_USER_CREATE & 1)
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] process descriptor = %x for process %x in cluster %x\n",
-__FUNCTION__, process , pid , local_cxy );
-#endif
-
-    // select a target core in local cluster
-    if( attr->attributes & PT_ATTR_CORE_DEFINED )
-    {
-        core_lid = attr->lid;
-        if( core_lid >= LOCAL_CLUSTER->cores_nr )
-        {
-	        printk("\n[ERROR] in %s : illegal core index attribute = %d\n",
-            __FUNCTION__ , core_lid );
-            return -1;
-        }
-    }
-    else
-    {
-        core_lid = cluster_select_local_core( local_cxy );
-    }
-
-#if( DEBUG_THREAD_USER_CREATE & 1)
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] core[%x,%d] selected\n",
-__FUNCTION__, local_cxy , core_lid );
-#endif
-
-    // allocate memory for thread descriptor
-    thread = kmem_alloc( CONFIG_THREAD_DESC_ORDER , AF_ZERO );
-
-    if( thread == NULL )
-    {
-	    printk("\n[ERROR] in %s : cannot create new thread in cluster %x\n",
-        __FUNCTION__, local_cxy );
-        return -1;
-    }
-
-#if( DEBUG_THREAD_USER_CREATE & 1)
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] new thread descriptor %x allocated\n",
-__FUNCTION__, thread );
-#endif
-
-    // set type in thread descriptor
-    thread->type = THREAD_USER;
-
-    // register new thread in process descriptor, and get a TRDID
-    error = process_register_thread( process, thread , &trdid );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot register new thread in process %x\n",
-        __FUNCTION__, pid );
-        thread_destroy( thread );
-        return -1;
-    }
-
-    // set trdid in thread descriptor 
-    thread->trdid = trdid;
-
-#if( DEBUG_THREAD_USER_CREATE & 1)
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] new thread %x registered in process %x\n",
-__FUNCTION__, trdid, pid );
-#endif
-
-    // allocate a stack from local VMM
-    us_vseg = vmm_create_vseg( process,
-                               VSEG_TYPE_STACK,
-                               LTID_FROM_TRDID( trdid ),
-                               0,                         // size unused
-                               0,                         // file_offset unused
-                               0,                         // file_size unused
-                               XPTR_NULL,                 // mapper_xp unused
-                               local_cxy );
-
-    if( us_vseg == NULL )
-    {
-	    printk("\n[ERROR] in %s : cannot create stack vseg\n", __FUNCTION__ );
-        process_remove_thread( thread );
-        thread_destroy( thread );
-		return -1;
-    }
-
-#if( DEBUG_THREAD_USER_CREATE & 1)
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] stack vseg created / vpn_base %x / %d pages\n",
-__FUNCTION__, us_vseg->vpn_base, us_vseg->vpn_size );
-#endif
-
-    // initialize thread descriptor
-    error = thread_init( thread,
-                         process,
-                         THREAD_USER,
-                         trdid,
-                         start_func,
-                         start_arg,
-                         core_lid,
-                         us_vseg );
-    if( error )
-    {
-	    printk("\n[ERROR] in %s : cannot initialize new thread\n", __FUNCTION__ );
-        vmm_remove_vseg( process , us_vseg );
-        process_remove_thread( thread );
-        thread_destroy( thread );
-        return -1;
-    }
-
-#if( DEBUG_THREAD_USER_CREATE & 1)
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] new thread %x in process %x initialised\n",
-__FUNCTION__, thread->trdid, process->pid );
-#endif
-
-    // set DETACHED flag if required
-    if( attr->attributes & PT_ATTR_DETACH ) 
-    {
-        thread->flags |= THREAD_FLAG_DETACHED;
-    }
-
-    // allocate & initialize CPU context
-	if( hal_cpu_context_alloc( thread ) )
-    {
-	    printk("\n[ERROR] in %s : cannot create CPU context\n", __FUNCTION__ );
-        vmm_remove_vseg( process , us_vseg );
-        process_remove_thread( thread );
-        thread_destroy( thread );
-        return -1;
-    }
-    hal_cpu_context_init( thread,
-                          false , 0 , 0 );   // not a main thread
-
-    // allocate & initialize FPU context
-    if( hal_fpu_context_alloc( thread ) )
-    {
-	    printk("\n[ERROR] in %s : cannot create FPU context\n", __FUNCTION__ );
-        vmm_remove_vseg( process , us_vseg );
-        process_remove_thread( thread );
-        thread_destroy( thread );
-        return -1;
-    }
-    hal_fpu_context_init( thread );
-
-#if( DEBUG_THREAD_USER_CREATE & 1)
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] CPU & FPU contexts created\n",
-__FUNCTION__, thread->trdid );
-hal_vmm_display( XPTR( local_cxy , process ) , true );
-#endif
-
-#if DEBUG_THREAD_USER_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_USER_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] exit / new_thread %x / core %d / cycle %d\n",
-__FUNCTION__, this->process->pid , this->trdid , thread->trdid, core_lid, cycle );
-#endif
+    process = process_get_local_copy( attr->pid );
+    if( process == NULL ) return ENOMEM;
+
+    // make allocation / initialisation
+    error = __thread_create( &thread,
+                             process,
+                             THREAD_USER,
+                             attr->entry_func,
+                             attr->entry_args,
+                             core_lid,
+                             u_stack_base,
+                             u_stack_size );
+    if( error ) return ENOMEM;
+
+    // set LOADABLE flag / set ATTACHED flag if required
+    thread->flags = THREAD_FLAG_LOADABLE;
+    if( attr->flags & PT_FLAG_DETACH ) thread->flags |= THREAD_FLAG_DETACHED;
+
+    // allocate & initialise CPU context 
+	error = hal_cpu_context_create( thread ); 
+    if( error ) return ENOMEM;
+
+    // allocate & initialise FPU context 
+    error = hal_fpu_context_create( thread ); 
+    if( error ) return ENOMEM;
+
+    thread_dmsg("INFO : %s thread %x for process %x on core %d in cluster %x\n", 
+                 __FUNCTION__, thread->trdid, process->pid, core_lid, local_cluster->cxy );
 
     *new_thread = thread;
 	return 0;
-
-}  // end thread_user_create()
-
-///////////////////////////////////////////////////////
-error_t thread_user_fork( xptr_t      parent_thread_xp,
-                          process_t * child_process,
-                          thread_t ** child_thread )
+} // end thread_user_create()
+
+
+/////////////////////////////////////////////////
+error_t thread_user_fork( thread_t ** new_thread,
+                          process_t * process,
+                          intptr_t    u_stack_base,
+                          uint32_t    u_stack_size )
 {
     error_t        error;
-	thread_t     * child_ptr;        // local pointer on child thread
-    trdid_t        child_trdid;      // child thread identifier
-    lid_t          core_lid;         // selected core local index
-    thread_t     * parent_ptr;       // local pointer on remote parent thread
-    cxy_t          parent_cxy;       // parent thread cluster
-    process_t    * parent_process;   // local pointer on parent process
-    xptr_t         parent_gpt_xp;    // extended pointer on parent thread GPT
-    void         * parent_func;      // parent thread entry_func
-    void         * parent_args;      // parent thread entry_args
-    uint32_t       parent_flags;     // parent_thread flags
-    vseg_t       * parent_us_vseg;   // parent thread user stack vseg
-    vseg_t       * child_us_vseg;    // child thread user stack vseg
-
-#if DEBUG_THREAD_USER_FORK
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] enter for child_process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, child_process->pid, cycle );
-#endif
+	thread_t     * new;          // pointer on thread descriptor
+    lid_t          core_lid;     // selected core local index
 
     // select a target core in local cluster
-    core_lid = cluster_select_local_core( local_cxy );
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] selected core [%x,%d]\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, core_lid );
-#endif
-
-    // get cluster and local pointer on parent thread descriptor
-    parent_cxy = GET_CXY( parent_thread_xp );
-    parent_ptr = GET_PTR( parent_thread_xp );
-
-    // get relevant infos from parent thread 
-    parent_func    = (void *)  hal_remote_lpt( XPTR(parent_cxy,&parent_ptr->entry_func ));
-    parent_args    = (void *)  hal_remote_lpt( XPTR(parent_cxy,&parent_ptr->entry_args ));
-    parent_flags   = (uint32_t)hal_remote_l32( XPTR(parent_cxy,&parent_ptr->flags ));
-    parent_us_vseg = (vseg_t *)hal_remote_lpt( XPTR(parent_cxy,&parent_ptr->user_stack_vseg ));
-
-    // get pointer on parent process in parent thread cluster
-    parent_process = (process_t *)hal_remote_lpt( XPTR( parent_cxy,
-                                                        &parent_ptr->process ) );
- 
-    // build extended pointer on parent GPT in parent thread cluster
-    parent_gpt_xp = XPTR( parent_cxy , &parent_process->vmm.gpt );
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] get parent GPT\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // allocate memory for child thread descriptor
-    child_ptr = kmem_alloc( CONFIG_THREAD_DESC_ORDER , AF_ZERO );
-
-    if( child_ptr == NULL )
-    {
-        printk("\n[ERROR] in %s : cannot allocate new thread\n",
-        __FUNCTION__ );
-        return -1;
-    }
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] allocated new thread descriptor %x\n",
-__FUNCTION__, this->process->pid, this->trdid, child_ptr );
-#endif
-
-    // set type in thread descriptor
-    child_ptr->type = THREAD_USER;
-
-    // register new thread in process descriptor, and get a TRDID
-    error = process_register_thread( child_process, child_ptr , &child_trdid );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot register new thread in process %x\n",
-        __FUNCTION__, child_process->pid );
-        thread_destroy( child_ptr );
-        return -1;
-    }
-
-    // set trdid in thread descriptor
-    child_ptr->trdid = child_trdid;
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] registered child thread %x in child process %x\n",
-__FUNCTION__, this->process->pid, this->trdid, child_trdid, child_process->pid );
-#endif
-
-    // get an user stack vseg from local VMM allocator
-    child_us_vseg = vmm_create_vseg( child_process,
-                                     VSEG_TYPE_STACK,
-                                     LTID_FROM_TRDID( child_trdid ),  
-                                     0,                               // size unused
-                                     0,                               // file_offset unused
-                                     0,                               // file_size unused
-                                     XPTR_NULL,                       // mapper_xp unused
-                                     local_cxy );
-    if( child_us_vseg == NULL )
-    {
-	    printk("\n[ERROR] in %s : cannot create stack vseg\n", __FUNCTION__ );
-        process_remove_thread( child_ptr );
-        thread_destroy( child_ptr );
-        return -1;
-    }
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] created an user stack vseg / vpn_base %x / %d pages\n",
-__FUNCTION__, this->process->pid, this->trdid,
-child_us_vseg->vpn_base, child_us_vseg->vpn_size );
-#endif
-
-    // initialize thread descriptor
-    error = thread_init( child_ptr,
-                         child_process,
-                         THREAD_USER,
-                         child_trdid,
-                         parent_func,
-                         parent_args,
-                         core_lid,
-                         child_us_vseg );
-    if( error )
-    {
-	    printk("\n[ERROR] in %s : cannot initialize child thread\n", __FUNCTION__ );
-        vmm_remove_vseg( child_process , child_us_vseg ); 
-        process_remove_thread( child_ptr );
-        thread_destroy( child_ptr );
-        return -1;
-    }
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] initialised thread %x in process %x\n",
-__FUNCTION__, this->process->pid, this->trdid, child_ptr->trdid, child_process->pid );
-#endif
-
-    // set detached flag if required
-    if( parent_flags & THREAD_FLAG_DETACHED ) child_ptr->flags = THREAD_FLAG_DETACHED;
-
-    // allocate a CPU context for child thread
-	if( hal_cpu_context_alloc( child_ptr ) )
-    {
-	    printk("\n[ERROR] in %s : cannot allocate CPU context\n", __FUNCTION__ );
-        vmm_remove_vseg( child_process , child_us_vseg );
-        process_remove_thread( child_ptr );
-        thread_destroy( child_ptr );
-        return -1;
-    }
-
-    // allocate a FPU context for child thread
-	if( hal_fpu_context_alloc( child_ptr ) )
-    {
-	    printk("\n[ERROR] in %s : cannot allocate FPU context\n", __FUNCTION__ );
-        vmm_remove_vseg( child_process , child_us_vseg );
-        process_remove_thread( child_ptr );
-        thread_destroy( child_ptr );
-        return -1;
-    }
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] created CPU & FPU contexts for thread %x in process %x\n",
-__FUNCTION__, this->process->pid, this->trdid, child_ptr->trdid, child_process->pid );
-#endif
-
-    // scan parent GPT, and copy all valid entries
-    // associated to user stack vseg into child GPT
-    vpn_t  parent_vpn;
-    vpn_t  child_vpn;
-    bool_t mapped;
-    ppn_t  ppn;
-    vpn_t  parent_vpn_base = hal_remote_l32( XPTR( parent_cxy, &parent_us_vseg->vpn_base ) );
-    vpn_t  parent_vpn_size = hal_remote_l32( XPTR( parent_cxy, &parent_us_vseg->vpn_size ) );
-    vpn_t  child_vpn_base  = child_us_vseg->vpn_base;
-
-    for( parent_vpn = parent_vpn_base , child_vpn = child_vpn_base ; 
-         parent_vpn < (parent_vpn_base + parent_vpn_size) ;
-         parent_vpn++ , child_vpn++ )
-    {
-        error = hal_gpt_pte_copy( &child_process->vmm.gpt,
-                                  child_vpn,
-                                  parent_gpt_xp,
-                                  parent_vpn,
-                                  true,                 // set cow
-                                  &ppn,
-                                  &mapped );
-        if( error )
-        {
-            printk("\n[ERROR] in %s : cannot update child GPT\n", __FUNCTION__ );
-            vmm_remove_vseg( child_process , child_us_vseg );
-            process_remove_thread( child_ptr );
-            thread_destroy( child_ptr );
-            return -1;
-        }
-
-        // increment pending forks counter for a mapped page 
-        if( mapped )
-        {
-            // get pointers on the page descriptor
-            xptr_t   page_xp  = ppm_ppn2page( ppn );
-            cxy_t    page_cxy = GET_CXY( page_xp );
-            page_t * page_ptr = GET_PTR( page_xp );
-
-            // build extended pointers on forks and lock fields
-            xptr_t forks_xp = XPTR( page_cxy , &page_ptr->forks );
-            xptr_t lock_xp  = XPTR( page_cxy , &page_ptr->lock );
-
-            // get lock protecting page
-            remote_busylock_acquire( lock_xp );  
-
-            // increment the forks counter in page descriptor
-            hal_remote_atomic_add( forks_xp , 1 );
-
-            // release lock protecting page
-            remote_busylock_release( lock_xp );  
-        }
-    }
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] copied STACK vseg PTEs & set COW in child GPT\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // set COW flag for all mapped entries of user stack vseg in parent GPT 
-    hal_gpt_set_cow( parent_gpt_xp,
-                     parent_vpn_base,
-                     parent_vpn_size );
-
-#if (DEBUG_THREAD_USER_FORK & 1)
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] set COW for STACK vseg in parent GPT\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // return child pointer
-    *child_thread = child_ptr;
-
-#if DEBUG_THREAD_USER_FORK
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_USER_FORK < cycle )
-printk("\n[%s] thread[%x,%x] exit / created thread[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-child_ptr->process->pid, child_ptr->trdid, cycle );
-#endif
-
+    core_lid = cluster_select_local_core();
+
+    // get pointer on calling thread descriptor
+    thread_t * this = CURRENT_THREAD;
+
+    // make allocation / initialisation
+    error = __thread_create( &new,
+                             process,
+                             THREAD_USER,
+                             this->entry_func,
+                             this->entry_args,
+                             core_lid,
+                             u_stack_base,
+                             u_stack_size );
+    if( error ) return ENOMEM;
+
+    // set ATTACHED flag if set in this thread
+    if( this->signals & THREAD_FLAG_DETACHED ) new->signals = THREAD_FLAG_DETACHED;
+
+    // allocate & initialise CPU context from calling thread
+	error = hal_cpu_context_copy( new , this ); 
+    if( error ) return ENOMEM;
+
+    // allocate & initialise FPU context from calling thread
+	error = hal_fpu_context_copy( new , this ); 
+    if( error ) return ENOMEM;
+
+    thread_dmsg("INFO : %s thread %x for process %x on core %d in cluster %x\n", 
+                 __FUNCTION__, new->trdid, process->pid, core_lid, local_cluster->cxy );
+
+    *new_thread = new;
 	return 0;
-
-}  // end thread_user_fork()
-
-/////////////////////////////////////
-void thread_user_exec( uint32_t argc,
-                       intptr_t argv )
-{
-    thread_t  * thread  = CURRENT_THREAD;
-    process_t * process = thread->process;
-
-#if DEBUG_THREAD_USER_EXEC
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_USER_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] enter / argc %d / argv %x / cycle %d\n",
-__FUNCTION__, process->pid, thread->trdid, argc, argv, cycle );
-#endif
-
-// check parent thread attributes
-assert( __FUNCTION__, (thread->type      == THREAD_USER )     , "bad type" );
-assert( __FUNCTION__, (thread->signature == THREAD_SIGNATURE) , "bad signature" );
-assert( __FUNCTION__, (thread->busylocks == 0)                , "bad busylocks" );
-
-	// re-initialize various thread descriptor fields
-    thread->quantum         = 0;                               // TODO
-    thread->ticks_nr        = 0;                               // TODO
-    thread->time_last_check = 0;                               // TODO
-    thread->entry_func      = (void*)process->vmm.entry_point;
-    thread->flags           = THREAD_FLAG_DETACHED;            // main always detached
-    thread->blocked         = 0;
-    thread->errno           = 0;
-    thread->fork_user       = 0;
-    thread->fork_cxy        = 0;
-
-    // reset thread info
-    memset( &thread->info , 0 , sizeof(thread_info_t) );
-
-    // re-initialize join_lock
-    remote_busylock_init( XPTR( local_cxy , &thread->join_lock ), LOCK_THREAD_JOIN );
-
-    // release FPU ownership if required
-    if( thread->core->fpu_owner == thread ) thread->core->fpu_owner = NULL;
-
-    // initialize thread FPU context
-    hal_fpu_context_init( thread );
-
-    // initialize thread CPU context 
-    hal_cpu_context_init( thread,
-                          true,          // main thread
-                          argc,
-                          argv );  
-
-#if DEBUG_THREAD_USER_EXEC
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_USER_EXEC < cycle )
-{
-    printk("\n[%s] thread[%x,%x] set CPU context & jump to user code / cycle %d\n",
-    __FUNCTION__, process->pid, thread->trdid, cycle );
-
-    hal_cpu_context_display( XPTR( local_cxy , thread ) );
-    hal_vmm_display( XPTR( local_cxy , process ) , true );
-}
-#endif
-
-    // restore CPU registers => jump to user code
-    hal_do_cpu_restore( thread->cpu_context );
-
-}  // end thread_user_exec()
+} // end thread_user_fork()
+
+
 
 /////////////////////////////////////////////////////////
 error_t thread_kernel_create( thread_t     ** new_thread,
                               thread_type_t   type,
-                              void          * func,
-                              void          * args,
+                              void          * func, 
+                              void          * args, 
 				              lid_t           core_lid )
 {
     error_t        error;
-	thread_t     * thread;       // pointer on new thread descriptor
-    trdid_t        trdid;        // new thread identifier
-
-    thread_t * this = CURRENT_THREAD; 
-
-assert( __FUNCTION__, ( (type == THREAD_IDLE) || (type == THREAD_RPC) || (type == THREAD_DEV) ) ,
-"illegal thread type" );
-
-assert( __FUNCTION__, (core_lid < LOCAL_CLUSTER->cores_nr) ,
-"illegal core_lid" );
-
-#if DEBUG_THREAD_KERNEL_CREATE
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_KERNEL_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enter / requested_type %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, thread_type_str(type), cycle );
-#endif
-
-    // allocate memory for new thread descriptor
-    thread = kmem_alloc( CONFIG_THREAD_DESC_ORDER , AF_ZERO );
-
-    if( thread == NULL )
-    {
-        printk("\n[ERROR] in %s : thread %x in process %x\n"
-        "   no memory for thread descriptor\n",
-        __FUNCTION__, this->trdid, this->process->pid );
-        return ENOMEM;
-    }
-
-    // set type in thread descriptor
-    thread->type = type;
-
-    // register new thread in local kernel process descriptor, and get a TRDID
-    error = process_register_thread( &process_zero , thread , &trdid );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s : cannot register thread in kernel process\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // set trdid in thread descriptor
-    thread->trdid = trdid;
-
-    // initialize thread descriptor
-    error = thread_init( thread,
-                         &process_zero,
-                         type,
-                         trdid,
-                         func,
-                         args,
-                         core_lid,
-                         NULL );  // no user stack for a kernel thread
-
-    if( error ) // release allocated memory for thread descriptor
-    {
-        printk("\n[ERROR] in %s : cannot initialize thread descriptor\n", __FUNCTION__ );
-        thread_destroy( thread );
-        return ENOMEM;
-    }
-
-    // allocate & initialize CPU context
-	error = hal_cpu_context_alloc( thread );
-
-    if( error )
-    {
-        printk("\n[ERROR] in %s : thread %x in process %x\n"
-        "    cannot create CPU context\n",
-        __FUNCTION__, this->trdid, this->process->pid );
-        thread_destroy( thread );
-        return EINVAL;
-    }
-
-    hal_cpu_context_init( thread,
-                          false , 0 , 0 );  // not a main thread
-
-#if DEBUG_THREAD_KERNEL_CREATE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_KERNEL_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] exit / new_thread %x / type %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, thread, thread_type_str(type), cycle );
-#endif
-
-    *new_thread = thread;
+	thread_t     * new;        // pointer on new thread descriptor
+
+    cluster_t    * local_cluster = LOCAL_CLUSTER;
+
+    // check type argument
+    if( (type != THREAD_KERNEL) && (type != THREAD_RPC) && 
+        (type != THREAD_IDLE) && (type != THREAD_DEV) )
+    {
+        printk("ERROR : %s received an illegal thread type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // check core local index
+    if( core_lid >= local_cluster->cores_nr )
+    {
+        printk("ERROR : %s received an illegal core_lid\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // make allocation / initialisation
+    error = __thread_create( &new,
+                             &process_zero,
+                             type,
+                             func,
+                             args,
+                             core_lid,
+                             0 , 0 );  // no user stack for a kernel thread
+    if( error ) 
+    {
+        printk("ERROR : %s cannot create thread\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // allocate & initialise CPU context
+	hal_cpu_context_create( new ); 
+
+    thread_dmsg("INFO : %s thread %x in cluster %x on core %d\n", 
+                 __FUNCTION__ , new->trdid , local_cluster->cxy , core_lid );
+
+    *new_thread = new; 
 	return 0;
-
 } // end thread_kernel_create()
 
-//////////////////////////////////////////////
-void thread_idle_init( thread_t      * thread,
-                       thread_type_t   type,
-                       void          * func,
-                       void          * args,
-	                   lid_t           core_lid )
-{
-    trdid_t trdid;   
-    error_t error;
-
-// check arguments
-assert( __FUNCTION__, (type == THREAD_IDLE),
-"illegal thread type" );
-
-assert( __FUNCTION__, (core_lid < LOCAL_CLUSTER->cores_nr),
-"illegal core index" );
-
-    // set type in thread descriptor
-    thread->type = THREAD_IDLE;
-
-    // register idle thread in local kernel process descriptor, and get a TRDID
-    error = process_register_thread( &process_zero , thread , &trdid );
-
-assert( __FUNCTION__, (error == 0),
-"cannot register idle_thread in kernel process" );
-
-    // set trdid in thread descriptor
-    thread->trdid = trdid;
-
-    // initialize thread descriptor
-    error = thread_init( thread,
-                         &process_zero,
-                         THREAD_IDLE,
-                         trdid,
-                         func,
-                         args,
-                         core_lid,
-                         NULL );   // no user stack for a kernel thread
-
-assert( __FUNCTION__, (error == 0),
-"cannot initialize idle_thread" );
-
-    // allocate CPU context 
-    error = hal_cpu_context_alloc( thread );
-
-assert( __FUNCTION__,(error == 0),
-"cannot allocate CPU context" );
-
-    // initialize CPU context
-    hal_cpu_context_init( thread,
-                          false , 0 , 0 );   // not a main thread
-
-}  // end thread_idle_init()
-
-////////////////////////////////////////////
-uint32_t thread_destroy( thread_t * thread )
-{
-    reg_t           save_sr;
-    uint32_t        count;
-
-    thread_type_t   type    = thread->type;
-    process_t     * process = thread->process;
-    core_t        * core    = thread->core;
-
-#if DEBUG_THREAD_DESTROY 
-uint32_t   cycle;
-thread_t * this  = CURRENT_THREAD;
-#endif
-
-#if (DEBUG_THREAD_DESTROY & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] enter to destroy thread[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, thread->trdid, cycle );
-#endif
-
-    // check calling thread busylocks counter
-    thread_assert_can_yield( thread , __FUNCTION__ );
-
-#if CONFIG_INSTRUMENTATION_PGFAULTS
-process->vmm.false_pgfault_nr    += thread->info.false_pgfault_nr;
-process->vmm.false_pgfault_cost  += thread->info.false_pgfault_cost;
-process->vmm.local_pgfault_nr    += thread->info.local_pgfault_nr;
-process->vmm.local_pgfault_cost  += thread->info.local_pgfault_cost;
-process->vmm.global_pgfault_nr   += thread->info.global_pgfault_nr;
-process->vmm.global_pgfault_cost += thread->info.global_pgfault_cost;
-#endif
-
-#if (CONFIG_INSTRUMENTATION_PGFAULTS & 1)
-uint32_t false_nr    = thread->info.false_pgfault_nr;
-uint32_t false_cost  = thread->info.false_pgfault_cost;
-uint32_t false_max   = thread->info.false_pgfault_max;
-uint32_t false_one   = false_nr  ? (false_cost  / false_nr ) : 0;
-
-uint32_t local_nr    = thread->info.local_pgfault_nr;
-uint32_t local_cost  = thread->info.local_pgfault_cost;
-uint32_t local_max   = thread->info.local_pgfault_max;
-uint32_t local_one   = local_nr  ? (local_cost  / local_nr ) : 0;
-
-uint32_t global_nr   = thread->info.global_pgfault_nr;
-uint32_t global_cost = thread->info.global_pgfault_cost;
-uint32_t global_max  = thread->info.global_pgfault_max;
-uint32_t global_one  = global_nr ? (global_cost / global_nr) : 0;
-
-printk("\n***** thread[%x,%x] page faults\n"
-       " - false  : %d events / cost %d cycles / max %d cycles\n"
-       " - local  : %d events / cost %d cycles / max %d cycles\n"
-       " - global : %d events / cost %d cycles / max %d cycles\n",
-       thread->process->pid, thread->trdid,
-       false_nr , false_one , false_max,
-       local_nr , local_one , local_max,
-       global_nr, global_one, global_max );
-#endif
-
-    // unlink embedded alarm from the list rooted in core when required
-    list_entry_t * entry = &thread->alarm.list;
-    if( (entry->next != NULL) || (entry->pred != NULL) )  list_unlink( entry );
-
-    // remove thread from process th_tbl[]
-    count = process_remove_thread( thread );
+
+///////////////////////////////////////////////////////////////////////////////////////
+// TODO: check that all memory dynamically allocated during thread execution
+// has been released, using a cache of mmap and malloc requests. [AG]
+///////////////////////////////////////////////////////////////////////////////////////
+void thread_destroy( thread_t * thread )
+{
+	uint32_t     tm_start;
+	uint32_t     tm_end;
+    uint32_t     state;
+
+    process_t  * process    = thread->process;
+    core_t     * core       = thread->core;
+
+    if( thread->children_nr )
+    {
+        printk("\n[PANIC] in %s : thread %x for process %x on core %d in cluster %x"
+               " has still attached children\n",
+               __FUNCTION__, thread->trdid, process->pid, core->lid, local_cxy );
+        hal_core_sleep();
+    }
+
+    if( (thread->local_locks != 0) || (thread->remote_locks != 0) )
+    {
+        printk("\n[PANIC] in %s : thread %x for process %x on core %d in cluster %x"
+               " did not released all locks\n",
+               __FUNCTION__, thread->trdid, process->pid, core->lid, local_cxy );
+        hal_core_sleep();
+    }
+    
+	tm_start = hal_time_stamp();
+
+    // update intrumentation values
+    uint32_t pgfaults = thread->info.pgfault_nr;
+    uint32_t u_errors = thread->info.u_err_nr;
+    uint32_t m_errors = thread->info.m_err_nr;
+
+	process->vmm.pgfault_nr += pgfaults;
+	process->vmm.u_err_nr   += u_errors;
+	process->vmm.m_err_nr   += m_errors;
 
     // release memory allocated for CPU context and FPU context
@@ -933,9 +372,7 @@
 	hal_fpu_context_destroy( thread );
 	
-    // release user stack vseg (for an user thread only)
-    if( type == THREAD_USER )  vmm_remove_vseg( process , thread->user_stack_vseg );
-
-    // release FPU ownership if required
-	hal_disable_irq( &save_sr );
+    // release FPU if required
+    // TODO This should be done before calling thread_destroy()
+	hal_disable_irq( &state );
 	if( core->fpu_owner == thread )
 	{
@@ -943,604 +380,229 @@
 		hal_fpu_disable();
 	}
-	hal_restore_irq( save_sr );
-
+	hal_restore_irq( state );
+
+    // remove thread from process th_tbl[] 
+    // TODO This should be done before calling thread_destroy()
+    ltid_t ltid = LTID_FROM_TRDID( thread->trdid );
+
+	spinlock_lock( &process->th_lock );
+	process->th_tbl[ltid] = XPTR_NULL;
+	process->th_nr--;
+	spinlock_unlock( &process->th_lock );
+	
     // invalidate thread descriptor
 	thread->signature = 0;
 
-    // release memory for thread descriptor (including kernel stack)
-    kmem_free( thread , CONFIG_THREAD_DESC_ORDER );
-
-#if DEBUG_THREAD_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] exit / destroyed thread[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, thread->trdid, cycle );
-#endif
-
-    return count;
-
-}   // end thread_destroy()
-
-//////////////////////////////////////////////////
-inline void thread_set_req_ack( thread_t * target,
-                                uint32_t * rsp_count )
-{
-    reg_t    save_sr;   // for critical section
-
-    // get pointer on target thread scheduler
-    scheduler_t * sched = &target->core->scheduler;
-
-    // wait scheduler ready to handle a new request
-    while( sched->req_ack_pending ) asm volatile( "nop" );
+    // release memory for thread descriptor
+	kmem_req_t   req; 
+	req.type     = KMEM_PAGE; 
+	req.ptr      = ppm_base2page( thread );
+	kmem_free(&req);
+
+	tm_end = hal_time_stamp();
+
+	thread_dmsg("INFO : %s destroy thread %x for process %x on core %d in cluster %x\n"
+                 " / duration = %d / page_faults = %d / ticks = %d\n",
+	               __FUNCTION__, trdid , pid , core_lid , local_cxy ,
+	               tm_end - tm_start , pgfaults , ticks );
+
+}  // end thread_destroy()
+
+
+/////////////////////////////////////////////////
+void thread_child_parent_link( xptr_t  xp_parent,
+                               xptr_t  xp_child )
+{
+    // get extended pointers on children list root 
+    cxy_t      parent_cxy = GET_CXY( xp_parent );    
+    thread_t * parent_ptr = (thread_t *)GET_PTR( xp_parent );
+    xptr_t     root       = XPTR( parent_cxy , &parent_ptr->children_root );
+
+    // get extended pointer on children list entry 
+    cxy_t      child_cxy  = GET_CXY( xp_child );    
+    thread_t * child_ptr  = (thread_t *)GET_PTR( xp_child );
+    xptr_t     entry      = XPTR( child_cxy , &child_ptr->brothers_list );
+
+    // set the link
+    xlist_add_first( root , entry );
+    hal_remote_atomic_add( XPTR( parent_cxy , &parent_ptr->children_nr ) , 1 );
+} 
+
+///////////////////////////////////////////////////
+void thread_child_parent_unlink( xptr_t  xp_parent,
+                                 xptr_t  xp_child )
+{
+    // get extended pointer on children list lock
+    cxy_t      parent_cxy = GET_CXY( xp_parent );    
+    thread_t * parent_ptr = (thread_t *)GET_PTR( xp_parent );
+    xptr_t     lock       = XPTR( parent_cxy , &parent_ptr->children_lock );
+
+    // get extended pointer on children list entry 
+    cxy_t      child_cxy  = GET_CXY( xp_child );    
+    thread_t * child_ptr  = (thread_t *)GET_PTR( xp_child );
+    xptr_t     entry      = XPTR( child_cxy , &child_ptr->brothers_list );
+
+    // get the lock
+    remote_spinlock_lock( lock );
+
+    // remove the link
+    xlist_unlink( entry );
+    hal_remote_atomic_add( XPTR( parent_cxy , &parent_ptr->children_nr ) , -1 );
     
-    // enter critical section
-    hal_disable_irq( &save_sr );
-      
-    // set request in target thread scheduler
-    sched->req_ack_pending = true;
-
-    // set ack request in target thread "flags"
-    hal_atomic_or( &target->flags , THREAD_FLAG_REQ_ACK );
-
-    // set pointer on responses counter in target thread
-    target->ack_rsp_count = rsp_count;
-    
-    // exit critical section
-    hal_restore_irq( save_sr );
-
-    hal_fence();
-
-}  // thread_set_req_ack()
-
-/////////////////////////////////////////////////////
-inline void thread_reset_req_ack( thread_t * target )
-{
-    reg_t    save_sr;   // for critical section
-
-    // get pointer on target thread scheduler
-    scheduler_t * sched = &target->core->scheduler;
-
-    // check signal pending in scheduler
-    assert( __FUNCTION__, sched->req_ack_pending , "no pending signal" );
-    
-    // enter critical section
-    hal_disable_irq( &save_sr );
-      
-    // reset signal in scheduler
-    sched->req_ack_pending = false;
-
-    // reset signal in thread "flags"
-    hal_atomic_and( &target->flags , ~THREAD_FLAG_REQ_ACK );
-
-    // reset pointer on responses counter 
-    target->ack_rsp_count = NULL;
-    
-    // exit critical section
-    hal_restore_irq( save_sr );
-
-    hal_fence();
-
-}  // thread_reset_req_ack()
-
-//////////////////////////////////////
-void thread_block( xptr_t   thread_xp,
-                   uint32_t cause )
+    // release the lock
+    remote_spinlock_unlock( lock );
+}
+
+/////////////////////////////////////////////////
+inline void thread_set_signal( thread_t * thread,
+                               uint32_t   mask )
+{
+    hal_atomic_or( &thread->signals , mask );
+}
+ 
+///////////////////////////////////////////////////
+inline void thread_reset_signal( thread_t * thread,
+                                 uint32_t   mask )
+{
+    hal_atomic_and( &thread->signals , ~mask );
+}
+ 
+//////////////////////////////////
+inline bool_t thread_is_joinable()
+{
+    thread_t * this = CURRENT_THREAD;
+    return( (this->brothers_list.next != XPTR_NULL) &&
+            (this->brothers_list.pred != XPTR_NULL) );
+}
+
+//////////////////////////////////
+inline bool_t thread_is_runnable()
+{
+    thread_t * this = CURRENT_THREAD;
+    return( this->blocked == 0 );
+}
+
+////////////////////////////////
+inline bool_t thread_can_yield()
+{
+    thread_t * this = CURRENT_THREAD;
+    return ( (this->local_locks == 0) && (this->remote_locks == 0) );
+}
+
+///////////////////////////
+bool_t thread_check_sched()
+{
+	thread_t * this = CURRENT_THREAD;
+
+    // check locks count
+	if( (this->local_locks != 0) || (this->remote_locks != 0) ) return false;
+
+    // compute elapsed time, taking into account 32 bits register wrap
+    uint32_t elapsed;
+    uint32_t time_now   = hal_time_stamp();
+    uint32_t time_last  = this->time_last_check;
+    if( time_now < time_last ) elapsed = (0xFFFFFFFF - time_last) + time_now;
+	else                       elapsed = time_now - time_last;
+
+    // update thread time
+    this->time_last_check = time_now;
+
+	// check elapsed time
+	if( elapsed < CONFIG_CORE_CHECK_EVERY ) return false;
+    else                                    return true;
+}
+
+/////////////////////
+error_t thread_exit()
+{
+    uint32_t   sr_save;
+
+	thread_t * this = CURRENT_THREAD;
+
+    // test if this thread can be descheduled
+	if( !thread_can_yield() )
+	{
+        printk("ERROR in %s : thread %x in process %x on core %d in cluster %x\n"
+               " did not released all locks\n",
+               __FUNCTION__ , this->trdid , this->process->pid ,
+               CURRENT_CORE->lid , local_cxy );
+        return EINVAL;
+    }
+
+    if( this->flags & THREAD_FLAG_DETACHED )
+    {
+        // if detached set signal and set blocking cause atomically
+        hal_disable_irq( &sr_save );
+        thread_set_signal( this , THREAD_SIG_KILL );
+        thread_block( this , THREAD_BLOCKED_EXIT );
+        hal_restore_irq( sr_save );
+    }
+    else 
+    {
+        // if attached, set blocking cause 
+        thread_block( this , THREAD_BLOCKED_EXIT );
+    }
+
+    // deschedule
+    sched_yield();
+    return 0;
+
+} // end thread_exit()
+
+/////////////////////////////////////
+void thread_block( thread_t * thread,
+                   uint32_t   cause )
+{
+    // set blocking cause 
+    hal_atomic_or( &thread->blocked , cause );
+
+}  // end thread_block()
+
+////////////////////////////////////
+void thread_unblock( xptr_t   thread,
+                    uint32_t cause )
 {
     // get thread cluster and local pointer
-    cxy_t      cxy = GET_CXY( thread_xp );
-    thread_t * ptr = GET_PTR( thread_xp );
-
-    // set blocking cause
-    hal_remote_atomic_or( XPTR( cxy , &ptr->blocked ) , cause );
-    hal_fence();
-
-#if DEBUG_THREAD_BLOCK
-uint32_t    cycle   = (uint32_t)hal_get_cycles();
-process_t * process = hal_remote_lpt( XPTR( cxy , &ptr->process ) );
-thread_t  * this    = CURRENT_THREAD;
-if( DEBUG_THREAD_BLOCK < cycle )
-printk("\n[%s] thread[%x,%x] blocked thread %x in process %x / cause %x\n",
-__FUNCTION__, this->process->pid, this->trdid,
-ptr->trdid, hal_remote_l32(XPTR( cxy , &process->pid )), cause );
-#endif
-
-} // end thread_block()
-
-////////////////////////////////////////////
-uint32_t thread_unblock( xptr_t   thread_xp,
-                         uint32_t cause )
-{
-    // get thread cluster and local pointer
-    cxy_t      cxy = GET_CXY( thread_xp );
-    thread_t * ptr = GET_PTR( thread_xp );
+    cxy_t      cxy = GET_CXY( thread ); 
+    thread_t * ptr = (thread_t *)GET_PTR( thread );
 
     // reset blocking cause
-    uint32_t previous = hal_remote_atomic_and( XPTR( cxy , &ptr->blocked ) , ~cause );
-    hal_fence();
-
-#if DEBUG_THREAD_BLOCK
-uint32_t    cycle   = (uint32_t)hal_get_cycles();
-process_t * process = hal_remote_lpt( XPTR( cxy , &ptr->process ) );
-thread_t  * this    = CURRENT_THREAD;
-if( DEBUG_THREAD_BLOCK < cycle )
-printk("\n[%s] thread[%x,%x] unblocked thread %x in process %x / cause %x\n",
-__FUNCTION__, this->process->pid, this->trdid,
-ptr->trdid, hal_remote_l32(XPTR( cxy , &process->pid )), cause );
-#endif
-
-    // return a non zero value if the cause bit is modified 
-    return( previous & cause );
+    hal_remote_atomic_and( XPTR( cxy , &ptr->blocked ) , ~cause );
 
 }  // end thread_unblock()
 
-//////////////////////////////////////////////
-void thread_delete_request( xptr_t  target_xp,
-                            bool_t  is_forced )
-{
-    reg_t       save_sr;                // for critical section
-    bool_t      target_join_done;       // joining thread arrived first
-    bool_t      target_attached;        // target thread attached
-    xptr_t      killer_xp;              // extended pointer on killer thread (this)
-    thread_t  * killer_ptr;             // pointer on killer thread (this)
-    cxy_t       target_cxy;             // target thread cluster     
-    thread_t  * target_ptr;             // pointer on target thread
-    process_t * target_process;         // pointer on target process
-    pid_t       target_pid;             // target process identifier
-    xptr_t      target_flags_xp;        // extended pointer on target thread <flags>
-    xptr_t      target_join_lock_xp;    // extended pointer on target thread <join_lock>
-    xptr_t      target_join_xp_xp;      // extended pointer on target thread <join_xp>
-    trdid_t     target_trdid;           // target thread identifier
-    ltid_t      target_ltid;            // target thread local index
-    uint32_t    target_flags;           // target thread flags
-    xptr_t      joining_xp;             // extended pointer on joining thread
-    thread_t  * joining_ptr;            // local pointer on joining thread
-    cxy_t       joining_cxy;            // joining thread cluster
-
-    // get target thread cluster and local pointer
-    target_cxy      = GET_CXY( target_xp );
-    target_ptr      = GET_PTR( target_xp );
-
-    // get target thread trdid, ltid, flags, and process PID
-    target_trdid    = hal_remote_l32( XPTR( target_cxy , &target_ptr->trdid ) );
-    target_ltid     = LTID_FROM_TRDID( target_trdid );
-    target_flags_xp = XPTR( target_cxy , &target_ptr->flags );
-    target_flags    = hal_remote_l32( target_flags_xp );
-    target_process  = hal_remote_lpt( XPTR( target_cxy , &target_ptr->process ) );
-    target_pid      = hal_remote_l32( XPTR( target_cxy , &target_process->pid ) );
-    target_attached = ((target_flags & THREAD_FLAG_DETACHED) == 0); 
-
-    // get killer thread pointers
-    killer_ptr = CURRENT_THREAD;
-    killer_xp  = XPTR( local_cxy , killer_ptr );
-
-#if DEBUG_THREAD_DELETE
-uint32_t cycle  = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_DELETE < cycle )
-printk("\n[%s] killer[%x,%x] enters / target[%x,%x] / forced %d / flags %x / cycle %d\n",
-__FUNCTION__, killer_ptr->process->pid, killer_ptr->trdid,  
-target_pid, target_trdid, is_forced, target_flags, cycle );
-#endif
-
-// check target thread is not the main thread, because the main thread
-// must be deleted by the parent process sys_wait() function
-assert( __FUNCTION__, ((CXY_FROM_PID( target_pid ) != target_cxy) || (target_ltid != 0)),
-"target thread cannot be the main thread" );
-
-    // check killer thread can yield 
-    thread_assert_can_yield( killer_ptr , __FUNCTION__ ); 
-
-    // if the target thread is attached, we must synchonize with the joining thread
-    // before blocking and marking the target thead for delete.
-
-    if( target_attached && (is_forced == false) ) // synchronize with joining thread 
-    {
-        // build extended pointers on target thread join fields
-        target_join_lock_xp  = XPTR( target_cxy , &target_ptr->join_lock );
-        target_join_xp_xp    = XPTR( target_cxy , &target_ptr->join_xp );
-
-        // enter critical section
-        hal_disable_irq( &save_sr );
-
-        // take the join_lock in target thread descriptor
-        remote_busylock_acquire( target_join_lock_xp );
-
-        // get join_done from target thread descriptor
-        target_join_done = ((hal_remote_l32( target_flags_xp ) & THREAD_FLAG_JOIN_DONE) != 0);
-    
-        if( target_join_done )                     // joining thread arrived first
-        {
-            // get extended pointer on joining thread
-            joining_xp  = (xptr_t)hal_remote_l64( target_join_xp_xp );
-
-            // get cluster and local pointer on joining thread
-            joining_ptr = GET_PTR( joining_xp );
-            joining_cxy = GET_CXY( joining_xp );
-
-            // copy exit_status from target thread to joining thread, because
-            // target thread may be deleted before joining thread resume
-            void * status = hal_remote_lpt( XPTR( target_cxy , &target_ptr->exit_status ) );
-            hal_remote_spt( XPTR( joining_cxy , &joining_ptr->exit_status ) , status );
-            
-            // reset the join_done flag in target thread
-            hal_remote_atomic_and( target_flags_xp , ~THREAD_FLAG_JOIN_DONE );
-
-            // unblock the joining thread
-            thread_unblock( joining_xp , THREAD_BLOCKED_JOIN );
-
-            // release the join_lock in target thread descriptor
-            remote_busylock_release( target_join_lock_xp );
-
-            // block the target thread 
-            thread_block( target_xp , THREAD_BLOCKED_GLOBAL );
-
-            // set the REQ_DELETE flag in target thread descriptor
-            hal_remote_atomic_or( target_flags_xp , THREAD_FLAG_REQ_DELETE );
-
-            // exit critical section
-            hal_restore_irq( save_sr );
-
-#if DEBUG_THREAD_DELETE
-cycle  = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_DELETE < cycle )
-printk("\n[%s] killer[%x,%x] exit / target[%x,%x] marked after join / cycle %d\n",
-__FUNCTION__, killer_ptr->process->pid, killer_ptr->trdid,
-target_pid, target_trdid, cycle );
-#endif
-
-        }
-        else                                      // killer thread arrived first
-        {
-            // set the kill_done flag in target thread
-            hal_remote_atomic_or( target_flags_xp , THREAD_FLAG_KILL_DONE );
-
-            // block target thread on BLOCKED_JOIN
-            thread_block( killer_xp , THREAD_BLOCKED_JOIN );
-
-            // set extended pointer on killer thread in target thread
-            hal_remote_s64( target_join_xp_xp , killer_xp );
-
-            // release the join_lock in target thread descriptor
-            remote_busylock_release( target_join_lock_xp );
-
-#if DEBUG_THREAD_DELETE
-cycle  = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_DELETE < cycle )
-printk("\n[%s] killer[%x,%x] deschedules / target[%x,%x] not completed / cycle %d\n",
-__FUNCTION__, killer_ptr->process->pid, killer_ptr->trdid,
-target_pid, target_trdid, cycle );
-#endif
-            // deschedule
-            sched_yield( "killer thread wait joining thread" );
-
-            // block the target thread 
-            thread_block( target_xp , THREAD_BLOCKED_GLOBAL );
-
-            // set the REQ_DELETE flag in target thread descriptor
-            hal_remote_atomic_or( target_flags_xp , THREAD_FLAG_REQ_DELETE );
-
-            // exit critical section
-            hal_restore_irq( save_sr );
-
-#if DEBUG_THREAD_DELETE
-cycle  = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_DELETE < cycle )
-printk("\n[%s] killer[%x,%x] exit / target[%x,%x] marked after join / cycle %d\n",
-__FUNCTION__, killer_ptr->process->pid, killer_ptr->trdid,
-target_pid, target_trdid, cycle );
-#endif
-
-        }
-    }
-    else                     // no synchronization with joining thread required
-    {
-        // block the target thread 
-        thread_block( target_xp , THREAD_BLOCKED_GLOBAL );
-
-        // set the REQ_DELETE flag in target thread descriptor
-        hal_remote_atomic_or( target_flags_xp , THREAD_FLAG_REQ_DELETE );
-
-#if DEBUG_THREAD_DELETE
-cycle  = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_DELETE < cycle )
-printk("\n[%s] killer[%x,%x] exit / target [%x,%x] marked / no join / cycle %d\n",
-__FUNCTION__, killer_ptr->process->pid, killer_ptr->trdid,
-target_pid, target_trdid, cycle );
-#endif
-
-    }
-}  // end thread_delete_request()
-
-
-
-/////////////////////////////
-void thread_idle_func( void )
-{
-
-#if DEBUG_THREAD_IDLE
-uint32_t cycle;
-#endif
-
+/////////////////////////////////////
+void thread_kill( thread_t * target )
+{
+    // set SIG_KILL signal in target thread descriptor
+    thread_set_signal( target , THREAD_SIG_KILL );
+
+    // set the global blocked bit in target thread descriptor.
+    thread_block( target , THREAD_BLOCKED_GLOBAL );
+
+    // send an IPI to reschedule the target thread core.
+    dev_icu_send_ipi( local_cxy , target->core->lid );
+
+}  // end thread_kill()
+
+
+/////////////////////////
+void * thread_idle_func()
+{
     while( 1 )
     {
-        // unmask IRQs
-        hal_enable_irq( NULL );
-
-        // force core to low-power mode (optional)
-        if( CONFIG_SCHED_IDLE_MODE_SLEEP ) 
-        {
-
-#if DEBUG_THREAD_IDLE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_IDLE < cycle )
-printk("\n[%s] idle thread on core[%x,%d] goes to sleep / cycle %d\n",
-__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cycle );
-#endif
-
-            hal_core_sleep();
-
-#if DEBUG_THREAD_IDLE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_IDLE < cycle )
-printk("\n[%s] idle thread on core[%x,%d] wake up / cycle %d\n",
-__FUNCTION__, local_cxy, CURRENT_THREAD->core->lid, cycle );
-#endif
-
-        }
-
-#if DEBUG_THREAD_IDLE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_IDLE < cycle )
-sched_remote_display( local_cxy , CURRENT_THREAD->core->lid );
-#endif     
-        // search a runable thread
-        sched_yield( "running idle thread" );
-
-    } // end while
-
+        thread_dmsg("INFO : core %d in cluster %x goes to sleeping state at cycle\n",
+                     core->lid , cluster->cxy, hal_time_stamp() );
+
+        // force core to sleeping state
+        hal_core_sleep();
+
+        thread_dmsg("INFO : core %d in cluster %x wake up at cycle %d\n",
+                     core->lid , cluster->cxy, hal_time_stamp() );
+
+        // force scheduling at wake-up
+        sched_yield();
+   }
 }  // end thread_idle()
 
 
-///////////////////////////////////////////
-void thread_time_update( thread_t * thread,
-                         bool_t     is_user )
-{
-    cycle_t current_cycle;   // current cycle counter value
-    cycle_t last_cycle;      // last cycle counter value
-
-    // get pointer on thread_info structure
-    thread_info_t * info = &thread->info;
-
-    // get last cycle counter value
-    last_cycle = info->last_cycle;
-
-    // get current cycle counter value
-    current_cycle = hal_get_cycles();
-
-    // update thread_info structure
-    info->last_cycle = current_cycle;
-
-    // update time in thread_info
-    if( is_user ) info->usr_cycles += (current_cycle - last_cycle);
-    else          info->sys_cycles += (current_cycle - last_cycle);
-
-}  // end thread_time_update()
-
-/////////////////////////////////////
-xptr_t thread_get_xptr( pid_t    pid,
-                        trdid_t  trdid )
-{
-    cxy_t         target_cxy;          // target thread cluster identifier
-    ltid_t        target_thread_ltid;  // target thread local index
-    thread_t    * target_thread_ptr;   // target thread local pointer
-    xptr_t        target_process_xp;   // extended pointer on target process descriptor
-    process_t   * target_process_ptr;  // local pointer on target process descriptor
-    pid_t         target_process_pid;  // target process identifier
-    xlist_entry_t root;                // root of list of process in target cluster
-    xptr_t        lock_xp;             // extended pointer on lock protecting  this list
-
-#if DEBUG_THREAD_GET_XPTR
-uint32_t cycle  = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_THREAD_GET_XPTR < cycle )
-printk("\n[%s] thread %x in process %x enters / pid %x / trdid %x / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, pid, trdid, cycle );
-#endif
-
-    // get target cluster identifier and local thread identifier
-    target_cxy         = CXY_FROM_TRDID( trdid );
-    target_thread_ltid = LTID_FROM_TRDID( trdid );
-
-    // check trdid argument
-	if( (target_thread_ltid >= CONFIG_THREADS_MAX_PER_CLUSTER) || 
-        cluster_is_active( target_cxy ) == false )                return XPTR_NULL;
-
-    // get root of list of process descriptors in target cluster
-    hal_remote_memcpy( XPTR( local_cxy  , &root ),
-                       XPTR( target_cxy , &LOCAL_CLUSTER->pmgr.local_root ),
-                       sizeof(xlist_entry_t) );
-
-    // get extended pointer on lock protecting the list of local processes
-    lock_xp = XPTR( target_cxy , &LOCAL_CLUSTER->pmgr.local_lock );
-
-    // take the lock protecting the list of processes in target cluster
-    remote_queuelock_acquire( lock_xp );
-
-#if( DEBUG_THREAD_GET_XPTR & 1 )
-if( DEBUG_THREAD_GET_XPTR < cycle )
-printk("\n[%s] scan processes in cluster %x :\n", __FUNCTION__, target_cxy );
-#endif
-
-    // scan the list of local processes in target cluster
-    xptr_t  iter;
-    bool_t  found = false;
-    XLIST_FOREACH( XPTR( target_cxy , &LOCAL_CLUSTER->pmgr.local_root ) , iter )
-    {
-        target_process_xp  = XLIST_ELEMENT( iter , process_t , local_list );
-        target_process_ptr = GET_PTR( target_process_xp );
-        target_process_pid = hal_remote_l32( XPTR( target_cxy , &target_process_ptr->pid ) );
-
-#if( DEBUG_THREAD_GET_XPTR & 1 )
-if( DEBUG_THREAD_GET_XPTR < cycle )
-printk(" - process %x\n", target_process_pid );
-#endif
-
-        if( target_process_pid == pid )
-        {
-            found = true;
-            break;
-        }
-    }
-
-    // release the lock protecting the list of processes in target cluster
-    remote_queuelock_release( lock_xp );
-
-    // check PID found
-    if( found == false ) 
-    {
-
-#if( DEBUG_THREAD_GET_XPTR & 1 )
-if( DEBUG_THREAD_GET_XPTR < cycle )
-printk("\n[%s] pid %x not found in cluster %x\n",
-__FUNCTION__, pid, target_cxy );
-#endif
-        return XPTR_NULL;
-    }
-
-    // get target thread local pointer
-    xptr_t xp = XPTR( target_cxy , &target_process_ptr->th_tbl[target_thread_ltid] );
-    target_thread_ptr = (thread_t *)hal_remote_lpt( xp );
-
-    if( target_thread_ptr == NULL )
-    {
-
-#if( DEBUG_THREAD_GET_XPTR & 1 )
-if( DEBUG_THREAD_GET_XPTR < cycle )
-printk("\n[%s] thread %x not registered in process %x in cluster %x\n",
-__FUNCTION__, trdid, pid, target_cxy );
-#endif
-        return XPTR_NULL;
-    }
-
-#if DEBUG_THREAD_GET_XPTR
-cycle  = (uint32_t)hal_get_cycles();
-if( DEBUG_THREAD_GET_XPTR < cycle )
-printk("\n[%s] thread %x in process %x exit / pid %x / trdid %x / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, pid, trdid, cycle );
-#endif
-
-    return XPTR( target_cxy , target_thread_ptr );
-
-}  // end thread_get_xptr()
-
-///////////////////////////////////////////////////
-void thread_assert_can_yield( thread_t    * thread,
-                              const char  * func_str )
-{
-    // does nothing if thread does not hold any busylock
-
-    if( thread->busylocks )
-    {
-        // get pointers on TXT0 chdev
-        xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-        cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-        chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-        // get extended pointer on TXT0 lock
-        xptr_t  txt0_lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-        // get TXT0 lock 
-        remote_busylock_acquire( txt0_lock_xp );
-
-        // display error message on TXT0
-        nolock_printk("\n[PANIC] in %s / thread[%x,%x] cannot yield : "
-        "hold %d busylock(s) / cycle %d\n",
-        func_str, thread->process->pid, thread->trdid,
-        thread->busylocks - 1, (uint32_t)hal_get_cycles() );
-
-#if DEBUG_BUSYLOCK_TYPE
-
-// scan list of busylocks
-xptr_t    iter_xp;
-xptr_t    root_xp  = XPTR( local_cxy , &thread->busylocks_root );
-XLIST_FOREACH( root_xp , iter_xp )
-{
-    xptr_t       lock_xp   = XLIST_ELEMENT( iter_xp , busylock_t , xlist );
-    cxy_t        lock_cxy  = GET_CXY( lock_xp );
-    busylock_t * lock_ptr  = GET_PTR( lock_xp );
-    uint32_t     lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->type ) );
-    nolock_printk(" - %s in cluster %x\n", lock_type_str[lock_type] , lock_cxy );
-}
-
-#endif
-
-        // release TXT0 lock 
-        remote_busylock_release( txt0_lock_xp );
-
-        // suicide
-        hal_core_sleep();
-    }
-}  // end thread_assert_can yield()
-
-//////////////////////////////////////////////////////
-void thread_display_busylocks( xptr_t       thread_xp,
-                               const char * string )
-{
-
-    cxy_t      thread_cxy = GET_CXY( thread_xp );
-    thread_t * thread_ptr = GET_PTR( thread_xp );
-
-#if DEBUG_BUSYLOCK
-
-    xptr_t     iter_xp;
-
-    // get relevant info from target thread descriptor
-    uint32_t    locks   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->busylocks ) );
-    trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-    process_t * process = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-    pid_t       pid     = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-
-    // get extended pointer on root of busylocks
-    xptr_t root_xp = XPTR( thread_cxy , &thread_ptr->busylocks_root );
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 lock
-    xptr_t  txt0_lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( txt0_lock_xp );
-
-    // display header 
-    nolock_printk("\n***** thread[%x,%x] in <%s> : %d busylocks *****\n",
-    pid, trdid, string, locks );
-
-    // scan the xlist of busylocks when required
-    if( locks )
-    {
-        XLIST_FOREACH( root_xp , iter_xp )
-        {
-            xptr_t       lock_xp   = XLIST_ELEMENT( iter_xp , busylock_t , xlist );
-            cxy_t        lock_cxy  = GET_CXY( lock_xp );
-            busylock_t * lock_ptr  = GET_PTR( lock_xp );
-            uint32_t     lock_type = hal_remote_l32(XPTR( lock_cxy , &lock_ptr->type ));
-            nolock_printk(" - %s in cluster %x\n", lock_type_str[lock_type] , lock_cxy );
-        }
-    }
-
-    // release TXT0 lock
-    remote_busylock_release( txt0_lock_xp );
-
-#else
-
-printk("\n[ERROR] in %s : set DEBUG_BUSYLOCK in kernel_config.h for %s / thread(%x,%x)\n",
-__FUNCTION__, string, thread_cxy, thread_ptr );
-
-#endif
-
-    return;
-
-}  // end thread_display_busylock()
-
Index: trunk/kernel/kern/thread.h
===================================================================
--- trunk/kernel/kern/thread.h	(revision 690)
+++ trunk/kernel/kern/thread.h	(revision 1)
@@ -1,7 +1,8 @@
 /*
  * thread.h -  Thread and related operations definition.
- *
+ * 
  * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
- *         Alain Greiner    (2016,2017,2018,2019,2020)
+ *         Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,16 +27,11 @@
 #define _THREAD_H_
 
-#include <hal_kernel_types.h>
-#include <shared_syscalls.h>
-#include <shared_almos.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <hal_kentry.h>
 #include <xlist.h>
 #include <list.h>
 #include <hal_context.h>
-#include <remote_busylock.h>
+#include <spinlock.h>
 #include <core.h>
-#include <chdev.h>
-#include <alarm.h>
 #include <cluster.h>
 #include <process.h>
@@ -44,14 +40,32 @@
 #include <dev_txt.h>
 #include <dev_mmc.h>
-#include <dev_dma.h>
-
-/***************************************************************************************
- * These macros are used to compose or decompose the global thread identifier (TRDID)
- * to or from cluster identifier / local thread index (CXY , LTID)
- **************************************************************************************/
-
-#define LTID_FROM_TRDID( trdid )   (ltid_t)(trdid & 0x0000FFFF)
-#define CXY_FROM_TRDID( trdid )    (cxy_t)(trdid >> 16)
-#define TRDID( cxy , ltid )        (trdid_t)((cxy << 16) | ltid )
+
+/***************************************************************************************
+ * This defines the various pthread_attr_t flags.
+ **************************************************************************************/
+
+#define PT_FLAG_DETACH                0x001    // user defined not joinable
+#define PT_FLAG_CLUSTER_DEFINED       0x002    // user defined target cluster
+#define PT_FLAG_CORE_DEFINED          0x004    // user defined core cluster
+
+/***************************************************************************************
+ * This structure defines the input argument of the pthread_create() system call.
+ * It contains all informations required to initialize an user thread, and is passed
+ * as input argument to the thread_user_create() function.
+ * It is partly set by the kernel, partly set by the user application itself,
+ * using the pthread_attr_***() functions.
+ **************************************************************************************/
+ 
+typedef struct pthread_attr_s
+{
+    pid_t       pid;             /*! owner process identifier                         */
+	void      * entry_func;      /*! pointer on entry function                        */
+	void      * entry_args;      /*! pointer on entry function arguments              */
+	uint32_t    flags;           /*! pthread flags        (entirely user specified)   */
+	cxy_t       cxy;             /*! target cluster       (can be user specified)     */
+	lid_t       lid;             /*! target core          (can be user specified)     */
+} 
+pthread_attr_t;
+
 
 /***************************************************************************************
@@ -60,75 +74,74 @@
 
 typedef enum
-{
-	THREAD_USER    = 0,          /*! user thread (pthread)                            */
+{   
+	THREAD_USER    = 0,          /*! user thread (pthread)                            */ 
 	THREAD_RPC     = 1,          /*! kernel thread executing pending RPCs             */
 	THREAD_DEV     = 2,          /*! kernel thread executing I/O device commands      */
-	THREAD_IDLE    = 3,          /*! kernel idle thread                               */
+	THREAD_KERNEL  = 3,          /*! other kernel thread                              */
+	THREAD_IDLE    = 4,          /*! kernel idle thread                               */
+	THREAD_TYPES_NR
+} 
+thread_type_t;
+
+/***************************************************************************************
+ * This defines the masks associated to the thread flags.
+ **************************************************************************************/
+
+#define THREAD_FLAG_LOADABLE     0x0001  /*! This thread has not been executed yet    */
+#define THREAD_FLAG_DETACHED     0x0002  /*! This user thread is detached from parent */
+
+/***************************************************************************************
+ * This defines the masks associated to the thread signals.
+ **************************************************************************************/
+
+#define THREAD_SIG_KILL          0x0001  /*! This thread must be destroyed ASAP       */
+
+/***************************************************************************************
+ * This defines the masks associated to the blocking causes.
+ **************************************************************************************/
+
+#define THREAD_BLOCKED_GLOBAL    0x0001  /*! thread global blocking                   */ 
+#define THREAD_BLOCKED_IO        0x0002  /*! thread wait IO operation completion      */
+#define THREAD_BLOCKED_MAPPER    0x0004  /*! thread wait mapper                       */
+#define THREAD_BLOCKED_EXIT      0x0010  /*! thread requested exit                    */
+#define THREAD_BLOCKED_KILL      0x0020  /*! thread received kill signal              */
+#define THREAD_BLOCKED_SEM       0x0040  /*! thread wait semaphore                    */
+#define THREAD_BLOCKED_PAGE      0x0080  /*! thread wait page access                  */
+#define THREAD_BLOCKED_IDLE      0x1000  /*! thread RPC wait activation               */
+#define THREAD_BLOCKED_DEV_QUEUE 0x2000  /*! thread DEV wait queue                    */
+#define THREAD_BLOCKED_DEV_ISR   0x4000  /*! thread DEV wait ISR                      */
+
+/***************************************************************************************
+ * This structure defines thread instrumentation informations.
+ **************************************************************************************/
+
+typedef struct thread_info_s
+{
+	uint32_t              pgfault_nr;    /*! cumulated number of page fault           */
+	uint32_t              sched_nr;      /*! TODO ???  [AG]                           */
+	uint32_t              u_err_nr;      /*! TODO ???  [AG]                           */
+	uint32_t              m_err_nr;      /*! TODO ???  [AG]                           */
+	uint32_t              tm_tmp;        /*! temp date to compute execution duration  */
+	uint32_t              tm_exec;       /*! TODO ???  [AG]                           */
+	uint32_t              tm_create;     /*! date of the creation                     */
+	uint32_t              tm_born;       /*! date of the thread loading               */
+	uint32_t              tm_dead;       /*! date of the death                        */
+	clock_t               tm_sleep;      /*! TODO ???  [AG]                           */
+	clock_t               tm_wait;       /*! TODO ???  [AG]                           */
+	clock_t               tm_usr;        /*! user execution duration                  */
+	clock_t               tm_sys;        /*! system execution duration                */
 }
-thread_type_t;
-
-/***************************************************************************************
- * This defines the thread flags bit-vector.
- **************************************************************************************/
-
-#define THREAD_FLAG_DETACHED     0x0001  /*! This thread is detached from parent      */
-#define THREAD_FLAG_JOIN_DONE    0x0002  /*! Parent thread made a join request        */
-#define THREAD_FLAG_KILL_DONE    0x0004  /*! This thread received a kill request      */
-#define THREAD_FLAG_REQ_ACK      0x0010  /*! Acknowledge required from scheduler      */
-#define THREAD_FLAG_REQ_DELETE   0x0020  /*! Destruction required from scheduler      */
-
-/***************************************************************************************
- * This defines the thread blocking causes bit-vector.
- **************************************************************************************/
-
-#define THREAD_BLOCKED_GLOBAL    0x0001  /*! ANY : deactivated / wait activation      */
-#define THREAD_BLOCKED_IO        0x0002  /*! USR : wait IO operation completion       */
-#define THREAD_BLOCKED_MAPPER    0x0004  /*! ??? : wait mapper                        */
-#define THREAD_BLOCKED_EXIT      0x0008  /*! USR : blocked in join / wait exit        */
-#define THREAD_BLOCKED_JOIN      0x0010  /*! USR : blocked in exit / wait join        */
-#define THREAD_BLOCKED_SEM       0x0020  /*! USR : wait semaphore                     */
-#define THREAD_BLOCKED_PAGE      0x0040  /*! ??? : wait page access                   */
-#define THREAD_BLOCKED_IDLE      0x0080  /*! RPC : wait RPC_FIFO non empty            */
-#define THREAD_BLOCKED_USERSYNC  0x0100  /*! USR : wait cond / mutex / barrier        */
-#define THREAD_BLOCKED_RPC       0x0200  /*! ANY : wait RPC completion                */
-#define THREAD_BLOCKED_ISR       0x0400  /*! DEV : wait hardware IRQ                  */
-#define THREAD_BLOCKED_WAIT      0x0800  /*! USR : wait child process termination     */
-#define THREAD_BLOCKED_LOCK      0x1000  /*! ANY : wait queuelock or rwlock           */
-#define THREAD_BLOCKED_CLIENT    0x2000  /*! DEV : wait clients queue non empty       */
-#define THREAD_BLOCKED_SLEEP     0x4000  /*! ANY : wait a timer based alarm           */
+thread_info_t;
 
 /***************************************************************************************
  * This structure defines a thread descriptor.
  * It is used for both the user threads and the kernel threads.
- * In a process, a user thread is identified by a unique TRDID (thread identifier):
+ * In a process, an user thread is identified by a unique TRDID (thread identifier),
+ * that is returned by the kernel to the user:
  * - The TRDID 16 LSB bits contain the LTID (Local Thread Index).
- * - The TRDID 16 MSB bits contain the CXY of cluster containing the thread.
- * For the main thread the LTID value is always 0, in the owner cluster. 
- * The LTID is used to index the th_tbl[] array in the local process descriptor.
+ * - The TRDID 16 MSB bits contain the owner cluster CXY.
+ * - The LTID is used to index the th_tbl[] array in the local process descriptor.
  * This TRDID is computed by the process_register_thread() function, when the user
- * thread is registered in the local copy of the process descriptor.
- *
- * Implementation notes:
- *
- * (1) Don't modify the first 4 fields order, as this order is used by the
- *     hal_kentry assembly code for the TSAR architectures.
- *
- * (2) Most of the thread state is private and accessed only by this thread,
- *     but some fields are shared, and can be modified by other threads.
- *     - the "blocked" bit_vector can be modified by another thread
- *       running in another cluster (using atomic instructions),
- *       to change this thread scheduling status.
- *     - the "flags" bit_vector can be modified by another thread
- *       running in another cluster (using atomic instructions),
- *       to register requests such as ACK or DELETE.
- *     - the "join_xp" field can be modified by the joining thread,
- *       and this rendez-vous is protected by the dedicated "join_lock".
- *
- * (3) When this thread is blocked on a shared resource (queuelock, condvar,
- *     or chdev), it registers in the associated waiting queue, using the
- *     "wait_list" (local list) or "wait_xlist" (trans-cluster list) fields. 
- *
- * (4) The thread_info_t structure is defined in the shared_almos.h file in the
- *     /kernel/syscall/shared_include directory.
+ * thread is registerd in the local copy of the process descriptor.
  **************************************************************************************/
 
@@ -137,13 +150,5 @@
 typedef struct thread_s
 {
-	void              * cpu_context;     /*! CPU context used by sched_yield          */
-	void              * fpu_context;     /*! FPU context used by sched_yield          */
-    void              * uzone_current;   /*! used by hal_do_syscall & hal_do_except   */
-    void              * uzone_previous;  /*! used by hal_do_syscall & hal_do_except   */
-
-	intptr_t            k_stack_base;    /*! kernel stack base address                */
-	uint32_t            k_stack_size;    /*! kernel stack size (bytes)                */
-
-	uint32_t            trdid;           /*! thread index (cxy.ltid)                  */
+	uint32_t            trdid;           /*! thread index (in THTBL)                  */
 	thread_type_t       type;            /*! thread type                              */
 	uint32_t            quantum;         /*! number of clock ticks given to thread    */
@@ -152,57 +157,58 @@
 	core_t            * core;            /*! pointer to the owner core                */
 	process_t         * process;         /*! pointer on local process descriptor      */
-    xptr_t              parent;          /*! extended pointer on parent thread        */
-
-    remote_busylock_t   join_lock;       /*! lock protecting the join/exit            */
-    xptr_t              join_xp;         /*! joining/killer thread extended pointer   */
-    void              * exit_status;     /*! status returned to joiniy thread        */
-
-    uint32_t          * ack_rsp_count;   /*! pointer on acknowledge response counter  */
-
-	vseg_t            * user_stack_vseg; /*! local pointer on user stack vseg         */
-
-    void              * entry_func;      /*! pointer on thread entry function         */
-    void              * entry_args;      /*! pthread     : pointer on arguments       */
+	page_t            * page;            /*! pointer on page desc. containing thread  */ 
+
+	uint32_t            local_locks;	 /*! number of local locks owned by thread    */
+    list_entry_t        locks_root;      /*! root of local locks list                 */
+
+	uint32_t            remote_locks;	 /*! number of local locks owned by thread    */
+    xlist_entry_t       xlocks_root;     /*! root of remote locks list                */
+
+	intptr_t            u_stack_base;    /*! user stack base address                  */
+	uint32_t            u_stack_size;    /*! user stack size (bytes)                  */
+	intptr_t            k_stack_base;    /*! kernel stack base address                */
+	uint32_t            k_stack_size;    /*! kernel stack size (bytes)                */
+
+    void              * entry_func;      /*! pointer on entry function                */
+    void              * entry_args;      /*! pointer on entry function arguments      */
 
     uint32_t            flags;           /*! bit vector of flags                      */
     uint32_t            blocked;         /*! bit vector of blocking causes            */
-
-	error_t             errno;           /*! errno value set by last system call      */
-    uint32_t            utls;            /*! user thread local storage                */
+    uint32_t            signals;         /*! bit vector of signals                    */
+
+	error_t             errno;           /*! errno value of last system call          */
 
     bool_t              fork_user;       /*! user defined placement for next fork()   */
     cxy_t               fork_cxy;        /*! target cluster  for next fork()          */
 
+	xlist_entry_t       children_root;   /*! root of list of attached children        */
+    uint32_t            children_nr;     /*! number of attached children threads      */
+    remote_spinlock_t * children_lock;   /*! lock protecting the children list        */
+
+    xlist_entry_t       brothers_list;   /*! member of threads with same parent       */
+
 	list_entry_t        sched_list;      /*! member of threads attached to same core  */
 
-    chdev_t           * chdev;           /*! chdev pointer (for a DEV thread only)    */
-
-    alarm_t             alarm;           /*! embedded timer based alarm               */
-
-    reg_t               save_sr;         /*! used by sched_yield() function           */
-
-    ioc_command_t       ioc_cmd;         /*! IOC device generic command               */
-    txt_command_t       txt_cmd;         /*! TXT device generic command               */
-    nic_command_t       nic_cmd;         /*! NIC device generic command               */
-    mmc_command_t       mmc_cmd;         /*! MMC device generic command               */
-    dma_command_t       dma_cmd;         /*! DMA device generic command               */
-    fbf_command_t       fbf_cmd;         /*! FBF device generic command               */
-
-  	xptr_t              rpc_client_xp;   /*! client thread (for a RPC thread only)    */
-
-    list_entry_t        wait_list;       /*! member of a local waiting queue          */
-    xlist_entry_t       wait_xlist;      /*! member of a trans-cluster waiting queue  */
-    xlist_entry_t       tmp_xlist;       /*! member of a trans-cluster kleenex queue  */
-
-	uint32_t            busylocks;	     /*! number of taken busylocks                */
-
-#if DEBUG_BUSYLOCK_TYPE
-    xlist_entry_t       busylocks_root;  /*! root of xlist of taken busylocks         */
-#endif
+    uint32_t            dev_channel;     /*! device channel for a DEV thread          */
+    union                                /*! embedded command for a DEV thread        */
+    {
+        ioc_command_t   ioc;             /*! IOC device generic command               */
+        txt_command_t   txt;             /*! TXT device generic command               */
+        nic_command_t   nic;             /*! NIC device generic command               */
+        mmc_command_t   mmc;             /*! NIC device generic command               */
+    }  
+    dev;
+    
+	cxy_t               rpc_client_cxy;  /*! client cluster index (for a RPC thread)  */
+
+    xlist_entry_t       wait_list;       /*! member of threads blocked on same cond   */
+
+	void              * fpu_context;     /*! pointer on FPU context                   */
+	void              * cpu_context;     /*! pointer on CPU context                   */
 
 	thread_info_t       info;            /*! embedded thread_info_t                   */
 
 	uint32_t            signature;       /*! for kernel stack overflow detection      */
-}
+} 
 thread_t;
 
@@ -214,80 +220,50 @@
 
 /***************************************************************************************
- * This function returns a printable string for a thread type.
- ***************************************************************************************
- * @ type    : thread type.
- * returns pointer on string.
- **************************************************************************************/
-const char * thread_type_str( thread_type_t type );
-
-/***************************************************************************************
- * This function is used by the pthread_create() system call to create a "new" thread
- * in an existing process. It allocates memory for an user thread descriptor in the
- * local cluster, and initializes it from information contained in the arguments.
- * The CPU context is initialized from scratch. 
- * It is registered in the local process descriptor specified by the <pid> argument.
- * The THREAD_BLOCKED_GLOBAL bit is set => the thread must be activated by the caller
- * to start at the next scheduling point.
- ***************************************************************************************
- * @ pid          : process identifier.
- * @ start_func   : pointer on entry function.
- * @ start_args   : pointer on function argument (can be NULL).
+ * This function allocates memory for an user thread descriptor in the local cluster,
+ * and initializes it from information contained in the "attr" argument.
+ * It is used by the pthread_create system call, the CPU context is initialised from
+ * scratch, and the "loadable" field is set.
+ * The new thread is attached to the core specified in the "attr" argument.
+ * It is registered in the local process descriptor for the process specified in "attr".
+ * The thread descriptor pointer is returned to allow the parent thread to register it
+ * in its children list.
+ * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.   
+ ***************************************************************************************
+ * @ new_thread   : address of buffer for new thread descriptor pointer.  
  * @ attr         : pointer on pthread attributes descriptor.
- * @ new_thread   : [out] address of buffer for new thread descriptor pointer.
+ * @ u_stack_base : actual user stack size.
+ * @ u_stack_size : actual user stack base.
  * @ returns 0 if success / returns ENOMEM if error.
  **************************************************************************************/
-error_t thread_user_create( pid_t             pid,
-                            void            * start_func,
-                            void            * start_arg,
+error_t thread_user_create( thread_t       ** new_thread,
                             pthread_attr_t  * attr,
-                            thread_t       ** new_thread );
-
-/***************************************************************************************
- * This function is used by the sys_fork() syscall to create the "child" main thread
- * in the local cluster. It is called, generally through the RPC_PROCESS_MAKE_FORK,
- * by the process_make_fork() function. It allocates memory from the local cluster
- * for a "child" thread descriptor, and initializes it from the "parent" thread 
- * descriptor defined by the <parent_thread_xp> argument.
- * The new thread is attached to the core that has the lowest load in local cluster.
- * It is registered in the "child" process defined by the <child_process> argument.
- * This new thread inherits its user stack from the parent thread, as it uses the
- * Copy-On-Write mechanism to get a private stack when required.
- * The content of the parent kernel stack is copied into the child kernel stack, as 
- * the Copy-On-Write mechanism cannot be used for kernel segments (because kernel 
- * uses physical addressing on some architectures).
- * The CPU and FPU execution contexts are created and linked to the new thread.
- * but the actual context copy is NOT done, and is done by the sys_fork() function. 
- * The THREAD_BLOCKED_GLOBAL bit is set => the thread must be activated to start.
- ***************************************************************************************
- * @ parent_thread_xp  : extended pointer on parent thread descriptor.
- * @ child_process     : local pointer on child process descriptor.
- * @ child_thread      : [out] address of buffer for child thread descriptor pointer.
- * @ returns 0 if success / returns -1 if error.
- **************************************************************************************/
-error_t thread_user_fork( xptr_t      parent_thread_xp,
-                          process_t * child_process,
-                          thread_t ** child_thread );
-
-/***************************************************************************************
- * This function is called by the process_make_exec() function to re-initialise the
- * calling thread descriptor, that will become the new process main thread, from
- * the process descriptor, and from the <args_nr> & <args_base> arguments.
- * - The calling thread TRDID is not modified.
- * - The kernel stack (currently in use) is not modified.  
- * - It calls the hal_cpu_context_init() to re-initialize the thread CPU context.
- * - It calls the hal_do_cpu_restore() to force execution of the new user code.
- ***************************************************************************************
- * @ argc   : actual number of main thread arguments.
- * @ argv   : user space pointer on array of pointers on arguments.
- **************************************************************************************/
-void thread_user_exec( uint32_t  argc,
-                       intptr_t  argv );
+                            intptr_t          u_stack_base,
+                            uint32_t          u_stack_size );
+
+/***************************************************************************************
+ * This function allocates memory for an user thread descriptor in the local cluster,
+ * and initialises it from informations contained in the calling thread descriptor.
+ * It is used by the fork() system call to create the child process main thread.
+ * The new thread is attached to the core with the lowest load. 
+ * It is registered in the process descriptor defined by the "process" argument.
+ * This new thread inherits its execution context from the calling thread,
+ * and the "loadable" field is NOT set.
+ * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.   
+ ***************************************************************************************
+ * @ new_thread   : address of buffer for new thread descriptor pointer.  
+ * @ process      : local pointer on owner process descriptor.
+ * @ u_stack_base : actual user stack size.
+ * @ u_stack_size : actual user stack base.
+ * @ returns 0 if success / returns ENOMEM if error.
+ **************************************************************************************/
+error_t thread_user_fork( thread_t ** new_thread,
+                          process_t * process,
+                          intptr_t    u_stack_base,
+                          uint32_t    u_stack_size );
 
 /***************************************************************************************
  * This function allocates memory for a kernel thread descriptor in the local cluster,
- * and initializes it from arguments values. 
- * It is called by kernel_init() to statically create all DEV server threads
- * It is also called to dynamically create RPC threads when required.
- * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.
+ * and initialise it from arguments values.
+ * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.   
  ***************************************************************************************
  * @ new_thread   : address of buffer for new thread pointer.
@@ -300,177 +276,141 @@
 error_t thread_kernel_create( thread_t     ** new_thread,
                               thread_type_t   type,
-                              void          * func,
+                              void          * func, 
                               void          * args,
                               lid_t           core_lid );
 
 /***************************************************************************************
- * This function is called by the kernel_init() function to initialize the IDLE thread
- * descriptor from arguments values.
- * The THREAD_BLOCKED_GLOBAL bit is set, and the thread must be activated to start.
- * It returns a kernel panic if failure.
- ***************************************************************************************
- * @ thread   : pointer on existing thread descriptor.
- * @ type     : kernel thread type.
- * @ func     : pointer on function.
- * @ args     : function arguments.
- * @ core_lid : local core index.
- **************************************************************************************/
-void thread_idle_init( thread_t      * thread,
-                       thread_type_t   type,
-                       void          * func,
-                       void          * args,
-                       lid_t           core_lid );
-
-/***************************************************************************************
- * This low-level function is called by the sched_handle_signals() function when a
- * thread is marked for delete. It removes the thread identified by the <thread>
- * argument from the process th_tbl[], and releases all physical memory allocated for 
- * this. This includes the thread descriptor itself, the associated CPU and FPU context,
- * and the physical memory allocated for an user thread stack.
- * This function does not remove the thread from the scheduler, as this is done by
- * the scheduler itself.
- ***************************************************************************************
- * @ thread  : pointer on the thread descriptor to release.
- * @ return the number of threads registered in the process th_tbl[] before deletion.
- **************************************************************************************/
-uint32_t thread_destroy( thread_t * thread );
-
-/***************************************************************************************
- * This function defines the code of the thread executed by all cores after kernel_init,
- * or when no other thread is runnable for a given core.
- * It enter and infinite loop in wich:
- * - it unmask the IRQs
- * - it optionally calls the hal_core_sleep() function to reduce the power consumption
- *   (this behavior is controlled by the CONFIG_THREAD_IDLE_MODE_SLEEP flag).
- * - it call the sched_yield() function to find another runnable thread.
- *
- * TODO: In the TSAR architecture the hal_core_sleep() function forces the core to
- * low-power mode. Any IRQ will force the core to exit this low-power mode, but no ISR
- * is executed. We must analyse if we have the same behaviour for I86 architectures...
- **************************************************************************************/
-void thread_idle_func( void );
-
-/***************************************************************************************
- * This function is used by a "blocker" thread running in the same cluster as a "target"
- * thread to request the scheduler of the target thread to acknowledge that the target
- * thread is blocked and not running, at the next context switch.
- * This function executes atomically the following actions :
- * - it set the request_pending boolean in the target scheduler descriptor.
- * - it set the REQ_ACK flag in the "flags" field of the target thread descriptor.
- * - It registers the responses counter pointer in the target thread descriptor.
- * The request_pending flag is handled as a set/reset flip-flop by the "blocker" thread
- * and by the "target" scheduler. 
- ***************************************************************************************
- * @ target        : local pointer on target thread.
- * @ ack_rsp_count : local pointer on responses counter.
- **************************************************************************************/
-void thread_set_req_ack( thread_t * target,
-                         uint32_t * ack_rsp_count );
-
-/***************************************************************************************
- * This function is used by the sched_handle_signal() function executed by the 
- * scheduler of a "target" thread to reset a "blocked not running" acknowledge request
- * in both the target thread descriptor, and in the target  thread scheduler.
- ***************************************************************************************
- * @ target    : local pointer on target thread.
- **************************************************************************************/
-void thread_reset_req_ack( thread_t * target );
-
-/***************************************************************************************
- * This function is used by the four sys_thread_cancel(), sys_thread_exit(),
- * sys_kill() and sys_exit() system calls to mark for delete a given thread. 
- * It set the THREAD_BLOCKED_GLOBAL bit and set the THREAD_FLAG_REQ_DELETE bit in the
- * thread descriptor identified by the <thread_xp> argument, to ask the scheduler 
- * to asynchronously delete the target thread, at the next scheduling point. 
- * The calling thread can run in any cluster, as it uses remote accesses.
- * This function makes a kernel panic if the target thread is the main thread,
- * because the main thread deletion will cause the process deletion, and a process
- * must be deleted by the parent process, running the wait function.
- * If the target thread is running in "attached" mode, and the <is_forced> argument
- * is false, this function implements the required sychronisation with the joining 
- * thread, blocking the killer thread until the pthread_join() syscall is executed
- * by the joining thread.
- ***************************************************************************************
- * @ thread_xp   : extended pointer on the target thread.
- * @ is_forced   : the deletion does not depends on the attached mode. 
- **************************************************************************************/
-void thread_delete_request( xptr_t  thread_xp,
-                            bool_t  is_forced );
-
-/***************************************************************************************
- * This function registers a blocking cause defined by the <cause> argument 
- * in a remote thread descriptor identified by the <thread_xp> argument.
- * We need an extended pointer, because this function can be called by another thread
- * than the target thread, executing the sys_kill() function.
- * WARNING : this function does not deschedule the target thread, and the descheduling
- * must be explicitely forced by a sched_yield().
- ***************************************************************************************
- * @ thread_xp   : extended pointer on remote thread descriptor.
- * @ cause       : mask defining the cause (one hot).
- **************************************************************************************/
-void thread_block( xptr_t   thread_xp,
-                   uint32_t cause );
-
-/***************************************************************************************
- * This function resets the bit identified by the <cause> argument in a remote
- * thread descriptor identified by the <thread_xp> argument.
+ * This function releases the physical memory allocated for a thread descriptor 
+ * in the local cluster. It can be used for both an user and a kernel thread.
+ * The physical memory dynamically allocated in the HEAP or MMAP zones by an user 
+ * thread will be released when the process is killed, and the page table flushed.
+ ***************************************************************************************
+ * @ thread  : pointer on the thread descriptor to release.  
+ **************************************************************************************/
+void thread_destroy( thread_t * thread );
+
+/***************************************************************************************
+ * This function defines the code of the thread executed when no other thread is 
+ * runnable for a given core. It try to force the core to the low-power state.
+ **************************************************************************************/
+void * thread_idle_func();
+
+/***************************************************************************************
+ * This function registers a child thread in the global list of attached 
+ * children threads of a parent thread.
+ * It does NOT take a lock, as this function is allways called by the parent thread.
+ ***************************************************************************************
+ * @ xp_parent : extended pointer on the parent thread descriptor.
+ * @ xp_child  : extended pointer on the child thread descriptor.
+ **************************************************************************************/
+void thread_child_parent_link( xptr_t  xp_parent,
+                               xptr_t  xp_child );
+
+/***************************************************************************************
+ * This function removes an user thread from the parent thread global list 
+ * of attached children threads. 
+ * It does take the lock, as this function can be called by the child thread.
+ * In this case, it uses the extended pointer on the parent thread contained 
+ * in the pthread_attr_t embedded in the child thread descriptor.
+ ***************************************************************************************
+ * @ xp_parent : extended pointer on the parent thread descriptor.
+ * @ xp_child  : extended pointer on the child thread descriptor.
+ **************************************************************************************/
+void thread_child_parent_unlink( xptr_t xp_parent,
+                                 xptr_t xp_child );
+
+
+/***************************************************************************************
+ * This function atomically set a signal in a thread descriptor.
+ ***************************************************************************************
+ * @ thread    : local pointer on target thread.
+ * @ mask      : mask on selected signal.
+ **************************************************************************************/
+inline void thread_set_signal( thread_t * thread,
+                               uint32_t   mask );
+
+/***************************************************************************************
+ * This function reset a signal in a thread descriptor.
+ ***************************************************************************************
+ * @ thread    : local pointer on target thread.
+ * @ mask      : mask on selected signal.
+ **************************************************************************************/
+inline void thread_reset_signal( thread_t * thread,
+                                 uint32_t   mask );
+
+/***************************************************************************************
+ * This function returns true if the calling thread is attached to its parent thread.
+ **************************************************************************************/
+inline bool_t thread_is_joinable();
+
+/***************************************************************************************
+ * This function returns true if the calling thread is not blocked.
+ **************************************************************************************/
+inline bool_t thread_is_runnable();
+
+/***************************************************************************************
+ * This function cheks if the calling thread can deschedule.
+ ***************************************************************************************
+ * @ returns true if no locks taken.
+ **************************************************************************************/
+inline bool_t thread_can_yield();
+
+/***************************************************************************************
+ * This function checks if the calling thread must be descheduled. 
+ ***************************************************************************************
+ * @ returns true if no locks taken, and elapsed time.
+ **************************************************************************************/
+bool_t thread_check_sched();
+
+/***************************************************************************************
+ * This function can be used by the calling thread to suicide.
+ * All locks must be previouly released.
+ * The scenario depends on the attached/detached flag :
+ * - if detached, it set the SIG_KILL signal in the "signals" bit_vector, registers
+ *   the BLOCKED_EXIT bit in the "blocked" bit_vector, and deschedule.
+ * - if attached, it simply set the BLOCKED_EXIT bit in the "blocked" bit vector
+ *   and deschedule. The SIG_KILL signal will be set by the parent thread when
+ *   executing the pthread_join().
+ ***************************************************************************************
+ * @ returns 0 if success / returns EINVAL if locks_count is not zero.
+ **************************************************************************************/
+error_t thread_exit();
+
+/***************************************************************************************  
+ * This function registers a blocking cause in the target thread "blocked" bit vector.
+ * Warning : this function does not deschedule the calling thread.
+ * The descheduling can be forced by a sched_yield(). 
+ ***************************************************************************************
+ * @ thread   : local pointer on target thread.
+ * @ cause    : mask defining the cause (one hot).
+ **************************************************************************************/
+void thread_block( thread_t * thread,
+                   uint32_t   cause );
+
+/***************************************************************************************  
+ * This function reset the bit identified by the cause argument in the "blocked"
+ * bit vector of a remote thread descriptor.
  * We need an extended pointer, because the client thread of an I/O operation on a
- * given device is generally not in the same cluster as the associated server thread.
- * WARNING : this function does not reschedule the remote thread.
+ * given device is not in the same cluster as the associated device descriptor.
+ * Warning : this function does not reschedule the remote thread. 
  * The scheduling can be forced by sending an IPI to the core running the remote thread.
  ***************************************************************************************
- * @ thread_xp   : extended pointer the remote thread.
- * @ cause       : mask defining the cause (one hot).
- * @ return non zero if the bit-vector was actually modified / return 0 otherwise
- **************************************************************************************/
-uint32_t thread_unblock( xptr_t   thread_xp,
-                         uint32_t cause );
-
-/***************************************************************************************
- * This function updates the calling thread user_time or kernel_time counters. 
- ***************************************************************************************
- * @ thread   : local pointer on target thread.
- * @ is_user  : update user time if true / update kernel time if false
- **************************************************************************************/
-void thread_time_update( thread_t * thread,
-                         bool_t     is_user );
-
-/***************************************************************************************
- * This function returns the extended pointer on a thread descriptor identified
- * by its thread identifier, and process identifier.
- * It can be called by any thread running in any cluster.
- ***************************************************************************************
- * @ pid     : process identifier.
- * @ trdid   : thread identifier.
- * @ return the extended pointer if thread found / return XPTR_NULL if not found.
- **************************************************************************************/
-xptr_t thread_get_xptr( pid_t    pid,
-                        trdid_t  trdid );
-
-/***************************************************************************************
- * This function checks that the thread identified by the <thread> argument does hold
- * any busylock (local or remote).
- * If the xlist of taken busylocks is not empty, it displays the set of taken locks,
- * and makes a kernel panic.  
- ***************************************************************************************
- * @ thread    : local pointer on target thread.
- * @ func_str  : faulty function name.
- **************************************************************************************/
-void thread_assert_can_yield( thread_t    * thread,
-                              const char  * func_str );
-
-/***************************************************************************************
- * This debug function display the list of busylocks (local or remote) 
- * currently owned by a the thread identified by the <thead_xp> argument.
- * The <string> argument is printed in header (can be the calling function name). 
- * WARNING : the DEBUG_BUSYLOCK parameter must be set in the kernel_config.h file.
- ***************************************************************************************
- * @ thread_xp  : extended pointer on target thread.
- * @ string     : defines the calling context.
- **************************************************************************************/
-void thread_display_busylocks( xptr_t       thread_xp,
-                               const char * string );
-
-
+ * @ thread   : extended pointer on the remote thread.
+ * @ cause    : mask defining the cause (one hot).
+ **************************************************************************************/
+void thread_unblock( xptr_t   thread,
+                     uint32_t cause );
+
+/***************************************************************************************  
+ * This function kills a target thread, identified by its local pointer.
+ * It is generally called by the local process_destroy() function.
+ * - it forces the global blocked bit in target thread descriptor.
+ * - it set the SIG_KILL signal in target thread.
+ * - it send an IPI_SCHED_REQUEST to the target thread core.
+ ***************************************************************************************
+ * @ thread   : local pointer on the target thread.
+ * @ returns 0 if success / returns EINVAL if locks_count is not zero.
+ **************************************************************************************/
+void thread_kill( thread_t * thread );
 
 #endif	/* _THREAD_H_ */
Index: trunk/kernel/kern/time.c
===================================================================
--- trunk/kernel/kern/time.c	(revision 1)
+++ trunk/kernel/kern/time.c	(revision 1)
@@ -0,0 +1,171 @@
+/*
+ * kern/time.c - thread time related management
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <thread.h>
+#include <task.h>
+#include <scheduler.h>
+#include <time.h>
+#include <list.h>
+#include <rt_timer.h>
+#include <kmagics.h>
+
+error_t alarm_wait(struct alarm_info_s *info, uint_t msec)
+{
+	register uint_t tm_now;
+	struct cpu_s *cpu;
+	struct alarm_s *alarm_mgr;
+	struct list_entry *iter;
+	struct alarm_info_s *current;
+	uint_t irq_state;
+
+	cpu       = current_cpu;
+	alarm_mgr = &cpu->alarm_mgr;
+
+	cpu_disable_all_irq(&irq_state);
+
+	tm_now          = cpu_get_ticks(cpu) * MSEC_PER_TICK;
+	info->signature = ALRM_INFO_ID;
+	info->tm_wakeup = tm_now + msec;
+
+	if(list_empty(&alarm_mgr->wait_queue))
+		list_add_first(&alarm_mgr->wait_queue, &info->list);
+	else
+	{
+		list_foreach_forward(&alarm_mgr->wait_queue, iter)
+		{
+			current = list_element(iter, struct alarm_info_s, list);
+      
+			if(info->tm_wakeup <= current->tm_wakeup) 
+			{
+				list_add_pred(iter, &info->list);
+				goto NEXT_TRAITMENT;
+			}
+		}
+		list_add_last(&alarm_mgr->wait_queue, &info->list);
+	}
+
+NEXT_TRAITMENT:
+	cpu_restore_irq(irq_state);
+	return 0;
+}
+
+void alarm_clock(struct alarm_s *alarm, uint_t ticks_nr)
+{
+	register uint_t tm_msec;
+	register struct list_entry *iter;
+	register struct alarm_info_s *info;
+  
+	tm_msec = ticks_nr * MSEC_PER_TICK;
+
+	list_foreach_forward(&alarm->wait_queue, iter)
+	{
+		info = list_element(iter, struct alarm_info_s, list);
+
+		assert((info->signature == ALRM_INFO_ID) && "Not an ALRM info object");
+
+		if(tm_msec < info->tm_wakeup)
+			break;
+    
+		list_unlink(iter);
+		event_send(info->event, current_cpu->gid);
+	}
+}
+
+error_t alarm_manager_init(struct alarm_s *alarm)
+{
+	list_root_init(&alarm->wait_queue);
+	return 0;
+}
+
+
+#if CONFIG_THREAD_TIME_STAT
+
+inline void tm_sleep_compute(struct thread_s *thread)
+{
+	uint_t tm_now;
+
+	if(thread->type == TH_IDLE)
+		return;
+
+	rt_timer_read(&tm_now);
+	thread->info.tm_sleep += (tm_now - thread->info.tm_tmp);
+	thread->info.tm_tmp    = tm_now;
+}
+
+inline void tm_usr_compute(struct thread_s *thread)
+{ 
+	uint_t tm_now;
+
+	rt_timer_read(&tm_now);
+	thread->info.tm_usr += (tm_now - thread->info.tm_tmp);
+	thread->info.tm_tmp  = tm_now;
+}
+
+inline void tm_sys_compute(struct thread_s *thread)
+{ 
+	uint_t tm_now;
+
+	rt_timer_read(&tm_now);
+	thread->info.tm_sys += (tm_now - thread->info.tm_tmp);
+	thread->info.tm_tmp  = tm_now;
+}
+
+inline void tm_wait_compute(struct thread_s *thread)
+{
+	uint_t tm_now;
+
+	if(thread->type == TH_IDLE)
+		return;
+
+	rt_timer_read(&tm_now);
+	thread->info.tm_wait += (tm_now - thread->info.tm_tmp);
+	thread->info.tm_tmp   = tm_now;
+	thread->info.tm_exec  = tm_now;
+}
+
+inline void tm_exit_compute(struct thread_s *thread)
+{
+	uint_t tm_now;
+  
+	rt_timer_read(&tm_now);
+	thread->info.tm_sys += tm_now - thread->info.tm_tmp;
+	thread->info.tm_dead = tm_now;
+}
+
+inline void tm_born_compute(struct thread_s *thread)
+{
+	uint_t tm_now;
+  
+	rt_timer_read(&tm_now);
+	thread->info.tm_born = tm_now;
+	thread->info.tm_tmp  = tm_now;
+	thread->info.tm_exec = tm_now;
+}
+
+inline void tm_create_compute(struct thread_s *thread)
+{
+	rt_timer_read(&thread->info.tm_create);
+}
+
+
+#endif	/* CONFIG_THREAD_TIME_STAT */
Index: trunk/kernel/kern/time.h
===================================================================
--- trunk/kernel/kern/time.h	(revision 1)
+++ trunk/kernel/kern/time.h	(revision 1)
@@ -0,0 +1,110 @@
+/*
+ * time.h: thread time related management
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _TIME_H_
+#define _TIME_H_
+
+#include <types.h>
+#include <list.h>
+#include <device.h>
+
+struct event_s;
+
+struct alarm_info_s 
+{
+	uint_t signature;
+
+	/* Public members */
+	struct event_s *event;
+
+	/* Private members */
+	uint_t tm_wakeup;
+	struct list_entry list;
+};
+
+struct alarm_s
+{ 
+	struct list_entry wait_queue;
+};
+
+
+struct timeb {
+	time_t         time;
+	unsigned short millitm;
+	short          timezone;
+	short          dstflag;
+};
+
+struct timeval {
+	clock_t tv_sec;    /* secondes */
+	clock_t tv_usec;   /* microsecondes */
+};
+
+struct timezone {
+	int tz_minuteswest;     /* minutes west of Greenwich */
+	int tz_dsttime;         /* type of DST correction */
+};
+
+
+struct tms 
+{
+       clock_t tms_utime;  /* user time */
+       clock_t tms_stime;  /* system time */
+       clock_t tms_cutime; /* user time of children */
+       clock_t tms_cstime; /* system time of children */
+};
+
+
+error_t alarm_manager_init(struct alarm_s *alarm);
+error_t alarm_wait(struct alarm_info_s *info, uint_t msec);
+
+void alarm_clock(struct alarm_s *alarm, uint_t ticks_nr);
+
+int sys_clock (uint64_t *val);
+int sys_alarm (unsigned nb_sec);
+int sys_ftime (struct timeb *utime);
+int sys_times(struct tms *utms);
+int sys_gettimeofday(struct timeval *tv, struct timezone *tz);
+
+#if CONFIG_THREAD_TIME_STAT
+struct thread_s;
+inline void tm_sleep_compute(struct thread_s *thread);
+inline void tm_usr_compute(struct thread_s *thread);
+inline void tm_sys_compute(struct thread_s *thread);
+inline void tm_wait_compute(struct thread_s *thread);
+inline void tm_exit_compute(struct thread_s *thread);
+inline void tm_born_compute(struct thread_s *thread);
+inline void tm_create_compute(struct thread_s *thread);
+
+#else
+
+#define tm_sleep_compute(thread)
+#define tm_usr_compute(thread)
+#define tm_sys_compute(thread)
+#define tm_wait_compute(thread)
+#define tm_exit_compute(thread)
+#define tm_born_compute(thread)
+#define tm_create_compute(thread)
+
+#endif	/* CONFIG_SCHED_STAT */
+
+#endif	/* _TIME_H_ */
Index: trunk/kernel/kernel.ld
===================================================================
--- trunk/kernel/kernel.ld	(revision 1)
+++ trunk/kernel/kernel.ld	(revision 1)
@@ -0,0 +1,33 @@
+/**********************************************************************************************
+ * This is the linker script for the ALMOS-MK kernel.
+ * It describes the memory layout for the "kernel.elf" binary file.
+ *********************************************************************************************/
+
+/* define the kernel code base address */
+
+kernel_base = 0x400000;
+
+/* Set the entry point of the boot-loader (e_entry field in the "boot.elf" file header) */ 
+
+ENTRY(kernel_init)
+
+/* Describe how to group the sections */
+
+SECTIONS
+{
+    . = kernel_base;
+    .text :
+    {
+        *(.text)
+        *(.rodata*)
+    }
+    . = ALIGN(0x1000);
+    .data :
+    {
+        *(.data*)
+    }
+    .bss :
+    {
+        *(.bss)
+    }
+}
Index: trunk/kernel/kernel_config.h
===================================================================
--- trunk/kernel/kernel_config.h	(revision 690)
+++ 	(revision )
@@ -1,555 +1,0 @@
-/*
- * kernel_config.h - global kernel configuration arguments
- * 
- * Authors        Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c)  UPMC Sorbonne Universites
- * 
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _KERNEL_CONFIG_H_
-#define _KERNEL_CONFIG_H_
-
-////////////////////////////////////////////////////////////////////////////////////////
-//                              KERNEL DEBUG
-//
-// 1) All errors detected by the kernel caused by a system call are reported to the
-//    user process using the ERRNO mechanism. Moreover, the DEBUG_***_ERROR variables
-//    force the compiler to display on TXT0 the error messages generated by
-//    the low-level kernel function, to help the error cause analysis.
-//
-// 2) The other debug variable forece the compiler to display on TXT0 a trace for one
-//    specific kernel function, or one small group of functions.
-//    All these trace variables (but locks, kmem, kcm) respect the following rules: 
-//    - the trace is generated if the debug variable is non zeo.
-//    - trace is generated only when cycle > debug_value.
-//    - detailed trace is enabled when (debug_value & 0x1) is non zero.
-////////////////////////////////////////////////////////////////////////////////////////
-
-// error reporting variables
-
-#define DEBUG_DEV_NIC_ERROR               1
-#define DEBUG_KCM_ERROR                   1
-#define DEBUG_KMEM_ERROR                  1
-#define DEBUG_MAPPER_ERROR                1
-#define DEBUG_PPM_ERROR                   1
-#define DEBUG_PROCESS_ERROR               1
-#define DEBUG_SOCKET_ERROR                1
-#define DEBUG_SYSCALLS_ERROR              1
-#define DEBUG_THREAD_ERROR                1
-#define DEBUG_USER_DIR_ERROR              1
-#define DEBUG_VFS_ERROR                   1
-#define DEBUG_VMM_ERROR                   1
-
-
-// trace activation variables
-
-#define DEBUG_BARRIER_CREATE              0
-#define DEBUG_BARRIER_DESTROY             0
-#define DEBUG_BARRIER_WAIT                0
-
-#define DEBUG_BUSYLOCK_TYPE               0   // type 0 undefined => no debug
-#define DEBUG_BUSYLOCK_PID                0   // owner process PID
-#define DEBUG_BUSYLOCK_TRDID              0   // owner thread TRDID
-                 
-#define DEBUG_CHDEV_CMD_RX                0
-#define DEBUG_CHDEV_CMD_TX                0
-#define DEBUG_CHDEV_SERVER_RX             0
-#define DEBUG_CHDEV_SERVER_TX             0
-
-#define DEBUG_CLUSTER_INIT                0
-#define DEBUG_CLUSTER_PID_ALLOC           0
-#define DEBUG_CLUSTER_PID_RELEASE         0
-#define DEBUG_CLUSTER_PROCESS_COPIES      0
-
-#define DEBUG_DEV_TXT_RX                  0
-#define DEBUG_DEV_TXT_TX                  0
-#define DEBUG_DEV_IOC_RX                  0
-#define DEBUG_DEV_IOC_TX                  0
-#define DEBUG_DEV_NIC_RX                  0
-#define DEBUG_DEV_NIC_TX                  0
-#define DEBUG_DEV_FBF                     0
-#define DEBUG_DEV_DMA                     0
-#define DEBUG_DEV_MMC                     0
-#define DEBUG_DEV_PIC                     0
-
-#define DEBUG_DEVFS_GLOBAL_INIT           0 
-#define DEBUG_DEVFS_LOCAL_INIT            0
-#define DEBUG_DEVFS_MOVE                  0
-
-#define DEBUG_ELF_LOAD                    0
-
-#define DEBUG_DQDT_GET_ROOT               0
-#define DEBUG_DQDT_INIT                   0
-#define DEBUG_DQDT_SELECT_FOR_THREAD      0
-#define DEBUG_DQDT_SELECT_FOR_MEMORY      0
-#define DEBUG_DQDT_UPDATE_PAGES           0
-#define DEBUG_DQDT_UPDATE_THREADS         0
-
-#define DEBUG_FATFS_ADD_DENTRY            0
-#define DEBUG_FATFS_CLUSTER_ALLOC         0
-#define DEBUG_FATFS_CTX_INIT              0
-#define DEBUG_FATFS_FREE_CLUSTERS         0
-#define DEBUG_FATFS_GET_CLUSTER           0
-#define DEBUG_FATFS_GET_USER_DIR          0
-#define DEBUG_FATFS_MOVE_PAGE             0
-#define DEBUG_FATFS_NEW_DENTRY            0
-#define DEBUG_FATFS_RELEASE_INODE         0
-#define DEBUG_FATFS_REMOVE_DENTRY         0
-#define DEBUG_FATFS_SCAN_DIRECTORY        0
-#define DEBUG_FATFS_SYNC_FAT              0
-#define DEBUG_FATFS_SYNC_FSINFO           0
-#define DEBUG_FATFS_SYNC_INODE            0
-#define DEBUG_FATFS_UPDATE_DENTRY         0
-#define DEBUG_FATFS_UPDATE_IOC            0
-
-#define DEBUG_GRDXT_INSERT                0
-
-#define DEBUG_HAL_CONTEXT_FORK            0
-#define DEBUG_HAL_CONTEXT_INIT            0
-#define DEBUG_HAL_EXCEPTIONS              0
-#define DEBUG_HAL_FBF                     0
-#define DEBUG_HAL_GPT_COPY                0
-#define DEBUG_HAL_GPT_CREATE              0
-#define DEBUG_HAL_GPT_DESTROY             0
-#define DEBUG_HAL_GPT_LOCK_PTE            0
-#define DEBUG_HAL_GPT_SET_COW             0
-#define DEBUG_HAL_GPT_SET_PTE             0
-#define DEBUG_HAL_IOC_RX                  0
-#define DEBUG_HAL_IOC_TX                  0
-#define DEBUG_HAL_IRQS                    0
-#define DEBUG_HAL_KENTRY                  0
-#define DEBUG_HAL_NIC_RX                  0
-#define DEBUG_HAL_NIC_TX                  0
-#define DEBUG_HAL_TXT_RX                  0
-#define DEBUG_HAL_TXT_TX                  0
-#define DEBUG_HAL_USPACE                  0
-#define DEBUG_HAL_VMM                     0
-
-#define DEBUG_KCM                         0
-#define DEBUG_KCM_ORDER                   0    // filter for DEBUG_KCM
-#define DEBUG_KCM_CXY                     0    // filter for DEBUG_KCM
-
-#define DEBUG_KERNEL_INIT                 0
-
-#define DEBUG_KMEM                        0
-#define DEBUG_KMEM_ORDER                  0    // filter for DEBUG_KMEM
-#define DEBUG_KMEM_CXY                    0    // filter for DEBUG_KMEM
-
-#define DEBUG_MAPPER_GET_PAGE             0
-#define DEBUG_MAPPER_GET_FAT_PAGE         0
-#define DEBUG_MAPPER_HANDLE_MISS          0
-#define DEBUG_MAPPER_MOVE_KERNEL          0
-#define DEBUG_MAPPER_MOVE_USER            0
-#define DEBUG_MAPPER_SYNC                 0
-
-#define DEBUG_MUTEX                       0
-
-#define DEBUG_PPM_ALLOC_PAGES             0
-#define DEBUG_PPM_FREE_PAGES              0
-   
-#define DEBUG_PROCESS_COPY_INIT           0
-#define DEBUG_PROCESS_DESTROY             0
-#define DEBUG_PROCESS_FD_REGISTER         0
-#define DEBUG_PROCESS_FD_REMOVE           0
-#define DEBUG_PROCESS_FD_CLEAN_ALL        0
-#define DEBUG_PROCESS_GET_LOCAL_COPY      0
-#define DEBUG_PROCESS_INIT_CREATE         0
-#define DEBUG_PROCESS_MAKE_EXEC           0
-#define DEBUG_PROCESS_MAKE_FORK           0
-#define DEBUG_PROCESS_REFERENCE_INIT      0
-#define DEBUG_PROCESS_SIGACTION           0
-#define DEBUG_PROCESS_TXT                 0
-#define DEBUG_PROCESS_ZERO_CREATE         0
-
-#define DEBUG_QUEUELOCK_TYPE              0   // type 0 undefined => no debug
-#define DEBUG_QUEUELOCK_PTR               0   // lock local pointer
-#define DEBUG_QUEUELOCK_CXY               0   // lock cluster identifier
-
-#define DEBUG_RPC_CLIENT_GENERIC          0
-#define DEBUG_RPC_SERVER_GENERIC          0
-
-#define DEBUG_RPC_FBF_DISPLAY             0
-#define DEBUG_RPC_PROCESS_MAKE_FORK       0
-#define DEBUG_RPC_PROCESS_SIGACTION       0
-#define DEBUG_RPC_THREAD_USER_CREATE      0
-#define DEBUG_RPC_THREAD_KERNEL_CREATE    0
-#define DEBUG_RPC_USER_DIR_CREATE         0
-#define DEBUG_RPC_USER_DIR_DESTROY        0
-#define DEBUG_RPC_VMM_CREATE_VSEG         0
-#define DEBUG_RPC_VMM_RESIZE_VSEG         0
-#define DEBUG_RPC_VMM_REMOVE_VSEG         0
-#define DEBUG_RPC_VMM_SET_COW             0
-
-#define DEBUG_RWLOCK_TYPE                 0   // type 0 undefined => no debug
-#define DEBUG_RWLOCK_PTR                  0   // lock local pointer
-#define DEBUG_RWLOCK_CXY                  0   // lock cluster identifier
-
-#define DEBUG_SCHED_HANDLE_SIGNALS        0
-#define DEBUG_SCHED_YIELD                 0
-#define DEBUG_SCHED_RPC_ACTIVATE          0
-
-#define DEBUG_SEM                         0
-
-#define DEBUG_SOCKET_ACCEPT               0
-#define DEBUG_SOCKET_ALARM                0
-#define DEBUG_SOCKET_BIND                 0
-#define DEBUG_SOCKET_BUILD                0
-#define DEBUG_SOCKET_CLOSE                0
-#define DEBUG_SOCKET_CONNECT              0
-#define DEBUG_SOCKET_CREATE               0
-#define DEBUG_SOCKET_DESTROY              0
-#define DEBUG_SOCKET_LISTEN               0
-#define DEBUG_SOCKET_SEND                 0
-#define DEBUG_SOCKET_RECV                 0
-#define DEBUG_SOCKET_LINK                 0
-
-#define DEBUG_SYS_BARRIER                 0
-#define DEBUG_SYS_CLOSE                   0
-#define DEBUG_SYS_CLOSEDIR                0
-#define DEBUG_SYS_CONDVAR                 0
-#define DEBUG_SYS_DISPLAY                 0
-#define DEBUG_SYS_EXEC                    0
-#define DEBUG_SYS_EXIT                    0
-#define DEBUG_SYS_FBF                     0
-#define DEBUG_SYS_FG                      0
-#define DEBUG_SYS_FORK                    0
-#define DEBUG_SYS_GET                     0  
-#define DEBUG_SYS_GETCWD                  0
-#define DEBUG_SYS_GETPID                  0
-#define DEBUG_SYS_ISATTY                  0
-#define DEBUG_SYS_IS_FG                   0
-#define DEBUG_SYS_KILL                    0
-#define DEBUG_SYS_LSEEK                   0
-#define DEBUG_SYS_MKDIR                   0
-#define DEBUG_SYS_MMAP                    0
-#define DEBUG_SYS_MUNMAP                  0
-#define DEBUG_SYS_MUTEX                   0
-#define DEBUG_SYS_OPEN                    0
-#define DEBUG_SYS_OPENDIR                 0
-#define DEBUG_SYS_READ                    0
-#define DEBUG_SYS_READDIR                 0
-#define DEBUG_SYS_SEM                     0
-#define DEBUG_SYS_SOCKET                  0
-#define DEBUG_SYS_STAT                    0
-#define DEBUG_SYS_THREAD_CANCEL           0
-#define DEBUG_SYS_THREAD_CREATE           0
-#define DEBUG_SYS_THREAD_EXIT             0
-#define DEBUG_SYS_THREAD_JOIN             0
-#define DEBUG_SYS_THREAD_SLEEP            0
-#define DEBUG_SYS_THREAD_WAKEUP           0
-#define DEBUG_SYS_THREAD_YIELD            0
-#define DEBUG_SYS_TRACE                   0
-#define DEBUG_SYS_UNLINK                  0
-#define DEBUG_SYS_WAIT                    0
-#define DEBUG_SYS_WRITE                   0
-
-#define DEBUG_THREAD_BLOCK                0
-#define DEBUG_THREAD_DELETE               0
-#define DEBUG_THREAD_DESTROY              0
-#define DEBUG_THREAD_GET_XPTR             0
-#define DEBUG_THREAD_IDLE                 0
-#define DEBUG_THREAD_INIT                 0
-#define DEBUG_THREAD_KERNEL_CREATE        0
-#define DEBUG_THREAD_USER_CREATE          0
-#define DEBUG_THREAD_USER_FORK            0
-#define DEBUG_THREAD_USER_EXEC            0
-
-#define DEBUG_USER_DIR_CREATE             0
-#define DEBUG_USER_DIR_DESTROY            0
-
-#define DEBUG_VFS_ADD_CHILD               0
-#define DEBUG_VFS_ADD_SPECIAL             0
-#define DEBUG_VFS_CHDIR                   0
-#define DEBUG_VFS_CLOSE                   0
-#define DEBUG_VFS_DENTRY_CREATE           0
-#define DEBUG_VFS_FILE_CREATE             0
-#define DEBUG_VFS_FILE_DESTROY            0
-#define DEBUG_VFS_GET_PATH                0
-#define DEBUG_VFS_INODE_CREATE            0
-#define DEBUG_VFS_INODE_LOAD_ALL          0
-#define DEBUG_VFS_KERNEL_MOVE             0
-#define DEBUG_VFS_LINK                    0
-#define DEBUG_VFS_LOOKUP                  0
-#define DEBUG_VFS_LSEEK                   0
-#define DEBUG_VFS_MKDIR                   0
-#define DEBUG_VFS_NEW_DENTRY_INIT         0
-#define DEBUG_VFS_OPEN                    0
-#define DEBUG_VFS_OPENDIR                 0
-#define DEBUG_VFS_REMOVE_CHILD            0
-#define DEBUG_VFS_STAT                    0
-#define DEBUG_VFS_USER_MOVE               0
-#define DEBUG_VFS_UNLINK                  0
-
-
-#define DEBUG_VMM_CREATE_VSEG             0
-#define DEBUG_VMM_DESTROY                 0
-#define DEBUG_VMM_FORK_COPY               0
-#define DEBUG_VMM_GET_ONE_PPN             0
-#define DEBUG_VMM_GET_PTE                 0
-#define DEBUG_VMM_GLOBAL_DELETE_VSEG      0
-#define DEBUG_VMM_GLOBAL_RESIZE_VSEG      0
-#define DEBUG_VMM_HANDLE_PAGE_FAULT       0
-#define DEBUG_VMM_HANDLE_COW              0
-#define DEBUG_VMM_MMAP                    0
-#define DEBUG_VMM_PAGE_ALLOCATE           0
-#define DEBUG_VMM_REMOVE_VSEG             0
-#define DEBUG_VMM_RESIZE_VSEG             0
-#define DEBUG_VMM_SET_COW                 0
-#define DEBUG_VMM_UPDATE_PTE              0
-#define DEBUG_VMM_USER_INIT               0
-#define DEBUG_VMM_USER_RESET              0
-
-#define DEBUG_XHTAB                       0
-
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                KERNEL LOCKS TYPES MNEMONICS (for debug)
-// It must be kept consistent with the lock_name[] array defined in kernel_init.c file.
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define LOCK_CLUSTER_KCM       1   // local  (B)  protect dynamic KCM creation in cluster
-#define LOCK_SCHED_STATE       2   // local  (B)  protect scheduler state for given core
-#define LOCK_VMM_STACK         3   // local  (B)  protect VMM stack vseg allocator   
-#define LOCK_VMM_MMAP          4   // local  (B)  protect VMM mmap vseg allocator
-#define LOCK_KCM_STATE         5   // local  (B)  protect KCM allocator state
-#define LOCK_KHM_STATE         6   // local  (B)  protect KHM allocator state
-#define LOCK_HTAB_STATE        7   // local  (B)  protect a local htab state
-#define LOCK_CORE_ALARMS       8   // local  (B)  protect list of alarms in core desc.
-
-#define LOCK_VFS_CTX           9   // remote (B)  protect vfs context state
-#define LOCK_PPM_FREE         10   // remote (B)  protect PPM allocator free_pages lists
-#define LOCK_THREAD_JOIN      11   // remote (B)  protect join/exit between two threads
-#define LOCK_XHTAB_STATE      12   // remote (B)  protect a distributed xhtab state
-#define LOCK_CHDEV_QUEUE      13   // remote (B)  protect chdev threads waiting queue
-#define LOCK_CHDEV_TXT0       14   // remote (B)  protect access to kernel terminal TXT0
-#define LOCK_CHDEV_TXTLIST    15   // remote (B)  protect xlist of processes using same TXT
-#define LOCK_PAGE_STATE       16   // remote (B)  protect physical page descriptor state
-#define LOCK_MUTEX_STATE      17   // remote (B)  protect user mutex state
-#define LOCK_CONDVAR_STATE    18   // remote (B)  protect user condvar state
-#define LOCK_SEM_STATE        19   // remote (B)  protect user semaphore state
-#define LOCK_PROCESS_CWD      20   // remote (B)  protect current working directory in process
-#define LOCK_BARRIER_STATE    21   // remote (B)  protect user barrier state
-#define LOCK_LISTEN_SOCKET    22   // remote (B)  protect xlist of listening sockets
-
-#define LOCK_CLUSTER_PREFTBL  23   // local  (Q)  protect array of ref. processes in cluster
-
-#define LOCK_SOCKET_STATE     24   // remote (Q)  protect kernel socket state
-#define LOCK_PPM_DIRTY        25   // remote (Q)  protect PPM dirty_pages list
-#define LOCK_CLUSTER_LOCALS   26   // remote (Q)  protect xlist of local processes in cluster
-#define LOCK_CLUSTER_COPIES   27   // remote (Q)  protect xlist of process copies in cluster
-#define LOCK_PROCESS_CHILDREN 28   // remote (Q)  protect xlist of chidren process in process
-#define LOCK_PROCESS_USERSYNC 29   // remote (Q)  protect lists of user synchros in process
-#define LOCK_PROCESS_FDARRAY  30   // remote (Q)  protect array of open files in owner process
-#define LOCK_PROCESS_DIR      31   // remote (Q)  protect xlist of open directories in process
-#define LOCK_VMM_VSL          32   // remote (Q)  protect VSL (local list of vsegs)
-
-#define LOCK_PROCESS_THTBL    33   // local  (RW) protect local array of threads in a process 
-
-#define LOCK_MAPPER_STATE     34   // remote (RW) protect mapper state
-#define LOCK_VFS_SIZE         35   // remote (RW) protect inode state and associated mapper
-#define LOCK_VFS_FILE         36   // remote (RW) protect file descriptor state
-#define LOCK_VFS_MAIN         37   // remote (RW) protect vfs traversal (in root inode)
-#define LOCK_FATFS_FAT        38   // remote (RW) protect exclusive access to the VFS FAT
-#define LOCK_FBF_WINDOWS      39   // remote (RW) protect FBF windows set
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                          GENERAL CONFIGURATION     
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_VERSION           "Version 2.4 / November 2020"
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                          HARDWARE CONFIGURATION     
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_KERNEL_IDENTITY_MAP          true       // True for 32 bits cores             
-#define CONFIG_MAX_CLUSTERS_X               16         // max number of clusters in row
-#define CONFIG_MAX_CLUSTERS_Y               16         // max number of clusters in column
-#define CONFIG_MAX_CLUSTERS                 (CONFIG_MAX_CLUSTERS_X * CONFIG_MAX_CLUSTERS_Y) 
-#define CONFIG_MAX_LOCAL_CORES              4          // max number of cores per cluster
-#define CONFIG_MAX_INT_DEV                  4          // max number of internal peripherals
-#define CONFIG_MAX_EXT_DEV                  8          // max number of external peripherals
-#define CONFIG_MAX_INTERNAL_IRQS            32         // max number of internal IRQs
-#define CONFIG_MAX_EXTERNAL_IRQS            32         // max number of external IRQs
-#define CONFIG_IRQS_PER_CORE                4          // number of input IRQs per core
-#define CONFIG_CLUSTER_SPAN                 32         // ln(phys. address space per cluster)
-#define CONFIG_CACHE_LINE_SIZE              64         // number of bytes in cache line
-#define CONFIG_CACHE_LINE_ORDER             6          // ln( cache line size )
-
-#define CONFIG_CACHE_LINE_ALIGNED           __attribute__((aligned(CONFIG_CACHE_LINE_SIZE)))
-
-#define CONFIG_MAX_IOC_CHANNELS             1          // max number of IOC device channels
-#define CONFIG_MAX_FBF_CHANNELS             1          // max number of FBF device channels
-#define CONFIG_MAX_TXT_CHANNELS             8          // max number of TXT device channels
-#define CONFIG_MAX_DMA_CHANNELS             4          // max number of DMA device channels
-#define CONFIG_MAX_NIC_CHANNELS             4          // max number of NIC device channels
-
-#define CONFIG_TXT_ECHO_MODE                1          // echo mode for TXT peripheral
-#define CONFIG_TXT_KBUF_SIZE                512        // kernel buffer for TXT write
-
-#define CONFIG_FBF_WIDTH                    128
-#define CONFIG_FBF_HEIGHT                   128
-
-#define CONFIG_CPU_CTX_SIZE                 256        // up to 64 uint32_t registers
-#define CONFIG_FPU_CTX_SIZE                 256        // up to 32 uint64_t registers
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                                  DQDT        
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_DQDT_LEVELS_NR               5
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                              FBF WINDOWS       
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_FBF_WINDOWS_MAX_NR           64         // max number of windows
-#define CONFIG_FBF_WINDOWS_MAX_WIDTH        1024       // max number of pixels in FBF line
-#define CONFIG_FBF_WINDOWS_MAX_HEIGHT       1024       // max number of lines in FBF
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                            PROCESS MANAGEMENT       
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_PROCESS_INIT_PATH            "/bin/user/init.elf"
-#define CONFIG_MAX_PROCESS_PER_CLUSTER      16         // max number of owned process
-#define CONFIG_PROCESS_ARGS_MAX_NR          4          // max number of args per process 
-#define CONFIG_PROCESS_ENVS_MAX_NR          256        // max number of envs per process
-#define CONFIG_PROCESS_FILE_MAX_NR          256        // max number of files per process
-#define CONFIG_PROCESS_MAX_CHILDREN         1024       // max number of children process
-#define CONFIG_PROCESS_HEAP_MIN_SIZE        0x00010000 // user heap min size (bytes)
-#define CONFIG_PROCESS_HEAP_MAX_SIZE        0x30000000 // user heap max size (bytes)
-#define CONFIG_PROCESS_DISPLAY_BUF_SIZE     128        // display one process on one line 
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                          PHYSICAL MEMORY MANAGEMENT         
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_PPM_PAGE_SIZE          4096          // physical page size (bytes)
-#define CONFIG_PPM_PAGE_ORDER         12            // ln(physical page size)
-#define CONFIG_PPM_PAGE_MASK          0x00000FFF    // physical page mask     
-#define CONFIG_PPM_MAX_ORDER          16            // ln(total number of pages per cluster)
-#define CONFIG_PPM_MAX_RSVD           32            // max reserved zones on the machine
-
-#define CONFIG_PPM_PAGE_ALIGNED       __attribute__((aligned(CONFIG_PPM_PAGE_SIZE)))
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                              RANDOM NUMBERS 
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_RDNG_PARAM_A                 65519
-#define CONFIG_RDNG_PARAM_C                 64037
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                             REMOTE PROCEDURE CALL
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_RPC_FIFO_SLOTS		        16
-#define CONFIG_RPC_FIFO_MAX_ITERATIONS      1024
-#define CONFIG_RPC_THREADS_MAX              4       // max number of RPC threads per core
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                                SCHEDULING 
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_SCHED_TICKS_PER_SECOND       1        // number of TICKS per seconds   
-#define CONFIG_SCHED_TICKS_PER_QUANTUM      1        // number of ticks between scheduling
-#define CONFIG_SCHED_MAX_THREADS_NR         32       // max number of threads per core
-#define CONFIG_SCHED_IDLE_MODE_SLEEP        0        // idle thread use sleep mode if non 0
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                                TCP/UDP/IP 
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_SOCK_ISS_CLIENT        0x10000      // initial sequence number for TCP client
-#define CONFIG_SOCK_ISS_SERVER        0x20000      // initial sequence number for TCP server
-#define CONFIG_SOCK_MAX_WINDOW        0xFFFFF      // initial window (bytes) for TCP
-#define CONFIG_SOCK_RETRY_TIMEOUT     1000000      // number of cycles before retry for TCP
-#define CONFIG_SOCK_QUEUES_DEPTH      4            // max number of packets in RX/TX queues 
-#define CONFIG_SOCK_RX_BUF_ORDER      20           // ln( number of bytes in socket rx_buf )
-#define CONFIG_SOCK_TX_BUF_ORDER      20           // ln( number of bytes in socket tx_buf )
-#define CONFIG_SOCK_R2T_BUF_SIZE      8            // max number of requests in R2T queue 
-#define CONFIG_SOCK_CRQ_BUF_SIZE      8            // max number of requests in CRQ queue
-#define CONFIG_SOCK_PKT_BUF_SIZE      2048         // max length for one ETH/IP/TCP packet
-#define CONFIG_SOCK_PAYLOAD_MAX       1500         // max user payload length for packet
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                                 THREADS 
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_THREADS_MAX_PER_CLUSTER      32       // max threads per cluster per process
-#define CONFIG_THREAD_DESC_SIZE             0x4000   // thread desc size (with kernel stack)
-#define CONFIG_THREAD_DESC_ORDER            14       // ln( number of bytes )
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                            VIRTUAL FILE SYSTEM        
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_VFS_ROOT_CXY                 0          // VFS_ROOT and FAT mapper cluster
-
-#define CONFIG_VFS_MAX_INODES               128        // max number of inodes per cluster
-#define CONFIG_VFS_MAX_NAME_LENGTH          56         // dentry name max length (bytes)
-#define CONFIG_VFS_MAX_PATH_LENGTH          256        // pathname max length (bytes)
-#define CONFIG_VFS_FREE_CLUSTERS_MIN        32         // min number of free clusters
-#define CONFIG_VFS_MAX_DENTRIES             63         // max number of dentries in one dir
-
-#define CONFIG_VFS_ROOT_IS_FATFS            1          // root FS is FATFS if non zero
-#define CONFIG_VFS_ROOT_IS_EX2FS            0          // root FS is EX2FS if non zero
-
-#define CONFIG_MAPPER_GRDXT_W1              6          // number of bits for RADIX_TREE_IX1
-#define CONFIG_MAPPER_GRDXT_W2              7          // number of bits for RADIX_TREE_IX2
-#define CONFIG_MAPPER_GRDXT_W3              7          // number of bits for RADIX_TREE_IX3
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//       32 bits  USER SPACE SEGMENTATION / all bases and sizes are numbers of pages
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_VMM_VSPACE_SIZE        0x100000      // virtual space          : 4   Gbytes
-
-#define CONFIG_VMM_UTILS_BASE         0x000200      // UTILS zone base        : 2   Mbytes
-#define CONFIG_VMM_ELF_BASE           0x000400      // ELF zone base          : 4   Mbytes
-#define CONFIG_VMM_HEAP_BASE          0x040000      // HEAP zone base         : 32  Mbytes
-#define CONFIG_VMM_STACK_BASE         0x0C0000      // STACK zone base        : 3   Gbytes
- 
-#define CONFIG_VMM_ARGS_SIZE          0x000001      // args vseg size         : 4   Kbytes
-#define CONFIG_VMM_ENVS_SIZE          0x000004      // envs vseg size         : 16  Kbytes
-#define CONFIG_VMM_STACK_SIZE         0x000100      // single stack vseg size : 1   Mbytes
-
-#define CONFIG_VMM_HEAP_MAX_ORDER     18            // max size of MMAP vseg  : 1   Gbytes
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                  MISCELANEOUS BUFFER SIZES  
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_PRINTK_BUF_SIZE        0x800        // max length of a formated string
-#define CONFIG_PIPE_BUF_SIZE          0x1000       // max number of bytes in a pipe buffer
-
-////////////////////////////////////////////////////////////////////////////////////////////
-//                 INSTRUMENTATION
-////////////////////////////////////////////////////////////////////////////////////////////
-
-#define CONFIG_INSTRUMENTATION_SYSCALLS    0
-#define CONFIG_INSTRUMENTATION_PGFAULTS    0
-#define CONFIG_INSTRUMENTATION_FOOTPRINT   1
-#define CONFIG_INSTRUMENTATION_CHDEVS      0
-#define CONFIG_INSTRUMENTATION_GPT         0
-
-
-
-
-#endif	/* _KERNEL_CONFIG_H_ */
Index: trunk/kernel/ksh/cat.c
===================================================================
--- trunk/kernel/ksh/cat.c	(revision 1)
+++ trunk/kernel/ksh/cat.c	(revision 1)
@@ -0,0 +1,71 @@
+/*
+	This file is part of MutekP.
+	
+	MutekP is free software; you can redistribute it and/or modify it
+	under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+	
+	MutekP is distributed in the hope that it will be useful, but
+	WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	General Public License for more details.
+	
+	You should have received a copy of the GNU General Public License
+	along with MutekP; if not, write to the Free Software Foundation,
+	Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+	
+	UPMC / LIP6 / SOC (c) 2008
+	Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <stdint.h>
+#include <string.h>
+#include <sys-vfs.h>
+#include <kminiShell.h>
+ 
+error_t cat_func(void *param)
+{
+#if 1
+	struct ku_obj ku_buff;
+	error_t err;
+	ssize_t size;
+	uint32_t argc;
+	uint32_t i;
+	struct vfs_file_s file;
+	ms_args_t *args;
+	uint_t count;
+
+	args  = (ms_args_t*) param;
+	argc = args->argc;
+	err = 0;
+	
+	for(i=1; i< argc; i++)
+	{
+		
+		KK_BUFF(ku_buff, args->argv[i]);
+		if((err=vfs_open(ms_n_cwd, &ku_buff,VFS_O_RDONLY,0, &file)))
+			return err;
+		
+		KK_SZ_BUFF(ku_buff, buffer, BUFFER_SIZE);
+		while((size = vfs_read(&file, &ku_buff)) > 0)
+		{ 
+			ksh_write(buffer, size);
+			//if((ch=getChar()) == 'q') break;
+		}
+		
+		err = vfs_close(&file, &count);
+	 
+		if(err)
+			printk(WARNING, "WARNING: %s: failed to close file at iteration %d, err %d\n", __FUNCTION__, i, err);
+
+		
+		if(size < 0) return size;
+	}
+
+	return 0;
+#else
+	return ENOSYS;
+#endif
+}
+
Index: trunk/kernel/ksh/cd.c
===================================================================
--- trunk/kernel/ksh/cd.c	(revision 1)
+++ trunk/kernel/ksh/cd.c	(revision 1)
@@ -0,0 +1,40 @@
+/*
+	This file is part of MutekP.
+	
+	MutekP is free software; you can redistribute it and/or modify it
+	under the terms of the GNU General Public License as published by
+	the Free Software Foundation; either version 2 of the License, or
+	(at your option) any later version.
+	
+	MutekP is distributed in the hope that it will be useful, but
+	WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	General Public License for more details.
+	
+	You should have received a copy of the GNU General Public License
+	along with MutekP; if not, write to the Free Software Foundation,
+	Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+	
+	UPMC / LIP6 / SOC (c) 2008
+	Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <kminiShell.h>
+
+error_t cd_func(void *param)
+{
+	ms_args_t *args ;
+	char * path_name;
+	struct ku_obj ku_path;
+	
+	args  = (ms_args_t *) param;
+
+	if(args->argc == 1)
+		path_name = "/";
+	else
+		path_name = args->argv[1];
+
+	
+	KK_BUFF(ku_path, path_name);
+	return vfs_chdir(&ku_path, ms_n_cwd);
+}
Index: trunk/kernel/ksh/clear.c
===================================================================
--- trunk/kernel/ksh/clear.c	(revision 1)
+++ trunk/kernel/ksh/clear.c	(revision 1)
@@ -0,0 +1,29 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <kminiShell.h>
+ 
+error_t clear_func(void* param)
+{
+  ksh_print("%c%c%c%c", 0x1b, '[', '2', 'J');
+  return 0;
+}
+
Index: trunk/kernel/ksh/cp.c
===================================================================
--- trunk/kernel/ksh/cp.c	(revision 1)
+++ trunk/kernel/ksh/cp.c	(revision 1)
@@ -0,0 +1,82 @@
+/*
+	 This file is part of MutekP.
+	
+	 MutekP is free software; you can redistribute it and/or modify it
+	 under the terms of the GNU General Public License as published by
+	 the Free Software Foundation; either version 2 of the License, or
+	 (at your option) any later version.
+	
+	 MutekP is distributed in the hope that it will be useful, but
+	 WITHOUT ANY WARRANTY; without even the implied warranty of
+	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	 General Public License for more details.
+	
+	 You should have received a copy of the GNU General Public License
+	 along with MutekP; if not, write to the Free Software Foundation,
+	 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+	
+	 UPMC / LIP6 / SOC (c) 2008
+	 Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <string.h>
+#include <stdint.h>
+#include <vfs.h>
+#include <kminiShell.h>
+
+error_t cp_func(void *param)
+{
+	char *src_name;
+	char *dest_name;
+	error_t err;
+	uint32_t argc;
+	uint32_t i;
+	ssize_t size;
+	struct ku_obj kuo;
+	struct vfs_file_s src_file;
+	struct vfs_file_s dest_file;
+	ms_args_t *args;
+	uint_t count;			/* FIXME to be correctly used */
+
+	args  = (ms_args_t *) param;
+	argc = args->argc;
+	dest_name = args->argv[argc - 1];
+	err = 0;
+	
+	KK_BUFF(kuo, dest_name);
+	if((err=vfs_open(ms_n_cwd, &kuo, VFS_O_WRONLY | VFS_O_CREATE,0, &dest_file)))
+		return err;
+	
+	argc --;
+
+	for(i=1; i< argc; i++)
+	{
+		src_name = args->argv[i];
+		
+		KK_BUFF(kuo, src_name);
+		if((err=vfs_open(ms_n_cwd, &kuo,VFS_O_RDONLY,0, &src_file))){
+			vfs_close(&dest_file, &count);
+			ksh_print("error while opinig %s\n",src_name);
+			return err;
+		}
+		size = 0;
+		KK_SZ_BUFF(kuo, buffer, BUFFER_SIZE);
+		while((size = vfs_read(&src_file, &kuo)) > 0)
+		{
+			//KK_SZ_BUFF(kuo, buffer, BUFFER_SIZE);
+			if((size=vfs_write(&dest_file, &kuo)) < 0)
+			goto CP_FUNC_ERROR;
+		}
+		
+		if(size < 0) goto CP_FUNC_ERROR;
+		vfs_close(&src_file, &count);
+	}
+	vfs_close(&dest_file,&count);
+	return 0;
+
+ CP_FUNC_ERROR:
+	vfs_close(&src_file,&count);
+	vfs_close(&dest_file,&count);
+	
+	return size;
+}
Index: trunk/kernel/ksh/eomtkp.c
===================================================================
--- trunk/kernel/ksh/eomtkp.c	(revision 1)
+++ trunk/kernel/ksh/eomtkp.c	(revision 1)
@@ -0,0 +1,109 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <cpu.h>
+#include <string.h>
+#include <stdint.h>
+#include <kminiShell.h>
+#include <vfs.h>
+#include <sgiImg.h>
+#include <sys-vfs.h>
+
+#ifdef BUFFER_SIZE
+#undef BUFFER_SIZE //512 //2048
+#define BUFFER_SIZE 512
+#endif
+
+error_t eomtkp_func(void *param)
+{
+  char *src_name;
+  error_t err;
+  uint16_t x_size;
+  uint16_t y_size;
+  ssize_t size;
+  int src_fd;
+  int dst_fd;
+  int tmp_fd;
+  clock_t tm_start;		/* start of command */
+  clock_t tm_header;		/* image's header paressing */
+  clock_t tm_end;		/* end of command */
+  clock_t tm_tmp;
+  ms_args_t *args;
+  struct sgi_info_s *sgi_info;
+
+  sys_clock(&tm_start);
+
+  args  = (ms_args_t *) param;
+  src_name = args->argv[1];
+  err = 0;
+  memset(buffer,0,BUFFER_SIZE);
+
+  if((dst_fd = sys_open("/DEV/SCREEN",VFS_O_WRONLY,0)) == -1)
+    return -1;
+      
+  if((src_fd = sys_open(src_name,VFS_O_RDONLY,0)) == -1){
+    sys_close(dst_fd);
+    ksh_print("error while opinig %s\n",src_name);
+    return -2;
+  }
+  
+  if((size = sys_read(src_fd, buffer,sizeof(*sgi_info))) < 0)
+  {
+    sys_close(dst_fd);
+    sys_close(src_fd);
+    return -3;
+  }
+
+  sgi_info = (struct sgi_info_s*) buffer;
+  x_size = SGI_TO_LE2(sgi_info->x_size);
+  y_size = SGI_TO_LE2(sgi_info->y_size);
+
+  if((tmp_fd = sys_open("/DEV/SCREEN",VFS_O_WRONLY,0)) == -1)
+    return -1;
+  
+  ksh_print("Image XSIZE %d, YSIZE %d\n", x_size, y_size);
+  ksh_print("Image Name: %s\n", sgi_info->img_name);
+  
+  if((size = sys_lseek(src_fd, sizeof(struct sgi_info_s), VFS_SEEK_SET)) == -1)
+    return -4;
+
+  sys_clock(&tm_tmp);
+  tm_header = tm_tmp - tm_start;
+
+  size = 0;
+  while((size = sys_read(src_fd,buffer,BUFFER_SIZE)) > 0)
+  {
+    if((size=sys_write(dst_fd,buffer,size)) < 0)
+      break;
+  }
+  
+  sys_close(src_fd);
+  sys_close(dst_fd);
+  
+  sys_clock(&tm_end);
+
+  ksh_print("  Command statistics:\n\tStart time: %u\n\tEnd time: %u\n\tElapsed time: %u\n\tHeader time: %u\n",
+	 tm_start,
+	 tm_end,
+	 tm_end - tm_start,
+	 tm_header);
+  return size;
+}
Index: trunk/kernel/ksh/error.c
===================================================================
--- trunk/kernel/ksh/error.c	(revision 1)
+++ trunk/kernel/ksh/error.c	(revision 1)
@@ -0,0 +1,65 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <system.h>
+#include <stdint.h>
+#include <kminiShell.h>
+
+#if 0
+#define ERROR_NR 17
+
+static const   char *msg1 = "NOT FOUND" ;
+static const   char *msg2 = "NO MORE MEMROY RESSOURCES" ;
+static const   char *msg3 = "NO MORE SPACE" ;
+static const   char *msg4 = "I/O ERROR" ;
+static const   char *msg5 = "UNKNOWN ERROR" ;
+static const   char *msg6 = "INVAILD IN VALUE" ;
+static const   char *msg7 = "BAD BLOCK FOUND" ;
+static const   char *msg8 = "ALREADY EXIST !" ;
+static const   char *msg9 = "IT'S DIRECTORY !" ;
+static const   char *msg10 = "BAD FILE DESCRIPTOR" ;
+static const   char *msg11 = "IT'S A PIPE OR FIFO" ;
+static const   char *msg12 = "SIZE OVERFLOW" ;
+static const   char *msg13 = "IS NOT DIRECTORY" ;
+static const   char *msg14 = "END OF DIRECTORY" ;
+static const   char *msg15 = "NOT IMPLEMENTED BY THAT SUB-SYSTEM" ;
+static const   char *msg16 = "NO MORE READERS ON PIPE OR FIFO" ;
+static const   char *msg17 = "DIRECTORY IS NOT EMPTY" ;
+ 
+void print_error_msg(error_t err)
+{
+  const char *msg_tab[18] = {NULL,msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8,msg9, \
+			     msg10,msg11,msg12,msg13,msg14,msg15,msg16,msg17};
+
+  err = (err < 0) ? -err : err;
+  
+  if((err < 1) || (err > ERROR_NR))
+    ksh_print("Invaild error code !!! %d\n", err);
+  else
+    ksh_print("Error: %s\n",msg_tab[err]);
+}
+
+#else
+void print_error_msg(error_t err)
+{
+  ksh_print("Command has failed\n");
+}
+#endif
Index: trunk/kernel/ksh/exec_func.c
===================================================================
--- trunk/kernel/ksh/exec_func.c	(revision 1)
+++ trunk/kernel/ksh/exec_func.c	(revision 1)
@@ -0,0 +1,67 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <stdint.h>
+#include <thread.h>
+#include <task.h>
+#include <kminiShell.h>
+
+char *envrion[] = { "ALMOS_VERSION=v1", NULL};
+ 
+error_t exec_func(void *param)
+{
+  char *path_name;
+  //error_t err;
+  uint32_t argc,i;
+  ms_args_t *args;
+  char *argv[MS_MAX_ARG_LEN + 1];
+
+  args = (ms_args_t *) param;
+  argc = args->argc;
+
+  if(argc < 2)
+  {
+    ksh_print("exec: missing operand\n");
+    return EINVAL;
+  }
+
+  path_name = args->argv[1];
+
+  for(i=1; i < argc; i++)
+    argv[i-1] = args->argv[i];
+
+  argv[argc - 1] = NULL;
+  
+#if 0
+  for(i=0; i < argc; i++)
+    ksh_print("%s: argv[%d]=%x, argv[%d]=%s\n", __FUNCTION__,i, argv[i], i, (argv[i] == NULL) ? "NULL" : argv[i]);
+#endif
+
+#if 0
+  if((err = do_exec(current_task, path_name, argv, &envrion[0])))
+  {
+    ksh_print("exec: error %d, faild to execute command %s\n", err, path_name);
+    return err;
+  }
+#endif
+  return 0;
+}
+
Index: trunk/kernel/ksh/instrument.c
===================================================================
--- trunk/kernel/ksh/instrument.c	(revision 1)
+++ trunk/kernel/ksh/instrument.c	(revision 1)
@@ -0,0 +1,37 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <fat32.h>
+#include <fat32-private.h>
+#include <kminiShell.h>
+
+
+error_t show_instrumentation(void *param)
+{
+ #if CONFIG_VFAT_INSTRUMENT && CONFIG_BC_INSTRUMENT
+  ksh_print("Total reads: %d\nTotal writes: %d\nDevBlok read %d\n\nHit: %d\nMiss %d\nDelayed Write %d\n",
+	   rd_count, wr_count, blk_rd_count,hit_count, miss_count, dw_count);
+#else
+  ksh_print("Total reads: N/A\nTotal writes: N/A\nDevBlok read N/A\n\nHit: N/A\nMiss N/A\nDelayed Write N/A\n");
+#endif
+
+  return 0;
+}
Index: trunk/kernel/ksh/kill.c
===================================================================
--- trunk/kernel/ksh/kill.c	(revision 1)
+++ trunk/kernel/ksh/kill.c	(revision 1)
@@ -0,0 +1,62 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <kminiShell.h>
+#include <list.h>
+#include <thread.h>
+#include <task.h>
+#include <signal.h>
+
+error_t kill_func(void *param)
+{
+  ms_args_t *args;
+  uint32_t argc;
+  uint_t sig;
+  pid_t pid;
+  cid_t location;
+  error_t err;
+
+  args  = (ms_args_t *) param;
+  argc = args->argc;
+  err = 0;
+
+  if(argc != 3)
+  {
+    ksh_print("Missing signal number or process pid\n");
+    return EINVAL;
+  }
+
+  sig = atoi(args->argv[1]);
+  pid = atoi(args->argv[2]);
+
+  if((sig == 0)  || (sig >= SIG_NR))
+  {
+    ksh_print("Unknown signal number: %d\n", sig);
+    return EINVAL;
+  }
+
+  location = task_whereis(pid);
+
+  if((err = signal_rise(pid, location, sig)))
+    ksh_print("Failed to rise signal %d on task %d\n", sig, pid);
+
+  return err;
+}
Index: trunk/kernel/ksh/kminiShell.h
===================================================================
--- trunk/kernel/ksh/kminiShell.h	(revision 1)
+++ trunk/kernel/ksh/kminiShell.h	(revision 1)
@@ -0,0 +1,75 @@
+/*
+    This file is part of MutekP.
+
+    MutekP is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    MutekP is distributed in the hope that it will be useful, but
+    WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with MutekP; if not, write to the Free Software Foundation,
+    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+    UPMC / LIP6 / SOC (c) 2008
+    Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#ifndef __MINI_SHELL_H__
+#define __MINI_SHELL_H__
+
+#include <vfs.h>
+#include <kdmsg.h>
+
+#define MS_MAX_ARG_LEN    20
+#define MS_MAX_LINE_LEN   64
+#define BUFFER_SIZE       4096
+#define MSG_STR_LEN       512
+
+extern uint8_t buffer[];
+extern kdmsg_channel_t ksh_tty;
+
+typedef struct ms_argument_s
+{
+  uint_t argc;
+  char argv[MS_MAX_ARG_LEN][MS_MAX_LINE_LEN];
+}ms_args_t;
+
+extern struct vfs_file_s *root ;
+extern struct vfs_file_s *ms_n_cwd ;
+extern char ms_pwd[128] ;
+
+void print_error_msg(error_t err)  ;
+void ksh_print(const char *fmt, ...);
+void ksh_write(void *buff, size_t size);
+char getChar() ;
+void putChar(char ch) ;
+void cmdLineAnalyser(ms_args_t *args);
+
+typedef error_t (ksh_cmd_t)(void*);
+
+/* Commands */
+error_t clear_func(void* param);
+error_t rm_func(void *parm) ;
+error_t cd_func(void *parm) ;
+error_t ls_func(void *param) ;
+error_t mkdir_func(void *param) ;
+error_t cp_func(void *arg) ;
+error_t mkfifo_func(void *param) ;
+error_t cat_func(void *param) ;
+error_t cat2_func(void *param) ;
+error_t eomtkp_func(void *param) ;
+error_t ps_func(void *param);
+error_t show_instrumentation(void* param) ;
+error_t exec_func(void *param);
+error_t pwd_func(void *param);
+error_t ksh_set_tty_func(void *param);
+error_t ppm_func(void *param);
+error_t ksh_cpu_state_func(void *param);
+error_t kill_func(void *param);
+
+#endif
Index: trunk/kernel/ksh/ksh_cpu_state.c
===================================================================
--- trunk/kernel/ksh/ksh_cpu_state.c	(revision 1)
+++ trunk/kernel/ksh/ksh_cpu_state.c	(revision 1)
@@ -0,0 +1,69 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <config.h>
+#include <kminiShell.h>
+#include <list.h>
+#include <thread.h>
+#include <task.h>
+#include <cluster.h>
+#include <cpu.h>
+#include <spinlock.h>
+#include <system.h>
+#include <wait_queue.h>
+
+//FIXME do it for all cluster
+error_t ksh_cpu_state_func(void *param)
+{
+	register uint_t cld, cpu;
+	uint_t cpu_nr;
+	ms_args_t args;
+
+#if 0
+	uint_t clstr_nr;
+	clstr_nr = arch_onln_cluster_nr();
+ 
+	for(cld=0; cld < clstr_nr; cld ++)
+	{
+		ksh_print("/SYS/CLUSTER%d\n", cld);
+		cpu_nr = clusters_tbl[cld].cluster->cpu_nr;
+
+		for(cpu=0; cpu < cpu_nr; cpu++)
+		{
+			args.argc = 2;
+			sprintk(args.argv[1], "/SYS/CLUSTER%d/CPU%d", cld,cpu);
+			cat_func(&args);
+		}
+	}
+#endif
+	cld = current_cid;
+	cpu_nr = current_cluster->cpu_nr;
+	ksh_print("/SYS/CLUSTER%d\n", current_cid);
+
+	for(cpu=0; cpu < cpu_nr; cpu++)
+	{
+		args.argc = 2;
+		sprintk(args.argv[1], "/SYS/CLUSTER%d/CPU%d", cld, cpu);
+		cat_func(&args);
+	}
+
+	return 0;
+}
Index: trunk/kernel/ksh/ksh_set_tty.c
===================================================================
--- trunk/kernel/ksh/ksh_set_tty.c	(revision 1)
+++ trunk/kernel/ksh/ksh_set_tty.c	(revision 1)
@@ -0,0 +1,50 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <kminiShell.h>
+#include <system.h>
+#include <device.h>
+
+error_t ksh_set_tty_func(void *param)
+{
+  ms_args_t *args ;
+  sint_t id = -1;
+
+  args  = (ms_args_t *) param;
+
+  if(args->argc == 2)
+    id = atoi(args->argv[1]);
+  
+  if(id == -1)
+  {
+    ksh_print("%s: Unknown TTY id\n", __FUNCTION__);
+    return EINVAL;
+  }
+
+  if((id >= TTY_DEV_NR) || (ttys_tbl[id] == NULL))
+  {
+    ksh_print("%s: Invalid TTY id: %d\n", __FUNCTION__, id);
+    return EINVAL;
+  }
+
+  ksh_tty.id = id;
+  return 0;
+}
Index: trunk/kernel/ksh/ls.c
===================================================================
--- trunk/kernel/ksh/ls.c	(revision 1)
+++ trunk/kernel/ksh/ls.c	(revision 1)
@@ -0,0 +1,143 @@
+/*
+	 This file is part of MutekP.
+	
+	 MutekP is free software; you can redistribute it and/or modify it
+	 under the terms of the GNU General Public License as published by
+	 the Free Software Foundation; either version 2 of the License, or
+	 (at your option) any later version.
+	
+	 MutekP is distributed in the hope that it will be useful, but
+	 WITHOUT ANY WARRANTY; without even the implied warranty of
+	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	 General Public License for more details.
+	
+	 You should have received a copy of the GNU General Public License
+	 along with MutekP; if not, write to the Free Software Foundation,
+	 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+	
+	 UPMC / LIP6 / SOC (c) 2008
+	 Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <stdint.h>
+#include <vfs.h>
+#include <kminiShell.h>
+#include <errno.h>
+
+static struct vfs_dirent_s dirent ;
+
+ void show3(void);
+ void show1(void);
+ void show2(void);
+
+error_t ls_func(void *param)
+{
+	char *path_name;
+	error_t err;
+	uint32_t argc;
+	uint32_t i;
+	uint_t count;
+	struct vfs_file_s dir;
+	struct ku_obj kuo;
+	ms_args_t *args;
+	//  char ch;
+
+	args  = (ms_args_t *) param;
+	err  = 0;
+
+	if(args->argc == 1)
+	{
+		argc = 2;
+		args->argv[1][0] = '.';
+		args->argv[1][1] = 0;
+	}
+	else
+		argc = args->argc;
+
+	for(i=1; i < argc; i++)
+	{
+		if(argc == 1)
+			path_name = ".";
+		else
+			path_name = args->argv[i];
+	 
+#if 0 
+		ksh_print("calling vfs for path_name |%s|\n", path_name);
+#endif
+
+		KK_BUFF(kuo, path_name);
+		if((err=vfs_opendir(ms_n_cwd, &kuo,0,&dir)))
+			return err;
+		
+		ksh_print("Name\t\tType\t\tSize\n", path_name);
+		ksh_print("----\t\t----\t\t----\n", path_name);
+		count = 0;
+		
+		KK_OBJ(kuo, &dirent);
+		while(!(err=vfs_readdir(&dir,&kuo)))
+		{
+			count++;
+			show3();
+
+#if 0      
+			ch=getChar();
+			
+			if(ch == '\n')
+			{
+	ch=getChar();
+	continue;
+			} 
+			if(ch == 'q') goto LS_END;
+#endif
+		}
+		ksh_print("\n%d found\n",count);
+		//  LS_END:
+		vfs_closedir(&dir, &count);
+		if(err != EEODIR) return err;
+	}
+	return 0;
+}
+
+ void show3(void)
+{
+	ksh_print("%s\t\t", dirent.d_name);
+
+	switch(dirent.d_attr)
+	{
+	case VFS_DIR:
+		ksh_print("<DIR>");
+		break;
+	case VFS_FIFO:
+		ksh_print("<FIFO>");
+		break;
+	case VFS_DEV_BLK:
+		ksh_print("<DEV-BLK>");
+		break;
+	case VFS_DEV_CHR:
+		ksh_print("<DEV-CHR>");
+		break;
+	default:
+		ksh_print("<RegFile>");
+	}
+	ksh_print("\n");
+}
+
+ void show1(void)
+{
+	ksh_print("=============================\n");
+	ksh_print("Entry name %s\t", dirent.d_name);
+	ksh_print("\tType: %s\n", (VFS_IS(dirent.d_attr, VFS_DIR)) ? "<DIR>" : 
+	   (VFS_IS(dirent.d_attr, VFS_FIFO)) ? "FIFO file" : "Reg file");
+	ksh_print("=============================\n");
+}
+
+ void show2(void)
+{
+	ksh_print("=============================\n");
+	ksh_print("Entry name %s\t\t\t\t",
+	    dirent.d_name);
+
+	ksh_print("\t\tType: %s\n", (VFS_IS(dirent.d_attr, VFS_DIR)) ? "<DIR>" : 
+	   (VFS_IS(dirent.d_attr, VFS_FIFO)) ? "FIFO file" : "Reg file");
+	ksh_print("=============================\n");
+}
Index: trunk/kernel/ksh/miniShell.c
===================================================================
--- trunk/kernel/ksh/miniShell.c	(revision 1)
+++ trunk/kernel/ksh/miniShell.c	(revision 1)
@@ -0,0 +1,215 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <system.h>
+#include <stdint.h>
+#include <string.h>
+#include <vfs.h>
+#include <thread.h>
+#include <kminiShell.h>
+#include <task.h>
+
+#define NR_THREADS  1
+
+uint8_t buffer[BUFFER_SIZE];
+
+struct vfs_file_s *root ;
+struct vfs_file_s *ms_n_cwd ;
+
+ms_args_t args;
+
+void print_args(ms_args_t *args)
+{
+  int i;
+
+  for(i=0; i < MS_MAX_ARG_LEN; i++)
+  {
+    ksh_print("idx %d:",i);
+    if(args->argv[i] != NULL)
+      ksh_print("|%s|\n", args->argv[i]);
+    else
+      ksh_print("NULL\n");
+  }
+
+  ksh_print("argc %d\n", args->argc);
+}
+
+
+typedef struct ksh_builtin_s
+{
+  char *name;
+  char *info;
+  ksh_cmd_t *cmd;
+}ksh_builtin_t;
+
+static error_t help_func(void *param);
+
+
+static ksh_builtin_t builtin_cmds[] = 
+  {
+    {"setty", "Set I/O Terminal Number", ksh_set_tty_func},
+    {"cd", "Change Directory", cd_func},
+    {"ls", "List Files In Directory", ls_func},
+    {"cp", "Copy File", cp_func},
+    {"cat", "Show File Contentes", cat_func},
+    {"ps", "Show Process (Tasks) State", ps_func},
+    {"exec", "Execute New Process", exec_func},
+    {"ppm", "Print Phyiscal Pages Manager", ppm_func},
+    {"cs", "CPUs Stats", ksh_cpu_state_func},
+    {"stat", "Show File System Instrumentation", show_instrumentation},
+    {"pwd", "Print Work Directory", pwd_func},
+    {"rm", "Remove File", rm_func},
+    {"kill", "Send the specified signal to the specified process", kill_func},
+    {"eomtkp", "Display SGI Image On Frame-Buffer", eomtkp_func},
+    {"clear", "Clear Some Lines", clear_func},
+    {"mkdir", "Make New Directory", mkdir_func},
+    {"mkfifo", "Make New Named FIFO File", mkfifo_func},
+    {"help", "Show Available commands", help_func},
+    {NULL,NULL,NULL}
+  };
+
+static error_t help_func(void *param)
+{
+  uint_t i;
+
+  ksh_print("Available Commands:\n");
+
+  for(i=0; builtin_cmds[i].name != NULL; i++)
+    ksh_print("%s: %s\n", builtin_cmds[i].name, builtin_cmds[i].info);
+
+  ksh_print("exit: Exit and synchronise panding disk wirtes if any\n");
+  return 0;
+}
+
+
+static error_t ksh_exec_cmd(char *cmd, ms_args_t *args)
+{
+  uint_t i;
+  error_t err;
+
+  for(i=0; builtin_cmds[i].name != NULL; i++)
+  {
+    if(!strcmp(cmd, builtin_cmds[i].name))
+    {
+      if((err=builtin_cmds[i].cmd(args)))
+	print_error_msg(err);
+      return 0;
+    }
+  }
+  return -1;
+}
+
+
+void* kMiniShelld(void *arg)
+{
+  ssize_t err;
+  struct task_s *task = current_task;
+  register char *cmd;
+
+  memset(&args,0,sizeof(args));
+  root = &task->vfs_root;
+  ms_n_cwd = &task->vfs_cwd;  
+
+#if 0
+  ksh_print("[%s]>",ms_n_cwd->n_name);
+  args.argc = 7;
+  strcpy(args.argv[0],"exec");
+  strcpy(args.argv[1],"/BIN/SHOWIMG.X");
+  strcpy(args.argv[2],"-p4");
+  strcpy(args.argv[3],"-i");
+  strcpy(args.argv[4],"/TMP/LENA.SGI");
+  strcpy(args.argv[5],"-o");
+  strcpy(args.argv[6],"/DEV/FB0");
+  
+  ksh_exec_cmd("exec", &args);
+#endif
+
+#if 0
+  ksh_print("[%s]>",ms_n_cwd->n_name);
+  args.argc = 7;
+  strcpy(args.argv[0],"exec");
+  strcpy(args.argv[1],"/BIN/HELLO.X");
+  strcpy(args.argv[2],"-p4");
+  strcpy(args.argv[3],"-i");
+  strcpy(args.argv[4],"/TMP/LENA.SGI");
+  strcpy(args.argv[5],"-o");
+  strcpy(args.argv[6],"/DEV/FB0");
+  
+  ksh_exec_cmd("exec", &args);
+
+  ksh_print("[%s]>",ms_n_cwd->n_name);
+  args.argc = 7;
+  strcpy(args.argv[0],"exec");
+  strcpy(args.argv[1],"/BIN/SHOWIMG.X");
+  strcpy(args.argv[2],"-p16");
+  strcpy(args.argv[3],"-i");
+  strcpy(args.argv[4],"/TMP/IMG.RGB");
+  strcpy(args.argv[5],"-o");
+  strcpy(args.argv[6],"/DEV/FB0");
+  
+  ksh_exec_cmd("exec", &args);
+
+#endif
+
+#if 0
+  task->vfs_cwd = ms_n_cwd;
+  ksh_print("[%s]>",ms_n_cwd->n_name);
+  args.argc = 2;
+  strcpy(args.argv[0],"cd");
+  strcpy(args.argv[1],"/tmp");
+  ksh_exec_cmd("cd", &args);
+
+  task->vfs_cwd = ms_n_cwd;
+  ksh_print("[%s]>",ms_n_cwd->n_name);
+  args.argc = 3;
+  strcpy(args.argv[0],"cp");
+  strcpy(args.argv[1],"r.txt");
+  strcpy(args.argv[2],"f.txt");
+  ksh_exec_cmd("cp", &args);
+#endif
+
+
+  while(1)
+  {
+    task->vfs_cwd = *ms_n_cwd;
+    //ksh_print("[%s]>",ms_n_cwd->n_name);FIXME
+    ksh_print("[%s]>", __FUNCTION__);
+    cmdLineAnalyser(&args);
+    cmd = args.argv[0];
+
+#if 0
+    print_args(&args);
+#endif
+
+    if((err=ksh_exec_cmd(cmd, &args)))
+    {
+      if(!strcmp(cmd, "exit"))
+	break;
+      else
+	ksh_print("Unknown command %s\n", cmd);
+    }
+  }
+
+  //bc_dump(&bc);
+  //bc_sync(&bc);
+  ksh_print("Finished\n");
+  return NULL;
+}
Index: trunk/kernel/ksh/miniShellIo.c
===================================================================
--- trunk/kernel/ksh/miniShellIo.c	(revision 1)
+++ trunk/kernel/ksh/miniShellIo.c	(revision 1)
@@ -0,0 +1,171 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <ctype.h>
+#include <libk.h>
+#include <string.h>
+#include <thread.h>
+#include <cluster.h>
+#include <sys-vfs.h>
+#include <driver.h>
+#include <device.h>
+#include <kminiShell.h>
+#include <stdarg.h>
+
+kdmsg_channel_t ksh_tty = {{.id = 0}};
+ 
+char getChar()
+{
+  struct device_s *tty;
+  dev_request_t rq;
+  char ch;
+  size_t size;
+  
+  ch = 0;
+  size = 0;
+  tty = ttys_tbl[ksh_tty.id];
+
+  while(size != 1 && size != -1)
+  {
+    rq.dst = (uint32_t*) &ch;
+    rq.count = 1;
+    rq.flags = 0;
+    size = tty->op.dev.read(tty, &rq);
+  }
+  return ch;
+}
+
+
+ssize_t ksh_getLine(char *buff, int count)
+{
+  struct device_s *tty;
+  dev_request_t rq;
+  ssize_t size;
+ 
+  tty = ttys_tbl[ksh_tty.id];
+
+  rq.dst = (uint32_t*) buff;
+  rq.count = count;
+  rq.flags = 0;
+  size = tty->op.dev.read(tty, &rq);
+  return size;
+}
+
+void ksh_write(void *buff, size_t size)
+{
+  struct device_s *tty;
+  dev_request_t rq;
+  
+  tty = ttys_tbl[ksh_tty.id];
+  rq.src = buff;
+  rq.count = size;
+  rq.flags = 0;
+  (void)tty->op.dev.write(tty, &rq);
+}
+
+static char ksh_msg_buff[MSG_STR_LEN];
+
+void ksh_print(const char *fmt, ...)
+{
+  va_list ap;
+  int count;
+
+  va_start (ap, fmt);
+  count = iprintk(&ksh_msg_buff[0], current_cid, 1, (char *) fmt, ap);
+  assert(count < (MSG_STR_LEN-1));
+  va_end (ap);
+  count = (count < (MSG_STR_LEN -1)) ? count : MSG_STR_LEN - 1;
+  ksh_msg_buff[count + 1] = 0;
+  ksh_write(ksh_msg_buff, count);
+}
+
+void getString(char *buff,size_t size)
+{
+  char ch = 0;
+  char *str = buff;
+  char *val = NULL;
+  char line[128];
+  char *line_ptr = &line[0];
+  ssize_t count,i;
+  
+
+  while(size > 0)
+  {
+    count = ksh_getLine(line_ptr,128);
+    i=0;
+
+    while((count > 0) && (size > 0))
+    {
+      ch=line[i++];
+      
+      if(ch == '\r')
+	continue;
+
+      if(ch == '\n')
+	goto GETSTRING_END;
+
+      if(!isprint(ch))
+      {
+	if((ch == 0x7F) || (ch == 0x08))
+	  str--;
+	count ++;
+	size ++;
+	continue;
+      }
+
+      *str ++ = ch;
+      ch = 0;
+      count --;
+      size --;
+    }
+  }
+  
+ GETSTRING_END:
+  val = buff;
+  *str = 0;
+}
+
+void cmdLineAnalyser(ms_args_t *args)
+{
+  char buff[128];
+  char *str = &buff[0];
+  char *arg = NULL;
+  uint_t i;
+
+  getString(buff,128);
+  i=0;
+
+  while((*str != '\0') && (i < MS_MAX_ARG_LEN))
+  {
+    while((*str) && (isspace(*str))) str++;
+    
+    if(!(*str)) break;
+   
+    arg = args->argv[i];
+ 
+    while((*str) && (!isspace(*str))) 
+      *arg++ = *str ++;
+
+    i++; *arg = 0;
+  }
+  args->argv[i][0] = 0;
+  args->argc = i;
+}
Index: trunk/kernel/ksh/mkdir_func.c
===================================================================
--- trunk/kernel/ksh/mkdir_func.c	(revision 1)
+++ trunk/kernel/ksh/mkdir_func.c	(revision 1)
@@ -0,0 +1,46 @@
+/*
+	 This file is part of MutekP.
+	
+	 MutekP is free software; you can redistribute it and/or modify it
+	 under the terms of the GNU General Public License as published by
+	 the Free Software Foundation; either version 2 of the License, or
+	 (at your option) any later version.
+	
+	 MutekP is distributed in the hope that it will be useful, but
+	 WITHOUT ANY WARRANTY; without even the implied warranty of
+	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	 General Public License for more details.
+	
+	 You should have received a copy of the GNU General Public License
+	 along with MutekP; if not, write to the Free Software Foundation,
+	 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+	
+	 UPMC / LIP6 / SOC (c) 2008
+	 Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <stdint.h>
+#include <vfs.h>
+#include <kminiShell.h>
+ 
+error_t mkdir_func(void *param)
+{
+	ms_args_t *args;
+	struct ku_obj kuo;
+	error_t err;
+	uint32_t argc;
+	uint32_t i;
+	
+	args = (ms_args_t *) param;
+	argc = args->argc;
+	err = 0;
+	
+	for(i=1; i< argc; i++)
+	{
+		KK_BUFF(kuo, args->argv[i]); 
+		if((err=vfs_mkdir(ms_n_cwd, &kuo,0)))
+			return err;
+	}
+	return 0;
+}
+
Index: trunk/kernel/ksh/mkfifo_func.c
===================================================================
--- trunk/kernel/ksh/mkfifo_func.c	(revision 1)
+++ trunk/kernel/ksh/mkfifo_func.c	(revision 1)
@@ -0,0 +1,52 @@
+/*
+	 This file is part of MutekP.
+	
+	 MutekP is free software; you can redistribute it and/or modify it
+	 under the terms of the GNU General Public License as published by
+	 the Free Software Foundation; either version 2 of the License, or
+	 (at your option) any later version.
+	
+	 MutekP is distributed in the hope that it will be useful, but
+	 WITHOUT ANY WARRANTY; without even the implied warranty of
+	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	 General Public License for more details.
+	
+	 You should have received a copy of the GNU General Public License
+	 along with MutekP; if not, write to the Free Software Foundation,
+	 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+	
+	 UPMC / LIP6 / SOC (c) 2008
+	 Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <stdint.h>
+#include <vfs.h>
+#include <kminiShell.h>
+ 
+error_t mkfifo_func(void *param)
+{
+
+	return ENOSYS;
+#if 0
+	ms_args_t *arg;
+	struct ku_obj kuo;
+	error_t err;
+	uint32_t argc;
+	uint32_t i;
+
+	arg  = (struct ms_argument_s *) param;
+	argc = arg->argc;
+	argv = &arg->argv[0];
+	err  = 0;
+	
+	for(i=0; i< argc; i++)
+	{
+		KK_BUFF(kuo, argv[i]); 
+	 
+		if((err=vfs_mkfifo(ms_n_cwd, &kuo, 0)))
+			return err;
+	}
+#endif
+
+	return 0;
+}
Index: trunk/kernel/ksh/ppm_func.c
===================================================================
--- trunk/kernel/ksh/ppm_func.c	(revision 1)
+++ trunk/kernel/ksh/ppm_func.c	(revision 1)
@@ -0,0 +1,66 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <kminiShell.h>
+#include <system.h>
+#include <ppm.h>
+#include <kdmsg.h>
+#include <page.h>
+#include <thread.h>
+#include <cluster.h>
+
+error_t ppm_func(void *param)
+{
+#if 0
+	uint_t i,j;
+	register struct page_s *pages_tbl;
+	struct ppm_s *ppm;
+	uint_t cluster_nr;
+
+	cluster_nr = arch_onln_cluster_nr();
+#endif
+
+	//for(i=0; i < cluster_nr; i++)
+		ppm_print(&current_cluster->ppm);
+
+//FIXME
+#if 0
+	for(j=0; j < cluster_nr; j++)
+	{
+		ppm = &clusters_tbl[j].cluster->ppm;
+		pages_tbl = ppm->pages_tbl;
+	
+		for(i=0; i < ppm->pages_nr; i++)
+		{
+			if(pages_tbl[i].flags != 0x5)
+	printk(WARNING,"WARNING: unexpected flags %x for page %x [i=%d]\n",
+	       pages_tbl[i].flags,ppm_page2addr(&pages_tbl[i]),i);
+		}
+	
+		for(i=0; i < KMEM_TYPES_NR; i++)
+		{
+			if(clusters_tbl[j].cluster->keys_tbl[i] != NULL)
+	kcm_print(clusters_tbl[j].cluster->keys_tbl[i]);
+		}
+	}
+#endif
+	return 0;
+}
Index: trunk/kernel/ksh/ps.c
===================================================================
--- trunk/kernel/ksh/ps.c	(revision 1)
+++ trunk/kernel/ksh/ps.c	(revision 1)
@@ -0,0 +1,133 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+   Copyright (c) 2009,2010,2011,2012,2013,2014,2015 UPMC Sorbonne Universites
+*/
+
+#include <list.h>
+#include <thread.h>
+#include <pid.h>
+#include <task.h>
+#include <cpu.h>
+#include <vfs.h>
+#include <rwlock.h>
+#include <system.h>
+#include <wait_queue.h>
+
+#define ksh_print(x, ...) printk(INFO,x, __VA_ARGS__)
+
+void ps_print_task(struct task_s *task, uint_t *usr_nr, uint_t *sys_nr, uint_t *tasks_nr)
+{
+  struct thread_s *thread;
+  struct list_entry *iter;
+  struct list_entry *th_root;
+  char *cmd;
+  uint_t ppid;
+
+  if(task != NULL)
+  {
+    th_root = &task->th_root;
+    
+    ppid = PID_MIN_GLOBAL;
+    cmd = "N/A";
+
+    if(task->pid != PID_MIN_GLOBAL)
+      ppid = task->parent;
+    
+    if(task->state == TASK_CREATE)
+      cmd = "Under-Creation";
+    else
+      if(VFS_FILE_IS_NULL(task->bin))
+      {
+	//cmd = vfs_get_file_name(task->bin);
+	cmd = "ENOTSUP";
+      }
+
+    printk(INFO,"\n[PID] %d [PPID] %d [Children] %d [Command] %s\n",
+	   task->pid, 
+	   ppid,
+	   atomic_get(&task->childs_nr),
+	   cmd);
+
+    if(task->state == TASK_CREATE)
+      return;
+
+    spinlock_lock(&task->th_lock);
+
+    list_foreach_forward(th_root, iter)
+    {
+      thread = list_element(iter, struct thread_s, rope);
+      assert(thread->signature == THREAD_ID);
+
+      ksh_print("  |__ [TID] %x [ORD] %d [%s] [CPU] %d [TICKs] %d [Sched] %d [tm_sys] %u [tm_usr] %u [tm_sleep] %u %s [ %s ]\n",
+		thread,
+		thread->info.order,
+		thread_get_attr_name(thread->type), 
+		thread_current_cpu(thread)->gid, 
+		thread->ticks_nr,
+		thread->info.sched_nr,
+		thread->info.tm_sys,
+		thread->info.tm_usr,
+		thread->info.tm_sleep,
+		thread_get_state_name(thread->state), 
+		(thread->info.queue == NULL) ? "N/A" : thread->info.queue->name);
+
+      if(thread->type == PTHREAD)
+	*usr_nr = *usr_nr + 1;
+      else
+	*sys_nr = *sys_nr + 1;
+    }
+
+    if(!(list_empty(th_root)))
+      *tasks_nr = *tasks_nr + 1;
+
+    spinlock_unlock(&task->th_lock);
+  }
+}
+
+error_t ps_func(void *param)
+{
+  uint_t usr_nr;
+  uint_t sys_nr;
+  uint_t tasks_nr;
+  uint_t pid;
+  struct task_locator_s *task_locator;
+
+  usr_nr = 0;
+  sys_nr = 0;
+  tasks_nr = 0;
+
+  ksh_print("\nOn cluster %u:\n", current_cid);
+
+  tasks_manager_lock();
+  /* Don't print task0, it's irrelevant */
+  for(pid=PID_MIN_GLOBAL+1; pid <= PID_MAX_GLOBAL; pid ++)
+  {
+    task_locator = task_lookup(pid);
+    if ( task_locator->cid != CID_NULL )
+            ps_print_task(task_locator->task, &usr_nr, &sys_nr, &tasks_nr);
+  }
+  tasks_manager_unlock();
+
+  ksh_print("\nTotal Active        Tasks   : %d\n", tasks_nr);
+  ksh_print("Total Active User   Threads : %d\n", usr_nr);
+  ksh_print("-----------------\n", NULL);
+  
+  return 0;
+}
Index: trunk/kernel/ksh/pwd_func.c
===================================================================
--- trunk/kernel/ksh/pwd_func.c	(revision 1)
+++ trunk/kernel/ksh/pwd_func.c	(revision 1)
@@ -0,0 +1,40 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <stdint.h>
+#include <vfs.h>
+#include <libk.h>
+#include <kminiShell.h>
+ 
+error_t pwd_func(void *param)
+{
+	error_t err;
+	char buff[128];
+	struct ku_obj ku_buff;
+
+	KK_SZ_BUFF(ku_buff, buff, 128);
+	err = vfs_get_path(ms_n_cwd, &ku_buff);
+
+	ksh_print("%s\n", &buff[0]);
+
+	return err;
+}
+
Index: trunk/kernel/ksh/rm.c
===================================================================
--- trunk/kernel/ksh/rm.c	(revision 1)
+++ trunk/kernel/ksh/rm.c	(revision 1)
@@ -0,0 +1,47 @@
+/*
+	 This file is part of MutekP.
+	
+	 MutekP is free software; you can redistribute it and/or modify it
+	 under the terms of the GNU General Public License as published by
+	 the Free Software Foundation; either version 2 of the License, or
+	 (at your option) any later version.
+	
+	 MutekP is distributed in the hope that it will be useful, but
+	 WITHOUT ANY WARRANTY; without even the implied warranty of
+	 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+	 General Public License for more details.
+	
+	 You should have received a copy of the GNU General Public License
+	 along with MutekP; if not, write to the Free Software Foundation,
+	 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+	
+	 UPMC / LIP6 / SOC (c) 2008
+	 Copyright Ghassan Almaless <ghassan.almaless@gmail.com>
+*/
+
+#include <stdint.h>
+#include <vfs.h>
+#include <kminiShell.h>
+ 
+error_t rm_func(void *param)
+{
+	ms_args_t *args;
+	struct ku_obj kuo;
+	error_t err;
+	uint32_t argc;
+	uint32_t i;
+
+	args  = (ms_args_t *) param;
+	argc = args->argc;
+	err = 0;
+	
+	for(i=1; i< argc; i++)
+	{
+		KK_BUFF(kuo, args->argv[i]); 
+		if((err=vfs_unlink(ms_n_cwd, &kuo)))
+			return err;
+	}
+
+	return 0;
+}
+
Index: trunk/kernel/ksh/sgiImg.h
===================================================================
--- trunk/kernel/ksh/sgiImg.h	(revision 1)
+++ trunk/kernel/ksh/sgiImg.h	(revision 1)
@@ -0,0 +1,59 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2008
+   Copyright Ghassan Almaless <ghassan.almaless@lip6.fr>
+*/
+
+#ifndef _SGI_IMG_H_
+#define _SGI_IMG_H_
+
+#include <stdint.h>
+
+#define SGI_ALIGN4(val)				\
+  (((val) & 0x000000FF) << 24  |		\
+   ((val) & 0x0000FF00) << 8   |		\
+   ((val) & 0x00FF0000) >> 8   |		\
+   (val) >> 24)
+
+#define SGI_ALIGN2(val)				\
+  (((val) & 0x00FF)     << 8   |		\
+   (val) >> 8)
+
+#define SGI_TO_LE2(val)				\
+  (((val) & 0xFF00)     >> 8   |		\
+   (val) << 8)
+
+struct sgi_info_s
+{
+  uint16_t   magic;
+  uint8_t    storage;
+  uint8_t    bpc;
+  uint16_t   dimension;
+  uint16_t   x_size;
+  uint16_t   y_size;
+  uint16_t   z_size;
+  uint32_t   pix_min;
+  uint32_t   pix_max;
+  uint32_t   dummy1;
+  uint8_t    img_name[80];
+  uint32_t   color_map;
+  uint8_t    dummy2[404];
+} __attribute__ ((packed));
+
+
+#endif
Index: trunk/kernel/libk/barrier.c
===================================================================
--- trunk/kernel/libk/barrier.c	(revision 690)
+++ 	(revision )
@@ -1,57 +1,0 @@
-/*
- * barrier.c - Busy-waiting, local, kernel barrier implementaion 
- * 
- * Author   Alain Greiner (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <hal_atomic.h>
-#include <barrier.h>
-
-//////////////////////////////////////////////
-inline void barrier_wait( barrier_t * barrier,
-                          uint32_t    count ) 
-{
-    uint32_t  expected;
-
-    // get barrier sense value
-    uint32_t sense = barrier->sense;
-
-	// compute expected value
-    if ( sense == 0 ) expected = 1;
-    else              expected = 0;
-
-    // atomically increment current 
-    uint32_t current = hal_atomic_add( &barrier->current , 1 );
-
-    // last task reset current and toggle sense
-    if( current == (count-1) ) 
-    {
-        barrier->current = 0;  
-        barrier->sense   = expected;  
-    }
-    else   // other tasks poll sense 
-    {
-        while( barrier->sense != expected ) asm volatile ("nop");
-    }
-}
-
-
Index: trunk/kernel/libk/barrier.h
===================================================================
--- trunk/kernel/libk/barrier.h	(revision 690)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
- * barrier.h - Busy-waiting, local, kernel barrier definition
- * 
- * Author  Alain Greiner (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BARRIER_H_
-#define _BARRIER_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-
-/*****************************************************************************************
- * This structure defines a "rendez-vous" barrier, that can be used
- * to synchronise several kernel threads running in the same  cluster.
- * As it is used in the kernel_init phase, it implements a busy-waiting policy.
- * It does not need to be initialised, but it must be statically allocated 
- * in the KDATA segment to be properly initialised by the compiler/loader.
- ****************************************************************************************/
-
-typedef struct barrier_s
-{
-    uint32_t            current;            // number of arrived threads
-    volatile uint32_t   sense;              // barrier state (toggle)
-    uint32_t            padding[(CONFIG_CACHE_LINE_SIZE>>2)-2];
-} 
-barrier_t;
-
-/*****************************************************************************************
- * This blocking function implements a toggle barrier. It returns only when all
- * expected threads reach the barrier. It can be used several times without
- * specific initialisation. 
- *****************************************************************************************
- * @ barrier : pointer on barrier
- * @ count   : number of expected thread
- ****************************************************************************************/
-inline void barrier_wait( barrier_t * barrier,  
-                          uint32_t    count );
-
-
-#endif	/* _BARRIER_H_ */
Index: trunk/kernel/libk/bits.c
===================================================================
--- trunk/kernel/libk/bits.c	(revision 690)
+++ trunk/kernel/libk/bits.c	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * bits.c - bitmap API implementation
+ * bits.c - bits manipulation functions implementation
  *
  * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
- *         Alain Greiner    (2016,2017,2018,2019,2020)
+ *         Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -23,22 +23,6 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <bits.h>
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////     local access functions     ///////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////
-void bitmap_init( bitmap_t * bitmap,
-                  uint32_t   len )
-{
-    uint32_t word;
-    uint32_t nwords = BITMAP_SIZE( len );
-    for( word = 0 ; word < nwords ; word++ )
-    {
-        bitmap[word] = 0;
-    }
-}  // end bitmap_init()
 
 //////////////////////////////////////////
@@ -46,6 +30,6 @@
                         uint32_t   index )
 {
-	uint32_t  word = index >> 5;
-	uint32_t  bit  = index & 0x1F;
+	uint32_t  word = index / 32;
+	uint32_t  bit  = index % 32;
 
 	bitmap[word] |= ( 1 << bit );
@@ -56,6 +40,6 @@
                           uint32_t   index )
 {
-	uint32_t  word = index >> 5;
-	uint32_t  bit  = index & 0x1F;
+	uint32_t  word = index / 32;
+	uint32_t  bit  = index % 32;
 
 	bitmap[word] &= ~( 1 << bit );
@@ -66,44 +50,9 @@
                             uint32_t   index )
 {
-	uint32_t  word = index >> 5;
-	uint32_t  bit  = index & 0x1F;
-
-	return (bitmap[word] & ( 1 << bit )) != 0;
-}
-
-/////////////////////////////////////////
-uint32_t bitmap_alloc( bitmap_t * bitmap,
-                       uint32_t   size )
-{
-    uint32_t max_word;
-    uint32_t max_bit; 
-	uint32_t word;
-	uint32_t bit;
- 
-    if( size )
-    {
-        max_word = ( (size-1) >>5 ) + 1;
-
-        for( word = 0 ; word < max_word ; word++ )
-	    {
-            max_bit = (word == (max_word - 1)) ? (size & 0x1F) : 32;
-
-		    if(bitmap[word] != 0XFFFFFFFF)
-		    {
-			    for(bit = 0 ; bit < max_bit ; bit++)
-			    {
-				    if( (bitmap[word] & (1 << bit)) == 0 )
-                    {
-                        bitmap[word] |= (1 << bit);
-                        return (word*32 + bit);
-                    }
-			    }
-            }
-		}
-	}
-
-	return -1;
-
-}  // end bitmap_alloc()
+	uint32_t  word = index / 32;
+	uint32_t  bit  = index % 32;
+
+	return (bitmap[word] & ( 1 << bit )) && 1;
+}
 
 //////////////////////////////////////////
@@ -120,7 +69,5 @@
 		if((len + bit) >= 32)
 		{
-            if( bit == 0 ) val = 0xFFFFFFFF;
-            else           val = (uint32_t)((1 << (32 - bit)) - 1);
-
+			val = (bit == 0) ? 0xFFFFFFFF : (1 << (32 - bit)) - 1;
 			bitmap[word] |= (val << bit);
 			word++;
@@ -134,5 +81,5 @@
 		}
 	}
-}  // bitmap_set_range()
+}
 
 ///////////////////////////////////////////
@@ -149,7 +96,5 @@
 		if((len + bit) >= 32)
 		{
-            if( bit == 0 ) val = 0xFFFFFFFF;
-            else           val = (uint32_t)((1 << (32 - bit)) - 1);
-
+			val = (bit == 0) ? 0xFFFFFFFF : (1 << (32 - bit)) - 1;
 			bitmap[word] &= ~(val << bit);
 			word++;
@@ -163,5 +108,5 @@
 		}
 	}
-}  // bitmap_clear_range()
+}
 
 ///////////////////////////////////////
@@ -170,36 +115,28 @@
                       uint32_t   size )
 {
-    uint32_t max_word;
 	uint32_t word = index / 32;  
 	uint32_t bit  = index % 32; 
  
-    if( index < size )
-    {
-	    if( bit != 0 )
-	    {
-		    for( ; bit < 32; bit++)
-		    {
-			    if((bitmap[word] & (1 << bit)) ) return (word*32 + bit);
-	  	    }
-		    word++;
-	    }
-
-        max_word = ( (size-1) >>5 ) + 1;
-
-        for( ; word < max_word ; word++ )
-	    {
-		    if(bitmap[word] != 0)
-		    {
-			    for(bit = 0 ; bit < 32 ; bit++)
-			    {
-				    if( bitmap[word] & (1 << bit) ) return (word*32 + bit);
-			    }
-            }
-		}
-	}
-
-	return -1;
-
-}  // bitmap_ffs2()
+	if(bit != 0)
+	{
+		for(; bit < 32; bit++)
+		{
+			if(bitmap[word] & (1 << bit)) return (word*32 + bit);
+		}
+		word++;
+	}
+
+	for(; word < size/32; word++)
+	{
+		if(bitmap[word] != 0)
+		{
+			for(bit = 0; bit < 32; bit++)
+			{
+				if(bitmap[word] & (1 << bit)) return (word*32 + bit);
+			}
+		}
+	}
+	return 0xFFFFFFFF;
+}
 
 ///////////////////////////////////////
@@ -208,36 +145,28 @@
                       uint32_t   size )
 {
-    uint32_t max_word;
 	uint32_t word = index / 32;
 	uint32_t bit  = index % 32;
-    
-    if( index < size )
-    {
-	    if( bit != 0 )
-	    {
-		    for( ; bit < 32; bit++)
-		    {
-			    if( (bitmap[word] & (1 << bit)) == 0) return (word*32 + bit);
-	  	    }
-		    word++;
-	    }
-
-        max_word = ( (size-1) >>5 ) + 1;
-
-        for( ; word < max_word ; word++ )
-	    {
-		    if(bitmap[word] != 0xFFFFFFFF)
-		    {
-			    for(bit = 0 ; bit < 32 ; bit++)
-			    {
-				    if( (bitmap[word] & (1 << bit)) == 0 ) return (word*32 + bit);
-			    }
-            }
-		}
-	}
-
-	return -1;
-
-}  // bitmap_ffc2()
+ 
+	if(bit != 0)
+	{
+		for(; bit < 32; bit++)
+		{
+			if((bitmap[word] & (1 << bit)) == 0) return (word*32 + bit);
+		}
+		word++;
+	}
+
+	for(; word < size/32; word++)
+	{
+		if(bitmap[word] != 0xFFFFFFFF)
+		{
+			for(bit = 0; bit < 32; bit++)
+			{
+				if((bitmap[word] & (1 << bit)) == 0) return (word*32 + bit);
+			}
+		}
+	}
+	return 0xFFFFFFFF;
+}
 
 //////////////////////////////////////
@@ -245,30 +174,19 @@
                      uint32_t   size )
 {
-    uint32_t max_word;
-    uint32_t max_bit;
 	uint32_t word;
 	uint32_t bit;
-
-    if( size )
-    {
-        max_word = ( (size-1) >>5 ) + 1;
-
-        for( word = 0 ; word < max_word ; word++ )
-	    {
-            max_bit = (word == (max_word - 1)) ? (size & 0x1F) : 32;
-
-		    if(bitmap[word] != 0)
-		    {
-			    for(bit = 0 ; bit < max_bit ; bit++)
-			    {
-				    if( bitmap[word] & (1 << bit) ) return (word*32 + bit);
-			    }
-            }
-		}
-	}
-
-	return -1;
-
-}  // bitmap_ffs()
+ 
+	for(word = 0 ; word < size/32 ; word++)
+	{
+		if(bitmap[word] != 0)
+		{
+			for(bit = 0 ; bit < 32 ; bit++)
+			{
+				if( bitmap[word] & (1 << bit) ) return (word*32 + bit);
+			}
+		}
+	}
+	return 0xFFFFFFFF;
+}
 
 //////////////////////////////////////
@@ -276,158 +194,18 @@
                      uint32_t   size )
 {
-    uint32_t max_word;
-    uint32_t max_bit;
 	uint32_t word;
 	uint32_t bit;
  
-    if( size )
-    {
-        max_word = ( (size-1) >>5 ) + 1;
-
-        for( word = 0 ; word < max_word ; word++ )
-	    {
-            max_bit = (word == (max_word - 1)) ? (size & 0x1F) : 32;
-
-		    if(bitmap[word] != 0XFFFFFFFF)
-		    {
-			    for(bit = 0 ; bit < max_bit ; bit++)
-			    {
-				    if( (bitmap[word] & (1 << bit)) == 0 ) return (word*32 + bit);
-			    }
-            }
-		}
-	}
-
-	return -1;
-
-}  // bitmap_ffc()
-
-
-//////////////////////////////////////////////////////////////////////////////
-//////////////     remote access functions     ///////////////////////////////
-//////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////
-void bitmap_remote_init( xptr_t   bitmap_xp,
-                         uint32_t len )
-{
-    bitmap_t * bitmap_ptr = GET_PTR( bitmap_xp );
-    cxy_t      bitmap_cxy = GET_CXY( bitmap_xp );
-
-    uint32_t word;
-    uint32_t nwords = BITMAP_SIZE( len );
-
-    for( word = 0 ; word < nwords ; word++ )
-    {
-        hal_remote_s32( XPTR( bitmap_cxy , &bitmap_ptr[word] ) , 0 );
-    }
-}
-
-////////////////////////////////////////////////////
-inline void bitmap_remote_set( xptr_t     bitmap_xp,
-                               uint32_t   index )
-{
-    bitmap_t * bitmap_ptr = GET_PTR( bitmap_xp );
-    cxy_t      bitmap_cxy = GET_CXY( bitmap_xp );
-
-	uint32_t  word = index / 32;
-	uint32_t  bit  = index % 32;
-
-    hal_remote_atomic_or( XPTR( bitmap_cxy , &bitmap_ptr[word] ) , (1 <<bit) );
-}
-
-//////////////////////////////////////////////////////
-inline void bitmap_remote_clear( xptr_t     bitmap_xp, 
-                                 uint32_t   index )
-{
-    bitmap_t * bitmap_ptr = GET_PTR( bitmap_xp );
-    cxy_t      bitmap_cxy = GET_CXY( bitmap_xp );
-
-	uint32_t  word = index / 32;
-	uint32_t  bit  = index % 32;
-
-    hal_remote_atomic_and( XPTR( bitmap_cxy , &bitmap_ptr[word] ) , ~(1 <<bit) );
-}
-
-///////////////////////////////////////////////////
-uint32_t bitmap_remote_alloc( xptr_t     bitmap_xp,
-                              uint32_t   size )
-{
-    uint32_t max_word;
-    uint32_t max_bit; 
-	uint32_t word;
-	uint32_t bit;
-    xptr_t   word_xp;
-    uint32_t value;
- 
-    bitmap_t * bitmap_ptr = GET_PTR( bitmap_xp );
-    cxy_t      bitmap_cxy = GET_CXY( bitmap_xp );
-
-    if( size )
-    {
-        max_word = ( (size-1) >>5 ) + 1;
-
-        for( word = 0 ; word < max_word ; word++ )
-	    {
-            max_bit = (word == (max_word - 1)) ? (size & 0x1F) : 32;
-
-            word_xp = XPTR( bitmap_cxy , &bitmap_ptr[word] );
-
-            value   = hal_remote_l32( word_xp );
-
-		    if( value != 0XFFFFFFFF )
-		    {
-			    for(bit = 0 ; bit < max_bit ; bit++)
-			    {
-				    if( (value & (1 << bit)) == 0 )
-                    {
-                        hal_remote_s32( word_xp , value | (1 << bit) );
-                        return (word*32 + bit);
-                    }
-			    }
-            }
-		}
-	}
-
-	return -1;
-
-}  // end bitmap_alloc()
-
-///////////////////////////////////////////////
-uint32_t bitmap_remote_ffc( xptr_t   bitmap_xp, 
-                                     uint32_t size )
-{
-    uint32_t max_word;
-    uint32_t max_bit;
-	uint32_t word;
-	uint32_t bit;
-    uint32_t value;
- 
-    bitmap_t * bitmap_ptr = GET_PTR( bitmap_xp );
-    cxy_t      bitmap_cxy = GET_CXY( bitmap_xp );
-
-    if( size )
-    {
-        max_word = ( (size-1) >>5 ) + 1;
-
-        for( word = 0 ; word < max_word ; word++ )
-	    {
-            max_bit = (word == (max_word - 1)) ? (size & 0x1F) : 32;
-
-            value = hal_remote_l32( XPTR( bitmap_cxy , &bitmap_ptr[word] ) );
-
-		    if( value != 0xFFFFFFFF )
-		    {
-			    for(bit = 0 ; bit < max_bit ; bit++)
-			    {
-				    if( (value & (1 << bit)) == 0 ) return (word*32 + bit);
-			    }
-            }
-		}
-	}
-
-	return -1;
-
-}  // bitmap_remote_ffc()
-
-
+	for(word = 0 ; word < size/32 ; word++)
+	{
+		if(bitmap[word] != 0)
+		{
+			for(bit = 0 ; bit < 32 ; bit++)
+			{
+				if( (bitmap[word] & (1 << bit)) == 0 ) return (word*32 + bit);
+			}
+		}
+	}
+	return 0xFFFFFFFF;
+}
+
Index: trunk/kernel/libk/bits.h
===================================================================
--- trunk/kernel/libk/bits.h	(revision 690)
+++ trunk/kernel/libk/bits.h	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * bits.h - bitmap API definition
+ * bits.h - bits manipulation helper functions
  *
  * Author   Ghassan Almaless (2008,2009,2010,2011,2012)
- *          Alain Greiner    (2016,2017,2018,2019,2020)
+ *          Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,23 +26,17 @@
 #define _BITS_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-
-/**********************************************************************************************
- * This file defines the API to access a generic bitmap, that can be local or remote.
- * It is implemented as an array of uint32_t words.
- * The number of entries in this array is statically defined at compile time
- * and defines the max number of items that can be registered in the bitmap.
- * The remote accesses are used in the VFS by the inum allocator.
- *********************************************************************************************/
-
-typedef uint32_t    bitmap_t;
-
-/**********************************************************************************************
- * This macro returns the number of 32 bits words required to register <size> entries.
- *********************************************************************************************/
-
-#define BITMAP_SIZE(size) ( ((size) & 31) ? (((size)>>5) + 1) : ((size)>>5) )
+#include <almos_config.h>
+#include <hal_types.h>
+
+/*********************************************************************************************
+ * These macros are NOT used by the bitmat, but can be useful in other contexts... [AG]
+ *********************************************************************************************/
+
+#define ARROUND_UP(val, size) (((val) & ((size) -1)) ? ((val) & ~((size)-1)) + (size) : (val))
+#define ARROUND_DOWN(val, size)  ((val) & ~((size) - 1))
+
+#define ABS(x) (((x) < 0) ? -(x) : (x))
+#define MIN(x,y) (((x) < (y)) ? (x) : (y))
+#define MAX(x,y) (((x) < (y)) ? (y) : (x))
 
 /**********************************************************************************************
@@ -50,5 +44,4 @@
  * It returns 0xFFFFFFFF if data is larger than 0x80000000.
  *********************************************************************************************/
-
 #define POW2_ROUNDUP(data) ( (data <= 0x00000001) ? 0x00000001  : \
                              (data <= 0x00000002) ? 0x00000002  : \
@@ -84,165 +77,141 @@
                              (data <= 0x80000000) ? 0x80000000  : 0xFFFFFFFF )
 
-/*********************************************************************************************
- * These macros are NOT used by the bitmap, but are useful in other contexts... [AG]
- *********************************************************************************************/
-
-#define ARROUND_UP(val, size) (((val) & ((size) -1)) ? ((val) & ~((size)-1)) + (size) : (val))
-#define ARROUND_DOWN(val, size)  ((val) & ~((size) - 1))
-
-#define ABS(x) (((x) < 0) ? -(x) : (x))
-#define MIN(x,y) (((x) < (y)) ? (x) : (y))
-#define MAX(x,y) (((x) < (y)) ? (y) : (x))
-
-/*********************************************************************************************
- * This function reset all bits in a local or remote bitmap. 
- *********************************************************************************************
- * @ bitmap  : pointer on first word in the bitmap.
- * @ size    : number of bits in bitmap. 
- ********************************************************************************************/
-extern void bitmap_init( bitmap_t * bitmap,
-                         uint32_t   size );
-
-extern void bitmap_remote_init( xptr_t   bitmap_xp,
-                                uint32_t size );
-
-/*********************************************************************************************
- * These functions set a specific bit in a local or remote bitmap.
- *********************************************************************************************
+/**********************************************************************************************
+ * This macro returns the number of 32 bits words required to register size entries.
+ *********************************************************************************************/
+
+#define BITMAP_SIZE(size) ( ((size) & 31) ? (((size)>>5) + 1) : ((size)>>5) )
+ 
+/**********************************************************************************************
+ * This macro declare a bitmap data structure. It is actually an array of uint32_t.
+ * size is the total number of entries in the bitmap.
+ *********************************************************************************************/
+
+#define BITMAP( name , size )     uint32_t name[BITMAP_SIZE(size)]
+
+typedef uint32_t    bitmap_t;
+
+/**********************************************************************************************
+ * This function set a specific bit in a bitmap.
+ **********************************************************************************************
+
  * @ bitmap  : pointer on the bitmap
  * @ index   : bit index in the bitmap
- ********************************************************************************************/
+ *********************************************************************************************/
 extern inline void bitmap_set( bitmap_t * bitmap,
                                uint32_t   index );
 
-extern inline void bitmap_remote_set( xptr_t    bitmap_xp,
-                                      uint32_t  index );
-
-/*********************************************************************************************
- * These functions clear a specific bit in a local or remote bitmap.
- *********************************************************************************************
+/**********************************************************************************************
+ * This function clear a specific bit in a bitmap.
+ **********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : bit index in the bitmap
- ********************************************************************************************/
+ *********************************************************************************************/
 extern inline void bitmap_clear( bitmap_t * bitmap, 
                                  uint32_t   index );
 
-extern inline void bitmap_remote_clear( xptr_t     bitmap_xp, 
-                                        uint32_t   index );
-
-/*********************************************************************************************
- * These functions search the first bit non-set in a local or remote bitmap, in the
- * range [0 , size-1], set this bit, and return the index of the found bit.
- * The lock protecting the bitmap must be taken by the caller.
- *********************************************************************************************
- * @ bitmap  : pointer on the bitmap.
- * @ size    : number of bits to scan.
- * @ returns index of found bit / returns 0xFFFFFFFF if not found.
- ********************************************************************************************/
-extern uint32_t bitmap_alloc( bitmap_t * bitmap, 
-                              uint32_t   size );
-
-extern uint32_t bitmap_remote_alloc( xptr_t    bitmap_xp,
-                                     uint32_t  size );
-
-/*********************************************************************************************
- * This function returns the index of aa specific bit in a bitmap.
- *********************************************************************************************
+/**********************************************************************************************
+ * This function returns a specific bit in a bitmap.
+ **********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : bit index in the bitmap
- * @ returns true if bitmap[index] is set
- ********************************************************************************************/
+ * @ returns tru if bitmap[index] is set
+ *********************************************************************************************/
 extern inline bool_t bitmap_state( bitmap_t * bitmap, 
                                    uint32_t   index );
 
-/*********************************************************************************************
+/**********************************************************************************************
  * This function set a range of bits in a bitmap : [index ... (index + len)[ 
- *********************************************************************************************
+ **********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit index in the bitmap
  * @ len     : number of bits to set
- ********************************************************************************************/
+ *********************************************************************************************/
 extern void bitmap_set_range( bitmap_t * bitmap, 
                               uint32_t   index, 
                               uint32_t   len );
 
-/*********************************************************************************************
+/**********************************************************************************************
  * This function reset a range of bits in a bitmap : [index ... (index + len)[ 
- *********************************************************************************************
+ **********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit index in the bitmap
  * @ len     : number of bits to clear
- ********************************************************************************************/
+ *********************************************************************************************/
 extern void bitmap_clear_range( bitmap_t * bitmap, 
                                 uint32_t   index, 
                                 uint32_t   len );
 
-/*********************************************************************************************
+/**********************************************************************************************
  * This function returns the index of first bit set in a bitmap, starting from index.
- *********************************************************************************************
+ **********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit to analyse in the bitmap
  * @ size    : number of bits to analyse in bitmap
  * @ returns index if found / returns 0xFFFFFFFF if bit not found
- ********************************************************************************************/
+ *********************************************************************************************/
 extern uint32_t bitmap_ffs2( bitmap_t * bitmap,
                              uint32_t   index, 
                              uint32_t   size );
 
-/*********************************************************************************************
+/**********************************************************************************************
  * This function returns the index of first bit cleared in a bitmap, starting from index.
- *********************************************************************************************
+ **********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ index   : first bit to analyse in the bitmap
  * @ size    : number of bits to analyse in bitmap
  * @ returns index if found / returns 0xFFFFFFFF if bit not found
- ********************************************************************************************/
+ *********************************************************************************************/
 extern uint32_t bitmap_ffc2( bitmap_t * bitmap,
                              uint32_t   index, 
                              uint32_t   size );
 
-/*********************************************************************************************
+/**********************************************************************************************
  * This function returns the index of first bit set in a bitmap, starting from bit 0.
- *********************************************************************************************
+ **********************************************************************************************
  * @ bitmap  : pointer on the bitmap
  * @ size    : number of bits to analyse in bitmap
  * @ returns index if found / returns 0xFFFFFFFF if bit not found
- ********************************************************************************************/
+ *********************************************************************************************/
 extern uint32_t bitmap_ffs( bitmap_t * bitmap,
                             uint32_t   size );
 
-/*********************************************************************************************
- * These functions return the index of first bit cleared in a local or remote bitmap,
- * starting from bit 0.
- *********************************************************************************************
- * @ bitmap  : pointer on the bitmap
- * @ size    : number of bits to analyse in bitmap
- * @ returns index if found / returns 0xFFFFFFFF if bit not found
- ********************************************************************************************/
+/**********************************************************************************************
+ * This function returns the index of first bit cleared in a bitmap, starting from bit 0.
+ **********************************************************************************************
+ * @ bitmap  : pointer on the bitmap
+ * @ size    : number of bits to alalyse in bitmap
+ * @ returns index if found / returns 0xFFFFFFFF if bit not found
+ *********************************************************************************************/
 extern uint32_t bitmap_ffc( bitmap_t * bitmap, 
                             uint32_t   size );
 
-extern uint32_t bitmap_remote_ffc( xptr_t   bitmap_xp, 
-                                   uint32_t size );
-
-/*********************************************************************************************
- * This function takes a positive integer <val> as input argument, and returns the smallest
- * integer <order> such as : 1<<order >= val. 
- * In other words, <order> is the min number of bits to encode the <val> values.
- *********************************************************************************************
+/**********************************************************************************************
+ * This function returns the number of bits to code a non-zero unsigned integer value.
+ **********************************************************************************************
+ * @ val   : value to analyse
+ * @ returns number of bits
+ *********************************************************************************************/
+static inline uint32_t bits_nr( uint32_t val )
+{
+	register uint32_t i;
+
+	for( i=0 ; val > 0 ; i++ ) 
+		val = val >> 1;
+
+	return i;
+}
+
+/**********************************************************************************************
+ * This function takes an unsigned integer value as input argument, and returns another
+ * unsigned integer, that is the (base 2) logarithm of the smallest power of 2 contained 
+ * in the input value.
+ **********************************************************************************************
  * @ val   : value to analyse
  * @ returns logarithm value
- ********************************************************************************************/
+ *********************************************************************************************/
 static inline uint32_t bits_log2( uint32_t val )
 {
-    uint32_t i;
-
-    if( val > 0 )
-    {
-        val--;
-        for( i=0 ; val > 0 ; i++ ) val = val >> 1;
-        return i;
-    }
-    return 0;
+	return (val == 0) ? 1 : bits_nr( val ) - 1;
 }
 
Index: trunk/kernel/libk/busylock.c
===================================================================
--- trunk/kernel/libk/busylock.c	(revision 690)
+++ 	(revision )
@@ -1,138 +1,0 @@
-/*
- * busylock.c - local kernel busy waiting lock implementation.
- *
- * Authors     Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <hal_special.h>
-#include <hal_atomic.h>
-#include <thread.h>
-#include <busylock.h>
-
-//////////////////////////////////////////////////////////////////////////////
-//                Extern global variables
-//////////////////////////////////////////////////////////////////////////////
-
-extern char               * lock_type_str[];    // allocated in kernel_init.c
-extern chdev_directory_t    chdev_dir;          // allocated in kernel_init.c
-
-//////////////////////////////////////
-void busylock_init( busylock_t * lock,
-                    uint32_t     type )
-{
-    lock->ticket  = 0;
-    lock->current = 0;
-    lock->type    = type;
-
-#if DEBUG_BUSYLOCK_TYPE
-    xlist_entry_init( XPTR( local_cxy , &lock->xlist ) ); 
-#endif
-
-}
-
-//////////////////////////////////////////
-void busylock_acquire( busylock_t * lock )
-{
-    reg_t      save_sr;
-    thread_t * this = CURRENT_THREAD;
-
-    // enter critical section 
-    hal_disable_irq( &save_sr );
- 
-    // get one free ticket and update ticket allocator
-    uint32_t ticket = hal_atomic_add( &lock->ticket , 1 );
-
-    // poll current until success
-    while( lock->current != ticket )  asm volatile ("nop");
-
-    // increment thread locks counter
-    this->busylocks++;
-
-    // save SR in lock descriptor
-    lock->save_sr = save_sr;
-
-    // memory barrier to update lock and thread state
-    hal_fence();
-
-#if DEBUG_BUSYLOCK
-if( lock->type != LOCK_CHDEV_TXT0 ) 
-{
-    // update thread list of busylocks
-    xptr_t root_xp = XPTR( local_cxy , &this->busylocks_root );
-    xlist_add_last( root_xp , XPTR( local_cxy , &lock->xlist ) );
-}
-#endif
-
-#if( DEBUG_BUSYLOCK & 1 )
-if( (lock->type != LOCK_CHDEV_TXT0) && 
-    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
-    (this->trdid == DEBUG_BUSYLOCK_TRDID) )
-{
-    printk("\n[%s] thread[%x,%x] ACQUIRE lock %s\n",
-    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] );
-}
-#endif
-
-} // end busylock_acquire()
-
-//////////////////////////////////////////
-void busylock_release( busylock_t * lock )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // memory barrier to update the protected object
-    hal_fence();
-
-    // update lock state
-    lock->current++;
-
-    // decrement thread busylocks counter
-    this->busylocks--;
-
-    // memory barrier to update busylock and thread state
-    hal_fence();
-
-#if DEBUG_BUSYLOCK
-if( lock->type != LOCK_CHDEV_TXT0 ) 
-{
-    // remove lock from thread list of busylocks
-    xlist_unlink( XPTR( local_cxy , &lock->xlist ) );
-}
-#endif
-
-#if( DEBUG_BUSYLOCK & 1 )
-if( (lock->type != LOCK_CHDEV_TXT0) && 
-    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
-    (this->trdid == DEBUG_BUSYLOCK_TRDID) )
-{
-    printk("\n[%s] thread[%x,%x] RELEASE lock %s\n",
-    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[lock->type] );
-}
-#endif
-
-    // exit critical section
-    hal_restore_irq( lock->save_sr );
- 
-}  // end busylock_release()
-
-        
Index: trunk/kernel/libk/busylock.h
===================================================================
--- trunk/kernel/libk/busylock.h	(revision 690)
+++ 	(revision )
@@ -1,107 +1,0 @@
-/*
- * busylock.h: local kernel busy-waiting lock definition.     
- * 
- * Authors  Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-kernel; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _BUSYLOCK_H_
-#define _BUSYLOCK_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_shared_types.h>
-#include <xlist.h>
-
-/*******************************************************************************************
- * This synchronisation object sequencializes all concurrent read or write accesses to
- * a shared object located in a given cluster, made by thread(s) running in same cluster.
- * It uses a busy waiting policy when the lock is taken by another thread, and should
- * be used to execute very short actions, such as accessing basic allocators or higher 
- * level synchronisation objects (barriers, queuelocks, or rwlocks).
- * 
- * - To acquire the lock, we use a ticket policy to avoid starvation: the calling thread
- *   makes an atomic increment on a "ticket" allocator, and keep polling the "current" 
- *   value  until current == ticket. 
- *
- * - To release the lock, the owner thread increments the "current" value.
- *
- * - When a thread takes a busylock, it enters a critical section: the acquire() 
- *   function disables the IRQs, takes the lock, increments the thread busylocks counter,
- *   save the SR in lock descriptor and returns.
- *
- * - The release() function releases the lock, decrements the thread busylock
- *   counter, restores the SR to exit the critical section, and returns.
- *
- * WARNING: a thread cannot yield when it is holding a busylock (local or remote).
- *
- * This rule is checked by all functions containing a thread_yield() AND by the scheduler,
- * thanks to the busylocks counter stored in the calling thread descriptor.
- * 1) all functions call "thread_assert_can_yield()" before calling "thread_yield()".
- * 2) The scheduler checks that the calling thread does not hold any busylock.
- * In case of violation the core goes to sleep after a [PANIC] message on TXT0.
- ******************************************************************************************/
-
-/*******************************************************************************************
- * This structure defines a busylock.
- * The <xlist> field is only used when DEBUG_BUSYLOCK is set.
- * The <type> field defines the lock usage as detailed in the kernel_config.h file. 
-******************************************************************************************/
-
-typedef struct busylock_s
-{
-	uint32_t            ticket;      /*! next free ticket index                           */
-    volatile uint32_t   current;     /*! current owner index                              */
-    uint32_t            type;        /*! lock type for debug                              */
-    reg_t               save_sr;     /*! SR value                                         */
-
-#if DEBUG_BUSYLOCK_TYPE
-    xlist_entry_t       xlist;       /*! member of list of locks taken by same thread     */
-#endif
-
-}
-busylock_t;
-
-/*******************************************************************************************
- * This function initializes a busylock.
- *******************************************************************************************
- * @ lock    : local pointer on busylock.
- * @ type    : lock  type for debug.
- ******************************************************************************************/
-void busylock_init( busylock_t * lock,
-                    uint32_t    type );
-
-/*******************************************************************************************
- * This blocking function uses a busy waiting strategy to acquire a busylock.
- * It makes an atomic increment on the "ticket" field to get a ticket value and increment
- * the ticket allocator. 
- * Then it polls the "current" field until (current == ticket), and returns.
- *******************************************************************************************
- * @ lock    : local pointer on busylock.
- ******************************************************************************************/
-void busylock_acquire( busylock_t * lock );
-
-/*******************************************************************************************
- * This function releases a busylock by incrementing the "current" field.
- *******************************************************************************************
- * @ lock    : local pointer on busylock.
- ******************************************************************************************/
-void busylock_release( busylock_t * lock );
-
-#endif	/* _BUSYLOCK_H_ */
Index: trunk/kernel/libk/ctype.c
===================================================================
--- trunk/kernel/libk/ctype.c	(revision 690)
+++ trunk/kernel/libk/ctype.c	(revision 1)
@@ -22,5 +22,5 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 
 ////////////////////
Index: trunk/kernel/libk/elf.c
===================================================================
--- trunk/kernel/libk/elf.c	(revision 690)
+++ trunk/kernel/libk/elf.c	(revision 1)
@@ -2,5 +2,5 @@
  * elf.c - elf parser: find and map process CODE and DATA segments
  *
- * Authors   Alain Greiner    (2016,2017,2018,2019,2020)
+ * Authors   Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,17 +22,14 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_special.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_uspace.h>
 #include <printk.h>
 #include <process.h>
-#include <thread.h>
-#include <mapper.h>
 #include <vseg.h>
 #include <kmem.h>
 #include <vfs.h>
 #include <elf.h>
-#include <syscalls.h>
+
 
 ///////////////////////////////////////////////////////////////////
@@ -41,31 +38,34 @@
 // - return false with an error message if illegal header.
 ///////////////////////////////////////////////////////////////////
-static bool_t elf_isValidHeader(Elf_Ehdr *header)
+static bool_t elf_isValidHeader(Elf32_Ehdr *header)
 {
-	if( (header->e_ident[EI_CLASS]   == ELFCLASS)    &&
-	    (header->e_ident[EI_DATA]    == ELFDATA2LSB) &&
-	    (header->e_ident[EI_VERSION] == EV_CURRENT)  && 
-        ( (header->e_machine == EM_MIPS)        ||
-	      (header->e_machine == EM_MIPS_RS3_LE) ||
-	      (header->e_machine == EM_X86_64) )         &&
-	    (header->e_type == ET_EXEC) )
-		return true;
-
-	if( header->e_ident[EI_CLASS] != ELFCLASS )
-		printk("\n[ERROR] in %s : Elf is not 32/64-Binary\n", __FUNCTION__ );
+	if((header->e_ident[EI_CLASS] == ELFCLASS32) 
+	   && (header->e_ident[EI_DATA] == ELFDATA2LSB) 
+	   && (header->e_ident[EI_VERSION] == EV_CURRENT)
+	   && (header->e_ident[EI_OSABI] == ELFOSABI_NONE)
+	   && ((header->e_machine == EM_MIPS) || 
+	       (header->e_machine == EM_MIPS_RS3_LE) ||
+	       (header->e_machine == EM_386))
+	   && (header->e_type == ET_EXEC))          return true;
+   
+	if( header->e_ident[EI_CLASS] != ELFCLASS32 )
+    printk("\n[ERROR] in %s : Elf is not 32-Binary\n", __FUNCTION__ );
 
 	if( header->e_ident[EI_DATA] != ELFDATA2LSB )
-		printk("\n[ERROR] in %s : Elf is not 2's complement, little endian\n", __FUNCTION__ );
-
-	if( header->e_ident[EI_VERSION] != EV_CURRENT )
-		printk("\n[ERROR] in %s : Elf is not in Current Version\n", __FUNCTION__);
-
-	if( (header->e_machine != EM_MIPS) &&
-	    (header->e_machine != EM_MIPS_RS3_LE) &&
-	    (header->e_machine != EM_X86_64) )
-		printk("\n[ERROR] in %s : unexpected core / accept only MIPS or x86_64\n", __FUNCTION__ );
-
-	if( header->e_type != ET_EXEC )
-		printk("\n[ERROR] in %s : Elf is not executable binary\n", __FUNCTION__ );
+    printk("\n[ERROR] in %s : Elf is not 2's complement, little endian\n", __FUNCTION__ );
+
+	if( header->e_ident[EI_VERSION] != EV_CURRENT ) 
+    printk("\n[ERROR] in %s : Elf is not in Current Version\n", __FUNCTION__);
+
+	if( header->e_ident[EI_OSABI] != ELFOSABI_NONE )
+    printk("\n[ERROR] in %s : Unexpected Elf ABI, need UNIX System V ABI\n", __FUNCTION__ );
+
+	if( (header->e_machine == EM_MIPS) || 
+		(header->e_machine == EM_MIPS_RS3_LE) || 
+        (header->e_machine == EM_386) ) 
+	printk("\n[ERROR] in %s : unexpected core / accept only MIPS or 80386\n", __FUNCTION__ );
+
+	if( header->e_type == ET_EXEC )
+	printk("\n[ERROR] in %s : Elf is not executable binary\n", __FUNCTION__ );
 
 	return false;
@@ -73,34 +73,26 @@
 
 ///////////////////////////////////////////////////////////////////////////////////////
-// This static function loads the .elf header in the buffer allocated by the caller.
-///////////////////////////////////////////////////////////////////////////////////////
+// This function load the .elf header in the buffer allocated by the caller.
 // @ file   : extended pointer on the remote file descriptor.
 // @ buffer : pointer on buffer allocated by the caller.
 // @ size   : number of bytes to read.
 ///////////////////////////////////////////////////////////////////////////////////////
-static error_t elf_header_load( xptr_t   file_xp,
+static error_t elf_header_read( xptr_t   file_xp,
                                 void   * buffer,
                                 uint32_t size )
-{
-	error_t   error;
-	xptr_t    buf_xp;
-
-	buf_xp = XPTR( local_cxy , buffer );
-
-	// load .elf header
-	error = vfs_kernel_move( true,     // to_buffer
-	                         file_xp,
-	                         buf_xp,
-	                         size );
-
-	if( error )
-	{
-		printk("\n[ERROR] in %s : cannot read ELF header size : %d\n",
-               __FUNCTION__ , size );
-		return -1;
-	}
-
-	Elf_Ehdr * header = (Elf_Ehdr *)buffer;
-
+{ 
+    uint32_t  count;
+
+    // load .elf header 
+	count = vfs_read( file_xp , buffer , size );
+
+	if( count != size )
+	{
+		printk("\n[ERROR] in %s : failed to read ELF header\n", __FUNCTION__ );
+		return -1;
+	}
+
+    Elf32_Ehdr * header = (Elf32_Ehdr *)buffer;
+    
 	if( (header->e_ident[EI_MAG0] != ELFMAG0) ||
 	    (header->e_ident[EI_MAG1] != ELFMAG1) ||
@@ -108,5 +100,5 @@
 	    (header->e_ident[EI_MAG3] != ELFMAG3) )
 	{
-		printk("\n[ERROR] in %s : file not in ELF format\n", __FUNCTION__ );
+		printk("\n[ERROR] in %s : file %s not in ELF format\n", __FUNCTION__ );
 		return -1;
 	}
@@ -118,10 +110,8 @@
 	}
 	return 0;
-
-} // end elf_header_load()
+}  // end elf_header_read()
 
 ///////////////////////////////////////////////////////////////////////////////////////
 // This function registers in the process VMM the CODE and DATA segments.
-///////////////////////////////////////////////////////////////////////////////////////
 // @ file      : extended pointer on the remote file descriptor.
 // @ segs_base : local pointer on buffer containing the segments descriptors array
@@ -129,223 +119,221 @@
 // @ process   : local pointer on process descriptor.
 ///////////////////////////////////////////////////////////////////////////////////////
-static error_t elf_segments_register( xptr_t       file_xp,
-                                      void       * segs_base,
-                                      uint32_t     nb_segs,
-                                      process_t  * process )
+static error_t elf_segments_load( xptr_t       file_xp,
+				                  void       * segs_base,
+                                  uint32_t     nb_segs,
+				                  process_t  * process )
 {
+	error_t      error;
 	uint32_t     index;
-	intptr_t     file_size;
-	intptr_t     mem_size;
-	intptr_t     file_offset;
-	intptr_t     vbase;
+	uint32_t     file_size;
+    uint32_t     mem_size;
+	intptr_t     start;
 	uint32_t     type;
 	uint32_t     flags;
-	vseg_t     * vseg;
-
-	Elf_Phdr * seg_ptr = (Elf_Phdr *)segs_base;
-
-	// loop on segments
-	for( index = 0 ; index < nb_segs ; index++ , seg_ptr++ )
-	{
-		if( seg_ptr->p_type != PT_LOAD)
-			continue;
-
-		// get segment attributes
-		vbase       = seg_ptr->p_vaddr;     // vseg base vaddr
-		mem_size    = seg_ptr->p_memsz;     // actual vseg size
-		file_offset = seg_ptr->p_offset;    // vseg offset in .elf file
-		file_size   = seg_ptr->p_filesz;    // vseg size in .elf file
-		flags       = seg_ptr->p_flags;
+	uint32_t     offset;
+    vseg_t     * vseg;
+
+    Elf32_Phdr * seg_ptr = (Elf32_Phdr *)segs_base;
+
+    // loop on segments
+	for( index = 0 ; index < nb_segs ; index++ , seg_ptr++ ) 
+	{   
+		if( seg_ptr->p_type != PT_LOAD) continue;
+    
+        // get segment attributes
+		start     = seg_ptr->p_vaddr;
+        offset    = seg_ptr->p_offset;
+        file_size = seg_ptr->p_filesz;
+        mem_size  = seg_ptr->p_memsz;
+        flags     = seg_ptr->p_flags;
+
+        // check alignment
+		if( start & CONFIG_PPM_PAGE_MASK )
+		{
+			printk("\n[WARNING] in %s : segment base not aligned = %x\n",
+			       __FUNCTION__, start );
+		}
+
+        // check size
+        if( file_size != mem_size )
+		{
+			printk("\n[WARNING] in %s : base = %x / mem_size = %x / file_size = %x\n",
+			       __FUNCTION__, start , mem_size , file_size);
+		}
+
+        // set seek on segment base in file
+		error = vfs_lseek( file_xp , offset , VFS_SEEK_SET , NULL );
+
+		if( error )
+		{
+			printk("\n[ERROR] in %s : failed to seek\n", __FUNCTION__ );
+			return -1;
+		}
 
 		if( flags & PF_X ) // found CODE segment
 		{
-			type                       = VSEG_TYPE_CODE;
-			process->vmm.code_vpn_base = vbase >> CONFIG_PPM_PAGE_ORDER;
-		}
-		else               // found DATA segment
-		{
-			type                       = VSEG_TYPE_DATA;
-			process->vmm.data_vpn_base = vbase >> CONFIG_PPM_PAGE_ORDER;
-		}
-
-        // get .elf file descriptor cluster and local pointer 
-        cxy_t        file_cxy = GET_CXY( file_xp );
-        vfs_file_t * file_ptr = GET_PTR( file_xp );
-
-        // get local pointer on .elf file mapper
-        mapper_t * mapper_ptr = (mapper_t *)hal_remote_lpt( XPTR( file_cxy , 
-                                                                  &file_ptr->mapper ) );
-		// register vseg in VMM
-		vseg = (vseg_t *)vmm_create_vseg( process,
-                                          type,
-		                                  vbase,
-		                                  mem_size,
-                                          file_offset,
-                                          file_size,
-                                          XPTR( file_cxy , mapper_ptr ),
-		                                  local_cxy );  
+            type                       = VSEG_TYPE_CODE;
+			process->vmm.code_vpn_base = start >> CONFIG_PPM_PAGE_SHIFT;
+
+			elf_dmsg("\n[INFO] %s found CODE vseg / base = %x / size = %x\n",
+                     __FUNCTION__ , start , mem_size );
+		}
+		else                   // found DATA segment
+		{
+            type                       = VSEG_TYPE_DATA;
+			process->vmm.data_vpn_base = start >> CONFIG_PPM_PAGE_SHIFT;
+
+			elf_dmsg("\n[INFO] %s found DATA vseg / base = %x / size = %x\n",
+                     __FUNCTION__, start , mem_size );
+		}
+
+        // register vseg in VMM
+		vseg = (vseg_t *)vmm_create_vseg( process, 
+					                      start,
+					                      mem_size, 
+					                      type );
 		if( vseg == NULL )
 		{
 			printk("\n[ERROR] in %s : cannot map segment / base = %x / size = %x\n",
-			       __FUNCTION__ , vbase , mem_size );
+			       __FUNCTION__ , start , mem_size );
 			return -1;
 		}
 
-#if DEBUG_ELF_LOAD
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_ELF_LOAD < cycle )
-printk("\n[%s] thread[%x,%x] found %s vseg / base %x / size %x\n"
-"  file_size %x / file_offset %x / mapper[%x,%x] / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, 
-vseg_type_str(vseg->type) , vseg->min , vseg->max - vseg->min ,
-vseg->file_size , vseg->file_offset , 
-GET_CXY(vseg->mapper_xp), GET_PTR(vseg->mapper_xp), cycle );
-#endif
-
+		vfs_file_count_up( file_xp );
 	}
 
 	return 0;
-
-} // end elf_segments_register()
-
-//////////////////////////////////////////////
-error_t elf_load_process( xptr_t      file_xp,
-                          process_t * process )
+} // end elf_load_segments()
+
+///////////////////////////////////////////////
+error_t elf_load_process( char      * pathname,
+                          process_t * process)
 {
-    uint32_t     new_offset;       // unused, required by vfs_lseek() 
-	Elf_Ehdr     header;           // local buffer for .elf header
+	kmem_req_t   req;              // kmem request for program header
+    char         path_copy[256];   // local copy of pathname
+	uint32_t     length;           // actual path length
+	Elf32_Ehdr   header;           // local buffer for .elf header
 	void       * segs_base;        // pointer on buffer for segment descriptors array
-	uint32_t     segs_size;        // size of buffer for segment descriptors array
-    char         name[CONFIG_VFS_MAX_NAME_LENGTH];
+    uint32_t     segs_size;        // size of buffer for segment descriptors array  
+	xptr_t       file_xp;          // extended pointer on created file descriptor
+    uint32_t     count;            // bytes counter
 	error_t      error;
 
-    // get file cluster and local pointer
-    cxy_t        file_cxy = GET_CXY( file_xp );
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-
-    // get inode pointer
-    vfs_inode_t * inode_ptr = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
- 
-    // get file name for error reporting and debug
-    vfs_inode_get_name( XPTR( file_cxy , inode_ptr ) , name );
-    
-#if DEBUG_ELF_LOAD
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_ELF_LOAD < cycle )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, cycle );
-#endif
-
-	// load header in local buffer
-	error = elf_header_load( file_xp ,
-	                         &header,
-	                         sizeof(Elf_Ehdr) );
+    // get path length from user space
+	length = hal_strlen_from_uspace( pathname );
+
+    if( length > 255 )
+    {
+        printk("\n[ERROR] in %s : pathname length too long\n", __FUNCTION__ );
+        return -1;
+    }
+
+    // make a local copy for pathname
+    hal_copy_from_uspace( path_copy , pathname , length+1 );
+
+    // open file
+    file_xp = XPTR_NULL;  // avoid GCC warning
+
+	error = vfs_open( process->vfs_cwd_xp, 
+                      path_copy,
+                      VFS_O_RDONLY,
+                      &file_xp );
 	if( error )
 	{
-		printk("\n[ERROR] in %s : cannot get header for <%s>\n", __FUNCTION__ , name );
-		return -1;
-	}
-
-#if (DEBUG_ELF_LOAD & 1)
-if( DEBUG_ELF_LOAD < cycle )
-printk("\n[%s] loaded elf header for <%s>\n"
-       "      - size    = %x\n"
-       "      - version = %x\n"
-       "      - entry   = %x\n"
-       "      - machine = %x\n"
-       "      - offset  = %x\n"
-       "      - segnum  = %x\n",
-       __FUNCTION__, name,
-       header.e_ehsize,
-       header.e_version,
-       header.e_entry,
-       header.e_machine,
-       header.e_phoff,
-       header.e_phnum );
-#endif
+		printk("\n[ERROR] in %s : failed to open executable file %s\n",
+               __FUNCTION__ , path_copy );
+		return -1;
+	}
+
+    // load header in local buffer
+	error = elf_header_read( file_xp , 
+                             &header,
+                             sizeof(Elf32_Ehdr) );
+	if( error ) 
+    {
+        vfs_close( file_xp , &count );
+        return -1;
+    }
+
+	elf_dmsg("\n[INFO] %s loaded elf header for %s\n", __FUNCTION__ , path_copy );
 
 	if( header.e_phnum == 0 )
 	{
 		printk("\n[ERROR] in %s : no segments found\n", __FUNCTION__ );
-		return -1;
-	}
-
-	// compute buffer size for segment descriptors array
-	segs_size = sizeof(Elf_Phdr) * header.e_phnum;
-
-	// allocate memory for segment descriptors array
-	segs_base = kmem_alloc( bits_log2(segs_size) , AF_NONE );
+        vfs_close( file_xp , &count );
+		return -1;
+	}
+
+    // compute buffer size for segment descriptors array
+	segs_size = sizeof(Elf32_Phdr) * header.e_phnum;
+  
+    // allocate memory for segment descriptors array
+	req.type  = KMEM_GENERIC;
+	req.size  = segs_size;
+	req.flags = AF_KERNEL;
+	segs_base = kmem_alloc( &req );
 
 	if( segs_base == NULL )
-	{
+    {
 		printk("\n[ERROR] in %s : no memory for segment descriptors\n", __FUNCTION__ );
-		return -1;
-	}
-
-	// set seek pointer in file descriptor to access segment descriptors array
-	error = vfs_lseek( file_xp , header.e_phoff, SEEK_SET , &new_offset );
+        vfs_close( file_xp , &count );
+        return -1;
+    }
+
+    // set seek pointer in file descriptor to access segment descriptors array
+	error = vfs_lseek( file_xp , header.e_phoff, VFS_SEEK_SET , NULL );
 
 	if( error )
 	{
 		printk("\n[ERROR] in %s : cannot seek for descriptors array\n", __FUNCTION__ );
-		kmem_free( segs_base , bits_log2(segs_size) );
-		return -1;
-	}
-
-#if (DEBUG_ELF_LOAD & 1)
-if( DEBUG_ELF_LOAD < cycle )
-printk("\n[%s] segments array allocated for <%s>\n", __FUNCTION__ , name );
-#endif
-
-	// load seg descriptors array to local buffer
-	error = vfs_kernel_move( true,                  // to_buffer
-	                         file_xp,
-	                         XPTR( local_cxy , segs_base ),
-	                         segs_size );
-
+        vfs_close( file_xp , &count );
+	    req.ptr = segs_base;
+	    kmem_free( &req );
+		return -1;
+	}
+
+    // load seg descriptors array to local buffer 
+	count = vfs_read( file_xp, 
+                      segs_base,
+                      segs_size );
+
+	if( count != segs_size )
+	{
+		printk("\n[ERROR] in %s : cannot read segments descriptors\n", __FUNCTION__ );
+        vfs_close( file_xp , &count );
+	    req.ptr = segs_base;
+	    kmem_free( &req );
+		return -1;
+	}
+
+	elf_dmsg("\n[INFO] %s loaded segments descriptors for %s \n", __FUNCTION__ , path_copy );
+
+    // register loadable segments in process VMM
+	error = elf_segments_load( file_xp, 
+                               segs_base,
+                               header.e_phnum,
+                               process );
 	if( error )
-	{
-		printk("\n[ERROR] in %s : cannot read segments descriptors\n", __FUNCTION__ );
-		kmem_free( segs_base , bits_log2(segs_size) );
-		return -1;
-	}
-
-#if (DEBUG_ELF_LOAD & 1)
-if( DEBUG_ELF_LOAD < cycle )
-printk("\n[%s] loaded segments descriptors for <%s>\n", __FUNCTION__ , name );
-#endif
-
-	// register loadable segments in process VMM
-	error = elf_segments_register( file_xp,
-	                               segs_base,
-	                               header.e_phnum,
-	                               process );
-	if( error )
-	{
-		printk("\n[ERROR] in %s : cannot register segments descriptors\n", __FUNCTION__ );
-		kmem_free( segs_base , bits_log2(segs_size) );
-		return -1;
-	}
-
-	// register process entry point in VMM
+    {
+        vfs_close( file_xp , &count );
+	    req.ptr = segs_base;
+	    kmem_free( &req );
+		return -1;
+    }
+
+    // register process entry point in VMM
 	process->vmm.entry_point = (intptr_t)header.e_entry;
 
-	// register extended pointer on .elf file descriptor
-	process->vfs_bin_xp = file_xp;
-
-	// release allocated memory for program header
-    kmem_free( segs_base , bits_log2(segs_size) );
-
-#if DEBUG_ELF_LOAD
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_ELF_LOAD < cycle )
-printk("\n[%s] thread[%x,%x] exit for <%s> / entry_point %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, header.e_entry, cycle );
-#endif
+    // register extended pointer on .elf file descriptor 
+    process->vfs_bin_xp = file_xp;
+
+    // release allocated memory for program header
+	req.ptr = segs_base;
+	kmem_free(&req);
+
+	elf_dmsg("\n[INFO] %s successfully completed / entry point = %x for %s]\n", 
+		 __FUNCTION__, (uint32_t) header.e_entry , path_copy );
 
 	return 0;
-
 }  // end elf_load_process()
 
Index: trunk/kernel/libk/elf.h
===================================================================
--- trunk/kernel/libk/elf.h	(revision 690)
+++ trunk/kernel/libk/elf.h	(revision 1)
@@ -22,37 +22,46 @@
 #define	_ELF_H_ 1
 
-#include <hal_kernel_types.h>
-
-/*
- * Standard ELF types.
- */
+#include <hal_types.h>
+
+/* Standard ELF types.  */
+
+/* Type for a 16-bit quantity.  */
+typedef uint16_t Elf32_Half;
+
+/* Types for signed and unsigned 32-bit quantities.  */
+typedef uint32_t Elf32_Word;
+typedef	int32_t  Elf32_Sword;
+
+/* Types for signed and unsigned 64-bit quantities.  */
+typedef uint64_t Elf32_Xword;
+typedef	int64_t  Elf32_Sxword;
+
+/* Type of addresses.  */
+typedef uint32_t Elf32_Addr;
+
+/* Type of file offsets.  */
+typedef uint32_t Elf32_Off;
+
+/* Type for section indices, which are 16-bit quantities.  */
+typedef uint16_t Elf32_Section;
+
+/* Type for version symbol information.  */
+typedef Elf32_Half Elf32_Versym;
+
+/*************************************************************************************
+ * This structure defines the ELF file header (first bytes in the file)
+ *************************************************************************************/
 
 #define EI_NIDENT (16)
 
-/* 32bit version */
-typedef uint16_t Elf32_Half;
-typedef uint32_t Elf32_Word;
-typedef int32_t  Elf32_Sword;
-typedef uint32_t Elf32_Addr;
-typedef uint32_t Elf32_Off;
-
-/* 64bit version */
-typedef uint16_t Elf64_Half;
-typedef uint32_t Elf64_Word;
-typedef int32_t  Elf64_Sword;
-typedef uint64_t Elf64_Xword;
-typedef uint64_t Elf64_Addr;
-typedef uint64_t Elf64_Off;
-
-/* ELF header - 32bit version. */
 typedef struct
 {
-	unsigned char   e_ident[EI_NIDENT]; /* Magic number and other info */
+	unsigned char	e_ident[EI_NIDENT];	/* Magic number and other info */
 	Elf32_Half      e_type;             /* Object file type */
 	Elf32_Half      e_machine;          /* Architecture */
 	Elf32_Word      e_version;          /* Object file version */
-	Elf32_Addr      e_entry;            /* Entry point virtual address */
-	Elf32_Off       e_phoff;            /* Program header table file offset */
-	Elf32_Off       e_shoff;            /* Section header table file offset */
+	Elf32_Addr	    e_entry;            /* Entry point virtual address */
+	Elf32_Off	    e_phoff;            /* Program header table file offset */
+	Elf32_Off	    e_shoff;            /* Section header table file offset */
 	Elf32_Word      e_flags;            /* Processor-specific flags */
 	Elf32_Half      e_ehsize;           /* ELF header size in bytes */
@@ -62,32 +71,11 @@
 	Elf32_Half      e_shnum;            /* Section header table entry count */
 	Elf32_Half      e_shstrndx;         /* Section header string table index */
-}
+} 
 Elf32_Ehdr;
 
-/* ELF header - 64bit version. */
-typedef struct
-{
-	unsigned char   e_ident[EI_NIDENT]; /* Magic number and other info */
-	Elf64_Half      e_type;	            /* Object file type */
-	Elf64_Half      e_machine;          /* Architecture */
-	Elf64_Word      e_version;          /* Object file version */
-	Elf64_Addr      e_entry;            /* Entry point virtual address */
-	Elf64_Off       e_phoff;            /* Program header table file offset */
-	Elf64_Off       e_shoff;            /* Section header table file offset */
-	Elf64_Word      e_flags;            /* Processor-specific flags */
-	Elf64_Half      e_ehsize;           /* ELF header size in bytes */
-	Elf64_Half      e_phentsize;        /* Program header table entry size */
-	Elf64_Half      e_phnum;            /* Program header table entry count */
-	Elf64_Half      e_shentsize;        /* Section header table entry size */
-	Elf64_Half      e_shnum;            /* Section header table entry count */
-	Elf64_Half      e_shstrndx;	        /* Section header string table index */
-}
-Elf64_Ehdr;
-
-/*
- * Fields in the e_ident array. The EI_* macros are indices into the
- * array. The macros under each EI_* macro are the values the byte
- * may have.
- */
+/* Fields in the e_ident array.  The EI_* macros are indices into the
+   array.  The macros under each EI_* macro are the values the byte
+   may have.  */
+
 #define EI_MAG0		0		/* File identification byte 0 index */
 #define ELFMAG0		0x7f		/* Magic number byte 0 */
@@ -101,10 +89,9 @@
 #define EI_MAG3		3		/* File identification byte 3 index */
 #define ELFMAG3		'F'		/* Magic number byte 3 */
+
 
 #define EI_CLASS	4		/* File class byte index */
 #define ELFCLASSNONE	0		/* Invalid class */
 #define ELFCLASS32	1		/* 32-bit objects */
-#define ELFCLASS64	2	/* 64-bit objects */
-
 #define ELFCLASSNUM	3
 
@@ -122,4 +109,5 @@
 
 /* Legal values for e_type (object file type).  */
+
 #define ET_NONE		0		/* No file type */
 #define ET_REL		1		/* Relocatable file */
@@ -134,5 +122,8 @@
 
 /* Legal values for e_machine (architecture).  */
+
 #define EM_NONE		 0		/* No machine */
+#define EM_386		 3		/* Intel 80386 */
+#define EM_860		 7		/* Intel 80860 */
 #define EM_MIPS		 8		/* MIPS R3000 big-endian */
 #define EM_MIPS_RS3_LE	10		/* MIPS R3000 little-endian */
@@ -140,40 +131,28 @@
 #define EM_PPC64	21		/* PowerPC 64-bit */
 #define EM_ARM		40		/* ARM */
-#define EM_X86_64	62		/* AMD x86-64 architecture */
 
 /* Legal values for e_version (version).  */
+
 #define EV_NONE		0		/* Invalid ELF version */
 #define EV_CURRENT	1		/* Current version */
 #define EV_NUM		2
 
-/* Program segment header - 32bit version. */
+/* Program segment header.  */
+
 typedef struct
 {
-	Elf32_Word  p_type;     /* Segment type */
-	Elf32_Off   p_offset;   /* Segment file offset */
-	Elf32_Addr  p_vaddr;    /* Segment virtual address */
-	Elf32_Addr  p_paddr;    /* Segment physical address */
-	Elf32_Word  p_filesz;   /* Segment size in file */
-	Elf32_Word  p_memsz;    /* Segment size in memory */
-	Elf32_Word  p_flags;    /* Segment flags */
-	Elf32_Word  p_align;    /* Segment alignment */
-}
+	Elf32_Word	p_type;		/* Segment type */
+	Elf32_Off	p_offset;	/* Segment file offset */
+	Elf32_Addr	p_vaddr;	/* Segment virtual address */
+	Elf32_Addr	p_paddr;	/* Segment physical address */
+	Elf32_Word	p_filesz;	/* Segment size in file */
+	Elf32_Word	p_memsz;	/* Segment size in memory */
+	Elf32_Word	p_flags;	/* Segment flags */
+	Elf32_Word	p_align;    /* Segment alignment */
+} 
 Elf32_Phdr;
 
-/* Program segment header - 64bit version. */
-typedef struct
-{
-	Elf64_Word  p_type;     /* Segment type */
-	Elf64_Word  p_flags;    /* Segment flags */
-	Elf64_Off   p_offset;   /* Segment file offset */
-	Elf64_Addr  p_vaddr;    /* Segment virtual address */
-	Elf64_Addr  p_paddr;    /* Segment physical address */
-	Elf64_Xword p_filesz;   /* Segment size in file */
-	Elf64_Xword p_memsz;    /* Segment size in memory */
-	Elf64_Xword p_align;    /* Segment alignment */
-}
-Elf64_Phdr;
-
 /* Legal values for p_type (segment type).  */
+
 #define	PT_NULL		0		/* Program header table entry unused */
 #define PT_LOAD		1		/* Loadable program segment */
@@ -198,4 +177,5 @@
 
 /* Legal values for p_flags (segment flags).  */
+
 #define PF_X		(1 << 0)	/* Segment is executable */
 #define PF_W		(1 << 1)	/* Segment is writable */
@@ -204,38 +184,17 @@
 #define PF_MASKPROC	0xf0000000	/* Processor-specific */
 
-#if defined(HAL_ELF_32_BITS)
-#define Elf_Half  Elf32_Half
-#define Elf_Word  Elf32_Word
-#define Elf_Sword Elf32_Sword
-#define Elf_Addr  Elf32_Addr
-#define Elf_Off   Elf32_Off
-#define Elf_Ehdr  Elf32_Ehdr
-#define Elf_Phdr  Elf32_Phdr
-#define ELFCLASS  ELFCLASS32
-#elif defined (HAL_ELF_64_BITS)
-#define Elf_Half  Elf64_Half
-#define Elf_Word  Elf64_Word
-#define Elf_Sword Elf64_Sword
-#define Elf_Xword Elf64_Xword
-#define Elf_Addr  Elf64_Addr
-#define Elf_Off   Elf64_Off
-#define Elf_Ehdr  Elf64_Ehdr
-#define Elf_Phdr  Elf64_Phdr
-#define ELFCLASS  ELFCLASS64
-#else
-#error "Must define HAL_ELF_64_BITS / HAL_ELF_32_BITS"
-#endif
+
 
 /****************************************************************************************
- * This function registers in the VSL of the process identified by the <process>
- * argument the CODE and DATA vsegs defined in the .elf file identidied by the 
- * file descriptor <file_xp>.  The segments themselve are not loaded in memory.
- * It also registers the process entry point in the process VMM.
+ * This function register in VMM the CODE and DATA vsegs defined in the .elf file. 
+ * The segments are not loaded in memory.
+ * It register also the process entry point in VMM.
  ****************************************************************************************
- * @ file_xp  : extended pointer on the .elf file descriptor.
+ * @ pathname : .elf file pathname (in user space => must use hal_uspace API).
  * @ process  : local pointer on target process descriptor.
  ***************************************************************************************/
-error_t elf_load_process( xptr_t      file_xp,
+error_t elf_load_process( char      * pathname,
                           process_t * process);
 
+
 #endif	/* elf.h */
Index: trunk/kernel/libk/grdxt.c
===================================================================
--- trunk/kernel/libk/grdxt.c	(revision 690)
+++ trunk/kernel/libk/grdxt.c	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * grdxt.c - Three-levels Generic Radix-tree implementation.
+ * grdxt.c - Three-levels Generic Radix-tree implementation
  * 
- * authors  Alain Greiner (2016,2017,2018,2019))
+ * authors  Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -22,15 +22,10 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <hal_remote.h>
 #include <errno.h>
 #include <printk.h>
 #include <kmem.h>
 #include <grdxt.h>
-
-////////////////////////////////////////////////////////////////////////////////////////
-//               Local access functions
-////////////////////////////////////////////////////////////////////////////////////////
 
 /////////////////////////////////
@@ -40,9 +35,6 @@
                     uint32_t  ix3_width )
 {
-
-assert( __FUNCTION__, (rt != NULL), 
-"pointer on radix tree is NULL\n" );
-
     void      ** root;
+	kmem_req_t   req;
   
 	rt->ix1_width = ix1_width;
@@ -51,27 +43,19 @@
 
     // allocates first level array
-	uint32_t order = ix1_width + ( (sizeof(void*) == 4) ? 2 : 3 );
-	root = kmem_alloc( order , AF_ZERO );
-
-	if( root == NULL )
-    {
-        printk("\n[ERROR] in %s : cannot allocate first level array\n", __FUNCTION__);
-        return -1;
-    }
+	req.type  = KMEM_GENERIC;
+	req.size  = sizeof(void *) << ix1_width;
+	req.flags = AF_KERNEL | AF_ZERO;
+	root = kmem_alloc( &req );
+	if( root == NULL ) return ENOMEM;
   
 	rt->root = root;
 
 	return 0;
-
-}  // end grdxt_init()
+}
 
 //////////////////////////////////
 void grdxt_destroy( grdxt_t * rt )
 {
-
-assert( __FUNCTION__, (rt != NULL), 
-"pointer on radix tree is NULL\n" );
-
-    uint32_t   order;
+	kmem_req_t req;
 
     uint32_t   w1 = rt->ix1_width;
@@ -85,7 +69,8 @@
 	uint32_t   ix1;
 	uint32_t   ix2;
-	uint32_t   ix3;
-
-	for( ix1=0 ; ix1 < (uint32_t)(1 << w1) ; ix1++ )
+
+	req.type = KMEM_GENERIC;
+
+	for( ix1=0 ; ix1 < (1 << w1) ; ix1++ )
 	{
         ptr2 = ptr1[ix1];
@@ -93,5 +78,5 @@
 		if( ptr2 == NULL ) continue;
 
-        for( ix2=0 ; ix2 < (uint32_t)(1 << w2) ; ix2++ )
+        for( ix2=0 ; ix2 < (1 << w2) ; ix2++ )
         {
             ptr3 = ptr2[ix2];
@@ -99,28 +84,69 @@
 		    if( ptr3 == NULL ) continue;
 
-            for( ix3=0 ; ix3 < (uint32_t)(1 << w3) ; ix3++ )
+            // release level 3 array 
+		    req.ptr  = ptr3;
+            req.type = KMEM_GENERIC;
+            req.size = sizeof(void *) * (1 << w3);
+		    kmem_free( &req );
+        }
+
+        // release level 2 array
+		req.ptr  = ptr2;
+        req.type = KMEM_GENERIC;
+        req.size = sizeof(void *) * (1 << w2);
+		kmem_free( &req );
+    }
+
+    // release level 1 array
+	req.ptr  = ptr1;
+    req.type = KMEM_GENERIC;
+    req.size = sizeof(void *) * (1 << w1);
+	kmem_free( &req );
+
+}  // end grdxt_destroy()
+
+///////////////////////////////
+void grdxt_print( grdxt_t * rt,
+                  char    * name )
+{
+	uint32_t        ix1;  
+	uint32_t        ix2;
+	uint32_t        ix3;
+
+    uint32_t        w1 = rt->ix1_width;
+    uint32_t        w2 = rt->ix2_width;
+    uint32_t        w3 = rt->ix3_width;
+
+    void         ** ptr1 = rt->root;
+    void         ** ptr2;
+    void         ** ptr3;
+
+    intptr_t        key; 
+    intptr_t        value;
+
+	printk("*** %s : n1 = %d / n2 = %d / n3 = %d\n", 
+           name, 1<<w1 , 1<<w2 , 1<<w3 );
+
+	for( ix1=0 ; ix1 < (1<<w1) ; ix1++ )
+	{
+        ptr2 = ptr1[ix1];
+        if( ptr2 == NULL )  continue;
+    
+        for( ix2=0 ; ix2 < (1<<w2) ; ix2++ )
+        {
+            ptr3 = ptr2[ix2];
+            if( ptr3 == NULL ) continue;
+
+            for( ix3=0 ; ix3 < (1<<w3) ; ix3++ )
             {
-                 if( ptr3[ix3] != NULL )
-                 {
-                     printk("\n[WARNING] in %s : ptr3[%d][%d][%d] non empty\n",
-                     __FUNCTION__, ix1, ix2, ix3 );
-                 }
+                value = (intptr_t)ptr3[ix3];
+                if( value == 0 )  continue;
+
+                key = (ix1<<(w2+w3)) + (ix2<<w3) + ix3;
+                printk(" - key = %x / value = %x\n", key , value );
             }
-
-            // release level 3 array 
-	        order = w3 + ( (sizeof(void*) == 4) ? 2 : 3 );
-		    kmem_free( ptr3 , order );
         }
-
-        // release level 2 array
-	    order = w2 + ( (sizeof(void*) == 4) ? 2 : 3 );
-		kmem_free( ptr2 , order );
-    }
-
-    // release level 1 array
-	order = w1 + ( (sizeof(void*) == 4) ? 2 : 3 );
-	kmem_free( ptr1 , order );
-
-}  // end grdxt_destroy()
+	}
+} // end grdxt_print()
 
 ////////////////////////////////////
@@ -129,13 +155,17 @@
                       void     * value )
 {
-    uint32_t        order;
-
-    uint32_t        w1 = rt->ix1_width;
-    uint32_t        w2 = rt->ix2_width;
-    uint32_t        w3 = rt->ix3_width;
-
-// Check key value
-assert( __FUNCTION__, ((key >> (w1 + w2 + w3)) == 0 ), 
-"illegal key value %x\n", key );
+	kmem_req_t      req;
+
+    uint32_t        w1 = rt->ix1_width;
+    uint32_t        w2 = rt->ix2_width;
+    uint32_t        w3 = rt->ix3_width;
+
+    // Check key
+    if( (key >> (w1 + w2 + w3)) != 0 )
+    {
+        printk("\n[PANIC] in %s : key value %x exceed (%d + %d + %d) bits\n",
+               __FUNCTION__ , key , w1 , w2 , w3 );
+        hal_core_sleep();
+    }
 
     // compute indexes
@@ -144,49 +174,55 @@
 	uint32_t        ix3 = key & ((1 << w3) - 1);         // index in level 3 array
 
-    // get ptr1
-    void ** ptr1 = rt->root;
-
-    if( ptr1 == NULL ) return -1;
-
-    // get ptr2
-	void ** ptr2 = ptr1[ix1];
-
-    // If required, allocate memory for the missing level 2 array
-	if( ptr2 == NULL )
+    void         ** ptr1 = rt->root;                     // pointer on level 1 array
+	void         ** ptr2;                                // pointer on level 2 array
+	void         ** ptr3;                                // pointer on level 3 array
+
+    // If required, we must allocate memory for the selected level 2 array,
+    // and atomically update the level 1 array.
+	if( ptr1[ix1] == NULL )
 	{
         // allocate memory for level 2 array
-        order = w2 + ( (sizeof(void*) == 4) ? 2 : 3 );
-        ptr2 = kmem_alloc( order , AF_ZERO );
-
-        if( ptr2 == NULL) return -1;
+        req.type = KMEM_GENERIC;
+        req.size = sizeof(void *) << w2;
+        req.flags = AF_KERNEL | AF_ZERO;
+        ptr2 = kmem_alloc( &req );
+        if( ptr2 == NULL) return ENOMEM;
 
         // update level 1 array
         ptr1[ix1] = ptr2;
 	}
-
-    // get ptr3
-	void ** ptr3 = ptr2[ix2];
-
-    // If required, allocate memory for the missing level 3 array
-	if( ptr3 == NULL )
+    else    // get pointer on selected level 2 array.
+    {
+	    ptr2 = ptr1[ix1];
+    }
+
+    // If required, we must allocate memory for the selected level 3 array,
+    // and atomically update the level 2 array.
+	if( ptr2[ix2] == NULL )
 	{
         // allocate memory for level 3 array
-        order = w3 + ( (sizeof(void*) == 4) ? 2 : 3 );
-        ptr3 = kmem_alloc( order , AF_ZERO );
-
-        if( ptr3 == NULL) return -1;
+        req.type = KMEM_GENERIC;
+        req.size = sizeof(void *) << w3;
+        req.flags = AF_KERNEL | AF_ZERO;
+        ptr3 = kmem_alloc( &req );
+        if( ptr3 == NULL) return ENOMEM;
 
         //  update level 3 array
 		ptr2[ix2] = ptr3;
 	}
+    else    // get pointer on selected level 3 array.
+    {
+	    ptr3 = ptr2[ix2];
+    }
+
+    // selected slot in level 3 array must be empty
+	if( ptr3[ix3] != NULL ) return EEXIST;
 
     // register the value
 	ptr3[ix3] = value;
-
-	hal_fence();
+	hal_wbflush();
 
 	return 0;
-
-}  // end grdxt_insert()
+}
 
 ///////////////////////////////////
@@ -198,7 +234,11 @@
     uint32_t        w3 = rt->ix3_width;
 
-// Check key value
-assert( __FUNCTION__, ((key >> (w1 + w2 + w3)) == 0 ), 
-"illegal key value %x\n", key );
+    // Check key
+    if( (key >> (w1 + w2 + w3)) != 0 )
+    {
+        printk("\n[PANIC] in %s : key value %x exceed (%d + %d + %d) bits\n",
+               __FUNCTION__ , key , w1 , w2 , w3 );
+        hal_core_sleep();
+    }
 
     // compute indexes
@@ -207,17 +247,14 @@
 	uint32_t        ix3 = key & ((1 << w3) - 1);         // index in level 3 array
 
-    // get ptr1
-    void ** ptr1 = rt->root;
-
-    if( ptr1 == NULL ) return NULL;
+    void         ** ptr1 = rt->root;                     // pointer on level 1 array
+	void         ** ptr2;                                // pointer on level 2 array
+	void         ** ptr3;                                // pointer on level 3 array
 
     // get ptr2
-	void ** ptr2 = ptr1[ix1];
-
+	ptr2 = ptr1[ix1];
 	if( ptr2 == NULL ) return NULL;
 
     // get ptr3
-	void ** ptr3 = ptr2[ix2];
-
+	ptr3 = ptr2[ix2];
 	if( ptr3 == NULL ) return NULL;
 
@@ -227,9 +264,8 @@
     // reset selected slot
 	ptr3[ix3] = NULL;
-	hal_fence();
+	hal_wbflush();
 
 	return value;
-
-}  // end grdxt_remove()
+}
 
 ///////////////////////////////////
@@ -241,7 +277,11 @@
     uint32_t        w3 = rt->ix3_width;
 
-// Check key value
-assert( __FUNCTION__, ((key >> (w1 + w2 + w3)) == 0 ), 
-"illegal key value %x\n", key );
+    // Check key
+    if( (key >> (w1 + w2 + w3)) != 0 )
+    {
+        printk("\n[PANIC] in %s : key value %x exceed (%d + %d + %d) bits\n",
+               __FUNCTION__ , key , w1 , w2 , w3 );
+        hal_core_sleep();
+    }
 
     void         ** ptr1 = rt->root;
@@ -266,6 +306,5 @@
 
 	return value;
-
-}  // end grdxt_lookup()
+}
 
 //////////////////////////////////////
@@ -282,7 +321,11 @@
     uint32_t        w3 = rt->ix3_width;
 
-// Check key value
-assert( __FUNCTION__, ((start_key >> (w1 + w2 + w3)) == 0 ),
-"illegal key value %x\n", start_key );
+    // Check start_key
+    if( (start_key >> (w1 + w2 + w3)) != 0 )
+    {
+        printk("\n[PANIC] in %s : start_key value %x exceed (%d + %d + %d) bits\n",
+               __FUNCTION__ , start_key , w1 , w2 , w3 );
+        hal_core_sleep();
+    }
 
     // compute max indexes
@@ -315,5 +358,5 @@
                 else                    
                 {
-                    *found_key = (ix1 << (w2+w3)) | (ix2 << w3) | ix3;
+                    *found_key = (ix1 << (w2+w3)) | (ix2 << w1) | ix3;
                     return ptr3[ix3];
                 }
@@ -323,451 +366,3 @@
 
     return NULL;
-
-}  // end grdxt_get_first()
-
-
-
-////////////////////////////////////////////////////////////////////////////////////////
-//               Remote access functions
-////////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////
-error_t grdxt_remote_init( xptr_t     rt_xp,
-                           uint32_t   ix1_width,
-                           uint32_t   ix2_width,
-                           uint32_t   ix3_width )
-{
-
-assert( __FUNCTION__, (rt_xp != XPTR_NULL),
-"extended pointer on radix tree is NULL\n" );
-
-    void      ** root;
-
-    // get cluster and local pointer
-    cxy_t     rt_cxy = GET_CXY( rt_xp );
-    grdxt_t * rt_ptr = GET_PTR( rt_xp );
-  
-    // initialize widths
-    hal_remote_s32( XPTR( rt_cxy , &rt_ptr->ix1_width ) , ix1_width );
-    hal_remote_s32( XPTR( rt_cxy , &rt_ptr->ix2_width ) , ix2_width );
-    hal_remote_s32( XPTR( rt_cxy , &rt_ptr->ix3_width ) , ix3_width );
-
-    // allocates first level array
-	uint32_t order = ix1_width + ( (sizeof(void*) == 4) ? 2 : 3 );
-	root = kmem_remote_alloc( rt_cxy , order , AF_ZERO );
-
-	if( root == NULL )
-    {
-        printk("\n[ERROR] in %s : cannot allocate first level array\n", __FUNCTION__);
-        return -1;
-    }
-  
-    // register first level array in rt descriptor
-    hal_remote_spt( XPTR( rt_cxy , &rt_ptr->root ) , root );
- 
-	return 0;
-
-}  // end grdxt_remote_init()
-
-//////////////////////////////////////////
-void grdxt_remote_destroy( xptr_t  rt_xp )
-{
-
-assert( __FUNCTION__, (rt_xp != XPTR_NULL),
-"extended pointer on radix tree is NULL\n" );
-
-    uint32_t   order;
-
-    uint32_t   w1;
-    uint32_t   w2;
-    uint32_t   w3;
-
-	uint32_t   ix1;
-	uint32_t   ix2;
-	uint32_t   ix3;
-
-    void    ** ptr1;
-    void    ** ptr2;
-    void    ** ptr3;
-
-    // get cluster and local pointer
-    cxy_t     rt_cxy = GET_CXY( rt_xp );
-    grdxt_t * rt_ptr = GET_PTR( rt_xp );
-
-    // get widths
-    w1 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix1_width ) );
-    w2 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix2_width ) );
-    w3 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix3_width ) );
-
-    // get ptr1
-    ptr1 = hal_remote_lpt( XPTR( rt_cxy , &rt_ptr->root ) );
-
-	for( ix1=0 ; ix1 < (uint32_t)(1 << w1) ; ix1++ )
-	{
-        // get ptr2
-        ptr2 = hal_remote_lpt( XPTR( rt_cxy , &ptr1[ix1] ) );
-
-		if( ptr2 == NULL ) continue;
-
-        for( ix2=0 ; ix2 < (uint32_t)(1 << w2) ; ix2++ )
-        {
-            // get ptr3
-            ptr3 = hal_remote_lpt( XPTR( rt_cxy , &ptr2[ix2] ) );
-
-		    if( ptr3 == NULL ) continue;
-
-            for( ix3=0 ; ix3 < (uint32_t)(1 << w3) ; ix3++ )
-            {
-                 if( ptr3[ix3] != NULL )
-                 {
-                     printk("\n[WARNING] in %s : ptr3[%d][%d][%d] non empty\n",
-                     __FUNCTION__, ix1, ix2, ix3 );
-                 }
-            }
-
-            // release level 3 array 
-		    order = w3 + ((sizeof(void*) == 4) ? 2 : 3 );
-		    kmem_remote_free( rt_cxy , ptr3 , order );
-        }
-
-        // release level 2 array
-        order = w2 + ((sizeof(void*) == 4) ? 2 : 3 );
-        kmem_remote_free( rt_cxy , ptr2 , order );
-    }
-
-    // release level 1 array
-    order = w1 + ((sizeof(void*) == 4) ? 2 : 3 );
-    kmem_remote_free( rt_cxy , ptr1 , order );
-
-}  // end grdxt_remote_destroy()
-
-//////////////////////////////////////////////
-error_t grdxt_remote_insert( xptr_t     rt_xp,
-                             uint32_t   key,
-                             void     * value )
-{
-    uint32_t order;
-
-    // get cluster and local pointer on remote rt descriptor
-	cxy_t     rt_cxy = GET_CXY( rt_xp );
-    grdxt_t * rt_ptr = GET_PTR( rt_xp );
-
-#if DEBUG_GRDXT_INSERT
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] enter / rt_xp (%x,%x) / key %x / value %x\n",
-__FUNCTION__, rt_cxy, rt_ptr, key, (intptr_t)value ); 
-#endif
-
-    // get widths
-    uint32_t        w1 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix1_width ) );
-    uint32_t        w2 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix2_width ) );
-    uint32_t        w3 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix3_width ) );
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] get widths : w1 %d / w2 %d / w3 %d\n",
-__FUNCTION__, w1, w2, w3 ); 
-#endif
-
-// Check key value
-assert( __FUNCTION__, ((key >> (w1 + w2 + w3)) == 0 ), "illegal key value %x\n", key );
-
-    // compute indexes
-    uint32_t        ix1 = key >> (w2 + w3);              // index in level 1 array
-	uint32_t        ix2 = (key >> w3) & ((1 << w2) -1);  // index in level 2 array
-	uint32_t        ix3 = key & ((1 << w3) - 1);         // index in level 3 array
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] compute indexes : ix1 %d / ix2 %d / ix3 %d\n",
-__FUNCTION__, ix1, ix2, ix3 ); 
-#endif
-
-    // get ptr1
-    void ** ptr1 = hal_remote_lpt( XPTR( rt_cxy , &rt_ptr->root ) );
-
-    if( ptr1 == NULL ) return -1;
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] compute ptr1 = %x\n",
-__FUNCTION__, (intptr_t)ptr1 ); 
-#endif
-
-    // get ptr2
-    void ** ptr2 = hal_remote_lpt( XPTR( rt_cxy , &ptr1[ix1] ) );
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] get current ptr2 = %x\n",
-__FUNCTION__, (intptr_t)ptr2 ); 
-#endif
-
-    // allocate memory for the missing level_2 array if required
-    if( ptr2 == NULL )
-    {
-        // allocate memory in remote cluster 
-        order = w2 + ((sizeof(void*) == 4) ? 2 : 3 );
-        ptr2 = kmem_remote_alloc( rt_cxy , order , AF_ZERO );
-
-        if( ptr2 == NULL ) return -1;
-        
-        // update level_1 entry
-        hal_remote_spt( XPTR( rt_cxy , &ptr1[ix1] ) , ptr2 );
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] update ptr1[%d] : &ptr1[%d] = %x / ptr2 = %x\n",
-__FUNCTION__, ix1, ix1, &ptr1[ix1], ptr2 );
-#endif
-
-    }
-
-    // get ptr3
-    void ** ptr3 = hal_remote_lpt( XPTR( rt_cxy , &ptr2[ix2] ) );
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] get current ptr3 = %x\n",
-__FUNCTION__, (intptr_t)ptr3 ); 
-#endif
-
-    // allocate memory for the missing level_3 array if required
-    if( ptr3 == NULL )
-    {
-        // allocate memory in remote cluster
-        order = w3 + ((sizeof(void*) == 4) ? 2 : 3 );
-        ptr3 = kmem_remote_alloc( rt_cxy , order , AF_ZERO );
-
-        if( ptr3 == NULL ) return -1;
-
-        // update level_2 entry
-        hal_remote_spt( XPTR( rt_cxy , &ptr2[ix2] ) , ptr3 );
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] update  ptr2[%d] : &ptr2[%d] %x / ptr3 %x\n",
-__FUNCTION__, ix2, ix2, &ptr2[ix2], ptr3 );
-#endif
-
-    }
-
-    // register value in level_3 array
-    hal_remote_spt( XPTR( rt_cxy , &ptr3[ix3] ) , value );
-
-#if DEBUG_GRDXT_INSERT
-if(DEBUG_GRDXT_INSERT < cycle)
-printk("\n[%s] update  ptr3[%d] : &ptr3[%d] %x / value %x\n",
-__FUNCTION__, ix3, ix3, &ptr3[ix3], value );
-#endif
-
-    hal_fence();
-
-	return 0;
-
-}  // end grdxt_remote_insert()
-
-////////////////////////////////////////////
-xptr_t grdxt_remote_remove( xptr_t    rt_xp,
-                            uint32_t  key )
-{
-    // get cluster and local pointer on remote rt descriptor
-	cxy_t     rt_cxy = GET_CXY( rt_xp );
-    grdxt_t * rt_ptr = GET_PTR( rt_xp );
-
-    // get widths
-    uint32_t        w1 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix1_width ) );
-    uint32_t        w2 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix2_width ) );
-    uint32_t        w3 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix3_width ) );
-
-// Check key value
-assert( __FUNCTION__, ((key >> (w1 + w2 + w3)) == 0 ), "illegal key value %x\n", key );
-
-    // compute indexes
-    uint32_t        ix1 = key >> (w2 + w3);              // index in level 1 array
-	uint32_t        ix2 = (key >> w3) & ((1 << w2) -1);  // index in level 2 array
-	uint32_t        ix3 = key & ((1 << w3) - 1);         // index in level 3 array
-
-    // get ptr1
-    void ** ptr1 = hal_remote_lpt( XPTR( rt_cxy , &rt_ptr->root ) );
-
-    // get ptr2
-	void ** ptr2 = hal_remote_lpt( XPTR( rt_cxy , &ptr1[ix1] ) );
-	if( ptr2 == NULL ) return XPTR_NULL;
-
-    // get ptr3
-	void ** ptr3 = hal_remote_lpt( XPTR( rt_cxy , &ptr2[ix2] ) );
-	if( ptr3 == NULL ) return XPTR_NULL;
-
-    // get value
-	void * value = hal_remote_lpt( XPTR( rt_cxy , &ptr3[ix3] ) );
-
-    // reset selected slot
-	hal_remote_spt( XPTR( rt_cxy, &ptr3[ix3] ) , NULL );
-	hal_fence();
-
-	return XPTR( rt_cxy , value );
-
-}  // end grdxt_remote_remove()
-
-////////////////////////////////////////////
-xptr_t grdxt_remote_lookup( xptr_t    rt_xp,
-                            uint32_t  key )
-{
-    // get cluster and local pointer on remote rt descriptor
-    grdxt_t       * rt_ptr = GET_PTR( rt_xp );
-    cxy_t           rt_cxy = GET_CXY( rt_xp );
-
-    // get widths
-    uint32_t        w1 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix1_width ) );
-    uint32_t        w2 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix2_width ) );
-    uint32_t        w3 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix3_width ) );
-
-// Check key value
-assert( __FUNCTION__, ((key >> (w1 + w2 + w3)) == 0 ), "illegal key value %x\n", key );
-
-    // compute indexes
-    uint32_t       ix1 = key >> (w2 + w3);              // index in level 1 array
-	uint32_t       ix2 = (key >> w3) & ((1 << w2) -1);  // index in level 2 array
-	uint32_t       ix3 = key & ((1 << w3) - 1);         // index in level 3 array
-
-    // get ptr1
-    void ** ptr1 = hal_remote_lpt( XPTR( rt_cxy , &rt_ptr->root ) );
-
-    // get ptr2
-	void ** ptr2 = hal_remote_lpt( XPTR( rt_cxy , &ptr1[ix1] ) );
-	if( ptr2 == NULL ) return XPTR_NULL;
-
-    // get ptr3
-	void ** ptr3 = hal_remote_lpt( XPTR( rt_cxy , &ptr2[ix2] ) );
-	if( ptr3 == NULL ) return XPTR_NULL;
-
-    // get pointer on registered item
-    void  * item_ptr = hal_remote_lpt( XPTR( rt_cxy , &ptr3[ix3] ) );
-
-    // return extended pointer on registered item 
-    if ( item_ptr == NULL )  return XPTR_NULL;
-	else                     return XPTR( rt_cxy , item_ptr );
-
-}  // end grdxt_remote_lookup()
-
-////////////////////////////////////////////////
-xptr_t grdxt_remote_get_first( xptr_t     rt_xp,
-                               uint32_t   start_key,
-                               uint32_t * found_key )
-{
-    uint32_t        ix1;
-    uint32_t        ix2;
-    uint32_t        ix3;
-
-    void        ** ptr1;       // local base address of remote first level array
-    void        ** ptr2;       // local base address of remote second level array
-    void        ** ptr3;       // local base address of remote third level array
-
-    // get cluster and local pointer on remote rt descriptor
-    grdxt_t       * rt_ptr = GET_PTR( rt_xp );
-    cxy_t           rt_cxy = GET_CXY( rt_xp );
-
-    // get widths
-    uint32_t        w1 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix1_width ) );
-    uint32_t        w2 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix2_width ) );
-    uint32_t        w3 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix3_width ) );
-
-// Check key value
-assert( __FUNCTION__, ((start_key >> (w1 + w2 + w3)) == 0 ), "illegal key value %x\n", start_key );
-
-    // compute min indexes
-    uint32_t       min1 = start_key >> (w2 + w3);            
-	uint32_t       min2 = (start_key >> w3) & ((1 << w2) -1);
-	uint32_t       min3 = start_key & ((1 << w3) - 1);  
-
-    // compute max indexes
-    uint32_t       max1 = 1 << w1;
-    uint32_t       max2 = 1 << w2;
-    uint32_t       max3 = 1 << w3;
-
-    // get ptr1
-    ptr1 = hal_remote_lpt( XPTR( rt_cxy , &rt_ptr->root ) );
-
-    for( ix1 = min1 ; ix1 < max1 ; ix1++ )
-    {
-        ptr2 = hal_remote_lpt( XPTR( rt_cxy , &ptr1[ix1] ) );
-        if( ptr2 == NULL ) continue;
-
-        for( ix2 = min2 ; ix2 < max2 ; ix2++ )
-        {
-            ptr3 = hal_remote_lpt( XPTR( rt_cxy , &ptr2[ix2] ) );
-            if( ptr3 == NULL ) continue;
-
-            for( ix3 = min3 ; ix3 < max3 ; ix3++ )
-            {
-                void * item = hal_remote_lpt( XPTR( rt_cxy , &ptr3[ix3] ) );
-
-                if( item == NULL ) continue;
-                else                    
-                {
-                    *found_key = (ix1 << (w2+w3)) | (ix2 << w3) | ix3;
-                    return XPTR( rt_cxy , item );
-                }
-            }
-        }
-    }
-
-    return XPTR_NULL;
-
-}  // end grdxt_remote_get_first()
-
-/////////////////////////i/////////////////
-void grdxt_remote_display( xptr_t    rt_xp,
-                           char    * name )
-{
-	uint32_t       ix1;  
-	uint32_t       ix2;
-	uint32_t       ix3;
-
-    void        ** ptr1;
-    void        ** ptr2;
-    void        ** ptr3;
-
-// check rt_xp
-assert( __FUNCTION__, (rt_xp != XPTR_NULL) , "pointer on radix tree is NULL\n" );
-
-    // get cluster and local pointer on remote rt descriptor
-    grdxt_t      * rt_ptr = GET_PTR( rt_xp );
-    cxy_t          rt_cxy = GET_CXY( rt_xp );
-
-    // get widths
-    uint32_t       w1 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix1_width ) );
-    uint32_t       w2 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix2_width ) );
-    uint32_t       w3 = hal_remote_l32( XPTR( rt_cxy , &rt_ptr->ix3_width ) );
-
-    ptr1 = hal_remote_lpt( XPTR( rt_cxy , &rt_ptr->root ) );
-
-	printk("\n***** Generic Radix Tree for <%s>\n", name );
-
-	for( ix1=0 ; ix1 < (uint32_t)(1<<w1) ; ix1++ )
-	{
-	    ptr2 = hal_remote_lpt( XPTR( rt_cxy , &ptr1[ix1] ) );
-        if( ptr2 == NULL )  continue;
-    
-        for( ix2=0 ; ix2 < (uint32_t)(1<<w2) ; ix2++ )
-        {
-	        ptr3 = hal_remote_lpt( XPTR( rt_cxy , &ptr2[ix2] ) );
-            if( ptr3 == NULL ) continue;
-
-            for( ix3=0 ; ix3 < (uint32_t)(1<<w3) ; ix3++ )
-            {
-                void * value = hal_remote_lpt( XPTR( rt_cxy , &ptr3[ix3] ) );
-                if( value == NULL )  continue;
-
-                uint32_t key = (ix1<<(w2+w3)) + (ix2<<w3) + ix3;
-                printk(" - key = %x / value = %x / ptr1 = %x / ptr2 = %x / ptr3 = %x\n",
-                key, (intptr_t)value, (intptr_t)ptr1, (intptr_t)ptr2, (intptr_t)ptr3 );
-            }
-        }
-	}
-
-} // end grdxt_remote_display()
-
-
+}
Index: trunk/kernel/libk/grdxt.h
===================================================================
--- trunk/kernel/libk/grdxt.h	(revision 690)
+++ trunk/kernel/libk/grdxt.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * grdxt.h - Three-levels Generic Radix-tree definition.
+ * grdxt.h - Three-levels Generic Radix-tree interface
  * 
- * Authors  Alain Greiner (2016,2017,2018,2019,2019,2020)
+ * Authors  Alain Greiner (2016)
  *
  * Copyright  UPMC Sorbonne Universites
@@ -25,5 +25,5 @@
 #define _GRDXT_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 
 /*******************************************************************************************
@@ -36,12 +36,6 @@
  * Memory for the second and third levels arrays is dynamically allocated by the
  * grdxt_insert() function and is only released by grdxt_destroy().
- * This structure is entirely contained in one single cluster, but to allow any thread
- * to access it, two sets of access functions are defined:
- * - local threads can use access function using local pointers.
- * - remote threads must use the access functions using extended pointers.
- ******************************************************************************************
- * When it is used by the mapper implementing the file cache:
- * - the key is the page index in file.
- * - the registered value is a local pointer on the page descriptor.
+ * - It used to by the VMM to retrieve a vseg descriptor: key is the virtual address.
+ * - It is used by the mapper to implement the file cache: key is the page index in file.
  ******************************************************************************************/
 
@@ -55,12 +49,8 @@
 grdxt_t;
 
-////////////////////////////////////////////////////////////////////////////////////////////
-//                       Local access functions
-////////////////////////////////////////////////////////////////////////////////////////////
 
 /*******************************************************************************************
  * This function initialises the radix-tree descriptor,
  * and allocates memory for the first level array of pointers.
- * It must be called by a local thread.
  *******************************************************************************************
  * @ rt        : pointer on the radix-tree descriptor.
@@ -77,6 +67,5 @@
 /*******************************************************************************************
  * This function releases all memory allocated to the radix-tree infrastructure.
- * A warning message is printed on the kernel TXT0 if the radix tree is not empty.
- * It must be called by a local thread.
+ * The radix-tree is supposed to be empty, but this is NOT checked by this function.
  *******************************************************************************************
  * @ rt      : pointer on the radix-tree descriptor.
@@ -87,10 +76,9 @@
  * This function insert a new item in the radix-tree.
  * It dynamically allocates memory for new second and third level arrays if required.
- * It must be called by a local thread.
  *******************************************************************************************
  * @ rt      : pointer on the radix-tree descriptor.
  * @ key     : key value.
  * @ value   : pointer on item to be registered in radix-tree.
- * @ returns 0 if success / returns -1 if no memory, or illegal key.
+ * @ returns 0 if success / returns ENOMEM if no memory, or EINVAL if illegal key.
  ******************************************************************************************/
 error_t grdxt_insert( grdxt_t  * rt,
@@ -99,7 +87,6 @@
 
 /*******************************************************************************************
- * This function removes an item identified by its key from the radix tree,
- * and returns a pointer on the removed item. No memory is released.
- * It must be called by a local thread.
+ * This function removes an item identified by its key, and returns a pointer
+ * on the removed item. No memory is released.
  *******************************************************************************************
  * @ rt      : pointer on the radix-tree descriptor.
@@ -111,11 +98,9 @@
 
 /*******************************************************************************************
- * This function returns to a local client, a local pointer on the item identified 
- * It must be called by a local thread.
- * by the <key> argument, from the radix tree identified by the <rt> local pointer.
+ * This function returns the pointer on the item identified by its key.
  *******************************************************************************************
- * @ rt      : local pointer on the radix-tree descriptor.
+ * @ rt      : pointer on the radix-tree descriptor.
  * @ key     : key value.
- * @ returns a local pointer on found item if success / returns NULL if failure.
+ * @ returns pointer on found item if success / returns NULL if failure.
  ******************************************************************************************/
 void * grdxt_lookup( grdxt_t  * rt, 
@@ -124,12 +109,11 @@
 /*******************************************************************************************
  * This function scan all radix-tree entries in increasing key order, starting from
- * the key defined by the <start_key> argument. It returns a pointer on the first valid
- * registered item, and returns in the <found_key> buffer the found item key value.
- * It must be called by a local thread.
+ * the value defined by the <key> argument, and return a pointer on the first valid
+ * registered item, and the found item key value.
  *******************************************************************************************
  * @ rt         : pointer on the radix-tree descriptor.
  * @ start_key  : key starting value for the scan.
  * @ found_key  : [out] buffer for found key value.
- * @ return pointer on first valid item if found / return NULL if no item found.
+ * return pointer on first valid item if found / return NULL if not found.
  ******************************************************************************************/
 void * grdxt_get_first( grdxt_t  * rt,
@@ -137,97 +121,13 @@
                         uint32_t * found_key );
 
-////////////////////////////////////////////////////////////////////////////////////////////
-//                       Remote access functions
-////////////////////////////////////////////////////////////////////////////////////////////
+/*******************************************************************************************
+ * This function displays the content of the radix_tree.
+ *******************************************************************************************
+ * @ rt      : pointer on the radix-tree descriptor.
+ * @ name    : string identifying the radix-tree.
+ ******************************************************************************************/
+void grdxt_print( grdxt_t * rt,
+                  char    * name );
 
-/*******************************************************************************************
- * This function initialises the radix-tree descriptor,
- * and allocates memory for the first level array of pointers.
- * It can be called by any thread running in any cluster
- *******************************************************************************************
- * @ rt_xp     : extended pointer on the radix-tree descriptor.
- * @ ix1_width : number of bits in ix1 field
- * @ ix2_width : number of bits in ix2 field
- * @ ix3_width : number of bits in ix3 field
- * @ returns 0 if success / returns ENOMEM if no more memory.      
- ******************************************************************************************/
-error_t grdxt_remote_init( xptr_t     rt_xp,
-                           uint32_t   ix1_width,
-                           uint32_t   ix2_width,
-                           uint32_t   ix3_width );
-
-/*******************************************************************************************
- * This function releases all memory allocated to the radix-tree infrastructure.
- * A warning message is printed on the kernel TXT0 if the radix tree is not empty.
- * It can be called by any thread running in any cluster
- *******************************************************************************************
- * @ rt_xp    : extended pointer on the radix-tree descriptor.
- ******************************************************************************************/
-void grdxt_remote_destroy( xptr_t  rt_xp );
-
-/*******************************************************************************************
- * This function insert a new item in a - possibly remote - radix tree.
- * It dynamically allocates memory for new second and third level arrays if required.
- * It can be called by any thread running in any cluster
- *******************************************************************************************
- * @ rt_xp   : extended pointer on the radix-tree descriptor.
- * @ key     : key value.
- * @ value   : pointer on item to be registered in radix-tree.
- * @ returns 0 if success / returns -1 if no memory, or illegal key.
- ******************************************************************************************/
-error_t grdxt_remote_insert( xptr_t     rt_xp,
-                             uint32_t   key,
-                             void     * value );
-
-/*******************************************************************************************
- * This function removes an item identified by its key from a - possibly remote - radix
- * tree, and returns a local pointer on the removed item. No memory is released.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt_xp   : pointer on the radix-tree descriptor.
- * @ key     : key value.
- * @ returns extended pointer on removed item if success / returns XPTR_NULL if failure.
- ******************************************************************************************/
-xptr_t grdxt_remote_remove( xptr_t    rt_xp,
-                            uint32_t  key );
-
-/*******************************************************************************************
- * This function returns to a - possibly remote - client, an extended pointer
- * on the item identified by the <key> argument, from the radix tree identified by
- * the <rt_xp> remote pointer.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt_xp   : extended pointer on the radix-tree descriptor.
- * @ key     : key value.
- * @ returns extended pointer on found item if success / returns XPTR_NULL if not found.
- ******************************************************************************************/
-xptr_t grdxt_remote_lookup( xptr_t     rt_xp, 
-                            uint32_t   key );
-
-/*******************************************************************************************
- * This function scan all radix-tree entries of a - possibly remote - radix tree <rt_xp>,
- * in increasing key order, starting from the key defined by the <start_key> argument.
- * It returns an extended pointer on the first valid registered item, and returns in the
- * <found_key> buffer the found item key value.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt_xp      : extended pointer on the radix-tree descriptor.
- * @ start_key  : key starting value for the scan.
- * @ found_key  : [out] buffer for found key value.
- * @ return xptr on first valid item if found / return XPTR_NULL if no item found.
- ******************************************************************************************/
-xptr_t grdxt_remote_get_first( xptr_t     rt_xp,
-                               uint32_t   start_key,
-                               uint32_t * found_key );
-
-/*******************************************************************************************
- * This function displays the current content of a possibly remote radix_tree.
- * It can be called by a thread running in any cluster
- *******************************************************************************************
- * @ rt      : extended pointer on the radix-tree descriptor.
- * @ string  : radix tree identifier. 
- ******************************************************************************************/
-void grdxt_remote_display( xptr_t    rt_xp,
-                           char    * string );
 
 #endif	/* _GRDXT_H_ */
Index: trunk/kernel/libk/htab.c
===================================================================
--- trunk/kernel/libk/htab.c	(revision 690)
+++ trunk/kernel/libk/htab.c	(revision 1)
@@ -2,5 +2,7 @@
  * htable.c - Generic, embedded hash table implementation.
  * 
- * Author      Alain Greiner (2016,2017)
+ * Author     Ghassan Almalles (2008,2009,2010,2011,2012)
+ *            Mohamed Lamine Karaoui (2015)
+ *            Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -8,9 +10,9 @@
  * This file is part of ALMOS-MKH.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,191 +20,115 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <htab.h>
-#include <busylock.h>
-#include <list.h>
-#include <printk.h>
-#include <vfs.h>
+#include <htable.h>
+#include <kmem.h>
+#include <ppm.h>
 
+///////////////////////////////////////////////
+error_t ht_header_init( ht_header_t  * header,
+                        ht_hash_t    * hash,
+                        ht_compare_t * compare )
+{
+	uint32_t     i;
+	kmem_req_t   req;
+	page_t     * page;
 
-///////////////////////////////////////////////////////////////////////////////////////////
-//    Item type specific (static) functions (two functions for each item type).
-// Example below if for <bloup_t> type, where the identifier is an uint32_t field. 
-///////////////////////////////////////////////////////////////////////////////////////////
+	req.type  = KMEM_PAGE;
+	req.size  = 0;
+	req.flags = AF_ZERO;
+	page      = kmem_alloc( &req );
+	
+	if( page == NULL ) return ENOMEM;
 
-typedef struct bloup_s
-{
-    uint32_t       key;
-    list_entry_t   list;
-}
-bloup_t;
+	header->nb_buckets = CONFIG_PPM_PAGE_SIZE/sizeof( list_entry_t );
+	header->buckets    = ppm_page2base( page );
+	header->hash       = hash;
+	header->compare    = compare;
 
-///////////////////////////////////////////////////////////////////////////////////////////
-// This static function computes the hash index from the key.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ key      : local pointer on key.
-// @ return the index value, from 0 to (HASHTAB_SIZE - 1)
-///////////////////////////////////////////////////////////////////////////////////////////
-static uint32_t htab_bloup_index( void * key )
-{
-	return (*(uint32_t *)key) % HASHTAB_SIZE;
+	for( i=0 ; i < header->nb_buckets ; i++ )
+	{
+		list_root_init( &header->buckets[i] );
+	}
+
+	return 0;
 }
 
-///////////////////////////////////////////////////////////////////////////////////////
-// This static function is used by htab_lookup(), htab_insert(), and htab_remove().
-// They scan one sub-list identified by  <index> to find an item  identified by <key>.
-// The sub-list is not modified, but the lock must have been taken by the caller.
-///////////////////////////////////////////////////////////////////////////////////////
-// @ htab    : pointer on hash table.
-// @ index   : index of sub-list to be scanned.
-// @ key     : pointer on item identifier.
-// @ return pointer on item if found / return NULL if not found.
-///////////////////////////////////////////////////////////////////////////////////////
-static void * htab_bloup_scan( htab_t  * htab,
-                               uint32_t  index,
-                               void    * key )
+////////////////////////////////////////
+error_t ht_node_init( ht_node_t * node )
 {
-    list_entry_t * list_entry;   // pointer on list_entry_t (iterator)
-    bloup_t      * bloup;        // pointer on item
-    
-	LIST_FOREACH( &htab->roots[index] , list_entry )
+	node->index = (uint32_t) -1;
+	list_entry_init( &node->list );
+
+	return 0;
+}
+
+/////////////////////////////////////////////////
+static ht_node_t * __hfind( ht_header_t * header,
+                            uint32_t      index,
+                            void        * key)
+{
+	ht_node_t    * node;
+	list_entry_t * root,
+    list_entry_t * iter;
+
+	root = &header->buckets[index % header->nb_buckets];
+
+	LIST_FOREACH( root , iter )
 	{
-        bloup = (bloup_t *)LIST_ELEMENT( list_entry , bloup_t , list );
-        if( bloup->key == *(uint32_t *)key ) return bloup; 
-    }
+		node = LIST_ELEMENT( iter , ht_node_t , list );
+		if( node->index == index )
+		{
+			if( header->compare( node , key ) ) return node;
+		}
+	}
 
-    // no matching item found
 	return NULL;
 }
 
-////////////////////////////////////////////////////////////////////////////////////////
-//         Generic access functions
-////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////
+ht_node_t * ht_find( ht_header_t * header,
+                     void        * key )
+{
+	uint32_t index = header->hash( key );
+
+	return __ht_find( header , index , key );
+}
 
 ////////////////////////////////////////
-void htab_init( htab_t           * htab,
-                htab_item_type_t   type )
+error_t ht_insert( ht_header_t * header,
+                   ht_node_t   * node,
+                   void        * key )
 {
-	uint32_t     i;
+	uint32_t index = header->hash( key );
 
-    // initialize readlock
-    busylock_init( &htab->lock , LOCK_HTAB_STATE );
+	ht_node_t * node = __ht_find( header , index , key );
 
-    htab->items = 0;
+	if( node != NULL ) return EINVAL;
 
-    if( type == HTAB_BLOUP_TYPE )
-    {
-        htab->scan    = &htab_bloup_scan;
-        htab->index   = &htab_bloup_index;
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "undefined item type\n" );
-    }
+	list_entry_t * root = &header->buckets[index % header->nb_buckets];
 
-    // initialize partial lists
-    for( i = 0 ; i < HASHTAB_SIZE ; i++ )
-    {
-        list_root_init( &htab->roots[i] );
-    }
+	list_add_first( root , &node->list);
+
+	node->index = index;
+
+	return 0;
 }
 
-/////////////////////////////////////////
-error_t htab_insert( htab_t       * htab, 
-                     void         * key,
-                     list_entry_t * list_entry )
+////////////////////////////////////////
+error_t ht_remove( ht_header_t * header,
+                   void        * key )
 {
-    // compute index from key
-    uint32_t index = htab->index( key );
+	uint32_t index = header->hash( key );
 
-    // take the lock 
-    busylock_acquire( &htab->lock );
+	ht_node_t * node = __ht_find( header , index , key );
 
-    // scan sub-list to check if item exist
-    void * item = htab->scan( htab , index , key );
+	if( node == NULL ) return EINVAL;
 
-    if( item != NULL ) // item exist => return error
-    {
-        // release lock
-        busylock_release( &htab->lock );
+	list_unlink( &node->list );
 
-        return 0xFFFFFFFF;
-    }
-    else               // item doesn't exist => register
-    {
-        // register item in hash table
-        list_add_last( &htab->roots[index] , list_entry );
-
-        // update items number
-        htab->items++;
-
-        // release lock
-        busylock_release( &htab->lock );
-
-        return 0;
-    }
+	return 0;
 }
 
-/////////////////////////////////////////
-error_t htab_remove( htab_t       * htab, 
-                     void         * key,
-                     list_entry_t * list_entry )
-{
-    // compute index from key
-    uint32_t index = htab->index( key );
-
-    // take the lock 
-    busylock_acquire( &htab->lock );
-
-    // scan sub-list to chek if item exist
-    void * item = htab->scan( htab , index , key );
-
-    if( item == NULL ) // item doesn't exist
-    {
-        // release lock
-        busylock_release( &htab->lock );
-
-        return 0xFFFFFFFF;
-    }
-    else               // item exist => remove it 
-    {
-        // remove item from hash table
-        list_unlink( list_entry );
-
-        // update items number
-        htab->items--;
-
-        // release lock
-        busylock_release( &htab->lock );
-
-        return 0;
-    }
-}
-
-//////////////////////////////////
-void * htab_lookup( htab_t * htab, 
-                    void   * key )
-{
-    // compute index from key
-    uint32_t index = htab->index( key );
-
-    // take the lock
-    busylock_acquire( &htab->lock );
-
-    // scan sub-list
-    void * item = htab->scan( htab , index , key );
-
-    // release lock 
-    busylock_release( &htab->lock );
-
-	return item;
-}
-
-
-
Index: trunk/kernel/libk/htab.h
===================================================================
--- trunk/kernel/libk/htab.h	(revision 690)
+++ trunk/kernel/libk/htab.h	(revision 1)
@@ -2,5 +2,7 @@
  * htab.h - Generic embedded hash table definition.
  * 
- * Authors  Alain Greiner (2016,2017,2018)
+ * Author     Ghassan Almalles (2008,2009,2010,2011,2012)
+ *            Mohamed Lamine Karaoui (2015)
+ *            Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,98 +28,89 @@
 #define _HTAB_H_
 
-#include <hal_kernel_types.h>
-#include <rwlock.h>
+#include <hal_types.h>
 #include <list.h>
 
-/////////////////////////////////////////////////////////////////////////////////////////
-// This file define a generic, embedded, local hash table.
-//
-// It can only be accessed by threads running in the local cluster.
-// It is generic as it can be used to register various types of items.
-// The main goal is to provide fast retrieval for a large number of items of same type.
-// For this purpose the set of all registered items is split in several subsets. 
-// Each subset is organised as a double linked lists.
-// - an item is uniquely identified by a <key>, that can be a single uint32_t, 
-//   a character string, or a more complex structure.
-// - From the pointer on <key>, we use an item type specific htab_index() function,
-//   to compute an <index> value, defining a subset of registered items.
-// - As several items can have the same <index>, we use the item type specific 
-//   htab_scan() function for a final associative search on the subset.
-// - Each registered item is a structure, that must contain an embedded list_entry_t,
-//   that is part of a rooted double linked list.
-//
-// Implementation Note: for each supported item type ***, you must define the two
-//                      htab_***_index() and htab_***_scan() functions, and
-//                      update the htab_init() function.
-/////////////////////////////////////////////////////////////////////////////////////////
-
-#define HASHTAB_SIZE    64   // number of subsets
+/****************************************************************************************
+ * This file define a generic, embedded, hash table.
+ * The main goal is to provide fast retrieval for a large number of items of same type
+ * in a given cluster. For this purpose the set of all registered items is split
+ * in several subsets. Each subset is organised as a double linked lists.
+ * - an item is uniquely identified by a <key>, that can be a single uint32_t, 
+ *   a character string, or a more complex structure.
+ * - From the pointer on the <key>, the hash table uses an user defined ht_hash() 
+ *   function, to compute an <index> value, defining a subset of registered
+ *   items, to restrict the associative search.
+ * - As several items can have the same <index>, the hash table uses the user defined
+ *   ht_compare() function for a final associative search on the subset.
+ * - Each registered item is a structure, that must contain an embedded ht_node_t,
+ *   This ht_node_t is part of a rooted double linked list, and contains the <index>.
+ * - Finally, the hash table returns a pointer on the embedded ht_node_t, and the
+ *   pointer on the searched item can be obtained by a simple offset.
+ ***************************************************************************************/
 
 /****************************************************************************************
- * These typedef define the two item type specific function prototypes.
+ * This define the generic, user defined, function types.
  ***************************************************************************************/
 
-struct htab_s;
+struct ht_node_s;
 
-typedef void *     htab_scan_t( struct htab_s * htab , uint32_t index , void * key );
-
-typedef uint32_t   htab_index_t( void * key );
+typedef bool_t     ht_compare_t( struct ht_node_s * node , void * key );
+typedef uint32_t   ht_hash_t( void * key );
 
 /****************************************************************************************
- * This define the supported item types.
+ * This structure defines the hash table header.
  ***************************************************************************************/
 
-typedef enum
+typedef struct ht_header_s
 {
-    HTAB_BLOUP_TYPE = 1,                     /*! item is a bloup_t                     */
+	uint32_t        nb_buckets;   /*! number of subsets (one linked list per subset)   */
+	ht_hash_t     * hash;         /*! user defined hash function                       */ 
+	ht_compare_t  * compare;      /*! user defined compare function                    */
+	list_entry_t  * buckets;      /*! array of root of partial lists of ht_node_t      */
 }
-htab_item_type_t;
+ht_header_t;
 
 /****************************************************************************************
- * This structure defines the the root of a local hash table.
+ * This structure defines one hash table node.
  ***************************************************************************************/
 
-typedef struct htab_s
+typedef struct ht_node_s
 {
-	list_entry_t      roots[HASHTAB_SIZE];  /*! array of roots of partial lists        */
-	htab_index_t    * index;                /*! item type  specific function           */
-	htab_scan_t     * scan;                 /*! item type specific function            */
-    uint32_t          items;                /*! number of registered items             */
-    busylock_t        lock;                 /*! lock protecting hash table accesses    */
+	uint32_t     index;           /*! integer value computed from the key              */
+	list_entry_t list;	          /*! member of list of all nodes in same bucket       */
 }
-htab_t;
+ht_node_t;
 
 /****************************************************************************************
- * This function initialises an empty hash table (zero registered item).
+ * This function initialises one hash table node.
  ****************************************************************************************
- * @ htab       : pointer on hash table.
- * @ type       : item type.
+ccccc
  ***************************************************************************************/
-void htab_init( htab_t           * htab,
-                htab_item_type_t   type );
+void ht_node_init( ht_node_t * node );
 
 /****************************************************************************************
- * This function register a new item in the hash table.
+ * This function allocates memory for the buckets array, and initializes the header.
+ * The number of buckets (number of subsets) is PAGE_SIZE / sizeof(list_entry_t)
  ****************************************************************************************
- * @ htab       : pointer on the hash table.
- * @ key        : pointer on the item identifier.
- * @ list_entry : pointer on list_entry_t embedded in item to be registered.
- * @ return 0 if success / return EINVAL if item already registered.
+ * @ header     : pointer on the hash table header.
+ * @ ht_hash    : pointer on the user defined hash function.
+ * @ ht_compare : pointer on the user defined compare function.
+ * @ return 0 if success / return ENOMEM if error.
  ***************************************************************************************/
-error_t htab_insert( htab_t       * htab,
-                     void         * key,
-                     list_entry_t * list_entry );
+error_t ht_header_init( ht_header_t  * header,
+                        ht_hash_t    * ht_hash,
+                        ht_compare_t * ht_compare );
 
 /****************************************************************************************
- * This function remove an item from the hash table.
+ * This function register a new node in the hash table.
  ****************************************************************************************
- * @ header     : pointer on the hash table.
+ * @ header     : pointer on the hash table header.
+ * @ node       : pointer on the node to be registered (embedded in item).
  * @ key        : pointer on the item identifier.
- * @ list_entry : pointer on list_entry_t embedded in item to be removed.
- * @ return 0 if success / return EINVAL if item not found.
+ * @ return 0 if success / return EINVAL if node already registered...
  ***************************************************************************************/
-error_t htab_remove( htab_t       * htab,
-                     void         * key,
-                     list_entry_t * list_entry );
+error_t ht_insert( ht_header_t * header,
+                   ht_node_t   * node,
+                   void        * key );
 
 /****************************************************************************************
@@ -125,11 +118,20 @@
  * identified by its key.
  ****************************************************************************************
- * @ htab      : pointer on the hash table.
- * @ key       : pointer on the item identifier.
- * @ return pointer on item if found / return NULL if not found.
+ * @ header     : pointer on the hash table header.
+ * @ key        : pointer on the item identifier.
+ * @ return pointer on node if found / return NULL if not found.
  ***************************************************************************************/
-void * htab_lookup( htab_t * htab,
-                    void   * key);
+ht_node_t * ht_find( ht_header_t * header,
+                     void        * key);
 
+/****************************************************************************************
+ * This function remove an item from the hash table.
+ ****************************************************************************************
+ * @ header     : pointer on the hash table header.
+ * @ key        : pointer on the item identifier.
+ * @ return 0 if success / return EINVAL if not found.
+ ***************************************************************************************/
+error_t ht_remove( ht_header_t * header,
+                   void        * key );
 
-#endif /* _HTAB_H_ */
+#endif /* _HTABLE_H_ */
Index: trunk/kernel/libk/iprintk.c
===================================================================
--- trunk/kernel/libk/iprintk.c	(revision 1)
+++ trunk/kernel/libk/iprintk.c	(revision 1)
@@ -0,0 +1,266 @@
+/*
+   This file is part of MutekP.
+
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+   UPMC / LIP6 / SOC (c) 2007
+   */
+
+/* 
+   revision 1.2.2 2011/07/12 11:08:34 Ghassan
+   - Split main loop into 3 noinline functions: compute_dec32, compute_dec64, compute_hex 
+   - Use bigger buffer size
+   - Reuse buffer treatment
+   - Add 64 bits support
+   - Add char count;
+
+   revision 1.2.1 2007/11/11 18:54:23 Ghassan
+   rename iprintf to __iprintk, it's a copy of iprintf called on system level.
+
+   stdio of the ghost of libc
+   Developped by Denis Hommais and Frédéric Pétrot
+   $Log: iprintf.c,v $
+   Revision 1.2  2003/07/01 13:40:46  fred
+   Supports the %u and doesnt core anymore on an unrecognized char
+   following a %
+
+   Revision 1.1.1.1  2002/02/28 12:58:56  disydent
+   Creation of Disydent CVS Tree
+
+   Revision 1.1  2001/11/22 15:07:36  fred
+   Adding the iprintf function that does the formatting, and removes all
+   the old stuff hanging around.
+
+   $Id: iprintf.c,v 1.2 2003/07/01 13:40:46 fred Exp $
+   Made up this file to centralize the printf behavior
+   */
+
+#include <remote_access.h>
+#include <stdarg.h>
+#include <types.h>
+#include <libk.h>
+
+/* Handling of the printf internals
+ * Addr is either the buffer or the tty addrs
+ * inc is 0 for a tty and 1 for a buffer
+ * Other arguments are self explanatory
+ */
+
+#define SIZE_OF_BUF 20
+
+char* __attribute__((noinline)) compute_dec64(char **addr,
+		uint_t cid,
+		char *buf,
+		uint_t *len,
+		int inc, 
+		uint64_t val, 
+		bool_t isSigned)
+{
+	register int64_t sval;
+	register uint32_t uval;
+	register char *tmp;
+	register uint_t count;
+	register uint_t i;
+
+	if(isSigned == true)
+	{
+		sval = val;
+		if(sval < 0)
+		{
+			sval = -sval;
+			val = sval;
+			remote_sb((void*)*addr, cid, '-');
+			*len = *len + 1;
+			(*addr) += inc;
+		}
+	}
+
+	count = 0;
+	i = 0;
+	tmp = buf + SIZE_OF_BUF;
+	*--tmp = '\0';
+
+	while(val >= 1000000000UL)
+	{
+		val -= 1000000000UL;
+		count ++;
+	}
+
+	uval = (uint32_t) val;
+
+	do
+	{
+		*--tmp = (uval % 10) + '0';
+		uval /= 10;
+		i++;
+	}while((uval) || (i < 9));
+
+	uval = count;
+
+	do
+	{
+		*--tmp = (uval % 10) + '0';
+		uval /= 10;
+	}while(uval);
+
+	return tmp;
+}
+
+static char* __attribute__((noinline)) compute_dec(char **addr,
+		uint_t cid,
+		char *buf,
+		uint_t *len,
+		int inc, 
+		uint_t val, 
+		bool_t isSigned)
+{
+	register sint_t sval;
+	register char *tmp;
+
+	if(isSigned == true)
+	{
+		sval = val;
+		if(sval < 0)
+		{
+			sval = -sval;
+			val = sval;
+			remote_sb(*addr, cid, '-');
+			*len = *len + 1;
+			(*addr) += inc;
+		}
+	}
+
+	tmp = buf + SIZE_OF_BUF;
+	*--tmp = '\0';
+
+	do
+	{
+		*--tmp = (val % 10) + '0';
+		val /= 10;
+	}while (val);
+
+	return tmp;
+}
+
+static char* __attribute__((noinline)) compute_hex(char **addr, 
+		uint_t cid,
+		char *buf, 
+		uint_t val, 
+		bool_t isPointer)
+{
+	register char *tmp;
+	register char *xdigit;
+	register uint_t i;
+
+	i = 0;
+	xdigit = "0123456789abcdef";
+	tmp = buf + SIZE_OF_BUF;
+	*--tmp = '\0';
+
+	do
+	{
+		*--tmp = xdigit[val & 15];
+		val = val >> 4;
+		i++;
+	}while (val);
+
+	if(isPointer)
+	{
+		while (i < 8)
+		{
+			*--tmp = xdigit[0];
+			i++;
+		}
+	}
+
+	return tmp;
+}
+
+int iprintk (char *addr, uint_t cid, int inc, const char *fmt, va_list ap)
+{
+	char *tmp;
+	sint_t val;
+	uint_t uval;
+	uint64_t val64;
+	uint_t count = 0;
+	char buf[SIZE_OF_BUF];
+
+	while (*fmt)
+	{
+		while ((*fmt != '%') && (*fmt))
+		{
+			remote_sb(addr, cid, *fmt++);
+			addr += inc;
+			count++;
+		}
+		if (*fmt)
+		{
+			fmt++;
+			switch (*fmt)
+			{
+				case '%':
+					remote_sb(addr, cid, '%');
+					addr += inc;
+					count++;
+					goto next;
+				case 'c':
+					remote_sb(addr, cid, va_arg (ap, uint_t));
+					addr += inc;
+					count++;
+					goto next;
+				case 'd':
+					val = va_arg (ap, sint_t);
+					tmp = compute_dec(&addr, cid, &buf[0], &count, inc, val, true); 
+					break;
+				case 'u':
+					uval = va_arg (ap, uint_t);
+					tmp = compute_dec(&addr, cid, &buf[0], &count, inc, uval, false); 
+					break;
+				case 'D':
+					val64 = va_arg (ap, int64_t);
+					tmp = compute_dec64(&addr, cid, &buf[0], &count, inc, val64, true); 
+					break;
+				case 'U':
+					val64 = va_arg (ap, uint64_t);
+					tmp = compute_dec64(&addr, cid, &buf[0], &count, inc, val64, false); 
+					break;
+				case 's':
+					tmp = va_arg (ap, char *);
+					if (!tmp)
+						tmp = "empty str";
+					break;
+				case 'p':
+				case 'x':
+					uval = va_arg (ap, uint_t);
+					tmp = compute_hex(&addr, cid, &buf[0], uval, (*fmt == 'p') ? true : false);
+					break;
+				default:
+					remote_sb(addr, cid, *fmt);
+					count++;
+					goto next;
+			}
+			while (*tmp)
+			{
+				remote_sb(addr, cid, *tmp++);
+				addr += inc;
+				count++;
+			}
+next:
+			fmt++;
+		}
+	}
+	va_end (ap);
+	return count;
+}
Index: trunk/kernel/libk/iprintk.c.bak
===================================================================
--- trunk/kernel/libk/iprintk.c.bak	(revision 1)
+++ trunk/kernel/libk/iprintk.c.bak	(revision 1)
@@ -0,0 +1,259 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2007
+*/
+
+/* 
+   revision 1.2.2 2011/07/12 11:08:34 Ghassan
+    - Split main loop into 3 noinline functions: compute_dec32, compute_dec64, compute_hex 
+    - Use bigger buffer size
+    - Reuse buffer treatment
+    - Add 64 bits support
+    - Add char count;
+    
+   revision 1.2.1 2007/11/11 18:54:23 Ghassan
+   rename iprintf to __iprintk, it's a copy of iprintf called on system level.
+   
+   stdio of the ghost of libc
+   Developped by Denis Hommais and Frédéric Pétrot
+   $Log: iprintf.c,v $
+   Revision 1.2  2003/07/01 13:40:46  fred
+   Supports the %u and doesnt core anymore on an unrecognized char
+   following a %
+  
+   Revision 1.1.1.1  2002/02/28 12:58:56  disydent
+   Creation of Disydent CVS Tree
+  
+   Revision 1.1  2001/11/22 15:07:36  fred
+   Adding the iprintf function that does the formatting, and removes all
+   the old stuff hanging around.
+  
+   $Id: iprintf.c,v 1.2 2003/07/01 13:40:46 fred Exp $
+   Made up this file to centralize the printf behavior
+*/
+
+#include <stdarg.h>
+#include <types.h>
+#include <libk.h>
+
+/* Handling of the printf internals
+ * Addr is either the buffer or the tty addrs
+ * inc is 0 for a tty and 1 for a buffer
+ * Other arguments are self explanatory
+ */
+
+#define SIZE_OF_BUF 20
+
+static char* __attribute__((noinline)) compute_dec64(char **addr,
+						     char *buf, 
+						     int inc, 
+						     uint64_t val, 
+						     bool_t isSigned)
+{
+  register int64_t sval;
+  register uint32_t uval;
+  register char *tmp;
+  register uint_t count;
+  register uint_t i;
+
+  if(isSigned == true)
+  {
+    sval = val;
+    if(sval < 0)
+    {
+      sval = -sval;
+      val = sval;
+      **addr = '-';
+      (*addr) += inc;
+    }
+  }
+
+  count = 0;
+  i = 0;
+  tmp = buf + SIZE_OF_BUF;
+  *--tmp = '\0';
+  
+  while(val >= 1000000000UL)
+  {
+    val -= 1000000000UL;
+    count ++;
+  }
+
+  uval = (uint32_t) val;
+
+  do
+  {
+    *--tmp = (uval % 10) + '0';
+    uval /= 10;
+    i++;
+  }while((uval) || (i < 9));
+  
+  uval = count;
+
+  do
+  {
+    *--tmp = (uval % 10) + '0';
+    uval /= 10;
+  }while(uval);
+
+  return tmp;
+}
+
+static char* __attribute__((noinline)) compute_dec(char **addr,
+						   char *buf, 
+						   int inc, 
+						   uint_t val, 
+						   bool_t isSigned)
+{
+  register sint_t sval;
+  register char *tmp;
+
+  if(isSigned == true)
+  {
+    sval = val;
+    if(sval < 0)
+    {
+      sval = -sval;
+      val = sval;
+      **addr = '-';
+      (*addr) += inc;
+    }
+  }
+
+  tmp = buf + SIZE_OF_BUF;
+  *--tmp = '\0';
+
+  do
+  {
+    *--tmp = (val % 10) + '0';
+    val /= 10;
+  }while (val);
+
+  return tmp;
+}
+
+static char* __attribute__((noinline)) compute_hex(char **addr, 
+						   char *buf, 
+						   uint_t val, 
+						   bool_t isPointer)
+{
+  register char *tmp;
+  register char *xdigit;
+  register uint_t i;
+
+  i = 0;
+  xdigit = "0123456789abcdef";
+  tmp = buf + SIZE_OF_BUF;
+  *--tmp = '\0';
+
+  do
+  {
+    *--tmp = xdigit[val & 15];
+    val = val >> 4;
+    i++;
+  }while (val);
+
+  if(isPointer)
+  {
+    while (i < 8)
+    {
+      *--tmp = xdigit[0];
+      i++;
+    }
+  }
+
+  return tmp;
+}
+
+int iprintk (char *addr, int inc, const char *fmt, va_list ap)
+{
+   char *tmp;
+   sint_t val;
+   uint_t uval;
+   uint_t count = 0;
+   char buf[SIZE_OF_BUF];
+
+   while (*fmt)
+   {
+      while ((*fmt != '%') && (*fmt))
+      {
+	*addr = *fmt++;
+         addr += inc;
+         count++;
+      }
+      if (*fmt)
+      {
+         fmt++;
+         switch (*fmt)
+         {
+         case '%':
+            *addr = '%';
+            addr += inc;
+            count++;
+            goto next;
+         case 'c':
+            *addr = va_arg (ap, uint_t);
+            addr += inc;
+            count++;
+            goto next;
+         case 'd':
+	    count ++;
+	    val = va_arg (ap, sint_t);
+	    tmp = compute_dec(&addr, &buf[0], inc, val, true); 
+            break;
+         case 'u':
+	    uval = va_arg (ap, uint_t);
+	    tmp = compute_dec(&addr, &buf[0], inc, uval, false); 
+            break;
+	 case 'D':
+	    count ++;
+	    val = va_arg (ap, int64_t);
+	    tmp = compute_dec64(&addr, &buf[0], inc, val, true); 
+	    break;
+	 case 'U':
+            uval = va_arg (ap, uint64_t);
+	    tmp = compute_dec64(&addr, &buf[0], inc, uval, false); 
+            break;
+         case 's':
+	    tmp = va_arg (ap, char *);
+            if (!tmp)
+               tmp = "empty str";
+            break;
+         case 'p':
+         case 'x':
+	   uval = va_arg (ap, uint_t);
+	   tmp = compute_hex(&addr, &buf[0], uval, (*fmt == 'p') ? true : false);
+	   break;
+         default:
+            *addr = *fmt;
+            count++;
+            goto next;
+         }
+         while (*tmp)
+         {
+            *addr = *tmp++;
+            addr += inc;
+            count++;
+         }
+       next:
+         fmt++;
+      }
+   }
+   va_end (ap);
+   return count;
+}
Index: trunk/kernel/libk/iprintk.c.old
===================================================================
--- trunk/kernel/libk/iprintk.c.old	(revision 1)
+++ trunk/kernel/libk/iprintk.c.old	(revision 1)
@@ -0,0 +1,169 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2007
+*/
+
+/* 
+   revision 1.2.1 2007/11/11 18:54:23 ghassan
+   rename iprintf to __iprintk, it's a copy of iprintf called on system level.
+   
+   stdio of the ghost of libc
+   Developped by Denis Hommais and Frédéric Pétrot
+   $Log: iprintf.c,v $
+   Revision 1.2  2003/07/01 13:40:46  fred
+   Supports the %u and doesnt core anymore on an unrecognized char
+   following a %
+  
+   Revision 1.1.1.1  2002/02/28 12:58:56  disydent
+   Creation of Disydent CVS Tree
+  
+   Revision 1.1  2001/11/22 15:07:36  fred
+   Adding the iprintf function that does the formatting, and removes all
+   the old stuff hanging around.
+  
+   $Id: iprintf.c,v 1.2 2003/07/01 13:40:46 fred Exp $
+   Made up this file to centralize the printf behavior
+*/
+
+#include <stdarg.h>
+#include <libk.h>
+
+/* Handling of the printf internals
+ * Addr is either the buffer or the tty addrs
+ * inc is 0 for a tty and 1 for a buffer
+ * Other arguments are self explanatory
+ */
+
+#define SIZE_OF_BUF 16
+int iprintk (char *addr, int inc, const char *fmt, va_list ap)
+{
+   register char *tmp;
+   int val, i = 0, count = 0;
+   char buf[SIZE_OF_BUF], *xdigit;
+
+   while (*fmt)
+   {
+      while ((*fmt != '%') && (*fmt))
+      {
+	*addr = *fmt++;
+         addr += inc;
+         count++;
+      }
+      if (*fmt)
+      {
+         fmt++;
+         switch (*fmt)
+         {
+         case '%':
+            *addr = '%';
+            addr += inc;
+            count++;
+            goto next;
+         case 'c':
+            *addr = va_arg (ap, int);
+            addr += inc;
+            count++;
+            goto next;
+         case 'd':
+         case 'i':
+            val = va_arg (ap, int);
+            if (val < 0)
+            {
+               val = -val;
+               *addr = '-';
+               addr += inc;
+               count++;
+            }
+            tmp = buf + SIZE_OF_BUF;
+            *--tmp = '\0';
+            do
+            {
+               *--tmp = val % 10 + '0';
+               val /= 10;
+            }
+            while (val);
+            break;
+         case 'u':
+            val = va_arg (ap, unsigned int);
+            tmp = buf + SIZE_OF_BUF;
+            *--tmp = '\0';
+            do
+            {
+               *--tmp = val % 10 + '0';
+               val /= 10;
+            }
+            while (val);
+            break;
+         case 'o':
+            val = va_arg (ap, int);
+            tmp = buf + SIZE_OF_BUF;
+            *--tmp = '\0';
+            do
+            {
+               *--tmp = (val & 7) + '0';
+               val = (unsigned int) val >> 3;
+            }
+            while (val);
+            break;
+         case 's':
+            tmp = va_arg (ap, char *);
+            if (!tmp)
+               tmp = "empty str";
+            break;
+         case 'p':
+         case 'x':
+         case 'X':
+            val = va_arg (ap, int);
+            tmp = buf + SIZE_OF_BUF;
+            *--tmp = '\0';
+            if (*fmt != 'X')
+               xdigit = "0123456789abcdef";
+            else
+               xdigit = "0123456789ABCDEF";
+            do
+            {
+               *--tmp = xdigit[val & 15];
+               val = (unsigned int) val >> 4;
+               i++;
+            }
+            while (val);
+            if (*fmt == 'p')
+               while (i < 8)
+               {
+                  *--tmp = xdigit[0];
+                  i++;
+               }
+            break;
+         default:
+            *addr = *fmt;
+            count++;
+            goto next;
+         }
+         while (*tmp)
+         {
+            *addr = *tmp++;
+            addr += inc;
+            count++;
+         }
+       next:
+         fmt++;
+      }
+   }
+   va_end (ap);
+   return count;
+}
Index: trunk/kernel/libk/list.h
===================================================================
--- trunk/kernel/libk/list.h	(revision 690)
+++ trunk/kernel/libk/list.h	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * list.h - Local double circular linked list, using local pointers.
+ * list.h - Double circular chained lists, inspired from linux
  *
  * Authors Ghassan Almaless  (2008,2009,2010,2011,2012)
- *         Alain Greiner     (2016,2017,2018,2019,2020)
+ *         Alain Greiner     (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -23,11 +23,9 @@
  */
 
-#ifndef _LIST_H_
-#define _LIST_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <printk.h>
+#ifndef _ALMOS_LIST_H_
+#define _ALMOS_LIST_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
 
 #ifndef NULL
@@ -36,19 +34,25 @@
 
 
-////////////////////////////////////////////////////////////////////////////
-//          Double circular linked list functions & macros
-// 
-// It defines a generic local list, as all elements are in the same cluster.
-//
-// There is two sets of access functions, because these local lists can be
-// accessed by local threads, using local pointers, but they can also be 
-// accessed by remote threads running in any cluster, with specific access
-// functions using extended pointers.
+/***************************************************************************
+ * This macro return an uint32_t that is the offset (number of bytes)
+ * of a field in a structure.
+ * @ type   : structure type
+ * @ member : name of the field
+ **************************************************************************/
+
+#ifndef OFFSETOF
+#define OFFSETOF( type , member ) ((unsigned int) & ((type *)0)->member)
+#endif
+
+////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////
+//          Double circular linked list functions & macros 
+////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////
 
 /***************************************************************************
  * This structure defines a Double Circular Linked List entry.
- * Note : The list root is an extra list-entry_t, that is NOT part
- *            of the set of linked elements.
+ * Note : The list root is an extra list-entry_t, that is NOT part of the 
+ *        set of linked elements.
  **************************************************************************/
 
@@ -59,16 +63,4 @@
 }
 list_entry_t;
-
-/***************************************************************************
- * This macro return an intptr_t that is the offset (number of bytes)
- * of a field in a structure.
- ***************************************************************************
- * @ type   : structure type
- * @ member : name of the field
- **************************************************************************/
-
-#ifndef OFFSETOF
-#define OFFSETOF( type , member ) ((intptr_t) & ((type *)0)->member)
-#endif
 
 /***************************************************************************
@@ -84,14 +76,8 @@
 	(container_type *)( (char*)__member_ptr - OFFSETOF( container_type , member_name ));})
 
-
-////////////////////////////////////////////////////////////////////////////
-// These functions and macros mus be called by a thread running
-// in the local cluster to access the local list.
-////////////////////////////////////////////////////////////////////////////
-
-/***************************************************************************
- * This macro returns a pointer on the first element of a list. 
- ***************************************************************************
- * @ root     : pointer on the list root
+/***************************************************************************
+ * This macro returns the first element of a rooted double linked list. 
+ ***************************************************************************
+ * @ root_ptr : pointer on the list root
  * @ type     : type of the linked elements
  * @ member   : name of the list_entry_t field
@@ -102,7 +88,7 @@
 
 /***************************************************************************
- * This macro returns a pointer on the last element of a list. 
- ***************************************************************************
- * @ root     : pointer on the list root
+ * This macro returns the last element of a rooted double linked list. 
+ ***************************************************************************
+ * @ root_ptr : pointer on the list root
  * @ type     : type of the linked elements
  * @ member   : name of the list_entry_t field
@@ -113,7 +99,40 @@
 
 /***************************************************************************
+ * This function returns the pointer on the next list_entry_t.
+ ***************************************************************************
+ * @ root    : pointer on the list root.
+ * @ current : pointer on the current list_entry_t.
+ * @ returns pointer on next entry if success.
+ *   returns NULL if list empty or next is the root. 
+ **************************************************************************/
+static inline list_entry_t * list_next( list_entry_t * root,
+                                        list_entry_t * current )
+{
+	if((root == root->next) || (current->next == root)) return NULL;
+  
+	return current->next;
+}
+
+/***************************************************************************
+ * This function returns the pointer on the previous list_entry_t.
+ ***************************************************************************
+ * @ root    : pointer on the list root.
+ * @ current : pointer on the current list_entry.
+ * @ returns pointer on previous entry if success.
+ *   returns NULL if list empty or previous is the root. 
+ **************************************************************************/
+static inline list_entry_t * list_pred( list_entry_t * root,
+                                        list_entry_t * current )
+{
+	if((root == root->next) || (current->pred == root))
+		return NULL;
+  
+	return current->pred;
+}
+
+/***************************************************************************
  * This macro traverse a rooted double linked list in forward order.
- * WARNING : Don't use this macro when you want to remove one or several
- * item(s) from the traversed list.	
+ * WARNING : Don't use 2 LIST_FOREACH in the same function, because the	
+ * variable __ptr will be defined twice, wich result in a compilation error.
  ***************************************************************************
  * @ root      : pointer on the root list_entry
@@ -162,6 +181,5 @@
 
 /***************************************************************************
- * This function must be called by a thread running in local cluster.
- * It inserts a new entry in first place of a double linked list.
+ * This function inserts a new entry in first place of a double linked list.
  ***************************************************************************
  * @ root    : pointer on the list root
@@ -171,16 +189,19 @@
                                    list_entry_t * entry )
 {
-    list_entry_t * first = root->next;  
-
-	entry->next = first;
-	entry->pred = root;
-  
-	root->next  = entry;
-	first->pred = entry;
-}
-
-/***************************************************************************
- * This function must be called by a thread running in local cluster.
- * It inserts a new entry in last place of a double linked list.
+    list_entry_t * pred_entry;
+    list_entry_t * next_entry;
+  
+	pred_entry = root;
+	next_entry = root->next;
+	
+	entry->next = next_entry;
+	entry->pred = pred_entry;
+  
+	pred_entry->next = entry;
+	next_entry->pred = entry;
+}
+
+/***************************************************************************
+ * This function inserts a new entry in last place of a double linked list.
  ***************************************************************************
  * @ root    : pointer on the list root
@@ -190,16 +211,9 @@
                                   list_entry_t * entry )
 {
-    list_entry_t * last = root->pred;
-
-	entry->next = root;
-	entry->pred = last;
-  
-	root->pred = entry;
-	last->next = entry;
-}
-
-/***************************************************************************
- * This function must be called by a thread running in local cluster.
- * It returns true if the list is empty.
+    list_add_first( root->pred , entry );
+}
+
+/***************************************************************************
+ * This function returns true if the list is empty.
  ***************************************************************************
  * @ root    : pointer on the list root
@@ -210,8 +224,6 @@
 }
 
-
-/***************************************************************************
- * This function must be called by a thread running in local cluster.
- * It removes an entry from the list.
+/***************************************************************************
+ * This function remove an entry from a rooted double linked list.
  ***************************************************************************
  * @ entry : pointer on the entry to be removed.
@@ -219,12 +231,12 @@
 static inline void list_unlink( list_entry_t * entry )
 {
-	list_entry_t * pred = entry->pred;
-    list_entry_t * next = entry->next;
-
-	pred->next = next;
-	next->pred = pred;
-
-    entry->next = NULL;
-    entry->pred = NULL;
+	list_entry_t * pred_entry;
+    list_entry_t * next_entry;
+
+	pred_entry = entry->pred;
+	next_entry = entry->next;
+
+	pred_entry->next = entry->next;
+	next_entry->pred = entry->pred;
 }
 
@@ -251,169 +263,4 @@
 }
 
-/***************************************************************************
- * This debug function displays all entries of a list.
- * @ root    : local pointer on the root list_entry_t.
- * @ string  : list identifier displayed in header.
- * @ max     : max number of éléments to display.
- **************************************************************************/
-static inline void list_display( list_entry_t * root,
-                                 char         * string,
-                                 uint32_t       max )
-{
-    list_entry_t * iter;
-    list_entry_t * next;
-    list_entry_t * pred;
-    uint32_t       index;
-
-    next = root->next;
-    pred = root->pred;
-
-    printk("\n***** root (%x) / next (%x) / pred (%x) / %s *****\n",
-    root, next, pred, string );
-
-    if( list_is_empty( root ) == false )
-    {
-        for( iter = next , index = 0 ;
-             (iter != root) && (index < max) ;
-             iter = next , index++ )
-        {
-            next = iter->next;
-			pred = iter->pred;
-
-            printk(" - %d : iter (%x) / next (%x) / pred (%x)\n",
-            index, iter, next, pred );
-        }
-    }
-}  // end list_display()
-
-
-
-////////////////////////////////////////////////////////////////////////////
-// These functions and macros can be used by any thread running
-// in any cluster to access a remote local list.
-////////////////////////////////////////////////////////////////////////////
-
-/***************************************************************************
- * This macro can be used by a thread running in any cluster to access
- * a remote local list. It returns a local pointer on the first element
- * of the remote list in the remote cluster.
- ***************************************************************************
- * @ cxy     : remote list cluster identifier
- * @ root    : local pointer on the list root
- * @ type    : type of the linked element
- * @ member  : name of the list_entry_t field
- **************************************************************************/
-
-#define LIST_REMOTE_FIRST( cxy , root , type , member )		       \
-	LIST_ELEMENT( hal_remote_lpt( XPTR( (cxy) , &(root)->next ) ), \
-                  type , member )
-
-/***************************************************************************
- * This macro can be used by a thread running in any cluster to access
- * a remote local list. It traverse the list in forward order.
- * WARNING : Don't use this macro when you want to remove one or several
- * item(s) from the traversed list.	
- ***************************************************************************
- * @ cxy     : remote cluster identifier.
- * @ root    : pointer on the root list_entry.
- * @ iter    : pointer on the current list_entry.
- **************************************************************************/
-
-#define LIST_REMOTE_FOREACH( cxy , root , iter )                 \
-for( (iter) = hal_remote_lpt( XPTR( (cxy) , &(root)->next ) ) ;  \
-     (iter) != (root) ;				                             \
-     (iter) = hal_remote_lpt( XPTR( (cxy) , &(iter)->next ) ) ) 
-	
-/***************************************************************************
- * This macro can be used by a thread running in any cluster to access
- * a remote local list. It traverse the list in backward order.
- * WARNING : same as the forward traversal
- ***************************************************************************
- * @ cxy       : remote cluster identifier.
- * @ root      : pointer on the root list_entry.
- * @ iter      : pointer on the current list_entry.
- **************************************************************************/
-
-#define LIST_REMOTE_FOREACH_BACKWARD( cxy , root , iter )       \
-for( (iter) = hal_remote_lpt( XPTR( (cxy) , &(root)->pred ) ) ; \
-     (iter) != (root) ;                                         \
-     (iter) = hal_remote_lpt( XPTR( (cxy) , &(iter)->pred ) ) )
-
-/***************************************************************************
- * This function can be called by a thread running in any cluster to access
- * a remote local list. It returns true if the list is empty.
- ***************************************************************************
- * @ cxy     : remote list cluster identifier
- * @ root    : local pointer on the remote list root
- **************************************************************************/
-static inline bool_t list_remote_is_empty( cxy_t          cxy,
-                                           list_entry_t * root )
-{
-    list_entry_t * next = hal_remote_lpt( XPTR( cxy , &root->next ) );
-    return( root == next );
-}
-
-/***************************************************************************
- * This function can be called by a thread running in any cluster to access
- * a remote local list. It inserts a new entry in first place of the list.
- ***************************************************************************
- * @ cxy     : remote list cluster identifier
- * @ root    : local pointer on the remote list root
- * @ entry   : local pointer on the remote entry to be inserted
- **************************************************************************/
-static inline void list_remote_add_first( cxy_t          cxy,
-                                          list_entry_t * root, 
-                                          list_entry_t * entry )
-{
-    list_entry_t * first = hal_remote_lpt( XPTR( cxy , &root->next ) );
-	
-	hal_remote_spt( XPTR( cxy , &entry->next ) , first );
-	hal_remote_spt( XPTR( cxy , &entry->pred ) , root );
-  
-	hal_remote_spt( XPTR( cxy , &root->next )  , entry );
-	hal_remote_spt( XPTR( cxy , &first->pred ) , entry );
-}
-
-/***************************************************************************
- * This function can be called by a thread running in any cluster to access
- * a remote local list. It inserts a new entry in last place of the list.
- ***************************************************************************
- * @ cxy     : remote list cluster identifier
- * @ root    : local pointer on the remote list root
- * @ entry   : local pointer on the remote entry to be inserted
- **************************************************************************/
-static inline void list_remote_add_last( cxy_t          cxy,
-                                         list_entry_t * root, 
-                                         list_entry_t * entry )
-{
-    list_entry_t * last = hal_remote_lpt( XPTR( cxy , &root->pred ) );
-	
-	hal_remote_spt( XPTR( cxy , &entry->next ) , root );
-	hal_remote_spt( XPTR( cxy , &entry->pred ) , last );
-  
-	hal_remote_spt( XPTR( cxy , &root->pred ) , entry );
-	hal_remote_spt( XPTR( cxy , &last->next ) , entry );
-}
-
-/***************************************************************************
- * This function can be called by a thread running in any cluster to access
- * a remote local list. It removes an entry from the list.
- ***************************************************************************
- * @ cxy     : remote list cluster identifier
- * @ entry   : local pointer on the remote entry to be removed.
- **************************************************************************/
-static inline void list_remote_unlink( cxy_t          cxy,
-                                       list_entry_t * entry )
-{
-	list_entry_t * pred = hal_remote_lpt( XPTR( cxy , &entry->pred ) );
-    list_entry_t * next = hal_remote_lpt( XPTR( cxy , &entry->next ) );
-
-	hal_remote_spt( XPTR( cxy , &pred->next ) , next );
-	hal_remote_spt( XPTR( cxy , &next->pred ) , pred );
-
-	hal_remote_spt( XPTR( cxy , &entry->next ) , NULL );
-	hal_remote_spt( XPTR( cxy , &entry->pred ) , NULL );
-}
-
-
-#endif	/* _LIST_H_ */
+
+#endif	/* _ALMOS_LIST_H_ */
Index: trunk/kernel/libk/memcpy.c
===================================================================
--- trunk/kernel/libk/memcpy.c	(revision 690)
+++ trunk/kernel/libk/memcpy.c	(revision 1)
@@ -22,20 +22,17 @@
  */
 
-#include <hal_kernel_types.h>
-#include <printk.h>
-#include <memcpy.h>
+#include <hal_types.h>
 
 /////////////////////////////////
 void * memcpy( void       * dst,
                const void * src,
-               uint32_t     size)
+               uint32_t     size) 
 {
     uint32_t       * wdst = dst;
     const uint32_t * wsrc = src;
 
-    // word per word copy if both addresses aligned
     if (!((uint32_t) wdst & 3) && !((uint32_t) wsrc & 3) )
     {
-        while (size > 3)
+        while (size > 3) 
         {
             *wdst++ = *wsrc++;
@@ -47,6 +44,5 @@
     unsigned char *csrc = (unsigned char*)wsrc;
 
-    // byte per byte for last bytes (or not aligned)
-    while (size--)
+    while (size--) 
     {
         *cdst++ = *csrc++;
@@ -55,51 +51,15 @@
 }
 
-//////////////////////////////
-void * memset( void     * dst,
-               uint32_t   val,
-               uint32_t   size)
+///////////////////////////
+void * memset( void   * dst, 
+               int      s,
+               uint32_t size) 
 {
-    // build 8 bits and 32 bits values
-    uint8_t    byte = (uint8_t)(val & 0xFF);
-    uint32_t   word = (val<<24) | (val<<16) | (val<<8) | val;
-
-    // word per word if address aligned
-    uint32_t * wdst = (uint32_t *)dst;
-
-    if( (((uint32_t)dst) & 0x3) == 0 )
+    char * a = (char *) dst;
+    while (size--)
     {
-        while( size > 3 )
-        {
-            *wdst++ = word;
-            size -= 4;
-        }
+        *a++ = (char)s;
     }
-
-    // byte per byte for last bytes (or not aligned)
-    char * cdst = (char *)wdst;
-
-    while( size-- )
-    {
-        *cdst++ = byte;
-    }
-
     return dst;
 }
 
-//////////////////////////////
-int memcmp( const void * s1,
-            const void * s2,
-            uint32_t     n)
-{
-    const uint8_t * cs1 = s1;
-    const uint8_t * cs2 = s2;
-
-    while (n > 0)
-    {
-        if (*cs1++ != *cs2++)
-            return (*--cs1 - *--cs2);
-        n--;
-    }
-    return 0;
-}
-
Index: trunk/kernel/libk/memcpy.h
===================================================================
--- trunk/kernel/libk/memcpy.h	(revision 690)
+++ trunk/kernel/libk/memcpy.h	(revision 1)
@@ -22,11 +22,11 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 
 
 /*******************************************************************************************
  * This function copies a source buffer to a destination buffer.
- * There is no alignment constraint, but the performance is improved if the buffers
- * are both aligned on a 32 bits word boundary.
+ * There is no alignment constraint, but the performances are improved if th buffers
+ * are both aligned on a 32 bits word boundary. 
  *******************************************************************************************
  * @ dst     : pointer on destination buffer.
@@ -35,33 +35,18 @@
  * @ return pointer on destination buffer.
  ******************************************************************************************/
-void * memcpy( void       * dst,
-               const void * src,
-               uint32_t     size );
+void * memcpy( void       * _dst,
+               const void * _src,
+               uint32_t     size ); 
 
 /*******************************************************************************************
- * This function sets a constant value in each byte of a target buffer.
+ * This function set a constant value in each byte of a target buffer.
  *******************************************************************************************
  * @ dst     : pointer on destination buffer.
- * @ val     : constant value (cast to uint8_t).
+ * @ s       : constant value (casted to a char).
  * @ size    : number of bytes.
  * @ return pointer on destination buffer.
  ******************************************************************************************/
-void * memset( void     * dst,
-               uint32_t   val,
-               uint32_t size);
+void * memset( void   * dst, 
+               int      s,
+               uint32_t size); 
 
-/*******************************************************************************************
- * This function compares two buffers bytewise.
- *******************************************************************************************
- * @s1     : pointer on a buffer
- * @s2     : pointer on another buffer to compare with @s1
- * @n      : number of bytes to compare
- * @return : = 0 if s1   == s2 means structural or physical equality between @s1 and @s2.
- *           < 0 if s1[i] < s2[i] means @s1[i] is lesser than @s2[i] current one
- *           > 0 if s1[i] > s2[i] means @s1[i] is greater than @s2[i] current one.
- * Note: i is an index to the current byte of the buffer.
- ******************************************************************************************/
-int memcmp( const void * s1,
-            const void * s2,
-            uint32_t     n);
-
Index: trunk/kernel/libk/memset.c
===================================================================
--- trunk/kernel/libk/memset.c	(revision 1)
+++ trunk/kernel/libk/memset.c	(revision 1)
@@ -0,0 +1,94 @@
+/*
+ * memset.c - architecture independent memory set function
+ *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <string.h>
+
+/* TODO: introduce the possiblity to use architecture specific 
+ * more optimized version if any */
+
+void do_memset_8(void *dst, uint32_t val, size_t size)
+{
+	volatile uint32_t *dst_ptr;
+	register uint32_t *limit_ptr;
+  
+	dst_ptr   = dst;
+	limit_ptr = (uint32_t*)((uint8_t*)dst + (size << 5));
+  
+	while(dst_ptr != limit_ptr)
+	{
+		dst_ptr[0] = val;
+		dst_ptr[1] = val;
+		dst_ptr[2] = val;
+		dst_ptr[3] = val;
+		dst_ptr[4] = val;
+		dst_ptr[5] = val;
+		dst_ptr[6] = val;
+		dst_ptr[7] = val;
+
+		dst_ptr += 8;
+	}
+}
+
+#include <kdmsg.h>
+#include <cpu.h>
+void *memset(void *s, int c, unsigned int size)
+{
+	register uint8_t  *ptr = s;
+	register uint32_t *wptr;
+	register uint32_t val;
+	register uint32_t isize;
+	register uint32_t count;
+  
+	c&=0xFF;
+	ptr = s;
+
+	while(((uint32_t) ptr & 0x3) && size && size--)
+		*(ptr++) = (uint8_t) c;
+
+	if(size == 0) return s;
+
+	val = c << 24 | c << 16 | c << 8 | (c & 0xFF);
+	isize = size >> 5;
+
+	if(isize != 0)
+		do_memset_8(ptr, val, isize);
+
+	count = isize << 5;
+	size -= count;
+  
+	if(size == 0) return s;
+
+	wptr = (uint32_t*)(ptr + count);
+	isize = size >> 2;
+	count = isize;
+
+	while(isize--)
+		*(wptr++) = val;
+
+	size = size - (count << 2);
+	ptr = (uint8_t*)wptr;
+
+	while(size--)
+		*(ptr++) = (uint8_t)c;
+  
+	return s;
+}
Index: trunk/kernel/libk/queuelock.c
===================================================================
--- trunk/kernel/libk/queuelock.c	(revision 690)
+++ 	(revision )
@@ -1,175 +1,0 @@
-/*
- * queuelock.c - local kernel lock with waiting queue implementation.
- *
- * Authors   Alain Greiner     (2016,2017,2018,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_atomic.h>
-#include <thread.h>
-#include <scheduler.h>
-#include <busylock.h>
-#include <queuelock.h>
-
-//////////////////////////////////////////////////////////////////////////////
-//                Extern global variables
-//////////////////////////////////////////////////////////////////////////////
-
-extern char * lock_type_str[];          // allocated in kernel_init.c
-
-
-////////////////////////////////////////
-void queuelock_init( queuelock_t * lock,
-                     uint32_t      type )
-{
-    lock->taken = 0;
-    list_root_init( &lock->root );
-    busylock_init( &lock->lock , type );
-
-#if DEBUG_QUEUELOCK_TYPE
-thread_t * this = CURRENT_THREAD;
-bool_t     cond = (type == DEBUG_QUEUELOCK_TYPE) &&
-                  (((local_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
-                    (lock == (queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
-                   ((DEBUG_QUEUELOCK_CXY == 0) &&
-                    (DEBUG_QUEUELOCK_PTR == 0)));
-if( cond ) printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[type], local_cxy, lock );
-#endif
-
-}
-
-////////////////////////////////////////////
-void queuelock_acquire( queuelock_t * lock )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // get busylock protecting access to queuelock state
-    busylock_acquire( &lock->lock );
-
-#if DEBUG_QUEUELOCK_TYPE
-uint32_t   lock_type = lock->lock.type;
-bool_t     cond = (lock_type == DEBUG_QUEUELOCK_TYPE) &&
-                  (((local_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
-                    (lock == (queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
-                   ((DEBUG_QUEUELOCK_CXY == 0) &&
-                    (DEBUG_QUEUELOCK_PTR == 0)));
-#endif
-
-    // block and deschedule if lock already taken
-    while( lock->taken )
-    {
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond ) printk("\n[%s ] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-        // get pointer on calling thread
-        thread_t * this = CURRENT_THREAD;
-
-        // register calling thread in waiting queue
-        list_add_last( &lock->root , &this->wait_list );
-
-        // block calling thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_LOCK );
-        
-        // release busylock
-        busylock_release( &lock->lock );
-
-        // deschedule
-        sched_yield("reader wait queuelock");
-        
-        // get busylock
-        busylock_acquire( &lock->lock );
-    }
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond ) printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-
-    // update queuelock state
-    lock->taken = 1;
-
-    // release busylock 
-    busylock_release( &lock->lock );
-
-}  // end queuelock_acquire()
-
-////////////////////////////////////////////
-void queuelock_release( queuelock_t * lock )
-{
-    // memory barrier before lock release
-    hal_fence();
-
-    // get busylock protecting access to queuelock state
-    busylock_acquire( &lock->lock );
-
-#if DEBUG_QUEUELOCK_TYPE
-uint32_t   lock_type = lock->lock.type;
-thread_t * this      = CURRENT_THREAD;
-bool_t     cond = (lock_type == DEBUG_QUEUELOCK_TYPE) &&
-                  (((local_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
-                    (lock == (queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
-                   ((DEBUG_QUEUELOCK_CXY == 0) &&
-                    (DEBUG_QUEUELOCK_PTR == 0)));
-#endif
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond ) printk("\n[%s] thread[%x,%x] RELEASE q_lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-
-    // update queuelock state
-    lock->taken = 0;
-
-    // unblock first waiting thread if waiting list not empty
-    if( list_is_empty( &lock->root ) == false )
-    {
-        // get first waiting thread
-        thread_t * thread = LIST_FIRST( &lock->root , thread_t , wait_list );
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond ) printk("\n[%s] thread[%x,%x] UNBLOCK thread [%x,%x] / q_lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-        // remove this waiting thread from waiting list
-        list_unlink( &thread->wait_list );
-
-        // unblock this waiting thread
-        thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_LOCK );
-    }
-
-    // release busylock
-    busylock_release( &lock->lock );
-
-}  // end queuelock_release()
-
-
-
Index: trunk/kernel/libk/queuelock.h
===================================================================
--- trunk/kernel/libk/queuelock.h	(revision 690)
+++ 	(revision )
@@ -1,91 +1,0 @@
-/*
- * queuelock.h: local kernel lock with waiting queue implementation.
- * 
- * Authors  Alain Greiner (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-kernel; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _QUEUELOCK_H_
-#define _QUEUELOCK_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <busylock.h>
-#include <list.h>
-
-/*******************************************************************************************
- * This synchronisation object sequencializes concurrent read or write accesses to a
- * locally shared object in a given cluster (i.e. made by thread(s) running in same cluster.
- * This lock has only two states: taken or free.
- * When the lock has been taken by another thread T', the thread T executing the
- * queuelock_acquire() function blocks and deschedules, after registering in the waiting
- * queue rooted in lock descriptor. The first thread in the waiting queue will be unblocked 
- * by the owner thread executing the queuelock_release() function.
- * To handle concurrent accesses between a thread T executing the acquire() function
- * and a thread T' executing the release() function, the "queuelock" is protected
- * by a "busylock" used by these two access functions.
- ******************************************************************************************/
- 
-
-/*******************************************************************************************
- * This structure defines a queuelock.
- ******************************************************************************************/
-
-typedef struct queuelock_s
-{
-    busylock_t          lock;               /*! protect atomic access to queuelock        */
-	volatile uint32_t   taken;              /*! state : free if zero / taken if non zero  */
-    list_entry_t        root;               /*! root of list of locally waiting threads   */
-}
-queuelock_t;
-
-/*******************************************************************************************
- * This function initializes a local queuelock in free state.
- * The <type> argument defines the lock usage and is only used for debug.
- * This type is actually stored in the associated busylock descriptor.
- *******************************************************************************************
- * @ lock   : local pointer on queuelock.
- * @ type   : lock usage for debug.
- ******************************************************************************************/
-inline void queuelock_init( queuelock_t * lock,
-                            uint32_t      type );
-
-/*******************************************************************************************
- * This blocking function acquires a queuelock.
- * The calling thread and the lock must be in same cluster.
- * It uses the busylock to atomically access/update the queuelock state.
- * If the lock is already taken, the calling thread atomically registers in the list
- * of waiting threads (rooted in the lock descriptor), block and deschedule.
- *******************************************************************************************
- * @ lock   : local pointer on queuelock.
- ******************************************************************************************/
-void queuelock_acquire( queuelock_t * lock );
-
-/*******************************************************************************************
- * This function releases a queuelock.
- * The calling thread and the lock must be in same cluster.
- * It uses the busylock to atomically access/update the queuelock state.
- * If the list of waiting threads is not empty, the first waiting thread is unblocked.
- *******************************************************************************************
- * @ lock   : local pointer on queuelock.
- ******************************************************************************************/
-void queuelock_release( queuelock_t * lock );
-
-
-#endif	/* _QUEUELOCK_H_ */
Index: trunk/kernel/libk/readlock.c
===================================================================
--- trunk/kernel/libk/readlock.c	(revision 690)
+++ trunk/kernel/libk/readlock.c	(revision 1)
@@ -22,6 +22,6 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_atomic.h>
 #include <hal_special.h>
@@ -66,5 +66,5 @@
 
     // sync
-    hal_fence();
+    hal_wbflush();
 
     // release lock to support several parallel read access
Index: trunk/kernel/libk/readlock.h
===================================================================
--- trunk/kernel/libk/readlock.h	(revision 690)
+++ trunk/kernel/libk/readlock.h	(revision 1)
@@ -25,6 +25,6 @@
 #define _READLOCK_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 
 /*******************************************************************************************
Index: trunk/kernel/libk/remote_barrier.c
===================================================================
--- trunk/kernel/libk/remote_barrier.c	(revision 690)
+++ trunk/kernel/libk/remote_barrier.c	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * remote_barrier.c -  POSIX barrier implementation.
- *
- * Author   Alain Greiner    (2016,2017,2018,2019,2020)
+ * remote_barrier.c - distributed kernel barrier implementaion 
+ * 
+ * Author   Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,986 +22,38 @@
  */
 
-#include <hal_kernel_types.h>
-#include <hal_macros.h>
+#include <hal_types.h>
 #include <hal_remote.h>
-#include <hal_irqmask.h>
-#include <remote_busylock.h>
-#include <thread.h>
-#include <kmem.h>
-#include <printk.h>
-#include <process.h>
-#include <vmm.h>
 #include <remote_barrier.h>
 
-////////////////////////////////////////////////////
-//  generic (implementation independant) functions
-////////////////////////////////////////////////////
+/////////////////////////////////////////
+inline void remote_barrier( xptr_t    xp,
+                            uint32_t  count ) 
+{
+    uint32_t  expected;
 
-///////////////////////////////////////////////////
-xptr_t generic_barrier_from_ident( intptr_t  ident )
-{
-    // get pointer on local process_descriptor
-    process_t * process = CURRENT_THREAD->process;
+    remote_barrier_t * ptr = (remote_barrier_t *)GET_PTR( xp );
+    cxy_t              cxy = GET_CXY( xp );
 
-    // get pointers on reference process
-    xptr_t         ref_xp  = process->ref_xp;
-    cxy_t          ref_cxy = GET_CXY( ref_xp );
-    process_t    * ref_ptr = (process_t *)GET_PTR( ref_xp );
+    // get barrier sense value
+    uint32_t sense = hal_remote_lw( XPTR( cxy , &ptr->sense ) );
 
-    // get extended pointer on root of barriers list
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->barrier_root );
+	// compute expected value
+    if ( sense == 0 ) expected = 1;
+    else              expected = 0;
 
-    // scan reference process barriers list
-    xptr_t              iter_xp;
-    xptr_t              barrier_xp;
-    cxy_t               barrier_cxy;
-    generic_barrier_t * barrier_ptr;
-    intptr_t            current;
-    bool_t              found = false;
+    // increment count
+    uint32_t current = hal_remote_atomic_add( XPTR( cxy , &ptr->current ) , 1 );
 
-    XLIST_FOREACH( root_xp , iter_xp )
+    // last task reset current and toggle sense
+    if( current == (count-1) ) 
     {
-        barrier_xp  = XLIST_ELEMENT( iter_xp , generic_barrier_t , list );
-        barrier_cxy = GET_CXY( barrier_xp );
-        barrier_ptr = (generic_barrier_t *)GET_PTR( barrier_xp );
-        current     = (intptr_t)hal_remote_lpt( XPTR( barrier_cxy , &barrier_ptr->ident ) );
-        if( ident == current )
-        {
-            found = true;
-            break;
-        }
+        hal_remote_sw( XPTR( cxy , &ptr->current) , 0 );  
+        hal_remote_sw( XPTR( cxy , &ptr->sense  ) , expected );  
     }
-
-    if( found == false )  return XPTR_NULL;
-    else                  return barrier_xp;
-
-} // end generic_barrier_from_ident()
-
-//////////////////////////////////////////////////////////////
-error_t generic_barrier_create( intptr_t                ident,
-                                uint32_t                count,
-                                pthread_barrierattr_t * attr )
-{
-    generic_barrier_t * gen_barrier_ptr;  // local pointer on generic barrier descriptor
-    void              * barrier;          // local pointer on impl barrier descriptor      
-
-    // get pointer on local process_descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get pointers on reference process
-    xptr_t         ref_xp  = process->ref_xp;
-    cxy_t          ref_cxy = GET_CXY( ref_xp );
-    process_t    * ref_ptr = (process_t *)GET_PTR( ref_xp );
-
-    // allocate memory for generic barrier descriptor
-    gen_barrier_ptr = kmem_remote_alloc( ref_cxy, 
-                                         bits_log2(sizeof(generic_barrier_t)),
-                                         AF_KERNEL );
-    if( gen_barrier_ptr == NULL )
+    else   // other tasks poll the sense 
     {
-        printk("\n[ERROR] in %s : cannot create generic barrier\n", __FUNCTION__ );
-        return -1;
+        while( hal_remote_lw( XPTR( cxy , &ptr->sense ) ) != expected ) asm volatile ("nop");
     }
-
-    // create implementation specific barrier descriptor
-    if( attr == NULL )                                    // simple barrier
-    {
-        // create simple barrier descriptor
-         barrier = simple_barrier_create( count );
-    }
-    else                                                  // QDT barrier
-    {
-        uint32_t x_size   = attr->x_size;
-        uint32_t y_size   = attr->y_size;
-        uint32_t nthreads = attr->nthreads;
-
-        // check attributes / count
-        if( (x_size * y_size * nthreads) != count )
-        {
-            printk("\n[ERROR] in %s : count(%d) != x_size(%d) * y_size(%d) * nthreads(%d)\n",
-            __FUNCTION__, count, x_size, y_size, nthreads );
-            kmem_remote_free( ref_cxy, 
-                              gen_barrier_ptr,
-                              bits_log2(sizeof(generic_barrier_t)) );
-            return -1;
-        }
-
-        // create DQT barrier descriptor
-        barrier = dqt_barrier_create( x_size , y_size , nthreads );
-    }
-
-    if( barrier == NULL ) 
-    {
-        printk("\n[ERROR] in %s : cannot create impl barrier\n", __FUNCTION__ );
-        kmem_remote_free( ref_cxy, 
-                          gen_barrier_ptr,
-                          bits_log2(sizeof(generic_barrier_t)) );
-        return -1;
-    }
-
-    // initialize the generic barrier descriptor
-    hal_remote_spt( XPTR( ref_cxy , &gen_barrier_ptr->ident  ) , (void*)ident );
-    hal_remote_s32( XPTR( ref_cxy , &gen_barrier_ptr->is_dqt ) , (attr != NULL) );
-    hal_remote_spt( XPTR( ref_cxy , &gen_barrier_ptr->extend ) , barrier );
-
-    // build extended pointers on lock, root and entry for reference process xlist
-    xptr_t root_xp  = XPTR( ref_cxy , &ref_ptr->barrier_root );
-    xptr_t lock_xp  = XPTR( ref_cxy , &ref_ptr->sync_lock );
-    xptr_t entry_xp = XPTR( ref_cxy , &gen_barrier_ptr->list );
-
-    // register barrier in reference process xlist of barriers
-    remote_busylock_acquire( lock_xp );
-    xlist_add_first( root_xp , entry_xp );
-    remote_busylock_release( lock_xp );
-
-    return 0;
-
-}  // en generic_barrier_create() 
-
-/////////////////////////////////////////////////////
-void generic_barrier_destroy( xptr_t gen_barrier_xp )
-{
-    // get pointer on local process_descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get pointers on reference process
-    xptr_t      ref_xp  = process->ref_xp;
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = GET_PTR( ref_xp );
-
-    // get cluster and local pointer on generic barrier descriptor
-    generic_barrier_t * gen_barrier_ptr = GET_PTR( gen_barrier_xp );
-    cxy_t               gen_barrier_cxy = GET_CXY( gen_barrier_xp );
-
-    // get barrier type and extension pointer
-    bool_t  is_dqt = hal_remote_l32( XPTR( gen_barrier_cxy , &gen_barrier_ptr->is_dqt ) );
-    void  * extend = hal_remote_lpt( XPTR( gen_barrier_cxy , &gen_barrier_ptr->extend ) );
-
-    // build extended pointer on implementation dependant barrier descriptor
-    xptr_t barrier_xp = XPTR( gen_barrier_cxy , extend );
-
-    // delete the implementation specific barrier
-    if( is_dqt ) dqt_barrier_destroy( barrier_xp );
-    else         simple_barrier_destroy( barrier_xp );
-
-    // build extended pointers on lock and entry for reference process xlist
-    xptr_t  lock_xp  = XPTR( ref_cxy , &ref_ptr->sync_lock );
-    xptr_t  entry_xp = XPTR( gen_barrier_cxy , &gen_barrier_ptr->list );
-
-    // remove barrier from reference process xlist
-    remote_busylock_acquire( lock_xp );
-    xlist_unlink( entry_xp );
-    remote_busylock_release( lock_xp );
-
-    // release memory allocated to generic barrier descriptor
-    kmem_remote_free( gen_barrier_cxy,
-                      gen_barrier_ptr,
-                      bits_log2(sizeof(generic_barrier_t)) );
-
-}  // end generic_barrier_destroy()
-
-//////////////////////////////////////////////////
-void generic_barrier_wait( xptr_t gen_barrier_xp )
-{
-    // get generic barrier descriptor cluster and pointer
-    cxy_t               gen_barrier_cxy = GET_CXY( gen_barrier_xp );
-    generic_barrier_t * gen_barrier_ptr = GET_PTR( gen_barrier_xp );
-
-    // get implementation type and extend local pointer
-    bool_t  is_dqt = hal_remote_l32( XPTR( gen_barrier_cxy , &gen_barrier_ptr->is_dqt ) );
-    void  * extend = hal_remote_lpt( XPTR( gen_barrier_cxy , &gen_barrier_ptr->extend ) );
-
-    // build extended pointer on implementation specific barrier descriptor
-    xptr_t barrier_xp = XPTR( gen_barrier_cxy , extend );
-
-    // call the relevant wait function
-    if( is_dqt ) dqt_barrier_wait( barrier_xp );
-    else         simple_barrier_wait( barrier_xp );
-    
-}  // end generic_barrier_wait()
-
-/////////////////////////////////////////////////////
-void generic_barrier_display( xptr_t gen_barrier_xp )
-{
-    // get cluster and local pointer
-    generic_barrier_t * gen_barrier_ptr = GET_PTR( gen_barrier_xp );
-    cxy_t               gen_barrier_cxy = GET_CXY( gen_barrier_xp );
-
-    // get barrier type and extend pointer
-    bool_t  is_dqt = hal_remote_l32( XPTR( gen_barrier_cxy , &gen_barrier_ptr->is_dqt ) );
-    void  * extend = hal_remote_lpt( XPTR( gen_barrier_cxy , &gen_barrier_ptr->extend ) );
-
-    // buil extended pointer on the implementation specific barrier descriptor
-    xptr_t barrier_xp = XPTR( gen_barrier_cxy , extend );
-
-    // display barrier state
-    if( is_dqt ) dqt_barrier_display( barrier_xp );
-    else         simple_barrier_display( barrier_xp );
 }
 
 
-
-/////////////////////////////////////////////////////////////
-//      simple barrier functions
-/////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////
-simple_barrier_t * simple_barrier_create( uint32_t  count )
-{
-    simple_barrier_t * barrier;
-
-    // get pointer on local client process descriptor
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-    // get reference process cluster
-    xptr_t         ref_xp  = process->ref_xp;
-    cxy_t          ref_cxy = GET_CXY( ref_xp );
-
-    // allocate memory for simple barrier descriptor
-    barrier  = kmem_remote_alloc( ref_cxy,
-                                  bits_log2(sizeof(simple_barrier_t)),
-                                  AF_ZERO );
-    if( barrier == NULL )
-    {
-        printk("\n[ERROR] in %s : cannot create simple barrier\n", __FUNCTION__ );
-        return NULL;
-    }
-
-    // initialise simple barrier descriptor
-    hal_remote_s32      ( XPTR( ref_cxy , &barrier->arity )      , count );
-    hal_remote_s32      ( XPTR( ref_cxy , &barrier->current    ) , 0 );
-    hal_remote_s32      ( XPTR( ref_cxy , &barrier->sense      ) , 0 );
-
-    xlist_root_init     ( XPTR( ref_cxy , &barrier->root ) );
-    remote_busylock_init( XPTR( ref_cxy , &barrier->lock ) , LOCK_BARRIER_STATE );
-
-#if DEBUG_BARRIER_CREATE
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_CREATE )
-printk("\n[%s] thread[%x,%x] created barrier (%x,%x) / count %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, ref_cxy, barrier, count, cycle );
-#endif
-
-    return barrier;
-
-}  // end simple_barrier_create()
-
-////////////////////////////////////////////////
-void simple_barrier_destroy( xptr_t barrier_xp )
-{
-    // get barrier cluster and local pointer
-    cxy_t              barrier_cxy = GET_CXY( barrier_xp );
-    simple_barrier_t * barrier_ptr = GET_PTR( barrier_xp );
-
-    // release memory allocated for barrier descriptor
-    kmem_remote_free( barrier_cxy,
-                      barrier_ptr,
-                      bits_log2(sizeof(simple_barrier_t)) );
-
-#if DEBUG_BARRIER_DESTROY
-uint32_t    cycle   = (uint32_t)hal_get_cycles();
-thread_t  * this    = CURRENT_THREAD;
-process_t * process = this->process;
-if( cycle > DEBUG_BARRIER_DESTROY )
-printk("\n[%s] thread[%x,%x] deleted barrier (%x,%x) / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, barrier_ptr, barrier_cxy, cycle );
-#endif
-
-}  // end simple_barrier_destroy()
-
-/////////////////////////////////////////////
-void simple_barrier_wait( xptr_t barrier_xp )
-{
-    uint32_t  expected;
-    uint32_t  sense;
-    uint32_t  current;
-    uint32_t  arity;
-    xptr_t    root_xp;
-    xptr_t    lock_xp;
-    xptr_t    current_xp;
-    xptr_t    sense_xp;
-    xptr_t    arity_xp;
-
-    // get pointer on calling thread
-    thread_t * this = CURRENT_THREAD;
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // get cluster and local pointer on remote barrier
-    simple_barrier_t * barrier_ptr = GET_PTR( barrier_xp );
-    cxy_t              barrier_cxy = GET_CXY( barrier_xp );
-
-#if DEBUG_BARRIER_WAIT
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] enter / barrier (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, barrier_cxy, barrier_ptr, cycle );
-#endif
-
-    // build extended pointers on various barrier descriptor fields
-    lock_xp    = XPTR( barrier_cxy , &barrier_ptr->lock );
-    root_xp    = XPTR( barrier_cxy , &barrier_ptr->root );
-    current_xp = XPTR( barrier_cxy , &barrier_ptr->current );
-    sense_xp   = XPTR( barrier_cxy , &barrier_ptr->sense );
-    arity_xp   = XPTR( barrier_cxy , &barrier_ptr->arity );
-
-    // take busylock protecting the barrier state
-    remote_busylock_acquire( lock_xp );
-
-    // get sense and threads values from barrier descriptor
-    sense = hal_remote_l32( sense_xp );
-    arity = hal_remote_l32( arity_xp );
-
-    // compute expected value
-    if ( sense == 0 ) expected = 1;
-    else              expected = 0;
-
-    // increment current number of arrived threads / get value before increment
-    current = hal_remote_atomic_add( current_xp , 1 );
-
-    // last thread reset current, toggle sense, and activate all waiting threads
-    // other threads block, register in queue, and deschedule
-
-    if( current == (arity - 1) )                       // last thread
-    {
-        hal_remote_s32( current_xp , 0 );
-        hal_remote_s32( sense_xp , expected );
-
-        // unblock all waiting threads
-        while( xlist_is_empty( root_xp ) == false )
-        {
-            // get pointers on first waiting thread
-            xptr_t     thread_xp  = XLIST_FIRST( root_xp , thread_t , wait_list );
-            cxy_t      thread_cxy = GET_CXY( thread_xp );
-            thread_t * thread_ptr = GET_PTR( thread_xp );
-
-#if (DEBUG_BARRIER_WAIT & 1)
-trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-process_t * process = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-pid_t       pid     = hal_remote_l32( XPTR( thread_cxy , &process->pid ) ); 
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] unblocks thread[%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, trdid );
-#endif
-
-            // remove waiting thread from queue
-            xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_list ) );
-
-            // unblock waiting thread
-            thread_unblock( thread_xp , THREAD_BLOCKED_USERSYNC );
-        }
-
-        // release busylock protecting the barrier
-        remote_busylock_release( lock_xp );
-    }
-    else                                             // not the last thread
-    {
-
-#if (DEBUG_BARRIER_WAIT & 1)
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] blocks\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-        // register calling thread in barrier waiting queue
-        xlist_add_last( root_xp , XPTR( local_cxy , &this->wait_list ) );
-
-        // block calling thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_USERSYNC );
-
-        // release busylock protecting the remote_barrier
-        remote_busylock_release( lock_xp );
-
-        // deschedule
-        sched_yield("blocked on barrier");
-    }
-
-#if DEBUG_BARRIER_WAIT
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] exit / barrier (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, barrier_cxy, barrier_ptr, cycle );
-#endif
-
-}  // end simple_barrier_wait()
-
-/////////////////////////////////////////////////
-void simple_barrier_display( xptr_t  barrier_xp )
-{
-    // get cluster and local pointer on simple barrier 
-    simple_barrier_t * barrier_ptr = GET_PTR( barrier_xp );
-    cxy_t              barrier_cxy = GET_CXY( barrier_xp );
-
-    // get barrier global parameters
-    uint32_t current  = hal_remote_l32( XPTR( barrier_cxy , &barrier_ptr->current ) );
-    uint32_t arity    = hal_remote_l32( XPTR( barrier_cxy , &barrier_ptr->arity   ) );
-
-    printk("\n***** simple barrier : %d arrived threads on %d *****\n",
-    current, arity );
-
-}   // end simple_barrier_display()
-
-
-
-
-/////////////////////////////////////////////////////////////
-//      DQT barrier functions
-/////////////////////////////////////////////////////////////
-
-static void dqt_barrier_increment( xptr_t node_xp );
-
-#if DEBUG_BARRIER_CREATE
-void dqt_barrier_display( xptr_t  barrier_xp );
-#endif
-
-///////////////////////////////////////////////////////
-dqt_barrier_t * dqt_barrier_create( uint32_t    x_size,
-                                    uint32_t    y_size,
-                                    uint32_t    nthreads )
-{
-    dqt_barrier_t * barrier;       // local pointer on DQT barrier descriptor
-    xptr_t          barrier_xp;    // extended pointer on DQT barrier descriptor
-    uint32_t        z;             // actual DQT size == max(x_size,y_size)
-    uint32_t        levels;        // actual number of DQT levels
-    uint32_t        x;             // X coordinate in QDT mesh
-    uint32_t        y;             // Y coordinate in QDT mesh
-    uint32_t        l;             // level coordinate
-
-    // compute number of DQT levels, depending on the mesh size
-    z      = (x_size > y_size) ? x_size : y_size;
-    levels = (z < 2) ? 1 : (z < 3) ? 2 : (z < 5) ? 3 : (z < 9) ? 4 : 5;
-
-// check x_size and y_size arguments
-assert( __FUNCTION__, (z <= 16),
-"DQT mesh size larger than (16*16)\n");
-
-// check size of an array of 5 DQT nodes
-assert( __FUNCTION__, (sizeof(dqt_node_t) * 5 <= 512 ),
-"array of DQT nodes larger than 512 bytes\n");
-
-// check size of DQT barrier descriptor
-assert( __FUNCTION__, (sizeof(dqt_barrier_t) <= 0x4000 ),
-"DQT barrier descriptor larger than 4 pages\n");
-
-    // get pointer on client thread and process descriptors
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_BARRIER_CREATE
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_CREATE ) 
-printk("\n[%s] thread[%x,%x] enter : x_size %d / y_size %d / levels %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, x_size, y_size, levels, cycle );
-#endif
-
-    // get reference process cluster
-    xptr_t         ref_xp  = process->ref_xp;
-    cxy_t          ref_cxy = GET_CXY( ref_xp );
-
-    // 1. allocate 4 small pages for the DQT barrier descriptor in reference cluster
-    barrier    = kmem_remote_alloc( ref_cxy,
-                                    CONFIG_PPM_PAGE_ORDER + 2,   // 4 small pages
-                                    AF_ZERO );      
-    if( barrier == NULL )
-    {
-        printk("\n[ERROR] in %s : cannot create DQT barrier\n", __FUNCTION__ );
-        return NULL;
-    }
-
-    // get pointers on DQT barrier descriptor in reference cluster
-    barrier_xp = XPTR( ref_cxy , barrier );
-
-    // initialize global parameters in DQT barrier descriptor
-    hal_remote_s32( XPTR( ref_cxy , &barrier->x_size   ) , x_size );
-    hal_remote_s32( XPTR( ref_cxy , &barrier->y_size   ) , x_size );
-    hal_remote_s32( XPTR( ref_cxy , &barrier->nthreads ) , nthreads );
-
-#if DEBUG_BARRIER_CREATE
-if( cycle > DEBUG_BARRIER_CREATE ) 
-printk("\n[%s] thread[%x,%x] created DQT barrier descriptor(%x,%x)\n",
-__FUNCTION__, process->pid, this->trdid, ref_cxy, barrier );
-#endif
-
-    // 2. allocate memory for an array of 5 DQT nodes  
-    //    in all existing clusters covered by the DQDT
-    //    (5 nodes per cluster <= 512 bytes per cluster)
-    //    and complete barrier descriptor initialisation. 
-    for ( x = 0 ; x < x_size ; x++ )
-    {
-        for ( y = 0 ; y < y_size ; y++ )
-        {
-            cxy_t  cxy = HAL_CXY_FROM_XY( x , y );   // target cluster identifier
-            xptr_t local_array_xp;                   // xptr on nodes array in cluster cxy
-
-            // allocate memory in existing clusters only
-            if( LOCAL_CLUSTER->cluster_info[x][y] )
-            {
-                void * ptr = kmem_remote_alloc( cxy , 9 , AF_ZERO );  // 512 bytes
-
-                if( ptr == NULL )
-                {
-                    printk("\n[ERROR] in %s : cannot allocate DQT in cluster %x\n",
-                    __FUNCTION__, cxy );
-                    return NULL;
-                }
-       
-                // build extended pointer on local node array in cluster cxy         
-			    local_array_xp = XPTR( cxy , ptr );
-
-                // initialize the node_xp[x][y][l] array in barrier descriptor
-                for ( l = 0 ; l < levels ; l++ )
-                {
-                    xptr_t  node_xp = local_array_xp + ( l * sizeof(dqt_node_t) );
-                    hal_remote_s64( XPTR( ref_cxy , &barrier->node_xp[x][y][l] ), node_xp );
-
-#if (DEBUG_BARRIER_CREATE & 1)
-if( cycle > DEBUG_BARRIER_CREATE )
-printk(" - dqt_node_xp[%d,%d,%d] = (%x,%x) / &dqt_node_xp = %x\n",
-x , y , l , GET_CXY( node_xp ), GET_PTR( node_xp ), &barrier->node_xp[x][y][l] );
-#endif
-                }  
-            }
-            else   // register XPTR_NULL for all non-existing entries
-            {
-                for ( l = 0 ; l < levels ; l++ )
-                {
-                    hal_remote_s64( XPTR( ref_cxy , &barrier->node_xp[x][y][l] ), XPTR_NULL );
-                }
-            }
-        }  // end for y 
-    }  // end for x
-
-#if DEBUG_BARRIER_CREATE
-if( cycle > DEBUG_BARRIER_CREATE ) 
-printk("\n[%s] thread[%x,%x] initialized array of pointers in DQT barrier\n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-
-    // 3. initialise all distributed DQT nodes using remote accesses
-    //    and the pointers stored in the node_xp[x][y][l] array
-    for ( x = 0 ; x < x_size ; x++ )
-    {
-        for ( y = 0 ; y < y_size ; y++ )
-        {
-            // initialize existing clusters only
-            if( LOCAL_CLUSTER->cluster_info[x][y] )
-            {
-                for ( l = 0 ; l < levels ; l++ )
-                {
-				    xptr_t    parent_xp;
-                    xptr_t    child_xp[4];
-                    uint32_t  arity = 0;
-
-                    // get DQT node pointers
-                    xptr_t       node_xp  = hal_remote_l64( XPTR( ref_cxy,
-                                            &barrier->node_xp[x][y][l] ) );
-                    cxy_t        node_cxy = GET_CXY( node_xp );
-                    dqt_node_t * node_ptr = GET_PTR( node_xp ); 
-
-                    // compute arity and child_xp[i] 
-                    if (l == 0 )                            // bottom DQT node
-                    {
-                        arity       = nthreads;
-
-                        child_xp[0] = XPTR_NULL;
-                        child_xp[1] = XPTR_NULL;
-                        child_xp[2] = XPTR_NULL;
-                        child_xp[3] = XPTR_NULL;
-                    }
-                    else                                    // not a bottom DQT node
-                    {
-                        arity = 0;
-
-                        // only few non-bottom nodes must be initialised
-                        if( ((x & ((1<<l)-1)) == 0) && ((y & ((1<<l)-1)) == 0) )
-                        {
-                            uint32_t cx[4];       // x coordinate for children
-                            uint32_t cy[4];       // y coordinate for children
-                            uint32_t i;
-
-                            // the child0 coordinates are equal to the parent coordinates
-                            // other children coordinates depend on the level value
-                            cx[0] = x;
-                            cy[0] = y;
-
-                            cx[1] = x;
-                            cy[1] = y + (1 << (l-1));
-
-                            cx[2] = x + (1 << (l-1));
-                            cy[2] = y;
-
-                            cx[3] = x + (1 << (l-1));
-                            cy[3] = y + (1 << (l-1));
-
-                            for ( i = 0 ; i < 4 ; i++ )
-                            {
-                                // child pointer is NULL if  outside the mesh
-                                if ( (cx[i] < x_size) && (cy[i] < y_size) ) 
-                                {
-                                    // get child_xp[i] 
-                                    child_xp[i] = hal_remote_l64( XPTR( ref_cxy,
-                                                  &barrier->node_xp[cx[i]][cy[i]][l-1] ) );
-
-                                    // increment arity
-                                    arity++;
-                                }
-                                else
-                                {
-                                    child_xp[i] = XPTR_NULL;
-                                }
-                            }
-                        }
-                    }
-
-                    // compute parent_xp
-                    if( l == (levels - 1) )                      // root DQT node
-                    {
-                        parent_xp = XPTR_NULL;
-                    }
-                    else                                          // not the root
-                    {
-                        uint32_t px = 0;           // parent X coordinate
-                        uint32_t py = 0;           // parent Y coordinate
-                        bool_t   found = false;
-
-                        // compute macro_cluster x_min, x_max, y_min, y_max                
-                        uint32_t x_min = x & ~((1<<(l+1))-1);
-                        uint32_t x_max = x_min + (1<<(l+1));
-                        uint32_t y_min = y & ~((1<<(l+1))-1);
-                        uint32_t y_max = y_min + (1<<(l+1));
-
-                        // scan all clusters in macro-cluster[x][y][l] / take first active
-                        for( px = x_min ; px < x_max ; px++ )
-                        {
-                            for( py = y_min ; py < y_max ; py++ )
-                            {
-                                if( LOCAL_CLUSTER->cluster_info[px][py] ) found = true;
-                                if( found ) break;
-                            }
-                            if( found ) break;
-                        }
-
-                        parent_xp = hal_remote_l64( XPTR( ref_cxy ,
-                                    &barrier->node_xp[px][py][l+1] ) );
-                    }
-
-                    // initializes  the DQT node
-                    hal_remote_s32( XPTR( node_cxy , &node_ptr->arity )       , arity );   
-                    hal_remote_s32( XPTR( node_cxy , &node_ptr->current )     , 0 );   
-                    hal_remote_s32( XPTR( node_cxy , &node_ptr->sense )       , 0 );   
-                    hal_remote_s32( XPTR( node_cxy , &node_ptr->level )       , l );   
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->parent_xp )   , parent_xp );
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->child_xp[0] ) , child_xp[0] );
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->child_xp[1] ) , child_xp[1] );
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->child_xp[2] ) , child_xp[2] );
-                    hal_remote_s64( XPTR( node_cxy , &node_ptr->child_xp[3] ) , child_xp[3] );
-
-                    xlist_root_init( XPTR( node_cxy , &node_ptr->root ) );
-
-                    remote_busylock_init( XPTR( node_cxy , &node_ptr->lock ),
-                                          LOCK_BARRIER_STATE );
-                }
-            }
-        }
-    }
-
-#if DEBUG_BARRIER_CREATE 
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_CREATE ) 
-printk("\n[%s] thread[%x,%x] completed DQT barrier initialisation / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cycle );
-dqt_barrier_display( barrier_xp );
-#endif
-
-    return barrier;
-
-}  // end dqt_barrier_create()
-
-///////////////////////////////////////////////
-void dqt_barrier_destroy( xptr_t   barrier_xp )
-{
-    uint32_t     x;
-    uint32_t     y;
-
-    // get DQT barrier descriptor cluster and local pointer
-    dqt_barrier_t * barrier_ptr = GET_PTR( barrier_xp );
-    cxy_t           barrier_cxy = GET_CXY( barrier_xp );
-
-#if DEBUG_BARRIER_DESTROY
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_DESTROY ) 
-printk("\n[%s] thread[%x,%x] enter for barrier (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, barrier_cxy, barrier_ptr, cycle );
-#endif
-
-    // get x_size and y_size global parameters
-    uint32_t x_size = hal_remote_l32( XPTR( barrier_cxy , &barrier_ptr->x_size ) );
-    uint32_t y_size = hal_remote_l32( XPTR( barrier_cxy , &barrier_ptr->y_size ) );
-
-    // 1. release memory allocated for the DQT nodes
-    //    in all clusters covered by the QDT mesh
-    for ( x = 0 ; x < x_size ; x++ )
-    {
-        for ( y = 0 ; y < y_size ; y++ )
-        {
-            // compute target cluster identifier
-            cxy_t   cxy = HAL_CXY_FROM_XY( x , y ); 
-
-            // existing cluster only
-            if( LOCAL_CLUSTER->cluster_info[x][y] )
-            {
-                // get local pointer on dqt_nodes array in target cluster  
-                xptr_t  buf_xp_xp = XPTR( barrier_cxy , &barrier_ptr->node_xp[x][y][0] );
-                xptr_t  buf_xp    = hal_remote_l64( buf_xp_xp );
-                void  * buf       = GET_PTR( buf_xp );
-
-                kmem_remote_free( cxy , buf , 9 );    // 512 bytes
-
-#if DEBUG_BARRIER_DESTROY
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_DESTROY ) 
-printk("\n[%s] thread[%x,%x] released node array %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, buf, cxy, cycle );
-#endif
-            }
-        }
-    }
-
-    // 2. release memory allocated for barrier descriptor in ref cluster
-    kmem_remote_free( barrier_cxy,
-                      barrier_ptr,
-                      CONFIG_PPM_PAGE_ORDER + 2 );   // 4 small pages
-
-#if DEBUG_BARRIER_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_DESTROY ) 
-printk("\n[%s] thread[%x,%x] release barrier descriptor (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, barrier_cxy, barrier_ptr, cycle );
-#endif
-
-}  // end dqt_barrier_destroy()
-
-////////////////////////////////////////////
-void dqt_barrier_wait( xptr_t   barrier_xp )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // get cluster and local pointer on DQT barrier descriptor
-    dqt_barrier_t * barrier_ptr = GET_PTR( barrier_xp );
-    cxy_t           barrier_cxy = GET_CXY( barrier_xp );
-
-#if DEBUG_BARRIER_WAIT
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] enter / barrier (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, barrier_cxy, barrier_ptr, cycle );
-#endif
-
-    // get extended pointer on local bottom DQT node
-    uint32_t x       = HAL_X_FROM_CXY( local_cxy );
-    uint32_t y       = HAL_Y_FROM_CXY( local_cxy );
-    xptr_t   node_xp = hal_remote_l64( XPTR( barrier_cxy , &barrier_ptr->node_xp[x][y][0] ) );
-
-    // call recursive function to traverse DQT from bottom to root
-    dqt_barrier_increment( node_xp );
-
-#if DEBUG_BARRIER_WAIT
-cycle = (uint32_t)hal_get_cycles();
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] exit / barrier (%x,%x) / cycle %d\n",
-__FUNCTION__, this->trdid, this->process->pid, barrier_cxy, barrier_ptr, cycle );
-#endif
-
-}  // end dqt_barrier_wait()
-
-//////////////////////////////////////////////
-void dqt_barrier_display( xptr_t  barrier_xp )
-{
-    // get cluster and local pointer on DQT barrier 
-    dqt_barrier_t * barrier_ptr = GET_PTR( barrier_xp );
-    cxy_t           barrier_cxy = GET_CXY( barrier_xp );
-
-    // get barrier global parameters
-    uint32_t x_size   = hal_remote_l32( XPTR( barrier_cxy , &barrier_ptr->x_size ) );
-    uint32_t y_size   = hal_remote_l32( XPTR( barrier_cxy , &barrier_ptr->y_size ) );
-    uint32_t nthreads = hal_remote_l32( XPTR( barrier_cxy , &barrier_ptr->nthreads ) );
-
-    // compute size and number of DQT levels
-    uint32_t z      = (x_size > y_size) ? x_size : y_size;
-    uint32_t levels = (z < 2) ? 1 : (z < 3) ? 2 : (z < 5) ? 3 : (z < 9) ? 4 : 5;
-
-    printk("\n***** DQT barrier : x_size %d / y_size %d / nthreads %d / levels %d *****\n",
-    x_size, y_size, nthreads, levels );
-
-    uint32_t x , y , l;
-
-    for ( x = 0 ; x < x_size ; x++ )
-    {
-        for ( y = 0 ; y < y_size ; y++ )
-        {
-            printk(" - cluster[%d,%d]\n", x , y );
-
-            for ( l = 0 ; l < levels ; l++ )
-            {
-                // get pointers on target node
-                xptr_t       node_xp  = hal_remote_l64( XPTR( barrier_cxy ,
-                                        &barrier_ptr->node_xp[x][y][l] ) );
-                dqt_node_t * node_ptr = GET_PTR( node_xp );
-                cxy_t        node_cxy = GET_CXY( node_xp );
-
-                if( node_xp != XPTR_NULL )
-                {
-                     uint32_t level = hal_remote_l32( XPTR( node_cxy , &node_ptr->level       ));
-                     xptr_t   pa_xp = hal_remote_l32( XPTR( node_cxy , &node_ptr->parent_xp   ));
-                     xptr_t   c0_xp = hal_remote_l32( XPTR( node_cxy , &node_ptr->child_xp[0] ));
-                     xptr_t   c1_xp = hal_remote_l32( XPTR( node_cxy , &node_ptr->child_xp[1] ));
-                     xptr_t   c2_xp = hal_remote_l32( XPTR( node_cxy , &node_ptr->child_xp[2] ));
-                     xptr_t   c3_xp = hal_remote_l32( XPTR( node_cxy , &node_ptr->child_xp[3] ));
-
-                     printk("   . level %d : (%x,%x) / P(%x,%x) / C0(%x,%x)"
-                            " C1(%x,%x) / C2(%x,%x) / C3(%x,%x)\n",
-                     level, node_cxy, node_ptr, 
-                     GET_CXY(pa_xp), GET_PTR(pa_xp),
-                     GET_CXY(c0_xp), GET_PTR(c0_xp),
-                     GET_CXY(c1_xp), GET_PTR(c1_xp),
-                     GET_CXY(c2_xp), GET_PTR(c2_xp),
-                     GET_CXY(c3_xp), GET_PTR(c3_xp) );
-                }
-            }
-        }
-    }
-}   // end dqt_barrier_display()
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-// This static (recursive) function is called by the dqt_barrier_wait() function.
-// It traverses the DQT from bottom to root, and decrements the "current" variables.
-// For each traversed node, it blocks and deschedules if it is not the last expected
-//  thread. The last arrived thread reset the local node before returning.
-//////////////////////////////////////////////////////////////////////////////////////////
-static void dqt_barrier_increment( xptr_t  node_xp )
-{
-    uint32_t   expected;
-    uint32_t   sense;
-    uint32_t   arity;
-
-    thread_t * this = CURRENT_THREAD;
-
-    // get node cluster and local pointer
-    dqt_node_t * node_ptr = GET_PTR( node_xp );
-    cxy_t        node_cxy = GET_CXY( node_xp );
-
-    // build relevant extended pointers
-    xptr_t  arity_xp   = XPTR( node_cxy , &node_ptr->arity );
-    xptr_t  sense_xp   = XPTR( node_cxy , &node_ptr->sense );
-    xptr_t  current_xp = XPTR( node_cxy , &node_ptr->current );
-    xptr_t  lock_xp    = XPTR( node_cxy , &node_ptr->lock );
-    xptr_t  root_xp    = XPTR( node_cxy , &node_ptr->root );
-
-#if DEBUG_BARRIER_WAIT
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-uint32_t   level = hal_remote_l32( XPTR( node_cxy, &node_ptr->level ) );
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] increments DQT node(%d,%d,%d) / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, 
-HAL_X_FROM_CXY(node_cxy), HAL_Y_FROM_CXY(node_cxy), level );
-#endif
-
-    // get extended pointer on parent node
-    xptr_t  parent_xp  = hal_remote_l64( XPTR( node_cxy , &node_ptr->parent_xp ) );
-
-    // take busylock
-    remote_busylock_acquire( lock_xp );
-    
-    // get sense and arity values from barrier descriptor
-    sense = hal_remote_l32( sense_xp );
-    arity = hal_remote_l32( arity_xp );
-
-    // compute expected value 
-    expected = (sense == 0) ? 1 : 0;
-
-    // increment current number of arrived threads / get value before increment
-    uint32_t current = hal_remote_atomic_add( current_xp , 1 );
-
-    // last arrived thread reset the local node, makes the recursive call 
-    // on parent node, and reactivates all waiting thread when returning.
-    // other threads block, register in queue, and deschedule.
-
-    if ( current == (arity - 1) )                        // last thread  
-    {
-
-#if DEBUG_BARRIER_WAIT
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] reset DQT node(%d,%d,%d)\n",
-__FUNCTION__ , this->process->pid, this->trdid,
-HAL_X_FROM_CXY(node_cxy), HAL_Y_FROM_CXY(node_cxy), level );
-#endif
-        // reset the current node
-        hal_remote_s32( sense_xp   , expected );
-        hal_remote_s32( current_xp , 0 );
-
-        // release busylock protecting the current node
-        remote_busylock_release( lock_xp );
-
-        // recursive call on parent node when current node is not the root
-        if( parent_xp != XPTR_NULL) dqt_barrier_increment( parent_xp );
-
-        // unblock all waiting threads on this node
-        while( xlist_is_empty( root_xp ) == false )
-        {
-            // get pointers on first waiting thread
-            xptr_t     thread_xp  = XLIST_FIRST( root_xp , thread_t , wait_list );
-            cxy_t      thread_cxy = GET_CXY( thread_xp );
-            thread_t * thread_ptr = GET_PTR( thread_xp );
-
-#if (DEBUG_BARRIER_WAIT & 1)
-trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-process_t * process = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-pid_t       pid     = hal_remote_l32( XPTR( thread_cxy , &process->pid ) ); 
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] unblock thread[%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, pid, trdid );
-#endif
-            // remove waiting thread from queue
-            xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_list ) );
-
-            // unblock waiting thread
-            thread_unblock( thread_xp , THREAD_BLOCKED_USERSYNC );
-        }
-    }
-    else                                               // not the last thread
-    {
-        // get extended pointer on xlist entry from thread
-        xptr_t  entry_xp = XPTR( local_cxy , &this->wait_list );
-        
-        // register calling thread in barrier waiting queue
-        xlist_add_last( root_xp , entry_xp );
-
-        // block calling thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_USERSYNC );
-
-        // release busylock protecting the remote_barrier
-        remote_busylock_release( lock_xp );
-
-#if DEBUG_BARRIER_WAIT
-if( cycle > DEBUG_BARRIER_WAIT )
-printk("\n[%s] thread[%x,%x] blocks on node(%d,%d,%d)\n",
-__FUNCTION__ , this->process->pid, this->trdid,
-HAL_X_FROM_CXY(node_cxy), HAL_Y_FROM_CXY(node_cxy), level );
-#endif
-        // deschedule
-        sched_yield("blocked on barrier");
-    }
-
-    return;
-
-} // end dqt_barrier_decrement()
-
-
Index: trunk/kernel/libk/remote_barrier.h
===================================================================
--- trunk/kernel/libk/remote_barrier.h	(revision 690)
+++ trunk/kernel/libk/remote_barrier.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * remote_barrier.h - POSIX barrier definition.               
+ * remote_barrier.h - distributed kernel barrier definition
  * 
- * Author  Alain Greiner (2016,2017,2018,2019)
+ * Author  Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -10,5 +10,5 @@
  * ALMOS-MKH is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
+err* the Free Software Foundation; version 2.0 of the License.
  *
  * ALMOS-MKH is distributed in the hope that it will be useful, but
@@ -25,285 +25,34 @@
 #define _REMOTE_BARRIER_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <remote_busylock.h>
-#include <xlist.h>
-#include <shared_pthread.h>
+#include <almos_config.h>
+#include <hal_types.h>
 
-/***************************************************************************************
- *       This file defines two implementations for a POSIX compliant barrier.
- *
- * It is used by multi-threaded user applications to synchronise threads running in
- * different clusters. Access functions use RPCs for barrier creation/destruction,
- * and use remote access primitives for actual synchronisation (wait function).
- *
- * A barrier is declared by a given user process as a "pthread_barrier_t" user variable.
- * This user type is implemented in user space as an unsigned long, but the value is not
- * used by the kernel. ALMOS-MKH uses only the barrier virtual address as an identifier.
- * For each user barrier, ALMOS-MKH creates a kernel structure, dynamically allocated 
- * by the generic_barrier_create() function, destroyed by the generic_barrier_destroy()
- * function, and used by the generic_barrier_wait() function.
- *
- * Implementation note:
- * ALMOS-MKH supports two barrier implementations:
- *
- * 1) simple_barrier_t
- *    If the pointer on the barrier attributes is NULL, the barrier is implemented as
- *    a shared variable localized in the reference process cluster. 
- *    There is a risk of contention when the number of synchronizing threads is large.
- *
- * 2) dqt_barrier_t
- *    If the (x_size, y_size, nthreads) arguments are defined in the barrier attributes,
- *    the barrier is implemented as a hierarchical quad-tree covering all clusters in the
- *    (x_size * ysize) mesh, including cluster (0,0), with nthreads per cluster.
- *    This DQT (Distributed Quad Tree) implementation assumes a regular architecture, 
- *    and a strong contraint on the threads placement: exactly "nthreads" threads per 
- *    cluster in the (x_size * y_size) mesh.
- *
- * For both implementations, the blocking "generic_barrier_wait()" function implements
- * a descheduling policy when the calling thread is not the last expected thread: 
- * the calling thread is registered in a waiting queue, rooted in the barrier structure, 
- * and the the calling thread is blocked on the THREAD_BLOCKED_USERSYNC condition. 
- * The last arrived thread unblocks all registered waiting threads.
- * **************************************************************************************/
+/*****************************************************************************************
+ * This structure defines a distributed "rendez-vous" barrier, that can be used
+ * to synchronise several kernel threads running in different clusters
+ * It is used in the parallel kernel_init phase.
+ * It does not need to be initialised, but it must be statically allocated 
+ * in the KDATA segment to be properly initialised by the compiler/loader.
+ ****************************************************************************************/
+
+typedef struct remote_barrier_s
+{
+    uint32_t   current;   // number of arrived threads
+    uint32_t   sense;     // barrier state (toggle)
+    uint32_t   pad[(CONFIG_CACHE_LINE_SIZE>>2)-2];
+} 
+remote_barrier_t;
+
+/*****************************************************************************************
+ * This blocking function implements a toggle barrier. It returns only when all
+ * expected threads reach the barrier. It can be used several times without
+ * specific initialisation. 
+ * It is portable, as it uses the remote_lw() & remote_sw() access functions.
+ * @ xp      : extended pointer on barrier in remote cluster
+ * @ count   : number of expected thread
+ ****************************************************************************************/
+inline void remote_barrier( xptr_t   xp,  
+                            uint32_t count );
 
 
-
-/*****************************************************************************************
- *                 generic barrier descriptor and access functions
- *****************************************************************************************
- * This generic structure is used by both the simple and the QOT implementations.
- * It is implemented in the reference process cluster, and contains
- * - the barrier identifier,
- * - the implementation type (simple or dqt),
- * - an xlist implementing the set of barriers dynamically created by a given process,
- * - a pointer on the implementation specific descriptor (simple_barrier / sqt_barrier).
- ****************************************************************************************/
-
-typedef struct generic_barrier_s
-{
-    intptr_t              ident;      /*! virtual address in user space == identifier   */
-    xlist_entry_t         list;       /*! member of list of barriers in same process    */
-    bool_t                is_dqt;     /*! DQT implementation when true                  */
-    void                * extend;     /*! implementation specific barrier descriptor    */
-} 
-generic_barrier_t;
-
-/*****************************************************************************************
- * This function returns an extended pointer on the remote barrier identified
- * by its virtual address in a given user process. It makes an associative search, 
- * scanning the list of barriers rooted in the reference process descriptor.
- * It can be used for both simple and DQT barriers, registered in the same list.
- *****************************************************************************************
- * @ ident    : barrier virtual address, used as identifier.
- * @ returns extended pointer on barrier if success / returns XPTR_NULL if not found. 
- ****************************************************************************************/
-xptr_t generic_barrier_from_ident( intptr_t  ident );
-
-/*****************************************************************************************
- * This function implements the pthread_barrier_init() syscall.
- * It allocates and initialises the generic barrier descriptor in the reference process 
- * cluster, and - depending on the <attr> argument, calls the relevant (simple or DQT) 
- * function to allocate and initialize the implementation dependant barrier descriptor.
- * Finally, it registers the barrier in the reference process xlist of user barriers.
- * It can be called by a thread running in any cluster, as it use RPC if required.
- *****************************************************************************************
- * @ ident    : barrier virtual address, used as identifier.
- * @ count    : number of expected threads.
- * @ attr     : barrier attributes (x_size,y_size,nthreads), used by QDT implementation.
- * @ returns 0 if success / returns -1 if not found. 
- ****************************************************************************************/
-error_t generic_barrier_create( intptr_t                ident,
-                                uint32_t                count,
-                                pthread_barrierattr_t * attr );
-
-/*****************************************************************************************
- * This function implements the pthread_barrier_destroy() syscall.
- * It calls the relevant function (simple or DQT) to release the memory allocated for 
- * the implementation specific barrier descriptor, and releases the memory allocated
- * for the generic barrier descriptor.
- * It removes the barrier from the list of barriers rooted in the reference process.
- * It can be called by a thread running in any cluster, as it use RPC if required.
- *****************************************************************************************
- * @ gen_barrier_xp  : extended pointer on generic barrier descriptor.
- ****************************************************************************************/
-void generic_barrier_destroy( xptr_t gen_barrier_xp );
-
-/*****************************************************************************************
- * This blocking function implements the pthread_barrier_wait() syscall.
- * It calls the relevant function (simple or DQT) depending on the implementation,
- * and returns only when all expected threads reach the barrier.
- * It can be called by a thread running in any cluster, as it use remote accesses.
- *****************************************************************************************
- * @ gen_barrier_xp   : extended pointer on generic barrier descriptor.
- ****************************************************************************************/
-void generic_barrier_wait( xptr_t gen_barrier_xp );
-
-
-/*****************************************************************************************
- * This debug function uses remote accesses to display the current state of a generic
- * barrier identified by the <gen_barrier_xp> argument. 
- * It calls the relevant function (simple or DQT) to display relevant information.
- * It can be called by a thread running in any cluster.
- *****************************************************************************************
- * @ barrier_xp   : extended pointer on generic barrier descriptor.
- ****************************************************************************************/
-
-void generic_barrier_display( xptr_t gen_barrier_xp );
-
-
-
-/*****************************************************************************************
- *                        simple barrier descriptor
- *****************************************************************************************
- * This structure defines the simple barrier descriptor. It is localized in the process
- * reference cluster, as an extension of the generic barrier descriptor.
- * It implements a toggle barrier remotely accessed by all threads.
- * It contains the root of the xlist registering all arrived threads.
- ****************************************************************************************/
-
-typedef struct simple_barrier_s
-{
-    remote_busylock_t  lock;          /*! lock protecting list of waiting threads       */
-    uint32_t           current;       /*! number of arrived threads                     */
-    uint32_t           sense;         /*! barrier state (toggle)                        */
-    uint32_t           arity;         /*! number of expected threads                    */ 
-    xlist_entry_t      root;          /*! root of list of waiting threads               */
-} 
-simple_barrier_t;
-
-/*****************************************************************************************
- * This function allocates memory for the simple barrier descriptor in the reference 
- * cluster of the calling process. It initializes the barrier state and returns
- * a local pointer on the created simple barrier descriptor in reference cluster.
- * It can be called by a thread running in any cluster, as it use RPC if required.
- *****************************************************************************************
- * @ count          : [in] number of expected threads.
- * @ return Local pointer on barrier descriptor if success / return NULL if failure.
- ****************************************************************************************/
-simple_barrier_t * simple_barrier_create( uint32_t  count );
-
-/*****************************************************************************************
- * This function releases the memory allocated for the simple barrier descriptor. 
- * It can be called by a thread running in any cluster, as it use RPC if required.
- *****************************************************************************************
- * @ barrier_xp  : extended pointer on simple barrier descriptor.
- ****************************************************************************************/
-void simple_barrier_destroy( xptr_t   barrier_xp );
-
-/*****************************************************************************************
- * This blocking function returns only when all expected threads reach the barrier.
- * It can be called by a thread running in any cluster, as it use remote accesses.
- * Waiting threads use a descheduling policy.
- *****************************************************************************************
- * @ barrier_xp   : extended pointer on simple barrier descriptor.
- ****************************************************************************************/
-void simple_barrier_wait( xptr_t   barrier_xp );
-
-/*****************************************************************************************
- * This debug function uses remote accesses to display the current state of a simple
- * barrier identified by the <barrier_xp> argument.
- * It can be called by a thread running in any cluster.
- *****************************************************************************************
- * @ barrier_xp   : extended pointer on simple barrier descriptor.
- ****************************************************************************************/
-void simple_barrier_display( xptr_t barrier_xp );
-
-
-
-
-/*****************************************************************************************
- *                              dqt_barrier
- *****************************************************************************************
- * These structuree define  the hierarchical DQT barrier, physically distributed in a
- * mesh of clusters defined by the (x_size, y_size, nthreads) arguments:
- *   . The involved clusters form a mesh [x_size * y_size]
- *   . The lower left involved cluster is cluster(0,0)  
- *   . The number of threads per cluster is the same in all clusters.
- *
- * Implementation note:
- * - The quad three is implemented as a three dimensions array of node[x][y][l]
- *   . [x][y] are the cluster coordinates / max values are (DQT_XMAX-1), (DQT_YMAX-1)
- *   . [l] is the node level / 0 for terminal nodes / (DQT_LMAX-1) for the root node
- * - The dqt_barrier_t is the global barrier descriptor, allocated in the reference
- *   process cluster as an extension of the generic barrier descriptor. It contains a
- *   3D array of extended pointers on all DQT nodes implementing the DQT barrier.
- * - The dqt_node_t is a local barrier implementing a togle barrier between all threads
- *   of a given cluster (for a terminal node), or between all representatives of the four
- *   children nodes (for a non terminal node).
- ****************************************************************************************/
-
-#define  DQT_XMAX    16               // max number of clusters in a row
-#define  DQT_YMAX    16               // max number of clusters in a column
-#define  DQT_LMAX    5                // max depth of the quad tree
-
-typedef struct dqt_node_s
-{
-    remote_busylock_t  lock;          /*! lock protecting list of waiting threads       */
-    volatile uint32_t  sense;         /*! barrier state (toggle)                        */
-    volatile uint32_t  current;       /*! number of locally arrived threads             */
-    uint32_t           arity;         /*! total number of locally expected threads      */
-    uint32_t           level;         /*! hierarchical level (0 is bottom)              */
-    xptr_t             parent_xp;     /*! x_pointer on parent node (NULL for root)      */
-    xptr_t             child_xp[4];   /*! x_pointer on children node (NULL for bottom)  */
-    xlist_entry_t      root;          /*! root of list of waiting threads               */
-}
-dqt_node_t;
-
-typedef struct dqt_barrier_s
-{
-    xptr_t    node_xp[DQT_XMAX][DQT_YMAX][DQT_LMAX];  /*! array of xptr on DQT nodes    */
-
-    uint32_t  x_size;                 /*! number of clusters in one row of DQT mesh     */
-    uint32_t  y_size;                 /*! number of clusters in one column of DQT mesh  */
-    uint32_t  nthreads;               /*! number of expected threads in one cluster     */
-} 
-dqt_barrier_t;
-
-/*****************************************************************************************
- * This function allocates memory for the DQT barrier descriptor in the reference cluster
- * of the calling process. It allocates also memory in all clusters of the QDT mesh, 
- * to store up to 5 QDT nodes per cluster. 
- * It initializes the barrier descriptor, including initialisation of the parent/children
- * extended pointers in the distributed QDT nodes.
- * It returns a local pointer on the QDT barrier descriptor in reference cluster.
- * It can be called by a thread running in any cluster, as it use RPCs for memory
- * allocation, and remote access for QDT initialisation.
- *****************************************************************************************
- * @ x_size      : [in] number of clusters in a line of DQT mesh.
- * @ y_size      : [in] number of clusters in a column of DQT mesh.
- * @ nthreads    : [in] number of threads per cluster.
- * @ return Local pointer on barrier descriptor if success / return NULL if failure.
- ****************************************************************************************/
-dqt_barrier_t * dqt_barrier_create( uint32_t  x_size,
-                                    uint32_t  y_size,
-                                    uint32_t  nthreads );
-
-/*****************************************************************************************
- * This function releases all memory allocated for the QDT barrier descriptor.
- * It removes the barrier from the list of barriers rooted in the reference process.
- * It can be called by a thread running in any cluster, as it use RPCs.
- *****************************************************************************************
- * @ barrier_xp  : extended pointer on DQT barrier descriptor.
- ****************************************************************************************/
-void dqt_barrier_destroy( xptr_t   barrier_xp );
-
-/*****************************************************************************************
- * This blocking function returns only when all expected threads reach the barrier.
- * It can be called by a thread running in any cluster, as it use remote accesses.
- * Waiting threads use a descheduling policy.
- *****************************************************************************************
- * @ barrier_xp   : extended pointer on DQT barrier descriptor.
- ****************************************************************************************/
-void dqt_barrier_wait( xptr_t   barrier_xp );
-
-/*****************************************************************************************
- * This debug function uses remote accesses to display the current state of all 
- * ditributed nodes in a DQT barrier identified by the <barrier_xp> argument.
- * It can be called by a thread running in any cluster.
- *****************************************************************************************
- * @ barrier_xp   : extended pointer on DQT barrier descriptor.
- ****************************************************************************************/
-void dqt_barrier_display( xptr_t barrier_xp );
-
 #endif	/* _REMOTE_BARRIER_H_ */
Index: trunk/kernel/libk/remote_buf.c
===================================================================
--- trunk/kernel/libk/remote_buf.c	(revision 690)
+++ 	(revision )
@@ -1,406 +1,0 @@
-/*
- * remote_buf.c Remotely accessible, circular buffer implementation.
- *
- * Authors : Alain Greiner  (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <hal_remote.h>
-#include <hal_uspace.h>
-#include <bits.h>
-#include <memcpy.h>
-#include <kmem.h>
-#include <remote_buf.h>
-
-/////////////////////////////////////////////
-remote_buf_t * remote_buf_alloc( cxy_t  cxy )
-{
-    return kmem_remote_alloc( cxy,
-                              bits_log2(sizeof(remote_buf_t)),
-                              AF_ZERO );
-}
-
-/////////////////////////////////////////
-error_t remote_buf_init( xptr_t   buf_xp,
-                         uint32_t order )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-assert( __FUNCTION__ , (order < 32) , "order cannot be larger than 31" );
-
-    uint8_t      * data;
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    // allocate the data buffer
-    data = kmem_remote_alloc( buf_cxy , order , AF_NONE );
-
-    if( data == NULL )  return -1;
-
-    // initialize buffer descriptor
-    hal_remote_s32( XPTR( buf_cxy , &buf_ptr->order ) , order );
-    hal_remote_s32( XPTR( buf_cxy , &buf_ptr->wid   ) , 0 );
-    hal_remote_s32( XPTR( buf_cxy , &buf_ptr->rid   ) , 0 );
-    hal_remote_s32( XPTR( buf_cxy , &buf_ptr->sts   ) , 0 );
-    hal_remote_spt( XPTR( buf_cxy , &buf_ptr->data  ) , data );
-
-    return 0;
-
-}  // end remote_buf_init()
-
-//////////////////////////////////////////////
-void remote_buf_release_data( xptr_t  buf_xp )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    // gets data buffer local pointer and order
-    uint32_t  order    = hal_remote_l32( XPTR( buf_cxy , &buf_ptr->order ));
-    char    * data_ptr = hal_remote_lpt( XPTR( buf_cxy , &buf_ptr->data ));
-
-    // release memory allocated for data buffer  if required
-    if( data_ptr != NULL )  kmem_remote_free( buf_cxy , data_ptr , order );
- 
-}  // end remote_buf_release_data()
-
-/////////////////////////////////////////
-void remote_buf_destroy( xptr_t  buf_xp )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    // release data buffer
-    remote_buf_release_data( buf_xp );
-
-    // release remote_buf descriptor
-    kmem_remote_free( buf_cxy , buf_ptr , bits_log2(sizeof(remote_buf_t)) );
-
-}  // end remote_buf_destroy()
-
-/////////////////////////////////////////
-void remote_buf_reset( xptr_t    buf_xp )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    hal_remote_s32( XPTR( buf_cxy , &buf_ptr->wid ) , 0 );
-    hal_remote_s32( XPTR( buf_cxy , &buf_ptr->rid ) , 0 );
-    hal_remote_s32( XPTR( buf_cxy , &buf_ptr->sts ) , 0 );
-}
-
-/////////////////////////////////////////////////
-error_t remote_buf_get_to_user( xptr_t    buf_xp,
-                                uint8_t * u_buf, 
-                                uint32_t  nbytes )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    // build relevant extended pointers
-    xptr_t sts_xp   = XPTR( buf_cxy , &buf_ptr->sts );
-    xptr_t rid_xp   = XPTR( buf_cxy , &buf_ptr->rid );
-    xptr_t order_xp = XPTR( buf_cxy , &buf_ptr->order );
-    xptr_t data_xp  = XPTR( buf_cxy , &buf_ptr->data );
-
-    // get relevant infos from remote buffer descriptor
-    uint32_t  sts  = hal_remote_l32( sts_xp );
-    uint32_t  rid  = hal_remote_l32( rid_xp );
-    uint32_t  order = hal_remote_l32( order_xp );
-    uint8_t * data = hal_remote_lpt( data_xp );
-
-    uint32_t  size = 1 << order;
-    uint32_t  mask = size - 1; 
-
-    // check enough bytes in buffer
-    if( nbytes > sts ) return -1;
-
-    // move nbytes 
-    if( (rid + nbytes) <= size)  // no wrap around => one move
-    {
-        hal_copy_to_uspace( u_buf,
-                            XPTR( buf_cxy , data + rid ),
-                            nbytes );
-    }
-    else                         // wrap around => two moves
-    {
-        uint32_t bytes_1 = size - rid;
-        uint32_t bytes_2 = nbytes - bytes_1;
-     
-        hal_copy_to_uspace( u_buf,
-                            XPTR( buf_cxy , data + rid ),
-                            bytes_1 );
-
-        hal_copy_to_uspace( u_buf + bytes_1,
-                            XPTR( buf_cxy , data ),
-                            bytes_2 );
-    }
-
-    // update rid in buffer descriptor
-    hal_remote_s32( rid_xp , (rid + nbytes) & mask );
-
-    // atomically update sts
-    hal_remote_atomic_add( sts_xp , -nbytes );
-
-    return 0;
-
-}  // end remote_buf_get_to_user()
-
-///////////////////////////////////////////////////
-error_t remote_buf_get_to_kernel( xptr_t    buf_xp,
-                                  uint8_t * k_buf,
-                                  uint32_t  nbytes )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    // build relevant extended pointers
-    xptr_t sts_xp   = XPTR( buf_cxy , &buf_ptr->sts );
-    xptr_t rid_xp   = XPTR( buf_cxy , &buf_ptr->rid );
-    xptr_t order_xp = XPTR( buf_cxy , &buf_ptr->order );
-    xptr_t data_xp  = XPTR( buf_cxy , &buf_ptr->data );
-
-    // get relevant infos from remote buffer descriptor
-    uint32_t  sts  = hal_remote_l32( sts_xp );
-    uint32_t  rid  = hal_remote_l32( rid_xp );
-    uint32_t  order = hal_remote_l32( order_xp );
-    uint8_t * data = hal_remote_lpt( data_xp );
-
-    uint32_t  size = 1 << order;
-    uint32_t  mask = size - 1; 
-
-    // check enough bytes in buffer
-    if( nbytes > sts ) return -1;
-
-    // move nbytes 
-    if( (rid + nbytes) <= size)  // no wrap around => one move
-    {
-        hal_remote_memcpy( XPTR( local_cxy , k_buf ),
-                           XPTR( buf_cxy   , data + rid ),
-                           nbytes );
-    }
-    else                         // wrap around => two moves
-    {
-        uint32_t bytes_1 = size - rid;
-        uint32_t bytes_2 = nbytes - bytes_1;
-     
-        hal_remote_memcpy( XPTR( local_cxy , k_buf ),
-                           XPTR( buf_cxy   , data + rid ),
-                           bytes_1 );
-
-        hal_remote_memcpy( XPTR( local_cxy , k_buf + bytes_1 ),
-                           XPTR( buf_cxy   , data ),
-                           bytes_2 );
-    }
-
-    // update rid in buffer descriptor
-    hal_remote_s32( rid_xp , (rid + nbytes) & mask );
-
-    // atomically update sts
-    hal_remote_atomic_add( sts_xp , -nbytes );
-
-    return 0;
-
-}  // end remote_buf_get_to_kernel()
-
-///////////////////////////////////////////////////
-error_t remote_buf_put_from_user( xptr_t    buf_xp,
-                                  uint8_t * u_buf,
-                                  uint32_t  nbytes )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    // build relevant extended pointers
-    xptr_t sts_xp   = XPTR( buf_cxy , &buf_ptr->sts );
-    xptr_t wid_xp   = XPTR( buf_cxy , &buf_ptr->wid );
-    xptr_t order_xp = XPTR( buf_cxy , &buf_ptr->order );
-    xptr_t data_xp  = XPTR( buf_cxy , &buf_ptr->data );
-
-    // get relevant infos from remote buffer descriptor
-    uint32_t  sts  = hal_remote_l32( sts_xp );
-    uint32_t  wid  = hal_remote_l32( wid_xp );
-    uint32_t  order = hal_remote_l32( order_xp );
-    uint8_t * data = hal_remote_lpt( data_xp );
-
-    uint32_t  size = 1 << order;
-    uint32_t  mask = size - 1; 
-
-    // check enough space in buffer
-    if( nbytes > (size - sts) ) return -1;
-
-    // move nbytes 
-    if( (wid + nbytes) <= size)  // no wrap around => one move
-    {
-        hal_copy_from_uspace( XPTR( buf_cxy , data + wid ),
-                              u_buf,
-                              nbytes );
-    }
-    else                         // wrap around => two moves
-    {
-        uint32_t bytes_1 = size - wid;
-        uint32_t bytes_2 = nbytes - bytes_1;
-     
-        hal_copy_from_uspace( XPTR( buf_cxy , data + wid ),
-                              u_buf,
-                              bytes_1 );
-
-        hal_copy_from_uspace( XPTR( buf_cxy , data ),
-                              u_buf + bytes_1,
-                              bytes_2 );
-    }
-
-    // update wid in buffer descriptor
-    hal_remote_s32( wid_xp , (wid + nbytes) & mask );
-
-    // atomically update sts
-    hal_remote_atomic_add( sts_xp , nbytes );
-
-    return 0;
-
-}  // end remote_buf_put_from_user()
-
-/////////////////////////////////////////////////////
-error_t remote_buf_put_from_kernel( xptr_t    buf_xp,
-                                    uint8_t * k_buf, 
-                                    uint32_t  nbytes )
-{
-
-assert( __FUNCTION__ , (buf_xp != XPTR_NULL) , "buf_xp cannot be NULL" );
-
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    // build relevant extended pointers
-    xptr_t sts_xp   = XPTR( buf_cxy , &buf_ptr->sts );
-    xptr_t wid_xp   = XPTR( buf_cxy , &buf_ptr->wid );
-    xptr_t order_xp = XPTR( buf_cxy , &buf_ptr->order );
-    xptr_t data_xp  = XPTR( buf_cxy , &buf_ptr->data );
-
-    // get relevant infos from remote buffer descriptor
-    uint32_t  sts  = hal_remote_l32( sts_xp );
-    uint32_t  wid  = hal_remote_l32( wid_xp );
-    uint32_t  order = hal_remote_l32( order_xp );
-    uint8_t * data = hal_remote_lpt( data_xp );
-
-    uint32_t  size = 1 << order;
-    uint32_t  mask = size - 1; 
-
-    // check enough space in buffer
-    if( nbytes > (size - sts) ) return -1;
-
-    // move nbytes 
-    if( (wid + nbytes) <= size)  // no wrap around => one move
-    {
-        hal_remote_memcpy( XPTR( buf_cxy   , data + wid ),
-                           XPTR( local_cxy , k_buf ),
-                           nbytes );
-    }
-    else                         // wrap around => two moves
-    {
-        uint32_t bytes_1 = size - wid;
-        uint32_t bytes_2 = nbytes - bytes_1;
-     
-        hal_remote_memcpy( XPTR( buf_cxy   , data + wid ),
-                           XPTR( local_cxy , k_buf ),
-                           bytes_1 );
-
-        hal_remote_memcpy( XPTR( buf_cxy   , data ),
-                           XPTR( local_cxy , k_buf + bytes_1 ),
-                           bytes_2 );
-    }
-
-    // update wid in buffer descriptor
-    hal_remote_s32( wid_xp , (wid + nbytes) & mask );
-
-    // atomically update sts
-    hal_remote_atomic_add( sts_xp , nbytes );
-
-    return 0;
-
-}  // end remote_buf_put_from_kernel()
-
-////////////////////////////////////////////
-uint32_t remote_buf_status( xptr_t  buf_xp )
-{
-    remote_buf_t * buf_ptr = GET_PTR( buf_xp );
-    cxy_t          buf_cxy = GET_CXY( buf_xp );
-
-    return hal_remote_l32( XPTR( buf_cxy , &buf_ptr->sts ) );
-    
-}  // end remote_buf_status()
-
-///////////////////////////////////////////////
-void remote_buf_display( const char * func_str,
-                         xptr_t       buf_xp,
-                         uint32_t     nbytes,
-                         uint32_t     offset )
-{
-    if( nbytes > 256 )
-    {
-        printk("\n[WARNING] in %s : no more than 256 bytes\n", __FUNCTION__ );
-        nbytes = 256;
-    }
-
-    uint8_t        string[128];          // for header
-    uint8_t        local_data[256];      // local data buffer
-
-    cxy_t          cxy = GET_CXY( buf_xp ); 
-    remote_buf_t * ptr = GET_PTR( buf_xp );
-
-    uint32_t   order = hal_remote_l32( XPTR( cxy , &ptr->order ));
-    uint32_t   rid   = hal_remote_l32( XPTR( cxy , &ptr->rid ));
-    uint32_t   wid   = hal_remote_l32( XPTR( cxy , &ptr->wid ));
-    uint32_t   sts   = hal_remote_l32( XPTR( cxy , &ptr->sts ));
-    uint8_t  * data  = hal_remote_lpt( XPTR( cxy , &ptr->data ));
-
-    // make a local copy of data buffer
-    hal_remote_memcpy( XPTR( local_cxy , local_data ),
-                       XPTR( cxy , data + offset ), 
-                       nbytes );
-
-    // build header
-    snprintk( (char*)string , 128 ,
-    "in %s remote buffer [%x,%x] : size %d / rid %d / wid %d / sts %d ",
-    func_str , cxy , ptr , 1<<order , rid , wid , sts );
-
-    // display buffer on TXT0
-    putb( (char*)string , local_data , nbytes );
-
-}  // end remote_buf_display()
Index: trunk/kernel/libk/remote_buf.h
===================================================================
--- trunk/kernel/libk/remote_buf.h	(revision 690)
+++ 	(revision )
@@ -1,194 +1,0 @@
-/*
- * remote_buf.h -  Remotely accessible, circular buffer definition.
- *
- * Authors : 
- *           Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MHH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _REMOTE_BUFFER_H_
-#define _REMOTE_BUFFER_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-
-/************************************************************************************
- * This structure and the associated access functions define a remotely accessible,
- * kernel buffer, handled as a single-reader & single-writer FIFO. 
- * This kernel buffer is implementes as an array of bytes. The size must be a power
- * of 2, dynamically defined by an argument of the "remote_buf_init()" function. 
- * The "put()" and "get()" functions defined below move the content of another
- * buffer (can be in kernel or in user space) to/from this circular kernel buffer.
- * This structure is NOT protected by a lock, as the only shared variable is the 
- * "sts" variable, that is updated by the hal_remote_atomic_add() primitive.
- *
- * - It is used to implement the three socket buffers (rx_buf / r2tq / crqq).
- * - It is also used to implement the inter-process communications channels
- *   based on named "fifos", or unamed "pipes".
- ***********************************************************************************/
-
-typedef struct remote_buf_s
-{
-    uint32_t   order;   /*! ln2( size of data buffer in bytes)                     */
-	uint32_t   rid;     /*! first empty slot index                                 */
-	uint32_t   wid;     /*! first non-empty slot index                             */
-    uint32_t   sts;     /*! current number of non empty slots                      */
-	uint8_t  * data;    /*! local pointer on local data buffer                     */
-}
-remote_buf_t;
-
-/************************************************************************************
- * This function allocates memory for a remote_buf descriptor in cluster 
- * defined by the <cxy> argument, and return a local pointer on this descriptor.
- ************************************************************************************
- * @ cxy    : target cluster identifier.
- * @ return local pointer on remote_buf descriptor.
- ***********************************************************************************/
-remote_buf_t * remote_buf_alloc( cxy_t  cxy );
-
-/************************************************************************************
- * This function initializes a remote_buf descriptor identified by the <buf_xp>
- * argument. It allocates memory for the data, as defined by the <order> argument,
- * and initializes the buffer as empty. It must be called by a local thread.
- * The <order> value cannot be larger than 31.
- ************************************************************************************
- * @ buf_xp    : [in] extended pointer on buffer descriptor.
- * @ order     : [in] ln2( number of bytes in buffer) / must be in [0,31].
- * @ return  0 if success / return -1 if memory failure or illegal order.
- ***********************************************************************************/
-error_t remote_buf_init( xptr_t   buf_xp,
-                         uint32_t order );
-
-/************************************************************************************
- * This function releases memory allocated for the data buffer of an embedded
- * remote-buf descriptor identified by the <buf_xp> argument, when the "data"
- * pointer is not NULL. It does nothing if the data buffer was not allocated. 
- * WARNING : do NOT use this function for a dynamically allocated remote_buf.
- ************************************************************************************
- * @ buf_xp      : [in] extended pointer on buffer descriptor.
- ***********************************************************************************/
-void remote_buf_release_data( xptr_t buf_xp );
-
-/************************************************************************************
- * This function releases both the memory allocated for the data buffer, and the
- * memory allocated for the remote_buf descriptor, for a remote-buf identified 
- * by the <buf_xp> argument. 
- * WARNING : do NOT use this function an embedded remote_buf.
- ************************************************************************************
- * @ buf_xp      : [in] extended pointer on buffer descriptor.
- ***********************************************************************************/
-void remote_buf_destroy( xptr_t buf_xp );
-
-/************************************************************************************
- * This function initialises as empty a buffer identified by the <buf_xp> argument.
- * It can be called by a thread runing in any cluster.
- ************************************************************************************
- * @ buf_xp    : [in] extended pointer on remote buffer descriptor.
- ***********************************************************************************/
-void remote_buf_reset( xptr_t buf_xp );
-
-/************************************************************************************
- * This function moves <nbytes> from a remote_buf_t identified by the <buf_xp>
- * argument to an user buffer identified by the <u_buf> argument.
- * It uses the hal_copy_to_uspace() function, and updates "sts" and "ptr".
- * The calling function is supposed to previously check the buffer status. 
- * It can be called by a thread runing in any cluster.
- ************************************************************************************
- * @ buf_xp    : [in] extended pointer pointer on remote buffer descriptor.
- * @ u_buf     : [in] pointer on destination user buffer in user space.
- * @ nbytes    : [in] number of bytes to move.
- * @ return 0 if success / return -1 if not enough bytes in buffer.
- ***********************************************************************************/
-error_t remote_buf_get_to_user( xptr_t    buf_xp,
-                                uint8_t * u_buf,
-                                uint32_t  nbytes );
-
-/************************************************************************************
- * This function moves <nbytes> from a remote_buf_t identified by the <buf_xp>
- * argument to a local kernel buffer identified by the <k_buf> argument.
- * It uses an hal_remote_memcpy() function, and updates the "sts" and "ptr" fields.
- * The calling function is supposed to previously check the buffer status. 
- * It can be called by a thread runing in any cluster.
- ************************************************************************************
- * @ buf_xp    : [in] extended pointer pointer on remote buffer descriptor.
- * @ k_buf     : [in] local pointer on local destination kernel buffer.
- * @ nbytes    : [in] number of bytes to move.
- * @ return 0 if success / return -1 if not enough bytes in buffer.
- ***********************************************************************************/
-error_t remote_buf_get_to_kernel( xptr_t    buf_xp,
-                                  uint8_t * k_buf,
-                                  uint32_t  nbytes );
-
-/************************************************************************************
- * This function moves <nbytes> from an user buffer identified by the <u_buf> 
- * argument to a remote_buf_t identified by the <buf_xp> argument.
- * It uses the hal_copy_from_uspace() function, and updates "sts" and "ptw"..
- * The calling function is supposed to previously check the buffer status. 
- * It can be called by a thread runing in any cluster.
- ************************************************************************************
- * @ buf_xp    : [in] extended pointer pointer on remote buffer descriptor.
- * @ u_buf     : [in] pointer on source user buffer in user space.
- * @ nbytes    : [in] number of bytes to move.
- * @ return 0 if success / return -1 if not enough bytes in buffer.
- ***********************************************************************************/
-error_t remote_buf_put_from_user( xptr_t    buf_xp,
-                                  uint8_t * u_buf,
-                                  uint32_t  nbytes );
-
-/************************************************************************************
- * This function moves <nbytes> from a local kernel buffer identified by the <k_buf> 
- * argument to a remote_buf_t identified by the <buf_xp> argument.
- * It uses an hal_remote_memcpy() function, and updates the "sts" and "ptw" fields.
- * The calling function is supposed to previously check the buffer status. 
- * It can be called by a thread runing in any cluster.
- ************************************************************************************
- * @ buf_xp    : [in] extended pointer pointer on remote buffer descriptor.
- * @ k_buf     : [in] local pointer on local source kernel buffer.
- * @ nbytes    : [in] number of bytes to move.
- * @ return 0 if success / return -1 if not enough bytes in buffer.
- ***********************************************************************************/
-error_t remote_buf_put_from_kernel( xptr_t    buf_xp,
-                                    uint8_t * k_buf,
-                                    uint32_t  nbytes );
-
-/************************************************************************************
- * This function returns the current number of bytes stored in buffer.
- ************************************************************************************
- * @ buf_xp    : [in] extended pointer pointer on remote buffer descriptor.
- * @ return current number of bytes in buffer.
- ***********************************************************************************/
-uint32_t remote_buf_status( xptr_t  buf_xp );
-
-/************************************************************************************
- * This debug function displays on the kernel terminal the current state of a remote
- * buffer identified by the <buf_xp> argument : order / rid / wid / sts.
- * If the <nbytes> argument is not nul, and not larger than 256, it displays up to
- * 256 bytes of the data buffer, from <offset> to (offset + nbytes -1).
- ************************************************************************************
- * @ func_str  : [in] calling function name (displayed in header).  
- * @ buf_xp    : [in] extended pointer pointer on remote buffer descriptor.
- * @ nbytes    : [in] number of data bytes to display.
- * @ offset    : [in] index of first displayed byte in data buffer.
- ***********************************************************************************/
-void remote_buf_display( const char * func_str,
-                         xptr_t       buf_xp,
-                         uint32_t     nbytes,
-                         uint32_t     offset );
-
-#endif	/* _REMOTE_BUFFER_H_ */
Index: trunk/kernel/libk/remote_busylock.c
===================================================================
--- trunk/kernel/libk/remote_busylock.c	(revision 690)
+++ 	(revision )
@@ -1,148 +1,0 @@
-/*
- * remote_busylock.c - remote kernel busy-waiting lock implementation.
- *
- * Authors     Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <hal_special.h>
-#include <hal_remote.h>
-#include <thread.h>
-#include <remote_busylock.h>
-
-//////////////////////////////////////////////////////////////////////////////
-//                Extern global variables
-//////////////////////////////////////////////////////////////////////////////
-
-extern char               * lock_type_str[];    // allocated in kernel_init.c
-extern chdev_directory_t    chdev_dir;          // allocated in kernel_init.c
-
-
-////////////////////////////////////////////
-void remote_busylock_init( xptr_t   lock_xp,
-                           uint32_t type )
-{
-    // get remote lock cluster and local pointer 
-    cxy_t        lock_cxy = GET_CXY( lock_xp );
-    busylock_t * lock_ptr = GET_PTR( lock_xp );
-
-    hal_remote_s32( XPTR( lock_cxy , &lock_ptr->ticket  ) , 0 );
-    hal_remote_s32( XPTR( lock_cxy , &lock_ptr->current ) , 0 );
-    hal_remote_s32( XPTR( lock_cxy , &lock_ptr->type    ) , type );
-
-#if DEBUG_BUSYLOCK_TYPE
-    xlist_entry_init( XPTR( lock_cxy , &lock_ptr->xlist ) ); 
-#endif
-
-}
-
-////////////////////////////////////////////////
-void remote_busylock_acquire( xptr_t   lock_xp )
-{
-    reg_t      save_sr;
-    thread_t * this = CURRENT_THREAD;
-
-    // get remote lock cluster and local pointer 
-    cxy_t        lock_cxy = GET_CXY( lock_xp );
-    busylock_t * lock_ptr = GET_PTR( lock_xp );
-
-    // enter critical section 
-    hal_disable_irq( &save_sr );
- 
-    // get one ticket
-    uint32_t ticket = hal_remote_atomic_add( XPTR( lock_cxy , &lock_ptr->ticket ) , 1 );
-
-    // poll current until success
-    xptr_t current_xp = XPTR( lock_cxy , &lock_ptr->current );
-    while( hal_remote_l32( current_xp ) != ticket ) asm volatile ("nop");
-
-    // increment thread locks counter
-    this->busylocks++;
-
-    // save SR in lock descriptor
-    hal_remote_s32( XPTR( lock_cxy , &lock_ptr->save_sr ) , save_sr );
-
-    // memory barrier to update busylock and thread state
-    hal_fence();
-    
-#if DEBUG_BUSYLOCK_TYPE
-uint32_t type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->type ) );
-if( type != LOCK_CHDEV_TXT0 )
-{
-    // update thread list of busyslocks
-    xptr_t root_xp = XPTR( local_cxy , &this->busylocks_root );
-    xlist_add_last( root_xp , XPTR( lock_cxy  , &lock_ptr->xlist ) );
-}
-if( (type               == DEBUG_BUSYLOCK_TYPE) && 
-    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
-    (this->trdid        == DEBUG_BUSYLOCK_TRDID) )
-{
-    printk("\n[%s] thread[%x,%x] ACQUIRE lock %s\n",
-    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[type] );
-}
-#endif
-
-}  // end remote_busylock_acquire()
-
-///////////////////////////////////////////////
-void remote_busylock_release( xptr_t  lock_xp )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // memory barrier to update the protected object
-    hal_fence();
-
-    // get remote lock cluster and local pointer 
-    cxy_t        lock_cxy = GET_CXY( lock_xp );
-    busylock_t * lock_ptr = GET_PTR( lock_xp );
-
-    // update lock state
-    hal_remote_atomic_add( XPTR( lock_cxy , &lock_ptr->current ) , 1 );
-
-    // decrement thread locks counter
-    this->busylocks--;
-
-    // memory barrier to update busylock and thread state
-    hal_fence();
-
-#if DEBUG_BUSYLOCK_TYPE
-uint32_t type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->type ) );
-if( type != LOCK_CHDEV_TXT0 ) 
-{
-    // remove lock from thread list of busyslocks
-    xlist_unlink( XPTR( lock_cxy  , &lock_ptr->xlist ) );
-}
-if( (type               == DEBUG_BUSYLOCK_TYPE) && 
-    (this->process->pid == DEBUG_BUSYLOCK_PID) &&
-    (this->trdid        == DEBUG_BUSYLOCK_TRDID) )
-{
-    printk("\n[%s] thread[%x,%x] RELEASE lock %s\n",
-    __FUNCTION__, this->process->pid, this->trdid, lock_type_str[type] );
-}
-#endif
-                                  
-    // exit critical section
-    hal_restore_irq( hal_remote_l32( XPTR( lock_cxy , &lock_ptr->save_sr ) ) );
- 
-}  // end remote_busylock_release()
-
-
Index: trunk/kernel/libk/remote_busylock.h
===================================================================
--- trunk/kernel/libk/remote_busylock.h	(revision 690)
+++ 	(revision )
@@ -1,109 +1,0 @@
-/*
- * remote_busylock.h: remote kernel busy-waiting lock definition.     
- * 
- * Authors  Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-kernel; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _REMOTE_BUSYLOCK_H_
-#define _REMOTE_BUSYLOCK_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_shared_types.h>
-#include <xlist.h>
-
-/*******************************************************************************************
- * This synchronisation object sequencializes all concurrent read or write accesses to a
- * shared object located in any cluster, made by any thread(s) running in any cluster.
- * It uses a busy waiting policy when the lock is taken by another thread, and should
- * be used ro execute very short actions, such as basic allocators, or to protect  
- * higher level synchronisation objects, such as remote_queuelock and remote_rwlock.
- *
- * - To acquire the lock, we use a ticket policy to avoid starvation: the calling thread
- *   makes an atomic increment on a "ticket" allocator, and keep polling the "current" 
- *   value  until current == ticket. 
- *
- * - To release the lock, the owner thread increments the "current" value.
- * 
- * - When a thread takes a busylock, it enters a critical section: the acquire() 
- *   function disables the IRQs, takes the lock, increments the thread busylocks counter,
- *   save the SR in the lock descriptor and returns.
- *
- * - The release() function releases the lock, decrements the thread busylock
- *   counter, restores the SR to exit the critical section, and returns.
- *
- * WARNING: a thread cannot yield when it is holding a busylock (local or remote).
- *
- * This rule is checked by all functions containing a thread_yield() AND by the scheduler,
- * thanks to the busylocks counter stored in the calling thread descriptor.
- * 1) all functions call "thread_assert_can_yield()" before calling "thread_yield()".
- * 2) The scheduler checks that the calling thread does not hold any busylock.
- * In case of violation the core goes to sleep after a [PANIC] message on TXT0.
- ******************************************************************************************/
-
-/*******************************************************************************************
- * This structure defines a remote_busylock.
- * - The <ticket> and <current> fields implement the ticket policy described above.
- * - The <type> and <xlist> fields are used for debug. The type defines the lock usage,
- *   as detailed in the kernel_config.h file. 
- * - The <save_sr> field is used to implement the critical section as decribed above.
- ******************************************************************************************/
-
-typedef struct remote_busylock_s
-{
-	uint32_t            ticket;      /*! next free ticket index                           */
-    volatile uint32_t   current;     /*! current owner index                              */
-    uint32_t            type;        /*! lock type for debug                              */
-    reg_t               save_sr;     /*! SR value                                         */
-
-#if DEBUG_BUSYLOCK_TYPE
-    xlist_entry_t       xlist;       /*! member of list of locks taken by same thread     */
-#endif
-
-}
-remote_busylock_t;
-
-/*******************************************************************************************
- * This function initializes a remote busylock.
- *******************************************************************************************
- * @ lock_xp    : extended pointer on remote busylock.
- * @ type       : lock type for debug.
- ******************************************************************************************/
-void remote_busylock_init( xptr_t   lock_xp,
-                           uint32_t type );
-
-/*******************************************************************************************
- * This blocking function uses a busy waiting strategy to acquire a remote_busylock.
- * It makes an atomic increment on the "ticket" field to get a ticket value and increment
- * the ticket allocator. 
- * Then it polls the "current" field until (current == ticket), and returns.
- *******************************************************************************************
- * @ lock_xp    : extended pointer on remote busylock
- ******************************************************************************************/
-void remote_busylock_acquire( xptr_t   lock_xp );
-
-/*******************************************************************************************
- * This function releases a busylock by incrementing the "current field".
- *******************************************************************************************
- * @ lock_xp       : extended pointer on remote busylock
- ******************************************************************************************/
-void remote_busylock_release( xptr_t  lock_xp );
-
-#endif	/* _REMOTE_BUSYLOCK_H_ */
Index: trunk/kernel/libk/remote_condvar.c
===================================================================
--- trunk/kernel/libk/remote_condvar.c	(revision 690)
+++ 	(revision )
@@ -1,242 +1,0 @@
-/*
- * remote_condvar.c - remote kernel condition variable implementation.
- *
- * Authors     Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <thread.h>
-#include <scheduler.h>
-#include <xlist.h>
-#include <remote_mutex.h>
-#include <remote_busylock.h>
-#include <remote_condvar.h>
-
-
-///////////////////////////////////////////////////
-xptr_t remote_condvar_from_ident( intptr_t  ident )
-{
-    // get pointer on local process_descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get cluster and local pointer on reference process 
-    cxy_t          ref_cxy = GET_CXY( ref_xp );
-    process_t    * ref_ptr = GET_PTR( ref_xp );
-
-    // get extended pointer on condvars list 
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->condvar_root );
-    xptr_t lock_xp = XPTR( ref_cxy , &ref_ptr->sync_lock );
-
-    // get lock protecting synchro lists
-    remote_queuelock_acquire( lock_xp );
- 
-    // scan reference process condvar list
-    xptr_t             iter_xp;
-    xptr_t             condvar_xp;
-    cxy_t              condvar_cxy;
-    remote_condvar_t * condvar_ptr;
-    intptr_t           current;
-    bool_t             found = false;
-            
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        condvar_xp  = XLIST_ELEMENT( iter_xp , remote_condvar_t , list );
-        condvar_cxy = GET_CXY( condvar_xp );
-        condvar_ptr = GET_PTR( condvar_xp );
-        current = (intptr_t)hal_remote_lpt( XPTR( condvar_cxy , &condvar_ptr->ident ) );   
-
-        if( current == ident )
-        {
-            found = true;
-            break;
-        }
-    }
-
-    // relese lock protecting synchros lists
-    remote_queuelock_release( lock_xp );
- 
-    if( found == false )  return XPTR_NULL;
-    else                  return condvar_xp;
-
-}  // end remote_condvar_from_ident()
-
-/////////////////////////////////////////////////
-error_t remote_condvar_create( intptr_t   ident )
-{
-    remote_condvar_t * condvar_ptr;
-
-    // get pointer on local process descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get reference process cluster and local pointer
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-
-    // allocate memory for condvar descriptor
-    condvar_ptr = kmem_alloc( bits_log2(sizeof(remote_condvar_t)) , AF_ZERO );
-
-    if( condvar_ptr == NULL )
-    {
-        printk("\n[ERROR] in %s : cannot create condvar\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // initialise condvar 
-	hal_remote_spt( XPTR( ref_cxy , &condvar_ptr->ident ) , (void *)ident );
-	xlist_root_init( XPTR( ref_cxy , &condvar_ptr->root ) );
-	xlist_entry_init( XPTR( ref_cxy , &condvar_ptr->list ) );
-    remote_busylock_init( XPTR( ref_cxy , &condvar_ptr->lock ), LOCK_CONDVAR_STATE );
-
-    // register condvar in reference process xlist
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->condvar_root );
-    xptr_t list_xp = XPTR( ref_cxy , &condvar_ptr->list );
-
-    remote_queuelock_acquire( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-    xlist_add_first( root_xp , list_xp );
-    remote_queuelock_release( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-    return 0;
-
-}  // end remote_condvar_create()
-
-////////////////////////////////////////////////
-void remote_condvar_destroy( xptr_t condvar_xp )
-{
-    // get pointer on local process descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get reference process cluster and local pointer
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = GET_PTR( ref_xp );
-
-    // get condvar cluster and local pointer
-    cxy_t              condvar_cxy = GET_CXY( condvar_xp );
-    remote_condvar_t * condvar_ptr = GET_PTR( condvar_xp );
-
-    // get remote pointer on waiting queue root
-    xptr_t root_xp = XPTR( condvar_cxy , &condvar_ptr->root );
-  
-    if( !xlist_is_empty( root_xp ) )   // user error
-    {
-        printk("WARNING in %s for thread %x in process %x : "
-               "destroy condvar, but  waiting threads queue not empty\n", 
-               __FUNCTION__ , CURRENT_THREAD->trdid , CURRENT_THREAD->process->pid );
-    }
-
-    // remove condvar from reference process xlist
-    remote_queuelock_acquire( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-    xlist_unlink( XPTR( condvar_cxy , &condvar_ptr->list ) );
-    remote_queuelock_release( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-    // release memory allocated for condvar descriptor
-    kmem_remote_free( ref_cxy , condvar_ptr , bits_log2(sizeof(remote_condvar_t)) );
-
-}  // end remote_convar_destroy()
-
-////////////////////////////////////////////
-void remote_condvar_wait( xptr_t condvar_xp,
-                          xptr_t mutex_xp )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // get condvar cluster and local pointer
-    remote_condvar_t * condvar_ptr = GET_PTR( condvar_xp );
-    cxy_t              condvar_cxy = GET_CXY( condvar_xp );
-
-    // register the calling thread in condvar waiting queue
-    xlist_add_last( XPTR( condvar_cxy , &condvar_ptr->root ),
-                    XPTR( local_cxy   , &this->wait_xlist ) );
-
-    // block the calling thread
-    thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_USERSYNC );
-
-    // release the mutex
-    remote_mutex_unlock( mutex_xp );
-
-    // deschedule
-    sched_yield("blocked on condvar");
-
-    // re-acquire the mutex
-    remote_mutex_lock( mutex_xp );
-
-}  // end remote_condvar_wait()
-
-///////////////////////////////////////////////
-void remote_condvar_signal( xptr_t condvar_xp )
-{
-    // get condvar cluster and local pointer
-    remote_condvar_t * condvar_ptr = GET_PTR( condvar_xp );
-    cxy_t              condvar_cxy = GET_CXY( condvar_xp );
-
-    // does nothing if waiting queue empty
-    if( xlist_is_empty( XPTR( condvar_cxy, &condvar_ptr->root ) ) == false )
-    {
-         // get first waiting thread
-         xptr_t thread_xp = XLIST_FIRST( XPTR( condvar_cxy , &condvar_ptr->root ),
-                                         thread_t , wait_xlist );
-
-         // remove this waiting thread from queue
-         thread_t * thread_ptr = GET_PTR( thread_xp );
-         cxy_t      thread_cxy = GET_CXY( thread_xp );
-         xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-         // unblock this waiting thread
-         thread_unblock( thread_xp , THREAD_BLOCKED_USERSYNC );
-    }
-
-}  // end remote_condvar_signal()
-
-//////////////////////////////////////////////////
-void remote_condvar_broadcast( xptr_t condvar_xp )
-{
-    // get condvar cluster and local pointer
-    remote_condvar_t * condvar_ptr = GET_PTR( condvar_xp );
-    cxy_t              condvar_cxy = GET_CXY( condvar_xp );
-
-    // does nothing if waiting queue empty
-    while( xlist_is_empty( XPTR( condvar_cxy , &condvar_ptr->root ) ) == false )
-    {
-         // get first waiting thread
-         xptr_t thread_xp = XLIST_FIRST( XPTR( condvar_cxy , &condvar_ptr->root ),
-                                         thread_t , wait_xlist );
-
-         // remove this waiting thread from queue
-         thread_t * thread_ptr = GET_PTR( thread_xp );
-         cxy_t      thread_cxy = GET_CXY( thread_xp );
-         xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-         // unblock this waiting thread
-         thread_unblock( thread_xp , THREAD_BLOCKED_USERSYNC );
-    }
-}  // end remote_condvar_broadcast()
-
Index: trunk/kernel/libk/remote_condvar.h
===================================================================
--- trunk/kernel/libk/remote_condvar.h	(revision 690)
+++ 	(revision )
@@ -1,132 +1,0 @@
-/*
- * remote_condvar.h: POSIX condition variable definition.     
- * 
- * Authors  Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-kernel; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _CONDVAR_H_
-#define _CONDVAR_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <remote_busylock.h>
-#include <xlist.h>
-
-/*******************************************************************************************
- * This file defines the ALMOS-MKH implentation of an user level, POSIX compliant condvar.
- *
- * It can be used by muti-threaded user applications to synchronise user threads
- * running in different clusters.
- *
- * A condvar is declared by a given user process as a "pthread_cond_t" global variable.
- * This user type is implemented as an unsigned long, but the value is not used by the 
- * kernel. ALMOS-MKH uses only the mutex virtual address as an identifier.
- * For each user condvar, ALMOS-MKH creates a kernel "remote_condvar_t" structure,
- * dynamically allocated in the reference cluster by the remote_condvar_create() function, 
- * and destroyed by the remote_condvar_destroy() function, using RPC if the calling thread
- * is not running in the reference cluster.
- * 
- * The blocking "remote_condvar_wait() function allows the calling thread to efficiently
- * wait for a change in a shared user object. The calling thread blocks and register in
- * a waiting queue attached to the condvar. The blocked thread is unblocked by another
- * thread calling the remote_convar signal() or remote_condvar_broadcast().
- * The three associated methods wait(), signal() and broadcast() must be called
- * by a thread holding the mutex associated to the condvar.
- ******************************************************************************************/
-
-/*******************************************************************************************
- * This structure defines the kernel implementation of a condvar.
- ******************************************************************************************/
-
-typedef struct remote_condvar_s
-{
-    remote_busylock_t lock;         /*! lock protecting the condvar state                 */
-    intptr_t          ident;        /*! virtual address in user space == identifier       */
-    xlist_entry_t     root;         /*! root of waiting threads queue                     */
-    xlist_entry_t     list;         /*! member of list of condvars in same process        */
-}
-remote_condvar_t;
-
-/*********************************************************************************************
- * This function returns an extended pointer on the remote condvar identified
- * by its virtual address in a given user process. It makes an associative search, 
- * scanning the list of user condvars rooted in the reference process descriptor.
- *********************************************************************************************
- * @ ident    : semaphore virtual address, used as identifier.
- * @ returns extended pointer on semaphore if success / returns XPTR_NULL if not found. 
- ********************************************************************************************/
-xptr_t remote_condvar_from_ident( intptr_t  ident );
-
-/*******************************************************************************************
- * This function implements the CONVAR_INIT operation.
- * This function creates and initializes a remote_condvar, identified by its virtual
- * address <vaddr> in the client process reference cluster, using remote access.
- * It registers this user condvar in the reference process descriptor.
- *******************************************************************************************
- * @ vaddr         : [in]  condvar virtual addresss, used as identifier.
- ******************************************************************************************/
-error_t remote_condvar_create( intptr_t   vaddr );
-
-/*******************************************************************************************
- * This function implements the CONVAR_DESTROY operation.
- * This function creates and initializes a remote_condvar, identified by its virtual
- * address in the client process reference cluster, and registers it in process descriptor.
- *******************************************************************************************
- * @ condvar_xp : [in] extended pointer on buffer to store xptr on created condvar.
- ******************************************************************************************/
-void remote_condvar_destroy( xptr_t condvar_xp );
-
-/*******************************************************************************************
- * This function implements the CONDVAR_WAIT operation.
- * It atomically releases the mutex identified by the <mutex_xp> argument, 
- * registers the calling thread in the condvar waiting queue identified by the
- * <condvar_xp> argument, blocks and deschedules this calling thread.
- * Later, when the calling thread resume, this function re-acquire the mutex and returns.
- * WARNING: the calling thread must hold the mutex associated to the condvar.
- *******************************************************************************************
- * @ condvar_xp : [in] extended pointer on condvar.
- * @ mutex_xp   : [in] extended pointer on mutex.
- ******************************************************************************************/
-void remote_condvar_wait( xptr_t condvar_xp,
-                          xptr_t mutex_xp );
-
-/*******************************************************************************************
- * This function implements the CONDVAR_SIGNAL operation.
- * It remove one waiting thread from a remote_condvar waiting queue identified by the
- * <condvar_xp> argument and unblocks this thread.
- * It does nothing if the queue is empty.
- * WARNING: the calling thread must hold the mutex associated to the condvar.
- *******************************************************************************************
- * @ condvar_xp : extended pointer on remote_condvar.
- ******************************************************************************************/
-void remote_condvar_signal( xptr_t condvar_xp );
-
-/*******************************************************************************************
- * This function implements the CONDVAR_BROADCAST operation.
- * It removes all threads from a remote_condvar waiting queue identified by the
- * <condvar_xp> argument, and unblocks all these threads. 
- * It does nothing if the queue is empty.
- * WARNING: the calling thread must hold the mutex associated to the condvar.
- *******************************************************************************************
- * @ condvar_xp : extended pointer on remote_condvar.
- ******************************************************************************************/
-void remote_condvar_broadcast( xptr_t condvar_xp );
-
-#endif	/* _CONDVAR_H_ */
Index: trunk/kernel/libk/remote_fifo.c
===================================================================
--- trunk/kernel/libk/remote_fifo.c	(revision 690)
+++ trunk/kernel/libk/remote_fifo.c	(revision 1)
@@ -1,7 +1,8 @@
 /*
- * remote_fifo.c  Implement a lock-less FIFO, multiple-remote-writers / single-local-reader
+ * remote_fifo.c  Implement a lock-less FIFO,
+                  multiple-remote-writers / single-local-reader
  *
  * Authors : Mohamed Lamine Karaoui (2015)
- *           Alain Greiner          (2016,2017)
+ *           Alain Greiner          (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -23,5 +24,5 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_irqmask.h>
 #include <hal_remote.h>
@@ -34,21 +35,22 @@
 #include <remote_fifo.h>
 
-/////////////////////////////////////////////
-void remote_fifo_init( remote_fifo_t * fifo )
+////////////////////////////////////////////
+void local_fifo_init( remote_fifo_t * fifo )
 {
     uint32_t  slot;
 
-    fifo->owner     = 0;
 	fifo->wr_id     = 0;
 	fifo->rd_id     = 0;
-    for( slot = 0 ; slot < CONFIG_RPC_FIFO_SLOTS ; slot++ )
+    for( slot = 0 ; slot < CONFIG_REMOTE_FIFO_SLOTS ; slot++ )
     {
-        fifo->valid[slot] = 0;
+        fifo->valid[slot] = false;
     }
 }
 
-/////////////////////////////////////////////////
-error_t remote_fifo_put_item( xptr_t     fifo_xp, 
-                              uint64_t   item )
+//////////////////////////////////////////// 
+error_t remote_fifo_put_item( xptr_t   fifo, 
+                              void   * item,
+                              uint32_t size,
+                              bool_t * first )
 {
     uint32_t        wr_id;
@@ -56,26 +58,35 @@
     uint32_t        ptw;
     uint32_t        watchdog;
+    uint32_t        save_sr;
     uint32_t        nslots;
 
     // get remote cluster identifier and pointer on FIFO
-    cxy_t           fifo_cxy = GET_CXY( fifo_xp );
-    remote_fifo_t * fifo_ptr = GET_PTR( fifo_xp );
+    cxy_t           cxy = (cxy_t)GET_CXY( fifo );
+    remote_fifo_t * ptr = (remote_fifo_t *)GET_PTR( fifo );
 
     // initialise watchdog for contention detection
     watchdog = 0;
 
-    // get write slot index with atomic increment QQQQQQQQQQ
-	wr_id = hal_remote_atomic_add( XPTR( fifo_cxy , &fifo_ptr->wr_id ) , 1 );
-
-    // wait until allocated slot is empty in remote FIFO
-    // max retry = CONFIG_RPC_FIFO_MAX_ITERATIONS  
-    // return error if watchdog is reached
+    // no descheduling during put access
+	hal_disable_irq( &save_sr );
+	
+    // get write slot index and increment 
+	wr_id = hal_remote_atomic_add( XPTR( cxy , &ptr->wr_id ) , 1 );
+
+    // check fifo state
     while( 1 )
     {
         // return error if contention detected by watchdog
-        if( watchdog > CONFIG_RPC_FIFO_MAX_ITERATIONS )  return EBUSY;
+        if( watchdog > CONFIG_REMOTE_FIFO_MAX_ITERATIONS ) 
+        {
+            // restore scheduling
+	        hal_restore_irq( save_sr );
+
+            // return error
+            return EBUSY;
+        }
 
         // read remote rd_id value
-        rd_id = hal_remote_l32( XPTR( fifo_cxy , &fifo_ptr->rd_id ) );
+        rd_id = hal_remote_lw( XPTR( cxy , &ptr->rd_id ) );
 
         // compute number of full slots
@@ -83,12 +94,15 @@
         else                 nslots = (0xFFFFFFFF - rd_id) + wr_id;
 
-        // exit waiting loop as soon as fifo not full
-        if ( nslots < CONFIG_RPC_FIFO_SLOTS )  break;
+        // exit if fifo not full
+        if ( nslots < CONFIG_REMOTE_FIFO_SLOTS )  break;
         
-        // retry later if fifo full:
-        // - deschedule without blocking if possible
-        // - wait ~1000 cycles otherwise
-        if( CURRENT_THREAD->busylocks == 0 ) sched_yield( "wait RPC fifo" );
-        else                                 hal_fixed_delay( 1000 );
+        // restore interrupts
+	    hal_restore_irq( save_sr );
+
+        // deschedule without blocking 
+        if( thread_can_yield() ) sched_yield();
+
+        // disable interrupts
+	    hal_disable_irq( &save_sr );
 
         // increment watchdog
@@ -97,13 +111,21 @@
 
     // compute actual write slot pointer
-    ptw = wr_id % CONFIG_RPC_FIFO_SLOTS;
+    ptw = wr_id % CONFIG_REMOTE_FIFO_SLOTS;
 
     // copy item to fifo
-	hal_remote_s64( XPTR( fifo_cxy , &fifo_ptr->data[ptw] ), item );
-	hal_fence();
+	hal_remote_memcpy( XPTR( cxy       , &ptr->data[ptw] ),
+                       XPTR( local_cxy , item ) , size ); 
+	hal_wbflush();
 
     // set the slot valid flag
-	hal_remote_s32( XPTR( fifo_cxy , &fifo_ptr->valid[ptw] ) , 1 );
-	hal_fence();
+	hal_remote_sw( XPTR( cxy , &ptr->valid[ptw] ) , 1 );
+
+	hal_wbflush();
+
+    // return the first RPC flag
+    *first = ( wr_id == rd_id );
+    
+    // restore scheduling
+	hal_restore_irq( save_sr );
 
     return 0;
@@ -111,7 +133,8 @@
 } // end remote_fifo_put_item()
 
-///////////////////////////////////////////////////
-error_t remote_fifo_get_item( remote_fifo_t * fifo,
-                              uint64_t      * item )
+//////////////////////////////////////////////////
+error_t local_fifo_get_item( remote_fifo_t * fifo,
+                             void          * item, 
+                             uint32_t        size )
 {
     // get fifo state
@@ -123,5 +146,5 @@
 	
     // compute actual read slot pointer 
-	uint32_t ptr = rd_id % CONFIG_RPC_FIFO_SLOTS;
+	uint32_t ptr = rd_id % CONFIG_REMOTE_FIFO_SLOTS;
 	
 	// wait slot filled by the writer
@@ -129,5 +152,5 @@
 	
     // copy item from FIFO to local buffer
-    *item = fifo->data[ptr];
+    memcpy( item , &fifo->data[ptr] , size );
 
     // reset valid slot flag
@@ -138,6 +161,5 @@
 
 	return 0;
-
-} // end remote_fifo_get_item()
+} // end local_fifo_get_item()
 
 /////////////////////////////////////////
@@ -147,10 +169,10 @@
 
     // get remote cluster identifier and pointer on FIFO
-    cxy_t           cxy = GET_CXY( fifo );
-    remote_fifo_t * ptr = GET_PTR( fifo );
+    cxy_t           cxy = (cxy_t)GET_CXY( fifo );
+    remote_fifo_t * ptr = (remote_fifo_t *)GET_PTR( fifo );
    
     // get read and write pointers
-	uint32_t wr_id = hal_remote_l32( XPTR( cxy , &ptr->wr_id ) );
-	uint32_t rd_id = hal_remote_l32( XPTR( cxy , &ptr->rd_id ) );
+	uint32_t wr_id = hal_remote_lw( XPTR( cxy , &ptr->wr_id ) );
+	uint32_t rd_id = hal_remote_lw( XPTR( cxy , &ptr->rd_id ) );
 
     // compute number of full slots
@@ -158,9 +180,9 @@
     else                 nslots = (0xFFFFFFFF - rd_id) + wr_id;
 
-    return ( nslots >= CONFIG_RPC_FIFO_SLOTS );
-}
-
-///////////////////////////////////////////////////
-bool_t remote_fifo_is_empty( remote_fifo_t * fifo )
+    return ( nslots >= CONFIG_REMOTE_FIFO_SLOTS );
+}
+
+//////////////////////////////////////////////////
+bool_t local_fifo_is_empty( remote_fifo_t * fifo )
 {
     return ( fifo->wr_id == fifo->rd_id );
@@ -173,10 +195,10 @@
 
     // get remote cluster identifier and pointer on FIFO
-    cxy_t           cxy = GET_CXY( fifo );
-    remote_fifo_t * ptr = GET_PTR( fifo );
+    cxy_t           cxy = (cxy_t)GET_CXY( fifo );
+    remote_fifo_t * ptr = (remote_fifo_t *)GET_PTR( fifo );
    
     // get read and write pointers
-	uint32_t wr_id = hal_remote_l32( XPTR( cxy , &ptr->wr_id ) );
-	uint32_t rd_id = hal_remote_l32( XPTR( cxy , &ptr->rd_id ) );
+	uint32_t wr_id = hal_remote_lw( XPTR( cxy , &ptr->wr_id ) );
+	uint32_t rd_id = hal_remote_lw( XPTR( cxy , &ptr->rd_id ) );
 
     // compute number of full slots
Index: trunk/kernel/libk/remote_fifo.h
===================================================================
--- trunk/kernel/libk/remote_fifo.h	(revision 690)
+++ trunk/kernel/libk/remote_fifo.h	(revision 1)
@@ -1,7 +1,6 @@
 /*
- * remote_fifo.h - Lock-less Single-Reader Multiple-Writers FIFO
+ * remote_fifo.h - kernel generic SRMW FIFO
  *
- * Authors : Mohamed Lamine Karaoui (2015)
- *           Alain Greiner (2016,2017)
+ * Authors : Mohamed Lamine Karaoui / Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,33 +25,29 @@
 #define _REMOTE_FIFO_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <printk.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <errno.h>
 #include <hal_remote.h>
 
 /************************************************************************************
- * This structure defines a generic, single reader, multiple writers FIFO,
- * that is used for - RPC based - inter cluster communications.
- * Each FIF0 slot can contain one 64 bits integer (or one extended pointer).
- * The number of slots is defined by the CONFIG_RPC_FIFO_SLOTS parameter.
- * - The write accesses are implemented using a lock-free algorithm, as it uses
- *   a ticket based mechanism to handle concurrent access between multiple writers.
- *   In case of FIFO full, the writer deschedule without blocking, to retry later.
- * - The reader must take the try_lock implemented by the "owner" field, using
- *   an atomic_add(). The TRDID is a good owner identifier, because all
- *   RPC threads in a given cluster belong to the same kernel process,
- *   and RPC threads cannot have local index LTID = 0.
-*
- * WARNING : Each FIFO requires 12 + (12 * CONFIG_RPC_FIFO_SLOTS) bytes.
+ * This structure defines a generic, single reader, multiple writers
+ * remote FIFO, that is used by the RPCs for inter cluster communications.
+ * The accesses are implemented using a lock-free algorithm, as it
+ * uses a ticket based mechanism to handle concurrent access between
+ * the multiple writers.
+ * Each FIF0 slot can contain one full cache line, even if RPCs store only
+ * an extended pointer on the RPC descriptor in each slot.
+ * In case of FIFO full, the writer deschedule without blocking, to retry later.
+ *
+ * WARNING : the number of slots is statically defined by the global 
+ * configuration parameter CONFIG_REMOTE_FIFO_SLOTS for all fifos, requiring
+ * CACHE_LINE_SIZE * CONFIG_REMOTE_FIFO_SLOTS bytes for each FIFO...
  ***********************************************************************************/
-
 typedef struct remote_fifo_s
 {
-    uint32_t           owner;                            /*! owner thread trdid    */
 	volatile uint32_t  wr_id;                            /*! write slot index      */
 	volatile uint32_t  rd_id;                            /*! read  slot index      */
-    volatile uint32_t  valid[CONFIG_RPC_FIFO_SLOTS];  /*! empty slot if 0       */
-	uint64_t           data[CONFIG_RPC_FIFO_SLOTS];   /*! fifo slot content     */
+    volatile bool_t    valid[CONFIG_REMOTE_FIFO_SLOTS];  /*! empty slot if false   */
+	cacheline_t        data[CONFIG_REMOTE_FIFO_SLOTS];   /*! fifo slot content     */
 }
 remote_fifo_t;
@@ -62,47 +57,53 @@
  * It can only initialise a local FIFO.
  ************************************************************************************
- * @ fifo    : local pointer to the local fifo.
+ * @ fifo    : pointer to the local fifo.
  ***********************************************************************************/
-void remote_fifo_init( remote_fifo_t * fifo );
+void local_fifo_init( remote_fifo_t * fifo );
 
 /************************************************************************************
  * This non blocking function tries to get one item from the local fifo.
- * The reader must get exclusive access for read before calling this function.  
+ * The reader must get exclusive access before calling this function.  
  * The read slot index is incremented.
  ************************************************************************************
- * @ fifo    : local pointer to the local fifo.
- * @ item    : [out] pointer on buffer for extracted item.
+ * @ fifo    : pointer to the local fifo.
+ * @ item    : pointer on destination buffer for extracted item.
+ * @ size    : actual number of bytes in one item.
  * @ return  0 on success, EAGAIN if the buffer is empty.
  ***********************************************************************************/
-error_t remote_fifo_get_item( remote_fifo_t * fifo, 
-                              uint64_t      * item );
+error_t local_fifo_get_item( remote_fifo_t * fifo, 
+                             void          * item,
+                             uint32_t        size );
 
 /************************************************************************************
  * This blocking function puts one item to a remote fifo identified
- * by an extended pointer. It gets a write ticket on the slot to be written,
- * using a remote_atomic_add() on the write slot index. Then, it waits until
- * the slot is empty, using a descheduling policy without blocking if required. 
- * It implements a watchdog, returning when the item has been successfully
- * registered, or after CONFIG_RPC_FIFO_MAX_ITERATIONS failures.   
+ * by an extended pointer.
+ * This function gets a write ticket using a remote_atomic_increment on the
+ * write slot index and waits until the slot is empty, using a descheduling
+ * policy (without blocking).
  ************************************************************************************
- * @ fifo    : extended pointer to the remote fifo.
- * @ item    : item to be stored.
+ * @ fifo    : extended pointer to the fifo in remote cluster.
+ * @ item    : pointer on a local buffer containing the item to be stored.
+ * @ size    : actual number of bytes in one item.
+ * @ first   : return value (true if first item registered in remote fifo)
  * @ return  0 on success / EBUSY if a contention has been detected.
  ***********************************************************************************/
 error_t remote_fifo_put_item( xptr_t     fifo,
-                              uint64_t   item );
+                              void     * item,
+                              uint32_t   size,
+                              bool_t   * first );
 
 /************************************************************************************
  * Query if local fifo is empty
  ************************************************************************************
- * @ fifo    : local pointer to the local fifo.
+ * @ fifo    : pointer to the fifo.
  * @ return true if the fifo is empty, false otherwise.
  ***********************************************************************************/
-bool_t remote_fifo_is_empty( remote_fifo_t * fifo );
+bool_t local_fifo_is_empty( remote_fifo_t * fifo );
 
 /************************************************************************************
  * Query if remote fifo is full
  ************************************************************************************
- * @ fifo    : extended pointer to the remote fifo.
+ * @ fifo    : pointer to the fifo in remote cluster.
+ * @ cxy	 : remote cluster index.
  * @ return true if the fifo is full, false otherwise.
  ***********************************************************************************/
@@ -112,5 +113,6 @@
  * Query number ot items in remote fifo.
  ************************************************************************************
- * @ fifo     : extended pointer to the remote fifo.
+ * @ fifo     : pointer to the fifo in remote cluster.
+ * @ cxy	  : remote cluster index.
  * @ return  number of items.
  ***********************************************************************************/
Index: trunk/kernel/libk/remote_mutex.c
===================================================================
--- trunk/kernel/libk/remote_mutex.c	(revision 690)
+++ 	(revision )
@@ -1,376 +1,0 @@
-/*
- * remote_mutex.c - POSIX mutex implementation.
- * 
- * Authors   Alain   Greiner (2016,2017,2018,2019,2020:)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <thread.h>
-#include <xlist.h>
-#include <scheduler.h>
-#include <remote_busylock.h>
-#include <remote_mutex.h>
-
-
-/////////////////////////////////////////////////
-xptr_t remote_mutex_from_ident( intptr_t  ident )
-{
-    // get pointer on local process_descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get cluster and local pointer on reference process 
-    cxy_t          ref_cxy = GET_CXY( ref_xp );
-    process_t    * ref_ptr = (process_t *)GET_PTR( ref_xp );
-
-    // get extended pointers on mutexes list  
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->mutex_root );
-    xptr_t lock_xp = XPTR( ref_cxy , &ref_ptr->sync_lock );
-
-    // get lock protecting synchro lists
-    remote_queuelock_acquire( lock_xp );
- 
-    // scan reference process mutex list
-    xptr_t           iter_xp;
-    xptr_t           mutex_xp;
-    cxy_t            mutex_cxy;
-    remote_mutex_t * mutex_ptr;
-    intptr_t         current;
-    bool_t           found = false;
-            
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        mutex_xp  = XLIST_ELEMENT( iter_xp , remote_mutex_t , list );
-        mutex_cxy = GET_CXY( mutex_xp );
-        mutex_ptr = (remote_mutex_t *)GET_PTR( mutex_xp );
-        current     = (intptr_t)hal_remote_lpt( XPTR( mutex_cxy , &mutex_ptr->ident ) );   
-        if( ident == current )
-        {
-            found = true;
-            break;
-        }
-    }
-
-    // relese lock protecting synchros lists
-    remote_queuelock_release( lock_xp );
- 
-    if( found == false )  return XPTR_NULL;
-    else                  return mutex_xp;
-
-}  // end remote_mutex_from_ident()
-
-/////////////////////////////////////////////
-error_t remote_mutex_create( intptr_t ident )
-{ 
-    remote_mutex_t * mutex_ptr;
-
-    // get pointer on local process descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get reference process cluster and local pointer
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-
-    // allocate memory for mutex descriptor in reference cluster
-    mutex_ptr = kmem_remote_alloc( ref_cxy , bits_log2(sizeof(remote_mutex_t)) , AF_ZERO );
-
-    if( mutex_ptr == NULL )
-    {
-       printk("\n[ERROR] in %s : cannot create mutex\n", __FUNCTION__);
-       return -1;
-    }
-
-    // initialise mutex
-    hal_remote_s32 ( XPTR( ref_cxy , &mutex_ptr->taken )   , 0 );
-    hal_remote_spt( XPTR( ref_cxy , &mutex_ptr->ident )   , (void *)ident );
-    xlist_entry_init( XPTR( ref_cxy , &mutex_ptr->list ) );
-    xlist_root_init( XPTR( ref_cxy , &mutex_ptr->root ) );
-    hal_remote_s64( XPTR( ref_cxy , &mutex_ptr->owner ) , XPTR_NULL );
-    remote_busylock_init( XPTR( ref_cxy , &mutex_ptr->lock ), LOCK_MUTEX_STATE );
-
-    // get root of mutexes list in process, and list_entry in mutex
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->mutex_root );
-    xptr_t xp_list = XPTR( ref_cxy , &mutex_ptr->list );
-
-    // get lock protecting user synchros lists
-    remote_queuelock_acquire( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-    // register mutex in process descriptor 
-    xlist_add_first( root_xp , xp_list );
-
-    // release lock protecting user synchros lists
-    remote_queuelock_release( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-#if DEBUG_MUTEX
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_MUTEX )
-printk("\n[%s] : thread[%x,%x] created mutex(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, mutex_ptr );
-#endif
-
-
-    return 0;
-
-}  // end remote_mutex_create()
-
-////////////////////////////////////////////
-void remote_mutex_destroy( xptr_t mutex_xp )
-{
-    // get pointer on local process descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get reference process cluster and local pointer
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-
-    // get mutex cluster and local pointer
-    cxy_t            mutex_cxy = GET_CXY( mutex_xp );
-    remote_mutex_t * mutex_ptr = (remote_mutex_t *)GET_PTR( mutex_xp );
-
-    // get lock protecting user synchros lists
-    remote_queuelock_acquire( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-    // remove mutex from reference process xlist
-    xlist_unlink( XPTR( mutex_cxy , &mutex_ptr->list ) );
-
-    // release lock protecting user synchros lists
-    remote_queuelock_release( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-    // release memory allocated for mutex descriptor
-    kmem_remote_free( mutex_cxy , mutex_ptr , bits_log2(sizeof(remote_mutex_t)) );
-
-}  // end remote_mutex_destroy()
-
-/////////////////////////////////////////
-void remote_mutex_lock( xptr_t mutex_xp )
-{ 
-    // get cluster and pointers on calling thread
-    cxy_t            caller_cxy = local_cxy;
-    thread_t       * caller_ptr = CURRENT_THREAD;
-    xptr_t           caller_xp  = XPTR( caller_cxy , caller_ptr );
-
-    // check calling thread can yield
-    thread_assert_can_yield( caller_ptr , __FUNCTION__ );
-
-    // get cluster and local pointer on mutex
-    remote_mutex_t * mutex_ptr = GET_PTR( mutex_xp );
-    cxy_t            mutex_cxy = GET_CXY( mutex_xp );
-
-    // get extended pointers on mutex fields 
-    xptr_t           taken_xp = XPTR( mutex_cxy , &mutex_ptr->taken );
-    xptr_t           owner_xp = XPTR( mutex_cxy , &mutex_ptr->owner );
-    xptr_t           root_xp  = XPTR( mutex_cxy , &mutex_ptr->root );
-    xptr_t           lock_xp  = XPTR( mutex_cxy , &mutex_ptr->lock );
-
-    while( 1 )
-    {
-        // get busylock protecting mutex state
-        remote_busylock_acquire( lock_xp );
-
-        // test mutex state
-        if( hal_remote_l32( taken_xp ) == 0 )                 // success
-        {
-            // register calling thread as mutex owner
-            hal_remote_s64( owner_xp , caller_xp );
-
-            // update mutex state
-            hal_remote_s32( taken_xp , 1 );
-
-#if DEBUG_MUTEX
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_MUTEX )
-printk("\n[%s] thread[%x,%x] SUCCESS on mutex(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, mutex_cxy, mutex_ptr );
-#endif
-
-            // release busylock protecting mutex state
-            remote_busylock_release( lock_xp ); 
-
-             return;
-        }
-        else                                                 //  already taken
-        {
-            // block the calling thread   
-            thread_block( caller_xp , THREAD_BLOCKED_USERSYNC );
-
-            // register calling thread in mutex waiting queue
-            xptr_t entry_xp = XPTR( caller_cxy , &caller_ptr->wait_xlist );
-            xlist_add_last( root_xp , entry_xp );
-
-#if DEBUG_MUTEX
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_MUTEX )
-printk("\n[%s] thread[%x,%x] BLOCKED on mutex(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, mutex_cxy, mutex_ptr );
-#endif
-
-            // release busylock protecting mutex state
-            remote_busylock_release( lock_xp ); 
-
-            // deschedule calling thread
-            sched_yield("blocked on mutex");
-        }
-    }  
-}  // end remote_mutex_lock()
-
-//////////////////////////////////////////////
-error_t remote_mutex_unlock( xptr_t mutex_xp )
-{
-    // memory barrier before mutex release
-    hal_fence();
-
-    // get cluster and local pointer on mutex
-    remote_mutex_t * mutex_ptr = GET_PTR( mutex_xp );
-    cxy_t            mutex_cxy = GET_CXY( mutex_xp );
-
-    // get cluster and pointers on calling thread
-    cxy_t            caller_cxy = local_cxy;
-    thread_t       * caller_ptr = CURRENT_THREAD;
-    xptr_t           caller_xp  = XPTR( caller_cxy , caller_ptr );
-
-    // get extended pointers on mutex fields 
-    xptr_t           taken_xp = XPTR( mutex_cxy , &mutex_ptr->taken );
-    xptr_t           owner_xp = XPTR( mutex_cxy , &mutex_ptr->owner );
-    xptr_t           root_xp  = XPTR( mutex_cxy , &mutex_ptr->root );
-    xptr_t           lock_xp  = XPTR( mutex_cxy , &mutex_ptr->lock );
-
-    // get busylock protecting mutex state
-    remote_busylock_acquire( lock_xp );
-    
-    // check calling thread is mutex owner
-    if( hal_remote_l64( owner_xp ) != caller_xp )
-    {
-        // release busylock protecting mutex state
-        remote_busylock_release( lock_xp );
-
-        return 0xFFFFFFFF;
-    }
-
-#if DEBUG_MUTEX
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_MUTEX )
-printk("\n[%s] thread[%x,%x] EXIT / mutex(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, mutex_cxy, mutex_ptr );
-#endif
-
-    // update owner field, 
-    hal_remote_s64( owner_xp , XPTR_NULL );
-
-    // update taken field
-    hal_remote_s32( taken_xp , 0 );
-
-    // unblock first waiting thread if waiting list non empty
-    if( xlist_is_empty( root_xp ) == false )
-    {
-        // get extended pointer on first waiting thread
-        xptr_t     thread_xp  = XLIST_FIRST( root_xp , thread_t , wait_xlist );
-        thread_t * thread_ptr = GET_PTR( thread_xp );
-        cxy_t      thread_cxy = GET_CXY( thread_xp );
-
-#if DEBUG_MUTEX
-if( (uint32_t)hal_get_cycles() > DEBUG_MUTEX )
-{
-trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-process_t * process = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-pid_t       pid     = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-printk("\n[%s] thread[%x,%x] UNBLOCK thread %x in process %d / mutex(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, trdid, pid, mutex_cxy, mutex_ptr );
-}
-#endif
-
-        // remove this thread from waiting queue
-        xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-        // unblock first waiting thread
-        thread_unblock( thread_xp , THREAD_BLOCKED_USERSYNC ); 
-    }
-    
-    // release busylock protecting mutex state
-    remote_busylock_release( lock_xp );
-
-    return 0;
-
-}  // end remote_mutex_unlock()
-
-///////////////////////////////////////////////
-error_t remote_mutex_trylock( xptr_t mutex_xp )
-{
-    // get cluster and local pointer on mutex
-    remote_mutex_t * mutex_ptr = GET_PTR( mutex_xp );
-    cxy_t            mutex_cxy = GET_CXY( mutex_xp );
-
-    // get cluster and pointers on calling thread
-    cxy_t            caller_cxy = local_cxy;
-    thread_t       * caller_ptr = CURRENT_THREAD;
-    xptr_t           caller_xp  = XPTR( caller_cxy , caller_ptr );
-
-    // get extended pointers on mutex fields 
-    xptr_t           taken_xp = XPTR( mutex_cxy , &mutex_ptr->taken );
-    xptr_t           owner_xp = XPTR( mutex_cxy , &mutex_ptr->owner );
-    xptr_t           lock_xp  = XPTR( mutex_cxy , &mutex_ptr->lock );
-
-    // get busylock protecting mutex state
-    remote_busylock_acquire( lock_xp );
-
-    // test mutex state
-    if( hal_remote_l32( taken_xp ) == 0 )                 // success
-    {
-        // register calling thread as mutex owner
-        hal_remote_s64( owner_xp , caller_xp );
-
-        // update mutex state
-        hal_remote_s32( taken_xp , 1 );
-
-#if DEBUG_MUTEX
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_QUEUELOCK )
-printk("\n[%s] SUCCESS for thread[%x,%x] / mutex(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, mutex_cxy, mutex_ptr );
-#endif
-        // release busylock protecting mutex state
-        remote_busylock_release( lock_xp ); 
-
-        return 0;
-    }
-    else                                                 //  already taken
-    {
-
-#if DEBUG_MUTEX
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_QUEUELOCK )
-printk("\n[%s] FAILURE for thread[%x,%x] / mutex(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, mutex_cxy, mutex_ptr );
-#endif
-        // release busylock protecting mutex state
-        remote_busylock_release( lock_xp ); 
-
-        return 0xFFFFFFFF;
-    }
-}  // end remote_mutex_trylock()
Index: trunk/kernel/libk/remote_mutex.h
===================================================================
--- trunk/kernel/libk/remote_mutex.h	(revision 690)
+++ 	(revision )
@@ -1,130 +1,0 @@
-/*
- * remote_mutex.h -  POSIX mutex definition.
- *
- * Authors   Alain Greiner   (2016,2017,2018)
- * 
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _REMOTE_MUTEX_H_
-#define _REMOTE_MUTEX_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <xlist.h>
-
-/*****************************************************************************************
- * This file defines the ALMOS-MKH implementation of an user level POSIX compliant mutex.
- *
- * It can be used by muti-threaded user applications to synchronise user threads
- * running in different clusters.
- *
- * A mutex is declared by a given user process as a "pthread_mutex_t" global variable.
- * This user type is implemented as an unsigned long, but the value is not used by the 
- * kernel. ALMOS-MKH uses only the mutex virtual address as an identifier.
- * For each user mutex, ALMOS-MKH creates a kernel "remote_mutex_t" structure, allocated
- * in the user process reference cluster by the remote_mutex_create() function, and 
- * destroyed by the remote_mutex_destroy() function, using RPC if the calling thread
- * is not running in the reference cluster. 
- *
- * The blocking "remote_mutex_lock()" function implements a descheduling policy when
- * the lock is already taken by another thread : the calling thread is registered 
- * in a waiting queue, rooted in the mutex structure, and the the calling thread 
- * is blocked on the THREAD_BLOCKED_MUTEX condition. 
- * The "remote_mutex_unlock()" function unblocks the first waiting thread in the queue
- * without releasing the mutex if queue is not empty.
- ****************************************************************************************/
-
-/*****************************************************************************************
- * This structure defines the kernel implementation of an user level mutex.
- ****************************************************************************************/
-
-typedef struct remote_mutex_s
-{
-    remote_busylock_t  lock;            /*! lock protecting the mutex state             */
-    intptr_t           ident;           /*! mutex identifier (vaddr in user space)      */ 
-    uint32_t           taken;           /*! mutex non allocated if 0                    */
-    xlist_entry_t      list;            /*! member of list of mutex in same process     */
-    xlist_entry_t      root;            /*! root of list of waiting threads             */
-    xptr_t             owner;           /*! extended pointer on owner thread            */
-}
-remote_mutex_t;
-
-/*****************************************************************************************
- * This function returns an extended pointer on the remote mutex, identified
- * by its virtual address in a given user process. It makes an associative search, 
- * scanning the list of mutex rooted in the reference process descriptor.
- *****************************************************************************************
- * @ ident    : mutex virtual address, used as identifier.
- * @ returns extended pointer on mutex if success / returns XPTR_NULL if not found. 
- ****************************************************************************************/
-xptr_t remote_mutex_from_ident( intptr_t  ident );
-
-/*****************************************************************************************
- * This function implements the pthread_mutex_init() syscall.
- * It allocates memory for the mutex descriptor in the reference cluster for
- * the calling process, it initializes the mutex state, and register it in the 
- * list of mutex owned by the reference process.
- *****************************************************************************************
- * @ ident       : mutex identifier (virtual address in user space).
- * @ return 0 if success / ENOMEM if no memory / EINVAL if invalid argument.
- ****************************************************************************************/
-error_t remote_mutex_create( intptr_t ident );
-
-/*****************************************************************************************
- * This function implements the pthread_mutex_destroy() syscall.
- * It releases thr memory allocated for the mutex descriptor, and remove the mutex 
- * from the list of mutex owned by the reference process.
- *****************************************************************************************
- * @ mutex_xp  : extended pointer on mutex descriptor.
- ****************************************************************************************/
-void remote_mutex_destroy( xptr_t  mutex_xp );
-
-/*****************************************************************************************
- * This blocking function implements the pthread_mutex_lock() syscall.
- * It returns only when the ownership of the mutex identified by the <mutex_xp>
- * argument has been obtained by the calling thread. It register in the mutex waiting 
- * queue when the mutex is already taken by another thread.
- *****************************************************************************************
- * @ mutex_xp  : extended pointer on mutex descriptor.
- ****************************************************************************************/
-void remote_mutex_lock( xptr_t  mutex_xp );
-
-/*****************************************************************************************
- * This function implements the pthread_mutex_unlock() syscall.
- * It cheks that the calling thread is actually the mutex owner.
- * It reset the "taken" & "owner" fields for the mutex identified by <mutex_xp>.
- * It unblocks the first thread registered in the mutex waiting queue, when the 
- * queue is not empty.
- *****************************************************************************************
- * @ mutex_xp  : extended pointer on mutex descriptor.
- * @ return 0 if success / return non zero if calling thread is not mutex owner. 
- ****************************************************************************************/
-error_t remote_mutex_unlock( xptr_t  mutex_xp );
-
-/*****************************************************************************************
- * This non blocking function function attempts to lock a mutex without blocking.
- *****************************************************************************************
- * @ mutex_xp  : extended pointer on mutex descriptor.
- * @ return 0 if success / return non zero if already taken.
- ****************************************************************************************/
-error_t remote_mutex_trylock( xptr_t  mutex_xp );
-
-
-
-#endif
Index: trunk/kernel/libk/remote_queuelock.c
===================================================================
--- trunk/kernel/libk/remote_queuelock.c	(revision 690)
+++ 	(revision )
@@ -1,211 +1,0 @@
-/*
- * remote_queuelock.c - remote kernel lock with waiting queue implementation.
- *
- * Authors   Alain Greiner     (2016,2017,2018,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_atomic.h>
-#include <thread.h>
-#include <scheduler.h>
-#include <busylock.h>
-#include <remote_queuelock.h>
-
-//////////////////////////////////////////////////////////////////////////////
-//                Extern global variables
-//////////////////////////////////////////////////////////////////////////////
-
-extern char * lock_type_str[];          // allocated in kernel_init.c
-
-
-/////////////////////////////////////////////
-void remote_queuelock_init( xptr_t   lock_xp,
-                            uint32_t type )
-{
-    // get remote lock cluster and local pointer 
-    cxy_t                lock_cxy = GET_CXY( lock_xp );
-    remote_queuelock_t * lock_ptr = GET_PTR( lock_xp );
-
-    // initialise taken field
-    hal_remote_s32( XPTR( lock_cxy , &lock_ptr->taken ), 0 );
-
-    // initialise xroot field
-    xlist_root_init( XPTR( lock_cxy , &lock_ptr->xroot ) );
-
-    // initialise busylock field
-    remote_busylock_init( XPTR( lock_cxy , &lock_ptr->lock ) , type );
-
-#if DEBUG_QUEUELOCK_TYPE
-thread_t * this = CURRENT_THREAD;
-bool_t     cond = (type == DEBUG_QUEUELOCK_TYPE) &&
-                  (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
-                    (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
-                   ((DEBUG_QUEUELOCK_CXY == 0) &&
-                    (DEBUG_QUEUELOCK_PTR == 0)));
-if( cond )printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[type], lock_cxy, lock_ptr );
-#endif
-
-}  // end remote_queuelock_init()
-
-///////////////////////////////////////////////
-void remote_queuelock_acquire( xptr_t lock_xp )
-{
-    thread_t * this = CURRENT_THREAD;
-
-    // get lock cluster and local pointer 
-    cxy_t                lock_cxy = GET_CXY( lock_xp );
-    remote_queuelock_t * lock_ptr = GET_PTR( lock_xp );
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-#if DEBUG_QUEUELOCK_TYPE
-uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
-bool_t     cond = (lock_type == DEBUG_QUEUELOCK_TYPE) &&
-                  (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
-                    (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
-                   ((DEBUG_QUEUELOCK_CXY == 0) &&
-                    (DEBUG_QUEUELOCK_PTR == 0)));
-#endif
-
-    // build extended pointer on busylock protecting queuelock
-    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
-
-    // get busylock 
-    remote_busylock_acquire( busylock_xp );
-
-    // block and deschedule if lock already taken
-    while( hal_remote_l32( XPTR( lock_cxy, &lock_ptr->taken ) ) )
-    {
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond ) printk("\n[%s] thread[%x,%x] BLOCK on q_lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], lock_cxy, lock_ptr );
-#endif
-        // get pointer on calling thread
-        thread_t * this = CURRENT_THREAD;
-
-        // block calling thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_LOCK );
-
-        // register calling thread in waiting list
-        xlist_add_last( XPTR( lock_cxy  , &lock_ptr->xroot ),
-                        XPTR( local_cxy , &this->wait_xlist ) );
-
-        // release busylock
-        remote_busylock_release( busylock_xp );
-
-        // deschedule calling thread
-        sched_yield("wait remote_queuelock");
-
-        // get busylock 
-        remote_busylock_acquire( busylock_xp );
-    }
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond ) printk("\n[%s] thread[%x,%x] ACQUIRE q_lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], lock_cxy, lock_ptr );
-#endif
-
-    // update remote_queuelock state
-    hal_remote_s32( XPTR( lock_cxy , &lock_ptr->taken ) , 1 );
-
-    // release busylock
-    remote_busylock_release( busylock_xp );
-
-    hal_fence();
-
-}  // end remote_queuelock_acquire()
-
-////////////////////////////////////////////////
-void remote_queuelock_release( xptr_t  lock_xp )
-{
-    // memory barrier before lock release
-    hal_fence();
-
-    // get lock cluster and local pointer 
-    cxy_t                lock_cxy = GET_CXY( lock_xp );
-    remote_queuelock_t * lock_ptr = GET_PTR( lock_xp );
-
-#if DEBUG_QUEUELOCK_TYPE
-thread_t * this      = CURRENT_THREAD;
-uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
-bool_t     cond = (lock_type == DEBUG_QUEUELOCK_TYPE) &&
-                  (((lock_cxy == (cxy_t)DEBUG_QUEUELOCK_CXY) &&
-                    (lock_ptr == (remote_queuelock_t*)DEBUG_QUEUELOCK_PTR)) ||
-                   ((DEBUG_QUEUELOCK_CXY == 0) &&
-                    (DEBUG_QUEUELOCK_PTR == 0)));
-#endif
-
-    // build extended pointer on busylock protecting queuelock
-    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
-
-    // get busylock
-    remote_busylock_acquire( busylock_xp );
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond ) printk("\n[%s] thread[%x,%x] RELEASE q_lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[lock_type], lock_cxy, lock_ptr );
-#endif
-
-    // update remote_queuelock state
-    hal_remote_s32( XPTR( lock_cxy , &lock_ptr->taken ) , 0 );
-
-    // unblock first waiting thread if waiting list not empty
-    if( xlist_is_empty( XPTR( lock_cxy, &lock_ptr->xroot ) ) == false )
-    {
-        // get extended pointer on first waiting thread
-        xptr_t root_xp   = XPTR( lock_cxy , &lock_ptr->xroot );
-        xptr_t     thread_xp  = XLIST_FIRST( root_xp , thread_t , wait_xlist );
-        cxy_t      thread_cxy = GET_CXY( thread_xp );
-        thread_t * thread_ptr = GET_PTR( thread_xp );
-
-#if DEBUG_QUEUELOCK_TYPE
-if( cond )
-{
-    trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-    process_t * process = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-    pid_t       pid     = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / q_lock %s [%x,%x]\n",
-    __FUNCTION__, this->process->pid, this->trdid, trdid, pid, 
-    lock_type_str[lock_type], lock_cxy, lock_ptr );
-}
-#endif
-
-        // remove this thread from waiting queue
-        xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-        // unblock this waiting thread
-        thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
-    }
-
-    // release busylock
-    remote_busylock_release( busylock_xp );
-
-}  // end remote_queuelock_release()
-
-
-
Index: trunk/kernel/libk/remote_queuelock.h
===================================================================
--- trunk/kernel/libk/remote_queuelock.h	(revision 690)
+++ 	(revision )
@@ -1,95 +1,0 @@
-/*
- * remote_queuelock.h: remote kernel lock with waiting queue definition.
- * 
- * Authors  Alain Greiner (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-kernel; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _REMOTE_QUEUELOCK_H_
-#define _REMOTE_QUEUELOCK_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <remote_busylock.h>
-#include <xlist.h>
-
-/*******************************************************************************************
- * This synchronisation object sequencializes concurrent read or write accesses to a
- * globally shared object located in any cluster, made by thread(s) running in any cluster.
- * This lock has only two states: taken or free.
- * When the lock has been taken by another thread T', the thread T executing the
- * queuelock_acquire() function blocks and deschedules, after registering in the waiting
- * queue rooted in lock descriptor. The first thread in the waiting queue will be unblocked 
- * by the owner thread executing the queuelock_release() function.
- * To handle concurrent accesses between a thread T executing the acquire() function
- * and a thread T' executing the release() function, the "remote_queuelock" is protected
- * by a "remote_busylock" used by these two access functions.
- ******************************************************************************************/
- 
-
-/*******************************************************************************************
- * This structure defines a remote_queuelock.
- ******************************************************************************************/
-
-typedef struct remote_queuelock_s
-{
-    remote_busylock_t   lock;               /*! protect atomic access to remote_queuelock */
-	volatile uint32_t   taken;              /*! state : free if zero / taken if non zero  */
-    xlist_entry_t       xroot;              /*! root of xlist of waiting threads          */
-}
-remote_queuelock_t;
-
-/*******************************************************************************************
- * This function initializes a local remote_queuelock in free state.
- * The <type> argument defines the lock usage and is only used for debug.
- * This type is actually stored in the associated busylock descriptor.
- *******************************************************************************************
- * @ lock_xp   : extended pointer on remote_queuelock.
- * @ type      : lock usage for debug.
-******************************************************************************************/
-inline void remote_queuelock_init( xptr_t   lock_xp,
-                                   uint32_t type );
-
-/*******************************************************************************************
- * This blocking function acquires a remote_queuelock.
- * The calling thread and the lock can be in different clusters.
- * It uses the remote_busylock to atomically access/update the remote_queuelock state.
- * If the lock is already taken, the calling thread atomically registers in the xlist
- * of waiting threads (rooted in the lock descriptor), block and deschedule.
- * It increments the calling thread remote_locks counter when the lock has been taken.
- * It optionally update the <owner_xp> and <xlist> debug fields.
- *******************************************************************************************
- * @ lock_xp   : extended pointer on remote_queuelock.
- ******************************************************************************************/
-void remote_queuelock_acquire( xptr_t  lock_xp );
-
-/*******************************************************************************************
- * This function releases a remote_queuelock.
- * The calling thread and the lock can be in different clusters.
- * It uses the remote_busylock to atomically access/update the remote_queuelock state.
- * If the xlist of waiting threads is not empty, the first waiting thread is unblocked.
- * It decrements the calling thread remote_locks counter when the lock has been released.
- * It optionally update the <owner_xp> and <xlist> debug fields.
- *******************************************************************************************
- * @ lock_xp   : extended pointer on remote_queuelock.
- ******************************************************************************************/
-void remote_queuelock_release( xptr_t lock_xp );
-
-
-#endif	/* _REMOTE_QUEUELOCK_H_ */
Index: trunk/kernel/libk/remote_rwlock.c
===================================================================
--- trunk/kernel/libk/remote_rwlock.c	(revision 690)
+++ trunk/kernel/libk/remote_rwlock.c	(revision 1)
@@ -1,6 +1,7 @@
 /*
- * remote_rwlock.c - kernel remote read/write lock implementation.
+ * remote_rwlock.c - kernel remote rwlock implementation.
  * 
- * Authors    Alain   Greiner (2016,2017,2018,2019)
+ * Authors  Mohamed Karaoui (2015)
+ *          Alain   Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,432 +23,183 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_remote.h>
 #include <hal_irqmask.h>
 #include <thread.h>
-#include <printk.h>
 #include <cluster.h>
 #include <scheduler.h>
 #include <remote_rwlock.h>
 
-//////////////////////////////////////////////////////////////////////////////
-//                Extern global variables
-//////////////////////////////////////////////////////////////////////////////
-
-extern char * lock_type_str[];          // allocated in kernel_init.c
-
-
-//////////////////////////////////////////
-void remote_rwlock_init( xptr_t   lock_xp,
-                         uint32_t type )
+///////////////////////////////////////////
+void remote_rwlock_init( xptr_t lock_xp )
 { 
-    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
-    cxy_t             lock_cxy = GET_CXY( lock_xp );
-
-    hal_remote_s32 ( XPTR( lock_cxy , &lock_ptr->taken ) , 0 );
-    hal_remote_s32 ( XPTR( lock_cxy , &lock_ptr->count ) , 0 );
-
-    xlist_root_init( XPTR( lock_cxy , &lock_ptr->rd_xroot ) );
-    xlist_root_init( XPTR( lock_cxy , &lock_ptr->wr_xroot ) );
-
-    remote_busylock_init( XPTR( lock_cxy , &lock_ptr->lock ) , type ); 
-
-#if DEBUG_RWLOCK_TYPE
-thread_t * this = CURRENT_THREAD;
-bool_t     cond = (type == DEBUG_RWLOCK_TYPE) &&
-                  (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                    (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
-                   ((DEBUG_RWLOCK_CXY == 0) &&
-                    (DEBUG_RWLOCK_PTR == 0)));
-if( cond )
-printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[type], local_cxy, lock_ptr );
-#endif
-
+    remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
+    cxy_t             lock_cxy = GET_CXY( lock_xp );
+
+    hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->ticket )  , 0 );
+    hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->current ) , 0 );
+    hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->count )   , 0 );
+    hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner )   , XPTR_NULL );
 }
 
-///////////////////////////////////////////////
-void remote_rwlock_rd_acquire( xptr_t lock_xp )
+//////////////////////////////////////////////
+void remote_rwlock_rd_lock( xptr_t lock_xp )
 { 
-    thread_t * this = CURRENT_THREAD;
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // get cluster and local pointer on remote_rwlock
-    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
-    cxy_t             lock_cxy = GET_CXY( lock_xp );
-
-#if DEBUG_RWLOCK_TYPE
-uint32_t lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
-bool_t   cond        = (type == DEBUG_RWLOCK_TYPE) &&
-                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
-                        ((DEBUG_RWLOCK_CXY == 0) &&
-                         (DEBUG_RWLOCK_PTR == 0)));
-xptr_t   wr_root_xp  = XPTR( lock_cxy , &lock_ptr->wr_xroot );
-#endif
-
-    // build useful extended pointers
-    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
-    xptr_t taken_xp    = XPTR( lock_cxy , &lock_ptr->taken );
-    xptr_t count_xp    = XPTR( lock_cxy , &lock_ptr->count );
-    xptr_t rd_root_xp  = XPTR( lock_cxy , &lock_ptr->rd_xroot );
-
-    // get busylock
-    remote_busylock_acquire( busylock_xp );
-
-    // block and deschedule if lock taken
-    while( hal_remote_l32( taken_xp ) )
+	uint32_t   mode;
+    uint32_t   ticket;
+
+    // get cluster and local pointer on remote_rwlock
+    remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
+    cxy_t             lock_cxy = GET_CXY( lock_xp );
+
+    // get cluster and local pointer on local thread
+    cxy_t               thread_cxy = local_cxy;
+    thread_t          * thread_ptr = CURRENT_THREAD;
+
+    // extended pointers on ticket, current, count, and thread->remote_locks
+    xptr_t              ticket_xp  = XPTR( lock_cxy   , &lock_ptr->ticket );
+    xptr_t              current_xp = XPTR( lock_cxy   , &lock_ptr->current );
+    xptr_t              count_xp   = XPTR( lock_cxy   , &lock_ptr->count );
+    xptr_t              locks_xp   = XPTR( thread_cxy , &thread_ptr->remote_locks );
+
+    // disable interrupts
+    hal_disable_irq( &mode );
+
+    // get next free ticket
+    ticket = hal_remote_lw( ticket_xp );
+
+    // loop to take the lock 
+	while( ticket != hal_remote_lw( current_xp ) )
+	{
+        hal_fixed_delay( CONFIG_RWLOCK_DELAY );
+	}
+
+    ////////// From here we have the lock  ////////////
+
+    // increment count and thead.remote_locks
+    hal_remote_atomic_add( count_xp , 1 );
+    hal_remote_atomic_add( locks_xp , 1 );
+
+    // sync
+    hal_wbflush();
+
+    // release lock to allow several simultaneous readers
+    hal_remote_atomic_add( current_xp , 1 );
+
+    // enable interrupts
+	hal_restore_irq( mode );
+
+}  // end remote_rwlock_rd_lock()
+
+////////////////////////////////////////////////
+void remote_rwlock_rd_unlock( xptr_t lock_xp )
+{
+	uint32_t            mode;
+
+    // get cluster and local pointer on remote_rwlock
+    remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
+    cxy_t             lock_cxy = GET_CXY( lock_xp );
+
+    // get cluster and local pointer on local thread
+    cxy_t               thread_cxy = local_cxy;
+    thread_t          * thread_ptr = CURRENT_THREAD;
+
+    // extended pointers on lock->count and thread->remote_locks
+    xptr_t              count_xp = XPTR( lock_cxy   , &lock_ptr->count );
+    xptr_t              locks_xp = XPTR( thread_cxy , &thread_ptr->remote_locks );
+
+    // disable interrupts
+	hal_disable_irq( &mode );
+  
+    // decrement count and thread.remote_locks
+    hal_remote_atomic_add( count_xp , -1 );
+	hal_remote_atomic_add( locks_xp , -1 );
+
+    // enable interrupts
+	hal_restore_irq( mode );
+
+}  // end remote_rwlock_rd_unlock()
+
+//////////////////////////////////////////////
+void remote_rwlock_wr_lock( xptr_t lock_xp )
+{ 
+	uint32_t   mode;
+    uint32_t   ticket;
+
+    // get cluster and local pointer on remote_rwlock
+    remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
+    cxy_t             lock_cxy = GET_CXY( lock_xp );
+
+    // get cluster and local pointer on local thread
+    cxy_t               thread_cxy = local_cxy;
+    thread_t          * thread_ptr = CURRENT_THREAD;
+
+    // compute extended pointers on lock->ticket, lock->owner, and thread->remote_locks
+    xptr_t              ticket_xp  = XPTR( lock_cxy   , &lock_ptr->ticket );
+    xptr_t              count_xp   = XPTR( lock_cxy   , &lock_ptr->count );
+    xptr_t              current_xp = XPTR( lock_cxy   , &lock_ptr->current );
+    xptr_t              owner_xp   = XPTR( lock_cxy   , &lock_ptr->owner );
+    xptr_t              locks_xp   = XPTR( thread_cxy , &thread_ptr->remote_locks );
+    xptr_t              thread_xp  = XPTR( thread_cxy , thread_ptr );
+
+    // disable interrupts
+    hal_disable_irq( &mode );
+
+    // get next free ticket
+    ticket = hal_remote_lw( ticket_xp );
+
+    // loop to take the lock 
+	while( ticket != hal_remote_lw( current_xp ) )
+	{
+        hal_fixed_delay( CONFIG_RWLOCK_DELAY );
+	}
+
+    ////////// From here we have the lock  ////////////
+
+    // wait completion of read accesses
+    while( hal_remote_lw( count_xp ) != 0 )
     {
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] READ BLOCK on %s [%x,%x]\n"
-"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], lock_cxy, lock_ptr,
-hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
-xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
-#endif
-        // get pointer on calling thread
-        thread_t * this = CURRENT_THREAD;
-
-        // register reader thread in waiting queue
-        xlist_add_last( rd_root_xp , XPTR( local_cxy , &this->wait_xlist ) );
-
-        // block reader thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_LOCK );
-
-        // release busylock
-        remote_busylock_release( busylock_xp );
-
-        // deschedule
-        sched_yield("reader wait remote_rwlock");
-
-        // get busylock
-        remote_busylock_acquire( busylock_xp );
+        hal_fixed_delay( CONFIG_RWLOCK_DELAY );
     }
 
-    // increment number of readers
-    hal_remote_atomic_add( count_xp , 1 );
-
-    hal_fence();
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] READ ACQUIRE %s [%x,%x]\n"
-"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[lock_type], lock_cxy, lock_ptr,
-hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
-xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
-#endif
-
-    // release busylock
-    remote_busylock_release( busylock_xp );
-
-}  // end remote_rwlock_rd_acquire()
-
-///////////////////////////////////////////////
-void remote_rwlock_wr_acquire( xptr_t lock_xp )
-{ 
-    thread_t * this = CURRENT_THREAD;
-
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // get cluster and local pointer on remote_rwlock
-    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
-    cxy_t             lock_cxy = GET_CXY( lock_xp );
-
-#if DEBUG_RWLOCK_TYPE
-uint32_t lock_type   = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
-bool_t   cond        = (type == DEBUG_RWLOCK_TYPE) &&
-                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
-                        ((DEBUG_RWLOCK_CXY == 0) &&
-                         (DEBUG_RWLOCK_PTR == 0)));
-xptr_t   rd_root_xp  = XPTR( lock_cxy , &lock_ptr->rd_xroot );
-#endif
-
-    // build useful extended pointers
-    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
-    xptr_t taken_xp    = XPTR( lock_cxy , &lock_ptr->taken );
-    xptr_t count_xp    = XPTR( lock_cxy , &lock_ptr->count );
-    xptr_t wr_root_xp  = XPTR( lock_cxy , &lock_ptr->wr_xroot );
-
-    // get busylock
-    remote_busylock_acquire( busylock_xp );
-
-    // block and deschedule if lock already taken or current readers
-    while( hal_remote_l32( taken_xp ) || hal_remote_l32( count_xp ) )
-    {
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] WRITE BLOCK on %s [%x,%x]\n"
-"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], lock_cxy, lock_ptr, 
-hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
-xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
-#endif
-
-        // get local pointer on calling thread
-        thread_t * this = CURRENT_THREAD;
-
-        // register writer thread in waiting queue
-        xlist_add_last( wr_root_xp , XPTR( local_cxy , &this->wait_xlist ) );
-
-        // block writer thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_LOCK );
-
-        // release busylock
-        remote_busylock_release( busylock_xp );
-
-        // deschedule
-        sched_yield("writer wait remote_rwlock");
-
-        // get busylock
-        remote_busylock_acquire( busylock_xp );
-    }
-
-    // take rwlock for write
-    hal_remote_s32( taken_xp , 1 );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] WRITE ACQUIRE %s [%x,%x]\n"
-"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], lock_cxy, lock_ptr,
-hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
-xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
-#endif
-
-    // release busylock
-    remote_busylock_release( busylock_xp );
-
-}  // end remote_rwlock_wr_acquire()
-
-
-///////////////////////////////////////////////
-void remote_rwlock_rd_release( xptr_t lock_xp )
+    // register owner thread and increment thread.remote_locks
+    hal_remote_swd( owner_xp , thread_xp );
+    hal_remote_atomic_add( locks_xp , 1 );
+
+    // enable interrupts
+	hal_restore_irq( mode );
+
+}  // end remote_rwlock_wr_lock()
+
+//////////////////////////////////////////////
+void remote_rwlock_wr_unlock( xptr_t lock_xp )
 {
-    // memory barrier before lock release
-    hal_fence();
-
-    // get cluster and local pointer on remote_rwlock
-    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
-    cxy_t             lock_cxy = GET_CXY( lock_xp );
-
-    // build useful extended pointers
-    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
-    xptr_t count_xp    = XPTR( lock_cxy , &lock_ptr->count );
-    xptr_t rd_root_xp  = XPTR( lock_cxy , &lock_ptr->rd_xroot );
-    xptr_t wr_root_xp  = XPTR( lock_cxy , &lock_ptr->wr_xroot );
-
-    // get busylock
-    remote_busylock_acquire( busylock_xp );
-
-	// decrement number of readers
-    hal_remote_atomic_add( count_xp , -1 );
-
-#if DEBUG_RWLOCK_TYPE
-thread_t * this      = CURRENT_THREAD;
-uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
-bool_t     cond      = (type == DEBUG_RWLOCK_TYPE) &&
-                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
-                        ((DEBUG_RWLOCK_CXY == 0) &&
-                         (DEBUG_RWLOCK_PTR == 0)));
-xptr_t     taken_xp  = XPTR( lock_cxy , &lock_ptr->taken );
-#endif
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] READ RELEASE %s [%x,%x]\n"
-"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[lock_type], lock_cxy, lock_ptr,
-hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
-xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
-#endif
-
-    // release first writer in waiting queue if no current readers
-    // and writers waiting queue non empty
-    if( (hal_remote_l32( count_xp ) == 0) && (xlist_is_empty( wr_root_xp ) == false) )
-    {
-        // get first writer thread
-        xptr_t      thread_xp  = XLIST_FIRST( wr_root_xp , thread_t, wait_xlist );
-        cxy_t       thread_cxy = GET_CXY( thread_xp ); 
-        thread_t *  thread_ptr = GET_PTR( thread_xp ); 
-
-        // remove this waiting thread from waiting list
-        xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-        // unblock this waiting thread
-        thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-{
-    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-    __FUNCTION__, this->process->pid, this->trdid, pid, trdid, 
-    lock_type_str[lock_type], lock_cxy, lock_ptr );
-}
-#endif
-
-    }
-
-    // release all readers in waiting queue if writers waiting queue empty
-    // and readers waiting queue non empty
-    else if( xlist_is_empty( wr_root_xp ) && (xlist_is_empty( rd_root_xp ) == false) )
-    {
-        while( xlist_is_empty( rd_root_xp ) == false )
-        {
-            // get first writer thread
-            xptr_t      thread_xp  = XLIST_FIRST( wr_root_xp , thread_t, wait_xlist );
-            cxy_t       thread_cxy = GET_CXY( thread_xp ); 
-            thread_t *  thread_ptr = GET_PTR( thread_xp ); 
-
-            // remove this waiting thread from waiting list
-            xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-            // unblock this waiting thread
-            thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-{
-    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-    __FUNCTION__, this->process->pid, this->trdid, pid, trdid, 
-    lock_type_str[lock_type], lock_cxy, lock_ptr );
-}
-#endif
-
-        }
-    }
-
-    // release busylock 
-    remote_busylock_release( busylock_xp );
-
-}  // end remote_rwlock_rd_release()
-
-///////////////////////////////////////////////
-void remote_rwlock_wr_release( xptr_t lock_xp )
-{ 
-    // memory barrier before lock release
-    hal_fence();
-
-    // get cluster and local pointer on remote_rwlock
-    remote_rwlock_t * lock_ptr = GET_PTR( lock_xp );
-    cxy_t             lock_cxy = GET_CXY( lock_xp );
-
-    // build useful extended pointers
-    xptr_t busylock_xp = XPTR( lock_cxy , &lock_ptr->lock );
-    xptr_t taken_xp    = XPTR( lock_cxy , &lock_ptr->taken );
-    xptr_t rd_root_xp  = XPTR( lock_cxy , &lock_ptr->rd_xroot );
-    xptr_t wr_root_xp  = XPTR( lock_cxy , &lock_ptr->wr_xroot );
-
-    // get busylock
-    remote_busylock_acquire( busylock_xp );
-
-    // release rwlock
-    hal_remote_s32( taken_xp , 0 );
-
-#if DEBUG_RWLOCK_TYPE
-thread_t * this      = CURRENT_THREAD;
-uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
-bool_t     cond      = (type == DEBUG_RWLOCK_TYPE) &&
-                       (((lock_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                         (lock_ptr == (remote_queuelock_t*)DEBUG_RWLOCK_PTR)) ||
-                        ((DEBUG_RWLOCK_CXY == 0) &&
-                         (DEBUG_RWLOCK_PTR == 0)));
-xptr_t     count_xp  = XPTR( lock_cxy , &lock_ptr->count );
-#endif
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] WRITE RELEASE %s [%x,%x]\n"
-"     taken %d / count %d / wr_empty %d / rd_empty %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[lock_type], lock_cxy, lock_ptr,
-hal_remote_l32( taken_xp ), hal_remote_l32( count_xp ),
-xlist_is_empty( wr_root_xp ), xlist_is_empty( rd_root_xp ) );
-#endif
-
-    // unblock first waiting writer thread if writers waiting queue non empty
-    if( xlist_is_empty( wr_root_xp ) == false )
-    {
-        // get first writer thread
-        xptr_t      thread_xp  = XLIST_FIRST( wr_root_xp , thread_t, wait_xlist );
-        cxy_t       thread_cxy = GET_CXY( thread_xp ); 
-        thread_t *  thread_ptr = GET_PTR( thread_xp ); 
-
-        // remove this waiting thread from waiting list
-        xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-        // unblock this waiting thread
-        thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-{
-    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-    __FUNCTION__, this->process->pid, this->trdid, pid, trdid, 
-    lock_type_str[lock_type], lock_cxy, lock_ptr );
-}
-#endif
-
-    }
-
-    // check readers waiting queue and unblock all if writers waiting queue empty
-    else 
-    {
-        while( xlist_is_empty( rd_root_xp ) == false )
-        {
-            // get first writer thread
-            xptr_t      thread_xp  = XLIST_FIRST( rd_root_xp , thread_t, wait_xlist );
-            cxy_t       thread_cxy = GET_CXY( thread_xp ); 
-            thread_t *  thread_ptr = GET_PTR( thread_xp ); 
-
-            // remove this waiting thread from waiting list
-            xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-            // unblock this waiting thread
-            thread_unblock( thread_xp , THREAD_BLOCKED_LOCK );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-{
-    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-    process_t * process   = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-    uint32_t    pid       = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-    printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-    __FUNCTION__, this->process->pid, this->trdid, pid, trdid, 
-    lock_type_str[lock_type], lock_cxy, lock_ptr );
-}
-#endif
-
-        }
-    }
-
-    // release busylock 
-    remote_busylock_release( busylock_xp );
-
-}  // end remote_rwlock_wr_release()
-
-
-
+	uint32_t            mode;
+
+    // get cluster and local pointer on remote_rwlock
+    remote_rwlock_t * lock_ptr = (remote_rwlock_t *)GET_PTR( lock_xp );
+    cxy_t             lock_cxy = GET_CXY( lock_xp );
+
+    // get cluster and local pointer on local thread
+    cxy_t               thread_cxy = local_cxy;
+    thread_t          * thread_ptr = CURRENT_THREAD;
+
+    // compute extended pointers on lock->ticket, lock->owner and thread->remote_locks
+    xptr_t              current_xp = XPTR( lock_cxy   , &lock_ptr->ticket );
+    xptr_t              owner_xp   = XPTR( lock_cxy   , &lock_ptr->owner );
+    xptr_t              locks_xp   = XPTR( thread_cxy , &thread_ptr->remote_locks );
+
+    // disable interrupts
+	hal_disable_irq( &mode );
+  
+    // unregister owner thread, and release lock
+    hal_remote_swd( owner_xp , XPTR_NULL );
+    hal_remote_atomic_add( current_xp , 1 );
+	hal_remote_atomic_add( locks_xp , -1 );
+
+    // enable interrupts
+	hal_restore_irq( mode );
+
+}  // end remote_rwlock_wr_unlock()
+
+
Index: trunk/kernel/libk/remote_rwlock.h
===================================================================
--- trunk/kernel/libk/remote_rwlock.h	(revision 690)
+++ trunk/kernel/libk/remote_rwlock.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * remote_rwlock.h - kernel remote read/write lock definition.
+ * remote_rwlock.h - kernel remote_rwlock definition.
  *
- * Authors   Alain Greiner   (2016,2017,2018,2020)
+ * Authors   Alain Greiner   (2016)
  * 
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,82 +25,72 @@
 #define _REMOTE_RWLOCK_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <remote_busylock.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <xlist.h>
 
-/*******************************************************************************************
- * This structure defines a kernel, global, read/write lock, supporting several simultaneous
- * read accesses, but only one write access to a globally shared object, that can be
- * accessed by threads running in any cluster.
- * Both readers and writers take the associated busylock before accessing or updating
- * the rwlock state, and releases the busylock after rwlock state update.
- * - when a reader try to access the object, it increments the readers "count" when the 
- *   lock is not "taken" by a writer. It registers in the "rd_root" waiting queue, blocks,
- *   and deschedules when the lock is taken.
- * - when a writer try to take the rwlock, it check the "taken" field. If the lock is already
- *   taken, or if the number of readers is non zero, it registers in the "wr_root" waiting
- *   queue, blocks, and deschedules. It set "taken" otherwise.
- * - when a reader completes its access, it decrement the readers "count", unblock 
- *   the first waiting writer if there is no other readers, and unblock all waiting
- *   readers if there no write request.
- * - when a  writer completes its access, it reset the "taken" field, releases the first
- *   waiting writer if queue non empty, or releases all waiting readers if no writer.
- ******************************************************************************************/
-
-
-/*******************************************************************************************
- * This structure defines a remote rwlock.
- ******************************************************************************************/
+/***************************************************************************************
+ * This structure defines a remote rwdlock,that supports several simultaneous read 
+ * accesses, but only one write access. It implements a ticket based allocation policy.
+ * It can be used to synchronize threads running in different clusters, because
+ * all access functions use remote pointers.
+ * - A reader take the lock to atomically increments the registered readers count.
+ *   Then it release the lock and access the protected structure. It atomically 
+ *   decrements the readers count without taking the lock when access is completed.
+ * - A writer take the lock and keep it, but must wait completion of all current read 
+ *   accesses before starting its own access.
+ * When the lock is taken by another thread, the new-comers use a busy waiting policy.
+ *
+ * TODO This could be replaced by a descheduling policy and a threads waiting queue
+ * implemented in the lock itself: each thread releasing the lock (i.e. incrementing
+ * the current field) activates the first waiting thread... 
+ **************************************************************************************/
 
 typedef struct remote_rwlock_s
 {
-    remote_busylock_t   lock;        /*! busylock protecting the rwlock state             */
-	volatile uint32_t   taken;       /*! lock taken by an exclusive writer if non zero    */
-    volatile uint32_t   count;       /*! current number of simultaneous readers threads   */
-    xlist_entry_t       rd_xroot;    /*! root of list of waiting readers                  */
-    xlist_entry_t       wr_xroot;    /*! root of list of waiting writers                  */
-}
+    uint32_t     ticket;                /*! first free ticket index                   */
+    uint32_t     current;               /*! ticket index of current owner             */
+    uint32_t     count;                 /*! current number of reader threads          */
+    xptr_t       owner;                 /*! extended pointer on writer thread         */
+} 
 remote_rwlock_t;
-
 
 /***************************************************************************************
  * This function initializes a remote rwlock.
- * The <type> argument defines the lock usage and is only used for debug.
- * This type is actually stored in the associated busylock descriptor.
  ***************************************************************************************
  * @ lock_xp    : extended pointer on the remote rwlock
- * @ type       : lock usage for debug.
  **************************************************************************************/
-void remote_rwlock_init( xptr_t   lock_xp,
-                         uint32_t type );
+void remote_rwlock_init( xptr_t lock_xp );
 
 /***************************************************************************************
  * This blocking function get access to a remote rwlock for a reader.
+ * It increments the calling thread locks count when the lock has been taken.
  ***************************************************************************************
  * @ lock_xp    : extended pointer on the remote rwlock
  **************************************************************************************/
-void remote_rwlock_rd_acquire( xptr_t lock_xp );
+void remote_rwlock_rd_lock( xptr_t lock_xp );
 
 /***************************************************************************************
  * This function releases a remote rwlock for a reader.
+ * It decrements the calling thread locks count when the lock has been released.
  ***************************************************************************************
  * @ lock_xp    : extended pointer on the remote rwlock
  **************************************************************************************/
-void remote_rwlock_rd_release( xptr_t lock_xp );
+void remote_rwlock_rd_unlock( xptr_t lock_xp );
 
 /***************************************************************************************
  * This blocking function get access to a remote rwlock for a writer.
+ * It increments the calling thread locks count when the lock has been taken.
  ***************************************************************************************
  * @ lock_xp    : extended pointer on the remote rwlock
  **************************************************************************************/
-void remote_rwlock_wr_acquire( xptr_t lock_xp );
+void remote_rwlock_wr_lock( xptr_t lock_xp );
 
 /***************************************************************************************
  * This function releases a remote rwlock for a writer.
+ * It decrements the calling thread locks count when the lock has been released.
  ***************************************************************************************
  * @ lock_xp    : extended pointer on the remote rwlock
  **************************************************************************************/
-void remote_rwlock_wr_release( xptr_t lock_xp );
+void remote_rwlock_wr_unlock( xptr_t lock_xp );
 
 #endif
Index: trunk/kernel/libk/remote_sem.c
===================================================================
--- trunk/kernel/libk/remote_sem.c	(revision 690)
+++ 	(revision )
@@ -1,320 +1,0 @@
-/*
- * remote_sem.c - POSIX unnamed semaphore implementation.
- * 
- * Author   Alain Greiner  (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <thread.h>
-#include <kmem.h>
-#include <printk.h>
-#include <process.h>
-#include <vmm.h>
-#include <remote_sem.h>
-
-
-///////////////////////////////////////////////
-xptr_t remote_sem_from_ident( intptr_t  ident )
-{
-    // get pointer on local process_descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get cluster and local pointer on reference process 
-    cxy_t          ref_cxy = GET_CXY( ref_xp );
-    process_t    * ref_ptr = GET_PTR( ref_xp );
-
-    // get extended pointer on semaphores list 
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->sem_root );
-    xptr_t lock_xp = XPTR( ref_cxy , &ref_ptr->sync_lock );
-   
-    // get lock protecting synchro lists
-    remote_queuelock_acquire( lock_xp );
- 
-    // scan reference process semaphores list
-    xptr_t         iter_xp;
-    xptr_t         sem_xp;
-    cxy_t          sem_cxy;
-    remote_sem_t * sem_ptr;
-    intptr_t       current;
-    bool_t         found = false;
-            
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        sem_xp  = XLIST_ELEMENT( iter_xp , remote_sem_t , list );
-        sem_cxy = GET_CXY( sem_xp );
-        sem_ptr = GET_PTR( sem_xp );
-        current = (intptr_t)hal_remote_lpt( XPTR( sem_cxy , &sem_ptr->ident ) );   
-
-        if( current == ident )
-        {
-            found = true;
-            break;
-        }
-    }
-
-    // relese lock protecting synchros lists
-    remote_queuelock_release( lock_xp );
- 
-    if( found == false )  return XPTR_NULL;
-    else                  return sem_xp;
-
-}  // end remote_sem_from_ident()
-
-///////////////////////////////////////////
-error_t remote_sem_create( intptr_t   vaddr,
-                           uint32_t   value )
-{
-    remote_sem_t * sem_ptr;
-
-    // get pointer on local process descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get reference process cluster and local pointer
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-
-    // allocate memory for new semaphore in reference cluster
-    sem_ptr = kmem_remote_alloc( ref_cxy , bits_log2(sizeof(remote_sem_t)) , AF_ZERO );
-
-    if( sem_ptr == NULL )
-    {
-        printk("\n[ERROR] in %s : cannot create semaphore\n", __FUNCTION__ );
-        return -1;
-    }
-
-    // initialise semaphore 
-    hal_remote_s32 ( XPTR( ref_cxy , &sem_ptr->count ) , value );
-	hal_remote_spt( XPTR( ref_cxy , &sem_ptr->ident ) , (void *)vaddr );
-	xlist_root_init( XPTR( ref_cxy , &sem_ptr->root ) );
-	xlist_entry_init( XPTR( ref_cxy , &sem_ptr->list ) );
-    remote_busylock_init( XPTR( ref_cxy , &sem_ptr->lock ), LOCK_SEM_STATE );
-
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->sem_root );
-    xptr_t list_xp = XPTR( ref_cxy , &sem_ptr->list );
-
-    // get lock protecting user synchro lists
-    remote_queuelock_acquire( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-    // register semaphore in reference process list of semaphores
-    xlist_add_first( root_xp , list_xp );
-
-    // release lock protecting user synchro lists
-    remote_queuelock_release( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-#if DEBUG_SEM
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_SEM )
-printk("\n[DBG] %s : thread %x in process %x INITIALIZE sem(%x,%x) / value %d\n",
-__FUNCTION__, this->trdid, this->process->pid, local_cxy, sem_ptr, value );
-#endif
-
-    return 0;
-
-}  // end remote_sem_create()
- 
-////////////////////////////////////////
-void remote_sem_destroy( xptr_t sem_xp )
-{
-    // get pointer on local process descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get extended pointer on reference process
-    xptr_t      ref_xp = process->ref_xp;
-
-    // get reference process cluster and local pointer
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = GET_PTR( ref_xp );
-
-    // get semaphore cluster and local pointer
-    cxy_t          sem_cxy = GET_CXY( sem_xp );
-    remote_sem_t * sem_ptr = GET_PTR( sem_xp );
-
-    // get remote pointer on waiting queue root
-    xptr_t root_xp = XPTR( sem_cxy , &sem_ptr->root );
-  
-    if( !xlist_is_empty( root_xp ) )   // user error
-    {
-        printk("WARNING in %s for thread %x in process %x : "
-               "destroy semaphore, but  waiting threads queue not empty\n", 
-               __FUNCTION__ , CURRENT_THREAD->trdid , CURRENT_THREAD->process->pid );
-    }
-
-    // remove semaphore from reference process xlist
-    remote_queuelock_acquire( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-    xlist_unlink( XPTR( sem_cxy , &sem_ptr->list ) );
-    remote_queuelock_release( XPTR( ref_cxy , &ref_ptr->sync_lock ) );
-
-    // release memory allocated for semaphore descriptor
-    kmem_remote_free( sem_cxy , sem_ptr , bits_log2(sizeof(remote_sem_t)) );
-
-}  // end remote_sem_destroy()
-
-/////////////////////////////////////
-void remote_sem_wait( xptr_t sem_xp )
-{ 
-    thread_t * this = CURRENT_THREAD;
-
-// check calling thread can yield
-assert( __FUNCTION__, (this->busylocks == 0),
-"cannot yield : busylocks = %d\n", this->busylocks );
-
-
-    // get semaphore cluster and local pointer
-    cxy_t          sem_cxy = GET_CXY( sem_xp );
-    remote_sem_t * sem_ptr = GET_PTR( sem_xp );
-
-    // get extended pointers on sem fields 
-    xptr_t           count_xp = XPTR( sem_cxy , &sem_ptr->count );
-    xptr_t           root_xp  = XPTR( sem_cxy , &sem_ptr->root );
-    xptr_t           lock_xp  = XPTR( sem_cxy , &sem_ptr->lock );
-
-    while( 1 )
-    {
-        // get busylock protecting semaphore     
-	    remote_busylock_acquire( lock_xp );
-  
-        // get semaphore current value
-        uint32_t count = hal_remote_l32( count_xp );
-
-	    if( count > 0 )                     // success
-	    {
-            // decrement semaphore value
-            hal_remote_s32( count_xp , count - 1 );
-
-#if DEBUG_SEM
-if( (uint32_t)hal_get_cycles() > DEBUG_SEM )
-printk("\n[DBG] %s : thread %x in process %x DECREMENT sem(%x,%x) / value %d\n",
-__FUNCTION__, this->trdid, this->process->pid, sem_cxy, sem_ptr, count-1 );
-#endif
-            // release busylock protecting semaphore
-	        remote_busylock_release( XPTR( sem_cxy , &sem_ptr->lock ) );
-
-            return;
-        }
-	    else                               // failure
-	    {
-            // get cluster and pointers on calling thread
-            cxy_t            caller_cxy = local_cxy;
-            thread_t       * caller_ptr = CURRENT_THREAD;
-            xptr_t           caller_xp  = XPTR( caller_cxy , caller_ptr );
-
-            // block the calling thread
-            thread_block( caller_xp , THREAD_BLOCKED_SEM );  
-
-            // register calling thread in waiting queue
-            xptr_t entry_xp = XPTR( caller_cxy , &caller_ptr->wait_xlist );
-		    xlist_add_last( root_xp , entry_xp );
-
-#if DEBUG_SEM
-if( (uint32_t)hal_get_cycles() > DEBUG_SEM )
-printk("\n[DBG] %s : thread %x in process %x BLOCK on sem(%x,%x) / value %d\n",
-__FUNCTION__, this->trdid, this->process->pid, sem_cxy, sem_ptr, count );
-#endif
-            // release busylock protecting semaphore
-	        remote_busylock_release( XPTR( sem_cxy , &sem_ptr->lock ) );
-
-            // deschedule calling thread
-            sched_yield("blocked on semaphore");
-        }
-	}
-}  // end remote_sem_wait()
-
-/////////////////////////////////////
-void remote_sem_post( xptr_t sem_xp )
-{
-    // memory barrier before sem release
-    hal_fence();
-
-    // get semaphore cluster and local pointer
-    cxy_t          sem_cxy = GET_CXY( sem_xp );
-    remote_sem_t * sem_ptr = GET_PTR( sem_xp );
-
-    // get extended pointers on sem fields 
-    xptr_t           count_xp = XPTR( sem_cxy , &sem_ptr->count );
-    xptr_t           root_xp  = XPTR( sem_cxy , &sem_ptr->root );
-    xptr_t           lock_xp  = XPTR( sem_cxy , &sem_ptr->lock );
-
-    // get busylock protecting semaphore
-	remote_busylock_acquire( lock_xp );
-  
-    // increment semaphore value
-    hal_remote_atomic_add( count_xp , 1 );
-
-#if DEBUG_SEM
-uint32_t count = hal_remote_l32( count_xp );
-thread_t * this = CURRENT_THREAD;
-if( (uint32_t)hal_get_cycles() > DEBUG_SEM )
-printk("\n[DBG] %s : thread %x in process %x INCREMENT sem(%x,%x) / value %d\n",
-__FUNCTION__, this->trdid, this->process->pid, sem_cxy, sem_ptr, count );
-#endif
-
-    // scan waiting queue to unblock all waiting threads
-	while( xlist_is_empty( root_xp ) == false )   // waiting queue non empty
-    {
-        // get first waiting thread from queue
-        xptr_t     thread_xp  = XLIST_FIRST( root_xp , thread_t , wait_xlist );
-        cxy_t      thread_cxy = GET_CXY( thread_xp );
-        thread_t * thread_ptr = GET_PTR( thread_xp );
-
-        // remove this thread from the waiting queue
-        xlist_unlink( XPTR( thread_cxy , &thread_ptr->wait_xlist ) );
-
-        // unblock this waiting thread
-		thread_unblock( thread_xp , THREAD_BLOCKED_SEM );
-
-#if DEBUG_SEM
-if( (uint32_t)hal_get_cycles() > DEBUG_SEM )
-{
-trdid_t     trdid   = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
-process_t * process = hal_remote_lpt( XPTR( thread_cxy , &thread_ptr->process ) );
-pid_t       pid     = hal_remote_l32( XPTR( thread_cxy , &process->pid ) );
-printk("\n[DBG] %s : thread %x in process %x UNBLOCK thread %x in process %x / sem(%x,%x)\n",
-__FUNCTION__, this->trdid, this->process->pid, trdid, pid, sem_cxy, sem_ptr );
-}
-#endif
-
-    }
-
-    // release busylock protecting the semaphore
-	remote_busylock_release( XPTR( sem_cxy , &sem_ptr->lock ) );
-
-}  // end remote_sem_post()
-
-
-//////////////////////////////////////////////
-void remote_sem_get_value( xptr_t      sem_xp,
-                           uint32_t  * data )
-{
-    // get semaphore cluster and local pointer
-    cxy_t          sem_cxy = GET_CXY( sem_xp );
-    remote_sem_t * sem_ptr = GET_PTR( sem_xp );
-
-    *data = hal_remote_l32( XPTR( sem_cxy , &sem_ptr->count ) );
-
-}  // end remote_sem_get_value()
-
-
Index: trunk/kernel/libk/remote_sem.h
===================================================================
--- trunk/kernel/libk/remote_sem.h	(revision 690)
+++ 	(revision )
@@ -1,130 +1,0 @@
-/*
- * remote_sem.h - POSIX unnamed semaphore definition.
- * 
- * Author   Alain Greiner    (2016,2017,2018,2019,2020)
- *
- * Copyright (c)  UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
-e* the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _SEMAPHORE_H_
-#define _SEMAPHORE_H_
-
-#include <hal_kernel_types.h>
-#include <xlist.h>
-#include <remote_busylock.h>
-
-/********************************************************************************************n
- * This is the kernel representation of an user level, POSIX compliant unnamed semaphore.
- *
- * It can be used by muti-threaded user applications to synchronise user threads
- * running in different clusters.
- *
-* A semaphore is declared by a given user process as a "sem_t" global variable.
- * The user "sem_t" structure is implemented as an unsigned long, but the value is not
- * used by the kernel. ALMOS-MKH uses only the sem_t virtual address as an identifier.
- * For each user semaphore, ALMOS-MKH creates a kernel "remote_sem_t" structure,
- * dynamically allocated in the reference cluster by the remote_sem_create() function, 
- * and destroyed by the remote_sem_destroy() function, using RPC if the calling thread is not
- * running in the reference cluster.
- *
- * The threads accessing the semaphore with the sem_get_value(), sem_wait(), sem_post()
- * syscalls can be running in any cluster, as these syscalls access the "remote_sem_t"
- * structure with remote_read / remote_write access functions.
- ********************************************************************************************/
-
-
-/*********************************************************************************************
- * This structure defines the kernel implementation of an user level semaphore.
- ********************************************************************************************/
-
-typedef struct remote_sem_s
-{
-	remote_busylock_t lock;          /*! lock protecting the semaphore state                */
-	uint32_t          count;         /*! current value                                      */
-    intptr_t          ident;         /*! virtual address in user space == identifier        */
-    xlist_entry_t     root;          /*! root of waiting thread queue                       */
-    xlist_entry_t     list;          /*! member of list of semaphores in same process       */
-}
-remote_sem_t;
-
-
-/*********************************************************************************************
- * This function returns an extended pointer on the remote semaphore identified
- * by its virtual address in a given user process. It makes an associative search, 
- * scanning the list of user semaphores rooted in the reference process descriptor.
- *********************************************************************************************
- * @ process  : pointer on local process descriptor.
- * @ ident    : semaphore virtual address, used as identifier.
- * @ returns extended pointer on semaphore if success / returns XPTR_NULL if not found. 
- ********************************************************************************************/
-xptr_t remote_sem_from_ident( intptr_t  ident );
-
-/*********************************************************************************************
- * This function implements the SEM_INIT operation.
- * It allocates memory for a remote semaphore in reference cluster, using a RPC if required, 
- * and initializes it, using remote accesses from values defined by the <vaddr> and <value>
- * arguments. It register this semaphore in the calling process list of user semaphores.
- *********************************************************************************************
- * @ vaddr     : [in] semaphore virtual address, used as identifier.
- * @ value     : [in] semaphore initial value.
- * @ returns 0 if success / returns -1 if no memory. 
- ********************************************************************************************/
-error_t remote_sem_create( intptr_t  vaddr,
-                           uint32_t  value );
- 
-/****************************yy***************************************************************
- * This function implements the SEM_DESTROY operation.
- * It desactivates the semaphore, and releases the physical memory allocated in the 
- * reference cluster, using a RPC if required.
- *********************************************************************************************
- * @ sem_xp   : [in] extended pointer on semaphore. 
- ********************************************************************************************/
-void remote_sem_destroy( xptr_t sem_xp );
-
-/****************************yy***************************************************************
- * This blocking function implements the SEM_WAIT operation.
- * - It returns only when the remote semaphore has a non-zero value, and has been 
- *   atomically decremented.
- * - If the semaphore has a zero value, it register the calling thread in the semaphore
- *   waiting queue, block the thread, and yield.
- *********************************************************************************************
- * @ sem_xp   : [in] extended pointer on semaphore. 
- ********************************************************************************************/
-void remote_sem_wait( xptr_t sem_xp );
-
-/****************************yy***************************************************************
- * This function implements the SEM_POST operation.
- * - It atomically increments the remote semaphore. 
- * - If the waiting queue is not empty, it wakes up all waiting thread.
- *********************************************************************************************
- * @ sem_xp   : [in] extended pointer on semaphore. 
- ********************************************************************************************/
-void remote_sem_post( xptr_t sem_xp );
-
-/****************************yy***************************************************************
- * This function implements the SEM_GETVALUE operation.
- * It returns in the <data> buffer the semaphore current value. 
- *********************************************************************************************
- * @ sem_xp   : [in]  extended pointer on semaphore. 
- * @ data     : [out] local pointer on buffer for returned value.
- ********************************************************************************************/
-void remote_sem_get_value( xptr_t      sem_xp,
-                           uint32_t  * data );
-
-
-#endif	/* _SEMAPHORE_H_ */
Index: trunk/kernel/libk/remote_spinlock.c
===================================================================
--- trunk/kernel/libk/remote_spinlock.c	(revision 1)
+++ trunk/kernel/libk/remote_spinlock.c	(revision 1)
@@ -0,0 +1,153 @@
+/*
+ * remote_spinlock.c - kernel remote spinlock implementation.
+ * 
+ * Authors  Mohamed Karaoui (2015)
+ *          Alain   Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <hal_types.h>
+#include <hal_remote.h>
+#include <hal_irqmask.h>
+#include <thread.h>
+#include <cluster.h>
+#include <scheduler.h>
+#include <remote_spinlock.h>
+
+////////////////////////////////////////
+void remote_spinlock_init( xptr_t lock )
+{ 
+    remote_spinlock_t * ptr = (remote_spinlock_t *)GET_PTR( lock );
+    cxy_t               cxy = GET_CXY( lock );
+
+    hal_remote_sw ( XPTR( cxy , &ptr->taken ) , 0 );
+    hal_remote_swd( XPTR( cxy , &ptr->owner ) , XPTR_NULL );
+    xlist_entry_init( XPTR( cxy , &ptr->list ) ); 
+}
+
+///////////////////////////////////////////////
+uint32_t remote_spinlock_trylock( xptr_t lock )
+{ 
+	uint32_t            mode;
+	bool_t              isAtomic = false;
+
+    // get cluster and local pointer on remote_spinlock
+    remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock );
+    cxy_t               lock_cxy = GET_CXY( lock );
+
+    // get cluster and local pointer on local thread
+    cxy_t               thread_cxy = local_cxy;
+    thread_t          * thread_ptr = CURRENT_THREAD;
+
+    // disable interrupts
+    hal_disable_irq( &mode );
+
+	if( hal_remote_lw( XPTR( lock_cxy , &lock_ptr->taken ) ) == 0 )
+    {
+		isAtomic = hal_remote_atomic_cas( XPTR( lock_cxy , &lock_ptr->taken ) , 0 , 1 );
+    }
+
+	if( isAtomic == false )    // failure 
+	{
+		hal_restore_irq( mode );
+		return 1;
+	}
+    else                      // success : register lock in thread
+    {
+	    thread_ptr->remote_locks++;
+
+        hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) ,
+                    (uint64_t)XPTR( thread_cxy , thread_ptr) );
+
+        xlist_add_first( XPTR( thread_cxy , &thread_ptr->xlocks_root ) ,
+                     XPTR( lock_cxy , &lock_ptr->list ) );
+
+	    hal_restore_irq(mode);  
+	    return 0;
+    }
+}
+
+////////////////////////////////////////
+void remote_spinlock_lock( xptr_t lock )
+{
+    bool_t              isAtomic = false;
+	uint32_t            mode;
+    volatile uint32_t   taken;
+
+    // get cluster and local pointer on remote_spinlock
+    remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock );
+    cxy_t               lock_cxy = GET_CXY( lock );
+
+    // get cluster and local pointer on local thread
+    cxy_t               thread_cxy = local_cxy;
+    thread_t          * thread_ptr = CURRENT_THREAD;
+
+    // disable interrupts
+	hal_disable_irq( &mode );
+  
+    // loop until success 
+	while( isAtomic == false )
+	{
+		taken = hal_remote_lw( XPTR( lock_cxy , &lock_ptr->taken ) );
+
+        // deschedule if possible when lock already taken
+		if( taken != 0 )
+		{
+	        hal_restore_irq( mode );
+            if( thread_can_yield() ) sched_yield();
+	        hal_disable_irq( &mode );
+			continue;
+		}
+    
+        // try to take the lock if not already taken
+		isAtomic = hal_remote_atomic_cas( XPTR( lock_cxy , &lock_ptr->taken ) , 0 , 1 );
+	}
+
+    // register lock in thread
+	thread_ptr->remote_locks++;
+
+    hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) ,
+                    (uint64_t)XPTR( thread_cxy , thread_ptr) );
+
+    xlist_add_first( XPTR( thread_cxy , &thread_ptr->xlocks_root ) ,
+                     XPTR( lock_cxy , &lock_ptr->list ) );
+
+    // enable interrupts
+	hal_restore_irq( mode );
+}
+
+//////////////////////////////////////////
+void remote_spinlock_unlock( xptr_t lock )
+{
+    // get cluster and local pointer on remote_spinlock
+    remote_spinlock_t * lock_ptr = (remote_spinlock_t *)GET_PTR( lock );
+    cxy_t               lock_cxy = GET_CXY( lock );
+
+    // get pointer on local thread
+    thread_t          * thread_ptr = CURRENT_THREAD;
+
+	hal_remote_swd( XPTR( lock_cxy , &lock_ptr->owner ) , XPTR_NULL );
+
+	hal_remote_sw ( XPTR( lock_cxy , &lock_ptr->taken ) , 0 );
+
+	thread_ptr->remote_locks--;
+
+    xlist_unlink( XPTR( lock_cxy , &lock_ptr->list ) );
+}
+
Index: trunk/kernel/libk/remote_spinlock.h
===================================================================
--- trunk/kernel/libk/remote_spinlock.h	(revision 1)
+++ trunk/kernel/libk/remote_spinlock.h	(revision 1)
@@ -0,0 +1,80 @@
+/*
+ * remote_spinlock.h - kernel remote spinlock definition.
+ *
+ * Authors  Mohamed Karaoui (2016)
+ *          Alain Greiner   (2016)
+ * 
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _REMOTE_SPINLOCK_H_
+#define _REMOTE_SPINLOCK_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <xlist.h>
+
+/***************************************************************************************
+ * This structure defines a remote spinlock, that can be used to protect
+ * exclusive access to a trans-cluster shared resource. It can be taken by any 
+ * thread running in any cluster. All access functions use remote pointers,
+ * and the owner thread is registrated as a remote pointer.
+ **************************************************************************************/
+
+typedef struct remote_spinlock_s
+{
+    volatile uint32_t     taken;       /*! free if 0 / taken if non zero             */
+    xptr_t                owner;       /*! extended pointer on the owner thread      */
+    xlist_entry_t         list;        /*! list of all remote_lock taken by owner    */
+} 
+remote_spinlock_t;
+
+/***************************************************************************************
+ * This function initializes a remote spinlock.
+ ***************************************************************************************
+ * @ lock    : extended pointer on the remote spinlock
+ **************************************************************************************/
+void remote_spinlock_init( xptr_t   lock );
+
+/***************************************************************************************
+ * This blocking function locks a remote spinlock.
+ * If the lock is already taken, the calling thread deschedule, and retry
+ * when it is rescheduled.
+ * It increments the calling thread locks count when the lock has been taken.
+ ***************************************************************************************
+ * @ lock    : extended pointer on the remote spinlock
+ **************************************************************************************/
+void remote_spinlock_lock( xptr_t lock );
+
+/***************************************************************************************
+ * This non blocking function try once to lock a remote spinlock.
+ * It increments the calling thread locks count in case of success.
+ ***************************************************************************************
+ * @ lock    : extended pointer on the remote spinlock
+ * @ returns O if success / returns non zero if lock already taken.
+ **************************************************************************************/
+uint32_t remote_spinlock_trylock( xptr_t lock );
+
+/***************************************************************************************
+ * This function releases a remote spinlock.
+ ***************************************************************************************
+ * @ lock    : extended pointer on the remote spinlock
+ **************************************************************************************/
+void remote_spinlock_unlock( xptr_t lock );
+
+#endif
Index: trunk/kernel/libk/rwlock.c
===================================================================
--- trunk/kernel/libk/rwlock.c	(revision 690)
+++ trunk/kernel/libk/rwlock.c	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * rwlock.c - kernel local read/write lock implementation.
+ * rwlock.c - kernel read/write lock synchronization.
  * 
- * Author  Alain Greiner     (2016,2017,2018,2019)
+ * Author  Alain Greiner     (2016}
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,6 +22,6 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_atomic.h>
 #include <hal_special.h>
@@ -31,311 +31,117 @@
 #include <rwlock.h>
 
-//////////////////////////////////////////////////////////////////////////////
-//                Extern global variables
-//////////////////////////////////////////////////////////////////////////////
-
-extern char * lock_type_str[];          // allocated in kernel_init.c
-
-
-//////////////////////////////////
-void rwlock_init( rwlock_t * lock,
-                  uint32_t   type )
+///////////////////////////////////////
+void rwlock_init( rwlock_t * lock )
 {  
-	lock->taken   = 0;
+	lock->ticket  = 0;
+    lock->current = 0;
     lock->count   = 0;
-
-    list_root_init( &lock->rd_root );
-    list_root_init( &lock->wr_root );
-
-    busylock_init( &lock->lock , type );
-
-#if DEBUG_RWLOCK_TYPE
-thread_t * this = CURRENT_THREAD;
-bool_t     cond = (lock_type == DEBUG_RWLOCK_TYPE) &&
-                  (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                    (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) ||
-                   ((DEBUG_RWLOCK_CXY == 0) &&
-                    (DEBUG_RWLOCK_PTR == 0)));
-if( cond ) printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid,
-lock_type_str[type], local_cxy, lock );
-#endif
-
+	lock->owner   = NULL;
 }
 
-/////////////////////////////////////////
-void rwlock_rd_acquire( rwlock_t * lock )
+//////////////////////////////////////
+void rwlock_rd_lock( rwlock_t * lock )
 {
-    thread_t * this = CURRENT_THREAD;
+	uint32_t            mode;
+	uint32_t            ticket;
+	thread_t          * this = CURRENT_THREAD;
 
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
+    // disable IRQs
+	hal_disable_irq( &mode );
 
-    // get busylock
-    busylock_acquire( &lock->lock );
+    // get next free ticket
+    ticket = hal_atomic_add( &lock->ticket , 1 );
+  
+    // poll the current ticket value
+	while( lock->current != ticket )
+    {
+        hal_fixed_delay( CONFIG_RWLOCK_DELAY );
+    }
 
-#if DEBUG_RWLOCK_TYPE
-uint32_t   lock_type = lock->lock.type;
-bool_t     cond = (lock_type == DEBUG_RWLOCK_TYPE) &&
-                  (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                    (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) ||
-                   ((DEBUG_RWLOCK_CXY == 0) &&
-                    (DEBUG_RWLOCK_PTR == 0)));
-#endif
-
-    // block and deschedule if lock already taken
-    while( lock->taken )
-    {
-
-#if DEBUG_RWLOCK_TYPE
-if( cond ) 
-printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], local_cxy, lock, lock->taken, lock->count );
-#endif
-        // register reader thread in waiting queue
-        list_add_last( &lock->rd_root , &this->wait_list );
-
-        // block reader thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_LOCK );
-        
-        // release busylock
-        busylock_release( &lock->lock );
-
-        // deschedule
-        sched_yield("reader wait rwlock");
-        
-        // get busylock
-        busylock_acquire( &lock->lock );
-    }
+    ////////// From here we have the lock  ////////////
 
     // increment number of readers
     lock->count++;
+    this->local_locks++;
 
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], local_cxy, lock, lock->taken, lock->count );
-#endif
+    // consistency
+    hal_wbflush();
 
-    // release busylock 
-    busylock_release( &lock->lock );
+    // release the lock to allow several simultaneous readers
+    lock->current++;
 
-}  // end rwlock_rd_acquire() 
+    // enable IRQs
+	hal_restore_irq( mode );
 
-/////////////////////////////////////////
-void rwlock_wr_acquire( rwlock_t * lock )
+}  // end  rwlock_rd_lock()
+
+////////////////////////////////////////
+void rwlock_rd_unlock( rwlock_t * lock )
 {
-    thread_t * this = CURRENT_THREAD;
+    uint32_t   mode;
+	thread_t * this = CURRENT_THREAD;
 
-    // check calling thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
+    // disable IRQs
+	hal_disable_irq( &mode );
+  
+    // decrement number of readers
+    hal_atomic_dec( &lock->count );
+    this->local_locks--;
 
-    // get busylock
-    busylock_acquire( &lock->lock );
+    // enable IRQs
+	hal_restore_irq( mode );
+}
 
-#if DEBUG_RWLOCK_TYPE
-uint32_t   lock_type = lock->lock.type;
-bool_t     cond = (lock_type == DEBUG_RWLOCK_TYPE) &&
-                  (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                    (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) ||
-                   ((DEBUG_RWLOCK_CXY == 0) &&
-                    (DEBUG_RWLOCK_PTR == 0)));
-#endif
+//////////////////////////////////////
+void rwlock_wr_lock( rwlock_t * lock )
+{
+	uint32_t           mode;
+    uint32_t           ticket;
+	thread_t         * this = CURRENT_THREAD;
 
-    // block and deschedule if lock already taken or existing read access
-    while( lock->taken || lock->count )
+    // disable IRQs
+	hal_disable_irq( &mode );
+  
+    // get next free ticket
+    ticket = hal_atomic_add( &lock->ticket , 1 );
+  
+    // poll the current ticket value
+	while( lock->current != ticket )
     {
+        hal_fixed_delay( CONFIG_RWLOCK_DELAY );
+    } 
 
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], local_cxy, lock, lock->taken, lock->count );
-#endif
-        // register writer in waiting queue
-        list_add_last( &lock->wr_root , &this->wait_list );
+    ////////// From here we have the lock  ////////////
 
-        // block writer thread
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_LOCK );
-        
-        // release busylock
-        busylock_release( &lock->lock );
-
-        // deschedule
-        sched_yield("writer wait rwlock");
-        
-        // get busylock
-        busylock_acquire( &lock->lock );
+    // wait completion of existing read access
+    while( lock->count != 0 )
+    {
+        hal_fixed_delay( CONFIG_RWLOCK_DELAY );
     }
 
-    // take the rwlock
-    lock->taken = 1;
+    lock->owner = this;
+    this->local_locks++;
 
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], local_cxy, lock, lock->taken, lock->count );
-#endif
+    // enable IRQs
+	hal_restore_irq( mode );
 
-    // release busylock 
-    busylock_release( &lock->lock );
+}  // end rwlock_wr_lock()
 
-}  // end rwlock_wr_acquire()
+////////////////////////////////////////////
+void rwlock_wr_unlock( rwlock_t * lock )
+{
+    uint32_t   mode;
+	thread_t * this = CURRENT_THREAD;
 
-/////////////////////////////////////////
-void rwlock_rd_release( rwlock_t * lock )
-{
-    // synchronize memory before lock release
-    hal_fence();
+    // disable IRQs
+	hal_disable_irq( &mode );
+  
+    // release lock
+    lock->current++;
+    lock->owner = NULL;
+    this->local_locks--;
+    
+    // enable IRQs
+	hal_restore_irq( mode );
+}
 
-    // get busylock
-    busylock_acquire( &lock->lock );
-
-    // decrement number of readers
-    lock->count--;
-
-#if DEBUG_RWLOCK_TYPE
-thread_t * this = CURRENT_THREAD;
-uint32_t   lock_type = lock->lock.type;
-bool_t     cond = (lock_type == DEBUG_RWLOCK_TYPE) &&
-                  (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                    (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) ||
-                   ((DEBUG_RWLOCK_CXY == 0) &&
-                    (DEBUG_RWLOCK_PTR == 0)));
-#endif
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], local_cxy, lock, lock->taken, lock->count );
-#endif
-
-    // release first writer in waiting queue if no current readers
-    // and writers waiting queue non empty
-    if( (lock->count == 0) && (list_is_empty( &lock->wr_root ) == false) )
-    {
-        // get first writer thread
-        thread_t * thread = LIST_FIRST( &lock->wr_root , thread_t , wait_list );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-
-        // remove this waiting thread from waiting list
-        list_unlink( &thread->wait_list );
-
-        // unblock this waiting thread
-        thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_LOCK );
-    }
-    // release all readers in waiting queue if writers waiting queue empty
-    // and readers waiting queue non empty
-    else if( list_is_empty( &lock->wr_root ) && (list_is_empty( &lock->rd_root ) == false) )
-    {
-        while( list_is_empty( &lock->rd_root ) == false )
-        {
-            // get first reader thread 
-            thread_t * thread = LIST_FIRST( &lock->wr_root , thread_t , wait_list );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-   
-            // remove this waiting thread from waiting list
-            list_unlink( &thread->wait_list );
-
-            // unblock this waiting thread
-            thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_LOCK );
-        }
-    }
-
-    // release busylock 
-    busylock_release( &lock->lock );
-
-}  // end rwlock_rd_release()
-
-/////////////////////////////////////////
-void rwlock_wr_release( rwlock_t * lock )
-{
-    // synchronize memory before lock release
-    hal_fence();
-
-    // get busylock
-    busylock_acquire( &lock->lock );
-
-    // release the rwlock
-    lock->taken = 0;
-
-#if DEBUG_RWLOCK_TYPE
-thread_t * this = CURRENT_THREAD;
-uint32_t   lock_type = lock->lock.type;
-bool_t     cond = (lock_type == DEBUG_RWLOCK_TYPE) &&
-                  (((local_cxy == (cxt_t)DEBUG_RWLOCK_CXY) &&
-                    (lock == (rwlock_t*)DEBUG_RWLOCK_PTR)) ||
-                   ((DEBUG_RWLOCK_CXY == 0) &&
-                    (DEBUG_RWLOCK_PTR == 0)));
-#endif
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-lock_type_str[lock_type], local_cxy, lock, lock->taken, lock->count );
-#endif
-
-    // release first waiting writer thread if writers waiting queue non empty
-    if( list_is_empty( &lock->wr_root ) == false )
-    {
-        // get first writer thread
-        thread_t * thread = LIST_FIRST( &lock->wr_root , thread_t , wait_list );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-        // remove this waiting thread from waiting list
-        list_unlink( &thread->wait_list );
-
-        // unblock this waiting thread
-        thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_LOCK );
-    }
-
-    // check readers waiting queue and release all if writers waiting queue empty
-    else 
-    {
-        while( list_is_empty( &lock->rd_root ) == false )
-        {
-            // get first reader thread 
-            thread_t * thread = LIST_FIRST( &lock->rd_root , thread_t , wait_list );
-
-#if DEBUG_RWLOCK_TYPE
-if( cond )
-printk("\n[%s] thread[%x,%x] UNBLOCK thread[%x,%x] / rwlock %s [%x,%x]\n",
-__FUNCTION__, this->process->pid, this->trdid, thread->process->pid, thread->trdid,
-lock_type_str[lock_type], local_cxy, lock );
-#endif
-            // remove this waiting thread from waiting list
-            list_unlink( &thread->wait_list );
-
-            // unblock this waiting thread
-            thread_unblock( XPTR( local_cxy , thread ) , THREAD_BLOCKED_LOCK );
-        }
-    }
-
-    // release busylock 
-    busylock_release( &lock->lock );
-
-}  // end rwlock_wr_release()
-
-
Index: trunk/kernel/libk/rwlock.h
===================================================================
--- trunk/kernel/libk/rwlock.h	(revision 690)
+++ trunk/kernel/libk/rwlock.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * rwlock.h - kernel local read/write lock definition.
+ * rwlock.h - kernel read/write lock definition.
  * 
- * Author   Alain Greiner    (2016,2017,2018)
+ * Author   Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,26 +25,24 @@
 #define _RWLOCK_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <busylock.h>
-#include <list.h>
+#include <almos_config.h>
+#include <hal_types.h>
 
-/******************************************************************************************n
- * This structure defines a kernel, local, read/write lock, supporting several simultaneous
- * read accesses, but only one write access to a given locally shared object in a cluster.
- * Both readers and writers take the associated busylock before accessing or updating
- * the rwlock state, and releases the busylock after rwlock state update.
- * - when a reader try to access the object, it increments the readers "count" when the 
- *   lock is not "taken" by a writer. It registers in the "rd_root" waiting queue, blocks,
- *   and deschedules when the lock is taken.
- * - when a writer try to take the rwlock, it check the "taken" field. If the lock is already
- *   taken, or if the number of readers is non zero, it registers in the "wr_root" waiting
- *   queue, blocks, and deschedules. It set "taken" otherwise.
- * - when a reader completes its access, it decrement the readers "count", unblock the
- *   the first waiting writer if there is no other readers, and unblock all waiting
- *   readers if there no write request.
- * - when a  writer completes its access, it reset the "taken" field, releases the first
- *   waiting writer if queue non empty, or releases all waiting readers if no writer.
+/*******************************************************************************************
+ * This structure defines a local rwlock, that supports several simultaneous read 
+ * accesses, but only one write access. It implements a ticket based allocation policy.
+ * Both readers and writers must take a ticket before doing anything else, and access
+ * are done in same order as requests (for both read an write ).
+ * - A reader take the lock to atomically increments the registered readers count.
+ *   Then it release the lock and access the protected structure. It atomically decrement
+ *   the readers count without taking the lock when access is completed.
+ * - A writer take the lock and keep it, but must wait completion of all current read 
+ *   accesses before starting its own access.
+ * As this local lock is only accessed by the local threads, if the lock is taken, 
+ * the new-comers use a busy waiting policy with a delay between retry.
  ******************************************************************************************/
+
+/****     Forward declarations    ****/
+
+struct thread_s;
 
 /*******************************************************************************************
@@ -54,9 +52,8 @@
 typedef struct rwlock_s
 {
-    busylock_t          lock;        /*! busylock protecting the rwlock state             */
-	volatile uint32_t   taken;       /*! lock taken by an exclusive writer if non zero    */
-    volatile uint32_t   count;       /*! current number of simultaneous readers threads   */
-    list_entry_t        rd_root;     /*! root of list of waiting readers                  */
-    list_entry_t        wr_root;     /*! root of list of waiting writers                  */
+	uint32_t            ticket;           /*! first free ticket index                     */
+    uint32_t            current;          /*! ticket index of current owner               */
+    uint32_t            count;            /*! number of simultaneous readers threads      */
+	struct thread_s   * owner;            /*! pointer on curent writer thread             */
 }
 rwlock_t;
@@ -64,12 +61,8 @@
 /*******************************************************************************************
  * This function initializes a local rwlock.
- * The <type> argument defines the lock usage and is only used for debug.
- * This type is actually stored in the associated busylock descriptor.
  *******************************************************************************************
- * @ lock       : pointer on rwlock.
- * @ type       : lock usage for debug.
+ * @ lock       : pointer on rwlock
  ******************************************************************************************/
-void rwlock_init( rwlock_t * lock,
-                  uint32_t   type );
+void rwlock_init( rwlock_t * lock );
 
 /*******************************************************************************************
@@ -78,5 +71,5 @@
  * @ lock       : pointer on rwlock
  ******************************************************************************************/
-void rwlock_rd_acquire( rwlock_t * lock );
+void rwlock_rd_lock( rwlock_t * lock );
 
 /*******************************************************************************************
@@ -85,5 +78,5 @@
  * @ lock       : pointer on rwlock
  ******************************************************************************************/
-void rwlock_wr_acquire( rwlock_t * lock );
+void rwlock_wr_lock( rwlock_t * lock );
 
 /*******************************************************************************************
@@ -92,5 +85,5 @@
  * @ lock       : pointer on rwlock
  ******************************************************************************************/
-void rwlock_rd_release( rwlock_t * lock );
+void rwlock_rd_unlock( rwlock_t * lock );
 
 /*******************************************************************************************
@@ -99,5 +92,5 @@
  * @ lock       : pointer on rwlock
  ******************************************************************************************/
-void rwlock_wr_release( rwlock_t * lock );
+void rwlock_wr_unlock( rwlock_t * lock );
 
 
Index: trunk/kernel/libk/spinlock.c
===================================================================
--- trunk/kernel/libk/spinlock.c	(revision 1)
+++ trunk/kernel/libk/spinlock.c	(revision 1)
@@ -0,0 +1,166 @@
+/*
+ * spinlock.c - kernel spinlock synchronization
+ * 
+ * Authors   Ghassan Almaless  (2008,2009,2010,2011,2012)
+ *           Alain Greiner     (2016}
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <hal_atomic.h>
+#include <hal_special.h>
+#include <hal_irqmask.h>
+#include <thread.h>
+#include <scheduler.h>
+#include <printk.h>
+#include <spinlock.h>
+
+//////////////////////////////////////////////
+inline void spinlock_init( spinlock_t * lock )
+{  
+	lock->taken = 0;
+	lock->owner = NULL;
+    list_entry_init( &lock->list );
+}
+
+///////////////////////////////////////////
+void spinlock_lock_busy( spinlock_t * lock, 
+                         uint32_t   * irq_state )
+{
+	uint32_t            mode;
+	volatile uint32_t   taken;
+	thread_t          * this     = CURRENT_THREAD;
+	bool_t              isAtomic = false;
+
+    // disable interrupts
+	hal_disable_irq( &mode );
+  
+    // loop until success
+	while( isAtomic == false )
+	{
+		taken = lock->taken;
+
+		if( taken == 0 )
+        {
+            // try to take the lock if not already taken
+		    isAtomic = hal_atomic_cas( &lock->taken , 0 , 1 );
+        }
+	}
+
+	this->local_locks++;
+    lock->owner = this;
+    list_add_first( &this->locks_root , &lock->list );
+
+    // enable interrupts if irq_state == NULL
+	if( irq_state ) *irq_state = mode;
+	else            hal_restore_irq( mode );
+}
+
+//////////////////////////////////////////////
+void spinlock_unlock_busy( spinlock_t * lock,
+                           bool_t       restore, 
+                           uint32_t     irq_state )
+{
+	thread_t * this = CURRENT_THREAD;;
+  
+    lock->owner = NULL;
+    lock->taken = 0;
+    this->local_locks--;
+    list_unlink( &lock->list );
+ 
+	if( restore ) hal_restore_irq( irq_state );
+}
+   
+///////////////////////////////////////
+void spinlock_lock( spinlock_t * lock )
+{
+	uint32_t          mode;
+	thread_t        * this     = CURRENT_THREAD;
+	bool_t            isAtomic = false;
+	volatile uint32_t taken;
+    
+    // disable interrupts
+	hal_disable_irq( &mode );
+  
+    // loop until success
+	while( isAtomic == false )
+	{
+        taken = lock->taken;
+
+        // deschedule without blocking when lock already taken
+		if( taken != 0 )
+        {
+            hal_restore_irq( mode );
+            if( thread_can_yield() ) sched_yield();
+            hal_disable_irq( &mode );
+            continue;
+        }
+
+        // try to atomically take the lock if not already taken
+	    isAtomic = hal_atomic_cas( &lock->taken , 0 , 1 );
+    }
+
+	this->local_locks++;
+    lock->owner = this;
+    list_add_first( &this->locks_root , &lock->list );
+
+    // enable interrupts
+    hal_restore_irq( mode );
+}
+
+//////////////////////////////////////////////
+uint32_t spinlock_trylock( spinlock_t * lock )
+{ 
+	uint32_t   mode;
+	bool_t     isAtomic = false;
+	thread_t * this     = CURRENT_THREAD;
+
+	hal_disable_irq( &mode );
+
+	if( lock->taken == 0)
+		isAtomic = hal_atomic_cas( &lock->taken , 0 , 1);
+  
+	if(isAtomic == false)
+	{
+		hal_restore_irq(mode);
+		return 1;
+	}
+    else
+    {
+	    this->local_locks++;
+	    lock->owner = this;
+        list_add_first( &this->locks_root , &lock->list );
+	    hal_restore_irq(mode);  
+	    return 0;
+    }
+}
+
+/////////////////////////////////////////
+void spinlock_unlock( spinlock_t * lock )
+{
+	thread_t * this = CURRENT_THREAD;
+  
+    lock->owner = NULL;
+    lock->taken = 0;
+    this->local_locks--;
+    list_unlink( &lock->list );
+}
+
+
Index: trunk/kernel/libk/spinlock.h
===================================================================
--- trunk/kernel/libk/spinlock.h	(revision 1)
+++ trunk/kernel/libk/spinlock.h	(revision 1)
@@ -0,0 +1,127 @@
+/*
+ * spinlock.h: kernel spinlock definition     
+ * 
+ * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *          Alain Greiner    (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _SPINLOCK_H_
+#define _SPINLOCK_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <list.h>
+
+/*******************************************************************************************
+ * This structure defines a local spinlock, that sequencializes all read or write accesses
+ * in a given cluster. A new access can only start after completion of the previous access, 
+ * when the owner thread releases the lock. The lock has only two states: taken or free.
+ * The owner thread is registered in the spinlock_t structure, and the calling thread
+ * list of local spinlocks is updated. 
+ * 
+ * A spinlock can be accessed in three modes :
+ *
+ * - The spinlock_lock() function is BLOCKING and use a descheduling policy when the lock
+ *   is already taken. The lock must be released with the spinlock_unlock() function.
+ * - The spinlock_lock_noirq() function is BLOCKING, but uses a polling (busy-waiting)
+ *   policy if the lock is already taken. The IRQs can be disabled or not depending
+ *   on the irq_state argument. The lock must be released with the spinlock_unlock_noirq()
+ *   function.
+ * - The spinlock_trylock() function is NON-BLOCKING, and tries only once to take the lock.
+ *   It must be released with the spinlock_unlock() function.
+ ******************************************************************************************/
+
+/****     Forward declarations    ****/
+
+struct thread_s;
+
+/*******************************************************************************************
+ * This structure defines a local spinlock.
+ ******************************************************************************************/
+
+typedef struct spinlock_s
+{
+	uint32_t            taken;             /*! state : free if zero / taken if non zero  */
+	struct thread_s   * owner;             /*! pointer on curent owner thread            */
+    list_entry_t        list;              /*! list of all locks taken by owner          */
+}
+spinlock_t;
+
+/*******************************************************************************************
+ * This function initializes a local spinlock in free state.
+ *******************************************************************************************
+ * @ lock    : pointer on spinlock.
+ ******************************************************************************************/
+inline void spinlock_init( spinlock_t * lock );
+
+/*******************************************************************************************
+ * This blocking function uses a busy waiting strategy to lock a local spinlock.
+ * It polls the lock and returns only when the lock has been taken.
+ * If the irq_state argument is not NULL, all IRQs are disabled and will keep disabled
+ * until the lock is released. If irq_state is NULL, the IRQs are only disabled
+ * during the lock acquisition polling loop.
+ * It increments the calling thread local_locks count when the lock has been taken.
+ *******************************************************************************************
+ * @ lock       : pointer on spinlock
+ * @ irq_state  : buffer to save the SR state (in the calling thread stack)
+ ******************************************************************************************/
+void spinlock_lock_busy( spinlock_t * lock,
+                         uint32_t   * irq_state );
+
+/*******************************************************************************************
+ * This function releases a local busy_waiting spinlock.
+ * It restores the CPU SR state, if required by the restore argument.
+ *******************************************************************************************
+ * @ lock       : pointer on spinlock
+ * @ restore    : restore the CPU SR (from irq_state) if true
+ * @ irq_state  : value to be resrored in CPU SR 
+ ******************************************************************************************/
+void spinlock_unlock_busy( spinlock_t * lock,
+                           bool_t       restore,
+                           uint32_t     irq_state );
+
+/*******************************************************************************************
+ * This blocking function locks a local spinlock.
+ * If the lock is already taken, the calling thread deschedules and retries when
+ * it is rescheduled, until success.
+ * It increments the calling thread local_locks count when the lock has been taken.
+ *******************************************************************************************
+ * @ lock       : pointer on spinlock
+ ******************************************************************************************/
+void spinlock_lock( spinlock_t * lock );
+
+/*******************************************************************************************
+ * This non-blocking function tries once to lock a spinlock.
+ * It increments the calling thread locks count in case of success.
+ *******************************************************************************************
+ * @ lock       : pointer on spinlock
+ * @ returns 0 if success / returns non zero if lock already taken. 
+ ******************************************************************************************/
+uint32_t spinlock_trylock( spinlock_t * lock );
+
+/*******************************************************************************************
+ * This function releases a spinlock and do schedule if necessary.
+ *******************************************************************************************
+ * @ lock       : pointer on spinlock
+ ******************************************************************************************/
+void spinlock_unlock( spinlock_t * lock );
+
+
+#endif	/* _SPINLOCK_H_ */
Index: trunk/kernel/libk/sprintk.c
===================================================================
--- trunk/kernel/libk/sprintk.c	(revision 1)
+++ trunk/kernel/libk/sprintk.c	(revision 1)
@@ -0,0 +1,63 @@
+/*
+   This file is part of MutekP.
+  
+   MutekP is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   MutekP is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with MutekP; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+  
+   UPMC / LIP6 / SOC (c) 2007
+*/
+
+/*
+ * $Log: sprintf.c,v $
+ * Revision 1.1.1.1  2002/02/28 12:58:56  disydent
+   Creation of Disydent CVS Tree
+ * Revision 1.2  2001/11/22 15:07:38  fred
+   Adding the iprintf function that does the formatting, and removes all
+   the old stuff hanging around.
+ * Revision 1.1.1.1  2001/11/19 16:55:47  pwet
+   Changing the CVS tree structure of disydent
+ * Revision 1.2  2001/11/14 12:12:26  fred
+   Modification for the call to printf and friends.
+   This should be reworked over sometime.
+ * Revision 1.1.1.1  2001/07/24 13:31:54  pwet
+   cvs tree of part of disydent
+ * Revision 1.1.1.1  2001/07/20 07:35:57  pwet
+   Embedded software cvs tree
+ * Revision 1.1  2000/07/24 08:16:05  denis
+   First archive of libc
+ * Revision 1.1  1998/09/16 16:11:22  pwet
+   passage a cvs
+ */
+
+
+#include <stdarg.h>
+#include <thread.h>
+#include <cluster.h>
+#include <libk.h>
+
+int sprintk (char *s, char *fmt, ...)
+{
+   va_list ap;
+   int count;
+
+   va_start (ap, fmt);
+
+   count = iprintk (s, current_cid, 1, fmt, ap);
+   *(s + count) = 0;
+
+   va_end (ap);
+
+   return count;
+}
+
Index: trunk/kernel/libk/string.c
===================================================================
--- trunk/kernel/libk/string.c	(revision 690)
+++ trunk/kernel/libk/string.c	(revision 1)
@@ -23,5 +23,5 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <ctype.h>
 #include <string.h>
@@ -31,4 +31,7 @@
 {
 	register const char *ptr = str;
+
+	if (str == NULL)
+		return 0;
 
 	while (*ptr) ptr++;
@@ -43,4 +46,7 @@
 	register const char *ptr = str;
 
+	if (str == NULL)
+		return 0;
+
 	while (*ptr && (maxlen-- > 0)) ptr++;
 
@@ -52,5 +58,7 @@
             const char * s2 )
 {
-
+	if((s1 == NULL) || (s2 == NULL))
+		return s1 - s2;
+  
 	while (*s1 && *s1 == *s2)
 	{
@@ -58,5 +66,5 @@
 		s2 ++;
 	}
-
+  
 	return (*s1 - *s2);
 }
@@ -67,7 +75,7 @@
              uint32_t     n )
 { 
-	if (n == 0)
-		return s1 - s2; // XXX ???
-
+	if((s1 == NULL) || (s2 == NULL) || (n == 0))
+		return s1 - s2;
+  
 	while (*s1 && (*s1 == *s2) && (n > 1))
 	{
@@ -76,5 +84,5 @@
 		n--;
 	}
-
+  
 	return (*s1 - *s2);
 }
@@ -87,9 +95,12 @@
 	char c2;
 
+	if((str1 == NULL) || (str2 == NULL))
+		return str1 - str2;
+  
 	do{
 		c1 = toupper(*++str1);
 		c2 = toupper(*++str2);
 	}while(c1 && c1 == c2);
-
+  
 	return (c1 - c2);
 }
@@ -102,7 +113,10 @@
 	char *dst_ptr = dest;
 
+	if(!dest || !src)
+		return dest;
+
 	while(*src_ptr)
 		*(dst_ptr++) = *(src_ptr++);
-
+  
 	*dst_ptr = 0;
 	return dest;
@@ -121,27 +135,6 @@
 	for (; i < n; i++)
 		dest[i] = '\0';
-
+  
 	return dest;
-}
-
-////////////////////////////////
-char * strstr( char       * s,
-               const char * find)
-{
-    char     sc;
-    char     c;
-    uint32_t len;
-
-    if ((c = *find++) != 0) {
-        len = strlen(find);
-        do {
-            do {
-                if ((sc = *s++) == 0)
-                    return NULL;
-            } while (sc != c);
-        } while (strncmp(s, find, len) != 0);
-        s--;
-    }
-    return s;
 }
 
@@ -150,4 +143,7 @@
                int          c )
 {
+	if(s == NULL)
+		return (char*)s;
+
 	while(*s && *s != (char) c)
 		s++;
@@ -155,5 +151,5 @@
 	if(*s == (char) c)
 		return (char*)s;
-
+  
 	return NULL;
 }
@@ -163,32 +159,12 @@
                 int          c )
 {
-	register char         ch;
-	register const char * l =0;
+  register char         ch;
+  register const char * l =0;
 
-	ch = c;
-	for (;;) {
-		if (*t == ch)
-			l=t;
-		if (!*t)
-			return (char*)l;
-		++t;
-	}
-	return (char*)l;
+  ch = c;
+  for (;;) {
+    if (*t == ch) l=t; if (!*t) return (char*)l; ++t;
+  }
+  return (char*)l;
 }
 
-/////////////////////////////////////
-inline uint8_t to_lower( uint8_t  c )
-{
-   if (c >= 'A' && c <= 'Z') return (c | 0x20);
-   else                      return c;
-}
-
-
-/////////////////////////////////////
-inline uint8_t to_upper( uint8_t  c )
-{
-   if (c >= 'a' && c <= 'z') return (c & ~(0x20));
-   else                      return c;
-}
-
-
Index: trunk/kernel/libk/string.h
===================================================================
--- trunk/kernel/libk/string.h	(revision 690)
+++ trunk/kernel/libk/string.h	(revision 1)
@@ -26,5 +26,5 @@
 #define _STRING_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 
 
@@ -49,5 +49,5 @@
 /********************************************************************************************
  * This function compares lexicographically the strind s1 and s2.
- * Characters are considered unsigned.
+ * characters are considered unsigned.
  * I does not compare characters after the first NUL character.
  ********************************************************************************************
@@ -61,5 +61,5 @@
 /********************************************************************************************
  * This function compares lexicographically the strind s1 and s2.
- * I does not compare more than <n> characters and stops after the first NUL character.
+ * I does not compare than <n> characters and stops after the first NUL character.
  ********************************************************************************************
  * @ s1   : pointer on string.
@@ -83,39 +83,21 @@
 
 /********************************************************************************************
- * this function copies the <src> buffer to the <dst> buffer, including the terminating NUL.
+ * TODO
  ********************************************************************************************
- * @ dst   : pointer on destination buffer.
- * @ src   : pointer on source buffer.
  *******************************************************************************************/
-char * strcpy ( char * dst, 
+char * strcpy ( char * dest, 
                 char * src );
 
 /********************************************************************************************
- * This function copies <n> characters from the <sr> buffer to the <dst> buffer.
+ * TODO
  ********************************************************************************************
- * @ dst   : pointer on destination buffer.
- * @ src   : pointer on source buffer.
- * @ n     : number of characters to be copied.
  *******************************************************************************************/
-char * strncpy ( char    * dst,
+char * strncpy ( char    * dest,
                  char    * src,
                  uint32_t  n );
 
 /********************************************************************************************
- * This function locates the first occurence of the <find> string in the <s> string.
+ * TODO
  ********************************************************************************************
- * @ s     : string to be analysed.
- * @ find  : searched string
- * @ return pointer on the found string / return NULL if not found.
- *******************************************************************************************/
-char * strstr( char       * s,
-               const char * find);
-
-/********************************************************************************************
- * This function locates the first occurence of the <c> character in the <s> string.
- ********************************************************************************************
- * @ s     : string to be analysed.
- * @ c     : searched character value (casted to a char)
- * @ return pointer on the found character / return NULL if not found.
  *******************************************************************************************/
 char * strchr ( const char * s,
@@ -123,28 +105,9 @@
 
 /********************************************************************************************
- * This function locates the last occurence of the <c> character in the <s> string.
+ * TODO
  ********************************************************************************************
- * @ s     : string to be analysed.
- * @ c     : searched character value (casted to a char)
- * @ return pointer on the found character / return NULL if not found.
  *******************************************************************************************/
 char * strrchr ( const char * t,
                  int          c );
 
-/********************************************************************************************
- * This function returns a lower case ASCII code if input is in [A...Z] range.
- ********************************************************************************************
- * @ c     : character to be forced to lower case.
- * @ return lower case ASCII code.
- *******************************************************************************************/
-inline uint8_t to_lower( uint8_t  c );
-
-/********************************************************************************************
- * This function returns an upper case ASCII code if input is in [a...z] range.
- ********************************************************************************************
- * @ c     : character to be forced to upper case.
- * @ return upper case ASCII code.
- *******************************************************************************************/
-inline uint8_t to_upper( uint8_t  c );
-
 #endif	/* _STRING_H_ */
Index: trunk/kernel/libk/user_dir.c
===================================================================
--- trunk/kernel/libk/user_dir.c	(revision 690)
+++ 	(revision )
@@ -1,518 +1,0 @@
-/*
- * user_dir.c - kernel DIR related operations implementation.
- * 
- * Authors   Alain   Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <hal_remote.h>
-#include <thread.h>
-#include <xlist.h>
-#include <scheduler.h>
-#include <remote_queuelock.h>
-#include <user_dir.h>
-
-
-/////////////////////////////////////////////
-xptr_t user_dir_from_ident( intptr_t  ident )
-{
-    // get pointer on local process_descriptor
-    process_t * process = CURRENT_THREAD->process;
-
-    // get pointers on reference process
-    xptr_t      ref_xp  = process->ref_xp;
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = GET_PTR( ref_xp );
-
-    // get extended pointers on open directories list and lock  
-    xptr_t root_xp = XPTR( ref_cxy , &ref_ptr->dir_root );
-    xptr_t lock_xp = XPTR( ref_cxy , &ref_ptr->dir_lock );
-
-    // get lock protecting open directories list
-    remote_queuelock_acquire( lock_xp );
- 
-    // scan reference process dir list
-    xptr_t           iter_xp;
-    xptr_t           dir_xp;
-    cxy_t            dir_cxy;
-    user_dir_t     * dir_ptr;
-    intptr_t         current;
-    bool_t           found = false;
-            
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        dir_xp  = XLIST_ELEMENT( iter_xp , user_dir_t , list );
-        dir_cxy = GET_CXY( dir_xp );
-        dir_ptr = GET_PTR( dir_xp );
-        current = (intptr_t)hal_remote_lpt( XPTR( dir_cxy , &dir_ptr->ident ) );   
-        if( ident == current )
-        {
-            found = true;
-            break;
-        }
-    }
-
-    // relese lock protecting open directories list
-    remote_queuelock_release( lock_xp );
- 
-    if( found == false )  return XPTR_NULL;
-    else                  return dir_xp;
-
-}  // end user_dir_from_ident()
-
-//////////////////////////////////////////////////
-user_dir_t * user_dir_create( vfs_inode_t * inode,
-                              xptr_t        ref_xp )
-{ 
-    user_dir_t    * dir;               // local pointer on created user_dir_t 
-    vseg_t        * vseg;              // local pointer on dirent array vseg
-    uint32_t        vseg_size;         // size of vseg in bytes
-    process_t     * ref_ptr;           // local pointer on reference process
-    cxy_t           ref_cxy;           // reference process cluster identifier
-    pid_t           ref_pid;           // reference process PID
-    xptr_t          gpt_xp;            // extended pointer on reference process GPT
-    uint32_t        attr;              // attributes for all GPT entries
-    uint32_t        dirents_per_page;  // number of dirent descriptors per page
-    page_t        * page;              // local pointer on page descriptor
-    struct dirent * base;              // local pointer on physical page base
-    uint32_t        total_dirents;     // total number of dirents in dirent array
-    uint32_t        total_pages;       // total number of pages for dirent array
-    vpn_t           vpn_base;          // first page in dirent array vseg
-    vpn_t           vpn;               // current page in dirent array vseg
-    ppn_t           ppn;               // ppn of currently allocated physical page
-    uint32_t        entries;           // number of dirent actually comied in one page
-    uint32_t        first_entry;       // index of first dentry to copy in dirent array
-    bool_t          done;              // last entry found and copied when true
-    list_entry_t    root;              // root of temporary list of allocated pages
-    uint32_t        page_id;           // page index in list of physical pages
-    ppn_t           fake_ppn;          // unused, but required by hal_gptlock_pte()
-    uint32_t        fake_attr;         // unused, but required by hal_gptlock_pte()
-    error_t         error;
-
-#if DEBUG_USER_DIR_CREATE || DEBUG_USER_DIR_ERROR
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-#endif
-
-    // get cluster, local pointer, and pid of reference process
-    ref_cxy = GET_CXY( ref_xp );
-    ref_ptr = GET_PTR( ref_xp );
-    ref_pid = hal_remote_l32( XPTR( ref_cxy , &ref_ptr->pid ) );
-
-#if DEBUG_USER_DIR_CREATE
-if( DEBUG_USER_DIR_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] enter for inode (%x,%x) and process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, inode, ref_pid, cycle );
-#endif
-
-// check dirent size 
-assert( __FUNCTION__, ( sizeof(struct dirent) == 64), "sizeof(dirent) must be 64\n");
-
-    // compute number of dirent per page
-    dirents_per_page = CONFIG_PPM_PAGE_SIZE >> 6;
-    
-    // initialise temporary list of pages
-    list_root_init( &root );
-
-    // allocate memory for a local user_dir descriptor
-    dir = kmem_alloc( bits_log2(sizeof(user_dir_t)) , AF_ZERO );
-
-    if( dir == NULL )
-    {
-
-#if DEBUG_USER_DIR_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate user_dir_t in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-        return NULL;
-    }
-
-    // First loop to build and initialize the dirent array
-    // as a temporary list of pages. For each iteration :
-    // - allocate one physical 4 Kbytes (64 dirent slots)
-    // - call the relevant FS specific function to scan the directory mapper,
-    //   and copy up to 64 entries in the page.
-    // - register the page in a temporary list using the embedded page list_entry
-    // - exit when the last entry has been found (done == true).
-
-    // initialize loops variables 
-    done          = false;
-    total_dirents = 0;
-    total_pages   = 0;
-    first_entry   = 0;
-
-    while( done == false )  // loop on physical pages
-    {
-        // allocate one physical page
-        base = kmem_alloc( CONFIG_PPM_PAGE_ORDER , AF_ZERO );
-
-        if( base == NULL )
-        {
-
-#if DEBUG_USER_DIR_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate page in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-            goto user_dir_create_failure;
-        }
-
-        // call the relevant FS specific function to copy dirents in page
-        error = vfs_fs_get_user_dir( inode,
-                                     base,
-                                     dirents_per_page,
-                                     first_entry,
-                                     false,        // don't create missing inodes
-                                     &entries,
-                                     &done );
-        if( error )
-        {
-
-#if DEBUG_USER_DIR_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot initialize dirent array in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-            goto user_dir_create_failure;
-        }
-
-        // increment number of written dirents
-        total_dirents += entries;
-
-        // get page descriptor pointer from base
-        page = GET_PTR( ppm_base2page( XPTR( local_cxy , base ) ) );
-
-        // register page in temporary list
-        list_add_last( &root , &page->list ); 
-        total_pages++; 
-
-        // set first_entry for next iteration
-        first_entry = total_dirents;
-
-    } // end while
-        
-#if DEBUG_USER_DIR_CREATE
-if( DEBUG_USER_DIR_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] initialised dirent array / %d entries\n",
-__FUNCTION__, this->process->pid, this->trdid, total_dirents, cycle );
-#endif
-
-    // compute required vseg size
-    vseg_size = total_dirents << 6;
-
-    // create an ANON vseg and register it in reference process VSL
-    if( local_cxy == ref_cxy )
-    {
-        vseg = vmm_create_vseg( ref_ptr,
-                                VSEG_TYPE_ANON,
-                                0,                      // vseg base (unused)
-                                vseg_size,
-                                0,                      // file offset (unused)
-                                0,                      // file_size (unused)
-                                XPTR_NULL,              // mapper (unused)
-                                local_cxy );
-    }
-    else
-    {
-        rpc_vmm_create_vseg_client( ref_cxy,
-                                    ref_ptr,
-                                    VSEG_TYPE_ANON,
-                                    0,                     // vseg base (unused)
-                                    vseg_size,
-                                    0,                     // file offset (unused)
-                                    0,                     // file size (unused)
-                                    XPTR_NULL,             // mapper (unused)
-                                    local_cxy,
-                                    &vseg ); 
-    }
-
-    if( vseg == NULL )
-    {
-
-#if DEBUG_USER_DIR_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create vseg in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, cycle );
-#endif
-        goto user_dir_create_failure;
-    }
-
-#if DEBUG_USER_DIR_CREATE
-if( DEBUG_USER_DIR_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] allocated vseg ANON / base %x / size %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg->min, vseg->max - vseg->min );
-#endif
-
-// check vseg size
-assert( __FUNCTION__, (total_pages == hal_remote_l32( XPTR( ref_cxy , &vseg->vpn_size ) ) ),
-"unconsistent vseg size for dirent array " );
-
-    // build extended pointer on reference process GPT
-    gpt_xp         = XPTR( ref_cxy , &ref_ptr->vmm.gpt );
-
-    // build PTE attributes
-    attr = GPT_MAPPED   |
-           GPT_SMALL    |
-           GPT_READABLE |
-           GPT_CACHABLE |
-           GPT_USER     ;
-
-    // get first vpn from vseg descriptor
-    vpn_base = hal_remote_l32( XPTR( ref_cxy , &vseg->vpn_base ) );
-
-    // Second loop on the allocated physical pages to map
-    // all physical pages in the reference process GPT
-    // The pages are mapped in the user process GPT, but
-    // are removed from the temporary list
-
-    page_id = 0;
-
-    while( list_is_empty( &root ) == false )
-    {
-        // get pointer on first page descriptor
-        page = LIST_FIRST( &root , page_t , list );
-
-        // compute ppn
-        ppn = ppm_page2ppn( XPTR( local_cxy , page ) );
-
-        // compute vpn
-        vpn = vpn_base + page_id;
-        
-        // lock the PTE (and create PT2 if required)
-        error = hal_gpt_lock_pte( gpt_xp,
-                                  vpn,
-                                  &fake_attr,
-                                  &fake_ppn );
-        if( error )
-        {
-
-#if DEBUG_USER_DIR_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot map vpn %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, local_cxy, cycle );
-#endif
-            // delete the vseg
-            intptr_t base = (intptr_t)hal_remote_lpt( XPTR( ref_cxy , &vseg->min ) );
-            rpc_vmm_remove_vseg_client( ref_cxy, ref_pid, base );
-         
-            // release the user_dir descriptor
-            kmem_free( dir , bits_log2(sizeof(user_dir_t)) );
-            return NULL;
-        }
-
-        // set PTE in GPT                          
-        hal_gpt_set_pte( gpt_xp,
-                         vpn,
-                         attr,
-                         ppn );
-
-#if DEBUG_USER_DIR_CREATE
-if( DEBUG_USER_DIR_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] mapped vpn %x to ppn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn + page_id, ppn );
-#endif
-
-        // remove the page from temporary list
-        list_unlink( &page->list );
-
-        page_id++;
-
-    }  // end map loop
-
-// check number of pages
-assert( __FUNCTION__, (page_id == total_pages) , "unconsistent pages number\n" );
-
-    // initialise user_dir_t structure
-    dir->current = 0;
-    dir->entries = total_dirents;
-    dir->ident   = (intptr_t)(vpn_base << CONFIG_PPM_PAGE_ORDER);
-
-    // build extended pointers on root and lock of user_dir xlist in ref process
-    xptr_t root_xp  = XPTR( ref_cxy , &ref_ptr->dir_root );
-    xptr_t lock_xp  = XPTR( ref_cxy , &ref_ptr->dir_lock );
-
-    // build extended pointer on list field in user_dir structure
-    xptr_t entry_xp = XPTR( local_cxy , &dir->list );
-
-    // get lock protecting open directories list
-    remote_queuelock_acquire( lock_xp );
-
-    // register user_dir_t in reference process  
-    xlist_add_first( root_xp , entry_xp );
-
-    // release lock protecting  open directorie list
-    remote_queuelock_release( lock_xp );
-
-#if DEBUG_USER_DIR_CREATE
-if( DEBUG_USER_DIR_CREATE < cycle )
-printk("\n[%s] thread[%x,%x] created user_dir (%x,%x) / %d entries / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, dir, total_dirents, cycle );
-#endif
-
-    return dir;
-
-user_dir_create_failure:
-
-    // release user_dir_t structure
-    kmem_free( dir , bits_log2(sizeof(user_dir_t)) );
-
-    // release physical pages
-    while( list_is_empty( &root ) == false )
-    {
-        // get page descriptor
-        page = LIST_FIRST( &root , page_t , list );
-
-        // get base from page descriptor pointer 
-        base = GET_PTR( ppm_page2base( XPTR( local_cxy , page ) ) );
- 
-        // release the page
-        kmem_free( base , CONFIG_PPM_PAGE_ORDER );
-    }
-
-    return NULL;
-
-}  // end user_dir_create()
-
-////////////////////////////////////////
-void user_dir_destroy( user_dir_t * dir,
-                       xptr_t       ref_xp )
-{
-    thread_t     * this;       // local pointer on calling thread
-    cluster_t    * cluster;    // local pointer on local cluster
-    intptr_t       ident;      // user pointer on dirent array
-    xptr_t         ref_pid;    // reference process PID
-    cxy_t          ref_cxy;    // reference process cluster identifier
-    process_t    * ref_ptr;    // local pointer on reference process
-    xptr_t         root_xp;    // root of xlist
-    xptr_t         lock_xp;    // extended pointer on lock protecting xlist
-    xptr_t         iter_xp;    // iteratot in xlist 
-    reg_t          save_sr;    // for critical section
-    cxy_t          owner_cxy;  // owner process cluster
-    lpid_t         lpid;       // process local index
-    rpc_desc_t     rpc;        // rpc descriptor
-    uint32_t       responses;  // response counter
-     
-    this    = CURRENT_THREAD;
-    cluster = LOCAL_CLUSTER;
-
-#if DEBUG_USER_DIR_DESTROY 
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get cluster, local pointer, and PID of reference user process
-    ref_cxy = GET_CXY( ref_xp );
-    ref_ptr = GET_PTR( ref_xp );
-    ref_pid = hal_remote_l32( XPTR( ref_cxy , &ref_ptr->pid ) );
-
-#if DEBUG_USER_DIR_DESTROY
-if( DEBUG_USER_DIR_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] enter for user_dir (%x,%x) and process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, dir, ref_pid, cycle );
-#endif
-
-    // get user pointer on dirent array
-    ident = dir->ident;
-
-    // build extended pointer on lock protecting open directories list
-    lock_xp = XPTR( ref_cxy , &ref_ptr->dir_lock );
-
-    // get lock protecting open directories list
-    remote_queuelock_acquire( lock_xp );
-
-    // remove dir from reference process xlist
-    xlist_unlink( XPTR( local_cxy , &dir->list ) );
-
-    // release lock protecting open directories list
-    remote_queuelock_release( lock_xp );
-
-    // To delete all copies of the vseg containing the dirent array, the client thread
-    // send parallel RPCs to all clusters containing a client process copy (including 
-    // the local cluster). It blocks and deschedules when all RPCs have been sent,
-    // to wait all RPC responses, and will be unblocked by the last RPC server thread.
-    // It allocates a - shared - RPC descriptor in the stack,  because all parallel
-    // server threads use the same input arguments, and there is no out argument.
-
-    // get owner cluster identifier and process lpid
-    owner_cxy = CXY_FROM_PID( ref_pid );
-    lpid      = LPID_FROM_PID( ref_pid );
-
-    // get root of list of copies and lock from owner cluster
-    root_xp   = XPTR( owner_cxy , &cluster->pmgr.copies_root[lpid] );
-    lock_xp   = XPTR( owner_cxy , &cluster->pmgr.copies_lock[lpid] );
-
-    // mask IRQs
-    hal_disable_irq( &save_sr);
-
-    // client thread blocks itself
-    thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
-
-    // initialize responses counter
-    responses = 0;
-
-    // initialize a shared RPC descriptor
-    rpc.rsp       = &responses;
-    rpc.blocking  = false;                  // non blocking behaviour for rpc_send()
-    rpc.index     = RPC_VMM_REMOVE_VSEG;
-    rpc.thread    = this;
-    rpc.lid       = this->core->lid;
-    rpc.args[0]   = ref_pid;
-    rpc.args[1]   = ident;
-
-    // take the lock protecting process copies
-    remote_queuelock_acquire( lock_xp );
-
-    // scan list of process copies 
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        // get extended pointer and cluster of process
-        xptr_t      process_xp  = XLIST_ELEMENT( iter_xp , process_t , copies_list );
-        cxy_t       process_cxy = GET_CXY( process_xp );
-
-        // atomically increment responses counter
-        hal_atomic_add( &responses , 1 );
-
-#if (DEBUG_USER_DIR_DESTROY & 1)
-if(  DEBUG_USER_DIR_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] register RPC request in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, process_cxy );
-#endif
-
-        // send RPC to target cluster  
-        rpc_send( process_cxy , &rpc );
-    }
-
-    // release the lock protecting process copies
-    remote_queuelock_release( lock_xp );
-
-    // client thread deschedule
-    sched_yield("blocked on rpc_vmm_delete_vseg");
- 
-    // restore IRQs
-    hal_restore_irq( save_sr);
-
-    // release local user_dir_t structure
-    kmem_free( dir , bits_log2(sizeof(user_dir_t)) );
-
-#if DEBUG_USER_DIR_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_USER_DIR_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] deleted user_dir (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, local_cxy, dir, cycle );
-#endif
-
-}  // end user_dir_destroy()
Index: trunk/kernel/libk/user_dir.h
===================================================================
--- trunk/kernel/libk/user_dir.h	(revision 690)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/*
- * user_dir.h -  DIR related operations definition.
- *
- * Authors   Alain Greiner   (2016,2017,2018,2019,2020)
- * 
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _REMOTE_DIR_H_
-#define _REMOTE_DIR_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <xlist.h>
-
-/*** Forward declarations   ***/
-struct vfs_inode_s;
-
-/*****************************************************************************************
- * This file defines the operations on a directory open by an user process
- *
- * - An user process open a directory by calling the "opendir()" syscall.
- *   The user_dir_create() function allocates physical memory to create in the cluster
- *   containing the directory inode one or several physical pages to implement an array 
- *   of "dirent". This array is mapped in the user process space as an ANON vseg.
- *   It allocates also an "user_dir_t" descriptor structure defined below, registered
- *   in the xlist rooted in the reference user process descriptor. 
- * - This "user_dir_t" structure contains the total number of "entries", the "current" 
- *   pointer used by the readdir() syscall, and an "ident" field, that is actually
- *   the DIR user pointer on the "dirent" array in user space.
- * - all these structures are destroyed by the closedir() syscall, that release to the
- *   kernel all allocated memory.
- *
- * WARNING: ALMOS-MKH makes explicitely the assumption that sizeof(dirent) == 64
- ****************************************************************************************/
-
-/*****************************************************************************************
- * This structure defines the user_dir_t decriptor, that is the kernel implementation
- * of a directory open by an user process.
- ****************************************************************************************/
-
-typedef struct user_dir_s
-{
-    intptr_t           ident;           /*! pointer on dirent array in user space       */ 
-    xlist_entry_t      list;            /*! member of list of open dir in same process  */
-    uint32_t           entries;         /*! actual number of dirent in dirent array     */
-    uint32_t           current;         /*! current dirent index in dirent array        */
-}
-user_dir_t;
-
-/*****************************************************************************************
- * This function returns an extended pointer on the user_dir_t structure,
- * identified by the DIR pointer in the user process virtual space.
- * It makes an associative search, scanning the xlist of user_dir_t rooted 
- * in the reference process descriptor.
- *****************************************************************************************
- * @ ident    : [in] DIR virtual address, used as identifier.
- * @ returns extended pointer on user_dir_t if success / returns XPTR_NULL if not found. 
- ****************************************************************************************/
-xptr_t user_dir_from_ident( intptr_t  ident );
-
-/*****************************************************************************************
- * This function allocates memory and initializes a user_dir_t structure in the cluster
- * containing the directory inode identified by the <inode> argument and map the
- * user accessible dirent array in the reference user process VSL, identified by the
- * <ref_xp> argument. 
- * It must be executed by a thread running in the cluster containing the target inode.
- * Use the RPC_USER_DIR_CREATE when the client thread is remote.
- * It makes the following actions:
- * - the allocation of one user_dir_t descriptor in the directory inode cluster.
- * - the allocation of one or several physical pages in reference cluster to store 
- *   all directory entries in an array of 64 bytes dirent structures,
- * - the initialisation of this array from informations found in the directory mapper.
- * - the creation of an ANON vseg containing this dirent array in reference process VMM,
- *   and the mapping of the relevant physical pages in this vseg. 
- * - the registration of the created user_dir_t structure in the xlist rooted 
- *   in the reference process,
- * It returns a local pointer on the created user_dir_t structure.
- *****************************************************************************************
- * @ inode    : [in] local pointer on the directory inode.
- * @ ref_xp   : [in] extended pointer on the reference user process descriptor. 
- * @ return local pointer on user_dir_t if success / return XPTR_NULL if failure.
- ****************************************************************************************/
-user_dir_t * user_dir_create( struct vfs_inode_s * inode,
-                              xptr_t               ref_xp );
-
-/*****************************************************************************************
- * This function removes a user_dir_t structure from the xlist of user_dir_t
- * structures rooted in the reference process descriptor, release all memory
- * allocated for the user_dir_t struct in the directory inode cluster, including 
- * the dirent array, and delete the ANON vseg copies in all process VMM copies,
- * using parallel RPCs.
- * It must be executed by a thread running in the cluster containing the target inode.
- * Use the RPC_USER_DIR_DESTROY when the client thread is remote.
- *****************************************************************************************
- * @ dir      : [in] local pointer on user_dir_t structure.
- * @ ref_xp   : [in] extended pointer on the reference user process descriptor. 
- ****************************************************************************************/
-void user_dir_destroy( struct user_dir_s * dir,
-                       xptr_t              ref_xp );
-
-
-#endif
Index: trunk/kernel/libk/utils.h
===================================================================
--- trunk/kernel/libk/utils.h	(revision 1)
+++ trunk/kernel/libk/utils.h	(revision 1)
@@ -0,0 +1,93 @@
+/*
+ * libk/utils.h - useful functions for the kernel
+ * 
+ * Copyright (c) 2015 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _UTILS_H_
+#define _UTILS_H_
+
+#include <types.h>
+
+struct kernel_iter_s {
+        cid_t cid;
+};
+
+struct kernel_iter_s kernel_list;
+
+/* return the substration of two uint_t  while avoid	*
+ * the overflow case. Big is normally bigger than small.*/
+#if 0
+static uint_t uint_subwo(uint_t big, uint_t small)
+{
+	if(big >= small)
+		return (long)big - (long)small;
+	else	/* big has overflowed */
+		return (UINT32_MAX - small) + big;
+}
+#else
+#define uint_subwo(big, small)				\
+({							\
+	uint_t __ret;					\
+	if(big >= small)				\
+		__ret = big - small;			\
+	else	/* big has overflowed */		\
+		__ret = (UINT32_MAX - small) + big;	\
+	__ret;						\
+})
+#endif
+
+/* The number of kernel running on the platform (some clusters does not have
+ * a kernel, like the I/O cluster.
+ */
+#define  KERNEL_TOTAL_NR         current_cluster->clstr_wram_nr
+
+/* From Linux */
+#define container_of(ptr, type, member) ({                              \
+        const typeof( ((type *)0)->member ) *__mptr = (ptr);            \
+                (type *)( (char *)__mptr - offsetof(type,member) );})
+
+/* Assuming that all running kernels are contiguously in cluster 0,1,2 etc...,
+ * and empty cluster and I/O cluster are the two last. This is a very
+ * dangerous assumption, but for now we can't do otherwise. It should be
+ * marked as FIXME. This comment is also true for kernel_foreach_backward.
+ */
+#define kernel_foreach(iter, next)                              \
+        iter = &kernel_list;                                    \
+        next = 0;                                               \
+        for ( iter->cid = 0; iter->cid < KERNEL_TOTAL_NR;       \
+                        iter->cid++, next = iter->cid )
+
+/* cid_t is an unsigned int16_t and CID_NULL == (cid_t)-1 == 65535. When the
+ * loop is doing 0-1, it's equal to 65535, and so equal to CID_NULL, that's
+ * why this is the end loop condition.
+ * 
+ * You are not expected to understand this.
+ *
+ */
+#define kernel_foreach_backward_init(iter,next)                 \
+        iter = &kernel_list;                                    \
+        next = KERNEL_TOTAL_NR-1;
+
+#define kernel_foreach_backward(iter, next)                     \
+        kernel_foreach_backward_init(iter,next)                 \
+        for ( iter->cid = KERNEL_TOTAL_NR-1;                    \
+                        iter->cid != CID_NULL;                  \
+                        iter->cid--, next = iter->cid )
+
+#endif /* _UTILS_H_ */
Index: trunk/kernel/libk/xbarrier.c
===================================================================
--- trunk/kernel/libk/xbarrier.c	(revision 690)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/*
- * xbarrier.c -  Busy-waiting, trans-clusters, kernel barrier implementation.
- *
- * Author   Alain Greiner (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <hal_atomic.h>
-#include <xbarrier.h>
-
-
-/////////////////////////////////////////////////
-inline void xbarrier_wait( xptr_t    barrier_xp,
-                           uint32_t  count )
-{
-    uint32_t  expected;
-
-    xbarrier_t * ptr = GET_PTR( barrier_xp );
-    cxy_t        cxy = GET_CXY( barrier_xp );
-
-    // get barrier sense value
-    uint32_t sense = hal_remote_l32( XPTR( cxy , &ptr->sense ) );
-
-    // compute expected value
-    if ( sense == 0 ) expected = 1;
-    else              expected = 0;
-
-    // atomically increment current
-    uint32_t current = hal_remote_atomic_add( XPTR( cxy , &ptr->current ) , 1 );
-
-    // last task reset current and toggle sense
-    if( current == (count-1) )
-    {
-        hal_remote_s32( XPTR( cxy , &ptr->current) , 0 );
-        hal_remote_s32( XPTR( cxy , &ptr->sense  ) , expected );
-    }
-    else   // other tasks poll the sense
-    {
-        while( hal_remote_l32( XPTR( cxy , &ptr->sense ) ) != expected ) asm volatile ("nop");
-    }
-}
-
Index: trunk/kernel/libk/xbarrier.h
===================================================================
--- trunk/kernel/libk/xbarrier.h	(revision 690)
+++ 	(revision )
@@ -1,58 +1,0 @@
-/*
- * xbarrier.h - Busy-waiting, trans-clusters, kernel barrier definition.               
- * 
- * Author  Alain Greiner (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef _XBARRIER_H_
-#define _XBARRIER_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-
-/*****************************************************************************************
- * This structure defines a "rendez-vous" barrier, that can be used
- * to synchronise several kernel threads running in different clusters.
- * As it is used in the kernel_init phase, it implements a busy-waiting policy.
- * It does not need to be initialised, but it must be statically allocated 
- * in the KDATA segment to be properly initialised by the compiler/loader.
- ****************************************************************************************/
-
-typedef struct xbarrier_s
-{
-    uint32_t           current;       /*! number of arrived threads                     */
-    uint32_t           sense;         /*! barrier state (toggle)                        */
-    uint32_t           padding[(CONFIG_CACHE_LINE_SIZE>>2)-2];
-} 
-xbarrier_t;
-
-/*****************************************************************************************
- * This blocking function implements a toggle barrier. It returns only when all
- * expected threads reach the barrier. It can be used several times without
- * specific initialisation. 
- *****************************************************************************************
- * @ barrier_xp  : extended pointer on barrier descriptor.
- * @ count       : number of expected threads.
- ****************************************************************************************/
-inline void xbarrier_wait( xptr_t   barrier_xp,  
-                           uint32_t count );
-
-
-#endif	/* _XBARRIER_H_ */
Index: trunk/kernel/libk/xhtab.c
===================================================================
--- trunk/kernel/libk/xhtab.c	(revision 690)
+++ trunk/kernel/libk/xhtab.c	(revision 1)
@@ -2,5 +2,5 @@
  * xhtab.c - Remote access embedded hash table implementation.
  * 
- * Author     Alain Greiner   (2016,2017,2018,2019,2020)
+ * Author     Alain Greiner          (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,10 +22,10 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <hal_remote.h>
 #include <xlist.h>
-#include <remote_busylock.h>
+#include <remote_rwlock.h>
 #include <string.h>
 #include <printk.h>
@@ -34,292 +34,117 @@
 
 
-///////////////////////////////////////////////////////////////////////////////////////////
-// Item type specific functions (four functions for each item type).
-// Example below is for <vfs_dentry_t> type where the identifier is the dentry name.
-///////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// XHTAB_DENTRY_TYPE
-// This functions compute the hash index from the key, that is the directory entry name.
-// In this implementation, the index value is simply the ASCII code of the first
-// character, to provide an approximate lexicographic order. 
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ key      : local pointer on name.
-// @ return the index value, from 0 to (HASHTAB_SIZE - 1)
-///////////////////////////////////////////////////////////////////////////////////////////
-static uint32_t xhtab_dentry_index_from_key( void * key )
-{
-	char     * name  = key;
-
-	return (name[0] % XHASHTAB_SIZE);
-} 
-
-///////////////////////////////////////////////////////////////////////////////////////////
-// XHTAB_DENTRY_TYPE
-// This functions returns the extended pointer on the item, from the extended pointer 
-// on xlist contained in the item.
-///////////////////////////////////////////////////////////////////////////////////////////
-// @ xlist_xp      : extended pointer on embedded xlist entry.
-// @ return the extended pointer on the dentry containing this xlist entry.
-///////////////////////////////////////////////////////////////////////////////////////////
-static xptr_t xhtab_dentry_item_from_xlist( xptr_t xlist_xp )
-{
-    return XLIST_ELEMENT( xlist_xp , vfs_dentry_t , children );
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// XHTAB_DENTRY_TYPE
-// This function compares the identifier of an item to a given <key>. 
-// it returns true when the directory name matches the name pointed by the <key> argument.
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ item_xp   : extended pointer on item.
-// @ key       : pointer on searched item identifier.
-// returns true if given name matches directory entry name.
-////////////////////////////////////////////////////////////////////////////////////////////
-static bool_t xhtab_dentry_item_match_key( xptr_t    item_xp,
-                                           void    * key )
-{
-    char name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    // get dentry cluster and local pointer
-    cxy_t          dentry_cxy = GET_CXY( item_xp );
-    vfs_dentry_t * dentry_ptr = GET_PTR( item_xp );
-
-    // make a local copy of directory entry name
-    hal_remote_strcpy( XPTR( local_cxy , name ) ,
-                       XPTR( dentry_cxy , &dentry_ptr->name ) );
-
-    return( strcmp( name , (char*)key ) == 0 );
-}
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// XHTAB_DENTRY_TYPE
-// This function print the item key, that is the name for a vfs_dentry_t.
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ item_xp   : extended pointer on item.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void xhtab_dentry_item_print_key( xptr_t item_xp )
-{
-    char name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-    // get dentry cluster and local pointer
-    cxy_t          dentry_cxy = GET_CXY( item_xp );
-    vfs_dentry_t * dentry_ptr = GET_PTR( item_xp );
-    
-    // make a local copy of directory entry name
-    hal_remote_strcpy( XPTR( local_cxy , name ) ,
-                       XPTR( dentry_cxy , &dentry_ptr->name ) );
-
-    // print dentry name
-    printk("%s , ", name );
-}                       
-
-////////////////////////////////////////////////////////////////////////////////////////
-//         Generic access functions
-////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////
-void xhtab_init( xptr_t             xhtab_xp,
-                 xhtab_item_type_t  type )
-{
-    uint32_t i;
-
-    // get cluster and local pointer
-    xhtab_t * ptr = GET_PTR( xhtab_xp );
-    cxy_t     cxy = GET_CXY( xhtab_xp );
-
-    // initialize lock
-    remote_busylock_init( XPTR( cxy , &ptr->lock), LOCK_XHTAB_STATE );
-
-    // initialise various fiels
-    hal_remote_s32( XPTR( cxy , &ptr->items ) , 0 );
-    hal_remote_s32( XPTR( cxy , &ptr->current_index ) , 0 );
-    hal_remote_s64( XPTR( cxy , &ptr->current_xlist_xp ) , XPTR_NULL );
-   
-    // initialize functions pointers
-    if( type == XHTAB_DENTRY_TYPE )
-    {
-        hal_remote_spt( XPTR( cxy , &ptr->item_match_key  ) , &xhtab_dentry_item_match_key );
-        hal_remote_spt( XPTR( cxy , &ptr->index_from_key  ) , &xhtab_dentry_index_from_key );
-        hal_remote_spt( XPTR( cxy , &ptr->item_from_xlist ) , &xhtab_dentry_item_from_xlist );
-        hal_remote_spt( XPTR( cxy , &ptr->item_print_key  ) , &xhtab_dentry_item_print_key );
-    }
-    else
-    {
-        assert( __FUNCTION__, false , "illegal item type\n" );
-    }
-
-    // initialize all lists
-    for( i=0 ; i < XHASHTAB_SIZE ; i++ )
-    {
-        xlist_root_init( XPTR( cxy , &ptr->roots[i] ) );
-    }
- 
-#if DEBUG_XHTAB
-printk("\n[%s] for xhtab (%x,%x)\n"
-" - index_from_key  = %x\n"
-" - item_match_key  = %x\n"
-" - item_from_xlist = %x\n",
-__FUNCTION__, cxy, ptr,
-hal_remote_lpt( XPTR( cxy , &ptr->index_from_key ) ),
-hal_remote_lpt( XPTR( cxy , &ptr->item_match_key ) ), 
-hal_remote_lpt( XPTR( cxy , &ptr->item_from_xlist ) ) ); 
-#endif
-
-}  // end xhtab_init()
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-// This static function traverse the subset identified by the <index> argument
-// to find an item identified by the <key> argument.
-/////////////////////////////////////////////////////////////////////////////////////////////
-// @ xhtab_xp  : extended pointer on the xhtab descriptor.
-// @ index     : subset index.
-// @ key       : searched key value.
-// @ return  extended pointer on the found item if success / return XPTR_NULL if not found.
-/////////////////////////////////////////////////////////////////////////////////////////////
-static xptr_t xhtab_scan( xptr_t    xhtab_xp,
+///////////////////////////////////////////////////////////////////////////////////////
+// This static function s called by the xhtab_lookup() and xhtab_register() functions.
+// It scan one sub-list identified by  <index> to find an item  identified by <key>.
+// The hash table is identified by <cxy> and local pointer <xhtab>.
+// The sub-list is not modified, but the readlock must have been taken by the caller.
+///////////////////////////////////////////////////////////////////////////////////////
+// @ cxy       : hash table cluster.
+// @ xhtab_xp  : hash table local pointer.
+// @ index     : index of sub-list to be scanned.
+// @ key       : local pointer on item identifier.
+///////////////////////////////////////////////////////////////////////////////////////
+static xptr_t xhtab_scan( cxy_t     cxy,
+                          xhtab_t * xhtab,
                           uint32_t  index,
                           void    * key )
 {
-    xptr_t              xlist_xp;           // xlist_entry_t (iterator)
-    xptr_t              item_xp;            // associated item
-    xhtab_t           * xhtab_ptr;          // hash table local pointer
-    cxy_t               xhtab_cxy;          // hash table cluster
-    item_from_xlist_t * item_from_xlist;    // function pointer
-    item_match_key_t  * item_match_key;     // function pointer
-
-    // get hash table cluster and local pointer
-    xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_ptr = GET_PTR( xhtab_xp );
-
-#if DEBUG_XHTAB
-printk("\n[%s] enter : index = %d / key = %s\n", __FUNCTION__ , index , key );
-#endif
-
-    // get pointer on "item_from_xlist" function
-    item_from_xlist = (item_from_xlist_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                           &xhtab_ptr->item_from_xlist ) );
-    // get pointer on "item_match_key" function
-    item_match_key = (item_match_key_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                         &xhtab_ptr->item_match_key ) );
-    // scan sub-list[index]
-    XLIST_FOREACH( XPTR( xhtab_cxy , &xhtab_ptr->roots[index] ) , xlist_xp )
-    {
-        // get extended pointer on item containing the xlist entry
-	    item_xp = item_from_xlist( xlist_xp );
-
-        // check matching
-        if( item_match_key( item_xp , key ) ) return item_xp;
-    }
-
-#if DEBUG_XHTAB
-printk("\n[%s] exit\n", __FUNCTION__ );
-#endif
-
-
-    // No matching item found
-    return XPTR_NULL;
-
-}  // end xhtab_scan()
+    xptr_t   xlist_xp;    // extended pointer on xlist_entry_t (iterator)
+    xptr_t   item_xp;     // extended pointer on found item (return value)
+    
+    // scan the sub-list[index]
+	XLIST_FOREACH( XPTR( cxy , &xhtab->roots[index] ) , xlist_xp )
+	{
+        if ( xhtab->compare( xlist_xp , key , &item_xp ) ) return item_xp;
+    }
+
+    // no matching item found
+	return XPTR_NULL;
+}
+
+/////////////////////////////////
+void xhtab_init( xhtab_t * xhtab,
+                 uint32_t  type )
+{
+	uint32_t i;
+
+    // initialize readlock
+    remote_rwlock_init( XPTR( local_cxy , &xhtab->lock) );
+
+    xhtab->items  = 0;
+
+    if( type == XHTAB_DENTRY_TYPE )
+    {
+        hal_remote_spt( XPTR( local_cxy , &xhtab->compare ) , &xhtab_dentry_compare );
+        hal_remote_spt( XPTR( local_cxy , &xhtab->index   ) , &xhtab_dentry_index   );
+    }
+    else
+    {
+        printk("\n[PANIC] in %s : illegal item type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+	for( i=0 ; i < HASHTAB_SIZE ; i++ )
+    {
+		xlist_root_init( XPTR( local_cxy , &xhtab->roots[i] ) );
+    }  
+}
 
 ///////////////////////////////////////
-error_t xhtab_insert( xptr_t   xhtab_xp,
-                      void   * key,
-                      xptr_t   xlist_xp )
-{
-    xptr_t             item_xp;
-    uint32_t           index;
-    cxy_t              xhtab_cxy;
-    xhtab_t          * xhtab_ptr;
-    index_from_key_t * index_from_key;     // function pointer
-    
+void xhtab_register( xptr_t   xhtab_xp,
+                     void   * key,
+                     xptr_t   xlist_xp )
+{
     // get xhtab cluster and local pointer 
-    xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_ptr = GET_PTR( xhtab_xp );
-
-#if DEBUG_XHTAB
-printk("\n[%s] enter / xhtab (%x,%x) / key = <%s> / cycle %d\n",
-__FUNCTION__, xhtab_cxy, xhtab_ptr, key, (uint32_t)hal_get_cycles() );
-#endif
-
-    // build extended pointer on xhtab lock
-    xptr_t lock_xp = XPTR( xhtab_cxy , &xhtab_ptr->lock );
-
-    // get pointer on "index_from_key" function
-    index_from_key = (index_from_key_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                         &xhtab_ptr->index_from_key ) );
+    cxy_t     xhtab_cxy = GET_CXY( xhtab_xp );
+    xhtab_t * xhtab_ptr = (xhtab_t *)GET_PTR( xhtab_xp );
+
     // compute index from key
-	index = index_from_key( key );
+	uint32_t index = xhtab_ptr->index( key );
 
     // take the lock protecting hash table
-    remote_busylock_acquire( lock_xp );
-
-    // search a matching item in subset
-    item_xp = xhtab_scan( xhtab_xp , index , key );
-
-    if( item_xp != XPTR_NULL )    // error if item already registered
+    remote_rwlock_wr_lock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
+
+    // register item in hash table
+	xlist_add_last( XPTR( xhtab_cxy , &xhtab_ptr->roots[index] ) , xlist_xp );
+
+    // update number of registered items
+    hal_remote_atomic_add( XPTR( xhtab_cxy , &xhtab_ptr->items ) , 1 );
+
+    // release the lock protecting hash table
+    remote_rwlock_wr_unlock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
+
+}  // end xhtab_register()
+
+/////////////////////////////////////
+void xhtab_remove( xptr_t   xhtab_xp,
+                   void   * key )
+{
+    // get xhtab cluster and local pointer 
+    cxy_t     xhtab_cxy = GET_CXY( xhtab_xp );
+    xhtab_t * xhtab_ptr = (xhtab_t *)GET_PTR( xhtab_xp );
+
+    // take the lock protecting hash table
+    remote_rwlock_wr_lock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
+
+    // compute index from key
+	uint32_t index = xhtab_ptr->index( key );
+
+    // get extended pointer on item to remove
+    xptr_t item_xp = xhtab_scan( xhtab_cxy , xhtab_ptr , index , key );
+
+    if( item_xp == XPTR_NULL )    // do nothing if not found
     {
         // release the lock protecting hash table
-        remote_busylock_release( lock_xp );
-
-        return -1;
-    }
-    else                          // insert item if not found
-    {
-        // register item in hash table
-	    xlist_add_last( XPTR( xhtab_cxy , &xhtab_ptr->roots[index] ) , xlist_xp );
-
-        // update number of registered items
-        hal_remote_atomic_add( XPTR( xhtab_cxy , &xhtab_ptr->items ) , 1 );
-
-        // release the lock protecting hash table
-        remote_busylock_release( lock_xp );
-    
-#if DEBUG_XHTAB
-printk("\n[%s] success for <%s>\n", __FUNCTION__, key );
-#endif
-
-        return 0;
-    }
-}  // end xhtab_insert()
-
-///////////////////////////////////////
-error_t xhtab_remove( xptr_t   xhtab_xp,
-                      void   * key,
-                      xptr_t   xlist_entry_xp )
-{
-    xptr_t             item_xp;
-    uint32_t           index;
-    cxy_t              xhtab_cxy;
-    xhtab_t          * xhtab_ptr;
-    index_from_key_t * index_from_key;     // function pointer
-
-    // get xhtab cluster and local pointer 
-    xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_ptr = GET_PTR( xhtab_xp );
-
-    // get pointer on "index_from_key" function
-    index_from_key = (index_from_key_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                         &xhtab_ptr->index_from_key ) );
-    // compute index from key
-	index = index_from_key( key );
-
-    // take the lock protecting hash table
-    remote_busylock_acquire( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
-
-    // get extended pointer on item to remove
-    item_xp = xhtab_scan( xhtab_xp , index , key );
-
-    if( item_xp == XPTR_NULL )    // return error if not found
-    {
-        // release the lock protecting hash table
-        remote_busylock_release( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
-
-        return -1;
+        remote_rwlock_wr_unlock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
     }
     else                          // remove item if found
     {
+        // get item cluster and local pointer 
+        cxy_t          item_cxy = GET_CXY( item_xp );
+        vfs_dentry_t * item_ptr = (vfs_dentry_t *)GET_PTR( item_xp );
+
         // remove item from hash table <=> unlink xlist_entry_t
-        xlist_unlink( xlist_entry_xp );
+        xlist_unlink( XPTR( item_cxy , &item_ptr->xlist ) );
 
         // update number of registered items
@@ -327,9 +152,7 @@
 
         // release the lock protecting hash table
-        remote_busylock_release( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
-
-        return 0;
-    }
-}  // end xhtab_remove()
+        remote_rwlock_wr_unlock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
+    }
+}  // end xhtab_unregister()
 
 /////////////////////////////////////////
@@ -337,202 +160,112 @@
                       void    * key )
 {
-    xptr_t             item_xp;
-    uint32_t           index;
-    cxy_t              xhtab_cxy;
-    xhtab_t          * xhtab_ptr;
-    index_from_key_t * index_from_key;     // function pointer
-
-    // get xhtab cluster and local pointer 
-    xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_ptr = GET_PTR( xhtab_xp );
-
-    // get pointer on "index_from_key" function
-    index_from_key = (index_from_key_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                         &xhtab_ptr->index_from_key ) );
-    // compute index from key
-	index = index_from_key( key );
-    
-#if DEBUG_XHTAB
-printk("\n[%s] enter\n", __FUNCTION__ );
-#endif
-
-    // take the lock protecting hash table
-    remote_busylock_acquire( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
-    
-    // scan sub-list
-    item_xp = xhtab_scan( xhtab_xp , index , key );
-
-    // release the lock protecting hash table
-    remote_busylock_release( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
-
-#if DEBUG_XHTAB
-printk("\n[%s] exit\n", __FUNCTION__ );
-#endif
-
-    return item_xp;
-
-}  // end xhtab_lookup()
-
-//////////////////////////////////
-void xhtab_lock( xptr_t xhtab_xp )
-{
+    xptr_t  item_xp;
+
     // get xhtab cluster and local pointer 
     cxy_t     xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_t * xhtab_ptr = GET_PTR( xhtab_xp );
+    xhtab_t * xhtab_ptr = (xhtab_t *)GET_PTR( xhtab_xp );
+
+    // compute index from key
+	uint32_t index = xhtab_ptr->index( key );
 
     // take the lock protecting hash table
-    remote_busylock_acquire( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
+    remote_rwlock_rd_lock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
+
+    // scan sub-list
+    item_xp = xhtab_scan( xhtab_cxy , xhtab_ptr , index , key );
+
+    // release the lock protecting hash table
+    remote_rwlock_rd_unlock( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
+
+    return item_xp;
+
+}  // end xhtab_lookup()
+
+
+
+/////////////////////////////////////////
+uint32_t xhtab_dentry_index( void * key )
+{
+	char    * str   = key;
+	uint32_t  index = 0;
+  
+	while( *str ) index = index + (*(str++) ^ index);
+
+	return index % HASHTAB_SIZE;
+} 
+
+///////////////////////////////////////////////
+bool_t xhtab_dentry_compare( xptr_t   xlist_xp,
+                             void   * key,
+                             xptr_t * item_xp )
+{
+    char   tested_name[256];      // local copy of name stored in remote hash table
+
+    char * searched_name = key;   // local pointer on searched name 
+
+    // compute name length
+    uint32_t length = strlen( searched_name );
+
+    // get extended pointer on dentry containing the xlist_entry_t
+	xptr_t dentry_xp = XLIST_ELEMENT( xlist_xp , vfs_dentry_t , xlist );
+
+    // get dentry cluster and local pointer 
+    cxy_t          dentry_cxy = GET_CXY( dentry_xp );
+    vfs_dentry_t * dentry_ptr = (vfs_dentry_t *)GET_PTR( dentry_xp );
+    
+    // make a local copy of remote dentry name
+    hal_remote_memcpy( XPTR( local_cxy  , tested_name ) ,
+                       XPTR( dentry_cxy , dentry_ptr->name ) , length );
+
+    // check matching / return if match
+    if( strcmp( tested_name , searched_name ) == 0 )
+    {
+        return true;
+        *item_xp = dentry_xp;
+    }
+    else
+    {
+        return false;
+    }
 }
 
-////////////////////////////////////
-void xhtab_unlock( xptr_t xhtab_xp )
-{
-    // get xhtab cluster and local pointer 
-    cxy_t     xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_t * xhtab_ptr = GET_PTR( xhtab_xp );
-
-    // release the lock protecting hash table
-    remote_busylock_release( XPTR( xhtab_cxy , &xhtab_ptr->lock ) );
-}
-
-/////////////////////////////////////////
-xptr_t xhtab_get_first( xptr_t xhtab_xp )
-{
-    uint32_t            index;
-    cxy_t               xhtab_cxy;
-    xhtab_t           * xhtab_ptr;
-    xptr_t              xlist_xp;
-    xptr_t              item_xp;
-    xptr_t              root_xp;
-    item_from_xlist_t * item_from_xlist;   // function pointer
-
-    // get xhtab cluster and local pointer 
-    xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_ptr = GET_PTR( xhtab_xp );
-
-    // get pointer on "item_from_xlist" function
-    item_from_xlist = (item_from_xlist_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                           &xhtab_ptr->item_from_xlist ) );
-    //loop on subsets
-    for( index = 0 ; index < XHASHTAB_SIZE ; index++ )
-    {
-        // get root of subset
-        root_xp = XPTR( xhtab_cxy , &xhtab_ptr->roots[index] );
-
-        // get first item
-        xlist_xp = xlist_next( root_xp , root_xp );
-
-        if( xlist_xp != XPTR_NULL )  // first item found
-        {
-            // get extended pointer on item containing the xlist entry
-	        item_xp = item_from_xlist( xlist_xp );
-
-            // register item in hash table header
-            hal_remote_s32 ( XPTR( xhtab_cxy , &xhtab_ptr->current_index ) , index );
-            hal_remote_s64( XPTR( xhtab_cxy , &xhtab_ptr->current_xlist_xp ) , xlist_xp );
-
-            return item_xp;
-        }
-    }
-            
-    // item not found
-    return XPTR_NULL;
-
-} // end xhtab_get_first()
+
+ 
+////////////////////////////////////////
+uint32_t xhtab_inode_index( void * key )
+{
+	uint32_t * inum = key;
+
+	return (((*inum) >> 16) ^ ((*inum) & 0xFFFF)) % HASHTAB_SIZE;
+} 
+
+///////////////////////////////////////////////
+bool_t xhtab_inode_compare( xptr_t   xlist_xp,
+                            void   * key,
+                            xptr_t * item_xp )
+{
+    uint32_t * searched_inum = key;
+    uint32_t   tested_inum;   
+
+    // get extended pointer on inode containing the xlist_entry_t
+	xptr_t inode_xp = XLIST_ELEMENT( xlist_xp , vfs_inode_t , xlist );
+
+    // get inode cluster and local pointer 
+    cxy_t         inode_cxy = GET_CXY( inode_xp );
+    vfs_inode_t * inode_ptr = (vfs_inode_t *)GET_PTR( inode_xp );
     
-////////////////////////////////////////
-xptr_t xhtab_get_next( xptr_t xhtab_xp )
-{
-    uint32_t            index;
-    cxy_t               xhtab_cxy;
-    xhtab_t           * xhtab_ptr;
-    xptr_t              xlist_xp;
-    xptr_t              item_xp;
-    xptr_t              root_xp;
-    item_from_xlist_t * item_from_xlist;   // function pointer
-
-    uint32_t current_index;
-    xptr_t   current_xlist_xp;
-
-    // get xhtab cluster and local pointer 
-    xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_ptr = GET_PTR( xhtab_xp );
-
-    // get current item pointers
-    current_index    = hal_remote_l32 ( XPTR( xhtab_cxy , &xhtab_ptr->current_index ) ); 
-    current_xlist_xp = hal_remote_l64( XPTR( xhtab_cxy , &xhtab_ptr->current_xlist_xp ) ); 
-
-    // get pointer on "item_from_xlist" function
-    item_from_xlist = (item_from_xlist_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                           &xhtab_ptr->item_from_xlist ) );
-    //loop on subsets
-    for( index = current_index ; index < XHASHTAB_SIZE ; index++ )
-    {
-        // get root of subset 
-        root_xp = XPTR( xhtab_cxy , &xhtab_ptr->roots[index] );
-
-        // get next item
-        if( index == current_index ) xlist_xp = xlist_next( root_xp , current_xlist_xp );
-        else                         xlist_xp = xlist_next( root_xp , root_xp );
-
-        if( xlist_xp != XPTR_NULL )  // next item found
-        {
-            // get extended pointer on item containing the xlist entry
-	        item_xp = item_from_xlist( xlist_xp );
-
-            // register item in hash table header
-            hal_remote_s32 ( XPTR( xhtab_cxy , &xhtab_ptr->current_index ) , index );
-            hal_remote_s64( XPTR( xhtab_cxy , &xhtab_ptr->current_xlist_xp ) , xlist_xp );
-
-            return item_xp;
-        }
-    }
-            
-    // item not found
-    return XPTR_NULL;
-
-} // end xhtab_get_next()
-
-/////////////////////////////////////
-void xhtab_display( xptr_t xhtab_xp )
-{
-    uint32_t            index;
-    cxy_t               xhtab_cxy;
-    xhtab_t           * xhtab_ptr;
-    xptr_t              root_xp;
-    xptr_t              iter_xp;
-    xptr_t              item_xp;
-    item_from_xlist_t * item_from_xlist;   // function pointer
-    item_print_key_t  * item_print_key;    // function pointer
-
-    // get xhtab cluster and local pointer 
-    xhtab_cxy = GET_CXY( xhtab_xp );
-    xhtab_ptr = GET_PTR( xhtab_xp );
-
-    // get pointer on "item_from_xlist" function
-    item_from_xlist = (item_from_xlist_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                           &xhtab_ptr->item_from_xlist ) );
-    // get pointer on "item_print_key" function
-    item_print_key = (item_print_key_t *)hal_remote_lpt( XPTR( xhtab_cxy , 
-                                                         &xhtab_ptr->item_print_key ) );
-    //loop on subsets
-    for( index = 0 ; index < XHASHTAB_SIZE ; index++ )
-    {
-        printk(" index = %d : ", index );
-
-        // get root of subset 
-        root_xp = XPTR( xhtab_cxy , &xhtab_ptr->roots[index] );
-
-        // loop on xlist
-        XLIST_FOREACH( root_xp , iter_xp )
-        {
-            // get item from xlist
-            item_xp = item_from_xlist( iter_xp );
-            
-            // print item identifier
-            item_print_key( item_xp );
-        }
-
-        printk("\n");
-    }
-}  // end xhtab_display()
+    // get tested inode inum
+    tested_inum = hal_remote_lw( XPTR( inode_cxy , &inode_ptr->inum ) );
+
+    // check matching / return if match
+    if( tested_inum == *searched_inum )
+    {
+        return true;
+        *item_xp = inode_xp;
+    }
+    else
+    {
+        return false;
+    }
+} 
+
Index: trunk/kernel/libk/xhtab.h
===================================================================
--- trunk/kernel/libk/xhtab.h	(revision 690)
+++ trunk/kernel/libk/xhtab.h	(revision 1)
@@ -2,5 +2,5 @@
  * xhtab.h - Remote access embedded hash table definition.
  * 
- * Author     Alain Greiner  (2016,2017,2018,2019)
+ * Author     Alain Greiner          (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,90 +25,80 @@
 #define _XHTAB_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <remote_rwlock.h>
 #include <xlist.h>
 
 
-///////////////////////////////////////////////////////////////////////////////////////////
-// This file define a generic, embedded, remotely accessible, hash table.
-//
-// It can be accessed by any thread, running in any cluster.
-// It is generic as it can be used to register various types of items.
-// The main goal is to speedup search by key in a large number of items of same type.
-// For this purpose the set of all registered items is split in several subsets.
-// Each subset is organised as an embedded double linked xlist.
-// - an item is uniquely identified by a <key>, that is a item specific pointer,
-//   that can be a - for example - a char* defining the item "name".
-// - From the <key> value, the hash table uses an item type specific index_from_key() 
-//   function, to compute an <index> value, defining a subset of registered items.
-// - to discriminate between items that have the same <index>, the hash table makes
-//   an associative search on the key in subset, using the item type specific
-//   item_match_key() function.
-// - Each registered item is a structure, that must contain an embedded xlist_entry,
-//   that is part of the xlist implementing the subset. 
-//
-// For all registered items, a total order is defined by the increasing index values, 
-// and for each index value, by the position in the xlist implementing a subset. 
-// This order is used by the two functions xhtab_get_first() and xhtab_get_next(), that
-// are used to scan all registered items. The two "current_index" and "current_xlist_xp"
-// fields in the hash table header register the current item during a scan.
-//
-// Implementation Note:
-// To inroduce a new item type, you must define the four item-type-specific
-// functions specified below, and you must update the xhtab_init() function
-// and the xhtab_item_type_t.
-///////////////////////////////////////////////////////////////////////////////////////////
+/******************************************************************************************
+ * This file define a generic, embedded, hash table that can be remotely accessed by 
+ * any thread running in any cluster.
+ * The main goal is to speedup search by key in a set of items identified by their key.
+ * For this purpose the set of all registered items is split in several subsets:
+ * Each subset is organised an embedded double linked lists.
+ * - an item is uniquely identified by a <key>, that can be a single uint32_t, 
+ *   a name (character string), or a more complex structure.
+ * - From the <key>, the hash table uses an item type specific "xhtab_index()" function,
+ *   to compute an <index> value, defining a subset of registered items.
+ * - to discriminate between items that have the same <index>, the hash table uses another
+ *   item type specific "xhtab_compare()" function for the associative search in subset.
+ * - Each registered item is a structure, that must contain an embedded xlist_entry,
+ *   that is part of the xlist implementing the subset. 
+ * - The xhtab header contains an array indexed by <index> and containing the roots
+ *   of the various xlists implementing the subsets.
+ *   pointer on the searched item can be obtained by a simple offset.
+ * Implementation note:
+ * to use this generic infrastructure for a new type of item, you must define a new
+ * type in the xhtan_item_type_t" below, and to define the two  associated
+ * "xhtab_compare() and xhtab_index().
+ *****************************************************************************************/
 
-#define XHASHTAB_SIZE    32   // number of subsets
+#define HASHTAB_SIZE    64   // number of subsets
 
 /******************************************************************************************
- * Here are the four item_type_specific function prototypes that must be defined
- * for each item type.
+ * These typedef define the generic xhtab_compare() and xhtab_index() function prototypes.
+ * It must exist a specific couple of functions for each item type.
+ * @ entry_xp : extended pointer on an xlist_entry_t in a partial xlist.
+ * @ key      : local pointer on the searched item key.
+ * @ item_xp  : buffer to store extended pointer on found item.
  *****************************************************************************************/
 
-typedef  bool_t    (item_match_key_t)   ( xptr_t item_xp , void * key );
-typedef  xptr_t    (item_from_xlist_t)  ( xptr_t xlist_xp );
-typedef  uint32_t  (index_from_key_t)   ( void * key );
-typedef  void      (item_print_key_t)   ( xptr_t item_xp );
+typedef  bool_t    xhtab_compare_t( xptr_t entry_xp , void * key , xptr_t * item_xp );
+typedef  uint32_t  xhtab_index_t( void * key );
 
 /******************************************************************************************
- * This define the currently supported item types.
- * - The XHTAB_DENTRY_TYPE is used to implement the set of directory entries for a
- *   directory inode : the "children" inode field is an embedded xhtab.
+ * This define the supported item types.
  *****************************************************************************************/
 
 typedef enum
 {
-    XHTAB_DENTRY_TYPE = 0,                    /*! item is a vfs_dentry_t                 */ 
+    XHTAB_DENTRY_TYPE = 1,                   /*! item is a vfs_dentry_t                  */
+    XHTAB_INODE_TYPE  = 2,                   /*! item is a vfs_inode_t                   */
 }
 xhtab_item_type_t;
 
 /******************************************************************************************
- * This structure define the root of the remotely accessible hash table. 
+ * This structure define the root of a generic, remote accessible, hash table. 
  *****************************************************************************************/
 
 typedef struct xhtab_s
 {
-	xlist_entry_t       roots[XHASHTAB_SIZE];  /*! array of roots of xlist               */
-    index_from_key_t  * index_from_key;        /*! item specific function pointer        */
-    item_match_key_t  * item_match_key;        /*! item specific function pointer        */
-    item_from_xlist_t * item_from_xlist;       /*! item specific function pointer        */
-    item_print_key_t  * item_print_key;        /*! item specific function pointer        */
-    uint32_t            items;                 /*! number of registered items            */
-    remote_busylock_t   lock;                  /*! lock protecting hash table accesses   */
-    uint32_t            current_index;         /*! current item subset index             */
-    xptr_t              current_xlist_xp;      /*! xptr on current item xlist entry      */
+	xlist_entry_t      roots[HASHTAB_SIZE];   /*! array of roots of xlist                */
+    xhtab_compare_t  * compare;               /*! item specific index function           */
+    xhtab_index_t    * index;                 /*! item specific compare function         */
+    uint32_t           items;                 /*! number of registered items             */
+    remote_rwlock_t  lock;                  /*! lock protecting hash table modifs      */
 }
 xhtab_t;
 
 /******************************************************************************************
- * This function initializes an empty hash table (zero registered item).
+ * This function initializes an empty hash table (zero children).
+ * The initialisation must be done by a thread running in cluster containing the table.
  ******************************************************************************************
- * @ xhtab_xp  : extended pointer on xhtab.
- * @ type      : item type (see above).
+ * @ xhtab   : local pointer on local xhtab to be initialized.
+ * @ type    : item type (see above).
  *****************************************************************************************/
-void xhtab_init( xptr_t              xhtab_xp,
-                 xhtab_item_type_t   type );
+void xhtab_init( xhtab_t * xhtab,
+                 uint32_t  type );
 
 /******************************************************************************************
@@ -118,21 +108,17 @@
  * @ key        : local pointer on item identifier.
  * @ xlist_xp   : extended pointer on xlist_entry_t embedded in item to be registered.
- * @ return 0 if success / return -1 if item already registered.
  *****************************************************************************************/
-error_t xhtab_insert( xptr_t   xhtab_xp,
-                      void   * key,
-                      xptr_t   xlist_xp );
+void xhtab_register( xptr_t   xhtab_xp,
+                     void   * key,
+                     xptr_t   xlist_xp );
 
 /******************************************************************************************
  * This function safely remove an item from the hash table, using the lock protecting it.
  ******************************************************************************************
- * @ xhtab_xp   : extended pointer on hash table.
- * @ key        : local pointer on item identifier.
- * @ xlist_xp   : extended pointer on xlist_entry embedded in item to be removed.
- * @ return 0 if item found / return -1 if item not found.
+ * @ xhtab_xp : extended pointer on hash table.
+ * @ key      : local pointer on item identifier.
  *****************************************************************************************/
-error_t xhtab_remove( xptr_t   xhtab_xp,
-                      void   * key,
-                      xptr_t   xlist_entry_xp );
+void xhtab_remove( xptr_t   xhtab_xp,
+                   void   * key );
 
 /******************************************************************************************
@@ -146,46 +132,47 @@
                       void    * key );
 
-/******************************************************************************************
- * This blocking function takes the lock protecting exclusive access to the hash table. 
- * It should be called before the xhtab_get_first() & xhtab_get_next() functions.
- ******************************************************************************************
- * @ xhtab_xp  : extended pointer on hash table.
- *****************************************************************************************/
-void xhtab_lock( xptr_t xhtab_xp );
+
+/************************  vfs_dentry_t specific functions  ******************************/
 
 /******************************************************************************************
- * This function releases the lock protecting exclusive access to the hash table. 
- * It should be called after the xhtab_get_first() & xhtab_get_next() functions.
+ * This function compute the hash index from the key, when the item is a vhs_dentry_t.
  ******************************************************************************************
- * @ xhtab_xp  : extended pointer on hash table.
+ * @ key      : local pointer on dentry name.
+ * @ return the index value, from 0 to (HASHTAB_SIZE - 1)
  *****************************************************************************************/
-void xhtab_unlock( xptr_t xhtab_xp );
+uint32_t xhtab_dentry_index( void * key );
 
 /******************************************************************************************
- * This function returns an extended pointer on the first item registered in hash table,
- * and register this pointer in the hash table header.
- * The lock protecting the hash table must have been previously taken by the caller.
+ * This function check the key value for a given item, when the item is a vhs_dentry_t.
  ******************************************************************************************
- * @ xhtab_xp  : extended pointer on hash table.
- * @ return extended pointer on item if success / XPTR_NULL if not found.
+ * @ xlist_xp : extended pointer on xlist_entry_t contained in a vfs_dentry_t.
+ * @ key      : local pointer on searched dentry name.
+ * @ return true if the item name matches the searched name. 
  *****************************************************************************************/
-xptr_t xhtab_get_first( xptr_t xhtab_xp );
+bool_t xhtab_dentry_compare( xptr_t   xlist_xp,
+                             void   * key,
+                             xptr_t * item_xp );
+
+
+/************************  vfs_inode_t specific functions  *******************************/
 
 /******************************************************************************************
- * This function returns an extended pointer on item following the currently pointed
- * item in the hash table header.
- * The lock protecting the hash table must have been previously taken by the caller.
+ * This function compute the hash index from the key, when the item is a vhs_inode_t.
  ******************************************************************************************
- * @ xhtab_xp  : extended pointer on hash table.
- * @ return extended pointer on item if success / XPTR_NULL if not found.
+ * @ key      : local pointer on dentry name.
+ * @ return the index value, from 0 to (HASHTAB_SIZE - 1)
  *****************************************************************************************/
-xptr_t xhtab_get_next( xptr_t xhtab_xp );
+uint32_t xhtab_inode_index( void * key );
 
 /******************************************************************************************
- * This function displays the full content of an xhtab.
+ * This function check the key value for a given item, when the item is a vhs_inode_t.
  ******************************************************************************************
- * @ xhtab_xp  : extended pointer on hash table.
+ * @ xlist_xp : extended pointer on xlist_entry_t contained in a vfs_dentry_t.
+ * @ key      : local pointer on searched dentry name.
+ * @ return true if the item name matches the searched name. 
  *****************************************************************************************/
-void xhtab_display( xptr_t  xhtab_xp );
+bool_t xhtab_inode_compare( xptr_t   xlist_xp,
+                            void   * key,
+                            xptr_t * item_xp );
 
 #endif	/* _XHTAB_H_ */
Index: trunk/kernel/libk/xlist.h
===================================================================
--- trunk/kernel/libk/xlist.h	(revision 690)
+++ trunk/kernel/libk/xlist.h	(revision 1)
@@ -1,6 +1,6 @@
 /*
- * xlist.h - Trans-cluster double circular linked list, using extended pointers.
- *
- * Author : Alain Greiner (2016,2017,2018,2019,2020)
+ * xlist.h - Double Circular Linked lists, using extended pointers.
+ *
+ * Author : Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,11 +22,10 @@
  */
 
-#ifndef _XLIST_H_
-#define _XLIST_H_
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#ifndef _ALMOS_XLIST_H_
+#define _ALMOS_XLIST_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_remote.h>
-#include <printk.h>
 
 /**** global variables ***/
@@ -50,5 +49,4 @@
 /***************************************************************************
  * This macro returns the offset (in bytes) of a field in a structure.
- ***************************************************************************
  * @ type   : structure type
  * @ member : name of the field
@@ -56,5 +54,5 @@
 
 #ifndef OFFSETOF
-#define OFFSETOF( type , member ) ((intptr_t) & ((type *)0)->member)
+#define OFFSETOF( type , member ) ((unsigned int) & ((type *)0)->member)
 #endif
 
@@ -62,5 +60,4 @@
  * This macro returns an extended pointer on the structure containing an
  * embedded xlist_entry_t field.
- ***************************************************************************
  * @ xlist_xp : extended pointer on the xlist_entry_t field
  * @ type     : type of the structure containing the xlist_entry_t
@@ -75,6 +72,4 @@
  * extended double linked list, identified by the extended pointer on 
  * the root xlist_entry_t.
- * WARNING : check list non empty before using this macro.
- ***************************************************************************
  * @ root_xp : extended pointer on the root xlist_entry_t 
  * @ type    : type of the linked elements
@@ -82,6 +77,6 @@
  **************************************************************************/
 
-#define XLIST_FIRST( root_xp , type , member )       \
-    ({ xptr_t __first = hal_remote_l64( root_xp );   \
+#define XLIST_FIRST_ELEMENT( root_xp , type , member ) \
+    ({ xptr_t __first = hal_remote_lwd( root_xp );     \
 	   XLIST_ELEMENT( __first , type , member ); })
 
@@ -90,6 +85,4 @@
  * extended double linked list, identified by the extended pointer on 
  * the root xlist_entry_t.
- * WARNING : check list non empty before using this macro.
- ***************************************************************************
  * @ root_xp : extended pointer on the root xlist_entry_t
  * @ type    : type of the linked elements
@@ -97,12 +90,11 @@
  **************************************************************************/
 
-#define XLIST_LAST( root_xp , type , member )                       \
-    ({ xptr_t __last = hal_remote_l64( root_xp + sizeof(xptr_t) );  \
+#define XLIST_LAST_ELEMENT( root_xp , type , member )  \
+    ({ xptr_t __last = hal_remote_lwd( root_xp + 8 );  \
 	   XLIST_ELEMENT( __last , type , member ); })
 
 /***************************************************************************
  * This macro traverses an extended double linked list in forward order.
- * WARNING : the iter variable should NOT be deleted during traversal. 
- ***************************************************************************
+ * The iter variable should NOT be deleted during traversal. 
  * @ root_xp  : extended pointer on the root xlist_entry_t
  * @ iter_xp  : current extended pointer on a xlist_entry_t
@@ -110,25 +102,23 @@
 
 #define XLIST_FOREACH( root_xp , iter_xp )    \
-for( (iter_xp) = hal_remote_l64( root_xp ) ;  \
+for( (iter_xp) = hal_remote_lwd( root_xp ) ;  \
      (iter_xp) != (root_xp) ;                 \
-     (iter_xp) = hal_remote_l64( iter_xp ) )
+     (iter_xp) = hal_remote_lwd( iter_xp ) )
 
 /***************************************************************************
  * This macro traverses an extended double linked list in backward order.
- * WARNING : the iter variable should NOT be deleted during traversal. 
- ***************************************************************************
+ * The iter variable should NOT be deleted during traversal. 
  * @ root_xp  : extended pointer on the root xlist_entry_t
  * @ iter_xp  : current extended pointer on a xlist_entry_t
  **************************************************************************/
 
-#define XLIST_FOREACH_BACKWARD( root_xp , iter_xp )              \
-for( (iter_xp) = hal_remote_l64( (root_xp) + sizeof(xptr_t) ) ;  \
-     (iter_xp) != (root_xp) ;                                    \
-     (iter_xp) = hal_remote_l64( (iter_xp) + sizeof(xptr_t) ) )
+#define XLIST_FOREACH_BACKWARD( root_xp , iter_xp )  \
+for( (iter_xp) = hal_remote_lwd( (root_xp) + 8 ) ;   \
+     (iter_xp) != (root_xp) ;                        \
+     (iter_xp) = hal_remote_lwd( (iter_xp) + 8 ) )
 
 /***************************************************************************
  * This function returns an extended pointer on the next xlist_entry_t,
  * from an extended pointer on a reference xlist_entry_t.
- ***************************************************************************
  * @ root    : extended pointer on the root xlist_entry_t
  * @ ref     : extended pointer on the reference xlist_entry_t
@@ -138,8 +128,8 @@
 {
     // get root->next
-    xptr_t root_next = (xptr_t)hal_remote_l64( root );
+    xptr_t root_next = (xptr_t)hal_remote_lwd( root );
 
     // get ref->next
-    xptr_t ref_next  = (xptr_t)hal_remote_l64( ref );
+    xptr_t ref_next  = (xptr_t)hal_remote_lwd( ref );
 
     // test if list is empty or ref is the last element  
@@ -151,5 +141,4 @@
 /***************************************************************************
  * This function returns an extended pointer on the previous xlist_entry_t.
- ***************************************************************************
  * @ root    : extended pointer on the root xlist_entry_t
  * @ ref     : extended pointer on the reference xlist_entry_t
@@ -159,8 +148,8 @@
 {
     // get root->next
-    xptr_t root_next = (xptr_t)hal_remote_l64( root );
+    xptr_t root_next = (xptr_t)hal_remote_lwd( root );
 
     // get ref->pred
-    xptr_t ref_pred  = (xptr_t)hal_remote_l64( ref + sizeof(xptr_t) );
+    xptr_t ref_pred  = (xptr_t)hal_remote_lwd( ref + 8 );
 
     // test if list is empty or ref is the first element  
@@ -173,11 +162,10 @@
  * This function initialises the root of an extended double linked list.
  * The root can be located in any cluster.
- ***************************************************************************
  * @ root_xp   :  extended pointer on the root xlist_entry_t
  **************************************************************************/
 static inline void xlist_root_init( xptr_t root_xp )
 {
-    hal_remote_s64( root_xp                  , root_xp );
-    hal_remote_s64( root_xp + sizeof(xptr_t) , root_xp );
+    hal_remote_swd(  root_xp   , root_xp );
+    hal_remote_swd(  root_xp+8 , root_xp );
 }
 
@@ -185,11 +173,10 @@
  * This function initialises an entry of an extended double linked list.
  * The entry can be located in any cluster.
- ***************************************************************************
  * @ entry_xp  : extended pointer on the xlist_entry_t
  **************************************************************************/
 static inline void xlist_entry_init( xptr_t entry_xp )
 {
-    hal_remote_s64( entry_xp                  , 0 );
-    hal_remote_s64( entry_xp + sizeof(xptr_t) , 0 );
+    hal_remote_swd(  entry_xp   , 0 );
+    hal_remote_swd(  entry_xp+8 , 0 );
 }
 
@@ -198,25 +185,24 @@
  * double linked list. Four extended pointers must be modified.
  * The lock protecting the list should have been previously taken.
- ***************************************************************************
- * @ root_xp   : extended pointer on the root xlist_entry_t
- * @ entry_xp  : extended pointer on the xlist_entry_t to be inserted
- **************************************************************************/
-static inline void xlist_add_first( xptr_t root_xp, 
-                                    xptr_t entry_xp )
+ * @ root   : extended pointer on the root xlist_entry_t
+ * @ entry  : extended pointer on the xlist_entry_t to be inserted
+ **************************************************************************/
+static inline void xlist_add_first( xptr_t root, 
+                                    xptr_t entry )
 {
     // get the extended pointer on the first element in list
-    xptr_t first_xp = hal_remote_l64( root_xp );
-
-    // update root_xp->next <= entry_xp
-    hal_remote_s64( root_xp , entry_xp );
-
-    // update entry_xp->next <= first_xp
-    hal_remote_s64( entry_xp , first_xp );
-
-    // update entry_xp->pred <= root_xp 
-    hal_remote_s64( entry_xp + sizeof(xptr_t) , root_xp );
+    xptr_t first = (xptr_t)hal_remote_lwd( root );
+
+    // update root.next <= entry
+    hal_remote_swd( root , (uint64_t)entry );
+
+    // update entry.next <= first
+    hal_remote_swd( entry , (uint64_t)first );
+
+    // entry.pred <= root 
+    hal_remote_swd( entry + 8 , (uint64_t)root );
     
-    // update first_xp->pred <= entry_xp
-    hal_remote_s64( first_xp + sizeof(xptr_t) , entry_xp );
+    // first.pred <= new
+    hal_remote_swd( first + 8 , (uint64_t)entry );
 }
 
@@ -225,25 +211,24 @@
  * double linked list.  Four extended pointers must be modified.
  * The lock protecting the list should have been previously taken.
- ***************************************************************************
- * @ root_xp   : extended pointer on the root xlist_entry_t
- * @ entry_xp  : extended pointer on the xlist_entry_t to be inserted
- **************************************************************************/
-static inline void xlist_add_last( xptr_t root_xp, 
-                                   xptr_t entry_xp )
+ * @ root   : extended pointer on the root xlist_entry_t
+ * @ entry  : extended pointer on the xlist_entry_t to be inserted
+ **************************************************************************/
+static inline void xlist_add_last( xptr_t root, 
+                                   xptr_t entry )
 {
     // get the extended pointer on the last element in list
-    xptr_t last_xp = hal_remote_l64( root_xp + sizeof(xptr_t) );
-
-    // update root_xp->pred <= entry_xp
-    hal_remote_s64( root_xp + sizeof(xptr_t) , entry_xp );
-
-    // update entry_xp->pred <= last_xp
-    hal_remote_s64( entry_xp + sizeof(xptr_t) , last_xp );
-
-    // update entry_xp->next <= root_xp
-    hal_remote_s64( entry_xp , root_xp );
+    xptr_t last = (xptr_t)hal_remote_lwd( root + 8 );
+
+    // update root.pred <= entry
+    hal_remote_swd( root + 8 , (uint64_t)entry );
+
+    // update entry.pred <= last
+    hal_remote_swd( entry + 8 , (uint64_t)last );
+
+    // entry.next <= root 
+    hal_remote_swd( entry , (uint64_t)root );
     
-    // update last_xp->next <= entry_xp
-    hal_remote_s64( last_xp , entry_xp );
+    // last.next <= entry
+    hal_remote_swd( last , (uint64_t)entry );
 }
 
@@ -251,19 +236,18 @@
 /***************************************************************************
  * This function returns true if the list is empty.
- ***************************************************************************
- * @ root_xp  : extended pointer on the root xlist_entry_t.
- **************************************************************************/
-static inline bool_t xlist_is_empty( xptr_t root_xp )
+ * @ root  : extended pointer on the root xlist_entry_t
+ **************************************************************************/
+static inline bool_t xlist_is_empty( xptr_t root )
 {
     // get the extended pointer root.next value
-    xptr_t next = (xptr_t)hal_remote_l64( root_xp );
-
-    return ( root_xp == next );
+    xptr_t next = (xptr_t)hal_remote_lwd( root );
+
+    return ( root == next );
 } 
 
 /***************************************************************************
  * This function removes an entry from an extended  double linked list.
+ * Two extended pointers must be modified.
  * The memory allocated to the removed entry is not released.
- ***************************************************************************
  * @ xp : extended pointer on the xlist_entry_t to be removed.
  **************************************************************************/
@@ -273,17 +257,15 @@
     xlist_entry_t entry;
     hal_remote_memcpy( XPTR( local_cxy , &entry ) ,
-                       xp , 
-                       sizeof(xlist_entry_t) );
+                                  xp , 
+                                  sizeof(xlist_entry_t) );
 
     xptr_t next = entry.next;
     xptr_t pred = entry.pred;
 
-    // update pred.next & next.pred
-    hal_remote_s64( pred , (uint64_t)next );
-    hal_remote_s64( next + sizeof(xptr_t) , (uint64_t)pred );
-
-    // reset the removed entry itself
-    hal_remote_s64( xp , XPTR_NULL );
-    hal_remote_s64( xp + sizeof(xptr_t) , XPTR_NULL );
+    // update pred.next <= next
+    hal_remote_swd( pred , (uint64_t)next );
+
+    // update next.pred <= pred
+    hal_remote_swd( next + 8 , (uint64_t)pred );
 }
 
@@ -292,7 +274,6 @@
  * Four extended pointers must be modified.
  * The memory allocated to the removed entry is not released.
- ***************************************************************************
- * @ old      : extended pointer on the xlist_entry_t to be removed.
- * @ new      : extended pointer on the xlist_entry_t to be inserted.
+ * @old      : extended pointer on the xlist_entry_t to be removed.
+ * @new      : extended pointer on the xlist_entry_t to be inserted.
  **************************************************************************/
 static inline void xlist_replace( xptr_t old,
@@ -309,80 +290,15 @@
 
 	// update new.next <= next
-    hal_remote_s64( new , (uint64_t)next );
+    hal_remote_swd( new , (uint64_t)next );
 
     // update new.pred <= pred
-    hal_remote_s64( new + sizeof(xptr_t) , (uint64_t)pred );
+    hal_remote_swd( new + 8 , (uint64_t)pred );
 
 	// update pred.next <= new
-    hal_remote_s64( pred , (uint64_t)new );
+    hal_remote_swd( pred , (uint64_t)new );
 
     // update next.pred <= new
-    hal_remote_s64( next + sizeof(xptr_t) , (uint64_t)new );
-}
-
-/***************************************************************************
- * This debug function displays <max> entries of an xlist.
- ***************************************************************************
- * @ root_xp : extended pointer on the root xlist_entry_t.
- * @ string  : list identifier displayed in header.
- * @ max     : max number of éléments to display.
- **************************************************************************/
-static inline void xlist_display( xptr_t  root_xp,
-                                  char  * string,
-                                  uint32_t max )
-{
-    cxy_t           root_cxy;
-    xlist_entry_t * root_ptr;
-
-    xptr_t          iter_xp;
-    cxy_t           iter_cxy;
-    xlist_entry_t * iter_ptr;
-
-    xptr_t          next_xp;
-    cxy_t           next_cxy;
-    xlist_entry_t * next_ptr;
-
-    xptr_t          pred_xp;
-    cxy_t           pred_cxy;
-    xlist_entry_t * pred_ptr;
-
-    uint32_t        index;
-
-    root_cxy = GET_CXY( root_xp );
-    root_ptr = GET_PTR( root_xp );
-
-    next_xp  = hal_remote_l64( XPTR( root_cxy , &root_ptr->next ) );
-    next_cxy = GET_CXY( next_xp );
-    next_ptr = GET_PTR( next_xp );
-
-    pred_xp  = hal_remote_l64( XPTR( root_cxy , &root_ptr->pred ) );
-    pred_cxy = GET_CXY( pred_xp );
-    pred_ptr = GET_PTR( pred_xp );
-
-    printk("\n***** root (%x,%x) / next (%x,%x) / pred (%x,%x) / %s *****\n",
-    root_cxy, root_ptr, next_cxy, next_ptr, pred_cxy, pred_ptr, string );
-
-    if( xlist_is_empty( root_xp ) == false )
-    {
-        for( iter_xp = hal_remote_l64( XPTR( root_cxy , &root_ptr->next) ) , index = 0 ;
-             (iter_xp != root_xp) && (index < max) ;
-             iter_xp = next_xp , index++ )
-        {
-            iter_cxy = GET_CXY( iter_xp );
-            iter_ptr = GET_PTR( iter_xp );
-
-            next_xp  = hal_remote_l64( XPTR( iter_cxy , &iter_ptr->next ) );
-            next_cxy = GET_CXY( next_xp );
-            next_ptr = GET_PTR( next_xp );
-
-            pred_xp  = hal_remote_l64( XPTR( iter_cxy , &iter_ptr->pred ) );
-            pred_cxy = GET_CXY( pred_xp );
-            pred_ptr = GET_PTR( pred_xp );
-
-            printk(" - %d : iter (%x,%x) / next (%x,%x) / pred (%x,%x)\n",
-            index, iter_cxy, iter_ptr, next_cxy, next_ptr, pred_cxy, pred_ptr );
-        }
-    }
-}  // end xlist_display()
-
-#endif	/* _XLIST_H_ */
+    hal_remote_swd( next + 8 , (uint64_t)new );
+}
+
+#endif	/* _ALMOS_LIST_H_ */
Index: trunk/kernel/mm/kcm.c
===================================================================
--- trunk/kernel/mm/kcm.c	(revision 690)
+++ trunk/kernel/mm/kcm.c	(revision 1)
@@ -1,6 +1,7 @@
 /*
- * kcm.c -  Kernel Cache Manager implementation.
- *
- * Author  Alain Greiner    (2016,2017,2018,2019,2020)
+ * kcm.c - Per cluster & per type Kernel Cache Manager access functions
+ * 
+ * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *         Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,8 +23,7 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <busylock.h>
 #include <list.h>
 #include <printk.h>
@@ -33,730 +33,321 @@
 #include <page.h>
 #include <cluster.h>
-#include <kmem.h>
 #include <kcm.h>
 
-///////////////////////////////////////////////////////////////////////////////////////////
-//         global variables
-///////////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t    chdev_dir;          // allocated in kernel_init.c
-
-
-/////////////////////////////////////////////////////////////////////////////////////
-//        Local access functions
-/////////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////////
+// Extern global variable (defined in kmem.c file)
+/////////////////////////////////////////////////////////////////////////////////////
+
+extern uint32_t kmem_size_tbl[KMEM_TYPES_NR];
+
+
+/////////////////////////////////////////////////////////////////////////////////////
+// This function allocates one page from local PPM.
+/////////////////////////////////////////////////////////////////////////////////////
+static page_t * kcm_page_alloc( kcm_t * kcm )
+{
+	page_t    * page;
+    kmem_req_t  req;
+
+    req.type  = KMEM_PAGE;
+    req.size  = 0;
+    req.flags = AF_KERNEL;
+    page = kmem_alloc( &req );
+  
+	if( page == NULL )
+	{
+		printk("\n[ERROR] in %s failed to allocate page in cluster %d\n", 
+               __FUNCTION__ , local_cxy );
+	}
+
+	return page;
+}
 
 //////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the kcm_alloc() function.
-// It returns a pointer on a block allocated from an active kcm_page.
-// It makes a panic if no block is available in the selected page.
-// It changes the page status as required.
+// This static function returns pointer on allocated block from an active page.
+// It returns NULL if no block available in selected page.
+// It changes the page status if required.
 //////////////////////////////////////////////////////////////////////////////////////
-// @ kcm      : pointer on KCM allocator.
-// @ kcm_page : pointer on an active kcm_page.
-// @ return pointer on allocated block.
-/////////////////////////////////////////////////////////////////////////////////////
-static void * __attribute__((noinline)) kcm_get_block( kcm_t      * kcm,
-                                                       kcm_page_t * kcm_page )
-{
-    // initialise variables
-    uint32_t order  = kcm->order;
-    uint32_t count  = kcm_page->count;
-    uint64_t status = kcm_page->status;
-
-// check kcm page not full
-assert( __FUNCTION__, (count < 63) ,
-"kcm_page should not be full / cxy %x / order %d / count %d", local_cxy, order, count );
-
-    uint32_t index  = 1;
-    uint64_t mask   = (uint64_t)0x2;
-
-	// allocate first free block in kcm_page, update status,
-    // and count , compute index of allocated block in kcm_page 
-    while( index <= 63 )
-    {
-        if( (status & mask) == 0 )   // block found
-        {
-            // update page count and status
-            kcm_page->status = status | mask;
-            kcm_page->count  = count + 1;
-            break;      
-        }
-        
-        index++;
-        mask <<= 1;
-    }
-
-    // switch page to full if last block
-    if( (count + 1) == 63 )
-    {
-		list_unlink( &kcm_page->list);
-		kcm->active_pages_nr--;
-
-        list_add_first( &kcm->full_root , &kcm_page->list );
-		kcm->full_pages_nr ++;
-    }
-
-	// compute return pointer
-	void * ptr = (void *)((intptr_t)kcm_page + (index << order));
-
-	return ptr;
-
-}  // end kcm_get_block()
-
-/////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the kcm_free() function.
-// It releases a previously allocated block to the relevant kcm_page.
-// It makes a panic if the released block is not allocated in this page.
-// It changes the kcm_page status as required.
-/////////////////////////////////////////////////////////////////////////////////////
-// @ kcm        : pointer on kcm allocator.
-// @ kcm_page   : pointer on kcm_page.
-// @ block_ptr  : pointer on block to be released.
-/////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__((noinline)) kcm_put_block ( kcm_t      * kcm,
-                                                      kcm_page_t * kcm_page,
-                                                      void       * block_ptr )
-{
-    // initialise variables
-    uint32_t order  = kcm->order;
-    uint32_t count  = kcm_page->count;
-    uint64_t status = kcm_page->status;
-    
-	// compute block index from block pointer and kcm_page pointer
-	uint32_t index = ((intptr_t)block_ptr - (intptr_t)kcm_page) >> order;
-
-    // compute mask in bit vector
-    uint64_t mask = ((uint64_t)0x1) << index;
-
-    if( (status & mask) == 0 )
-    {
-        printk("\n[WARNING] in %s : block[%x,%x] not allocated / kcm %x / kcm_page %x\n",
-        __FUNCTION__, local_cxy, block_ptr, kcm, kcm_page );
-        kcm_remote_display( local_cxy , kcm );
-        return;
-    }
-
-    // update status & count in kcm_page 
-	kcm_page->status = status & ~mask;
-	kcm_page->count  = count - 1;
-
-	// switch page to active if it was full
-	if( count == 63 )
-	{
-		list_unlink( &kcm_page->list );
-		kcm->full_pages_nr --;
-
-		list_add_last( &kcm->active_root, &kcm_page->list );
+static void * get_block( kcm_t      * kcm,
+                         kcm_page_t * page )
+{
+	int32_t index = bitmap_ffs( page->bitmap , sizeof(page->bitmap) ); 
+
+    // the page should be active 
+    if( page->active == 0 )
+    {
+        printk("\n[PANIC] in %s : kcm page should be active\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // the page should not be full
+    if( index == -1 )
+    {
+        printk("\n[PANIC] in %s : kcm page should be active\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+ 
+	bitmap_clear( page->bitmap , index );
+	page->refcount ++;
+
+    // change the page to busy if last block in page
+    if( page->refcount >= kcm->blocks_nr )
+    {
+        page->active = 0;
+		list_unlink( &page->list);
+		kcm->active_pages_nr --;
+
+		list_add_first( &kcm->busy_root , &page->list);
+		kcm->busy_pages_nr ++;
+        page->busy   = 1;
+    }
+
+	return (page->blk_tbl + index * kcm->block_size );
+}
+
+/////////////////////////////////////////////////////////////////////////////////////
+// This static function releases a previously allocated block.
+// It changes the page status if required.
+/////////////////////////////////////////////////////////////////////////////////////
+static void put_block ( kcm_t * kcm,
+                        void  * ptr )
+{
+	kcm_page_t * page;
+    uint32_t     index; 
+  
+	page = (kcm_page_t*)((intptr_t)ptr & CONFIG_PPM_PAGE_MASK);
+	index = ((uint8_t*)ptr - page->blk_tbl) / kcm->block_size;
+  
+	bitmap_set( page->bitmap , index );
+	page->refcount --;
+  
+    // change the page to active if it was busy
+	if( page->busy )
+	{
+		page->busy = 0;
+		list_unlink( &page->list );
+		kcm->busy_pages_nr --;
+
+		list_add_last( &kcm->active_root, &page->list );
 		kcm->active_pages_nr ++;
-	}
-
-}  // kcm_put_block()
-
-/////////////////////////////////////////////////////////////////////////////////////
-// This static function  returns one non-full kcm_page with the following policy :
-// - if the "active_list" is non empty, it returns the first "active" page,
-//   without modifying the KCM state.
-// - if the "active_list" is empty, it allocates a new page from PPM, inserts
-//   this page in the active_list, and returns it. 
-/////////////////////////////////////////////////////////////////////////////////////
-// @ kcm      : local pointer on local KCM allocator.
-// @ return pointer on a non-full kcm page if success / returns NULL if no memory.
-/////////////////////////////////////////////////////////////////////////////////////
-static kcm_page_t * __attribute__((noinline)) kcm_get_page( kcm_t * kcm )
-{
-    kcm_page_t * kcm_page;
-
-    uint32_t active_pages_nr = kcm->active_pages_nr;
-
-    if( active_pages_nr > 0 )       // return first active page
-    {
-        kcm_page = LIST_FIRST( &kcm->active_root , kcm_page_t , list );
-    }
-    else                            // allocate a new page from PPM
-	{
-        // get KCM order
-        uint32_t order = kcm->order;
-
-        // get one kcm_page from  PPM
-        page_t * page = ppm_alloc_pages( order + 6 - CONFIG_PPM_PAGE_ORDER );
-
-	    if( page == NULL )
-	    {
-
-#if DEBUG_KCM_ERROR
-printk("\n[ERROR] in %s : failed to allocate page in cluster %x\n",
-__FUNCTION__ , local_cxy );
-#endif
-		    return NULL;
-        }
-
-	    // get page base address
-	    xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) );
-
-        // get local pointer on kcm_page 
-	    kcm_page = GET_PTR( base_xp );
-
-	    // initialize kcm_page descriptor
-	    kcm_page->status = 0;
-	    kcm_page->count  = 0;
-	    kcm_page->kcm    = kcm;
-	    kcm_page->page   = page;
-
-	    // introduce new page in KCM active_list
-	    list_add_first( &kcm->active_root , &kcm_page->list );
-	    kcm->active_pages_nr ++;
-	}
-
-	return kcm_page;
-
-}  // end kcm_get_page()
-
-//////////////////////////////
-void kcm_init( kcm_t    * kcm,
-	           uint32_t   order)
-{
-
-// check argument
-assert( __FUNCTION__, (order < CONFIG_PPM_PAGE_ORDER),
-"order argument %d too large", order );
-
-assert( __FUNCTION__, (order >= CONFIG_CACHE_LINE_ORDER),
-"order argument %d too small", order );
-
-	// initialize lock
-	remote_busylock_init( XPTR( local_cxy , &kcm->lock ) , LOCK_KCM_STATE );
-
-	// initialize KCM page lists
-	kcm->full_pages_nr   = 0;
+        page->active = 1;
+	}
+
+    // change the page to free if last block in active page
+	if( (page->active) && (page->refcount == 0) )
+	{
+        page->active = 0;
+		list_unlink( &page->list);
+		kcm->active_pages_nr --;
+
+		list_add_first( &kcm->free_root , &page->list);
+		kcm->free_pages_nr ++;
+	}
+}
+
+/////////////////////////////////////////////////////////////////////////////////////
+// This static function tries to allocate one page from PPM. It initializes
+// the KCM-page descriptor, and introduces the new page into freelist. 
+/////////////////////////////////////////////////////////////////////////////////////
+static error_t freelist_populate( kcm_t * kcm )
+{
+	page_t     * page;
+	kcm_page_t * ptr;
+
+    // get one page from local PPM
+	page = kcm_page_alloc( kcm );
+	if( page == NULL ) return ENOMEM;
+ 
+    // get physical page base address
+	ptr = ppm_page2base( page );
+
+    // initialize KCM-page descriptor
+	bitmap_set_range( ptr->bitmap , 0 , kcm->blocks_nr );
+
+	ptr->busy          = 0;
+	ptr->active        = 0;
+	ptr->refcount      = 0;
+	ptr->blk_tbl       = (uint8_t*)ptr + kcm->block_size;
+	ptr->kcm           = kcm;
+	ptr->page          = page;
+
+    // introduce new page in free-list
+	list_add_first( &kcm->free_root , &ptr->list );
+	kcm->free_pages_nr ++;
+ 
+	return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////
+// This private function get one KCM page from the KCM freelist.
+// It populates the freelist if required.
+/////////////////////////////////////////////////////////////////////////////////////
+static kcm_page_t * freelist_get( kcm_t * kcm )
+{
+	error_t      err;
+	kcm_page_t * page;
+
+    // get a new page from PPM if freelist empty
+	if( kcm->free_pages_nr == 0 )
+	{
+        err = freelist_populate( kcm );
+        if( err	) return NULL;
+	}
+
+    // get first KCM page from freelist and change its status to active 
+	page = LIST_FIRST( &kcm->free_root, kcm_page_t , list );
+	list_unlink( &page->list );
+	kcm->free_pages_nr --;
+    page->active = 1;
+
+    list_add_first( &kcm->active_root , &page->list);
+	kcm->active_pages_nr ++;
+    page->active = 1;
+
+	return page;
+}
+
+
+////////////////////////////////////
+error_t kcm_init( kcm_t       * kcm,
+		          uint32_t      type )
+{
+	uint32_t     blocks_nr;
+	uint32_t     block_size;
+	uint32_t     remaining;
+	kcm_page_t * page;
+
+	spinlock_init( &kcm->lock );
+
+    // initialize KCM type  
+	kcm->type = type;
+
+    // initialise KCM page lists
+	kcm->free_pages_nr   = 0;
+	kcm->busy_pages_nr   = 0;
 	kcm->active_pages_nr = 0;
-	list_root_init( &kcm->full_root );
+	list_root_init( &kcm->free_root );
+	list_root_init( &kcm->busy_root );
 	list_root_init( &kcm->active_root );
 
-	// initialize order 
-	kcm->order = order;
- 
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) )
-printk("\n[%s] cxy %x / order %d\n",
-__FUNCTION__, local_cxy, order );
-#endif
-
-}  // end kcm_init()
+    // initialize block size and number of blocks per page,
+    // using the global kmem_size_tbl[] array 
+	block_size      = ARROUND_UP( kmem_size_tbl[type] , 64 );
+	blocks_nr       = CONFIG_PPM_PAGE_SIZE / block_size;
+	remaining       = CONFIG_PPM_PAGE_SIZE % block_size;
+	blocks_nr       = (remaining >= sizeof(kcm_page_t)) ? blocks_nr : blocks_nr - 1;
+
+	kcm->blocks_nr  = blocks_nr;
+	kcm->block_size = block_size;
+
+    // get one page from free_list
+	page = freelist_get( kcm );
+	if( page == NULL ) return ENOMEM;
+     
+    // register page in active list
+	list_add_first( &kcm->active_root , &page->list );
+	page->active = 1;
+	kcm->active_pages_nr ++;
+
+	return 0;
+}
 
 ///////////////////////////////
 void kcm_destroy( kcm_t * kcm )
 {
-	kcm_page_t   * kcm_page;
-
-    // build extended pointer on  KCM lock
-    xptr_t lock_xp = XPTR( local_cxy , &kcm->lock );
-
-	// get KCM lock
-	remote_busylock_acquire( lock_xp );
-
-	// release all full pages
-	while( list_is_empty( &kcm->full_root ) == false )
-	{
-		kcm_page = LIST_FIRST( &kcm->full_root , kcm_page_t , list );
-		list_unlink( &kcm_page->list );
-		ppm_free_pages( kcm_page->page );
-	}
-
-    // release all empty pages
-    while( list_is_empty( &kcm->active_root ) == false )
-	{
-		kcm_page = LIST_FIRST( &kcm->active_root , kcm_page_t , list );
-		list_unlink( &kcm_page->list );
-		ppm_free_pages( kcm_page->page );
-	}
-
-	// release KCM lock
-	remote_busylock_release( lock_xp );
-
-}  // end kcm_destroy()
-
-//////////////////////////////////
-void * kcm_alloc( uint32_t order )
-{
-    kcm_t      * kcm;
-	kcm_page_t * kcm_page;
-	void       * block;
-
-// check argument
-assert( __FUNCTION__, (order < CONFIG_PPM_PAGE_ORDER),
-"order argument %d too large", order );
-
-#if DEBUG_KCM
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // smallest block size is a cache line
-    if (order < CONFIG_CACHE_LINE_ORDER) order = CONFIG_CACHE_LINE_ORDER;
-
-    // get local pointer on relevant KCM allocator
-    kcm = &LOCAL_CLUSTER->kcm[order - CONFIG_CACHE_LINE_ORDER];
-
-    // build extended pointer on local KCM lock
-    xptr_t lock_xp = XPTR( local_cxy , &kcm->lock );
-
-	// get KCM lock
-	remote_busylock_acquire( lock_xp );
-
-    // get a non-full kcm_page
-    kcm_page = kcm_get_page( kcm );
-
-    if( kcm_page == NULL )
-	{
-		remote_busylock_release( lock_xp );
-		return NULL;
-	}
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] enter / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, local_cxy, kcm, kcm->full_pages_nr, kcm->active_pages_nr,
-kcm_page, (uint32_t)(kcm_page->status>>32), (uint32_t)(kcm_page->status), kcm_page->count );
-#endif
-
-	// allocate a block from selected active page
-	block = kcm_get_block( kcm , kcm_page );
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] exit  / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, local_cxy, kcm, kcm->full_pages_nr, kcm->active_pages_nr,
-kcm_page, (uint32_t)(kcm_page->status>>32), (uint32_t)(kcm_page->status), kcm_page->count );
-#endif
-
-	// release lock
-	remote_busylock_release( lock_xp );
-
-	return block;
-
-}  // end kcm_alloc()
+	kcm_page_t   * page;
+	list_entry_t * iter;
+  
+    // get KCM lock
+	spinlock_lock( &kcm->lock );
+
+    // release all free pages
+	LIST_FOREACH( &kcm->free_root , iter )
+	{
+		page = (kcm_page_t *)LIST_ELEMENT( iter , kcm_page_t , list );
+		list_unlink( iter );
+		kcm->free_pages_nr --;
+		ppm_free_pages( page->page );
+	}
+
+    // release all active pages
+	LIST_FOREACH( &kcm->active_root , iter )
+	{
+		page = (kcm_page_t *)LIST_ELEMENT( iter , kcm_page_t , list );
+		list_unlink( iter );
+		kcm->free_pages_nr --;
+		ppm_free_pages( page->page );
+	}
+
+    // release all busy pages
+	LIST_FOREACH( &kcm->busy_root , iter )
+	{
+		page = (kcm_page_t *)LIST_ELEMENT( iter , kcm_page_t , list );
+		list_unlink( iter );
+		kcm->free_pages_nr --;
+		ppm_free_pages( page->page );
+	}
+
+    // release KCM lock
+    spinlock_unlock( &kcm->lock );
+
+    
+}
 
 ///////////////////////////////
-void kcm_free( void    * block,
-               uint32_t  order )
-{
-    kcm_t      * kcm;
-	kcm_page_t * kcm_page;
-
-// check argument
-assert( __FUNCTION__, (block != NULL), 
-"block pointer cannot be NULL" );
-
-#if DEBUG_KCM
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // smallest block size is a cache line
-    if (order < CONFIG_CACHE_LINE_ORDER) order = CONFIG_CACHE_LINE_ORDER;
-
-    // get local pointer on relevant KCM allocator
-    kcm = &LOCAL_CLUSTER->kcm[order - CONFIG_CACHE_LINE_ORDER];
-
-    // get local pointer on KCM page
-    intptr_t kcm_page_mask = (1 << (order + 6)) - 1; 
-	kcm_page = (kcm_page_t *)((intptr_t)block & ~kcm_page_mask);
-
-    // build extended pointer on local KCM lock
-    xptr_t lock_xp = XPTR( local_cxy , &kcm->lock );
-
-	// get lock
-	remote_busylock_acquire( lock_xp );
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] exit  / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, local_cxy, kcm, kcm->full_pages_nr, kcm->active_pages_nr,
-kcm_page, (uint32_t)(kcm_page->status>>32), (uint32_t)(kcm_page->status), kcm_page->count );
-#endif
-
-	// release the block to the relevant page
-	kcm_put_block( kcm , kcm_page , block );
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] exit  / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, local_cxy, kcm, kcm->full_pages_nr, kcm->active_pages_nr,
-kcm_page, (uint32_t)(kcm_page->status>>32), (uint32_t)(kcm_page->status), kcm_page->count );
-#endif
-
-	// release lock
-	remote_busylock_release( lock_xp );
-
-}  // end kcm_free() 
-
-
-/////////////////////////////////////////////////////////////////////////////////////
-//        Remote access functions
-/////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the kcm_remote_alloc() function.
-// It can be called by any thread running in any cluster.
-// It returns a local pointer on a block allocated from an active kcm_page.
-// It makes a panic if no block available in the selected kcm_page.
-// It changes the page status as required.
-/////////////////////////////////////////////////////////////////////////////////////
-// @ kcm_cxy  : remote KCM cluster identifier.
-// @ kcm_ptr  : local pointer on remote KCM allocator.
-// @ kcm_page : local pointer on remote active kcm_page to use.
-// @ return a local pointer on the allocated block. 
-/////////////////////////////////////////////////////////////////////////////////////
-static void * __attribute__((noinline)) kcm_remote_get_block( cxy_t        kcm_cxy,
-                                                              kcm_t      * kcm_ptr,
-                                                              kcm_page_t * kcm_page )
-{
-    uint32_t order  = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->order ) );
-    uint32_t count  = hal_remote_l32( XPTR( kcm_cxy , &kcm_page->count ) );
-    uint64_t status = hal_remote_l64( XPTR( kcm_cxy , &kcm_page->status ) );
-
-// check kcm_page not full
-assert( __FUNCTION__, (count < 63) , 
-"kcm_page should not be full / cxy %x / order %d / count %d", kcm_cxy, order, count );
-
-    uint32_t index  = 1;
-    uint64_t mask   = (uint64_t)0x2;
+void * kcm_alloc( kcm_t * kcm )
+{
+	kcm_page_t * page;
+	void       * ptr = NULL;   // pointer on block
+
+    // get lock
+	spinlock_lock( &kcm->lock );
     
-	// allocate first free block in kcm_page, update status,
-    // and count , compute index of allocated block in kcm_page 
-    while( index <= 63 )
-    {
-        if( (status & mask) == 0 )   // block found
-        {
-            hal_remote_s64( XPTR( kcm_cxy , &kcm_page->status ) , status | mask );
-            hal_remote_s32( XPTR( kcm_cxy , &kcm_page->count  ) , count + 1 );
-            break;      
-        }
-        
-        index++;
-        mask <<= 1;
-    }
-
-	// swich the page to full if last block
-	if( (count + 1) == 63 )
-	{
-		list_remote_unlink( kcm_cxy , &kcm_page->list );
-		hal_remote_atomic_add( XPTR( kcm_cxy , &kcm_ptr->active_pages_nr ) , -1 );
-
-		list_remote_add_first( kcm_cxy , &kcm_ptr->full_root , &kcm_page->list );
-		hal_remote_atomic_add( XPTR( kcm_cxy , &kcm_ptr->full_pages_nr ) , 1 );
-	}
-
-	// compute return pointer
-	void * ptr = (void *)((intptr_t)kcm_page + (index << order));
+    // get block
+    if( list_is_empty( &kcm->active_root ) )  // no active page
+    {
+		page = (kcm_page_t *)LIST_FIRST( &kcm->active_root , kcm_page_t , list );
+        ptr  = get_block( kcm , page );
+    }
+    else                                      // active page cannot be full
+    {
+        page = LIST_FIRST( &kcm->active_root , kcm_page_t , list );
+        ptr  = get_block( kcm , page );
+    }
+
+    // release lock  
+	spinlock_unlock(&kcm->lock);
 
 	return ptr;
-
-}  // end kcm_remote_get_block()
-
-/////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the kcm_remote_free() function.
-// It can be called by any thread running in any cluster.
-// It releases a previously allocated block to the relevant kcm_page.
-// It changes the kcm_page status as required.
-/////////////////////////////////////////////////////////////////////////////////////
-// @ kcm_cxy   : remote KCM cluster identifier
-// @ kcm_ptr   : local pointer on remote KCM.
-// @ kcm_page  : local pointer on kcm_page.
-// @ block_ptr : pointer on block to be released.
-/////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__((noinline)) kcm_remote_put_block ( cxy_t        kcm_cxy,
-                                                             kcm_t      * kcm_ptr,
-                                                             kcm_page_t * kcm_page,
-                                                             void       * block_ptr )
-{
-    uint32_t order  = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->order ) );
-    uint32_t count  = hal_remote_l32( XPTR( kcm_cxy , &kcm_page->count ) );
-    uint64_t status = hal_remote_l64( XPTR( kcm_cxy , &kcm_page->status ) );
-    
-	// compute block index from block pointer and kcm_page pointer
-	uint32_t index = ((intptr_t)block_ptr - (intptr_t)kcm_page) >> order;
-
-    // compute mask in bit vector
-    uint64_t mask = ((uint64_t)0x1) << index;
-
-    if( (status & mask) == 0 )
-    {
-        printk("\n[WARNING] in %s : block[%x,%x] not allocated / kcm %x / kcm_page %x\n",
-        __FUNCTION__, kcm_cxy, block_ptr, kcm_ptr, kcm_page );
-        kcm_remote_display( kcm_cxy , kcm_ptr );
-        return;
-    }
-
-    // update status & count in kcm_page 
-	hal_remote_s64( XPTR( kcm_cxy , &kcm_page->status ) , status & ~mask );
-	hal_remote_s32( XPTR( kcm_cxy , &kcm_page->count  ) , count - 1 );
-
-	// switch the page to active if page was full
-	if( count == 63 )
-	{
-		list_remote_unlink( kcm_cxy , &kcm_page->list );
-		hal_remote_atomic_add( XPTR( kcm_cxy , &kcm_ptr->full_pages_nr ) , -1 );
-
-		list_remote_add_last( kcm_cxy , &kcm_ptr->active_root, &kcm_page->list );
-		hal_remote_atomic_add( XPTR( kcm_cxy , &kcm_ptr->active_pages_nr ) , 1 );
-	}
-
-}  // end kcm_remote_put_block()
-
-/////////////////////////////////////////////////////////////////////////////////////
-// This static function can be called by any thread running in any cluster.
-// It gets one non-full KCM page from the remote KCM.
-// It allocates a page from remote PPM to populate the freelist, and initialises
-// the kcm_page descriptor when required.
-/////////////////////////////////////////////////////////////////////////////////////
-static kcm_page_t * __attribute__((noinline)) kcm_remote_get_page( cxy_t    kcm_cxy,
-                                                                   kcm_t  * kcm_ptr )
-{
-    kcm_page_t * kcm_page;    // local pointer on remote KCM page 
-
-    uint32_t active_pages_nr = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->active_pages_nr ) );
-
-    if( active_pages_nr > 0 )       // return first active page
-    {
-        kcm_page = LIST_REMOTE_FIRST( kcm_cxy , &kcm_ptr->active_root , kcm_page_t , list );
-    }
-    else                            // allocate a new page from PPM
-	{
-        // get KCM order
-        uint32_t order = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->order ));
-
-        // get one kcm_page from PPM
-        xptr_t page_xp = ppm_remote_alloc_pages( kcm_cxy,
-                                                 order + 6 - CONFIG_PPM_PAGE_ORDER );
-	    if( page_xp == XPTR_NULL )
-	    {
-
-#if DEBUG_KCM_ERROR
-printk("\n[ERROR] in %s : failed to allocate page in cluster %x\n",
-__FUNCTION__ , kcm_cxy );
-#endif
-		    return NULL;
-        }
-
-	    // get extended pointer on allocated buffer
-	    xptr_t base_xp = ppm_page2base( page_xp );
-
-        // get local pointer on kcm_page
-	    kcm_page = GET_PTR( base_xp );
-
-	    // initialize kcm_page descriptor
-	    hal_remote_s32( XPTR( kcm_cxy , &kcm_page->count )  , 0 );
-	    hal_remote_s64( XPTR( kcm_cxy , &kcm_page->status ) , 0 );
-	    hal_remote_spt( XPTR( kcm_cxy , &kcm_page->kcm )    , kcm_ptr );
-	    hal_remote_spt( XPTR( kcm_cxy , &kcm_page->page )   , GET_PTR( page_xp ) );
-
-	    // introduce new page in remote KCM active_list
-	    list_remote_add_first( kcm_cxy , &kcm_ptr->active_root , &kcm_page->list );
-	    hal_remote_atomic_add( XPTR( kcm_cxy , &kcm_ptr->active_pages_nr ) , 1 );
-	}
-
-	return kcm_page;
-
-}  // end kcm_remote_get_page()
-
-//////////////////////////////////////////
-void * kcm_remote_alloc( cxy_t    kcm_cxy,
-                         uint32_t order )
-{
-    kcm_t      * kcm_ptr;
-    kcm_page_t * kcm_page;
-    void       * block_ptr;
-
-// check kcm_cxy argument
-assert( __FUNCTION__, cluster_is_active( kcm_cxy ),
-"cluster %x not active", kcm_cxy );
-
-// check order argument
-assert( __FUNCTION__, (order < CONFIG_PPM_PAGE_ORDER) ,
-"order argument %d too large", order );
-
-    // smallest size is a cache line
-    if( order < CONFIG_CACHE_LINE_ORDER ) order = CONFIG_CACHE_LINE_ORDER;
-
-    // get local pointer on relevant KCM allocator (same in all clusters)
-    kcm_ptr = &LOCAL_CLUSTER->kcm[order - 6];
-
-    // build extended pointer on remote KCM lock
-    xptr_t lock_xp = XPTR( kcm_cxy , &kcm_ptr->lock );
-
-	// get lock
-	remote_busylock_acquire( lock_xp );
-
-    // get a non-full kcm_page
-    kcm_page = kcm_remote_get_page( kcm_cxy , kcm_ptr );
-
-    if( kcm_page == NULL )
-	{
-		remote_busylock_release( lock_xp );
-		return NULL;
-	}
-
-#if DEBUG_KCM
-uint32_t cycle     = (uint32_t)hal_get_cycles();
-uint32_t nb_full   = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->full_pages_nr ));
-uint32_t nb_active = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->active_pages_nr ));
-uint64_t status    = hal_remote_l64( XPTR( kcm_cxy , &kcm_page->status ));
-uint32_t count     = hal_remote_l32( XPTR( kcm_cxy , &kcm_page->count ));
-#endif
-
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] enter / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, kcm_cxy, kcm_ptr, nb_full, nb_active,
-kcm_page, (uint32_t)(status>>32), (uint32_t)(status), kcm_page->count );
-#endif
-
-	// get a block from selected active page
-	block_ptr = kcm_remote_get_block( kcm_cxy , kcm_ptr , kcm_page );
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] exit  / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, kcm_cxy, kcm_ptr, nb_full, nb_active,
-kcm_page, (uint32_t)(status>>32), (uint32_t)(status), kcm_page->count );
-#endif
-
-	// release lock
-	remote_busylock_release( lock_xp );
-
-	return block_ptr;
-
-}  // end kcm_remote_alloc()
-
-////////////////////////////////////////
-void kcm_remote_free( cxy_t     kcm_cxy,
-                      void    * block_ptr,
-                      uint32_t  order )
-{
-	kcm_t      * kcm_ptr;
-	kcm_page_t * kcm_page;
-
-// check kcm_cxy argument
-assert( __FUNCTION__, cluster_is_active( kcm_cxy ),
-"cluster %x not active", kcm_cxy );
-
-// check block_ptr argument
-assert( __FUNCTION__, (block_ptr != NULL),
-"block pointer cannot be NULL" );
-
-// check order argument
-assert( __FUNCTION__, (order < CONFIG_PPM_PAGE_ORDER) ,
-"order argument %d too large", order );
-
-    // smallest block size is a cache line
-    if (order < CONFIG_CACHE_LINE_ORDER) order = CONFIG_CACHE_LINE_ORDER;
-
-    // get local pointer on relevant KCM allocator (same in all clusters)
-    kcm_ptr = &LOCAL_CLUSTER->kcm[order - CONFIG_CACHE_LINE_ORDER];
-
-    // get local pointer on KCM page
-    intptr_t kcm_page_mask = (1 << (order + 6)) - 1; 
-	kcm_page = (kcm_page_t *)((intptr_t)block_ptr & ~kcm_page_mask);
-
-#if DEBUG_KCM
-uint32_t cycle     = (uint32_t)hal_get_cycles();
-uint32_t nb_full   = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->full_pages_nr ));
-uint32_t nb_active = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->active_pages_nr ));
-uint64_t status    = hal_remote_l64( XPTR( kcm_cxy , &kcm_page->status ));
-uint32_t count     = hal_remote_l32( XPTR( kcm_cxy , &kcm_page->count ));
-#endif
-
-    // build extended pointer on remote KCM lock
-    xptr_t lock_xp = XPTR( kcm_cxy , &kcm_ptr->lock );
-
-	// get lock
-	remote_busylock_acquire( lock_xp );
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] enter / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, kcm_cxy, kcm_ptr, nb_full, nb_active,
-kcm_page, (uint32_t)(status>>32), (uint32_t)(status), kcm_page->count );
-#endif
-
-	// release the block to the relevant page
-	kcm_remote_put_block( kcm_cxy , kcm_ptr , kcm_page , block_ptr );
-
-#if DEBUG_KCM
-if( (DEBUG_KCM_ORDER == order) && (DEBUG_KCM_CXY == local_cxy) && (DEBUG_KCM < cycle) )
-printk("\n[%s] exit  / order %d / kcm[%x,%x] / nb_full %d / nb_active %d\n"
-"    page %x / status [%x,%x] / count %d\n",
-__FUNCTION__, order, kcm_cxy, kcm_ptr, nb_full, nb_active,
-kcm_page, (uint32_t)(status>>32), (uint32_t)(status), kcm_page->count );
-#endif
-
-	// release lock
-	remote_busylock_release( lock_xp );
-
-}  // end kcm_remote_free
-
-/////////////////////////////////////////
-void kcm_remote_display( cxy_t   kcm_cxy,
-                         kcm_t * kcm_ptr )
-{
-    list_entry_t * iter;
-    kcm_page_t   * kcm_page;
-    uint64_t       status;
-    uint32_t       count;
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // get extended pointer on remote TXT0 chdev lock
-    xptr_t    txt0_lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( txt0_lock_xp );
-
-    uint32_t order           = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->order) );
-    uint32_t full_pages_nr   = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->full_pages_nr ) );
-    uint32_t active_pages_nr = hal_remote_l32( XPTR( kcm_cxy , &kcm_ptr->active_pages_nr ) );
-
-	nolock_printk("*** KCM : cxy %x / order %d / full_pages_nr %d / active_pages_nr %d\n",
-	kcm_cxy, order, full_pages_nr, active_pages_nr );
-
-    if( active_pages_nr )
-    {
-        LIST_REMOTE_FOREACH( kcm_cxy , &kcm_ptr->active_root , iter )
-        {
-            kcm_page = LIST_ELEMENT( iter , kcm_page_t , list );
-            status   = hal_remote_l64( XPTR( kcm_cxy , &kcm_page->status ) );
-            count    = hal_remote_l32( XPTR( kcm_cxy , &kcm_page->count ) );
-
-            nolock_printk("- active page %x / status (%x,%x) / count %d\n",
-            kcm_page, (uint32_t)( status<< 32 ), (uint32_t)( status ), count );
-        }
-    }
-
-    if( full_pages_nr )
-    {
-        LIST_REMOTE_FOREACH( kcm_cxy , &kcm_ptr->full_root , iter )
-        {
-            kcm_page = LIST_ELEMENT( iter , kcm_page_t , list );
-            status   = hal_remote_l64( XPTR( kcm_cxy , &kcm_page->status ) );
-            count    = hal_remote_l32( XPTR( kcm_cxy , &kcm_page->count ) );
-
-            nolock_printk("- full page %x / status (%x,%x) / count %d\n",
-            kcm_page, (uint32_t)( status<< 32 ), (uint32_t)( status ), count );
-        }
-    }
-
-    // release TXT0 lock 
-    remote_busylock_release( txt0_lock_xp );
-
-}  // end kcm remote_display()
+}
+
+///////////////////////////
+void kcm_free( void * ptr )
+{
+	kcm_page_t * page;
+	kcm_t      * kcm;
+  
+	if( ptr == NULL ) return;
+	
+	page = (kcm_page_t *)((intptr_t)ptr & CONFIG_PPM_PAGE_MASK);
+	kcm  = page->kcm;
+
+    // get lock
+	spinlock_lock( &kcm->lock );
+
+    // release block
+	put_block( kcm , ptr );
+
+    // release lock  
+	spinlock_unlock( &kcm->lock );
+}
+
+////////////////////////////
+void kcm_print (kcm_t * kcm)
+{
+	printk("*** KCM type = %d / free_pages = %d / busy_pages = %d / active_pages = %d\n",
+           kcm->type , 
+           kcm->free_pages_nr , 
+           kcm->busy_pages_nr ,
+           kcm->active_pages_nr );
+}
Index: trunk/kernel/mm/kcm.h
===================================================================
--- trunk/kernel/mm/kcm.h	(revision 690)
+++ trunk/kernel/mm/kcm.h	(revision 1)
@@ -1,6 +1,7 @@
 /*
- * kcm.h - Kernel Cache Manager definition.
+ * kcm.h - Per-cluster Kernel Cache Manager Interface
  *
- * Authors    Alain Greiner (2016,2017,2018,2019,2020)
+ * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *          Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,6 +27,6 @@
 
 #include <list.h>
-#include <hal_kernel_types.h>
-#include <busylock.h>
+#include <hal_types.h>
+#include <spinlock.h>
 #include <page.h>
 #include <bits.h>
@@ -33,41 +34,29 @@
 
 /****************************************************************************************
- * This structure defines a generic Kernel Cache Manager, a fixed size block allocator.
- * It returns an aligned block whose size is a power of 2, not smaller than a cache line,
- * but smaller than a small PPM page. It exists in each cluster a specific KCM allocator
- * for each possible block size. When the cache line contains 64 bytes and the page 
- * contains 4K bytes, the possible block sizes are 64, 128, 256, 512, 1024, 2048 bytes.
- * These KCM allocators are initialized by the cluster_init() function.
- *
- * Each KCM cache is implemented as a set of "kcm_pages": a "kcm_page" is an aligned
- * buffer in physical memory (allocated by the PPM allocator) such as :
- *       buffer_size = block_size * 64  <=>  buffer_order = block_order + 6.
- * 
- * A kcm_page contains always 64 kcm_blocks, but the first block (that cannot be smaller
- * than 64 bytes) is used to store the kcm_page descriptor defining the page allocation
- * status, and cannot be allocated to store data.
- *
- * A KCM cache is extensible, as new kcm_pages are dynamically allocated from the PPM
- * allocator when required. For a given KCM cache the set of kcm_pages is split in two
- * lists: the list of "full" pages (containing 63 allocated blocks), and the list of
- * "active" pages (containing at least one free block). An "empty" page (containing
- * only free blocks) is considered active, and is not released to PPM.
- * 
- * To allow any thread running in any cluster to directly access the KCM of any cluster,
- * ALMOS-MKH defines two sets of access functions, for local or remote access.
+ * This structure defines a generic Kernel Cache Manager, that is a block allocator,
+ * for fixed size objects. It exists a specific KCM allocator for each object type.
+ * The actual allocated block size is the smallest multiple of 64 bytes that can
+ * contain one single object.
+ * The various KCM allocators themselves are not statically allocated in the cluster
+ * manager, but are dynamically allocated when required, using the specific KCM 
+ * allocator defined in the cluster manager, to allocate the other ones...
  ***************************************************************************************/
 
-typedef struct kcm_s
+typedef struct kcm_s                      
 {
-	remote_busylock_t    lock;             /*! protect KCM allocator                   */
+	spinlock_t           lock;             /*! protect exclusive access to allocator   */
+	uint32_t             block_size;       /*! actual block size (bytes)               */
+	uint32_t             blocks_nr;        /*! number of blocks per page               */
 
-	list_entry_t         full_root;        /*! root of full pages list                 */
 	list_entry_t         active_root;      /*! root of active pages list               */
+	list_entry_t         busy_root;        /*! root of busy pages list                 */
+	list_entry_t         free_root;        /*! root of free pages list                 */
 
-	uint32_t             full_pages_nr;    /*! number of full pages                    */
+	uint32_t             free_pages_nr;    /*! number of free pages                    */
+	uint32_t             busy_pages_nr;    /*! number of busy pages                    */
 	uint32_t             active_pages_nr;  /*! number of active pages                  */
 
-	uint32_t             order;            /*! ln( block_size )                        */
-}
+    uint32_t             type;             /*! KCM type                                */
+} 
 kcm_t;
 
@@ -75,95 +64,61 @@
 /****************************************************************************************
  * This structure defines a KCM-page descriptor.
- * A KCM-page contains (CONFIG_PPM_PAGE_SIZE / block_size) slots. 
- * Each slot contains one block, but the kcm page descriptor is stored in first slot.
- * The current allocation status is defined by the 64 bits "status" bit vector: each
- * non zero bit defines an allocated block / "count" is the number of allocated blocks. 
- * Each kcm_page is registered in one of the two following lists, rooted in the kcm:
- * - full   : when count == max
- * - active : count < max 
+ * A KCM-page can contain several blocks.
+ * This descriptor is stored in the first block slot.
  ***************************************************************************************/
 
 typedef struct kcm_page_s
 {
-	uint64_t            status;            /*! bit vector: non-zero == allocated       */
-	uint32_t            count;             /*! number of allocated blocks in page      */
-	list_entry_t        list;              /*! [active / busy / free] list member      */
-	kcm_t             * kcm;               /*! pointer on kcm allocator                */
-	page_t            * page;              /*! pointer on physical page descriptor     */
-}
+	BITMAP          ( bitmap , 16 );       /*! at most 16 blocks in a page (1 if free) */
+	uint8_t       * blk_tbl;               /*! pointer on first free block in page     */
+	kcm_t         * kcm;                   /*! owner KCM allocator                     */
+	uint8_t         unused;                /*! first free block index in page          */
+	uint8_t         refcount;              /*! number of allocated blocks              */
+	uint8_t         busy;                  /*! page busy if non zero                   */
+	uint8_t         active;                /*! page active if non zero                 */
+	list_entry_t    list;                  /*! [active / busy / free] list member      */
+	page_t        * page;                  /*! pointer on the physical page descriptor */
+} 
 kcm_page_t;
 
 /****************************************************************************************
- * This function must be called by a local thread. 
- * It initializes a Kernel Cache Manager, depending on block size.
+ * This function initializes a generic Kernel Cache Manager. 
  ****************************************************************************************
- * @ kcm      : pointer on KCM to be initialized.
- * @ order    : ln(block_size).
+ * @ kcm      : pointer on KCM manager to initialize.
+ * @ type     : KCM allocator type.
  ***************************************************************************************/
-void kcm_init( kcm_t    * kcm,
-               uint32_t   order );
+error_t kcm_init( kcm_t       * kcm,
+		          uint32_t      type );
 
 /****************************************************************************************
- * This function must be called by a local thread. 
- * It releases all memory allocated to a Kernel Cache Manager.
+ * This function releases all memory allocated to a generic Kernel Cache Manager. 
  ****************************************************************************************
  * @ kcm      : pointer on KCM manager to destroy.
  ***************************************************************************************/
-void kcm_destroy( kcm_t  * kcm );
+void kcm_destroy( kcm_t       * kcm );
 
 /****************************************************************************************
- * This function must be called by a local thread. 
- * It allocates one block from the local Kernel Cache Manager.
+ * This function allocates one single object in a Kernel Cache Manager 
+ * The object size must be smaller than one page size.
  ****************************************************************************************
- * @ order     :  ln( block-size ) == KCM allocator identifier.
- * @ return pointer on allocated block if success / return NULL if failure
+ * @ kcm     :  pointer on the selected KCM allocator
  ***************************************************************************************/
-void * kcm_alloc( uint32_t order );
+void * kcm_alloc( kcm_t * kcm );
 
 /****************************************************************************************
- * This function must be called by a local thread. 
- * It releases a previouly allocated block to the local Kernel Cache Manager.
+ * This function releases a previouly allocated block containing one object.
  ****************************************************************************************
- * @ block_ptr   : local pointer on the released block.
- * @ order       : log2( block_size in bytes ).
+ * @ ptr   : local pointer on the allocated buffer.
  ***************************************************************************************/
-void kcm_free( void    * block_ptr,
-               uint32_t  order );
+void  kcm_free( void * ptr );
+
+/****************************************************************************************
+ * This function prints KCM allocator state (for debug only).
+ ****************************************************************************************
+ * @ kcm   : local pointer on the selected KCM allocator.
+ ***************************************************************************************/
+void kcm_print( kcm_t * kcm );
 
 
 
-
-/****************************************************************************************
- * This function can be called by any thread running in any cluster. 
- * It allocates one fixed size block from a remote Kernel Cache Manager.
- ****************************************************************************************
- * @ kcm_cxy   : remote KCM cluster identifier.
- * @ order     :  ln( block-size ) == KCM allocator identifier.
- * @ return a local pointer on allocated block if success / return NULL if failure
- ***************************************************************************************/
-void * kcm_remote_alloc( cxy_t    kcm_cxy,
-                         uint32_t order );
-
-/****************************************************************************************
- * This function can be called by any thread running in any cluster. 
- * It releases a previouly allocated block to a remote Kernel Cache Manager.
- ****************************************************************************************
- * @ kcm_cxy     : remote KCM cluster identifier.
- * @ block_ptr   : local pointer on the released buffer in remote cluster.
- * @ order       : log2( block_size in bytes ).
- ***************************************************************************************/
-void kcm_remote_free( cxy_t     kcm_cxy,
-                      void    * block_ptr,
-                      uint32_t  order );
-
-/****************************************************************************************
- * This debug function can be called by any thread running in any cluster. It displays
- * on TXT0 the state of a KCM, identified by the <kcm_cxy> & <kcm_ptr> arguments.
- ****************************************************************************************
- * @ kcm_cxy : remote KCM cluster identifier.
- * @ kcm_ptr : local pointer on remote KCM.
- ***************************************************************************************/
-void kcm_remote_display( cxy_t   kcm_cxy,
-                         kcm_t * kcm_ptr );
-
 #endif	/* _KCM_H_ */
Index: trunk/kernel/mm/khm.c
===================================================================
--- trunk/kernel/mm/khm.c	(revision 690)
+++ trunk/kernel/mm/khm.c	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * khm.c - Kernel Heap Manager implementation.
- *
+ * khm.c - kernel heap manager implementation.
+ * 
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
- *          Alain Greiner (2016,2017,2018)
+ *          Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -23,8 +23,8 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <busylock.h>
+#include <spinlock.h>
 #include <bits.h>
 #include <printk.h>
@@ -39,25 +39,27 @@
 void khm_init( khm_t * khm )
 {
-	// check config parameters
-	assert( __FUNCTION__, ((CONFIG_PPM_PAGE_ORDER + CONFIG_PPM_HEAP_ORDER) < 32 ) ,
-	         "CONFIG_PPM_HEAP_ORDER too large" );
+    // check config parameters
+    if( (CONFIG_PPM_PAGE_SHIFT + CONFIG_PPM_HEAP_ORDER) >= 32 )
+    {
+        printk("\n[PANIC] in %s : CONFIG_PPM_HEAP_ORDER too large\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
 
-	// initialize lock
-	busylock_init( &khm->lock , LOCK_KHM_STATE );
+    // initialize lock
+	spinlock_init( &khm->lock );  
+    
+    //  compute kernel heap size 
+    intptr_t heap_size = (1 << CONFIG_PPM_HEAP_ORDER) << CONFIG_PPM_PAGE_SHIFT;
 
-	// compute kernel heap size
-	intptr_t heap_size = (1 << CONFIG_PPM_HEAP_ORDER) << CONFIG_PPM_PAGE_ORDER;
+    // get kernel heap base from PPM 
+    page_t * page      = ppm_alloc_pages( CONFIG_PPM_HEAP_ORDER );
+    void   * heap_base = ppm_page2base( page );
 
-	// get kernel heap base from PPM
-	page_t * page      = ppm_alloc_pages( CONFIG_PPM_HEAP_ORDER );
-	xptr_t   base_xp   = ppm_page2base( XPTR( local_cxy, page ) );
-	void   * heap_base = GET_PTR( base_xp );
-
-	// initialize first block (complete heap)
+    // initializes first block == complete heap
 	khm_block_t * block = (khm_block_t *)heap_base;
 	block->size = heap_size;
 	block->busy = 0;
 
-	// initialize KHM fields
+    // initializes KHM fields
 	khm->base    = (intptr_t)heap_base;
 	khm->size    = heap_size;
@@ -66,33 +68,33 @@
 
 /////////////////////////////////
-void * khm_alloc( khm_t    * khm,
+void * khm_alloc( khm_t    * khm, 
                   uint32_t   size )
 {
-	khm_block_t  * current;
+	khm_block_t  * current;        
 	khm_block_t  * next;
 	uint32_t       effective_size;
 
-	// compute actual block size
+    // compute actual block size
 	effective_size = size + sizeof(khm_block_t);
 	effective_size = ARROUND_UP( effective_size, CONFIG_CACHE_LINE_SIZE );
 
-	// get lock protecting heap
-	busylock_acquire( &khm->lock );
+    // get lock protecting heap
+	spinlock_lock( &khm->lock );
+  
+    // define a starting block to scan existing blocks 
+    if( ((khm_block_t*)khm->next)->size < effective_size ) current = (khm_block_t*)khm->base;
+    else                                                   current = (khm_block_t*)khm->next;
 
-	// define a starting block to scan existing blocks
-	if( ((khm_block_t*)khm->next)->size < effective_size ) current = (khm_block_t*)khm->base;
-	else                                                   current = (khm_block_t*)khm->next;
-
-	// scan all existing blocks to find a free block large enough
-	while( current->busy || (current->size < effective_size))
+    // scan all existing blocks to find a large enough free block
+	while( current->busy || (current->size < effective_size)) 
 	{
-		// get next block pointer
+        // get next block pointer
 		current = (khm_block_t*)((char*)current + current->size);
-
+    
 		if( (intptr_t)current >= (khm->base + khm->size) )  // heap full
 		{
-			busylock_release(&khm->lock);
+			spinlock_unlock(&khm->lock);
 
-			printk("\n[ERROR] in %s : failed to allocate block of size %d\n",
+			printk("\n[ERROR] in %s : failed to allocate block of size %d\n", 
 			       __FUNCTION__ , effective_size );
 			return NULL;
@@ -100,27 +102,27 @@
 	}
 
-	// split the current block if it is too large
+    // split the current block if current block is too large
 	if( (current->size - effective_size) >= CONFIG_CACHE_LINE_SIZE )
 	{
-		// update new free block features
+        // update new free block features
 		next           = (khm_block_t *)((char*)current + effective_size);
 		next->size     = current->size - effective_size;
 		next->busy     = 0;
 
-		// register new free block
+        // register new free block
 		khm->next = (intptr_t)next;
 
-		// update allocated block features
+        // update allocated block features
 		current->size  = effective_size;
 		current->busy  = 1;
 	}
 	else
-	{
-		// change block state
+    {
+        // change block state
 		current->busy  = 1;
-	}
+    }
 
-	// release lock protecting heap
-	busylock_release( &khm->lock );
+    // release lock protecting heap
+	spinlock_unlock( &khm->lock );
 
 	return (char*)current + sizeof(khm_block_t);
@@ -134,21 +136,19 @@
 	khm_block_t * current;
 	khm_block_t * next;
+  
+	if(ptr == NULL) return;
+  
+	current = (khm_block_t *)((char*)ptr - sizeof(khm_block_t));
+ 
+    // get lock protecting heap
+	spinlock_lock(&khm->lock);
 
-	if(ptr == NULL) return;
-
-	current = (khm_block_t *)((char*)ptr - sizeof(khm_block_t));
-
-	// get lock protecting heap
-	busylock_acquire(&khm->lock);
-
-	assert( __FUNCTION__, (current->busy == 1) , "page already freed" );
-
-	// release block
+    // release block 
 	current->busy = 0;
-
-	// try to merge released block with the next
+  
+    // try to merge released block with the next
 	while ( 1 )
-	{
-		next = (khm_block_t*)((char*)current + current->size);
+	{ 
+        next = (khm_block_t*)((char*)current + current->size);
 		if ( ((intptr_t)next >= (khm->base + khm->size)) || (next->busy == 1) ) break;
 		current->size += next->size;
@@ -156,7 +156,7 @@
 
 	if( (intptr_t)current < khm->next ) khm->next = (intptr_t)current;
-
-	// release lock protecting heap
-	busylock_release( &khm->lock );
+  
+    // release lock protecting heap
+	spinlock_unlock( &khm->lock );
 }
 
Index: trunk/kernel/mm/khm.h
===================================================================
--- trunk/kernel/mm/khm.h	(revision 690)
+++ trunk/kernel/mm/khm.h	(revision 1)
@@ -1,7 +1,8 @@
 /*
- * khm.h - Kernel Heap Manager definition.
- *
+ * khm.h - kernel heap manager used for variable size memory allocation.
+ * 
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
- *          Alain Greiner (2016,2017,2018,2019)
+ *          Mohamed Lamine Karaoui (2015)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,17 +27,17 @@
 #define _HEAP_MANAGER_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <busylock.h>
+#include <almos_config.h>
+#include <hal_types.h>
+#include <spinlock.h>
 
 /*******************************************************************************************
  * This structure defines a Kernel Heap Manager (KHM) in a given cluster.
- * It is used to allocate memory objects, that are too large, or not enough replicated
- * to use a dedicated KCM allocator.
+ * It is used to allocate memory objects, that are not 
+ * enough replicated to justify a dedicated KCM allocator.
  ******************************************************************************************/
 
 typedef struct khm_s
 {
-	busylock_t lock;           /*! lock protecting KHM allocator                          */
+	spinlock_t lock;           /*! lock protecting exclusive access to heap               */
 	intptr_t   base;           /*! heap base address                                      */
 	uint32_t   size;           /*! heap size (bytes)                                      */
@@ -47,5 +48,5 @@
 /*******************************************************************************************
  * This structure defines an allocated block descriptor for the KHM.
- * This block descriptor is stored at the beginning of the allocated block.
+ * This block descriptor is stored at the beginning of the allocated block. 
  * The returned pointer is the allocated memory block base + block descriptor size.
  ******************************************************************************************/
@@ -53,7 +54,7 @@
 typedef struct khm_block_s
 {
-	uint32_t   busy;           /*! free block if zero                                     */
-	uint32_t   size;           /*! block size                                             */
-}
+	uint32_t   busy:1;         /*! free block if zero                                     */
+	uint32_t   size:31;        /*! size coded on 31 bits                                  */
+} 
 khm_block_t;
 
@@ -61,5 +62,5 @@
 /*******************************************************************************************
  * This function initializes a KHM heap manager in a given cluster.
- * It is used to allocate variable size memory objects, that are not
+ * It is used to allocate variable size memory objects, that are not 
  * enough replicated to justify a dedicated KCM allocator.
  *******************************************************************************************
@@ -71,5 +72,5 @@
 
 /*******************************************************************************************
- * This function allocates a memory block from the local KHM.
+ * This function allocates a memory block from the local KHM. 
  * The actual size of the allocated block is the requested size, plus the block descriptor
  * size, rounded to a cache line size.
Index: trunk/kernel/mm/kmem.c
===================================================================
--- trunk/kernel/mm/kmem.c	(revision 690)
+++ trunk/kernel/mm/kmem.c	(revision 1)
@@ -2,5 +2,7 @@
  * kmem.c - kernel memory allocator implementation.
  *
- * Authors  Alain Greiner     (2016,2017,2018,2019,2020)
+ * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *          Mohamed Lamine Karaoui (2015)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,191 +24,207 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <printk.h>
+#include <spinlock.h>
+#include <readlock.h>
+#include <memcpy.h>
+#include <khm.h>
+#include <ppm.h>
+#include <page.h>
 #include <cluster.h>
 #include <thread.h>
-#include <memcpy.h>
-#include <ppm.h>
-#include <kcm.h>
-#include <page.h>
+#include <process.h>
+#include <device.h>
+#include <mapper.h>
+#include <vfs.h>
+#include <fatfs.h>
+#include <ramfs.h>
+#include <remote_sem.h>
+#include <remote_barrier.h>
+#include <mapper.h>
+#include <grdxt.h>
+#include <vseg.h>
 #include <kmem.h>
 
-///////////////////////////////////
-void * kmem_alloc( uint32_t  order,
-                   uint32_t  flags )
-{
-
-#if DEBUG_KMEM || DEBUG_KMEM_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-	if( order >= CONFIG_PPM_PAGE_ORDER )     // use PPM
+/////////////////////////////////////////////////////////////////////////////////////////////
+// This global array is indexed by the Kernel Memory Object Type (defined in kmem.h)
+// It contains the size of fixed size objects type dynamically allocated by the KCMs.
+// This array should be consistent with the enum defined kmem.h.
+/////////////////////////////////////////////////////////////////////////////////////////////
+
+uint32_t  kmem_size_tbl[KMEM_TYPES_NR] =
+{
+    0,                        // 0  KMEM_PAGE is not a fixed size object
+    0,                        // 1  KMEM_GENERIC   
+    sizeof( kcm_t ),          // 2  KMEM_KCM
+    sizeof( vseg_t ),         // 3  KMEM_VSEG
+    sizeof( device_t ),       // 4  KMEM_DEVICE
+    sizeof( mapper_t ),       // 5  KMEM_MAPPER
+    sizeof( process_t ),      // 6  KMEM_PROCESS
+    0,                        // 7 
+    0,                        // 8  
+    0,                        // 9  
+
+    sizeof( fatfs_inode_t ),  // 10 KMEM_FATFS_INODE
+    sizeof( fatfs_ctx_t ),    // 11 KMEM_FATFS_CTX
+    sizeof( ramfs_inode_t ),  // 12 KMEM_RAMFS_INODE
+    sizeof( ramfs_ctx_t ),    // 13 KMEM_RAMFS_CTX
+    sizeof( vfs_ctx_t ),      // 14 KMEM_VFS_CTX
+    sizeof( vfs_inode_t ),    // 15 KMEM_VFS_INODE
+    sizeof( vfs_dentry_t ),   // 16 KMEM_VFS_DENTRY
+    sizeof( vfs_file_t ),     // 17 KMEM_VFS_FILE
+    sizeof( remote_sem_t ),   // 18 KMEM_SEM
+    0,                        // 19 
+
+    64,                       // 20 KMEM_64_BYTES
+    128,                      // 21 KMEM_128_BYTES
+    256,                      // 22 KMEM_256_BYTES
+    512,                      // 23 KMEM_512_BYTES
+    1024,                     // 24 KMEM_1024_BYTES
+    2048,                     // 25 KMEM_2048_BYTES
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////////
+// This static function dynamically allocates and initializes a specific KCM allocator.
+// It uses the KCM allocator embedded in cluster manager, initialized by cluster_init().
+/////////////////////////////////////////////////////////////////////////////////////////////
+static error_t kmem_get_kcm( uint32_t type )
+{
+	kcm_t    * kcm;
+	error_t    error;
+
+    // check kmem object type
+    if( (type < 2) || (type >= KMEM_TYPES_NR) )
+    {
+        printk("\n[PANIC] in %s illegal request type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    cluster_t * cluster = LOCAL_CLUSTER;
+
+    // allocates memory for the requested KCM allocator
+	kcm = kcm_alloc( &cluster->kcm );
+	if( kcm == NULL )
+    {
+		printk("\n[ERROR] in %s : failed to create KCM type %d in cluster %x\n",
+               __FUNCTION__ , type , local_cxy );
+        return ENOMEM;
+    }
+
+    // initializes the new KCM allocator 
+	error = kcm_init( kcm , type );
+
+	if( error )
 	{
-		// allocate memory from PPM
-		page_t * page = (void *)ppm_alloc_pages( order - CONFIG_PPM_PAGE_ORDER );
-
-		if( page == NULL )
-		{
-
-#if DEBUG_KMEM_ERROR
-if (DEBUG_KMEM_ERROR < cycle)
-printk("\n[ERROR] in %s : thread[%x,%x] failed for PPM / order %d / cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , order , local_cxy , cycle );
-#endif
-			return NULL;
-		}
-
-		// reset page if requested
-		if( flags & AF_ZERO ) page_zero( page );
-
-        // get pointer on buffer from the page descriptor
-        xptr_t page_xp = XPTR( local_cxy , page );
-        void * ptr     = GET_PTR( ppm_page2base( page_xp ) );
-
-#if DEBUG_KMEM
-if( (DEBUG_KMEM < cycle) && (DEBUG_KMEM_CXY == local_cxy) && (DEBUG_KMEM_ORDER == order) )
-printk("\n[%s] thread[%x,%x] from PPM / order %d / ppn %x / cxy %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-order, ppm_page2ppn(XPTR(local_cxy,ptr)), local_cxy, cycle );
-#endif
-        return ptr;
-	}
-	else                                     // use KCM 
+		printk("\n[ERROR] in %s : failed to init KCM type %d\n",
+               __FUNCTION__ , type , local_cxy );
+		return error;
+	}
+
+	cluster->kcm_tbl[type] = kcm;
+	hal_wbflush();
+
+	return 0;
+}
+ 
+
+/////////////////////////////////////
+void * kmem_alloc( kmem_req_t * req )
+{
+	cluster_t * cluster = LOCAL_CLUSTER;
+
+	uint32_t    type;
+	uint32_t    size;    // ln( pages ) if PPM / bytes if KHM or BKM / unused if KCM
+	uint32_t    flags;
+	void      * ptr;     // local pointer on allocated memory buffer
+
+	type  = req->type;
+	size  = req->size;
+	flags = req->flags;
+  
+	kmem_dmsg("\n[INFO] %s in cluster %x : type %d, size %d, flags %x at cycle %d \n",
+		      __FUNCTION__, local_cxy , type, size, flags , hal_time_stamp() );
+
+	if( type >= KMEM_TYPES_NR )
+    {
+        printk("\n[PANIC] in %s illegal request type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+  
+    // analyse request type
+	if( type ==  KMEM_PAGE )                       // PPM allocator
+    {        
+        // allocate the number of requested pages
+		ptr = (void*)ppm_alloc_pages( size );
+
+        // reset page if required
+		if( flags & AF_ZERO ) page_zero( (page_t*)ptr );
+	}
+    else if( type == KMEM_GENERIC )                // KHM allocator
+    {
+        // allocate memory from KHM
+		ptr = khm_alloc( &cluster->khm , size );
+
+        // reset memory if requested
+		if( flags & AF_ZERO ) memset( ptr , 0 , size );
+	}
+    else                                           // KCM allocator
+    {
+        uint32_t error = 0;
+
+        // initialize the KCM allocator if not already done
+	    if( cluster->kcm_tbl[type] == NULL )
+	    { 
+            spinlock_lock( &cluster->kcm_lock );
+			error = kmem_get_kcm( type );
+            spinlock_unlock( &cluster->kcm_lock );
+	    }
+
+        // allocate memory from KCM if success
+        if( error ) ptr = NULL;
+        else        ptr = kcm_alloc( cluster->kcm_tbl[type] );
+	}
+
+    if( ptr == NULL )
+    {
+	    printk("\n[ERROR] in %s : failed for type %d, size %d, flags %x in cluster %x\n", 
+	       __FUNCTION__ , type , size , flags , local_cxy );
+ 
+	    return NULL;
+    }
+
+	kmem_dmsg("\n[INFO] %s got ptr = %x in cluster %x at cycle %d\n",
+		  __FUNCTION__, (intptr_t)ptr , local_cxy , hal_time_stamp() );
+	    
+	return ptr;
+
+} // end kmem_alloc()
+
+//////////////////////////////////
+void kmem_free( kmem_req_t * req )
+{
+	if( req->type >= KMEM_TYPES_NR )
+    {
+        printk("\n[PANIC] in %s : illegal request type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+  
+	switch(req->type)
 	{
-		// allocate memory from KCM
-		void * ptr = kcm_alloc( order );
-
-		if( ptr == NULL )
-		{
-
-#if DEBUG_KMEM_ERROR
-if (DEBUG_KMEM_ERROR < cycle)
-printk("\n[ERROR] in %s : thread[%x,%x] failed for KCM / order %d / cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , order , local_cxy , cycle );
-#endif
-			return NULL;
-		}
-
-		// reset memory if requested
-		if( flags & AF_ZERO ) memset( ptr , 0 , 1<<order );
-
-#if DEBUG_KMEM
-if( (DEBUG_KMEM < cycle) && (DEBUG_KMEM_CXY == local_cxy) && (DEBUG_KMEM_ORDER == order) )
-printk("\n[%s] thread [%x,%x] from KCM / order %d / base %x / cxy %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-order, ptr, local_cxy, cycle ); 
-#endif
-        return ptr;
-	}
-}  // end kmem_alloc()
-
-//////////////////////////////
-void kmem_free( void    * ptr,
-                uint32_t  order )
-{
-	if( order >= CONFIG_PPM_PAGE_ORDER )     // use PPM
-	{
-        page_t * page = GET_PTR( ppm_base2page( XPTR( local_cxy , ptr ) ) );
-
-        ppm_free_pages( page );
-    }
-	else                                     // use KCM 
-    {
-        kcm_free( ptr , order );
-	}
-}  // end kmem_free()
-
-
-
-////////////////////////////////////////
-void * kmem_remote_alloc( cxy_t     cxy,
-                          uint32_t  order,
-                          uint32_t  flags )
-{
-
-#if DEBUG_KMEM || DEBUG_KMEM_ERROR
-thread_t * this = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-	if( order >= CONFIG_PPM_PAGE_ORDER )     // use PPM
-	{
-		// allocate memory from PPM
-		xptr_t page_xp = ppm_remote_alloc_pages( cxy , order - CONFIG_PPM_PAGE_ORDER );
-
-		if( page_xp == XPTR_NULL )
-		{
-
-#if DEBUG_KMEM_ERROR
-if( DEBUG_KMEM_ERROR < cycle )
-printk("\n[ERROR] in %s : thread[%x,%x] failed for PPM / order %d / cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , order , cxy , cycle );
-#endif
-			return NULL;
-		}
-
-        // get extended pointer on remote buffer
-        xptr_t base_xp = ppm_page2base( page_xp );
-
-		// reset memory if requested
-		if( flags & AF_ZERO ) hal_remote_memset( base_xp , 0 , 1<<order );
-
-#if DEBUG_KMEM
-if( (DEBUG_KMEM < cycle) && (DEBUG_KMEM_CXY == local_cxy) && (DEBUG_KMEM_ORDER == order) )
-printk("\n[%s] thread[%x,%x] from PPM / order %d / ppn %x / cxy %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-order, ppm_page2ppn( page_xp ), cxy, cycle );
-#endif
-        return GET_PTR( base_xp );
-	}
-	else                                     // use KCM 
-	{
-		// allocate memory from KCM
-		void * ptr = kcm_remote_alloc( cxy , order );
-
-		if( ptr == NULL )
-		{
-
-#if DEBUG_KMEM_ERROR
-if( DEBUG_KMEM_ERROR < cycle )
-printk("\n[ERROR] in %s : thread[%x,%x] failed for KCM / order %d / cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid , this->trdid , order , cxy , cycle );
-#endif
-			return NULL;
-		}
-
-		// reset memory if requested
-		if( flags & AF_ZERO )  hal_remote_memset( XPTR( cxy , ptr ) , 0 , 1<<order );
-
-#if DEBUG_KMEM
-if( (DEBUG_KMEM < cycle) && (DEBUG_KMEM_CXY == local_cxy) && (DEBUG_KMEM_ORDER == order) )
-printk("\n[%s] thread [%x,%x] from KCM / order %d / base %x / cxy %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-order, ptr, cxy, cycle );
-#endif
-        return ptr;
-	}
-}  // kmem_remote_malloc()
-
-/////////////////////////////////////
-void kmem_remote_free( cxy_t     cxy,
-                       void    * ptr,
-                       uint32_t  order )
-{
-	if( order >= CONFIG_PPM_PAGE_ORDER )     // use PPM
-	{
-        page_t * page = GET_PTR( ppm_base2page( XPTR( cxy , ptr ) ) );
-
-        ppm_remote_free_pages( cxy , page );
-    }
-	else                                     // use KCM 
-    {
-        kcm_remote_free( cxy , ptr , order );
-	}
-}  // end kmem_remote_free()
-
-
-
+	    case KMEM_PAGE:
+		ppm_free_pages( (page_t*)req->ptr );
+		return;
+
+	    case KMEM_GENERIC:
+	    khm_free( req->ptr );
+		return;
+
+	    default:
+		kcm_free( req->ptr );
+		return;
+	}
+}
+
+
Index: trunk/kernel/mm/kmem.h
===================================================================
--- trunk/kernel/mm/kmem.h	(revision 690)
+++ trunk/kernel/mm/kmem.h	(revision 1)
@@ -1,6 +1,8 @@
 /*
- * kmem.h - unified kernel memory allocator definition
+ * kmem.h - kernel unified memory allocator interface
  *
- * Authors  Alain Greiner     (2016,2017,2018,2019,2020)
+ * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *          Mohamed Lamine Karaoui (2015)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,60 +27,90 @@
 #define _KMEM_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <kcm.h>
 
 /*************************************************************************************
- * This defines the generic Allocation Flags that can be associated to
+ * This enum defines the Kernel Memory Types for dynamically allocated objects.
+ ************************************************************************************/
+
+enum
+{
+  KMEM_PAGE             = 0,   /*! reserved for PPM allocator                       */
+  KMEM_GENERIC          = 1,   /*! reserved for KHM allocator                       */
+  KMEM_KCM              = 2,   /*! kcm_t                                            */
+  KMEM_VSEG             = 3,   /*! vseg_t                                           */
+  KMEM_DEVICE           = 4,   /*! device_t                                         */
+  KMEM_MAPPER           = 5,   /*! mapper_t                                         */
+  KMEM_PROCESS          = 6,   /*! process_t                                        */
+  KMEM_TBD_7            = 7,
+  KMEM_TBD_8            = 8,
+  KMEM_TBD_9            = 9,
+
+  KMEM_FATFS_INODE      = 10,  /*! fatfs_inode_t                                    */
+  KMEM_FATFS_CTX        = 11,  /*! fatfs_ctx_t                                      */
+  KMEM_RAMFS_INODE      = 12,  /*  ramfs_inode_t                                    */
+  KMEM_RAMFS_CTX        = 13,  /*! ramfs_ctx_t                                      */
+  KMEM_VFS_CTX          = 14,  /*! vfs_context_t                                    */
+  KMEM_VFS_INODE        = 15,  /*! vfs_inode_t                                      */
+  KMEM_VFS_DENTRY       = 16,  /*! vfs_dentry_t                                     */
+  KMEM_VFS_FILE         = 17,  /*! vfs_file_t                                       */
+  KMEM_SEM              = 18,  /*! remote_sem_t                                     */
+  KMEM_TBD_19           = 19,
+
+  KMEM_64_BYTES         = 20,  /*! fixed size buffer                                */
+  KMEM_128_BYTES        = 21,  /*! fixed size buffer                                */
+  KMEM_256_BYTES        = 22,  /*! fixed size buffer                                */
+  KMEM_512_BYTES        = 23,  /*! fixed size buffer                                */
+  KMEM_1024_BYTES       = 24,  /*! fixed size buffer                                */
+  KMEM_2048_BYTES       = 25,  /*! fixed size buffer                                */
+
+  KMEM_TYPES_NR         = 26,
+};
+
+/*************************************************************************************
+ * This defines the generic Allocation Flags that can be associated to 
  * a Kernel Memory Request.
  ************************************************************************************/
 
 #define AF_NONE       0x0000   // no attributes
-#define AF_KERNEL     0x0001   // for kernel use ???
-#define AF_ZERO       0x0002   // data buffer must be reset to 0
+#define AF_KERNEL     0x0001   // for kernel use    
+#define AF_ZERO       0x0002   // must be reset to 0
 
 /*************************************************************************************
- * These two functions allocate physical memory in a local or remote cluster
- * as specified by the <cxy>, <order> and <flags> arguments, and return a local
- * pointer on the allocated buffer. The buffer size (in bytes) is a power of 2,
- * equal to (1 << order) bytes. It can be initialized to zero if requested.
- * Depending on the <order> value, it uses two specialised allocators:
- * - When order is larger or equal to CONFIG_PPM_PAGE_ORDER, the PPM (Physical Pages
- *   Manager) allocates 2**(order - PPM_PAGE_ORDER) contiguous small physical pages.
- *   This allocator implements the buddy algorithm.
- * - When order is smaller than CONFIG_PPM_PAGE_ORDER, the KCM (Kernel Cache Manager) 
- *   allocates an aligned block of 2**order bytes from specialised KCM[ORDER] caches
- *  (one KCM cache per block size).  
- *************************************************************************************
- * @ cxy    : [in] target cluster identifier for a remote access).
- * @ order  : [in] ln( block size in bytes).
- * @ flags  : [in] allocation flags defined above.
- * @ return local pointer on allocated buffer if success / return NULL if no memory.
+ * This structure defines a Kernel Memory Request. 
  ************************************************************************************/
-void * kmem_alloc( uint32_t  order,
-                   uint32_t  flags );
 
-void * kmem_remote_alloc( cxy_t     cxy,
-                          uint32_t  order,
-                          uint32_t  flags );
+typedef struct kmem_req_s
+{
+    uint32_t      type;   /*! request type                                          */
+    uint32_t      size;   /*! ln2(nb_pages) if PPM / bytes if KHM / unused by KCM   */
+    uint32_t      flags;  /*! request attributes                                    */
+    void        * ptr;    /*! local pointer on allocated buffer (only used by free) */
+} 
+kmem_req_t;
 
 /*************************************************************************************
- * These two functions release a previously allocated physical memory block,
- * as specified by the <cxy>, <order> and <ptr> arguments. 
- * - When order is larger or equal to CONFIG_PPM_PAGE_ORDER, the PPM (Physical Pages
- *   Manager) releases 2**(order - PPM_PAGE_ORDER) contiguous small physical pages.
- *   This allocator implements the buddy algorithm.
- * - When order is smaller than CONFIG_PPM_PAGE_ORDER, the KCM (Kernel Cache Manager)
- *   release release the block of 2**order bytes to the specialised KCM[order] cache.
+ * This generic function allocates physical memory in the local cluster
+ * as specified by the request descriptor.
+ * It uses three specialised physical memory allocators:
+ * - PPM (Physical Pages Manager) allocates N contiguous physical pages,
+ *       N must be a power of 2.
+ * - KHM (Kernel Heap Manager) allocates a physical memory buffer,
+ *       that can have any size.
+ * - KCM (Kernel Cache Manager) allocates various fixed size objects,
+ *       handling a dedicated cache for each object type.
  *************************************************************************************
- * @ cxy    : [in] target cluster identifier for a remote access.
- * @ ptr    : [in] local pointer to released block.
- * @ order  : [in] ln( block size in bytes ).
+ * @ req : local pointer to allocation request
+ * @ return a local pointer to allocated buffer / NULL otherwise
  ************************************************************************************/
-void  kmem_free( void    * ptr,
-                 uint32_t  order );
+void * kmem_alloc( kmem_req_t * req );
 
-void  kmem_remote_free( cxy_t     cxy,
-                        void    * ptr,
-                        uint32_t  order );
+/*************************************************************************************
+ * This function releases previously allocated physical memory, as specified
+ * by the "type" and "ptr" fiels of the kmem-req_t request.
+ *************************************************************************************
+ * @ req : local pointer to request descriptor.
+ ************************************************************************************/
+void  kmem_free ( kmem_req_t * req );
 
 
Index: trunk/kernel/mm/mapper.c
===================================================================
--- trunk/kernel/mm/mapper.c	(revision 690)
+++ trunk/kernel/mm/mapper.c	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * mapper.c - Kernel cache for FS files or directories implementation.
+ * mapper.c - Map memory, file or device in process virtual address space.
  *
  * Authors   Mohamed Lamine Karaoui (2015)
- *           Alain Greiner          (2016,2017,2018,2019,2020)
+ *           Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -23,14 +23,10 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
 #include <grdxt.h>
-#include <string.h>
 #include <rwlock.h>
 #include <printk.h>
-#include <memcpy.h>
 #include <thread.h>
 #include <core.h>
@@ -38,91 +34,81 @@
 #include <kmem.h>
 #include <kcm.h>
-#include <ppm.h>
 #include <page.h>
 #include <cluster.h>
 #include <vfs.h>
 #include <mapper.h>
-#include <dev_ioc.h>
-
-
-/////////////////////////////////////
-xptr_t  mapper_create( cxy_t     cxy,
-                       uint32_t  type )
-{
-    mapper_t * mapper_ptr;
+
+//////////////////////////
+mapper_t * mapper_create()
+{
+    mapper_t * mapper;
+    kmem_req_t req;
     error_t    error;
 
-    // allocate memory for mapper descriptor
-    mapper_ptr  = kmem_remote_alloc( cxy , bits_log2(sizeof(mapper_t)) , AF_ZERO );
-
-    if( mapper_ptr == NULL )
-    {
-
-#if DEBUG_MAPPER_ERROR 
-printk("\n[ERROR] in %s : no memory for mapper descriptor\n", __FUNCTION__ );
-#endif
-        return XPTR_NULL;
-    }
-
-    // initialize refcount and type
-    hal_remote_s32( XPTR( cxy , &mapper_ptr->refcount ) , 0 );
-    hal_remote_s32( XPTR( cxy , &mapper_ptr->fs_type )  , type );
+    // allocate memory for associated mapper
+	req.type  = KMEM_MAPPER;
+	req.size  = sizeof(mapper_t);
+    req.flags = AF_KERNEL | AF_ZERO;
+	mapper    = (mapper_t *)kmem_alloc( &req );
+
+    if( mapper == NULL )
+    {
+        printk("\n[ERROR] in %s : no memory for mapper descriptor\n", __FUNCTION__ );
+        return NULL;
+    }
+
+    // initialize refcount & inode
+	mapper->refcount = 0;
+    mapper->inode    = NULL;
 
     // initialize radix tree
-    error = grdxt_remote_init( XPTR( cxy , &mapper_ptr->rt ),
-                               CONFIG_MAPPER_GRDXT_W1,
-                               CONFIG_MAPPER_GRDXT_W2,
-                               CONFIG_MAPPER_GRDXT_W3 );
+	error = grdxt_init( &mapper->radix,
+                        CONFIG_VMM_GRDXT_W1,
+                        CONFIG_VMM_GRDXT_W2,
+                        CONFIG_VMM_GRDXT_W3 );
+
     if( error )
     {
-
-#if DEBUG_MAPPER_ERROR 
-printk("\n[ERROR] in %s : cannot initialize radix tree\n", __FUNCTION__ );
-kmem_remote_free( cxy , mapper_ptr , bits_log2(sizeof(mapper_t)) );
-#endif
-        return XPTR_NULL;
+        printk("\n[ERROR] in %s : cannot initialize radix tree\n", __FUNCTION__ );
+	    req.type  = KMEM_MAPPER;
+        req.ptr   = mapper;
+        kmem_free( &req );
+        return NULL;
     }
 
     // initialize mapper lock
-    remote_rwlock_init( XPTR( cxy , &mapper_ptr->lock ) , LOCK_MAPPER_STATE );
+	rwlock_init(  &mapper->lock );
 
     // initialize waiting threads xlist (empty)
-    xlist_root_init( XPTR( cxy , &mapper_ptr->wait_root ) );
+	xlist_root_init( XPTR( local_cxy , &mapper->wait_root ) );
 
     // initialize vsegs xlist (empty)
-    xlist_root_init( XPTR( cxy , &mapper_ptr->vsegs_root ) );
-
-    return XPTR( cxy , mapper_ptr );
-
-}  // end mapper_create()
-
-////////////////////////////////////////
-void mapper_destroy( xptr_t  mapper_xp )
-{
-    xptr_t     page_xp;
+	xlist_root_init( XPTR( local_cxy , &mapper->vsegs_root ) );
+
+    return mapper;
+
+} // end mapper_create()
+
+///////////////////////////////////////////
+error_t mapper_destroy( mapper_t * mapper )
+{
     page_t   * page;
     uint32_t   found_index = 0;
     uint32_t   start_index = 0;
-
-    cxy_t      mapper_cxy = GET_CXY( mapper_xp ); 
-    mapper_t * mapper_ptr = GET_PTR( mapper_xp );
-
-    // build extended pointer on radix tree
-    xptr_t rt_xp = XPTR( mapper_cxy , &mapper_ptr->rt );
-
-    // scan radix tree
+    kmem_req_t req;
+    error_t    error;
+
+    // scan radix three and release all registered pages to PPM
     do
     {
         // get page from radix tree
-        page_xp = grdxt_remote_get_first( rt_xp,
-                                          start_index , 
-                                          &found_index );
-        page = GET_PTR( page_xp );
-        
-        // release registered pages to PPM
-        if( page != NULL )
+        page = (page_t *)grdxt_get_first( &mapper->radix , start_index , &found_index );
+
+        if( page != NULL ) 
         {
             // remove page from mapper and release to PPM
-            mapper_remote_release_page( mapper_xp , page );
+	        error = mapper_release_page( mapper , found_index , page );
+
+            if ( error ) return error;
 
             // update start_key value for next page
@@ -132,830 +118,476 @@
     while( page != NULL );
 
-    // release the memory allocated to radix tree itself
-    grdxt_remote_destroy( rt_xp );
+    // release the memory allocated to radix-tree itself
+    grdxt_destroy( &mapper->radix );
 
     // release memory for mapper descriptor
-    kmem_remote_free( mapper_cxy , mapper_ptr , bits_log2(sizeof(mapper_t)) );
-
+    req.type = KMEM_MAPPER;
+    req.ptr  = mapper;
+    kmem_free( &req );
+
+    return 0;
+ 
 }  // end mapper_destroy()
 
-/////////////////////////////////////////////////
-error_t mapper_handle_miss( xptr_t     mapper_xp,
-                            uint32_t   page_id,
-                            xptr_t   * page_xp_ptr )
-{
-    error_t    error;
-
-    uint32_t   inode_size = 0;    
-    uint32_t   inode_type = 0;
-
-#if DEBUG_MAPPER_HANDLE_MISS || DEBUG_MAPPER_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // get target mapper cluster and local pointer
-    cxy_t         mapper_cxy = GET_CXY( mapper_xp );
-    mapper_t    * mapper_ptr = GET_PTR( mapper_xp );
-
-    // get inode pointer
-    vfs_inode_t * inode = hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) );
-
-    // get inode size and type if relevant
-    if( inode != NULL )
-    {
-        inode_size = hal_remote_l32( XPTR( mapper_cxy , &inode->size ) );
-        inode_type = hal_remote_l32( XPTR( mapper_cxy , &inode->type ) );
-    }
-
-#if DEBUG_MAPPER_HANDLE_MISS
-char          name[CONFIG_VFS_MAX_NAME_LENGTH];
-if( (DEBUG_MAPPER_HANDLE_MISS < cycle) && (inode != NULL) )
-{
-    vfs_inode_get_name( XPTR( mapper_cxy , inode ) , name );
-    printk("\n[%s] thread[%x,%x] enter for page %d in <%s> / cxy %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, page_id, name, mapper_cxy, cycle );
-}
-if( (DEBUG_MAPPER_HANDLE_MISS < cycle) && (inode == NULL) )
-{
-    printk("\n[%s] thread[%x,%x] enter for page %d in FAT / cxy %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, page_id, mapper_cxy, cycle );
-}
-#endif
-
-#if( DEBUG_MAPPER_HANDLE_MISS & 1 ) 
-if( DEBUG_MAPPER_HANDLE_MISS < cycle ) 
-{
-    if (inode != NULL) grdxt_remote_display( XPTR( mapper_cxy , &mapper_ptr->rt ) , name );
-    else               grdxt_remote_display( XPTR( mapper_cxy , &mapper_ptr->rt ) , "FAT" );
-}
-#endif
-
-    // allocate one 4 Kbytes page in the remote mapper cluster
-    void * base_ptr = kmem_remote_alloc( mapper_cxy , 12 , AF_NONE );
-
-    if( base_ptr == NULL )
-    {
-
-#if DEBUG_MAPPER_ERROR
-printk("\n[ERROR] in %s : thread [%x,%x] cannot allocate page in cluster %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid , mapper_cxy , cycle );
-#endif
-        return -1;
-    }
-
-    // get pointers on allocated page descrptor
-    xptr_t   page_xp  = ppm_base2page( XPTR( mapper_cxy , base_ptr ) );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    // initialize the page descriptor 
-    page_remote_init( page_xp );
-
-    // initialize specific page descriptor fields
-    hal_remote_s32( XPTR( mapper_cxy , &page_ptr->refcount ) , 1          );
-    hal_remote_s32( XPTR( mapper_cxy , &page_ptr->index )    , page_id    );
-    hal_remote_spt( XPTR( mapper_cxy , &page_ptr->mapper )   , mapper_ptr );
-    hal_remote_s32( XPTR( mapper_cxy , &page_ptr->flags )    , PG_INIT    );
-
-    // insert page in mapper radix tree 
-    error = grdxt_remote_insert( XPTR( mapper_cxy , &mapper_ptr->rt),
-                                 page_id,
-                                 page_ptr );
-    if( error )
-    {
-
-#if DEBUG_MAPPER_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot insert page in mapper / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid , cycle );
-ppm_remote_free_pages( mapper_cxy , page_ptr );
-#endif
-        return -1;
-    }
-
-    // launch I/O operation to load page from IOC device when required:
-    // - it is the FAT mapper
-    // - it is a directory mapper
-    // - it is a file mapper, and it exist data on IOC device for this page
-    if( (inode == NULL) || (inode_type == FILE_TYPE_DIR) || (inode_size > (page_id << 10) ) )
-    {
-        error = vfs_fs_move_page( page_xp , IOC_SYNC_READ );
-
-        if( error )
-        {
-
-#if DEBUG_MAPPER_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot load page from device / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid , cycle );
-mapper_remote_release_page( mapper_xp , page_ptr );
-#endif
-            return -1;
-         }
-    }
-
-    // return extended pointer on allocated page
-    *page_xp_ptr = page_xp;
-
-#if DEBUG_MAPPER_HANDLE_MISS
-ppn_t ppn = ppm_page2ppn( page_xp );
-if( (DEBUG_MAPPER_HANDLE_MISS < cycle) && (inode != NULL) )
-{
-    printk("\n[%s] thread[%x,%x] exit for page %d in <%s> / page %x / ppn %x\n",
-    __FUNCTION__, this->process->pid, this->trdid, page_id, name, page_ptr, ppn );
-}
-if( (DEBUG_MAPPER_HANDLE_MISS < cycle) && (inode == NULL) )
-{
-    printk("\n[%s] thread[%x,%x] exit for page %d in FAT / page %x / ppn %x\n",
-    __FUNCTION__, this->process->pid, this->trdid, page_id, page_ptr, ppn );
-}
-#endif
-
-#if( DEBUG_MAPPER_HANDLE_MISS & 1 ) 
-if( DEBUG_MAPPER_HANDLE_MISS < cycle ) 
-{
-    if (inode != NULL) grdxt_remote_display( XPTR( mapper_cxy , &mapper_ptr->rt ) , name );
-    else               grdxt_remote_display( XPTR( mapper_cxy , &mapper_ptr->rt ) , "FAT" );
-}
-#endif
-
-    return 0;
-
-}  // end mapper_handle_miss()
-
-/////////////////////////////////////////////
-xptr_t  mapper_get_page( xptr_t    mapper_xp,
-                         uint32_t  page_id )
-{
-    error_t       error;
+
+////////////////////////////////////////////
+page_t * mapper_get_page( mapper_t * mapper,
+                          uint32_t   index )
+{
+	kmem_req_t    req;
+	page_t      * page;
+	error_t       error;
 
     thread_t * this = CURRENT_THREAD;
 
-    // get mapper cluster and local pointer
-    mapper_t * mapper_ptr = GET_PTR( mapper_xp );
-    cxy_t      mapper_cxy = GET_CXY( mapper_xp );
-
-assert( __FUNCTION__, (hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) ) != NULL ),
-"should not be used for the FAT mapper");
-
-#if DEBUG_MAPPER_GET_PAGE
-uint32_t      cycle = (uint32_t)hal_get_cycles();
-char          name[CONFIG_VFS_MAX_NAME_LENGTH];
-if( DEBUG_MAPPER_GET_PAGE < cycle )  
-{
-    vfs_inode_t * inode = hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) );
-    vfs_inode_get_name( XPTR( mapper_cxy , inode ) , name );
-    printk("\n[%s] thread[%x,%x] enter for page %d of <%s> mapper / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, page_id, name, cycle );
-}
-#endif
-
-#if( DEBUG_MAPPER_GET_PAGE & 1 )
-if( DEBUG_MAPPER_GET_PAGE < cycle ) 
-ppm_remote_display( local_cxy );
-#endif
-
-    // check thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // build extended pointer on mapper lock and mapper rt
-    xptr_t lock_xp  = XPTR( mapper_cxy , &mapper_ptr->lock );
-    xptr_t rt_xp    = XPTR( mapper_cxy , &mapper_ptr->rt );
-
     // take mapper lock in READ_MODE
-    remote_rwlock_rd_acquire( lock_xp );
+    rwlock_rd_lock( &mapper->lock );
 
     // search page in radix tree
-    xptr_t page_xp  = grdxt_remote_lookup( rt_xp , page_id );
-
-    // test mapper miss 
-    if( page_xp == XPTR_NULL )                  // miss => handle it
+    page = (page_t *)grdxt_lookup( &mapper->radix , index );
+
+    // test if page available in mapper 
+    if( ( page == NULL) || page_is_flag( page , PG_INLOAD ) )  // page not available            /
     {
         // release the lock in READ_MODE and take it in WRITE_MODE
-        remote_rwlock_rd_release( lock_xp );
-        remote_rwlock_wr_acquire( lock_xp );
-
-        // second test on missing page because the page status can be modified
+        rwlock_rd_unlock( &mapper->lock );
+        rwlock_wr_lock( &mapper->lock );
+
+        // second test on missing page because the page status can have been modified
         // by another thread, when passing from READ_MODE to WRITE_MODE.
         // from this point there is no concurrent accesses to mapper.
-        page_xp = grdxt_remote_lookup( rt_xp , page_id );
-
-        if ( page_xp == XPTR_NULL )  // miss confirmed => handle it
-        {
-            error = mapper_handle_miss( mapper_xp,
-                                        page_id,
-                                        &page_xp );
+
+        page = grdxt_lookup( &mapper->radix , index );
+
+        if ( page == NULL )   // missing page => load it from file system
+        {
+            // allocate one page from PPM
+            req.type  = KMEM_PAGE;
+            req.size  = 0;
+            req.flags = AF_NONE;
+            page = kmem_alloc( &req );
+      
+            if( page == NULL )
+            {
+                printk("\n[ERROR] in %s : thread %x cannot allocate a page in cluster %x\n",
+                       __FUNCTION__ , this->trdid , local_cxy );
+                rwlock_wr_unlock( &mapper->lock );
+                return NULL;
+            }
+
+            // initialize the page descriptor
+            page_init( page );
+            page_set_flag( page , PG_INIT );
+            page_set_flag( page , PG_INLOAD );
+            page_refcount_up( page );
+            page->mapper = mapper;
+            page->index  = index;
+
+            // insert page in mapper radix tree
+            error = grdxt_insert( &mapper->radix, index , page );
+
+            // release mapper lock from WRITE_MODE
+            rwlock_wr_unlock( &mapper->lock );
+
+            if( error ) 
+            {
+                printk("\n[ERROR] in %s : thread %x cannot insert page in mapper\n",
+                       __FUNCTION__ , this->trdid );
+                mapper_release_page( mapper , index , page );
+                page_clear_flag( page , PG_ALL );
+                req.ptr  = page;
+                req.type = KMEM_PAGE;
+                kmem_free(&req);
+                return NULL;
+            }
+        
+            // launch I/O operation to load page from file system
+            error = mapper_updt_page( mapper , index , page );
+
             if( error )
             {
-
-#if DEBUG_MAPPER_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot handle mapper miss\n",
-__FUNCTION__ , this->process->pid, this->trdid );
-remote_rwlock_wr_release( lock_xp );
-#endif
-                return XPTR_NULL;
+                printk("\n[ERROR] in %s : thread %x cannot load page from device\n",
+                       __FUNCTION__ , this->trdid );
+                mapper_release_page( mapper , index , page );
+                page_clear_flag( page , PG_ALL );
+                req.ptr  = page;
+                req.type = KMEM_PAGE;
+                kmem_free( &req );
+                return NULL;
             }
-        }
-
-#if (DEBUG_MAPPER_GET_PAGE & 1)
-if( DEBUG_MAPPER_GET_PAGE < cycle )
-printk("\n[%s] thread[%x,%x] introduced missing page %d in <%s> mapper / ppn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, page_id, name, ppm_page2ppn(page_xp) );
-#endif
+
+            // update the mapper and index fields in page descriptor
+            page->mapper = mapper;
+            page->index  = index;
+
+            // reset the page INLOAD flag to make the page available to all readers
+            page_clear_flag( page , PG_INLOAD );
+
+        }
+        else if( page_is_flag( page , PG_INLOAD ) )   // page is loaded by another thread
+        {
+            // release mapper lock from WRITE_MODE
+            rwlock_wr_unlock( &mapper->lock );
+
+            // deschedule to wait load completion
+            while( 1 )
+            {
+                // exit waiting loop when loaded
+                if(  page_is_flag( page , PG_INLOAD ) ) break;
+
+                // deschedule 
+                sched_yield();
+            }
+         
+        }
+
+        return page;
+    }
+    else 
+    {
+         // release lock from READ_MODE
+         rwlock_rd_unlock( &mapper->lock );
+
+         return page;
+    }
+}  // end mapper_get_page()
+
+///////////////////////////////////////////////
+error_t mapper_release_page( mapper_t * mapper,
+                             uint32_t   index,
+                             page_t   * page )
+{
+    error_t error;
+
+    // lauch IO operation to update page to file system
+    error = mapper_sync_page( mapper , index , page );
+
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot update file system\n", __FUNCTION__ );
+        return EIO;
+    }
         
-        // release mapper lock from WRITE_MODE
-        remote_rwlock_wr_release( lock_xp );
-    }
-    else                                              // hit 
-    {
+    // take mapper lock in WRITE_MODE
+    rwlock_wr_lock( &mapper->lock );
+
+    // remove physical page from radix tree
+	grdxt_remove( &mapper->radix , page->index );
+
+    // release mapper lock from WRITE_MODE
+    rwlock_wr_unlock( &mapper->lock );
+
+    // release page to PPM
+	kmem_req_t   req;
+	req.type  = KMEM_PAGE;
+    req.ptr   = page;
+    kmem_free( &req );
+
+    return 0;
+
+}  // end mapper_release_page()
+
+////////////////////////////////////////////
+error_t mapper_updt_page( mapper_t * mapper,
+                          uint32_t   index,
+                          page_t   * page )
+{
+    uint32_t      type;
+    vfs_inode_t * inode;
+    error_t       error = 0;
+
+    if( page == NULL )
+    {
+        printk("\n[PANIC] in %s : page pointer is NULL\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    if( mapper == NULL )
+    {
+        printk("\n[PANIC] in %s : no mapper for this page\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get file system type and inode pointer
+    inode = mapper->inode;
+    type  = inode->ctx->type;
+
+    // get page lock
+    page_lock( page );
+
+    // get mapper lock in WRITE_MODE
+    rwlock_wr_lock( &mapper->lock );
+
+    // call proper I/O operation to update file system
+    if     ( type == FS_TYPE_FATFS ) error = fatfs_read_page( page );
+    else if( type == FS_TYPE_RAMFS ) error = ramfs_read_page( page );
+    else
+    {
+        printk("\n[PANIC] in %s : undefined file system type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // release mapper lock from WRITE_MODE
+    rwlock_wr_unlock( &mapper->lock );
+
+    // release page lock 
+    page_unlock( page );
+
+    if( error )
+    {
+        printk("\n[PANIC] in %s : cannot access file system\n", __FUNCTION__ );
+        return EIO;
+    }
+	
+    return 0;
+}  // end mapper_updt_page
+
+////////////////////////////////////////////
+error_t mapper_sync_page( mapper_t * mapper,
+                          uint32_t   index,
+                          page_t   * page )
+{
+    uint32_t      type;
+    vfs_inode_t * inode;
+    error_t       error = 0;
+
+    if( page == NULL )
+    {
+        printk("\n[PANIC] in %s : page pointer is NULL\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    if( mapper == NULL )
+    {
+        printk("\n[PANIC] in %s : no mapper for this page\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+	if( page_is_flag( page , PG_DIRTY ) ) 
+	{
+        // get file system type and inode pointer
+        inode = mapper->inode;
+        type  = inode->ctx->type;
+
+        // get page lock
+        page_lock( page );
+
+        // get mapper lock in READ_MODE
+        rwlock_rd_lock( &mapper->lock );
+
+        // call proper I/O operation to update file system
+        if     ( type == FS_TYPE_FATFS ) error = fatfs_write_page( page );
+        else if( type == FS_TYPE_RAMFS ) error = ramfs_write_page( page );
+        else
+        {
+            printk("\n[PANIC] in %s : undefined file system type\n", __FUNCTION__ );
+            hal_core_sleep();
+        }
+
         // release mapper lock from READ_MODE
-        remote_rwlock_rd_release( lock_xp );
-    }
-
-#if DEBUG_MAPPER_GET_PAGE
-if( DEBUG_MAPPER_GET_PAGE < cycle )
-printk("\n[%s] thread[%x,%x] exit for page %d of <%s> mapper / ppn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, page_id, name, ppm_page2ppn(page_xp) );
-#endif
-
-#if( DEBUG_MAPPER_GET_PAGE & 1)
-if( DEBUG_MAPPER_GET_PAGE < cycle ) 
-ppm_remote_display( local_cxy );
-#endif
-
-    return page_xp;
-
-}  // end mapper_get_page()
-
-/////////////////////////////////////////////////
-xptr_t  mapper_get_fat_page( xptr_t    mapper_xp,
-                             uint32_t  page_id )
-{
-    error_t       error;
-
-    thread_t * this = CURRENT_THREAD;
-
-    // get mapper cluster and local pointer
-    mapper_t * mapper_ptr = GET_PTR( mapper_xp );
-    cxy_t      mapper_cxy = GET_CXY( mapper_xp );
-
-assert( __FUNCTION__, (hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) ) == NULL ),
-"should be used for the FAT mapper");
-
-#if DEBUG_MAPPER_GET_FAT_PAGE
-uint32_t      cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_MAPPER_GET_FAT_PAGE < cycle ) 
-printk("\n[%s] thread[%x,%x] enter for page %d of FAT mapper / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, page_id, cycle );
-#endif
-
-#if( DEBUG_MAPPER_GET_FAT_PAGE & 2 )
-if( DEBUG_MAPPER_GET_FAT_PAGE < cycle ) 
-ppm_remote_display( local_cxy );
-#endif
-
-    // check thread can yield
-    thread_assert_can_yield( this , __FUNCTION__ );
-
-    // build extended pointer on mapper lock and mapper rt
-    xptr_t lock_xp  = XPTR( mapper_cxy , &mapper_ptr->lock );
-    xptr_t rt_xp    = XPTR( mapper_cxy , &mapper_ptr->rt );
-
-    // take mapper lock in READ_MODE
-    remote_rwlock_rd_acquire( lock_xp );
-
-    // search page in radix tree
-    xptr_t page_xp  = grdxt_remote_lookup( rt_xp , page_id );
-
-    // test mapper miss 
-    if( page_xp == XPTR_NULL )                  // miss => handle it
-    {
-        // release the lock in READ_MODE and take it in WRITE_MODE
-        remote_rwlock_rd_release( lock_xp );
-        remote_rwlock_wr_acquire( lock_xp );
-
-        // second test on missing page because the page status can be modified
-        // by another thread, when passing from READ_MODE to WRITE_MODE.
-        // from this point there is no concurrent accesses to mapper.
-        page_xp = grdxt_remote_lookup( rt_xp , page_id );
-
-        if ( page_xp == XPTR_NULL )  // miss confirmed => handle it
-        {
-            error = mapper_handle_miss( mapper_xp,
-                                        page_id,
-                                        &page_xp );
-            if( error )
-            {
-
-#if DEBUG_MAPPER_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot handle mapper miss\n",
-__FUNCTION__ , this->process->pid, this->trdid );
-remote_rwlock_wr_release( lock_xp );
-#endif
-                return XPTR_NULL;
-            }
-        }
-
-#if (DEBUG_MAPPER_GET_FAT_PAGE & 1)
-if( DEBUG_MAPPER_GET_FAT_PAGE < cycle )
-printk("\n[%s] thread[%x,%x] introduced missing page %d in FAT mapper / ppn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, page_id, ppm_page2ppn(page_xp) );
-#endif
-        
-        // release mapper lock from WRITE_MODE
-        remote_rwlock_wr_release( lock_xp );
-    }
-    else                                              // hit 
-    {
-        // release mapper lock from READ_MODE
-        remote_rwlock_rd_release( lock_xp );
-    }
-
-#if DEBUG_MAPPER_GET_FAT_PAGE
-if( DEBUG_MAPPER_GET_FAT_PAGE < cycle )
-printk("\n[%s] thread[%x,%x] exit for page %d of FAT mapper  / ppn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, page_id, ppm_page2ppn(page_xp) );
-#endif
-
-#if( DEBUG_MAPPER_GET_FAT_PAGE & 1)
-if( DEBUG_MAPPER_GET_FAT_PAGE < cycle ) 
-ppm_remote_display( local_cxy );
-#endif
-
-    return page_xp;
-
-}  // end mapper_get_fat_page()
-
-////////////////////////////////////////////////////
-void mapper_remote_release_page( xptr_t   mapper_xp,
-                                 page_t * page )
-{
-    // get mapper cluster an local pointer
-    cxy_t      mapper_cxy = GET_CXY( mapper_xp );
-    mapper_t * mapper_ptr = GET_PTR( mapper_xp );
-
-    // build extended pointer on mapper lock
-    xptr_t lock_xp = XPTR( mapper_cxy , &mapper_ptr->lock );
-
-    // take mapper lock in WRITE_MODE
-    remote_rwlock_wr_acquire( lock_xp );
-
-    // remove physical page from radix tree
-    grdxt_remote_remove( XPTR( mapper_cxy , &mapper_ptr->rt ) , page->index );
-
-    // release mapper lock from WRITE_MODE
-    remote_rwlock_wr_release( lock_xp );
-
-    // release page to PPM
-    ppm_remote_free_pages( mapper_cxy , page );
-                           
-}  // end mapper_release_page()
-
-///////////////////////////////////////////////
-error_t mapper_move_user( xptr_t     mapper_xp,
-                          bool_t     to_buffer,
-                          uint32_t   file_offset,
-                          void     * buffer,
-                          uint32_t   size )
-{
-    uint32_t   page_offset;    // first byte to move to/from a mapper page
-    uint32_t   page_bytes;     // number of bytes to move to/from a mapper page
-    uint32_t   page_id;        // current mapper page index
-    uint32_t   done;           // number of moved bytes
-    xptr_t     page_xp;        // extended pointer on current mapper page descriptor
-
-#if DEBUG_MAPPER_MOVE_USER
-uint32_t      cycle      = (uint32_t)hal_get_cycles();
-thread_t    * this       = CURRENT_THREAD;
-cxy_t         mapper_cxy = GET_CXY( mapper_xp );
-mapper_t    * mapper_ptr = GET_PTR( mapper_xp );
-vfs_inode_t * inode_ptr  = hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) );
-xptr_t        inode_xp   = XPTR( mapper_cxy , inode_ptr );
-char          name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( inode_xp , name );
-if( DEBUG_MAPPER_MOVE_USER < cycle )
-{
-    if( to_buffer )
-    printk("\n[%s] thread[%x,%x] : mapper(%s) -> buffer(%x) / bytes %d / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, name, buffer, size, cycle );
-    else
-    printk("\n[%s] thread[%x,%x] : buffer(%x) -> mapper(%s) / bytes %d / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, buffer, name, size, cycle );
-}
-#endif
-
-    // compute indexes of first and last bytes in file
-    uint32_t min_byte = file_offset;
-    uint32_t max_byte = file_offset + size - 1;
+        rwlock_rd_unlock( &mapper->lock );
+
+        // release page lock 
+        page_unlock( page );
+
+        if( error )
+        {
+            printk("\n[PANIC] in %s : cannot update file system\n", __FUNCTION__ );
+            return EIO;
+        }
+    
+        // clear dirty bit
+		page_undo_dirty( page );
+     }
+	
+    return 0;
+
+}  // end mapper_sync_page()
+
+///////////////////////////////////////////////////////////////////////////////////////
+// This static function is called by the mapper_move fragments() function.
+// It moves one fragment between an user buffer and the kernel mapper.
+// Implementation Note: It can require access to one or two pages in mapper: 
+//  [max_page_index == min_page_index]     <=>  fragment fit in one mapper page
+//  [max_page index == min_page_index + 1] <=>  fragment spread on two mapper pages
+///////////////////////////////////////////////////////////////////////////////////////
+static error_t mapper_move_one_fragment( mapper_t   * mapper,
+                                         bool_t       to_buffer,
+                                         fragment_t * fragment )
+{
+    uint32_t   size;                 // number of bytes in fragment 
+    cxy_t      buf_cxy;              // cluster identifier for user buffer
+    uint8_t  * buf_ptr;              // local pointer on first byte in user buffer
+    
+    xptr_t     xp_buf;               // extended pointer on byte in user buffer
+    xptr_t     xp_map;               // extended pointer on byte in kernel mapper
+
+    uint32_t   min_file_offset;      // offset of first byte in file 
+    uint32_t   max_file_offset;      // offset of last byte in file    
+
+    uint32_t   first_page_index;     // index of first page in mapper
+    uint32_t   first_page_offset;    // offset of first byte in first page in mapper    
+    uint32_t   first_page_size;      // offset of first byte in first page in mapper    
+
+    uint32_t   second_page_index;    // index of last page in mapper    
+    uint32_t   second_page_offset;   // offset of last byte in last page in mapper    
+    uint32_t   second_page_size;     // offset of last byte in last page in mapper    
+ 
+    page_t   * page;                 // pointer on one page descriptor in mapper
+    uint8_t  * map_ptr;              // local pointer on first byte in mapper
+
+    // get fragment attributes in user buffer
+    buf_cxy = fragment->buf_cxy;
+    buf_ptr = fragment->buf_ptr;
+    size    = fragment->size;
+
+    if( size > CONFIG_PPM_PAGE_SIZE )
+    {
+        printk("\n[PANIC] in %s : illegal fragment size = %d\n",
+               __FUNCTION__ , size );
+        return EINVAL;
+    }
+    
+    // compute offsets of first and last bytes in file
+    min_file_offset = fragment->file_offset;
+    max_file_offset = min_file_offset + size;
 
     // compute indexes of pages for first and last byte in mapper
-    uint32_t first = min_byte >> CONFIG_PPM_PAGE_ORDER;
-    uint32_t last  = max_byte >> CONFIG_PPM_PAGE_ORDER;
-
-#if (DEBUG_MAPPER_MOVE_USER & 1)
-if( DEBUG_MAPPER_MOVE_USER < cycle )
-printk("\n[%s] thread[%x,%x] : mapper(%x,%x) / first_page %d / last_page %d\n",
-__FUNCTION__, this->process->pid, this->trdid, mapper_cxy, mapper_ptr, first, last );
-#endif
-
-    done = 0;
-
-    // loop on pages in mapper
-    for( page_id = first ; page_id <= last ; page_id++ )
-    {
-        // compute page_offset
-        if( page_id == first ) page_offset = min_byte & CONFIG_PPM_PAGE_MASK;
-        else                   page_offset = 0;
-
-        // compute number of bytes in page
-        if      ( first   == last  ) page_bytes = size;
-        else if ( page_id == first ) page_bytes = CONFIG_PPM_PAGE_SIZE - page_offset;
-        else if ( page_id == last  ) page_bytes = (max_byte & CONFIG_PPM_PAGE_MASK) + 1;
-        else                         page_bytes = CONFIG_PPM_PAGE_SIZE;
-
-#if (DEBUG_MAPPER_MOVE_USER & 1)
-if( DEBUG_MAPPER_MOVE_USER < cycle )
-printk("\n[%s] thread[%x,%x] : page_id %d / page_offset %d / bytes %d\n",
-__FUNCTION__, this->process->pid, this->trdid, page_id , page_offset , page_bytes );
-#endif
-
-        // get extended pointer on page descriptor in mapper
-        page_xp = mapper_get_page( mapper_xp , page_id ); 
-
-        if ( page_xp == XPTR_NULL ) return -1;
-
-        // compute extended pointer on kernel mapper
-        xptr_t     map_xp  = ppm_page2base( page_xp ) + page_offset;
-
-#if (DEBUG_MAPPER_MOVE_USER & 1)
-if( DEBUG_MAPPER_MOVE_USER < cycle )
-printk("\n[%s] thread[%x,%x] : get buffer(%x,%x) in mapper\n",
-__FUNCTION__, this->process->pid, this->trdid, GET_CXY(map_xp), GET_PTR(map_xp) );
-#endif
-        // compute pointer in user buffer
-        uint8_t * buf_ptr = (uint8_t *)buffer + done;
+    first_page_index  = min_file_offset >> CONFIG_PPM_PAGE_SHIFT;
+    second_page_index = max_file_offset >> CONFIG_PPM_PAGE_SHIFT;
+
+    if ( first_page_index == second_page_index )  // only one page in mapper
+    {
+        // compute offset and size for page in mapper 
+        first_page_offset = min_file_offset & (1<<CONFIG_PPM_PAGE_SHIFT);
+        first_page_size   = size;
+
+        // get pointer on first page in mapper
+        page = mapper_get_page( mapper , first_page_index );
+
+        if ( page == NULL ) return EINVAL;
+
+        // compute pointer on fragment first byte in mapper
+        map_ptr = (uint8_t *)ppm_page2base( page ) + first_page_offset;
+
+        // compute extended pointers in mapper and in buffer
+        xp_map = XPTR( local_cxy , map_ptr );
+        xp_buf = XPTR( buf_cxy , buf_ptr );
 
         // move fragment
         if( to_buffer )
         {
-            hal_copy_to_uspace( buf_ptr , map_xp , page_bytes ); 
-
-#if DEBUG_MAPPER_MOVE_USER & 1
-if( DEBUG_MAPPER_MOVE_USER < cycle )
-printk("\n[%s] thread[%x,%x] moved %d bytes / mapper %s (%x,%x) -> user buffer(%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, page_bytes,
-name, GET_CXY(map_xp), GET_PTR(map_xp), local_cxy, buf_ptr );
-#endif
-
+            hal_remote_memcpy( xp_buf , xp_map , first_page_size );
         }
         else
         {
-            ppm_page_do_dirty( page_xp ); 
-            hal_copy_from_uspace( map_xp , buf_ptr , page_bytes ); 
-
-#if DEBUG_MAPPER_MOVE_USER & 1
-if( DEBUG_MAPPER_MOVE_USER < cycle )
-printk("\n[%s] thread[%x,%x] moved %d bytes / user buffer(%x,%x) -> mapper %s (%x,%x)\n",
-__FUNCTION__, this->process->pid, this->trdid, page_bytes,
-local_cxy, buf_ptr, name, GET_CXY(map_xp), GET_PTR(map_xp) );
-mapper_display_page(  mapper_xp , page_id , 128 );
-#endif
-
-        }
-
-        done += page_bytes;
-    }
-
-#if DEBUG_MAPPER_MOVE_USER
-cycle      = (uint32_t)hal_get_cycles();
-if( DEBUG_MAPPER_MOVE_USER < cycle )
-{
-    if( to_buffer )
-    printk("\n[%s] thread[%x,%x] completed mapper(%s) -> buffer(%x) / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, name, buffer, cycle );
-    else
-    printk("\n[%s] thread[%x,%x] completed buffer(%x) -> mapper(%s) / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, buffer, name, cycle );
-}
-#endif
+            page_do_dirty( page );
+            hal_remote_memcpy( xp_map , xp_buf , first_page_size );
+        }
+    }
+    else                                        // two pages in mapper
+    {
+        // compute offset and size for first page in mapper
+        first_page_offset = min_file_offset & (1<<CONFIG_PPM_PAGE_SHIFT);
+        first_page_size   = CONFIG_PPM_PAGE_SIZE - first_page_offset;
+
+        // get pointer on first page descriptor in mapper
+        page = mapper_get_page( mapper , first_page_index );
+
+        if ( page == NULL ) return EINVAL;
+
+        // compute local pointer on first byte in first page in mapper
+        map_ptr = (uint8_t *)ppm_page2base(page) + first_page_offset;
+    
+        // compute extended pointers
+        xp_map = XPTR( local_cxy , map_ptr );
+        xp_buf = XPTR( buf_cxy , buf_ptr );
+
+        // move fragment to/from first page
+        if( to_buffer )
+        {
+            hal_remote_memcpy( xp_buf , xp_map , first_page_size );
+        }
+        else
+        {
+            page_do_dirty( page );
+            hal_remote_memcpy( xp_map , xp_buf , first_page_size );
+        }
+
+        // compute offset and size for second page in mapper
+        second_page_offset = 0;
+        second_page_size   = size - first_page_size;  
+
+        // get pointer on second page in mapper
+        page = mapper_get_page( mapper , second_page_index );
+
+        if ( page == NULL ) return EINVAL;
+
+        // compute local pointer on first byte in second page in mapper
+        map_ptr = (uint8_t *)ppm_page2base( page ) + second_page_offset;
+    
+        // compute extended pointers
+        xp_map = XPTR( local_cxy , map_ptr );
+        xp_buf = XPTR( buf_cxy , buf_ptr + first_page_offset );
+
+        // move fragment to/from second page
+        if( to_buffer )
+        {
+            hal_remote_memcpy( xp_buf , xp_map , second_page_size );
+        }
+        else
+        {
+            page_do_dirty( page );
+            hal_remote_memcpy( xp_map , xp_buf , second_page_size );
+        }
+    }
 
     return 0;
-
-}  // end mapper_move_user()
-
-////////////////////////////////////////////////
-error_t mapper_move_kernel( xptr_t    mapper_xp,
-                            bool_t    to_buffer,
-                            uint32_t  file_offset,
-                            xptr_t    buffer_xp,
-                            uint32_t  size )
-{
-    uint32_t   page_offset;    // first byte to move to/from a mapper page
-    uint32_t   page_bytes;     // number of bytes to move to/from a mapper page
-    uint32_t   page_id;        // current mapper page index
-    uint32_t   done;           // number of moved bytes
-    xptr_t     page_xp;        // extended pointer on current mapper page descriptor
-
-    uint8_t  * src_ptr;        // source buffer local pointer
-    cxy_t      src_cxy;        // source cluster
-    uint8_t  * dst_ptr;        // destination buffer local pointer
-    cxy_t      dst_cxy;        // destination cluster
-
-    // get buffer cluster and local pointer
-    cxy_t     buffer_cxy = GET_CXY( buffer_xp );
-    uint8_t * buffer_ptr = GET_PTR( buffer_xp );
-
-    // get mapper cluster
-    cxy_t     mapper_cxy = GET_CXY( mapper_xp );
-
-#if DEBUG_MAPPER_MOVE_KERNEL
-char          name[CONFIG_VFS_MAX_NAME_LENGTH];
-uint32_t      cycle  = (uint32_t)hal_get_cycles();
-thread_t    * this   = CURRENT_THREAD;
-mapper_t    * mapper = GET_PTR( mapper_xp );
-vfs_inode_t * inode  = hal_remote_lpt( XPTR( mapper_cxy , &mapper->inode ) );
-vfs_inode_get_name( XPTR( mapper_cxy , inode ) , name );
-if( DEBUG_MAPPER_MOVE_KERNEL < cycle )
-printk("\n[%s] thread[%x,%x] enter / %d bytes / offset %d / mapper <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, size, file_offset, name, cycle );
-#endif
-
-    // compute offsets of first and last bytes in file
-    uint32_t min_byte = file_offset;
-    uint32_t max_byte = file_offset + size -1;
-
-    // compute indexes for first and last pages in mapper
-    uint32_t first = min_byte >> CONFIG_PPM_PAGE_ORDER;
-    uint32_t last  = max_byte >> CONFIG_PPM_PAGE_ORDER;
-
-    // compute source and destination clusters
-    if( to_buffer )
-    {
-        dst_cxy = buffer_cxy;
-        src_cxy = mapper_cxy;
-    }
-    else
-    {
-        src_cxy = buffer_cxy;
-        dst_cxy = mapper_cxy;
-    }
-
-    done = 0;
-
-    // loop on pages in mapper
-    for( page_id = first ; page_id <= last ; page_id++ )
-    {
-        // compute page_offset
-        if( page_id == first ) page_offset = min_byte & CONFIG_PPM_PAGE_MASK;
-        else                   page_offset = 0;
-
-        // compute number of bytes to move in page
-        if      ( first == last  )   page_bytes = size;
-        else if ( page_id == first ) page_bytes = CONFIG_PPM_PAGE_SIZE - page_offset;
-        else if ( page_id == last  ) page_bytes = (max_byte & CONFIG_PPM_PAGE_MASK) + 1;
-        else                         page_bytes = CONFIG_PPM_PAGE_SIZE;
-
-        // get extended pointer on page descriptor
-        page_xp = mapper_get_page( mapper_xp , page_id );
-
-        if ( page_xp == XPTR_NULL ) return -1;
-
-        // get page base address
-        xptr_t    base_xp  = ppm_page2base( page_xp );
-        uint8_t * base_ptr = (uint8_t *)GET_PTR( base_xp );
-
-        // compute source and destination pointers
-        if( to_buffer )
-        {
-            dst_ptr = buffer_ptr + done;
-            src_ptr = base_ptr + page_offset;
-        }
-        else
-        {
-            src_ptr = buffer_ptr + done;
-            dst_ptr = base_ptr + page_offset;
-
-            ppm_page_do_dirty( page_xp );
-        }
-
-#if (DEBUG_MAPPER_MOVE_KERNEL & 1)
-if( DEBUG_MAPPER_MOVE_KERNEL < cycle )
-{
-    if( to_buffer )
-    printk("\n[%s] mapper <%s> page %d => buffer (%x,%x) / %d bytes\n",
-    __FUNCTION__, name, page_id, dst_cxy, dst_ptr, page_bytes );
-    else
-    printk("\n[%s] buffer (%x,%x) => mapper <%s> page %d / %d bytes\n",
-    __FUNCTION__, src_cxy, src_ptr, name, page_id, page_bytes );
-}
-#endif
-
-        // move fragment
-        hal_remote_memcpy( XPTR( dst_cxy , dst_ptr ), XPTR( src_cxy , src_ptr ), page_bytes );
-
-        done += page_bytes;
-    }
-
-#if DEBUG_MAPPER_MOVE_KERNEL
-cycle  = (uint32_t)hal_get_cycles();
-if( DEBUG_MAPPER_MOVE_KERNEL < cycle )
-printk("\n[%s] thread[%x,%x] exit / mapper <%s> / buffer (%x,%x) / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, name, buffer_cxy, buffer_ptr, cycle );
-#endif
+}  // end mapper_move_one_fragment()
+
+/////////////////////////////////////////////////
+error_t mapper_move_fragments( mapper_t * mapper,
+                               bool_t     read,
+                               uint32_t   nb_frags,
+                               xptr_t     xp_frags )
+{
+	uint32_t     index;
+	error_t      error;
+    fragment_t   local_frags[CONFIG_MAPPER_MAX_FRAGMENTS];   // local copy of fragments array
+    fragment_t * frags_array;                                // pointer on fragments array
+
+    // check nb_frags
+    if( nb_frags > CONFIG_MAPPER_MAX_FRAGMENTS )
+    {
+        printk("\n[PANIC] in %s : number of fragments cannot be larger than %d\n",
+               __FUNCTION__ , CONFIG_MAPPER_MAX_FRAGMENTS );
+        return EINVAL;
+    }
+
+    // get client cluster and local pointer on fragments array
+    cxy_t        client_cxy   = GET_CXY( xp_frags );
+    fragment_t * client_frags = (fragment_t *)GET_PTR( xp_frags );
+
+    if ( local_cxy == client_cxy ) // use the local fragments array if possible
+    {
+        frags_array = client_frags;
+    }
+    else                           // make a local copy of fragments array 
+    {
+        hal_remote_memcpy( XPTR( local_cxy , local_frags ) , xp_frags ,
+                           sizeof(fragment_t) * nb_frags );
+        frags_array = local_frags;
+    }
+
+    // loop on fragments
+    for( index = 0 ; index < nb_frags ; index ++ )
+    {
+        error = mapper_move_one_fragment( mapper , read , &frags_array[index] );
+        if ( error ) return error;
+    }
 
     return 0;
 
-}  // end mapper_move_kernel()
-
-///////////////////////////////////////////////////
-error_t mapper_remote_get_32( xptr_t     mapper_xp,
-                              uint32_t   page_id,
-                              uint32_t   word_id,
-                              uint32_t * value )
-{
-    xptr_t     page_xp;      // extended pointer on searched page descriptor
-    xptr_t     base_xp;      // extended pointer on searched page base 
-    
-    // get page containing the searched word
-    page_xp  = mapper_get_page( mapper_xp , page_id );
-
-    if( page_xp == XPTR_NULL )  return -1;
-    
-    // get page base
-    base_xp = ppm_page2base( page_xp );
-
-    // get the value from mapper
-    *value = hal_remote_l32( base_xp + (word_id<<2) ); 
-
-    return 0;
-
-}  // end mapper_remote_get_32()
-
-///////////////////////////////////////////////////
-error_t mapper_remote_set_32( xptr_t     mapper_xp,
-                              uint32_t   page_id,
-                              uint32_t   word_id,
-                              uint32_t   value )
-{
-    xptr_t     page_xp;      // extended pointer on searched page descriptor
-    xptr_t     base_xp;      // extended pointer on searched page base 
-
-    // get page containing the searched word
-    page_xp  = mapper_get_page( mapper_xp , page_id );
-
-    if( page_xp == XPTR_NULL ) return -1;
-
-    // get page base
-    base_xp = ppm_page2base( page_xp );
-
-    // set value to mapper
-    hal_remote_s32( (base_xp + (word_id << 2)) , value );
-
-    // set the dirty flag in page descriptor
-    ppm_page_do_dirty( page_xp );
-
-    return 0;
-
-}  // end mapper_remote_set_32()
-
-////////////////////////////////////////
-error_t mapper_sync( xptr_t  mapper_xp )
-{
-    uint32_t   found_key;           // unused, required by grdxt_remote_get_first()
-    error_t    error;
-
-    // get mapper cluster and local pointer
-    mapper_t * mapper_ptr = GET_PTR( mapper_xp );
-    cxy_t      mapper_cxy = GET_CXY( mapper_xp );
-
-#if DEBUG_MAPPER_SYNC
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-char       name[CONFIG_VFS_MAX_NAME_LENGTH];
-vfs_inode_get_name( XPTR( mapper_cxy , &mapper_ptr->inode ) , name );
-#endif
-
-    // build extended pointer on radix tree
-    xptr_t   rt_xp = XPTR( mapper_cxy , &mapper_ptr->rt );
-
-    // initialise loop variable 
-    uint32_t start_key = 0;
-
-    // scan radix-tree until last page found
-    while( 1 )
-    {
-        // get page descriptor from radix tree
-        xptr_t page_xp = grdxt_remote_get_first( rt_xp , start_key , &found_key );
-         
-        page_t * page_ptr = GET_PTR( page_xp );
-
-        // exit loop when last page found
-        if( page_ptr == NULL ) break;
-
-        // get page flags & index fields
-        uint32_t flags = hal_remote_l32( XPTR( mapper_cxy , &page_ptr->flags ) );
-        uint32_t index = hal_remote_l32( XPTR( mapper_cxy , &page_ptr->index ) );
-
-        // synchronize page if dirty
-        if( flags & PG_DIRTY )
-        {
-
-#if DEBUG_MAPPER_SYNC
-if( cycle > DEBUG_MAPPER_SYNC )
-printk("\n[%s] thread[%x,%x] synchonise page %d of <%s> to IOC device\n",
-__FUNCTION__, this->process->pid, this->trdid, page_ptr->index, name );
-#endif
-            // copy page to file system
-            error = vfs_fs_move_page( page_xp , IOC_WRITE );
-
-            if( error )
-            {
-
-#if DEBUG_MAPPER_SYNC
-printk("\n[ERROR] in %s : cannot synchonize dirty page %d\n", 
-__FUNCTION__, page_ptr->index );
-#endif
-                return -1;
-            }
-
-            // remove page from PPM dirty list
-            ppm_page_undo_dirty( page_xp ); 
-        } 
-        else
-        {
-
-#if DEBUG_MAPPER_SYNC
-if( cycle > DEBUG_MAPPER_SYNC )
-printk("\n[%s] thread[%x,%x] skip page %d for <%s>\n",
-__FUNCTION__, this->process->pid, this->trdid, page_ptr->index, name );
-#endif
-        }
-
-        // update loop variable
-        start_key = index + 1;
-    }  // end while
-
-    return 0;
-
-}  // end mapper_sync()
-
-///////////////////////////////////////////////
-void mapper_display_page( xptr_t     mapper_xp,
-                          uint32_t   page_id,
-                          uint32_t   nbytes )
-{
-    char          buffer[4096];   // local buffer
-    uint32_t      line;           // line index
-    uint32_t      word;           // word index
- 
-    char       name[CONFIG_VFS_MAX_NAME_LENGTH];
-
-assert( __FUNCTION__, (nbytes <= 4096)         , "nbytes cannot be larger than 4096");
-assert( __FUNCTION__, (mapper_xp != XPTR_NULL) , "mapper_xp argument cannot be null");
-
-    // get mapper cluster and local pointer
-    cxy_t      mapper_cxy = GET_CXY( mapper_xp );
-    mapper_t * mapper_ptr = GET_PTR( mapper_xp );
-
-    // get extended pointer on page descriptor
-    xptr_t page_xp = mapper_get_page( mapper_xp , page_id );
-
-    // get page cluster and local pointer
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    // get page_id and mapper from page descriptor
-    uint32_t   index   = hal_remote_l32( XPTR( page_cxy , &page_ptr->index ) );
-    mapper_t * mapper  = hal_remote_lpt( XPTR( page_cxy , &page_ptr->mapper ) );
-
-assert( __FUNCTION__, (mapper_cxy == page_cxy ) , "mapper and page must be in same cluster");
-assert( __FUNCTION__, (mapper_ptr == mapper   ) , "unconsistent mapper field in page descriptor");
-assert( __FUNCTION__, (page_id    == index    ) , "unconsistent index  field in page descriptor");
-
-    // get inode
-    vfs_inode_t * inode_ptr = hal_remote_lpt( XPTR( mapper_cxy , &mapper_ptr->inode ) );
-
-    // get inode name
-    if( inode_ptr == NULL ) strcpy( name , "FAT" );
-    else  vfs_inode_get_name( XPTR( mapper_cxy , inode_ptr ) , name );
-    
-    // get extended pointer on page base
-    xptr_t base_xp = ppm_page2base( page_xp );
-   
-    // copy remote page to local buffer
-    hal_remote_memcpy( XPTR( local_cxy , buffer ) , base_xp , nbytes );
-
-    // display header
-    uint32_t * tabi = (uint32_t *)buffer;
-    printk("\n***** mapper <%s> / page_id %d / cxy %x / mapper %x / buffer %x\n",
-    name, page_id, mapper_cxy, mapper_ptr, GET_PTR( base_xp ) );
-
-    // display 8 words per line
-    for( line = 0 ; line < (nbytes >> 5) ; line++ )
-    {
-        printk("%X : ", line << 5 );
-        for( word = 0 ; word < 8 ; word++ ) printk("%X ", tabi[(line<<3) + word] );
-        printk("\n");
-    }
-
-}  // end mapper_display_page()
-
-
+}  // end mapper_move_fragments()
+
+
Index: trunk/kernel/mm/mapper.h
===================================================================
--- trunk/kernel/mm/mapper.h	(revision 690)
+++ trunk/kernel/mm/mapper.h	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * mapper.h - Kernel cache for VFS files/directories definition.
+ * mapper.h - Map memory, file or device in process virtual address space.
  *
  * Authors   Mohamed Lamine Karaoui (2015)
- *           Alain Greiner (2016,2017,2018,2019)
+ *           Alain Greiner (2016)
  *
  * Copyright (c)  UPMC Sorbonne Universites
@@ -26,5 +26,5 @@
 #define _MAPPER_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_atomic.h>
 #include <xlist.h>
@@ -38,32 +38,23 @@
 
 /*******************************************************************************************
- * This mapper_t object implements the kernel cache for a given VFS file or directory.
- * There is one mapper per file/dir.
- * - It is implemented as a three levels radix tree, entirely stored in the same cluster
- *   as the inode representing the file/directory.
- * - The fast retrieval key is the page index in the file.
+ * The mapper implement the kernel cache for a given file or directory.
+ * There is one mapper per file. It is implemented as a three levels radix tree,
+ * entirely stored in the same cluster as the inode representing the file/dir.
+ * - The fast retrieval key is the page index in the file. 
  *   The ix1_width, ix2_width, ix3_width sub-indexes are configuration parameters.
  * - The leaves are pointers on physical page descriptors, dynamically allocated
- *   in the same cluster as the radix tree.
- * - The mapper is protected by a "remote_rwlock", to support several simultaneous 
- *   "readers", and only one "writer".
- * - A "reader" thread, calling the mapper_remote_get_page() function to get a page 
- *   descriptor pointer from the page index in file, can be running in any cluster. 
- * - A "writer" thread, calling the mapper_handle_miss() function to handle a page miss
- *   must be local (running in the mapper cluster).
- * - The vfs_fs_move_page() function access the file system to handle a mapper miss,
- *   or update a dirty page on device.
- * - The vfs_mapper_load_all() functions is used to load all pages of a directory 
- *   into the mapper (prefetch).
- * - the mapper_move_user() function is used to move data to or from an user buffer.
- *   This user space buffer can be physically distributed in several clusters.
- * - the mapper_move_kernel() function is used to move data to or from a remote kernel
- *   buffer, that can be physically located in any cluster.
- * - In the present implementation the cache size for a given file increases on demand,
- *   and the  allocated memory is only released when the inode is destroyed.
- *
- * WARNING : This mapper implementation makes the assumption that the PPM page size
- *           is 4 Kbytes. This code should be modified to support a generic page size,
- *           defined by the CONFIG_PPM_PAGE_SIZE parameter. 
+ *   in the local cluster.
+ * - In a given cluster, a mapper is a "private" structure: a thread accessing the mapper
+ *   must be running in the cluster containing it (can be a local thread or a RPC thread).
+ * - The mapper is protected by a blocking "rwlock", to support several simultaneous
+ *   readers, and only one writer. This lock implement a busy waiting policy.
+ * - The two functions mapper_sync_page() and mapper_updt_page() define the generic API
+ *   used to move pages to or from the relevant file system on IOC device.
+ * - the mapper_move fragments() function is used to move data to or from a distributed
+ *   user buffer. 
+ * - The mapper_get_page() function that return a page descriptor pointer from a page
+ *   index in file is in charge of handling the miss on the mapper cache.
+ * - In the present implementation the cache size increases on demand, and the
+ *   allocated memory is only released when the mapper is destroyed.
  ******************************************************************************************/
 
@@ -75,8 +66,7 @@
 typedef struct mapper_s
 {
-	struct vfs_inode_s * inode;	      /*! owner inode                                     */
-    uint32_t             fs_type;     /*! file system type                                */
-	grdxt_t	             rt; 	      /*! embedded pages cache descriptor (radix tree)    */
-	remote_rwlock_t      lock;        /*! several readers / only one writer               */
+	struct vfs_inode_s * inode;	      /*! owner file inode                                */
+	grdxt_t	             radix;	      /*! pages cache implemented as a radix tree         */
+	rwlock_t             lock;        /*! several readers / only one writer               */
 	uint32_t	         refcount;    /*! several vsegs can refer the same file           */
 	xlist_entry_t        vsegs_root;  /*! root of list of vsegs refering this mapper      */
@@ -87,198 +77,124 @@
 
 /*******************************************************************************************
- * This function allocates physical memory for a mapper descriptor, in cluster
- * identified by the <cxy> argument. It initializes it (refcount <= 0) / inode <= NULL).
- * It can be executed by any thread running in any cluster.
- *******************************************************************************************
- * @ cxy    : target cluster identifier.
- * @ type   : FS type.
- * @ return an extended pointer on created mapper if success / return NULL if no memory
- ******************************************************************************************/
-xptr_t  mapper_create( cxy_t     cxy,
-                       uint32_t  type );
-
-/*******************************************************************************************
- * This function releases all physical memory allocated for a mapper, identified
- * by the <mapper_xp> argument. Both the mapper descriptor and the radix tree are released.
- * It does NOT synchronize dirty pages. Use the vfs_sync_inode() function if required.
- * It can be executed by any thread running in any cluster.
- *******************************************************************************************
- * @ mapper_xp	 : extended pointer on target mapper.
- ******************************************************************************************/
-void mapper_destroy( xptr_t  mapper_xp );
-
-/*******************************************************************************************
- * This function load from the IOC device a missing page identified by the <page_id> 
- * argument into a - possibly remote - mapper identified by the <mapper_xp> argument.
- * It can be executed by a thread running in any cluster.
- * It allocates a physical page from the remote cluster PPM, initialises it by accessing
- * the IOC device, and registers the page in the remote mapper radix tree.
- * WARNING : the calling function mapper_remote_get_page() is supposed to take and release
- * the lock protecting the mapper in WRITE_MODE.
- *******************************************************************************************
- * @ mapper_xp	 : [in]  extended pointer on remote mapper.
- * @ page_id     : [in]  missing page index in file.
- * @ page_xp     : [out] buffer for extended pointer on missing page descriptor.
- * @ return 0 if success / return -1 if IOC cannot be accessed.
- ******************************************************************************************/
-error_t mapper_handle_miss( xptr_t     mapper_xp,
-                            uint32_t   page_id,
-                            xptr_t   * page_xp );
-
-/*******************************************************************************************
- * This function removes a physical page from a - possibly remote - mapper,
- * and releases the page to the remote PPM. 
- * It can be executed by any thread running in any cluster. 
- * It takes the mapper lock in WRITE_MODE to update the mapper.
- *******************************************************************************************
- * @ mapper	: extended pointer on the remote mapper.
- * @ page	: local pointer on the page in remote mapper.
- ******************************************************************************************/
-void mapper_remote_release_page( xptr_t          mapper_xp,
-                                 struct page_s * page );
-
-/*******************************************************************************************
- * This function move data between a remote mapper, identified by the <mapper_xp> argument,
- * and a distributed user buffer. It can be called by a thread running in any cluster.
- * It is called by the vfs_user_move() to implement sys_read() and sys_write() syscalls.
- * If required, the data transfer is split in "fragments", where one fragment contains 
- * contiguous bytes in the same mapper page.
- * It uses "hal_uspace" accesses to move a fragment to/from the user buffer.
+ * This structure defines a "fragment". It is used to move data between the kernel mapper,
+ * and an user buffer, that can be split in several distributed physical pages located
+ * in different clusters. A fragment is a set of contiguous bytes in the file.
+ * - It can be stored in one single physical page in the user buffer. 
+ * - It can spread two successive physical pages in the kernel mapper.
+ ******************************************************************************************/
+
+typedef struct fragment_s
+{
+    uint32_t    file_offset;         /*! offset of fragment in file (i.e. in mapper)      */
+    uint32_t    size;                /*! number of bytes in fragment                      */
+    cxy_t       buf_cxy;             /*! user buffer cluster identifier                   */
+    uint8_t   * buf_ptr;             /*! local pointer on first byte in user buffer       */
+}
+fragment_t;
+
+/*******************************************************************************************
+ * This function allocates physical memory for a mapper descriptor, and inititalizes it
+ * (refcount <= 0) / inode <= NULL).
+ * It must be executed by a thread running in the cluster containing the mapper.
+ *******************************************************************************************
+ * @ return pointer on created mapper if success / return NULL if no memory
+ ******************************************************************************************/
+mapper_t * mapper_create();
+
+/*******************************************************************************************
+ * This function releases all physical pages allocated for the mapper.
+ * It synchronizes all dirty pages (i.e. update the file on disk) if required.
+ * The mapper descriptor and the radix three themselve are released.
+ * It must be executed by a thread running in the cluster containing the mapper.
+ *******************************************************************************************
+ * @ mapper	 : target mapper.
+ * @ return 0 if success / return EIO if a dirty page cannot be updated on device.
+ ******************************************************************************************/
+error_t mapper_destroy( mapper_t * mapper );
+
+/*******************************************************************************************
+ * This function moves all fragments covering a distributed user buffer between 
+ * a mapper (associated to a local inode), and the user buffer.
+ * [See the fragment definition in the mapper.h file] 
+ * It must be executed by a thread running in the cluster containing the mapper.
+ * The lock protecting the mapper must have been taken in WRITE_MODE or READ_MODE
+ * by the caller thread, depending on the transfer direction.
  * In case of write, the dirty bit is set for all pages written in the mapper.
- * The mapper being an extendable cache, it is automatically extended when required.
- * The "offset" field in the file descriptor, and the "size" field in inode descriptor
- * are not modified by this function.
- *******************************************************************************************
- * @ mapper_xp    : extended pointer on mapper.
- * @ to_buffer    : mapper -> buffer if true / buffer -> mapper if false.
- * @ file_offset  : first byte to move in file.
- * @ u_buf        : user space pointer on user buffer.
- * @ size         : number of bytes to move.
- * returns O if success / returns -1 if error.
- ******************************************************************************************/
-error_t mapper_move_user( xptr_t     mapper_xp,
-                          bool_t     to_buffer,
-                          uint32_t   file_offset,
-                          void     * u_buf,
-                          uint32_t   size );
-
-/********************************************************************************************
- * This function move <size> bytes from/to a remote mapper, identified by the <mapper_xp>
- * argument, to/from a remote kernel buffer, identified by the <buffer_xp> argument.
- * It can be called by a thread running in any cluster. 
- * If required, the data transfer is split in "fragments", where one fragment contains 
- * contiguous bytes in the same mapper page. Each fragment uses a "remote_memcpy".
- * In case of write to mapper, the dirty bit is set for all pages written in the mapper.
- *******************************************************************************************
- * @ mapper_xp    : extended pointer on mapper.
- * @ to_buffer    : mapper -> buffer if true / buffer -> mapper if false.
- * @ file_offset  : first byte to move in file.
- * @ buffer_xp    : extended pointer on kernel buffer.
- * @ size         : number of bytes to move.
- * returns O if success / returns -1 if error.
- ******************************************************************************************/
-error_t mapper_move_kernel( xptr_t     mapper_xp,
-                            bool_t     to_buffer,
-                            uint32_t   file_offset,
-                            xptr_t     buffer_xp,
-                            uint32_t   size );
-
-/*******************************************************************************************
- * This function returns an extended pointer on a page descriptor for a regular mapper
- * (i.e. this mapper is NOT the FAT mapper), identified by the <mapper_xp> argument.
- * The page is identified by <page_id> argument (page index in the file).
- * It can be executed by a thread running in any cluster, as it uses remote
- * access primitives to scan the mapper.
- * In case of miss, this function takes the mapper lock in WRITE_MODE, and call the 
- * mapper_handle_miss() to load the missing page from device to mapper, using an RPC 
- * when the mapper is remote.
- *******************************************************************************************
- * @ mapper_xp	: extended pointer on the mapper.
- * @ page_id	: page index in file
- * @ returns extended pointer on page descriptor if success / return XPTR_NULL if error.
- ******************************************************************************************/
-xptr_t mapper_get_page( xptr_t    mapper_xp,
-                        uint32_t  page_id );
-
-/*******************************************************************************************
- * This function returns an extended pointer on a page descriptor for the FAT mapper.
- * The page is identified by <page_id> argument (page index in the FAT mapper).
- * It can be executed by a thread running in any cluster, as it uses remote
- * access primitives to scan the mapper.
- * In case of miss, this function takes the mapper lock in WRITE_MODE, and call the 
- * mapper_handle_miss() to load the missing page from device to mapper, using an RPC 
- * when the mapper is remote.
- *******************************************************************************************
- * @ mapper_xp	: extended pointer on the mapper.
- * @ page_id	: page index in file
- * @ returns extended pointer on page descriptor if success / return XPTR_NULL if error.
- ******************************************************************************************/
-xptr_t mapper_get_fat_page( xptr_t    mapper_xp,
-                            uint32_t  page_id );
-
-/*******************************************************************************************
- * This function allows to read a single word in a mapper seen as and array of uint32_t.
- * It has bee designed to support remote access to the FAT mapper of the FATFS. 
- * It can be called by any thread running in any cluster.
+ * The offset in the file descriptor is not modified by this function. 
+ * Implementation note:
+ * For each fragment, this function makes ONE hal_remote_memcpy() when the fragment is
+ * fully contained in one single page of the mapper. It makes TWO hal_remote_memcpy()
+ * if the fragment spread on two contiguous pages in the mapper.
+ *******************************************************************************************
+ * @ mapper    : local pointer on the local mapper.
+ * @ to_buffer : mapper to buffer if true / buffer to mapper if false.
+ * @ nb_frags  : number of fragments covering the user buffer (one per page).
+ * @ frags_xp  : extended pointer on array of fragments.
+FAT * returns O if success / returns EINVAL if error.
+ ******************************************************************************************/
+error_t mapper_move_fragments( mapper_t * mapper,
+                               bool_t     to_buffer,
+                               uint32_t   nb_frags,
+                               xptr_t     frags_xp );
+
+
+/*******************************************************************************************
+ * This function removes a physical page from the mapper, update the FS if the page
+ * is dirty, and releases the page to PPM. It is called by the mapper_destroy() function.
+ * It must be executed by a thread running in the cluster containing the mapper.
+ * It takes both the page lock and the mapper lock in WRITE_MODE to release the page.
+ *******************************************************************************************
+ * @ mapper	: local pointer on the mapper.
+ * @ index	: page index in file
+ * @ page	: pointer on page to remove.
+ * @ return 0 if success / return EIO if a dirty page cannot be copied to FS.
+ ******************************************************************************************/
+error_t mapper_release_page( mapper_t      * mapper,
+                             uint32_t        index,
+                             struct page_s * page );
+
+/*******************************************************************************************
+ * This function search a physical page descriptor from its index in mapper.
+ * It must be executed by a thread running in the cluster containing the mapper.
  * In case of miss, it takes the mapper lock in WRITE_MODE, load the missing
- * page from device to mapper, and release the mapper lock.
- *******************************************************************************************
- * @ mapper_xp	: [in]  extended pointer on the mapper.
- * @ page_id    : [in]  page index in mapper.
- * @ word_id    : [in]  32 bits word index in page.
- * @ value      : [out] local pointer on destination buffer.
- * @ returns 0 if success / return -1 if error.
- ******************************************************************************************/
-error_t mapper_remote_get_32( xptr_t     mapper_xp,
-                              uint32_t   page_id,
-                              uint32_t   word_id,
-                              uint32_t * value );
-
-/*******************************************************************************************
- * This function allows to write a single word to a mapper seen as and array of uint32_t.
- * It has been designed to support remote access to the FAT mapper of the FATFS. 
- * It can be called by any thread running in any cluster.
- * In case of miss, it takes the mapper lock in WRITE_MODE, load the missing
- * page from device to mapper, and release the mapper lock.
- * It does not update the FAT on IOC device.
- *******************************************************************************************
- * @ mapper_xp	: [in]  extended pointer on the mapper.
- * @ page_id    : [in]  page index in mapper.
- * @ word_id    : [in]  32 bits word index in page.
- * @ value      : [in]  value to be written.
- * @ returns 0 if success / return -1 if error.
- ******************************************************************************************/
-error_t mapper_remote_set_32( xptr_t     mapper_xp,
-                              uint32_t   page_id,
-                              uint32_t   word_id,
-                              uint32_t   value );
-
-/*******************************************************************************************
- * This function scan all pages present in the mapper identified by the <mapper_xp>
- * argument, and synchronize all pages marked as "dirty" on disk. 
- * These pages are unmarked and removed from the local PPM dirty_list. 
- * It can be called by any thread running in any cluster.
- *******************************************************************************************
- * @ mapper_xp	: [in]  extended pointer on local mapper.
- * @ returns 0 if success / return -1 if error.
- ******************************************************************************************/
-error_t mapper_sync( xptr_t  mapper_xp );
-
-/*******************************************************************************************
- * This debug function displays the content of a given page of a given mapper, identified
- * by the <mapper_xp> and <page_id> arguments.
- * The number of bytes to display in page is defined by the <nbytes> argument.
- * The format is eigth (32 bits) words per line in hexadecimal.
- * It can be called by any thread running in any cluster.
- *******************************************************************************************
- * @ mapper_xp	: [in]  extended pointer on the mapper.
- * @ page_id	: [in]  page_index in mapper.
- * @ nbytes     : [in]  number of bytes in page.
- * @ returns 0 if success / return -1 if error.
- ******************************************************************************************/
-void mapper_display_page( xptr_t     mapper_xp,
-                          uint32_t   page_id,
-                          uint32_t   nbytes );
-
+ * page from device to the mapper, and release the mapper lock. 
+ *******************************************************************************************
+ * @ mapper	: local pointer on the mapper.
+ * @ index	: page index in file
+ * @ returns pointer on page descriptor if success / return NULL if error.
+ ******************************************************************************************/
+struct page_s * mapper_get_page( mapper_t * mapper,
+                                 uint32_t   index );
+
+/*******************************************************************************************
+ * This function makes an I/O operation to move one page from FS to mapper.
+ * Depending on the file system type, it calls the proper, FS specific function.
+ * It must be executed by a thread running in the cluster containing the mapper.
+ *******************************************************************************************
+ * @ mapper	: local pointer on the mapper.
+ * @ index	: page index in file.
+ * @ page   : local pointer on the page descriptor in mapper. 
+ * @ returns 0 if success / return EINVAL if it cannot access the device.
+ ******************************************************************************************/
+error_t mapper_updt_page( mapper_t      * mapper,
+                          uint32_t        index,
+                          struct page_s * page );        
+              
+/*******************************************************************************************
+ * This function makes an I/0 operation to move one page from mapper to FS.
+ * Depending on the file system type, it calls the proper, FS specific function.
+ * It must be executed by a thread running in the cluster containing the mapper.
+ * It does nothing if the page is not dirty. If the page is dirty, it takes
+ * the page lock before launching the IO operation, clear the page dirty bit,
+ * and remove the page from the PPM dirty list. It does nothing if the page is not dirty.
+ *******************************************************************************************
+ * @ mapper	: local pointer on the mapper.
+ * @ index	: page index in file.
+ * @ page   : local pointer on the page descriptor in mapper. 
+ * @ returns 0 if success / return EINVAL if it cannot access the device.
+ ******************************************************************************************/
+error_t mapper_sync_page( mapper_t      * mapper,
+                          uint32_t        index,
+                          struct page_s * page );        
 
 #endif /* _MAPPER_H_ */
Index: trunk/kernel/mm/page.c
===================================================================
--- trunk/kernel/mm/page.c	(revision 690)
+++ trunk/kernel/mm/page.c	(revision 1)
@@ -3,5 +3,5 @@
  *
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
- *          Alain Greiner    (2016,2017)
+ *          Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -23,10 +23,15 @@
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <hal_atomic.h>
 #include <list.h>
-#include <queuelock.h>
+#include <xlist.h>
 #include <memcpy.h>
+#include <thread.h>
+#include <scheduler.h>
+#include <cluster.h>
+#include <ppm.h>
+#include <mapper.h>
 #include <printk.h>
 #include <vfs.h>
@@ -35,4 +40,5 @@
 
 
+
 ////////////////////////////////////////
 inline void page_init( page_t   * page )
@@ -40,31 +46,181 @@
 	page->flags    = 0;
 	page->order    = 0;
+	page->index    = 0;
 	page->mapper   = NULL;
-	page->index    = 0;
-	page->refcount = 0;
-	page->forks    = 0;
-
-	remote_busylock_init( XPTR( local_cxy , &page->lock ), LOCK_PAGE_STATE );
+	page->private  = 0;
+    page->refcount = 0;
+	spinlock_init( &page->lock );
+	list_entry_init( &page->list );
 }
 
 ////////////////////////////////////////////
 inline void page_set_flag( page_t   * page,
-                           uint32_t   value )
-{
-	hal_atomic_or( (uint32_t *)&page->flags , (uint32_t)value );
+                           uint16_t   value )
+{
+    hal_atomic_or( (uint32_t *)&page->flags , (uint32_t)value );
 }
 
 //////////////////////////////////////////////
 inline void page_clear_flag( page_t   * page,
-                             uint32_t   value )
-{
-	hal_atomic_and( (uint32_t *)&page->flags , ~value );
+                             uint16_t   value )
+{
+    hal_atomic_and( (uint32_t *)&page->flags , ~((uint32_t)value) );
 }
 
 //////////////////////////////////////////////
 inline bool_t page_is_flag( page_t   * page,
-                            uint32_t   value )
-{
-    return ( (page->flags & value) ? 1 : 0 );
+                            uint16_t   value )
+{
+    return (bool_t)(page->flags & value);
+}
+
+//////////////////////////////////////
+bool_t page_do_dirty( page_t * page )
+{
+	bool_t done = false;
+
+    ppm_t * ppm = &LOCAL_CLUSTER->ppm;
+
+    // lock the PPM dirty_list
+	spinlock_lock( &ppm->dirty_lock );
+
+	if( !page_is_flag( page , PG_DIRTY ) )
+	{
+        // set dirty flag in page descriptor
+		page_set_flag( page , PG_DIRTY );
+  
+        // register page in PPM dirty list
+		list_add_first( &ppm->dirty_root , &page->list );
+		done = true;
+	}
+
+    // unlock the PPM dirty_list
+	spinlock_unlock( &ppm->dirty_lock );
+  
+	return done;
+}
+
+////////////////////////////////////////
+bool_t page_undo_dirty( page_t * page )
+{
+	bool_t done = false;
+
+    ppm_t * ppm = &LOCAL_CLUSTER->ppm;
+
+    // lock the dirty_list
+	spinlock_lock( &ppm->dirty_lock );
+
+	if( page_is_flag( page , PG_DIRTY) )
+	{
+        // clear dirty flag in page descriptor
+		page_clear_flag( page , PG_DIRTY );
+
+        // remove page from PPM dirty list
+		list_unlink( &page->list );
+		done = true;
+	}
+
+    // unlock the dirty_list
+	spinlock_unlock( &ppm->dirty_lock );
+
+	return done;
+}
+
+/////////////////////
+void sync_all_pages() 
+{
+	page_t   * page;
+	mapper_t * mapper;
+    uint32_t   index;
+    ppm_t    * ppm = &LOCAL_CLUSTER->ppm;
+
+    // lock the dirty_list
+	spinlock_lock( &ppm->dirty_lock );
+
+	while( !list_is_empty( &ppm->dirty_root ) ) 
+	{
+		page = LIST_FIRST( &ppm->dirty_root ,  page_t , list );
+
+        // unlock the dirty_list
+	    spinlock_unlock( &ppm->dirty_lock );
+
+		mapper = page->mapper;
+        index  = page->index;
+ 
+        // lock the page
+		page_lock( page );
+
+        // sync the page
+		mapper_sync_page( mapper , index , page );
+
+        // unlock the page
+		page_unlock( page );
+
+        // lock the dirty_list
+	    spinlock_lock( &ppm->dirty_lock );
+	}
+
+    // unlock the dirty_list
+	spinlock_unlock( &ppm->dirty_lock );
+
+} // end sync_all_pages()
+
+///////////////////////////////
+void page_lock( page_t * page )
+{
+    // take the spinlock protecting the PG_LOCKED flag
+	spinlock_lock( &page->lock );
+
+	if( page_is_flag( page , PG_LOCKED ) )  // page is already locked
+	{
+        // get pointer on calling thread
+        thread_t * thread = CURRENT_THREAD;
+
+        // register thread in the page waiting queue
+        xlist_add_last( XPTR( local_cxy , &page->wait_root ),
+                        XPTR( local_cxy , &thread->wait_list ) );
+
+        // release the spinlock
+		spinlock_unlock( &page->lock );
+
+        // deschedule the calling thread
+        thread_block( thread , THREAD_BLOCKED_PAGE );
+		sched_yield();
+	}
+	else                                    // page is not locked
+	{
+        // set the PG_LOCKED flag
+		page_set_flag( page , PG_LOCKED );
+
+        // release the spinlock
+		spinlock_unlock( &page->lock );
+	}
+}
+
+/////////////////////////////////
+void page_unlock( page_t * page )
+{
+    // take the spinlock protecting the PG_LOCKED flag
+	spinlock_lock( &page->lock );
+  
+    // check the page waiting list
+	bool_t is_empty = xlist_is_empty( XPTR( local_cxy , &page->wait_root ) );
+
+	if( is_empty == false )    // at least one waiting thread => resume it
+    {
+        // get an extended pointer on the first waiting thread
+        xptr_t root_xp   = XPTR( local_cxy , &page->wait_root ); 
+        xptr_t thread_xp = XLIST_FIRST_ELEMENT( root_xp , thread_t , wait_list );
+
+        // reactivate the first waiting thread
+        thread_unblock( thread_xp , THREAD_BLOCKED_PAGE );
+    }
+	else                      // no waiting thread => clear the PG_LOCKED flag
+	{
+        page_clear_flag( page , PG_LOCKED );
+    }
+
+    // release the spinlock
+	spinlock_unlock( &page->lock );
 }
 
@@ -72,5 +228,5 @@
 inline void page_refcount_up( page_t *page )
 {
-    hal_atomic_add( &page->refcount , +1 );
+    hal_atomic_inc( &page->refcount );
 }
 
@@ -78,5 +234,26 @@
 inline void page_refcount_down( page_t *page )
 {
-    hal_atomic_add( &page->refcount , -1 );
+    hal_atomic_dec( &page->refcount );
+}
+
+//////////////////////////////
+void page_copy(  page_t * dst,
+                 page_t * src )
+{
+	uint32_t  size;
+	void    * src_base;
+	void    * dst_base;
+  
+	if( dst->order != src->order )
+    {
+        printk("\n[PANIC] in %s : src size != dst size\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+	size = (1 << dst->order) * CONFIG_PPM_PAGE_SIZE;
+	src_base = ppm_page2base( src );
+	dst_base = ppm_page2base( dst );
+
+	memcpy( dst_base , src_base , size );
 }
 
@@ -84,91 +261,142 @@
 void page_zero( page_t * page )
 {
-	uint32_t   size = (1 << page->order) * CONFIG_PPM_PAGE_SIZE;
-
-	xptr_t base_xp = ppm_page2base( XPTR( local_cxy , page ) );
-
-	memset( GET_PTR( base_xp ) , 0 , size );
-}
-
-
-
-
-///////////////////////////////////////////////
-inline void page_remote_init( xptr_t  page_xp )
-{
-	hal_remote_memset( page_xp , 0 , sizeof(page_t) );
-
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-	remote_busylock_init( XPTR( page_cxy , &page_ptr->lock ), LOCK_PAGE_STATE );
-}
-
-////////////////////////////////////////////////////
-inline void page_remote_set_flag( xptr_t    page_xp,
-                                  uint32_t  value )
-{
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-	hal_remote_atomic_or( XPTR( page_cxy , &page_ptr->flags ) , value );
-}
-
-//////////////////////////////////////////////////////
-inline void page_remote_clear_flag( xptr_t    page_xp,
-                                    uint32_t  value )
-{
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-	hal_remote_atomic_and( XPTR( page_cxy , &page_ptr->flags ) , ~value );
-}
-
-/////////////////////////////////////////////////////
-inline bool_t page_remote_is_flag( xptr_t    page_xp,
-                                   uint32_t  value )
-{
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    uint32_t flags = hal_remote_l32( XPTR( page_cxy , &page_ptr->flags ) );
-    
-    return (flags & value) ? 1 : 0;
-}
-
-/////////////////////////////////////////////////////
-inline void page_remote_refcount_up( xptr_t page_xp )
-{
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    hal_remote_atomic_add( XPTR( page_cxy , &page_ptr->refcount ) , 1 );
-}
-
-///////////////////////////////////////////////////////
-inline void page_remote_refcount_down( xptr_t page_xp )
-{
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    hal_remote_atomic_add( XPTR( page_cxy , &page_ptr->refcount ) , -1 );
+	uint32_t   size;
+	void     * base;
+
+	size = (1 << page->order) * CONFIG_PPM_PAGE_SIZE;
+	base = ppm_page2base(page);
+
+	memset( base , 0 , size ); 
+}
+
+////////////////////////////////
+void page_print( page_t * page )
+{
+	printk("*** Page %d : base = %x / flags = %x / order = %d / count = %d\n",
+	        page->index, 
+	        ppm_page2base( page ),
+	        page->flags, 
+	        page->order, 
+	        page->refcount );
+}
+
+
+
+
+
+/*
+/////////////////////////////////////////
+static void page_to_free( page_t * page )
+{
+	assert((page->state == PGINVALID) || 
+	       (page->state == PGVALID)   ||
+	       (page->state == PGINIT));
+
+	if(page_refcount_get(page) != 0)
+	{
+		printk(ERROR, "ERROR: %s: cpu %d, pid %d, tid %x, page %x, state %x, count %d [%d]\n",
+		       __FUNCTION__,
+		       cpu_get_id(),
+		       current_task->pid,
+		       current_thread,
+		       page,
+		       page->state,
+		       page_refcount_get(page),
+		       cpu_time_stamp());
+	}
+	page->state = PGFREE;
+}
+
+////////////////////////////////////////////
+static void page_to_invalid( page_t * page )
+{
+	assert((page->state == PGFREE)  || 
+	       (page->state == PGVALID) ||
+	       (page->state == PGLOCKEDIO));
+  
+	if(page->state == PGLOCKEDIO)
+	{
+		page->state = PGINVALID; 
+		page_unlock(page);
+		return;
+	}
+ 
+	page->state = PGINVALID;
+}
+
+//////////////////////////////////////////
+static void page_to_valid( page_t * page )
+{
+	assert((page->state == PGINVALID) || 
+	       (page->state == PGLOCKED)  ||
+	       (page->state == PGLOCKEDIO));
+  
+	if(page->state == PGINVALID)
+	{
+		page->state = PGVALID;
+		return;
+	}
+
+	page->state = PGVALID;
+	page_unlock(page);
+}
+
+//////////////////////////////////////////////
+static void page_to_locked_io( page_t * page )
+{
+	assert((page->state == PGINVALID) || 
+	       (page->state == PGVALID));
+
+	page_lock(page);
+	page->state = PGLOCKEDIO;
 }
 
 ///////////////////////////////////////////
-void page_remote_display( xptr_t  page_xp )
-{
-    page_t  page;   // local copy of page decriptor
-
-    hal_remote_memcpy( XPTR( local_cxy , &page ) , page_xp , sizeof( page_t ) );
-                      
-	printk("*** Page %d in cluster %x : ppn %x / flags %x / order %d / refcount %d\n",
-	        page.index,
-            GET_CXY( page_xp ),
-	        ppm_page2ppn( page_xp ),
-	        page.flags,
-	        page.order,
-	        page.refcount );
-}
-
-
-
+static void page_to_locked( page_t * page )
+{
+	assert(page->state == PGVALID);
+	page_lock(page);
+	page->state = PGLOCKED;
+}
+
+/////////////////////////////////////////
+void page_state_set( page_t       * page,
+                     page_state_t   state )
+{
+	switch( state )
+	{
+	case PGFREE:
+		page_to_free(page);
+		return;
+
+	case PGINVALID:
+		page_to_invalid(page);
+		return;
+
+	case PGVALID:
+		page_to_valid(page);
+		return;
+
+	case PGLOCKEDIO:
+		page_to_locked_io(page);
+		return;
+
+	case PGLOCKED:
+		page_to_locked(page);
+		return;
+
+	case PGRESERVED:
+		refcount_set(&page->count,1);
+
+	case PGINIT:
+		page->state = new_state;
+		return;
+
+	default:
+		printk(ERROR, "ERROR: %s: Unknown Asked State %d\n", new_state);
+		return;
+	}
+}
+*/
+
+
Index: trunk/kernel/mm/page.h
===================================================================
--- trunk/kernel/mm/page.h	(revision 690)
+++ trunk/kernel/mm/page.h	(revision 1)
@@ -3,5 +3,5 @@
  *
  * Authors Ghassan Almalles (2008,2009,2010,2011,2012)
- *         Alain Greiner    (2016,2017,2018,2019,2020)
+ *         Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,13 +26,15 @@
 #define _PAGE_H_
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <remote_busylock.h>
+#include <almos_config.h>
+#include <hal_types.h>
+#include <spinlock.h>
 #include <list.h>
+#include <slist.h>
+#include <xlist.h>
 
 /***   Forward declarations   ***/
 
 struct mapper_s;
-
+ 
 /*************************************************************************************
  * This  defines the flags that can be attached to a physical page.
@@ -41,35 +43,44 @@
 #define PG_INIT		    0x0001     // page descriptor has been initialised
 #define PG_RESERVED	    0x0002     // cannot be allocated by PPM
-#define PG_FREE		    0x0004     // page not yet allocated by PPM
+#define PG_FREE		    0x0004     // page can be allocated by PPM
+#define PG_INLOAD	    0x0008     // on-going load from disk 
+#define PG_IO_ERR	    0x0010     // mapper signals a read/write access error
+#define PG_BUFFER	    0x0020     // used in blockio.c
 #define PG_DIRTY	    0x0040     // page has been written
-#define PG_COW          0x0080     // page is copy-on-write
+#define PG_LOCKED       0x0080     // page is locked
+
+#define PG_ALL          0xFFFF     // All flags
 
 /*************************************************************************************
  * This structure defines a physical page descriptor.
- * - The remote_busylock is used to allows any remote thread to atomically
- *   test/modify the forks counter or the flags.
- * - The list field is used to register the page in a free list, or in dirty list,
- *   as a given page cannot be simultaneously dirty and free.
- * - The refcount is used to release the page to the PPM.
- * NOTE: the size is 48 bytes for a 32 bits core.
+ * Size is 60 bytes for a 32 bits core...
  ************************************************************************************/
 
 typedef struct page_s
 {
-    uint32_t          flags;          /*! flags defined above                  (4)  */
-    uint32_t          order;          /*! log2( number of small pages)         (4)  */
+    uint16_t          flags;          /*! flags defined above                  (2)  */
+    uint16_t          order;          /*! log2( number of 4Kbytes pages)       (2)  */
+
     struct mapper_s * mapper;         /*! local pointer on associated mapper   (4)  */
     uint32_t          index;          /*! page index in mapper                 (4)  */
-	list_entry_t      list;           /*! for both dirty pages and free pages  (8)  */
-	int32_t           refcount;       /*! references counter for page release  (4)  */
-	uint32_t          forks;          /*! number of pending forks              (4)  */
-	remote_busylock_t lock;           /*! protect forks or flags modifs        (16) */
+ 
+	union                             /*!                                      (4)  */
+	{
+		uint32_t      private;        /*! TODO ??? [AG]                             */
+		void        * data;           /*! TODO ??? [AG]                             */
+		slist_entry_t root;           /*! TODO ??? [AG]                             */
+	};
+
+	list_entry_t      list;           /*! for both dirty pages and free pages  (8)  */ 
+
+    xlist_entry_t     wait_root;      /*! root of list of waiting threads      (16) */
+
+	uint32_t          refcount;       /*! reference counter                    (4)  */
+	spinlock_t        lock;           /*! only used to set the PG_LOCKED flag  (16) */
 }
 page_t;
 
 /*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It initializes the page descriptor.
- *************************************************************************************
+ * This function initializes one page descriptor.
  * @ page    : pointer to page descriptor
  ************************************************************************************/
@@ -77,38 +88,60 @@
 
 /*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It atomically set one or several flags in page descriptor flags.
- *************************************************************************************
+ * This function set one or several flags in page descriptor flags.
  * @ page    : pointer to page descriptor.
- * @ value   : all non zero bits in value will be set.
+ * @ value   : all non zero bits in value will be set. 
  ************************************************************************************/
 inline void page_set_flag( page_t   * page,
-                           uint32_t   value );
+                           uint16_t   value );
 
 /*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It atomically reset one or several flags in page descriptor flags.
- *************************************************************************************
+ * This function reset one or several flags in page descriptor flags.
  * @ page    : pointer to page descriptor.
- * @ value   : all non zero bits in value will be cleared.
+ * @ value   : all non zero bits in value will be cleared. 
  ************************************************************************************/
 inline void page_clear_flag( page_t   * page,
-                             uint32_t   value );
+                             uint16_t   value );
 
 /*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It tests the value of one or several flags in page descriptor flags.
- *************************************************************************************
+ * This function test the value of one or several flags in page descriptor flags.
  * @ page    : pointer to page descriptor.
  * @ value   : all non zero bits will be tested.
- * @ returns true if at least one non zero bit in value is set / false otherwise.
+ * @ returns true if at least one non zero bit in value is set / false otherwise. 
  ************************************************************************************/
 inline bool_t page_is_flag( page_t   * page,
-                            uint32_t   value );
+                            uint16_t   value );
 
 /*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It resets to 0 all bytes in a given page.
- *************************************************************************************
+ * This function synchronizes (i.e. update the disk) all dirty pages in a cluster.
+ * It scan the PPM dirty list, that should be empty when this operation is completed. 
+ ************************************************************************************/
+void sync_all_pages();
+
+/*************************************************************************************
+ * This function set the PG_DIRTY flag in the page descriptor,
+ * and register the page in the dirty list in PPM.
+ * @ page     : pointer on page descriptor.
+ * @ returns true if page was not dirty / returns false if page was dirty
+ ************************************************************************************/
+bool_t page_do_dirty( page_t * page );
+
+/*************************************************************************************
+ * This function reset the PG_DIRTY flag in the page descriptor,
+ * and remove the page from the dirty list in PPM.
+ * @ page     : pointer on page descriptor.
+ * @ returns true if page was dirty / returns false if page was not dirty 
+ ************************************************************************************/
+bool_t page_undo_dirty( page_t * page );
+
+/*************************************************************************************
+ * This function makes a local copy of the content of a src page  to a dst page.
+ * @ dst      : pointer on destination page descriptor.
+ * @ src      : pointer on source page descriptor.
+ ************************************************************************************/
+void page_copy( page_t * dst,
+                page_t * src );
+
+/*************************************************************************************
+ * This function reset to 0 all bytes in a given page. 
  * @ page     : pointer on page descriptor.
  ************************************************************************************/
@@ -116,7 +149,21 @@
 
 /*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It atomically increments the page refcount.
- *************************************************************************************
+ * This blocking function set the PG_LOCKED flag on the page.
+ * It deschedule if the page has already been locked by another thread,
+ * and returns only when the flag has been successfully set. 
+ * @ page     : pointer on page descriptor.
+ ************************************************************************************/
+void page_lock( page_t * page );
+
+/*************************************************************************************
+ * This blocking function reset the PG_LOCKED flag on the page, if there is no
+ * other waiting thread. IF there is waiting thread(s), it activates the first
+ * waiting thread without modifying the PG_LOCKED flag.
+ * @ page     : pointer on page descriptor.
+ ************************************************************************************/
+void page_unlock( page_t * page );
+
+/*************************************************************************************
+ * This blocking function atomically increment the page refcount.
  * @ page     : pointer on page descriptor.
  ************************************************************************************/
@@ -124,82 +171,14 @@
 
 /*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It atomically decrements the page refcount.
- *************************************************************************************
+ * This blocking function atomically decrement the page refcount.
  * @ page     : pointer on page descriptor.
  ************************************************************************************/
 inline void page_refcount_down( page_t * page );
 
+/*************************************************************************************
+ * This function display the values contained in a page descriptor.
+ ************************************************************************************/
+void page_print( page_t * page );
 
 
-
-
-/*************************************************************************************
- * This function must be called by a thread running in the local cluster.
- * It initializes the page descriptor.
- *************************************************************************************
- * @ page_xp    : extended pointer to page descriptor.
- ************************************************************************************/
-inline void page_remote_init( xptr_t  page_xp );
-
-/*************************************************************************************
- * This function can be called by any thread running in any cluster.
- * It atomically set one or several flags in a remote page descriptor
- * identified by the <page_xp> argument.
- *************************************************************************************
- * @ page_xp : extended pointer to page descriptor.
- * @ value   : all non zero bits in value will be set.
- ************************************************************************************/
-inline void page_remote_set_flag( xptr_t    page_xp,
-                                  uint32_t  value );
-
-/*************************************************************************************
- * This function can be called by any thread running in any cluster.
- * It atomically reset one or several flags in a remote page descriptor
- * identified by the <page_xp> argument.
- *************************************************************************************
- * @ page_xp : extended pointer to page descriptor.
- * @ value   : all non zero bits in value will be cleared.
- ************************************************************************************/
-inline void page_remote_clear_flag( xptr_t    page_xp,
-                                    uint32_t  value );
-
-/*************************************************************************************
- * This function can be called by any thread running in any cluster.
- * It tests the value of one or several flags in a remote page descriptor
- * identified by the <page_xp> argument.
- *************************************************************************************
- * @ page_xp : extended pointer to page descriptor.
- * @ value   : all non zero bits will be tested.
- * @ returns true if at least one non zero bit in value is set / false otherwise.
- ************************************************************************************/
-inline bool_t page_remote_is_flag( xptr_t    page_xp,
-                                   uint32_t  value );
-
-/*************************************************************************************
- * This function can be called by any thread running in any cluster.
- * It atomically increments the refcount for the remote page identified by
- * the <page_xp> argument.
- *************************************************************************************
- * @ page_xp   : extended pointer on page descriptor.
- ************************************************************************************/
-inline void page_remote_refcount_up( xptr_t page_xp );
-
-/*************************************************************************************
- * This function can be called by any thread running in any cluster.
- * It atomically decrements the refcount for the remote page identified by
- * the <page_xp> argument.
- *************************************************************************************
- * @ page_xp   : extended pointer on page descriptor.
- ************************************************************************************/
-inline void page_remote_refcount_down( xptr_t  page_xp );
-
-/*************************************************************************************
- * This debug function can be called by any thread running in any cluster.
- * It displays the values contained in a page descriptor.
- *************************************************************************************
- * @ page_xp     : extended pointer on page descriptor.
- ************************************************************************************/
-void page_remote_display( xptr_t  page_xp );
-
 #endif	/* _PAGE_H_ */
Index: trunk/kernel/mm/ppm.c
===================================================================
--- trunk/kernel/mm/ppm.c	(revision 690)
+++ trunk/kernel/mm/ppm.c	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * ppm.c -  Physical Pages Manager implementation
+ * ppm.c - Per-cluster Physical Pages Manager implementation
  *
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
- *          Alain Greiner    (2016,2017,2018,2019,2020)
+ *          Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -23,6 +23,6 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <printk.h>
@@ -30,301 +30,241 @@
 #include <bits.h>
 #include <page.h>
-#include <dqdt.h>
-#include <busylock.h>
-#include <queuelock.h>
+#include <spinlock.h>
 #include <thread.h>
 #include <cluster.h>
 #include <kmem.h>
 #include <process.h>
-#include <mapper.h>
+#include <dqdt.h>
 #include <ppm.h>
-#include <vfs.h>
-
-////////////////////////////////////////////////////////////////////////////////////////
-//         global variables
-////////////////////////////////////////////////////////////////////////////////////////
-
-extern chdev_directory_t    chdev_dir;          // allocated in kernel_init.c
-
-////////////////////////////////////////////////////////////////////////////////////////
-//     functions to  translate [ page <-> base <-> ppn ]
-////////////////////////////////////////////////////////////////////////////////////////
-
-/////////////////////////////////////////////
-inline xptr_t ppm_page2base( xptr_t page_xp )
-{
-	ppm_t  * ppm      = &LOCAL_CLUSTER->ppm;
-
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-   void   * base_ptr = ppm->vaddr_base + 
-                       ((page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_ORDER);
-
-	return XPTR( page_cxy , base_ptr );
-
-} // end ppm_page2base()
-
-/////////////////////////////////////////////
-inline xptr_t ppm_base2page( xptr_t base_xp )
-{
-	ppm_t  * ppm = &LOCAL_CLUSTER->ppm;
-
-    cxy_t    base_cxy = GET_CXY( base_xp );
-    void   * base_ptr = GET_PTR( base_xp );
-
-	page_t * page_ptr = ppm->pages_tbl + 
-                        ((base_ptr - ppm->vaddr_base)>>CONFIG_PPM_PAGE_ORDER);
-
-	return XPTR( base_cxy , page_ptr );
-
-}  // end ppm_base2page()
-
-
-
-///////////////////////////////////////////
-inline ppn_t ppm_page2ppn( xptr_t page_xp )
-{
-	ppm_t  * ppm      = &LOCAL_CLUSTER->ppm;
-
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    paddr_t  paddr    = PADDR( page_cxy , (page_ptr - ppm->pages_tbl)<<CONFIG_PPM_PAGE_ORDER );
-
-    return (ppn_t)(paddr >> CONFIG_PPM_PAGE_ORDER);
-
-}  // end hal_page2ppn()
+
+
+
+////////////////////////////////////////////////
+inline bool_t ppm_page_is_valid( page_t * page )
+{
+    ppm_t    * ppm  = &LOCAL_CLUSTER->ppm;
+	uint32_t   pgnr = (uint32_t)( page - ppm->pages_tbl );
+	return (pgnr <= ppm->pages_nr);
+}
+
+////////////////////////////////////////////
+inline void * ppm_page2base( page_t * page )
+{
+	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
+	return (void*)((page - ppm->pages_tbl) << CONFIG_PPM_PAGE_SHIFT);
+}
+
+////////////////////////////////////////////
+inline page_t * ppm_base2page( void * base ) 
+{
+	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
+	return (ppm->pages_tbl + (((uint32_t)base ) >> CONFIG_PPM_PAGE_SHIFT));
+}
+
+//////////////////////////////////////////
+inline ppn_t ppm_page2ppn( page_t * page )
+{
+	ppm_t  * ppm  = &LOCAL_CLUSTER->ppm;
+	return (ppn_t)( page - ppm->pages_tbl );
+}
+
+/////////////////////////////////////////
+inline page_t * ppm_ppn2page( ppn_t ppn )
+{
+	ppm_t  * ppm  = &LOCAL_CLUSTER->ppm;
+	return &ppm->pages_tbl[ppn];
+}
 
 ///////////////////////////////////////
-inline xptr_t ppm_ppn2page( ppn_t ppn )
-{
-	ppm_t   * ppm  = &LOCAL_CLUSTER->ppm;
-
-    paddr_t  paddr = ((paddr_t)ppn) << CONFIG_PPM_PAGE_ORDER;
-
-    cxy_t    cxy   = CXY_FROM_PADDR( paddr );
-    lpa_t    lpa   = LPA_FROM_PADDR( paddr );
-
-    return XPTR( cxy , &ppm->pages_tbl[lpa>>CONFIG_PPM_PAGE_ORDER] );
-
-}  // end hal_ppn2page
-
-
-
-///////////////////////////////////////
-inline xptr_t ppm_ppn2base( ppn_t ppn )
-{
-	ppm_t  * ppm   = &LOCAL_CLUSTER->ppm;
-   
-    paddr_t  paddr = ((paddr_t)ppn) << CONFIG_PPM_PAGE_ORDER;
-
-    cxy_t    cxy   = CXY_FROM_PADDR( paddr );
-    lpa_t    lpa   = LPA_FROM_PADDR( paddr );
-
-	return XPTR( cxy , (void *)ppm->vaddr_base + lpa );
-
-}  // end ppm_ppn2base()
-
-///////////////////////////////////////////
-inline ppn_t ppm_base2ppn( xptr_t base_xp )
-{
-	ppm_t  * ppm      = &LOCAL_CLUSTER->ppm;
-
-    cxy_t    base_cxy = GET_CXY( base_xp );
-    void   * base_ptr = GET_PTR( base_xp );
-
-    paddr_t  paddr    = PADDR( base_cxy , (base_ptr - ppm->vaddr_base) );
-
-    return (ppn_t)(paddr >> CONFIG_PPM_PAGE_ORDER);
-
-}  // end ppm_base2ppn()
-
-
-////////////////////////////////////////////////////////////////////////////////////////
-//     functions to  allocate / release  physical pages 
-////////////////////////////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////
-void ppm_free_pages_nolock( page_t * page )
-{
-	page_t   * buddy;               // searched buddy page descriptor
-	uint32_t   buddy_index;         // buddy page index in page_tbl[]
-	page_t   * current_ptr;         // current (merged) page descriptor
-	uint32_t   current_index;       // current (merged) page index in page_tbl[]
-	uint32_t   current_order;       // current (merged) page order
-
-	ppm_t    * ppm         = &LOCAL_CLUSTER->ppm;
-	page_t   * pages_tbl   = ppm->pages_tbl;
-
-assert( __FUNCTION__, !page_is_flag( page , PG_FREE ) ,
-"page already released : ppn = %x" , ppm_page2ppn( XPTR( local_cxy , page ) ) );
-
-assert( __FUNCTION__, !page_is_flag( page , PG_RESERVED ) ,
-"reserved page : ppn = %x" , ppm_page2ppn( XPTR( local_cxy , page ) ) );
-
-	// set FREE flag in released page descriptor
+inline void * ppm_ppn2base( ppn_t ppn )
+{
+	return (void*)( ppn << CONFIG_PPM_PAGE_SHIFT );
+}
+
+////////////////////////////////////////
+inline ppn_t ppm_base2ppn( void * base )
+{
+	return (ppn_t)( (uint32_t)base >> CONFIG_PPM_PAGE_SHIFT );
+}
+
+//////////////////////////////////////////////////
+static void ppm_free_pages_nolock( page_t * page )
+{
+    ppm_t    * ppm         = &LOCAL_CLUSTER->ppm;
+    page_t   * pages_tbl   = ppm->pages_tbl;
+    uint32_t   page_order  = page->order;
+    uint32_t   page_index  = (uint32_t)(page - ppm->pages_tbl);
+
+	page_t   * block;
+	uint32_t   block_index;
+	uint32_t   current_order;
+
+    // update page descriptor flag
 	page_set_flag( page , PG_FREE );
 
-    // initialise loop variables
-    current_ptr   = page;
-    current_order = page->order;
-	current_index = page - ppm->pages_tbl;
-
-	// search the buddy page descriptor
-	// - merge with current page if buddy found
-	// - exit to release the current page when buddy not found
-    while( current_order < CONFIG_PPM_MAX_ORDER )
+    // update free_lists
+	for( current_order = page_order ; current_order < CONFIG_PPM_MAX_ORDER ; current_order++ )
     {
-        // compute buddy page index and page descriptor
-		buddy_index = current_index ^ (1 << current_order);
-		buddy       = pages_tbl + buddy_index;
-        
-        // exit loop if buddy not found in current free list
-		if( !page_is_flag( buddy , PG_FREE ) || (buddy->order != current_order) ) break;
-
-        // remove buddy page from current free_list 
-		list_unlink( &buddy->list );
+		block_index = page_index ^ (1 << current_order);
+		block = pages_tbl + block_index;
+    
+		if( page_is_flag( block , PG_FREE ) || (block->order != current_order) ) break;
+
+		list_unlink( &block->list );
 		ppm->free_pages_nr[current_order] --;
-
-        // reset order field in buddy page descriptor
-		buddy->order = 0;
-
-		// compute next values for loop variables
-		current_index &= buddy_index;
-        current_order++;
-        current_ptr = pages_tbl + current_index; 
+        ppm->total_free_pages -= (1 << current_order);
+    
+		block->order = 0;
+		page_index &= block_index;
+	}
+  
+	block        = pages_tbl + page_index;
+	block->order = current_order;
+
+	list_add_first( &ppm->free_pages_root[current_order] , &block->list );
+	ppm->free_pages_nr[current_order] ++;
+    ppm->total_free_pages += (1 << current_order);
+
+}  // end ppm_free_pages_nolock()
+
+/////////////////////////////////
+void ppm_init( ppm_t    * ppm,
+               uint32_t   pages_nr,        // total pages number
+               uint32_t   pages_offset )   // occupied pages
+{
+	uint32_t   i;
+
+    // set signature
+	ppm->signature = PPM_SIGNATURE;
+
+    // initialize lock protecting the free_pages[] array
+	spinlock_init( &ppm->free_lock );
+
+    // initialize free_pages[] array as empty
+	ppm->total_free_pages = 0;
+	for( i = 0 ; i < CONFIG_PPM_MAX_ORDER ; i++ )
+	{
+		list_root_init( &ppm->free_pages_root[i] );
+		ppm->free_pages_nr[i] = 0;
+	}
+  
+    // initialize dirty_list as empty
+    list_root_init( &ppm->dirty_root );
+
+    // initialize pointer on page descriptors array 
+	ppm->pages_tbl = (page_t*)( pages_offset << CONFIG_PPM_PAGE_SHIFT );
+
+    // compute size of pages descriptor array rounded to an integer number of pages
+    uint32_t bytes = ARROUND_UP( pages_nr * sizeof(page_t), CONFIG_PPM_PAGE_SIZE );
+
+    // compute number of pages required to store page descriptor array
+	uint32_t pages_array  = bytes >> CONFIG_PPM_PAGE_SHIFT;
+
+    // compute total number of reserved pages (kernel code & pages_tbl[])
+	uint32_t reserved_pages = pages_offset + pages_array;
+
+	// set pages numbers 
+	ppm->pages_nr      = pages_nr;
+    ppm->pages_offset  = pages_offset;
+
+    // initialises all page descriptors in pages_tbl[]
+    // TODO Peut-on accélérer ces monstrueuses boucle ? [AG]
+	for( i = 0 ; i < pages_nr ; i++ )
+    { 
+        page_init( &ppm->pages_tbl[i] );
+    } 
+
+    // set PG_RESERVED flag for reserved pages (kernel code & pages_tbl[]) 
+	for( i = 0 ; i < reserved_pages ; i++) 
+    {
+        page_set_flag( &ppm->pages_tbl[i] , PG_RESERVED );
     }
 
-	// update order field for merged page descriptor 
-	current_ptr->order = current_order;
-
-	// insert merged page in relevant free list
-	list_add_first( &ppm->free_pages_root[current_order] , &current_ptr->list );
-	ppm->free_pages_nr[current_order] ++;
-
-}  // end ppm_free_pages_nolock()
+    // initialise the free lists by releasing all non reserved pages
+	for( i = 0 ; i < pages_nr ; i++ )
+	{
+		page_t * page = &ppm->pages_tbl[i];
+		if( page_is_flag( page , PG_RESERVED) ) ppm_free_pages_nolock( page );
+	}
+} // end ppm_init()
 
 ////////////////////////////////////////////
 page_t * ppm_alloc_pages( uint32_t   order )
 {
-	page_t   * current_block;
-	uint32_t   current_order;
+    uint32_t   current_order;
+	page_t   * remaining_block;
 	uint32_t   current_size;
-	page_t   * found_block;  
-
-	ppm_t    * ppm = &LOCAL_CLUSTER->ppm;
-
-#if DEBUG_PPM_ALLOC_PAGES || DEBUG_PPM_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_PPM_ALLOC_PAGES 
-if( DEBUG_PPM_ALLOC_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] enter for %d page(s) in cluster %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 1<<order, local_cxy, cycle );
-    if( DEBUG_PPM_ALLOC_PAGES & 1 ) ppm_remote_display( local_cxy );
-}
-#endif
-
-// check order
-assert( __FUNCTION__, (order < CONFIG_PPM_MAX_ORDER) ,
-"illegal order argument = %d" , order );
-
-    //build extended pointer on lock protecting remote PPM
-    xptr_t lock_xp = XPTR( local_cxy , &ppm->free_lock );
-
-	// take lock protecting free lists
-	remote_busylock_acquire( lock_xp );
-
-	current_block = NULL;
-    current_order = order;
-
-	// search a free block equal or larger than requested size
-	while( current_order < CONFIG_PPM_MAX_ORDER )
-	{
-        // get local pointer on the root of relevant free_list (same in all clusters)
-        list_entry_t * root = &ppm->free_pages_root[current_order];
-
-		if( !list_is_empty( root ) )
+
+    ppm_t    * ppm = &LOCAL_CLUSTER->ppm;
+
+	if( ppm->signature != PPM_SIGNATURE )
+    {
+        printk("\n[PANIC] in %s : PPM non initialised in cluster %x\n",
+               __FUNCTION__ , local_cxy );
+        hal_core_sleep();
+    }
+
+	if( order >= CONFIG_PPM_MAX_ORDER )
+    {
+        printk("\n[PANIC] in %s : illegal order argument in cluster %x\n",
+               __FUNCTION__ , local_cxy );
+        hal_core_sleep();
+    }
+
+	page_t * block = NULL;
+
+    // take lock protecting free lists
+	spinlock_lock( &ppm->free_lock );
+
+    // find a block larger or equal to requested size
+	for( current_order = order ; current_order < CONFIG_PPM_MAX_ORDER ; current_order ++ )
+	{
+		if( !list_is_empty( &ppm->free_pages_root[current_order] ) )
 		{
-            // get first free block in this free_list
-			current_block = LIST_FIRST( root , page_t , list );
-
-            // remove this block from this free_list
-			list_unlink( &current_block->list );
-	        ppm->free_pages_nr[current_order] --;
-
-            // register pointer on found block
-            found_block = current_block;
-
-            // compute found block size
-	        current_size = (1 << current_order);
-
-			break;	
+			block = LIST_FIRST( &ppm->free_pages_root[current_order] , page_t , list );
+			list_unlink( &block->list );
+			break;
 		}
-
-        // increment loop index
-        current_order++;
-	}
-
-	if( current_block == NULL ) // return failure if no free block found
-	{
-
-#if DEBUG_PPM_ERROR
-printk("\n[ERROR] in %s thread[%x,%x] cannot allocate %d page(s) in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 1<<order, local_cxy, cycle );
-#endif
+	}
+
+	if( block == NULL ) // return failure
+	{
         // release lock protecting free lists
-		remote_busylock_release( lock_xp );
-		return NULL;
-	}
-
-
-	// split the found block in smaller sub-blocks if required
-	// and update the free-lists accordingly
+	    spinlock_unlock( &ppm->free_lock );
+
+        return NULL;
+    }
+  
+    // update free-lists after removing a block 
+	ppm->total_free_pages -= (1 << current_order);
+	ppm->free_pages_nr[current_order] --;  
+	current_size = (1 << current_order);
+
+    // split the removed block in smaller sub-blocks if required
+    // and update the free-lists accordingly
 	while( current_order > order )
 	{
-        // update size and order
 		current_order --;
 		current_size >>= 1;
-
-        // update order fields in new free block
-		current_block = found_block + current_size;
-		current_block->order = current_order;
-
-        // insert new free block in relevant free_list
-		list_add_first( &ppm->free_pages_root[current_order] , &current_block->list );
+    
+		remaining_block = block + current_size;
+		remaining_block->order = current_order;
+
+		list_add_first( &ppm->free_pages_root[current_order] , &remaining_block->list );
 		ppm->free_pages_nr[current_order] ++;
-	}
-
-	// update found block page descriptor
-	page_clear_flag( found_block , PG_FREE );
-	page_refcount_up( found_block );
-	found_block->order = order;
-
-	// release lock protecting free lists
-	remote_busylock_release( lock_xp );
-
-    // update DQDT
-    dqdt_increment_pages( local_cxy , order );
-
-    hal_fence();
-
-#if DEBUG_PPM_ALLOC_PAGES
-if( DEBUG_PPM_ALLOC_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] allocated %d page(s) in cluster %x / ppn %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 
-    1<<order, local_cxy, ppm_page2ppn(XPTR( local_cxy , found_block )), cycle );
-    if( DEBUG_PPM_ALLOC_PAGES & 1 ) ppm_remote_display( local_cxy );
-}
-#endif
-
-	return found_block;
-
-}  // end ppm_alloc_pages()
+        ppm->total_free_pages += (1 << current_order);
+	}
+  
+    // update page descriptor
+    page_clear_flag( block , PG_FREE );
+	page_refcount_up( block );
+	block->order = order;
+
+    // release lock protecting free lists
+	spinlock_unlock( &ppm->free_lock );
+  
+	return block;
+}  // end pmm_alloc-pages()
+
 
 ////////////////////////////////////
@@ -332,359 +272,16 @@
 {
 	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-#if DEBUG_PPM_FREE_PAGES
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_PPM_FREE_PAGES 
-if( DEBUG_PPM_FREE_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] enter for %d page(s) in cluster %x / ppn %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 
-    1<<page->order, local_cxy, ppm_page2ppn(XPTR(local_cxy , page)), cycle );
-    if( DEBUG_PPM_FREE_PAGES & 1 ) ppm_remote_display( local_cxy );
-}
-#endif
-
-    //build extended pointer on lock protecting free_lists
-    xptr_t lock_xp = XPTR( local_cxy , &ppm->free_lock );
-
-	// get lock protecting free_pages[] array
-	remote_busylock_acquire( lock_xp );
-
-	ppm_free_pages_nolock( page );
-
-	// release lock protecting free_lists
-	remote_busylock_release( lock_xp );
-
-    // update DQDT
-    dqdt_decrement_pages( local_cxy , page->order );
-
-    hal_fence();
-
-#if DEBUG_PPM_FREE_PAGES
-if( DEBUG_PPM_FREE_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] released %d page(s) in cluster %x / ppn %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 
-    1<<page->order, local_cxy, ppm_page2ppn(XPTR(local_cxy , page)) , cycle );
-    if( DEBUG_PPM_FREE_PAGES & 1 ) ppm_remote_display( local_cxy );
-}
-#endif
-
-}  // end ppm_free_pages()
-
-
-/////////////////////////////////////////////
-xptr_t ppm_remote_alloc_pages( cxy_t     cxy,
-                               uint32_t  order )
-{
-	uint32_t   current_order;
-	uint32_t   current_size;
-    page_t   * current_block;   
-    page_t   * found_block;
-
-// check order
-assert( __FUNCTION__, (order < CONFIG_PPM_MAX_ORDER) ,
-"illegal order argument = %d" , order );
-
-    // get local pointer on PPM (same in all clusters)
-	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-#if DEBUG_PPM_ALLOC_PAGES || DEBUG_PPM_ERROR
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_PPM_ALLOC_PAGES
-if( DEBUG_PPM_ALLOC_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] enter for %d page(s) in cluster %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 1<<order, cxy, cycle );
-    if( DEBUG_PPM_ALLOC_PAGES & 1 ) ppm_remote_display( cxy );
-}
-#endif
-
-    //build extended pointer on lock protecting remote PPM
-    xptr_t lock_xp = XPTR( cxy , &ppm->free_lock );
-
-	// take lock protecting free lists in remote cluster
-	remote_busylock_acquire( lock_xp );
-
-    current_block = NULL;    
-    current_order = order;
-
-    // search a free block equal or larger than requested size
-    while( current_order < CONFIG_PPM_MAX_ORDER )
-    {
-        // get local pointer on the root of relevant free_list (same in all clusters)
-        list_entry_t * root = &ppm->free_pages_root[current_order];
-
-		if( !list_remote_is_empty( cxy , root ) )  // list non empty => success
-		{
-            // get local pointer on first free page descriptor in remote cluster
-			current_block = LIST_REMOTE_FIRST( cxy, root , page_t , list );
-
-            // remove first free page from the free-list in remote cluster
-			list_remote_unlink( cxy , &current_block->list );
-	        hal_remote_atomic_add( XPTR( cxy , &ppm->free_pages_nr[current_order] ), -1 );
-
-            // register found block
-            found_block = current_block;
-
-            // compute found block size
-	        current_size = (1 << current_order);
-
-			break;
-		}
-
-        // increment loop index
-        current_order++;
-	}
-
-	if( current_block == NULL ) // return failure
-	{
-
-#if DEBUG_PPM_ERROR
- printk("\n[ERROR] in %s : thread[%x,%x] cannot allocate %d page(s) in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 1<<order, cxy, cycle );
-#endif
-		// release lock protecting free lists
-		remote_busylock_release( lock_xp );
-		return XPTR_NULL;
-	}
-
-	// split the found block in smaller sub-blocks if required
-	// and update the free-lists accordingly in remote cluster
-	while( current_order > order )
-	{
-        // update order and size
-		current_order --;
-		current_size >>= 1;
-
-        // update new free block order field in remote cluster 
-		current_block = found_block + current_size;
-		hal_remote_s32( XPTR( cxy , &current_block->order ) , current_order );
-
-        // get local pointer on the root of the relevant free_list in remote cluster  
-        list_entry_t * root = &ppm->free_pages_root[current_order];
-
-        // insert new free block in this free_list
-		list_remote_add_first( cxy , root, &current_block->list );
-
-        // update free-list number of items in remote cluster
-        hal_remote_atomic_add( XPTR(cxy , &ppm->free_pages_nr[current_order]), 1 );
-	}
-
-	// update refcount, flags and order fields in found block 
-	page_remote_clear_flag( XPTR( cxy , found_block ), PG_FREE );
-	page_remote_refcount_up( XPTR( cxy , found_block ) );
-	hal_remote_s32( XPTR( cxy , &found_block->order ) , order );
-    
-	// release lock protecting free lists in remote cluster
-	remote_busylock_release( lock_xp );
-
-    // update DQDT page counter in remote cluster
-    dqdt_increment_pages( cxy , order );
-
-    hal_fence();
-
-#if DEBUG_PPM_ALLOC_PAGES
-if( DEBUG_PPM_ALLOC_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] allocated %d page(s) in cluster %x / ppn %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 
-    1<<order, cxy, ppm_page2ppn(XPTR( cxy , found_block )), cycle );
-    if( DEBUG_PPM_ALLOC_PAGES & 1 ) ppm_remote_display( cxy );
-}
-#endif
-
-	return XPTR( cxy , found_block );
-
-}  // end ppm_remote_alloc_pages()
-
-///////////////////////////////////////////////
-void ppm_remote_free_pages( cxy_t     page_cxy,
-                            page_t  * page_ptr )
-{
-    xptr_t     page_xp;          // extended pointer on released page descriptor
-	page_t   * buddy_ptr;        // searched buddy page descriptor
-    uint32_t   buddy_order;      // searched buddy page order
-	uint32_t   buddy_index;      // buddy page index in page_tbl[]
-	page_t   * current_ptr;      // current (merged) page descriptor
-	uint32_t   current_index;    // current (merged) page index in page_tbl[]
-	uint32_t   current_order;    // current (merged) page order
-
-    // get local pointer on PPM (same in all clusters)
-	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-    // get page ppn and order
-    uint32_t   order = hal_remote_l32( XPTR( page_cxy , &page_ptr->order ) );
-
-#if DEBUG_PPM_FREE_PAGES
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-ppn_t      ppn   = ppm_page2ppn( XPTR( page_cxy , page_ptr ) );
-#endif
-
-#if DEBUG_PPM_FREE_PAGES
-if( DEBUG_PPM_FREE_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] enter for %d page(s) in cluster %x / ppn %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 1<<order, page_cxy, ppn, cycle );
-    if( DEBUG_PPM_FREE_PAGES & 1 ) ppm_remote_display( page_cxy );
-}
-#endif
-
-    // build extended pointer on released page descriptor
-    page_xp = XPTR( page_cxy , page_ptr );
-    
-    // build extended pointer on lock protecting remote PPM
-    xptr_t lock_xp = XPTR( page_cxy , &ppm->free_lock );
-
-    // get local pointer on remote PPM page_tbl[] array 
-	page_t * pages_tbl = hal_remote_lpt( XPTR( page_cxy , &ppm->pages_tbl ) );
-
-	// get lock protecting free_pages in remote cluster
-	remote_busylock_acquire( lock_xp );
-
-assert( __FUNCTION__, !page_remote_is_flag( page_xp , PG_FREE ) ,
-"page already released : ppn = %x" , ppm_page2ppn(XPTR( page_cxy , page_ptr ) ) );
-
-assert( __FUNCTION__, !page_remote_is_flag( page_xp , PG_RESERVED ) ,
-"reserved page : ppn = %x" , ppm_page2ppn(XPTR( page_cxy , page_ptr ) ) );
-
-	// set the FREE flag in released page descriptor
-	page_remote_set_flag( page_xp , PG_FREE );
-
-    // initialise loop variables
-    current_ptr   = page_ptr;
-    current_order = order;
-	current_index = page_ptr - ppm->pages_tbl;
-
-	// search the buddy page descriptor
-	// - merge with current page descriptor if buddy found
-	// - exit to release the current page descriptor if buddy not found
-    while( current_order < CONFIG_PPM_MAX_ORDER )
-    {
-        // compute buddy page index and local pointer on page descriptor
-		buddy_index = current_index ^ (1 << current_order);
-		buddy_ptr   = pages_tbl + buddy_index;
-
-        // get buddy order
-        buddy_order = hal_remote_l32( XPTR( page_cxy , &buddy_ptr->order ) );
-        
-        // exit loop if buddy not found
-		if( !page_remote_is_flag( XPTR( page_cxy , buddy_ptr ) , PG_FREE ) || 
-            (buddy_order != current_order) ) break;
-
-        // remove buddy page from its free list in remote cluster
-		list_remote_unlink( page_cxy , &buddy_ptr->list );
-        hal_remote_atomic_add( XPTR( page_cxy , &ppm->free_pages_nr[current_order] ) , -1 );
-
-        // reset order field in buddy page descriptor
-        hal_remote_s32( XPTR( page_cxy , &buddy_ptr->order ) , 0 );
-
-		// compute next values for loop variables
-		current_index &= buddy_index;
-        current_order++;
-        current_ptr = pages_tbl + current_index; 
-
-    }  // end loop on order
-
-	// update current (merged) page descriptor order field
-    hal_remote_s32( XPTR( page_cxy , &current_ptr->order ) , current_order );
-
-	// insert current (merged) page into relevant free list
-	list_remote_add_first( page_cxy, &ppm->free_pages_root[current_order], &current_ptr->list );
-    hal_remote_atomic_add( XPTR( page_cxy , &ppm->free_pages_nr[current_order] ) , 1 );
-
-	// release lock protecting free_pages[] array
-	remote_busylock_release( lock_xp );
-
-    // update DQDT
-    dqdt_decrement_pages( page_cxy , page_ptr->order );
-
-    hal_fence();
-
-#if DEBUG_PPM_FREE_PAGES
-if( DEBUG_PPM_FREE_PAGES < cycle )
-{
-    printk("\n[%s] thread[%x,%x] released %d page(s) in cluster %x / ppn %x / cycle %d\n",
-    __FUNCTION__, this->process->pid, this->trdid, 1<<order, page_cxy, ppn, cycle );
-    if( DEBUG_PPM_FREE_PAGES & 1 ) ppm_remote_display( page_cxy );
-}
-#endif
-
-}  // end ppm_remote_free_pages()
-
-////////////////////////////////////
-void ppm_remote_display( cxy_t cxy )
-{
-	uint32_t       order;
-	list_entry_t * iter;
-    xptr_t         page_xp;
-
-    ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-    // get remote PPM general parameters
-    uint32_t   pages_nr   = hal_remote_l32( XPTR( cxy , &ppm->pages_nr ) );
-    void     * vaddr_base = hal_remote_lpt( XPTR( cxy , &ppm->vaddr_base ) );  
-    void     * pages_tbl  = hal_remote_lpt( XPTR( cxy , &ppm->pages_tbl ) );  
-
-    // build extended pointer on lock protecting remote PPM
-    xptr_t ppm_lock_xp = XPTR( cxy , &ppm->free_lock );
-
-    // get pointers on TXT0 chdev
-    xptr_t    txt0_xp  = chdev_dir.txt_tx[0];
-    cxy_t     txt0_cxy = GET_CXY( txt0_xp );
-    chdev_t * txt0_ptr = GET_PTR( txt0_xp );
-
-    // build extended pointer on remote TXT0 lock
-    xptr_t  txt_lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock );
-
-	// get PPM lock 
-	remote_busylock_acquire( ppm_lock_xp );
-
-    // get TXT0 lock 
-    remote_busylock_acquire( txt_lock_xp );
-
-	nolock_printk("\n***** PPM in cluster %x / %d pages / page_tbl %x / vaddr_base %x\n",
-    local_cxy, pages_nr, pages_tbl, vaddr_base );
-
-	for( order = 0 ; order < CONFIG_PPM_MAX_ORDER ; order++ )
-	{
-        // get number of free pages for free_list[order] in remote cluster
-        uint32_t n = hal_remote_l32( XPTR( cxy , &ppm->free_pages_nr[order] ) );
-
-        // display forward free_list[order]
-		nolock_printk("- forward  : order = %d / n = %d : ", order , n );
-		LIST_REMOTE_FOREACH( cxy , &ppm->free_pages_root[order] , iter )
-		{
-            page_xp = XPTR( cxy , LIST_ELEMENT( iter , page_t , list ) );
-			nolock_printk("%x," , ppm_page2ppn( page_xp ) );
-		}
-		nolock_printk("\n");
-
-        // display backward free_list[order]
-		nolock_printk("- backward : order = %d / n = %d : ", order , n );
-		LIST_REMOTE_FOREACH_BACKWARD( cxy , &ppm->free_pages_root[order] , iter )
-		{
-            page_xp = XPTR( cxy , LIST_ELEMENT( iter , page_t , list ) );
-			nolock_printk("%x," , ppm_page2ppn( page_xp ) );
-		}
-		nolock_printk("\n");
-	}
-
-	// release TXT0 lock
-	remote_busylock_release( txt_lock_xp );
-
-	// release PPM lock
-	remote_busylock_release( ppm_lock_xp );
-}
-
-////////////////////////////////
-error_t ppm_assert_order( void )
+  
+    // get lock protecting free_pages[] array
+	spinlock_lock( &ppm->free_lock );
+
+	ppm_free_pages_nolock( page ); 
+
+    // release lock protecting free_pages[] array
+	spinlock_unlock( &ppm->free_lock );
+}
+
+/////////////////////////////
+void ppm_print( ppm_t * ppm )
 {
 	uint32_t       order;
@@ -692,154 +289,51 @@
 	page_t       * page;
 
-    ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-	for( order=0 ; order < CONFIG_PPM_MAX_ORDER ; order++ )
-	{
-		if( list_is_empty( &ppm->free_pages_root[order] ) ) continue;
-
+    // get lock protecting free lists
+	spinlock_lock( &ppm->free_lock );
+
+	printk("***  PPM state in cluster %x : pages = %d / offset = %d / free = %d ***\n",
+	       local_cxy , ppm->pages_nr , ppm->pages_offset , ppm->total_free_pages ); 
+	
+	for( order = 0 ; order < CONFIG_PPM_MAX_ORDER ; order++ )
+	{
+		printk("- order = %d / free_pages = %d  [\n",
+               order , ppm->free_pages_nr[order] );
+		
 		LIST_FOREACH( &ppm->free_pages_root[order] , iter )
 		{
 			page = LIST_ELEMENT( iter , page_t , list );
-			if( page->order != order )  return -1;
+			printk("%d," , page - ppm->pages_tbl );
 		}
-	}
-
-	return 0;
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////////
-//     functions to handle  dirty physical pages
-//////////////////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////
-bool_t ppm_page_do_dirty( xptr_t page_xp )
-{
-	bool_t done = false;
-
-    // get page cluster and local pointer
-    page_t * page_ptr = GET_PTR( page_xp );
-    cxy_t    page_cxy = GET_CXY( page_xp );
-
-    // get local pointer on PPM (same in all clusters)
-	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-    // build extended pointers on page lock, page flags, and PPM dirty list lock
-    xptr_t page_lock_xp  = XPTR( page_cxy , &page_ptr->lock  );    
-    xptr_t page_flags_xp = XPTR( page_cxy , &page_ptr->flags );
-    xptr_t dirty_lock_xp = XPTR( page_cxy , &ppm->dirty_lock );
-           
-	// lock the remote PPM dirty_list
-	remote_queuelock_acquire( dirty_lock_xp );
-
-    // lock the remote page
-    remote_busylock_acquire( page_lock_xp );
-
-    // get remote page flags
-    uint32_t flags = hal_remote_l32( page_flags_xp );
-
-	if( (flags & PG_DIRTY) == 0 )
-	{
-		// set dirty flag in page descriptor
-        hal_remote_s32( page_flags_xp , flags | PG_DIRTY );
-
-		// insert the page in the remote dirty list
-        list_remote_add_first( page_cxy , &ppm->dirty_root , &page_ptr->list );
-
-		done = true;
-	}
-
-    // unlock the remote page
-    remote_busylock_release( page_lock_xp );
-
-	// unlock the remote PPM dirty_list
-	remote_queuelock_release( dirty_lock_xp );
-
-	return done;
-
-} // end ppm_page_do_dirty()
-
-////////////////////////////////////////////
-bool_t ppm_page_undo_dirty( xptr_t page_xp )
-{
-	bool_t done = false;
-
-    // get page cluster and local pointer
-    page_t * page_ptr = GET_PTR( page_xp );
-    cxy_t    page_cxy = GET_CXY( page_xp );
-
-    // get local pointer on PPM (same in all clusters)
-	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-    // build extended pointers on page lock, page flags, and PPM dirty list lock
-    xptr_t page_lock_xp  = XPTR( page_cxy , &page_ptr->lock  );
-    xptr_t page_flags_xp = XPTR( page_cxy , &page_ptr->flags );
-    xptr_t dirty_lock_xp = XPTR( page_cxy , &ppm->dirty_lock );
-           
-	// lock the remote PPM dirty_list
-	remote_queuelock_acquire( XPTR( page_cxy , &ppm->dirty_lock ) );
-
-    // lock the remote page
-    remote_busylock_acquire( page_lock_xp );
-
-    // get remote page flags
-    uint32_t flags = hal_remote_l32( page_flags_xp );
-
-	if( (flags & PG_DIRTY) )  // page is dirty
-	{
-		// reset dirty flag in page descriptor
-        hal_remote_s32( page_flags_xp , flags & (~PG_DIRTY) );
-
-        // remove the page from remote dirty list
-        list_remote_unlink( page_cxy , &page_ptr->list );
-
-		done = true;
-	}
-
-    // unlock the remote page
-    remote_busylock_release( page_lock_xp );
-
-	// unlock the remote PPM dirty_list
-	remote_queuelock_release( dirty_lock_xp );
-
-	return done;
-
-}  // end ppm_page_undo_dirty()
-
-/////////////////////////////////
-void ppm_sync_dirty_pages( void )
-{
-	ppm_t * ppm = &LOCAL_CLUSTER->ppm;
-
-    // get local pointer on PPM dirty_root
-    list_entry_t * dirty_root = &ppm->dirty_root;
-
-    // build extended pointer on PPM dirty_lock 
-    xptr_t dirty_lock_xp = XPTR( local_cxy , &ppm->dirty_lock );
-
-	// get the PPM dirty_list lock
-	remote_queuelock_acquire( dirty_lock_xp );
-
-	while( !list_is_empty( &ppm->dirty_root ) )
-	{
-		page_t * page = LIST_FIRST( dirty_root ,  page_t , list );
-        xptr_t   page_xp = XPTR( local_cxy , page );
-
-        // build extended pointer on page lock
-        xptr_t page_lock_xp = XPTR( local_cxy , &page->lock );
-
-		// get the page lock
-		remote_busylock_acquire( page_lock_xp );
-
-		// sync the page
-		vfs_fs_move_page( page_xp , false );  // from mapper to device
-
-		// release the page lock
-		remote_busylock_release( page_lock_xp );
-	}
-
-	// release the PPM dirty_list lock
-	remote_queuelock_release( dirty_lock_xp );
-
-}  // end ppm_sync_dirty_pages()
-
+    
+		printk("]\n", NULL );
+	}
+
+    // release lock protecting free lists
+	spinlock_unlock( &ppm->free_lock );
+}
+
+////////////////////////////////////////
+void ppm_assert_order(struct ppm_s *ppm)
+{
+	uint32_t       order;
+	list_entry_t * iter;
+	page_t       * page;
+	
+	for(order=0; order < CONFIG_PPM_MAX_ORDER; order++)
+	{
+		if( list_is_empty( &ppm->free_pages_root[order] ) ) continue;
+		
+		LIST_FOREACH( &ppm->free_pages_root[order] , iter )
+		{
+			page = LIST_ELEMENT( iter , page_t , list );
+
+			if( page->order != order )
+            {
+	            printk("%s detected inconsistency at order %d, page %d\n", 
+	                   __FUNCTION__, order , page - ppm->pages_tbl );
+            }
+		}
+	}
+	return;
+}
+
Index: trunk/kernel/mm/ppm.h
===================================================================
--- trunk/kernel/mm/ppm.h	(revision 690)
+++ trunk/kernel/mm/ppm.h	(revision 1)
@@ -1,7 +1,7 @@
 /*
- * ppm.h - Per-cluster Physical Pages Manager definition.
- *
+ * ppm.h - Per-cluster Physical Pages Manager Interface
+ * 
  * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
- *          Alain Greiner    (2016,2017,2018,2019,2020)
+ *          Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -26,244 +26,137 @@
 #define _PPM_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <list.h>
-#include <busylock.h>
-#include <remote_queuelock.h>
+#include <spinlock.h>
 #include <boot_info.h>
 #include <page.h>
 
+#define  PPM_SIGNATURE     0xBABEF00D
 
 /*****************************************************************************************
- * This structure defines the Physical Pages Manager in a cluster.
- * In each cluster, the physical memory bank starts at local physical address 0 and
- * contains an integer number of small pages, defined by the <pages_nr> field in the
- * boot_info structure. It is split in three parts:
- *
- * - the "kernel_code" section contains the kernel code, loaded by the boot-loader.
- *   It starts at local PPN = 0 and the size is defined by the <pages_offset> field
- *   in the boot_info structure.
- * - the local "pages_tbl" section contains the physical page descriptors array.
- *   It starts at local PPN = pages_offset, and it contains one entry per small page.
- *   It is created and initialized by the hal_ppm_create() function. 
- * - The "kernel_heap" section contains all physical pages that are are not in the
- *   "kernel_code" and "pages_tbl" sections, and that have not been reserved.
- *   The reserved pages are defined in the boot_info structure.
- *
- * The main service provided by the PMM is the dynamic allocation of physical pages
- * from the "kernel_heap" section. This low-level allocator implements the "buddy" 
- * algorithm: an allocated block is an integer number n of small pages, where n 
- * is a power of 2, and ln(n) is called order. The free_pages_root[] array contains
- * the roots ot the local lists of free pages for different sizes, as required by
- * the "buddy" algorithm. 
- * The local threads can access these free_lists by calling the ppm_alloc_pages() and
- * ppm_free_page() functions, and the remote threads can access the same free lists,
- * by calling the ppm_remote_alloc_pages() and ppm_remote_free_pages functions.
- * Therefore, these free lists are protected by a remote_busy_lock.
- * 
- * Another service is to register the dirty pages in a specific local dirty_list,
- * also rooted in the PPM, in order to be able to synchronize all dirty pages on disk.
- * This dirty list is protected by a specific remote_queuelock, because it can be
- * modified by a remote thread.
+ * This structure defines the list of blocks of a given size for the "buddy"
+ * allocation algorithm implemented by the ppm_t manager.
  ****************************************************************************************/
+typedef struct buddy_list_s
+{
+	list_entry_t  root;       // root of the list 
+	uint32_t      pages_nr;   // number of blocks
+}
+buddy_list_t;
 
+/*****************************************************************************************
+ * This structure defines the Physical Memory Manager in a cluster.
+ * In all clusters, the physical memory bank starts at address 0.
+ * The segments kcode and kdata are mapped in the first "offset" pages.
+ * The physical page descriptors array is implemented just after this offset zone.
+ * The main service provided by the PMM is the dynamic allocation of physical pages. 
+ * This low-level allocator implements the buddy algorithm.
+ ****************************************************************************************/
 typedef struct ppm_s
 {
-	remote_busylock_t   free_lock;          /*! lock protecting free_pages[] lists      */
-	list_entry_t        free_pages_root[CONFIG_PPM_MAX_ORDER];  /*! roots of free lists */
-	uint32_t            free_pages_nr[CONFIG_PPM_MAX_ORDER];    /*! free pages number   */
-	page_t            * pages_tbl;          /*! pointer on page descriptors array       */
-	uint32_t            pages_nr;           /*! total number of small physical page     */
-    remote_queuelock_t  dirty_lock;         /*! lock protecting dirty pages list        */
-    list_entry_t        dirty_root;         /*! root of dirty pages list                */
-    void              * vaddr_base;         /*! pointer on local physical memory base   */
+	uint32_t       signature;               /*! set when initialised                    */
+	spinlock_t     free_lock;               /*! lock protecting free_pages[] array      */
+	list_entry_t   free_pages_root[CONFIG_PPM_MAX_ORDER];  /*! roots of free lists      */
+	uint32_t       free_pages_nr[CONFIG_PPM_MAX_ORDER];    /*! numbers of free pages    */
+    uint32_t       total_free_pages;        /*! total number of free pages              */
+	page_t       * pages_tbl;               /*! pointer on page descriptors array       */
+	uint32_t       pages_nr;                /*! total number of 4 Kbytes physical page  */
+    uint32_t       pages_offset;            /*! allocated pages for kcode & kdata       */
+    uint32_t       pages_desc;              /*! allocated pages for pages_tbl[] array   */
+    spinlock_t     dirty_lock;              /*! lock protecting the dirty list          */
+    list_entry_t   dirty_root;              /*! root of dirty pages list                */
 }
 ppm_t;
 
-/************** functions to allocate / release physical pages  *************************/
+/*****************************************************************************************
+ * This function initializes a PPM (Physical Pages Manager) in a cluster.
+ * The physical memory base address in all cluster is zero.
+ * The physical memory size is NOT constrained to be smaller than 4 Gbytes. 
+ * @ ppm          : pointer on physical pages manager.
+ * @ pages_nr     : total physical memory size (number of 4 Kbytes pages).
+ * @ pages_offset : number of pages already allocated in this physical memory.
+ ****************************************************************************************/
+void ppm_init( ppm_t    * ppm, 
+               uint32_t   pages_nr,
+	           uint32_t   pages_offset );
 
 /*****************************************************************************************
- * This local allocator must be called by a thread running in local cluster. 
- * It allocates N contiguous physical 4 Kbytes pages from the local cluster, where 
- * N is a power of 2 defined by the <order> argument. 
- * In normal use, it should not be called directly, as the recommended way to allocate
+ * This is the low-level physical pages allocation function.
+ * It allocates N contiguous physical pages. N is a power of 2.
+ * In normal use, you don't need to call it directly, as the recommanded way to get 
  * physical pages is to call the generic allocator defined in kmem.h.
- *****************************************************************************************
- * @ order     : ln2( number of 4 Kbytes pages)
- * @ returns a local pointer on the page descriptor if success / NULL if error.
+ * @ order        : ln2( number of 4 Kbytes pages)
+ * @ returns a pointer on the page descriptor if success / NULL otherwise
  ****************************************************************************************/
 page_t * ppm_alloc_pages( uint32_t order );
 
 /*****************************************************************************************
- * This function must be called by a thread running in local cluster to release
- * physical pages. It takes the lock protecting the free_lists before register the 
- * released page in the relevant free_list.
- * In normal use, it should not be called directly, as the recommended way to free
+ * This is the low-level physical pages release function.
+ * In normal use, you do not need to call it directly, as the recommanded way to free 
  * physical pages is to call the generic allocator defined in kmem.h.
- *****************************************************************************************
- * @ page   : local pointer on the page descriptor to be released
+ * @ page         : pointer to the page descriptor to be released
  ****************************************************************************************/
 void ppm_free_pages( page_t * page );
 
 /*****************************************************************************************
- * This function does the same as the ppm_free_page() function, without taking the lock.
- * It is used by the hal_ppm_init() function to initialize the pages_tbl[] array, when
- * there is no concurrent access issue.
- *****************************************************************************************
- * @ page   : local pointer on the page descriptor to be released
+ * This function check if a page descriptor is valid.
+ * @ page         : pointer on a page descriptor
+ * @ returns true if valid / false otherwise.
  ****************************************************************************************/
-void ppm_free_pages_nolock( page_t * page );
+inline bool_t ppm_page_is_valid( page_t * page );
 
 /*****************************************************************************************
- * This remote  allocator can be called by any thread running in any cluster. 
- * It allocates N contiguous physical 4 Kbytes pages from cluster identified 
- * by the <cxy> argument, where N is a power of 2 defined by the <order> argument. 
- * In normal use, it should not be called directly, as the recommended way to allocate
- * physical pages is to call the generic allocator defined in kmem.h.
- *****************************************************************************************
- * @ cxy       : remote cluster identifier.
- * @ order     : ln2( number of 4 Kbytes pages)
- * @ returns an extended pointer on page descriptor if success / XPTR_NULL if error.
+ * Get the page base address from the page descriptor pointer.
+ * @ page         : pointer to page descriptor
+ * @ returns page base address
  ****************************************************************************************/
-xptr_t  ppm_remote_alloc_pages( cxy_t    cxy,
-                                uint32_t order );
+inline void* ppm_page2base( page_t * page );
 
 /*****************************************************************************************
- * This function can be called by any thread running in any cluster to release physical
- * pages to a remote cluster. It takes the lock protecting the free_list before register
- * the released page in the relevant free_list.
- * In normal use, you do not need to call it directly, as the recommended way to free
- * physical pages is to call the generic allocator defined in kmem.h.
- *****************************************************************************************
- * @ cxy       : remote cluster identifier.
- * @ page      : local pointer on the page descriptor to be released in remote cluster.
+ * Get the page descriptor pointer from the page base address.
+ * @ vaddr        : page base address
+ * @ returns pointer on page descriptor
  ****************************************************************************************/
-void ppm_remote_free_pages( cxy_t    cxy,
-                            page_t * page );
+inline page_t * ppm_base2page( void * vaddr );
 
 /*****************************************************************************************
- * This debug function can be called by any thread running in any cluster to display
- * the current PPM state of a remote cluster.
- *****************************************************************************************
- * @ cxy       : remote cluster identifier.
+ * Get the PPN from the page descriptor pointer.
+ * @ page         : pointer to page descriptor
+ * @ returns physical page number
  ****************************************************************************************/
-void ppm_remote_display( cxy_t cxy );
-
-
-/************** functions to translate [ page <->  base <-> ppn ] ***********************/
+inline ppn_t ppm_page2ppn( page_t * page );
 
 /*****************************************************************************************
- * Get extended pointer on page base from extended pointer on page descriptor.
- *****************************************************************************************
- * @ page_xp    : extended pointer to page descriptor
- * @ returns extended pointer on page base.
+ * Get the page descriptor pointer from the PPN.
+ * @ ppn          : physical page number
+ * @ returns pointer on page descriptor
  ****************************************************************************************/
-inline xptr_t ppm_page2base( xptr_t page_xp );
+inline page_t * ppm_ppn2page( ppn_t ppn );
 
 /*****************************************************************************************
- * Get extended pointer on page descriptor from extended pointer on page base.
- *****************************************************************************************
- * @ base_xp   : extended pointer to page base.
- * @ returns extended pointer on page descriptor
+ * Get the page base address from the PPN.
+ * @ ppn          : physical page number
+ * @ returns page base address
  ****************************************************************************************/
-inline xptr_t ppm_base2page( xptr_t base_xp );
+inline void* ppm_ppn2base( ppn_t ppn );
 
 /*****************************************************************************************
- * Get extended pointer on page base from global PPN.
- *****************************************************************************************
- * @ ppn    : global physical page number.
- * @ returns extended pointer on page base.
+ * Get the PPN from the page base address.
+ * @ vaddr        : page base address
+ * @ returns physical page number
  ****************************************************************************************/
-inline xptr_t ppm_ppn2base( ppn_t ppn );
+inline ppn_t ppm_base2ppn( void * base );
 
 /*****************************************************************************************
- * Get global PPN from extended pointer on page base.
- *****************************************************************************************
- * @ base_xp   : extended pointer to page base.
- * @ returns global physical page number.
+ * This function prints the PPM allocator status.
+ * @ ppm      : pointer on PPM allocator.
  ****************************************************************************************/
-inline ppn_t ppm_base2ppn( xptr_t base_xp );
+void ppm_print( ppm_t * ppm );
 
 /*****************************************************************************************
- * Get global PPN from extended pointer on page descriptor.
- *****************************************************************************************
- * @ page_xp   : pointer to page descriptor
- * @ returns global physical page number.
+ * This function checks PPM allocator consistency.
+ * @ ppm      : pointer on PPM allocator.
  ****************************************************************************************/
-inline ppn_t ppm_page2ppn( xptr_t page_xp );
-
-/*****************************************************************************************
- * Get extended pointer on page descriptor from global PPN.
- *****************************************************************************************
- * @ ppn       : global physical page number
- * @ returns extended pointer on page descriptor.
- ****************************************************************************************/
-inline xptr_t ppm_ppn2page( ppn_t ppn );
-
-
-/*********** debug  functions  **********************************************************/
-
-/*****************************************************************************************
- * This function can be called by any thread running in any cluster.
- * It displays the PPM allocator status in cluster identified by the <cxy> argument.
- *****************************************************************************************
- * @ cxy   : remote cluster
- ****************************************************************************************/
-void ppm_remote_display( cxy_t cxy );
-
-/*****************************************************************************************
- * This function must be called by a thread running in local cluster.
- * It checks the consistency of the local PPM allocator.
- *****************************************************************************************
- * @ return 0 if PPM is OK / return -1 if PPM not consistent.
- ****************************************************************************************/
-error_t ppm_assert_order( void );
-
-
-/*********** functions to handle dirty pages  *******************************************/
-
-/*****************************************************************************************
- * This function registers a page identified by the <page_xp> argument as dirty. 
- * It can be called by a thread running in any cluster.
- * - it takes the queuelock protecting the PPM dirty_list.
- * - it takes the busylock protecting the page flags.
- * - it test the PG_DIRTY flag in the page descriptor.
- *   . if page already dirty => do nothing
- *   . it page not dirty => set the PG_DIRTY flag and register page in PPM dirty list.
- * - it releases the busylock protecting the page flags.
- * - it releases the queuelock protecting the PPM dirty_list.
- *****************************************************************************************
- * @ page_xp  : extended pointer on page descriptor.
- * @ returns true if page was not dirty / returns false if page was dirty
- ****************************************************************************************/
-bool_t ppm_page_do_dirty( xptr_t page_xp );
-
-/*****************************************************************************************
- * This function unregisters a page identified by the <page_xp> argument as dirty. 
- * It can be called by a thread running in any cluster.
- * - it takes the queuelock protecting the PPM dirty_list.
- * - it takes the busylock protecting the page flags.
- * - it test the PG_DIRTY flag in the page descriptor.
- *   . if page not dirty => do nothing
- *   . it page dirty => reset the PG_DIRTY flag and remove page from PPM dirty list.
- * - it releases the busylock protecting the page flags.
- * - it releases the queuelock protecting the PPM dirty_list.
- *****************************************************************************************
- * @ page_xp  : extended pointer on page descriptor.
- * @ returns true if page was dirty / returns false if page was not dirty
- ****************************************************************************************/
-bool_t ppm_page_undo_dirty( xptr_t page_xp );
-
-/*****************************************************************************************
- * This function synchronizes (i.e. update the IOC device) all dirty pages in a cluster.
- * - it takes the queuelock protecting the PPM dirty_list.
- * - it scans the PPM dirty list, and for each page:
- *   . it takes the lock protecting the page.
- *   . it removes the page from the PPM dirty_list.
- *   . it reset the PG_DIRTY flag.
- *   . it releases the lock protecting the page.
- * - it releases the queuelock protecting the PPM dirty_list.
- $ The PPM dirty_list is empty when the sync operation completes.
- ****************************************************************************************/
-void ppm_sync_dirty_pages( void );
+void ppm_assert_order( ppm_t * ppm );
 
 #endif	/* _PPM_H_ */
Index: trunk/kernel/mm/vmm.c
===================================================================
--- trunk/kernel/mm/vmm.c	(revision 690)
+++ trunk/kernel/mm/vmm.c	(revision 1)
@@ -1,8 +1,9 @@
 /*
- * vmm.c - virtual memory manager related operations implementation.
+ * vmm.c - virtual memory manager related operations interface.
  *
- * Authors   Ghassan Almaless (2008,2009,2010,2011,2012)
- *           Alain Greiner    (2016,2017,2018,2019,2020)
- *
+ * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
+ *           Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ * 
  * Copyright (c) UPMC Sorbonne Universites
  *
@@ -23,16 +24,11 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <hal_gpt.h>
-#include <hal_vmm.h>
-#include <hal_irqmask.h>
-#include <hal_macros.h>
 #include <printk.h>
-#include <memcpy.h>
-#include <remote_queuelock.h>
+#include <rwlock.h>
 #include <list.h>
-#include <xlist.h>
 #include <bits.h>
 #include <process.h>
@@ -46,2909 +42,1379 @@
 #include <kmem.h>
 #include <vmm.h>
-#include <hal_exception.h>
-
-////////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////////
 //   Extern global variables
-////////////////////////////////////////////////////////////////////////////////////////////
-
-extern  process_t  process_zero;      // allocated in cluster.c 
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the vmm_user_init() function.
-// It initialises the free lists of vsegs used by the VMM MMAP allocator.
-// It makes the assumption that HEAP_BASE == 1 Gbytes and HEAP_SIZE == 2 Gbytes.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void vmm_stack_init( vmm_t * vmm )
-{
-
-// check STACK zone
-assert( __FUNCTION__, ((CONFIG_VMM_STACK_SIZE * CONFIG_THREADS_MAX_PER_CLUSTER) <=
-(CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE)) , "STACK zone too small\n");
-
-    // get pointer on STACK allocator 
-    stack_mgr_t * mgr = &vmm->stack_mgr;
-
-    mgr->bitmap   = 0;
-    mgr->vpn_base = CONFIG_VMM_STACK_BASE;
-    busylock_init( &mgr->lock , LOCK_VMM_STACK );
-
-}
+//////////////////////////////////////////////////////////////////////////////////
+
+extern  process_t  process_zero;   // defined in cluster.c file
+
+
+////////////////////////////////////
+void vmm_init( process_t * process )
+{  
+    error_t   error;
+    vseg_t  * vseg_kentry;
+    vseg_t  * vseg_args;
+    vseg_t  * vseg_envs;
+    vseg_t  * vseg_heap;
+    intptr_t  base;
+    intptr_t  size;
+
+    // get pointer on VMM
+    vmm_t   * vmm = &process->vmm;
+
+    // check UTILS zone size
+    if( (CONFIG_VMM_KENTRY_SIZE + CONFIG_VMM_ARGS_SIZE + CONFIG_VMM_ENVS_SIZE ) >
+        CONFIG_VMM_ELF_BASE )
+    {
+        printk("\n[PANIC] in %s : UTILS zone too small for process %x\n",
+               __FUNCTION__ , process->pid );
+        hal_core_sleep();
+    }
+    
+    // check max number of stacks slots
+    if( CONFIG_THREAD_MAX_PER_CLUSTER > 32 )
+    {
+        printk("\n[PANIC] in %s : max number ot threads per cluster for a sihgle process"
+               " cannot be larger than 32\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // check STACK zone size
+    if( (CONFIG_VMM_STACK_SIZE * CONFIG_THREAD_MAX_PER_CLUSTER) > 
+        (CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE) )
+    {
+        printk("\n[PANIC] in %s : STACK zone too small for process %x\n",
+               __FUNCTION__ , process->pid );
+        hal_core_sleep();
+    }
+
+    // initialise the rwlock protecting the vsegs list
+	rwlock_init( &vmm->vsegs_lock );
+
+    // initialize local list of vsegs and radix-tree
+	list_root_init( &vmm->vsegs_root );
+    vmm->vsegs_nr = 0;
+    error = grdxt_init( &vmm->grdxt,
+                        CONFIG_VMM_GRDXT_W1,
+                        CONFIG_VMM_GRDXT_W2,
+                        CONFIG_VMM_GRDXT_W3 );
+    if( error )
+    {
+        printk("\n[PANIC] in %s : cannot initialise radix tree for process %x\n",
+               __FUNCTION__ , process->pid );
+        hal_core_sleep();
+    }
+
+    // register kentry vseg in VMM
+    base = 1 << CONFIG_PPM_PAGE_SHIFT;
+    size = CONFIG_VMM_KENTRY_SIZE << CONFIG_PPM_PAGE_SHIFT;
+    vseg_kentry = vmm_create_vseg( process , base , size , VSEG_TYPE_CODE );
+    if( vseg_kentry == NULL ) 
+    {
+        printk("\n[PANIC] in %s : cannot register kent vseg for process %x\n",
+               __FUNCTION__ , process->pid );
+        hal_core_sleep();
+    }
+    vmm->kent_vpn_base = 1;
+
+    // register the args vseg in VMM
+    base = (CONFIG_VMM_KENTRY_SIZE + 1 )<<CONFIG_PPM_PAGE_SHIFT;
+    size = CONFIG_VMM_ARGS_SIZE << CONFIG_PPM_PAGE_SHIFT;
+    vseg_args = vmm_create_vseg( process , base , size , VSEG_TYPE_DATA );
+    if( vseg_args == NULL ) 
+    {
+        printk("\n[PANIC] in %s : cannot register args vseg for process %x\n",
+               __FUNCTION__ , process->pid );
+        hal_core_sleep();
+    }
+    vmm->args_vpn_base = CONFIG_VMM_KENTRY_SIZE + 1;
+
+    // register the envs vseg in VMM
+    base = (CONFIG_VMM_KENTRY_SIZE + CONFIG_VMM_ARGS_SIZE + 1 )<<CONFIG_PPM_PAGE_SHIFT;
+    size = CONFIG_VMM_ENVS_SIZE << CONFIG_PPM_PAGE_SHIFT;
+    vseg_envs = vmm_create_vseg( process , base , size , VSEG_TYPE_DATA );
+    if( vseg_envs == NULL ) 
+    {
+        printk("\n[PANIC] in %s : cannot register envs vseg for process %x\n",
+               __FUNCTION__ , process->pid );
+        hal_core_sleep();
+    }
+    vmm->envs_vpn_base = CONFIG_VMM_KENTRY_SIZE + CONFIG_VMM_ARGS_SIZE + 1;
+
+    // register the heap vseg in VMM
+    base = CONFIG_VMM_HEAP_BASE << CONFIG_PPM_PAGE_SHIFT;
+    size = (CONFIG_VMM_MMAP_BASE-CONFIG_VMM_HEAP_BASE) << CONFIG_PPM_PAGE_SHIFT;
+    vseg_heap = vmm_create_vseg( process , base , size , VSEG_TYPE_HEAP );
+    if( vseg_heap == NULL ) 
+    {
+        printk("\n[PANIC] in %s : cannot register heap vseg in for process %x\n",
+               __FUNCTION__ , process->pid );
+        hal_core_sleep();
+    }
+    vmm->heap_vpn_base = CONFIG_VMM_HEAP_BASE;
+
+    // initialize generic page table
+    error = hal_gpt_create( &vmm->gpt );
+    if( error )
+    {
+        printk("PANIC in %s : cannot initialize page table\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // initialize STACK allocator
+    vmm->stack_mgr.bitmap   = 0;
+    vmm->stack_mgr.vpn_base = CONFIG_VMM_STACK_BASE;
+
+    // initialize MMAP allocator
+    vmm->mmap_mgr.vpn_base        = CONFIG_VMM_MMAP_BASE;
+    vmm->mmap_mgr.vpn_size        = CONFIG_VMM_STACK_BASE - CONFIG_VMM_MMAP_BASE;
+    vmm->mmap_mgr.first_free_vpn  = CONFIG_VMM_MMAP_BASE;
+    uint32_t i;
+    for( i = 0 ; i < 32 ; i++ ) list_root_init( &vmm->mmap_mgr.zombi_list[i] );
+
+    // initialise instrumentation counters
+	vmm->pgfault_nr          = 0;
+	vmm->u_err_nr            = 0;
+	vmm->m_err_nr            = 0;
+
+    hal_wbflush();
+
+}  // end vmm_init()
+
+///////////////////////////////////////
+void vmm_destroy( process_t * process )
+{
+	vseg_t * vseg;
+
+    // get pointer on VMM
+    vmm_t  * vmm = &process->vmm;
+
+    // get lock protecting vseg list
+	rwlock_wr_lock( &vmm->vsegs_lock );
+
+    // remove all vsegs registered in vmm
+	while( !list_is_empty( &vmm->vsegs_root ) )
+	{
+		vseg = LIST_FIRST( &vmm->vsegs_root ,  vseg_t , list );
+		vseg_detach( vmm , vseg );
+        vseg_free( vseg );
+	}
+
+    // delete vsegs radix_tree
+    grdxt_destroy( &vmm->grdxt );
+
+    // release lock
+	rwlock_wr_unlock(&vmm->vsegs_lock);
+
+    // remove all vsegs from zombi_lists in MMAP allocator
+    uint32_t i;
+    for( i = 0 ; i<32 ; i++ )
+    {
+	    while( !list_is_empty( &vmm->mmap_mgr.zombi_list[i] ) )
+	    {
+		    vseg = LIST_FIRST( &vmm->mmap_mgr.zombi_list[i] , vseg_t , list );
+		    vseg_detach( vmm , vseg );
+            vseg_free( vseg );
+	    }
+    }
+
+    // release memory allocated to the local page table
+    hal_gpt_destroy( &vmm->gpt );
+
+} // end vmm_destroy()
+
+/////////////////////////////////////////////////
+vseg_t * vmm_check_conflict( process_t * process,
+                             vpn_t       vpn_base, 
+                             vpn_t       vpn_size )
+{
+    vmm_t        * vmm = &process->vmm;
+	vseg_t       * vseg;
+    list_entry_t * iter;
+
+    // scan the list of registered vsegs
+	LIST_FOREACH( &vmm->vsegs_root , iter )
+	{
+		vseg = LIST_ELEMENT( iter , vseg_t , list );
+		if( ((vpn_base + vpn_size) > vseg->vpn_base) && 
+             (vpn_base < (vseg->vpn_base + vseg->vpn_size)) ) return vseg; 
+	}
+    return NULL;
+}  // vmm_check_conflict()
 
 ////////////////////////////////////////////////////////////////////////////////////////////
 // This static function is called by the vmm_create_vseg() function, and implements
-// the VMM STACK specific allocator. Depending on the local thread index <ltid>,
-// it ckeks availability of the corresponding slot in the process STACKS region,
-// allocates a vseg descriptor, and initializes the "vpn_base" and "vpn_size" fields.
+// the VMM stack_vseg specific allocator.
 ////////////////////////////////////////////////////////////////////////////////////////////
-// @ vmm      : [in]  pointer on VMM.
-// @ ltid     : [in]  requested slot == local user thread identifier.
+// @ vmm      : pointer on VMM.
+// @ vpn_base : (return value) first alocated page 
+// @ vpn_size : (return value) number of allocated pages
 ////////////////////////////////////////////////////////////////////////////////////////////
-static vseg_t * vmm_stack_alloc( vmm_t  * vmm,
-                                 ltid_t   ltid )
-{
-
-// check ltid argument
-assert( __FUNCTION__, 
-(ltid <= ((CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE) / CONFIG_VMM_STACK_SIZE)),
-"slot index %d too large for an user stack vseg", ltid );
-
+static error_t vmm_stack_alloc( vmm_t * vmm,
+                                vpn_t * vpn_base,
+                                vpn_t * vpn_size )
+{
     // get stack allocator pointer
     stack_mgr_t * mgr = &vmm->stack_mgr;
 
-    // get lock protecting stack allocator
-    busylock_acquire( &mgr->lock );
-
-// check requested slot is available
-assert( __FUNCTION__, (bitmap_state( &mgr->bitmap , ltid ) == false),
-"slot index %d already allocated", ltid );
-
-    // allocate a vseg descriptor
-    vseg_t * vseg = vseg_alloc();
-
-    if( vseg == NULL )
-   	{
- 
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] %s cannot allocate memory for vseg in cluster %x\n",
-__FUNCTION__ , local_cxy );
-#endif
-        busylock_release( &mgr->lock );
-        return NULL;
-    }
+    // get lock on stack allocator
+    spinlock_lock( &mgr->lock );
+
+    // get first free slot index in bitmap
+    int32_t index = bitmap_ffc( &mgr->bitmap , 4 );
+    if( (index < 0) || (index > 31) ) return ENOMEM;
 
     // update bitmap
-    bitmap_set( &mgr->bitmap , ltid );
-
+    bitmap_set( &mgr->bitmap , index );
+            
     // release lock on stack allocator
-    busylock_release( &mgr->lock );
-
-    // set "vpn_base" & "vpn_size" fields (first page non allocated)
-    vseg->vpn_base = mgr->vpn_base + (ltid * CONFIG_VMM_STACK_SIZE) + 1;
-    vseg->vpn_size = CONFIG_VMM_STACK_SIZE - 1;
-
-    return vseg;
-
-} // end vmm_stack_alloc()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the vmm_remove_vseg() function, and implements
-// the VMM STACK specific desallocator.
-// It updates the bitmap to release the corresponding slot in the process STACKS region,
-// and releases memory allocated to vseg descriptor.
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ vmm      : [in] pointer on VMM.
-// @ vseg     : [in] pointer on released vseg.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void vmm_stack_free( vmm_t  * vmm,
-                            vseg_t * vseg )
-{
-    // get stack allocator pointer
-    stack_mgr_t * mgr = &vmm->stack_mgr;
-
-    // compute slot index
-    uint32_t index = (vseg->vpn_base - 1 - mgr->vpn_base) / CONFIG_VMM_STACK_SIZE;
-
-// check index
-assert( __FUNCTION__, (index <= ((CONFIG_VMM_VSPACE_SIZE - CONFIG_VMM_STACK_BASE) / CONFIG_VMM_STACK_SIZE)),
-"slot index %d too large for an user stack vseg", index );
-
-// check released slot is allocated
-assert( __FUNCTION__, (bitmap_state( &mgr->bitmap , index ) == true),
-"released slot index %d non allocated", index );
-
-    // get lock on stack allocator
-    busylock_acquire( &mgr->lock );
-
-    // update stacks_bitmap
-    bitmap_clear( &mgr->bitmap , index );
-
-    // release lock on stack allocator
-    busylock_release( &mgr->lock );
-
-    // release memory allocated to vseg descriptor
-    vseg_free( vseg );
-
-}  // end vmm_stack_free()
-
-
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This function display the current state of the VMM MMAP allocator of a process VMM
-// identified by the <vmm> argument.
-////////////////////////////////////////////////////////////////////////////////////////////
-void vmm_mmap_display( vmm_t * vmm )
-{
-    uint32_t  order;
-    xptr_t    root_xp;
-    xptr_t    iter_xp;
-
-    // get pointer on process
-    process_t * process = (process_t *)(((char*)vmm) - OFFSETOF( process_t , vmm ));
-
-    // get process PID
-    pid_t pid = process->pid;
-
-    // get pointer on VMM MMAP allocator
-    mmap_mgr_t * mgr = &vmm->mmap_mgr;
-
-    // display header
-    printk("***** VMM MMAP allocator / process %x *****\n", pid );
-
-    // scan the array of free lists of vsegs
-    for( order = 0 ; order <= CONFIG_VMM_HEAP_MAX_ORDER ; order++ )
-    {
-        root_xp = XPTR( local_cxy , &mgr->free_list_root[order] );
-
-        if( !xlist_is_empty( root_xp ) )
-        {
-            printk(" - %d (%x pages) : ", order , 1<<order );
-
-            XLIST_FOREACH( root_xp , iter_xp )
-            {
-                xptr_t   vseg_xp = XLIST_ELEMENT( iter_xp , vseg_t , xlist );
-                vseg_t * vseg    = GET_PTR( vseg_xp );
-
-                printk("%x | ", vseg->vpn_base );
-            }
-
-            printk("\n");
-        }
-    }
-}  // end vmm_mmap_display()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the vmm_user_init() function.
-// It initialises the free lists of vsegs used by the VMM MMAP allocator.
-// TODO this function is only valid for 32 bits cores, and makes three assumptions:
-// HEAP_BASE == 1 Gbytes / HEAP_SIZE == 2 Gbytes / MMAP_MAX_SIZE == 1 Gbytes
-////////////////////////////////////////////////////////////////////////////////////////////
-void vmm_mmap_init( vmm_t * vmm )
-{
-
-// check HEAP base and size 
-assert( __FUNCTION__, (CONFIG_VMM_HEAP_BASE == 0x40000) & (CONFIG_VMM_STACK_BASE == 0xc0000),
-"CONFIG_VMM_HEAP_BASE != 0x40000 or CONFIG_VMM_STACK_BASE != 0xc0000" );
-
-// check  MMAP vseg max order 
-assert( __FUNCTION__, (CONFIG_VMM_HEAP_MAX_ORDER == 18), "max mmap vseg size is 256K pages" );
-
-    // get pointer on MMAP allocator 
-    mmap_mgr_t * mgr = &vmm->mmap_mgr;
-
-    // initialize HEAP base and size
-    mgr->vpn_base        = CONFIG_VMM_HEAP_BASE;
-    mgr->vpn_size        = CONFIG_VMM_STACK_BASE - CONFIG_VMM_HEAP_BASE;
-
-    // initialize lock
-    busylock_init( &mgr->lock , LOCK_VMM_MMAP );
-
-    // initialize free lists
-    uint32_t   i;
-    for( i = 0 ; i <= CONFIG_VMM_HEAP_MAX_ORDER ; i++ )
-    {
-        xlist_root_init( XPTR( local_cxy , &mgr->free_list_root[i] ) );
-    }
-
-    // allocate and register first 1 Gbytes vseg
-    vseg_t * vseg0 = vseg_alloc();
-
-assert( __FUNCTION__, (vseg0 != NULL) , "cannot allocate vseg" );
-
-    vseg0->vpn_base = CONFIG_VMM_HEAP_BASE;
-    vseg0->vpn_size = CONFIG_VMM_HEAP_BASE;
-
-    xlist_add_first( XPTR( local_cxy , &mgr->free_list_root[CONFIG_VMM_HEAP_MAX_ORDER] ),
-                     XPTR( local_cxy , &vseg0->xlist ) );
-
-    // allocate and register second 1 Gbytes vseg
-    vseg_t * vseg1 = vseg_alloc();
-
-assert( __FUNCTION__, (vseg1 != NULL) , "cannot allocate vseg" );
-
-    vseg1->vpn_base = CONFIG_VMM_HEAP_BASE << 1;
-    vseg1->vpn_size = CONFIG_VMM_HEAP_BASE;
-
-    xlist_add_first( XPTR( local_cxy , &mgr->free_list_root[CONFIG_VMM_HEAP_MAX_ORDER] ),
-                     XPTR( local_cxy , &vseg1->xlist ) );
-
-#if DEBUG_VMM_MMAP
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-printk("\n[%s] thread[%x,%x] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, cycle );
-vmm_mmap_display( vmm );
-#endif
-
-}  // end vmm_mmap_init()
+    spinlock_unlock( &mgr->lock );
+
+    // returns vpn_base, vpn_size (one page non allocated) 
+    *vpn_base = mgr->vpn_base + index * CONFIG_VMM_STACK_SIZE + 1;
+    *vpn_size = CONFIG_VMM_STACK_SIZE - 1;
+    return 0;
+
+}  // end vmm_stack_alloc()
 
 ////////////////////////////////////////////////////////////////////////////////////////////
 // This static function is called by the vmm_create_vseg() function, and implements
-// the VMM MMAP specific allocator.  Depending on the requested number of pages <npages>,
-// it get a free vseg from the relevant free_list, and initializes the "vpn_base" and
-// "vpn_size" fields.
+// the VMM MMAP specific allocator.
 ////////////////////////////////////////////////////////////////////////////////////////////
 // @ vmm      : [in] pointer on VMM.
 // @ npages   : [in] requested number of pages.
-// @ returns local pointer on vseg if success / returns NULL if failure.
+// @ vpn_base : [out] first allocated page. 
+// @ vpn_size : [out] actual number of allocated pages.
 ////////////////////////////////////////////////////////////////////////////////////////////
-static vseg_t * vmm_mmap_alloc( vmm_t * vmm,
-                                vpn_t   npages )
-{
-
-#if DEBUG_VMM_MMAP
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_MMAP < cycle )
-printk("\n[%s] thread[%x,%x] for %x pages / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, npages, cycle );
-#endif
-
-    // number of allocated pages must be power of 2
-    // compute actual size and order 
-    vpn_t    required_vpn_size = POW2_ROUNDUP( npages );
-    uint32_t required_order    = bits_log2( required_vpn_size );
+static error_t vmm_mmap_alloc( vmm_t * vmm,
+                               vpn_t   npages,
+                               vpn_t * vpn_base,
+                               vpn_t * vpn_size )
+{
+    uint32_t   index;
+    vseg_t   * vseg;
+    vpn_t      base;
+    vpn_t      size;
+    vpn_t      free;    
+
+    // mmap vseg size must be power of 2 
+    // compute actual size and index in zombi_list array
+    size  = POW2_ROUNDUP( npages );
+    index = bits_log2( size );
 
     // get mmap allocator pointer
     mmap_mgr_t * mgr = &vmm->mmap_mgr;
 
-    // take lock protecting free lists in MMAP allocator
-    busylock_acquire( &mgr->lock );
-
-    // initialises the while loop variables
-    uint32_t   current_order = required_order;
-    vseg_t   * current_vseg  = NULL;
-
-    // search a free vseg equal or larger than requested size
-	while( current_order <= CONFIG_VMM_HEAP_MAX_ORDER )
-	{
-        // build extended pointer on free_pages_root[current_order]
-        xptr_t root_xp = XPTR( local_cxy , &mgr->free_list_root[current_order] );
-
-		if( !xlist_is_empty( root_xp ) )
-		{
-            // get extended pointer on first vseg in this free_list
-			xptr_t current_vseg_xp = XLIST_FIRST( root_xp , vseg_t , xlist );
-            current_vseg = GET_PTR( current_vseg_xp );
-
-            // build extended pointer on xlist field in vseg descriptor
-            xptr_t list_entry_xp = XPTR( local_cxy , &current_vseg->xlist );
-
-            // remove this vseg from the free_list
-			xlist_unlink( list_entry_xp );
-
-			break;	
-		}
-
-        // increment loop index
-        current_order++;
-
-    }  // end while loop 
-
-    if( current_vseg == NULL )  // return failure 
-    {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] %s cannot allocate ) %d page(s) in cluster %x\n",
-__FUNCTION__, npages , local_cxy );
-#endif
-        busylock_release( &mgr->lock );
-        return NULL;
-    }
-
-	// split recursively the found vseg in smaller vsegs
-    // if required, and update the free-lists accordingly
-	while( current_order > required_order )
-	{
-        // get found vseg base and size
-        vpn_t  vpn_base = current_vseg->vpn_base;
-        vpn_t  vpn_size = current_vseg->vpn_size;
-        
-        // allocate a new vseg for the upper half of current vseg
-	    vseg_t * new_vseg = vseg_alloc();
-
-	    if( new_vseg == NULL )
-    	{
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] %s cannot allocate memory for vseg in cluster %x\n",
-__FUNCTION__ , local_cxy );
-#endif
-            busylock_release( &mgr->lock );
-            return NULL;
-	    }
-
-        // initialise new vseg (upper half of found vseg)
-        new_vseg->vmm      = vmm;
-        new_vseg->vpn_base = vpn_base + (vpn_size >> 1);
-        new_vseg->vpn_size = vpn_size >> 1;
-
-        // insert new vseg in relevant free_list
-		xlist_add_first( XPTR( local_cxy , &mgr->free_list_root[current_order-1] ),
-                         XPTR( local_cxy , &new_vseg->xlist ) );
-
-        // update found vseg
-        current_vseg->vpn_size = vpn_size>>1; 
-
-        // update order
-		current_order --;
-	}
-
-	// release lock protecting free lists
-	busylock_release( &mgr->lock );
-
-#if DEBUG_VMM_MMAP
-vmm_mmap_display( vmm );
-#endif
-
-    return current_vseg;
-
-}  // end vmm_mmap_alloc()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function implements the VMM MMAP specific desallocator.
-// It is called by the vmm_remove_vseg() function.
-// It releases the vseg to the relevant free_list, after trying (recursively) to
-// merge it to the buddy vseg.
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ vmm      : [in] pointer on VMM.
-// @ vseg     : [in] pointer on released vseg.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void vmm_mmap_free( vmm_t  * vmm,
-                           vseg_t * vseg )
-{
-
-#if DEBUG_VMM_MMAP
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_MMAP < cycle )
-printk("\n[%s] thread[%x,%x] for vpn_base %x / vpn_size %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg->vpn_base, vseg->vpn_size, cycle );
-#endif
-
-    vseg_t * buddy_vseg;
-
-    // get mmap allocator pointer
-    mmap_mgr_t * mgr = &vmm->mmap_mgr;
-
-    // take lock protecting free lists
-    busylock_acquire( &mgr->lock );
-
-    // initialise loop variables 
-    // released_vseg is the currently released vseg
-    vseg_t * released_vseg     = vseg;
-    uint32_t released_order    = bits_log2( vseg->vpn_size );
-
-	// iteratively merge the released vseg to the buddy vseg
-	// release the current page and exit when buddy not found
-    while( released_order <= CONFIG_VMM_HEAP_MAX_ORDER )
-    {
-        // compute buddy_vseg vpn_base 
-		vpn_t buddy_vpn_base = released_vseg->vpn_base ^ (1 << released_order);
-        
-        // build extended pointer on free_pages_root[current_order]
-        xptr_t root_xp = XPTR( local_cxy , &mgr->free_list_root[released_order] );
-
-        // scan this free list to find the buddy vseg
-        xptr_t   iter_xp;
-        buddy_vseg = NULL;
-        XLIST_FOREACH( root_xp , iter_xp )
+    // get lock on mmap allocator
+    spinlock_lock( &mgr->lock );
+
+    // get vseg from zombi_list or from mmap zone
+    if( list_is_empty( &mgr->zombi_list[index] ) )     // from mmap zone
+    {
+        // check overflow
+        free = mgr->first_free_vpn;
+        if( (free + size) > mgr->vpn_size ) return ENOMEM;
+
+        // update STACK allocator
+        mgr->first_free_vpn += size;
+
+        // compute base
+        base = free;
+    }
+    else                                             // from zombi_list
+    {
+        // get pointer on zombi vseg from zombi_list
+        vseg = LIST_FIRST( &mgr->zombi_list[index] , vseg_t , list );
+
+        // remove vseg from free-list
+        list_unlink( &vseg->list );
+
+        // compute base
+        base = vseg->vpn_base;
+    }    
+            
+    // release lock on mmap allocator
+    spinlock_unlock( &mgr->lock );
+
+    // returns vpn_base, vpn_size
+    *vpn_base = base;
+    *vpn_size = size;
+    return 0;
+
+}  // end vmm_mmap_allocator()
+
+//////////////////////////////////////////////
+vseg_t * vmm_create_vseg( process_t * process,
+                          intptr_t    base, 
+	                      intptr_t    size, 
+	                      uint32_t    type )
+{
+    vseg_t     * vseg;          // created vseg pointer
+    vpn_t        vpn_base;      // vseg first page 
+    vpn_t        vpn_size;      // number of pages
+	error_t      error;
+
+    // get pointer on VMM
+	vmm_t * vmm = &process->vmm;
+  
+	vmm_dmsg("\n[INFO] %s enter for process %x / base = %x / size = %x / type = %s\n",
+		     __FUNCTION__ , process->pid , base , size , vseg_type_name[type] );
+   
+    // compute base, size, vpn_base, vpn_size, depending on type
+    // we use the VMM specific allocators for STACK and MMAP vsegs
+    if( type == VSEG_TYPE_STACK )
+    {
+        // get vpn_base and vpn_size from STACK allocator
+        error = vmm_stack_alloc( vmm , &vpn_base , &vpn_size );
+        if( error )
         {
-            xptr_t   current_vseg_xp = XLIST_ELEMENT( iter_xp , vseg_t , xlist );
-            vseg_t * current_vseg    = GET_PTR( current_vseg_xp );
-
-            if( current_vseg->vpn_base == buddy_vpn_base )
-            {
-                buddy_vseg = current_vseg;
-                break;
-            }
-        }
-        
-        if( buddy_vseg != NULL )     // buddy found => merge released & buddy
-        {
-            // update released vseg fields
-            released_vseg->vpn_size = buddy_vseg->vpn_size<<1;
-            if( released_vseg->vpn_base > buddy_vseg->vpn_base) 
-                released_vseg->vpn_base = buddy_vseg->vpn_base;
-
-            // remove buddy vseg from free_list
-            xlist_unlink( XPTR( local_cxy , &buddy_vseg->xlist ) );
-
-            // release memory allocated to buddy descriptor
-            vseg_free( buddy_vseg );
-        }
-        else                         // buddy not found => register & exit
-        {
-            // register released vseg in free list
-            xlist_add_first( root_xp , XPTR( local_cxy , &released_vseg->xlist ) );
-
-            // exit while loop
-            break;
-        }
-
-        // increment released_order
-        released_order++;
-    }
-
-    // release lock
-    busylock_release( &mgr->lock );
-
-#if DEBUG_VMM_MMAP
-vmm_mmap_display( vmm );
-#endif
-
-}  // end vmm_mmap_free()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function registers one vseg in the VSL of a local process descriptor.
-////////////////////////////////////////////////////////////////////////////////////////////
-// vmm       : [in] pointer on VMM.
-// vseg      : [in] pointer on vseg.
-////////////////////////////////////////////////////////////////////////////////////////////
-void vmm_attach_vseg_to_vsl( vmm_t  * vmm,
-                             vseg_t * vseg )
-{
-    // update vseg descriptor
-    vseg->vmm = vmm;
-
-    // increment vsegs number
-    vmm->vsegs_nr++;
-
-    // add vseg in vmm list
-    xlist_add_last( XPTR( local_cxy , &vmm->vsegs_root ),
-                    XPTR( local_cxy , &vseg->xlist ) );
-
-}  // end vmm_attach_vseg_to_vsl()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function removes one vseg from the VSL of a local process descriptor.
-////////////////////////////////////////////////////////////////////////////////////////////
-// vmm       : [in] pointer on VMM.
-// vseg      : [in] pointer on vseg.
-////////////////////////////////////////////////////////////////////////////////////////////
-void vmm_detach_vseg_from_vsl( vmm_t  * vmm,
-                               vseg_t * vseg )
-{
-    // update vseg descriptor
-    vseg->vmm = NULL;
-
-    // decrement vsegs number
-    vmm->vsegs_nr--;
-
-    // remove vseg from VSL
-    xlist_unlink( XPTR( local_cxy , &vseg->xlist ) );
-
-}  // end vmm_detach_vseg_from_vsl()
-
-////////////////////////////////////////////
-error_t vmm_user_init( process_t * process )
-{
-
-#if DEBUG_VMM_USER_INIT
-thread_t * this = CURRENT_THREAD;
-uint32_t cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_USER_INIT )
-printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n", 
-__FUNCTION__ , this->process->pid, this->trdid, process->pid, local_cxy, cycle );
-#endif
-
-    // get pointer on VMM
-    vmm_t   * vmm = &process->vmm;
-
-// check UTILS zone 
-assert( __FUNCTION__ , ((CONFIG_VMM_ARGS_SIZE + CONFIG_VMM_ENVS_SIZE) <= 
-(CONFIG_VMM_ELF_BASE - CONFIG_VMM_UTILS_BASE)) , "UTILS zone too small\n" );
-
-    // initialize lock protecting the VSL 
-	remote_queuelock_init( XPTR( local_cxy , &vmm->vsl_lock ) , LOCK_VMM_VSL );
-
-    // initialize STACK allocator
-    vmm_stack_init( vmm );
-
-    // initialize MMAP allocator
-    vmm_mmap_init( vmm );
-
-    // initialize instrumentation counters
-	vmm->false_pgfault_nr    = 0;
-	vmm->local_pgfault_nr    = 0;
-	vmm->global_pgfault_nr   = 0;
-	vmm->false_pgfault_cost  = 0;
-	vmm->local_pgfault_cost  = 0;
-	vmm->global_pgfault_cost = 0;
-
-    hal_fence();
-
-#if DEBUG_VMM_USER_INIT
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_USER_INIT )
-printk("\n[%s] thread[%x,%x] exit for process %x in cluster %x / cycle %d\n", 
-__FUNCTION__, this->process->pid, this->trdid, process->pid, local_cxy, cycle );
-#endif
-
-    return 0;
-
-}  // end vmm_user_init()
-
-//////////////////////////////////////////
-void vmm_user_reset( process_t * process )
-{
-    xptr_t       vseg_xp;
-	vseg_t     * vseg;
-    vseg_type_t  vseg_type;
-
-#if DEBUG_VMM_USER_RESET
-uint32_t   cycle;
-thread_t * this = CURRENT_THREAD;
-#endif
-
-#if (DEBUG_VMM_USER_RESET & 1 )
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_USER_RESET < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, local_cxy, cycle );
-#endif
-
-#if (DEBUG_VMM_USER_RESET & 1 )
-if( DEBUG_VMM_USER_RESET < cycle )
-hal_vmm_display( XPTR( local_cxy , process ) , true );
-#endif
-
-    // get pointer on local VMM
-    vmm_t * vmm = &process->vmm;
-
-    // build extended pointer on VSL root and VSL lock
-    xptr_t   root_xp = XPTR( local_cxy , &vmm->vsegs_root );
-    xptr_t   lock_xp = XPTR( local_cxy , &vmm->vsl_lock );
-
-    // take the VSL lock
-	remote_queuelock_acquire( lock_xp );
-
-    // scan the VSL to delete all non kernel vsegs
-    // (we don't use a FOREACH in case of item deletion)
-    xptr_t   iter_xp;
-    xptr_t   next_xp;
-	for( iter_xp = hal_remote_l64( root_xp ) ; 
-         iter_xp != root_xp ;
-         iter_xp = next_xp )
-	{
-        // save extended pointer on next item in xlist
-        next_xp = hal_remote_l64( iter_xp );
-
-        // get pointers on current vseg in VSL
-        vseg_xp   = XLIST_ELEMENT( iter_xp , vseg_t , xlist );
-        vseg      = GET_PTR( vseg_xp );
-        vseg_type = vseg->type;
-
-#if( DEBUG_VMM_USER_RESET & 1 )
-if( DEBUG_VMM_USER_RESET < cycle )
-printk("\n[%s] found %s vseg / vpn_base %x / vpn_size %d\n",
-__FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
-#endif
-        // delete non kernel vseg  
-        if( (vseg_type != VSEG_TYPE_KCODE) && 
-            (vseg_type != VSEG_TYPE_KDATA) && 
-            (vseg_type != VSEG_TYPE_KDEV ) )
-        {
-            // remove vseg from VSL
-            vmm_remove_vseg( process , vseg );
-
-#if( DEBUG_VMM_USER_RESET & 1 )
-if( DEBUG_VMM_USER_RESET < cycle )
-printk("\n[%s] %s vseg deleted / vpn_base %x / vpn_size %d\n",
-__FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
-#endif
-        }
-        else
-        {
-
-#if( DEBUG_VMM_USER_RESET & 1 )
-if( DEBUG_VMM_USER_RESET < cycle )
-printk("\n[%s] keep %s vseg / vpn_base %x / vpn_size %d\n",
-__FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
-#endif
-        }
-	}  // end loop on vsegs in VSL
-
-    // release the VSL lock
-	remote_queuelock_release( lock_xp );
-
-// FIXME il faut gérer les process copies...
-
-    // re-initialise VMM
-    vmm_user_init( process );
-
-#if DEBUG_VMM_USER_RESET
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_USER_RESET < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, local_cxy , cycle );
-#endif
-
-#if (DEBUG_VMM_USER_RESET & 1 )
-if( DEBUG_VMM_USER_RESET < cycle )
-hal_vmm_display( XPTR( local_cxy , process ) , true );
-#endif
-
-}  // end vmm_user_reset()
-
-/////////////////////////////////////////////////
-void vmm_global_delete_vseg( process_t * process,
-                             intptr_t    base )
-{
-    cxy_t           owner_cxy;
-    lpid_t          owner_lpid;
-    reg_t           save_sr;
-
-    xptr_t          process_lock_xp;
-    xptr_t          process_root_xp;
-    xptr_t          process_iter_xp;
-
-    xptr_t          remote_process_xp;
-    cxy_t           remote_process_cxy;
-    process_t     * remote_process_ptr;
-
-    xptr_t          vsl_root_xp;
-    xptr_t          vsl_lock_xp;
-    xptr_t          vsl_iter_xp;
-
-    rpc_desc_t      rpc;                  // shared rpc descriptor for parallel RPCs
-    uint32_t        responses;            // RPC responses counter
-
-    thread_t      * this    = CURRENT_THREAD;
-    pid_t           pid     = process->pid;
-    cluster_t     * cluster = LOCAL_CLUSTER;
-
-#if DEBUG_VMM_GLOBAL_DELETE_VSEG
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if (DEBUG_VMM_GLOBAL_DELETE_VSEG & 1)
-if( DEBUG_VMM_GLOBAL_DELETE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] enters / process %x / base %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, base, cycle );
-#endif
-
-    // initialize a shared RPC descriptor
-    rpc.rsp       = &responses;
-    rpc.blocking  = false;                  // non blocking behaviour for rpc_send()
-    rpc.index     = RPC_VMM_REMOVE_VSEG;
-    rpc.thread    = this;
-    rpc.lid       = this->core->lid;
-    rpc.args[0]   = this->process->pid;
-    rpc.args[1]   = base;
-
-    // get owner process cluster and local index 
-    owner_cxy        = CXY_FROM_PID( pid );
-    owner_lpid       = LPID_FROM_PID( pid );
-
-    // get extended pointer on root and lock of process copies xlist in owner cluster
-    process_root_xp  = XPTR( owner_cxy , &cluster->pmgr.copies_root[owner_lpid] );
-    process_lock_xp  = XPTR( owner_cxy , &cluster->pmgr.copies_lock[owner_lpid] );
-
-    // mask IRQs
-    hal_disable_irq( &save_sr );
-
-    // client thread blocks itself
-    thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
-
-    // take the lock protecting process copies
-    remote_queuelock_acquire( process_lock_xp );
-
-    // initialize responses counter
-    responses = 0;
-
-    // loop on process copies
-    XLIST_FOREACH( process_root_xp , process_iter_xp )
-    {
-        // get cluster and local pointer on remote process
-        remote_process_xp  = XLIST_ELEMENT( process_iter_xp , process_t , copies_list );
-        remote_process_ptr = GET_PTR( remote_process_xp );
-        remote_process_cxy = GET_CXY( remote_process_xp );
-
-        // build extended pointers on remote VSL root and lock
-        vsl_root_xp = XPTR( remote_process_cxy , &remote_process_ptr->vmm.vsegs_root );
-        vsl_lock_xp = XPTR( remote_process_cxy , &remote_process_ptr->vmm.vsl_lock );
-
-        // get lock on remote VSL
-        remote_queuelock_acquire( vsl_lock_xp );
-
-        // loop on vsegs in remote process VSL
-        XLIST_FOREACH( vsl_root_xp , vsl_iter_xp )
-        {
-            // get pointers on current vseg 
-            xptr_t   vseg_xp  = XLIST_ELEMENT( vsl_iter_xp , vseg_t , xlist );
-            vseg_t * vseg_ptr = GET_PTR( vseg_xp );
-
-            // get current vseg base address
-            intptr_t vseg_base = (intptr_t)hal_remote_lpt( XPTR( remote_process_cxy,
-                                                                 &vseg_ptr->min ) );
-
-            if( vseg_base == base )   // found searched vseg
-            {
-                // atomically increment responses counter
-                hal_atomic_add( &responses , 1 );
-
-#if (DEBUG_VMM_GLOBAL_DELETE_VSEG & 1)
-if( DEBUG_VMM_GLOBAL_DELETE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] register RPC request in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, remote_process_cxy );
-#endif
-                // send RPC to remote cluster
-                rpc_send( remote_process_cxy , &rpc );
-
-                // exit loop on vsegs
-                break;
-            }
-        }  // end of loop on vsegs
-
-        // release lock on remote VSL
-        remote_queuelock_release( vsl_lock_xp );
-
-    }  // end of loop on process copies
-
-    // release the lock protecting process copies
-    remote_queuelock_release( process_lock_xp );
-
-#if (DEBUG_VMM_GLOBAL_DELETE_VSEG & 1)
-if( DEBUG_VMM_GLOBAL_DELETE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] deschedule / process %x / base %x\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, base );
-#endif
-
-    // client thread deschedule
-    sched_yield("blocked on rpc_vmm_delete_vseg");
- 
-    // restore IRQs
-    hal_restore_irq( save_sr );
-
-#if DEBUG_VMM_GLOBAL_DELETE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_GLOBAL_DELETE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] exit / process %x / base %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, base, cycle );
-#endif
-
-}  // end vmm_global_delete_vseg()
-
-////////////////////////////////////////////////
-void vmm_global_resize_vseg( process_t * process,
-                             intptr_t    base,
-                             intptr_t    new_base,
-                             intptr_t    new_size )
-{
-    cxy_t           owner_cxy;
-    lpid_t          owner_lpid;
-    reg_t           save_sr;
-
-    xptr_t          process_lock_xp;
-    xptr_t          process_root_xp;
-    xptr_t          process_iter_xp;
-
-    xptr_t          remote_process_xp;
-    cxy_t           remote_process_cxy;
-    process_t     * remote_process_ptr;
-
-    xptr_t          vsl_root_xp;
-    xptr_t          vsl_lock_xp;
-    xptr_t          vsl_iter_xp;
-
-    rpc_desc_t      rpc;                  // shared rpc descriptor for parallel RPCs
-    uint32_t        responses;            // RPC responses counter
-
-    thread_t      * this    = CURRENT_THREAD; 
-    pid_t           pid     = process->pid;
-    cluster_t     * cluster = LOCAL_CLUSTER;
-
-#if DEBUG_VMM_GLOBAL_RESIZE_VSEG
-uint32_t cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if (DEBUG_VMM_GLOBAL_RESIZE_VSEG & 1)
-if( DEBUG_VMM_GLOBAL_RESIZE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] : process %x / base %x / new_base %x / new_size %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, base, new_base, new_size, cycle );
-#endif
-
-    // initialize a shared RPC descriptor
-    rpc.rsp       = &responses;
-    rpc.blocking  = false;                  // non blocking behaviour for rpc_send()
-    rpc.index     = RPC_VMM_REMOVE_VSEG;
-    rpc.thread    = this;
-    rpc.lid       = this->core->lid;
-    rpc.args[0]   = this->process->pid;
-    rpc.args[1]   = base;
-    rpc.args[2]   = new_base;
-    rpc.args[3]   = new_size;
-
-    // get owner process cluster and local index
-    owner_cxy        = CXY_FROM_PID( pid );
-    owner_lpid       = LPID_FROM_PID( pid );
-
-    // get extended pointer on root and lock of process copies xlist in owner cluster
-    process_root_xp  = XPTR( owner_cxy , &cluster->pmgr.copies_root[owner_lpid] );
-    process_lock_xp  = XPTR( owner_cxy , &cluster->pmgr.copies_lock[owner_lpid] );
-
-    // mask IRQs
-    hal_disable_irq( &save_sr );
-
-    // client thread blocks itself
-    thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_RPC );
-
-    // take the lock protecting process copies
-    remote_queuelock_acquire( process_lock_xp );
-
-    // initialize responses counter
-    responses = 0;
-
-    // loop on process copies
-    XLIST_FOREACH( process_root_xp , process_iter_xp )
-    {
-        // get cluster and local pointer on remote process
-        remote_process_xp  = XLIST_ELEMENT( process_iter_xp , process_t , copies_list );
-        remote_process_ptr = GET_PTR( remote_process_xp );
-        remote_process_cxy = GET_CXY( remote_process_xp );
-
-        // build extended pointers on remote VSL root and lock
-        vsl_root_xp = XPTR( remote_process_cxy , &remote_process_ptr->vmm.vsegs_root );
-        vsl_lock_xp = XPTR( remote_process_cxy , &remote_process_ptr->vmm.vsl_lock );
-
-        // get lock on remote VSL
-        remote_queuelock_acquire( vsl_lock_xp );
-
-        // loop on vsegs in remote process VSL
-        XLIST_FOREACH( vsl_root_xp , vsl_iter_xp )
-        {
-            // get pointers on current vseg 
-            xptr_t   vseg_xp  = XLIST_ELEMENT( vsl_iter_xp , vseg_t , xlist );
-            vseg_t * vseg_ptr = GET_PTR( vseg_xp );
-
-            // get current vseg base address
-            intptr_t vseg_base = (intptr_t)hal_remote_lpt( XPTR( remote_process_cxy,
-                                                                 &vseg_ptr->min ) );
-
-            if( vseg_base == base )   // found searched vseg
-            {
-                // atomically increment responses counter
-                hal_atomic_add( &responses , 1 );
-
-#if (DEBUG_VMM_GLOBAL_RESIZE_VSEG & 1)
-if( DEBUG_VMM_GLOBAL_RESIZE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] register RPC request in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, remote_process_cxy );
-#endif
-                // send RPC to remote cluster
-                rpc_send( remote_process_cxy , & rpc );
-
-                // exit loop on vsegs
-                break;
-            }
-
-        }  // end of loop on vsegs
-
-#if (DEBUG_VMM_GLOBAL_RESIZE_VSEG & 1)
-if( DEBUG_VMM_GLOBAL_RESIZE_VSEG < cycle )
-hal_vmm_display( remote_process_xp , false );
-#endif
-
-        // release lock on remote VSL
-        remote_queuelock_release( vsl_lock_xp );
-
-    }  // end of loop on process copies
-
-    // release the lock protecting process copies
-    remote_queuelock_release( process_lock_xp );
-
-#if (DEBUG_VMM_GLOBAL_RESIZE_VSEG & 1)
-if( DEBUG_VMM_GLOBAL_RESIZE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] deschedule / process %x / base %x\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, base );
-#endif
-
-    // client thread deschedule
-    sched_yield("blocked on rpc_vmm_delete_vseg");
-
-    // restore IRQs
-    hal_restore_irq( save_sr );
-
-#if DEBUG_VMM_GLOBAL_RESIZE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_GLOBAL_RESIZE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / base %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid , base, cycle );
-#endif
-
-}  // end vmm_global_resize_vseg()
-
-////////////////////////////////////////////////
-void vmm_global_update_pte( process_t * process,
-                            vpn_t       vpn,
-                            uint32_t    attr,
-                            ppn_t       ppn )
-{
-    pid_t           pid;
-    cxy_t           owner_cxy;
-    lpid_t          owner_lpid;
-
-    xlist_entry_t * process_root_ptr;
-    xptr_t          process_root_xp;
-    xptr_t          process_iter_xp;
-
-    xptr_t          remote_process_xp;
-    cxy_t           remote_process_cxy;
-    process_t     * remote_process_ptr;
-    xptr_t          remote_gpt_xp;
-
-#if DEBUG_VMM_GLOBAL_UPDATE_PTE
-uint32_t cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-#endif
-
-
-#if (DEBUG_VMM_GLOBAL_UPDATE_PTE & 1)
-if( DEBUG_VMM_GLOBAL_UPDATE_PTE < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x / vpn %x / attr %x / ppn %x / ycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, vpn, attr, ppn, cycle );
-#endif
-
-    // get owner process cluster and local index
-    pid              = process->pid;
-    owner_cxy        = CXY_FROM_PID( pid );
-    owner_lpid       = LPID_FROM_PID( pid );
-
-    // get extended pointer on root of process copies xlist in owner cluster
-    process_root_ptr = &LOCAL_CLUSTER->pmgr.copies_root[owner_lpid];
-    process_root_xp  = XPTR( owner_cxy , process_root_ptr );
-
-    // loop on process copies
-    XLIST_FOREACH( process_root_xp , process_iter_xp )
-    {
-        // get cluster and local pointer on remote process
-        remote_process_xp  = XLIST_ELEMENT( process_iter_xp , process_t , copies_list );
-        remote_process_ptr = GET_PTR( remote_process_xp );
-        remote_process_cxy = GET_CXY( remote_process_xp );
-
-#if (DEBUG_VMM_GLOBAL_UPDATE_PTE & 1)
-if( DEBUG_VMM_GLOBAL_UPDATE_PTE < cycle )
-printk("\n[%s] thread[%x,%x] handling vpn %x for process %x in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, process->pid, remote_process_cxy );
-#endif
-
-        // get extended pointer on remote gpt
-        remote_gpt_xp = XPTR( remote_process_cxy , &remote_process_ptr->vmm.gpt );
-
-        // update remote GPT
-        hal_gpt_update_pte( remote_gpt_xp, vpn, attr, ppn );
-    }  
-
-#if DEBUG_VMM_GLOBAL_UPDATE_PTE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_GLOBAL_UPDATE_PTE < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / vpn %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid , vpn , cycle );
-#endif
-
-#if (DEBUG_VMM_GLOBAL_UPDATE_PTE & 1)
-hal_vmm_display( process , true );
-#endif
-
-}  // end vmm_global_update_pte()
-
-///////////////////////////////////////
-void vmm_set_cow( process_t * process )
-{
-    vmm_t         * vmm;
-
-    xlist_entry_t * process_root_ptr;
-    xptr_t          process_root_xp;
-    xptr_t          process_iter_xp;
-
-    xptr_t          remote_process_xp;
-    cxy_t           remote_process_cxy;
-    process_t     * remote_process_ptr;
-    xptr_t          remote_gpt_xp;
-
-    xptr_t          vseg_root_xp;
-    xptr_t          vseg_iter_xp;
-
-    xptr_t          vseg_xp;
-    vseg_t        * vseg;
-
-    pid_t           pid;
-    cxy_t           owner_cxy;
-    lpid_t          owner_lpid;
-
-    // get target process PID
-    pid = process->pid;
-
-#if DEBUG_VMM_SET_COW
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_VMM_SET_COW < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pid , cycle );
-#endif
-
-#if (DEBUG_VMM_SET_COW & 1)
-if( DEBUG_VMM_SET_COW < cycle )
-hal_vmm_display( process , true );
-#endif
-
-// check cluster is reference
-assert( __FUNCTION__, (XPTR( local_cxy , process ) == process->ref_xp),
-"local cluster must be process reference cluster\n");
-
-    // get pointer on reference VMM
-    vmm = &process->vmm;
-
-    // get extended pointer on root of process copies xlist in owner cluster
-    owner_cxy        = CXY_FROM_PID( pid );
-    owner_lpid       = LPID_FROM_PID( pid );
-    process_root_ptr = &LOCAL_CLUSTER->pmgr.copies_root[owner_lpid];
-    process_root_xp  = XPTR( owner_cxy , process_root_ptr );
-
-    // get extended pointer on root of vsegs xlist from reference VMM
-    vseg_root_xp  = XPTR( local_cxy , &vmm->vsegs_root ); 
-
-    // loop on target process copies
-    XLIST_FOREACH( process_root_xp , process_iter_xp )
-    {
-        // get cluster and local pointer on remote process copy
-        remote_process_xp  = XLIST_ELEMENT( process_iter_xp , process_t , copies_list );
-        remote_process_ptr = GET_PTR( remote_process_xp );
-        remote_process_cxy = GET_CXY( remote_process_xp );
-
-#if (DEBUG_VMM_SET_COW & 1)
-if( DEBUG_VMM_SET_COW < cycle )
-printk("\n[%s] thread[%x,%x] (%x) handles process %x in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, this, pid, remote_process_cxy );
-#endif
-
-        // get extended pointer on remote gpt
-        remote_gpt_xp = XPTR( remote_process_cxy , &remote_process_ptr->vmm.gpt );
-
-        // loop on vsegs in (local) reference process VSL
-        XLIST_FOREACH( vseg_root_xp , vseg_iter_xp )
-        {
-            // get pointer on vseg
-            vseg_xp  = XLIST_ELEMENT( vseg_iter_xp , vseg_t , xlist );
-            vseg     = GET_PTR( vseg_xp );
-
-            // get vseg type, base and size
-            uint32_t type     = vseg->type;
-            vpn_t    vpn_base = vseg->vpn_base;
-            vpn_t    vpn_size = vseg->vpn_size;
-
-#if (DEBUG_VMM_SET_COW & 1)
-if( DEBUG_VMM_SET_COW < cycle )
-printk("\n[%s] thread[%x,%x] found vseg %s / vpn_base = %x / vpn_size = %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg_type_str(type), vpn_base, vpn_size );
-#endif
-            // only DATA, ANON and REMOTE vsegs
-            if( (type == VSEG_TYPE_DATA)  ||
-                (type == VSEG_TYPE_ANON)  ||
-                (type == VSEG_TYPE_REMOTE) )
-            {
-                vpn_t      vpn;
-                uint32_t   attr;
-                ppn_t      ppn;
-                xptr_t     page_xp;
-                cxy_t      page_cxy;
-                page_t   * page_ptr;
-                xptr_t     forks_xp;
-                xptr_t     lock_xp;
-
-                // update flags in remote GPT 
-                hal_gpt_set_cow( remote_gpt_xp,
-                                 vpn_base,
-                                 vpn_size ); 
-
-                // atomically increment pending forks counter in physical pages,
-                // this is only done once, when handling the reference copy 
-                if( remote_process_cxy == local_cxy )
-                {
-
-#if (DEBUG_VMM_SET_COW & 1)
-if( DEBUG_VMM_SET_COW < cycle )
-printk("\n[%s] thread[%x,%x] handles vseg %s / vpn_base = %x / vpn_size = %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg_type_str(type), vpn_base, vpn_size );
-#endif
-                    // scan all pages in vseg 
-                    for( vpn = vpn_base ; vpn < (vpn_base + vpn_size) ; vpn++ )
-                    {
-                        // get page attributes and PPN from reference GPT
-                        hal_gpt_get_pte( remote_gpt_xp , vpn , &attr , &ppn ); 
-
-                        // atomically update pending forks counter if page is mapped
-                        if( attr & GPT_MAPPED )
-                        {
-                            // get pointers and cluster on page descriptor
-                            page_xp  = ppm_ppn2page( ppn );
-                            page_cxy = GET_CXY( page_xp );
-                            page_ptr = GET_PTR( page_xp );
-
-                            // get extended pointers on "forks" and "lock"
-                            forks_xp = XPTR( page_cxy , &page_ptr->forks );
-                            lock_xp  = XPTR( page_cxy , &page_ptr->lock );
-
-                            // take lock protecting "forks" counter
-                            remote_busylock_acquire( lock_xp );
-
-                            // increment "forks"
-                            hal_remote_atomic_add( forks_xp , 1 );
-
-                            // release lock protecting "forks" counter
-                            remote_busylock_release( lock_xp );
-                        }
-                    }   // end loop on vpn
-
-#if (DEBUG_VMM_SET_COW & 1)
-if( DEBUG_VMM_SET_COW < cycle )
-printk("\n[%s] thread[%x,%x] completes vseg %s / vpn_base = %x / vpn_size = %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg_type_str(type), vpn_base, vpn_size );
-#endif
-                }   // end if local
-            }   // end if vseg type
-        }   // end loop on vsegs
-    }   // end loop on process copies
- 
-#if DEBUG_VMM_SET_COW
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_SET_COW < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid , cycle );
-#endif
-
-}  // end vmm_set-cow()
-
-/////////////////////////////////////////////////
-error_t vmm_fork_copy( process_t * child_process,
-                       xptr_t      parent_process_xp )
-{
-    error_t     error;
-    cxy_t       parent_cxy;
-    process_t * parent_process;
-    vmm_t     * parent_vmm;
-    xptr_t      parent_lock_xp;
-    vmm_t     * child_vmm;
-    xptr_t      iter_xp;
-    xptr_t      parent_vseg_xp;
-    vseg_t    * parent_vseg;
-    vseg_t    * child_vseg;
-    uint32_t    type;
-    vpn_t       vpn;            
-    vpn_t       vpn_base;
-    vpn_t       vpn_size;
-    xptr_t      parent_root_xp;
-    bool_t      mapped; 
-    ppn_t       ppn;
-
-#if DEBUG_VMM_FORK_COPY
-uint32_t cycle = (uint32_t)hal_get_cycles();
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_VMM_FORK_COPY < cycle )
-printk("\n[%s] thread %x enter / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, cycle );
-#endif
-
-    // get parent process cluster and local pointer
-    parent_cxy     = GET_CXY( parent_process_xp );
-    parent_process = GET_PTR( parent_process_xp );
-
-    // get local pointers on parent and child VMM
-    parent_vmm = &parent_process->vmm; 
-    child_vmm  = &child_process->vmm;
-
-    // build extended pointer on parent VSL root and lock
-    parent_root_xp = XPTR( parent_cxy , &parent_vmm->vsegs_root );
-    parent_lock_xp = XPTR( parent_cxy , &parent_vmm->vsl_lock );
-
-    // take the lock protecting the parent VSL 
-    remote_queuelock_acquire( parent_lock_xp );
-
-    // loop on parent VSL xlist
-    XLIST_FOREACH( parent_root_xp , iter_xp )
-    {
-        // get pointers on current parent vseg
-        parent_vseg_xp = XLIST_ELEMENT( iter_xp , vseg_t , xlist );
-        parent_vseg    = GET_PTR( parent_vseg_xp );
-
-        // get vseg type
-        type = hal_remote_l32( XPTR( parent_cxy , &parent_vseg->type ) );
-        
-#if DEBUG_VMM_FORK_COPY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_FORK_COPY < cycle )
-printk("\n[%s] thread[%x,%x] found parent vseg %s / vpn_base = %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, vseg_type_str(type),
-hal_remote_l32( XPTR( parent_cxy , &parent_vseg->vpn_base ) ) , cycle );
-#endif
-
-        // all parent vsegs - but STACK and kernel vsegs - must be copied in child VSL
-        if( (type != VSEG_TYPE_STACK) && (type != VSEG_TYPE_KCODE) &&
-            (type != VSEG_TYPE_KDATA) && (type != VSEG_TYPE_KDEV) )
-        {
-            // allocate memory for a new child vseg
-            child_vseg = vseg_alloc();
-            if( child_vseg == NULL )   // release all allocated vsegs
-            {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] in %s : cannot create vseg for child in cluster %x\n",
-__FUNCTION__, local_cxy );
-#endif
-                vmm_destroy( child_process );
-                return -1;
-            }
-
-            // copy parent vseg to child vseg
-            vseg_init_from_ref( child_vseg , parent_vseg_xp );
-
-            // build extended pointer on child VSL lock
-            xptr_t child_lock_xp = XPTR( local_cxy , &child_vmm->vsl_lock );
- 
-            // take the child VSL lock 
-            remote_queuelock_acquire( child_lock_xp );
-
-            // register child vseg in child VSL
-            vmm_attach_vseg_to_vsl( child_vmm , child_vseg );
-
-            // release the child VSL lock
-            remote_queuelock_release( child_lock_xp );
-
-#if DEBUG_VMM_FORK_COPY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_FORK_COPY < cycle )
-printk("\n[%s] thread[%x,%x] copied vseg %s / vpn_base = %x to child VSL / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, vseg_type_str(type),
-hal_remote_l32( XPTR( parent_cxy , &parent_vseg->vpn_base ) ) , cycle );
-#endif
-            // copy DATA, ANON, REMOTE, FILE parent GPT entries to child GPT
-            if( type != VSEG_TYPE_CODE )
-            {
-                // activate the COW for DATA, ANON, REMOTE vsegs only
-                // cow = ( type != VSEG_TYPE_FILE );
-
-                vpn_base = child_vseg->vpn_base;
-                vpn_size = child_vseg->vpn_size;
-
-                // scan pages in parent vseg
-                for( vpn = vpn_base ; vpn < (vpn_base + vpn_size) ; vpn++ )
-                {
-                    error = hal_gpt_pte_copy( &child_vmm->gpt,
-                                              vpn,
-                                              XPTR( parent_cxy , &parent_vmm->gpt ),
-                                              vpn,
-                                              false,      // does not handle COW flag
-                                              &ppn,       // unused
-                                              &mapped );  // unused
-                    if( error )
-                    {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] in %s : cannot copy GPT\n",
-__FUNCTION__ );
-#endif
-                        vmm_destroy( child_process );
-                        return -1;
-                    }
-
-#if DEBUG_VMM_FORK_COPY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_FORK_COPY < cycle )
-printk("\n[%s] thread[%x,%x] copied vpn %x to child GPT / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid , vpn , cycle );
-#endif
-                }
-            }   // end if no code & no stack
-        }   // end if no stack
-    }   // end loop on vsegs
-
-    // release the parent VSL lock in read mode
-    remote_queuelock_release( parent_lock_xp );
-
-    // copy base addresses from parent VMM to child VMM
-    child_vmm->args_vpn_base = (vpn_t)hal_remote_lpt(XPTR(parent_cxy, &parent_vmm->args_vpn_base));
-    child_vmm->envs_vpn_base = (vpn_t)hal_remote_lpt(XPTR(parent_cxy, &parent_vmm->envs_vpn_base));
-    child_vmm->heap_vpn_base = (vpn_t)hal_remote_lpt(XPTR(parent_cxy, &parent_vmm->heap_vpn_base));
-    child_vmm->code_vpn_base = (vpn_t)hal_remote_lpt(XPTR(parent_cxy, &parent_vmm->code_vpn_base));
-    child_vmm->data_vpn_base = (vpn_t)hal_remote_lpt(XPTR(parent_cxy, &parent_vmm->data_vpn_base));
-
-    child_vmm->entry_point = (intptr_t)hal_remote_lpt(XPTR(parent_cxy, &parent_vmm->entry_point));
-
-    hal_fence();
-
-#if DEBUG_VMM_FORK_COPY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_FORK_COPY < cycle )
-printk("\n[%s] thread[%x,%x] exit successfully / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid , cycle );
-#endif
-
-    return 0;
-
-}  // vmm_fork_copy()
-
-///////////////////////////////////////
-void vmm_destroy( process_t * process )
-{
-    xptr_t   vseg_xp;
-	vseg_t * vseg;
-
-#if DEBUG_VMM_DESTROY
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_VMM_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] enter for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, local_cxy, cycle );
-#endif
-
-#if (DEBUG_VMM_DESTROY & 1 )
-if( DEBUG_VMM_DESTROY < cycle )
-hal_vmm_display( XPTR( local_cxy, process ) , true );
-#endif
-
-    // get pointer on local VMM
-    vmm_t  * vmm = &process->vmm;
-
-    // build extended pointer on VSL root, VSL lock and GPT lock
-    xptr_t   vsl_root_xp = XPTR( local_cxy , &vmm->vsegs_root );
-    xptr_t   vsl_lock_xp = XPTR( local_cxy , &vmm->vsl_lock );
-
-    // take the VSL lock
-    remote_queuelock_acquire( vsl_lock_xp );
-
-    // scan the VSL to delete all registered vsegs
-    // (we don't use a FOREACH in case of item deletion)
-    xptr_t  iter_xp;
-    xptr_t  next_xp;
-	for( iter_xp = hal_remote_l64( vsl_root_xp ) ; 
-         iter_xp != vsl_root_xp ;
-         iter_xp = next_xp )
-	{
-        // save extended pointer on next item in xlist
-        next_xp = hal_remote_l64( iter_xp );
-
-        // get pointers on current vseg in VSL
-        vseg_xp   = XLIST_ELEMENT( iter_xp , vseg_t , xlist );
-        vseg      = GET_PTR( vseg_xp );
-
-        // delete vseg and release physical pages 
-        vmm_remove_vseg( process , vseg );
-
-#if( DEBUG_VMM_DESTROY & 1 )
-if( DEBUG_VMM_DESTROY < cycle )
-printk("\n[%s] %s vseg deleted / vpn_base %x / vpn_size %d\n",
-__FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
-#endif
-
-	}
-
-    // release the VSL lock
-    remote_queuelock_release( vsl_lock_xp );
-
-    // remove all registered MMAP vsegs from free_lists in MMAP allocator
-    uint32_t i;
-    for( i = 0 ; i <= CONFIG_VMM_HEAP_MAX_ORDER ; i++ )
-    {
-        // build extended pointer on free list root
-        xptr_t root_xp = XPTR( local_cxy , &vmm->mmap_mgr.free_list_root[i] );
-  
-        // scan zombi_list[i]
-	    while( !xlist_is_empty( root_xp ) )
-	    {
-		    vseg_xp = XLIST_FIRST( root_xp , vseg_t , xlist );
-            vseg    = GET_PTR( vseg_xp );
-
-#if( DEBUG_VMM_DESTROY & 1 )
-if( DEBUG_VMM_DESTROY < cycle )
-printk("\n[%s] found zombi vseg / vpn_base %x / vpn_size %d\n",
-__FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
-#endif
-            // clean vseg descriptor
-            vseg->vmm = NULL;
-
-            // remove vseg from  zombi_list
-            xlist_unlink( XPTR( local_cxy , &vseg->xlist ) );
-
-		    // release vseg descriptor
-            vseg_free( vseg );
-
-#if( DEBUG_VMM_DESTROY & 1 )
-if( DEBUG_VMM_DESTROY < cycle )
-printk("\n[%s] zombi vseg released / vpn_base %x / vpn_size %d\n",
-__FUNCTION__ , vseg_type_str( vseg->type ), vseg->vpn_base, vseg->vpn_size );
-#endif
-	    }
-    }
-
-    // release memory allocated to the GPT itself
-    hal_gpt_destroy( &vmm->gpt );
-
-#if DEBUG_VMM_DESTROY
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_DESTROY < cycle )
-printk("\n[%s] thread[%x,%x] exit for process %x in cluster %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, process->pid, local_cxy , cycle );
-#endif
-
-}  // end vmm_destroy()
-
-/////////////////////////////////////////////////
-vseg_t * vmm_check_conflict( process_t * process,
-                             vpn_t       vpn_base,
-                             vpn_t       vpn_size )
-{
-    vmm_t        * vmm = &process->vmm;
-
-    // scan the VSL
-	vseg_t       * vseg;
-    xptr_t         iter_xp;
-    xptr_t         vseg_xp;
-    xptr_t         root_xp = XPTR( local_cxy , &vmm->vsegs_root );
-
-	XLIST_FOREACH( root_xp , iter_xp )
-	{
-		vseg_xp = XLIST_ELEMENT( iter_xp , vseg_t , xlist );
-        vseg    = GET_PTR( vseg_xp );
-
-		if( ((vpn_base + vpn_size) > vseg->vpn_base) &&
-             (vpn_base < (vseg->vpn_base + vseg->vpn_size)) ) return vseg;
-	}
-    return NULL;
-
-}  // end vmm_check_conflict()
-
-////////////////////////////////////////////////
-vseg_t * vmm_create_vseg( process_t   * process,
-	                      vseg_type_t   type,
-                          intptr_t      base,         // ltid for VSEG_TYPE_STACK
-	                      uint32_t      size,
-                          uint32_t      file_offset,
-                          uint32_t      file_size,
-                          xptr_t        mapper_xp,
-                          cxy_t         cxy )
-{
-    vseg_t     * vseg;          // pointer on allocated vseg descriptor 
-
-#if DEBUG_VMM_CREATE_VSEG
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle;
-#endif
-
-#if (DEBUG_VMM_CREATE_VSEG & 1)
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_CREATE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] enter / process %x / %s / base %x / cxy %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-process->pid, vseg_type_str(type), base, cxy, cycle );
-#endif
-
-    // get pointer on VMM 
-	vmm_t * vmm    = &process->vmm;
-
-    // allocate a vseg descriptor and initialize it, depending on type
-    // we use specific allocators for "stack" and "mmap" types
-
-    /////////////////////////////
-    if( type == VSEG_TYPE_STACK )
-    {
-        // get vseg from STACK allocator
-        vseg = vmm_stack_alloc( vmm , base );    // base == ltid
-       
-        if( vseg == NULL )
-        {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] %s cannot create %s vseg for process %x in cluster %x\n",
-__FUNCTION__ , vseg_type_str( type ) , process->pid , local_cxy );
-#endif
+            printk("\n[ERROR] in %s : no vspace for stack vseg / process %x in cluster %x\n",
+                   __FUNCTION__ , process->pid , local_cxy );
             return NULL;
         }
 
-        // initialize vseg
-        vseg->type = type;
-        vseg->vmm  = vmm;
-        vseg->min  = vseg->vpn_base << CONFIG_PPM_PAGE_ORDER;
-        vseg->max  = vseg->min + (vseg->vpn_size << CONFIG_PPM_PAGE_ORDER);
-        vseg->cxy  = cxy;
-
-        vseg_init_flags( vseg , type );
-    }
-    /////////////////////////////////
-    else if( type == VSEG_TYPE_FILE )
-    {
-        // compute page index (in mapper) for first and last byte
-        vpn_t    vpn_min    = file_offset >> CONFIG_PPM_PAGE_ORDER;
-        vpn_t    vpn_max    = (file_offset + size - 1) >> CONFIG_PPM_PAGE_ORDER;
-
-        // compute offset in first page and number of pages
-        uint32_t offset = file_offset & CONFIG_PPM_PAGE_MASK;
-        vpn_t    npages      = vpn_max - vpn_min + 1;
-
-        // get vseg from MMAP allocator
-        vseg = vmm_mmap_alloc( vmm , npages );
-
-        if( vseg == NULL )
+        // compute vseg base and size from vpn_base and vpn_size
+        base = vpn_base << CONFIG_PPM_PAGE_SHIFT;
+        size = vpn_size << CONFIG_PPM_PAGE_SHIFT;
+    }
+    else if( (type == VSEG_TYPE_ANON) || 
+             (type == VSEG_TYPE_FILE) || 
+             (type == VSEG_TYPE_REMOTE) )
+    {
+        // get vpn_base and vpn_size from MMAP allocator
+        vpn_t npages = size >> CONFIG_PPM_PAGE_SHIFT;
+        error = vmm_mmap_alloc( vmm , npages , &vpn_base , &vpn_size );
+        if( error )
         {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] %s cannot create %s vseg for process %x in cluster %x\n",
-__FUNCTION__ , vseg_type_str( type ) , process->pid , local_cxy );
-#endif
+            printk("\n[ERROR] in %s : no vspace for mmap vseg / process %x in cluster %x\n",
+                   __FUNCTION__ , process->pid , local_cxy );
             return NULL;
         }
 
-        // initialize vseg 
-        vseg->type        = type;
-        vseg->vmm         = vmm;
-        vseg->min         = (vseg->vpn_base << CONFIG_PPM_PAGE_ORDER) + offset; 
-        vseg->max         = vseg->min + size;
-        vseg->file_offset = file_offset;
-        vseg->file_size   = file_size;
-        vseg->mapper_xp   = mapper_xp;
-        vseg->cxy         = cxy;
-
-        vseg_init_flags( vseg , type );
-    }
-    /////////////////////////////////////////////////////////////////
-    else if( (type == VSEG_TYPE_ANON) || (type == VSEG_TYPE_REMOTE) )
-    {
-        // compute number of required pages in virtual space
-        vpn_t npages = size >> CONFIG_PPM_PAGE_ORDER;
-        if( size & CONFIG_PPM_PAGE_MASK) npages++;
-        
-        // allocate vseg from MMAP allocator
-        vseg = vmm_mmap_alloc( vmm , npages );
-
-        if( vseg == NULL )
+        // compute vseg base and size from vpn_base and vpn_size
+        base = vpn_base << CONFIG_PPM_PAGE_SHIFT;
+        size = vpn_size << CONFIG_PPM_PAGE_SHIFT;
+    }
+    else
+    {
+        vpn_base = ARROUND_DOWN( base , CONFIG_PPM_PAGE_SIZE ) >> CONFIG_PPM_PAGE_SHIFT;
+	    vpn_size = ARROUND_UP( base + size , CONFIG_PPM_PAGE_SIZE ) >> CONFIG_PPM_PAGE_SHIFT;
+    }
+
+    // check collisions
+    vseg = vmm_check_conflict( process , vpn_base , vpn_size );
+    if( vseg != NULL )
+    {
+        printk("\n[ERROR] in %s for process %x : new vseg [vpn_base = %x / vpn_size = %x]\n" 
+               "  overlap existing vseg [vpn_base = %x / vpn_size = %x]\n",
+               __FUNCTION__ , process->pid, vpn_base, vpn_size, 
+               vseg->vpn_base, vseg->vpn_size ); 
+        return NULL;
+    }
+
+    // allocate physical memory for vseg descriptor
+	vseg = vseg_alloc();
+	if( vseg == NULL )
+	{
+	    printk("\n[ERROR] in %s for process %x : cannot allocate memory for vseg\n",
+             __FUNCTION__ , process->pid );
+        return NULL;
+	}
+
+    // initialize vseg descriptor
+	vseg_init( vseg , base, size , vpn_base , vpn_size , type , local_cxy , 0 , 0 );
+
+    // update "heap_vseg" in VMM
+	process->vmm.heap_vseg = vseg;
+
+    // attach vseg to vmm
+	rwlock_wr_lock( &vmm->vsegs_lock );
+	vseg_attach( vmm , vseg );
+	rwlock_wr_unlock( &vmm->vsegs_lock );
+
+	vmm_dmsg("\n[INFO] : %s exit for process %x, vseg [%x, %x] has been mapped\n", 
+		     __FUNCTION__ , process->pid , vseg->min , vseg->max );
+  
+	return vseg;
+
+}  // end vmm_create_vseg()
+
+/////////////////////////////////////
+void vmm_remove_vseg( vseg_t * vseg )
+{
+    // get pointers on calling process and VMM
+    thread_t   * this    = CURRENT_THREAD;
+    process_t  * process = this->process;
+    vmm_t      * vmm     = &this->process->vmm;
+    uint32_t     type    = vseg->type;
+
+    // detach vseg from VMM
+	rwlock_wr_lock( &vmm->vsegs_lock );
+    vseg_detach( &process->vmm , vseg );
+	rwlock_wr_unlock( &vmm->vsegs_lock );
+
+    // release the stack slot to VMM stack allocator if STACK type
+    if( type == VSEG_TYPE_STACK )
+    {
+        // get pointer on stack allocator
+        stack_mgr_t * mgr = &vmm->stack_mgr;
+
+        // compute slot index
+        uint32_t index = ((vseg->vpn_base - mgr->vpn_base - 1) / CONFIG_VMM_STACK_SIZE);
+
+        // update stacks_bitmap
+        spinlock_lock( &mgr->lock );
+        bitmap_clear( &mgr->bitmap , index );
+        spinlock_unlock( &mgr->lock );
+    }
+
+    // release the vseg to VMM mmap allocator if MMAP type
+    if( (type == VSEG_TYPE_ANON) || (type == VSEG_TYPE_FILE) || (type == VSEG_TYPE_REMOTE) )
+    {
+        // get pointer on mmap allocator
+        mmap_mgr_t * mgr = &vmm->mmap_mgr;
+
+        // compute zombi_list index
+        uint32_t index = bits_log2( vseg->vpn_size );
+
+        // update zombi_list
+        spinlock_lock( &mgr->lock );
+        list_add_first( &mgr->zombi_list[index] , &vseg->list );
+        spinlock_unlock( &mgr->lock );
+    }
+
+    // release physical memory allocated for vseg descriptor if no MMAP type
+    if( (type != VSEG_TYPE_ANON) && (type != VSEG_TYPE_FILE) && (type != VSEG_TYPE_REMOTE) )
+    {
+        vseg_free( vseg );
+    }
+
+}  // end vmm_remove_vseg()
+
+
+//////////////////////////////////////////
+error_t vmm_map_vseg( vseg_t    * vseg,
+                      uint32_t    attr )
+{
+    vpn_t       vpn;        // VPN of PTE to be set
+    vpn_t       vpn_min;    // VPN of first PTE to be set
+    vpn_t       vpn_max;    // VPN of last PTE to be set (excluded)
+	ppn_t       ppn;        // PPN of allocated physical page
+	uint32_t    order;      // ln( number of small pages for one single PTE )
+	page_t    * page;
+    error_t     error;
+
+    // check vseg type
+    uint32_t type = vseg->type;
+    if( (type != VSEG_TYPE_KCODE) && (type != VSEG_TYPE_KDATA) && (type != VSEG_TYPE_KDEV) )
+    {
+        printk("\n[PANIC] in %s : not a kernel vseg\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get pointer on page table
+    gpt_t * gpt = &process_zero.vmm.gpt;
+
+    // define number of small pages per PTE 
+	if( attr & GPT_SMALL ) order = 0;   // 1 small page
+	else                   order = 9;   // 512 small pages
+
+    // loop on pages in vseg
+    vpn_min = vseg->vpn_base;
+    vpn_max = vpn_min + vseg->vpn_size;
+	for( vpn = vpn_min ; vpn < vpn_max ; vpn++ )
+	{
+	    kmem_req_t req;
+	    req.type  = KMEM_PAGE;
+	    req.size  = order;
+	    req.flags = AF_KERNEL | AF_ZERO;
+	    page      = (page_t *)kmem_alloc( &req );
+		if( page == NULL ) 
         {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] %s cannot create %s vseg for process %x in cluster %x\n",
-__FUNCTION__ , vseg_type_str( type ) , process->pid , local_cxy );
-#endif
-            return NULL;
+            printk("\n[ERROR] in %s : cannot allocate physical memory\n", __FUNCTION__ );
+            return ENOMEM;
         }
 
-        // initialize vseg
-        vseg->type = type;
-        vseg->vmm  = vmm;
-        vseg->min  = vseg->vpn_base << CONFIG_PPM_PAGE_ORDER;
-        vseg->max  = vseg->min + (vseg->vpn_size << CONFIG_PPM_PAGE_ORDER);
-        vseg->cxy  = cxy;
-
-        vseg_init_flags( vseg , type );
-    }
-    /////////////////////////////////////////////////////////////////
-    else    // VSEG_TYPE_DATA, VSEG_TYPE_CODE or KERNEL vseg
-    {
-        uint32_t vpn_min = base >> CONFIG_PPM_PAGE_ORDER;
-        uint32_t vpn_max = (base + size - 1) >> CONFIG_PPM_PAGE_ORDER;
-
-        // allocate vseg descriptor
-	    vseg = vseg_alloc();
-
-	    if( vseg == NULL )
-	    {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] %s cannot create %s vseg for process %x in cluster %x\n",
-__FUNCTION__ , vseg_type_str( type ) , process->pid , local_cxy );
-#endif
-            return NULL;
-	    }
-
-        // initialize vseg
-        vseg->type        = type;
-        vseg->vmm         = vmm;
-        vseg->min         = base;
-        vseg->max         = base + size;
-        vseg->vpn_base    = base >> CONFIG_PPM_PAGE_ORDER;
-        vseg->vpn_size    = vpn_max - vpn_min + 1;
-        vseg->file_offset = file_offset;
-        vseg->file_size   = file_size;
-        vseg->mapper_xp   = mapper_xp;
-        vseg->cxy         = cxy;
-
-        vseg_init_flags( vseg , type );
-    }
-
-    // check collisions
-    vseg_t * existing_vseg = vmm_check_conflict( process , vseg->vpn_base , vseg->vpn_size );
-
-    if( existing_vseg != NULL )
-    {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] in %s for process %x : new vseg %s [vpn_base %x / vpn_size %x]\n"
-       "        overlap existing vseg %s [vpn_base %x / vpn_size %x]\n",
-__FUNCTION__ , process->pid, vseg_type_str(vseg->type), vseg->vpn_base, vseg->vpn_size, 
-vseg_type_str(existing_vseg->type), existing_vseg->vpn_base, existing_vseg->vpn_size );
-#endif
-        vseg_free( vseg );
-        return NULL;
-    }
-
-    // build extended pointer on VSL lock
-    xptr_t lock_xp = XPTR( local_cxy , &vmm->vsl_lock );
+        // set page table entry
+        ppn = ppm_page2ppn( page );
+        error = hal_gpt_set_pte( gpt , vpn , ppn , attr );
+		if( error ) 
+        {
+            printk("\n[ERROR] in %s : cannot register PPE\n", __FUNCTION__ );
+            return ENOMEM;
+        }
+	}
  
-    // take the VSL lock in write mode
-    remote_queuelock_acquire( lock_xp );
-
-    // attach vseg to VSL
-	vmm_attach_vseg_to_vsl( vmm , vseg );
-
-    // release the VSL lock
-    remote_queuelock_release( lock_xp );
-
-#if DEBUG_VMM_CREATE_VSEG 
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_CREATE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] exit / %s / vpn_base %x / vpn_size %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-vseg_type_str(type), vseg->vpn_base, vseg->vpn_size, cycle );
-#endif
-
-	return vseg;
-
-}  // vmm_create_vseg()
-
-////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called by the vmm_remove_vseg() and vmm_resize_vseg() functions
-// to update the physical page descriptor identified by the <ppn> argument. 
-// It decrements the refcount, set the dirty bit when required, and releases the physical
-// page to kmem depending on the vseg type.
-// - KERNEL : refcount decremented / not released to kmem    / dirty bit not set
-// - FILE   : refcount decremented / not released to kmem    / dirty bit set when required.
-// - CODE   : refcount decremented / released to kmem        / dirty bit not set.
-// - STAK   : refcount decremented / released to kmem        / dirty bit not set.
-// - DATA   : refcount decremented / released to kmem if ref / dirty bit not set.
-// - MMAP   : refcount decremented / released to kmem if ref / dirty bit not set.
-////////////////////////////////////////////////////////////////////////////////////////////
-// @ process  : local pointer on process.
-// @ vseg     : local pointer on vseg.
-// @ ppn      : released pysical page index. 
-// @ dirty    : set the dirty bit in page descriptor when non zero.
-////////////////////////////////////////////////////////////////////////////////////////////
-static void vmm_ppn_release( process_t * process,
-                             vseg_t    * vseg,
-                             ppn_t       ppn,
-                             uint32_t    dirty )
-{
-    bool_t do_kmem_release;
-
-    // get vseg type
-    vseg_type_t type = vseg->type;
-
-    // compute is_ref <=> this vseg is the reference vseg
-    bool_t is_ref = (GET_CXY( process->ref_xp ) == local_cxy);
-
-    // get pointers on physical page descriptor
-    xptr_t   page_xp  = ppm_ppn2page( ppn );
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    // decrement page refcount
-    xptr_t count_xp = XPTR( page_cxy , &page_ptr->refcount );
-    hal_remote_atomic_add( count_xp , -1 );
-
-    // compute the do_kmem_release condition depending on vseg type
-    if( (type == VSEG_TYPE_KCODE) || 
-        (type == VSEG_TYPE_KDATA) || 
-        (type == VSEG_TYPE_KDEV) )            
-    {
-        // no physical page release for KERNEL 
-        do_kmem_release = false;
-    }
-    else if( type == VSEG_TYPE_FILE )
-    {
-        // no physical page release for KERNEL 
-        do_kmem_release = false;
-
-        // set dirty bit if required
-        if( dirty ) ppm_page_do_dirty( page_xp );
-    }   
-    else if( (type == VSEG_TYPE_CODE)  ||
-             (type == VSEG_TYPE_STACK) ) 
-    {
-        // always release physical page for private vsegs
-        do_kmem_release = true;
-    }
-    else if( (type == VSEG_TYPE_ANON)  ||
-             (type == VSEG_TYPE_REMOTE) )
-    {
-        // release physical page if reference cluster
-        do_kmem_release = is_ref;
-    }
-    else if( is_ref )  // vseg_type == DATA in reference cluster
-    {
-        // get extended pointers on forks and lock field in page descriptor
-        xptr_t forks_xp = XPTR( page_cxy , &page_ptr->forks );
-        xptr_t lock_xp  = XPTR( page_cxy , &page_ptr->lock );
-
-        // take lock protecting "forks" counter
-        remote_busylock_acquire( lock_xp );
-
-        // get number of pending forks from page descriptor
-        uint32_t forks = hal_remote_l32( forks_xp );
-
-        // decrement pending forks counter if required
-        if( forks )  hal_remote_atomic_add( forks_xp , -1 );
-
-        // release lock protecting "forks" counter
-        remote_busylock_release( lock_xp );
-
-        // release physical page if forks == 0
-        do_kmem_release = (forks == 0); 
-    }
-    else              // vseg_type == DATA not in reference cluster
-    {
-        // no physical page release if not in reference cluster 
-        do_kmem_release = false;
-    }
-
-    // release physical page to relevant kmem when required
-    if( do_kmem_release )
-    {
-        // get physical page order
-        uint32_t order = CONFIG_PPM_PAGE_ORDER +
-                         hal_remote_l32( XPTR( page_cxy , &page_ptr->order ));
-
-        // get physical page base 
-        void * base = GET_PTR( ppm_ppn2base( ppn ) );
-
-        // release physical page
-        kmem_remote_free( page_cxy , base , order );
-
-#if DEBUG_VMM_PPN_RELEASE
-thread_t * this = CURRENT_THREAD;
-if( DEBUG_VMM_PPN_RELEASE < cycle )
-printk("\n[%s] thread[%x,%x] released ppn %x to kmem\n",
-__FUNCTION__, this->process->pid, this->trdid, ppn );
-#endif
-
-    }
-} // end vmm_ppn_release()
-
-//////////////////////////////////////////
-void vmm_remove_vseg( process_t * process,
-                      vseg_t    * vseg )
-{
-    uint32_t    vseg_type;  // vseg type
-    vpn_t       vpn;        // VPN of current PTE
-    vpn_t       vpn_min;    // VPN of first PTE
+	return 0;
+} // end vmm_map_vseg()
+
+/////////////////////////////////////////
+void vmm_unmap_vseg( process_t * process,
+                     vseg_t    * vseg )
+{
+    vpn_t       vpn;        // VPN of current PTE 
+    vpn_t       vpn_min;    // VPN of first PTE 
     vpn_t       vpn_max;    // VPN of last PTE (excluded)
-    ppn_t       ppn;        // current PTE ppn value
-    uint32_t    attr;       // current PTE attributes
-
-// check arguments
-assert( __FUNCTION__, (process != NULL), "process argument is NULL" );
-assert( __FUNCTION__, (vseg    != NULL), "vseg argument is NULL" );
-
-    // get pointers on local process VMM 
+
+    // get pointer on process page table
+    gpt_t     * gpt = &process->vmm.gpt;
+
+    // loop on pages in vseg
+    vpn_min = vseg->vpn_base;
+    vpn_max = vpn_min + vseg->vpn_size;
+	for( vpn = vpn_min ; vpn < vpn_max ; vpn++ )
+    {
+        hal_gpt_reset_pte( gpt , vpn );
+    }
+} // end vmm_unmap_vseg()
+
+
+/////////////////////////////////////////////
+error_t vmm_resize_vseg( process_t * process,
+                         intptr_t    base,
+                         intptr_t    size )
+{
+	error_t error;
+
+    // get pointer on process VMM
     vmm_t * vmm = &process->vmm;
 
-    // build extended pointer on GPT
-    xptr_t gpt_xp = XPTR( local_cxy , &vmm->gpt );
-
-    // get relevant vseg infos
-    vseg_type = vseg->type;
-    vpn_min   = vseg->vpn_base;
-    vpn_max   = vpn_min + vseg->vpn_size;
-
-#if DEBUG_VMM_REMOVE_VSEG
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-#endif
-
-#if (DEBUG_VMM_REMOVE_VSEG & 1 )
-if( DEBUG_VMM_REMOVE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] enters / process %x / type %s / base %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-process->pid, vseg_type_str(vseg->type), vseg->min, cycle );
-#endif
-
-    // the loop on PTEs in GPT to unmap all mapped PTEs 
-    for( vpn = vpn_min ; vpn < vpn_max ; vpn++ )
-    {
-        // get ppn and attr
-        hal_gpt_get_pte( gpt_xp , vpn , &attr , &ppn );
-
-        if( attr & GPT_MAPPED )  // PTE is mapped
+    intptr_t addr_min = base;
+	intptr_t addr_max = base + size;
+    uint32_t shift    = CONFIG_PPM_PAGE_SHIFT;       
+
+    // get pointer on vseg
+	vseg_t * vseg = grdxt_lookup( &vmm->grdxt , (uint32_t)(base >> shift) );
+
+	if( vseg == NULL)  return EINVAL;
+  
+    // get VMM lock protecting vsegs list
+	rwlock_wr_lock( &vmm->vsegs_lock );
+  
+	if( (vseg->min > addr_min) || (vseg->max < addr_max) )   // region not included in vseg
+    {
+        error = EINVAL;
+    }
+	else if( (vseg->min == addr_min) && (vseg->max == addr_max) ) // vseg must be removed
+    {
+        vmm_remove_vseg( vseg );
+        error = 0;
+    }
+	else if( vseg->min == addr_min )                              // vseg must be resized
+    {
+        printk("\n[PANIC] in %s : resize not implemented yet\n", __FUNCTION__ );
+        hal_core_sleep();
+		error = 0;
+    }
+	else if( vseg->max == addr_max )                              // vseg must be resized
+    {
+        printk("\n[PANIC] in %s : resize not implemented yet\n", __FUNCTION__ );
+        hal_core_sleep();
+		error = 0;
+    }
+    else            // vseg cut in three regions => vseg must be resized & new vseg created
+    {
+        printk("\n[PANIC] in %s : resize not implemented yet\n", __FUNCTION__ );
+        hal_core_sleep();
+		error = 0;
+    }
+
+    // release VMM lock
+	rwlock_wr_unlock( &vmm->vsegs_lock );
+
+	return error;
+} // end vmm_resize_vseg()
+
+///////////////////////////////////////////
+vseg_t * vmm_get_vseg( process_t * process,
+                       intptr_t    vaddr )
+{
+
+    // get pointer on process VMM
+    vmm_t * vmm = &process->vmm;
+
+    // get lock protecting the vseg list
+    rwlock_rd_lock( &vmm->vsegs_lock );
+
+    // get pointer on vseg from radix tree
+	vseg_t * vseg = grdxt_lookup( &vmm->grdxt, (uint32_t)(vaddr >> CONFIG_PPM_PAGE_SHIFT) );
+
+    // release the lock
+    rwlock_rd_unlock( &vmm->vsegs_lock );
+
+    return vseg;
+
+} // end vmm_get_vseg()
+
+/////////////////////////////////////////
+error_t vmm_get_pte( process_t * process,
+                     vpn_t       vpn,
+                     uint32_t  * ret_attr,
+                     ppn_t     * ret_ppn )
+{
+    vseg_t  * vseg;   // pointer on vseg containing VPN
+    ppn_t     ppn;    // PPN from GPT entry
+    uint32_t  attr;   // attributes from GPT entry
+    error_t   error;
+
+    // this function must be called by in the reference cluster 
+    if( process->is_ref == false );
+    {
+        printk("\n[PANIC] in %s : not called in the reference cluster\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get VMM pointer
+    vmm_t * vmm = &process->vmm;
+
+    // access GPT to get PTE attributes and PPN
+    hal_gpt_get_pte( &vmm->gpt , vpn , &attr , &ppn );
+
+    // if PTE unmapped => allocate one small physical page to map it
+    if( (attr & GPT_MAPPED) == 0 )  
+    {
+        // get vseg pointer
+        vseg = vmm_get_vseg( process , vpn<<CONFIG_PPM_PAGE_SHIFT );
+
+        if( vseg == NULL );
+        {
+            printk("\n[ERROR] in %s : out of segment / process = %x / vpn = %x\n",
+                   __FUNCTION__ , process->pid , vpn );
+            return EINVAL;
+        }
+
+        // select the target cluster for physical mapping
+        uint32_t target_cxy;
+        if( vseg->flags & VSEG_DISTRIB ) // depends on VPN LSB
+        {
+            uint32_t x_width = LOCAL_CLUSTER->x_width;
+            uint32_t y_width = LOCAL_CLUSTER->y_width;
+            target_cxy = vpn & ((1<<(x_width + y_width)) - 1);
+        }
+        else                             // defined in vseg descriptor
+        {
+            target_cxy = vseg->cxy;
+        }
+
+        // allocate memory for page fault
+        kmem_req_t   req;
+        page_t     * page;
+        if( target_cxy == local_cxy )        // target cluster is the local cluster
         { 
-
-#if( DEBUG_VMM_REMOVE_VSEG & 1 )
-if( DEBUG_VMM_REMOVE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] unmap vpn %x / ppn %x / type %s\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn , ppn, vseg_type_str(vseg_type) );
-#endif
-            // unmap GPT entry in local GPT
-            hal_gpt_reset_pte( gpt_xp , vpn );
-
-            // release physical page depending on vseg type
-            vmm_ppn_release( process , vseg , ppn , attr & GPT_DIRTY );
+            req.type  = KMEM_PAGE;
+            req.size  = 0;
+            req.flags = AF_NONE;
+            page      = (page_t *)kmem_alloc( &req );
+
+            error = ( page == NULL ) ? 1 : 0;
+            ppn   = ppm_page2ppn( page );
         }
-    }
-
-    // remove vseg from VSL 
-    vmm_detach_vseg_from_vsl( vmm , vseg );
-
-    // release vseg descriptor depending on vseg type
-    if( vseg_type == VSEG_TYPE_STACK )
-    {
-        // release slot to local stack allocator
-        vmm_stack_free( vmm , vseg );
-    }
-    else if( (vseg_type == VSEG_TYPE_ANON) || 
-             (vseg_type == VSEG_TYPE_FILE) || 
-             (vseg_type == VSEG_TYPE_REMOTE) )  
-    {
-        // release vseg to local mmap allocator
-        vmm_mmap_free( vmm , vseg );
-    }
-    else
-    {
-        // release vseg descriptor to local kmem
-        vseg_free( vseg );
-    }
-
-#if DEBUG_VMM_REMOVE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_REMOVE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] exit / process %x / type %s / base %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-process->pid, vseg_type_str(vseg->type), vseg->min, cycle );
-#endif
-
-}  // end vmm_remove_vseg()
-
-/////////////////////////////////////////////
-void vmm_resize_vseg( process_t * process,
-                      vseg_t    * vseg,
-                      intptr_t    new_base,
-                      intptr_t    new_size )
-{
-    vpn_t     vpn;
-    ppn_t     ppn;
-    uint32_t  attr;
-
-// check arguments
-assert( __FUNCTION__, (process != NULL), "process argument is NULL" );
-assert( __FUNCTION__, (vseg    != NULL), "vseg argument is NULL" );
-
-#if DEBUG_VMM_RESIZE_VSEG
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-#endif
-
-#if (DEBUG_VMM_RESIZE_VSEG & 1)
-if( DEBUG_VMM_RESIZE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] enter / process %x / %s / base %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-process->pid, vseg_type_str(vseg->type), old_base, cycle );
-#endif
-
-    // get existing vseg vpn_min and vpn_max
-    vpn_t     old_vpn_min = vseg->vpn_base;
-    vpn_t     old_vpn_max = old_vpn_min + vseg->vpn_size - 1;
-
-    // compute new vseg vpn_min & vpn_max  
-    intptr_t min          = new_base;
-    intptr_t max          = new_base + new_size;
-    vpn_t    new_vpn_min  = min >> CONFIG_PPM_PAGE_ORDER;
-    vpn_t    new_vpn_max  = (max - 1) >> CONFIG_PPM_PAGE_ORDER;
-
-    // build extended pointer on GPT
-    xptr_t gpt_xp = XPTR( local_cxy , &process->vmm.gpt );
-
-    // loop on PTEs in GPT to unmap PTE if (old_vpn_min <= vpn < new_vpn_min)
-	for( vpn = old_vpn_min ; vpn < new_vpn_min ; vpn++ )
-    {
-        // get ppn and attr
-        hal_gpt_get_pte( gpt_xp , vpn , &attr , &ppn );
-
-        if( attr & GPT_MAPPED )  // PTE is mapped
-        { 
-
-#if( DEBUG_VMM_RESIZE_VSEG & 1 )
-if( DEBUG_VMM_RESIZE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] unmap vpn %x / ppn %x / %s",
-__FUNCTION__, this->process->pid, this->trdid, vpn , ppn, vseg_type_str(vseg_type) );
-#endif
-            // unmap GPT entry 
-            hal_gpt_reset_pte( gpt_xp , vpn );
-
-            // release physical page when required
-            vmm_ppn_release( process , vseg , ppn , attr & GPT_DIRTY );
+        else                                 // target cluster is not the local cluster
+        {
+            rpc_pmem_get_pages_client( target_cxy , 0 , &error , &ppn );
         }
-    }
-
-    // loop on PTEs in GPT to unmap PTE if (new vpn_max <= vpn < old_vpn_max)
-	for( vpn = new_vpn_max ; vpn < old_vpn_max ; vpn++ )
-    {
-        // get ppn and attr
-        hal_gpt_get_pte( gpt_xp , vpn , &attr , &ppn );
-
-        if( attr & GPT_MAPPED )  // PTE is mapped
-        { 
-
-#if( DEBUG_VMM_RESIZE_VSEG & 1 )
-if( DEBUG_VMM_RESIZE_VSEG < cycle )
-printk("\n[%s] thread[%x,%x] unmap vpn %x / ppn %x / %s",
-__FUNCTION__, this->process->pid, this->trdid, vpn , ppn, vseg_type_str(vseg_type) );
-#endif
-            // unmap GPT entry in local GPT
-            hal_gpt_reset_pte( gpt_xp , vpn );
-
-            // release physical page when required
-            vmm_ppn_release( process , vseg , ppn , attr & GPT_DIRTY );
+
+        if( error )
+        {
+            printk("\n[ERROR] in %s : cannot allocate memory / process = %x / vpn = %x\n",
+                   __FUNCTION__ , process->pid , vpn );
+            return ENOMEM;
         }
-    }
-
-    // resize vseg in VSL
-    vseg->min      = min;
-    vseg->max      = max;
-    vseg->vpn_base = new_vpn_min;
-    vseg->vpn_size = new_vpn_max - new_vpn_min + 1;
-
-#if DEBUG_VMM_RESIZE_VSEG
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_RESIZE_VSEG < cycle )
-printk("[%s] thread[%x,%x] exit / process %x / %s / base %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-process->pid, vseg_type_str(vseg->type), vseg->min, cycle );
-#endif
-
-}  // end vmm_resize_vseg
-
-/////////////////////////////////////////////////////////////////////////////////////////////
-// This static function is called twice by the vmm_get_vseg() function.
-// It scan the - possibly remote - VSL defined by the <vmm_xp> argument to find the vseg
-// containing a given virtual address <vaddr>. It uses remote accesses to access the remote
-// VSL if required. The VSL lock protecting the VSL must be taken by the caller.
-/////////////////////////////////////////////////////////////////////////////////////////////
-// @ vmm_xp  : extended pointer on the process VMM.
-// @ vaddr   : virtual address.
-// @ return local pointer on remote vseg if success / return NULL if not found.
-/////////////////////////////////////////////////////////////////////////////////////////////
-static vseg_t * vmm_vseg_from_vaddr( xptr_t     vmm_xp,
-                                     intptr_t   vaddr )
-{
-    xptr_t   iter_xp;
-    xptr_t   vseg_xp;
-    vseg_t * vseg;
-    intptr_t min;
-    intptr_t max;
-
-    // get cluster and local pointer on target VMM
-    vmm_t * vmm_ptr = GET_PTR( vmm_xp );
-    cxy_t   vmm_cxy = GET_CXY( vmm_xp );
-
-    // build extended pointer on VSL root
-    xptr_t root_xp = XPTR( vmm_cxy , &vmm_ptr->vsegs_root );
-
-    // scan the list of vsegs in VSL
-    XLIST_FOREACH( root_xp , iter_xp )
-    {
-        vseg_xp = XLIST_ELEMENT( iter_xp , vseg_t , xlist );
-        vseg    = GET_PTR( vseg_xp );
-
-        min = hal_remote_l32( XPTR( vmm_cxy , &vseg->min ) );
-        max = hal_remote_l32( XPTR( vmm_cxy , &vseg->max ) );
-
-        // return success when match
-        if( (vaddr >= min) && (vaddr < max) ) return vseg;
-    }
-
-    // return failure
-    return NULL;
-
-}  // end vmm_vseg_from_vaddr()
-
-///////////////////////////////////////////
-error_t  vmm_get_vseg( process_t * process,
-                       intptr_t    vaddr,
-                       vseg_t   ** found_vseg )
-{
-    xptr_t    loc_lock_xp;     // extended pointer on local VSL lock
-    xptr_t    ref_lock_xp;     // extended pointer on reference VSL lock
-    vseg_t  * loc_vseg;        // local pointer on local vseg
-    vseg_t  * ref_vseg;        // local pointer on reference vseg
-
-    // build extended pointer on local VSL lock
-    loc_lock_xp = XPTR( local_cxy , &process->vmm.vsl_lock );
-     
-    // get local VSL lock 
-    remote_queuelock_acquire( loc_lock_xp );
-
-    // try to get vseg from local VSL
-    loc_vseg = vmm_vseg_from_vaddr( XPTR( local_cxy, &process->vmm ) , vaddr );
-
-    if (loc_vseg == NULL)   // vseg not found => access reference VSL
-    {
-        // get extended pointer on reference process
-        xptr_t ref_xp = process->ref_xp;
-
-        // get cluster and local pointer on reference process
-        cxy_t       ref_cxy = GET_CXY( ref_xp );
-        process_t * ref_ptr = GET_PTR( ref_xp );
-
-        if( ref_cxy == local_cxy )    // local is ref => return error
+
+        // defineg GPT attributes from vseg flags
+        attr = GPT_MAPPED | GPT_SMALL;
+        if( vseg->flags & VSEG_USER  ) attr |= GPT_USER;
+        if( vseg->flags & VSEG_WRITE ) attr |= GPT_WRITABLE;
+        if( vseg->flags & VSEG_EXEC  ) attr |= GPT_EXECUTABLE;
+        if( vseg->flags & VSEG_CACHE ) attr |= GPT_CACHABLE;
+
+        // set the missing PTE in local VMM
+        error = hal_gpt_set_pte( &vmm->gpt , vpn , ppn , attr );
+        if( error )
         {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] in %s : vaddr %x in process %x out of segment\n",
-__FUNCTION__, vaddr, process->pid );
-#endif
-            remote_queuelock_release( loc_lock_xp );
-            return -1;
+            printk("\n[ERROR] in %s : cannot register PTE / process = %x / vpn = %x\n",
+                   __FUNCTION__ , process->pid , vpn );
+            return ENOMEM;
         }
-        else                          // ref != local => access ref VSL                     
-        {
-            // build extended pointer on reference VSL lock
-            ref_lock_xp = XPTR( ref_cxy , &ref_ptr->vmm.vsl_lock );
-     
-            // get reference VSL lock 
-            remote_queuelock_acquire( ref_lock_xp );
-
-            // try to get vseg from reference VSL
-            ref_vseg = vmm_vseg_from_vaddr( XPTR( ref_cxy , &ref_ptr->vmm ) , vaddr );
-
-            if( ref_vseg == NULL )  // vseg not found => return error
-            {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] in %s : vaddr %x in process %x out of segment\n",
-__FUNCTION__, vaddr, process->pid );
-#endif
-                remote_queuelock_release( loc_lock_xp );
-                remote_queuelock_release( ref_lock_xp );
-                return -1;
-            }
-            else                    // vseg found => try to update local VSL 
-            {
-                // allocate a local vseg descriptor
-                loc_vseg = vseg_alloc();
-
-                if( loc_vseg == NULL )   // no memory => return error
-                {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] in %s : vaddr %x in process %x / no memory\n",
-__FUNCTION__, vaddr, process->pid );
-#endif
-                    remote_queuelock_release( ref_lock_xp );
-                    remote_queuelock_release( loc_lock_xp );
-                    return -1;
-                }
-                else                     // update local VSL and return success
-                {
-                    // initialize local vseg
-                    vseg_init_from_ref( loc_vseg , XPTR( ref_cxy , ref_vseg ) );
-
-                    // register local vseg in local VSL
-                    vmm_attach_vseg_to_vsl( &process->vmm , loc_vseg );
-
-                    // release both VSL locks
-                    remote_queuelock_release( ref_lock_xp );
-                    remote_queuelock_release( loc_lock_xp );
-
-                    *found_vseg = loc_vseg;
-                    return 0;
-                }
-            }
-        }
-    }
-    else                        // vseg found in local VSL => return success
-    {
-        // release local VSL lock
-        remote_queuelock_release( loc_lock_xp );
-
-        *found_vseg = loc_vseg;
-        return 0;
-    }
-}  // end vmm_get_vseg()
-
-//////////////////////////////////////////////////////////////////////////////////////
-// This static function compute the target cluster to allocate a physical page
-// for a given <vpn> in a given <vseg>, allocates the physical page from a local
-// or remote cluster (depending on the vseg type), and returns an extended pointer
-// on the allocated page descriptor.
-// The vseg cannot have the FILE type.
-//////////////////////////////////////////////////////////////////////////////////////
-// @ vseg   : local pointer on vseg.
-// @ vpn    : unmapped vpn.
-// @ return xptr on page descriptor if success / return XPTR_NULL if failure
-//////////////////////////////////////////////////////////////////////////////////////
-static xptr_t vmm_page_allocate( vseg_t * vseg,
-                                 vpn_t    vpn )
-{
-
-#if DEBUG_VMM_PAGE_ALLOCATE
-uint32_t   cycle   = (uint32_t)hal_get_cycles();
-thread_t * this    = CURRENT_THREAD;
-if( DEBUG_VMM_PAGE_ALLOCATE < cycle )
-printk("\n[%s] thread[%x,%x] enter for vpn %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, vpn, cycle );
-#endif
-
-    xptr_t       page_xp;
-    cxy_t        page_cxy;
-    uint32_t     index;
-
-    uint32_t     type   = vseg->type;
-    uint32_t     flags  = vseg->flags;
-    uint32_t     x_size = LOCAL_CLUSTER->x_size;
-    uint32_t     y_size = LOCAL_CLUSTER->y_size;
-
-// check vseg type
-assert( __FUNCTION__, ( type != VSEG_TYPE_FILE ) , "illegal vseg type\n" );
-
-    // compute target cluster identifier
-    if( flags & VSEG_DISTRIB )    // distributed => cxy depends on vpn LSB
-    {
-        index    = vpn & ((x_size * y_size) - 1);
-        page_cxy = HAL_CXY_FROM_XY( (index / y_size) , (index % y_size) );
-
-        // If the cluster selected from VPN's LSBs is empty, we select one randomly
-        if ( cluster_is_active( page_cxy ) == false )
-        {
-            page_cxy = cluster_random_select();
-        }
-    }
-    else                          // other cases => cxy specified in vseg
-    {
-        page_cxy = vseg->cxy;
-    }
-
-    // get local pointer on page base
-    void * ptr = kmem_remote_alloc( page_cxy , CONFIG_PPM_PAGE_ORDER , AF_ZERO );
-
-    if( ptr == NULL )
-    {
-
-#if DEBUG_VMM_ERROR
-printk("\n[ERROR] in %s : cannot allocate memory from cluster %x\n",
-__FUNCTION__, page_cxy );
-#endif
-        return XPTR_NULL;
-    }     
-    // get extended pointer on page descriptor
-    page_xp = ppm_base2page( XPTR( page_cxy , ptr ) );
-
-#if DEBUG_VMM_PAGE_ALLOCATE
-cycle = (uint32_t)hal_get_cycles();
-if( DEBUG_VMM_PAGE_ALLOCATE < cycle )
-printk("\n[%s] thread[%x,%x] exit for vpn %x / ppn %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, vpn, ppm_page2ppn(page_xp), cycle );
-#endif
-
-    return page_xp;
-
-}  // end vmm_page_allocate()  
-
-////////////////////////////////////////
-error_t vmm_get_one_ppn( vseg_t * vseg,
-                         vpn_t    vpn,
-                         ppn_t  * ppn )
-{
-    error_t    error;
-    xptr_t     page_xp;           // extended pointer on physical page descriptor
-    uint32_t   page_id;           // missing page index in vseg mapper
-    uint32_t   type;              // vseg type;
-
-    type      = vseg->type;
-    page_id   = vpn - vseg->vpn_base;
-
-#if DEBUG_VMM_GET_ONE_PPN 
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-thread_t * this  = CURRENT_THREAD;
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-printk("\n[%s] thread[%x,%x] enter for vpn %x / vseg %s / page_id  %d / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, vseg_type_str(type), page_id, cycle );
-#endif
-
-#if (DEBUG_VMM_GET_ONE_PPN & 2)
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-hal_vmm_display( XPTR( local_cxy , this->process ) , true );
-#endif
-
-    // FILE type : get the physical page from the file mapper
-    if( type == VSEG_TYPE_FILE )
-    {
-        // get extended pointer on mapper
-        xptr_t mapper_xp = vseg->mapper_xp;
-
-assert( __FUNCTION__, (mapper_xp != XPTR_NULL),
-"mapper not defined for a FILE vseg\n" );
-        
-        // get extended pointer on page descriptor
-        page_xp = mapper_get_page( mapper_xp , page_id );
-
-        if ( page_xp == XPTR_NULL ) return EINVAL;
-    }
-
-    // Other types : allocate a physical page from target cluster,
-    // as defined by vseg type and vpn value
-    else
-    {
-        // allocate one physical page 
-        page_xp = vmm_page_allocate( vseg , vpn );
-
-        if( page_xp == XPTR_NULL ) return -1;
-
-        // initialise missing page from .elf file mapper for DATA and CODE types
-        // the vseg->mapper_xp field is an extended pointer on the .elf file mapper
-        if( (type == VSEG_TYPE_CODE) || (type == VSEG_TYPE_DATA) )
-        {
-            // get extended pointer on mapper
-            xptr_t     mapper_xp = vseg->mapper_xp;
-
-assert( __FUNCTION__, (mapper_xp != XPTR_NULL),
-"mapper not defined for a CODE or DATA vseg\n" );
-        
-            // compute missing page offset in vseg
-            uint32_t offset = page_id << CONFIG_PPM_PAGE_ORDER;
-
-            // compute missing page offset in .elf file
-            uint32_t elf_offset = vseg->file_offset + offset;
-
-#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-printk("\n[%s] thread[%x,%x] for vpn = %x / elf_offset = %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, elf_offset );
-#endif
-            // compute extended pointer on page base 
-            xptr_t base_xp  = ppm_page2base( page_xp );
-
-            // file_size (in .elf mapper) can be smaller than vseg_size (BSS)
-            uint32_t file_size = vseg->file_size;
-
-            if( file_size < offset )                 // missing page fully in  BSS 
-            {
-
-#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-printk("\n[%s] thread[%x,%x] for vpn  %x / fully in BSS\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn );
-#endif
-                if( GET_CXY( page_xp ) == local_cxy )
-                {
-                    memset( GET_PTR( base_xp ) , 0 , CONFIG_PPM_PAGE_SIZE );
-                }
-                else
-                {
-                   hal_remote_memset( base_xp , 0 , CONFIG_PPM_PAGE_SIZE );       
-                }
-            }
-            else if( file_size >= (offset + CONFIG_PPM_PAGE_SIZE) )  // fully in  mapper
-            {
-
-#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-printk("\n[%s] thread[%x,%x] for vpn  %x / fully in mapper\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn );
-#endif
-                error = mapper_move_kernel( mapper_xp,
-                                            true,             // to_buffer
-                                            elf_offset,
-                                            base_xp,
-                                            CONFIG_PPM_PAGE_SIZE ); 
-                if( error ) return EINVAL;
-            }
-            else  // both in mapper and in BSS :
-                  // - (file_size - offset)             bytes from mapper
-                  // - (page_size + offset - file_size) bytes from BSS
-            {
-
-#if (DEBUG_VMM_GET_ONE_PPN & 0x1)
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-printk("\n[%s] thread[%x,%x] for vpn  %x / both mapper & BSS\n"
-"      %d bytes from mapper / %d bytes from BSS\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn,
-file_size - offset , offset + CONFIG_PPM_PAGE_SIZE - file_size  );
-#endif
-                // initialize mapper part
-                error = mapper_move_kernel( mapper_xp,
-                                            true,         // to buffer
-                                            elf_offset,
-                                            base_xp,
-                                            file_size - offset ); 
-                if( error ) return EINVAL;
-
-                // initialize BSS part
-                if( GET_CXY( page_xp ) == local_cxy )
-                {
-                    memset( GET_PTR( base_xp ) + file_size - offset , 0 , 
-                            offset + CONFIG_PPM_PAGE_SIZE - file_size );
-                }
-                else
-                {
-                   hal_remote_memset( base_xp + file_size - offset , 0 , 
-                                      offset + CONFIG_PPM_PAGE_SIZE - file_size );
-                }
-            }    
-
-        }  // end if CODE or DATA types   
-    } 
-
-    // return ppn
-    *ppn = ppm_page2ppn( page_xp );
-
-#if DEBUG_VMM_GET_ONE_PPN
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-printk("\n[%s] thread[%x,%x] exit for vpn %x / ppn %x / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid , vpn , *ppn, cycle );
-#endif
-
-#if (DEBUG_VMM_GET_ONE_PPN & 2)
-if( DEBUG_VMM_GET_ONE_PPN < cycle )
-hal_vmm_display( XPTR( local_cxy , this->process ) , true );
-#endif
-
+    }
+
+    *ret_ppn  = ppn;
+    *ret_attr = attr;  
     return 0;
-
-}  // end vmm_get_one_ppn()
+}  // end vmm_get_pte()
 
 ///////////////////////////////////////////////////
 error_t vmm_handle_page_fault( process_t * process,
+                               vseg_t    * vseg,
                                vpn_t       vpn )
 {
-    vseg_t         * vseg;            // vseg containing vpn
-    uint32_t         attr;            // PTE_ATTR value
-    ppn_t            ppn;             // PTE_PPN value
-    uint32_t         ref_attr;        // PTE_ATTR value in reference GPT
-    ppn_t            ref_ppn;         // PTE_PPN value in reference GPT
-    cxy_t            ref_cxy;         // reference cluster for missing vpn
-    process_t      * ref_ptr;         // reference process for missing vpn
-    xptr_t           local_gpt_xp;    // extended pointer on local GPT
-    xptr_t           ref_gpt_xp;      // extended pointer on reference GPT
-    error_t          error;           // value returned by called functions
-
-    thread_t * this  = CURRENT_THREAD;
-
-#if (CONFIG_INSTRUMENTATION_PGFAULTS || DEBUG_VMM_HANDLE_PAGE_FAULT)
-uint32_t start_cycle = (uint32_t)hal_get_cycles();
+    uint32_t         attr;          // missing page attributes
+    ppn_t            ppn;           // missing page PPN 
+    error_t          error;         // return value
+
+    // get local VMM pointer
+	vmm_t * vmm = &process->vmm;
+
+    // get reference process cluster and local pointer
+    cxy_t       ref_cxy = GET_CXY( process->ref_xp );
+    process_t * ref_ptr = (process_t *)GET_PTR( process->ref_xp );
+
+    // get missing PTE attributes and PPN
+    if( local_cxy != ref_cxy )   // local cluster is not the reference cluster
+    {
+        rpc_vmm_get_pte_client( ref_cxy , ref_ptr , vpn , &attr , &ppn , &error );
+    }
+    else                              // local cluster is the reference cluster       
+    {
+        error = vmm_get_pte( process , vpn , &attr , &ppn );
+    }
+
+    // check page allocation error
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot allocate memory / process = %x / vpn = %x\n",
+               __FUNCTION__ , process->pid , vpn ); 
+	    return ENOMEM;
+    }
+
+    // set the missing PTE in local VMM
+    error = hal_gpt_set_pte( &vmm->gpt , vpn , attr , ppn );
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot register PTE / process = %x / vpn = %x\n",
+               __FUNCTION__ , process->pid , vpn ); 
+        return ENOMEM;
+    }
+ 
+    return 0;
+}  // end vmm_handle_page_fault()
+
+///////////////////////////////////////////
+error_t vmm_v2p_translate( bool_t    ident,
+                           void    * ptr,
+                           paddr_t * paddr )
+{
+    uint32_t vaddr = (uint32_t)ptr;
+
+    thread_t  * this    = CURRENT_THREAD;
+    process_t * process = this->process;
+
+    if( ident )  // identity mapping
+    {
+        *paddr = (paddr_t)PADDR( local_cxy , vaddr );
+        return 0;
+    }
+
+    // access page table 
+    error_t  error;
+    vpn_t    vpn;
+    uint32_t attr;
+    ppn_t    ppn;
+    uint32_t offset;
+
+    vpn    = (vpn_t)( vaddr >> CONFIG_PPM_PAGE_SHIFT );
+    offset = (uint32_t)( vaddr & CONFIG_PPM_PAGE_MASK );
+
+    if( process->is_ref )   // calling process is reference process
+    {
+        error = vmm_get_pte( process, vpn , &attr , &ppn );
+    }
+    else                    // use a RPC
+    {
+        cxy_t       ref_cxy = GET_CXY( process->ref_xp );
+        process_t * ref_ptr = (process_t *)GET_PTR( process->ref_xp );
+        rpc_vmm_get_pte_client( ref_cxy , ref_ptr , vpn , &attr , &ppn , &error );
+    }
+
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot get physical address for vaddr = %x\n",
+               __FUNCTION__ , vaddr );
+        return error;
+    }
+  
+    // return paddr
+    *paddr = (((paddr_t)ppn) << CONFIG_PPM_PAGE_SHIFT) | offset;
+    return 0;
+ 
+}  // end vmm_v2p_translate()
+
+
+
+
+/*
+
+///////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+error_t vmm_inval_shared_page( vseg_t *vseg, vma_t vaddr, ppn_t ppn)
+{
+	pmm_page_info_t current;
+	error_t err;
+
+	error= pmm_get_page(&vseg->vmm->pmm, vaddr, &current);
+
+	if((err) || (current.ppn != ppn))
+		goto ended;
+
+	current.ppn     = 0;
+	current.attr    = 0;
+	current.cluster = NULL;	
+
+	error= pmm_set_page(&vseg->vmm->pmm, vaddr, &current);
+
+ended:
+	return err;
+}
+
+error_t vmm_update_shared_page( vseg_t *vseg, vma_t vaddr, ppn_t ppn)
+{
+	pmm_page_info_t current;
+	error_t err;
+
+	error= pmm_get_page(&vseg->vmm->pmm, vaddr, &current);
+
+	if((err) || (current.attr != 0))
+		goto ended;
+
+	current.ppn     = ppn;
+	current.attr    = vseg->vm_pgprot;
+	current.cluster = NULL;	// this function is called after invalidate one 
+
+	error= pmm_set_page(&vseg->vmm->pmm, vaddr , &current);
+
+ended:
+	return err;
+}
+
+// Hypothesis: the vseg is shared-anon, mapper list is rdlocked, page is locked 
+error_t vmm_migrate_shared_page_seq( vseg_t *vseg, struct page_s *page, struct page_s **new)
+{
+	register  vseg_t *reg;
+	register struct process_s *process;
+	register struct process_s *this_process;
+	struct page_s *new_pg;
+	struct list_entry *iter;
+	kmem_req_t req;
+	vma_t vaddr;
+	ppn_t ppn;
+	error_t err;
+
+	vaddr     = (page->index << PMM_PAGE_SHIFT) + vseg->vm_start + vseg->vm_offset;
+	ppn       = ppm_page2ppn(page);
+	this_process = (new == NULL) ? NULL : current_process;
+	iter      = &vseg->vm_shared_list;
+	error      = ECANCELED;
+
+	// Invalidate All 
+	do
+	{
+		reg  = list_element(iter,  vseg_t, vm_shared_list);
+
+		process = vmm_get_process(reg->vmm);
+
+		if(process != this_process)
+		{
+			error= vmm_inval_shared_page(reg, vaddr, ppn);
+
+			if(err) goto fail_inval;
+		}
+
+		assert(vseg->vm_mapper.m_home_cid == current_cid);
+		iter = list_next(&vseg->vm_mapper.m_reg_root, iter);
+
+	}while(iter != NULL);
+
+	req.type  = KMEM_PAGE;
+	req.size  = 0;
+	req.excep_code = AF_USER;
+
+	new_pg    = kmem_alloc(&req);
+	*new      = new_pg;
+
+	if(new_pg == NULL)
+	{
+		error= ENOMEM;
+		goto fail_alloc;
+	}
+
+	page_copy(new_pg, page);
+
+	page_lock(new_pg);
+
+	new_pg->mapper = page->mapper;
+	new_pg->index  = page->index;
+
+	// TODO: do the complet job regading dirty page 
+	if(PAGE_IS(page, PG_DIRTY))
+		PAGE_SET(new_pg, PG_DIRTY);
+
+	ppn  = ppm_page2ppn(new_pg);
+	iter = &vseg->vm_shared_list;
+
+	// Update All
+	do
+	{
+		reg  = list_element(iter,  vseg_t, vm_shared_list);
+
+		process = vmm_get_process(reg->vmm);
+
+		if(process != this_process)
+			(void) vmm_update_shared_page(reg, vaddr, ppn);
+
+		assert(vseg->vm_mapper.m_home_cid == current_cid);
+		iter = list_next(&vseg->vm_mapper.m_reg_root, iter);
+
+
+	}while(iter != NULL);
+
+	page_unlock(new_pg);
+
+fail_alloc:
+fail_inval:
+	return err;
+}
+
+//TODO: revisit all manipulation of the page->refcount
+///////////////////////////////////////////////////////////////
+static inline error_t vmm_do_migrate( vseg_t     * vseg, 
+                                      pmm_page_info_t * pinfo,
+                                      uint32_t          vaddr )
+{
+	kmem_req_t        req;
+	pmm_page_info_t   current;
+	page_t          * newpage;
+	cluster_t       * cluster;
+	thread_t        * this;
+	error_t           err;
+	ppn_t             ppn;
+ 
+	assert( pinfo->ppn != 0 );
+
+	ppn = pinfo->ppn;
+	this = current_thread;
+	newpage = NULL;
+	cluster = current_cluster;
+  
+	current.attr = 0;
+	current.ppn  = 0;
+
+	error= pmm_lock_page(&vseg->vmm->pmm, vaddr, &current);
+
+	if(error|| (current.isAtomic == false) || 
+              (current.ppn != ppn) || !(current.attr & PMM_MIGRATE))
+	{
+#if CONFIG_SHOW_SPURIOUS_PGFAULT
+		printk(INFO, "%s: pid %d, tid %d, cpu %d, nothing to do for vaddr %x\n", 
+		       __FUNCTION__, 
+		       this->process->pid, 
+		       this->info.order, 
+		       cpu_get_id(),
+		       vaddr);
 #endif
-
-#if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) & (vpn > 0) )
-printk("\n[%s] thread[%x,%x] enter for vpn %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, start_cycle );
+		this->info.spurious_pgfault_cntr ++;
+		pmm_unlock_page(&vseg->vmm->pmm, vaddr, &current);
+		pmm_tlb_flush_vaddr(vaddr, PMM_DATA);
+		return 0;
+	}
+  
+	if(!ppn_is_local(ppn))
+	{
+		req.type  = KMEM_PAGE;
+		req.size  = 0;
+		req.excep_code = AF_PGFAULT;
+
+		newpage = kmem_alloc(&req);
+
+		if(newpage)
+		{
+			newpage->mapper = NULL;//?
+			ppn_copy(ppm_page2ppn(newpage), ppn);
+
+			if(current.attr & PMM_COW)
+			{
+				current.attr |= PMM_WRITE;
+				current.attr &= ~(PMM_COW);
+			}
+
+			current.ppn = ppm_page2ppn(newpage);
+		}
+	}
+
+	current.attr   |= PMM_PRESENT;
+	current.attr   &= ~(PMM_MIGRATE);
+	current.attr   &= ~(PMM_LOCKED);
+	current.cluster = NULL;
+
+	//also unlock the table entry
+	error= pmm_set_page(&vseg->vmm->pmm, vaddr, &current);
+	
+	if(err)
+	{
+		// TODO: we should differ the kmem_free call 
+		//page_unlock(page);
+		(void)pmm_unlock_page(&vseg->vmm->pmm, vaddr, &current);
+		req.ptr = newpage;
+		kmem_free(&req);
+		return err;
+	} 
+
+
+	if(newpage)
+	{
+		ppn_refcount_down(ppn);
+		current_thread->info.remote_pages_cntr ++;
+#if CONFIG_SHOW_REMOTE_PGALLOC  
+		printk(INFO, "%s: pid %d, tid %x, cpu %d, cid %d: got new remote page from cluster %d (vaddr %x)\n",
+		       __FUNCTION__,
+		       current_process->pid,
+		       current_thread,
+		       cpu_get_id(),
+		       cluster->id,
+		       newpage->cid,
+		       vaddr);
 #endif
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 2)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-hal_vmm_display( XPTR( local_cxy , this->process ) , true );
+	}
+
+#if CONFIG_SHOW_VMMMGRT_MSG
+	printk(INFO, "%s: pid %d, tid %d, cpu %d: Asked to migrate page (vaddr %x) from cluster %d to cluster %d, error%d\n",
+	       __FUNCTION__,
+	       current_process->pid,
+	       current_thread->info.order,
+	       cpu_get_id(),
+	       vaddr,
+	       ppn_ppn2cid(ppn),
+	       cluster->id,
+	       err);
 #endif
 
-    // get local vseg (access to reference VSL can be required)
-    error = vmm_get_vseg( process, 
-                          (intptr_t)vpn<<CONFIG_PPM_PAGE_ORDER,
-                          &vseg );
-    if( error )
-    {
-        printk("\n[ERROR] in %s : vpn %x in thread[%x,%x] not in registered vseg\n",
-        __FUNCTION__ , vpn , process->pid, this->trdid );
-        
-        return EXCP_USER_ERROR;
-    }
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] found vseg %s\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg_type_str(vseg->type) );
+	return err;
+}
+
+error_t vmm_do_cow( vseg_t *vseg, pmm_page_info_t *pinfo, uint32_t vaddr)
+{
+	register struct page_s *newpage;
+	register struct page_s *page;
+	register struct thread_s *this;
+	register error_t err;
+	register uint32_t count;
+	register bool_t isCountDown;
+	pmm_page_info_t old;
+	pmm_page_info_t new;
+	kmem_req_t req;
+
+	this       = current_thread;
+	old.attr  = 0;
+	newpage    = NULL;
+	isCountDown = true;
+
+	vmm_dmsg(2,"%s: pid %d, tid %d, cpu %d, vaddr %x\n",
+		 __FUNCTION__,
+		 this->process->pid,
+		 this->info.order,
+		 cpu_get_id(),
+		 vaddr);
+
+  
+	error= pmm_lock_page(&vseg->vmm->pmm, vaddr, &old);
+
+	//TODO: check this condition
+	if(error|| (old.isAtomic == false) || !(old.attr & PMM_COW))
+	{
+#if CONFIG_SHOW_SPURIOUS_PGFAULT
+		printk(INFO, "%s: pid %d, tid %d, cpu %d, nothing to do for vaddr %x\n", 
+		       __FUNCTION__, 
+		       this->process->pid, 
+		       this->info.order, 
+		       cpu_get_id(),
+		       vaddr);
 #endif
-
-    // build extended pointer on local GPT
-    local_gpt_xp  = XPTR( local_cxy , &process->vmm.gpt );
-
-    // lock PTE in local GPT and get current PPN and attributes
-    error = hal_gpt_lock_pte( local_gpt_xp,
-                              vpn,
-                              &attr,
-                              &ppn );
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot lock PTE in local GPT / vpn %x / process %x\n",
-        __FUNCTION__ , vpn , process->pid );
-        
-        return EXCP_KERNEL_PANIC;
-    }
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] locked vpn %x in cluster %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, local_cxy );
+		this->info.spurious_pgfault_cntr ++;
+		pmm_tlb_flush_vaddr(vaddr, PMM_DATA);
+		pmm_unlock_page(&vseg->vmm->pmm, vaddr, &old);
+		return err;
+		//goto VMM_COW_END;
+	}
+
+	//if the ppn is local and the others (processus with wich we share the page) 
+	//has done cow, then use the old.ppn directly
+	if(ppn_is_local(old.ppn))
+	{
+		page = ppm_ppn2page(&current_cluster->ppm, old.ppn);
+
+		if(page->mapper == NULL)
+		{
+			count = page_refcount_get(page);
+			if(count == 1)
+			{
+				newpage = page;//don't copy the page. use it directly.
+				isCountDown = false;
+				vmm_dmsg(2, "%s: pid %d, tid %d, cpu %d, reuse same page for vaddr %x, pg_addr %x\n", 
+					 __FUNCTION__, 
+					 this->process->pid, 
+					 this->info.order, 
+					 cpu_get_id(), 
+					 vaddr, 
+					 ppm_page2addr(page));
+			}
+		}
+		//else: we need to do the cow even if it's local!
+
+	}
+
+	//else: alocate newpage and copy the data from the remote node
+	//also defcount down the ppn
+	if(newpage == NULL)
+	{    
+		req.type  = KMEM_PAGE;
+		req.size  = 0;
+		req.excep_code = AF_PGFAULT;
+
+		if((newpage = kmem_alloc(&req)) == NULL)
+		{
+			(void)pmm_unlock_page(&vseg->vmm->pmm, vaddr, &old);
+			return ENOMEM;
+		}	
+
+		newpage->mapper = NULL;
+
+		ppn_copy(ppm_page2ppn(newpage), old.ppn);
+		assert(isCountDown);
+		
+		vmm_dmsg(2, 
+			 "%s: pid %d, tid %d, cpu %d, newpage for vaddr %x, pg_addr %x\n", 
+			 __FUNCTION__, 
+			 this->process->pid, 
+			 this->info.order, 
+			 cpu_get_id(), 
+			 vaddr, 
+			 ppm_page2addr(newpage));
+
+		if(newpage->cid != current_cid)
+			this->info.remote_pages_cntr ++;
+	}
+
+	new.attr    = vseg->vm_pgprot | PMM_WRITE;
+	new.attr   &= ~(PMM_COW | PMM_MIGRATE);
+	new.ppn     = ppm_page2ppn(newpage);
+	new.cluster = NULL;
+
+	//this also unlock the table entry (if no error)
+	error= pmm_set_page(&vseg->vmm->pmm, vaddr, &new);
+
+	if(err)
+	{
+		(void)pmm_unlock_page(&vseg->vmm->pmm, vaddr, &old);
+		req.ptr = newpage;
+		kmem_free(&req);
+		vmm_dmsg(3, "%s: ended [ error%d ]\n", __FUNCTION__, err);
+		return err;
+	}
+	
+	if(isCountDown) ppn_refcount_down(old.ppn);
+	
+	vmm_dmsg(2, "%s, pid %d, tid %d, cpu %d, COW ended [vaddr %x]\n", 
+		 __FUNCTION__, 
+		 this->process->pid,
+		 this->info.order,
+		 cpu_get_id(),
+		 vaddr);
+  
+	return 0;
+}
+
+
+//refcount is taken on the file at mmap
+static inline error_t vmm_do_mapped( vseg_t *vseg, uint32_t vaddr, uint32_t excep_code)
+{
+	ppn_t ppn;
+	error_t err;
+	uint32_t index;
+	bool_t isDone;
+	pmm_page_info_t info;
+	pmm_page_info_t current;
+	struct thread_s *this;
+
+	this = current_thread;
+
+	current.attr = 1;
+	current.ppn  = 1;
+	isDone       = false;
+
+	error= pmm_lock_page(&vseg->vmm->pmm, vaddr, &current);
+	
+	if(err) return err;
+
+	if((current.isAtomic == false) || (current.attr != 0))
+	{
+#if CONFIG_SHOW_SPURIOUS_PGFAULT
+		printk(INFO, "%s: pid %d, tid %d, cpu %d, nothing to do for vaddr %x\n", 
+		       __FUNCTION__, 
+		       this->process->pid, 
+		       this->info.order, 
+		       cpu_get_id(),
+		       vaddr);
 #endif
-
-    // handle page fault only if local PTE still unmapped after lock
-    if( (attr & GPT_MAPPED) == 0 )
-    {
-        // get reference process cluster and local pointer
-        ref_cxy = GET_CXY( process->ref_xp );
-        ref_ptr = GET_PTR( process->ref_xp );
-
-        /////////////// private vseg or (local == reference)
-        /////////////// => access only the local GPT 
-        if( (vseg->type == VSEG_TYPE_STACK) ||
-            (vseg->type == VSEG_TYPE_CODE)  ||
-            (ref_cxy    == local_cxy ) )
-        {
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] access local gpt : cxy %x / ref_cxy %x / type %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-local_cxy, ref_cxy, vseg_type_str(vseg->type), (uint32_t)hal_get_cycles() );
+		this->info.spurious_pgfault_cntr ++;
+		pmm_tlb_flush_vaddr(vaddr, PMM_DATA);
+		return 0;
+	}
+
+	index = ((vaddr - vseg->vm_start) + vseg->vm_offset) >> PMM_PAGE_SHIFT;
+
+	//also hold a refcount!
+	ppn = mapper_get_ppn(&vseg->vm_mapper, 
+			       index, 
+			       MAPPER_SYNC_OP);
+
+	if(!ppn)
+	{
+		error= pmm_unlock_page(&vseg->vmm->pmm, vaddr, &current);
+		assert(!err); //FIXME: liberate the ppn ...
+		return (VFS_FILE_IS_NULL(vseg->vm_file)) ? EIO : ENOMEM;
+	}
+
+	info.attr    = vseg->vm_pgprot;
+	info.ppn     = ppn;
+	info.cluster = NULL;
+
+	//also unlock the page
+	error= pmm_set_page(&vseg->vmm->pmm, vaddr, &info);
+
+	assert(!err);//FIXME: liberate the ppn and unlock the table entry ...
+	//error= pmm_unlock_page(&vseg->vmm->pmm, vaddr, &current);
+
+	return err;
+}
+
+/////////////////////////////////////////////////////
+static inline error_t vmm_do_aod( vseg_t *vseg, uint32_t vaddr)
+{
+	register error_t err;
+	register struct page_s *page;
+	register struct cluster_s *cluster;
+	struct thread_s *this;
+	pmm_page_info_t old;
+	pmm_page_info_t new;
+	kmem_req_t req;
+
+	page      = NULL;
+	old.attr  = 0;
+	this      = current_thread;
+  
+	error= pmm_lock_page(&vseg->vmm->pmm, vaddr, &old);
+
+	if(err) return err;
+
+	if(old.isAtomic == false)
+	{
+		this->info.spurious_pgfault_cntr ++;
+		pmm_tlb_flush_vaddr(vaddr, PMM_DATA);
+		return 0;
+	}
+
+	req.type  = KMEM_PAGE;
+	req.size  = 0;
+	req.excep_code = AF_PGFAULT | AF_ZERO;
+
+	if((page = kmem_alloc(&req)) == NULL)
+	{
+		(void)pmm_unlock_page(&vseg->vmm->pmm, vaddr, &old);
+		return ENOMEM;
+	}
+
+	page->mapper = NULL;
+
+	new.attr    = vseg->vm_pgprot;
+	new.ppn     = ppm_page2ppn(page);
+	new.cluster = NULL;
+
+	error= pmm_set_page(&vseg->vmm->pmm, vaddr, &new);
+	
+	if(err) goto fail_set_pg;
+
+	cluster = current_cluster;
+
+	if(page->cid != cluster->id)
+		this->info.remote_pages_cntr ++;
+
+	return 0;
+
+fail_set_pg:
+	(void)pmm_unlock_page(&vseg->vmm->pmm, vaddr, &old);
+	req.ptr = page;
+	kmem_free(&req);
+
+	vmm_dmsg(3, "%s: ended [ error%d ]\n", __FUNCTION__, err);
+	return err;
+}
+
+VSEGION_PAGE_FAULT(vmm_default_pagefault)
+{
+	register struct thread_s *this;
+	register error_t err;
+	pmm_page_info_t info;
+
+	if((error= pmm_get_page(&vseg->vmm->pmm, vaddr, &info)))
+		return err;
+
+	if((info.attr != 0) && (info.ppn != 0))
+	{
+		if((info.attr & PMM_COW) && pmm_except_isWrite(excep_code))
+		{
+			error= vmm_do_cow(vseg, &info, vaddr);
+			return err;
+		}
+
+		if(info.attr & PMM_MIGRATE)
+			return vmm_do_migrate(vseg, &info, vaddr);
+
+		if(info.attr & PMM_PRESENT)
+		{
+			this = current_thread;
+
+#if CONFIG_SHOW_SPURIOUS_PGFAULT
+			printk(WARNING, "WARNING: %s: pid %d, tid %d, cpu %d, excep_code %x but vaddr is valid %x, attr %x, ppn %x\n",
+			       __FUNCTION__,
+			       this->process->pid,
+			       this->info.order,
+			       cpu_get_id(),
+			       excep_code,
+			       vaddr,
+			       info.attr,
+			       info.ppn);
 #endif
-            // allocate and initialise a physical page 
-            error = vmm_get_one_ppn( vseg , vpn , &ppn );
-
-            if( error )
-            {
-                printk("\n[ERROR] in %s : no physical page / process = %x / vpn = %x\n",
-                __FUNCTION__ , process->pid , vpn );
-
-                // unlock PTE in local GPT 
-                hal_gpt_unlock_pte( local_gpt_xp , vpn );
-
-                return EXCP_KERNEL_PANIC;
-            }
-
-            // define attr from vseg flags 
-            attr = GPT_MAPPED | GPT_SMALL | GPT_READABLE;
-            if( vseg->flags & VSEG_USER  ) attr |= GPT_USER;
-            if( vseg->flags & VSEG_WRITE ) attr |= GPT_WRITABLE;
-            if( vseg->flags & VSEG_EXEC  ) attr |= GPT_EXECUTABLE;
-            if( vseg->flags & VSEG_CACHE ) attr |= GPT_CACHABLE;
-
-            // set PTE to local GPT 
-            // it unlocks this PTE
-            hal_gpt_set_pte( local_gpt_xp,
-                             vpn,
-                             attr,
-                             ppn );
-
-#if (CONFIG_INSTRUMENTATION_PGFAULTS || DEBUG_VMM_HANDLE_PAGE_FAULT)
-uint32_t end_cycle = (uint32_t)hal_get_cycles();
+
+			current_thread->info.spurious_pgfault_cntr ++;
+			pmm_tlb_flush_vaddr(vaddr, PMM_UNKNOWN);
+			return 0;
+		}
+
+		current_thread->info.spurious_pgfault_cntr ++;
+		pmm_tlb_flush_vaddr(vaddr, PMM_UNKNOWN);
+		return 0;
+#if 0
+#if CONFIG_SHOW_VMM_ERROR_MSG
+		printk(ERROR, 
+		       "ERROR: %s: pid %d, cpu %d, Unexpected page attributes configuration for vaddr %x, found: ppn %x, attr %x\n",
+		       __FUNCTION__,
+		       current_process->pid,
+		       cpu_get_id(), 
+		       vaddr, 
+		       info.ppn,
+		       info.attr);
 #endif
-
-#if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] handled local pgfault / ppn %x / attr %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, ppn, attr, end_cycle );
+    
+		return EPERM;
 #endif
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 2)
-if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-hal_vmm_display( XPTR( local_cxy , this->process ) , true );
-#endif
-
-#if CONFIG_INSTRUMENTATION_PGFAULTS 
-uint32_t cost      = end_cycle - start_cycle;
-this->info.local_pgfault_nr++;
-this->info.local_pgfault_cost += cost;
-if( cost > this->info.local_pgfault_max ) this->info.local_pgfault_max = cost;
-#endif
-            return EXCP_NON_FATAL;
-
-        }   // end local GPT access 
-
-        /////////////////// public vseg and (local != reference) 
-        /////////////////// => access ref GPT to update local GPT
-        else                                
-        {
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] access ref gpt : cxy %x / ref_cxy %x / type %s / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, 
-local_cxy, ref_cxy, vseg_type_str(vseg->type), (uint32_t)hal_get_cycles() );
-#endif
-            // build extended pointer on reference GPT
-            ref_gpt_xp = XPTR( ref_cxy , &ref_ptr->vmm.gpt );
-
-            // lock PTE in reference GPT and get current PPN and attributes
-            error = hal_gpt_lock_pte( ref_gpt_xp,
-                                      vpn,
-                                      &ref_attr,
-                                      &ref_ppn );
-            if( error )
-            {
-                printk("\n[PANIC] in %s : cannot lock PTE in ref GPT / vpn %x / process %x\n",
-                __FUNCTION__ , vpn , process->pid );
-        
-                // unlock PTE in local GPT
-                hal_gpt_unlock_pte( local_gpt_xp , vpn );
-                    
-                return EXCP_KERNEL_PANIC;
-            }
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] get pte from ref gpt / attr %x / ppn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, ref_attr, ref_ppn );
-#endif
-
-            if( ref_attr & GPT_MAPPED )        // false page fault 
-            {
-                // update local GPT from reference GPT values
-                // this unlocks the PTE in local GPT
-                hal_gpt_set_pte( local_gpt_xp,
-                                 vpn,
-                                 ref_attr,
-                                 ref_ppn );
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] updated local gpt for a false pgfault\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-                // unlock the PTE in reference GPT
-                hal_gpt_unlock_pte( ref_gpt_xp, vpn );
-                             
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT &1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] unlock the ref gpt after a false pgfault\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-#if (CONFIG_INSTRUMENTATION_PGFAULTS || DEBUG_VMM_HANDLE_PAGE_FAULT)
-uint32_t end_cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] handled false pgfault / ppn %x / attr %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, ref_ppn, ref_attr, end_cycle );
-#endif
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 2)
-if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-hal_vmm_display( XPTR( local_cxy , this->process ) , true );
-#endif
-
-#if CONFIG_INSTRUMENTATION_PGFAULTS 
-uint32_t cost      = end_cycle - start_cycle;
-this->info.false_pgfault_nr++;
-this->info.false_pgfault_cost += cost;
-if( cost > this->info.false_pgfault_max ) this->info.false_pgfault_max = cost;
-#endif
-                return EXCP_NON_FATAL;
-            }
-            else                            // true page fault 
-            {
-                // allocate and initialise a physical page depending on the vseg type
-                error = vmm_get_one_ppn( vseg , vpn , &ppn );
-
-                if( error )
-                {
-                    printk("\n[ERROR] in %s : no memory / process = %x / vpn = %x\n",
-                    __FUNCTION__ , process->pid , vpn );
-
-                    // unlock PTE in local GPT and in reference GPT
-                    hal_gpt_unlock_pte( local_gpt_xp , vpn );
-                    hal_gpt_unlock_pte( ref_gpt_xp   , vpn );
-                    
-                    return EXCP_KERNEL_PANIC;
-                }
-
-                // define attr from vseg flags 
-                attr = GPT_MAPPED | GPT_SMALL | GPT_READABLE;
-                if( vseg->flags & VSEG_USER  ) attr |= GPT_USER;
-                if( vseg->flags & VSEG_WRITE ) attr |= GPT_WRITABLE;
-                if( vseg->flags & VSEG_EXEC  ) attr |= GPT_EXECUTABLE;
-                if( vseg->flags & VSEG_CACHE ) attr |= GPT_CACHABLE;
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] build a new PTE for a true pgfault\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-                // set PTE in reference GPT
-                // this unlock the PTE 
-                hal_gpt_set_pte( ref_gpt_xp,
-                                 vpn,
-                                 attr,
-                                 ppn );
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 1)
-if( (start_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] set new PTE in ref gpt for a true page fault\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-                // set PTE in local GPT 
-                // this unlock the PTE 
-                hal_gpt_set_pte( local_gpt_xp,
-                                 vpn,
-                                 attr,
-                                 ppn );
-
-#if (CONFIG_INSTRUMENTATION_PGFAULTS || DEBUG_VMM_HANDLE_PAGE_FAULT)
-uint32_t end_cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] handled global pgfault / ppn %x / attr %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, ppn, attr, end_cycle );
-#endif
-
-#if (DEBUG_VMM_HANDLE_PAGE_FAULT & 2)
-if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-hal_vmm_display( XPTR( local_cxy , this->process ) , true );
-#endif
-
-#if CONFIG_INSTRUMENTATION_PGFAULTS 
-uint32_t cost      = end_cycle - start_cycle;
-this->info.global_pgfault_nr++;
-this->info.global_pgfault_cost += cost;
-if( cost > this->info.global_pgfault_max ) this->info.global_pgfault_max = cost;
-#endif
-                return EXCP_NON_FATAL;
-            }
-        }
-    }
-    else   // page has been locally mapped by another concurrent thread
-    {
-        // unlock the PTE in local GPT
-        hal_gpt_unlock_pte( local_gpt_xp , vpn );
-
-#if (CONFIG_INSTRUMENTATION_PGFAULTS || DEBUG_VMM_HANDLE_PAGE_FAULT)
-uint32_t end_cycle = (uint32_t)hal_get_cycles();
-#endif
-
-#if DEBUG_VMM_HANDLE_PAGE_FAULT
-if( (end_cycle > DEBUG_VMM_HANDLE_PAGE_FAULT) && (vpn > 0) )
-printk("\n[%s] handled by another thread / vpn %x / ppn %x / attr %x / cycle %d\n",
-__FUNCTION__, vpn, ppn, attr, end_cycle );
-#endif
-
-#if CONFIG_INSTRUMENTATION_PGFAULTS 
-uint32_t cost      = end_cycle - start_cycle;
-this->info.false_pgfault_nr++;
-this->info.false_pgfault_cost += cost;
-if( cost > this->info.false_pgfault_max ) this->info.false_pgfault_max = cost;
-#endif
-        return EXCP_NON_FATAL;
-    }
-
-}   // end vmm_handle_page_fault()
-
-////////////////////////////////////////////
-error_t vmm_handle_cow( process_t * process,
-                        vpn_t       vpn )
-{
-    vseg_t         * vseg;            // vseg containing vpn
-    xptr_t           gpt_xp;          // extended pointer on GPT (local or reference)
-    gpt_t          * gpt_ptr;         // local pointer on GPT (local or reference)
-    cxy_t            gpt_cxy;         // GPT cluster identifier
-    uint32_t         old_attr;        // current PTE_ATTR value
-    ppn_t            old_ppn;         // current PTE_PPN value
-    uint32_t         new_attr;        // new PTE_ATTR value
-    ppn_t            new_ppn;         // new PTE_PPN value
-    cxy_t            ref_cxy;         // reference process cluster
-    process_t      * ref_ptr;         // local pointer on reference process
-    error_t          error;
-
-    thread_t * this  = CURRENT_THREAD;
-
-#if DEBUG_VMM_HANDLE_COW
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] enter for vpn %x / core[%x,%d] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, local_cxy, this->core->lid, cycle );
-#endif
-
-#if (DEBUG_VMM_HANDLE_COW & 2)
-hal_vmm_display( XPTR( local_cxy , process ) , true );
-#endif
-
-    // get local vseg
-    error = vmm_get_vseg( process, 
-                          (intptr_t)vpn<<CONFIG_PPM_PAGE_ORDER,
-                          &vseg );
-    if( error )
-    {
-        printk("\n[ERROR] in %s : vpn %x in thread[%x,%x] not in a registered vseg\n",
-        __FUNCTION__, vpn, process->pid, this->trdid );
-
-        return EXCP_USER_ERROR;
-    }
-
-#if DEBUG_VMM_HANDLE_COW 
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] get vseg %s\n",
-__FUNCTION__, this->process->pid, this->trdid, vseg_type_str(vseg->type) );
-#endif
-
-    // get reference process cluster and local pointer
-    ref_cxy = GET_CXY( process->ref_xp );
-    ref_ptr = GET_PTR( process->ref_xp );
-
-    // build pointers on relevant GPT
-    // - access only local GPT for a private vseg  
-    // - access reference GPT and all copies for a public vseg
-    if( (vseg->type == VSEG_TYPE_STACK) || (vseg->type == VSEG_TYPE_CODE) )
-    {
-        gpt_cxy = local_cxy;
-        gpt_ptr = &process->vmm.gpt;
-        gpt_xp  = XPTR( gpt_cxy , gpt_ptr );
-    }
-    else
-    {
-        gpt_cxy = ref_cxy;
-        gpt_ptr = &ref_ptr->vmm.gpt;
-        gpt_xp  = XPTR( gpt_cxy , gpt_ptr );
-    }
-
-    // lock target PTE in relevant GPT (local or reference) 
-    // and get current PTE value
-    error = hal_gpt_lock_pte( gpt_xp,
-                              vpn,
-                              &old_attr,
-                              &old_ppn );
-    if( error )
-    {
-        printk("\n[PANIC] in %s : cannot lock PTE in GPT / cxy %x / vpn %x / process %x\n",
-        __FUNCTION__ , gpt_cxy, vpn , process->pid );
-        
-        return EXCP_KERNEL_PANIC;
-    }
-
-#if DEBUG_VMM_HANDLE_COW 
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] get pte for vpn %x : ppn %x / attr %x\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, old_ppn, old_attr );
-#endif
-
-    // return user error if COW attribute not set or PTE2 unmapped
-    if( ((old_attr & GPT_COW) == 0) || ((old_attr & GPT_MAPPED) == 0) )
-    {
-        hal_gpt_unlock_pte( gpt_xp , vpn );
-
-        return EXCP_USER_ERROR;
-    }
-
-    // get pointers on physical page descriptor
-    xptr_t   page_xp  = ppm_ppn2page( old_ppn );
-    cxy_t    page_cxy = GET_CXY( page_xp );
-    page_t * page_ptr = GET_PTR( page_xp );
-
-    // get extended pointers on forks and lock field in page descriptor
-    xptr_t forks_xp       = XPTR( page_cxy , &page_ptr->forks );
-    xptr_t forks_lock_xp  = XPTR( page_cxy , &page_ptr->lock );
-
-    // take lock protecting "forks" counter
-    remote_busylock_acquire( forks_lock_xp );
-
-    // get number of pending forks from page descriptor
-    uint32_t forks = hal_remote_l32( forks_xp );
-
-#if DEBUG_VMM_HANDLE_COW 
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] get forks = %d for vpn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, forks, vpn );
-#endif
-
-    if( forks )        // pending fork => allocate a new page, and copy old to new
-    {
-        // decrement pending forks counter in page descriptor
-        hal_remote_atomic_add( forks_xp , -1 );
-
-        // release lock protecting "forks" counter
-        remote_busylock_release( forks_lock_xp );
-
-        // allocate a new physical page depending on vseg type
-        page_xp = vmm_page_allocate( vseg , vpn );
-
-        if( page_xp == XPTR_NULL ) 
-        {
-            printk("\n[PANIC] in %s : no memory for vpn %x in process %x\n",
-            __FUNCTION__ , vpn, process->pid );
-
-            hal_gpt_unlock_pte( gpt_xp , vpn ); 
-
-            return EXCP_KERNEL_PANIC;
-        }
-
-        // compute allocated page PPN 
-        new_ppn = ppm_page2ppn( page_xp );
-
-#if DEBUG_VMM_HANDLE_COW 
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] get new ppn %x for vpn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, new_ppn, vpn );
-#endif
-
-        // copy old page content to new page
-        hal_remote_memcpy( ppm_ppn2base( new_ppn ),
-                           ppm_ppn2base( old_ppn ),
-                           CONFIG_PPM_PAGE_SIZE );
-
-#if DEBUG_VMM_HANDLE_COW
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] copied old page to new page\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    }             
-    else               // no pending fork => keep the existing page
-    {
-        // release lock protecting "forks" counter
-        remote_busylock_release( forks_lock_xp );
-
-#if(DEBUG_VMM_HANDLE_COW & 1)
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] no pending forks / keep existing PPN %x\n",
-__FUNCTION__, this->process->pid, this->trdid, old_ppn );
-#endif
-        new_ppn = old_ppn;
-    }
-
-    // build new_attr : set WRITABLE, reset COW, reset LOCKED
-    new_attr = (((old_attr | GPT_WRITABLE) & (~GPT_COW)) & (~GPT_LOCKED));
-
-#if(DEBUG_VMM_HANDLE_COW & 1)
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] new_attr %x / new_ppn %x\n",
-__FUNCTION__, this->process->pid, this->trdid, new_attr, new_ppn );
-#endif
-
-    // update the relevant GPT(s)
-    // - private vseg => update only the local GPT 
-    // - public vseg => update the reference GPT AND all the GPT copies
-    if( (vseg->type == VSEG_TYPE_STACK) || (vseg->type == VSEG_TYPE_CODE) )
-    {
-        // set new PTE in local gpt
-        hal_gpt_set_pte( gpt_xp,
-                         vpn,
-                         new_attr,
-                         new_ppn );
-    }
-    else
-    {
-        // set new PTE in all GPT copies
-        vmm_global_update_pte( process,
-                               vpn,
-                               new_attr,
-                               new_ppn );
-    }
-
-#if DEBUG_VMM_HANDLE_COW
-cycle = (uint32_t)hal_get_cycles();
-if( (DEBUG_VMM_HANDLE_COW < cycle) && (vpn > 0) )
-printk("\n[%s] thread[%x,%x] exit for vpn %x / core[%x,%d] / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, vpn, local_cxy, this->core->lid, cycle );
-#endif
-
-#if (DEBUG_VMM_HANDLE_COW & 2)
-hal_vmm_display( XPTR( local_cxy , process ) , true );
-#endif
-
-     return EXCP_NON_FATAL;
-
-}   // end vmm_handle_cow()
-
+	}
+
+	if(!MAPPER_IS_NULL(vseg->vm_mapper))
+		return vmm_do_mapped(vseg, vaddr, excep_code);
+
+	return vmm_do_aod(vseg, vaddr);
+}
+
+*/
+
+
Index: trunk/kernel/mm/vmm.h
===================================================================
--- trunk/kernel/mm/vmm.h	(revision 690)
+++ trunk/kernel/mm/vmm.h	(revision 1)
@@ -3,6 +3,7 @@
  *
  * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
- *           Alain Greiner    (2016,2017,2018,2019,2020))
- *
+ *           Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ * 
  * Copyright (c) UPMC Sorbonne Universites
  *
@@ -26,9 +27,9 @@
 #define _VMM_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <bits.h>
 #include <list.h>
-#include <queuelock.h>
-#include <remote_queuelock.h>
+#include <grdxt.h>
+#include <spinlock.h>
 #include <hal_gpt.h>
 #include <vseg.h>
@@ -38,56 +39,51 @@
 
 struct process_s;
-struct vseg_s;
-
-/*********************************************************************************************
- * This structure defines the STACK allocator used by the VMM to dynamically handle
- * vseg allocation or release requests for an user thread.
- * This allocator handles a fixed size array of fixed size slots in STACK zone of user space.
+
+/*********************************************************************************************
+ * This structure defines the STACK allocator used by the VMM to dynamically allocate
+ * STACK vsegs requested or released by the user process.
+ * This allocator handles a fixed size array of fixed size slots stores in the STACK zone.
  * The stack size and the number of slots are defined by the CONFIG_VMM_STACK_SIZE, and
- * CONFIG_VMM_STACK_BASE parameters.
- * Each slot can contain one user stack vseg. The first 4 Kbytes page in the slot is not
- * mapped to detect stack overflow.
- * In this implementation, the slot index is defined by the user thead LTID.
- * All allocated stacks are registered in a bitmap defining the STACK zone state: 
- * - The allocator checks that the requested slot has not been already allocated, and set the
- *   corresponding bit in the bitmap.
- * - The de-allocator reset the corresponding bit in the bitmap.
- *
- * An  architecture dependant hal_vmm_display() function is defined in <hal_vmm.h> file.
+ * CONFIG_THREAD
+ * Each slot can contain one user stack vseg. The first page in the slot is not allocated
+ * to detect stack overflow.
+ * The slot index can be computed form the slot base address, and reversely.
+ * All allocation / release operations are registered in the stack_bitmap, that completely
+ * define the STACK zone state.  
+ * In this implementation, the max number of slots is 32.
  ********************************************************************************************/
 
 typedef struct stack_mgr_s
 {
-    busylock_t     lock;               /*! lock protecting STACK allocator                  */
+    spinlock_t     lock;               /*! lock protecting STACK allocator                  */
     vpn_t          vpn_base;           /*! first page of STACK zone                         */
-    bitmap_t       bitmap;             /*! bit vector of allocated stacks                   */
+    bitmap_t       bitmap;             /*! bit bector of allocated stacks                   */
 }
 stack_mgr_t;
 
 /*********************************************************************************************
- * This structure defines the MMAP allocator used by the VMM to dynamically handle MMAP vsegs
- * requested or released by an user process. It must be called in the reference cluster.
- * - allocation policy : 
- *   This allocator implements the buddy algorithm. All allocated vsegs occupy an integer
- *   number of pages, that is power of 2, and are aligned (vpn_base is multiple of vpn_size).
- *   The requested number of pages is rounded if required. The global allocator state is
- *   completely defined by the free_pages_root[] array indexed by the vseg order.
- *   These free lists are local, but are implemented as xlist because we use the existing
- *   vseg.xlist to register a free vseg in its free list.
- * - release policy : 
- *   A released vseg is recursively merged with the "buddy" vseg when it is free, in
- *   order to build the largest possible aligned free vsegs. The resulting vseg.vpn_size
- *   field is updated.
- * Implementation note:
- * The only significant (and documented) fiels in the vsegs registered in the MMAP allocator
- * free lists are "xlist", "vpn_base", and "vpn_size".
+ * This structure defines the MMAP allocator used by the VMM to dynamically allocate
+ * MMAP vsegs requested or released by an user process.
+ * This allocator sould be only used in the reference cluster.
+ * - allocation policy : all allocated vsegs occupy an integer number of pages that is 
+ *   power of 2, and are aligned on a page boundary. The requested number of pages is
+ *   rounded if reqired. The first_free_vpn variable defines completely the MMAP zone state.
+ *   It is never decremented, as the released vsegs are simply registered in a zombi_list.
+ *   The relevant zombi_list is checked first for each allocation request. 
+ * - release policy : a released MMAP vseg is registered in an array of zombi_lists.
+ *   This array is indexed by ln(number of pages), and each entry contains the root of
+ *   a local list of zombi vsegs that have the same size. The physical memory allocated
+ *   for a zombi vseg descriptor is not released, to use the "list" field.
+ *   This physical memory allocated for MMAP vseg descriptors is actually released
+ *   when the VMM is destroyed.
  ********************************************************************************************/
 
 typedef struct mmap_mgr_s
 {
-    busylock_t     lock;               /*! lock protecting MMAP allocator                   */
+    spinlock_t     lock;               /*! lock protecting MMAP allocator                   */
     vpn_t          vpn_base;           /*! first page of MMAP zone                          */
     vpn_t          vpn_size;           /*! number of pages in MMAP zone                     */
-    xlist_entry_t  free_list_root[CONFIG_VMM_HEAP_MAX_ORDER + 1];  /* roots of free lists   */
+    vpn_t          first_free_vpn;     /*! first free page in MMAP zone                     */
+    list_entry_t   zombi_list[32];     /*! array of roots of released vsegs lists           */
 }
 mmap_mgr_t;
@@ -95,186 +91,80 @@
 /*********************************************************************************************
  * This structure defines the Virtual Memory Manager for a given process in a given cluster.
- * This VMM implements four main services:
- * 1) It contains the local copy of the vseg list (VSL), only complete in reference cluster.
- * 2) It contains the local copy of the generic page table (GPT), only complete in reference.
- * 3) The stack manager dynamically allocates virtual memory space for the STACK vsegs.
- * 4) The mmap manager dynamically allocates virtual memory for the (FILE/ANON/REMOTE) vsegs.
- ******************************************************a**************************************
- * Implementation notes:
- * 1. In most clusters, the VSL and GPT are only partial copies of the reference VSL and GPT
- *    structures, stored in the reference cluster.
- * 2. The VSL contains only local vsegs, but it is implemented as an xlist, and protected by
- *    a remote_rwlock, because it can be accessed by a thread running in a remote cluster.
- *    An example is the vmm_fork_copy() function.
- * 3. The GPT in the reference cluster can be directly accessed by remote threads to handle
- *    false page-fault (page is mapped in the reference GPT, but the PTE copy is missing
- *    in the local GPT). As each PTE can be protected by a specific GPT_LOCKED attribute
- *    for exclusive access, it is NOT protected by a global lock. 
+ * This local VMM provides three main services:
+ * 1) It registers all vsegs statically or dynamically defined in the vseg list,
+ *    and in the associated radix-tree.
+ * 2) It allocates virtual memory space for the STACKS and MMAP vsegs,
+ *    using dedicated allocators. 
+ * 3) It contains the local copy of the generic page table descriptor.
  ********************************************************************************************/
 
 typedef struct vmm_s
 {
-	remote_queuelock_t vsl_lock;            /*! lock protecting the local VSL               */
-	xlist_entry_t      vsegs_root;          /*! Virtual Segment List root                   */
-	uint32_t           vsegs_nr;            /*! total number of local vsegs                 */
-
-    gpt_t              gpt;                 /*! Generic Page Table descriptor               */
-
-    stack_mgr_t        stack_mgr;           /*! embedded STACK vsegs allocator              */
-
-    mmap_mgr_t         mmap_mgr;            /*! embedded MMAP vsegs allocator               */
-
-	uint32_t           false_pgfault_nr;    /*! false page fault counter (for all threads)  */
-	uint32_t           local_pgfault_nr;    /*! false page fault counter (for all threads)  */
-	uint32_t           global_pgfault_nr;   /*! false page fault counter (for all threads)  */
-    uint32_t           false_pgfault_cost;  /*! cumulated cost (for all threads)            */
-    uint32_t           local_pgfault_cost;  /*! cumulated cost (for all threads)            */
-    uint32_t           global_pgfault_cost; /*! cumulated cost (for all threads)            */
-
-    vpn_t              args_vpn_base;       /*! args vseg first page                        */
-    vpn_t              envs_vpn_base;       /*! envs vseg first page                        */
-	vpn_t              code_vpn_base;       /*! code vseg first page                        */
-	vpn_t              data_vpn_base;       /*! data vseg first page                        */
-    vpn_t              heap_vpn_base;       /*! heap zone first page                        */
-
-	intptr_t           entry_point;         /*! main thread entry point                     */
+	rwlock_t       vsegs_lock;         /*! lock protecting the vsegs list & radix tree      */
+	list_entry_t   vsegs_root;         /*! all vsegs in same process and same cluster       */
+	uint32_t       vsegs_nr;           /*! total number of vsegs                            */
+
+  	grdxt_t        grdxt;              /*! embedded generic vsegs radix tree (key is vpn)   */
+
+    gpt_t          gpt;                /*! embedded generic page table descriptor           */
+
+    stack_mgr_t    stack_mgr;          /*! embedded STACK vsegs allocator                   */
+
+    mmap_mgr_t     mmap_mgr;           /*! embedded MMAP vsegs allocator                    */
+
+	uint32_t       pgfault_nr;         /*! page fault counter                               */
+	uint32_t       u_err_nr;           /*! TODO ??? [AG]                                    */
+	uint32_t       m_err_nr;           /*! TODO ??? [AG]                                    */
+
+    vpn_t          kent_vpn_base;      /*! kentry vseg first page                           */
+    vpn_t          args_vpn_base;      /*! args vseg first page                             */
+    vpn_t          envs_vpn_base;      /*! envs zone first page                             */
+    vpn_t          heap_vpn_base;      /*! envs zone first page                             */
+	vpn_t          code_vpn_base;      /*! code zone first page                             */
+	vpn_t          data_vpn_base;      /*! data zone first page                             */
+
+	intptr_t       entry_point;        /*! main thread entry point                          */
+
+    vseg_t       * heap_vseg;          /*! pointer on local heap vseg descriptor            */
 }
 vmm_t;
 
 /*********************************************************************************************
- * This function makes a partial initialisation of the VMM attached to an user process.
- * It intializes the STACK and MMAP allocators, the VSL lock, and the instrumentation
- * counters, but it does not register any vseg in the VSL:
- * - The "kernel" vsegs are registered, by the hal_vmm_kernel_update() function.
- * - The "args" & "envs" vsegs are registered by the process_make_exec() function.
- * - The "code" and "data" vsegs are registered by the elf_load_process() function.
- * - The "stack" vsegs are registered by process_make_exec() / thread_user_create().
- * - The "file", "anon", "remote" vsegs are dynamically registered by the mmap() syscall.
+ * This structure is used to store the arguments of the mmap() system call.
+ ********************************************************************************************/
+
+typedef struct mmap_attr_s
+{
+	void     * addr;            /*! requested virtual address (unused : should be NULL)     */ 
+	uint32_t   length;          /*! requested vseg size (bytes)                             */
+	uint32_t   prot;            /*! access modes                                            */
+	uint32_t   flags;           /*! only MAP_FILE / MAP_ANON / MAP_PRIVATE / MAP_SHARED     */
+	fdid_t     fdid;            /*! file descriptor index (if MAP_FILE is set)              */
+	int32_t    offset;          /*! file offset (if MAP_FILE is set)                        */
+}
+mmap_attr_t;
+
+/*********************************************************************************************
+ * This function initialises the virtual memory manager attached to a process.
+ * - It initializes the VSL (list of vsegs and associated radix tree).
+ * - It initializes the generic page table (empty).
+ * - It initializes the STAK and MMAP allocators.
+ * - It registers the "kentry", "args", "envs" and "heap" vsegs in the vsegs list.
+ * Any error in this function gives a kernel panic.
  *********************************************************************************************
  * @ process   : pointer on process descriptor
- * @ return 0 if success / return -1 if failure.
- ********************************************************************************************/
-error_t vmm_user_init( struct process_s * process );
-
-/*********************************************************************************************
- * This function is called by the process_make_exec() function to re-initialises the VMM
- * attached to an user process:
- * - It removes from the VMM of the process identified by the <process> argument all user
- *   vsegs, by calling the vmm_remove_vseg() function: the vsegs are removed from the VSL,
- *   the corresponding GPT entries are removed from the GPT, and the physical pages are 
- *   released to the relevant kmem when they are not shared.
- * - The VSL and the GPT are not modified for the kernel vsegs.
- * - Finally, it calls the vmm_user_init() function to re-initialize the STAK and MMAP
- *   allocators, and the lock protecting GPT.
- *********************************************************************************************
- * @ process   : pointer on process descriptor.
- ********************************************************************************************/
-void vmm_user_reset( struct process_s * process );
-
-/*********************************************************************************************
- * This function is called by the process_make_fork() function. It partially copies
- * the content of a remote parent process VMM to the local child process VMM:
- * - The KERNEL vsegs required by the architecture must have been previously
- *   created in the child VMM, using the hal_vmm_kernel_update() function.
- * - The DATA, ANON, REMOTE vsegs registered in the parent VSL are registered in the
- *   child VSL. All valid PTEs in parent GPT are copied to the child GPT.
- *   The WRITABLE  and COW flags are not modified, as it will be done later for those
- *   shared pages by the vmm_set_cow() function.
- * - The CODE vsegs registered in the parent VSL are registered in the child VSL, but the
- *   GPT entries are not copied in the child GPT, and will be dynamically updated from
- *   the .elf file when a page fault is reported.
- * - The FILE vsegs registered in the parent VSL are registered in the child VSL, and all
- *   valid GPT entries in parent GPT are copied to the child GPT. The COW flag is not set.
- * - No STACK vseg is copied from  parent VMM to child VMM: the child stack vseg is copied
- *   later from the cluster containing the user thread requesting the fork().
- *********************************************************************************************
- * @ child_process     : local pointer on local child process descriptor.
- * @ parent_process_xp : extended pointer on remote parent process descriptor.
- * @ return 0 if success / return -1 if failure.
- ********************************************************************************************/
-error_t vmm_fork_copy( struct process_s * child_process,
-                       xptr_t             parent_process_xp );
-
-/*********************************************************************************************
- * This function is called by the process_make_fork() function to update the COW attribute
- * in the parent parent process vsegs. It set the COW flag, and reset the WRITABLE flag of
- * all GPT entries of the DATA, MMAP, and REMOTE vsegs of the <process> argument.
- * It must be called by a thread running in the reference cluster, that contains the complete
- * VSL and GPT (use the rpc_vmm_set_cow_client() when the calling thread client is remote). 
- * It updates all copies of the process in all clusters, to maintain coherence in GPT copies,
- * using the list of copies stored in the owner process, and using remote_write accesses to
- * update the remote GPTs. It atomically increment the pending_fork counter, in all involved
- * physical page descriptors. It cannot fail, as only mapped entries in GPTs are updated.
- *********************************************************************************************
- * @ process   : local pointer on local reference process descriptor.
- ********************************************************************************************/
-void vmm_set_cow( struct process_s * process );
-
-/*********************************************************************************************
- * This function modifies the vseg identified by <process> and <base> arguments in all
- * clusters containing a VSL copy, as defined by <new_base> and <new_size> arguments.
- * The new vseg, defined by the <new_base> and <new_size> arguments must be included
- * in the existing vseg. The target VSL size and base fields are modified in the VSL.
- * This is done in all clusters containing a VMM copy to maintain VMM coherence. 
- * It is called by the sys_munmap() and dev_fbf_resize_window() functions.
- * It can be called by a thread running in any cluster, as it uses the vmm_resize_vseg() in
- * the local cluster, and parallel RPC_VMM_RESIZE_VSEG for remote clusters.
- * It cannot fail, as only vseg registered  in VSL copies are updated.
- *********************************************************************************************
- * @ process   : local pointer on process descriptor.
- * @ base      : current vseg base address in user space.
- * @ new_base  : new vseg base.
- * @ new_size  : new vseg size.
- ********************************************************************************************/
-void vmm_global_resize_vseg( struct process_s * process,
-                             intptr_t           base,
-                             intptr_t           new_base,
-                             intptr_t           new_size );
-
-/*********************************************************************************************
- * This function removes the vseg identified by the <process> and <base> arguments from
- * the VSL and remove all associated PTE entries from the GPT.
- * This is done in all clusters containing a VMM copy to maintain VMM coherence. 
- * It is called by the sys_munmap() and dev_fbf_resize_window() functions.
- * It can be called by a thread running in any cluster, as it uses the vmm_remove_vseg() in
- * the local cluster, and parallel RPC_VMM_REMOVE_VSEG for remote clusters.
- * It cannot fail, as only vseg registered  in VSL copies are deleted.
- *********************************************************************************************
- * @ pid      : local pointer on process identifier.
- * @ base     : vseg base address in user space.
- ********************************************************************************************/
-void vmm_global_delete_vseg( struct process_s * process,
-                             intptr_t           base );
-
-/*********************************************************************************************
- * This function modifies one GPT entry identified by the <process> and <vpn> arguments
- * in all clusters containing a process copy. It maintains coherence in GPT copies,
- * using remote_write accesses.
- * It cannot fail, as only mapped PTE2 in GPT copies are updated.
- *********************************************************************************************
- * @ process   : local pointer on local process descriptor.
- * @ vpn       : PTE index.
- * @ attr      : PTE / attributes.
- * @ ppn       : PTE / physical page index.
- ********************************************************************************************/
-void vmm_global_update_pte( struct process_s * process,
-                            vpn_t              vpn,
-                            uint32_t           attr,
-                            ppn_t              ppn );
-
-/*********************************************************************************************
- * This function deletes, in the local cluster, all vsegs registered in the VSL
- * of the process identified by the <process> argument. For each vseg:
- * - it unmaps all vseg PTEs from the GPT (release the physical pages when required). 
- * - it removes the vseg from the local VSL.
- * - it releases the memory allocated to the local vseg descriptors.
- * - it releases the memory allocated to the GPT itself.
- *********************************************************************************************
- * @ process   : pointer on process descriptor.
+ ********************************************************************************************/
+void vmm_init( struct process_s * process );
+
+/*********************************************************************************************
+ * This function removes all vsegs registered in in a virtual memory manager,
+ * and releases the memory allocated to the local generic page table. 
+ *********************************************************************************************
+ * @ vmm   : pointer on process descriptor.
  ********************************************************************************************/
 void vmm_destroy( struct process_s * process );
 
 /*********************************************************************************************
- * This function scans the list of vsegs registered in the VMM of a given process descriptor
+ * This function scan the list of vsegs registered in the VMM of a given process descriptor
  * to check if a given virtual region (defined by a base and size) overlap an existing vseg.
  *********************************************************************************************
@@ -289,172 +179,198 @@
 
 /*********************************************************************************************
- * This function allocates memory for a vseg descriptor, initialises it, and register it
- * in the VSL of the local process descriptor.
- * - For the FILE, ANON, & REMOTE types, it does not use the <base> argument, but uses 
- *   the specific VMM MMAP allocator.
- * - For the STACK type, it does not use the <base> and <size> arguments,  but uses the
- *   the specific VMM STACK allocator.
- * It checks collision with pre-existing vsegs.
- * To comply with the "on-demand" paging policy, this function does NOT modify the GPT,
- * and does not allocate physical memory for vseg data.
- * It should be called by a local thread (could be a RPC thread if the client thread is not
- * running in the reference cluster).
- *********************************************************************************************
- * @ process     : pointer on local processor descriptor.
- * @ type        : vseg type.
- * @ base        : vseg base address (or user thread ltid for an user stack vseg).
- * @ size        : vseg size (bytes).
- * @ file_offset : offset in file for CODE, DATA, FILE types. 
- * @ file_size   : can be smaller than "size" for DATA type.
- * @ mapper_xp   : extended pointer on mapper for CODE, DATA, FILE types.
- * @ cxy         : physical mapping cluster (for non distributed vsegs).
- * @ returns pointer on vseg if success / returns NULL if no memory, or conflict.
+ * This function allocates memory for a vseg descriptor, initialises it, and register it 
+ * in the VMM of the process. It checks the collision with pre-existing vsegs in VMM.
+ * For STACK and MMAP types vseg, it does not use the base argument, but uses the VMM STACK
+ * and MMAP specific allocators to get a base address in virtual space.
+ * To comply with the "on-demand" paging policy, this function does NOT mofify the
+ * page table, and does not allocate physical memory for vseg data.
+ *********************************************************************************************
+ * @ vmm   : pointer on process descriptor.
+ * @ base      : vseg base address
+ * @ size      : vseg size (bytes)
+ * @ type      : vseg type
+ * @ returns pointer on vseg if success / returns NULL if no memory or conflict.
  ********************************************************************************************/
 vseg_t * vmm_create_vseg( struct process_s * process,
-                          vseg_type_t        type,
-                          intptr_t           base,
-	                      uint32_t           size,
-                          uint32_t           file_offset,
-                          uint32_t           file_size,
-                          xptr_t             mapper_xp,
-                          cxy_t              cxy );
-
-/*********************************************************************************************
- * This function removes from the VMM of a local process descriptor, identified by
- * the <process> argument, the vseg identified by the <vseg> argument.  
- * It is called by the vmm_user_reset(), vmm_global_delete_vseg(), vmm_destroy() functions.
- * It must be called by a local thread, running in the cluster containing the modified VMM.
- * Use the RPC_VMM_REMOVE_VSEG if required.
- * It makes a kernel panic if the process is not registered in the local cluster.
- * For all vseg types, the vseg is detached from local VSL, and all associated PTEs are
- * unmapped from local GPT. Other actions depend on the vseg type:
- * Regarding the vseg descriptor release:
- *   . for ANON and REMOTE, the vseg is not released, but registered in local zombi_list.
- *   . for STACK the vseg is released to the local stack allocator.
- *   . for all other types, the vseg descriptor is released to the local kmem.
- * Regarding the physical pages release:
- *   . for KERNEL and FILE, the pages are not released to kmem.
- *   . for CODE and STACK, the pages are released to local kmem.
- *   . for DATA, ANON and REMOTE, the pages are released to relevant kmem only when
- *     the local cluster is the reference cluster.
- * The VSL lock protecting the VSL must be taken by the caller.
- *********************************************************************************************
- * @ process  : local pointer on process descriptor.
- * @ vseg     : local pointer on target vseg. 
- ********************************************************************************************/
-void vmm_remove_vseg( struct process_s * process,
-                      struct vseg_s    * vseg );
-
-/*********************************************************************************************
- * This function resize a local vseg identified by the <process> and <vseg> arguments.
- * Both the "size" and "base" fields are modified in the process VSL. When the new vseg
- * contains less pages than the target vseg, the relevant pages are removed from the GPT. 
- * It is called by the vmm_global_resize() and dev_fbf_resize_window() functions.
- * It must be called by a local thread, running in the cluster containing the modified VSL.
- * Use the RPC_VMM_RESIZE_VSEG if required.
- * The VSL lock protecting the VSL must be taken by the caller.
- *********************************************************************************************
- * @ process   : local pointer on process descriptor
- * @ vseg      : local pointer on target vseg
- * @ new_base  : vseg base address
- * @ new_size  : vseg size (bytes)
- ********************************************************************************************/
-void vmm_resize_vseg( struct process_s * process,
-                      struct vseg_s    * vseg,
-                      intptr_t           new_base,
-                      intptr_t           new_size );
-
-/*********************************************************************************************
- * This function checks that a given virtual address <vaddr> in a given <process> is
- * contained in a registered vseg. It can be called by any thread running in any cluster.
- * - if the vseg is registered in the local process VSL, it returns the local vseg pointer.
- * - if the vseg is missing in local VSL, it access directly the reference VSL.
- * - if the vseg is found in reference VSL, it updates the local VSL and returns this pointer.
- * It returns an error when the vseg is missing in the reference VMM, or when there is 
- * not enough memory for a new vseg descriptor in the calling thread cluster.
- * For both the local and the reference VSL, it takes the VSL lock before scanning the VSL.
+                          intptr_t           base, 
+	                      intptr_t           size, 
+	                      uint32_t           type );
+
+/*********************************************************************************************
+ * Ths function removes a vseg identified by it's pointer from the VMM of the calling process.
+ * - If the vseg has not the STACK or MMAP type, it is removed from the vsegs list,
+ *   and the physical memory allocated to vseg descriptor is released to KMEM.
+ * - If the vseg has the STACK type, it is removed from the vsegs list, the physical memory
+ *   allocated to vseg descriptor is released to KMEM, and the stack slot is returned to the
+ *   VMM STACK allocator.
+ * - If the vseg has the MMAP type, it is removed from the vsegs list and is registered
+ *   in the zombi_list of the VMM MMAP allocator for future reuse. The physical memory
+ *   allocated to vseg descriptor is NOT released to KMEM.
+ *********************************************************************************************
+ * @ vseg      : pointer on vseg to be removed.
+ ********************************************************************************************/
+void vmm_remove_vseg( vseg_t * vseg );
+
+/*********************************************************************************************
+ * This function allocates physical memory from the local cluster to map all PTEs 
+ * of a "kernel" vseg (type KCODE , KDATA, or KDEV) in the page table of process_zero.
+ * It should not be used for other vseg types, because "user" vsegs use the 
+ * "on-demand-paging" policy.
+ *********************************************************************************************
+ * @ vseg     : pointer on the vseg to be mapped.
+ * @ attr     : GPT attributes to be set for all vseg pages.
+ * @ returns 0 if success / returns ENOMEM if no memory
+ ********************************************************************************************/
+error_t vmm_map_vseg( vseg_t           * vseg,
+                      uint32_t           attr );
+
+/*********************************************************************************************
+ * This function unmap all PTEs of a given vseg, in the generic page table asociated 
+ * to a given process descriptor, and releases the corresponding physical memory.
+ * It can be used for any type of vseg.
+ *********************************************************************************************
+ * @ process  : pointer on process descriptor.
+ * @ vseg     : pointer on the vseg to be unmapped.
+ ********************************************************************************************/
+void vmm_unmap_vseg( struct process_s * process,
+                     vseg_t           * vseg );
+
+/*********************************************************************************************
+ * This function remove a given region (defined by a base address and a size) from
+ * the VMM of a given process descriptor. This can modify several vsegs:
+ * (a) if the region is not entirely mapped in an existing vseg, it's an error.
+ * (b) if the region has same base and size as an existing vseg, the vseg is removed.
+ * (c) if the removed region cut the vseg in two parts, it is removed and re-created.
+ * (d) if the removed region cut the vseg in three parts, it is removed, and two are created.
+ * TODO : cases (c) and (d) are not implemented [AG]
+ *********************************************************************************************
+ * @ process   : pointer on process descriptor
+ * @ base      : vseg base address
+ * @ size      : vseg size (bytes)
+ ********************************************************************************************/
+error_t vmm_resize_vseg( struct process_s * process,
+                         intptr_t           base,
+                         intptr_t           size );
+
+/*********************************************************************************************
+ * This function search if a given virtual address is contained in a vseg registered in
+ * the local process VMM and returns the vseg pointer if success.
+ *********************************************************************************************
+ * @ process   : pointer on process descriptor
+ * @ vaddr     : virtual address
+ * @ returns the pointer on vseg if success / returns NULL if failure.
+ *********************************************************************************************/
+vseg_t * vmm_get_vseg( struct process_s * process,
+                       intptr_t           vaddr );
+
+/*********************************************************************************************
+ * This function is called by the architecture specific exception handler when a 
+ * page fault has been detected in a given cluster. 
+ * If the local cluster is not the reference cluster, it send a RPC_VMM_GET_PTE
+ * to the reference cluster to get the missing PTE attributes and PPN, and update
+ * the local page table. If the local cluster is the reference, it call directly
+ * the vmm_get_pte() function.
+ *********************************************************************************************
+ * @ process   : pointer on process descriptor.
+ * @ vseg      : pointer on involved vseg.
+ * @ vpn       : VPN of the missing PTE.
+ * @ returns 0 if success / returns ENOMEM if no memory.
+ ********************************************************************************************/
+error_t vmm_handle_page_fault( struct process_s * process,
+                               vseg_t           * vseg,
+                               vpn_t              vpn ); 
+
+/*********************************************************************************************
+ * This function returns in the "attr" and "ppn" arguments the PTE associated to a given
+ * VPN for a given process. This function must be called on the reference cluster. 
+ * To get the PTE from another cluster, use the RPC_VMM_GET_PTE.
+ * The vseg containing the searched VPN should be registered in the reference VMM.
+ * If the PTE in the reference page table is unmapped, this function allocates the missing
+ * physical page from the target cluster defined by the vseg type, and update the reference
+ * page table. It can call a RPC_PMEM_GET_PAGES to get the missing physical page, 
+ * if the target cluster is not the reference cluster.
  *********************************************************************************************
  * @ process   : [in] pointer on process descriptor.
- * @ vaddr     : [in] virtual address.
- * @ vseg      : [out] local pointer on local vseg.
- * @ returns 0 if success / returns -1 if user error 
- ********************************************************************************************/
-error_t vmm_get_vseg( struct process_s  * process,
-                      intptr_t            vaddr,
-                      vseg_t           ** vseg );            
-
-/*********************************************************************************************
- * This function is called by the generic exception handler in case of page-fault event,
- * detected for a given <vpn>. The <process> argument is used to access the relevant VMM.
- * It checks the missing VPN and returns an user error if it is not in a registered vseg.
- * For a legal VPN, there is actually 3 cases:
- * 1) if the missing VPN belongs to a private vseg (STACK or CODE segment types, non
- *    replicated in all clusters), it allocates a new physical page, computes the attributes,
- *    depending on vseg type, and updates directly the local GPT.
- * 2) if the missing VPN belongs to a public vseg, it can be a false page-fault, when the VPN
- *    is mapped in the reference GPT, but not in the local GPT. For this false page-fault,
- *    the local GPT is simply updated from the reference GPT.
- * 3) if the missing VPN is public, and unmapped in the ref GPT, it is a true page fault.
- *    The calling thread  allocates a new physical page, computes the attributes, depending
- *    on vseg type, and updates directly (without RPC) the local GPT and the reference GPT.
- *    Other GPT copies  will updated on demand.
- * Concurrent accesses to the GPT(s) are handled, by locking the target PTE before accessing
- * the local and/or reference GPT(s).
- *********************************************************************************************
- * @ process  : local pointer on local process.
- * @ vpn      : VPN of the missing PTE.
- * @ returns EXCP_NON_FATAL / EXCP_USER_ERROR / EXCP_KERNEL_PANIC after analysis
- ********************************************************************************************/
-error_t vmm_handle_page_fault( struct process_s * process,
-                               vpn_t              vpn );
-
-/*********************************************************************************************
- * This function is called by the generic exception handler in case of WRITE violation event, 
- * detected for a given <vpn>. The <process> argument is used to access the relevant VMM.
- * It returns a kernel panic if the faulty VPN is not in a registered vseg, or is not mapped.
- * For a legal mapped vseg there is two cases:
- * 1) If the missing VPN belongs to a private vseg (STACK), it access only the local GPT.
- *    It access the forks counter in the current physical page descriptor.
- *    If there is a pending fork, it allocates a new physical page from the cluster defined 
- *    by the vseg type, copies the old physical page content to the new physical page,
- *    and decrements the pending_fork counter in old physical page descriptor.
- *    Finally, it reset the COW flag and set the WRITE flag in local GPT.
- * 2) If the missing VPN is public, it access only the reference GPT.
- *    It access the forks counter in the current physical page descriptor.
- *    If there is a pending fork, it allocates a new physical page from the cluster defined 
- *    by the vseg type, copies the old physical page content to the new physical page,
- *    and decrements the pending_fork counter in old physical page descriptor.
- *    Finally it calls the vmm_global_update_pte() function to reset the COW flag and set
- *    the WRITE flag in all the GPT copies, using a RPC if the reference cluster is remote.
- * In both cases, concurrent accesses to the GPT are handled by locking the target PTE
- * before accessing the GPT.
- *********************************************************************************************
- * @ process   : pointer on local process descriptor copy.
- * @ vpn       : VPN of the faulting PTE.
- * @ returns EXCP_NON_FATAL / EXCP_USER_ERROR / EXCP_KERNEL_PANIC after analysis
- ********************************************************************************************/
-error_t vmm_handle_cow( struct process_s * process,
-                        vpn_t              vpn );
-
-/*********************************************************************************************
- * This function is called by the vmm_get_pte() function when a page is unmapped.
- * Depending on the vseg type, defined by the <vseg> argument, it returns the PPN 
- * (Physical Page Number) associated to a missing page defined by the <vpn> argument.
- * - For the FILE type, it returns directly the physical page from the file mapper.
- * - For the CODE and DATA types, it allocates a new physical page from the cluster defined
- *   by the <vseg->cxy> field, or by the <vpn> MSB bits for a distributed vseg,
- *   and initialize this page from the .elf file mapper.
- * - For all other types, it allocates a new physical page from the cluster defined
- *   by the <vseg->cxy> field, or by the <vpn> MSB bits for a distributed vseg,
- *   but the new page is not initialized.
- *********************************************************************************************
- * @ vseg   : local pointer on vseg containing the mising page.
- * @ vpn    : Virtual Page Number identifying the missing page.
- * @ ppn    : [out] returned Physical Page Number.
- * return 0 if success / return EINVAL or ENOMEM if error.
- ********************************************************************************************/
-error_t vmm_get_one_ppn( vseg_t * vseg,
-                         vpn_t    vpn,
-                         ppn_t  * ppn );
+ * @ vpn       : [in] VPN defining the missing PTE.
+ * @ attr      : [out] PTE attributes.
+ * @ ppn       : [out] PTE ppn.
+ * @ returns 0 if success / returns ENOMEM if error.
+ ********************************************************************************************/
+error_t vmm_get_pte( struct process_s * process,
+                     vpn_t              vpn,
+                     uint32_t         * attr,
+                     ppn_t            * ppn );
+
+/*********************************************************************************************
+ * This function makes the virtual to physical address translation, using the calling 
+ * process page table. It uses identity mapping if required by the ident flag. 
+ * This address translation is required to configure the devices
+ * that have a DMA capability, or to implement the software L2/L3 cache cohérence, 
+ * using the MMC device synchronisation primitives.
+ * WARNING : the <ident> value must be defined by the CONFIG_KERNEL_IDENT parameter.
+ *********************************************************************************************
+ * @ ident     : [in] uses identity mapping if true.
+ * @ ptr       : [in] virtual address.
+ * @ paddr     : [out] pointer on buffer for physical address.
+ * @ returns 0 if success / returns ENOMEM if error.
+ ********************************************************************************************/
+error_t vmm_v2p_translate( bool_t    ident,
+                           void    * ptr,
+                           paddr_t * paddr );
+
+
+/*********************************************************************************************
+ * Pas a sa place ici [AG]
+ ********************************************************************************************/
+int sys_mmap( mmap_attr_t * mattr );
+
+/*********************************************************************************************
+ ********************************************************************************************/
+int sys_madvise( void    * start,
+                 uint32_t  length,
+                 uint32_t  advice );
+
+/*********************************************************************************************
+ ********************************************************************************************/
+int sys_sbrk( uint32_t current_heap_ptr, 
+              uint32_t size );
+
+/*********************************************************************************************
+ ********************************************************************************************/
+error_t vmm_sbrk( vmm_t   * vmm, 
+                  uint32_t  current,
+                  uint32_t  size );
+
+/*********************************************************************************************
+ ********************************************************************************************/
+error_t vmm_madvise_migrate( vmm_t    * vmm,
+                             uint32_t   start, 
+                             uint32_t   len );
+
+/*********************************************************************************************
+ ********************************************************************************************/
+error_t vmm_madvise_willneed( vmm_t   * vmm,
+                              uint32_t  start,
+                              uint32_t  len );
+
+/*********************************************************************************************
+ ********************************************************************************************/
+error_t vmm_set_auto_migrate( vmm_t    * vmm,
+                              uint32_t   start,
+                              uint32_t   flags );
+
+/*********************************************************************************************
+ * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked 
+ ********************************************************************************************/
+error_t vmm_broadcast_inval( vseg_t * region,
+                             page_t      * page,
+                             page_t     ** new );
+
+/*********************************************************************************************
+ * Hypothesis: the region is shared-anon, mapper list is rdlocked, page is locked 
+ ********************************************************************************************/
+error_t vmm_migrate_shared_page_seq( vseg_t * region,
+                                     page_t      * page,
+                                     page_t     ** new );
 
 #endif /* _VMM_H_ */
Index: trunk/kernel/mm/vseg.c
===================================================================
--- trunk/kernel/mm/vseg.c	(revision 690)
+++ trunk/kernel/mm/vseg.c	(revision 1)
@@ -2,5 +2,7 @@
  * vseg.c - virtual segment (vseg) related operations
  *
- * Authors   Alain Greiner (2016,2017,2018,2019,2020)
+ * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
+ *           Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -8,9 +10,9 @@
  * This file is part of ALMOS-MKH.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,9 +20,9 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
 #include <hal_special.h>
 #include <hal_remote.h>
@@ -33,4 +35,5 @@
 #include <ppm.h>
 #include <mapper.h>
+#include <spinlock.h>
 #include <vfs.h>
 #include <page.h>
@@ -40,27 +43,32 @@
 
 ////////////////////////////////////////////////////////////////////////////////////////
-//   global variables for display / must be consistent with enum in "vseg.h"
+//   global variables for display / must be consistant with enum in "vseg.h"
 ////////////////////////////////////////////////////////////////////////////////////////
 
-
-//////////////////////////////////////////
-char * vseg_type_str( uint32_t vseg_type )
-{
-  	if     ( vseg_type == VSEG_TYPE_CODE   ) return "CODE";
-  	else if( vseg_type == VSEG_TYPE_DATA   ) return "DATA";
-  	else if( vseg_type == VSEG_TYPE_STACK  ) return "STAK";
-  	else if( vseg_type == VSEG_TYPE_ANON   ) return "ANON";
-  	else if( vseg_type == VSEG_TYPE_FILE   ) return "FILE";
-  	else if( vseg_type == VSEG_TYPE_REMOTE ) return "REMO";
-  	else if( vseg_type == VSEG_TYPE_KCODE  ) return "KCOD";
-  	else if( vseg_type == VSEG_TYPE_KDATA  ) return "KDAT";
-  	else if( vseg_type == VSEG_TYPE_KDEV   ) return "KDEV";
-    else                                     return "undefined";
-}
-
-///////////////////////////
-vseg_t * vseg_alloc( void )
-{
-    return (vseg_t*)kmem_alloc( bits_log2( sizeof(vseg_t)) , AF_ZERO );
+const char* vseg_type_name[VSEG_TYPES_NR] =
+{
+	"CODE",
+	"DATA",
+    "HEAP",
+    "STACK",
+    "ANON",
+    "FILE",
+    "REMOTE",
+    "KCODE",
+    "KDATA",
+    "KDEV",
+};
+
+
+/////////////////////
+vseg_t * vseg_alloc()
+{
+    kmem_req_t   req;
+
+    req.type  = KMEM_VSEG;
+	req.size  = sizeof(vseg_t);
+	req.flags = AF_KERNEL;
+
+    return (vseg_t *)kmem_alloc( &req );
 }
 
@@ -68,16 +76,37 @@
 void vseg_free( vseg_t * vseg )
 {
-	kmem_free( vseg , bits_log2( sizeof(vseg_t)) );
-}
-
-/////////////////////////////////////////
-void vseg_init_flags( vseg_t      * vseg,
-                      vseg_type_t   type )
-{
+    kmem_req_t  req;
+
+	req.type = KMEM_VSEG;
+	req.ptr  = vseg;
+	kmem_free( &req );
+}
+
+///////////////////////////////////
+void vseg_init( vseg_t      * vseg,
+	            intptr_t      base, 
+                intptr_t      size,
+                vpn_t         vpn_base,
+                vpn_t         vpn_size,
+		        uint32_t      type,
+                cxy_t         cxy,
+                fdid_t        fdid,
+		        uint32_t      offset )
+{
+    vseg->type      = type;
+	vseg->min       = base;
+	vseg->max       = base + size;
+    vseg->vpn_base  = vpn_base;
+	vseg->vpn_size  = vpn_size;
+	vseg->mapper    = XPTR_NULL;
+	vseg->fdid      = fdid;
+	vseg->offset    = offset;
+    vseg->cxy       = cxy;
+
     // set vseg flags depending on type
-	if( type == VSEG_TYPE_CODE )
-    {
-        vseg->flags = VSEG_USER    |
-                      VSEG_EXEC    |
+	if     ( type == VSEG_TYPE_CODE ) 
+    {
+        vseg->flags = VSEG_USER    |
+                      VSEG_EXEC    | 
                       VSEG_CACHE   |
                       VSEG_PRIVATE ;
@@ -88,102 +117,118 @@
                       VSEG_WRITE   |
                       VSEG_CACHE   |
+                      VSEG_PRIVATE ; 
+    }
+    else if( type == VSEG_TYPE_DATA ) 
+    {
+        vseg->flags = VSEG_USER    |
+                      VSEG_WRITE   |
+                      VSEG_CACHE   | 
+                      VSEG_DISTRIB ;
+    }
+    else if( type == VSEG_TYPE_HEAP ) 
+    {
+        vseg->flags = VSEG_USER    |
+                      VSEG_WRITE   |
+                      VSEG_CACHE   |
+                      VSEG_DISTRIB ;
+    }
+    else if( type == VSEG_TYPE_REMOTE ) 
+    {
+        vseg->flags = VSEG_USER    |
+                      VSEG_WRITE   | 
+                      VSEG_CACHE   ; 
+    }
+    else if( type == VSEG_TYPE_ANON ) 
+    {
+        vseg->flags = VSEG_USER    |
+                      VSEG_WRITE   |
+                      VSEG_CACHE   |
+                      VSEG_DISTRIB ;
+    }
+    else if( type == VSEG_TYPE_FILE ) 
+    {
+        vseg->flags = VSEG_USER    |
+                      VSEG_WRITE   |
+                      VSEG_CACHE   ;
+    }
+    else if( type == VSEG_TYPE_KCODE ) 
+    {
+        vseg->flags = VSEG_EXEC    |
+                      VSEG_CACHE   |
                       VSEG_PRIVATE ;
     }
-    else if( type == VSEG_TYPE_DATA )
-    {
-        vseg->flags = VSEG_USER    |
-                      VSEG_WRITE   |
-                      VSEG_CACHE   |
-                      VSEG_DISTRIB ;
-    }
-    else if( type == VSEG_TYPE_REMOTE )
-    {
-        vseg->flags = VSEG_USER    |
-                      VSEG_WRITE   |
-                      VSEG_CACHE   ;
-    }
-    else if( type == VSEG_TYPE_ANON )
-    {
-        vseg->flags = VSEG_USER    |
-                      VSEG_WRITE   |
-                      VSEG_CACHE; 
-    }
-    else if( type == VSEG_TYPE_FILE )
-    {
-        vseg->flags = VSEG_USER    |
-                      VSEG_WRITE   |
-                      VSEG_CACHE   ;
-    }
-    else if( type == VSEG_TYPE_KCODE )
-    {
-        vseg->flags = VSEG_EXEC    |
+    else if( type == VSEG_TYPE_KDATA ) 
+    {
+        vseg->flags = VSEG_WRITE   |
                       VSEG_CACHE   |
                       VSEG_PRIVATE ;
     }
-    else if( type == VSEG_TYPE_KDATA )
-    {
-        vseg->flags = VSEG_CACHE   |
-                      VSEG_WRITE   ;
-    }
-    else if( type == VSEG_TYPE_KDEV )
-    {
-        vseg->flags = VSEG_WRITE   ;
-    }
-    else
-    {
-	    assert( __FUNCTION__, false , "illegal vseg type\n" );
-    }
-
+    else 
+    {
+	    printk("\n[PANIC] in %s : illegal vseg type\n", __FUNCTION__);
+        hal_core_sleep();
+    }  
 }  // end vseg_init()
 
 //////////////////////////////////////////
 void vseg_init_from_ref( vseg_t    * vseg,
-                         xptr_t      ref_xp )
+                         xptr_t      ref )
 {
     // get remote vseg cluster and pointer
-    cxy_t    cxy = (cxy_t   )GET_CXY( ref_xp );
-    vseg_t * ptr = (vseg_t *)GET_PTR( ref_xp );
+    cxy_t    cxy = (cxy_t   )GET_CXY( ref );
+    vseg_t * ptr = (vseg_t *)GET_PTR( ref );
 
     // initialize vseg with remote_read access
-    vseg->type        =           hal_remote_l32( XPTR( cxy , &ptr->type        ) );
-    vseg->min         = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->min         ) );
-    vseg->max         = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->max         ) );
-    vseg->vpn_base    =           hal_remote_l32( XPTR( cxy , &ptr->vpn_base    ) );
-    vseg->vpn_size    =           hal_remote_l32( XPTR( cxy , &ptr->vpn_size    ) );
-    vseg->flags       =           hal_remote_l32( XPTR( cxy , &ptr->flags       ) );
-    vseg->file_offset =           hal_remote_l32( XPTR( cxy , &ptr->file_offset ) );
-    vseg->file_size   =           hal_remote_l32( XPTR( cxy , &ptr->file_size   ) );
-	vseg->mapper_xp   = (xptr_t)  hal_remote_l64( XPTR( cxy , &ptr->mapper_xp   ) );
-
-    switch (vseg->type)
-    {
-        case VSEG_TYPE_DATA:      // unused 
-        {
-            vseg->cxy = 0xffff;
-            break;
-        }
-        case VSEG_TYPE_CODE:      // always local
-        case VSEG_TYPE_STACK: 
-        case VSEG_TYPE_KCODE:
-        {
-            vseg->cxy = local_cxy;
-            break;
-        }
-        case VSEG_TYPE_ANON:      // intrinsic
-        case VSEG_TYPE_FILE:
-        case VSEG_TYPE_REMOTE: 
-        case VSEG_TYPE_KDEV:
-        case VSEG_TYPE_KDATA:
-        {
-            vseg->cxy = (cxy_t) hal_remote_l32( XPTR(cxy, &ptr->cxy) );
-            break;
-        }
-        default: 
-        {
-            assert( __FUNCTION__, false, "Illegal vseg type" );
-            break;
-        }
-    }
-}
-
-
+    vseg->type     =           hal_remote_lw ( XPTR( cxy , &ptr->type     ) );
+    vseg->min      = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->min      ) );
+    vseg->max      = (intptr_t)hal_remote_lpt( XPTR( cxy , &ptr->max      ) );
+    vseg->vpn_base =           hal_remote_lw ( XPTR( cxy , &ptr->vpn_base ) );
+    vseg->vpn_size =           hal_remote_lw ( XPTR( cxy , &ptr->vpn_size ) );
+    vseg->flags    =           hal_remote_lw ( XPTR( cxy , &ptr->flags    ) );
+	vseg->mapper   = (xptr_t)  hal_remote_lwd( XPTR( cxy , &ptr->mapper   ) );
+
+    if( vseg->type == VSEG_TYPE_FILE )
+    {
+        vseg->fdid   = hal_remote_lw( XPTR( cxy , &ptr->fdid   ) );
+        vseg->offset = hal_remote_lw( XPTR( cxy , &ptr->offset ) );
+    }
+    else
+    {
+        vseg->fdid   = 0;
+        vseg->offset = 0;
+    }
+} // end vseg_init_from_ref()
+
+
+///////////////////////////////
+error_t vseg_attach( vmm_t  * vmm,
+                     vseg_t * vseg )
+{
+    // add vseg in radix-tree
+    error_t error = grdxt_insert( &vmm->grdxt , vseg->vpn_base , vseg );
+    if ( error ) return ENOMEM;
+
+    // update vseg descriptor
+    vseg->vmm = vmm;
+
+    // add vseg in vmm list
+    list_add_last( &vmm->vsegs_root , &vseg->list );
+
+    return 0;
+}
+
+///////////////////////////////
+void vseg_detach( vmm_t  * vmm,
+                  vseg_t * vseg )
+{
+    // remove vseg from radix-tree
+    grdxt_remove( &vmm->grdxt , vseg->vpn_base );
+
+    // update vseg descriptor
+    vseg->vmm = NULL;
+
+    // remove vseg from vmm list
+    list_unlink( &vseg->list );
+}
+
+
Index: trunk/kernel/mm/vseg.h
===================================================================
--- trunk/kernel/mm/vseg.h	(revision 690)
+++ trunk/kernel/mm/vseg.h	(revision 1)
@@ -2,5 +2,7 @@
  * vseg.h - virtual segment (vseg) related operations
  *
- * Authors  Alain Greiner (2016,2017,2018,2019,2020)
+ * Authors   Ghassan Almaless (2008,2009,2010,2011, 2012)
+ *           Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -25,5 +27,6 @@
 #define _VSEG_H_
 
-#include <hal_kernel_types.h>
+#include <hal_types.h>
+#include <spinlock.h>
 #include <vfs.h>
 
@@ -32,105 +35,129 @@
 struct vmm_s;
 
-/*******************************************************************************************
- * This enum defines the vseg types.
- * Note : the KDATA and KDEV types are not used by the TSAR HAL, because the accesses
- *        to kernel data or kernel devices are done through the DATA extension address
- *        register, but these types are probably required by the I86 HAL [AG].
- ******************************************************************************************/
+/**********************************************************************************************
+ * This enum defines the vseg types
+ *********************************************************************************************/
 
-typedef enum
+enum
 {
-    VSEG_TYPE_CODE   = 1,          /*! executable user code     / private / localized     */
-    VSEG_TYPE_DATA   = 2,          /*! initialized user data    / public  / distributed   */
-    VSEG_TYPE_STACK  = 3,          /*! execution user stack     / private / localized     */
-    VSEG_TYPE_ANON   = 4,          /*! anonymous mmap           / public  / localized     */
-    VSEG_TYPE_FILE   = 5,          /*! file mmap                / public  / localized     */
-    VSEG_TYPE_REMOTE = 6,          /*! remote mmap              / public  / localized     */
+    VSEG_TYPE_CODE   = 0,          /*! executable code        / private / localized          */
+    VSEG_TYPE_DATA   = 1,          /*! initialized data       / public  / distributed        */
+    VSEG_TYPE_HEAP   = 2,          /*! standard malloc        / public  / distributed        */
+    VSEG_TYPE_STACK  = 3,          /*! execution stack        / private / localized          */
+    VSEG_TYPE_ANON   = 4,          /*! anonymous mmap         / public  / localized          */
+    VSEG_TYPE_FILE   = 5,          /*! file mmap              / public  / localized          */
+    VSEG_TYPE_REMOTE = 6,          /*! remote mmap            / public  / localized          */
+    VSEG_TYPE_KCODE  = 7,          /*! kernel code            / private / localized          */
+    VSEG_TYPE_KDATA  = 8,          /*! kernel data            / private / localized          */
+    VSEG_TYPE_KDEV   = 9,          /*! device segment         / public  / localized          */
 
-    VSEG_TYPE_KCODE  = 7,          /*! executable kernel code   / private / localized     */
-    VSEG_TYPE_KDATA  = 8,          /*! initialized kernel data  / private / localized     */
-    VSEG_TYPE_KDEV   = 9,          /*! kernel peripheral device / public  / localized     */
-}
-vseg_type_t;
+    VSEG_TYPES_NR    = 10,
+};
 
 
-/*******************************************************************************************
- * These masks define the vseg generic (hardware independent) flags.
- ******************************************************************************************/
+/**********************************************************************************************
+ * These masks define the vseg generic (hardware independant) flags.
+ *********************************************************************************************/
 
-#define VSEG_USER     0x0001       /*! user accessible                                    */
-#define VSEG_WRITE    0x0002       /*! writeable                                          */
-#define VSEG_EXEC     0x0004       /*! executable                                         */
-#define VSEG_CACHE    0x0008       /*! cachable                                           */
-#define VSEG_PRIVATE  0x0010       /*! should not be accessed from another cluster        */
-#define VSEG_DISTRIB  0x0020       /*! physically distributed on all clusters             */
+#define VSEG_USER     0x0001       /*! user accessible                                       */
+#define VSEG_WRITE    0x0002       /*! writeable                                             */
+#define VSEG_EXEC     0x0004       /*! executable                                            */
+#define VSEG_CACHE    0x0008       /*! cachable                                              */
+#define VSEG_PRIVATE  0x0010       /*! should not be accessed from another cluster           */
+#define VSEG_DISTRIB  0x0020       /*! physically distributed on all clusters                */
 
-/*******************************************************************************************
+/**********************************************************************************************
  * This structure defines a virtual segment descriptor.
- * The VSL contains only local vsegs, but is implemented as an xlist, because it can be
- * accessed by a thread running in a remote cluster.
- * The xlist field is also used to implement the zombi lists used by the MMAP allocator.
- ******************************************************************************************/
+ *********************************************************************************************/
 
 typedef struct vseg_s
 {
-    xlist_entry_t     xlist;        /*! all vsegs in same VSL                             */
-    struct vmm_s    * vmm;          /*! pointer on associated VM manager                  */
-    uint32_t          type;         /*! vseg type                                         */
-    intptr_t          min;          /*! segment min virtual address                       */
-    intptr_t          max;          /*! segment max virtual address (excluded)            */
-    vpn_t             vpn_base;     /*! first page of vseg                                */
-    vpn_t             vpn_size;     /*! number of pages occupied                          */
-    xptr_t            mapper_xp;    /*! xptr on remote mapper (for types CODE/DATA/FILE)  */
-    uint32_t          flags;        /*! vseg attributes                                   */
-    intptr_t          file_offset;  /*! vseg offset in file (for types CODE/DATA/FILE)    */
-    intptr_t          file_size;    /*! max segment size in mapper (for type CODE/DATA)   */
-    cxy_t             cxy;          /*! physical mapping (for non distributed vseg)       */ 
+	list_entry_t      list;         /*! all vsegs in same process / same free list if mmap   */
+	struct vmm_s    * vmm;          /*! pointer on associated VM manager                     */
+    uint32_t          type;         /*! vseg type                                            */
+	intptr_t          min;          /*! segment min virtual address                          */
+	intptr_t          max;          /*! segment max virtual address (excluded)               */
+	vpn_t             vpn_base;     /*! first page of vseg                                   */
+	vpn_t             vpn_size;     /*! numbre of pages occupied                             */
+	uint32_t          flags;        /*! vseg attributes                                      */
+	xptr_t            mapper;       /*! extended pointer on associated mapper                */
+	fdid_t            fdid;         /*! associated fdid for a VSEG_TYPE_FILE                 */
+	uint32_t          offset;       /*! offset in file for a VSEG_TYPE_FILE                  */
+    cxy_t             cxy;          /*! target cluster for physical mapping                  */
 }
 vseg_t;
 
-/*******************************************************************************************
- * This function returns a printable string for the vseg type. 
- *******************************************************************************************
- * @ vseg_type  : type of vseg
- * @ return pointer on string
- ******************************************************************************************/
-char * vseg_type_str( uint32_t vseg_type );
-
-/*******************************************************************************************
+/**********************************************************************************************
  * This function allocates physical memory for a new vseg descriptor from the local cluster
  * physical memory allocator.
- *******************************************************************************************
+ **********************************************************************************************
  * @ return pointer on allocated vseg descriptor if success / return NULL if failure.
- ******************************************************************************************/
-vseg_t * vseg_alloc( void );
+ *********************************************************************************************/
+vseg_t * vseg_alloc();
 
-/*******************************************************************************************
- * This function releases the physical memory allocated for a vseg descriptor 
- * to the local cluster physical memory allocator.
- *******************************************************************************************
+/**********************************************************************************************
+ * This function releases physical memory allocated for a vseg descriptor to the local cluster
+ * physical memory allocator.
+ **********************************************************************************************
  * @ vseg   : local pointer on released vseg descriptor.
- ******************************************************************************************/
+ *********************************************************************************************/
 void vseg_free( vseg_t * vseg );
 
-/*******************************************************************************************
- * This function initializes the "flags" field for a local <vseg> descriptor,
- * depending on the vseg <type>. 
- *******************************************************************************************
+/**********************************************************************************************
+ * This function initializes a local vseg descriptor, from the arguments values.
+ * It does NOT register the vseg in the local VMM.
+ **********************************************************************************************
  * @ vseg      : pointer on the vseg descriptor.
+ * @ base      : vseg base address.
+ * @ size      : vseg size (bytes).
+ * @ vpn_base  : first page index.
+ * @ vpn_size  : number of pages.
  * @ type      : vseg type.
- ******************************************************************************************/
-void vseg_init_flags( vseg_t      * vseg,
-	                  vseg_type_t   type );
+ * @ cxy       : target cluster for physical mapping.
+ * @ fdid      : file descriptor index if VSEG_TYPE_FILE.
+ * @ offset    : offset in file if VSEG_TYPE_FILE.
+ *********************************************************************************************/
+void vseg_init( vseg_t      * vseg,
+                intptr_t      base, 
+	            intptr_t      size, 
+                vpn_t         vpn_base,
+                vpn_t         vpn_size,
+	            uint32_t      type,
+                cxy_t         cxy,
+                fdid_t        fdid,
+	            uint32_t      offset );
 
-/*******************************************************************************************
+/**********************************************************************************************
  * This function initializes a local vseg descriptor from values contained in a reference
  * remote vseg descriptor. It does NOT register the vseg in the local VMM.
- *******************************************************************************************
+ **********************************************************************************************
  * @ vseg      : pointer on the vseg descriptor.
- * @ ref_xp    : extended pointer on the reference vseg descriptor.
- ******************************************************************************************/
+ * @ src       : extended pointer on the reference vseg descriptor.
+ *********************************************************************************************/
 void vseg_init_from_ref( vseg_t * vseg,
-                         xptr_t   ref_xp );
+                         xptr_t   ref );
+
+/**********************************************************************************************
+ * This function add a vseg descriptor in the set of vsegs controled by a given VMM,
+ * and update the vmm field in the vseg descriptor. 
+ * The lock protecting the vsegs list in VMM must be taken by the caller.
+ **********************************************************************************************
+ * @ vmm       : pointer on the VMM
+ * @ vseg      : pointer on the vseg descriptor
+ * @ returns 0 if success / returns ENOMEM if failure.
+ *********************************************************************************************/
+error_t vseg_attach( struct vmm_s  * vmm, 
+                     vseg_t        * vseg );
+
+/**********************************************************************************************
+ * This function removes a vseg descriptor from the set of vsegs controled by a given VMM,
+ * and update the vmm field in the vseg descriptor. No memory is released.
+ * The lock protecting the vsegs list in VMM must be taken by the caller.
+ **********************************************************************************************
+ * @ vmm       : pointer on the VMM
+ * @ vseg      : pointer on the vseg descriptor
+ *********************************************************************************************/
+void vseg_detach( struct vmm_s  * vmm, 
+                  vseg_t        * vseg );
 
 
Index: trunk/kernel/obj.tsar/almos-mk-tsar-mipsel.dump
===================================================================
--- trunk/kernel/obj.tsar/almos-mk-tsar-mipsel.dump	(revision 1)
+++ trunk/kernel/obj.tsar/almos-mk-tsar-mipsel.dump	(revision 1)
@@ -0,0 +1,58594 @@
+
+obj.tsar/almos-mk-tsar-mipsel.elf:     file format elf32-littlemips
+
+
+Disassembly of section .ktext:
+
+00000000 <__ktext_start>:
+	...
+
+00000180 <kentry>:
+     180:	401a6000 	mfc0	k0,c0_status
+     184:	335a0010 	andi	k0,k0,0x10
+     188:	1340000b 	beqz	k0,1b8 <kentry+0x38>
+     18c:	341a0003 	ori	k0,zero,0x3
+     190:	489a0800 	mtc2	k0,$1
+     194:	00000000 	sll	zero,zero,0x0
+     198:	401a2002 	mfc0	k0,$4,2
+     19c:	af5b008c 	sw	k1,140(k0)
+     1a0:	af5d007c 	sw	sp,124(k0)
+     1a4:	8f5d0000 	lw	sp,0(k0)
+     1a8:	341b000f 	ori	k1,zero,0xf
+     1ac:	af5b0094 	sw	k1,148(k0)
+     1b0:	08000083 	j	20c <kentry+0x8c>
+     1b4:	001ad825 	or	k1,zero,k0
+     1b8:	0340d024 	and	k0,k0,zero
+     1bc:	481ac000 	mfc2	k0,$24
+     1c0:	335a00ff 	andi	k0,k0,0xff
+     1c4:	401b7801 	mfc0	k1,$15,1
+     1c8:	337b0fff 	andi	k1,k1,0xfff
+     1cc:	001bd882 	srl	k1,k1,0x2
+     1d0:	489bc000 	mtc2	k1,$24
+     1d4:	481b0800 	mfc2	k1,$1
+     1d8:	337b000f 	andi	k1,k1,0xf
+     1dc:	001bda00 	sll	k1,k1,0x8
+     1e0:	035bd025 	or	k0,k0,k1
+     1e4:	341b0003 	ori	k1,zero,0x3
+     1e8:	489b0800 	mtc2	k1,$1
+     1ec:	27bbff68 	addiu	k1,sp,-152
+     1f0:	af7d007c 	sw	sp,124(k1)
+     1f4:	001aea02 	srl	sp,k0,0x8
+     1f8:	af7d0094 	sw	sp,148(k1)
+     1fc:	335a00ff 	andi	k0,k0,0xff
+     200:	af7a0090 	sw	k0,144(k1)
+     204:	0360e825 	or	sp,k1,zero
+     208:	401a2002 	mfc0	k0,$4,2
+     20c:	af610004 	sw	at,4(k1)
+     210:	af620008 	sw	v0,8(k1)
+     214:	af63000c 	sw	v1,12(k1)
+     218:	af640010 	sw	a0,16(k1)
+     21c:	af650014 	sw	a1,20(k1)
+     220:	af660018 	sw	a2,24(k1)
+     224:	af67001c 	sw	a3,28(k1)
+     228:	af680020 	sw	t0,32(k1)
+     22c:	af690024 	sw	t1,36(k1)
+     230:	af6a0028 	sw	t2,40(k1)
+     234:	af6b002c 	sw	t3,44(k1)
+     238:	af6c0030 	sw	t4,48(k1)
+     23c:	af6d0034 	sw	t5,52(k1)
+     240:	af6e0038 	sw	t6,56(k1)
+     244:	af6f003c 	sw	t7,60(k1)
+     248:	af780040 	sw	t8,64(k1)
+     24c:	af790044 	sw	t9,68(k1)
+     250:	af700048 	sw	s0,72(k1)
+     254:	af71004c 	sw	s1,76(k1)
+     258:	af720050 	sw	s2,80(k1)
+     25c:	af730054 	sw	s3,84(k1)
+     260:	af740058 	sw	s4,88(k1)
+     264:	af75005c 	sw	s5,92(k1)
+     268:	af760060 	sw	s6,96(k1)
+     26c:	af770064 	sw	s7,100(k1)
+     270:	af7e0068 	sw	s8,104(k1)
+     274:	af7c006c 	sw	gp,108(k1)
+     278:	af7f0070 	sw	ra,112(k1)
+     27c:	40107000 	mfc0	s0,c0_epc
+     280:	af700074 	sw	s0,116(k1)
+     284:	00007012 	mflo	t6
+     288:	af6e0084 	sw	t6,132(k1)
+     28c:	00007810 	mfhi	t7
+     290:	af6f0088 	sw	t7,136(k1)
+     294:	40126000 	mfc0	s2,c0_status
+     298:	af720080 	sw	s2,128(k1)
+     29c:	00121942 	srl	v1,s2,0x5
+     2a0:	00031940 	sll	v1,v1,0x5
+     2a4:	40836000 	mtc0	v1,c0_status
+     2a8:	40116800 	mfc0	s1,c0_cause
+     2ac:	af710078 	sw	s1,120(k1)
+     2b0:	3221003f 	andi	at,s1,0x3f
+     2b4:	40047801 	mfc0	a0,$15,1
+     2b8:	30840003 	andi	a0,a0,0x3
+     2bc:	40052002 	mfc0	a1,$4,2
+     2c0:	0c002032 	jal	80c8 <cpu_kentry>
+     2c4:	27bdfff8 	addiu	sp,sp,-8
+     2c8:	27bd0008 	addiu	sp,sp,8
+     2cc:	34080020 	ori	t0,zero,0x20
+     2d0:	1101000c 	beq	t0,at,304 <kentry+0x184>
+     2d4:	001b9825 	or	s3,zero,k1
+     2d8:	40057801 	mfc0	a1,$15,1
+     2dc:	30a501ff 	andi	a1,a1,0x1ff
+     2e0:	001a2025 	or	a0,zero,k0
+     2e4:	1020000e 	beqz	at,320 <kentry+0x1a0>
+     2e8:	001b3025 	or	a2,zero,k1
+     2ec:	3c010000 	lui	at,0x0
+     2f0:	242108f4 	addiu	at,at,2292
+     2f4:	0020f809 	jalr	at
+     2f8:	27bdfff4 	addiu	sp,sp,-12
+     2fc:	080000ce 	j	338 <kentry+0x1b8>
+     300:	27bd000c 	addiu	sp,sp,12
+     304:	3c0e0000 	lui	t6,0x0
+     308:	25ce0f78 	addiu	t6,t6,3960
+     30c:	27bdfffc 	addiu	sp,sp,-4
+     310:	01c0f809 	jalr	t6
+     314:	001b2025 	or	a0,zero,k1
+     318:	080000ce 	j	338 <kentry+0x1b8>
+     31c:	00029825 	or	s3,zero,v0
+     320:	3c010000 	lui	at,0x0
+     324:	24210ebc 	addiu	at,at,3772
+     328:	00113a82 	srl	a3,s1,0xa
+     32c:	27bdfff0 	addiu	sp,sp,-16
+     330:	0020f809 	jalr	at
+     334:	30e7003f 	andi	a3,a3,0x3f
+     338:	40047801 	mfc0	a0,$15,1
+     33c:	30840003 	andi	a0,a0,0x3
+     340:	40052002 	mfc0	a1,$4,2
+     344:	0c00203d 	jal	80f4 <cpu_kexit>
+     348:	27bdfff8 	addiu	sp,sp,-8
+     34c:	27bd0008 	addiu	sp,sp,8
+     350:	0013d825 	or	k1,zero,s3
+     354:	8f610004 	lw	at,4(k1)
+     358:	8f620008 	lw	v0,8(k1)
+     35c:	8f63000c 	lw	v1,12(k1)
+     360:	8f640010 	lw	a0,16(k1)
+     364:	8f650014 	lw	a1,20(k1)
+     368:	8f660018 	lw	a2,24(k1)
+     36c:	8f67001c 	lw	a3,28(k1)
+     370:	8f680020 	lw	t0,32(k1)
+     374:	8f690024 	lw	t1,36(k1)
+     378:	8f6a0028 	lw	t2,40(k1)
+     37c:	8f6b002c 	lw	t3,44(k1)
+     380:	8f6c0030 	lw	t4,48(k1)
+     384:	8f6d0034 	lw	t5,52(k1)
+     388:	8f6e0038 	lw	t6,56(k1)
+     38c:	8f6f003c 	lw	t7,60(k1)
+     390:	8f780040 	lw	t8,64(k1)
+     394:	8f790044 	lw	t9,68(k1)
+     398:	8f720050 	lw	s2,80(k1)
+     39c:	8f730054 	lw	s3,84(k1)
+     3a0:	8f740058 	lw	s4,88(k1)
+     3a4:	8f75005c 	lw	s5,92(k1)
+     3a8:	8f760060 	lw	s6,96(k1)
+     3ac:	8f770064 	lw	s7,100(k1)
+     3b0:	8f7e0068 	lw	s8,104(k1)
+     3b4:	8f7c006c 	lw	gp,108(k1)
+     3b8:	8f7f0070 	lw	ra,112(k1)
+     3bc:	8f700074 	lw	s0,116(k1)
+     3c0:	8f7d007c 	lw	sp,124(k1)
+     3c4:	8f710080 	lw	s1,128(k1)
+     3c8:	401a6000 	mfc0	k0,c0_status
+     3cc:	3231001f 	andi	s1,s1,0x1f
+     3d0:	40907000 	mtc0	s0,c0_epc
+     3d4:	0351d025 	or	k0,k0,s1
+     3d8:	8f700084 	lw	s0,132(k1)
+     3dc:	409a6000 	mtc0	k0,c0_status
+     3e0:	8f710088 	lw	s1,136(k1)
+     3e4:	02000013 	mtlo	s0
+     3e8:	02200011 	mthi	s1
+     3ec:	8f700048 	lw	s0,72(k1)
+     3f0:	8f71004c 	lw	s1,76(k1)
+     3f4:	8f7a0094 	lw	k0,148(k1)
+     3f8:	335a000c 	andi	k0,k0,0xc
+     3fc:	1340000f 	beqz	k0,43c <kentry+0x2bc>
+     400:	335a0008 	andi	k0,k0,0x8
+     404:	13400007 	beqz	k0,424 <kentry+0x2a4>
+     408:	8f7a0090 	lw	k0,144(k1)
+     40c:	8f7b008c 	lw	k1,140(k1)
+     410:	489ac000 	mtc2	k0,$24
+     414:	341a000f 	ori	k0,zero,0xf
+     418:	489a0800 	mtc2	k0,$1
+     41c:	08000115 	j	454 <kentry+0x2d4>
+     420:	00000000 	sll	zero,zero,0x0
+     424:	8f7b008c 	lw	k1,140(k1)
+     428:	489ac000 	mtc2	k0,$24
+     42c:	341a0007 	ori	k0,zero,0x7
+     430:	489a0800 	mtc2	k0,$1
+     434:	08000115 	j	454 <kentry+0x2d4>
+     438:	00000000 	sll	zero,zero,0x0
+     43c:	8f7a0090 	lw	k0,144(k1)
+     440:	8f7b008c 	lw	k1,140(k1)
+     444:	489ac000 	mtc2	k0,$24
+     448:	341a0003 	ori	k0,zero,0x3
+     44c:	489a0800 	mtc2	k0,$1
+	...
+     458:	42000018 	eret
+
+0000045c <kentry_load>:
+     45c:	489a0800 	mtc2	k0,$1
+	...
+     468:	42000018 	eret
+
+0000046c <cpu_copy_from_uspace>:
+     46c:	34080007 	ori	t0,zero,0x7
+     470:	34090003 	ori	t1,zero,0x3
+     474:	30a20003 	andi	v0,a1,0x3
+     478:	30870003 	andi	a3,a0,0x3
+     47c:	00471021 	addu	v0,v0,a3
+     480:	1440000f 	bnez	v0,4c0 <cpu_copy_from_uspace+0x54>
+     484:	00a61821 	addu	v1,a1,a2
+     488:	3403fffc 	ori	v1,zero,0xfffc
+     48c:	00c31824 	and	v1,a2,v1
+     490:	00a31821 	addu	v1,a1,v1
+     494:	10a30007 	beq	a1,v1,4b4 <cpu_copy_from_uspace+0x48>
+     498:	24840004 	addiu	a0,a0,4
+     49c:	48880800 	mtc2	t0,$1
+     4a0:	8ca70000 	lw	a3,0(a1)
+     4a4:	48890800 	mtc2	t1,$1
+     4a8:	24a50004 	addiu	a1,a1,4
+     4ac:	08000125 	j	494 <cpu_copy_from_uspace+0x28>
+     4b0:	ac87fffc 	sw	a3,-4(a0)
+     4b4:	30c30003 	andi	v1,a2,0x3
+     4b8:	2484fffc 	addiu	a0,a0,-4
+     4bc:	00651821 	addu	v1,v1,a1
+     4c0:	10a30007 	beq	a1,v1,4e0 <cpu_copy_from_uspace+0x74>
+     4c4:	24840001 	addiu	a0,a0,1
+     4c8:	48880800 	mtc2	t0,$1
+     4cc:	90a70000 	lbu	a3,0(a1)
+     4d0:	48890800 	mtc2	t1,$1
+     4d4:	24a50001 	addiu	a1,a1,1
+     4d8:	08000130 	j	4c0 <cpu_copy_from_uspace+0x54>
+     4dc:	a087ffff 	sb	a3,-1(a0)
+     4e0:	03e00008 	jr	ra
+     4e4:	00001025 	or	v0,zero,zero
+
+000004e8 <cpu_copy_to_uspace>:
+     4e8:	34080007 	ori	t0,zero,0x7
+     4ec:	34090003 	ori	t1,zero,0x3
+     4f0:	30a20003 	andi	v0,a1,0x3
+     4f4:	30870003 	andi	a3,a0,0x3
+     4f8:	00471021 	addu	v0,v0,a3
+     4fc:	1440000f 	bnez	v0,53c <cpu_copy_to_uspace+0x54>
+     500:	00a61821 	addu	v1,a1,a2
+     504:	3403fffc 	ori	v1,zero,0xfffc
+     508:	00c31824 	and	v1,a2,v1
+     50c:	00a31821 	addu	v1,a1,v1
+     510:	10a30007 	beq	a1,v1,530 <cpu_copy_to_uspace+0x48>
+     514:	24840004 	addiu	a0,a0,4
+     518:	8ca70000 	lw	a3,0(a1)
+     51c:	24a50004 	addiu	a1,a1,4
+     520:	48880800 	mtc2	t0,$1
+     524:	ac87fffc 	sw	a3,-4(a0)
+     528:	08000144 	j	510 <cpu_copy_to_uspace+0x28>
+     52c:	48890800 	mtc2	t1,$1
+     530:	30c30003 	andi	v1,a2,0x3
+     534:	2484fffc 	addiu	a0,a0,-4
+     538:	00651821 	addu	v1,v1,a1
+     53c:	10a30007 	beq	a1,v1,55c <cpu_copy_to_uspace+0x74>
+     540:	24840001 	addiu	a0,a0,1
+     544:	90a70000 	lbu	a3,0(a1)
+     548:	24a50001 	addiu	a1,a1,1
+     54c:	48880800 	mtc2	t0,$1
+     550:	a087ffff 	sb	a3,-1(a0)
+     554:	0800014f 	j	53c <cpu_copy_to_uspace+0x54>
+     558:	48890800 	mtc2	t1,$1
+     55c:	03e00008 	jr	ra
+     560:	00001025 	or	v0,zero,zero
+
+00000564 <cpu_uspace_strlen>:
+     564:	34080007 	ori	t0,zero,0x7
+     568:	34090003 	ori	t1,zero,0x3
+     56c:	10800007 	beqz	a0,58c <cpu_uspace_strlen+0x28>
+     570:	00041825 	or	v1,zero,a0
+     574:	48880800 	mtc2	t0,$1
+     578:	80820000 	lb	v0,0(a0)
+     57c:	10400003 	beqz	v0,58c <cpu_uspace_strlen+0x28>
+     580:	48890800 	mtc2	t1,$1
+     584:	0800015d 	j	574 <cpu_uspace_strlen+0x10>
+     588:	24840001 	addiu	a0,a0,1
+     58c:	00831823 	subu	v1,a0,v1
+     590:	aca30000 	sw	v1,0(a1)
+     594:	03e00008 	jr	ra
+     598:	00001025 	or	v0,zero,zero
+
+0000059c <cpu_uspace_error>:
+     59c:	03e00008 	jr	ra
+     5a0:	2402000e 	addiu	v0,zero,14
+
+000005a4 <cpu_context_init>:
+     5a4:	8ca20350 	lw	v0,848(a1)
+     5a8:	8ca7034c 	lw	a3,844(a1)
+     5ac:	2442fff8 	addiu	v0,v0,-8
+     5b0:	00e23821 	addu	a3,a3,v0
+     5b4:	2406fff8 	addiu	a2,zero,-8
+     5b8:	3c020004 	lui	v0,0x4
+     5bc:	00e63824 	and	a3,a3,a2
+     5c0:	aca70000 	sw	a3,0(a1)
+     5c4:	2443c960 	addiu	v1,v0,-13984
+     5c8:	88630003 	lwl	v1,3(v1)
+     5cc:	8caa0310 	lw	t2,784(a1)
+     5d0:	9843c960 	lwr	v1,-13984(v0)
+     5d4:	8cab0314 	lw	t3,788(a1)
+     5d8:	3063ffff 	andi	v1,v1,0xffff
+     5dc:	2c620101 	sltiu	v0,v1,257
+     5e0:	8ca9032c 	lw	t1,812(a1)
+     5e4:	14400003 	bnez	v0,5f4 <cpu_context_init+0x50>
+     5e8:	8ca80330 	lw	t0,816(a1)
+     5ec:	0800017b 	j	5ec <cpu_context_init+0x48>
+     5f0:	00000000 	sll	zero,zero,0x0
+     5f4:	00031100 	sll	v0,v1,0x4
+     5f8:	00031880 	sll	v1,v1,0x2
+     5fc:	00431823 	subu	v1,v0,v1
+     600:	3c020004 	lui	v0,0x4
+     604:	2442c9a0 	addiu	v0,v0,-13920
+     608:	00431021 	addu	v0,v0,v1
+     60c:	8c430000 	lw	v1,0(v0)
+     610:	3c025555 	lui	v0,0x5555
+     614:	34425555 	ori	v0,v0,0x5555
+     618:	1062fff4 	beq	v1,v0,5ec <cpu_context_init+0x48>
+     61c:	3402fc00 	ori	v0,zero,0xfc00
+     620:	8cad0184 	lw	t5,388(a1)
+     624:	aca30090 	sw	v1,144(a1)
+     628:	340cfc11 	ori	t4,zero,0xfc11
+     62c:	2403000f 	addiu	v1,zero,15
+     630:	018d100a 	movz	v0,t4,t5
+     634:	aca30094 	sw	v1,148(a1)
+     638:	a882002f 	swl	v0,47(a0)
+     63c:	b882002c 	swr	v0,44(a0)
+     640:	8ca20184 	lw	v0,388(a1)
+     644:	10400038 	beqz	v0,728 <cpu_context_init+0x184>
+     648:	2562fff8 	addiu	v0,t3,-8
+     64c:	00e03021 	addu	a2,a3,zero
+     650:	a8860023 	swl	a2,35(a0)
+     654:	b8860020 	swr	a2,32(a0)
+     658:	8ca30344 	lw	v1,836(a1)
+     65c:	24020001 	addiu	v0,zero,1
+     660:	a8830027 	swl	v1,39(a0)
+     664:	b8830024 	swr	v1,36(a0)
+     668:	8ca30318 	lw	v1,792(a1)
+     66c:	01283821 	addu	a3,t1,t0
+     670:	a883002b 	swl	v1,43(a0)
+     674:	b8830028 	swr	v1,40(a0)
+     678:	8ca30344 	lw	v1,836(a1)
+     67c:	a8830033 	swl	v1,51(a0)
+     680:	b8830030 	swr	v1,48(a0)
+     684:	8ca6031c 	lw	a2,796(a1)
+     688:	2403fff8 	addiu	v1,zero,-8
+     68c:	a886003f 	swl	a2,63(a0)
+     690:	b886003c 	swr	a2,60(a0)
+     694:	8ca60320 	lw	a2,800(a1)
+     698:	00e31824 	and	v1,a3,v1
+     69c:	a8860043 	swl	a2,67(a0)
+     6a0:	b8860040 	swr	a2,64(a0)
+     6a4:	8ca60324 	lw	a2,804(a1)
+     6a8:	24e7fff8 	addiu	a3,a3,-8
+     6ac:	a8860047 	swl	a2,71(a0)
+     6b0:	b8860044 	swr	a2,68(a0)
+     6b4:	a882003b 	swl	v0,59(a0)
+     6b8:	b8820038 	swr	v0,56(a0)
+     6bc:	8ca20180 	lw	v0,384(a1)
+     6c0:	00671824 	and	v1,v1,a3
+     6c4:	8c460258 	lw	a2,600(v0)
+     6c8:	24020003 	addiu	v0,zero,3
+     6cc:	00063042 	srl	a2,a2,0x1
+     6d0:	a8860037 	swl	a2,55(a0)
+     6d4:	b8860034 	swr	a2,52(a0)
+     6d8:	8ca60310 	lw	a2,784(a1)
+     6dc:	a886004b 	swl	a2,75(a0)
+     6e0:	b8860048 	swr	a2,72(a0)
+     6e4:	8ca60314 	lw	a2,788(a1)
+     6e8:	a886004f 	swl	a2,79(a0)
+     6ec:	b886004c 	swr	a2,76(a0)
+     6f0:	8ca60328 	lw	a2,808(a1)
+     6f4:	a8860053 	swl	a2,83(a0)
+     6f8:	b8860050 	swr	a2,80(a0)
+     6fc:	a8830057 	swl	v1,87(a0)
+     700:	b8830054 	swr	v1,84(a0)
+     704:	8ca30330 	lw	v1,816(a1)
+     708:	a883005b 	swl	v1,91(a0)
+     70c:	b8830058 	swr	v1,88(a0)
+     710:	8ca50184 	lw	a1,388(a1)
+     714:	2403000f 	addiu	v1,zero,15
+     718:	0065100a 	movz	v0,v1,a1
+     71c:	a882005f 	swl	v0,95(a0)
+     720:	03e00008 	jr	ra
+     724:	b882005c 	swr	v0,92(a0)
+     728:	01423821 	addu	a3,t2,v0
+     72c:	08000194 	j	650 <cpu_context_init+0xac>
+     730:	00e63024 	and	a2,a3,a2
+
+00000734 <cpu_context_destroy>:
+     734:	03e00008 	jr	ra
+     738:	00000000 	sll	zero,zero,0x0
+
+0000073c <cpu_context_set_tid>:
+     73c:	a8850033 	swl	a1,51(a0)
+     740:	03e00008 	jr	ra
+     744:	b8850030 	swr	a1,48(a0)
+
+00000748 <cpu_context_set_pmm>:
+     748:	8ca20008 	lw	v0,8(a1)
+     74c:	00021042 	srl	v0,v0,0x1
+     750:	a8820037 	swl	v0,55(a0)
+     754:	03e00008 	jr	ra
+     758:	b8820034 	swr	v0,52(a0)
+
+0000075c <cpu_context_set_stackaddr>:
+     75c:	a8850023 	swl	a1,35(a0)
+     760:	03e00008 	jr	ra
+     764:	b8850020 	swr	a1,32(a0)
+
+00000768 <cpu_context_get_stackaddr>:
+     768:	88820023 	lwl	v0,35(a0)
+     76c:	03e00008 	jr	ra
+     770:	98820020 	lwr	v0,32(a0)
+
+00000774 <cpu_context_dup_finlize>:
+     774:	27bdffe0 	addiu	sp,sp,-32
+     778:	afb10018 	sw	s1,24(sp)
+     77c:	afb00014 	sw	s0,20(sp)
+     780:	00a08821 	addu	s1,a1,zero
+     784:	00808021 	addu	s0,a0,zero
+     788:	afbf001c 	sw	ra,28(sp)
+     78c:	0c00c12b 	jal	304ac <memcpy>
+     790:	24060060 	addiu	a2,zero,96
+     794:	8a020033 	lwl	v0,51(s0)
+     798:	8a230023 	lwl	v1,35(s1)
+     79c:	9a020030 	lwr	v0,48(s0)
+     7a0:	9a230020 	lwr	v1,32(s1)
+     7a4:	2404e000 	addiu	a0,zero,-8192
+     7a8:	00442024 	and	a0,v0,a0
+     7ac:	30631fff 	andi	v1,v1,0x1fff
+     7b0:	00831825 	or	v1,a0,v1
+     7b4:	aa030023 	swl	v1,35(s0)
+     7b8:	ba030020 	swr	v1,32(s0)
+     7bc:	8a030033 	lwl	v1,51(s0)
+     7c0:	2405fff8 	addiu	a1,zero,-8
+     7c4:	9a030030 	lwr	v1,48(s0)
+     7c8:	24040003 	addiu	a0,zero,3
+     7cc:	34631fff 	ori	v1,v1,0x1fff
+     7d0:	00651824 	and	v1,v1,a1
+     7d4:	ac430000 	sw	v1,0(v0)
+     7d8:	aa04005f 	swl	a0,95(s0)
+     7dc:	ba04005c 	swr	a0,92(s0)
+     7e0:	8fbf001c 	lw	ra,28(sp)
+     7e4:	8fb10018 	lw	s1,24(sp)
+     7e8:	8fb00014 	lw	s0,20(sp)
+     7ec:	03e00008 	jr	ra
+     7f0:	27bd0020 	addiu	sp,sp,32
+
+000007f4 <cpu_except_get_entry>:
+     7f4:	2c82000e 	sltiu	v0,a0,14
+     7f8:	2403000d 	addiu	v1,zero,13
+     7fc:	0082180b 	movn	v1,a0,v0
+     800:	00031100 	sll	v0,v1,0x4
+     804:	00031880 	sll	v1,v1,0x2
+     808:	00431823 	subu	v1,v0,v1
+     80c:	3c020004 	lui	v0,0x4
+     810:	24429010 	addiu	v0,v0,-28656
+     814:	03e00008 	jr	ra
+     818:	00431021 	addu	v0,v0,v1
+
+0000081c <mmu_exception_handler>:
+     81c:	30c201e0 	andi	v0,a2,0x1e0
+     820:	14400008 	bnez	v0,844 <mmu_exception_handler+0x28>
+     824:	00000000 	sll	zero,zero,0x0
+     828:	8ca50080 	lw	a1,128(a1)
+     82c:	34c20100 	ori	v0,a2,0x100
+     830:	30a50010 	andi	a1,a1,0x10
+     834:	0045300a 	movz	a2,v0,a1
+     838:	00c02821 	addu	a1,a2,zero
+     83c:	08008155 	j	20554 <vmm_fault_handler>
+     840:	00e02021 	addu	a0,a3,zero
+     844:	03e00008 	jr	ra
+     848:	24020003 	addiu	v0,zero,3
+
+0000084c <CpU_exception_handler>:
+     84c:	8cc20078 	lw	v0,120(a2)
+     850:	27bdffe0 	addiu	sp,sp,-32
+     854:	00021702 	srl	v0,v0,0x1c
+     858:	30420003 	andi	v0,v0,0x3
+     85c:	24030001 	addiu	v1,zero,1
+     860:	afb00014 	sw	s0,20(sp)
+     864:	afbf001c 	sw	ra,28(sp)
+     868:	afb10018 	sw	s1,24(sp)
+     86c:	10430007 	beq	v0,v1,88c <CpU_exception_handler+0x40>
+     870:	00808021 	addu	s0,a0,zero
+     874:	8fbf001c 	lw	ra,28(sp)
+     878:	2402ffff 	addiu	v0,zero,-1
+     87c:	8fb10018 	lw	s1,24(sp)
+     880:	8fb00014 	lw	s0,20(sp)
+     884:	03e00008 	jr	ra
+     888:	27bd0020 	addiu	sp,sp,32
+     88c:	40022002 	mfc0	v0,$4,2
+     890:	8c510174 	lw	s1,372(v0)
+     894:	3c1b2000 	lui	k1,0x2000
+     898:	40016000 	mfc0	at,c0_status
+     89c:	003bd825 	or	k1,at,k1
+     8a0:	409b6000 	mtc0	k1,c0_status
+     8a4:	3c020001 	lui	v0,0x1
+     8a8:	02221021 	addu	v0,s1,v0
+     8ac:	8c448324 	lw	a0,-31964(v0)
+     8b0:	10800005 	beqz	a0,8c8 <CpU_exception_handler+0x7c>
+     8b4:	00000000 	sll	zero,zero,0x0
+     8b8:	10900003 	beq	a0,s0,8c8 <CpU_exception_handler+0x7c>
+     8bc:	00000000 	sll	zero,zero,0x0
+     8c0:	0c00cc61 	jal	33184 <cpu_fpu_context_save>
+     8c4:	00000000 	sll	zero,zero,0x0
+     8c8:	0c00cc82 	jal	33208 <cpu_fpu_context_restore>
+     8cc:	02002021 	addu	a0,s0,zero
+     8d0:	3c020001 	lui	v0,0x1
+     8d4:	8fbf001c 	lw	ra,28(sp)
+     8d8:	02228821 	addu	s1,s1,v0
+     8dc:	ae308324 	sw	s0,-31964(s1)
+     8e0:	00001021 	addu	v0,zero,zero
+     8e4:	8fb10018 	lw	s1,24(sp)
+     8e8:	8fb00014 	lw	s0,20(sp)
+     8ec:	03e00008 	jr	ra
+     8f0:	27bd0020 	addiu	sp,sp,32
+
+000008f4 <cpu_do_exception>:
+     8f4:	27bdff90 	addiu	sp,sp,-112
+     8f8:	afb30054 	sw	s3,84(sp)
+     8fc:	8cd30078 	lw	s3,120(a2)
+     900:	afb40058 	sw	s4,88(sp)
+     904:	00139882 	srl	s3,s3,0x2
+     908:	afb1004c 	sw	s1,76(sp)
+     90c:	afb00048 	sw	s0,72(sp)
+     910:	afbf006c 	sw	ra,108(sp)
+     914:	afbe0068 	sw	s8,104(sp)
+     918:	afb70064 	sw	s7,100(sp)
+     91c:	afb60060 	sw	s6,96(sp)
+     920:	afb5005c 	sw	s5,92(sp)
+     924:	afb20050 	sw	s2,80(sp)
+     928:	00c08021 	addu	s0,a2,zero
+     92c:	00808821 	addu	s1,a0,zero
+     930:	3273001f 	andi	s3,s3,0x1f
+     934:	00a0a021 	addu	s4,a1,zero
+     938:	48175800 	mfc2	s7,$11
+     93c:	48026800 	mfc2	v0,$13
+     940:	afa20030 	sw	v0,48(sp)
+     944:	48166000 	mfc2	s6,$12
+     948:	481e7000 	mfc2	s8,$14
+     94c:	24020007 	addiu	v0,zero,7
+     950:	12620146 	beq	s3,v0,e6c <cpu_do_exception+0x578>
+     954:	03c03821 	addu	a3,s8,zero
+     958:	2402000b 	addiu	v0,zero,11
+     95c:	1262013f 	beq	s3,v0,e5c <cpu_do_exception+0x568>
+     960:	00000000 	sll	zero,zero,0x0
+     964:	24020006 	addiu	v0,zero,6
+     968:	126200ff 	beq	s3,v0,d68 <cpu_do_exception+0x474>
+     96c:	24c20074 	addiu	v0,a2,116
+     970:	afa20034 	sw	v0,52(sp)
+     974:	3c020004 	lui	v0,0x4
+     978:	24449000 	addiu	a0,v0,-28672
+     97c:	0c0022e4 	jal	8b90 <distlock_lock>
+     980:	3c120004 	lui	s2,0x4
+     984:	8e449180 	lw	a0,-28288(s2)
+     988:	3c020003 	lui	v0,0x3
+     98c:	24050002 	addiu	a1,zero,2
+     990:	0c0009b0 	jal	26c0 <__fprintk>
+     994:	2446328c 	addiu	a2,v0,12940
+     998:	40024800 	mfc0	v0,c0_count
+     99c:	00000000 	sll	zero,zero,0x0
+     9a0:	3c060003 	lui	a2,0x3
+     9a4:	8e449180 	lw	a0,-28288(s2)
+     9a8:	02203821 	addu	a3,s1,zero
+     9ac:	24c632d4 	addiu	a2,a2,13012
+     9b0:	24050002 	addiu	a1,zero,2
+     9b4:	afa20014 	sw	v0,20(sp)
+     9b8:	0c0009b0 	jal	26c0 <__fprintk>
+     9bc:	afb40010 	sw	s4,16(sp)
+     9c0:	8e449180 	lw	a0,-28288(s2)
+     9c4:	3c060003 	lui	a2,0x3
+     9c8:	24c63308 	addiu	a2,a2,13064
+     9cc:	0c0009b0 	jal	26c0 <__fprintk>
+     9d0:	24050002 	addiu	a1,zero,2
+     9d4:	8fa20034 	lw	v0,52(sp)
+     9d8:	8e070078 	lw	a3,120(s0)
+     9dc:	8c490000 	lw	t1,0(v0)
+     9e0:	8e080080 	lw	t0,128(s0)
+     9e4:	8e03007c 	lw	v1,124(s0)
+     9e8:	8e22007c 	lw	v0,124(s1)
+     9ec:	8e449180 	lw	a0,-28288(s2)
+     9f0:	3c060003 	lui	a2,0x3
+     9f4:	24c6331c 	addiu	a2,a2,13084
+     9f8:	24050002 	addiu	a1,zero,2
+     9fc:	afa90010 	sw	t1,16(sp)
+     a00:	afa80014 	sw	t0,20(sp)
+     a04:	afa30018 	sw	v1,24(sp)
+     a08:	0c0009b0 	jal	26c0 <__fprintk>
+     a0c:	afa2001c 	sw	v0,28(sp)
+     a10:	8e070004 	lw	a3,4(s0)
+     a14:	8e090008 	lw	t1,8(s0)
+     a18:	8e08000c 	lw	t0,12(s0)
+     a1c:	8e030010 	lw	v1,16(s0)
+     a20:	8e020014 	lw	v0,20(s0)
+     a24:	8e449180 	lw	a0,-28288(s2)
+     a28:	3c060003 	lui	a2,0x3
+     a2c:	24c6334c 	addiu	a2,a2,13132
+     a30:	24050002 	addiu	a1,zero,2
+     a34:	afa90010 	sw	t1,16(sp)
+     a38:	afa80014 	sw	t0,20(sp)
+     a3c:	afa30018 	sw	v1,24(sp)
+     a40:	0c0009b0 	jal	26c0 <__fprintk>
+     a44:	afa2001c 	sw	v0,28(sp)
+     a48:	8e070018 	lw	a3,24(s0)
+     a4c:	8e09001c 	lw	t1,28(s0)
+     a50:	8e080020 	lw	t0,32(s0)
+     a54:	8e030024 	lw	v1,36(s0)
+     a58:	8e020028 	lw	v0,40(s0)
+     a5c:	8e449180 	lw	a0,-28288(s2)
+     a60:	3c060003 	lui	a2,0x3
+     a64:	24c63380 	addiu	a2,a2,13184
+     a68:	24050002 	addiu	a1,zero,2
+     a6c:	afa90010 	sw	t1,16(sp)
+     a70:	afa80014 	sw	t0,20(sp)
+     a74:	afa30018 	sw	v1,24(sp)
+     a78:	0c0009b0 	jal	26c0 <__fprintk>
+     a7c:	afa2001c 	sw	v0,28(sp)
+     a80:	8e07002c 	lw	a3,44(s0)
+     a84:	8e090030 	lw	t1,48(s0)
+     a88:	8e080034 	lw	t0,52(s0)
+     a8c:	8e030038 	lw	v1,56(s0)
+     a90:	8e02003c 	lw	v0,60(s0)
+     a94:	8e449180 	lw	a0,-28288(s2)
+     a98:	3c060003 	lui	a2,0x3
+     a9c:	24c633b4 	addiu	a2,a2,13236
+     aa0:	24050002 	addiu	a1,zero,2
+     aa4:	afa90010 	sw	t1,16(sp)
+     aa8:	afa80014 	sw	t0,20(sp)
+     aac:	afa30018 	sw	v1,24(sp)
+     ab0:	0c0009b0 	jal	26c0 <__fprintk>
+     ab4:	afa2001c 	sw	v0,28(sp)
+     ab8:	8e070040 	lw	a3,64(s0)
+     abc:	8e090044 	lw	t1,68(s0)
+     ac0:	8e08006c 	lw	t0,108(s0)
+     ac4:	8e030088 	lw	v1,136(s0)
+     ac8:	8e020084 	lw	v0,132(s0)
+     acc:	8e449180 	lw	a0,-28288(s2)
+     ad0:	3c060003 	lui	a2,0x3
+     ad4:	24c633e8 	addiu	a2,a2,13288
+     ad8:	24050002 	addiu	a1,zero,2
+     adc:	afa90010 	sw	t1,16(sp)
+     ae0:	afa80014 	sw	t0,20(sp)
+     ae4:	afa30018 	sw	v1,24(sp)
+     ae8:	0c0009b0 	jal	26c0 <__fprintk>
+     aec:	afa2001c 	sw	v0,28(sp)
+     af0:	8e070048 	lw	a3,72(s0)
+     af4:	8e09004c 	lw	t1,76(s0)
+     af8:	8e080050 	lw	t0,80(s0)
+     afc:	8e030054 	lw	v1,84(s0)
+     b00:	8e020058 	lw	v0,88(s0)
+     b04:	8e449180 	lw	a0,-28288(s2)
+     b08:	3c060003 	lui	a2,0x3
+     b0c:	24c6341c 	addiu	a2,a2,13340
+     b10:	24050002 	addiu	a1,zero,2
+     b14:	afa90010 	sw	t1,16(sp)
+     b18:	afa80014 	sw	t0,20(sp)
+     b1c:	afa30018 	sw	v1,24(sp)
+     b20:	0c0009b0 	jal	26c0 <__fprintk>
+     b24:	afa2001c 	sw	v0,28(sp)
+     b28:	8e07005c 	lw	a3,92(s0)
+     b2c:	8e090060 	lw	t1,96(s0)
+     b30:	8e080064 	lw	t0,100(s0)
+     b34:	8e030068 	lw	v1,104(s0)
+     b38:	8e020070 	lw	v0,112(s0)
+     b3c:	8e449180 	lw	a0,-28288(s2)
+     b40:	3c060003 	lui	a2,0x3
+     b44:	24c6344c 	addiu	a2,a2,13388
+     b48:	24050002 	addiu	a1,zero,2
+     b4c:	afa90010 	sw	t1,16(sp)
+     b50:	afa80014 	sw	t0,20(sp)
+     b54:	afa30018 	sw	v1,24(sp)
+     b58:	0c0009b0 	jal	26c0 <__fprintk>
+     b5c:	afa2001c 	sw	v0,28(sp)
+     b60:	8e459180 	lw	a1,-28288(s2)
+     b64:	8e23007c 	lw	v1,124(s1)
+     b68:	8e28008c 	lw	t0,140(s1)
+     b6c:	8e240130 	lw	a0,304(s1)
+     b70:	8e350000 	lw	s5,0(s1)
+     b74:	afa30040 	sw	v1,64(sp)
+     b78:	afa50038 	sw	a1,56(sp)
+     b7c:	0c00681c 	jal	1a070 <thread_get_state_name>
+     b80:	afa8003c 	sw	t0,60(sp)
+     b84:	8fa50038 	lw	a1,56(sp)
+     b88:	8e29013c 	lw	t1,316(s1)
+     b8c:	8fa8003c 	lw	t0,60(sp)
+     b90:	8fa30040 	lw	v1,64(sp)
+     b94:	3c060003 	lui	a2,0x3
+     b98:	24c63480 	addiu	a2,a2,13440
+     b9c:	00a02021 	addu	a0,a1,zero
+     ba0:	02203821 	addu	a3,s1,zero
+     ba4:	24050002 	addiu	a1,zero,2
+     ba8:	afa80018 	sw	t0,24(sp)
+     bac:	afa90020 	sw	t1,32(sp)
+     bb0:	afb50010 	sw	s5,16(sp)
+     bb4:	afa30014 	sw	v1,20(sp)
+     bb8:	0c0009b0 	jal	26c0 <__fprintk>
+     bbc:	afa2001c 	sw	v0,28(sp)
+     bc0:	8e230274 	lw	v1,628(s1)
+     bc4:	8e270270 	lw	a3,624(s1)
+     bc8:	8e240184 	lw	a0,388(s1)
+     bcc:	8e559180 	lw	s5,-28288(s2)
+     bd0:	afa30040 	sw	v1,64(sp)
+     bd4:	0c006898 	jal	1a260 <thread_get_attr_name>
+     bd8:	afa70038 	sw	a3,56(sp)
+     bdc:	8fa30040 	lw	v1,64(sp)
+     be0:	8e240174 	lw	a0,372(s1)
+     be4:	afa30010 	sw	v1,16(sp)
+     be8:	afa20014 	sw	v0,20(sp)
+     bec:	8c890004 	lw	t1,4(a0)
+     bf0:	8e2301e8 	lw	v1,488(s1)
+     bf4:	8e2201ec 	lw	v0,492(s1)
+     bf8:	8e28026c 	lw	t0,620(s1)
+     bfc:	8fa70038 	lw	a3,56(sp)
+     c00:	3c060003 	lui	a2,0x3
+     c04:	02a02021 	addu	a0,s5,zero
+     c08:	24c634c8 	addiu	a2,a2,13512
+     c0c:	24050002 	addiu	a1,zero,2
+     c10:	afa90018 	sw	t1,24(sp)
+     c14:	afa8001c 	sw	t0,28(sp)
+     c18:	afa30028 	sw	v1,40(sp)
+     c1c:	afa2002c 	sw	v0,44(sp)
+     c20:	afa30020 	sw	v1,32(sp)
+     c24:	0c0009b0 	jal	26c0 <__fprintk>
+     c28:	afa20024 	sw	v0,36(sp)
+     c2c:	40022002 	mfc0	v0,$4,2
+     c30:	24020006 	addiu	v0,zero,6
+     c34:	1262009a 	beq	s3,v0,ea0 <cpu_do_exception+0x5ac>
+     c38:	00000000 	sll	zero,zero,0x0
+     c3c:	0c000a09 	jal	2824 <mmu_except_get_entry>
+     c40:	02c02021 	addu	a0,s6,zero
+     c44:	0040a821 	addu	s5,v0,zero
+     c48:	8e020080 	lw	v0,128(s0)
+     c4c:	8e449180 	lw	a0,-28288(s2)
+     c50:	30420010 	andi	v0,v0,0x10
+     c54:	1440006a 	bnez	v0,e00 <cpu_do_exception+0x50c>
+     c58:	3c100004 	lui	s0,0x4
+     c5c:	3c060003 	lui	a2,0x3
+     c60:	3c070003 	lui	a3,0x3
+     c64:	24c63520 	addiu	a2,a2,13600
+     c68:	24e73534 	addiu	a3,a3,13620
+     c6c:	0c0009b0 	jal	26c0 <__fprintk>
+     c70:	24050002 	addiu	a1,zero,2
+     c74:	8ea20008 	lw	v0,8(s5)
+     c78:	8ea70004 	lw	a3,4(s5)
+     c7c:	afa20010 	sw	v0,16(sp)
+     c80:	8ea2000c 	lw	v0,12(s5)
+     c84:	8e049180 	lw	a0,-28288(s0)
+     c88:	afa20014 	sw	v0,20(sp)
+     c8c:	3c060003 	lui	a2,0x3
+     c90:	8fa20030 	lw	v0,48(sp)
+     c94:	24050002 	addiu	a1,zero,2
+     c98:	24c63538 	addiu	a2,a2,13624
+     c9c:	afa20018 	sw	v0,24(sp)
+     ca0:	afbe001c 	sw	s8,28(sp)
+     ca4:	afb70020 	sw	s7,32(sp)
+     ca8:	0c0009b0 	jal	26c0 <__fprintk>
+     cac:	afb60024 	sw	s6,36(sp)
+     cb0:	8fa40034 	lw	a0,52(sp)
+     cb4:	2e63000e 	sltiu	v1,s3,14
+     cb8:	2402000d 	addiu	v0,zero,13
+     cbc:	0263100b 	movn	v0,s3,v1
+     cc0:	8c830000 	lw	v1,0(a0)
+     cc4:	3c040000 	lui	a0,0x0
+     cc8:	00022900 	sll	a1,v0,0x4
+     ccc:	8c840000 	lw	a0,0(a0)
+     cd0:	00021080 	sll	v0,v0,0x2
+     cd4:	00a21023 	subu	v0,a1,v0
+     cd8:	3c050004 	lui	a1,0x4
+     cdc:	24a59010 	addiu	a1,a1,-28656
+     ce0:	0064202b 	sltu	a0,v1,a0
+     ce4:	10800067 	beqz	a0,e84 <cpu_do_exception+0x590>
+     ce8:	00a22821 	addu	a1,a1,v0
+     cec:	00004821 	addu	t1,zero,zero
+     cf0:	40024000 	mfc0	v0,c0_badvaddr
+     cf4:	8e230180 	lw	v1,384(s1)
+     cf8:	8ca80004 	lw	t0,4(a1)
+     cfc:	8c6705c4 	lw	a3,1476(v1)
+     d00:	3c060003 	lui	a2,0x3
+     d04:	8ca30008 	lw	v1,8(a1)
+     d08:	8e449180 	lw	a0,-28288(s2)
+     d0c:	24c635b0 	addiu	a2,a2,13744
+     d10:	24050002 	addiu	a1,zero,2
+     d14:	afb40010 	sw	s4,16(sp)
+     d18:	afa90014 	sw	t1,20(sp)
+     d1c:	afb30018 	sw	s3,24(sp)
+     d20:	afa8001c 	sw	t0,28(sp)
+     d24:	afa30020 	sw	v1,32(sp)
+     d28:	0c0009b0 	jal	26c0 <__fprintk>
+     d2c:	afa20024 	sw	v0,36(sp)
+     d30:	8e449180 	lw	a0,-28288(s2)
+     d34:	3c020003 	lui	v0,0x3
+     d38:	2446328c 	addiu	a2,v0,12940
+     d3c:	0c0009b0 	jal	26c0 <__fprintk>
+     d40:	24050002 	addiu	a1,zero,2
+     d44:	3c020004 	lui	v0,0x4
+     d48:	0c00225f 	jal	897c <distlock_unlock>
+     d4c:	24449000 	addiu	a0,v0,-28672
+     d50:	24020002 	addiu	v0,zero,2
+     d54:	ae220130 	sw	v0,304(s1)
+     d58:	0c0046e4 	jal	11b90 <sched_exit>
+     d5c:	02202021 	addu	a0,s1,zero
+     d60:	08000358 	j	d60 <cpu_do_exception+0x46c>
+     d64:	00000000 	sll	zero,zero,0x0
+     d68:	8fa70030 	lw	a3,48(sp)
+     d6c:	00a02021 	addu	a0,a1,zero
+     d70:	00c02821 	addu	a1,a2,zero
+     d74:	0c000207 	jal	81c <mmu_exception_handler>
+     d78:	02e03021 	addu	a2,s7,zero
+     d7c:	10400015 	beqz	v0,dd4 <cpu_do_exception+0x4e0>
+     d80:	8fbf006c 	lw	ra,108(sp)
+     d84:	24030001 	addiu	v1,zero,1
+     d88:	14430049 	bne	v0,v1,eb0 <cpu_do_exception+0x5bc>
+     d8c:	3c030000 	lui	v1,0x0
+     d90:	8e020074 	lw	v0,116(s0)
+     d94:	2463046c 	addiu	v1,v1,1132
+     d98:	26040074 	addiu	a0,s0,116
+     d9c:	0043182b 	sltu	v1,v0,v1
+     da0:	1460fef4 	bnez	v1,974 <cpu_do_exception+0x80>
+     da4:	afa40034 	sw	a0,52(sp)
+     da8:	3c030000 	lui	v1,0x0
+     dac:	246305a4 	addiu	v1,v1,1444
+     db0:	0062102b 	sltu	v0,v1,v0
+     db4:	1440fef0 	bnez	v0,978 <cpu_do_exception+0x84>
+     db8:	3c020004 	lui	v0,0x4
+     dbc:	24020003 	addiu	v0,zero,3
+     dc0:	ae020094 	sw	v0,148(s0)
+     dc4:	3c020000 	lui	v0,0x0
+     dc8:	2442059c 	addiu	v0,v0,1436
+     dcc:	ae020074 	sw	v0,116(s0)
+     dd0:	8fbf006c 	lw	ra,108(sp)
+     dd4:	8fbe0068 	lw	s8,104(sp)
+     dd8:	8fb70064 	lw	s7,100(sp)
+     ddc:	8fb60060 	lw	s6,96(sp)
+     de0:	8fb5005c 	lw	s5,92(sp)
+     de4:	8fb40058 	lw	s4,88(sp)
+     de8:	8fb30054 	lw	s3,84(sp)
+     dec:	8fb20050 	lw	s2,80(sp)
+     df0:	8fb1004c 	lw	s1,76(sp)
+     df4:	8fb00048 	lw	s0,72(sp)
+     df8:	03e00008 	jr	ra
+     dfc:	27bd0070 	addiu	sp,sp,112
+     e00:	3c060003 	lui	a2,0x3
+     e04:	3c070003 	lui	a3,0x3
+     e08:	24c63520 	addiu	a2,a2,13600
+     e0c:	24e73608 	addiu	a3,a3,13832
+     e10:	0c0009b0 	jal	26c0 <__fprintk>
+     e14:	24050002 	addiu	a1,zero,2
+     e18:	8ea20008 	lw	v0,8(s5)
+     e1c:	8ea70004 	lw	a3,4(s5)
+     e20:	afa20010 	sw	v0,16(sp)
+     e24:	8ea2000c 	lw	v0,12(s5)
+     e28:	8e049180 	lw	a0,-28288(s0)
+     e2c:	afa20014 	sw	v0,20(sp)
+     e30:	3c060003 	lui	a2,0x3
+     e34:	8fa20030 	lw	v0,48(sp)
+     e38:	24c63538 	addiu	a2,a2,13624
+     e3c:	24050002 	addiu	a1,zero,2
+     e40:	afa20018 	sw	v0,24(sp)
+     e44:	afbe001c 	sw	s8,28(sp)
+     e48:	afb70020 	sw	s7,32(sp)
+     e4c:	0c0009b0 	jal	26c0 <__fprintk>
+     e50:	afb60024 	sw	s6,36(sp)
+     e54:	0800034d 	j	d34 <cpu_do_exception+0x440>
+     e58:	8e449180 	lw	a0,-28288(s2)
+     e5c:	0c000213 	jal	84c <CpU_exception_handler>
+     e60:	00000000 	sll	zero,zero,0x0
+     e64:	0800035f 	j	d7c <cpu_do_exception+0x488>
+     e68:	00000000 	sll	zero,zero,0x0
+     e6c:	00a02021 	addu	a0,a1,zero
+     e70:	00c02821 	addu	a1,a2,zero
+     e74:	0c000207 	jal	81c <mmu_exception_handler>
+     e78:	02c03021 	addu	a2,s6,zero
+     e7c:	0800035f 	j	d7c <cpu_do_exception+0x488>
+     e80:	00000000 	sll	zero,zero,0x0
+     e84:	3c020004 	lui	v0,0x4
+     e88:	8c429000 	lw	v0,-28672(v0)
+     e8c:	0043102b 	sltu	v0,v0,v1
+     e90:	1440ff97 	bnez	v0,cf0 <cpu_do_exception+0x3fc>
+     e94:	00004821 	addu	t1,zero,zero
+     e98:	0800033c 	j	cf0 <cpu_do_exception+0x3fc>
+     e9c:	8c690000 	lw	t1,0(v1)
+     ea0:	0c000a09 	jal	2824 <mmu_except_get_entry>
+     ea4:	02e02021 	addu	a0,s7,zero
+     ea8:	08000312 	j	c48 <cpu_do_exception+0x354>
+     eac:	0040a821 	addu	s5,v0,zero
+     eb0:	26040074 	addiu	a0,s0,116
+     eb4:	0800025d 	j	974 <cpu_do_exception+0x80>
+     eb8:	afa40034 	sw	a0,52(sp)
+
+00000ebc <cpu_do_interrupt>:
+     ebc:	8c820214 	lw	v0,532(a0)
+     ec0:	27bdffc8 	addiu	sp,sp,-56
+     ec4:	afb10028 	sw	s1,40(sp)
+     ec8:	afb00024 	sw	s0,36(sp)
+     ecc:	afbf0034 	sw	ra,52(sp)
+     ed0:	afb30030 	sw	s3,48(sp)
+     ed4:	afb2002c 	sw	s2,44(sp)
+     ed8:	00808821 	addu	s1,a0,zero
+     edc:	14400018 	bnez	v0,f40 <cpu_do_interrupt+0x84>
+     ee0:	00e08021 	addu	s0,a3,zero
+     ee4:	1200000f 	beqz	s0,f24 <cpu_do_interrupt+0x68>
+     ee8:	00009021 	addu	s2,zero,zero
+     eec:	080003c1 	j	f04 <cpu_do_interrupt+0x48>
+     ef0:	24130006 	addiu	s3,zero,6
+     ef4:	1200000b 	beqz	s0,f24 <cpu_do_interrupt+0x68>
+     ef8:	26520001 	addiu	s2,s2,1
+     efc:	1253000a 	beq	s2,s3,f28 <cpu_do_interrupt+0x6c>
+     f00:	8fbf0034 	lw	ra,52(sp)
+     f04:	32020001 	andi	v0,s0,0x1
+     f08:	1040fffa 	beqz	v0,ef4 <cpu_do_interrupt+0x38>
+     f0c:	00108042 	srl	s0,s0,0x1
+     f10:	02402821 	addu	a1,s2,zero
+     f14:	0c002780 	jal	9e00 <do_interrupt>
+     f18:	02202021 	addu	a0,s1,zero
+     f1c:	1600fff7 	bnez	s0,efc <cpu_do_interrupt+0x40>
+     f20:	26520001 	addiu	s2,s2,1
+     f24:	8fbf0034 	lw	ra,52(sp)
+     f28:	8fb30030 	lw	s3,48(sp)
+     f2c:	8fb2002c 	lw	s2,44(sp)
+     f30:	8fb10028 	lw	s1,40(sp)
+     f34:	8fb00024 	lw	s0,36(sp)
+     f38:	03e00008 	jr	ra
+     f3c:	27bd0038 	addiu	sp,sp,56
+     f40:	3c020004 	lui	v0,0x4
+     f44:	8cc30074 	lw	v1,116(a2)
+     f48:	8c449180 	lw	a0,-28288(v0)
+     f4c:	8cc20070 	lw	v0,112(a2)
+     f50:	3c060003 	lui	a2,0x3
+     f54:	00a03821 	addu	a3,a1,zero
+     f58:	24c637a0 	addiu	a2,a2,14240
+     f5c:	24050002 	addiu	a1,zero,2
+     f60:	afa30014 	sw	v1,20(sp)
+     f64:	afa20018 	sw	v0,24(sp)
+     f68:	0c0009b0 	jal	26c0 <__fprintk>
+     f6c:	afb10010 	sw	s1,16(sp)
+     f70:	080003b9 	j	ee4 <cpu_do_interrupt+0x28>
+     f74:	00000000 	sll	zero,zero,0x0
+
+00000f78 <cpu_do_syscall>:
+     f78:	8c820008 	lw	v0,8(a0)
+     f7c:	27bdffd8 	addiu	sp,sp,-40
+     f80:	2403001f 	addiu	v1,zero,31
+     f84:	afbf0024 	sw	ra,36(sp)
+     f88:	10430014 	beq	v0,v1,fdc <cpu_do_syscall+0x64>
+     f8c:	afb00020 	sw	s0,32(sp)
+     f90:	8c830010 	lw	v1,16(a0)
+     f94:	8c87001c 	lw	a3,28(a0)
+     f98:	8c850014 	lw	a1,20(a0)
+     f9c:	8c860018 	lw	a2,24(a0)
+     fa0:	00602021 	addu	a0,v1,zero
+     fa4:	0c0027f7 	jal	9fdc <do_syscall>
+     fa8:	afa20010 	sw	v0,16(sp)
+     fac:	00402821 	addu	a1,v0,zero
+     fb0:	40022002 	mfc0	v0,$4,2
+     fb4:	8c430074 	lw	v1,116(v0)
+     fb8:	8c440258 	lw	a0,600(v0)
+     fbc:	8fbf0024 	lw	ra,36(sp)
+     fc0:	24630004 	addiu	v1,v1,4
+     fc4:	8fb00020 	lw	s0,32(sp)
+     fc8:	ac450008 	sw	a1,8(v0)
+     fcc:	ac44000c 	sw	a0,12(v0)
+     fd0:	ac430074 	sw	v1,116(v0)
+     fd4:	03e00008 	jr	ra
+     fd8:	27bd0028 	addiu	sp,sp,40
+     fdc:	40102002 	mfc0	s0,$4,2
+     fe0:	8e0501dc 	lw	a1,476(s0)
+     fe4:	02002021 	addu	a0,s0,zero
+     fe8:	24a5fee8 	addiu	a1,a1,-280
+     fec:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+     ff0:	24060118 	addiu	a2,zero,280
+     ff4:	14400018 	bnez	v0,1058 <cpu_do_syscall+0xe0>
+     ff8:	00000000 	sll	zero,zero,0x0
+     ffc:	40022002 	mfc0	v0,$4,2
+    1000:	8c430174 	lw	v1,372(v0)
+    1004:	3c020001 	lui	v0,0x1
+    1008:	00621821 	addu	v1,v1,v0
+    100c:	8c638324 	lw	v1,-31964(v1)
+    1010:	1203002b 	beq	s0,v1,10c0 <cpu_do_syscall+0x148>
+    1014:	00000000 	sll	zero,zero,0x0
+    1018:	8e060134 	lw	a2,308(s0)
+    101c:	8e050074 	lw	a1,116(s0)
+    1020:	8e03025c 	lw	v1,604(s0)
+    1024:	8e020258 	lw	v0,600(s0)
+    1028:	2404f7ff 	addiu	a0,zero,-2049
+    102c:	00c42024 	and	a0,a2,a0
+    1030:	24a50004 	addiu	a1,a1,4
+    1034:	ae050074 	sw	a1,116(s0)
+    1038:	ae040134 	sw	a0,308(s0)
+    103c:	ae030008 	sw	v1,8(s0)
+    1040:	ae02000c 	sw	v0,12(s0)
+    1044:	40022002 	mfc0	v0,$4,2
+    1048:	8fbf0024 	lw	ra,36(sp)
+    104c:	8fb00020 	lw	s0,32(sp)
+    1050:	03e00008 	jr	ra
+    1054:	27bd0028 	addiu	sp,sp,40
+    1058:	40037801 	mfc0	v1,$15,1
+    105c:	3c020004 	lui	v0,0x4
+    1060:	30630003 	andi	v1,v1,0x3
+    1064:	00031880 	sll	v1,v1,0x2
+    1068:	2442c950 	addiu	v0,v0,-14000
+    106c:	00621021 	addu	v0,v1,v0
+    1070:	8c420000 	lw	v0,0(v0)
+    1074:	3c030004 	lui	v1,0x4
+    1078:	afa20010 	sw	v0,16(sp)
+    107c:	8e020180 	lw	v0,384(s0)
+    1080:	8c649100 	lw	a0,-28416(v1)
+    1084:	8c4205c4 	lw	v0,1476(v0)
+    1088:	3c060003 	lui	a2,0x3
+    108c:	afa20014 	sw	v0,20(sp)
+    1090:	8e0202f8 	lw	v0,760(s0)
+    1094:	3c070003 	lui	a3,0x3
+    1098:	24c637c0 	addiu	a2,a2,14272
+    109c:	24e737fc 	addiu	a3,a3,14332
+    10a0:	00002821 	addu	a1,zero,zero
+    10a4:	afa20018 	sw	v0,24(sp)
+    10a8:	0c0009b0 	jal	26c0 <__fprintk>
+    10ac:	afb0001c 	sw	s0,28(sp)
+    10b0:	0c005e49 	jal	17924 <sys_thread_exit>
+    10b4:	24040004 	addiu	a0,zero,4
+    10b8:	080003ff 	j	ffc <cpu_do_syscall+0x84>
+    10bc:	00000000 	sll	zero,zero,0x0
+    10c0:	40032002 	mfc0	v1,$4,2
+    10c4:	8c630174 	lw	v1,372(v1)
+    10c8:	00621021 	addu	v0,v1,v0
+    10cc:	ac408324 	sw	zero,-31964(v0)
+    10d0:	3c1bdfff 	lui	k1,0xdfff
+    10d4:	377bffff 	ori	k1,k1,0xffff
+    10d8:	40016000 	mfc0	at,c0_status
+    10dc:	003bd824 	and	k1,at,k1
+    10e0:	409b6000 	mtc0	k1,c0_status
+    10e4:	08000407 	j	101c <cpu_do_syscall+0xa4>
+    10e8:	8e060134 	lw	a2,308(s0)
+
+000010ec <cpu_uzone_init>:
+    10ec:	03e00008 	jr	ra
+    10f0:	00000000 	sll	zero,zero,0x0
+
+000010f4 <cpu_uzone_destroy>:
+    10f4:	03e00008 	jr	ra
+    10f8:	00000000 	sll	zero,zero,0x0
+
+000010fc <cpu_uzone_getattr>:
+    10fc:	8883008f 	lwl	v1,143(a0)
+    1100:	00001021 	addu	v0,zero,zero
+    1104:	9883008c 	lwr	v1,140(a0)
+    1108:	aca30004 	sw	v1,4(a1)
+    110c:	8883007f 	lwl	v1,127(a0)
+    1110:	9883007c 	lwr	v1,124(a0)
+    1114:	03e00008 	jr	ra
+    1118:	aca30000 	sw	v1,0(a1)
+
+0000111c <cpu_uzone_setattr>:
+    111c:	8ca20004 	lw	v0,4(a1)
+    1120:	a882008f 	swl	v0,143(a0)
+    1124:	b882008c 	swr	v0,140(a0)
+    1128:	8ca30000 	lw	v1,0(a1)
+    112c:	00001021 	addu	v0,zero,zero
+    1130:	a883007f 	swl	v1,127(a0)
+    1134:	03e00008 	jr	ra
+    1138:	b883007c 	swr	v1,124(a0)
+
+0000113c <cpu_context_set_sigreturn>:
+    113c:	a8850053 	swl	a1,83(a0)
+    1140:	03e00008 	jr	ra
+    1144:	b8850050 	swr	a1,80(a0)
+
+00001148 <cpu_signal_notify>:
+    1148:	27bdffc8 	addiu	sp,sp,-56
+    114c:	afb3002c 	sw	s3,44(sp)
+    1150:	afb20028 	sw	s2,40(sp)
+    1154:	afb10024 	sw	s1,36(sp)
+    1158:	afbf0034 	sw	ra,52(sp)
+    115c:	afb40030 	sw	s4,48(sp)
+    1160:	afb00020 	sw	s0,32(sp)
+    1164:	00809821 	addu	s3,a0,zero
+    1168:	00a09021 	addu	s2,a1,zero
+    116c:	00c08821 	addu	s1,a2,zero
+    1170:	40022002 	mfc0	v0,$4,2
+    1174:	8c540174 	lw	s4,372(v0)
+    1178:	3c020001 	lui	v0,0x1
+    117c:	02821021 	addu	v0,s4,v0
+    1180:	8c448324 	lw	a0,-31964(v0)
+    1184:	10800003 	beqz	a0,1194 <cpu_signal_notify+0x4c>
+    1188:	00000000 	sll	zero,zero,0x0
+    118c:	0c00cc61 	jal	33184 <cpu_fpu_context_save>
+    1190:	00000000 	sll	zero,zero,0x0
+    1194:	8e7001dc 	lw	s0,476(s3)
+    1198:	3c020001 	lui	v0,0x1
+    119c:	0282a021 	addu	s4,s4,v0
+    11a0:	2610fee8 	addiu	s0,s0,-280
+    11a4:	ae938324 	sw	s3,-31964(s4)
+    11a8:	02002021 	addu	a0,s0,zero
+    11ac:	02602821 	addu	a1,s3,zero
+    11b0:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+    11b4:	24060118 	addiu	a2,zero,280
+    11b8:	14400018 	bnez	v0,121c <cpu_signal_notify+0xd4>
+    11bc:	3c052000 	lui	a1,0x2000
+    11c0:	8e6201d8 	lw	v0,472(s3)
+    11c4:	8e64008c 	lw	a0,140(s3)
+    11c8:	8e630344 	lw	v1,836(s3)
+    11cc:	ae6201c4 	sw	v0,452(s3)
+    11d0:	34a5fc11 	ori	a1,a1,0xfc11
+    11d4:	24020001 	addiu	v0,zero,1
+    11d8:	ae7001a8 	sw	s0,424(s3)
+    11dc:	ae6401ac 	sw	a0,428(s3)
+    11e0:	ae7201b0 	sw	s2,432(s3)
+    11e4:	ae7101c8 	sw	s1,456(s3)
+    11e8:	ae6501b4 	sw	a1,436(s3)
+    11ec:	ae6301b8 	sw	v1,440(s3)
+    11f0:	ae6201c0 	sw	v0,448(s3)
+    11f4:	ae6001cc 	sw	zero,460(s3)
+    11f8:	26640188 	addiu	a0,s3,392
+    11fc:	8fbf0034 	lw	ra,52(sp)
+    1200:	8fb40030 	lw	s4,48(sp)
+    1204:	8fb3002c 	lw	s3,44(sp)
+    1208:	8fb20028 	lw	s2,40(sp)
+    120c:	8fb10024 	lw	s1,36(sp)
+    1210:	8fb00020 	lw	s0,32(sp)
+    1214:	0800cc17 	j	3305c <cpu_context_load>
+    1218:	27bd0038 	addiu	sp,sp,56
+    121c:	3c020004 	lui	v0,0x4
+    1220:	8c449100 	lw	a0,-28416(v0)
+    1224:	3c060003 	lui	a2,0x3
+    1228:	3c070003 	lui	a3,0x3
+    122c:	24c6380c 	addiu	a2,a2,14348
+    1230:	24e73850 	addiu	a3,a3,14416
+    1234:	00002821 	addu	a1,zero,zero
+    1238:	afb10010 	sw	s1,16(sp)
+    123c:	afb20014 	sw	s2,20(sp)
+    1240:	0c0009b0 	jal	26c0 <__fprintk>
+    1244:	afb00018 	sw	s0,24(sp)
+    1248:	8fbf0034 	lw	ra,52(sp)
+    124c:	8fb40030 	lw	s4,48(sp)
+    1250:	8fb3002c 	lw	s3,44(sp)
+    1254:	8fb20028 	lw	s2,40(sp)
+    1258:	8fb10024 	lw	s1,36(sp)
+    125c:	8fb00020 	lw	s0,32(sp)
+    1260:	03e00008 	jr	ra
+    1264:	27bd0038 	addiu	sp,sp,56
+
+00001268 <cpu_uzone_dup>:
+    1268:	0800c12b 	j	304ac <memcpy>
+    126c:	24060118 	addiu	a2,zero,280
+
+00001270 <arch_cpu_set_irq_entry>:
+    1270:	24a50002 	addiu	a1,a1,2
+    1274:	00052880 	sll	a1,a1,0x2
+    1278:	00852021 	addu	a0,a0,a1
+    127c:	ac860000 	sw	a2,0(a0)
+    1280:	03e00008 	jr	ra
+    1284:	00001021 	addu	v0,zero,zero
+
+00001288 <arch_cpu_get_irq_entry>:
+    1288:	24a50002 	addiu	a1,a1,2
+    128c:	00052880 	sll	a1,a1,0x2
+    1290:	00852021 	addu	a0,a0,a1
+    1294:	8c830000 	lw	v1,0(a0)
+    1298:	00001021 	addu	v0,zero,zero
+    129c:	03e00008 	jr	ra
+    12a0:	acc30000 	sw	v1,0(a2)
+
+000012a4 <arch_cpu_send_ipi>:
+    12a4:	27bdffe0 	addiu	sp,sp,-32
+    12a8:	afbf001c 	sw	ra,28(sp)
+    12ac:	afa40010 	sw	a0,16(sp)
+    12b0:	afa50014 	sw	a1,20(sp)
+    12b4:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    12b8:	afb00018 	sw	s0,24(sp)
+    12bc:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    12c0:	00408021 	addu	s0,v0,zero
+    12c4:	8fa40010 	lw	a0,16(sp)
+    12c8:	8fa50014 	lw	a1,20(sp)
+    12cc:	0090001b 	divu	zero,a0,s0
+    12d0:	020001f4 	teq	s0,zero,0x7
+    12d4:	00a03021 	addu	a2,a1,zero
+    12d8:	8fbf001c 	lw	ra,28(sp)
+    12dc:	8fb00018 	lw	s0,24(sp)
+    12e0:	27bd0020 	addiu	sp,sp,32
+    12e4:	00001812 	mflo	v1
+    12e8:	0082001b 	divu	zero,a0,v0
+    12ec:	004001f4 	teq	v0,zero,0x7
+    12f0:	00031100 	sll	v0,v1,0x4
+    12f4:	00031880 	sll	v1,v1,0x2
+    12f8:	00431823 	subu	v1,v0,v1
+    12fc:	3c020004 	lui	v0,0x4
+    1300:	2442c9a0 	addiu	v0,v0,-13920
+    1304:	00431821 	addu	v1,v0,v1
+    1308:	8c640004 	lw	a0,4(v1)
+    130c:	080017c7 	j	5f1c <soclib_xicu_ipi_send>
+    1310:	00002810 	mfhi	a1
+
+00001314 <arch_barrier_destroy>:
+    1314:	8c820400 	lw	v0,1024(a0)
+    1318:	00021900 	sll	v1,v0,0x4
+    131c:	00021080 	sll	v0,v0,0x2
+    1320:	00621023 	subu	v0,v1,v0
+    1324:	3c030004 	lui	v1,0x4
+    1328:	2463c9a0 	addiu	v1,v1,-13920
+    132c:	00621021 	addu	v0,v1,v0
+    1330:	08001843 	j	610c <soclib_xicu_barrier_destroy>
+    1334:	8c440004 	lw	a0,4(v0)
+
+00001338 <arch_barrier_wait>:
+    1338:	8c820400 	lw	v0,1024(a0)
+    133c:	00021900 	sll	v1,v0,0x4
+    1340:	00021080 	sll	v0,v0,0x2
+    1344:	00621023 	subu	v0,v1,v0
+    1348:	3c030004 	lui	v1,0x4
+    134c:	2463c9a0 	addiu	v1,v1,-13920
+    1350:	00621021 	addu	v0,v1,v0
+    1354:	080017e0 	j	5f80 <soclib_xicu_barrier_wait>
+    1358:	8c440004 	lw	a0,4(v0)
+
+0000135c <arch_barrier_init>:
+    135c:	8c820400 	lw	v0,1024(a0)
+    1360:	00021900 	sll	v1,v0,0x4
+    1364:	00021080 	sll	v0,v0,0x2
+    1368:	00621023 	subu	v0,v1,v0
+    136c:	3c030004 	lui	v1,0x4
+    1370:	2463c9a0 	addiu	v1,v1,-13920
+    1374:	00621021 	addu	v0,v1,v0
+    1378:	08001866 	j	6198 <soclib_xicu_barrier_init>
+    137c:	8c440004 	lw	a0,4(v0)
+
+00001380 <arch_set_power_state>:
+    1380:	27bdffe0 	addiu	sp,sp,-32
+    1384:	14a00006 	bnez	a1,13a0 <arch_set_power_state+0x20>
+    1388:	afbf001c 	sw	ra,28(sp)
+    138c:	42000020 	wait
+    1390:	8fbf001c 	lw	ra,28(sp)
+    1394:	00001021 	addu	v0,zero,zero
+    1398:	03e00008 	jr	ra
+    139c:	27bd0020 	addiu	sp,sp,32
+    13a0:	2ca20003 	sltiu	v0,a1,3
+    13a4:	14400012 	bnez	v0,13f0 <arch_set_power_state+0x70>
+    13a8:	3c020001 	lui	v0,0x1
+    13ac:	8c830000 	lw	v1,0(a0)
+    13b0:	00821021 	addu	v0,a0,v0
+    13b4:	8c428328 	lw	v0,-31960(v0)
+    13b8:	afa30010 	sw	v1,16(sp)
+    13bc:	3c030004 	lui	v1,0x4
+    13c0:	8c420400 	lw	v0,1024(v0)
+    13c4:	8c649100 	lw	a0,-28416(v1)
+    13c8:	3c060003 	lui	a2,0x3
+    13cc:	00a03821 	addu	a3,a1,zero
+    13d0:	24c638b4 	addiu	a2,a2,14516
+    13d4:	00002821 	addu	a1,zero,zero
+    13d8:	0c0009b0 	jal	26c0 <__fprintk>
+    13dc:	afa20014 	sw	v0,20(sp)
+    13e0:	8fbf001c 	lw	ra,28(sp)
+    13e4:	24020016 	addiu	v0,zero,22
+    13e8:	03e00008 	jr	ra
+    13ec:	27bd0020 	addiu	sp,sp,32
+    13f0:	8c830000 	lw	v1,0(a0)
+    13f4:	00821021 	addu	v0,a0,v0
+    13f8:	8c428328 	lw	v0,-31960(v0)
+    13fc:	afa30010 	sw	v1,16(sp)
+    1400:	3c030004 	lui	v1,0x4
+    1404:	8c420400 	lw	v0,1024(v0)
+    1408:	8c649100 	lw	a0,-28416(v1)
+    140c:	3c060003 	lui	a2,0x3
+    1410:	00a03821 	addu	a3,a1,zero
+    1414:	24c63864 	addiu	a2,a2,14436
+    1418:	00002821 	addu	a1,zero,zero
+    141c:	0c0009b0 	jal	26c0 <__fprintk>
+    1420:	afa20014 	sw	v0,20(sp)
+    1424:	8fbf001c 	lw	ra,28(sp)
+    1428:	00001021 	addu	v0,zero,zero
+    142c:	03e00008 	jr	ra
+    1430:	27bd0020 	addiu	sp,sp,32
+    1434:	27bdffd8 	addiu	sp,sp,-40
+    1438:	afb00018 	sw	s0,24(sp)
+    143c:	afbf0024 	sw	ra,36(sp)
+    1440:	8c900008 	lw	s0,8(a0)
+    1444:	afb20020 	sw	s2,32(sp)
+    1448:	afb1001c 	sw	s1,28(sp)
+    144c:	40027801 	mfc0	v0,$15,1
+    1450:	3c120004 	lui	s2,0x4
+    1454:	30420003 	andi	v0,v0,0x3
+    1458:	2652c950 	addiu	s2,s2,-14000
+    145c:	00021080 	sll	v0,v0,0x2
+    1460:	3c110004 	lui	s1,0x4
+    1464:	00521021 	addu	v0,v0,s2
+    1468:	8e249140 	lw	a0,-28352(s1)
+    146c:	8c420000 	lw	v0,0(v0)
+    1470:	3c060003 	lui	a2,0x3
+    1474:	24c63900 	addiu	a2,a2,14592
+    1478:	24050001 	addiu	a1,zero,1
+    147c:	02003821 	addu	a3,s0,zero
+    1480:	0c0009b0 	jal	26c0 <__fprintk>
+    1484:	afa20010 	sw	v0,16(sp)
+    1488:	40026000 	mfc0	v0,c0_status
+    148c:	00100825 	or	at,zero,s0
+    1490:	2421000a 	addiu	at,at,10
+    1494:	34030001 	ori	v1,zero,0x1
+    1498:	00231804 	sllv	v1,v1,at
+    149c:	2401ffff 	addiu	at,zero,-1
+    14a0:	00610826 	xor	at,v1,at
+    14a4:	00220824 	and	at,at,v0
+    14a8:	40816000 	mtc0	at,c0_status
+    14ac:	00022025 	or	a0,zero,v0
+    14b0:	40027801 	mfc0	v0,$15,1
+    14b4:	30420003 	andi	v0,v0,0x3
+    14b8:	00021080 	sll	v0,v0,0x2
+    14bc:	00529021 	addu	s2,v0,s2
+    14c0:	8e420000 	lw	v0,0(s2)
+    14c4:	8e249140 	lw	a0,-28352(s1)
+    14c8:	3c060003 	lui	a2,0x3
+    14cc:	02003821 	addu	a3,s0,zero
+    14d0:	24c63934 	addiu	a2,a2,14644
+    14d4:	24050001 	addiu	a1,zero,1
+    14d8:	0c0009b0 	jal	26c0 <__fprintk>
+    14dc:	afa20010 	sw	v0,16(sp)
+    14e0:	8fbf0024 	lw	ra,36(sp)
+    14e4:	8fb20020 	lw	s2,32(sp)
+    14e8:	8fb1001c 	lw	s1,28(sp)
+    14ec:	8fb00018 	lw	s0,24(sp)
+    14f0:	03e00008 	jr	ra
+    14f4:	27bd0028 	addiu	sp,sp,40
+
+000014f8 <arch_cpu_init>:
+    14f8:	27bdffc8 	addiu	sp,sp,-56
+    14fc:	24020001 	addiu	v0,zero,1
+    1500:	afa20010 	sw	v0,16(sp)
+    1504:	2402000c 	addiu	v0,zero,12
+    1508:	afb40030 	sw	s4,48(sp)
+    150c:	afa20014 	sw	v0,20(sp)
+    1510:	3c140000 	lui	s4,0x0
+    1514:	3c02000d 	lui	v0,0xd
+    1518:	afb3002c 	sw	s3,44(sp)
+    151c:	afb20028 	sw	s2,40(sp)
+    1520:	afb10024 	sw	s1,36(sp)
+    1524:	afb00020 	sw	s0,32(sp)
+    1528:	afbf0034 	sw	ra,52(sp)
+    152c:	afa20018 	sw	v0,24(sp)
+    1530:	00808821 	addu	s1,a0,zero
+    1534:	26941434 	addiu	s4,s4,5172
+    1538:	24100001 	addiu	s0,zero,1
+    153c:	27b20010 	addiu	s2,sp,16
+    1540:	24130006 	addiu	s3,zero,6
+    1544:	0c00713f 	jal	1c4fc <kmem_alloc>
+    1548:	02402021 	addu	a0,s2,zero
+    154c:	10400010 	beqz	v0,1590 <arch_cpu_init+0x98>
+    1550:	8fbf0034 	lw	ra,52(sp)
+    1554:	ac500008 	sw	s0,8(v0)
+    1558:	26100001 	addiu	s0,s0,1
+    155c:	ae22000c 	sw	v0,12(s1)
+    1560:	ac540004 	sw	s4,4(v0)
+    1564:	1613fff7 	bne	s0,s3,1544 <arch_cpu_init+0x4c>
+    1568:	26310004 	addiu	s1,s1,4
+    156c:	8fbf0034 	lw	ra,52(sp)
+    1570:	00001021 	addu	v0,zero,zero
+    1574:	8fb40030 	lw	s4,48(sp)
+    1578:	8fb3002c 	lw	s3,44(sp)
+    157c:	8fb20028 	lw	s2,40(sp)
+    1580:	8fb10024 	lw	s1,36(sp)
+    1584:	8fb00020 	lw	s0,32(sp)
+    1588:	03e00008 	jr	ra
+    158c:	27bd0038 	addiu	sp,sp,56
+    1590:	2402000c 	addiu	v0,zero,12
+    1594:	8fb40030 	lw	s4,48(sp)
+    1598:	8fb3002c 	lw	s3,44(sp)
+    159c:	8fb20028 	lw	s2,40(sp)
+    15a0:	8fb10024 	lw	s1,36(sp)
+    15a4:	8fb00020 	lw	s0,32(sp)
+    15a8:	03e00008 	jr	ra
+    15ac:	27bd0038 	addiu	sp,sp,56
+
+000015b0 <arch_onln_cpu_nr>:
+    15b0:	3c020004 	lui	v0,0x4
+    15b4:	03e00008 	jr	ra
+    15b8:	8c42bafc 	lw	v0,-17668(v0)
+
+000015bc <arch_onln_cluster_nr>:
+    15bc:	3c020004 	lui	v0,0x4
+    15c0:	03e00008 	jr	ra
+    15c4:	8c42bb7c 	lw	v0,-17540(v0)
+
+000015c8 <arch_cpu_per_cluster>:
+    15c8:	3c020004 	lui	v0,0x4
+    15cc:	03e00008 	jr	ra
+    15d0:	8c42bb3c 	lw	v0,-17604(v0)
+
+000015d4 <arch_boot_cid>:
+    15d4:	3c020004 	lui	v0,0x4
+    15d8:	03e00008 	jr	ra
+    15dc:	9442bbbc 	lhu	v0,-17476(v0)
+
+000015e0 <cpu_gid_tbl_init>:
+    15e0:	8c850050 	lw	a1,80(a0)
+    15e4:	2ca20005 	sltiu	v0,a1,5
+    15e8:	1040000f 	beqz	v0,1628 <cpu_gid_tbl_init+0x48>
+    15ec:	3c020004 	lui	v0,0x4
+    15f0:	8c46bb3c 	lw	a2,-17604(v0)
+    15f4:	3c030004 	lui	v1,0x4
+    15f8:	00001021 	addu	v0,zero,zero
+    15fc:	10450008 	beq	v0,a1,1620 <cpu_gid_tbl_init+0x40>
+    1600:	2463c950 	addiu	v1,v1,-14000
+    1604:	8c870058 	lw	a3,88(a0)
+    1608:	70c74002 	mul	t0,a2,a3
+    160c:	01023821 	addu	a3,t0,v0
+    1610:	24420001 	addiu	v0,v0,1
+    1614:	ac670000 	sw	a3,0(v1)
+    1618:	1445fffa 	bne	v0,a1,1604 <cpu_gid_tbl_init+0x24>
+    161c:	24630004 	addiu	v1,v1,4
+    1620:	03e00008 	jr	ra
+    1624:	00000000 	sll	zero,zero,0x0
+    1628:	0800058a 	j	1628 <cpu_gid_tbl_init+0x48>
+    162c:	00000000 	sll	zero,zero,0x0
+
+00001630 <arch_dev_locate>:
+    1630:	8c820000 	lw	v0,0(a0)
+    1634:	1082000d 	beq	a0,v0,166c <arch_dev_locate+0x3c>
+    1638:	8c430000 	lw	v1,0(v0)
+    163c:	2442ff7c 	addiu	v0,v0,-132
+    1640:	8c460054 	lw	a2,84(v0)
+    1644:	14c50006 	bne	a2,a1,1660 <arch_dev_locate+0x30>
+    1648:	00000000 	sll	zero,zero,0x0
+    164c:	0800059d 	j	1674 <arch_dev_locate+0x44>
+    1650:	00000000 	sll	zero,zero,0x0
+    1654:	8c470054 	lw	a3,84(v0)
+    1658:	10e50006 	beq	a3,a1,1674 <arch_dev_locate+0x44>
+    165c:	00c01821 	addu	v1,a2,zero
+    1660:	2462ff7c 	addiu	v0,v1,-132
+    1664:	1483fffb 	bne	a0,v1,1654 <arch_dev_locate+0x24>
+    1668:	8c660000 	lw	a2,0(v1)
+    166c:	03e00008 	jr	ra
+    1670:	00001021 	addu	v0,zero,zero
+    1674:	03e00008 	jr	ra
+    1678:	00000000 	sll	zero,zero,0x0
+
+0000167c <arch_xicu_set_mask>:
+    167c:	27bdffd0 	addiu	sp,sp,-48
+    1680:	afb3001c 	sw	s3,28(sp)
+    1684:	afb10014 	sw	s1,20(sp)
+    1688:	afb00010 	sw	s0,16(sp)
+    168c:	8c910404 	lw	s1,1028(a0)
+    1690:	00a08021 	addu	s0,a1,zero
+    1694:	afbf002c 	sw	ra,44(sp)
+    1698:	afb60028 	sw	s6,40(sp)
+    169c:	afb50024 	sw	s5,36(sp)
+    16a0:	afb40020 	sw	s4,32(sp)
+    16a4:	afb20018 	sw	s2,24(sp)
+    16a8:	00009821 	addu	s3,zero,zero
+    16ac:	00001021 	addu	v0,zero,zero
+    16b0:	24050001 	addiu	a1,zero,1
+    16b4:	24040020 	addiu	a0,zero,32
+    16b8:	0051001b 	divu	zero,v0,s1
+    16bc:	022001f4 	teq	s1,zero,0x7
+    16c0:	00453004 	sllv	a2,a1,v0
+    16c4:	00001810 	mfhi	v1
+    16c8:	14600002 	bnez	v1,16d4 <arch_xicu_set_mask+0x58>
+    16cc:	24420001 	addiu	v0,v0,1
+    16d0:	02669825 	or	s3,s3,a2
+    16d4:	1444fff8 	bne	v0,a0,16b8 <arch_xicu_set_mask+0x3c>
+    16d8:	0011a080 	sll	s4,s1,0x2
+    16dc:	1280001c 	beqz	s4,1750 <arch_xicu_set_mask+0xd4>
+    16e0:	00009021 	addu	s2,zero,zero
+    16e4:	26520001 	addiu	s2,s2,1
+    16e8:	0254102b 	sltu	v0,s2,s4
+    16ec:	10400018 	beqz	v0,1750 <arch_xicu_set_mask+0xd4>
+    16f0:	32430003 	andi	v1,s2,0x3
+    16f4:	1060fffb 	beqz	v1,16e4 <arch_xicu_set_mask+0x68>
+    16f8:	02403821 	addu	a3,s2,zero
+    16fc:	8e020030 	lw	v0,48(s0)
+    1700:	02002021 	addu	a0,s0,zero
+    1704:	00002821 	addu	a1,zero,zero
+    1708:	0040f809 	jalr	v0
+    170c:	24060008 	addiu	a2,zero,8
+    1710:	8e020030 	lw	v0,48(s0)
+    1714:	02403821 	addu	a3,s2,zero
+    1718:	02002021 	addu	a0,s0,zero
+    171c:	00002821 	addu	a1,zero,zero
+    1720:	0040f809 	jalr	v0
+    1724:	24060004 	addiu	a2,zero,4
+    1728:	8e020030 	lw	v0,48(s0)
+    172c:	02403821 	addu	a3,s2,zero
+    1730:	02002021 	addu	a0,s0,zero
+    1734:	26520001 	addiu	s2,s2,1
+    1738:	00002821 	addu	a1,zero,zero
+    173c:	0040f809 	jalr	v0
+    1740:	2406000c 	addiu	a2,zero,12
+    1744:	0254102b 	sltu	v0,s2,s4
+    1748:	1440ffea 	bnez	v0,16f4 <arch_xicu_set_mask+0x78>
+    174c:	32430003 	andi	v1,s2,0x3
+    1750:	1220001a 	beqz	s1,17bc <arch_xicu_set_mask+0x140>
+    1754:	00009021 	addu	s2,zero,zero
+    1758:	24160001 	addiu	s6,zero,1
+    175c:	0012a080 	sll	s4,s2,0x2
+    1760:	8e020030 	lw	v0,48(s0)
+    1764:	02532804 	sllv	a1,s3,s2
+    1768:	02002021 	addu	a0,s0,zero
+    176c:	24060008 	addiu	a2,zero,8
+    1770:	0040f809 	jalr	v0
+    1774:	02803821 	addu	a3,s4,zero
+    1778:	0256a804 	sllv	s5,s6,s2
+    177c:	8e020030 	lw	v0,48(s0)
+    1780:	02002021 	addu	a0,s0,zero
+    1784:	02a02821 	addu	a1,s5,zero
+    1788:	24060004 	addiu	a2,zero,4
+    178c:	0040f809 	jalr	v0
+    1790:	02803821 	addu	a3,s4,zero
+    1794:	8e020030 	lw	v0,48(s0)
+    1798:	02a02821 	addu	a1,s5,zero
+    179c:	02803821 	addu	a3,s4,zero
+    17a0:	26520001 	addiu	s2,s2,1
+    17a4:	02002021 	addu	a0,s0,zero
+    17a8:	0040f809 	jalr	v0
+    17ac:	2406000c 	addiu	a2,zero,12
+    17b0:	0251102b 	sltu	v0,s2,s1
+    17b4:	1440ffea 	bnez	v0,1760 <arch_xicu_set_mask+0xe4>
+    17b8:	0012a080 	sll	s4,s2,0x2
+    17bc:	8fbf002c 	lw	ra,44(sp)
+    17c0:	8fb60028 	lw	s6,40(sp)
+    17c4:	8fb50024 	lw	s5,36(sp)
+    17c8:	8fb40020 	lw	s4,32(sp)
+    17cc:	8fb3001c 	lw	s3,28(sp)
+    17d0:	8fb20018 	lw	s2,24(sp)
+    17d4:	8fb10014 	lw	s1,20(sp)
+    17d8:	8fb00010 	lw	s0,16(sp)
+    17dc:	03e00008 	jr	ra
+    17e0:	27bd0030 	addiu	sp,sp,48
+
+000017e4 <arch_xicu_set_wti>:
+    17e4:	27bdffb8 	addiu	sp,sp,-72
+    17e8:	afb2002c 	sw	s2,44(sp)
+    17ec:	8c920070 	lw	s2,112(a0)
+    17f0:	afb70040 	sw	s7,64(sp)
+    17f4:	afb6003c 	sw	s6,60(sp)
+    17f8:	afb50038 	sw	s5,56(sp)
+    17fc:	afb40034 	sw	s4,52(sp)
+    1800:	afb30030 	sw	s3,48(sp)
+    1804:	afb10028 	sw	s1,40(sp)
+    1808:	afb00024 	sw	s0,36(sp)
+    180c:	0006a080 	sll	s4,a2,0x2
+    1810:	afbf0044 	sw	ra,68(sp)
+    1814:	00a0b821 	addu	s7,a1,zero
+    1818:	8c830074 	lw	v1,116(a0)
+    181c:	8c820030 	lw	v0,48(a0)
+    1820:	02929021 	addu	s2,s4,s2
+    1824:	24050001 	addiu	a1,zero,1
+    1828:	00c52804 	sllv	a1,a1,a2
+    182c:	00c09821 	addu	s3,a2,zero
+    1830:	0254a02b 	sltu	s4,s2,s4
+    1834:	00e0b021 	addu	s6,a3,zero
+    1838:	2406000d 	addiu	a2,zero,13
+    183c:	00173880 	sll	a3,s7,0x2
+    1840:	3c150004 	lui	s5,0x4
+    1844:	00808021 	addu	s0,a0,zero
+    1848:	0283a021 	addu	s4,s4,v1
+    184c:	0040f809 	jalr	v0
+    1850:	8fb10058 	lw	s1,88(sp)
+    1854:	96a2c960 	lhu	v0,-13984(s5)
+    1858:	1440000b 	bnez	v0,1888 <arch_xicu_set_wti+0xa4>
+    185c:	00000000 	sll	zero,zero,0x0
+    1860:	40024800 	mfc0	v0,c0_count
+    1864:	00000000 	sll	zero,zero,0x0
+    1868:	3c040003 	lui	a0,0x3
+    186c:	24843960 	addiu	a0,a0,14688
+    1870:	02e03021 	addu	a2,s7,zero
+    1874:	02602821 	addu	a1,s3,zero
+    1878:	02803821 	addu	a3,s4,zero
+    187c:	afa20014 	sw	v0,20(sp)
+    1880:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1884:	afb20010 	sw	s2,16(sp)
+    1888:	8e02003c 	lw	v0,60(s0)
+    188c:	02c02821 	addu	a1,s6,zero
+    1890:	02603021 	addu	a2,s3,zero
+    1894:	0040f809 	jalr	v0
+    1898:	02002021 	addu	a0,s0,zero
+    189c:	10400011 	beqz	v0,18e4 <arch_xicu_set_wti+0x100>
+    18a0:	96a3c960 	lhu	v1,-13984(s5)
+    18a4:	1460000d 	bnez	v1,18dc <arch_xicu_set_wti+0xf8>
+    18a8:	00000000 	sll	zero,zero,0x0
+    18ac:	1220001c 	beqz	s1,1920 <arch_xicu_set_wti+0x13c>
+    18b0:	3c050003 	lui	a1,0x3
+    18b4:	262500ec 	addiu	a1,s1,236
+    18b8:	3c040003 	lui	a0,0x3
+    18bc:	260300ec 	addiu	v1,s0,236
+    18c0:	2484399c 	addiu	a0,a0,14748
+    18c4:	02803021 	addu	a2,s4,zero
+    18c8:	02403821 	addu	a3,s2,zero
+    18cc:	afa30010 	sw	v1,16(sp)
+    18d0:	afb00014 	sw	s0,20(sp)
+    18d4:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    18d8:	afa20018 	sw	v0,24(sp)
+    18dc:	08000637 	j	18dc <arch_xicu_set_wti+0xf8>
+    18e0:	00000000 	sll	zero,zero,0x0
+    18e4:	12200004 	beqz	s1,18f8 <arch_xicu_set_wti+0x114>
+    18e8:	8fbf0044 	lw	ra,68(sp)
+    18ec:	ae34007c 	sw	s4,124(s1)
+    18f0:	ae320078 	sw	s2,120(s1)
+    18f4:	8fbf0044 	lw	ra,68(sp)
+    18f8:	8fb70040 	lw	s7,64(sp)
+    18fc:	8fb6003c 	lw	s6,60(sp)
+    1900:	8fb50038 	lw	s5,56(sp)
+    1904:	8fb40034 	lw	s4,52(sp)
+    1908:	8fb30030 	lw	s3,48(sp)
+    190c:	8fb2002c 	lw	s2,44(sp)
+    1910:	8fb10028 	lw	s1,40(sp)
+    1914:	8fb00024 	lw	s0,36(sp)
+    1918:	03e00008 	jr	ra
+    191c:	27bd0048 	addiu	sp,sp,72
+    1920:	0800062e 	j	18b8 <arch_xicu_set_wti+0xd4>
+    1924:	24a53998 	addiu	a1,a1,14744
+
+00001928 <arch_dev_iopic_register>:
+    1928:	8c820400 	lw	v0,1024(a0)
+    192c:	27bdffc0 	addiu	sp,sp,-64
+    1930:	00021900 	sll	v1,v0,0x4
+    1934:	00021080 	sll	v0,v0,0x2
+    1938:	00621023 	subu	v0,v1,v0
+    193c:	3c030004 	lui	v1,0x4
+    1940:	afb00018 	sw	s0,24(sp)
+    1944:	2463c9a0 	addiu	v1,v1,-13920
+    1948:	8cb00010 	lw	s0,16(a1)
+    194c:	afb30024 	sw	s3,36(sp)
+    1950:	00621021 	addu	v0,v1,v0
+    1954:	24b30010 	addiu	s3,a1,16
+    1958:	afb70034 	sw	s7,52(sp)
+    195c:	afb5002c 	sw	s5,44(sp)
+    1960:	afb40028 	sw	s4,40(sp)
+    1964:	afb20020 	sw	s2,32(sp)
+    1968:	afbf003c 	sw	ra,60(sp)
+    196c:	afbe0038 	sw	s8,56(sp)
+    1970:	afb60030 	sw	s6,48(sp)
+    1974:	afb1001c 	sw	s1,28(sp)
+    1978:	afa40040 	sw	a0,64(sp)
+    197c:	00a0a021 	addu	s4,a1,zero
+    1980:	8c570004 	lw	s7,4(v0)
+    1984:	8c950404 	lw	s5,1028(a0)
+    1988:	1270000e 	beq	s3,s0,19c4 <arch_dev_iopic_register+0x9c>
+    198c:	8e120000 	lw	s2,0(s0)
+    1990:	2611ff7c 	addiu	s1,s0,-132
+    1994:	8e230054 	lw	v1,84(s1)
+    1998:	24020008 	addiu	v0,zero,8
+    199c:	1062000a 	beq	v1,v0,19c8 <arch_dev_iopic_register+0xa0>
+    19a0:	02401021 	addu	v0,s2,zero
+    19a4:	0800066e 	j	19b8 <arch_dev_iopic_register+0x90>
+    19a8:	24050008 	addiu	a1,zero,8
+    19ac:	8e240054 	lw	a0,84(s1)
+    19b0:	10850005 	beq	a0,a1,19c8 <arch_dev_iopic_register+0xa0>
+    19b4:	00601021 	addu	v0,v1,zero
+    19b8:	2451ff7c 	addiu	s1,v0,-132
+    19bc:	1662fffb 	bne	s3,v0,19ac <arch_dev_iopic_register+0x84>
+    19c0:	8c430000 	lw	v1,0(v0)
+    19c4:	00008821 	addu	s1,zero,zero
+    19c8:	12e00052 	beqz	s7,1b14 <arch_dev_iopic_register+0x1ec>
+    19cc:	3c030004 	lui	v1,0x4
+    19d0:	9462c960 	lhu	v0,-13984(v1)
+    19d4:	10400027 	beqz	v0,1a74 <arch_dev_iopic_register+0x14c>
+    19d8:	00000000 	sll	zero,zero,0x0
+    19dc:	12700033 	beq	s3,s0,1aac <arch_dev_iopic_register+0x184>
+    19e0:	8fbf003c 	lw	ra,60(sp)
+    19e4:	241e0020 	addiu	s8,zero,32
+    19e8:	03d5f023 	subu	s8,s8,s5
+    19ec:	03d5102b 	sltu	v0,s8,s5
+    19f0:	14400042 	bnez	v0,1afc <arch_dev_iopic_register+0x1d4>
+    19f4:	2610ff7c 	addiu	s0,s0,-132
+    19f8:	02a0a021 	addu	s4,s5,zero
+    19fc:	0000b021 	addu	s6,zero,zero
+    1a00:	12110012 	beq	s0,s1,1a4c <arch_dev_iopic_register+0x124>
+    1a04:	2403ffff 	addiu	v1,zero,-1
+    1a08:	8e020064 	lw	v0,100(s0)
+    1a0c:	1043000f 	beq	v0,v1,1a4c <arch_dev_iopic_register+0x124>
+    1a10:	3c030004 	lui	v1,0x4
+    1a14:	9462c960 	lhu	v0,-13984(v1)
+    1a18:	1040002f 	beqz	v0,1ad8 <arch_dev_iopic_register+0x1b0>
+    1a1c:	00000000 	sll	zero,zero,0x0
+    1a20:	02d5001b 	divu	zero,s6,s5
+    1a24:	02a001f4 	teq	s5,zero,0x7
+    1a28:	02803021 	addu	a2,s4,zero
+    1a2c:	26070058 	addiu	a3,s0,88
+    1a30:	02e02021 	addu	a0,s7,zero
+    1a34:	afb00010 	sw	s0,16(sp)
+    1a38:	26940001 	addiu	s4,s4,1
+    1a3c:	26d60001 	addiu	s6,s6,1
+    1a40:	0c0005f9 	jal	17e4 <arch_xicu_set_wti>
+    1a44:	00002810 	mfhi	a1
+    1a48:	ae110080 	sw	s1,128(s0)
+    1a4c:	0c0089cc 	jal	22730 <devfs_register>
+    1a50:	02002021 	addu	a0,s0,zero
+    1a54:	2650ff7c 	addiu	s0,s2,-132
+    1a58:	03d4102b 	sltu	v0,s8,s4
+    1a5c:	12720012 	beq	s3,s2,1aa8 <arch_dev_iopic_register+0x180>
+    1a60:	8e430000 	lw	v1,0(s2)
+    1a64:	14400025 	bnez	v0,1afc <arch_dev_iopic_register+0x1d4>
+    1a68:	00609021 	addu	s2,v1,zero
+    1a6c:	08000680 	j	1a00 <arch_dev_iopic_register+0xd8>
+    1a70:	00000000 	sll	zero,zero,0x0
+    1a74:	8e260010 	lw	a2,16(s1)
+    1a78:	40024800 	mfc0	v0,c0_count
+    1a7c:	00000000 	sll	zero,zero,0x0
+    1a80:	8e27001c 	lw	a3,28(s1)
+    1a84:	8e850000 	lw	a1,0(s4)
+    1a88:	3c040003 	lui	a0,0x3
+    1a8c:	24843a1c 	addiu	a0,a0,14876
+    1a90:	00c73821 	addu	a3,a2,a3
+    1a94:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1a98:	afa20010 	sw	v0,16(sp)
+    1a9c:	8e900010 	lw	s0,16(s4)
+    1aa0:	1670ffd0 	bne	s3,s0,19e4 <arch_dev_iopic_register+0xbc>
+    1aa4:	8e120000 	lw	s2,0(s0)
+    1aa8:	8fbf003c 	lw	ra,60(sp)
+    1aac:	8fbe0038 	lw	s8,56(sp)
+    1ab0:	8fb70034 	lw	s7,52(sp)
+    1ab4:	8fb60030 	lw	s6,48(sp)
+    1ab8:	8fb5002c 	lw	s5,44(sp)
+    1abc:	8fb40028 	lw	s4,40(sp)
+    1ac0:	8fb30024 	lw	s3,36(sp)
+    1ac4:	8fb20020 	lw	s2,32(sp)
+    1ac8:	8fb1001c 	lw	s1,28(sp)
+    1acc:	8fb00018 	lw	s0,24(sp)
+    1ad0:	03e00008 	jr	ra
+    1ad4:	27bd0040 	addiu	sp,sp,64
+    1ad8:	40074800 	mfc0	a3,c0_count
+    1adc:	00000000 	sll	zero,zero,0x0
+    1ae0:	3c040003 	lui	a0,0x3
+    1ae4:	8ee60018 	lw	a2,24(s7)
+    1ae8:	24843a84 	addiu	a0,a0,14980
+    1aec:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1af0:	260500ec 	addiu	a1,s0,236
+    1af4:	08000688 	j	1a20 <arch_dev_iopic_register+0xf8>
+    1af8:	00000000 	sll	zero,zero,0x0
+    1afc:	3c030004 	lui	v1,0x4
+    1b00:	9462c960 	lhu	v0,-13984(v1)
+    1b04:	1040000d 	beqz	v0,1b3c <arch_dev_iopic_register+0x214>
+    1b08:	8fa20040 	lw	v0,64(sp)
+    1b0c:	080006c3 	j	1b0c <arch_dev_iopic_register+0x1e4>
+    1b10:	00000000 	sll	zero,zero,0x0
+    1b14:	3c020004 	lui	v0,0x4
+    1b18:	9442c960 	lhu	v0,-13984(v0)
+    1b1c:	14400005 	bnez	v0,1b34 <arch_dev_iopic_register+0x20c>
+    1b20:	00000000 	sll	zero,zero,0x0
+    1b24:	3c040003 	lui	a0,0x3
+    1b28:	8e850000 	lw	a1,0(s4)
+    1b2c:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1b30:	248439ec 	addiu	a0,a0,14828
+    1b34:	080006cd 	j	1b34 <arch_dev_iopic_register+0x20c>
+    1b38:	00000000 	sll	zero,zero,0x0
+    1b3c:	3c040003 	lui	a0,0x3
+    1b40:	8c450400 	lw	a1,1024(v0)
+    1b44:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1b48:	24843a5c 	addiu	a0,a0,14940
+    1b4c:	080006c3 	j	1b0c <arch_dev_iopic_register+0x1e4>
+    1b50:	00000000 	sll	zero,zero,0x0
+
+00001b54 <arch_dev_register>:
+    1b54:	27bdffc0 	addiu	sp,sp,-64
+    1b58:	afb50030 	sw	s5,48(sp)
+    1b5c:	8cb50010 	lw	s5,16(a1)
+    1b60:	afb20024 	sw	s2,36(sp)
+    1b64:	24b20010 	addiu	s2,a1,16
+    1b68:	afb60034 	sw	s6,52(sp)
+    1b6c:	afb30028 	sw	s3,40(sp)
+    1b70:	afb10020 	sw	s1,32(sp)
+    1b74:	afbf003c 	sw	ra,60(sp)
+    1b78:	afb70038 	sw	s7,56(sp)
+    1b7c:	afb4002c 	sw	s4,44(sp)
+    1b80:	afb0001c 	sw	s0,28(sp)
+    1b84:	00a0b021 	addu	s6,a1,zero
+    1b88:	00808821 	addu	s1,a0,zero
+    1b8c:	1255006e 	beq	s2,s5,1d48 <arch_dev_register+0x1f4>
+    1b90:	8eb30000 	lw	s3,0(s5)
+    1b94:	26a3ff7c 	addiu	v1,s5,-132
+    1b98:	8c670054 	lw	a3,84(v1)
+    1b9c:	24020001 	addiu	v0,zero,1
+    1ba0:	10e2006c 	beq	a3,v0,1d54 <arch_dev_register+0x200>
+    1ba4:	02601021 	addu	v0,s3,zero
+    1ba8:	080006ef 	j	1bbc <arch_dev_register+0x68>
+    1bac:	24060001 	addiu	a2,zero,1
+    1bb0:	8e050054 	lw	a1,84(s0)
+    1bb4:	10a60005 	beq	a1,a2,1bcc <arch_dev_register+0x78>
+    1bb8:	00801021 	addu	v0,a0,zero
+    1bbc:	2450ff7c 	addiu	s0,v0,-132
+    1bc0:	1642fffb 	bne	s2,v0,1bb0 <arch_dev_register+0x5c>
+    1bc4:	8c440000 	lw	a0,0(v0)
+    1bc8:	00008021 	addu	s0,zero,zero
+    1bcc:	24020003 	addiu	v0,zero,3
+    1bd0:	10e2000a 	beq	a3,v0,1bfc <arch_dev_register+0xa8>
+    1bd4:	02601021 	addu	v0,s3,zero
+    1bd8:	080006fb 	j	1bec <arch_dev_register+0x98>
+    1bdc:	24060003 	addiu	a2,zero,3
+    1be0:	8c650054 	lw	a1,84(v1)
+    1be4:	10a60005 	beq	a1,a2,1bfc <arch_dev_register+0xa8>
+    1be8:	00801021 	addu	v0,a0,zero
+    1bec:	2443ff7c 	addiu	v1,v0,-132
+    1bf0:	1642fffb 	bne	s2,v0,1be0 <arch_dev_register+0x8c>
+    1bf4:	8c440000 	lw	a0,0(v0)
+    1bf8:	00001821 	addu	v1,zero,zero
+    1bfc:	8ec50000 	lw	a1,0(s6)
+    1c00:	8e240400 	lw	a0,1024(s1)
+    1c04:	00051080 	sll	v0,a1,0x2
+    1c08:	00053100 	sll	a2,a1,0x4
+    1c0c:	00c23023 	subu	a2,a2,v0
+    1c10:	3c020004 	lui	v0,0x4
+    1c14:	2442c9a0 	addiu	v0,v0,-13920
+    1c18:	00461021 	addu	v0,v0,a2
+    1c1c:	ac430008 	sw	v1,8(v0)
+    1c20:	10a4000c 	beq	a1,a0,1c54 <arch_dev_register+0x100>
+    1c24:	ac500004 	sw	s0,4(v0)
+    1c28:	8fbf003c 	lw	ra,60(sp)
+    1c2c:	8fb70038 	lw	s7,56(sp)
+    1c30:	8fb60034 	lw	s6,52(sp)
+    1c34:	8fb50030 	lw	s5,48(sp)
+    1c38:	8fb4002c 	lw	s4,44(sp)
+    1c3c:	8fb30028 	lw	s3,40(sp)
+    1c40:	8fb20024 	lw	s2,36(sp)
+    1c44:	8fb10020 	lw	s1,32(sp)
+    1c48:	8fb0001c 	lw	s0,28(sp)
+    1c4c:	03e00008 	jr	ra
+    1c50:	27bd0040 	addiu	sp,sp,64
+    1c54:	12000034 	beqz	s0,1d28 <arch_dev_register+0x1d4>
+    1c58:	3c020004 	lui	v0,0x4
+    1c5c:	12550018 	beq	s2,s5,1cc0 <arch_dev_register+0x16c>
+    1c60:	02002821 	addu	a1,s0,zero
+    1c64:	0800071c 	j	1c70 <arch_dev_register+0x11c>
+    1c68:	2417ffff 	addiu	s7,zero,-1
+    1c6c:	00409821 	addu	s3,v0,zero
+    1c70:	26b4ff7c 	addiu	s4,s5,-132
+    1c74:	02002021 	addu	a0,s0,zero
+    1c78:	12900009 	beq	s4,s0,1ca0 <arch_dev_register+0x14c>
+    1c7c:	02802821 	addu	a1,s4,zero
+    1c80:	8e820064 	lw	v0,100(s4)
+    1c84:	10570006 	beq	v0,s7,1ca0 <arch_dev_register+0x14c>
+    1c88:	00000000 	sll	zero,zero,0x0
+    1c8c:	8e020040 	lw	v0,64(s0)
+    1c90:	0040f809 	jalr	v0
+    1c94:	00000000 	sll	zero,zero,0x0
+    1c98:	1440001e 	bnez	v0,1d14 <arch_dev_register+0x1c0>
+    1c9c:	3c030004 	lui	v1,0x4
+    1ca0:	8e620000 	lw	v0,0(s3)
+    1ca4:	1653fff1 	bne	s2,s3,1c6c <arch_dev_register+0x118>
+    1ca8:	0260a821 	addu	s5,s3,zero
+    1cac:	8ec20000 	lw	v0,0(s6)
+    1cb0:	8e230400 	lw	v1,1024(s1)
+    1cb4:	1462ffdd 	bne	v1,v0,1c2c <arch_dev_register+0xd8>
+    1cb8:	8fbf003c 	lw	ra,60(sp)
+    1cbc:	02002821 	addu	a1,s0,zero
+    1cc0:	02202021 	addu	a0,s1,zero
+    1cc4:	0c00059f 	jal	167c <arch_xicu_set_mask>
+    1cc8:	26120058 	addiu	s2,s0,88
+    1ccc:	08000737 	j	1cdc <arch_dev_register+0x188>
+    1cd0:	00008021 	addu	s0,zero,zero
+    1cd4:	0c00049c 	jal	1270 <arch_cpu_set_irq_entry>
+    1cd8:	26100001 	addiu	s0,s0,1
+    1cdc:	00101980 	sll	v1,s0,0x6
+    1ce0:	00101280 	sll	v0,s0,0xa
+    1ce4:	00621021 	addu	v0,v1,v0
+    1ce8:	00022140 	sll	a0,v0,0x5
+    1cec:	00822023 	subu	a0,a0,v0
+    1cf0:	8e220404 	lw	v0,1028(s1)
+    1cf4:	24840440 	addiu	a0,a0,1088
+    1cf8:	0202102b 	sltu	v0,s0,v0
+    1cfc:	02242021 	addu	a0,s1,a0
+    1d00:	00002821 	addu	a1,zero,zero
+    1d04:	1440fff3 	bnez	v0,1cd4 <arch_dev_register+0x180>
+    1d08:	02403021 	addu	a2,s2,zero
+    1d0c:	0800070b 	j	1c2c <arch_dev_register+0xd8>
+    1d10:	8fbf003c 	lw	ra,60(sp)
+    1d14:	9463c960 	lhu	v1,-13984(v1)
+    1d18:	10600010 	beqz	v1,1d5c <arch_dev_register+0x208>
+    1d1c:	3c040003 	lui	a0,0x3
+    1d20:	08000748 	j	1d20 <arch_dev_register+0x1cc>
+    1d24:	00000000 	sll	zero,zero,0x0
+    1d28:	9442c960 	lhu	v0,-13984(v0)
+    1d2c:	14400004 	bnez	v0,1d40 <arch_dev_register+0x1ec>
+    1d30:	00000000 	sll	zero,zero,0x0
+    1d34:	3c040003 	lui	a0,0x3
+    1d38:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1d3c:	24843ad4 	addiu	a0,a0,15060
+    1d40:	08000750 	j	1d40 <arch_dev_register+0x1ec>
+    1d44:	00000000 	sll	zero,zero,0x0
+    1d48:	00008021 	addu	s0,zero,zero
+    1d4c:	080006ff 	j	1bfc <arch_dev_register+0xa8>
+    1d50:	00001821 	addu	v1,zero,zero
+    1d54:	080006f3 	j	1bcc <arch_dev_register+0x78>
+    1d58:	00608021 	addu	s0,v1,zero
+    1d5c:	8e860064 	lw	a2,100(s4)
+    1d60:	24843b00 	addiu	a0,a0,15104
+    1d64:	26a50068 	addiu	a1,s5,104
+    1d68:	260700ec 	addiu	a3,s0,236
+    1d6c:	afa20014 	sw	v0,20(sp)
+    1d70:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1d74:	afb00010 	sw	s0,16(sp)
+    1d78:	08000748 	j	1d20 <arch_dev_register+0x1cc>
+    1d7c:	00000000 	sll	zero,zero,0x0
+
+00001d80 <arch_dev_init>:
+    1d80:	27bdffa8 	addiu	sp,sp,-88
+    1d84:	afbe0050 	sw	s8,80(sp)
+    1d88:	afb50044 	sw	s5,68(sp)
+    1d8c:	afbf0054 	sw	ra,84(sp)
+    1d90:	afb7004c 	sw	s7,76(sp)
+    1d94:	afb60048 	sw	s6,72(sp)
+    1d98:	afb40040 	sw	s4,64(sp)
+    1d9c:	afb3003c 	sw	s3,60(sp)
+    1da0:	afb20038 	sw	s2,56(sp)
+    1da4:	afb10034 	sw	s1,52(sp)
+    1da8:	afb00030 	sw	s0,48(sp)
+    1dac:	0080f021 	addu	s8,a0,zero
+    1db0:	00a0a821 	addu	s5,a1,zero
+    1db4:	40022002 	mfc0	v0,$4,2
+    1db8:	90f20003 	lbu	s2,3(a3)
+    1dbc:	8c820400 	lw	v0,1024(a0)
+    1dc0:	90f40000 	lbu	s4,0(a3)
+    1dc4:	12400074 	beqz	s2,1f98 <arch_dev_init+0x218>
+    1dc8:	afa20020 	sw	v0,32(sp)
+    1dcc:	00c08021 	addu	s0,a2,zero
+    1dd0:	00009821 	addu	s3,zero,zero
+    1dd4:	00008821 	addu	s1,zero,zero
+    1dd8:	3c160004 	lui	s6,0x4
+    1ddc:	0800077d 	j	1df4 <arch_dev_init+0x74>
+    1de0:	24170001 	addiu	s7,zero,1
+    1de4:	26310001 	addiu	s1,s1,1
+    1de8:	0232102b 	sltu	v0,s1,s2
+    1dec:	1040006b 	beqz	v0,1f9c <arch_dev_init+0x21c>
+    1df0:	2610000f 	addiu	s0,s0,15
+    1df4:	92040000 	lbu	a0,0(s0)
+    1df8:	1080fffa 	beqz	a0,1de4 <arch_dev_init+0x64>
+    1dfc:	00000000 	sll	zero,zero,0x0
+    1e00:	0c000d71 	jal	35c4 <drvdb_locate_byId>
+    1e04:	00000000 	sll	zero,zero,0x0
+    1e08:	10400052 	beqz	v0,1f54 <arch_dev_init+0x1d4>
+    1e0c:	00402821 	addu	a1,v0,zero
+    1e10:	8c42000c 	lw	v0,12(v0)
+    1e14:	10400050 	beqz	v0,1f58 <arch_dev_init+0x1d8>
+    1e18:	96c2c960 	lhu	v0,-13984(s6)
+    1e1c:	8a070004 	lwl	a3,4(s0)
+    1e20:	8a060008 	lwl	a2,8(s0)
+    1e24:	92020000 	lbu	v0,0(s0)
+    1e28:	9a070001 	lwr	a3,1(s0)
+    1e2c:	9a060005 	lwr	a2,5(s0)
+    1e30:	38420008 	xori	v0,v0,0x8
+    1e34:	afa50028 	sw	a1,40(sp)
+    1e38:	afa60024 	sw	a2,36(sp)
+    1e3c:	afa7002c 	sw	a3,44(sp)
+    1e40:	0c0021d2 	jal	8748 <device_alloc>
+    1e44:	02e2980a 	movz	s3,s7,v0
+    1e48:	00401821 	addu	v1,v0,zero
+    1e4c:	00402021 	addu	a0,v0,zero
+    1e50:	8fa50028 	lw	a1,40(sp)
+    1e54:	8fa60024 	lw	a2,36(sp)
+    1e58:	10400060 	beqz	v0,1fdc <arch_dev_init+0x25c>
+    1e5c:	8fa7002c 	lw	a3,44(sp)
+    1e60:	ac470010 	sw	a3,16(v0)
+    1e64:	ac470070 	sw	a3,112(v0)
+    1e68:	ac460074 	sw	a2,116(v0)
+    1e6c:	ac540018 	sw	s4,24(v0)
+    1e70:	9206000e 	lbu	a2,14(s0)
+    1e74:	9208000d 	lbu	t0,13(s0)
+    1e78:	00063200 	sll	a2,a2,0x8
+    1e7c:	8ca2000c 	lw	v0,12(a1)
+    1e80:	00c83025 	or	a2,a2,t0
+    1e84:	00063400 	sll	a2,a2,0x10
+    1e88:	00063403 	sra	a2,a2,0x10
+    1e8c:	8c420000 	lw	v0,0(v0)
+    1e90:	ac660064 	sw	a2,100(v1)
+    1e94:	ac600080 	sw	zero,128(v1)
+    1e98:	afa30024 	sw	v1,36(sp)
+    1e9c:	afa50028 	sw	a1,40(sp)
+    1ea0:	0040f809 	jalr	v0
+    1ea4:	afa7002c 	sw	a3,44(sp)
+    1ea8:	8fa30024 	lw	v1,36(sp)
+    1eac:	8fa50028 	lw	a1,40(sp)
+    1eb0:	00602021 	addu	a0,v1,zero
+    1eb4:	1440004f 	bnez	v0,1ff4 <arch_dev_init+0x274>
+    1eb8:	8fa7002c 	lw	a3,44(sp)
+    1ebc:	afa30024 	sw	v1,36(sp)
+    1ec0:	afa50028 	sw	a1,40(sp)
+    1ec4:	0c0089cc 	jal	22730 <devfs_register>
+    1ec8:	afa7002c 	sw	a3,44(sp)
+    1ecc:	8ea20014 	lw	v0,20(s5)
+    1ed0:	8fa30024 	lw	v1,36(sp)
+    1ed4:	8c460000 	lw	a2,0(v0)
+    1ed8:	24640084 	addiu	a0,v1,132
+    1edc:	ac620088 	sw	v0,136(v1)
+    1ee0:	ac660084 	sw	a2,132(v1)
+    1ee4:	acc40004 	sw	a0,4(a2)
+    1ee8:	ac440000 	sw	a0,0(v0)
+    1eec:	96c2c960 	lhu	v0,-13984(s6)
+    1ef0:	8fa50028 	lw	a1,40(sp)
+    1ef4:	1440ffbb 	bnez	v0,1de4 <arch_dev_init+0x64>
+    1ef8:	8fa7002c 	lw	a3,44(sp)
+    1efc:	40064800 	mfc0	a2,c0_count
+    1f00:	00000000 	sll	zero,zero,0x0
+    1f04:	40024800 	mfc0	v0,c0_count
+    1f08:	00000000 	sll	zero,zero,0x0
+    1f0c:	8ca50004 	lw	a1,4(a1)
+    1f10:	afb40010 	sw	s4,16(sp)
+    1f14:	8a03000c 	lwl	v1,12(s0)
+    1f18:	9a030009 	lwr	v1,9(s0)
+    1f1c:	afa30014 	sw	v1,20(sp)
+    1f20:	9203000e 	lbu	v1,14(s0)
+    1f24:	9204000d 	lbu	a0,13(s0)
+    1f28:	00031a00 	sll	v1,v1,0x8
+    1f2c:	00641825 	or	v1,v1,a0
+    1f30:	00031c00 	sll	v1,v1,0x10
+    1f34:	3c040003 	lui	a0,0x3
+    1f38:	00031c03 	sra	v1,v1,0x10
+    1f3c:	24843c14 	addiu	a0,a0,15380
+    1f40:	afa30018 	sw	v1,24(sp)
+    1f44:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1f48:	afa2001c 	sw	v0,28(sp)
+    1f4c:	0800077a 	j	1de8 <arch_dev_init+0x68>
+    1f50:	26310001 	addiu	s1,s1,1
+    1f54:	96c2c960 	lhu	v0,-13984(s6)
+    1f58:	1440ffa2 	bnez	v0,1de4 <arch_dev_init+0x64>
+    1f5c:	3c040003 	lui	a0,0x3
+    1f60:	8a030004 	lwl	v1,4(s0)
+    1f64:	8a020008 	lwl	v0,8(s0)
+    1f68:	9a030001 	lwr	v1,1(s0)
+    1f6c:	9a020005 	lwr	v0,5(s0)
+    1f70:	92070000 	lbu	a3,0(s0)
+    1f74:	24843b48 	addiu	a0,a0,15176
+    1f78:	02802821 	addu	a1,s4,zero
+    1f7c:	02203021 	addu	a2,s1,zero
+    1f80:	afa30010 	sw	v1,16(sp)
+    1f84:	afa20014 	sw	v0,20(sp)
+    1f88:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    1f8c:	afa70018 	sw	a3,24(sp)
+    1f90:	0800077a 	j	1de8 <arch_dev_init+0x68>
+    1f94:	26310001 	addiu	s1,s1,1
+    1f98:	00009821 	addu	s3,zero,zero
+    1f9c:	03c02021 	addu	a0,s8,zero
+    1fa0:	0c0006d5 	jal	1b54 <arch_dev_register>
+    1fa4:	02a02821 	addu	a1,s5,zero
+    1fa8:	8fbf0054 	lw	ra,84(sp)
+    1fac:	02601021 	addu	v0,s3,zero
+    1fb0:	8fbe0050 	lw	s8,80(sp)
+    1fb4:	8fb7004c 	lw	s7,76(sp)
+    1fb8:	8fb60048 	lw	s6,72(sp)
+    1fbc:	8fb50044 	lw	s5,68(sp)
+    1fc0:	8fb40040 	lw	s4,64(sp)
+    1fc4:	8fb3003c 	lw	s3,60(sp)
+    1fc8:	8fb20038 	lw	s2,56(sp)
+    1fcc:	8fb10034 	lw	s1,52(sp)
+    1fd0:	8fb00030 	lw	s0,48(sp)
+    1fd4:	03e00008 	jr	ra
+    1fd8:	27bd0058 	addiu	sp,sp,88
+    1fdc:	3c020004 	lui	v0,0x4
+    1fe0:	9442c960 	lhu	v0,-13984(v0)
+    1fe4:	10400009 	beqz	v0,200c <arch_dev_init+0x28c>
+    1fe8:	3c040003 	lui	a0,0x3
+    1fec:	080007fb 	j	1fec <arch_dev_init+0x26c>
+    1ff0:	00000000 	sll	zero,zero,0x0
+    1ff4:	3c030004 	lui	v1,0x4
+    1ff8:	9463c960 	lhu	v1,-13984(v1)
+    1ffc:	10600009 	beqz	v1,2024 <arch_dev_init+0x2a4>
+    2000:	3c040003 	lui	a0,0x3
+    2004:	08000801 	j	2004 <arch_dev_init+0x284>
+    2008:	00000000 	sll	zero,zero,0x0
+    200c:	8fa50020 	lw	a1,32(sp)
+    2010:	24843b94 	addiu	a0,a0,15252
+    2014:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    2018:	02203021 	addu	a2,s1,zero
+    201c:	080007fb 	j	1fec <arch_dev_init+0x26c>
+    2020:	00000000 	sll	zero,zero,0x0
+    2024:	8ca50004 	lw	a1,4(a1)
+    2028:	24843bcc 	addiu	a0,a0,15308
+    202c:	02803021 	addu	a2,s4,zero
+    2030:	02203821 	addu	a3,s1,zero
+    2034:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    2038:	afa20010 	sw	v0,16(sp)
+    203c:	08000801 	j	2004 <arch_dev_init+0x284>
+    2040:	00000000 	sll	zero,zero,0x0
+
+00002044 <arch_state_init>:
+    2044:	27bdffc0 	addiu	sp,sp,-64
+    2048:	afb00018 	sw	s0,24(sp)
+    204c:	8c870058 	lw	a3,88(a0)
+    2050:	8c90002c 	lw	s0,44(a0)
+    2054:	afb60030 	sw	s6,48(sp)
+    2058:	afb20020 	sw	s2,32(sp)
+    205c:	afb1001c 	sw	s1,28(sp)
+    2060:	afbf003c 	sw	ra,60(sp)
+    2064:	afbe0038 	sw	s8,56(sp)
+    2068:	afb70034 	sw	s7,52(sp)
+    206c:	afb5002c 	sw	s5,44(sp)
+    2070:	afb40028 	sw	s4,40(sp)
+    2074:	afb30024 	sw	s3,36(sp)
+    2078:	9205003f 	lbu	a1,63(s0)
+    207c:	00808821 	addu	s1,a0,zero
+    2080:	00071040 	sll	v0,a3,0x1
+    2084:	000720c0 	sll	a0,a3,0x3
+    2088:	9203003e 	lbu	v1,62(s0)
+    208c:	00821023 	subu	v0,a0,v0
+    2090:	26120054 	addiu	s2,s0,84
+    2094:	02421021 	addu	v0,s2,v0
+    2098:	00052a00 	sll	a1,a1,0x8
+    209c:	90530005 	lbu	s3,5(v0)
+    20a0:	90460000 	lbu	a2,0(v0)
+    20a4:	00a32825 	or	a1,a1,v1
+    20a8:	90430004 	lbu	v1,4(v0)
+    20ac:	3c020004 	lui	v0,0x4
+    20b0:	ac45bb7c 	sw	a1,-17540(v0)
+    20b4:	9204003d 	lbu	a0,61(s0)
+    20b8:	9202003c 	lbu	v0,60(s0)
+    20bc:	00042200 	sll	a0,a0,0x8
+    20c0:	00822025 	or	a0,a0,v0
+    20c4:	3c020004 	lui	v0,0x4
+    20c8:	ac44bafc 	sw	a0,-17668(v0)
+    20cc:	8a04000b 	lwl	a0,11(s0)
+    20d0:	3c020004 	lui	v0,0x4
+    20d4:	9a040008 	lwr	a0,8(s0)
+    20d8:	00139a00 	sll	s3,s3,0x8
+    20dc:	ac44bb3c 	sw	a0,-17604(v0)
+    20e0:	8e28005c 	lw	t0,92(s1)
+    20e4:	3c160004 	lui	s6,0x4
+    20e8:	3c020004 	lui	v0,0x4
+    20ec:	ac48bbbc 	sw	t0,-17476(v0)
+    20f0:	02639825 	or	s3,s3,v1
+    20f4:	10a0000e 	beqz	a1,2130 <arch_state_init+0xec>
+    20f8:	aec6c960 	sw	a2,-13984(s6)
+    20fc:	3c0b0004 	lui	t3,0x4
+    2100:	256bd5a0 	addiu	t3,t3,-10848
+    2104:	02001021 	addu	v0,s0,zero
+    2108:	00001821 	addu	v1,zero,zero
+    210c:	90490055 	lbu	t1,85(v0)
+    2110:	904a0054 	lbu	t2,84(v0)
+    2114:	24630001 	addiu	v1,v1,1
+    2118:	00094840 	sll	t1,t1,0x1
+    211c:	01694821 	addu	t1,t3,t1
+    2120:	0065402a 	slt	t0,v1,a1
+    2124:	a52a0000 	sh	t2,0(t1)
+    2128:	1500fff8 	bnez	t0,210c <arch_state_init+0xc8>
+    212c:	24420006 	addiu	v0,v0,6
+    2130:	8e25003c 	lw	a1,60(s1)
+    2134:	10a0000f 	beqz	a1,2174 <arch_state_init+0x130>
+    2138:	02001021 	addu	v0,s0,zero
+    213c:	3c0b0004 	lui	t3,0x4
+    2140:	256bc9a0 	addiu	t3,t3,-13920
+    2144:	00001821 	addu	v1,zero,zero
+    2148:	90460054 	lbu	a2,84(v0)
+    214c:	904a0055 	lbu	t2,85(v0)
+    2150:	00064080 	sll	t0,a2,0x2
+    2154:	00064900 	sll	t1,a2,0x4
+    2158:	01284823 	subu	t1,t1,t0
+    215c:	24630001 	addiu	v1,v1,1
+    2160:	01694821 	addu	t1,t3,t1
+    2164:	0065402b 	sltu	t0,v1,a1
+    2168:	ad2a0000 	sw	t2,0(t1)
+    216c:	1500fff6 	bnez	t0,2148 <arch_state_init+0x104>
+    2170:	24420006 	addiu	v0,v0,6
+    2174:	8e230050 	lw	v1,80(s1)
+    2178:	2c620005 	sltiu	v0,v1,5
+    217c:	1040001b 	beqz	v0,21ec <arch_state_init+0x1a8>
+    2180:	3c020004 	lui	v0,0x4
+    2184:	2442c950 	addiu	v0,v0,-14000
+    2188:	00031880 	sll	v1,v1,0x2
+    218c:	00431821 	addu	v1,v0,v1
+    2190:	10430005 	beq	v0,v1,21a8 <arch_state_init+0x164>
+    2194:	70872002 	mul	a0,a0,a3
+    2198:	ac440000 	sw	a0,0(v0)
+    219c:	24420004 	addiu	v0,v0,4
+    21a0:	1443fffd 	bne	v0,v1,2198 <arch_state_init+0x154>
+    21a4:	24840001 	addiu	a0,a0,1
+    21a8:	02709821 	addu	s3,s3,s0
+    21ac:	02202021 	addu	a0,s1,zero
+    21b0:	0c000973 	jal	25cc <kboot_tty_init>
+    21b4:	afa60014 	sw	a2,20(sp)
+    21b8:	8a62000c 	lwl	v0,12(s3)
+    21bc:	9a620009 	lwr	v0,9(s3)
+    21c0:	1440000c 	bnez	v0,21f4 <arch_state_init+0x1b0>
+    21c4:	8fa60014 	lw	a2,20(sp)
+    21c8:	96c2c960 	lhu	v0,-13984(s6)
+    21cc:	14400005 	bnez	v0,21e4 <arch_state_init+0x1a0>
+    21d0:	3c040003 	lui	a0,0x3
+    21d4:	3c050003 	lui	a1,0x3
+    21d8:	24843c74 	addiu	a0,a0,15476
+    21dc:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    21e0:	24a53db4 	addiu	a1,a1,15796
+    21e4:	08000879 	j	21e4 <arch_state_init+0x1a0>
+    21e8:	00000000 	sll	zero,zero,0x0
+    21ec:	0800087b 	j	21ec <arch_state_init+0x1a8>
+    21f0:	00000000 	sll	zero,zero,0x0
+    21f4:	40022002 	mfc0	v0,$4,2
+    21f8:	8c420180 	lw	v0,384(v0)
+    21fc:	3c1e0003 	lui	s8,0x3
+    2200:	afa20010 	sw	v0,16(sp)
+    2204:	27de3cf4 	addiu	s8,s8,15604
+    2208:	08000897 	j	225c <arch_state_init+0x218>
+    220c:	0000b821 	addu	s7,zero,zero
+    2210:	00009821 	addu	s3,zero,zero
+    2214:	0000a021 	addu	s4,zero,zero
+    2218:	92420002 	lbu	v0,2(s2)
+    221c:	10400003 	beqz	v0,222c <arch_state_init+0x1e8>
+    2220:	00000000 	sll	zero,zero,0x0
+    2224:	12600033 	beqz	s3,22f4 <arch_state_init+0x2b0>
+    2228:	96c2c960 	lhu	v0,-13984(s6)
+    222c:	8e220058 	lw	v0,88(s1)
+    2230:	10550022 	beq	v0,s5,22bc <arch_state_init+0x278>
+    2234:	8fa30010 	lw	v1,16(sp)
+    2238:	96c2c960 	lhu	v0,-13984(s6)
+    223c:	10400018 	beqz	v0,22a0 <arch_state_init+0x25c>
+    2240:	00000000 	sll	zero,zero,0x0
+    2244:	02a02021 	addu	a0,s5,zero
+    2248:	02802821 	addu	a1,s4,zero
+    224c:	0c001f28 	jal	7ca0 <cluster_entry_init>
+    2250:	02603021 	addu	a2,s3,zero
+    2254:	26f70001 	addiu	s7,s7,1
+    2258:	26520006 	addiu	s2,s2,6
+    225c:	8e22003c 	lw	v0,60(s1)
+    2260:	02e2102b 	sltu	v0,s7,v0
+    2264:	10400018 	beqz	v0,22c8 <arch_state_init+0x284>
+    2268:	8fbf003c 	lw	ra,60(sp)
+    226c:	92420005 	lbu	v0,5(s2)
+    2270:	92430004 	lbu	v1,4(s2)
+    2274:	00021200 	sll	v0,v0,0x8
+    2278:	00431025 	or	v0,v0,v1
+    227c:	00501021 	addu	v0,v0,s0
+    2280:	90430000 	lbu	v1,0(v0)
+    2284:	1460ffe2 	bnez	v1,2210 <arch_state_init+0x1cc>
+    2288:	92550000 	lbu	s5,0(s2)
+    228c:	88540004 	lwl	s4,4(v0)
+    2290:	8853000c 	lwl	s3,12(v0)
+    2294:	98540001 	lwr	s4,1(v0)
+    2298:	08000886 	j	2218 <arch_state_init+0x1d4>
+    229c:	98530009 	lwr	s3,9(v0)
+    22a0:	40064800 	mfc0	a2,c0_count
+    22a4:	00000000 	sll	zero,zero,0x0
+    22a8:	03c02021 	addu	a0,s8,zero
+    22ac:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    22b0:	02a02821 	addu	a1,s5,zero
+    22b4:	08000892 	j	2248 <arch_state_init+0x204>
+    22b8:	02a02021 	addu	a0,s5,zero
+    22bc:	02741021 	addu	v0,s3,s4
+    22c0:	0800088e 	j	2238 <arch_state_init+0x1f4>
+    22c4:	ac620290 	sw	v0,656(v1)
+    22c8:	8fbe0038 	lw	s8,56(sp)
+    22cc:	8fb70034 	lw	s7,52(sp)
+    22d0:	8fb60030 	lw	s6,48(sp)
+    22d4:	8fb5002c 	lw	s5,44(sp)
+    22d8:	8fb40028 	lw	s4,40(sp)
+    22dc:	8fb30024 	lw	s3,36(sp)
+    22e0:	8fb20020 	lw	s2,32(sp)
+    22e4:	8fb1001c 	lw	s1,28(sp)
+    22e8:	8fb00018 	lw	s0,24(sp)
+    22ec:	03e00008 	jr	ra
+    22f0:	27bd0040 	addiu	sp,sp,64
+    22f4:	14400006 	bnez	v0,2310 <arch_state_init+0x2cc>
+    22f8:	3c040003 	lui	a0,0x3
+    22fc:	3c050003 	lui	a1,0x3
+    2300:	24843ca8 	addiu	a0,a0,15528
+    2304:	24a53db4 	addiu	a1,a1,15796
+    2308:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    230c:	02a03021 	addu	a2,s5,zero
+    2310:	080008c4 	j	2310 <arch_state_init+0x2cc>
+    2314:	00000000 	sll	zero,zero,0x0
+
+00002318 <arch_init>:
+    2318:	27bdffb0 	addiu	sp,sp,-80
+    231c:	afb30034 	sw	s3,52(sp)
+    2320:	3c020004 	lui	v0,0x4
+    2324:	8c93002c 	lw	s3,44(a0)
+    2328:	8c4590c0 	lw	a1,-28480(v0)
+    232c:	afb1002c 	sw	s1,44(sp)
+    2330:	24060010 	addiu	a2,zero,16
+    2334:	00808821 	addu	s1,a0,zero
+    2338:	26640014 	addiu	a0,s3,20
+    233c:	afbf004c 	sw	ra,76(sp)
+    2340:	afbe0048 	sw	s8,72(sp)
+    2344:	afb70044 	sw	s7,68(sp)
+    2348:	afb60040 	sw	s6,64(sp)
+    234c:	afb5003c 	sw	s5,60(sp)
+    2350:	afb40038 	sw	s4,56(sp)
+    2354:	afb20030 	sw	s2,48(sp)
+    2358:	0c00c45b 	jal	3116c <strncmp>
+    235c:	afb00028 	sw	s0,40(sp)
+    2360:	10400003 	beqz	v0,2370 <arch_init+0x58>
+    2364:	3c050003 	lui	a1,0x3
+    2368:	080008da 	j	2368 <arch_init+0x50>
+    236c:	00000000 	sll	zero,zero,0x0
+    2370:	24a53d2c 	addiu	a1,a1,15660
+    2374:	26640026 	addiu	a0,s3,38
+    2378:	0c00c45b 	jal	3116c <strncmp>
+    237c:	24060010 	addiu	a2,zero,16
+    2380:	10400003 	beqz	v0,2390 <arch_init+0x78>
+    2384:	26700054 	addiu	s0,s3,84
+    2388:	080008e2 	j	2388 <arch_init+0x70>
+    238c:	00000000 	sll	zero,zero,0x0
+    2390:	8e230058 	lw	v1,88(s1)
+    2394:	000310c0 	sll	v0,v1,0x3
+    2398:	00031840 	sll	v1,v1,0x1
+    239c:	00431023 	subu	v0,v0,v1
+    23a0:	02021021 	addu	v0,s0,v0
+    23a4:	90540005 	lbu	s4,5(v0)
+    23a8:	90430004 	lbu	v1,4(v0)
+    23ac:	0014a200 	sll	s4,s4,0x8
+    23b0:	90520000 	lbu	s2,0(v0)
+    23b4:	0283a025 	or	s4,s4,v1
+    23b8:	0293a021 	addu	s4,s4,s3
+    23bc:	0c000811 	jal	2044 <arch_state_init>
+    23c0:	02202021 	addu	a0,s1,zero
+    23c4:	8a860004 	lwl	a2,4(s4)
+    23c8:	8a85000c 	lwl	a1,12(s4)
+    23cc:	00121140 	sll	v0,s2,0x5
+    23d0:	00121880 	sll	v1,s2,0x2
+    23d4:	00621821 	addu	v1,v1,v0
+    23d8:	9a850009 	lwr	a1,9(s4)
+    23dc:	9a860001 	lwr	a2,1(s4)
+    23e0:	8a870008 	lwl	a3,8(s4)
+    23e4:	00721821 	addu	v1,v1,s2
+    23e8:	3c150004 	lui	s5,0x4
+    23ec:	26b5d9a0 	addiu	s5,s5,-9824
+    23f0:	00031880 	sll	v1,v1,0x2
+    23f4:	9a870005 	lwr	a3,5(s4)
+    23f8:	00a61021 	addu	v0,a1,a2
+    23fc:	02a31821 	addu	v1,s5,v1
+    2400:	8c630004 	lw	v1,4(v1)
+    2404:	0045282b 	sltu	a1,v0,a1
+    2408:	00a72821 	addu	a1,a1,a3
+    240c:	02202021 	addu	a0,s1,zero
+    2410:	afa20010 	sw	v0,16(sp)
+    2414:	afa50014 	sw	a1,20(sp)
+    2418:	0c001e53 	jal	794c <cluster_init>
+    241c:	afa30018 	sw	v1,24(sp)
+    2420:	1040000b 	beqz	v0,2450 <arch_init+0x138>
+    2424:	3c1e0004 	lui	s8,0x4
+    2428:	3c030004 	lui	v1,0x4
+    242c:	9463c960 	lhu	v1,-13984(v1)
+    2430:	14600005 	bnez	v1,2448 <arch_init+0x130>
+    2434:	3c040003 	lui	a0,0x3
+    2438:	24843d38 	addiu	a0,a0,15672
+    243c:	02402821 	addu	a1,s2,zero
+    2440:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    2444:	00403021 	addu	a2,v0,zero
+    2448:	08000912 	j	2448 <arch_init+0x130>
+    244c:	00000000 	sll	zero,zero,0x0
+    2450:	8e23003c 	lw	v1,60(s1)
+    2454:	27c26db0 	addiu	v0,s8,28080
+    2458:	ac43040c 	sw	v1,1036(v0)
+    245c:	0000b821 	addu	s7,zero,zero
+    2460:	0000b021 	addu	s6,zero,zero
+    2464:	08000934 	j	24d0 <arch_init+0x1b8>
+    2468:	00009021 	addu	s2,zero,zero
+    246c:	92030005 	lbu	v1,5(s0)
+    2470:	3c050004 	lui	a1,0x4
+    2474:	92040004 	lbu	a0,4(s0)
+    2478:	94a2c960 	lhu	v0,-13984(a1)
+    247c:	00031a00 	sll	v1,v1,0x8
+    2480:	00641825 	or	v1,v1,a0
+    2484:	10400022 	beqz	v0,2510 <arch_init+0x1f8>
+    2488:	92140000 	lbu	s4,0(s0)
+    248c:	00141140 	sll	v0,s4,0x5
+    2490:	00142880 	sll	a1,s4,0x2
+    2494:	00a22821 	addu	a1,a1,v0
+    2498:	00b42821 	addu	a1,a1,s4
+    249c:	00052880 	sll	a1,a1,0x2
+    24a0:	3c040004 	lui	a0,0x4
+    24a4:	00733021 	addu	a2,v1,s3
+    24a8:	02003821 	addu	a3,s0,zero
+    24ac:	24846db0 	addiu	a0,a0,28080
+    24b0:	0c000760 	jal	1d80 <arch_dev_init>
+    24b4:	02a52821 	addu	a1,s5,a1
+    24b8:	24040001 	addiu	a0,zero,1
+    24bc:	8e23003c 	lw	v1,60(s1)
+    24c0:	0282900b 	movn	s2,s4,v0
+    24c4:	0082b00b 	movn	s6,a0,v0
+    24c8:	26f70001 	addiu	s7,s7,1
+    24cc:	26100006 	addiu	s0,s0,6
+    24d0:	02e3182b 	sltu	v1,s7,v1
+    24d4:	1460ffe5 	bnez	v1,246c <arch_init+0x154>
+    24d8:	00000000 	sll	zero,zero,0x0
+    24dc:	16c00015 	bnez	s6,2534 <arch_init+0x21c>
+    24e0:	8fbf004c 	lw	ra,76(sp)
+    24e4:	8fbe0048 	lw	s8,72(sp)
+    24e8:	8fb70044 	lw	s7,68(sp)
+    24ec:	8fb60040 	lw	s6,64(sp)
+    24f0:	8fb5003c 	lw	s5,60(sp)
+    24f4:	8fb40038 	lw	s4,56(sp)
+    24f8:	8fb30034 	lw	s3,52(sp)
+    24fc:	8fb20030 	lw	s2,48(sp)
+    2500:	8fb1002c 	lw	s1,44(sp)
+    2504:	8fb00028 	lw	s0,40(sp)
+    2508:	03e00008 	jr	ra
+    250c:	27bd0050 	addiu	sp,sp,80
+    2510:	40064800 	mfc0	a2,c0_count
+    2514:	00000000 	sll	zero,zero,0x0
+    2518:	3c040003 	lui	a0,0x3
+    251c:	24843d68 	addiu	a0,a0,15720
+    2520:	02802821 	addu	a1,s4,zero
+    2524:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    2528:	afa30020 	sw	v1,32(sp)
+    252c:	08000923 	j	248c <arch_init+0x174>
+    2530:	8fa30020 	lw	v1,32(sp)
+    2534:	00122880 	sll	a1,s2,0x2
+    2538:	00121140 	sll	v0,s2,0x5
+    253c:	00a22821 	addu	a1,a1,v0
+    2540:	00b22821 	addu	a1,a1,s2
+    2544:	00052880 	sll	a1,a1,0x2
+    2548:	02a52821 	addu	a1,s5,a1
+    254c:	27c46db0 	addiu	a0,s8,28080
+    2550:	8fbe0048 	lw	s8,72(sp)
+    2554:	8fb70044 	lw	s7,68(sp)
+    2558:	8fb60040 	lw	s6,64(sp)
+    255c:	8fb5003c 	lw	s5,60(sp)
+    2560:	8fb40038 	lw	s4,56(sp)
+    2564:	8fb30034 	lw	s3,52(sp)
+    2568:	8fb20030 	lw	s2,48(sp)
+    256c:	8fb1002c 	lw	s1,44(sp)
+    2570:	8fb00028 	lw	s0,40(sp)
+    2574:	0800064a 	j	1928 <arch_dev_iopic_register>
+    2578:	27bd0050 	addiu	sp,sp,80
+
+0000257c <kdmsg_init>:
+    257c:	3c030004 	lui	v1,0x4
+    2580:	2463bc18 	addiu	v1,v1,-17384
+    2584:	00001021 	addu	v0,zero,zero
+    2588:	08000966 	j	2598 <kdmsg_init+0x1c>
+    258c:	24050020 	addiu	a1,zero,32
+    2590:	10450007 	beq	v0,a1,25b0 <kdmsg_init+0x34>
+    2594:	24630004 	addiu	v1,v1,4
+    2598:	8c640000 	lw	a0,0(v1)
+    259c:	1480fffc 	bnez	a0,2590 <kdmsg_init+0x14>
+    25a0:	24420001 	addiu	v0,v0,1
+    25a4:	2c420003 	sltiu	v0,v0,3
+    25a8:	14400006 	bnez	v0,25c4 <kdmsg_init+0x48>
+    25ac:	00000000 	sll	zero,zero,0x0
+    25b0:	24020003 	addiu	v0,zero,3
+    25b4:	3c030004 	lui	v1,0x4
+    25b8:	ac629180 	sw	v0,-28288(v1)
+    25bc:	3c030004 	lui	v1,0x4
+    25c0:	ac629140 	sw	v0,-28352(v1)
+    25c4:	03e00008 	jr	ra
+    25c8:	00000000 	sll	zero,zero,0x0
+
+000025cc <kboot_tty_init>:
+    25cc:	8c850044 	lw	a1,68(a0)
+    25d0:	8c83005c 	lw	v1,92(a0)
+    25d4:	3c020008 	lui	v0,0x8
+    25d8:	8c840048 	lw	a0,72(a0)
+    25dc:	ac4526dc 	sw	a1,9948(v0)
+    25e0:	3c020008 	lui	v0,0x8
+    25e4:	ac4426d8 	sw	a0,9944(v0)
+    25e8:	3c020008 	lui	v0,0x8
+    25ec:	03e00008 	jr	ra
+    25f0:	ac4326e0 	sw	v1,9952(v0)
+
+000025f4 <__perror>:
+    25f4:	3c020004 	lui	v0,0x4
+    25f8:	8c439180 	lw	v1,-28288(v0)
+    25fc:	3c020004 	lui	v0,0x4
+    2600:	00031880 	sll	v1,v1,0x2
+    2604:	2442bc18 	addiu	v0,v0,-17384
+    2608:	00621021 	addu	v0,v1,v0
+    260c:	27bdffd8 	addiu	sp,sp,-40
+    2610:	8c420000 	lw	v0,0(v0)
+    2614:	afa60030 	sw	a2,48(sp)
+    2618:	afa70034 	sw	a3,52(sp)
+    261c:	8c430018 	lw	v1,24(v0)
+    2620:	8c420010 	lw	v0,16(v0)
+    2624:	afb00020 	sw	s0,32(sp)
+    2628:	00a03821 	addu	a3,a1,zero
+    262c:	00808021 	addu	s0,a0,zero
+    2630:	00602821 	addu	a1,v1,zero
+    2634:	00402021 	addu	a0,v0,zero
+    2638:	00003021 	addu	a2,zero,zero
+    263c:	27a20030 	addiu	v0,sp,48
+    2640:	afbf0024 	sw	ra,36(sp)
+    2644:	afa20010 	sw	v0,16(sp)
+    2648:	0c00bbbe 	jal	2eef8 <iprintk>
+    264c:	afa20018 	sw	v0,24(sp)
+    2650:	12000003 	beqz	s0,2660 <__perror+0x6c>
+    2654:	8fbf0024 	lw	ra,36(sp)
+    2658:	08000996 	j	2658 <__perror+0x64>
+    265c:	00000000 	sll	zero,zero,0x0
+    2660:	8fb00020 	lw	s0,32(sp)
+    2664:	03e00008 	jr	ra
+    2668:	27bd0028 	addiu	sp,sp,40
+
+0000266c <early_boot_dmsg>:
+    266c:	3c020008 	lui	v0,0x8
+    2670:	8c4826dc 	lw	t0,9948(v0)
+    2674:	3c020008 	lui	v0,0x8
+    2678:	8c4326d8 	lw	v1,9944(v0)
+    267c:	27bdffd8 	addiu	sp,sp,-40
+    2680:	00801021 	addu	v0,a0,zero
+    2684:	afa5002c 	sw	a1,44(sp)
+    2688:	afa60030 	sw	a2,48(sp)
+    268c:	afa70034 	sw	a3,52(sp)
+    2690:	01002021 	addu	a0,t0,zero
+    2694:	00403821 	addu	a3,v0,zero
+    2698:	00602821 	addu	a1,v1,zero
+    269c:	27a2002c 	addiu	v0,sp,44
+    26a0:	00003021 	addu	a2,zero,zero
+    26a4:	afbf0024 	sw	ra,36(sp)
+    26a8:	afa20010 	sw	v0,16(sp)
+    26ac:	0c00bbbe 	jal	2eef8 <iprintk>
+    26b0:	afa20018 	sw	v0,24(sp)
+    26b4:	8fbf0024 	lw	ra,36(sp)
+    26b8:	03e00008 	jr	ra
+    26bc:	27bd0028 	addiu	sp,sp,40
+
+000026c0 <__fprintk>:
+    26c0:	27bdffc8 	addiu	sp,sp,-56
+    26c4:	27a30044 	addiu	v1,sp,68
+    26c8:	2ca20002 	sltiu	v0,a1,2
+    26cc:	afb10030 	sw	s1,48(sp)
+    26d0:	afbf0034 	sw	ra,52(sp)
+    26d4:	afb0002c 	sw	s0,44(sp)
+    26d8:	afa70044 	sw	a3,68(sp)
+    26dc:	afa30018 	sw	v1,24(sp)
+    26e0:	14400012 	bnez	v0,272c <__fprintk+0x6c>
+    26e4:	00808821 	addu	s1,a0,zero
+    26e8:	3c020004 	lui	v0,0x4
+    26ec:	2442bc18 	addiu	v0,v0,-17384
+    26f0:	00118880 	sll	s1,s1,0x2
+    26f4:	02228821 	addu	s1,s1,v0
+    26f8:	8e220000 	lw	v0,0(s1)
+    26fc:	00c03821 	addu	a3,a2,zero
+    2700:	8c450018 	lw	a1,24(v0)
+    2704:	8c440010 	lw	a0,16(v0)
+    2708:	8fa20018 	lw	v0,24(sp)
+    270c:	00003021 	addu	a2,zero,zero
+    2710:	0c00bbbe 	jal	2eef8 <iprintk>
+    2714:	afa20010 	sw	v0,16(sp)
+    2718:	8fbf0034 	lw	ra,52(sp)
+    271c:	8fb10030 	lw	s1,48(sp)
+    2720:	8fb0002c 	lw	s0,44(sp)
+    2724:	03e00008 	jr	ra
+    2728:	27bd0038 	addiu	sp,sp,56
+    272c:	3c020003 	lui	v0,0x3
+    2730:	00052880 	sll	a1,a1,0x2
+    2734:	24423de8 	addiu	v0,v0,15848
+    2738:	00a22821 	addu	a1,a1,v0
+    273c:	8cb00000 	lw	s0,0(a1)
+    2740:	1200ffe9 	beqz	s0,26e8 <__fprintk+0x28>
+    2744:	02002021 	addu	a0,s0,zero
+    2748:	0c0022e4 	jal	8b90 <distlock_lock>
+    274c:	afa60020 	sw	a2,32(sp)
+    2750:	3c020004 	lui	v0,0x4
+    2754:	2442bc18 	addiu	v0,v0,-17384
+    2758:	00118880 	sll	s1,s1,0x2
+    275c:	02228821 	addu	s1,s1,v0
+    2760:	8e220000 	lw	v0,0(s1)
+    2764:	8fa60020 	lw	a2,32(sp)
+    2768:	8c450018 	lw	a1,24(v0)
+    276c:	8c440010 	lw	a0,16(v0)
+    2770:	8fa20018 	lw	v0,24(sp)
+    2774:	00c03821 	addu	a3,a2,zero
+    2778:	00003021 	addu	a2,zero,zero
+    277c:	0c00bbbe 	jal	2eef8 <iprintk>
+    2780:	afa20010 	sw	v0,16(sp)
+    2784:	02002021 	addu	a0,s0,zero
+    2788:	0c00225f 	jal	897c <distlock_unlock>
+    278c:	afa20020 	sw	v0,32(sp)
+    2790:	8fbf0034 	lw	ra,52(sp)
+    2794:	8fa20020 	lw	v0,32(sp)
+    2798:	8fb10030 	lw	s1,48(sp)
+    279c:	8fb0002c 	lw	s0,44(sp)
+    27a0:	03e00008 	jr	ra
+    27a4:	27bd0038 	addiu	sp,sp,56
+
+000027a8 <__arch_boot_dmsg>:
+    27a8:	27bdffc8 	addiu	sp,sp,-56
+    27ac:	afb0002c 	sw	s0,44(sp)
+    27b0:	3c100004 	lui	s0,0x4
+    27b4:	27a2003c 	addiu	v0,sp,60
+    27b8:	afb10030 	sw	s1,48(sp)
+    27bc:	00808821 	addu	s1,a0,zero
+    27c0:	260490f0 	addiu	a0,s0,-28432
+    27c4:	afbf0034 	sw	ra,52(sp)
+    27c8:	afa5003c 	sw	a1,60(sp)
+    27cc:	afa60040 	sw	a2,64(sp)
+    27d0:	afa70044 	sw	a3,68(sp)
+    27d4:	0c0022e4 	jal	8b90 <distlock_lock>
+    27d8:	afa20018 	sw	v0,24(sp)
+    27dc:	3c020008 	lui	v0,0x8
+    27e0:	8c4426dc 	lw	a0,9948(v0)
+    27e4:	3c020008 	lui	v0,0x8
+    27e8:	8c4526d8 	lw	a1,9944(v0)
+    27ec:	8fa20018 	lw	v0,24(sp)
+    27f0:	02203821 	addu	a3,s1,zero
+    27f4:	00003021 	addu	a2,zero,zero
+    27f8:	0c00bbbe 	jal	2eef8 <iprintk>
+    27fc:	afa20010 	sw	v0,16(sp)
+    2800:	260490f0 	addiu	a0,s0,-28432
+    2804:	0c00225f 	jal	897c <distlock_unlock>
+    2808:	afa20020 	sw	v0,32(sp)
+    280c:	8fbf0034 	lw	ra,52(sp)
+    2810:	8fa20020 	lw	v0,32(sp)
+    2814:	8fb10030 	lw	s1,48(sp)
+    2818:	8fb0002c 	lw	s0,44(sp)
+    281c:	03e00008 	jr	ra
+    2820:	27bd0038 	addiu	sp,sp,56
+
+00002824 <mmu_except_get_entry>:
+    2824:	3c030004 	lui	v1,0x4
+    2828:	8c6291c0 	lw	v0,-28224(v1)
+    282c:	1040000f 	beqz	v0,286c <mmu_except_get_entry+0x48>
+    2830:	00000000 	sll	zero,zero,0x0
+    2834:	1044000d 	beq	v0,a0,286c <mmu_except_get_entry+0x48>
+    2838:	00003021 	addu	a2,zero,zero
+    283c:	3c020004 	lui	v0,0x4
+    2840:	08000a14 	j	2850 <mmu_except_get_entry+0x2c>
+    2844:	244291d0 	addiu	v0,v0,-28208
+    2848:	10a40004 	beq	a1,a0,285c <mmu_except_get_entry+0x38>
+    284c:	24420010 	addiu	v0,v0,16
+    2850:	8c450000 	lw	a1,0(v0)
+    2854:	14a0fffc 	bnez	a1,2848 <mmu_except_get_entry+0x24>
+    2858:	24c60001 	addiu	a2,a2,1
+    285c:	00063100 	sll	a2,a2,0x4
+    2860:	246391c0 	addiu	v1,v1,-28224
+    2864:	03e00008 	jr	ra
+    2868:	00661021 	addu	v0,v1,a2
+    286c:	03e00008 	jr	ra
+    2870:	246291c0 	addiu	v0,v1,-28224
+
+00002874 <pmm_ppn2ppm>:
+    2874:	3c020004 	lui	v0,0x4
+    2878:	03e00008 	jr	ra
+    287c:	24426e60 	addiu	v0,v0,28256
+
+00002880 <pmm_ppn2vma>:
+    2880:	03e00008 	jr	ra
+    2884:	00041300 	sll	v0,a0,0xc
+
+00002888 <pmm_ppn2cid>:
+    2888:	00042502 	srl	a0,a0,0x14
+    288c:	3c020004 	lui	v0,0x4
+    2890:	2442d5a0 	addiu	v0,v0,-10848
+    2894:	00042040 	sll	a0,a0,0x1
+    2898:	00822021 	addu	a0,a0,v0
+    289c:	03e00008 	jr	ra
+    28a0:	94820000 	lhu	v0,0(a0)
+
+000028a4 <pmm_bootstrap_init>:
+    28a4:	24020001 	addiu	v0,zero,1
+    28a8:	ac820004 	sw	v0,4(a0)
+    28ac:	ac850000 	sw	a1,0(a0)
+    28b0:	03e00008 	jr	ra
+    28b4:	00001021 	addu	v0,zero,zero
+    28b8:	00051542 	srl	v0,a1,0x15
+    28bc:	00021080 	sll	v0,v0,0x2
+    28c0:	00821021 	addu	v0,a0,v0
+    28c4:	8c420000 	lw	v0,0(v0)
+    28c8:	04400005 	bltz	v0,28e0 <pmm_bootstrap_init+0x3c>
+    28cc:	3c034000 	lui	v1,0x4000
+    28d0:	acc00004 	sw	zero,4(a2)
+    28d4:	acc00000 	sw	zero,0(a2)
+    28d8:	03e00008 	jr	ra
+    28dc:	00001021 	addu	v0,zero,zero
+    28e0:	00432024 	and	a0,v0,v1
+    28e4:	10800010 	beqz	a0,2928 <pmm_bootstrap_init+0x84>
+    28e8:	3c04001f 	lui	a0,0x1f
+    28ec:	3c030fff 	lui	v1,0xfff
+    28f0:	3463ffff 	ori	v1,v1,0xffff
+    28f4:	3484f000 	ori	a0,a0,0xf000
+    28f8:	00a42824 	and	a1,a1,a0
+    28fc:	00431024 	and	v0,v0,v1
+    2900:	00052a42 	srl	a1,a1,0x9
+    2904:	00021300 	sll	v0,v0,0xc
+    2908:	00451021 	addu	v0,v0,a1
+    290c:	8c440004 	lw	a0,4(v0)
+    2910:	00831824 	and	v1,a0,v1
+    2914:	acc30004 	sw	v1,4(a2)
+    2918:	8c420000 	lw	v0,0(v0)
+    291c:	acc20000 	sw	v0,0(a2)
+    2920:	03e00008 	jr	ra
+    2924:	00001021 	addu	v0,zero,zero
+    2928:	3484ffff 	ori	a0,a0,0xffff
+    292c:	00a42824 	and	a1,a1,a0
+    2930:	00022540 	sll	a0,v0,0x15
+    2934:	00852825 	or	a1,a0,a1
+    2938:	3c04bfc0 	lui	a0,0xbfc0
+    293c:	00441024 	and	v0,v0,a0
+    2940:	00431825 	or	v1,v0,v1
+    2944:	00052b02 	srl	a1,a1,0xc
+    2948:	acc50004 	sw	a1,4(a2)
+    294c:	acc30000 	sw	v1,0(a2)
+    2950:	03e00008 	jr	ra
+    2954:	00001021 	addu	v0,zero,zero
+
+00002958 <pmm_get_page>:
+    2958:	08000a2e 	j	28b8 <pmm_bootstrap_init+0x14>
+    295c:	8c840000 	lw	a0,0(a0)
+
+00002960 <pmm_unlock_page>:
+    2960:	8cc20010 	lw	v0,16(a2)
+    2964:	24040001 	addiu	a0,zero,1
+    2968:	8c430000 	lw	v1,0(v0)
+    296c:	acc00000 	sw	zero,0(a2)
+    2970:	8c430004 	lw	v1,4(v0)
+    2974:	acc4000c 	sw	a0,12(a2)
+    2978:	acc30004 	sw	v1,4(a2)
+    297c:	ac400000 	sw	zero,0(v0)
+    2980:	03e00008 	jr	ra
+    2984:	00001021 	addu	v0,zero,zero
+
+00002988 <pmm_region_unmap>:
+    2988:	03e00008 	jr	ra
+    298c:	00001021 	addu	v0,zero,zero
+
+00002990 <pmm_tlb_enable>:
+    2990:	30820001 	andi	v0,a0,0x1
+    2994:	10400005 	beqz	v0,29ac <pmm_tlb_enable+0x1c>
+    2998:	00000000 	sll	zero,zero,0x0
+    299c:	48020800 	mfc2	v0,$1
+    29a0:	30420007 	andi	v0,v0,0x7
+    29a4:	34420008 	ori	v0,v0,0x8
+    29a8:	48820800 	mtc2	v0,$1
+    29ac:	30840002 	andi	a0,a0,0x2
+    29b0:	10800005 	beqz	a0,29c8 <pmm_tlb_enable+0x38>
+    29b4:	00000000 	sll	zero,zero,0x0
+    29b8:	48020800 	mfc2	v0,$1
+    29bc:	3042000b 	andi	v0,v0,0xb
+    29c0:	34420004 	ori	v0,v0,0x4
+    29c4:	48820800 	mtc2	v0,$1
+    29c8:	03e00008 	jr	ra
+    29cc:	00000000 	sll	zero,zero,0x0
+
+000029d0 <pmm_tlb_disable>:
+    29d0:	30820001 	andi	v0,a0,0x1
+    29d4:	10400004 	beqz	v0,29e8 <pmm_tlb_disable+0x18>
+    29d8:	00000000 	sll	zero,zero,0x0
+    29dc:	48020800 	mfc2	v0,$1
+    29e0:	30420007 	andi	v0,v0,0x7
+    29e4:	48820800 	mtc2	v0,$1
+    29e8:	30840002 	andi	a0,a0,0x2
+    29ec:	10800004 	beqz	a0,2a00 <pmm_tlb_disable+0x30>
+    29f0:	00000000 	sll	zero,zero,0x0
+    29f4:	48020800 	mfc2	v0,$1
+    29f8:	30420003 	andi	v0,v0,0x3
+    29fc:	48820800 	mtc2	v0,$1
+    2a00:	03e00008 	jr	ra
+    2a04:	00000000 	sll	zero,zero,0x0
+
+00002a08 <pmm_tlb_flush_vaddr>:
+    2a08:	30a20001 	andi	v0,a1,0x1
+    2a0c:	10400002 	beqz	v0,2a18 <pmm_tlb_flush_vaddr+0x10>
+    2a10:	00000000 	sll	zero,zero,0x0
+    2a14:	48842000 	mtc2	a0,$4
+    2a18:	30a50002 	andi	a1,a1,0x2
+    2a1c:	10a00002 	beqz	a1,2a28 <pmm_tlb_flush_vaddr+0x20>
+    2a20:	00000000 	sll	zero,zero,0x0
+    2a24:	48842800 	mtc2	a0,$5
+    2a28:	03e00008 	jr	ra
+    2a2c:	00000000 	sll	zero,zero,0x0
+
+00002a30 <pmm_cache_flush_vaddr>:
+    2a30:	30a20001 	andi	v0,a1,0x1
+    2a34:	10400002 	beqz	v0,2a40 <pmm_cache_flush_vaddr+0x10>
+    2a38:	00000000 	sll	zero,zero,0x0
+    2a3c:	48843000 	mtc2	a0,$6
+    2a40:	30a50002 	andi	a1,a1,0x2
+    2a44:	10a00002 	beqz	a1,2a50 <pmm_cache_flush_vaddr+0x20>
+    2a48:	00000000 	sll	zero,zero,0x0
+    2a4c:	48843800 	mtc2	a0,$7
+    2a50:	03e00008 	jr	ra
+    2a54:	00000000 	sll	zero,zero,0x0
+
+00002a58 <pmm_cache_flush_raddr>:
+    2a58:	30c20001 	andi	v0,a2,0x1
+    2a5c:	10400002 	beqz	v0,2a68 <pmm_cache_flush_raddr+0x10>
+    2a60:	00001021 	addu	v0,zero,zero
+    2a64:	48821000 	mtc2	v0,$2
+    2a68:	30c60002 	andi	a2,a2,0x2
+    2a6c:	10c00002 	beqz	a2,2a78 <pmm_cache_flush_raddr+0x20>
+    2a70:	00001021 	addu	v0,zero,zero
+    2a74:	48821800 	mtc2	v0,$3
+    2a78:	03e00008 	jr	ra
+    2a7c:	00000000 	sll	zero,zero,0x0
+
+00002a80 <pmm_cache_flush>:
+    2a80:	30820001 	andi	v0,a0,0x1
+    2a84:	10400002 	beqz	v0,2a90 <pmm_cache_flush+0x10>
+    2a88:	00001021 	addu	v0,zero,zero
+    2a8c:	48821000 	mtc2	v0,$2
+    2a90:	30840002 	andi	a0,a0,0x2
+    2a94:	10800002 	beqz	a0,2aa0 <pmm_cache_flush+0x20>
+    2a98:	00001021 	addu	v0,zero,zero
+    2a9c:	48821800 	mtc2	v0,$3
+    2aa0:	03e00008 	jr	ra
+    2aa4:	00000000 	sll	zero,zero,0x0
+
+00002aa8 <pmm_print>:
+    2aa8:	27bdffc8 	addiu	sp,sp,-56
+    2aac:	afbf0034 	sw	ra,52(sp)
+    2ab0:	afb50030 	sw	s5,48(sp)
+    2ab4:	afb4002c 	sw	s4,44(sp)
+    2ab8:	afb30028 	sw	s3,40(sp)
+    2abc:	afb20024 	sw	s2,36(sp)
+    2ac0:	afb10020 	sw	s1,32(sp)
+    2ac4:	afb0001c 	sw	s0,28(sp)
+    2ac8:	40037801 	mfc0	v1,$15,1
+    2acc:	3c020004 	lui	v0,0x4
+    2ad0:	30630003 	andi	v1,v1,0x3
+    2ad4:	00031880 	sll	v1,v1,0x2
+    2ad8:	2442c950 	addiu	v0,v0,-14000
+    2adc:	00621021 	addu	v0,v1,v0
+    2ae0:	3c140003 	lui	s4,0x3
+    2ae4:	8c550000 	lw	s5,0(v0)
+    2ae8:	8c910000 	lw	s1,0(a0)
+    2aec:	26944358 	addiu	s4,s4,17240
+    2af0:	00008021 	addu	s0,zero,zero
+    2af4:	3c130004 	lui	s3,0x4
+    2af8:	08000ac3 	j	2b0c <pmm_print+0x64>
+    2afc:	24120800 	addiu	s2,zero,2048
+    2b00:	26100001 	addiu	s0,s0,1
+    2b04:	1212000e 	beq	s0,s2,2b40 <pmm_print+0x98>
+    2b08:	8fbf0034 	lw	ra,52(sp)
+    2b0c:	8e220000 	lw	v0,0(s1)
+    2b10:	1040fffb 	beqz	v0,2b00 <pmm_print+0x58>
+    2b14:	26310004 	addiu	s1,s1,4
+    2b18:	8e649100 	lw	a0,-28416(s3)
+    2b1c:	afb00010 	sw	s0,16(sp)
+    2b20:	00002821 	addu	a1,zero,zero
+    2b24:	02803021 	addu	a2,s4,zero
+    2b28:	02a03821 	addu	a3,s5,zero
+    2b2c:	26100001 	addiu	s0,s0,1
+    2b30:	0c0009b0 	jal	26c0 <__fprintk>
+    2b34:	afa20014 	sw	v0,20(sp)
+    2b38:	1612fff4 	bne	s0,s2,2b0c <pmm_print+0x64>
+    2b3c:	8fbf0034 	lw	ra,52(sp)
+    2b40:	8fb50030 	lw	s5,48(sp)
+    2b44:	8fb4002c 	lw	s4,44(sp)
+    2b48:	8fb30028 	lw	s3,40(sp)
+    2b4c:	8fb20024 	lw	s2,36(sp)
+    2b50:	8fb10020 	lw	s1,32(sp)
+    2b54:	8fb0001c 	lw	s0,28(sp)
+    2b58:	03e00008 	jr	ra
+    2b5c:	27bd0038 	addiu	sp,sp,56
+
+00002b60 <pmm_region_dup>:
+    2b60:	8ca20000 	lw	v0,0(a1)
+    2b64:	00063542 	srl	a2,a2,0x15
+    2b68:	8c840000 	lw	a0,0(a0)
+    2b6c:	00062880 	sll	a1,a2,0x2
+    2b70:	24062000 	addiu	a2,zero,8192
+    2b74:	27bdffe8 	addiu	sp,sp,-24
+    2b78:	00c53023 	subu	a2,a2,a1
+    2b7c:	00852021 	addu	a0,a0,a1
+    2b80:	afbf0014 	sw	ra,20(sp)
+    2b84:	0c00c12b 	jal	304ac <memcpy>
+    2b88:	00452821 	addu	a1,v0,a1
+    2b8c:	8fbf0014 	lw	ra,20(sp)
+    2b90:	00001021 	addu	v0,zero,zero
+    2b94:	03e00008 	jr	ra
+    2b98:	27bd0018 	addiu	sp,sp,24
+
+00002b9c <pmm_destroy>:
+    2b9c:	27bdffd8 	addiu	sp,sp,-40
+    2ba0:	8c82000c 	lw	v0,12(a0)
+    2ba4:	27a40010 	addiu	a0,sp,16
+    2ba8:	afbf0024 	sw	ra,36(sp)
+    2bac:	afa2001c 	sw	v0,28(sp)
+    2bb0:	0c007134 	jal	1c4d0 <kmem_free>
+    2bb4:	afa00010 	sw	zero,16(sp)
+    2bb8:	8fbf0024 	lw	ra,36(sp)
+    2bbc:	00001021 	addu	v0,zero,zero
+    2bc0:	03e00008 	jr	ra
+    2bc4:	27bd0028 	addiu	sp,sp,40
+
+00002bc8 <pmm_alloc_pages>:
+    2bc8:	27bdffd0 	addiu	sp,sp,-48
+    2bcc:	3c020055 	lui	v0,0x55
+    2bd0:	afa4001c 	sw	a0,28(sp)
+    2bd4:	34420020 	ori	v0,v0,0x20
+    2bd8:	27a40010 	addiu	a0,sp,16
+    2bdc:	afb20028 	sw	s2,40(sp)
+    2be0:	afb10024 	sw	s1,36(sp)
+    2be4:	afb00020 	sw	s0,32(sp)
+    2be8:	afbf002c 	sw	ra,44(sp)
+    2bec:	afa50014 	sw	a1,20(sp)
+    2bf0:	afa20018 	sw	v0,24(sp)
+    2bf4:	00c08021 	addu	s0,a2,zero
+    2bf8:	00e09021 	addu	s2,a3,zero
+    2bfc:	0c00713f 	jal	1c4fc <kmem_alloc>
+    2c00:	afa00010 	sw	zero,16(sp)
+    2c04:	1040000b 	beqz	v0,2c34 <pmm_alloc_pages+0x6c>
+    2c08:	00408821 	addu	s1,v0,zero
+    2c0c:	12000004 	beqz	s0,2c20 <pmm_alloc_pages+0x58>
+    2c10:	00000000 	sll	zero,zero,0x0
+    2c14:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+    2c18:	00402021 	addu	a0,v0,zero
+    2c1c:	ae020000 	sw	v0,0(s0)
+    2c20:	12400005 	beqz	s2,2c38 <pmm_alloc_pages+0x70>
+    2c24:	8fbf002c 	lw	ra,44(sp)
+    2c28:	0c007c15 	jal	1f054 <ppm_page2addr>
+    2c2c:	02202021 	addu	a0,s1,zero
+    2c30:	ae420000 	sw	v0,0(s2)
+    2c34:	8fbf002c 	lw	ra,44(sp)
+    2c38:	02201021 	addu	v0,s1,zero
+    2c3c:	8fb20028 	lw	s2,40(sp)
+    2c40:	8fb10024 	lw	s1,36(sp)
+    2c44:	8fb00020 	lw	s0,32(sp)
+    2c48:	03e00008 	jr	ra
+    2c4c:	27bd0030 	addiu	sp,sp,48
+
+00002c50 <pmm_lock_page>:
+    2c50:	27bdffd8 	addiu	sp,sp,-40
+    2c54:	8c820000 	lw	v0,0(a0)
+    2c58:	afb00018 	sw	s0,24(sp)
+    2c5c:	00058542 	srl	s0,a1,0x15
+    2c60:	00108080 	sll	s0,s0,0x2
+    2c64:	00508021 	addu	s0,v0,s0
+    2c68:	8e020000 	lw	v0,0(s0)
+    2c6c:	afb20020 	sw	s2,32(sp)
+    2c70:	afb1001c 	sw	s1,28(sp)
+    2c74:	afbf0024 	sw	ra,36(sp)
+    2c78:	00a09021 	addu	s2,a1,zero
+    2c7c:	00c08821 	addu	s1,a2,zero
+    2c80:	afa00010 	sw	zero,16(sp)
+    2c84:	10400037 	beqz	v0,2d64 <pmm_lock_page+0x114>
+    2c88:	afa00014 	sw	zero,20(sp)
+    2c8c:	3c034000 	lui	v1,0x4000
+    2c90:	00431824 	and	v1,v0,v1
+    2c94:	10600029 	beqz	v1,2d3c <pmm_lock_page+0xec>
+    2c98:	3c030fff 	lui	v1,0xfff
+    2c9c:	3463ffff 	ori	v1,v1,0xffff
+    2ca0:	00431024 	and	v0,v0,v1
+    2ca4:	00021b00 	sll	v1,v0,0xc
+    2ca8:	afa20014 	sw	v0,20(sp)
+    2cac:	afa30010 	sw	v1,16(sp)
+    2cb0:	3c02001f 	lui	v0,0x1f
+    2cb4:	3442f000 	ori	v0,v0,0xf000
+    2cb8:	02429024 	and	s2,s2,v0
+    2cbc:	00129242 	srl	s2,s2,0x9
+    2cc0:	00729021 	addu	s2,v1,s2
+    2cc4:	8e420000 	lw	v0,0(s2)
+    2cc8:	30430008 	andi	v1,v0,0x8
+    2ccc:	14600022 	bnez	v1,2d58 <pmm_lock_page+0x108>
+    2cd0:	34450008 	ori	a1,v0,0x8
+    2cd4:	0000000f 	sync
+    2cd8:	00054025 	or	t0,zero,a1
+    2cdc:	c2430000 	ll	v1,0(s2)
+    2ce0:	14620004 	bne	v1,v0,2cf4 <pmm_lock_page+0xa4>
+    2ce4:	24070000 	addiu	a3,zero,0
+    2ce8:	e2480000 	sc	t0,0(s2)
+    2cec:	01003825 	or	a3,t0,zero
+    2cf0:	0000000f 	sync
+    2cf4:	00e02025 	or	a0,a3,zero
+    2cf8:	1080fff6 	beqz	a0,2cd4 <pmm_lock_page+0x84>
+    2cfc:	00000000 	sll	zero,zero,0x0
+    2d00:	ae220000 	sw	v0,0(s1)
+    2d04:	8e430004 	lw	v1,4(s2)
+    2d08:	3c020fff 	lui	v0,0xfff
+    2d0c:	3442ffff 	ori	v0,v0,0xffff
+    2d10:	00621024 	and	v0,v1,v0
+    2d14:	ae220004 	sw	v0,4(s1)
+    2d18:	ae320010 	sw	s2,16(s1)
+    2d1c:	ae24000c 	sw	a0,12(s1)
+    2d20:	00001021 	addu	v0,zero,zero
+    2d24:	8fbf0024 	lw	ra,36(sp)
+    2d28:	8fb20020 	lw	s2,32(sp)
+    2d2c:	8fb1001c 	lw	s1,28(sp)
+    2d30:	8fb00018 	lw	s0,24(sp)
+    2d34:	03e00008 	jr	ra
+    2d38:	27bd0028 	addiu	sp,sp,40
+    2d3c:	8fbf0024 	lw	ra,36(sp)
+    2d40:	24020016 	addiu	v0,zero,22
+    2d44:	8fb20020 	lw	s2,32(sp)
+    2d48:	8fb1001c 	lw	s1,28(sp)
+    2d4c:	8fb00018 	lw	s0,24(sp)
+    2d50:	03e00008 	jr	ra
+    2d54:	27bd0028 	addiu	sp,sp,40
+    2d58:	8e420000 	lw	v0,0(s2)
+    2d5c:	08000b33 	j	2ccc <pmm_lock_page+0x7c>
+    2d60:	30430008 	andi	v1,v0,0x8
+    2d64:	8c840010 	lw	a0,16(a0)
+    2d68:	10800026 	beqz	a0,2e04 <pmm_lock_page+0x1b4>
+    2d6c:	00000000 	sll	zero,zero,0x0
+    2d70:	00002821 	addu	a1,zero,zero
+    2d74:	27a60014 	addiu	a2,sp,20
+    2d78:	0c000af2 	jal	2bc8 <pmm_alloc_pages>
+    2d7c:	27a70010 	addiu	a3,sp,16
+    2d80:	10400023 	beqz	v0,2e10 <pmm_lock_page+0x1c0>
+    2d84:	8fa90014 	lw	t1,20(sp)
+    2d88:	3c03c000 	lui	v1,0xc000
+    2d8c:	01234825 	or	t1,t1,v1
+    2d90:	00003021 	addu	a2,zero,zero
+    2d94:	0000000f 	sync
+    2d98:	00094025 	or	t0,zero,t1
+    2d9c:	c2030000 	ll	v1,0(s0)
+    2da0:	14660004 	bne	v1,a2,2db4 <pmm_lock_page+0x164>
+    2da4:	24070000 	addiu	a3,zero,0
+    2da8:	e2080000 	sc	t0,0(s0)
+    2dac:	01003825 	or	a3,t0,zero
+    2db0:	0000000f 	sync
+    2db4:	00e02825 	or	a1,a3,zero
+    2db8:	14a0ffbd 	bnez	a1,2cb0 <pmm_lock_page+0x60>
+    2dbc:	8fa30010 	lw	v1,16(sp)
+    2dc0:	8e030000 	lw	v1,0(s0)
+    2dc4:	1060fff3 	beqz	v1,2d94 <pmm_lock_page+0x144>
+    2dc8:	00000000 	sll	zero,zero,0x0
+    2dcc:	0c007d65 	jal	1f594 <ppm_free_pages>
+    2dd0:	00402021 	addu	a0,v0,zero
+    2dd4:	8e030000 	lw	v1,0(s0)
+    2dd8:	3c020fff 	lui	v0,0xfff
+    2ddc:	3442ffff 	ori	v0,v0,0xffff
+    2de0:	00621024 	and	v0,v1,v0
+    2de4:	afa20014 	sw	v0,20(sp)
+    2de8:	00021b00 	sll	v1,v0,0xc
+    2dec:	afa30010 	sw	v1,16(sp)
+    2df0:	40022002 	mfc0	v0,$4,2
+    2df4:	8c440200 	lw	a0,512(v0)
+    2df8:	24840001 	addiu	a0,a0,1
+    2dfc:	08000b2c 	j	2cb0 <pmm_lock_page+0x60>
+    2e00:	ac440200 	sw	a0,512(v0)
+    2e04:	3c040004 	lui	a0,0x4
+    2e08:	08000b5c 	j	2d70 <pmm_lock_page+0x120>
+    2e0c:	24846db0 	addiu	a0,a0,28080
+    2e10:	08000b49 	j	2d24 <pmm_lock_page+0xd4>
+    2e14:	2402000c 	addiu	v0,zero,12
+    2e18:	27bdffd0 	addiu	sp,sp,-48
+    2e1c:	afb20024 	sw	s2,36(sp)
+    2e20:	afbf002c 	sw	ra,44(sp)
+    2e24:	afb30028 	sw	s3,40(sp)
+    2e28:	afb10020 	sw	s1,32(sp)
+    2e2c:	afb0001c 	sw	s0,28(sp)
+    2e30:	00a09021 	addu	s2,a1,zero
+    2e34:	40027801 	mfc0	v0,$15,1
+    2e38:	8cd10000 	lw	s1,0(a2)
+    2e3c:	00058542 	srl	s0,a1,0x15
+    2e40:	00108080 	sll	s0,s0,0x2
+    2e44:	3c034000 	lui	v1,0x4000
+    2e48:	32220010 	andi	v0,s1,0x10
+    2e4c:	00908021 	addu	s0,a0,s0
+    2e50:	8cd30004 	lw	s3,4(a2)
+    2e54:	10400010 	beqz	v0,2e98 <pmm_lock_page+0x248>
+    2e58:	02232024 	and	a0,s1,v1
+    2e5c:	10800025 	beqz	a0,2ef4 <pmm_lock_page+0x2a4>
+    2e60:	00000000 	sll	zero,zero,0x0
+    2e64:	8e020000 	lw	v0,0(s0)
+    2e68:	00001821 	addu	v1,zero,zero
+    2e6c:	afa00014 	sw	zero,20(sp)
+    2e70:	ae030000 	sw	v1,0(s0)
+    2e74:	0000000f 	sync
+    2e78:	00001021 	addu	v0,zero,zero
+    2e7c:	8fbf002c 	lw	ra,44(sp)
+    2e80:	8fb30028 	lw	s3,40(sp)
+    2e84:	8fb20024 	lw	s2,36(sp)
+    2e88:	8fb10020 	lw	s1,32(sp)
+    2e8c:	8fb0001c 	lw	s0,28(sp)
+    2e90:	03e00008 	jr	ra
+    2e94:	27bd0030 	addiu	sp,sp,48
+    2e98:	afa00014 	sw	zero,20(sp)
+    2e9c:	afa00010 	sw	zero,16(sp)
+    2ea0:	10800019 	beqz	a0,2f08 <pmm_lock_page+0x2b8>
+    2ea4:	8e020000 	lw	v0,0(s0)
+    2ea8:	12600068 	beqz	s3,304c <pmm_lock_page+0x3fc>
+    2eac:	00000000 	sll	zero,zero,0x0
+    2eb0:	1040005a 	beqz	v0,301c <pmm_lock_page+0x3cc>
+    2eb4:	32240001 	andi	a0,s1,0x1
+    2eb8:	3c030004 	lui	v1,0x4
+    2ebc:	2464c960 	addiu	a0,v1,-13984
+    2ec0:	88840003 	lwl	a0,3(a0)
+    2ec4:	9864c960 	lwr	a0,-13984(v1)
+    2ec8:	3083ffff 	andi	v1,a0,0xffff
+    2ecc:	1060004c 	beqz	v1,3000 <pmm_lock_page+0x3b0>
+    2ed0:	3c040003 	lui	a0,0x3
+    2ed4:	24020016 	addiu	v0,zero,22
+    2ed8:	8fbf002c 	lw	ra,44(sp)
+    2edc:	8fb30028 	lw	s3,40(sp)
+    2ee0:	8fb20024 	lw	s2,36(sp)
+    2ee4:	8fb10020 	lw	s1,32(sp)
+    2ee8:	8fb0001c 	lw	s0,28(sp)
+    2eec:	03e00008 	jr	ra
+    2ef0:	27bd0030 	addiu	sp,sp,48
+    2ef4:	afa00014 	sw	zero,20(sp)
+    2ef8:	8e020000 	lw	v0,0(s0)
+    2efc:	afa00010 	sw	zero,16(sp)
+    2f00:	00009821 	addu	s3,zero,zero
+    2f04:	00008821 	addu	s1,zero,zero
+    2f08:	14400038 	bnez	v0,2fec <pmm_lock_page+0x39c>
+    2f0c:	3c030fff 	lui	v1,0xfff
+    2f10:	8cc40008 	lw	a0,8(a2)
+    2f14:	10800048 	beqz	a0,3038 <pmm_lock_page+0x3e8>
+    2f18:	00000000 	sll	zero,zero,0x0
+    2f1c:	00002821 	addu	a1,zero,zero
+    2f20:	27a60014 	addiu	a2,sp,20
+    2f24:	0c000af2 	jal	2bc8 <pmm_alloc_pages>
+    2f28:	27a70010 	addiu	a3,sp,16
+    2f2c:	10400045 	beqz	v0,3044 <pmm_lock_page+0x3f4>
+    2f30:	8fa90014 	lw	t1,20(sp)
+    2f34:	3c03c000 	lui	v1,0xc000
+    2f38:	01234825 	or	t1,t1,v1
+    2f3c:	00003021 	addu	a2,zero,zero
+    2f40:	0000000f 	sync
+    2f44:	00094025 	or	t0,zero,t1
+    2f48:	c2030000 	ll	v1,0(s0)
+    2f4c:	14660004 	bne	v1,a2,2f60 <pmm_lock_page+0x310>
+    2f50:	24070000 	addiu	a3,zero,0
+    2f54:	e2080000 	sc	t0,0(s0)
+    2f58:	01003825 	or	a3,t0,zero
+    2f5c:	0000000f 	sync
+    2f60:	00e02825 	or	a1,a3,zero
+    2f64:	14a00032 	bnez	a1,3030 <pmm_lock_page+0x3e0>
+    2f68:	00000000 	sll	zero,zero,0x0
+    2f6c:	8e030000 	lw	v1,0(s0)
+    2f70:	1060fff3 	beqz	v1,2f40 <pmm_lock_page+0x2f0>
+    2f74:	00000000 	sll	zero,zero,0x0
+    2f78:	0c007d65 	jal	1f594 <ppm_free_pages>
+    2f7c:	00402021 	addu	a0,v0,zero
+    2f80:	8e030000 	lw	v1,0(s0)
+    2f84:	3c020fff 	lui	v0,0xfff
+    2f88:	3442ffff 	ori	v0,v0,0xffff
+    2f8c:	00621024 	and	v0,v1,v0
+    2f90:	afa20014 	sw	v0,20(sp)
+    2f94:	00021300 	sll	v0,v0,0xc
+    2f98:	40032002 	mfc0	v1,$4,2
+    2f9c:	8c640200 	lw	a0,512(v1)
+    2fa0:	24840001 	addiu	a0,a0,1
+    2fa4:	ac640200 	sw	a0,512(v1)
+    2fa8:	3c03001f 	lui	v1,0x1f
+    2fac:	3463f000 	ori	v1,v1,0xf000
+    2fb0:	02439024 	and	s2,s2,v1
+    2fb4:	00129242 	srl	s2,s2,0x9
+    2fb8:	00521021 	addu	v0,v0,s2
+    2fbc:	ac530004 	sw	s3,4(v0)
+    2fc0:	0000000f 	sync
+    2fc4:	ac510000 	sw	s1,0(v0)
+    2fc8:	0000000f 	sync
+    2fcc:	8fbf002c 	lw	ra,44(sp)
+    2fd0:	00001021 	addu	v0,zero,zero
+    2fd4:	8fb30028 	lw	s3,40(sp)
+    2fd8:	8fb20024 	lw	s2,36(sp)
+    2fdc:	8fb10020 	lw	s1,32(sp)
+    2fe0:	8fb0001c 	lw	s0,28(sp)
+    2fe4:	03e00008 	jr	ra
+    2fe8:	27bd0030 	addiu	sp,sp,48
+    2fec:	3463ffff 	ori	v1,v1,0xffff
+    2ff0:	00431024 	and	v0,v0,v1
+    2ff4:	afa20014 	sw	v0,20(sp)
+    2ff8:	08000bea 	j	2fa8 <pmm_lock_page+0x358>
+    2ffc:	00021300 	sll	v0,v0,0xc
+    3000:	3c050003 	lui	a1,0x3
+    3004:	24844370 	addiu	a0,a0,17264
+    3008:	24a54394 	addiu	a1,a1,17300
+    300c:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    3010:	00403021 	addu	a2,v0,zero
+    3014:	08000bb6 	j	2ed8 <pmm_lock_page+0x288>
+    3018:	24020016 	addiu	v0,zero,22
+    301c:	1480ffa6 	bnez	a0,2eb8 <pmm_lock_page+0x268>
+    3020:	02231826 	xor	v1,s1,v1
+    3024:	00139a42 	srl	s3,s3,0x9
+    3028:	08000b9c 	j	2e70 <pmm_lock_page+0x220>
+    302c:	00731825 	or	v1,v1,s3
+    3030:	08000bea 	j	2fa8 <pmm_lock_page+0x358>
+    3034:	8fa20010 	lw	v0,16(sp)
+    3038:	3c040004 	lui	a0,0x4
+    303c:	08000bc7 	j	2f1c <pmm_lock_page+0x2cc>
+    3040:	24846db0 	addiu	a0,a0,28080
+    3044:	08000b9f 	j	2e7c <pmm_lock_page+0x22c>
+    3048:	2402000c 	addiu	v0,zero,12
+    304c:	08000b9c 	j	2e70 <pmm_lock_page+0x220>
+    3050:	02231826 	xor	v1,s1,v1
+
+00003054 <pmm_set_page>:
+    3054:	08000b86 	j	2e18 <pmm_lock_page+0x1c8>
+    3058:	8c840000 	lw	a0,0(a0)
+
+0000305c <pmm_region_attr_set>:
+    305c:	27bdffb8 	addiu	sp,sp,-72
+    3060:	3c024000 	lui	v0,0x4000
+    3064:	afb30034 	sw	s3,52(sp)
+    3068:	00e21024 	and	v0,a3,v0
+    306c:	24131000 	addiu	s3,zero,4096
+    3070:	3c030020 	lui	v1,0x20
+    3074:	afb60040 	sw	s6,64(sp)
+    3078:	afb40038 	sw	s4,56(sp)
+    307c:	afb1002c 	sw	s1,44(sp)
+    3080:	afbf0044 	sw	ra,68(sp)
+    3084:	afb5003c 	sw	s5,60(sp)
+    3088:	afb20030 	sw	s2,48(sp)
+    308c:	afb00028 	sw	s0,40(sp)
+    3090:	00e0b021 	addu	s6,a3,zero
+    3094:	0062980b 	movn	s3,v1,v0
+    3098:	0080a021 	addu	s4,a0,zero
+    309c:	10c00029 	beqz	a2,3144 <pmm_region_attr_set+0xe8>
+    30a0:	00a08821 	addu	s1,a1,zero
+    30a4:	27b50010 	addiu	s5,sp,16
+    30a8:	8e840000 	lw	a0,0(s4)
+    30ac:	00c08021 	addu	s0,a2,zero
+    30b0:	02202821 	addu	a1,s1,zero
+    30b4:	0c000a2e 	jal	28b8 <pmm_bootstrap_init+0x14>
+    30b8:	02a03021 	addu	a2,s5,zero
+    30bc:	00409021 	addu	s2,v0,zero
+    30c0:	1440000f 	bnez	v0,3100 <pmm_region_attr_set+0xa4>
+    30c4:	2610ffff 	addiu	s0,s0,-1
+    30c8:	8fa20014 	lw	v0,20(sp)
+    30cc:	10400003 	beqz	v0,30dc <pmm_region_attr_set+0x80>
+    30d0:	8fa20010 	lw	v0,16(sp)
+    30d4:	04400015 	bltz	v0,312c <pmm_region_attr_set+0xd0>
+    30d8:	02202821 	addu	a1,s1,zero
+    30dc:	12000008 	beqz	s0,3100 <pmm_region_attr_set+0xa4>
+    30e0:	02338821 	addu	s1,s1,s3
+    30e4:	8e840000 	lw	a0,0(s4)
+    30e8:	02202821 	addu	a1,s1,zero
+    30ec:	0c000a2e 	jal	28b8 <pmm_bootstrap_init+0x14>
+    30f0:	02a03021 	addu	a2,s5,zero
+    30f4:	00409021 	addu	s2,v0,zero
+    30f8:	1040fff3 	beqz	v0,30c8 <pmm_region_attr_set+0x6c>
+    30fc:	2610ffff 	addiu	s0,s0,-1
+    3100:	8fbf0044 	lw	ra,68(sp)
+    3104:	02401021 	addu	v0,s2,zero
+    3108:	8fb60040 	lw	s6,64(sp)
+    310c:	8fb5003c 	lw	s5,60(sp)
+    3110:	8fb40038 	lw	s4,56(sp)
+    3114:	8fb30034 	lw	s3,52(sp)
+    3118:	8fb20030 	lw	s2,48(sp)
+    311c:	8fb1002c 	lw	s1,44(sp)
+    3120:	8fb00028 	lw	s0,40(sp)
+    3124:	03e00008 	jr	ra
+    3128:	27bd0048 	addiu	sp,sp,72
+    312c:	8e840000 	lw	a0,0(s4)
+    3130:	02a03021 	addu	a2,s5,zero
+    3134:	0c000b86 	jal	2e18 <pmm_lock_page+0x1c8>
+    3138:	afb60010 	sw	s6,16(sp)
+    313c:	08000c37 	j	30dc <pmm_region_attr_set+0x80>
+    3140:	00000000 	sll	zero,zero,0x0
+    3144:	08000c40 	j	3100 <pmm_region_attr_set+0xa4>
+    3148:	00009021 	addu	s2,zero,zero
+
+0000314c <pmm_release>:
+    314c:	27bdffa0 	addiu	sp,sp,-96
+    3150:	afb30048 	sw	s3,72(sp)
+    3154:	afb20044 	sw	s2,68(sp)
+    3158:	afb10040 	sw	s1,64(sp)
+    315c:	afb0003c 	sw	s0,60(sp)
+    3160:	afbf005c 	sw	ra,92(sp)
+    3164:	afb70058 	sw	s7,88(sp)
+    3168:	afb60054 	sw	s6,84(sp)
+    316c:	afb50050 	sw	s5,80(sp)
+    3170:	afb4004c 	sw	s4,76(sp)
+    3174:	8c910000 	lw	s1,0(a0)
+    3178:	afa00010 	sw	zero,16(sp)
+    317c:	24104000 	addiu	s0,zero,16384
+    3180:	27b20020 	addiu	s2,sp,32
+    3184:	08000c66 	j	3198 <pmm_release+0x4c>
+    3188:	3c130020 	lui	s3,0x20
+    318c:	26101000 	addiu	s0,s0,4096
+    3190:	12130011 	beq	s0,s3,31d8 <pmm_release+0x8c>
+    3194:	3c160004 	lui	s6,0x4
+    3198:	02002821 	addu	a1,s0,zero
+    319c:	02202021 	addu	a0,s1,zero
+    31a0:	0c000a2e 	jal	28b8 <pmm_bootstrap_init+0x14>
+    31a4:	02403021 	addu	a2,s2,zero
+    31a8:	8fa20020 	lw	v0,32(sp)
+    31ac:	0441fff7 	bgez	v0,318c <pmm_release+0x40>
+    31b0:	34420010 	ori	v0,v0,0x10
+    31b4:	02002821 	addu	a1,s0,zero
+    31b8:	02202021 	addu	a0,s1,zero
+    31bc:	02403021 	addu	a2,s2,zero
+    31c0:	26101000 	addiu	s0,s0,4096
+    31c4:	0c000b86 	jal	2e18 <pmm_lock_page+0x1c8>
+    31c8:	afa20020 	sw	v0,32(sp)
+    31cc:	1613fff3 	bne	s0,s3,319c <pmm_release+0x50>
+    31d0:	02002821 	addu	a1,s0,zero
+    31d4:	3c160004 	lui	s6,0x4
+    31d8:	3c150007 	lui	s5,0x7
+    31dc:	3c170fff 	lui	s7,0xfff
+    31e0:	26d66e60 	addiu	s6,s6,28256
+    31e4:	36b5ffff 	ori	s5,s5,0xffff
+    31e8:	36f7ffff 	ori	s7,s7,0xffff
+    31ec:	24100001 	addiu	s0,zero,1
+    31f0:	3c144000 	lui	s4,0x4000
+    31f4:	27b30010 	addiu	s3,sp,16
+    31f8:	08000c83 	j	320c <pmm_release+0xc0>
+    31fc:	24120400 	addiu	s2,zero,1024
+    3200:	26100001 	addiu	s0,s0,1
+    3204:	12120011 	beq	s0,s2,324c <pmm_release+0x100>
+    3208:	26310004 	addiu	s1,s1,4
+    320c:	8e220004 	lw	v0,4(s1)
+    3210:	0441fffb 	bgez	v0,3200 <pmm_release+0xb4>
+    3214:	00541824 	and	v1,v0,s4
+    3218:	00552824 	and	a1,v0,s5
+    321c:	10600017 	beqz	v1,327c <pmm_release+0x130>
+    3220:	ae200004 	sw	zero,4(s1)
+    3224:	00572824 	and	a1,v0,s7
+    3228:	0c007c41 	jal	1f104 <ppm_ppn2page>
+    322c:	02c02021 	addu	a0,s6,zero
+    3230:	26100001 	addiu	s0,s0,1
+    3234:	02602021 	addu	a0,s3,zero
+    3238:	afa2001c 	sw	v0,28(sp)
+    323c:	0c007134 	jal	1c4d0 <kmem_free>
+    3240:	26310004 	addiu	s1,s1,4
+    3244:	1612fff1 	bne	s0,s2,320c <pmm_release+0xc0>
+    3248:	00000000 	sll	zero,zero,0x0
+    324c:	8fbf005c 	lw	ra,92(sp)
+    3250:	00001021 	addu	v0,zero,zero
+    3254:	8fb70058 	lw	s7,88(sp)
+    3258:	8fb60054 	lw	s6,84(sp)
+    325c:	8fb50050 	lw	s5,80(sp)
+    3260:	8fb4004c 	lw	s4,76(sp)
+    3264:	8fb30048 	lw	s3,72(sp)
+    3268:	8fb20044 	lw	s2,68(sp)
+    326c:	8fb10040 	lw	s1,64(sp)
+    3270:	8fb0003c 	lw	s0,60(sp)
+    3274:	03e00008 	jr	ra
+    3278:	27bd0060 	addiu	sp,sp,96
+    327c:	08000c8a 	j	3228 <pmm_release+0xdc>
+    3280:	00052a40 	sll	a1,a1,0x9
+
+00003284 <pagedir_dup>:
+    3284:	27bdffb0 	addiu	sp,sp,-80
+    3288:	afb00028 	sw	s0,40(sp)
+    328c:	27b00010 	addiu	s0,sp,16
+    3290:	afbe0048 	sw	s8,72(sp)
+    3294:	afb40038 	sw	s4,56(sp)
+    3298:	afb30034 	sw	s3,52(sp)
+    329c:	afb1002c 	sw	s1,44(sp)
+    32a0:	00e09821 	addu	s3,a3,zero
+    32a4:	00c08821 	addu	s1,a2,zero
+    32a8:	0080f021 	addu	s8,a0,zero
+    32ac:	00a0a021 	addu	s4,a1,zero
+    32b0:	02002021 	addu	a0,s0,zero
+    32b4:	00002821 	addu	a1,zero,zero
+    32b8:	24060014 	addiu	a2,zero,20
+    32bc:	afbf004c 	sw	ra,76(sp)
+    32c0:	afb70044 	sw	s7,68(sp)
+    32c4:	afb60040 	sw	s6,64(sp)
+    32c8:	afb5003c 	sw	s5,60(sp)
+    32cc:	0c00c182 	jal	30608 <memset>
+    32d0:	afb20030 	sw	s2,48(sp)
+    32d4:	0233102b 	sltu	v0,s1,s3
+    32d8:	1040002d 	beqz	v0,3390 <pagedir_dup+0x10c>
+    32dc:	3c174000 	lui	s7,0x4000
+    32e0:	3c160020 	lui	s6,0x20
+    32e4:	08000cc1 	j	3304 <pagedir_dup+0x80>
+    32e8:	24151000 	addiu	s5,zero,4096
+    32ec:	02a01821 	addu	v1,s5,zero
+    32f0:	02c2180b 	movn	v1,s6,v0
+    32f4:	02238821 	addu	s1,s1,v1
+    32f8:	0233102b 	sltu	v0,s1,s3
+    32fc:	10400018 	beqz	v0,3360 <pagedir_dup+0xdc>
+    3300:	02401021 	addu	v0,s2,zero
+    3304:	02202821 	addu	a1,s1,zero
+    3308:	02802021 	addu	a0,s4,zero
+    330c:	0c000a2e 	jal	28b8 <pmm_bootstrap_init+0x14>
+    3310:	02003021 	addu	a2,s0,zero
+    3314:	14400011 	bnez	v0,335c <pagedir_dup+0xd8>
+    3318:	00409021 	addu	s2,v0,zero
+    331c:	8fa20010 	lw	v0,16(sp)
+    3320:	0441fff2 	bgez	v0,32ec <pagedir_dup+0x68>
+    3324:	00571024 	and	v0,v0,s7
+    3328:	02202821 	addu	a1,s1,zero
+    332c:	03c02021 	addu	a0,s8,zero
+    3330:	0c000b86 	jal	2e18 <pmm_lock_page+0x1c8>
+    3334:	02003021 	addu	a2,s0,zero
+    3338:	14400009 	bnez	v0,3360 <pagedir_dup+0xdc>
+    333c:	02a01821 	addu	v1,s5,zero
+    3340:	8fa20010 	lw	v0,16(sp)
+    3344:	00571024 	and	v0,v0,s7
+    3348:	02c2180b 	movn	v1,s6,v0
+    334c:	02238821 	addu	s1,s1,v1
+    3350:	0233102b 	sltu	v0,s1,s3
+    3354:	1440ffec 	bnez	v0,3308 <pagedir_dup+0x84>
+    3358:	02202821 	addu	a1,s1,zero
+    335c:	02401021 	addu	v0,s2,zero
+    3360:	8fbf004c 	lw	ra,76(sp)
+    3364:	8fbe0048 	lw	s8,72(sp)
+    3368:	8fb70044 	lw	s7,68(sp)
+    336c:	8fb60040 	lw	s6,64(sp)
+    3370:	8fb5003c 	lw	s5,60(sp)
+    3374:	8fb40038 	lw	s4,56(sp)
+    3378:	8fb30034 	lw	s3,52(sp)
+    337c:	8fb20030 	lw	s2,48(sp)
+    3380:	8fb1002c 	lw	s1,44(sp)
+    3384:	8fb00028 	lw	s0,40(sp)
+    3388:	03e00008 	jr	ra
+    338c:	27bd0050 	addiu	sp,sp,80
+    3390:	08000cd8 	j	3360 <pagedir_dup+0xdc>
+    3394:	00001021 	addu	v0,zero,zero
+
+00003398 <pmm_dup>:
+    3398:	8c840000 	lw	a0,0(a0)
+    339c:	8ca50000 	lw	a1,0(a1)
+    33a0:	00003021 	addu	a2,zero,zero
+    33a4:	08000ca1 	j	3284 <pagedir_dup>
+    33a8:	24073fff 	addiu	a3,zero,16383
+
+000033ac <pmm_region_map>:
+    33ac:	8ce20004 	lw	v0,4(a3)
+    33b0:	27bdffc0 	addiu	sp,sp,-64
+    33b4:	afb50030 	sw	s5,48(sp)
+    33b8:	afb20024 	sw	s2,36(sp)
+    33bc:	afb10020 	sw	s1,32(sp)
+    33c0:	afbf003c 	sw	ra,60(sp)
+    33c4:	afb70038 	sw	s7,56(sp)
+    33c8:	afb60034 	sw	s6,52(sp)
+    33cc:	afb4002c 	sw	s4,44(sp)
+    33d0:	afb30028 	sw	s3,40(sp)
+    33d4:	afb0001c 	sw	s0,28(sp)
+    33d8:	00e09021 	addu	s2,a3,zero
+    33dc:	0080a821 	addu	s5,a0,zero
+    33e0:	1040002f 	beqz	v0,34a0 <pmm_region_map+0xf4>
+    33e4:	00a08821 	addu	s1,a1,zero
+    33e8:	8cf30008 	lw	s3,8(a3)
+    33ec:	12600038 	beqz	s3,34d0 <pmm_region_map+0x124>
+    33f0:	00000000 	sll	zero,zero,0x0
+    33f4:	8e560000 	lw	s6,0(s2)
+    33f8:	3c024000 	lui	v0,0x4000
+    33fc:	02c2b024 	and	s6,s6,v0
+    3400:	24141000 	addiu	s4,zero,4096
+    3404:	3c020020 	lui	v0,0x20
+    3408:	0056a00b 	movn	s4,v0,s6
+    340c:	24020009 	addiu	v0,zero,9
+    3410:	0016100a 	movz	v0,zero,s6
+    3414:	10c00022 	beqz	a2,34a0 <pmm_region_map+0xf4>
+    3418:	0040b021 	addu	s6,v0,zero
+    341c:	00c08021 	addu	s0,a2,zero
+    3420:	08000d13 	j	344c <pmm_region_map+0xa0>
+    3424:	27b70010 	addiu	s7,sp,16
+    3428:	ac400018 	sw	zero,24(v0)
+    342c:	8fa20010 	lw	v0,16(sp)
+    3430:	8ea40000 	lw	a0,0(s5)
+    3434:	0c000b86 	jal	2e18 <pmm_lock_page+0x1c8>
+    3438:	ae420004 	sw	v0,4(s2)
+    343c:	1440000e 	bnez	v0,3478 <pmm_region_map+0xcc>
+    3440:	8fbf003c 	lw	ra,60(sp)
+    3444:	1200000c 	beqz	s0,3478 <pmm_region_map+0xcc>
+    3448:	02348821 	addu	s1,s1,s4
+    344c:	02c02821 	addu	a1,s6,zero
+    3450:	02e03021 	addu	a2,s7,zero
+    3454:	02602021 	addu	a0,s3,zero
+    3458:	0c000af2 	jal	2bc8 <pmm_alloc_pages>
+    345c:	00003821 	addu	a3,zero,zero
+    3460:	2610ffff 	addiu	s0,s0,-1
+    3464:	02202821 	addu	a1,s1,zero
+    3468:	1440ffef 	bnez	v0,3428 <pmm_region_map+0x7c>
+    346c:	02403021 	addu	a2,s2,zero
+    3470:	2402000c 	addiu	v0,zero,12
+    3474:	8fbf003c 	lw	ra,60(sp)
+    3478:	8fb70038 	lw	s7,56(sp)
+    347c:	8fb60034 	lw	s6,52(sp)
+    3480:	8fb50030 	lw	s5,48(sp)
+    3484:	8fb4002c 	lw	s4,44(sp)
+    3488:	8fb30028 	lw	s3,40(sp)
+    348c:	8fb20024 	lw	s2,36(sp)
+    3490:	8fb10020 	lw	s1,32(sp)
+    3494:	8fb0001c 	lw	s0,28(sp)
+    3498:	03e00008 	jr	ra
+    349c:	27bd0040 	addiu	sp,sp,64
+    34a0:	8fbf003c 	lw	ra,60(sp)
+    34a4:	00001021 	addu	v0,zero,zero
+    34a8:	8fb70038 	lw	s7,56(sp)
+    34ac:	8fb60034 	lw	s6,52(sp)
+    34b0:	8fb50030 	lw	s5,48(sp)
+    34b4:	8fb4002c 	lw	s4,44(sp)
+    34b8:	8fb30028 	lw	s3,40(sp)
+    34bc:	8fb20024 	lw	s2,36(sp)
+    34c0:	8fb10020 	lw	s1,32(sp)
+    34c4:	8fb0001c 	lw	s0,28(sp)
+    34c8:	03e00008 	jr	ra
+    34cc:	27bd0040 	addiu	sp,sp,64
+    34d0:	3c130004 	lui	s3,0x4
+    34d4:	08000cfd 	j	33f4 <pmm_region_map+0x48>
+    34d8:	26736db0 	addiu	s3,s3,28080
+
+000034dc <pmm_init>:
+    34dc:	27bdffd8 	addiu	sp,sp,-40
+    34e0:	ac850010 	sw	a1,16(a0)
+    34e4:	afb0001c 	sw	s0,28(sp)
+    34e8:	27a60010 	addiu	a2,sp,16
+    34ec:	00808021 	addu	s0,a0,zero
+    34f0:	27a70014 	addiu	a3,sp,20
+    34f4:	00a02021 	addu	a0,a1,zero
+    34f8:	afb10020 	sw	s1,32(sp)
+    34fc:	afbf0024 	sw	ra,36(sp)
+    3500:	0c000af2 	jal	2bc8 <pmm_alloc_pages>
+    3504:	24050002 	addiu	a1,zero,2
+    3508:	1040001b 	beqz	v0,3578 <pmm_init+0x9c>
+    350c:	00408821 	addu	s1,v0,zero
+    3510:	8e020004 	lw	v0,4(s0)
+    3514:	30420001 	andi	v0,v0,0x1
+    3518:	1440000d 	bnez	v0,3550 <pmm_init+0x74>
+    351c:	8fa40014 	lw	a0,20(sp)
+    3520:	8fa20014 	lw	v0,20(sp)
+    3524:	8fbf0024 	lw	ra,36(sp)
+    3528:	ae020000 	sw	v0,0(s0)
+    352c:	8fa20010 	lw	v0,16(sp)
+    3530:	ae11000c 	sw	s1,12(s0)
+    3534:	ae020008 	sw	v0,8(s0)
+    3538:	ae000004 	sw	zero,4(s0)
+    353c:	00001021 	addu	v0,zero,zero
+    3540:	8fb10020 	lw	s1,32(sp)
+    3544:	8fb0001c 	lw	s0,28(sp)
+    3548:	03e00008 	jr	ra
+    354c:	27bd0028 	addiu	sp,sp,40
+    3550:	8e050000 	lw	a1,0(s0)
+    3554:	00003021 	addu	a2,zero,zero
+    3558:	0c000ca1 	jal	3284 <pagedir_dup>
+    355c:	24073fff 	addiu	a3,zero,16383
+    3560:	1040ffef 	beqz	v0,3520 <pmm_init+0x44>
+    3564:	8fbf0024 	lw	ra,36(sp)
+    3568:	8fb10020 	lw	s1,32(sp)
+    356c:	8fb0001c 	lw	s0,28(sp)
+    3570:	03e00008 	jr	ra
+    3574:	27bd0028 	addiu	sp,sp,40
+    3578:	8fbf0024 	lw	ra,36(sp)
+    357c:	2402000c 	addiu	v0,zero,12
+    3580:	8fb10020 	lw	s1,32(sp)
+    3584:	8fb0001c 	lw	s0,28(sp)
+    3588:	03e00008 	jr	ra
+    358c:	27bd0028 	addiu	sp,sp,40
+
+00003590 <rt_timer_init>:
+    3590:	03e00008 	jr	ra
+    3594:	00001021 	addu	v0,zero,zero
+
+00003598 <rt_timer_read>:
+    3598:	40024800 	mfc0	v0,c0_count
+    359c:	00000000 	sll	zero,zero,0x0
+    35a0:	ac820000 	sw	v0,0(a0)
+    35a4:	03e00008 	jr	ra
+    35a8:	00001021 	addu	v0,zero,zero
+
+000035ac <rt_timer_set>:
+    35ac:	03e00008 	jr	ra
+    35b0:	24020026 	addiu	v0,zero,38
+
+000035b4 <rt_timer_setperiod>:
+    35b4:	03e00008 	jr	ra
+    35b8:	24020026 	addiu	v0,zero,38
+
+000035bc <rt_timer_ctrl>:
+    35bc:	03e00008 	jr	ra
+    35c0:	24020026 	addiu	v0,zero,38
+
+000035c4 <drvdb_locate_byId>:
+    35c4:	2c82000c 	sltiu	v0,a0,12
+    35c8:	10400005 	beqz	v0,35e0 <drvdb_locate_byId+0x1c>
+    35cc:	00042100 	sll	a0,a0,0x4
+    35d0:	3c020004 	lui	v0,0x4
+    35d4:	244292d0 	addiu	v0,v0,-27952
+    35d8:	03e00008 	jr	ra
+    35dc:	00441021 	addu	v0,v0,a0
+    35e0:	03e00008 	jr	ra
+    35e4:	00001021 	addu	v0,zero,zero
+
+000035e8 <drvdb_get_driver>:
+    35e8:	2c82000c 	sltiu	v0,a0,12
+    35ec:	10400006 	beqz	v0,3608 <drvdb_get_driver+0x20>
+    35f0:	00042100 	sll	a0,a0,0x4
+    35f4:	3c020004 	lui	v0,0x4
+    35f8:	244292d0 	addiu	v0,v0,-27952
+    35fc:	00442021 	addu	a0,v0,a0
+    3600:	03e00008 	jr	ra
+    3604:	8c82000c 	lw	v0,12(a0)
+    3608:	03e00008 	jr	ra
+    360c:	00001021 	addu	v0,zero,zero
+
+00003610 <drvdb_set_driver>:
+    3610:	2c82000c 	sltiu	v0,a0,12
+    3614:	10400007 	beqz	v0,3634 <drvdb_set_driver+0x24>
+    3618:	00042100 	sll	a0,a0,0x4
+    361c:	3c020004 	lui	v0,0x4
+    3620:	244292d0 	addiu	v0,v0,-27952
+    3624:	00442021 	addu	a0,v0,a0
+    3628:	ac85000c 	sw	a1,12(a0)
+    362c:	03e00008 	jr	ra
+    3630:	00001021 	addu	v0,zero,zero
+    3634:	03e00008 	jr	ra
+    3638:	24020022 	addiu	v0,zero,34
+
+0000363c <drvdb_locate_byName>:
+    363c:	27bdffd8 	addiu	sp,sp,-40
+    3640:	afb40020 	sw	s4,32(sp)
+    3644:	3c140004 	lui	s4,0x4
+    3648:	8e8292d0 	lw	v0,-27952(s4)
+    364c:	2403000c 	addiu	v1,zero,12
+    3650:	afb20018 	sw	s2,24(sp)
+    3654:	afbf0024 	sw	ra,36(sp)
+    3658:	afb3001c 	sw	s3,28(sp)
+    365c:	afb10014 	sw	s1,20(sp)
+    3660:	afb00010 	sw	s0,16(sp)
+    3664:	10430019 	beq	v0,v1,36cc <drvdb_locate_byName+0x90>
+    3668:	00809021 	addu	s2,a0,zero
+    366c:	3c100004 	lui	s0,0x4
+    3670:	261092d4 	addiu	s0,s0,-27948
+    3674:	00008821 	addu	s1,zero,zero
+    3678:	08000da4 	j	3690 <drvdb_locate_byName+0x54>
+    367c:	2413000c 	addiu	s3,zero,12
+    3680:	8e02000c 	lw	v0,12(s0)
+    3684:	26310001 	addiu	s1,s1,1
+    3688:	10530010 	beq	v0,s3,36cc <drvdb_locate_byName+0x90>
+    368c:	26100010 	addiu	s0,s0,16
+    3690:	8e040000 	lw	a0,0(s0)
+    3694:	0c00c445 	jal	31114 <strcmp>
+    3698:	02402821 	addu	a1,s2,zero
+    369c:	1440fff8 	bnez	v0,3680 <drvdb_locate_byName+0x44>
+    36a0:	8fbf0024 	lw	ra,36(sp)
+    36a4:	00118900 	sll	s1,s1,0x4
+    36a8:	269492d0 	addiu	s4,s4,-27952
+    36ac:	02911021 	addu	v0,s4,s1
+    36b0:	8fb40020 	lw	s4,32(sp)
+    36b4:	8fb3001c 	lw	s3,28(sp)
+    36b8:	8fb20018 	lw	s2,24(sp)
+    36bc:	8fb10014 	lw	s1,20(sp)
+    36c0:	8fb00010 	lw	s0,16(sp)
+    36c4:	03e00008 	jr	ra
+    36c8:	27bd0028 	addiu	sp,sp,40
+    36cc:	8fbf0024 	lw	ra,36(sp)
+    36d0:	00001021 	addu	v0,zero,zero
+    36d4:	8fb40020 	lw	s4,32(sp)
+    36d8:	8fb3001c 	lw	s3,28(sp)
+    36dc:	8fb20018 	lw	s2,24(sp)
+    36e0:	8fb10014 	lw	s1,20(sp)
+    36e4:	8fb00010 	lw	s0,16(sp)
+    36e8:	03e00008 	jr	ra
+    36ec:	27bd0028 	addiu	sp,sp,40
+    36f0:	94820018 	lhu	v0,24(a0)
+    36f4:	2c470101 	sltiu	a3,v0,257
+    36f8:	14e00003 	bnez	a3,3708 <drvdb_locate_byName+0xcc>
+    36fc:	8c830010 	lw	v1,16(a0)
+    3700:	08000dc0 	j	3700 <drvdb_locate_byName+0xc4>
+    3704:	00000000 	sll	zero,zero,0x0
+    3708:	00022100 	sll	a0,v0,0x4
+    370c:	00021080 	sll	v0,v0,0x2
+    3710:	00821023 	subu	v0,a0,v0
+    3714:	3c040004 	lui	a0,0x4
+    3718:	2484c9a0 	addiu	a0,a0,-13920
+    371c:	00821021 	addu	v0,a0,v0
+    3720:	3c075555 	lui	a3,0x5555
+    3724:	8c420000 	lw	v0,0(v0)
+    3728:	34e75555 	ori	a3,a3,0x5555
+    372c:	1047fff4 	beq	v0,a3,3700 <drvdb_locate_byName+0xc4>
+    3730:	246a0014 	addiu	t2,v1,20
+    3734:	24090001 	addiu	t1,zero,1
+    3738:	4808c000 	mfc2	t0,$24
+    373c:	4882c000 	mtc2	v0,$24
+    3740:	ad490000 	sw	t1,0(t2)
+    3744:	4888c000 	mtc2	t0,$24
+    3748:	8ca90004 	lw	t1,4(a1)
+    374c:	4808c000 	mfc2	t0,$24
+    3750:	4882c000 	mtc2	v0,$24
+    3754:	ac690000 	sw	t1,0(v1)
+    3758:	4888c000 	mtc2	t0,$24
+    375c:	3c080004 	lui	t0,0x4
+    3760:	2509c960 	addiu	t1,t0,-13984
+    3764:	89290003 	lwl	t1,3(t1)
+    3768:	9909c960 	lwr	t1,-13984(t0)
+    376c:	3128ffff 	andi	t0,t1,0xffff
+    3770:	2d090101 	sltiu	t1,t0,257
+    3774:	1120001e 	beqz	t1,37f0 <drvdb_locate_byName+0x1b4>
+    3778:	00084900 	sll	t1,t0,0x4
+    377c:	00084080 	sll	t0,t0,0x2
+    3780:	01284023 	subu	t0,t1,t0
+    3784:	00882021 	addu	a0,a0,t0
+    3788:	8c840000 	lw	a0,0(a0)
+    378c:	10870018 	beq	a0,a3,37f0 <drvdb_locate_byName+0x1b4>
+    3790:	24670020 	addiu	a3,v1,32
+    3794:	4808c000 	mfc2	t0,$24
+    3798:	4882c000 	mtc2	v0,$24
+    379c:	ace40000 	sw	a0,0(a3)
+    37a0:	4888c000 	mtc2	t0,$24
+    37a4:	8ca40000 	lw	a0,0(a1)
+    37a8:	24670004 	addiu	a3,v1,4
+    37ac:	4808c000 	mfc2	t0,$24
+    37b0:	4882c000 	mtc2	v0,$24
+    37b4:	ace40000 	sw	a0,0(a3)
+    37b8:	4888c000 	mtc2	t0,$24
+    37bc:	8ca40008 	lw	a0,8(a1)
+    37c0:	24650008 	addiu	a1,v1,8
+    37c4:	4808c000 	mfc2	t0,$24
+    37c8:	4882c000 	mtc2	v0,$24
+    37cc:	aca40000 	sw	a0,0(a1)
+    37d0:	4888c000 	mtc2	t0,$24
+    37d4:	2463000c 	addiu	v1,v1,12
+    37d8:	4808c000 	mfc2	t0,$24
+    37dc:	4882c000 	mtc2	v0,$24
+    37e0:	ac660000 	sw	a2,0(v1)
+    37e4:	4888c000 	mtc2	t0,$24
+    37e8:	03e00008 	jr	ra
+    37ec:	00000000 	sll	zero,zero,0x0
+    37f0:	08000dfc 	j	37f0 <drvdb_locate_byName+0x1b4>
+    37f4:	00000000 	sll	zero,zero,0x0
+    37f8:	8c820068 	lw	v0,104(a0)
+    37fc:	8c43001c 	lw	v1,28(v0)
+    3800:	8c420018 	lw	v0,24(v0)
+    3804:	aca30018 	sw	v1,24(a1)
+    3808:	70621802 	mul	v1,v1,v0
+    380c:	aca20010 	sw	v0,16(a1)
+    3810:	aca30004 	sw	v1,4(a1)
+    3814:	03e00008 	jr	ra
+    3818:	00001021 	addu	v0,zero,zero
+    381c:	03e00008 	jr	ra
+    3820:	24020001 	addiu	v0,zero,1
+
+00003824 <soclib_block_init>:
+    3824:	27bdffd0 	addiu	sp,sp,-48
+    3828:	3c050003 	lui	a1,0x3
+    382c:	afb20028 	sw	s2,40(sp)
+    3830:	24a54568 	addiu	a1,a1,17768
+    3834:	3c120004 	lui	s2,0x4
+    3838:	afb00020 	sw	s0,32(sp)
+    383c:	afbf002c 	sw	ra,44(sp)
+    3840:	00808021 	addu	s0,a0,zero
+    3844:	0c004a24 	jal	12890 <spinlock_init>
+    3848:	afb10024 	sw	s1,36(sp)
+    384c:	8e42bbfc 	lw	v0,-17412(s2)
+    3850:	3c040000 	lui	a0,0x0
+    3854:	24030001 	addiu	v1,zero,1
+    3858:	24843a60 	addiu	a0,a0,14944
+    385c:	ae04005c 	sw	a0,92(s0)
+    3860:	ae030014 	sw	v1,20(s0)
+    3864:	ae100058 	sw	s0,88(s0)
+    3868:	1043005e 	beq	v0,v1,39e4 <soclib_block_init+0x1c0>
+    386c:	ae020060 	sw	v0,96(s0)
+    3870:	261100ec 	addiu	s1,s0,236
+    3874:	3c050003 	lui	a1,0x3
+    3878:	24a5458c 	addiu	a1,a1,17804
+    387c:	00403021 	addu	a2,v0,zero
+    3880:	02202021 	addu	a0,s1,zero
+    3884:	24420001 	addiu	v0,v0,1
+    3888:	0c00c414 	jal	31050 <sprintk>
+    388c:	ae42bbfc 	sw	v0,-17412(s2)
+    3890:	ae11008c 	sw	s1,140(s0)
+    3894:	ae000090 	sw	zero,144(s0)
+    3898:	02001821 	addu	v1,s0,zero
+    389c:	00001021 	addu	v0,zero,zero
+    38a0:	2405000a 	addiu	a1,zero,10
+    38a4:	24440013 	addiu	a0,v0,19
+    38a8:	000420c0 	sll	a0,a0,0x3
+    38ac:	02042021 	addu	a0,s0,a0
+    38b0:	24840004 	addiu	a0,a0,4
+    38b4:	24420001 	addiu	v0,v0,1
+    38b8:	ac6400a0 	sw	a0,160(v1)
+    38bc:	ac64009c 	sw	a0,156(v1)
+    38c0:	1445fff8 	bne	v0,a1,38a4 <soclib_block_init+0x80>
+    38c4:	24630008 	addiu	v1,v1,8
+    38c8:	3c020000 	lui	v0,0x0
+    38cc:	2442381c 	addiu	v0,v0,14364
+    38d0:	ae020030 	sw	v0,48(s0)
+    38d4:	3c020000 	lui	v0,0x0
+    38d8:	24423e50 	addiu	v0,v0,15952
+    38dc:	ae020034 	sw	v0,52(s0)
+    38e0:	3c020000 	lui	v0,0x0
+    38e4:	24423e48 	addiu	v0,v0,15944
+    38e8:	ae020038 	sw	v0,56(s0)
+    38ec:	3c020000 	lui	v0,0x0
+    38f0:	244237f8 	addiu	v0,v0,14328
+    38f4:	ae020050 	sw	v0,80(s0)
+    38f8:	24020004 	addiu	v0,zero,4
+    38fc:	ae020054 	sw	v0,84(s0)
+    3900:	24020001 	addiu	v0,zero,1
+    3904:	ae00003c 	sw	zero,60(s0)
+    3908:	ae000040 	sw	zero,64(s0)
+    390c:	ae000044 	sw	zero,68(s0)
+    3910:	ae000048 	sw	zero,72(s0)
+    3914:	ae00004c 	sw	zero,76(s0)
+    3918:	afa20010 	sw	v0,16(sp)
+    391c:	24020020 	addiu	v0,zero,32
+    3920:	afa20014 	sw	v0,20(sp)
+    3924:	27a40010 	addiu	a0,sp,16
+    3928:	3c02000d 	lui	v0,0xd
+    392c:	0c00713f 	jal	1c4fc <kmem_alloc>
+    3930:	afa20018 	sw	v0,24(sp)
+    3934:	10400039 	beqz	v0,3a1c <soclib_block_init+0x1f8>
+    3938:	24440010 	addiu	a0,v0,16
+    393c:	ac40000c 	sw	zero,12(v0)
+    3940:	96030018 	lhu	v1,24(s0)
+    3944:	2c650101 	sltiu	a1,v1,257
+    3948:	ac440014 	sw	a0,20(v0)
+    394c:	ac440010 	sw	a0,16(v0)
+    3950:	ac510008 	sw	s1,8(v0)
+    3954:	ac420000 	sw	v0,0(v0)
+    3958:	ac420004 	sw	v0,4(v0)
+    395c:	14a00003 	bnez	a1,396c <soclib_block_init+0x148>
+    3960:	8e040010 	lw	a0,16(s0)
+    3964:	08000e59 	j	3964 <soclib_block_init+0x140>
+    3968:	00000000 	sll	zero,zero,0x0
+    396c:	00032900 	sll	a1,v1,0x4
+    3970:	00031880 	sll	v1,v1,0x2
+    3974:	00a31823 	subu	v1,a1,v1
+    3978:	3c050004 	lui	a1,0x4
+    397c:	24a5c9a0 	addiu	a1,a1,-13920
+    3980:	00a31821 	addu	v1,a1,v1
+    3984:	8c630000 	lw	v1,0(v1)
+    3988:	3c055555 	lui	a1,0x5555
+    398c:	34a55555 	ori	a1,a1,0x5555
+    3990:	1065fff4 	beq	v1,a1,3964 <soclib_block_init+0x140>
+    3994:	2485001c 	addiu	a1,a0,28
+    3998:	4808c000 	mfc2	t0,$24
+    399c:	4883c000 	mtc2	v1,$24
+    39a0:	8ca50000 	lw	a1,0(a1)
+    39a4:	4888c000 	mtc2	t0,$24
+    39a8:	ac45001c 	sw	a1,28(v0)
+    39ac:	24840018 	addiu	a0,a0,24
+    39b0:	4808c000 	mfc2	t0,$24
+    39b4:	4883c000 	mtc2	v1,$24
+    39b8:	8c830000 	lw	v1,0(a0)
+    39bc:	4888c000 	mtc2	t0,$24
+    39c0:	ae020068 	sw	v0,104(s0)
+    39c4:	ac430018 	sw	v1,24(v0)
+    39c8:	00001021 	addu	v0,zero,zero
+    39cc:	8fbf002c 	lw	ra,44(sp)
+    39d0:	8fb20028 	lw	s2,40(sp)
+    39d4:	8fb10024 	lw	s1,36(sp)
+    39d8:	8fb00020 	lw	s0,32(sp)
+    39dc:	03e00008 	jr	ra
+    39e0:	27bd0030 	addiu	sp,sp,48
+    39e4:	3c020004 	lui	v0,0x4
+    39e8:	2443c960 	addiu	v1,v0,-13984
+    39ec:	88630003 	lwl	v1,3(v1)
+    39f0:	9843c960 	lwr	v1,-13984(v0)
+    39f4:	3062ffff 	andi	v0,v1,0xffff
+    39f8:	14400004 	bnez	v0,3a0c <soclib_block_init+0x1e8>
+    39fc:	3c040003 	lui	a0,0x3
+    3a00:	24844578 	addiu	a0,a0,17784
+    3a04:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+    3a08:	24050001 	addiu	a1,zero,1
+    3a0c:	3c030008 	lui	v1,0x8
+    3a10:	8e42bbfc 	lw	v0,-17412(s2)
+    3a14:	08000e1c 	j	3870 <soclib_block_init+0x4c>
+    3a18:	ac7026e4 	sw	s0,9956(v1)
+    3a1c:	08000e73 	j	39cc <soclib_block_init+0x1a8>
+    3a20:	2402000c 	addiu	v0,zero,12
+
+00003a24 <bdev_unlock>:
+    3a24:	8c820080 	lw	v0,128(a0)
+    3a28:	1040000b 	beqz	v0,3a58 <bdev_unlock+0x34>
+    3a2c:	00000000 	sll	zero,zero,0x0
+    3a30:	8c820060 	lw	v0,96(a0)
+    3a34:	3c040004 	lui	a0,0x4
+    3a38:	00021100 	sll	v0,v0,0x4
+    3a3c:	248493a0 	addiu	a0,a0,-27744
+    3a40:	00822021 	addu	a0,a0,v0
+    3a44:	40022002 	mfc0	v0,$4,2
+    3a48:	8c430140 	lw	v1,320(v0)
+    3a4c:	24630001 	addiu	v1,v1,1
+    3a50:	0800225f 	j	897c <distlock_unlock>
+    3a54:	ac430140 	sw	v1,320(v0)
+    3a58:	03e00008 	jr	ra
+    3a5c:	00000000 	sll	zero,zero,0x0
+
+00003a60 <block_irq_handler>:
+    3a60:	27bdffd8 	addiu	sp,sp,-40
+    3a64:	afb00014 	sw	s0,20(sp)
+    3a68:	8c900000 	lw	s0,0(a0)
+    3a6c:	afb10018 	sw	s1,24(sp)
+    3a70:	8e040010 	lw	a0,16(s0)
+    3a74:	8e050018 	lw	a1,24(s0)
+    3a78:	8e110068 	lw	s1,104(s0)
+    3a7c:	afbf0024 	sw	ra,36(sp)
+    3a80:	afb30020 	sw	s3,32(sp)
+    3a84:	afb2001c 	sw	s2,28(sp)
+    3a88:	2409ffff 	addiu	t1,zero,-1
+    3a8c:	24060001 	addiu	a2,zero,1
+    3a90:	8e020000 	lw	v0,0(s0)
+    3a94:	1440fffe 	bnez	v0,3a90 <block_irq_handler+0x30>
+    3a98:	00000000 	sll	zero,zero,0x0
+    3a9c:	0000000f 	sync
+    3aa0:	00094025 	or	t0,zero,t1
+    3aa4:	c2030000 	ll	v1,0(s0)
+    3aa8:	14620004 	bne	v1,v0,3abc <block_irq_handler+0x5c>
+    3aac:	24070000 	addiu	a3,zero,0
+    3ab0:	e2080000 	sc	t0,0(s0)
+    3ab4:	01003825 	or	a3,t0,zero
+    3ab8:	0000000f 	sync
+    3abc:	00e05025 	or	t2,a3,zero
+    3ac0:	1546fff3 	bne	t2,a2,3a90 <block_irq_handler+0x30>
+    3ac4:	00000000 	sll	zero,zero,0x0
+    3ac8:	30a5ffff 	andi	a1,a1,0xffff
+    3acc:	2ca20101 	sltiu	v0,a1,257
+    3ad0:	14400003 	bnez	v0,3ae0 <block_irq_handler+0x80>
+    3ad4:	00051100 	sll	v0,a1,0x4
+    3ad8:	08000eb6 	j	3ad8 <block_irq_handler+0x78>
+    3adc:	00000000 	sll	zero,zero,0x0
+    3ae0:	00052880 	sll	a1,a1,0x2
+    3ae4:	00452823 	subu	a1,v0,a1
+    3ae8:	3c020004 	lui	v0,0x4
+    3aec:	2442c9a0 	addiu	v0,v0,-13920
+    3af0:	00451021 	addu	v0,v0,a1
+    3af4:	3c035555 	lui	v1,0x5555
+    3af8:	8c420000 	lw	v0,0(v0)
+    3afc:	34635555 	ori	v1,v1,0x5555
+    3b00:	1043fff5 	beq	v0,v1,3ad8 <block_irq_handler+0x78>
+    3b04:	00000000 	sll	zero,zero,0x0
+    3b08:	24840010 	addiu	a0,a0,16
+    3b0c:	4808c000 	mfc2	t0,$24
+    3b10:	4882c000 	mtc2	v0,$24
+    3b14:	8c930000 	lw	s3,0(a0)
+    3b18:	4888c000 	mtc2	t0,$24
+    3b1c:	8e320000 	lw	s2,0(s1)
+    3b20:	12320029 	beq	s1,s2,3bc8 <block_irq_handler+0x168>
+    3b24:	2652ffac 	addiu	s2,s2,-84
+    3b28:	8e420054 	lw	v0,84(s2)
+    3b2c:	8e430058 	lw	v1,88(s2)
+    3b30:	ac620000 	sw	v0,0(v1)
+    3b34:	8e250000 	lw	a1,0(s1)
+    3b38:	12250049 	beq	s1,a1,3c60 <block_irq_handler+0x200>
+    3b3c:	ac430004 	sw	v1,4(v0)
+    3b40:	24a5ffac 	addiu	a1,a1,-84
+    3b44:	8ca60050 	lw	a2,80(a1)
+    3b48:	0c000dbc 	jal	36f0 <drvdb_locate_byName+0xb4>
+    3b4c:	02002021 	addu	a0,s0,zero
+    3b50:	2673fffe 	addiu	s3,s3,-2
+    3b54:	2e730002 	sltiu	s3,s3,2
+    3b58:	1660003f 	bnez	s3,3c58 <block_irq_handler+0x1f8>
+    3b5c:	24020001 	addiu	v0,zero,1
+    3b60:	ae42004c 	sw	v0,76(s2)
+    3b64:	40022002 	mfc0	v0,$4,2
+    3b68:	8e42000c 	lw	v0,12(s2)
+    3b6c:	30420001 	andi	v0,v0,0x1
+    3b70:	1040002c 	beqz	v0,3c24 <block_irq_handler+0x1c4>
+    3b74:	26240008 	addiu	a0,s1,8
+    3b78:	00101025 	or	v0,zero,s0
+    3b7c:	0000000f 	sync
+    3b80:	ac400000 	sw	zero,0(v0)
+    3b84:	0000000f 	sync
+    3b88:	8e42004c 	lw	v0,76(s2)
+    3b8c:	ae500024 	sw	s0,36(s2)
+    3b90:	ae420028 	sw	v0,40(s2)
+    3b94:	24020003 	addiu	v0,zero,3
+    3b98:	ae420018 	sw	v0,24(s2)
+    3b9c:	40022002 	mfc0	v0,$4,2
+    3ba0:	8c420174 	lw	v0,372(v0)
+    3ba4:	26440018 	addiu	a0,s2,24
+    3ba8:	8c450004 	lw	a1,4(v0)
+    3bac:	8fbf0024 	lw	ra,36(sp)
+    3bb0:	8fb30020 	lw	s3,32(sp)
+    3bb4:	8fb2001c 	lw	s2,28(sp)
+    3bb8:	8fb10018 	lw	s1,24(sp)
+    3bbc:	8fb00014 	lw	s0,20(sp)
+    3bc0:	080029e6 	j	a798 <event_send>
+    3bc4:	27bd0028 	addiu	sp,sp,40
+    3bc8:	00101025 	or	v0,zero,s0
+    3bcc:	0000000f 	sync
+    3bd0:	ac400000 	sw	zero,0(v0)
+    3bd4:	0000000f 	sync
+    3bd8:	40037801 	mfc0	v1,$15,1
+    3bdc:	3c020004 	lui	v0,0x4
+    3be0:	30630003 	andi	v1,v1,0x3
+    3be4:	00031880 	sll	v1,v1,0x2
+    3be8:	2442c950 	addiu	v0,v0,-14000
+    3bec:	00621021 	addu	v0,v1,v0
+    3bf0:	3c030004 	lui	v1,0x4
+    3bf4:	3c060003 	lui	a2,0x3
+    3bf8:	8c649140 	lw	a0,-28352(v1)
+    3bfc:	8c470000 	lw	a3,0(v0)
+    3c00:	8fbf0024 	lw	ra,36(sp)
+    3c04:	8fb30020 	lw	s3,32(sp)
+    3c08:	8fb2001c 	lw	s2,28(sp)
+    3c0c:	8fb10018 	lw	s1,24(sp)
+    3c10:	8fb00014 	lw	s0,20(sp)
+    3c14:	24c64594 	addiu	a2,a2,17812
+    3c18:	24050001 	addiu	a1,zero,1
+    3c1c:	080009b0 	j	26c0 <__fprintk>
+    3c20:	27bd0028 	addiu	sp,sp,40
+    3c24:	0c006d56 	jal	1b558 <wakeup_one>
+    3c28:	00002821 	addu	a1,zero,zero
+    3c2c:	00101025 	or	v0,zero,s0
+    3c30:	0000000f 	sync
+    3c34:	ac400000 	sw	zero,0(v0)
+    3c38:	0000000f 	sync
+    3c3c:	8fbf0024 	lw	ra,36(sp)
+    3c40:	8fb30020 	lw	s3,32(sp)
+    3c44:	8fb2001c 	lw	s2,28(sp)
+    3c48:	8fb10018 	lw	s1,24(sp)
+    3c4c:	8fb00014 	lw	s0,20(sp)
+    3c50:	03e00008 	jr	ra
+    3c54:	27bd0028 	addiu	sp,sp,40
+    3c58:	08000ed9 	j	3b64 <block_irq_handler+0x104>
+    3c5c:	ae40004c 	sw	zero,76(s2)
+    3c60:	0c000e89 	jal	3a24 <bdev_unlock>
+    3c64:	02002021 	addu	a0,s0,zero
+    3c68:	08000ed5 	j	3b54 <block_irq_handler+0xf4>
+    3c6c:	2673fffe 	addiu	s3,s3,-2
+
+00003c70 <bdev_lock>:
+    3c70:	8c820080 	lw	v0,128(a0)
+    3c74:	27bdffe0 	addiu	sp,sp,-32
+    3c78:	afb10018 	sw	s1,24(sp)
+    3c7c:	afbf001c 	sw	ra,28(sp)
+    3c80:	afb00014 	sw	s0,20(sp)
+    3c84:	1040001b 	beqz	v0,3cf4 <bdev_lock+0x84>
+    3c88:	00808821 	addu	s1,a0,zero
+    3c8c:	8c820060 	lw	v0,96(a0)
+    3c90:	3c100004 	lui	s0,0x4
+    3c94:	00021100 	sll	v0,v0,0x4
+    3c98:	261093a0 	addiu	s0,s0,-27744
+    3c9c:	08000f2d 	j	3cb4 <bdev_lock+0x44>
+    3ca0:	02028021 	addu	s0,s0,v0
+    3ca4:	0c0021a3 	jal	868c <cpu_yield>
+    3ca8:	00000000 	sll	zero,zero,0x0
+    3cac:	0c004636 	jal	118d8 <sched_yield>
+    3cb0:	40042002 	mfc0	a0,$4,2
+    3cb4:	0c00221b 	jal	886c <distlock_trylock>
+    3cb8:	02002021 	addu	a0,s0,zero
+    3cbc:	1440fff9 	bnez	v0,3ca4 <bdev_lock+0x34>
+    3cc0:	00000000 	sll	zero,zero,0x0
+    3cc4:	40022002 	mfc0	v0,$4,2
+    3cc8:	8c430140 	lw	v1,320(v0)
+    3ccc:	8e240080 	lw	a0,128(s1)
+    3cd0:	2463ffff 	addiu	v1,v1,-1
+    3cd4:	ac430140 	sw	v1,320(v0)
+    3cd8:	8c990034 	lw	t9,52(a0)
+    3cdc:	02202821 	addu	a1,s1,zero
+    3ce0:	8fbf001c 	lw	ra,28(sp)
+    3ce4:	8fb10018 	lw	s1,24(sp)
+    3ce8:	8fb00014 	lw	s0,20(sp)
+    3cec:	03200008 	jr	t9
+    3cf0:	27bd0020 	addiu	sp,sp,32
+    3cf4:	8fbf001c 	lw	ra,28(sp)
+    3cf8:	8fb10018 	lw	s1,24(sp)
+    3cfc:	8fb00014 	lw	s0,20(sp)
+    3d00:	03e00008 	jr	ra
+    3d04:	27bd0020 	addiu	sp,sp,32
+
+00003d08 <block_request>:
+    3d08:	27bdffc8 	addiu	sp,sp,-56
+    3d0c:	afb30030 	sw	s3,48(sp)
+    3d10:	afb10028 	sw	s1,40(sp)
+    3d14:	afb00024 	sw	s0,36(sp)
+    3d18:	afbf0034 	sw	ra,52(sp)
+    3d1c:	afb2002c 	sw	s2,44(sp)
+    3d20:	00808821 	addu	s1,a0,zero
+    3d24:	00a08021 	addu	s0,a1,zero
+    3d28:	8c930068 	lw	s3,104(a0)
+    3d2c:	40122002 	mfc0	s2,$4,2
+    3d30:	8ca50000 	lw	a1,0(a1)
+    3d34:	8e020008 	lw	v0,8(s0)
+    3d38:	8e630018 	lw	v1,24(s3)
+    3d3c:	00a21021 	addu	v0,a1,v0
+    3d40:	0062102b 	sltu	v0,v1,v0
+    3d44:	10400008 	beqz	v0,3d68 <block_request+0x60>
+    3d48:	8fbf0034 	lw	ra,52(sp)
+    3d4c:	2402ffff 	addiu	v0,zero,-1
+    3d50:	8fb30030 	lw	s3,48(sp)
+    3d54:	8fb2002c 	lw	s2,44(sp)
+    3d58:	8fb10028 	lw	s1,40(sp)
+    3d5c:	8fb00024 	lw	s0,36(sp)
+    3d60:	03e00008 	jr	ra
+    3d64:	27bd0038 	addiu	sp,sp,56
+    3d68:	ae060050 	sw	a2,80(s0)
+    3d6c:	27a50010 	addiu	a1,sp,16
+    3d70:	0c004bbf 	jal	12efc <spinlock_lock_noirq>
+    3d74:	afa60018 	sw	a2,24(sp)
+    3d78:	8e620000 	lw	v0,0(s3)
+    3d7c:	12620025 	beq	s3,v0,3e14 <block_request+0x10c>
+    3d80:	26030054 	addiu	v1,s0,84
+    3d84:	8e620004 	lw	v0,4(s3)
+    3d88:	8c440000 	lw	a0,0(v0)
+    3d8c:	ae020058 	sw	v0,88(s0)
+    3d90:	ae040054 	sw	a0,84(s0)
+    3d94:	ac830004 	sw	v1,4(a0)
+    3d98:	ac430000 	sw	v1,0(v0)
+    3d9c:	8e02000c 	lw	v0,12(s0)
+    3da0:	30420001 	andi	v0,v0,0x1
+    3da4:	14400010 	bnez	v0,3de8 <block_request+0xe0>
+    3da8:	26640008 	addiu	a0,s3,8
+    3dac:	0c006d13 	jal	1b44c <wait_on>
+    3db0:	24050001 	addiu	a1,zero,1
+    3db4:	8fa50010 	lw	a1,16(sp)
+    3db8:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    3dbc:	02202021 	addu	a0,s1,zero
+    3dc0:	0c004634 	jal	118d0 <sched_sleep>
+    3dc4:	02402021 	addu	a0,s2,zero
+    3dc8:	8fbf0034 	lw	ra,52(sp)
+    3dcc:	8e02004c 	lw	v0,76(s0)
+    3dd0:	8fb30030 	lw	s3,48(sp)
+    3dd4:	8fb2002c 	lw	s2,44(sp)
+    3dd8:	8fb10028 	lw	s1,40(sp)
+    3ddc:	8fb00024 	lw	s0,36(sp)
+    3de0:	03e00008 	jr	ra
+    3de4:	27bd0038 	addiu	sp,sp,56
+    3de8:	8fa50010 	lw	a1,16(sp)
+    3dec:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    3df0:	02202021 	addu	a0,s1,zero
+    3df4:	8fbf0034 	lw	ra,52(sp)
+    3df8:	00001021 	addu	v0,zero,zero
+    3dfc:	8fb30030 	lw	s3,48(sp)
+    3e00:	8fb2002c 	lw	s2,44(sp)
+    3e04:	8fb10028 	lw	s1,40(sp)
+    3e08:	8fb00024 	lw	s0,36(sp)
+    3e0c:	03e00008 	jr	ra
+    3e10:	27bd0038 	addiu	sp,sp,56
+    3e14:	26020054 	addiu	v0,s0,84
+    3e18:	ae130054 	sw	s3,84(s0)
+    3e1c:	ae130058 	sw	s3,88(s0)
+    3e20:	02202021 	addu	a0,s1,zero
+    3e24:	ae620004 	sw	v0,4(s3)
+    3e28:	0c000f1c 	jal	3c70 <bdev_lock>
+    3e2c:	ae620000 	sw	v0,0(s3)
+    3e30:	8fa60018 	lw	a2,24(sp)
+    3e34:	02202021 	addu	a0,s1,zero
+    3e38:	0c000dbc 	jal	36f0 <drvdb_locate_byName+0xb4>
+    3e3c:	02002821 	addu	a1,s0,zero
+    3e40:	08000f68 	j	3da0 <block_request+0x98>
+    3e44:	8e02000c 	lw	v0,12(s0)
+    3e48:	08000f42 	j	3d08 <block_request>
+    3e4c:	24060002 	addiu	a2,zero,2
+    3e50:	08000f42 	j	3d08 <block_request>
+    3e54:	24060001 	addiu	a2,zero,1
+    3e58:	03e00008 	jr	ra
+    3e5c:	24020001 	addiu	v0,zero,1
+
+00003e60 <soclib_dma_init>:
+    3e60:	3c050003 	lui	a1,0x3
+    3e64:	27bdffd0 	addiu	sp,sp,-48
+    3e68:	24a545e4 	addiu	a1,a1,17892
+    3e6c:	afb00024 	sw	s0,36(sp)
+    3e70:	afbf002c 	sw	ra,44(sp)
+    3e74:	00808021 	addu	s0,a0,zero
+    3e78:	0c004a24 	jal	12890 <spinlock_init>
+    3e7c:	afb10028 	sw	s1,40(sp)
+    3e80:	24040001 	addiu	a0,zero,1
+    3e84:	3c020004 	lui	v0,0x4
+    3e88:	ae040014 	sw	a0,20(s0)
+    3e8c:	8c43bc00 	lw	v1,-17408(v0)
+    3e90:	3c040000 	lui	a0,0x0
+    3e94:	2484444c 	addiu	a0,a0,17484
+    3e98:	ae04005c 	sw	a0,92(s0)
+    3e9c:	ae100058 	sw	s0,88(s0)
+    3ea0:	14600003 	bnez	v1,3eb0 <soclib_dma_init+0x50>
+    3ea4:	ae000060 	sw	zero,96(s0)
+    3ea8:	3c040008 	lui	a0,0x8
+    3eac:	ac9026e8 	sw	s0,9960(a0)
+    3eb0:	261100ec 	addiu	s1,s0,236
+    3eb4:	3c050003 	lui	a1,0x3
+    3eb8:	24a545f4 	addiu	a1,a1,17908
+    3ebc:	00603021 	addu	a2,v1,zero
+    3ec0:	02202021 	addu	a0,s1,zero
+    3ec4:	24630001 	addiu	v1,v1,1
+    3ec8:	0c00c414 	jal	31050 <sprintk>
+    3ecc:	ac43bc00 	sw	v1,-17408(v0)
+    3ed0:	ae11008c 	sw	s1,140(s0)
+    3ed4:	ae000090 	sw	zero,144(s0)
+    3ed8:	02001821 	addu	v1,s0,zero
+    3edc:	00001021 	addu	v0,zero,zero
+    3ee0:	2405000a 	addiu	a1,zero,10
+    3ee4:	24440013 	addiu	a0,v0,19
+    3ee8:	000420c0 	sll	a0,a0,0x3
+    3eec:	02042021 	addu	a0,s0,a0
+    3ef0:	24840004 	addiu	a0,a0,4
+    3ef4:	24420001 	addiu	v0,v0,1
+    3ef8:	ac6400a0 	sw	a0,160(v1)
+    3efc:	ac64009c 	sw	a0,156(v1)
+    3f00:	1445fff8 	bne	v0,a1,3ee4 <soclib_dma_init+0x84>
+    3f04:	24630008 	addiu	v1,v1,8
+    3f08:	3c020000 	lui	v0,0x0
+    3f0c:	2442404c 	addiu	v0,v0,16460
+    3f10:	3c030000 	lui	v1,0x0
+    3f14:	ae020038 	sw	v0,56(s0)
+    3f18:	ae020034 	sw	v0,52(s0)
+    3f1c:	24633e58 	addiu	v1,v1,15960
+    3f20:	24020001 	addiu	v0,zero,1
+    3f24:	ae030030 	sw	v1,48(s0)
+    3f28:	ae00003c 	sw	zero,60(s0)
+    3f2c:	ae000040 	sw	zero,64(s0)
+    3f30:	ae000044 	sw	zero,68(s0)
+    3f34:	ae000048 	sw	zero,72(s0)
+    3f38:	ae00004c 	sw	zero,76(s0)
+    3f3c:	ae000050 	sw	zero,80(s0)
+    3f40:	24030003 	addiu	v1,zero,3
+    3f44:	afa20010 	sw	v0,16(sp)
+    3f48:	24020018 	addiu	v0,zero,24
+    3f4c:	ae030054 	sw	v1,84(s0)
+    3f50:	27a40010 	addiu	a0,sp,16
+    3f54:	afa20014 	sw	v0,20(sp)
+    3f58:	3c02000d 	lui	v0,0xd
+    3f5c:	0c00713f 	jal	1c4fc <kmem_alloc>
+    3f60:	afa20018 	sw	v0,24(sp)
+    3f64:	1040000e 	beqz	v0,3fa0 <soclib_dma_init+0x140>
+    3f68:	8fbf002c 	lw	ra,44(sp)
+    3f6c:	24430010 	addiu	v1,v0,16
+    3f70:	ae020068 	sw	v0,104(s0)
+    3f74:	ac510008 	sw	s1,8(v0)
+    3f78:	ac430014 	sw	v1,20(v0)
+    3f7c:	ac40000c 	sw	zero,12(v0)
+    3f80:	ac430010 	sw	v1,16(v0)
+    3f84:	ac420000 	sw	v0,0(v0)
+    3f88:	ac420004 	sw	v0,4(v0)
+    3f8c:	8fb10028 	lw	s1,40(sp)
+    3f90:	00001021 	addu	v0,zero,zero
+    3f94:	8fb00024 	lw	s0,36(sp)
+    3f98:	03e00008 	jr	ra
+    3f9c:	27bd0030 	addiu	sp,sp,48
+    3fa0:	2402000c 	addiu	v0,zero,12
+    3fa4:	8fb10028 	lw	s1,40(sp)
+    3fa8:	8fb00024 	lw	s0,36(sp)
+    3fac:	03e00008 	jr	ra
+    3fb0:	27bd0030 	addiu	sp,sp,48
+    3fb4:	27bdffe0 	addiu	sp,sp,-32
+    3fb8:	afb00018 	sw	s0,24(sp)
+    3fbc:	afbf001c 	sw	ra,28(sp)
+    3fc0:	00808021 	addu	s0,a0,zero
+    3fc4:	40022002 	mfc0	v0,$4,2
+    3fc8:	8c440180 	lw	a0,384(v0)
+    3fcc:	afa60010 	sw	a2,16(sp)
+    3fd0:	0c0067d9 	jal	19f64 <task_vaddr2paddr>
+    3fd4:	afa70014 	sw	a3,20(sp)
+    3fd8:	ae020000 	sw	v0,0(s0)
+    3fdc:	40022002 	mfc0	v0,$4,2
+    3fe0:	8fa60010 	lw	a2,16(sp)
+    3fe4:	8c440180 	lw	a0,384(v0)
+    3fe8:	0c0067d9 	jal	19f64 <task_vaddr2paddr>
+    3fec:	00c02821 	addu	a1,a2,zero
+    3ff0:	8fa70014 	lw	a3,20(sp)
+    3ff4:	8e030000 	lw	v1,0(s0)
+    3ff8:	ae070008 	sw	a3,8(s0)
+    3ffc:	ae020004 	sw	v0,4(s0)
+    4000:	1060000d 	beqz	v1,4038 <soclib_dma_init+0x1d8>
+    4004:	ae00000c 	sw	zero,12(s0)
+    4008:	1040000b 	beqz	v0,4038 <soclib_dma_init+0x1d8>
+    400c:	24020008 	addiu	v0,zero,8
+    4010:	ae020018 	sw	v0,24(s0)
+    4014:	8fbf001c 	lw	ra,28(sp)
+    4018:	3c020000 	lui	v0,0x0
+    401c:	244243e4 	addiu	v0,v0,17380
+    4020:	ae02001c 	sw	v0,28(s0)
+    4024:	ae100020 	sw	s0,32(s0)
+    4028:	00001021 	addu	v0,zero,zero
+    402c:	8fb00018 	lw	s0,24(sp)
+    4030:	03e00008 	jr	ra
+    4034:	27bd0020 	addiu	sp,sp,32
+    4038:	8fbf001c 	lw	ra,28(sp)
+    403c:	24020001 	addiu	v0,zero,1
+    4040:	8fb00018 	lw	s0,24(sp)
+    4044:	03e00008 	jr	ra
+    4048:	27bd0020 	addiu	sp,sp,32
+    404c:	27bdff98 	addiu	sp,sp,-104
+    4050:	afb10044 	sw	s1,68(sp)
+    4054:	8cb10008 	lw	s1,8(a1)
+    4058:	afbe0060 	sw	s8,96(sp)
+    405c:	afb7005c 	sw	s7,92(sp)
+    4060:	afb40050 	sw	s4,80(sp)
+    4064:	afbf0064 	sw	ra,100(sp)
+    4068:	afb60058 	sw	s6,88(sp)
+    406c:	afb50054 	sw	s5,84(sp)
+    4070:	afb3004c 	sw	s3,76(sp)
+    4074:	afb20048 	sw	s2,72(sp)
+    4078:	afb00040 	sw	s0,64(sp)
+    407c:	00a0a021 	addu	s4,a1,zero
+    4080:	0080b821 	addu	s7,a0,zero
+    4084:	aca0004c 	sw	zero,76(a1)
+    4088:	12200092 	beqz	s1,42d4 <soclib_dma_init+0x474>
+    408c:	8c9e0068 	lw	s8,104(a0)
+    4090:	8ca50000 	lw	a1,0(a1)
+    4094:	2402f000 	addiu	v0,zero,-4096
+    4098:	00a21824 	and	v1,a1,v0
+    409c:	24631000 	addiu	v1,v1,4096
+    40a0:	00b12021 	addu	a0,a1,s1
+    40a4:	0064182b 	sltu	v1,v1,a0
+    40a8:	00a09821 	addu	s3,a1,zero
+    40ac:	10600043 	beqz	v1,41bc <soclib_dma_init+0x35c>
+    40b0:	8e920004 	lw	s2,4(s4)
+    40b4:	00b22825 	or	a1,a1,s2
+    40b8:	30a50fff 	andi	a1,a1,0xfff
+    40bc:	14a00032 	bnez	a1,4188 <soclib_dma_init+0x328>
+    40c0:	2402fffb 	addiu	v0,zero,-5
+    40c4:	8e83000c 	lw	v1,12(s4)
+    40c8:	00621024 	and	v0,v1,v0
+    40cc:	24030004 	addiu	v1,zero,4
+    40d0:	afa30014 	sw	v1,20(sp)
+    40d4:	2403005c 	addiu	v1,zero,92
+    40d8:	afa30018 	sw	v1,24(sp)
+    40dc:	27b60014 	addiu	s6,sp,20
+    40e0:	3c030011 	lui	v1,0x11
+    40e4:	34630020 	ori	v1,v1,0x20
+    40e8:	02c02021 	addu	a0,s6,zero
+    40ec:	ae82000c 	sw	v0,12(s4)
+    40f0:	ae800050 	sw	zero,80(s4)
+    40f4:	0c00713f 	jal	1c4fc <kmem_alloc>
+    40f8:	afa3001c 	sw	v1,28(sp)
+    40fc:	00408021 	addu	s0,v0,zero
+    4100:	00402021 	addu	a0,v0,zero
+    4104:	0280a821 	addu	s5,s4,zero
+    4108:	02602821 	addu	a1,s3,zero
+    410c:	02403021 	addu	a2,s2,zero
+    4110:	24071000 	addiu	a3,zero,4096
+    4114:	12000016 	beqz	s0,4170 <soclib_dma_init+0x310>
+    4118:	2e221000 	sltiu	v0,s1,4096
+    411c:	1440003c 	bnez	v0,4210 <soclib_dma_init+0x3b0>
+    4120:	00000000 	sll	zero,zero,0x0
+    4124:	0c000fed 	jal	3fb4 <soclib_dma_init+0x154>
+    4128:	2631f000 	addiu	s1,s1,-4096
+    412c:	14400011 	bnez	v0,4174 <soclib_dma_init+0x314>
+    4130:	00000000 	sll	zero,zero,0x0
+    4134:	aeb00050 	sw	s0,80(s5)
+    4138:	1220003e 	beqz	s1,4234 <soclib_dma_init+0x3d4>
+    413c:	ae000050 	sw	zero,80(s0)
+    4140:	0c00713f 	jal	1c4fc <kmem_alloc>
+    4144:	02c02021 	addu	a0,s6,zero
+    4148:	26731000 	addiu	s3,s3,4096
+    414c:	26521000 	addiu	s2,s2,4096
+    4150:	0200a821 	addu	s5,s0,zero
+    4154:	00408021 	addu	s0,v0,zero
+    4158:	00402021 	addu	a0,v0,zero
+    415c:	02602821 	addu	a1,s3,zero
+    4160:	02403021 	addu	a2,s2,zero
+    4164:	24071000 	addiu	a3,zero,4096
+    4168:	1600ffec 	bnez	s0,411c <soclib_dma_init+0x2bc>
+    416c:	2e221000 	sltiu	v0,s1,4096
+    4170:	2402000c 	addiu	v0,zero,12
+    4174:	8e830050 	lw	v1,80(s4)
+    4178:	10600063 	beqz	v1,4308 <soclib_dma_init+0x4a8>
+    417c:	24030004 	addiu	v1,zero,4
+    4180:	08001060 	j	4180 <soclib_dma_init+0x320>
+    4184:	00000000 	sll	zero,zero,0x0
+    4188:	24020026 	addiu	v0,zero,38
+    418c:	8fbf0064 	lw	ra,100(sp)
+    4190:	8fbe0060 	lw	s8,96(sp)
+    4194:	8fb7005c 	lw	s7,92(sp)
+    4198:	8fb60058 	lw	s6,88(sp)
+    419c:	8fb50054 	lw	s5,84(sp)
+    41a0:	8fb40050 	lw	s4,80(sp)
+    41a4:	8fb3004c 	lw	s3,76(sp)
+    41a8:	8fb20048 	lw	s2,72(sp)
+    41ac:	8fb10044 	lw	s1,68(sp)
+    41b0:	8fb00040 	lw	s0,64(sp)
+    41b4:	03e00008 	jr	ra
+    41b8:	27bd0068 	addiu	sp,sp,104
+    41bc:	02421024 	and	v0,s2,v0
+    41c0:	24421000 	addiu	v0,v0,4096
+    41c4:	02511821 	addu	v1,s2,s1
+    41c8:	0043102b 	sltu	v0,v0,v1
+    41cc:	1440ffb9 	bnez	v0,40b4 <soclib_dma_init+0x254>
+    41d0:	00000000 	sll	zero,zero,0x0
+    41d4:	40022002 	mfc0	v0,$4,2
+    41d8:	0c0067d9 	jal	19f64 <task_vaddr2paddr>
+    41dc:	8c440180 	lw	a0,384(v0)
+    41e0:	ae820000 	sw	v0,0(s4)
+    41e4:	40022002 	mfc0	v0,$4,2
+    41e8:	8c440180 	lw	a0,384(v0)
+    41ec:	0c0067d9 	jal	19f64 <task_vaddr2paddr>
+    41f0:	8e850004 	lw	a1,4(s4)
+    41f4:	8e830000 	lw	v1,0(s4)
+    41f8:	10600003 	beqz	v1,4208 <soclib_dma_init+0x3a8>
+    41fc:	ae820004 	sw	v0,4(s4)
+    4200:	14400010 	bnez	v0,4244 <soclib_dma_init+0x3e4>
+    4204:	02e02021 	addu	a0,s7,zero
+    4208:	08001063 	j	418c <soclib_dma_init+0x32c>
+    420c:	24020001 	addiu	v0,zero,1
+    4210:	02602821 	addu	a1,s3,zero
+    4214:	02403021 	addu	a2,s2,zero
+    4218:	02203821 	addu	a3,s1,zero
+    421c:	0c000fed 	jal	3fb4 <soclib_dma_init+0x154>
+    4220:	02002021 	addu	a0,s0,zero
+    4224:	1440ffd3 	bnez	v0,4174 <soclib_dma_init+0x314>
+    4228:	00000000 	sll	zero,zero,0x0
+    422c:	aeb00050 	sw	s0,80(s5)
+    4230:	ae000050 	sw	zero,80(s0)
+    4234:	8e82000c 	lw	v0,12(s4)
+    4238:	34420004 	ori	v0,v0,0x4
+    423c:	ae82000c 	sw	v0,12(s4)
+    4240:	02e02021 	addu	a0,s7,zero
+    4244:	0c004bbf 	jal	12efc <spinlock_lock_noirq>
+    4248:	27a50010 	addiu	a1,sp,16
+    424c:	8fc20000 	lw	v0,0(s8)
+    4250:	13c2004f 	beq	s8,v0,4390 <soclib_dma_init+0x530>
+    4254:	26830054 	addiu	v1,s4,84
+    4258:	8fc20004 	lw	v0,4(s8)
+    425c:	8c440000 	lw	a0,0(v0)
+    4260:	ae820058 	sw	v0,88(s4)
+    4264:	ae840054 	sw	a0,84(s4)
+    4268:	ac830004 	sw	v1,4(a0)
+    426c:	ac430000 	sw	v1,0(v0)
+    4270:	8e82000c 	lw	v0,12(s4)
+    4274:	30420001 	andi	v0,v0,0x1
+    4278:	14400035 	bnez	v0,4350 <soclib_dma_init+0x4f0>
+    427c:	27c40008 	addiu	a0,s8,8
+    4280:	0c006d13 	jal	1b44c <wait_on>
+    4284:	24050001 	addiu	a1,zero,1
+    4288:	8fa50010 	lw	a1,16(sp)
+    428c:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    4290:	02e02021 	addu	a0,s7,zero
+    4294:	40042002 	mfc0	a0,$4,2
+    4298:	0c004634 	jal	118d0 <sched_sleep>
+    429c:	00000000 	sll	zero,zero,0x0
+    42a0:	8fbf0064 	lw	ra,100(sp)
+    42a4:	8e82004c 	lw	v0,76(s4)
+    42a8:	8fbe0060 	lw	s8,96(sp)
+    42ac:	8fb7005c 	lw	s7,92(sp)
+    42b0:	8fb60058 	lw	s6,88(sp)
+    42b4:	8fb50054 	lw	s5,84(sp)
+    42b8:	8fb40050 	lw	s4,80(sp)
+    42bc:	8fb3004c 	lw	s3,76(sp)
+    42c0:	8fb20048 	lw	s2,72(sp)
+    42c4:	8fb10044 	lw	s1,68(sp)
+    42c8:	8fb00040 	lw	s0,64(sp)
+    42cc:	03e00008 	jr	ra
+    42d0:	27bd0068 	addiu	sp,sp,104
+    42d4:	8fbf0064 	lw	ra,100(sp)
+    42d8:	24020016 	addiu	v0,zero,22
+    42dc:	8fbe0060 	lw	s8,96(sp)
+    42e0:	8fb7005c 	lw	s7,92(sp)
+    42e4:	8fb60058 	lw	s6,88(sp)
+    42e8:	8fb50054 	lw	s5,84(sp)
+    42ec:	8fb40050 	lw	s4,80(sp)
+    42f0:	8fb3004c 	lw	s3,76(sp)
+    42f4:	8fb20048 	lw	s2,72(sp)
+    42f8:	8fb10044 	lw	s1,68(sp)
+    42fc:	8fb00040 	lw	s0,64(sp)
+    4300:	03e00008 	jr	ra
+    4304:	27bd0068 	addiu	sp,sp,104
+    4308:	27a40024 	addiu	a0,sp,36
+    430c:	afa20038 	sw	v0,56(sp)
+    4310:	afa30024 	sw	v1,36(sp)
+    4314:	0c007134 	jal	1c4d0 <kmem_free>
+    4318:	afa00030 	sw	zero,48(sp)
+    431c:	8fbf0064 	lw	ra,100(sp)
+    4320:	8fa20038 	lw	v0,56(sp)
+    4324:	8fbe0060 	lw	s8,96(sp)
+    4328:	8fb7005c 	lw	s7,92(sp)
+    432c:	8fb60058 	lw	s6,88(sp)
+    4330:	8fb50054 	lw	s5,84(sp)
+    4334:	8fb40050 	lw	s4,80(sp)
+    4338:	8fb3004c 	lw	s3,76(sp)
+    433c:	8fb20048 	lw	s2,72(sp)
+    4340:	8fb10044 	lw	s1,68(sp)
+    4344:	8fb00040 	lw	s0,64(sp)
+    4348:	03e00008 	jr	ra
+    434c:	27bd0068 	addiu	sp,sp,104
+    4350:	8fa50010 	lw	a1,16(sp)
+    4354:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    4358:	02e02021 	addu	a0,s7,zero
+    435c:	8fbf0064 	lw	ra,100(sp)
+    4360:	00001021 	addu	v0,zero,zero
+    4364:	8fbe0060 	lw	s8,96(sp)
+    4368:	8fb7005c 	lw	s7,92(sp)
+    436c:	8fb60058 	lw	s6,88(sp)
+    4370:	8fb50054 	lw	s5,84(sp)
+    4374:	8fb40050 	lw	s4,80(sp)
+    4378:	8fb3004c 	lw	s3,76(sp)
+    437c:	8fb20048 	lw	s2,72(sp)
+    4380:	8fb10044 	lw	s1,68(sp)
+    4384:	8fb00040 	lw	s0,64(sp)
+    4388:	03e00008 	jr	ra
+    438c:	27bd0068 	addiu	sp,sp,104
+    4390:	8e83000c 	lw	v1,12(s4)
+    4394:	26820054 	addiu	v0,s4,84
+    4398:	30630004 	andi	v1,v1,0x4
+    439c:	ae9e0054 	sw	s8,84(s4)
+    43a0:	ae9e0058 	sw	s8,88(s4)
+    43a4:	afc20000 	sw	v0,0(s8)
+    43a8:	afc20004 	sw	v0,4(s8)
+    43ac:	1460000b 	bnez	v1,43dc <soclib_dma_init+0x57c>
+    43b0:	8ee20010 	lw	v0,16(s7)
+    43b4:	02801821 	addu	v1,s4,zero
+    43b8:	8c650000 	lw	a1,0(v1)
+    43bc:	8c640004 	lw	a0,4(v1)
+    43c0:	ac450000 	sw	a1,0(v0)
+    43c4:	ac440004 	sw	a0,4(v0)
+    43c8:	ac400010 	sw	zero,16(v0)
+    43cc:	8c630008 	lw	v1,8(v1)
+    43d0:	ac430008 	sw	v1,8(v0)
+    43d4:	0800109d 	j	4274 <soclib_dma_init+0x414>
+    43d8:	8e82000c 	lw	v0,12(s4)
+    43dc:	080010ee 	j	43b8 <soclib_dma_init+0x558>
+    43e0:	8e830050 	lw	v1,80(s4)
+    43e4:	8c830010 	lw	v1,16(a0)
+    43e8:	27bdffc8 	addiu	sp,sp,-56
+    43ec:	afbf0034 	sw	ra,52(sp)
+    43f0:	1060000d 	beqz	v1,4428 <soclib_dma_init+0x5c8>
+    43f4:	8c820008 	lw	v0,8(a0)
+    43f8:	10400003 	beqz	v0,4408 <soclib_dma_init+0x5a8>
+    43fc:	24020004 	addiu	v0,zero,4
+    4400:	08001100 	j	4400 <soclib_dma_init+0x5a0>
+    4404:	00000000 	sll	zero,zero,0x0
+    4408:	27a40020 	addiu	a0,sp,32
+    440c:	afa20020 	sw	v0,32(sp)
+    4410:	0c007134 	jal	1c4d0 <kmem_free>
+    4414:	afa0002c 	sw	zero,44(sp)
+    4418:	8fbf0034 	lw	ra,52(sp)
+    441c:	00001021 	addu	v0,zero,zero
+    4420:	03e00008 	jr	ra
+    4424:	27bd0038 	addiu	sp,sp,56
+    4428:	27a40010 	addiu	a0,sp,16
+    442c:	24030004 	addiu	v1,zero,4
+    4430:	afa2001c 	sw	v0,28(sp)
+    4434:	0c007134 	jal	1c4d0 <kmem_free>
+    4438:	afa30010 	sw	v1,16(sp)
+    443c:	8fbf0034 	lw	ra,52(sp)
+    4440:	00001021 	addu	v0,zero,zero
+    4444:	03e00008 	jr	ra
+    4448:	27bd0038 	addiu	sp,sp,56
+    444c:	27bdffd8 	addiu	sp,sp,-40
+    4450:	afb00010 	sw	s0,16(sp)
+    4454:	8c900000 	lw	s0,0(a0)
+    4458:	afb10014 	sw	s1,20(sp)
+    445c:	8e090010 	lw	t1,16(s0)
+    4460:	8e110068 	lw	s1,104(s0)
+    4464:	afbf0024 	sw	ra,36(sp)
+    4468:	afb40020 	sw	s4,32(sp)
+    446c:	afb3001c 	sw	s3,28(sp)
+    4470:	afb20018 	sw	s2,24(sp)
+    4474:	2406ffff 	addiu	a2,zero,-1
+    4478:	24050001 	addiu	a1,zero,1
+    447c:	8e020000 	lw	v0,0(s0)
+    4480:	1440fffe 	bnez	v0,447c <soclib_dma_init+0x61c>
+    4484:	00000000 	sll	zero,zero,0x0
+    4488:	0000000f 	sync
+    448c:	00064025 	or	t0,zero,a2
+    4490:	c2030000 	ll	v1,0(s0)
+    4494:	14620004 	bne	v1,v0,44a8 <soclib_dma_init+0x648>
+    4498:	24070000 	addiu	a3,zero,0
+    449c:	e2080000 	sc	t0,0(s0)
+    44a0:	01003825 	or	a3,t0,zero
+    44a4:	0000000f 	sync
+    44a8:	00e02025 	or	a0,a3,zero
+    44ac:	1485fff3 	bne	a0,a1,447c <soclib_dma_init+0x61c>
+    44b0:	00000000 	sll	zero,zero,0x0
+    44b4:	8e320000 	lw	s2,0(s1)
+    44b8:	8d330008 	lw	s3,8(t1)
+    44bc:	ad20000c 	sw	zero,12(t1)
+    44c0:	1232005a 	beq	s1,s2,462c <soclib_dma_init+0x7cc>
+    44c4:	2652ffac 	addiu	s2,s2,-84
+    44c8:	8e42000c 	lw	v0,12(s2)
+    44cc:	30420004 	andi	v0,v0,0x4
+    44d0:	1440003b 	bnez	v0,45c0 <soclib_dma_init+0x760>
+    44d4:	00000000 	sll	zero,zero,0x0
+    44d8:	8e430054 	lw	v1,84(s2)
+    44dc:	8e440058 	lw	a0,88(s2)
+    44e0:	ac830000 	sw	v1,0(a0)
+    44e4:	8e220000 	lw	v0,0(s1)
+    44e8:	1222000d 	beq	s1,v0,4520 <soclib_dma_init+0x6c0>
+    44ec:	ac640004 	sw	a0,4(v1)
+    44f0:	2442ffac 	addiu	v0,v0,-84
+    44f4:	8c44000c 	lw	a0,12(v0)
+    44f8:	30840004 	andi	a0,a0,0x4
+    44fc:	1480001f 	bnez	a0,457c <soclib_dma_init+0x71c>
+    4500:	8e030010 	lw	v1,16(s0)
+    4504:	8c450000 	lw	a1,0(v0)
+    4508:	8c440004 	lw	a0,4(v0)
+    450c:	ac650000 	sw	a1,0(v1)
+    4510:	ac640004 	sw	a0,4(v1)
+    4514:	ac600010 	sw	zero,16(v1)
+    4518:	8c420008 	lw	v0,8(v0)
+    451c:	ac620008 	sw	v0,8(v1)
+    4520:	8e42000c 	lw	v0,12(s2)
+    4524:	30420001 	andi	v0,v0,0x1
+    4528:	10400016 	beqz	v0,4584 <soclib_dma_init+0x724>
+    452c:	26240008 	addiu	a0,s1,8
+    4530:	00101025 	or	v0,zero,s0
+    4534:	0000000f 	sync
+    4538:	ac400000 	sw	zero,0(v0)
+    453c:	0000000f 	sync
+    4540:	40022002 	mfc0	v0,$4,2
+    4544:	ae530028 	sw	s3,40(s2)
+    4548:	ae500024 	sw	s0,36(s2)
+    454c:	40022002 	mfc0	v0,$4,2
+    4550:	8c420174 	lw	v0,372(v0)
+    4554:	26440018 	addiu	a0,s2,24
+    4558:	8c450004 	lw	a1,4(v0)
+    455c:	8fbf0024 	lw	ra,36(sp)
+    4560:	8fb40020 	lw	s4,32(sp)
+    4564:	8fb3001c 	lw	s3,28(sp)
+    4568:	8fb20018 	lw	s2,24(sp)
+    456c:	8fb10014 	lw	s1,20(sp)
+    4570:	8fb00010 	lw	s0,16(sp)
+    4574:	080029e6 	j	a798 <event_send>
+    4578:	27bd0028 	addiu	sp,sp,40
+    457c:	08001141 	j	4504 <soclib_dma_init+0x6a4>
+    4580:	8c420050 	lw	v0,80(v0)
+    4584:	ae53004c 	sw	s3,76(s2)
+    4588:	0c006d56 	jal	1b558 <wakeup_one>
+    458c:	00002821 	addu	a1,zero,zero
+    4590:	00101025 	or	v0,zero,s0
+    4594:	0000000f 	sync
+    4598:	ac400000 	sw	zero,0(v0)
+    459c:	0000000f 	sync
+    45a0:	8fbf0024 	lw	ra,36(sp)
+    45a4:	8fb40020 	lw	s4,32(sp)
+    45a8:	8fb3001c 	lw	s3,28(sp)
+    45ac:	8fb20018 	lw	s2,24(sp)
+    45b0:	8fb10014 	lw	s1,20(sp)
+    45b4:	8fb00010 	lw	s0,16(sp)
+    45b8:	03e00008 	jr	ra
+    45bc:	27bd0028 	addiu	sp,sp,40
+    45c0:	8e540050 	lw	s4,80(s2)
+    45c4:	ae930028 	sw	s3,40(s4)
+    45c8:	ae900024 	sw	s0,36(s4)
+    45cc:	40022002 	mfc0	v0,$4,2
+    45d0:	8c420174 	lw	v0,372(v0)
+    45d4:	26840018 	addiu	a0,s4,24
+    45d8:	0c0029e6 	jal	a798 <event_send>
+    45dc:	8c450004 	lw	a1,4(v0)
+    45e0:	1660ffbd 	bnez	s3,44d8 <soclib_dma_init+0x678>
+    45e4:	00000000 	sll	zero,zero,0x0
+    45e8:	8e820050 	lw	v0,80(s4)
+    45ec:	1040ffba 	beqz	v0,44d8 <soclib_dma_init+0x678>
+    45f0:	00000000 	sll	zero,zero,0x0
+    45f4:	ae420050 	sw	v0,80(s2)
+    45f8:	8e820050 	lw	v0,80(s4)
+    45fc:	8c44000c 	lw	a0,12(v0)
+    4600:	30840004 	andi	a0,a0,0x4
+    4604:	10800002 	beqz	a0,4610 <soclib_dma_init+0x7b0>
+    4608:	8e030010 	lw	v1,16(s0)
+    460c:	8c420050 	lw	v0,80(v0)
+    4610:	8c450000 	lw	a1,0(v0)
+    4614:	8c440004 	lw	a0,4(v0)
+    4618:	ac650000 	sw	a1,0(v1)
+    461c:	ac640004 	sw	a0,4(v1)
+    4620:	ac600010 	sw	zero,16(v1)
+    4624:	8c420008 	lw	v0,8(v0)
+    4628:	ac620008 	sw	v0,8(v1)
+    462c:	00101025 	or	v0,zero,s0
+    4630:	0000000f 	sync
+    4634:	ac400000 	sw	zero,0(v0)
+    4638:	0000000f 	sync
+    463c:	8fbf0024 	lw	ra,36(sp)
+    4640:	8fb40020 	lw	s4,32(sp)
+    4644:	8fb3001c 	lw	s3,28(sp)
+    4648:	8fb20018 	lw	s2,24(sp)
+    464c:	8fb10014 	lw	s1,20(sp)
+    4650:	8fb00010 	lw	s0,16(sp)
+    4654:	03e00008 	jr	ra
+    4658:	27bd0028 	addiu	sp,sp,40
+    465c:	03e00008 	jr	ra
+    4660:	00001021 	addu	v0,zero,zero
+    4664:	8c830068 	lw	v1,104(a0)
+    4668:	00001021 	addu	v0,zero,zero
+    466c:	03e00008 	jr	ra
+    4670:	aca30004 	sw	v1,4(a1)
+    4674:	03e00008 	jr	ra
+    4678:	00001021 	addu	v0,zero,zero
+    467c:	03e00008 	jr	ra
+    4680:	2402000e 	addiu	v0,zero,14
+
+00004684 <soclib_fb_init>:
+    4684:	3c020000 	lui	v0,0x0
+    4688:	27bdffe0 	addiu	sp,sp,-32
+    468c:	24424674 	addiu	v0,v0,18036
+    4690:	afb10018 	sw	s1,24(sp)
+    4694:	afb00014 	sw	s0,20(sp)
+    4698:	afbf001c 	sw	ra,28(sp)
+    469c:	ac820030 	sw	v0,48(a0)
+    46a0:	3c020000 	lui	v0,0x0
+    46a4:	24424ac0 	addiu	v0,v0,19136
+    46a8:	ac820034 	sw	v0,52(a0)
+    46ac:	3c020000 	lui	v0,0x0
+    46b0:	24424a4c 	addiu	v0,v0,19020
+    46b4:	ac820038 	sw	v0,56(a0)
+    46b8:	3c020000 	lui	v0,0x0
+    46bc:	2442465c 	addiu	v0,v0,18012
+    46c0:	ac820040 	sw	v0,64(a0)
+    46c4:	3c020000 	lui	v0,0x0
+    46c8:	2442486c 	addiu	v0,v0,18540
+    46cc:	ac820044 	sw	v0,68(a0)
+    46d0:	3c020000 	lui	v0,0x0
+    46d4:	24424780 	addiu	v0,v0,18304
+    46d8:	ac820048 	sw	v0,72(a0)
+    46dc:	3c020000 	lui	v0,0x0
+    46e0:	24424664 	addiu	v0,v0,18020
+    46e4:	ac820050 	sw	v0,80(a0)
+    46e8:	ac80003c 	sw	zero,60(a0)
+    46ec:	ac80004c 	sw	zero,76(a0)
+    46f0:	3c020004 	lui	v0,0x4
+    46f4:	00808021 	addu	s0,a0,zero
+    46f8:	8c43bc04 	lw	v1,-17404(v0)
+    46fc:	8c84001c 	lw	a0,28(a0)
+    4700:	24050005 	addiu	a1,zero,5
+    4704:	ae050054 	sw	a1,84(s0)
+    4708:	261100ec 	addiu	s1,s0,236
+    470c:	3c050003 	lui	a1,0x3
+    4710:	ae040068 	sw	a0,104(s0)
+    4714:	24a545fc 	addiu	a1,a1,17916
+    4718:	00603021 	addu	a2,v1,zero
+    471c:	ae000014 	sw	zero,20(s0)
+    4720:	24630001 	addiu	v1,v1,1
+    4724:	02202021 	addu	a0,s1,zero
+    4728:	0c00c414 	jal	31050 <sprintk>
+    472c:	ac43bc04 	sw	v1,-17404(v0)
+    4730:	ae11008c 	sw	s1,140(s0)
+    4734:	ae000090 	sw	zero,144(s0)
+    4738:	02001821 	addu	v1,s0,zero
+    473c:	00001021 	addu	v0,zero,zero
+    4740:	2405000a 	addiu	a1,zero,10
+    4744:	24440013 	addiu	a0,v0,19
+    4748:	000420c0 	sll	a0,a0,0x3
+    474c:	02042021 	addu	a0,s0,a0
+    4750:	24840004 	addiu	a0,a0,4
+    4754:	24420001 	addiu	v0,v0,1
+    4758:	ac6400a0 	sw	a0,160(v1)
+    475c:	ac64009c 	sw	a0,156(v1)
+    4760:	1445fff8 	bne	v0,a1,4744 <soclib_fb_init+0xc0>
+    4764:	24630008 	addiu	v1,v1,8
+    4768:	8fbf001c 	lw	ra,28(sp)
+    476c:	00001021 	addu	v0,zero,zero
+    4770:	8fb10018 	lw	s1,24(sp)
+    4774:	8fb00014 	lw	s0,20(sp)
+    4778:	03e00008 	jr	ra
+    477c:	27bd0020 	addiu	sp,sp,32
+    4780:	8ca30014 	lw	v1,20(a1)
+    4784:	27bdffb8 	addiu	sp,sp,-72
+    4788:	8c820068 	lw	v0,104(a0)
+    478c:	afb00034 	sw	s0,52(sp)
+    4790:	8c6400f8 	lw	a0,248(v1)
+    4794:	8c7000f4 	lw	s0,244(v1)
+    4798:	afb2003c 	sw	s2,60(sp)
+    479c:	00902023 	subu	a0,a0,s0
+    47a0:	8c7200e8 	lw	s2,232(v1)
+    47a4:	0044202b 	sltu	a0,v0,a0
+    47a8:	afbf0044 	sw	ra,68(sp)
+    47ac:	afb30040 	sw	s3,64(sp)
+    47b0:	afb10038 	sw	s1,56(sp)
+    47b4:	14800017 	bnez	a0,4814 <soclib_fb_init+0x190>
+    47b8:	265200d0 	addiu	s2,s2,208
+    47bc:	8c7100f8 	lw	s1,248(v1)
+    47c0:	02308823 	subu	s1,s1,s0
+    47c4:	12200027 	beqz	s1,4864 <soclib_fb_init+0x1e0>
+    47c8:	27b30018 	addiu	s3,sp,24
+    47cc:	afa00018 	sw	zero,24(sp)
+    47d0:	080011f8 	j	47e0 <soclib_fb_init+0x15c>
+    47d4:	afa0001c 	sw	zero,28(sp)
+    47d8:	12200007 	beqz	s1,47f8 <soclib_fb_init+0x174>
+    47dc:	26101000 	addiu	s0,s0,4096
+    47e0:	02002821 	addu	a1,s0,zero
+    47e4:	02402021 	addu	a0,s2,zero
+    47e8:	0c000c15 	jal	3054 <pmm_set_page>
+    47ec:	02603021 	addu	a2,s3,zero
+    47f0:	1040fff9 	beqz	v0,47d8 <soclib_fb_init+0x154>
+    47f4:	2631f000 	addiu	s1,s1,-4096
+    47f8:	8fbf0044 	lw	ra,68(sp)
+    47fc:	8fb30040 	lw	s3,64(sp)
+    4800:	8fb2003c 	lw	s2,60(sp)
+    4804:	8fb10038 	lw	s1,56(sp)
+    4808:	8fb00034 	lw	s0,52(sp)
+    480c:	03e00008 	jr	ra
+    4810:	27bd0048 	addiu	sp,sp,72
+    4814:	8c6300f8 	lw	v1,248(v1)
+    4818:	3c040004 	lui	a0,0x4
+    481c:	8c849100 	lw	a0,-28416(a0)
+    4820:	3c060003 	lui	a2,0x3
+    4824:	3c070003 	lui	a3,0x3
+    4828:	00708023 	subu	s0,v1,s0
+    482c:	24c64604 	addiu	a2,a2,17924
+    4830:	24e746a4 	addiu	a3,a3,18084
+    4834:	00002821 	addu	a1,zero,zero
+    4838:	afb00010 	sw	s0,16(sp)
+    483c:	0c0009b0 	jal	26c0 <__fprintk>
+    4840:	afa20014 	sw	v0,20(sp)
+    4844:	8fbf0044 	lw	ra,68(sp)
+    4848:	24020022 	addiu	v0,zero,34
+    484c:	8fb30040 	lw	s3,64(sp)
+    4850:	8fb2003c 	lw	s2,60(sp)
+    4854:	8fb10038 	lw	s1,56(sp)
+    4858:	8fb00034 	lw	s0,52(sp)
+    485c:	03e00008 	jr	ra
+    4860:	27bd0048 	addiu	sp,sp,72
+    4864:	080011fe 	j	47f8 <soclib_fb_init+0x174>
+    4868:	00001021 	addu	v0,zero,zero
+    486c:	27bdffa0 	addiu	sp,sp,-96
+    4870:	afb00044 	sw	s0,68(sp)
+    4874:	8cb00014 	lw	s0,20(a1)
+    4878:	afb2004c 	sw	s2,76(sp)
+    487c:	8e0200f4 	lw	v0,244(s0)
+    4880:	00809021 	addu	s2,a0,zero
+    4884:	8e0400f8 	lw	a0,248(s0)
+    4888:	8e430068 	lw	v1,104(s2)
+    488c:	00822023 	subu	a0,a0,v0
+    4890:	afb10048 	sw	s1,72(sp)
+    4894:	afbf005c 	sw	ra,92(sp)
+    4898:	afb50058 	sw	s5,88(sp)
+    489c:	afb40054 	sw	s4,84(sp)
+    48a0:	afb30050 	sw	s3,80(sp)
+    48a4:	0064202b 	sltu	a0,v1,a0
+    48a8:	8cb30010 	lw	s3,16(a1)
+    48ac:	10800017 	beqz	a0,490c <soclib_fb_init+0x288>
+    48b0:	8e1100e8 	lw	s1,232(s0)
+    48b4:	8e0500f8 	lw	a1,248(s0)
+    48b8:	3c040004 	lui	a0,0x4
+    48bc:	8c849100 	lw	a0,-28416(a0)
+    48c0:	3c060003 	lui	a2,0x3
+    48c4:	3c070003 	lui	a3,0x3
+    48c8:	00a21023 	subu	v0,a1,v0
+    48cc:	24c64638 	addiu	a2,a2,17976
+    48d0:	24e746b0 	addiu	a3,a3,18096
+    48d4:	00002821 	addu	a1,zero,zero
+    48d8:	afa20010 	sw	v0,16(sp)
+    48dc:	0c0009b0 	jal	26c0 <__fprintk>
+    48e0:	afa30014 	sw	v1,20(sp)
+    48e4:	24020022 	addiu	v0,zero,34
+    48e8:	8fbf005c 	lw	ra,92(sp)
+    48ec:	8fb50058 	lw	s5,88(sp)
+    48f0:	8fb40054 	lw	s4,84(sp)
+    48f4:	8fb30050 	lw	s3,80(sp)
+    48f8:	8fb2004c 	lw	s2,76(sp)
+    48fc:	8fb10048 	lw	s1,72(sp)
+    4900:	8fb00044 	lw	s0,68(sp)
+    4904:	03e00008 	jr	ra
+    4908:	27bd0060 	addiu	sp,sp,96
+    490c:	3c030004 	lui	v1,0x4
+    4910:	8e6a0018 	lw	t2,24(s3)
+    4914:	8e69001c 	lw	t1,28(s3)
+    4918:	8e680020 	lw	t0,32(s3)
+    491c:	8c649100 	lw	a0,-28416(v1)
+    4920:	3c060003 	lui	a2,0x3
+    4924:	8e0300f8 	lw	v1,248(s0)
+    4928:	3c070003 	lui	a3,0x3
+    492c:	24c6466c 	addiu	a2,a2,18028
+    4930:	00002821 	addu	a1,zero,zero
+    4934:	24e746b0 	addiu	a3,a3,18096
+    4938:	263100d0 	addiu	s1,s1,208
+    493c:	afaa0010 	sw	t2,16(sp)
+    4940:	afa90014 	sw	t1,20(sp)
+    4944:	afa80018 	sw	t0,24(sp)
+    4948:	afa2001c 	sw	v0,28(sp)
+    494c:	afa30020 	sw	v1,32(sp)
+    4950:	0c0009b0 	jal	26c0 <__fprintk>
+    4954:	27b50028 	addiu	s5,sp,40
+    4958:	8e450010 	lw	a1,16(s2)
+    495c:	02202021 	addu	a0,s1,zero
+    4960:	0c000a56 	jal	2958 <pmm_get_page>
+    4964:	02a03021 	addu	a2,s5,zero
+    4968:	1440ffe0 	bnez	v0,48ec <soclib_fb_init+0x268>
+    496c:	8fbf005c 	lw	ra,92(sp)
+    4970:	8e1400f4 	lw	s4,244(s0)
+    4974:	8e1200f8 	lw	s2,248(s0)
+    4978:	8e030104 	lw	v1,260(s0)
+    497c:	02549023 	subu	s2,s2,s4
+    4980:	34630080 	ori	v1,v1,0x80
+    4984:	32420fff 	andi	v0,s2,0xfff
+    4988:	ae030104 	sw	v1,260(s0)
+    498c:	10400004 	beqz	v0,49a0 <soclib_fb_init+0x31c>
+    4990:	8e030100 	lw	v1,256(s0)
+    4994:	2402f000 	addiu	v0,zero,-4096
+    4998:	02429024 	and	s2,s2,v0
+    499c:	26521000 	addiu	s2,s2,4096
+    49a0:	12400013 	beqz	s2,49f0 <soclib_fb_init+0x36c>
+    49a4:	2602011c 	addiu	v0,s0,284
+    49a8:	3c02f7ff 	lui	v0,0xf7ff
+    49ac:	3442ffff 	ori	v0,v0,0xffff
+    49b0:	00621824 	and	v1,v1,v0
+    49b4:	afa30028 	sw	v1,40(sp)
+    49b8:	08001272 	j	49c8 <soclib_fb_init+0x344>
+    49bc:	afa00030 	sw	zero,48(sp)
+    49c0:	24420001 	addiu	v0,v0,1
+    49c4:	afa2002c 	sw	v0,44(sp)
+    49c8:	02802821 	addu	a1,s4,zero
+    49cc:	02202021 	addu	a0,s1,zero
+    49d0:	0c000c15 	jal	3054 <pmm_set_page>
+    49d4:	02a03021 	addu	a2,s5,zero
+    49d8:	1440ffc3 	bnez	v0,48e8 <soclib_fb_init+0x264>
+    49dc:	2652f000 	addiu	s2,s2,-4096
+    49e0:	26941000 	addiu	s4,s4,4096
+    49e4:	1640fff6 	bnez	s2,49c0 <soclib_fb_init+0x33c>
+    49e8:	8fa2002c 	lw	v0,44(sp)
+    49ec:	2602011c 	addiu	v0,s0,284
+    49f0:	26630030 	addiu	v1,s3,48
+    49f4:	8e670000 	lw	a3,0(s3)
+    49f8:	8e660004 	lw	a2,4(s3)
+    49fc:	8e650008 	lw	a1,8(s3)
+    4a00:	8e64000c 	lw	a0,12(s3)
+    4a04:	26730010 	addiu	s3,s3,16
+    4a08:	ac470000 	sw	a3,0(v0)
+    4a0c:	ac460004 	sw	a2,4(v0)
+    4a10:	ac450008 	sw	a1,8(v0)
+    4a14:	ac44000c 	sw	a0,12(v0)
+    4a18:	1663fff6 	bne	s3,v1,49f4 <soclib_fb_init+0x370>
+    4a1c:	24420010 	addiu	v0,v0,16
+    4a20:	8e650008 	lw	a1,8(s3)
+    4a24:	8e640000 	lw	a0,0(s3)
+    4a28:	8e630004 	lw	v1,4(s3)
+    4a2c:	ac450008 	sw	a1,8(v0)
+    4a30:	3c050004 	lui	a1,0x4
+    4a34:	24a594c0 	addiu	a1,a1,-27456
+    4a38:	ac440000 	sw	a0,0(v0)
+    4a3c:	ac430004 	sw	v1,4(v0)
+    4a40:	ae05010c 	sw	a1,268(s0)
+    4a44:	0800123a 	j	48e8 <soclib_fb_init+0x264>
+    4a48:	00001021 	addu	v0,zero,zero
+    4a4c:	27bdffe8 	addiu	sp,sp,-24
+    4a50:	afb00010 	sw	s0,16(sp)
+    4a54:	afbf0014 	sw	ra,20(sp)
+    4a58:	8ca20010 	lw	v0,16(a1)
+    4a5c:	00a08021 	addu	s0,a1,zero
+    4a60:	8c430014 	lw	v1,20(v0)
+    4a64:	8c820068 	lw	v0,104(a0)
+    4a68:	8c650004 	lw	a1,4(v1)
+    4a6c:	8c830010 	lw	v1,16(a0)
+    4a70:	00621021 	addu	v0,v1,v0
+    4a74:	00652021 	addu	a0,v1,a1
+    4a78:	1082000d 	beq	a0,v0,4ab0 <soclib_fb_init+0x42c>
+    4a7c:	8fbf0014 	lw	ra,20(sp)
+    4a80:	8e060008 	lw	a2,8(s0)
+    4a84:	8e050000 	lw	a1,0(s0)
+    4a88:	00861821 	addu	v1,a0,a2
+    4a8c:	00433823 	subu	a3,v0,v1
+    4a90:	0043102b 	sltu	v0,v0,v1
+    4a94:	0c00c12b 	jal	304ac <memcpy>
+    4a98:	00e2300b 	movn	a2,a3,v0
+    4a9c:	8fbf0014 	lw	ra,20(sp)
+    4aa0:	8e020008 	lw	v0,8(s0)
+    4aa4:	8fb00010 	lw	s0,16(sp)
+    4aa8:	03e00008 	jr	ra
+    4aac:	27bd0018 	addiu	sp,sp,24
+    4ab0:	2402ffde 	addiu	v0,zero,-34
+    4ab4:	8fb00010 	lw	s0,16(sp)
+    4ab8:	03e00008 	jr	ra
+    4abc:	27bd0018 	addiu	sp,sp,24
+    4ac0:	27bdffe8 	addiu	sp,sp,-24
+    4ac4:	afbf0014 	sw	ra,20(sp)
+    4ac8:	afb00010 	sw	s0,16(sp)
+    4acc:	8ca20010 	lw	v0,16(a1)
+    4ad0:	8c830068 	lw	v1,104(a0)
+    4ad4:	8c420014 	lw	v0,20(v0)
+    4ad8:	8c460004 	lw	a2,4(v0)
+    4adc:	8c820010 	lw	v0,16(a0)
+    4ae0:	00431821 	addu	v1,v0,v1
+    4ae4:	00461021 	addu	v0,v0,a2
+    4ae8:	1043000f 	beq	v0,v1,4b28 <soclib_fb_init+0x4a4>
+    4aec:	8fbf0014 	lw	ra,20(sp)
+    4af0:	8cb00008 	lw	s0,8(a1)
+    4af4:	8ca40004 	lw	a0,4(a1)
+    4af8:	00502821 	addu	a1,v0,s0
+    4afc:	00653023 	subu	a2,v1,a1
+    4b00:	0065182b 	sltu	v1,v1,a1
+    4b04:	00c3800b 	movn	s0,a2,v1
+    4b08:	02003021 	addu	a2,s0,zero
+    4b0c:	0c00c12b 	jal	304ac <memcpy>
+    4b10:	00402821 	addu	a1,v0,zero
+    4b14:	8fbf0014 	lw	ra,20(sp)
+    4b18:	02001021 	addu	v0,s0,zero
+    4b1c:	8fb00010 	lw	s0,16(sp)
+    4b20:	03e00008 	jr	ra
+    4b24:	27bd0018 	addiu	sp,sp,24
+    4b28:	00001021 	addu	v0,zero,zero
+    4b2c:	8fb00010 	lw	s0,16(sp)
+    4b30:	03e00008 	jr	ra
+    4b34:	27bd0018 	addiu	sp,sp,24
+    4b38:	8c820010 	lw	v0,16(a0)
+    4b3c:	ac450008 	sw	a1,8(v0)
+    4b40:	03e00008 	jr	ra
+    4b44:	00000000 	sll	zero,zero,0x0
+    4b48:	8c820010 	lw	v0,16(a0)
+    4b4c:	8c420004 	lw	v0,4(v0)
+    4b50:	03e00008 	jr	ra
+    4b54:	00000000 	sll	zero,zero,0x0
+    4b58:	8c820010 	lw	v0,16(a0)
+    4b5c:	8c420010 	lw	v0,16(v0)
+    4b60:	03e00008 	jr	ra
+    4b64:	00000000 	sll	zero,zero,0x0
+
+00004b68 <soclib_icu_bind>:
+    4b68:	8ca20064 	lw	v0,100(a1)
+    4b6c:	28430020 	slti	v1,v0,32
+    4b70:	10600008 	beqz	v1,4b94 <soclib_icu_bind+0x2c>
+    4b74:	8c840068 	lw	a0,104(a0)
+    4b78:	00021080 	sll	v0,v0,0x2
+    4b7c:	00822021 	addu	a0,a0,v0
+    4b80:	8c820000 	lw	v0,0(a0)
+    4b84:	10400005 	beqz	v0,4b9c <soclib_icu_bind+0x34>
+    4b88:	24a50058 	addiu	a1,a1,88
+    4b8c:	03e00008 	jr	ra
+    4b90:	24020010 	addiu	v0,zero,16
+    4b94:	03e00008 	jr	ra
+    4b98:	24020022 	addiu	v0,zero,34
+    4b9c:	ac850000 	sw	a1,0(a0)
+    4ba0:	03e00008 	jr	ra
+    4ba4:	00001021 	addu	v0,zero,zero
+
+00004ba8 <soclib_icu_init>:
+    4ba8:	27bdffd0 	addiu	sp,sp,-48
+    4bac:	3c020004 	lui	v0,0x4
+    4bb0:	afb10028 	sw	s1,40(sp)
+    4bb4:	afb00024 	sw	s0,36(sp)
+    4bb8:	249100ec 	addiu	s1,a0,236
+    4bbc:	00808021 	addu	s0,a0,zero
+    4bc0:	24040002 	addiu	a0,zero,2
+    4bc4:	8c43bc08 	lw	v1,-17400(v0)
+    4bc8:	ae040014 	sw	a0,20(s0)
+    4bcc:	3c040000 	lui	a0,0x0
+    4bd0:	24844cc4 	addiu	a0,a0,19652
+    4bd4:	3c050003 	lui	a1,0x3
+    4bd8:	ae04005c 	sw	a0,92(s0)
+    4bdc:	24a546b8 	addiu	a1,a1,18104
+    4be0:	00603021 	addu	a2,v1,zero
+    4be4:	ae100058 	sw	s0,88(s0)
+    4be8:	24630001 	addiu	v1,v1,1
+    4bec:	ae000060 	sw	zero,96(s0)
+    4bf0:	ac43bc08 	sw	v1,-17400(v0)
+    4bf4:	afbf002c 	sw	ra,44(sp)
+    4bf8:	0c00c414 	jal	31050 <sprintk>
+    4bfc:	02202021 	addu	a0,s1,zero
+    4c00:	ae11008c 	sw	s1,140(s0)
+    4c04:	ae000090 	sw	zero,144(s0)
+    4c08:	02001821 	addu	v1,s0,zero
+    4c0c:	00001021 	addu	v0,zero,zero
+    4c10:	2405000a 	addiu	a1,zero,10
+    4c14:	24440013 	addiu	a0,v0,19
+    4c18:	000420c0 	sll	a0,a0,0x3
+    4c1c:	02042021 	addu	a0,s0,a0
+    4c20:	24840004 	addiu	a0,a0,4
+    4c24:	24420001 	addiu	v0,v0,1
+    4c28:	ac6400a0 	sw	a0,160(v1)
+    4c2c:	ac64009c 	sw	a0,156(v1)
+    4c30:	1445fff8 	bne	v0,a1,4c14 <soclib_icu_init+0x6c>
+    4c34:	24630008 	addiu	v1,v1,8
+    4c38:	3c020000 	lui	v0,0x0
+    4c3c:	24424b38 	addiu	v0,v0,19256
+    4c40:	ae020030 	sw	v0,48(s0)
+    4c44:	3c020000 	lui	v0,0x0
+    4c48:	24424b48 	addiu	v0,v0,19272
+    4c4c:	ae020034 	sw	v0,52(s0)
+    4c50:	3c020000 	lui	v0,0x0
+    4c54:	24424b58 	addiu	v0,v0,19288
+    4c58:	ae020038 	sw	v0,56(s0)
+    4c5c:	3c020000 	lui	v0,0x0
+    4c60:	24424b68 	addiu	v0,v0,19304
+    4c64:	ae020040 	sw	v0,64(s0)
+    4c68:	24020006 	addiu	v0,zero,6
+    4c6c:	ae020054 	sw	v0,84(s0)
+    4c70:	24020001 	addiu	v0,zero,1
+    4c74:	afa20010 	sw	v0,16(sp)
+    4c78:	24020080 	addiu	v0,zero,128
+    4c7c:	afa20014 	sw	v0,20(sp)
+    4c80:	27a40010 	addiu	a0,sp,16
+    4c84:	3c02000d 	lui	v0,0xd
+    4c88:	0c00713f 	jal	1c4fc <kmem_alloc>
+    4c8c:	afa20018 	sw	v0,24(sp)
+    4c90:	10400007 	beqz	v0,4cb0 <soclib_icu_init+0x108>
+    4c94:	8fbf002c 	lw	ra,44(sp)
+    4c98:	ae020068 	sw	v0,104(s0)
+    4c9c:	8fb10028 	lw	s1,40(sp)
+    4ca0:	00001021 	addu	v0,zero,zero
+    4ca4:	8fb00024 	lw	s0,36(sp)
+    4ca8:	03e00008 	jr	ra
+    4cac:	27bd0030 	addiu	sp,sp,48
+    4cb0:	2402000c 	addiu	v0,zero,12
+    4cb4:	8fb10028 	lw	s1,40(sp)
+    4cb8:	8fb00024 	lw	s0,36(sp)
+    4cbc:	03e00008 	jr	ra
+    4cc0:	27bd0030 	addiu	sp,sp,48
+
+00004cc4 <icu_irq_handler>:
+    4cc4:	27bdffc0 	addiu	sp,sp,-64
+    4cc8:	afb10020 	sw	s1,32(sp)
+    4ccc:	8c910000 	lw	s1,0(a0)
+    4cd0:	afb70038 	sw	s7,56(sp)
+    4cd4:	afb60034 	sw	s6,52(sp)
+    4cd8:	afb50030 	sw	s5,48(sp)
+    4cdc:	afb20024 	sw	s2,36(sp)
+    4ce0:	3c170004 	lui	s7,0x4
+    4ce4:	3c160003 	lui	s6,0x3
+    4ce8:	3c150003 	lui	s5,0x3
+    4cec:	8e320068 	lw	s2,104(s1)
+    4cf0:	afb4002c 	sw	s4,44(sp)
+    4cf4:	afbf003c 	sw	ra,60(sp)
+    4cf8:	afb30028 	sw	s3,40(sp)
+    4cfc:	afb0001c 	sw	s0,28(sp)
+    4d00:	26f7c950 	addiu	s7,s7,-14000
+    4d04:	26d646c0 	addiu	s6,s6,18112
+    4d08:	26b53934 	addiu	s5,s5,14644
+    4d0c:	3c140004 	lui	s4,0x4
+    4d10:	8e220010 	lw	v0,16(s1)
+    4d14:	8c500010 	lw	s0,16(v0)
+    4d18:	00108600 	sll	s0,s0,0x18
+    4d1c:	00108603 	sra	s0,s0,0x18
+    4d20:	00101080 	sll	v0,s0,0x2
+    4d24:	0600000e 	bltz	s0,4d60 <icu_irq_handler+0x9c>
+    4d28:	02421021 	addu	v0,s2,v0
+    4d2c:	8c420000 	lw	v0,0(v0)
+    4d30:	10400016 	beqz	v0,4d8c <icu_irq_handler+0xc8>
+    4d34:	00402021 	addu	a0,v0,zero
+    4d38:	8c420004 	lw	v0,4(v0)
+    4d3c:	0040f809 	jalr	v0
+    4d40:	00000000 	sll	zero,zero,0x0
+    4d44:	8e220010 	lw	v0,16(s1)
+    4d48:	8c500010 	lw	s0,16(v0)
+    4d4c:	00108600 	sll	s0,s0,0x18
+    4d50:	00108603 	sra	s0,s0,0x18
+    4d54:	00101080 	sll	v0,s0,0x2
+    4d58:	0601fff4 	bgez	s0,4d2c <icu_irq_handler+0x68>
+    4d5c:	02421021 	addu	v0,s2,v0
+    4d60:	8fbf003c 	lw	ra,60(sp)
+    4d64:	8fb70038 	lw	s7,56(sp)
+    4d68:	8fb60034 	lw	s6,52(sp)
+    4d6c:	8fb50030 	lw	s5,48(sp)
+    4d70:	8fb4002c 	lw	s4,44(sp)
+    4d74:	8fb30028 	lw	s3,40(sp)
+    4d78:	8fb20024 	lw	s2,36(sp)
+    4d7c:	8fb10020 	lw	s1,32(sp)
+    4d80:	8fb0001c 	lw	s0,28(sp)
+    4d84:	03e00008 	jr	ra
+    4d88:	27bd0040 	addiu	sp,sp,64
+    4d8c:	40027801 	mfc0	v0,$15,1
+    4d90:	30420003 	andi	v0,v0,0x3
+    4d94:	00021080 	sll	v0,v0,0x2
+    4d98:	00571021 	addu	v0,v0,s7
+    4d9c:	8c530000 	lw	s3,0(v0)
+    4da0:	8e849140 	lw	a0,-28352(s4)
+    4da4:	02c03021 	addu	a2,s6,zero
+    4da8:	02003821 	addu	a3,s0,zero
+    4dac:	24050001 	addiu	a1,zero,1
+    4db0:	0c0009b0 	jal	26c0 <__fprintk>
+    4db4:	afb30010 	sw	s3,16(sp)
+    4db8:	8e220010 	lw	v0,16(s1)
+    4dbc:	24030001 	addiu	v1,zero,1
+    4dc0:	8c440004 	lw	a0,4(v0)
+    4dc4:	02031804 	sllv	v1,v1,s0
+    4dc8:	00031827 	nor	v1,zero,v1
+    4dcc:	00641824 	and	v1,v1,a0
+    4dd0:	ac430008 	sw	v1,8(v0)
+    4dd4:	8e849140 	lw	a0,-28352(s4)
+    4dd8:	02003821 	addu	a3,s0,zero
+    4ddc:	24050001 	addiu	a1,zero,1
+    4de0:	02a03021 	addu	a2,s5,zero
+    4de4:	0c0009b0 	jal	26c0 <__fprintk>
+    4de8:	afb30010 	sw	s3,16(sp)
+    4dec:	08001345 	j	4d14 <icu_irq_handler+0x50>
+    4df0:	8e220010 	lw	v0,16(s1)
+
+00004df4 <iopic_bind_wti_and_irq>:
+    4df4:	94820018 	lhu	v0,24(a0)
+    4df8:	8ca6007c 	lw	a2,124(a1)
+    4dfc:	2c470101 	sltiu	a3,v0,257
+    4e00:	8ca30064 	lw	v1,100(a1)
+    4e04:	8c840010 	lw	a0,16(a0)
+    4e08:	14e00003 	bnez	a3,4e18 <iopic_bind_wti_and_irq+0x24>
+    4e0c:	8ca50078 	lw	a1,120(a1)
+    4e10:	08001384 	j	4e10 <iopic_bind_wti_and_irq+0x1c>
+    4e14:	00000000 	sll	zero,zero,0x0
+    4e18:	00023900 	sll	a3,v0,0x4
+    4e1c:	00021080 	sll	v0,v0,0x2
+    4e20:	00e21023 	subu	v0,a3,v0
+    4e24:	3c070004 	lui	a3,0x4
+    4e28:	24e7c9a0 	addiu	a3,a3,-13920
+    4e2c:	00e21021 	addu	v0,a3,v0
+    4e30:	8c420000 	lw	v0,0(v0)
+    4e34:	3c075555 	lui	a3,0x5555
+    4e38:	34e75555 	ori	a3,a3,0x5555
+    4e3c:	1047fff4 	beq	v0,a3,4e10 <iopic_bind_wti_and_irq+0x1c>
+    4e40:	00000000 	sll	zero,zero,0x0
+    4e44:	00031900 	sll	v1,v1,0x4
+    4e48:	00831821 	addu	v1,a0,v1
+    4e4c:	4808c000 	mfc2	t0,$24
+    4e50:	4882c000 	mtc2	v0,$24
+    4e54:	ac650000 	sw	a1,0(v1)
+    4e58:	4888c000 	mtc2	t0,$24
+    4e5c:	24630004 	addiu	v1,v1,4
+    4e60:	4808c000 	mfc2	t0,$24
+    4e64:	4882c000 	mtc2	v0,$24
+    4e68:	ac660000 	sw	a2,0(v1)
+    4e6c:	4888c000 	mtc2	t0,$24
+    4e70:	03e00008 	jr	ra
+    4e74:	00000000 	sll	zero,zero,0x0
+
+00004e78 <iopic_get_status>:
+    4e78:	94820018 	lhu	v0,24(a0)
+    4e7c:	2c470101 	sltiu	a3,v0,257
+    4e80:	14e00003 	bnez	a3,4e90 <iopic_get_status+0x18>
+    4e84:	8c830010 	lw	v1,16(a0)
+    4e88:	080013a2 	j	4e88 <iopic_get_status+0x10>
+    4e8c:	00000000 	sll	zero,zero,0x0
+    4e90:	00022100 	sll	a0,v0,0x4
+    4e94:	00021080 	sll	v0,v0,0x2
+    4e98:	00821023 	subu	v0,a0,v0
+    4e9c:	3c040004 	lui	a0,0x4
+    4ea0:	2484c9a0 	addiu	a0,a0,-13920
+    4ea4:	00821021 	addu	v0,a0,v0
+    4ea8:	8c420000 	lw	v0,0(v0)
+    4eac:	3c045555 	lui	a0,0x5555
+    4eb0:	34845555 	ori	a0,a0,0x5555
+    4eb4:	1044fff4 	beq	v0,a0,4e88 <iopic_get_status+0x10>
+    4eb8:	00000000 	sll	zero,zero,0x0
+    4ebc:	00052880 	sll	a1,a1,0x2
+    4ec0:	00651821 	addu	v1,v1,a1
+    4ec4:	24630008 	addiu	v1,v1,8
+    4ec8:	4808c000 	mfc2	t0,$24
+    4ecc:	4882c000 	mtc2	v0,$24
+    4ed0:	8c620000 	lw	v0,0(v1)
+    4ed4:	4888c000 	mtc2	t0,$24
+    4ed8:	03e00008 	jr	ra
+    4edc:	acc20000 	sw	v0,0(a2)
+
+00004ee0 <soclib_iopic_init>:
+    4ee0:	3c020000 	lui	v0,0x0
+    4ee4:	27bdffe0 	addiu	sp,sp,-32
+    4ee8:	24424df4 	addiu	v0,v0,19956
+    4eec:	afb10018 	sw	s1,24(sp)
+    4ef0:	afb00014 	sw	s0,20(sp)
+    4ef4:	afbf001c 	sw	ra,28(sp)
+    4ef8:	ac820034 	sw	v0,52(a0)
+    4efc:	3c020000 	lui	v0,0x0
+    4f00:	24424e78 	addiu	v0,v0,20088
+    4f04:	ac820030 	sw	v0,48(a0)
+    4f08:	3c020004 	lui	v0,0x4
+    4f0c:	00808021 	addu	s0,a0,zero
+    4f10:	8c43bc0c 	lw	v1,-17396(v0)
+    4f14:	249100ec 	addiu	s1,a0,236
+    4f18:	24040008 	addiu	a0,zero,8
+    4f1c:	ae040054 	sw	a0,84(s0)
+    4f20:	3c050003 	lui	a1,0x3
+    4f24:	24040002 	addiu	a0,zero,2
+    4f28:	ae040014 	sw	a0,20(s0)
+    4f2c:	24a546fc 	addiu	a1,a1,18172
+    4f30:	00603021 	addu	a2,v1,zero
+    4f34:	ae100058 	sw	s0,88(s0)
+    4f38:	24630001 	addiu	v1,v1,1
+    4f3c:	ae000060 	sw	zero,96(s0)
+    4f40:	02202021 	addu	a0,s1,zero
+    4f44:	0c00c414 	jal	31050 <sprintk>
+    4f48:	ac43bc0c 	sw	v1,-17396(v0)
+    4f4c:	ae11008c 	sw	s1,140(s0)
+    4f50:	ae000090 	sw	zero,144(s0)
+    4f54:	02001821 	addu	v1,s0,zero
+    4f58:	00001021 	addu	v0,zero,zero
+    4f5c:	2405000a 	addiu	a1,zero,10
+    4f60:	24440013 	addiu	a0,v0,19
+    4f64:	000420c0 	sll	a0,a0,0x3
+    4f68:	02042021 	addu	a0,s0,a0
+    4f6c:	24840004 	addiu	a0,a0,4
+    4f70:	24420001 	addiu	v0,v0,1
+    4f74:	ac6400a0 	sw	a0,160(v1)
+    4f78:	ac64009c 	sw	a0,156(v1)
+    4f7c:	1445fff8 	bne	v0,a1,4f60 <soclib_iopic_init+0x80>
+    4f80:	24630008 	addiu	v1,v1,8
+    4f84:	8fbf001c 	lw	ra,28(sp)
+    4f88:	00001021 	addu	v0,zero,zero
+    4f8c:	8fb10018 	lw	s1,24(sp)
+    4f90:	8fb00014 	lw	s0,20(sp)
+    4f94:	03e00008 	jr	ra
+    4f98:	27bd0020 	addiu	sp,sp,32
+    4f9c:	03e00008 	jr	ra
+    4fa0:	2402ff82 	addiu	v0,zero,-126
+    4fa4:	03e00008 	jr	ra
+    4fa8:	2402007e 	addiu	v0,zero,126
+    4fac:	2402006c 	addiu	v0,zero,108
+    4fb0:	aca20004 	sw	v0,4(a1)
+    4fb4:	03e00008 	jr	ra
+    4fb8:	00001021 	addu	v0,zero,zero
+    4fbc:	03e00008 	jr	ra
+    4fc0:	00001021 	addu	v0,zero,zero
+    4fc4:	03e00008 	jr	ra
+    4fc8:	2402000e 	addiu	v0,zero,14
+
+00004fcc <soclib_memc_init>:
+    4fcc:	3c020000 	lui	v0,0x0
+    4fd0:	27bdffe0 	addiu	sp,sp,-32
+    4fd4:	24424fbc 	addiu	v0,v0,20412
+    4fd8:	afb10018 	sw	s1,24(sp)
+    4fdc:	afb00014 	sw	s0,20(sp)
+    4fe0:	afbf001c 	sw	ra,28(sp)
+    4fe4:	ac820030 	sw	v0,48(a0)
+    4fe8:	3c020000 	lui	v0,0x0
+    4fec:	24425394 	addiu	v0,v0,21396
+    4ff0:	ac820034 	sw	v0,52(a0)
+    4ff4:	3c020000 	lui	v0,0x0
+    4ff8:	24424f9c 	addiu	v0,v0,20380
+    4ffc:	ac820038 	sw	v0,56(a0)
+    5000:	3c020000 	lui	v0,0x0
+    5004:	24424fa4 	addiu	v0,v0,20388
+    5008:	ac820040 	sw	v0,64(a0)
+    500c:	3c020000 	lui	v0,0x0
+    5010:	244251b4 	addiu	v0,v0,20916
+    5014:	ac820044 	sw	v0,68(a0)
+    5018:	3c020000 	lui	v0,0x0
+    501c:	244250c8 	addiu	v0,v0,20680
+    5020:	ac820048 	sw	v0,72(a0)
+    5024:	3c020000 	lui	v0,0x0
+    5028:	24424fac 	addiu	v0,v0,20396
+    502c:	ac820050 	sw	v0,80(a0)
+    5030:	ac80003c 	sw	zero,60(a0)
+    5034:	ac80004c 	sw	zero,76(a0)
+    5038:	3c020004 	lui	v0,0x4
+    503c:	00808021 	addu	s0,a0,zero
+    5040:	8c43bc10 	lw	v1,-17392(v0)
+    5044:	8c84001c 	lw	a0,28(a0)
+    5048:	24050009 	addiu	a1,zero,9
+    504c:	ae050054 	sw	a1,84(s0)
+    5050:	261100ec 	addiu	s1,s0,236
+    5054:	3c050003 	lui	a1,0x3
+    5058:	ae040068 	sw	a0,104(s0)
+    505c:	24a54704 	addiu	a1,a1,18180
+    5060:	00603021 	addu	a2,v1,zero
+    5064:	ae000014 	sw	zero,20(s0)
+    5068:	24630001 	addiu	v1,v1,1
+    506c:	02202021 	addu	a0,s1,zero
+    5070:	0c00c414 	jal	31050 <sprintk>
+    5074:	ac43bc10 	sw	v1,-17392(v0)
+    5078:	ae11008c 	sw	s1,140(s0)
+    507c:	ae000090 	sw	zero,144(s0)
+    5080:	02001821 	addu	v1,s0,zero
+    5084:	00001021 	addu	v0,zero,zero
+    5088:	2405000a 	addiu	a1,zero,10
+    508c:	24440013 	addiu	a0,v0,19
+    5090:	000420c0 	sll	a0,a0,0x3
+    5094:	02042021 	addu	a0,s0,a0
+    5098:	24840004 	addiu	a0,a0,4
+    509c:	24420001 	addiu	v0,v0,1
+    50a0:	ac6400a0 	sw	a0,160(v1)
+    50a4:	ac64009c 	sw	a0,156(v1)
+    50a8:	1445fff8 	bne	v0,a1,508c <soclib_memc_init+0xc0>
+    50ac:	24630008 	addiu	v1,v1,8
+    50b0:	8fbf001c 	lw	ra,28(sp)
+    50b4:	00001021 	addu	v0,zero,zero
+    50b8:	8fb10018 	lw	s1,24(sp)
+    50bc:	8fb00014 	lw	s0,20(sp)
+    50c0:	03e00008 	jr	ra
+    50c4:	27bd0020 	addiu	sp,sp,32
+    50c8:	8ca30014 	lw	v1,20(a1)
+    50cc:	27bdffb8 	addiu	sp,sp,-72
+    50d0:	8c820068 	lw	v0,104(a0)
+    50d4:	afb00034 	sw	s0,52(sp)
+    50d8:	8c6400f8 	lw	a0,248(v1)
+    50dc:	8c7000f4 	lw	s0,244(v1)
+    50e0:	afb2003c 	sw	s2,60(sp)
+    50e4:	00902023 	subu	a0,a0,s0
+    50e8:	8c7200e8 	lw	s2,232(v1)
+    50ec:	0044202b 	sltu	a0,v0,a0
+    50f0:	afbf0044 	sw	ra,68(sp)
+    50f4:	afb30040 	sw	s3,64(sp)
+    50f8:	afb10038 	sw	s1,56(sp)
+    50fc:	14800017 	bnez	a0,515c <soclib_memc_init+0x190>
+    5100:	265200d0 	addiu	s2,s2,208
+    5104:	8c7100f8 	lw	s1,248(v1)
+    5108:	02308823 	subu	s1,s1,s0
+    510c:	12200027 	beqz	s1,51ac <soclib_memc_init+0x1e0>
+    5110:	27b30018 	addiu	s3,sp,24
+    5114:	afa00018 	sw	zero,24(sp)
+    5118:	0800144a 	j	5128 <soclib_memc_init+0x15c>
+    511c:	afa0001c 	sw	zero,28(sp)
+    5120:	12200007 	beqz	s1,5140 <soclib_memc_init+0x174>
+    5124:	26101000 	addiu	s0,s0,4096
+    5128:	02002821 	addu	a1,s0,zero
+    512c:	02402021 	addu	a0,s2,zero
+    5130:	0c000c15 	jal	3054 <pmm_set_page>
+    5134:	02603021 	addu	a2,s3,zero
+    5138:	1040fff9 	beqz	v0,5120 <soclib_memc_init+0x154>
+    513c:	2631f000 	addiu	s1,s1,-4096
+    5140:	8fbf0044 	lw	ra,68(sp)
+    5144:	8fb30040 	lw	s3,64(sp)
+    5148:	8fb2003c 	lw	s2,60(sp)
+    514c:	8fb10038 	lw	s1,56(sp)
+    5150:	8fb00034 	lw	s0,52(sp)
+    5154:	03e00008 	jr	ra
+    5158:	27bd0048 	addiu	sp,sp,72
+    515c:	8c6300f8 	lw	v1,248(v1)
+    5160:	3c040004 	lui	a0,0x4
+    5164:	8c849100 	lw	a0,-28416(a0)
+    5168:	3c060003 	lui	a2,0x3
+    516c:	3c070003 	lui	a3,0x3
+    5170:	00708023 	subu	s0,v1,s0
+    5174:	24c64604 	addiu	a2,a2,17924
+    5178:	24e7470c 	addiu	a3,a3,18188
+    517c:	00002821 	addu	a1,zero,zero
+    5180:	afb00010 	sw	s0,16(sp)
+    5184:	0c0009b0 	jal	26c0 <__fprintk>
+    5188:	afa20014 	sw	v0,20(sp)
+    518c:	8fbf0044 	lw	ra,68(sp)
+    5190:	24020022 	addiu	v0,zero,34
+    5194:	8fb30040 	lw	s3,64(sp)
+    5198:	8fb2003c 	lw	s2,60(sp)
+    519c:	8fb10038 	lw	s1,56(sp)
+    51a0:	8fb00034 	lw	s0,52(sp)
+    51a4:	03e00008 	jr	ra
+    51a8:	27bd0048 	addiu	sp,sp,72
+    51ac:	08001450 	j	5140 <soclib_memc_init+0x174>
+    51b0:	00001021 	addu	v0,zero,zero
+    51b4:	27bdffa0 	addiu	sp,sp,-96
+    51b8:	afb00044 	sw	s0,68(sp)
+    51bc:	8cb00014 	lw	s0,20(a1)
+    51c0:	afb2004c 	sw	s2,76(sp)
+    51c4:	8e0200f4 	lw	v0,244(s0)
+    51c8:	00809021 	addu	s2,a0,zero
+    51cc:	8e0400f8 	lw	a0,248(s0)
+    51d0:	8e430068 	lw	v1,104(s2)
+    51d4:	00822023 	subu	a0,a0,v0
+    51d8:	afb10048 	sw	s1,72(sp)
+    51dc:	afbf005c 	sw	ra,92(sp)
+    51e0:	afb50058 	sw	s5,88(sp)
+    51e4:	afb40054 	sw	s4,84(sp)
+    51e8:	afb30050 	sw	s3,80(sp)
+    51ec:	0064202b 	sltu	a0,v1,a0
+    51f0:	8cb30010 	lw	s3,16(a1)
+    51f4:	10800017 	beqz	a0,5254 <soclib_memc_init+0x288>
+    51f8:	8e1100e8 	lw	s1,232(s0)
+    51fc:	8e0500f8 	lw	a1,248(s0)
+    5200:	3c040004 	lui	a0,0x4
+    5204:	8c849100 	lw	a0,-28416(a0)
+    5208:	3c060003 	lui	a2,0x3
+    520c:	3c070003 	lui	a3,0x3
+    5210:	00a21023 	subu	v0,a1,v0
+    5214:	24c64638 	addiu	a2,a2,17976
+    5218:	24e74718 	addiu	a3,a3,18200
+    521c:	00002821 	addu	a1,zero,zero
+    5220:	afa20010 	sw	v0,16(sp)
+    5224:	0c0009b0 	jal	26c0 <__fprintk>
+    5228:	afa30014 	sw	v1,20(sp)
+    522c:	24020022 	addiu	v0,zero,34
+    5230:	8fbf005c 	lw	ra,92(sp)
+    5234:	8fb50058 	lw	s5,88(sp)
+    5238:	8fb40054 	lw	s4,84(sp)
+    523c:	8fb30050 	lw	s3,80(sp)
+    5240:	8fb2004c 	lw	s2,76(sp)
+    5244:	8fb10048 	lw	s1,72(sp)
+    5248:	8fb00044 	lw	s0,68(sp)
+    524c:	03e00008 	jr	ra
+    5250:	27bd0060 	addiu	sp,sp,96
+    5254:	3c030004 	lui	v1,0x4
+    5258:	8e6a0018 	lw	t2,24(s3)
+    525c:	8e69001c 	lw	t1,28(s3)
+    5260:	8e680020 	lw	t0,32(s3)
+    5264:	8c649100 	lw	a0,-28416(v1)
+    5268:	3c060003 	lui	a2,0x3
+    526c:	8e0300f8 	lw	v1,248(s0)
+    5270:	3c070003 	lui	a3,0x3
+    5274:	24c6466c 	addiu	a2,a2,18028
+    5278:	00002821 	addu	a1,zero,zero
+    527c:	24e74718 	addiu	a3,a3,18200
+    5280:	263100d0 	addiu	s1,s1,208
+    5284:	afaa0010 	sw	t2,16(sp)
+    5288:	afa90014 	sw	t1,20(sp)
+    528c:	afa80018 	sw	t0,24(sp)
+    5290:	afa2001c 	sw	v0,28(sp)
+    5294:	afa30020 	sw	v1,32(sp)
+    5298:	0c0009b0 	jal	26c0 <__fprintk>
+    529c:	27b50028 	addiu	s5,sp,40
+    52a0:	8e450010 	lw	a1,16(s2)
+    52a4:	02202021 	addu	a0,s1,zero
+    52a8:	0c000a56 	jal	2958 <pmm_get_page>
+    52ac:	02a03021 	addu	a2,s5,zero
+    52b0:	1440ffe0 	bnez	v0,5234 <soclib_memc_init+0x268>
+    52b4:	8fbf005c 	lw	ra,92(sp)
+    52b8:	8e1400f4 	lw	s4,244(s0)
+    52bc:	8e1200f8 	lw	s2,248(s0)
+    52c0:	8e030104 	lw	v1,260(s0)
+    52c4:	02549023 	subu	s2,s2,s4
+    52c8:	34630080 	ori	v1,v1,0x80
+    52cc:	32420fff 	andi	v0,s2,0xfff
+    52d0:	ae030104 	sw	v1,260(s0)
+    52d4:	10400004 	beqz	v0,52e8 <soclib_memc_init+0x31c>
+    52d8:	8e030100 	lw	v1,256(s0)
+    52dc:	2402f000 	addiu	v0,zero,-4096
+    52e0:	02429024 	and	s2,s2,v0
+    52e4:	26521000 	addiu	s2,s2,4096
+    52e8:	12400013 	beqz	s2,5338 <soclib_memc_init+0x36c>
+    52ec:	2602011c 	addiu	v0,s0,284
+    52f0:	3c02f7ff 	lui	v0,0xf7ff
+    52f4:	3442ffff 	ori	v0,v0,0xffff
+    52f8:	00621824 	and	v1,v1,v0
+    52fc:	afa30028 	sw	v1,40(sp)
+    5300:	080014c4 	j	5310 <soclib_memc_init+0x344>
+    5304:	afa00030 	sw	zero,48(sp)
+    5308:	24420001 	addiu	v0,v0,1
+    530c:	afa2002c 	sw	v0,44(sp)
+    5310:	02802821 	addu	a1,s4,zero
+    5314:	02202021 	addu	a0,s1,zero
+    5318:	0c000c15 	jal	3054 <pmm_set_page>
+    531c:	02a03021 	addu	a2,s5,zero
+    5320:	1440ffc3 	bnez	v0,5230 <soclib_memc_init+0x264>
+    5324:	2652f000 	addiu	s2,s2,-4096
+    5328:	26941000 	addiu	s4,s4,4096
+    532c:	1640fff6 	bnez	s2,5308 <soclib_memc_init+0x33c>
+    5330:	8fa2002c 	lw	v0,44(sp)
+    5334:	2602011c 	addiu	v0,s0,284
+    5338:	26630030 	addiu	v1,s3,48
+    533c:	8e670000 	lw	a3,0(s3)
+    5340:	8e660004 	lw	a2,4(s3)
+    5344:	8e650008 	lw	a1,8(s3)
+    5348:	8e64000c 	lw	a0,12(s3)
+    534c:	26730010 	addiu	s3,s3,16
+    5350:	ac470000 	sw	a3,0(v0)
+    5354:	ac460004 	sw	a2,4(v0)
+    5358:	ac450008 	sw	a1,8(v0)
+    535c:	ac44000c 	sw	a0,12(v0)
+    5360:	1663fff6 	bne	s3,v1,533c <soclib_memc_init+0x370>
+    5364:	24420010 	addiu	v0,v0,16
+    5368:	8e650008 	lw	a1,8(s3)
+    536c:	8e640000 	lw	a0,0(s3)
+    5370:	8e630004 	lw	v1,4(s3)
+    5374:	ac450008 	sw	a1,8(v0)
+    5378:	3c050004 	lui	a1,0x4
+    537c:	24a59578 	addiu	a1,a1,-27272
+    5380:	ac440000 	sw	a0,0(v0)
+    5384:	ac430004 	sw	v1,4(v0)
+    5388:	ae05010c 	sw	a1,268(s0)
+    538c:	0800148c 	j	5230 <soclib_memc_init+0x264>
+    5390:	00001021 	addu	v0,zero,zero
+    5394:	8ca20008 	lw	v0,8(a1)
+    5398:	27bdffd8 	addiu	sp,sp,-40
+    539c:	00021082 	srl	v0,v0,0x2
+    53a0:	afb3001c 	sw	s3,28(sp)
+    53a4:	2c43001c 	sltiu	v1,v0,28
+    53a8:	2413001b 	addiu	s3,zero,27
+    53ac:	0043980b 	movn	s3,v0,v1
+    53b0:	afb40020 	sw	s4,32(sp)
+    53b4:	afb10014 	sw	s1,20(sp)
+    53b8:	afbf0024 	sw	ra,36(sp)
+    53bc:	afb20018 	sw	s2,24(sp)
+    53c0:	afb00010 	sw	s0,16(sp)
+    53c4:	0080a021 	addu	s4,a0,zero
+    53c8:	1260000f 	beqz	s3,5408 <soclib_memc_init+0x43c>
+    53cc:	8cb10004 	lw	s1,4(a1)
+    53d0:	3c120003 	lui	s2,0x3
+    53d4:	26524724 	addiu	s2,s2,18212
+    53d8:	00008021 	addu	s0,zero,zero
+    53dc:	96420000 	lhu	v0,0(s2)
+    53e0:	8e850010 	lw	a1,16(s4)
+    53e4:	02202021 	addu	a0,s1,zero
+    53e8:	26100001 	addiu	s0,s0,1
+    53ec:	00a22821 	addu	a1,a1,v0
+    53f0:	0c00c12b 	jal	304ac <memcpy>
+    53f4:	24060004 	addiu	a2,zero,4
+    53f8:	0213102b 	sltu	v0,s0,s3
+    53fc:	26520002 	addiu	s2,s2,2
+    5400:	1440fff6 	bnez	v0,53dc <soclib_memc_init+0x410>
+    5404:	26310004 	addiu	s1,s1,4
+    5408:	8fbf0024 	lw	ra,36(sp)
+    540c:	00131080 	sll	v0,s3,0x2
+    5410:	8fb40020 	lw	s4,32(sp)
+    5414:	8fb3001c 	lw	s3,28(sp)
+    5418:	8fb20018 	lw	s2,24(sp)
+    541c:	8fb10014 	lw	s1,20(sp)
+    5420:	8fb00010 	lw	s0,16(sp)
+    5424:	03e00008 	jr	ra
+    5428:	27bd0028 	addiu	sp,sp,40
+    542c:	8c820010 	lw	v0,16(a0)
+    5430:	8c420000 	lw	v0,0(v0)
+    5434:	03e00008 	jr	ra
+    5438:	00000000 	sll	zero,zero,0x0
+    543c:	8c830010 	lw	v1,16(a0)
+    5440:	24020001 	addiu	v0,zero,1
+    5444:	24040003 	addiu	a0,zero,3
+    5448:	0085100b 	movn	v0,a0,a1
+    544c:	ac620004 	sw	v0,4(v1)
+    5450:	03e00008 	jr	ra
+    5454:	00000000 	sll	zero,zero,0x0
+    5458:	8c820010 	lw	v0,16(a0)
+    545c:	ac400004 	sw	zero,4(v0)
+    5460:	03e00008 	jr	ra
+    5464:	00000000 	sll	zero,zero,0x0
+    5468:	8c820010 	lw	v0,16(a0)
+    546c:	ac450008 	sw	a1,8(v0)
+    5470:	03e00008 	jr	ra
+    5474:	00000000 	sll	zero,zero,0x0
+
+00005478 <soclib_timer_init>:
+    5478:	27bdffe0 	addiu	sp,sp,-32
+    547c:	3c020004 	lui	v0,0x4
+    5480:	afb10018 	sw	s1,24(sp)
+    5484:	afb00014 	sw	s0,20(sp)
+    5488:	249100ec 	addiu	s1,a0,236
+    548c:	00808021 	addu	s0,a0,zero
+    5490:	24040002 	addiu	a0,zero,2
+    5494:	8c43bc14 	lw	v1,-17388(v0)
+    5498:	ae040014 	sw	a0,20(s0)
+    549c:	3c040000 	lui	a0,0x0
+    54a0:	2484555c 	addiu	a0,a0,21852
+    54a4:	3c050003 	lui	a1,0x3
+    54a8:	ae04005c 	sw	a0,92(s0)
+    54ac:	24a5475c 	addiu	a1,a1,18268
+    54b0:	00603021 	addu	a2,v1,zero
+    54b4:	ae100058 	sw	s0,88(s0)
+    54b8:	24630001 	addiu	v1,v1,1
+    54bc:	ae000060 	sw	zero,96(s0)
+    54c0:	ac43bc14 	sw	v1,-17388(v0)
+    54c4:	afbf001c 	sw	ra,28(sp)
+    54c8:	0c00c414 	jal	31050 <sprintk>
+    54cc:	02202021 	addu	a0,s1,zero
+    54d0:	ae11008c 	sw	s1,140(s0)
+    54d4:	ae000090 	sw	zero,144(s0)
+    54d8:	02001821 	addu	v1,s0,zero
+    54dc:	00001021 	addu	v0,zero,zero
+    54e0:	2405000a 	addiu	a1,zero,10
+    54e4:	24440013 	addiu	a0,v0,19
+    54e8:	000420c0 	sll	a0,a0,0x3
+    54ec:	02042021 	addu	a0,s0,a0
+    54f0:	24840004 	addiu	a0,a0,4
+    54f4:	24420001 	addiu	v0,v0,1
+    54f8:	ac6400a0 	sw	a0,160(v1)
+    54fc:	ac64009c 	sw	a0,156(v1)
+    5500:	1445fff8 	bne	v0,a1,54e4 <soclib_timer_init+0x6c>
+    5504:	24630008 	addiu	v1,v1,8
+    5508:	3c020000 	lui	v0,0x0
+    550c:	2442543c 	addiu	v0,v0,21564
+    5510:	ae020030 	sw	v0,48(s0)
+    5514:	3c020000 	lui	v0,0x0
+    5518:	24425458 	addiu	v0,v0,21592
+    551c:	ae020034 	sw	v0,52(s0)
+    5520:	3c020000 	lui	v0,0x0
+    5524:	24425468 	addiu	v0,v0,21608
+    5528:	ae020040 	sw	v0,64(s0)
+    552c:	3c020000 	lui	v0,0x0
+    5530:	2442542c 	addiu	v0,v0,21548
+    5534:	ae020038 	sw	v0,56(s0)
+    5538:	8fbf001c 	lw	ra,28(sp)
+    553c:	24020007 	addiu	v0,zero,7
+    5540:	ae020054 	sw	v0,84(s0)
+    5544:	ae000068 	sw	zero,104(s0)
+    5548:	00001021 	addu	v0,zero,zero
+    554c:	8fb10018 	lw	s1,24(sp)
+    5550:	8fb00014 	lw	s0,20(sp)
+    5554:	03e00008 	jr	ra
+    5558:	27bd0020 	addiu	sp,sp,32
+
+0000555c <timer_irq_handler>:
+    555c:	27bdffe8 	addiu	sp,sp,-24
+    5560:	afb00010 	sw	s0,16(sp)
+    5564:	afbf0014 	sw	ra,20(sp)
+    5568:	00808021 	addu	s0,a0,zero
+    556c:	40022002 	mfc0	v0,$4,2
+    5570:	0c0020a8 	jal	82a0 <cpu_clock>
+    5574:	8c440174 	lw	a0,372(v0)
+    5578:	8e020000 	lw	v0,0(s0)
+    557c:	3c03000f 	lui	v1,0xf
+    5580:	8c420010 	lw	v0,16(v0)
+    5584:	34634240 	ori	v1,v1,0x4240
+    5588:	8fbf0014 	lw	ra,20(sp)
+    558c:	ac40000c 	sw	zero,12(v0)
+    5590:	ac430008 	sw	v1,8(v0)
+    5594:	24030003 	addiu	v1,zero,3
+    5598:	8fb00010 	lw	s0,16(sp)
+    559c:	ac430004 	sw	v1,4(v0)
+    55a0:	03e00008 	jr	ra
+    55a4:	27bd0018 	addiu	sp,sp,24
+
+000055a8 <tty_open>:
+    55a8:	03e00008 	jr	ra
+    55ac:	00001021 	addu	v0,zero,zero
+
+000055b0 <tty_get_status>:
+    55b0:	94850018 	lhu	a1,24(a0)
+    55b4:	2ca20101 	sltiu	v0,a1,257
+    55b8:	14400003 	bnez	v0,55c8 <tty_get_status+0x18>
+    55bc:	8c830010 	lw	v1,16(a0)
+    55c0:	08001570 	j	55c0 <tty_get_status+0x10>
+    55c4:	00000000 	sll	zero,zero,0x0
+    55c8:	00051100 	sll	v0,a1,0x4
+    55cc:	00052880 	sll	a1,a1,0x2
+    55d0:	00452823 	subu	a1,v0,a1
+    55d4:	3c020004 	lui	v0,0x4
+    55d8:	2442c9a0 	addiu	v0,v0,-13920
+    55dc:	00451021 	addu	v0,v0,a1
+    55e0:	3c045555 	lui	a0,0x5555
+    55e4:	8c420000 	lw	v0,0(v0)
+    55e8:	34845555 	ori	a0,a0,0x5555
+    55ec:	1044fff4 	beq	v0,a0,55c0 <tty_get_status+0x10>
+    55f0:	00000000 	sll	zero,zero,0x0
+    55f4:	24630004 	addiu	v1,v1,4
+    55f8:	4808c000 	mfc2	t0,$24
+    55fc:	4882c000 	mtc2	v0,$24
+    5600:	8c620000 	lw	v0,0(v1)
+    5604:	4888c000 	mtc2	t0,$24
+    5608:	00021600 	sll	v0,v0,0x18
+    560c:	03e00008 	jr	ra
+    5610:	00021603 	sra	v0,v0,0x18
+
+00005614 <soclib_tty_init>:
+    5614:	27bdffc8 	addiu	sp,sp,-56
+    5618:	afb2002c 	sw	s2,44(sp)
+    561c:	3c120004 	lui	s2,0x4
+    5620:	8e42bc98 	lw	v0,-17256(s2)
+    5624:	afb00024 	sw	s0,36(sp)
+    5628:	24430001 	addiu	v1,v0,1
+    562c:	2c630020 	sltiu	v1,v1,32
+    5630:	afbf0034 	sw	ra,52(sp)
+    5634:	afb30030 	sw	s3,48(sp)
+    5638:	afb10028 	sw	s1,40(sp)
+    563c:	14600009 	bnez	v1,5664 <soclib_tty_init+0x50>
+    5640:	00808021 	addu	s0,a0,zero
+    5644:	24020022 	addiu	v0,zero,34
+    5648:	8fbf0034 	lw	ra,52(sp)
+    564c:	8fb30030 	lw	s3,48(sp)
+    5650:	8fb2002c 	lw	s2,44(sp)
+    5654:	8fb10028 	lw	s1,40(sp)
+    5658:	8fb00024 	lw	s0,36(sp)
+    565c:	03e00008 	jr	ra
+    5660:	27bd0038 	addiu	sp,sp,56
+    5664:	3c030004 	lui	v1,0x4
+    5668:	2463bc18 	addiu	v1,v1,-17384
+    566c:	00021080 	sll	v0,v0,0x2
+    5670:	00431021 	addu	v0,v0,v1
+    5674:	3c050003 	lui	a1,0x3
+    5678:	ac440000 	sw	a0,0(v0)
+    567c:	0c004a24 	jal	12890 <spinlock_init>
+    5680:	24a54764 	addiu	a1,a1,18276
+    5684:	3c020000 	lui	v0,0x0
+    5688:	244257c4 	addiu	v0,v0,22468
+    568c:	ae02005c 	sw	v0,92(s0)
+    5690:	3c020000 	lui	v0,0x0
+    5694:	24425b88 	addiu	v0,v0,23432
+    5698:	ae020034 	sw	v0,52(s0)
+    569c:	3c020000 	lui	v0,0x0
+    56a0:	24425a84 	addiu	v0,v0,23172
+    56a4:	ae020038 	sw	v0,56(s0)
+    56a8:	3c020000 	lui	v0,0x0
+    56ac:	24425a5c 	addiu	v0,v0,23132
+    56b0:	ae020050 	sw	v0,80(s0)
+    56b4:	24020002 	addiu	v0,zero,2
+    56b8:	ae020054 	sw	v0,84(s0)
+    56bc:	24020001 	addiu	v0,zero,1
+    56c0:	ae000030 	sw	zero,48(s0)
+    56c4:	ae00003c 	sw	zero,60(s0)
+    56c8:	ae000040 	sw	zero,64(s0)
+    56cc:	ae000044 	sw	zero,68(s0)
+    56d0:	ae000048 	sw	zero,72(s0)
+    56d4:	ae00004c 	sw	zero,76(s0)
+    56d8:	afa20010 	sw	v0,16(sp)
+    56dc:	24020020 	addiu	v0,zero,32
+    56e0:	afa20014 	sw	v0,20(sp)
+    56e4:	ae000014 	sw	zero,20(s0)
+    56e8:	3c02000d 	lui	v0,0xd
+    56ec:	ae100058 	sw	s0,88(s0)
+    56f0:	ae000060 	sw	zero,96(s0)
+    56f4:	27a40010 	addiu	a0,sp,16
+    56f8:	0c00713f 	jal	1c4fc <kmem_alloc>
+    56fc:	afa20018 	sw	v0,24(sp)
+    5700:	1040002e 	beqz	v0,57bc <soclib_tty_init+0x1a8>
+    5704:	00408821 	addu	s1,v0,zero
+    5708:	8e42bc98 	lw	v0,-17256(s2)
+    570c:	24040001 	addiu	a0,zero,1
+    5710:	24050028 	addiu	a1,zero,40
+    5714:	00003021 	addu	a2,zero,zero
+    5718:	0c003235 	jal	c8d4 <mwmr_init>
+    571c:	ae220000 	sw	v0,0(s1)
+    5720:	261300ec 	addiu	s3,s0,236
+    5724:	8e46bc98 	lw	a2,-17256(s2)
+    5728:	3c050003 	lui	a1,0x3
+    572c:	24a5476c 	addiu	a1,a1,18284
+    5730:	ae22001c 	sw	v0,28(s1)
+    5734:	ae200004 	sw	zero,4(s1)
+    5738:	ae110068 	sw	s1,104(s0)
+    573c:	0c00c414 	jal	31050 <sprintk>
+    5740:	02602021 	addu	a0,s3,zero
+    5744:	ae13008c 	sw	s3,140(s0)
+    5748:	ae000090 	sw	zero,144(s0)
+    574c:	02001821 	addu	v1,s0,zero
+    5750:	00001021 	addu	v0,zero,zero
+    5754:	2405000a 	addiu	a1,zero,10
+    5758:	24440013 	addiu	a0,v0,19
+    575c:	000420c0 	sll	a0,a0,0x3
+    5760:	02042021 	addu	a0,s0,a0
+    5764:	24840004 	addiu	a0,a0,4
+    5768:	24420001 	addiu	v0,v0,1
+    576c:	ac6400a0 	sw	a0,160(v1)
+    5770:	ac64009c 	sw	a0,156(v1)
+    5774:	1445fff8 	bne	v0,a1,5758 <soclib_tty_init+0x144>
+    5778:	24630008 	addiu	v1,v1,8
+    577c:	8e43bc98 	lw	v1,-17256(s2)
+    5780:	8fbf0034 	lw	ra,52(sp)
+    5784:	26220014 	addiu	v0,s1,20
+    5788:	24630001 	addiu	v1,v1,1
+    578c:	ae220018 	sw	v0,24(s1)
+    5790:	ae33000c 	sw	s3,12(s1)
+    5794:	ae200010 	sw	zero,16(s1)
+    5798:	ae220014 	sw	v0,20(s1)
+    579c:	ae43bc98 	sw	v1,-17256(s2)
+    57a0:	00001021 	addu	v0,zero,zero
+    57a4:	8fb30030 	lw	s3,48(sp)
+    57a8:	8fb2002c 	lw	s2,44(sp)
+    57ac:	8fb10028 	lw	s1,40(sp)
+    57b0:	8fb00024 	lw	s0,36(sp)
+    57b4:	03e00008 	jr	ra
+    57b8:	27bd0038 	addiu	sp,sp,56
+    57bc:	08001592 	j	5648 <soclib_tty_init+0x34>
+    57c0:	2402000c 	addiu	v0,zero,12
+
+000057c4 <tty_irq_handler>:
+    57c4:	27bdffb0 	addiu	sp,sp,-80
+    57c8:	afb00028 	sw	s0,40(sp)
+    57cc:	8c900000 	lw	s0,0(a0)
+    57d0:	afb30034 	sw	s3,52(sp)
+    57d4:	00809821 	addu	s3,a0,zero
+    57d8:	8e040010 	lw	a0,16(s0)
+    57dc:	afb1002c 	sw	s1,44(sp)
+    57e0:	8e0a0018 	lw	t2,24(s0)
+    57e4:	8e110068 	lw	s1,104(s0)
+    57e8:	afb20030 	sw	s2,48(sp)
+    57ec:	afbf004c 	sw	ra,76(sp)
+    57f0:	afbe0048 	sw	s8,72(sp)
+    57f4:	afb70044 	sw	s7,68(sp)
+    57f8:	afb60040 	sw	s6,64(sp)
+    57fc:	afb5003c 	sw	s5,60(sp)
+    5800:	afb40038 	sw	s4,56(sp)
+    5804:	2409ffff 	addiu	t1,zero,-1
+    5808:	00809021 	addu	s2,a0,zero
+    580c:	24060001 	addiu	a2,zero,1
+    5810:	8e020000 	lw	v0,0(s0)
+    5814:	1440fffe 	bnez	v0,5810 <tty_irq_handler+0x4c>
+    5818:	00000000 	sll	zero,zero,0x0
+    581c:	0000000f 	sync
+    5820:	00094025 	or	t0,zero,t1
+    5824:	c2030000 	ll	v1,0(s0)
+    5828:	14620004 	bne	v1,v0,583c <tty_irq_handler+0x78>
+    582c:	24070000 	addiu	a3,zero,0
+    5830:	e2080000 	sc	t0,0(s0)
+    5834:	01003825 	or	a3,t0,zero
+    5838:	0000000f 	sync
+    583c:	00e02825 	or	a1,a3,zero
+    5840:	14a6fff3 	bne	a1,a2,5810 <tty_irq_handler+0x4c>
+    5844:	3c1e0004 	lui	s8,0x4
+    5848:	314affff 	andi	t2,t2,0xffff
+    584c:	000a1080 	sll	v0,t2,0x2
+    5850:	000ab100 	sll	s6,t2,0x4
+    5854:	02c2b023 	subu	s6,s6,v0
+    5858:	2622000c 	addiu	v0,s1,12
+    585c:	afa20020 	sw	v0,32(sp)
+    5860:	24820008 	addiu	v0,a0,8
+    5864:	27dec9a0 	addiu	s8,s8,-13920
+    5868:	3c145555 	lui	s4,0x5555
+    586c:	2d430101 	sltiu	v1,t2,257
+    5870:	afa2001c 	sw	v0,28(sp)
+    5874:	2d420101 	sltiu	v0,t2,257
+    5878:	03d6b021 	addu	s6,s8,s6
+    587c:	36945555 	ori	s4,s4,0x5555
+    5880:	afa30018 	sw	v1,24(sp)
+    5884:	24150008 	addiu	s5,zero,8
+    5888:	10400042 	beqz	v0,5994 <tty_irq_handler+0x1d0>
+    588c:	2417000a 	addiu	s7,zero,10
+    5890:	000a1100 	sll	v0,t2,0x4
+    5894:	000a5080 	sll	t2,t2,0x2
+    5898:	004a1023 	subu	v0,v0,t2
+    589c:	03c21021 	addu	v0,s8,v0
+    58a0:	8c420000 	lw	v0,0(v0)
+    58a4:	1054003b 	beq	v0,s4,5994 <tty_irq_handler+0x1d0>
+    58a8:	00000000 	sll	zero,zero,0x0
+    58ac:	24840004 	addiu	a0,a0,4
+    58b0:	4808c000 	mfc2	t0,$24
+    58b4:	4882c000 	mtc2	v0,$24
+    58b8:	8c820000 	lw	v0,0(a0)
+    58bc:	4888c000 	mtc2	t0,$24
+    58c0:	00021600 	sll	v0,v0,0x18
+    58c4:	00021603 	sra	v0,v0,0x18
+    58c8:	10400054 	beqz	v0,5a1c <tty_irq_handler+0x258>
+    58cc:	8fa30018 	lw	v1,24(sp)
+    58d0:	10600050 	beqz	v1,5a14 <tty_irq_handler+0x250>
+    58d4:	00000000 	sll	zero,zero,0x0
+    58d8:	8ec20000 	lw	v0,0(s6)
+    58dc:	1054004d 	beq	v0,s4,5a14 <tty_irq_handler+0x250>
+    58e0:	8fa3001c 	lw	v1,28(sp)
+    58e4:	4808c000 	mfc2	t0,$24
+    58e8:	4882c000 	mtc2	v0,$24
+    58ec:	8c620000 	lw	v0,0(v1)
+    58f0:	4888c000 	mtc2	t0,$24
+    58f4:	00021600 	sll	v0,v0,0x18
+    58f8:	00021603 	sra	v0,v0,0x18
+    58fc:	a3a20010 	sb	v0,16(sp)
+    5900:	8e230008 	lw	v1,8(s1)
+    5904:	1060003b 	beqz	v1,59f4 <tty_irq_handler+0x230>
+    5908:	27a50010 	addiu	a1,sp,16
+    590c:	8c640004 	lw	a0,4(v1)
+    5910:	a0820000 	sb	v0,0(a0)
+    5914:	8e230008 	lw	v1,8(s1)
+    5918:	83a20010 	lb	v0,16(sp)
+    591c:	8c650008 	lw	a1,8(v1)
+    5920:	24840001 	addiu	a0,a0,1
+    5924:	24a5ffff 	addiu	a1,a1,-1
+    5928:	ac640004 	sw	a0,4(v1)
+    592c:	10570003 	beq	v0,s7,593c <tty_irq_handler+0x178>
+    5930:	ac650008 	sw	a1,8(v1)
+    5934:	14a00006 	bnez	a1,5950 <tty_irq_handler+0x18c>
+    5938:	00000000 	sll	zero,zero,0x0
+    593c:	8fa40020 	lw	a0,32(sp)
+    5940:	0c006d56 	jal	1b558 <wakeup_one>
+    5944:	00002821 	addu	a1,zero,zero
+    5948:	ae200008 	sw	zero,8(s1)
+    594c:	83a20010 	lb	v0,16(sp)
+    5950:	10550014 	beq	v0,s5,59a4 <tty_irq_handler+0x1e0>
+    5954:	2403007f 	addiu	v1,zero,127
+    5958:	10430012 	beq	v0,v1,59a4 <tty_irq_handler+0x1e0>
+    595c:	00000000 	sll	zero,zero,0x0
+    5960:	8ec30000 	lw	v1,0(s6)
+    5964:	1074000d 	beq	v1,s4,599c <tty_irq_handler+0x1d8>
+    5968:	00000000 	sll	zero,zero,0x0
+    596c:	4808c000 	mfc2	t0,$24
+    5970:	4883c000 	mtc2	v1,$24
+    5974:	ae420000 	sw	v0,0(s2)
+    5978:	4888c000 	mtc2	t0,$24
+    597c:	8e620000 	lw	v0,0(s3)
+    5980:	944a0018 	lhu	t2,24(v0)
+    5984:	8c440010 	lw	a0,16(v0)
+    5988:	2d420101 	sltiu	v0,t2,257
+    598c:	1440ffc1 	bnez	v0,5894 <tty_irq_handler+0xd0>
+    5990:	000a1100 	sll	v0,t2,0x4
+    5994:	08001665 	j	5994 <tty_irq_handler+0x1d0>
+    5998:	00000000 	sll	zero,zero,0x0
+    599c:	08001667 	j	599c <tty_irq_handler+0x1d8>
+    59a0:	00000000 	sll	zero,zero,0x0
+    59a4:	8ec20000 	lw	v0,0(s6)
+    59a8:	10540010 	beq	v0,s4,59ec <tty_irq_handler+0x228>
+    59ac:	00000000 	sll	zero,zero,0x0
+    59b0:	4808c000 	mfc2	t0,$24
+    59b4:	4882c000 	mtc2	v0,$24
+    59b8:	ae550000 	sw	s5,0(s2)
+    59bc:	4888c000 	mtc2	t0,$24
+    59c0:	24030020 	addiu	v1,zero,32
+    59c4:	4808c000 	mfc2	t0,$24
+    59c8:	4882c000 	mtc2	v0,$24
+    59cc:	ae430000 	sw	v1,0(s2)
+    59d0:	4888c000 	mtc2	t0,$24
+    59d4:	4808c000 	mfc2	t0,$24
+    59d8:	4882c000 	mtc2	v0,$24
+    59dc:	ae550000 	sw	s5,0(s2)
+    59e0:	4888c000 	mtc2	t0,$24
+    59e4:	08001660 	j	5980 <tty_irq_handler+0x1bc>
+    59e8:	8e620000 	lw	v0,0(s3)
+    59ec:	0800167b 	j	59ec <tty_irq_handler+0x228>
+    59f0:	00000000 	sll	zero,zero,0x0
+    59f4:	8e24001c 	lw	a0,28(s1)
+    59f8:	0c00317a 	jal	c5e8 <mwmr_write>
+    59fc:	24060001 	addiu	a2,zero,1
+    5a00:	83a20010 	lb	v0,16(sp)
+    5a04:	1457ffd2 	bne	v0,s7,5950 <tty_irq_handler+0x18c>
+    5a08:	24030001 	addiu	v1,zero,1
+    5a0c:	08001658 	j	5960 <tty_irq_handler+0x19c>
+    5a10:	ae230004 	sw	v1,4(s1)
+    5a14:	08001685 	j	5a14 <tty_irq_handler+0x250>
+    5a18:	00000000 	sll	zero,zero,0x0
+    5a1c:	00101025 	or	v0,zero,s0
+    5a20:	0000000f 	sync
+    5a24:	ac400000 	sw	zero,0(v0)
+    5a28:	0000000f 	sync
+    5a2c:	8fbf004c 	lw	ra,76(sp)
+    5a30:	8fbe0048 	lw	s8,72(sp)
+    5a34:	8fb70044 	lw	s7,68(sp)
+    5a38:	8fb60040 	lw	s6,64(sp)
+    5a3c:	8fb5003c 	lw	s5,60(sp)
+    5a40:	8fb40038 	lw	s4,56(sp)
+    5a44:	8fb30034 	lw	s3,52(sp)
+    5a48:	8fb20030 	lw	s2,48(sp)
+    5a4c:	8fb1002c 	lw	s1,44(sp)
+    5a50:	8fb00028 	lw	s0,40(sp)
+    5a54:	03e00008 	jr	ra
+    5a58:	27bd0050 	addiu	sp,sp,80
+
+00005a5c <tty_get_params>:
+    5a5c:	27bdffe8 	addiu	sp,sp,-24
+    5a60:	00a02021 	addu	a0,a1,zero
+    5a64:	2406001c 	addiu	a2,zero,28
+    5a68:	afbf0014 	sw	ra,20(sp)
+    5a6c:	0c00c182 	jal	30608 <memset>
+    5a70:	00002821 	addu	a1,zero,zero
+    5a74:	8fbf0014 	lw	ra,20(sp)
+    5a78:	00001021 	addu	v0,zero,zero
+    5a7c:	03e00008 	jr	ra
+    5a80:	27bd0018 	addiu	sp,sp,24
+
+00005a84 <tty_write>:
+    5a84:	8c820068 	lw	v0,104(a0)
+    5a88:	27bdffd0 	addiu	sp,sp,-48
+    5a8c:	afb0001c 	sw	s0,28(sp)
+    5a90:	00808021 	addu	s0,a0,zero
+    5a94:	8c440000 	lw	a0,0(v0)
+    5a98:	afb10020 	sw	s1,32(sp)
+    5a9c:	3c110004 	lui	s1,0x4
+    5aa0:	8ca20008 	lw	v0,8(a1)
+    5aa4:	00042100 	sll	a0,a0,0x4
+    5aa8:	263195c0 	addiu	s1,s1,-27200
+    5aac:	02242021 	addu	a0,s1,a0
+    5ab0:	afb30028 	sw	s3,40(sp)
+    5ab4:	afb20024 	sw	s2,36(sp)
+    5ab8:	afa20014 	sw	v0,20(sp)
+    5abc:	afa50010 	sw	a1,16(sp)
+    5ac0:	afbf002c 	sw	ra,44(sp)
+    5ac4:	8e120010 	lw	s2,16(s0)
+    5ac8:	0c0022e4 	jal	8b90 <distlock_lock>
+    5acc:	8e130018 	lw	s3,24(s0)
+    5ad0:	8fa20014 	lw	v0,20(sp)
+    5ad4:	1040001c 	beqz	v0,5b48 <tty_write+0xc4>
+    5ad8:	8fa50010 	lw	a1,16(sp)
+    5adc:	8ca60000 	lw	a2,0(a1)
+    5ae0:	3273ffff 	andi	s3,s3,0xffff
+    5ae4:	2e630101 	sltiu	v1,s3,257
+    5ae8:	10600025 	beqz	v1,5b80 <tty_write+0xfc>
+    5aec:	80c40000 	lb	a0,0(a2)
+    5af0:	00131900 	sll	v1,s3,0x4
+    5af4:	00139880 	sll	s3,s3,0x2
+    5af8:	00739823 	subu	s3,v1,s3
+    5afc:	3c030004 	lui	v1,0x4
+    5b00:	2463c9a0 	addiu	v1,v1,-13920
+    5b04:	00731821 	addu	v1,v1,s3
+    5b08:	8c650000 	lw	a1,0(v1)
+    5b0c:	3c035555 	lui	v1,0x5555
+    5b10:	34635555 	ori	v1,v1,0x5555
+    5b14:	10a3001a 	beq	a1,v1,5b80 <tty_write+0xfc>
+    5b18:	00001821 	addu	v1,zero,zero
+    5b1c:	080016ca 	j	5b28 <tty_write+0xa4>
+    5b20:	00000000 	sll	zero,zero,0x0
+    5b24:	80e40000 	lb	a0,0(a3)
+    5b28:	4808c000 	mfc2	t0,$24
+    5b2c:	4885c000 	mtc2	a1,$24
+    5b30:	ae440000 	sw	a0,0(s2)
+    5b34:	4888c000 	mtc2	t0,$24
+    5b38:	24630001 	addiu	v1,v1,1
+    5b3c:	0062202b 	sltu	a0,v1,v0
+    5b40:	1480fff8 	bnez	a0,5b24 <tty_write+0xa0>
+    5b44:	00c33821 	addu	a3,a2,v1
+    5b48:	8e030068 	lw	v1,104(s0)
+    5b4c:	afa20014 	sw	v0,20(sp)
+    5b50:	8c640000 	lw	a0,0(v1)
+    5b54:	00042100 	sll	a0,a0,0x4
+    5b58:	0c00225f 	jal	897c <distlock_unlock>
+    5b5c:	02242021 	addu	a0,s1,a0
+    5b60:	8fbf002c 	lw	ra,44(sp)
+    5b64:	8fa20014 	lw	v0,20(sp)
+    5b68:	8fb30028 	lw	s3,40(sp)
+    5b6c:	8fb20024 	lw	s2,36(sp)
+    5b70:	8fb10020 	lw	s1,32(sp)
+    5b74:	8fb0001c 	lw	s0,28(sp)
+    5b78:	03e00008 	jr	ra
+    5b7c:	27bd0030 	addiu	sp,sp,48
+    5b80:	080016e0 	j	5b80 <tty_write+0xfc>
+    5b84:	00000000 	sll	zero,zero,0x0
+
+00005b88 <tty_read>:
+    5b88:	8ca2000c 	lw	v0,12(a1)
+    5b8c:	27bdffc0 	addiu	sp,sp,-64
+    5b90:	30420001 	andi	v0,v0,0x1
+    5b94:	afb50038 	sw	s5,56(sp)
+    5b98:	afb30030 	sw	s3,48(sp)
+    5b9c:	afb2002c 	sw	s2,44(sp)
+    5ba0:	afb10028 	sw	s1,40(sp)
+    5ba4:	afb00024 	sw	s0,36(sp)
+    5ba8:	afbf003c 	sw	ra,60(sp)
+    5bac:	afb40034 	sw	s4,52(sp)
+    5bb0:	00a08821 	addu	s1,a1,zero
+    5bb4:	00808021 	addu	s0,a0,zero
+    5bb8:	8c920068 	lw	s2,104(a0)
+    5bbc:	8cb30008 	lw	s3,8(a1)
+    5bc0:	1440004e 	bnez	v0,5cfc <tty_read+0x174>
+    5bc4:	8cb50004 	lw	s5,4(a1)
+    5bc8:	8e440000 	lw	a0,0(s2)
+    5bcc:	3c140004 	lui	s4,0x4
+    5bd0:	00042100 	sll	a0,a0,0x4
+    5bd4:	269497c0 	addiu	s4,s4,-26688
+    5bd8:	0c0022e4 	jal	8b90 <distlock_lock>
+    5bdc:	02842021 	addu	a0,s4,a0
+    5be0:	8e040080 	lw	a0,128(s0)
+    5be4:	10800004 	beqz	a0,5bf8 <tty_read+0x70>
+    5be8:	00000000 	sll	zero,zero,0x0
+    5bec:	8c820034 	lw	v0,52(a0)
+    5bf0:	0040f809 	jalr	v0
+    5bf4:	02002821 	addu	a1,s0,zero
+    5bf8:	02002021 	addu	a0,s0,zero
+    5bfc:	0c004bbf 	jal	12efc <spinlock_lock_noirq>
+    5c00:	27a50010 	addiu	a1,sp,16
+    5c04:	8e44001c 	lw	a0,28(s2)
+    5c08:	02a02821 	addu	a1,s5,zero
+    5c0c:	0c0031d9 	jal	c764 <mwmr_read>
+    5c10:	02603021 	addu	a2,s3,zero
+    5c14:	8e430004 	lw	v1,4(s2)
+    5c18:	14600007 	bnez	v1,5c38 <tty_read+0xb0>
+    5c1c:	8fa50010 	lw	a1,16(sp)
+    5c20:	10530006 	beq	v0,s3,5c3c <tty_read+0xb4>
+    5c24:	02002021 	addu	a0,s0,zero
+    5c28:	8e23000c 	lw	v1,12(s1)
+    5c2c:	30630001 	andi	v1,v1,0x1
+    5c30:	10600014 	beqz	v1,5c84 <tty_read+0xfc>
+    5c34:	02a2a821 	addu	s5,s5,v0
+    5c38:	02002021 	addu	a0,s0,zero
+    5c3c:	ae400004 	sw	zero,4(s2)
+    5c40:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    5c44:	afa20018 	sw	v0,24(sp)
+    5c48:	8e030068 	lw	v1,104(s0)
+    5c4c:	8c640000 	lw	a0,0(v1)
+    5c50:	00042100 	sll	a0,a0,0x4
+    5c54:	0c00225f 	jal	897c <distlock_unlock>
+    5c58:	02842021 	addu	a0,s4,a0
+    5c5c:	8fa20018 	lw	v0,24(sp)
+    5c60:	8fbf003c 	lw	ra,60(sp)
+    5c64:	8fb50038 	lw	s5,56(sp)
+    5c68:	8fb40034 	lw	s4,52(sp)
+    5c6c:	8fb30030 	lw	s3,48(sp)
+    5c70:	8fb2002c 	lw	s2,44(sp)
+    5c74:	8fb10028 	lw	s1,40(sp)
+    5c78:	8fb00024 	lw	s0,36(sp)
+    5c7c:	03e00008 	jr	ra
+    5c80:	27bd0040 	addiu	sp,sp,64
+    5c84:	8e230008 	lw	v1,8(s1)
+    5c88:	00621023 	subu	v0,v1,v0
+    5c8c:	2644000c 	addiu	a0,s2,12
+    5c90:	ae220008 	sw	v0,8(s1)
+    5c94:	ae350004 	sw	s5,4(s1)
+    5c98:	ae510008 	sw	s1,8(s2)
+    5c9c:	0c006d13 	jal	1b44c <wait_on>
+    5ca0:	24050001 	addiu	a1,zero,1
+    5ca4:	8fa50010 	lw	a1,16(sp)
+    5ca8:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    5cac:	02002021 	addu	a0,s0,zero
+    5cb0:	40042002 	mfc0	a0,$4,2
+    5cb4:	0c004634 	jal	118d0 <sched_sleep>
+    5cb8:	00000000 	sll	zero,zero,0x0
+    5cbc:	8e020068 	lw	v0,104(s0)
+    5cc0:	8c440000 	lw	a0,0(v0)
+    5cc4:	00042100 	sll	a0,a0,0x4
+    5cc8:	0c00225f 	jal	897c <distlock_unlock>
+    5ccc:	02842021 	addu	a0,s4,a0
+    5cd0:	8e220008 	lw	v0,8(s1)
+    5cd4:	8fbf003c 	lw	ra,60(sp)
+    5cd8:	02621023 	subu	v0,s3,v0
+    5cdc:	8fb50038 	lw	s5,56(sp)
+    5ce0:	8fb40034 	lw	s4,52(sp)
+    5ce4:	8fb30030 	lw	s3,48(sp)
+    5ce8:	8fb2002c 	lw	s2,44(sp)
+    5cec:	8fb10028 	lw	s1,40(sp)
+    5cf0:	8fb00024 	lw	s0,36(sp)
+    5cf4:	03e00008 	jr	ra
+    5cf8:	27bd0040 	addiu	sp,sp,64
+    5cfc:	8e440000 	lw	a0,0(s2)
+    5d00:	3c140004 	lui	s4,0x4
+    5d04:	00042100 	sll	a0,a0,0x4
+    5d08:	269497c0 	addiu	s4,s4,-26688
+    5d0c:	0c00221b 	jal	886c <distlock_trylock>
+    5d10:	02842021 	addu	a0,s4,a0
+    5d14:	1040ffb2 	beqz	v0,5be0 <tty_read+0x58>
+    5d18:	2402fff5 	addiu	v0,zero,-11
+    5d1c:	08001719 	j	5c64 <tty_read+0xdc>
+    5d20:	8fbf003c 	lw	ra,60(sp)
+    5d24:	94820018 	lhu	v0,24(a0)
+    5d28:	2c430101 	sltiu	v1,v0,257
+    5d2c:	14600003 	bnez	v1,5d3c <tty_read+0x1b4>
+    5d30:	8c840010 	lw	a0,16(a0)
+    5d34:	0800174d 	j	5d34 <tty_read+0x1ac>
+    5d38:	00000000 	sll	zero,zero,0x0
+    5d3c:	00021900 	sll	v1,v0,0x4
+    5d40:	00021080 	sll	v0,v0,0x2
+    5d44:	00621023 	subu	v0,v1,v0
+    5d48:	3c030004 	lui	v1,0x4
+    5d4c:	2463c9a0 	addiu	v1,v1,-13920
+    5d50:	00621021 	addu	v0,v1,v0
+    5d54:	8c420000 	lw	v0,0(v0)
+    5d58:	3c035555 	lui	v1,0x5555
+    5d5c:	34635555 	ori	v1,v1,0x5555
+    5d60:	1043fff4 	beq	v0,v1,5d34 <tty_read+0x1ac>
+    5d64:	00061940 	sll	v1,a2,0x5
+    5d68:	00671825 	or	v1,v1,a3
+    5d6c:	00031880 	sll	v1,v1,0x2
+    5d70:	00831821 	addu	v1,a0,v1
+    5d74:	4808c000 	mfc2	t0,$24
+    5d78:	4882c000 	mtc2	v0,$24
+    5d7c:	ac650000 	sw	a1,0(v1)
+    5d80:	4888c000 	mtc2	t0,$24
+    5d84:	24030004 	addiu	v1,zero,4
+    5d88:	10c30003 	beq	a2,v1,5d98 <tty_read+0x210>
+    5d8c:	34e70020 	ori	a3,a3,0x20
+    5d90:	03e00008 	jr	ra
+    5d94:	00000000 	sll	zero,zero,0x0
+    5d98:	00073880 	sll	a3,a3,0x2
+    5d9c:	3c03000f 	lui	v1,0xf
+    5da0:	00872021 	addu	a0,a0,a3
+    5da4:	34634240 	ori	v1,v1,0x4240
+    5da8:	4808c000 	mfc2	t0,$24
+    5dac:	4882c000 	mtc2	v0,$24
+    5db0:	ac830000 	sw	v1,0(a0)
+    5db4:	4888c000 	mtc2	t0,$24
+    5db8:	08001764 	j	5d90 <tty_read+0x208>
+    5dbc:	00000000 	sll	zero,zero,0x0
+    5dc0:	00052940 	sll	a1,a1,0x5
+    5dc4:	8c820010 	lw	v0,16(a0)
+    5dc8:	00a62825 	or	a1,a1,a2
+    5dcc:	00052880 	sll	a1,a1,0x2
+    5dd0:	00452821 	addu	a1,v0,a1
+    5dd4:	8ca20000 	lw	v0,0(a1)
+    5dd8:	03e00008 	jr	ra
+    5ddc:	00000000 	sll	zero,zero,0x0
+
+00005de0 <xicu_get_highest_irq>:
+    5de0:	8c830010 	lw	v1,16(a0)
+    5de4:	34c201e0 	ori	v0,a2,0x1e0
+    5de8:	00021080 	sll	v0,v0,0x2
+    5dec:	00621021 	addu	v0,v1,v0
+    5df0:	24040008 	addiu	a0,zero,8
+    5df4:	8c420000 	lw	v0,0(v0)
+    5df8:	10a4001e 	beq	a1,a0,5e74 <xicu_get_highest_irq+0x94>
+    5dfc:	2ca40009 	sltiu	a0,a1,9
+    5e00:	1480000d 	bnez	a0,5e38 <xicu_get_highest_irq+0x58>
+    5e04:	2404000c 	addiu	a0,zero,12
+    5e08:	10a40014 	beq	a1,a0,5e5c <xicu_get_highest_irq+0x7c>
+    5e0c:	24040011 	addiu	a0,zero,17
+    5e10:	14a4000c 	bne	a1,a0,5e44 <xicu_get_highest_irq+0x64>
+    5e14:	00000000 	sll	zero,zero,0x0
+    5e18:	30420008 	andi	v0,v0,0x8
+    5e1c:	1040000d 	beqz	v0,5e54 <xicu_get_highest_irq+0x74>
+    5e20:	34c60240 	ori	a2,a2,0x240
+    5e24:	00063080 	sll	a2,a2,0x2
+    5e28:	00661821 	addu	v1,v1,a2
+    5e2c:	8c620000 	lw	v0,0(v1)
+    5e30:	03e00008 	jr	ra
+    5e34:	00000000 	sll	zero,zero,0x0
+    5e38:	24030004 	addiu	v1,zero,4
+    5e3c:	10a30003 	beq	a1,v1,5e4c <xicu_get_highest_irq+0x6c>
+    5e40:	30430001 	andi	v1,v0,0x1
+    5e44:	03e00008 	jr	ra
+    5e48:	2402fffe 	addiu	v0,zero,-2
+    5e4c:	1460000f 	bnez	v1,5e8c <xicu_get_highest_irq+0xac>
+    5e50:	00000000 	sll	zero,zero,0x0
+    5e54:	03e00008 	jr	ra
+    5e58:	2402ffff 	addiu	v0,zero,-1
+    5e5c:	30430004 	andi	v1,v0,0x4
+    5e60:	1060fffc 	beqz	v1,5e54 <xicu_get_highest_irq+0x74>
+    5e64:	00000000 	sll	zero,zero,0x0
+    5e68:	00021602 	srl	v0,v0,0x18
+    5e6c:	03e00008 	jr	ra
+    5e70:	3042001f 	andi	v0,v0,0x1f
+    5e74:	30430002 	andi	v1,v0,0x2
+    5e78:	1060fff6 	beqz	v1,5e54 <xicu_get_highest_irq+0x74>
+    5e7c:	00000000 	sll	zero,zero,0x0
+    5e80:	00021402 	srl	v0,v0,0x10
+    5e84:	03e00008 	jr	ra
+    5e88:	3042001f 	andi	v0,v0,0x1f
+    5e8c:	00021202 	srl	v0,v0,0x8
+    5e90:	03e00008 	jr	ra
+    5e94:	3042001f 	andi	v0,v0,0x1f
+
+00005e98 <soclib_xicu_bind>:
+    5e98:	8ca20064 	lw	v0,100(a1)
+    5e9c:	28430020 	slti	v1,v0,32
+    5ea0:	10600009 	beqz	v1,5ec8 <soclib_xicu_bind+0x30>
+    5ea4:	8c840068 	lw	a0,104(a0)
+    5ea8:	2442000e 	addiu	v0,v0,14
+    5eac:	00021080 	sll	v0,v0,0x2
+    5eb0:	00822021 	addu	a0,a0,v0
+    5eb4:	8c820004 	lw	v0,4(a0)
+    5eb8:	10400005 	beqz	v0,5ed0 <soclib_xicu_bind+0x38>
+    5ebc:	24a50058 	addiu	a1,a1,88
+    5ec0:	03e00008 	jr	ra
+    5ec4:	24020010 	addiu	v0,zero,16
+    5ec8:	03e00008 	jr	ra
+    5ecc:	24020022 	addiu	v0,zero,34
+    5ed0:	ac850004 	sw	a1,4(a0)
+    5ed4:	03e00008 	jr	ra
+    5ed8:	00001021 	addu	v0,zero,zero
+
+00005edc <soclib_xicu_bind_wti>:
+    5edc:	2cc20020 	sltiu	v0,a2,32
+    5ee0:	10400009 	beqz	v0,5f08 <soclib_xicu_bind_wti+0x2c>
+    5ee4:	8c830068 	lw	v1,104(a0)
+    5ee8:	24c6002e 	addiu	a2,a2,46
+    5eec:	00063080 	sll	a2,a2,0x2
+    5ef0:	00661821 	addu	v1,v1,a2
+    5ef4:	8c620004 	lw	v0,4(v1)
+    5ef8:	10400005 	beqz	v0,5f10 <soclib_xicu_bind_wti+0x34>
+    5efc:	00000000 	sll	zero,zero,0x0
+    5f00:	03e00008 	jr	ra
+    5f04:	24020010 	addiu	v0,zero,16
+    5f08:	03e00008 	jr	ra
+    5f0c:	24020022 	addiu	v0,zero,34
+    5f10:	ac650004 	sw	a1,4(v1)
+    5f14:	03e00008 	jr	ra
+    5f18:	00001021 	addu	v0,zero,zero
+
+00005f1c <soclib_xicu_ipi_send>:
+    5f1c:	94820018 	lhu	v0,24(a0)
+    5f20:	2c470101 	sltiu	a3,v0,257
+    5f24:	14e00003 	bnez	a3,5f34 <soclib_xicu_ipi_send+0x18>
+    5f28:	8c830010 	lw	v1,16(a0)
+    5f2c:	080017cb 	j	5f2c <soclib_xicu_ipi_send+0x10>
+    5f30:	00000000 	sll	zero,zero,0x0
+    5f34:	00022100 	sll	a0,v0,0x4
+    5f38:	00021080 	sll	v0,v0,0x2
+    5f3c:	00821023 	subu	v0,a0,v0
+    5f40:	3c040004 	lui	a0,0x4
+    5f44:	2484c9a0 	addiu	a0,a0,-13920
+    5f48:	00821021 	addu	v0,a0,v0
+    5f4c:	8c420000 	lw	v0,0(v0)
+    5f50:	3c045555 	lui	a0,0x5555
+    5f54:	34845555 	ori	a0,a0,0x5555
+    5f58:	1044fff4 	beq	v0,a0,5f2c <soclib_xicu_ipi_send+0x10>
+    5f5c:	00000000 	sll	zero,zero,0x0
+    5f60:	00052880 	sll	a1,a1,0x2
+    5f64:	00651821 	addu	v1,v1,a1
+    5f68:	4808c000 	mfc2	t0,$24
+    5f6c:	4882c000 	mtc2	v0,$24
+    5f70:	ac660000 	sw	a2,0(v1)
+    5f74:	4888c000 	mtc2	t0,$24
+    5f78:	03e00008 	jr	ra
+    5f7c:	00001021 	addu	v0,zero,zero
+
+00005f80 <soclib_xicu_barrier_wait>:
+    5f80:	8c820010 	lw	v0,16(a0)
+    5f84:	34a50200 	ori	a1,a1,0x200
+    5f88:	00052880 	sll	a1,a1,0x2
+    5f8c:	00452821 	addu	a1,v0,a1
+    5f90:	8ca20000 	lw	v0,0(a1)
+    5f94:	03e00008 	jr	ra
+    5f98:	00000000 	sll	zero,zero,0x0
+
+00005f9c <soclib_xicu_init>:
+    5f9c:	27bdffd0 	addiu	sp,sp,-48
+    5fa0:	3c020004 	lui	v0,0x4
+    5fa4:	afb10028 	sw	s1,40(sp)
+    5fa8:	afb00024 	sw	s0,36(sp)
+    5fac:	249100ec 	addiu	s1,a0,236
+    5fb0:	00808021 	addu	s0,a0,zero
+    5fb4:	24040002 	addiu	a0,zero,2
+    5fb8:	8c43bc9c 	lw	v1,-17252(v0)
+    5fbc:	ae040014 	sw	a0,20(s0)
+    5fc0:	3c040000 	lui	a0,0x0
+    5fc4:	24846380 	addiu	a0,a0,25472
+    5fc8:	3c050003 	lui	a1,0x3
+    5fcc:	ae04005c 	sw	a0,92(s0)
+    5fd0:	24a5478c 	addiu	a1,a1,18316
+    5fd4:	00603021 	addu	a2,v1,zero
+    5fd8:	ae100058 	sw	s0,88(s0)
+    5fdc:	24630001 	addiu	v1,v1,1
+    5fe0:	ae000060 	sw	zero,96(s0)
+    5fe4:	ac43bc9c 	sw	v1,-17252(v0)
+    5fe8:	afbf002c 	sw	ra,44(sp)
+    5fec:	0c00c414 	jal	31050 <sprintk>
+    5ff0:	02202021 	addu	a0,s1,zero
+    5ff4:	ae11008c 	sw	s1,140(s0)
+    5ff8:	ae000090 	sw	zero,144(s0)
+    5ffc:	02001821 	addu	v1,s0,zero
+    6000:	00001021 	addu	v0,zero,zero
+    6004:	2405000a 	addiu	a1,zero,10
+    6008:	24440013 	addiu	a0,v0,19
+    600c:	000420c0 	sll	a0,a0,0x3
+    6010:	02042021 	addu	a0,s0,a0
+    6014:	24840004 	addiu	a0,a0,4
+    6018:	24420001 	addiu	v0,v0,1
+    601c:	ac6400a0 	sw	a0,160(v1)
+    6020:	ac64009c 	sw	a0,156(v1)
+    6024:	1445fff8 	bne	v0,a1,6008 <soclib_xicu_init+0x6c>
+    6028:	24630008 	addiu	v1,v1,8
+    602c:	3c030000 	lui	v1,0x0
+    6030:	24635d24 	addiu	v1,v1,23844
+    6034:	ae030030 	sw	v1,48(s0)
+    6038:	3c030000 	lui	v1,0x0
+    603c:	24635dc0 	addiu	v1,v1,24000
+    6040:	ae030034 	sw	v1,52(s0)
+    6044:	3c030000 	lui	v1,0x0
+    6048:	24635de0 	addiu	v1,v1,24032
+    604c:	ae030038 	sw	v1,56(s0)
+    6050:	3c030000 	lui	v1,0x0
+    6054:	24635e98 	addiu	v1,v1,24216
+    6058:	ae030040 	sw	v1,64(s0)
+    605c:	3c030000 	lui	v1,0x0
+    6060:	24020001 	addiu	v0,zero,1
+    6064:	24635edc 	addiu	v1,v1,24284
+    6068:	ae03003c 	sw	v1,60(s0)
+    606c:	ae020054 	sw	v0,84(s0)
+    6070:	afa20010 	sw	v0,16(sp)
+    6074:	24020240 	addiu	v0,zero,576
+    6078:	afa20014 	sw	v0,20(sp)
+    607c:	27a40010 	addiu	a0,sp,16
+    6080:	3c02000d 	lui	v0,0xd
+    6084:	0c00713f 	jal	1c4fc <kmem_alloc>
+    6088:	afa20018 	sw	v0,24(sp)
+    608c:	10400019 	beqz	v0,60f4 <soclib_xicu_init+0x158>
+    6090:	00408821 	addu	s1,v0,zero
+    6094:	3c050003 	lui	a1,0x3
+    6098:	00402021 	addu	a0,v0,zero
+    609c:	0c004a24 	jal	12890 <spinlock_init>
+    60a0:	24a54794 	addiu	a1,a1,18324
+    60a4:	3c050003 	lui	a1,0x3
+    60a8:	26240010 	addiu	a0,s1,16
+    60ac:	0c004a24 	jal	12890 <spinlock_init>
+    60b0:	24a547a0 	addiu	a1,a1,18336
+    60b4:	3c050003 	lui	a1,0x3
+    60b8:	26240020 	addiu	a0,s1,32
+    60bc:	0c004a24 	jal	12890 <spinlock_init>
+    60c0:	24a547ac 	addiu	a1,a1,18348
+    60c4:	ae200030 	sw	zero,48(s1)
+    60c8:	26240034 	addiu	a0,s1,52
+    60cc:	00002821 	addu	a1,zero,zero
+    60d0:	0c00b8f0 	jal	2e3c0 <bitmap_set_range>
+    60d4:	24060020 	addiu	a2,zero,32
+    60d8:	8fbf002c 	lw	ra,44(sp)
+    60dc:	ae110068 	sw	s1,104(s0)
+    60e0:	00001021 	addu	v0,zero,zero
+    60e4:	8fb10028 	lw	s1,40(sp)
+    60e8:	8fb00024 	lw	s0,36(sp)
+    60ec:	03e00008 	jr	ra
+    60f0:	27bd0030 	addiu	sp,sp,48
+    60f4:	8fbf002c 	lw	ra,44(sp)
+    60f8:	2402000c 	addiu	v0,zero,12
+    60fc:	8fb10028 	lw	s1,40(sp)
+    6100:	8fb00024 	lw	s0,36(sp)
+    6104:	03e00008 	jr	ra
+    6108:	27bd0030 	addiu	sp,sp,48
+
+0000610c <soclib_xicu_barrier_destroy>:
+    610c:	27bdffd8 	addiu	sp,sp,-40
+    6110:	afb0001c 	sw	s0,28(sp)
+    6114:	8c900068 	lw	s0,104(a0)
+    6118:	afb10020 	sw	s1,32(sp)
+    611c:	26110020 	addiu	s1,s0,32
+    6120:	02202021 	addu	a0,s1,zero
+    6124:	afbf0024 	sw	ra,36(sp)
+    6128:	0c004bc3 	jal	12f0c <spinlock_lock>
+    612c:	afa50010 	sw	a1,16(sp)
+    6130:	8fa50010 	lw	a1,16(sp)
+    6134:	8e030030 	lw	v1,48(s0)
+    6138:	00051142 	srl	v0,a1,0x5
+    613c:	2442000c 	addiu	v0,v0,12
+    6140:	00021080 	sll	v0,v0,0x2
+    6144:	02021021 	addu	v0,s0,v0
+    6148:	8c460004 	lw	a2,4(v0)
+    614c:	24a40027 	addiu	a0,a1,39
+    6150:	24070001 	addiu	a3,zero,1
+    6154:	00a73804 	sllv	a3,a3,a1
+    6158:	0065402b 	sltu	t0,v1,a1
+    615c:	000420c0 	sll	a0,a0,0x3
+    6160:	0068280b 	movn	a1,v1,t0
+    6164:	02042021 	addu	a0,s0,a0
+    6168:	00e61825 	or	v1,a3,a2
+    616c:	ac430004 	sw	v1,4(v0)
+    6170:	ae050030 	sw	a1,48(s0)
+    6174:	ac800004 	sw	zero,4(a0)
+    6178:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    617c:	02202021 	addu	a0,s1,zero
+    6180:	8fbf0024 	lw	ra,36(sp)
+    6184:	00001021 	addu	v0,zero,zero
+    6188:	8fb10020 	lw	s1,32(sp)
+    618c:	8fb0001c 	lw	s0,28(sp)
+    6190:	03e00008 	jr	ra
+    6194:	27bd0028 	addiu	sp,sp,40
+
+00006198 <soclib_xicu_barrier_init>:
+    6198:	27bdffd0 	addiu	sp,sp,-48
+    619c:	afb1001c 	sw	s1,28(sp)
+    61a0:	8c910068 	lw	s1,104(a0)
+    61a4:	afb20020 	sw	s2,32(sp)
+    61a8:	26320020 	addiu	s2,s1,32
+    61ac:	afb30024 	sw	s3,36(sp)
+    61b0:	00809821 	addu	s3,a0,zero
+    61b4:	02402021 	addu	a0,s2,zero
+    61b8:	afbf002c 	sw	ra,44(sp)
+    61bc:	afb40028 	sw	s4,40(sp)
+    61c0:	afb00018 	sw	s0,24(sp)
+    61c4:	00a0a021 	addu	s4,a1,zero
+    61c8:	0c004bc3 	jal	12f0c <spinlock_lock>
+    61cc:	00c08021 	addu	s0,a2,zero
+    61d0:	8e250030 	lw	a1,48(s1)
+    61d4:	26240034 	addiu	a0,s1,52
+    61d8:	0c00b895 	jal	2e254 <bitmap_ffs2>
+    61dc:	24060008 	addiu	a2,zero,8
+    61e0:	2403ffff 	addiu	v1,zero,-1
+    61e4:	10430034 	beq	v0,v1,62b8 <soclib_xicu_barrier_init+0x120>
+    61e8:	00021942 	srl	v1,v0,0x5
+    61ec:	2463000c 	addiu	v1,v1,12
+    61f0:	00031880 	sll	v1,v1,0x2
+    61f4:	02231821 	addu	v1,s1,v1
+    61f8:	24050001 	addiu	a1,zero,1
+    61fc:	8c640004 	lw	a0,4(v1)
+    6200:	00452804 	sllv	a1,a1,v0
+    6204:	00052827 	nor	a1,zero,a1
+    6208:	00a42824 	and	a1,a1,a0
+    620c:	24440001 	addiu	a0,v0,1
+    6210:	ac650004 	sw	a1,4(v1)
+    6214:	ae240030 	sw	a0,48(s1)
+    6218:	02402021 	addu	a0,s2,zero
+    621c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    6220:	afa20010 	sw	v0,16(sp)
+    6224:	8fa20010 	lw	v0,16(sp)
+    6228:	96630018 	lhu	v1,24(s3)
+    622c:	24440027 	addiu	a0,v0,39
+    6230:	000420c0 	sll	a0,a0,0x3
+    6234:	02248821 	addu	s1,s1,a0
+    6238:	2c640101 	sltiu	a0,v1,257
+    623c:	ae340004 	sw	s4,4(s1)
+    6240:	ae300008 	sw	s0,8(s1)
+    6244:	14800003 	bnez	a0,6254 <soclib_xicu_barrier_init+0xbc>
+    6248:	8e650010 	lw	a1,16(s3)
+    624c:	08001893 	j	624c <soclib_xicu_barrier_init+0xb4>
+    6250:	00000000 	sll	zero,zero,0x0
+    6254:	00032100 	sll	a0,v1,0x4
+    6258:	00031880 	sll	v1,v1,0x2
+    625c:	00831823 	subu	v1,a0,v1
+    6260:	3c040004 	lui	a0,0x4
+    6264:	2484c9a0 	addiu	a0,a0,-13920
+    6268:	00831821 	addu	v1,a0,v1
+    626c:	8c630000 	lw	v1,0(v1)
+    6270:	3c045555 	lui	a0,0x5555
+    6274:	34845555 	ori	a0,a0,0x5555
+    6278:	1064fff4 	beq	v1,a0,624c <soclib_xicu_barrier_init+0xb4>
+    627c:	34440200 	ori	a0,v0,0x200
+    6280:	00042080 	sll	a0,a0,0x2
+    6284:	00a42021 	addu	a0,a1,a0
+    6288:	4808c000 	mfc2	t0,$24
+    628c:	4883c000 	mtc2	v1,$24
+    6290:	ac900000 	sw	s0,0(a0)
+    6294:	4888c000 	mtc2	t0,$24
+    6298:	8fbf002c 	lw	ra,44(sp)
+    629c:	8fb40028 	lw	s4,40(sp)
+    62a0:	8fb30024 	lw	s3,36(sp)
+    62a4:	8fb20020 	lw	s2,32(sp)
+    62a8:	8fb1001c 	lw	s1,28(sp)
+    62ac:	8fb00018 	lw	s0,24(sp)
+    62b0:	03e00008 	jr	ra
+    62b4:	27bd0030 	addiu	sp,sp,48
+    62b8:	02402021 	addu	a0,s2,zero
+    62bc:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    62c0:	afa20010 	sw	v0,16(sp)
+    62c4:	080018a6 	j	6298 <soclib_xicu_barrier_init+0x100>
+    62c8:	8fa20010 	lw	v0,16(sp)
+
+000062cc <xicu_timer_irq_handler>:
+    62cc:	27bdffd8 	addiu	sp,sp,-40
+    62d0:	afb0001c 	sw	s0,28(sp)
+    62d4:	afbf0024 	sw	ra,36(sp)
+    62d8:	afb10020 	sw	s1,32(sp)
+    62dc:	00808021 	addu	s0,a0,zero
+    62e0:	40022002 	mfc0	v0,$4,2
+    62e4:	8c510174 	lw	s1,372(v0)
+    62e8:	afa50010 	sw	a1,16(sp)
+    62ec:	0c0020a8 	jal	82a0 <cpu_clock>
+    62f0:	02202021 	addu	a0,s1,zero
+    62f4:	8fa50010 	lw	a1,16(sp)
+    62f8:	96020018 	lhu	v0,24(s0)
+    62fc:	00052882 	srl	a1,a1,0x2
+    6300:	8e060010 	lw	a2,16(s0)
+    6304:	34a30060 	ori	v1,a1,0x60
+    6308:	00031880 	sll	v1,v1,0x2
+    630c:	00c31821 	addu	v1,a2,v1
+    6310:	2c440101 	sltiu	a0,v0,257
+    6314:	8c630000 	lw	v1,0(v1)
+    6318:	14800003 	bnez	a0,6328 <xicu_timer_irq_handler+0x5c>
+    631c:	8e230038 	lw	v1,56(s1)
+    6320:	080018c8 	j	6320 <xicu_timer_irq_handler+0x54>
+    6324:	00000000 	sll	zero,zero,0x0
+    6328:	00022100 	sll	a0,v0,0x4
+    632c:	00021080 	sll	v0,v0,0x2
+    6330:	00821023 	subu	v0,a0,v0
+    6334:	3c040004 	lui	a0,0x4
+    6338:	2484c9a0 	addiu	a0,a0,-13920
+    633c:	00821021 	addu	v0,a0,v0
+    6340:	8c420000 	lw	v0,0(v0)
+    6344:	3c045555 	lui	a0,0x5555
+    6348:	34845555 	ori	a0,a0,0x5555
+    634c:	1044fff4 	beq	v0,a0,6320 <xicu_timer_irq_handler+0x54>
+    6350:	34a40040 	ori	a0,a1,0x40
+    6354:	00042080 	sll	a0,a0,0x2
+    6358:	00c42021 	addu	a0,a2,a0
+    635c:	4808c000 	mfc2	t0,$24
+    6360:	4882c000 	mtc2	v0,$24
+    6364:	ac830000 	sw	v1,0(a0)
+    6368:	4888c000 	mtc2	t0,$24
+    636c:	8fbf0024 	lw	ra,36(sp)
+    6370:	8fb10020 	lw	s1,32(sp)
+    6374:	8fb0001c 	lw	s0,28(sp)
+    6378:	03e00008 	jr	ra
+    637c:	27bd0028 	addiu	sp,sp,40
+
+00006380 <xicu_irq_handler>:
+    6380:	27bdffb8 	addiu	sp,sp,-72
+    6384:	afbf0044 	sw	ra,68(sp)
+    6388:	afbe0040 	sw	s8,64(sp)
+    638c:	afb7003c 	sw	s7,60(sp)
+    6390:	afb60038 	sw	s6,56(sp)
+    6394:	afb50034 	sw	s5,52(sp)
+    6398:	afb40030 	sw	s4,48(sp)
+    639c:	afb3002c 	sw	s3,44(sp)
+    63a0:	afb20028 	sw	s2,40(sp)
+    63a4:	afb10024 	sw	s1,36(sp)
+    63a8:	afb00020 	sw	s0,32(sp)
+    63ac:	40022002 	mfc0	v0,$4,2
+    63b0:	8c510174 	lw	s1,372(v0)
+    63b4:	8c900000 	lw	s0,0(a0)
+    63b8:	8e320000 	lw	s2,0(s1)
+    63bc:	8e030010 	lw	v1,16(s0)
+    63c0:	00129080 	sll	s2,s2,0x2
+    63c4:	364201e0 	ori	v0,s2,0x1e0
+    63c8:	00021080 	sll	v0,v0,0x2
+    63cc:	00621021 	addu	v0,v1,v0
+    63d0:	8c550000 	lw	s5,0(v0)
+    63d4:	32a20004 	andi	v0,s5,0x4
+    63d8:	14400055 	bnez	v0,6530 <xicu_irq_handler+0x1b0>
+    63dc:	8e130068 	lw	s3,104(s0)
+    63e0:	32a20001 	andi	v0,s5,0x1
+    63e4:	14400097 	bnez	v0,6644 <xicu_irq_handler+0x2c4>
+    63e8:	32a20002 	andi	v0,s5,0x2
+    63ec:	10400020 	beqz	v0,6470 <xicu_irq_handler+0xf0>
+    63f0:	36420100 	ori	v0,s2,0x100
+    63f4:	00021080 	sll	v0,v0,0x2
+    63f8:	3c1e0003 	lui	s8,0x3
+    63fc:	3c170003 	lui	s7,0x3
+    6400:	afa20018 	sw	v0,24(sp)
+    6404:	27de47bc 	addiu	s8,s8,18364
+    6408:	26f747fc 	addiu	s7,s7,18428
+    640c:	3c160004 	lui	s6,0x4
+    6410:	02002021 	addu	a0,s0,zero
+    6414:	02403021 	addu	a2,s2,zero
+    6418:	0c001778 	jal	5de0 <xicu_get_highest_irq>
+    641c:	24050008 	addiu	a1,zero,8
+    6420:	0040a021 	addu	s4,v0,zero
+    6424:	2442000e 	addiu	v0,v0,14
+    6428:	00021080 	sll	v0,v0,0x2
+    642c:	06800010 	bltz	s4,6470 <xicu_irq_handler+0xf0>
+    6430:	02621021 	addu	v0,s3,v0
+    6434:	8c420004 	lw	v0,4(v0)
+    6438:	10400068 	beqz	v0,65dc <xicu_irq_handler+0x25c>
+    643c:	00402021 	addu	a0,v0,zero
+    6440:	8c420004 	lw	v0,4(v0)
+    6444:	0040f809 	jalr	v0
+    6448:	00000000 	sll	zero,zero,0x0
+    644c:	02002021 	addu	a0,s0,zero
+    6450:	02403021 	addu	a2,s2,zero
+    6454:	0c001778 	jal	5de0 <xicu_get_highest_irq>
+    6458:	24050008 	addiu	a1,zero,8
+    645c:	0040a021 	addu	s4,v0,zero
+    6460:	2442000e 	addiu	v0,v0,14
+    6464:	00021080 	sll	v0,v0,0x2
+    6468:	0681fff2 	bgez	s4,6434 <xicu_irq_handler+0xb4>
+    646c:	02621021 	addu	v0,s3,v0
+    6470:	32b50008 	andi	s5,s5,0x8
+    6474:	12a00055 	beqz	s5,65cc <xicu_irq_handler+0x24c>
+    6478:	36520240 	ori	s2,s2,0x240
+    647c:	8e020010 	lw	v0,16(s0)
+    6480:	00129080 	sll	s2,s2,0x2
+    6484:	00521021 	addu	v0,v0,s2
+    6488:	8c520000 	lw	s2,0(v0)
+    648c:	1240004f 	beqz	s2,65cc <xicu_irq_handler+0x24c>
+    6490:	3c160004 	lui	s6,0x4
+    6494:	3c155555 	lui	s5,0x5555
+    6498:	26d6c9a0 	addiu	s6,s6,-13920
+    649c:	36b55555 	ori	s5,s5,0x5555
+    64a0:	0800193a 	j	64e8 <xicu_irq_handler+0x168>
+    64a4:	0000a021 	addu	s4,zero,zero
+    64a8:	8ca20000 	lw	v0,0(a1)
+    64ac:	1055001c 	beq	v0,s5,6520 <xicu_irq_handler+0x1a0>
+    64b0:	00000000 	sll	zero,zero,0x0
+    64b4:	4808c000 	mfc2	t0,$24
+    64b8:	4882c000 	mtc2	v0,$24
+    64bc:	ac830000 	sw	v1,0(a0)
+    64c0:	4888c000 	mtc2	t0,$24
+    64c4:	8e62013c 	lw	v0,316(s3)
+    64c8:	10400003 	beqz	v0,64d8 <xicu_irq_handler+0x158>
+    64cc:	00402021 	addu	a0,v0,zero
+    64d0:	0c0029e6 	jal	a798 <event_send>
+    64d4:	8e250004 	lw	a1,4(s1)
+    64d8:	00129042 	srl	s2,s2,0x1
+    64dc:	26940001 	addiu	s4,s4,1
+    64e0:	1240002e 	beqz	s2,659c <xicu_irq_handler+0x21c>
+    64e4:	26730008 	addiu	s3,s3,8
+    64e8:	36840200 	ori	a0,s4,0x200
+    64ec:	32420001 	andi	v0,s2,0x1
+    64f0:	1040fff9 	beqz	v0,64d8 <xicu_irq_handler+0x158>
+    64f4:	00042080 	sll	a0,a0,0x2
+    64f8:	96020018 	lhu	v0,24(s0)
+    64fc:	8e030010 	lw	v1,16(s0)
+    6500:	00023100 	sll	a2,v0,0x4
+    6504:	00022880 	sll	a1,v0,0x2
+    6508:	00c52823 	subu	a1,a2,a1
+    650c:	2c420101 	sltiu	v0,v0,257
+    6510:	00642021 	addu	a0,v1,a0
+    6514:	02c52821 	addu	a1,s6,a1
+    6518:	1440ffe3 	bnez	v0,64a8 <xicu_irq_handler+0x128>
+    651c:	8e630140 	lw	v1,320(s3)
+    6520:	08001948 	j	6520 <xicu_irq_handler+0x1a0>
+    6524:	00000000 	sll	zero,zero,0x0
+    6528:	0c002030 	jal	80c0 <cpu_ipi_notify>
+    652c:	02202021 	addu	a0,s1,zero
+    6530:	02002021 	addu	a0,s0,zero
+    6534:	02403021 	addu	a2,s2,zero
+    6538:	0c001778 	jal	5de0 <xicu_get_highest_irq>
+    653c:	2405000c 	addiu	a1,zero,12
+    6540:	2444002e 	addiu	a0,v0,46
+    6544:	00042080 	sll	a0,a0,0x2
+    6548:	02642021 	addu	a0,s3,a0
+    654c:	04400013 	bltz	v0,659c <xicu_irq_handler+0x21c>
+    6550:	00021880 	sll	v1,v0,0x2
+    6554:	8e050010 	lw	a1,16(s0)
+    6558:	8c820004 	lw	v0,4(a0)
+    655c:	00a31821 	addu	v1,a1,v1
+    6560:	00402021 	addu	a0,v0,zero
+    6564:	1040fff0 	beqz	v0,6528 <xicu_irq_handler+0x1a8>
+    6568:	8c650000 	lw	a1,0(v1)
+    656c:	8c420004 	lw	v0,4(v0)
+    6570:	0040f809 	jalr	v0
+    6574:	00000000 	sll	zero,zero,0x0
+    6578:	02002021 	addu	a0,s0,zero
+    657c:	02403021 	addu	a2,s2,zero
+    6580:	0c001778 	jal	5de0 <xicu_get_highest_irq>
+    6584:	2405000c 	addiu	a1,zero,12
+    6588:	2444002e 	addiu	a0,v0,46
+    658c:	00042080 	sll	a0,a0,0x2
+    6590:	02642021 	addu	a0,s3,a0
+    6594:	0441ffef 	bgez	v0,6554 <xicu_irq_handler+0x1d4>
+    6598:	00021880 	sll	v1,v0,0x2
+    659c:	8fbf0044 	lw	ra,68(sp)
+    65a0:	8fbe0040 	lw	s8,64(sp)
+    65a4:	8fb7003c 	lw	s7,60(sp)
+    65a8:	8fb60038 	lw	s6,56(sp)
+    65ac:	8fb50034 	lw	s5,52(sp)
+    65b0:	8fb40030 	lw	s4,48(sp)
+    65b4:	8fb3002c 	lw	s3,44(sp)
+    65b8:	8fb20028 	lw	s2,40(sp)
+    65bc:	8fb10024 	lw	s1,36(sp)
+    65c0:	8fb00020 	lw	s0,32(sp)
+    65c4:	03e00008 	jr	ra
+    65c8:	27bd0048 	addiu	sp,sp,72
+    65cc:	8e22004c 	lw	v0,76(s1)
+    65d0:	24420001 	addiu	v0,v0,1
+    65d4:	08001967 	j	659c <xicu_irq_handler+0x21c>
+    65d8:	ae22004c 	sw	v0,76(s1)
+    65dc:	8ec49140 	lw	a0,-28352(s6)
+    65e0:	03c03021 	addu	a2,s8,zero
+    65e4:	02803821 	addu	a3,s4,zero
+    65e8:	24050001 	addiu	a1,zero,1
+    65ec:	0c0009b0 	jal	26c0 <__fprintk>
+    65f0:	afb20010 	sw	s2,16(sp)
+    65f4:	8e020010 	lw	v0,16(s0)
+    65f8:	8fa30018 	lw	v1,24(sp)
+    65fc:	24050001 	addiu	a1,zero,1
+    6600:	00431021 	addu	v0,v0,v1
+    6604:	8c420000 	lw	v0,0(v0)
+    6608:	02852804 	sllv	a1,a1,s4
+    660c:	00052827 	nor	a1,zero,a1
+    6610:	02002021 	addu	a0,s0,zero
+    6614:	02403821 	addu	a3,s2,zero
+    6618:	00a22824 	and	a1,a1,v0
+    661c:	0c001749 	jal	5d24 <tty_read+0x19c>
+    6620:	24060008 	addiu	a2,zero,8
+    6624:	8ec49140 	lw	a0,-28352(s6)
+    6628:	02803821 	addu	a3,s4,zero
+    662c:	24050001 	addiu	a1,zero,1
+    6630:	02e03021 	addu	a2,s7,zero
+    6634:	0c0009b0 	jal	26c0 <__fprintk>
+    6638:	afb20010 	sw	s2,16(sp)
+    663c:	08001905 	j	6414 <xicu_irq_handler+0x94>
+    6640:	02002021 	addu	a0,s0,zero
+    6644:	02002021 	addu	a0,s0,zero
+    6648:	02402821 	addu	a1,s2,zero
+    664c:	8fbf0044 	lw	ra,68(sp)
+    6650:	8fbe0040 	lw	s8,64(sp)
+    6654:	8fb7003c 	lw	s7,60(sp)
+    6658:	8fb60038 	lw	s6,56(sp)
+    665c:	8fb50034 	lw	s5,52(sp)
+    6660:	8fb40030 	lw	s4,48(sp)
+    6664:	8fb3002c 	lw	s3,44(sp)
+    6668:	8fb20028 	lw	s2,40(sp)
+    666c:	8fb10024 	lw	s1,36(sp)
+    6670:	8fb00020 	lw	s0,32(sp)
+    6674:	080018b3 	j	62cc <xicu_timer_irq_handler>
+    6678:	27bd0048 	addiu	sp,sp,72
+
+0000667c <atomic_init>:
+    667c:	30a200ff 	andi	v0,a1,0xff
+    6680:	00051a02 	srl	v1,a1,0x8
+    6684:	90860000 	lbu	a2,0(a0)
+    6688:	306300ff 	andi	v1,v1,0xff
+    668c:	a0820000 	sb	v0,0(a0)
+    6690:	00051402 	srl	v0,a1,0x10
+    6694:	90860001 	lbu	a2,1(a0)
+    6698:	304200ff 	andi	v0,v0,0xff
+    669c:	a0830001 	sb	v1,1(a0)
+    66a0:	90830002 	lbu	v1,2(a0)
+    66a4:	00052e02 	srl	a1,a1,0x18
+    66a8:	a0820002 	sb	v0,2(a0)
+    66ac:	90820003 	lbu	v0,3(a0)
+    66b0:	a0850003 	sb	a1,3(a0)
+    66b4:	0000000f 	sync
+    66b8:	03e00008 	jr	ra
+    66bc:	00000000 	sll	zero,zero,0x0
+
+000066c0 <atomic_inc>:
+    66c0:	24020001 	addiu	v0,zero,1
+    66c4:	c0850000 	ll	a1,0(a0)
+    66c8:	00a21821 	addu	v1,a1,v0
+    66cc:	e0830000 	sc	v1,0(a0)
+    66d0:	1060fffc 	beqz	v1,66c4 <atomic_inc+0x4>
+    66d4:	00000000 	sll	zero,zero,0x0
+    66d8:	0000000f 	sync
+    66dc:	03e00008 	jr	ra
+    66e0:	00a01021 	addu	v0,a1,zero
+
+000066e4 <atomic_add>:
+    66e4:	c0820000 	ll	v0,0(a0)
+    66e8:	00451821 	addu	v1,v0,a1
+    66ec:	e0830000 	sc	v1,0(a0)
+    66f0:	1060fffc 	beqz	v1,66e4 <atomic_add>
+    66f4:	00000000 	sll	zero,zero,0x0
+    66f8:	0000000f 	sync
+    66fc:	03e00008 	jr	ra
+    6700:	00000000 	sll	zero,zero,0x0
+
+00006704 <atomic_dec>:
+    6704:	2402ffff 	addiu	v0,zero,-1
+    6708:	c0850000 	ll	a1,0(a0)
+    670c:	00a21821 	addu	v1,a1,v0
+    6710:	e0830000 	sc	v1,0(a0)
+    6714:	1060fffc 	beqz	v1,6708 <atomic_dec+0x4>
+    6718:	00000000 	sll	zero,zero,0x0
+    671c:	0000000f 	sync
+    6720:	03e00008 	jr	ra
+    6724:	00a01021 	addu	v0,a1,zero
+
+00006728 <atomic_cas>:
+    6728:	0000000f 	sync
+    672c:	00064025 	or	t0,zero,a2
+    6730:	c0830000 	ll	v1,0(a0)
+    6734:	14650004 	bne	v1,a1,6748 <atomic_cas+0x20>
+    6738:	24070000 	addiu	a3,zero,0
+    673c:	e0880000 	sc	t0,0(a0)
+    6740:	01003825 	or	a3,t0,zero
+    6744:	0000000f 	sync
+    6748:	00e01025 	or	v0,a3,zero
+    674c:	03e00008 	jr	ra
+    6750:	00000000 	sll	zero,zero,0x0
+
+00006754 <atomic_get>:
+    6754:	0000000f 	sync
+    6758:	00041025 	or	v0,zero,a0
+    675c:	8c430000 	lw	v1,0(v0)
+    6760:	03e00008 	jr	ra
+    6764:	00601021 	addu	v0,v1,zero
+
+00006768 <atomic_set>:
+    6768:	0000000f 	sync
+    676c:	00041025 	or	v0,zero,a0
+    6770:	8c460000 	lw	a2,0(v0)
+    6774:	0000000f 	sync
+    6778:	00054025 	or	t0,zero,a1
+    677c:	c0830000 	ll	v1,0(a0)
+    6780:	14660004 	bne	v1,a2,6794 <atomic_set+0x2c>
+    6784:	24070000 	addiu	a3,zero,0
+    6788:	e0880000 	sc	t0,0(a0)
+    678c:	01003825 	or	a3,t0,zero
+    6790:	0000000f 	sync
+    6794:	00e01025 	or	v0,a3,zero
+    6798:	1040fff3 	beqz	v0,6768 <atomic_set>
+    679c:	00c01021 	addu	v0,a2,zero
+    67a0:	03e00008 	jr	ra
+    67a4:	00000000 	sll	zero,zero,0x0
+
+000067a8 <atomic_test_set>:
+    67a8:	0000000f 	sync
+    67ac:	00041025 	or	v0,zero,a0
+    67b0:	8c460000 	lw	a2,0(v0)
+    67b4:	14c0000e 	bnez	a2,67f0 <atomic_test_set+0x48>
+    67b8:	00000000 	sll	zero,zero,0x0
+    67bc:	0000000f 	sync
+    67c0:	00054025 	or	t0,zero,a1
+    67c4:	c0830000 	ll	v1,0(a0)
+    67c8:	14660004 	bne	v1,a2,67dc <atomic_test_set+0x34>
+    67cc:	24070000 	addiu	a3,zero,0
+    67d0:	e0880000 	sc	t0,0(a0)
+    67d4:	01003825 	or	a3,t0,zero
+    67d8:	0000000f 	sync
+    67dc:	00e01025 	or	v0,a3,zero
+    67e0:	1040fff1 	beqz	v0,67a8 <atomic_test_set>
+    67e4:	24020001 	addiu	v0,zero,1
+    67e8:	03e00008 	jr	ra
+    67ec:	00000000 	sll	zero,zero,0x0
+    67f0:	03e00008 	jr	ra
+    67f4:	00001021 	addu	v0,zero,zero
+
+000067f8 <refcount_init>:
+    67f8:	03e00008 	jr	ra
+    67fc:	ac800000 	sw	zero,0(a0)
+
+00006800 <refcount_up>:
+    6800:	24020001 	addiu	v0,zero,1
+    6804:	c0850000 	ll	a1,0(a0)
+    6808:	00a21821 	addu	v1,a1,v0
+    680c:	e0830000 	sc	v1,0(a0)
+    6810:	1060fffc 	beqz	v1,6804 <refcount_up+0x4>
+    6814:	00000000 	sll	zero,zero,0x0
+    6818:	0000000f 	sync
+    681c:	03e00008 	jr	ra
+    6820:	00a01021 	addu	v0,a1,zero
+
+00006824 <refcount_down>:
+    6824:	2402ffff 	addiu	v0,zero,-1
+    6828:	c0850000 	ll	a1,0(a0)
+    682c:	00a21821 	addu	v1,a1,v0
+    6830:	e0830000 	sc	v1,0(a0)
+    6834:	1060fffc 	beqz	v1,6828 <refcount_down+0x4>
+    6838:	00000000 	sll	zero,zero,0x0
+    683c:	0000000f 	sync
+    6840:	03e00008 	jr	ra
+    6844:	00a01021 	addu	v0,a1,zero
+
+00006848 <refcount_set>:
+    6848:	8c820000 	lw	v0,0(a0)
+    684c:	ac850000 	sw	a1,0(a0)
+    6850:	0000000f 	sync
+    6854:	03e00008 	jr	ra
+    6858:	00000000 	sll	zero,zero,0x0
+
+0000685c <refcount_get>:
+    685c:	0000000f 	sync
+    6860:	00041025 	or	v0,zero,a0
+    6864:	8c430000 	lw	v1,0(v0)
+    6868:	03e00008 	jr	ra
+    686c:	00601021 	addu	v0,v1,zero
+
+00006870 <wqdb_kmem_init>:
+    6870:	24030015 	addiu	v1,zero,21
+    6874:	ac830000 	sw	v1,0(a0)
+    6878:	3c030003 	lui	v1,0x3
+    687c:	24634834 	addiu	v1,v1,18484
+    6880:	24020002 	addiu	v0,zero,2
+    6884:	ac830004 	sw	v1,4(a0)
+    6888:	240300c0 	addiu	v1,zero,192
+    688c:	ac820010 	sw	v0,16(a0)
+    6890:	ac82000c 	sw	v0,12(a0)
+    6894:	ac830008 	sw	v1,8(a0)
+    6898:	ac80001c 	sw	zero,28(a0)
+    689c:	ac800014 	sw	zero,20(a0)
+    68a0:	ac800018 	sw	zero,24(a0)
+    68a4:	03e00008 	jr	ra
+    68a8:	00001021 	addu	v0,zero,zero
+
+000068ac <barrier_destroy>:
+    68ac:	3c02cfa5 	lui	v0,0xcfa5
+    68b0:	8c830040 	lw	v1,64(a0)
+    68b4:	27bdffc8 	addiu	sp,sp,-56
+    68b8:	3442b1a3 	ori	v0,v0,0xb1a3
+    68bc:	afb00024 	sw	s0,36(sp)
+    68c0:	afbf0034 	sw	ra,52(sp)
+    68c4:	afb30030 	sw	s3,48(sp)
+    68c8:	afb2002c 	sw	s2,44(sp)
+    68cc:	afb10028 	sw	s1,40(sp)
+    68d0:	10620009 	beq	v1,v0,68f8 <barrier_destroy+0x4c>
+    68d4:	00808021 	addu	s0,a0,zero
+    68d8:	24020016 	addiu	v0,zero,22
+    68dc:	8fbf0034 	lw	ra,52(sp)
+    68e0:	8fb30030 	lw	s3,48(sp)
+    68e4:	8fb2002c 	lw	s2,44(sp)
+    68e8:	8fb10028 	lw	s1,40(sp)
+    68ec:	8fb00024 	lw	s0,36(sp)
+    68f0:	03e00008 	jr	ra
+    68f4:	27bd0038 	addiu	sp,sp,56
+    68f8:	8c820044 	lw	v0,68(a0)
+    68fc:	1040001b 	beqz	v0,696c <barrier_destroy+0xc0>
+    6900:	00000000 	sll	zero,zero,0x0
+    6904:	40032002 	mfc0	v1,$4,2
+    6908:	8c630180 	lw	v1,384(v1)
+    690c:	1443fff3 	bne	v0,v1,68dc <barrier_destroy+0x30>
+    6910:	24020016 	addiu	v0,zero,22
+    6914:	0c0019d5 	jal	6754 <atomic_get>
+    6918:	afa00010 	sw	zero,16(sp)
+    691c:	1440ffef 	bnez	v0,68dc <barrier_destroy+0x30>
+    6920:	24020010 	addiu	v0,zero,16
+    6924:	ae000040 	sw	zero,64(s0)
+    6928:	0000000f 	sync
+    692c:	00008821 	addu	s1,zero,zero
+    6930:	27b30010 	addiu	s3,sp,16
+    6934:	24120010 	addiu	s2,zero,16
+    6938:	02111021 	addu	v0,s0,s1
+    693c:	8c420078 	lw	v0,120(v0)
+    6940:	26310004 	addiu	s1,s1,4
+    6944:	02602021 	addu	a0,s3,zero
+    6948:	0c007134 	jal	1c4d0 <kmem_free>
+    694c:	afa2001c 	sw	v0,28(sp)
+    6950:	1632fffa 	bne	s1,s2,693c <barrier_destroy+0x90>
+    6954:	02111021 	addu	v0,s0,s1
+    6958:	8e020044 	lw	v0,68(s0)
+    695c:	10400006 	beqz	v0,6978 <barrier_destroy+0xcc>
+    6960:	00000000 	sll	zero,zero,0x0
+    6964:	08001a37 	j	68dc <barrier_destroy+0x30>
+    6968:	00001021 	addu	v0,zero,zero
+    696c:	afa00010 	sw	zero,16(sp)
+    6970:	08001a47 	j	691c <barrier_destroy+0x70>
+    6974:	8c82004c 	lw	v0,76(a0)
+    6978:	0c004a29 	jal	128a4 <spinlock_destroy>
+    697c:	02002021 	addu	a0,s0,zero
+    6980:	08001a37 	j	68dc <barrier_destroy+0x30>
+    6984:	00001021 	addu	v0,zero,zero
+
+00006988 <barrier_init>:
+    6988:	27bdffa8 	addiu	sp,sp,-88
+    698c:	afb10038 	sw	s1,56(sp)
+    6990:	afb00034 	sw	s0,52(sp)
+    6994:	afbf0054 	sw	ra,84(sp)
+    6998:	afb70050 	sw	s7,80(sp)
+    699c:	afb6004c 	sw	s6,76(sp)
+    69a0:	afb50048 	sw	s5,72(sp)
+    69a4:	afb40044 	sw	s4,68(sp)
+    69a8:	afb30040 	sw	s3,64(sp)
+    69ac:	afb2003c 	sw	s2,60(sp)
+    69b0:	00a08021 	addu	s0,a1,zero
+    69b4:	10a0003c 	beqz	a1,6aa8 <barrier_init+0x120>
+    69b8:	00808821 	addu	s1,a0,zero
+    69bc:	40022002 	mfc0	v0,$4,2
+    69c0:	8c420180 	lw	v0,384(v0)
+    69c4:	8c420634 	lw	v0,1588(v0)
+    69c8:	2c420801 	sltiu	v0,v0,2049
+    69cc:	10400058 	beqz	v0,6b30 <barrier_init+0x1a8>
+    69d0:	2ca20801 	sltiu	v0,a1,2049
+    69d4:	1040004a 	beqz	v0,6b00 <barrier_init+0x178>
+    69d8:	00000000 	sll	zero,zero,0x0
+    69dc:	14c00076 	bnez	a2,6bb8 <barrier_init+0x230>
+    69e0:	00000000 	sll	zero,zero,0x0
+    69e4:	40022002 	mfc0	v0,$4,2
+    69e8:	8c420180 	lw	v0,384(v0)
+    69ec:	10400073 	beqz	v0,6bbc <barrier_init+0x234>
+    69f0:	ac820044 	sw	v0,68(a0)
+    69f4:	0c00199f 	jal	667c <atomic_init>
+    69f8:	00000000 	sll	zero,zero,0x0
+    69fc:	3c020026 	lui	v0,0x26
+    6a00:	34420040 	ori	v0,v0,0x40
+    6a04:	afa20028 	sw	v0,40(sp)
+    6a08:	afa00020 	sw	zero,32(sp)
+    6a0c:	afa00024 	sw	zero,36(sp)
+    6a10:	0220a821 	addu	s5,s1,zero
+    6a14:	02209021 	addu	s2,s1,zero
+    6a18:	00009821 	addu	s3,zero,zero
+    6a1c:	27b60020 	addiu	s6,sp,32
+    6a20:	24170004 	addiu	s7,zero,4
+    6a24:	0c00713f 	jal	1c4fc <kmem_alloc>
+    6a28:	02c02021 	addu	a0,s6,zero
+    6a2c:	0040a021 	addu	s4,v0,zero
+    6a30:	10400029 	beqz	v0,6ad8 <barrier_init+0x150>
+    6a34:	00402021 	addu	a0,v0,zero
+    6a38:	0c007c15 	jal	1f054 <ppm_page2addr>
+    6a3c:	26730001 	addiu	s3,s3,1
+    6a40:	ae420068 	sw	v0,104(s2)
+    6a44:	ae540078 	sw	s4,120(s2)
+    6a48:	1677fff6 	bne	s3,s7,6a24 <barrier_init+0x9c>
+    6a4c:	26520004 	addiu	s2,s2,4
+    6a50:	3c020003 	lui	v0,0x3
+    6a54:	2442489c 	addiu	v0,v0,18588
+    6a58:	ae220088 	sw	v0,136(s1)
+    6a5c:	8fbf0054 	lw	ra,84(sp)
+    6a60:	3c02cfa5 	lui	v0,0xcfa5
+    6a64:	3442b1a3 	ori	v0,v0,0xb1a3
+    6a68:	ae300048 	sw	s0,72(s1)
+    6a6c:	ae220040 	sw	v0,64(s1)
+    6a70:	ae200050 	sw	zero,80(s1)
+    6a74:	ae200054 	sw	zero,84(s1)
+    6a78:	ae200058 	sw	zero,88(s1)
+    6a7c:	00001021 	addu	v0,zero,zero
+    6a80:	8fb70050 	lw	s7,80(sp)
+    6a84:	8fb6004c 	lw	s6,76(sp)
+    6a88:	8fb50048 	lw	s5,72(sp)
+    6a8c:	8fb40044 	lw	s4,68(sp)
+    6a90:	8fb30040 	lw	s3,64(sp)
+    6a94:	8fb2003c 	lw	s2,60(sp)
+    6a98:	8fb10038 	lw	s1,56(sp)
+    6a9c:	8fb00034 	lw	s0,52(sp)
+    6aa0:	03e00008 	jr	ra
+    6aa4:	27bd0058 	addiu	sp,sp,88
+    6aa8:	8fbf0054 	lw	ra,84(sp)
+    6aac:	24020016 	addiu	v0,zero,22
+    6ab0:	8fb70050 	lw	s7,80(sp)
+    6ab4:	8fb6004c 	lw	s6,76(sp)
+    6ab8:	8fb50048 	lw	s5,72(sp)
+    6abc:	8fb40044 	lw	s4,68(sp)
+    6ac0:	8fb30040 	lw	s3,64(sp)
+    6ac4:	8fb2003c 	lw	s2,60(sp)
+    6ac8:	8fb10038 	lw	s1,56(sp)
+    6acc:	8fb00034 	lw	s0,52(sp)
+    6ad0:	03e00008 	jr	ra
+    6ad4:	27bd0058 	addiu	sp,sp,88
+    6ad8:	12600009 	beqz	s3,6b00 <barrier_init+0x178>
+    6adc:	00008021 	addu	s0,zero,zero
+    6ae0:	8ea20078 	lw	v0,120(s5)
+    6ae4:	26100001 	addiu	s0,s0,1
+    6ae8:	02c02021 	addu	a0,s6,zero
+    6aec:	0c007134 	jal	1c4d0 <kmem_free>
+    6af0:	afa2002c 	sw	v0,44(sp)
+    6af4:	0213102b 	sltu	v0,s0,s3
+    6af8:	1440fff9 	bnez	v0,6ae0 <barrier_init+0x158>
+    6afc:	26b50004 	addiu	s5,s5,4
+    6b00:	8fbf0054 	lw	ra,84(sp)
+    6b04:	2402000c 	addiu	v0,zero,12
+    6b08:	8fb70050 	lw	s7,80(sp)
+    6b0c:	8fb6004c 	lw	s6,76(sp)
+    6b10:	8fb50048 	lw	s5,72(sp)
+    6b14:	8fb40044 	lw	s4,68(sp)
+    6b18:	8fb30040 	lw	s3,64(sp)
+    6b1c:	8fb2003c 	lw	s2,60(sp)
+    6b20:	8fb10038 	lw	s1,56(sp)
+    6b24:	8fb00034 	lw	s0,52(sp)
+    6b28:	03e00008 	jr	ra
+    6b2c:	27bd0058 	addiu	sp,sp,88
+    6b30:	40032002 	mfc0	v1,$4,2
+    6b34:	40047801 	mfc0	a0,$15,1
+    6b38:	3c020004 	lui	v0,0x4
+    6b3c:	30840003 	andi	a0,a0,0x3
+    6b40:	00042080 	sll	a0,a0,0x2
+    6b44:	2442c950 	addiu	v0,v0,-14000
+    6b48:	8c630180 	lw	v1,384(v1)
+    6b4c:	00821021 	addu	v0,a0,v0
+    6b50:	8c420000 	lw	v0,0(v0)
+    6b54:	3c040004 	lui	a0,0x4
+    6b58:	8c6305c4 	lw	v1,1476(v1)
+    6b5c:	8c849100 	lw	a0,-28416(a0)
+    6b60:	3c060003 	lui	a2,0x3
+    6b64:	3c070003 	lui	a3,0x3
+    6b68:	afa20014 	sw	v0,20(sp)
+    6b6c:	24c64844 	addiu	a2,a2,18500
+    6b70:	24020800 	addiu	v0,zero,2048
+    6b74:	24e748e4 	addiu	a3,a3,18660
+    6b78:	00002821 	addu	a1,zero,zero
+    6b7c:	afa30010 	sw	v1,16(sp)
+    6b80:	0c0009b0 	jal	26c0 <__fprintk>
+    6b84:	afa20018 	sw	v0,24(sp)
+    6b88:	8fbf0054 	lw	ra,84(sp)
+    6b8c:	2402000c 	addiu	v0,zero,12
+    6b90:	8fb70050 	lw	s7,80(sp)
+    6b94:	8fb6004c 	lw	s6,76(sp)
+    6b98:	8fb50048 	lw	s5,72(sp)
+    6b9c:	8fb40044 	lw	s4,68(sp)
+    6ba0:	8fb30040 	lw	s3,64(sp)
+    6ba4:	8fb2003c 	lw	s2,60(sp)
+    6ba8:	8fb10038 	lw	s1,56(sp)
+    6bac:	8fb00034 	lw	s0,52(sp)
+    6bb0:	03e00008 	jr	ra
+    6bb4:	27bd0058 	addiu	sp,sp,88
+    6bb8:	ac800044 	sw	zero,68(a0)
+    6bbc:	3c050003 	lui	a1,0x3
+    6bc0:	24a54894 	addiu	a1,a1,18580
+    6bc4:	0c004a24 	jal	12890 <spinlock_init>
+    6bc8:	02202021 	addu	a0,s1,zero
+    6bcc:	08001a7f 	j	69fc <barrier_init+0x74>
+    6bd0:	ae20004c 	sw	zero,76(s1)
+
+00006bd4 <barrier_wait>:
+    6bd4:	27bdffa8 	addiu	sp,sp,-88
+    6bd8:	afb3003c 	sw	s3,60(sp)
+    6bdc:	afbf0054 	sw	ra,84(sp)
+    6be0:	afbe0050 	sw	s8,80(sp)
+    6be4:	afb7004c 	sw	s7,76(sp)
+    6be8:	afb60048 	sw	s6,72(sp)
+    6bec:	afb50044 	sw	s5,68(sp)
+    6bf0:	afb40040 	sw	s4,64(sp)
+    6bf4:	afb20038 	sw	s2,56(sp)
+    6bf8:	afb10034 	sw	s1,52(sp)
+    6bfc:	afb00030 	sw	s0,48(sp)
+    6c00:	00809821 	addu	s3,a0,zero
+    6c04:	40114800 	mfc0	s1,c0_count
+    6c08:	00000000 	sll	zero,zero,0x0
+    6c0c:	40102002 	mfc0	s0,$4,2
+    6c10:	3c02cfa5 	lui	v0,0xcfa5
+    6c14:	8c830040 	lw	v1,64(a0)
+    6c18:	3442b1a3 	ori	v0,v0,0xb1a3
+    6c1c:	8e1402f8 	lw	s4,760(s0)
+    6c20:	1062000e 	beq	v1,v0,6c5c <barrier_wait+0x88>
+    6c24:	8c850044 	lw	a1,68(a0)
+    6c28:	24020016 	addiu	v0,zero,22
+    6c2c:	8fbf0054 	lw	ra,84(sp)
+    6c30:	8fbe0050 	lw	s8,80(sp)
+    6c34:	8fb7004c 	lw	s7,76(sp)
+    6c38:	8fb60048 	lw	s6,72(sp)
+    6c3c:	8fb50044 	lw	s5,68(sp)
+    6c40:	8fb40040 	lw	s4,64(sp)
+    6c44:	8fb3003c 	lw	s3,60(sp)
+    6c48:	8fb20038 	lw	s2,56(sp)
+    6c4c:	8fb10034 	lw	s1,52(sp)
+    6c50:	8fb00030 	lw	s0,48(sp)
+    6c54:	03e00008 	jr	ra
+    6c58:	27bd0058 	addiu	sp,sp,88
+    6c5c:	2cb20001 	sltiu	s2,a1,1
+    6c60:	16400026 	bnez	s2,6cfc <barrier_wait+0x128>
+    6c64:	00000000 	sll	zero,zero,0x0
+    6c68:	8e020180 	lw	v0,384(s0)
+    6c6c:	14a2ffef 	bne	a1,v0,6c2c <barrier_wait+0x58>
+    6c70:	24020016 	addiu	v0,zero,22
+    6c74:	00141242 	srl	v0,s4,0x9
+    6c78:	2442001a 	addiu	v0,v0,26
+    6c7c:	00021080 	sll	v0,v0,0x2
+    6c80:	00821021 	addu	v0,a0,v0
+    6c84:	8c550000 	lw	s5,0(v0)
+    6c88:	329401ff 	andi	s4,s4,0x1ff
+    6c8c:	0014a0c0 	sll	s4,s4,0x3
+    6c90:	02b41021 	addu	v0,s5,s4
+    6c94:	ac500004 	sw	s0,4(v0)
+    6c98:	0c0019b9 	jal	66e4 <atomic_add>
+    6c9c:	2405ffff 	addiu	a1,zero,-1
+    6ca0:	24030001 	addiu	v1,zero,1
+    6ca4:	10430026 	beq	v0,v1,6d40 <barrier_wait+0x16c>
+    6ca8:	02b4a021 	addu	s4,s5,s4
+    6cac:	8e630048 	lw	v1,72(s3)
+    6cb0:	1062006a 	beq	v1,v0,6e5c <barrier_wait+0x288>
+    6cb4:	00000000 	sll	zero,zero,0x0
+    6cb8:	0c004b07 	jal	12c1c <spinlock_unlock_nosched>
+    6cbc:	02602021 	addu	a0,s3,zero
+    6cc0:	0c004634 	jal	118d0 <sched_sleep>
+    6cc4:	02002021 	addu	a0,s0,zero
+    6cc8:	8fbf0054 	lw	ra,84(sp)
+    6ccc:	00001021 	addu	v0,zero,zero
+    6cd0:	8fbe0050 	lw	s8,80(sp)
+    6cd4:	8fb7004c 	lw	s7,76(sp)
+    6cd8:	8fb60048 	lw	s6,72(sp)
+    6cdc:	8fb50044 	lw	s5,68(sp)
+    6ce0:	8fb40040 	lw	s4,64(sp)
+    6ce4:	8fb3003c 	lw	s3,60(sp)
+    6ce8:	8fb20038 	lw	s2,56(sp)
+    6cec:	8fb10034 	lw	s1,52(sp)
+    6cf0:	8fb00030 	lw	s0,48(sp)
+    6cf4:	03e00008 	jr	ra
+    6cf8:	27bd0058 	addiu	sp,sp,88
+    6cfc:	0c004bc3 	jal	12f0c <spinlock_lock>
+    6d00:	00000000 	sll	zero,zero,0x0
+    6d04:	8e62004c 	lw	v0,76(s3)
+    6d08:	8e630048 	lw	v1,72(s3)
+    6d0c:	00022242 	srl	a0,v0,0x9
+    6d10:	2484001a 	addiu	a0,a0,26
+    6d14:	00042080 	sll	a0,a0,0x2
+    6d18:	02642021 	addu	a0,s3,a0
+    6d1c:	305401ff 	andi	s4,v0,0x1ff
+    6d20:	8c950000 	lw	s5,0(a0)
+    6d24:	0014a0c0 	sll	s4,s4,0x3
+    6d28:	24450001 	addiu	a1,v0,1
+    6d2c:	02b42021 	addu	a0,s5,s4
+    6d30:	ae65004c 	sw	a1,76(s3)
+    6d34:	00621023 	subu	v0,v1,v0
+    6d38:	08001b28 	j	6ca0 <barrier_wait+0xcc>
+    6d3c:	ac900004 	sw	s0,4(a0)
+    6d40:	ae710060 	sw	s1,96(s3)
+    6d44:	16400040 	bnez	s2,6e48 <barrier_wait+0x274>
+    6d48:	ae800004 	sw	zero,4(s4)
+    6d4c:	8e650048 	lw	a1,72(s3)
+    6d50:	0c00199f 	jal	667c <atomic_init>
+    6d54:	02602021 	addu	a0,s3,zero
+    6d58:	40114800 	mfc0	s1,c0_count
+    6d5c:	00000000 	sll	zero,zero,0x0
+    6d60:	8e770048 	lw	s7,72(s3)
+    6d64:	8e70005c 	lw	s0,92(s3)
+    6d68:	26f7ffff 	addiu	s7,s7,-1
+    6d6c:	12e0001c 	beqz	s7,6de0 <barrier_wait+0x20c>
+    6d70:	8e720060 	lw	s2,96(s3)
+    6d74:	afa00028 	sw	zero,40(sp)
+    6d78:	0000b021 	addu	s6,zero,zero
+    6d7c:	241e0200 	addiu	s8,zero,512
+    6d80:	8fa20028 	lw	v0,40(sp)
+    6d84:	02621821 	addu	v1,s3,v0
+    6d88:	02d7102b 	sltu	v0,s6,s7
+    6d8c:	1040000d 	beqz	v0,6dc4 <barrier_wait+0x1f0>
+    6d90:	8c740068 	lw	s4,104(v1)
+    6d94:	0000a821 	addu	s5,zero,zero
+    6d98:	8e820004 	lw	v0,4(s4)
+    6d9c:	26b50001 	addiu	s5,s5,1
+    6da0:	10400004 	beqz	v0,6db4 <barrier_wait+0x1e0>
+    6da4:	00402021 	addu	a0,v0,zero
+    6da8:	0c0044a3 	jal	1128c <sched_wakeup>
+    6dac:	ae800004 	sw	zero,4(s4)
+    6db0:	26d60001 	addiu	s6,s6,1
+    6db4:	12be0003 	beq	s5,s8,6dc4 <barrier_wait+0x1f0>
+    6db8:	02d7102b 	sltu	v0,s6,s7
+    6dbc:	1440fff6 	bnez	v0,6d98 <barrier_wait+0x1c4>
+    6dc0:	26940008 	addiu	s4,s4,8
+    6dc4:	8fa30028 	lw	v1,40(sp)
+    6dc8:	2402000c 	addiu	v0,zero,12
+    6dcc:	10620004 	beq	v1,v0,6de0 <barrier_wait+0x20c>
+    6dd0:	24630004 	addiu	v1,v1,4
+    6dd4:	02d7102b 	sltu	v0,s6,s7
+    6dd8:	1440ffe9 	bnez	v0,6d80 <barrier_wait+0x1ac>
+    6ddc:	afa30028 	sw	v1,40(sp)
+    6de0:	40024800 	mfc0	v0,c0_count
+    6de4:	00000000 	sll	zero,zero,0x0
+    6de8:	40047801 	mfc0	a0,$15,1
+    6dec:	3c030004 	lui	v1,0x4
+    6df0:	30840003 	andi	a0,a0,0x3
+    6df4:	00042080 	sll	a0,a0,0x2
+    6df8:	2463c950 	addiu	v1,v1,-14000
+    6dfc:	00831821 	addu	v1,a0,v1
+    6e00:	3c040004 	lui	a0,0x4
+    6e04:	8c680000 	lw	t0,0(v1)
+    6e08:	8c849100 	lw	a0,-28416(a0)
+    6e0c:	3c060003 	lui	a2,0x3
+    6e10:	3c070003 	lui	a3,0x3
+    6e14:	00501823 	subu	v1,v0,s0
+    6e18:	24c648ac 	addiu	a2,a2,18604
+    6e1c:	24e748f4 	addiu	a3,a3,18676
+    6e20:	00002821 	addu	a1,zero,zero
+    6e24:	afa80010 	sw	t0,16(sp)
+    6e28:	afb20018 	sw	s2,24(sp)
+    6e2c:	afb1001c 	sw	s1,28(sp)
+    6e30:	afa30024 	sw	v1,36(sp)
+    6e34:	afb00014 	sw	s0,20(sp)
+    6e38:	0c0009b0 	jal	26c0 <__fprintk>
+    6e3c:	afa20020 	sw	v0,32(sp)
+    6e40:	08001b0b 	j	6c2c <barrier_wait+0x58>
+    6e44:	24020001 	addiu	v0,zero,1
+    6e48:	ae60004c 	sw	zero,76(s3)
+    6e4c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    6e50:	02602021 	addu	a0,s3,zero
+    6e54:	08001b56 	j	6d58 <barrier_wait+0x184>
+    6e58:	00000000 	sll	zero,zero,0x0
+    6e5c:	08001b2e 	j	6cb8 <barrier_wait+0xe4>
+    6e60:	ae71005c 	sw	s1,92(s3)
+
+00006e64 <blkio_kmem_init>:
+    6e64:	24020002 	addiu	v0,zero,2
+    6e68:	ac820000 	sw	v0,0(a0)
+    6e6c:	3c020003 	lui	v0,0x3
+    6e70:	2442490c 	addiu	v0,v0,18700
+    6e74:	ac820004 	sw	v0,4(a0)
+    6e78:	240200b0 	addiu	v0,zero,176
+    6e7c:	ac820008 	sw	v0,8(a0)
+    6e80:	24020004 	addiu	v0,zero,4
+    6e84:	ac82000c 	sw	v0,12(a0)
+    6e88:	24020008 	addiu	v0,zero,8
+    6e8c:	ac820010 	sw	v0,16(a0)
+    6e90:	3c020000 	lui	v0,0x0
+    6e94:	244271d4 	addiu	v0,v0,29140
+    6e98:	ac820018 	sw	v0,24(a0)
+    6e9c:	ac80001c 	sw	zero,28(a0)
+    6ea0:	ac800014 	sw	zero,20(a0)
+    6ea4:	03e00008 	jr	ra
+    6ea8:	00001021 	addu	v0,zero,zero
+
+00006eac <blkio_destroy>:
+    6eac:	27bdffc8 	addiu	sp,sp,-56
+    6eb0:	afb30030 	sw	s3,48(sp)
+    6eb4:	afb10028 	sw	s1,40(sp)
+    6eb8:	afb00024 	sw	s0,36(sp)
+    6ebc:	afbf0034 	sw	ra,52(sp)
+    6ec0:	afb2002c 	sw	s2,44(sp)
+    6ec4:	8c82001c 	lw	v0,28(a0)
+    6ec8:	2491001c 	addiu	s1,a0,28
+    6ecc:	00809821 	addu	s3,a0,zero
+    6ed0:	1051000b 	beq	v0,s1,6f00 <blkio_destroy+0x54>
+    6ed4:	8c500000 	lw	s0,0(v0)
+    6ed8:	24030002 	addiu	v1,zero,2
+    6edc:	afa30010 	sw	v1,16(sp)
+    6ee0:	27b20010 	addiu	s2,sp,16
+    6ee4:	2442ff5c 	addiu	v0,v0,-164
+    6ee8:	02402021 	addu	a0,s2,zero
+    6eec:	0c007134 	jal	1c4d0 <kmem_free>
+    6ef0:	afa2001c 	sw	v0,28(sp)
+    6ef4:	02001021 	addu	v0,s0,zero
+    6ef8:	1451fffa 	bne	v0,s1,6ee4 <blkio_destroy+0x38>
+    6efc:	8e100000 	lw	s0,0(s0)
+    6f00:	8e620000 	lw	v0,0(s3)
+    6f04:	2403fdff 	addiu	v1,zero,-513
+    6f08:	00621024 	and	v0,v1,v0
+    6f0c:	ae620000 	sw	v0,0(s3)
+    6f10:	ae60001c 	sw	zero,28(s3)
+    6f14:	8fbf0034 	lw	ra,52(sp)
+    6f18:	00001021 	addu	v0,zero,zero
+    6f1c:	8fb30030 	lw	s3,48(sp)
+    6f20:	8fb2002c 	lw	s2,44(sp)
+    6f24:	8fb10028 	lw	s1,40(sp)
+    6f28:	8fb00024 	lw	s0,36(sp)
+    6f2c:	03e00008 	jr	ra
+    6f30:	27bd0038 	addiu	sp,sp,56
+
+00006f34 <blkio_sync>:
+    6f34:	27bdffc0 	addiu	sp,sp,-64
+    6f38:	afb70038 	sw	s7,56(sp)
+    6f3c:	afb60034 	sw	s6,52(sp)
+    6f40:	afbf003c 	sw	ra,60(sp)
+    6f44:	afb50030 	sw	s5,48(sp)
+    6f48:	afb4002c 	sw	s4,44(sp)
+    6f4c:	afb30028 	sw	s3,40(sp)
+    6f50:	afb20024 	sw	s2,36(sp)
+    6f54:	afb10020 	sw	s1,32(sp)
+    6f58:	afb0001c 	sw	s0,28(sp)
+    6f5c:	00a0b821 	addu	s7,a1,zero
+    6f60:	8c85001c 	lw	a1,28(a0)
+    6f64:	32e20001 	andi	v0,s7,0x1
+    6f68:	1040002c 	beqz	v0,701c <blkio_sync+0xe8>
+    6f6c:	24b6ff5c 	addiu	s6,a1,-164
+    6f70:	8ec200a0 	lw	v0,160(s6)
+    6f74:	8c540034 	lw	s4,52(v0)
+    6f78:	2491001c 	addiu	s1,a0,28
+    6f7c:	10b10054 	beq	a1,s1,70d0 <blkio_sync+0x19c>
+    6f80:	8cb00000 	lw	s0,0(a1)
+    6f84:	00009821 	addu	s3,zero,zero
+    6f88:	00001021 	addu	v0,zero,zero
+    6f8c:	24150001 	addiu	s5,zero,1
+    6f90:	08001beb 	j	6fac <blkio_sync+0x78>
+    6f94:	2412fffe 	addiu	s2,zero,-2
+    6f98:	aca6ff5c 	sw	a2,-164(a1)
+    6f9c:	8e030000 	lw	v1,0(s0)
+    6fa0:	12110011 	beq	s0,s1,6fe8 <blkio_sync+0xb4>
+    6fa4:	02002821 	addu	a1,s0,zero
+    6fa8:	00608021 	addu	s0,v1,zero
+    6fac:	8ca4ff5c 	lw	a0,-164(a1)
+    6fb0:	00923024 	and	a2,a0,s2
+    6fb4:	30840001 	andi	a0,a0,0x1
+    6fb8:	1480fff7 	bnez	a0,6f98 <blkio_sync+0x64>
+    6fbc:	24a3ff5c 	addiu	v1,a1,-164
+    6fc0:	8c6400a0 	lw	a0,160(v1)
+    6fc4:	24a5ff9c 	addiu	a1,a1,-100
+    6fc8:	0280f809 	jalr	s4
+    6fcc:	ac75004c 	sw	s5,76(v1)
+    6fd0:	04400032 	bltz	v0,709c <blkio_sync+0x168>
+    6fd4:	00000000 	sll	zero,zero,0x0
+    6fd8:	26730001 	addiu	s3,s3,1
+    6fdc:	02002821 	addu	a1,s0,zero
+    6fe0:	1611fff1 	bne	s0,s1,6fa8 <blkio_sync+0x74>
+    6fe4:	8e030000 	lw	v1,0(s0)
+    6fe8:	32f70002 	andi	s7,s7,0x2
+    6fec:	16e0000e 	bnez	s7,7028 <blkio_sync+0xf4>
+    6ff0:	8fbf003c 	lw	ra,60(sp)
+    6ff4:	8fb70038 	lw	s7,56(sp)
+    6ff8:	8fb60034 	lw	s6,52(sp)
+    6ffc:	8fb50030 	lw	s5,48(sp)
+    7000:	8fb4002c 	lw	s4,44(sp)
+    7004:	8fb30028 	lw	s3,40(sp)
+    7008:	8fb20024 	lw	s2,36(sp)
+    700c:	8fb10020 	lw	s1,32(sp)
+    7010:	8fb0001c 	lw	s0,28(sp)
+    7014:	03e00008 	jr	ra
+    7018:	27bd0040 	addiu	sp,sp,64
+    701c:	8ec200a0 	lw	v0,160(s6)
+    7020:	08001bde 	j	6f78 <blkio_sync+0x44>
+    7024:	8c540038 	lw	s4,56(v0)
+    7028:	26d00010 	addiu	s0,s6,16
+    702c:	02002021 	addu	a0,s0,zero
+    7030:	0c004bbf 	jal	12efc <spinlock_lock_noirq>
+    7034:	27a50010 	addiu	a1,sp,16
+    7038:	96c30022 	lhu	v1,34(s6)
+    703c:	96c40020 	lhu	a0,32(s6)
+    7040:	00831821 	addu	v1,a0,v1
+    7044:	00739823 	subu	s3,v1,s3
+    7048:	3273ffff 	andi	s3,s3,0xffff
+    704c:	0264102b 	sltu	v0,s3,a0
+    7050:	14400014 	bnez	v0,70a4 <blkio_sync+0x170>
+    7054:	a6d30022 	sh	s3,34(s6)
+    7058:	8fa50010 	lw	a1,16(sp)
+    705c:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    7060:	02002021 	addu	a0,s0,zero
+    7064:	8ec30024 	lw	v1,36(s6)
+    7068:	8fbf003c 	lw	ra,60(sp)
+    706c:	24020005 	addiu	v0,zero,5
+    7070:	0003100a 	movz	v0,zero,v1
+    7074:	8fb70038 	lw	s7,56(sp)
+    7078:	8fb60034 	lw	s6,52(sp)
+    707c:	8fb50030 	lw	s5,48(sp)
+    7080:	8fb4002c 	lw	s4,44(sp)
+    7084:	8fb30028 	lw	s3,40(sp)
+    7088:	8fb20024 	lw	s2,36(sp)
+    708c:	8fb10020 	lw	s1,32(sp)
+    7090:	8fb0001c 	lw	s0,28(sp)
+    7094:	03e00008 	jr	ra
+    7098:	27bd0040 	addiu	sp,sp,64
+    709c:	08001bfa 	j	6fe8 <blkio_sync+0xb4>
+    70a0:	24020005 	addiu	v0,zero,5
+    70a4:	26c40028 	addiu	a0,s6,40
+    70a8:	0c006d13 	jal	1b44c <wait_on>
+    70ac:	24050002 	addiu	a1,zero,2
+    70b0:	8fa50010 	lw	a1,16(sp)
+    70b4:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    70b8:	02002021 	addu	a0,s0,zero
+    70bc:	40042002 	mfc0	a0,$4,2
+    70c0:	0c004634 	jal	118d0 <sched_sleep>
+    70c4:	00000000 	sll	zero,zero,0x0
+    70c8:	08001c1a 	j	7068 <blkio_sync+0x134>
+    70cc:	8ec30024 	lw	v1,36(s6)
+    70d0:	00009821 	addu	s3,zero,zero
+    70d4:	08001bfa 	j	6fe8 <blkio_sync+0xb4>
+    70d8:	00001021 	addu	v0,zero,zero
+
+000070dc <blkio_init>:
+    70dc:	27bdffc8 	addiu	sp,sp,-56
+    70e0:	24a3001c 	addiu	v1,a1,28
+    70e4:	afb40030 	sw	s4,48(sp)
+    70e8:	afb3002c 	sw	s3,44(sp)
+    70ec:	afb00020 	sw	s0,32(sp)
+    70f0:	afbf0034 	sw	ra,52(sp)
+    70f4:	afb20028 	sw	s2,40(sp)
+    70f8:	afb10024 	sw	s1,36(sp)
+    70fc:	00a08021 	addu	s0,a1,zero
+    7100:	00c0a021 	addu	s4,a2,zero
+    7104:	00809821 	addu	s3,a0,zero
+    7108:	10c00022 	beqz	a2,7194 <blkio_init+0xb8>
+    710c:	aca3001c 	sw	v1,28(a1)
+    7110:	24020002 	addiu	v0,zero,2
+    7114:	afa20010 	sw	v0,16(sp)
+    7118:	240200b0 	addiu	v0,zero,176
+    711c:	afa20014 	sw	v0,20(sp)
+    7120:	3c020011 	lui	v0,0x11
+    7124:	34420020 	ori	v0,v0,0x20
+    7128:	afa20018 	sw	v0,24(sp)
+    712c:	00c08821 	addu	s1,a2,zero
+    7130:	08001c55 	j	7154 <blkio_init+0x78>
+    7134:	27b20010 	addiu	s2,sp,16
+    7138:	ac400000 	sw	zero,0(v0)
+    713c:	ac50009c 	sw	s0,156(v0)
+    7140:	ac5300a0 	sw	s3,160(v0)
+    7144:	8e04001c 	lw	a0,28(s0)
+    7148:	ac4400a4 	sw	a0,164(v0)
+    714c:	12200011 	beqz	s1,7194 <blkio_init+0xb8>
+    7150:	ae03001c 	sw	v1,28(s0)
+    7154:	0c00713f 	jal	1c4fc <kmem_alloc>
+    7158:	02402021 	addu	a0,s2,zero
+    715c:	2631ffff 	addiu	s1,s1,-1
+    7160:	1440fff5 	bnez	v0,7138 <blkio_init+0x5c>
+    7164:	244300a4 	addiu	v1,v0,164
+    7168:	0c001bab 	jal	6eac <blkio_destroy>
+    716c:	02002021 	addu	a0,s0,zero
+    7170:	8fbf0034 	lw	ra,52(sp)
+    7174:	2402000c 	addiu	v0,zero,12
+    7178:	8fb40030 	lw	s4,48(sp)
+    717c:	8fb3002c 	lw	s3,44(sp)
+    7180:	8fb20028 	lw	s2,40(sp)
+    7184:	8fb10024 	lw	s1,36(sp)
+    7188:	8fb00020 	lw	s0,32(sp)
+    718c:	03e00008 	jr	ra
+    7190:	27bd0038 	addiu	sp,sp,56
+    7194:	2463ff5c 	addiu	v1,v1,-164
+    7198:	a4740020 	sh	s4,32(v1)
+    719c:	ac600024 	sw	zero,36(v1)
+    71a0:	a4600022 	sh	zero,34(v1)
+    71a4:	8e030000 	lw	v1,0(s0)
+    71a8:	00001021 	addu	v0,zero,zero
+    71ac:	34630200 	ori	v1,v1,0x200
+    71b0:	ae030000 	sw	v1,0(s0)
+    71b4:	8fbf0034 	lw	ra,52(sp)
+    71b8:	8fb40030 	lw	s4,48(sp)
+    71bc:	8fb3002c 	lw	s3,44(sp)
+    71c0:	8fb20028 	lw	s2,40(sp)
+    71c4:	8fb10024 	lw	s1,36(sp)
+    71c8:	8fb00020 	lw	s0,32(sp)
+    71cc:	03e00008 	jr	ra
+    71d0:	27bd0038 	addiu	sp,sp,56
+    71d4:	27bdffe8 	addiu	sp,sp,-24
+    71d8:	afb00010 	sw	s0,16(sp)
+    71dc:	00a08021 	addu	s0,a1,zero
+    71e0:	3c050003 	lui	a1,0x3
+    71e4:	26040010 	addiu	a0,s0,16
+    71e8:	afbf0014 	sw	ra,20(sp)
+    71ec:	0c004a24 	jal	12890 <spinlock_init>
+    71f0:	24a54918 	addiu	a1,a1,18712
+    71f4:	3c030000 	lui	v1,0x0
+    71f8:	24637238 	addiu	v1,v1,29240
+    71fc:	ae03005c 	sw	v1,92(s0)
+    7200:	24030003 	addiu	v1,zero,3
+    7204:	ae030058 	sw	v1,88(s0)
+    7208:	8fbf0014 	lw	ra,20(sp)
+    720c:	3c030003 	lui	v1,0x3
+    7210:	26020030 	addiu	v0,s0,48
+    7214:	24634920 	addiu	v1,v1,18720
+    7218:	ae020034 	sw	v0,52(s0)
+    721c:	ae030028 	sw	v1,40(s0)
+    7220:	ae100060 	sw	s0,96(s0)
+    7224:	ae00002c 	sw	zero,44(s0)
+    7228:	ae020030 	sw	v0,48(s0)
+    722c:	8fb00010 	lw	s0,16(sp)
+    7230:	03e00008 	jr	ra
+    7234:	27bd0018 	addiu	sp,sp,24
+    7238:	8c820008 	lw	v0,8(a0)
+    723c:	27bdffd0 	addiu	sp,sp,-48
+    7240:	8c43009c 	lw	v1,156(v0)
+    7244:	afb10024 	sw	s1,36(sp)
+    7248:	afbf002c 	sw	ra,44(sp)
+    724c:	afb20028 	sw	s2,40(sp)
+    7250:	afb00020 	sw	s0,32(sp)
+    7254:	8c70001c 	lw	s0,28(v1)
+    7258:	8c910010 	lw	s1,16(a0)
+    725c:	1620002a 	bnez	s1,7308 <blkio_init+0x22c>
+    7260:	2610ff5c 	addiu	s0,s0,-164
+    7264:	26120010 	addiu	s2,s0,16
+    7268:	02402021 	addu	a0,s2,zero
+    726c:	0c004bbf 	jal	12efc <spinlock_lock_noirq>
+    7270:	27a50018 	addiu	a1,sp,24
+    7274:	96020022 	lhu	v0,34(s0)
+    7278:	8e030024 	lw	v1,36(s0)
+    727c:	24420001 	addiu	v0,v0,1
+    7280:	3042ffff 	andi	v0,v0,0xffff
+    7284:	1060000f 	beqz	v1,72c4 <blkio_init+0x1e8>
+    7288:	a6020022 	sh	v0,34(s0)
+    728c:	96030020 	lhu	v1,32(s0)
+    7290:	24110001 	addiu	s1,zero,1
+    7294:	1062000f 	beq	v1,v0,72d4 <blkio_init+0x1f8>
+    7298:	ae110024 	sw	s1,36(s0)
+    729c:	8fa50018 	lw	a1,24(sp)
+    72a0:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    72a4:	02402021 	addu	a0,s2,zero
+    72a8:	8fbf002c 	lw	ra,44(sp)
+    72ac:	00001021 	addu	v0,zero,zero
+    72b0:	8fb20028 	lw	s2,40(sp)
+    72b4:	8fb10024 	lw	s1,36(sp)
+    72b8:	8fb00020 	lw	s0,32(sp)
+    72bc:	03e00008 	jr	ra
+    72c0:	27bd0030 	addiu	sp,sp,48
+    72c4:	96030020 	lhu	v1,32(s0)
+    72c8:	0011882b 	sltu	s1,zero,s1
+    72cc:	1462fff3 	bne	v1,v0,729c <blkio_init+0x1c0>
+    72d0:	ae110024 	sw	s1,36(s0)
+    72d4:	26040028 	addiu	a0,s0,40
+    72d8:	0c006d56 	jal	1b558 <wakeup_one>
+    72dc:	24050002 	addiu	a1,zero,2
+    72e0:	8fa50018 	lw	a1,24(sp)
+    72e4:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+    72e8:	02402021 	addu	a0,s2,zero
+    72ec:	8fbf002c 	lw	ra,44(sp)
+    72f0:	00001021 	addu	v0,zero,zero
+    72f4:	8fb20028 	lw	s2,40(sp)
+    72f8:	8fb10024 	lw	s1,36(sp)
+    72fc:	8fb00020 	lw	s0,32(sp)
+    7300:	03e00008 	jr	ra
+    7304:	27bd0030 	addiu	sp,sp,48
+    7308:	3c030004 	lui	v1,0x4
+    730c:	8c649100 	lw	a0,-28416(v1)
+    7310:	8c420040 	lw	v0,64(v0)
+    7314:	3c060003 	lui	a2,0x3
+    7318:	3c070003 	lui	a3,0x3
+    731c:	24c6492c 	addiu	a2,a2,18732
+    7320:	24e7495c 	addiu	a3,a3,18780
+    7324:	00002821 	addu	a1,zero,zero
+    7328:	0c0009b0 	jal	26c0 <__fprintk>
+    732c:	afa20010 	sw	v0,16(sp)
+    7330:	08001c9a 	j	7268 <blkio_init+0x18c>
+    7334:	26120010 	addiu	s2,s0,16
+
+00007338 <clusters_sysfs_register>:
+    7338:	3c030004 	lui	v1,0x4
+    733c:	2463d9a0 	addiu	v1,v1,-9824
+    7340:	34059400 	ori	a1,zero,0x9400
+    7344:	3c040008 	lui	a0,0x8
+    7348:	3c07cccc 	lui	a3,0xcccc
+    734c:	00652821 	addu	a1,v1,a1
+    7350:	24840390 	addiu	a0,a0,912
+    7354:	34e7cccd 	ori	a3,a3,0xcccd
+    7358:	8c62000c 	lw	v0,12(v1)
+    735c:	1040001e 	beqz	v0,73d8 <clusters_sysfs_register+0xa0>
+    7360:	00000000 	sll	zero,zero,0x0
+    7364:	8c820014 	lw	v0,20(a0)
+    7368:	8c680034 	lw	t0,52(v1)
+    736c:	24420001 	addiu	v0,v0,1
+    7370:	ac820014 	sw	v0,20(a0)
+    7374:	81060000 	lb	a2,0(t0)
+    7378:	10c0000d 	beqz	a2,73b0 <clusters_sysfs_register+0x78>
+    737c:	00001021 	addu	v0,zero,zero
+    7380:	25080001 	addiu	t0,t0,1
+    7384:	00c24826 	xor	t1,a2,v0
+    7388:	81060000 	lb	a2,0(t0)
+    738c:	14c0fffc 	bnez	a2,7380 <clusters_sysfs_register+0x48>
+    7390:	00491021 	addu	v0,v0,t1
+    7394:	00470019 	multu	v0,a3
+    7398:	00003010 	mfhi	a2
+    739c:	000630c2 	srl	a2,a2,0x3
+    73a0:	000640c0 	sll	t0,a2,0x3
+    73a4:	00063040 	sll	a2,a2,0x1
+    73a8:	00c83021 	addu	a2,a2,t0
+    73ac:	00463023 	subu	a2,v0,a2
+    73b0:	24c60004 	addiu	a2,a2,4
+    73b4:	000630c0 	sll	a2,a2,0x3
+    73b8:	00863021 	addu	a2,a0,a2
+    73bc:	8cc20004 	lw	v0,4(a2)
+    73c0:	2466003c 	addiu	a2,v1,60
+    73c4:	8c480000 	lw	t0,0(v0)
+    73c8:	ac620040 	sw	v0,64(v1)
+    73cc:	ac68003c 	sw	t0,60(v1)
+    73d0:	ad060004 	sw	a2,4(t0)
+    73d4:	ac460000 	sw	a2,0(v0)
+    73d8:	24630094 	addiu	v1,v1,148
+    73dc:	1465ffde 	bne	v1,a1,7358 <clusters_sysfs_register+0x20>
+    73e0:	00000000 	sll	zero,zero,0x0
+    73e4:	03e00008 	jr	ra
+    73e8:	00000000 	sll	zero,zero,0x0
+
+000073ec <cluster_wait_flag>:
+    73ec:	8c87003c 	lw	a3,60(a0)
+    73f0:	10e0001a 	beqz	a3,745c <cluster_wait_flag+0x70>
+    73f4:	3c090004 	lui	t1,0x4
+    73f8:	2529d9a0 	addiu	t1,t1,-9824
+    73fc:	01202821 	addu	a1,t1,zero
+    7400:	00003021 	addu	a2,zero,zero
+    7404:	8ca30008 	lw	v1,8(a1)
+    7408:	10600010 	beqz	v1,744c <cluster_wait_flag+0x60>
+    740c:	8ca20000 	lw	v0,0(a1)
+    7410:	00024080 	sll	t0,v0,0x2
+    7414:	00021940 	sll	v1,v0,0x5
+    7418:	01031821 	addu	v1,t0,v1
+    741c:	00621821 	addu	v1,v1,v0
+    7420:	00031880 	sll	v1,v1,0x2
+    7424:	01231821 	addu	v1,t1,v1
+    7428:	8c62000c 	lw	v0,12(v1)
+    742c:	30420001 	andi	v0,v0,0x1
+    7430:	14400006 	bnez	v0,744c <cluster_wait_flag+0x60>
+    7434:	00000000 	sll	zero,zero,0x0
+    7438:	8c62000c 	lw	v0,12(v1)
+    743c:	30420001 	andi	v0,v0,0x1
+    7440:	1040fffd 	beqz	v0,7438 <cluster_wait_flag+0x4c>
+    7444:	00000000 	sll	zero,zero,0x0
+    7448:	8c87003c 	lw	a3,60(a0)
+    744c:	24c60001 	addiu	a2,a2,1
+    7450:	00c7102b 	sltu	v0,a2,a3
+    7454:	1440ffeb 	bnez	v0,7404 <cluster_wait_flag+0x18>
+    7458:	24a50094 	addiu	a1,a1,148
+    745c:	03e00008 	jr	ra
+    7460:	00000000 	sll	zero,zero,0x0
+
+00007464 <cluster_with_ram_nr>:
+    7464:	8c82003c 	lw	v0,60(a0)
+    7468:	1040000e 	beqz	v0,74a4 <cluster_with_ram_nr+0x40>
+    746c:	00021940 	sll	v1,v0,0x5
+    7470:	00023080 	sll	a2,v0,0x2
+    7474:	00c33021 	addu	a2,a2,v1
+    7478:	00c23021 	addu	a2,a2,v0
+    747c:	3c030004 	lui	v1,0x4
+    7480:	2463d9a8 	addiu	v1,v1,-9816
+    7484:	00063080 	sll	a2,a2,0x2
+    7488:	00663021 	addu	a2,v1,a2
+    748c:	00001021 	addu	v0,zero,zero
+    7490:	8c650000 	lw	a1,0(v1)
+    7494:	24440001 	addiu	a0,v0,1
+    7498:	24630094 	addiu	v1,v1,148
+    749c:	1466fffc 	bne	v1,a2,7490 <cluster_with_ram_nr+0x2c>
+    74a0:	0085100b 	movn	v0,a0,a1
+    74a4:	03e00008 	jr	ra
+    74a8:	00000000 	sll	zero,zero,0x0
+
+000074ac <cluster_init_flag>:
+    74ac:	8c850058 	lw	a1,88(a0)
+    74b0:	8c830068 	lw	v1,104(a0)
+    74b4:	8c84003c 	lw	a0,60(a0)
+    74b8:	00a31826 	xor	v1,a1,v1
+    74bc:	24060011 	addiu	a2,zero,17
+    74c0:	24020001 	addiu	v0,zero,1
+    74c4:	1080002b 	beqz	a0,7574 <cluster_init_flag+0xc8>
+    74c8:	0043300b 	movn	a2,v0,v1
+    74cc:	00051140 	sll	v0,a1,0x5
+    74d0:	00055080 	sll	t2,a1,0x2
+    74d4:	01425021 	addu	t2,t2,v0
+    74d8:	01455021 	addu	t2,t2,a1
+    74dc:	3c020004 	lui	v0,0x4
+    74e0:	2442d9a0 	addiu	v0,v0,-9824
+    74e4:	000a5080 	sll	t2,t2,0x2
+    74e8:	004a6021 	addu	t4,v0,t2
+    74ec:	3c070004 	lui	a3,0x4
+    74f0:	3c0b5555 	lui	t3,0x5555
+    74f4:	258c000c 	addiu	t4,t4,12
+    74f8:	24e7c9a0 	addiu	a3,a3,-13920
+    74fc:	356b5555 	ori	t3,t3,0x5555
+    7500:	004a5021 	addu	t2,v0,t2
+    7504:	08001d50 	j	7540 <cluster_init_flag+0x94>
+    7508:	00001821 	addu	v1,zero,zero
+    750c:	1120001c 	beqz	t1,7580 <cluster_init_flag+0xd4>
+    7510:	00000000 	sll	zero,zero,0x0
+    7514:	8da90000 	lw	t1,0(t5)
+    7518:	112b0019 	beq	t1,t3,7580 <cluster_init_flag+0xd4>
+    751c:	00000000 	sll	zero,zero,0x0
+    7520:	4808c000 	mfc2	t0,$24
+    7524:	4889c000 	mtc2	t1,$24
+    7528:	ad860000 	sw	a2,0(t4)
+    752c:	4888c000 	mtc2	t0,$24
+    7530:	24630001 	addiu	v1,v1,1
+    7534:	0064402b 	sltu	t0,v1,a0
+    7538:	1100000e 	beqz	t0,7574 <cluster_init_flag+0xc8>
+    753c:	24420094 	addiu	v0,v0,148
+    7540:	8c490008 	lw	t1,8(v0)
+    7544:	1120fffa 	beqz	t1,7530 <cluster_init_flag+0x84>
+    7548:	8c480000 	lw	t0,0(v0)
+    754c:	3109ffff 	andi	t1,t0,0xffff
+    7550:	00097100 	sll	t6,t1,0x4
+    7554:	00096880 	sll	t5,t1,0x2
+    7558:	01cd6823 	subu	t5,t6,t5
+    755c:	00ed6821 	addu	t5,a3,t5
+    7560:	1505ffea 	bne	t0,a1,750c <cluster_init_flag+0x60>
+    7564:	2d290101 	sltiu	t1,t1,257
+    7568:	ad46000c 	sw	a2,12(t2)
+    756c:	08001d4d 	j	7534 <cluster_init_flag+0x88>
+    7570:	24630001 	addiu	v1,v1,1
+    7574:	0000000f 	sync
+    7578:	03e00008 	jr	ra
+    757c:	00000000 	sll	zero,zero,0x0
+    7580:	08001d60 	j	7580 <cluster_init_flag+0xd4>
+    7584:	00000000 	sll	zero,zero,0x0
+
+00007588 <cluster_key_delete_event_handler>:
+    7588:	00801821 	addu	v1,a0,zero
+    758c:	3c050004 	lui	a1,0x4
+    7590:	8c840008 	lw	a0,8(a0)
+    7594:	24a56db0 	addiu	a1,a1,28080
+    7598:	8c820000 	lw	v0,0(a0)
+    759c:	8ca603fc 	lw	a2,1020(a1)
+    75a0:	27bdffe8 	addiu	sp,sp,-24
+    75a4:	0046302b 	sltu	a2,v0,a2
+    75a8:	afbf0014 	sw	ra,20(sp)
+    75ac:	10c00002 	beqz	a2,75b8 <cluster_key_delete_event_handler+0x30>
+    75b0:	8c64000c 	lw	a0,12(v1)
+    75b4:	aca203fc 	sw	v0,1020(a1)
+    75b8:	244200dc 	addiu	v0,v0,220
+    75bc:	00021080 	sll	v0,v0,0x2
+    75c0:	00a21021 	addu	v0,a1,v0
+    75c4:	ac400000 	sw	zero,0(v0)
+    75c8:	0c0044a3 	jal	1128c <sched_wakeup>
+    75cc:	ac600010 	sw	zero,16(v1)
+    75d0:	8fbf0014 	lw	ra,20(sp)
+    75d4:	00001021 	addu	v0,zero,zero
+    75d8:	03e00008 	jr	ra
+    75dc:	27bd0018 	addiu	sp,sp,24
+
+000075e0 <cluster_key_create_event_handler>:
+    75e0:	3c030004 	lui	v1,0x4
+    75e4:	24636db0 	addiu	v1,v1,28080
+    75e8:	8c6203fc 	lw	v0,1020(v1)
+    75ec:	27bdffe8 	addiu	sp,sp,-24
+    75f0:	2c450023 	sltiu	a1,v0,35
+    75f4:	afbf0014 	sw	ra,20(sp)
+    75f8:	8c88000c 	lw	t0,12(a0)
+    75fc:	10a00011 	beqz	a1,7644 <cluster_key_create_event_handler+0x64>
+    7600:	8c890008 	lw	t1,8(a0)
+    7604:	244500dc 	addiu	a1,v0,220
+    7608:	00053080 	sll	a2,a1,0x2
+    760c:	00c33021 	addu	a2,a2,v1
+    7610:	8cc60000 	lw	a2,0(a2)
+    7614:	10c00014 	beqz	a2,7668 <cluster_key_create_event_handler+0x88>
+    7618:	24070023 	addiu	a3,zero,35
+    761c:	244500dd 	addiu	a1,v0,221
+    7620:	00052880 	sll	a1,a1,0x2
+    7624:	08001d8e 	j	7638 <cluster_key_create_event_handler+0x58>
+    7628:	00652821 	addu	a1,v1,a1
+    762c:	8ca60000 	lw	a2,0(a1)
+    7630:	10c0000c 	beqz	a2,7664 <cluster_key_create_event_handler+0x84>
+    7634:	24a50004 	addiu	a1,a1,4
+    7638:	24420001 	addiu	v0,v0,1
+    763c:	1447fffb 	bne	v0,a3,762c <cluster_key_create_event_handler+0x4c>
+    7640:	00000000 	sll	zero,zero,0x0
+    7644:	2402001c 	addiu	v0,zero,28
+    7648:	ac820010 	sw	v0,16(a0)
+    764c:	0c0044a3 	jal	1128c <sched_wakeup>
+    7650:	01002021 	addu	a0,t0,zero
+    7654:	8fbf0014 	lw	ra,20(sp)
+    7658:	00001021 	addu	v0,zero,zero
+    765c:	03e00008 	jr	ra
+    7660:	27bd0018 	addiu	sp,sp,24
+    7664:	244500dc 	addiu	a1,v0,220
+    7668:	00052880 	sll	a1,a1,0x2
+    766c:	00652821 	addu	a1,v1,a1
+    7670:	24060001 	addiu	a2,zero,1
+    7674:	ad220000 	sw	v0,0(t1)
+    7678:	aca60000 	sw	a2,0(a1)
+    767c:	ac6203fc 	sw	v0,1020(v1)
+    7680:	ac800010 	sw	zero,16(a0)
+    7684:	0c0044a3 	jal	1128c <sched_wakeup>
+    7688:	01002021 	addu	a0,t0,zero
+    768c:	8fbf0014 	lw	ra,20(sp)
+    7690:	00001021 	addu	v0,zero,zero
+    7694:	03e00008 	jr	ra
+    7698:	27bd0018 	addiu	sp,sp,24
+
+0000769c <manager_alarm_event_handler>:
+    769c:	27bdffe8 	addiu	sp,sp,-24
+    76a0:	afbf0014 	sw	ra,20(sp)
+    76a4:	8c84000c 	lw	a0,12(a0)
+    76a8:	40016000 	mfc0	at,c0_status
+    76ac:	00000000 	sll	zero,zero,0x0
+    76b0:	00011825 	or	v1,zero,at
+    76b4:	00010842 	srl	at,at,0x1
+    76b8:	00010840 	sll	at,at,0x1
+    76bc:	40816000 	mtc0	at,c0_status
+    76c0:	40022002 	mfc0	v0,$4,2
+    76c4:	8c45013c 	lw	a1,316(v0)
+    76c8:	24a50001 	addiu	a1,a1,1
+    76cc:	ac45013c 	sw	a1,316(v0)
+    76d0:	40016000 	mfc0	at,c0_status
+    76d4:	340200ff 	ori	v0,zero,0xff
+    76d8:	00431024 	and	v0,v0,v1
+    76dc:	00220825 	or	at,at,v0
+    76e0:	40816000 	mtc0	at,c0_status
+    76e4:	0c0044a3 	jal	1128c <sched_wakeup>
+    76e8:	00000000 	sll	zero,zero,0x0
+    76ec:	40016000 	mfc0	at,c0_status
+    76f0:	00000000 	sll	zero,zero,0x0
+    76f4:	00011825 	or	v1,zero,at
+    76f8:	00010842 	srl	at,at,0x1
+    76fc:	00010840 	sll	at,at,0x1
+    7700:	40816000 	mtc0	at,c0_status
+    7704:	40022002 	mfc0	v0,$4,2
+    7708:	8c44013c 	lw	a0,316(v0)
+    770c:	2484ffff 	addiu	a0,a0,-1
+    7710:	ac44013c 	sw	a0,316(v0)
+    7714:	40016000 	mfc0	at,c0_status
+    7718:	340200ff 	ori	v0,zero,0xff
+    771c:	00431024 	and	v0,v0,v1
+    7720:	00220825 	or	at,at,v0
+    7724:	40816000 	mtc0	at,c0_status
+    7728:	8fbf0014 	lw	ra,20(sp)
+    772c:	00001021 	addu	v0,zero,zero
+    7730:	03e00008 	jr	ra
+    7734:	27bd0018 	addiu	sp,sp,24
+
+00007738 <cluster_manager_thread>:
+    7738:	27bdff70 	addiu	sp,sp,-144
+    773c:	afbf008c 	sw	ra,140(sp)
+    7740:	afbe0088 	sw	s8,136(sp)
+    7744:	afb70084 	sw	s7,132(sp)
+    7748:	afb60080 	sw	s6,128(sp)
+    774c:	afb5007c 	sw	s5,124(sp)
+    7750:	afb40078 	sw	s4,120(sp)
+    7754:	afb30074 	sw	s3,116(sp)
+    7758:	afb20070 	sw	s2,112(sp)
+    775c:	afb1006c 	sw	s1,108(sp)
+    7760:	afb00068 	sw	s0,104(sp)
+    7764:	40016000 	mfc0	at,c0_status
+    7768:	00000000 	sll	zero,zero,0x0
+    776c:	00011025 	or	v0,zero,at
+    7770:	34210001 	ori	at,at,0x1
+    7774:	40816000 	mtc0	at,c0_status
+    7778:	00000000 	sll	zero,zero,0x0
+    777c:	40122002 	mfc0	s2,$4,2
+    7780:	40037801 	mfc0	v1,$15,1
+    7784:	3c020008 	lui	v0,0x8
+    7788:	8c5626ec 	lw	s6,9964(v0)
+    778c:	30630003 	andi	v1,v1,0x3
+    7790:	8ec202f0 	lw	v0,752(s6)
+    7794:	00031880 	sll	v1,v1,0x2
+    7798:	00829826 	xor	s3,a0,v0
+    779c:	24020002 	addiu	v0,zero,2
+    77a0:	afa2002c 	sw	v0,44(sp)
+    77a4:	3c020004 	lui	v0,0x4
+    77a8:	2442c950 	addiu	v0,v0,-14000
+    77ac:	00621021 	addu	v0,v1,v0
+    77b0:	2e730001 	sltiu	s3,s3,1
+    77b4:	24030004 	addiu	v1,zero,4
+    77b8:	24110001 	addiu	s1,zero,1
+    77bc:	0073880b 	movn	s1,v1,s3
+    77c0:	3c030000 	lui	v1,0x0
+    77c4:	2463769c 	addiu	v1,v1,30364
+    77c8:	8c420000 	lw	v0,0(v0)
+    77cc:	afa30030 	sw	v1,48(sp)
+    77d0:	27a3002c 	addiu	v1,sp,44
+    77d4:	afa3001c 	sw	v1,28(sp)
+    77d8:	afa20064 	sw	v0,100(sp)
+    77dc:	afb20038 	sw	s2,56(sp)
+    77e0:	40016000 	mfc0	at,c0_status
+    77e4:	00000000 	sll	zero,zero,0x0
+    77e8:	00011825 	or	v1,zero,at
+    77ec:	00010842 	srl	at,at,0x1
+    77f0:	00010840 	sll	at,at,0x1
+    77f4:	40816000 	mtc0	at,c0_status
+    77f8:	40022002 	mfc0	v0,$4,2
+    77fc:	8c44013c 	lw	a0,316(v0)
+    7800:	24840001 	addiu	a0,a0,1
+    7804:	ac44013c 	sw	a0,316(v0)
+    7808:	40016000 	mfc0	at,c0_status
+    780c:	340200ff 	ori	v0,zero,0xff
+    7810:	00431024 	and	v0,v0,v1
+    7814:	00220825 	or	at,at,v0
+    7818:	40816000 	mtc0	at,c0_status
+    781c:	3c15cccc 	lui	s5,0xcccc
+    7820:	3c1e0003 	lui	s8,0x3
+    7824:	36b5cccd 	ori	s5,s5,0xcccd
+    7828:	27de4968 	addiu	s8,s8,18792
+    782c:	00008021 	addu	s0,zero,zero
+    7830:	3c170004 	lui	s7,0x4
+    7834:	08001e15 	j	7854 <cluster_manager_thread+0x11c>
+    7838:	27b40018 	addiu	s4,sp,24
+    783c:	02202821 	addu	a1,s1,zero
+    7840:	0c006c2b 	jal	1b0ac <alarm_wait>
+    7844:	02802021 	addu	a0,s4,zero
+    7848:	0c004634 	jal	118d0 <sched_sleep>
+    784c:	02402021 	addu	a0,s2,zero
+    7850:	26100001 	addiu	s0,s0,1
+    7854:	40024800 	mfc0	v0,c0_count
+    7858:	00000000 	sll	zero,zero,0x0
+    785c:	0c0028e8 	jal	a3a0 <dqdt_update>
+    7860:	afa20060 	sw	v0,96(sp)
+    7864:	40024800 	mfc0	v0,c0_count
+    7868:	00000000 	sll	zero,zero,0x0
+    786c:	02150019 	multu	s0,s5
+    7870:	1260fff2 	beqz	s3,783c <cluster_manager_thread+0x104>
+    7874:	00001810 	mfhi	v1
+    7878:	000318c2 	srl	v1,v1,0x3
+    787c:	000320c0 	sll	a0,v1,0x3
+    7880:	00031840 	sll	v1,v1,0x1
+    7884:	00641821 	addu	v1,v1,a0
+    7888:	1603ffec 	bne	s0,v1,783c <cluster_manager_thread+0x104>
+    788c:	8fa50060 	lw	a1,96(sp)
+    7890:	8ee49100 	lw	a0,-28416(s7)
+    7894:	8fa70064 	lw	a3,100(sp)
+    7898:	00451823 	subu	v1,v0,a1
+    789c:	03c03021 	addu	a2,s8,zero
+    78a0:	00002821 	addu	a1,zero,zero
+    78a4:	afa30014 	sw	v1,20(sp)
+    78a8:	0c0009b0 	jal	26c0 <__fprintk>
+    78ac:	afa20010 	sw	v0,16(sp)
+    78b0:	0c002935 	jal	a4d4 <dqdt_print_summary>
+    78b4:	02c02021 	addu	a0,s6,zero
+    78b8:	08001e10 	j	7840 <cluster_manager_thread+0x108>
+    78bc:	02202821 	addu	a1,s1,zero
+
+000078c0 <cluster_in_kernel>:
+    78c0:	27bdffe0 	addiu	sp,sp,-32
+    78c4:	afb10014 	sw	s1,20(sp)
+    78c8:	3c110004 	lui	s1,0x4
+    78cc:	26316db0 	addiu	s1,s1,28080
+    78d0:	8e220408 	lw	v0,1032(s1)
+    78d4:	afb20018 	sw	s2,24(sp)
+    78d8:	afbf001c 	sw	ra,28(sp)
+    78dc:	afb00010 	sw	s0,16(sp)
+    78e0:	10400013 	beqz	v0,7930 <cluster_in_kernel+0x70>
+    78e4:	3092ffff 	andi	s2,a0,0xffff
+    78e8:	08001e40 	j	7900 <cluster_in_kernel+0x40>
+    78ec:	00008021 	addu	s0,zero,zero
+    78f0:	8e220408 	lw	v0,1032(s1)
+    78f4:	0202102b 	sltu	v0,s0,v0
+    78f8:	1040000f 	beqz	v0,7938 <cluster_in_kernel+0x78>
+    78fc:	00001021 	addu	v0,zero,zero
+    7900:	02002821 	addu	a1,s0,zero
+    7904:	02402021 	addu	a0,s2,zero
+    7908:	0c002048 	jal	8120 <__cpu_in_kernel>
+    790c:	26100001 	addiu	s0,s0,1
+    7910:	1040fff7 	beqz	v0,78f0 <cluster_in_kernel+0x30>
+    7914:	8fbf001c 	lw	ra,28(sp)
+    7918:	24020001 	addiu	v0,zero,1
+    791c:	8fb20018 	lw	s2,24(sp)
+    7920:	8fb10014 	lw	s1,20(sp)
+    7924:	8fb00010 	lw	s0,16(sp)
+    7928:	03e00008 	jr	ra
+    792c:	27bd0020 	addiu	sp,sp,32
+    7930:	8fbf001c 	lw	ra,28(sp)
+    7934:	00001021 	addu	v0,zero,zero
+    7938:	8fb20018 	lw	s2,24(sp)
+    793c:	8fb10014 	lw	s1,20(sp)
+    7940:	8fb00010 	lw	s0,16(sp)
+    7944:	03e00008 	jr	ra
+    7948:	27bd0020 	addiu	sp,sp,32
+
+0000794c <cluster_init>:
+    794c:	27bdffa8 	addiu	sp,sp,-88
+    7950:	afbe0050 	sw	s8,80(sp)
+    7954:	afb7004c 	sw	s7,76(sp)
+    7958:	afb60048 	sw	s6,72(sp)
+    795c:	afb40040 	sw	s4,64(sp)
+    7960:	afbf0054 	sw	ra,84(sp)
+    7964:	afb50044 	sw	s5,68(sp)
+    7968:	afb3003c 	sw	s3,60(sp)
+    796c:	afb20038 	sw	s2,56(sp)
+    7970:	afb10034 	sw	s1,52(sp)
+    7974:	afb00030 	sw	s0,48(sp)
+    7978:	8c940058 	lw	s4,88(a0)
+    797c:	0080f021 	addu	s8,a0,zero
+    7980:	00c0b021 	addu	s6,a2,zero
+    7984:	00e0b821 	addu	s7,a3,zero
+    7988:	40122002 	mfc0	s2,$4,2
+    798c:	8c830054 	lw	v1,84(a0)
+    7990:	3c110004 	lui	s1,0x4
+    7994:	00032180 	sll	a0,v1,0x6
+    7998:	00031280 	sll	v0,v1,0xa
+    799c:	00821021 	addu	v0,a0,v0
+    79a0:	00028140 	sll	s0,v0,0x5
+    79a4:	02021023 	subu	v0,s0,v0
+    79a8:	263171f0 	addiu	s1,s1,29168
+    79ac:	02228021 	addu	s0,s1,v0
+    79b0:	3c150004 	lui	s5,0x4
+    79b4:	3c020001 	lui	v0,0x1
+    79b8:	26b36db0 	addiu	s3,s5,28080
+    79bc:	02021021 	addu	v0,s0,v0
+    79c0:	ae500174 	sw	s0,372(s2)
+    79c4:	a6540150 	sh	s4,336(s2)
+    79c8:	ac538328 	sw	s3,-31960(v0)
+    79cc:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    79d0:	afa30028 	sw	v1,40(sp)
+    79d4:	70542002 	mul	a0,v0,s4
+    79d8:	8fa30028 	lw	v1,40(sp)
+    79dc:	00831021 	addu	v0,a0,v1
+    79e0:	ae420154 	sw	v0,340(s2)
+    79e4:	ae740400 	sw	s4,1024(s3)
+    79e8:	8fc2004c 	lw	v0,76(s8)
+    79ec:	00141940 	sll	v1,s4,0x5
+    79f0:	ae620404 	sw	v0,1028(s3)
+    79f4:	8fc20050 	lw	v0,80(s8)
+    79f8:	00142080 	sll	a0,s4,0x2
+    79fc:	ae620408 	sw	v0,1032(s3)
+    7a00:	8fc2005c 	lw	v0,92(s8)
+    7a04:	00832021 	addu	a0,a0,v1
+    7a08:	ae620418 	sw	v0,1048(s3)
+    7a0c:	8fc20068 	lw	v0,104(s8)
+    7a10:	00942021 	addu	a0,a0,s4
+    7a14:	3c030004 	lui	v1,0x4
+    7a18:	00042080 	sll	a0,a0,0x2
+    7a1c:	ae620414 	sw	v0,1044(s3)
+    7a20:	2463d9a0 	addiu	v1,v1,-9824
+    7a24:	00641821 	addu	v1,v1,a0
+    7a28:	8fc2003c 	lw	v0,60(s8)
+    7a2c:	3c040003 	lui	a0,0x3
+    7a30:	02642021 	addu	a0,s3,a0
+    7a34:	ac909528 	sw	s0,-27352(a0)
+    7a38:	1040000f 	beqz	v0,7a78 <cluster_init+0x12c>
+    7a3c:	ae630434 	sw	v1,1076(s3)
+    7a40:	00021940 	sll	v1,v0,0x5
+    7a44:	00023080 	sll	a2,v0,0x2
+    7a48:	00c33021 	addu	a2,a2,v1
+    7a4c:	00c23021 	addu	a2,a2,v0
+    7a50:	3c030004 	lui	v1,0x4
+    7a54:	2463d9a8 	addiu	v1,v1,-9816
+    7a58:	00063080 	sll	a2,a2,0x2
+    7a5c:	00663021 	addu	a2,v1,a2
+    7a60:	00001021 	addu	v0,zero,zero
+    7a64:	8c650000 	lw	a1,0(v1)
+    7a68:	24440001 	addiu	a0,v0,1
+    7a6c:	24630094 	addiu	v1,v1,148
+    7a70:	1466fffc 	bne	v1,a2,7a64 <cluster_init+0x118>
+    7a74:	0085100b 	movn	v0,a0,a1
+    7a78:	3c050003 	lui	a1,0x3
+    7a7c:	ae620410 	sw	v0,1040(s3)
+    7a80:	24a54998 	addiu	a1,a1,18840
+    7a84:	0c004a24 	jal	12890 <spinlock_init>
+    7a88:	02602021 	addu	a0,s3,zero
+    7a8c:	3c040004 	lui	a0,0x4
+    7a90:	24846dc0 	addiu	a0,a0,28096
+    7a94:	0c00199f 	jal	667c <atomic_init>
+    7a98:	00002821 	addu	a1,zero,zero
+    7a9c:	3c040004 	lui	a0,0x4
+    7aa0:	24846e00 	addiu	a0,a0,28160
+    7aa4:	0c00199f 	jal	667c <atomic_init>
+    7aa8:	00002821 	addu	a1,zero,zero
+    7aac:	3c040004 	lui	a0,0x4
+    7ab0:	24846e40 	addiu	a0,a0,28224
+    7ab4:	00002821 	addu	a1,zero,zero
+    7ab8:	0c00c182 	jal	30608 <memset>
+    7abc:	24060014 	addiu	a2,zero,20
+    7ac0:	3c040004 	lui	a0,0x4
+    7ac4:	24847120 	addiu	a0,a0,28960
+    7ac8:	00002821 	addu	a1,zero,zero
+    7acc:	0c00c182 	jal	30608 <memset>
+    7ad0:	2406008c 	addiu	a2,zero,140
+    7ad4:	3c020008 	lui	v0,0x8
+    7ad8:	24423000 	addiu	v0,v0,12288
+    7adc:	2404001b 	addiu	a0,zero,27
+    7ae0:	30430fff 	andi	v1,v0,0xfff
+    7ae4:	10600004 	beqz	v1,7af8 <cluster_init+0x1ac>
+    7ae8:	ae6403fc 	sw	a0,1020(s3)
+    7aec:	2403f000 	addiu	v1,zero,-4096
+    7af0:	00431024 	and	v0,v0,v1
+    7af4:	24421000 	addiu	v0,v0,4096
+    7af8:	3c100008 	lui	s0,0x8
+    7afc:	00508021 	addu	s0,v0,s0
+    7b00:	3c040004 	lui	a0,0x4
+    7b04:	00402821 	addu	a1,v0,zero
+    7b08:	248470f0 	addiu	a0,a0,28912
+    7b0c:	00403021 	addu	a2,v0,zero
+    7b10:	0c006e3b 	jal	1b8ec <heap_manager_init>
+    7b14:	02003821 	addu	a3,s0,zero
+    7b18:	8fa20068 	lw	v0,104(sp)
+    7b1c:	8fa3006c 	lw	v1,108(sp)
+    7b20:	afa20010 	sw	v0,16(sp)
+    7b24:	3c040004 	lui	a0,0x4
+    7b28:	8fa20070 	lw	v0,112(sp)
+    7b2c:	02c03021 	addu	a2,s6,zero
+    7b30:	02e03821 	addu	a3,s7,zero
+    7b34:	24846e60 	addiu	a0,a0,28256
+    7b38:	afa30014 	sw	v1,20(sp)
+    7b3c:	afa20018 	sw	v0,24(sp)
+    7b40:	afb0001c 	sw	s0,28(sp)
+    7b44:	0c007e29 	jal	1f8a4 <ppm_init>
+    7b48:	afbe0020 	sw	s8,32(sp)
+    7b4c:	3c030002 	lui	v1,0x2
+    7b50:	2463bc88 	addiu	v1,v1,-17272
+    7b54:	afa30020 	sw	v1,32(sp)
+    7b58:	3c040004 	lui	a0,0x4
+    7b5c:	3c050003 	lui	a1,0x3
+    7b60:	3c030002 	lui	v1,0x2
+    7b64:	24020001 	addiu	v0,zero,1
+    7b68:	2463bc80 	addiu	v1,v1,-17280
+    7b6c:	24847080 	addiu	a0,a0,28800
+    7b70:	24a549a0 	addiu	a1,a1,18848
+    7b74:	24060070 	addiu	a2,zero,112
+    7b78:	00003821 	addu	a3,zero,zero
+    7b7c:	afa20014 	sw	v0,20(sp)
+    7b80:	afa30024 	sw	v1,36(sp)
+    7b84:	afa20010 	sw	v0,16(sp)
+    7b88:	afa00018 	sw	zero,24(sp)
+    7b8c:	0c007068 	jal	1c1a0 <kcm_init>
+    7b90:	afa0001c 	sw	zero,28(sp)
+    7b94:	8e620404 	lw	v0,1028(s3)
+    7b98:	10400023 	beqz	v0,7c28 <cluster_init+0x2dc>
+    7b9c:	3c120004 	lui	s2,0x4
+    7ba0:	26526da0 	addiu	s2,s2,28064
+    7ba4:	26b56db0 	addiu	s5,s5,28080
+    7ba8:	00008021 	addu	s0,zero,zero
+    7bac:	24170001 	addiu	s7,zero,1
+    7bb0:	08001ef3 	j	7bcc <cluster_init+0x280>
+    7bb4:	341683c0 	ori	s6,zero,0x83c0
+    7bb8:	8e620404 	lw	v0,1028(s3)
+    7bbc:	ae570000 	sw	s7,0(s2)
+    7bc0:	0202102b 	sltu	v0,s0,v0
+    7bc4:	10400018 	beqz	v0,7c28 <cluster_init+0x2dc>
+    7bc8:	26520004 	addiu	s2,s2,4
+    7bcc:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    7bd0:	00000000 	sll	zero,zero,0x0
+    7bd4:	70541802 	mul	v1,v0,s4
+    7bd8:	02003021 	addu	a2,s0,zero
+    7bdc:	00703821 	addu	a3,v1,s0
+    7be0:	02202021 	addu	a0,s1,zero
+    7be4:	02a02821 	addu	a1,s5,zero
+    7be8:	0c0020df 	jal	837c <cpu_init>
+    7bec:	26100001 	addiu	s0,s0,1
+    7bf0:	1040fff1 	beqz	v0,7bb8 <cluster_init+0x26c>
+    7bf4:	02368821 	addu	s1,s1,s6
+    7bf8:	8fbf0054 	lw	ra,84(sp)
+    7bfc:	8fbe0050 	lw	s8,80(sp)
+    7c00:	8fb7004c 	lw	s7,76(sp)
+    7c04:	8fb60048 	lw	s6,72(sp)
+    7c08:	8fb50044 	lw	s5,68(sp)
+    7c0c:	8fb40040 	lw	s4,64(sp)
+    7c10:	8fb3003c 	lw	s3,60(sp)
+    7c14:	8fb20038 	lw	s2,56(sp)
+    7c18:	8fb10034 	lw	s1,52(sp)
+    7c1c:	8fb00030 	lw	s0,48(sp)
+    7c20:	03e00008 	jr	ra
+    7c24:	27bd0058 	addiu	sp,sp,88
+    7c28:	3c040007 	lui	a0,0x7
+    7c2c:	0c003d19 	jal	f464 <rpc_listner_init>
+    7c30:	248480f8 	addiu	a0,a0,-32520
+    7c34:	8fc30054 	lw	v1,84(s8)
+    7c38:	8fbf0054 	lw	ra,84(sp)
+    7c3c:	00031280 	sll	v0,v1,0xa
+    7c40:	00031980 	sll	v1,v1,0x6
+    7c44:	00621021 	addu	v0,v1,v0
+    7c48:	00021940 	sll	v1,v0,0x5
+    7c4c:	00621023 	subu	v0,v1,v0
+    7c50:	3c030002 	lui	v1,0x2
+    7c54:	02621021 	addu	v0,s3,v0
+    7c58:	02639821 	addu	s3,s3,v1
+    7c5c:	3c030001 	lui	v1,0x1
+    7c60:	00621021 	addu	v0,v1,v0
+    7c64:	ac408778 	sw	zero,-30856(v0)
+    7c68:	ae601344 	sw	zero,4932(s3)
+    7c6c:	ae601340 	sw	zero,4928(s3)
+    7c70:	00001021 	addu	v0,zero,zero
+    7c74:	8fbe0050 	lw	s8,80(sp)
+    7c78:	8fb7004c 	lw	s7,76(sp)
+    7c7c:	8fb60048 	lw	s6,72(sp)
+    7c80:	8fb50044 	lw	s5,68(sp)
+    7c84:	8fb40040 	lw	s4,64(sp)
+    7c88:	8fb3003c 	lw	s3,60(sp)
+    7c8c:	8fb20038 	lw	s2,56(sp)
+    7c90:	8fb10034 	lw	s1,52(sp)
+    7c94:	8fb00030 	lw	s0,48(sp)
+    7c98:	03e00008 	jr	ra
+    7c9c:	27bd0058 	addiu	sp,sp,88
+
+00007ca0 <cluster_entry_init>:
+    7ca0:	27bdffe0 	addiu	sp,sp,-32
+    7ca4:	afb00014 	sw	s0,20(sp)
+    7ca8:	00041940 	sll	v1,a0,0x5
+    7cac:	00048080 	sll	s0,a0,0x2
+    7cb0:	02031821 	addu	v1,s0,v1
+    7cb4:	00641821 	addu	v1,v1,a0
+    7cb8:	3c100004 	lui	s0,0x4
+    7cbc:	00031880 	sll	v1,v1,0x2
+    7cc0:	2610d9a0 	addiu	s0,s0,-9824
+    7cc4:	02038021 	addu	s0,s0,v1
+    7cc8:	26030010 	addiu	v1,s0,16
+    7ccc:	00801021 	addu	v0,a0,zero
+    7cd0:	afb10018 	sw	s1,24(sp)
+    7cd4:	ae050004 	sw	a1,4(s0)
+    7cd8:	26110018 	addiu	s1,s0,24
+    7cdc:	3c050003 	lui	a1,0x3
+    7ce0:	ae060008 	sw	a2,8(s0)
+    7ce4:	24a549a4 	addiu	a1,a1,18852
+    7ce8:	00803021 	addu	a2,a0,zero
+    7cec:	ae030014 	sw	v1,20(s0)
+    7cf0:	ae030010 	sw	v1,16(s0)
+    7cf4:	ae020000 	sw	v0,0(s0)
+    7cf8:	afbf001c 	sw	ra,28(sp)
+    7cfc:	0c00c414 	jal	31050 <sprintk>
+    7d00:	02202021 	addu	a0,s1,zero
+    7d04:	ae110034 	sw	s1,52(s0)
+    7d08:	ae000038 	sw	zero,56(s0)
+    7d0c:	02001821 	addu	v1,s0,zero
+    7d10:	00001021 	addu	v0,zero,zero
+    7d14:	2405000a 	addiu	a1,zero,10
+    7d18:	24440008 	addiu	a0,v0,8
+    7d1c:	000420c0 	sll	a0,a0,0x3
+    7d20:	02042021 	addu	a0,s0,a0
+    7d24:	24840004 	addiu	a0,a0,4
+    7d28:	24420001 	addiu	v0,v0,1
+    7d2c:	ac640048 	sw	a0,72(v1)
+    7d30:	ac640044 	sw	a0,68(v1)
+    7d34:	1445fff8 	bne	v0,a1,7d18 <cluster_entry_init+0x78>
+    7d38:	24630008 	addiu	v1,v1,8
+    7d3c:	8fbf001c 	lw	ra,28(sp)
+    7d40:	8fb10018 	lw	s1,24(sp)
+    7d44:	8fb00014 	lw	s0,20(sp)
+    7d48:	03e00008 	jr	ra
+    7d4c:	27bd0020 	addiu	sp,sp,32
+
+00007d50 <cv_destroy>:
+    7d50:	27bdffe0 	addiu	sp,sp,-32
+    7d54:	afb00018 	sw	s0,24(sp)
+    7d58:	afbf001c 	sw	ra,28(sp)
+    7d5c:	0c004bc3 	jal	12f0c <spinlock_lock>
+    7d60:	00808021 	addu	s0,a0,zero
+    7d64:	8e03001c 	lw	v1,28(s0)
+    7d68:	2602001c 	addiu	v0,s0,28
+    7d6c:	00621826 	xor	v1,v1,v0
+    7d70:	24020010 	addiu	v0,zero,16
+    7d74:	0003100a 	movz	v0,zero,v1
+    7d78:	02002021 	addu	a0,s0,zero
+    7d7c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    7d80:	afa20010 	sw	v0,16(sp)
+    7d84:	8fbf001c 	lw	ra,28(sp)
+    7d88:	8fa20010 	lw	v0,16(sp)
+    7d8c:	8fb00018 	lw	s0,24(sp)
+    7d90:	03e00008 	jr	ra
+    7d94:	27bd0020 	addiu	sp,sp,32
+
+00007d98 <cv_broadcast>:
+    7d98:	27bdffe8 	addiu	sp,sp,-24
+    7d9c:	afb00010 	sw	s0,16(sp)
+    7da0:	afbf0014 	sw	ra,20(sp)
+    7da4:	0c004bc3 	jal	12f0c <spinlock_lock>
+    7da8:	00808021 	addu	s0,a0,zero
+    7dac:	0c006d29 	jal	1b4a4 <wakeup_all>
+    7db0:	26040014 	addiu	a0,s0,20
+    7db4:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    7db8:	02002021 	addu	a0,s0,zero
+    7dbc:	8fbf0014 	lw	ra,20(sp)
+    7dc0:	00001021 	addu	v0,zero,zero
+    7dc4:	8fb00010 	lw	s0,16(sp)
+    7dc8:	03e00008 	jr	ra
+    7dcc:	27bd0018 	addiu	sp,sp,24
+
+00007dd0 <cv_signal>:
+    7dd0:	27bdffe8 	addiu	sp,sp,-24
+    7dd4:	afb00010 	sw	s0,16(sp)
+    7dd8:	afbf0014 	sw	ra,20(sp)
+    7ddc:	0c004bc3 	jal	12f0c <spinlock_lock>
+    7de0:	00808021 	addu	s0,a0,zero
+    7de4:	26040014 	addiu	a0,s0,20
+    7de8:	0c006d56 	jal	1b558 <wakeup_one>
+    7dec:	00002821 	addu	a1,zero,zero
+    7df0:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    7df4:	02002021 	addu	a0,s0,zero
+    7df8:	8fbf0014 	lw	ra,20(sp)
+    7dfc:	00001021 	addu	v0,zero,zero
+    7e00:	8fb00010 	lw	s0,16(sp)
+    7e04:	03e00008 	jr	ra
+    7e08:	27bd0018 	addiu	sp,sp,24
+
+00007e0c <cv_wait>:
+    7e0c:	27bdffc8 	addiu	sp,sp,-56
+    7e10:	afb20030 	sw	s2,48(sp)
+    7e14:	afb00028 	sw	s0,40(sp)
+    7e18:	afbf0034 	sw	ra,52(sp)
+    7e1c:	afb1002c 	sw	s1,44(sp)
+    7e20:	00809021 	addu	s2,a0,zero
+    7e24:	00a08021 	addu	s0,a1,zero
+    7e28:	40112002 	mfc0	s1,$4,2
+    7e2c:	00a02021 	addu	a0,a1,zero
+    7e30:	0c004780 	jal	11e00 <sem_getvalue>
+    7e34:	27a50018 	addiu	a1,sp,24
+    7e38:	8e020020 	lw	v0,32(s0)
+    7e3c:	10510017 	beq	v0,s1,7e9c <cv_wait+0x90>
+    7e40:	8fa20018 	lw	v0,24(sp)
+    7e44:	8e03001c 	lw	v1,28(s0)
+    7e48:	24020001 	addiu	v0,zero,1
+    7e4c:	10620008 	beq	v1,v0,7e70 <cv_wait+0x64>
+    7e50:	3c020004 	lui	v0,0x4
+    7e54:	24020016 	addiu	v0,zero,22
+    7e58:	8fbf0034 	lw	ra,52(sp)
+    7e5c:	8fb20030 	lw	s2,48(sp)
+    7e60:	8fb1002c 	lw	s1,44(sp)
+    7e64:	8fb00028 	lw	s0,40(sp)
+    7e68:	03e00008 	jr	ra
+    7e6c:	27bd0038 	addiu	sp,sp,56
+    7e70:	8c449100 	lw	a0,-28416(v0)
+    7e74:	3c060003 	lui	a2,0x3
+    7e78:	8fa20018 	lw	v0,24(sp)
+    7e7c:	24c649ac 	addiu	a2,a2,18860
+    7e80:	02203821 	addu	a3,s1,zero
+    7e84:	00002821 	addu	a1,zero,zero
+    7e88:	afb00010 	sw	s0,16(sp)
+    7e8c:	0c0009b0 	jal	26c0 <__fprintk>
+    7e90:	afa20014 	sw	v0,20(sp)
+    7e94:	08001f96 	j	7e58 <cv_wait+0x4c>
+    7e98:	24020016 	addiu	v0,zero,22
+    7e9c:	1c40ffe9 	bgtz	v0,7e44 <cv_wait+0x38>
+    7ea0:	00000000 	sll	zero,zero,0x0
+    7ea4:	0c004bc3 	jal	12f0c <spinlock_lock>
+    7ea8:	02402021 	addu	a0,s2,zero
+    7eac:	0c0047d0 	jal	11f40 <sem_post>
+    7eb0:	02002021 	addu	a0,s0,zero
+    7eb4:	1440000d 	bnez	v0,7eec <cv_wait+0xe0>
+    7eb8:	00000000 	sll	zero,zero,0x0
+    7ebc:	24050001 	addiu	a1,zero,1
+    7ec0:	0c006d13 	jal	1b44c <wait_on>
+    7ec4:	26440014 	addiu	a0,s2,20
+    7ec8:	0c004b07 	jal	12c1c <spinlock_unlock_nosched>
+    7ecc:	02402021 	addu	a0,s2,zero
+    7ed0:	40042002 	mfc0	a0,$4,2
+    7ed4:	0c004634 	jal	118d0 <sched_sleep>
+    7ed8:	00000000 	sll	zero,zero,0x0
+    7edc:	0c004805 	jal	12014 <sem_wait>
+    7ee0:	02002021 	addu	a0,s0,zero
+    7ee4:	08001f97 	j	7e5c <cv_wait+0x50>
+    7ee8:	8fbf0034 	lw	ra,52(sp)
+    7eec:	02402021 	addu	a0,s2,zero
+    7ef0:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    7ef4:	afa20020 	sw	v0,32(sp)
+    7ef8:	08001f96 	j	7e58 <cv_wait+0x4c>
+    7efc:	8fa20020 	lw	v0,32(sp)
+
+00007f00 <cv_init>:
+    7f00:	3c050003 	lui	a1,0x3
+    7f04:	27bdffe8 	addiu	sp,sp,-24
+    7f08:	24a549f4 	addiu	a1,a1,18932
+    7f0c:	afbf0014 	sw	ra,20(sp)
+    7f10:	afb00010 	sw	s0,16(sp)
+    7f14:	0c004a24 	jal	12890 <spinlock_init>
+    7f18:	00808021 	addu	s0,a0,zero
+    7f1c:	3c03b1ca 	lui	v1,0xb1ca
+    7f20:	34630ba5 	ori	v1,v1,0xba5
+    7f24:	ae030010 	sw	v1,16(s0)
+    7f28:	8fbf0014 	lw	ra,20(sp)
+    7f2c:	3c030003 	lui	v1,0x3
+    7f30:	2602001c 	addiu	v0,s0,28
+    7f34:	24634a04 	addiu	v1,v1,18948
+    7f38:	ae020020 	sw	v0,32(s0)
+    7f3c:	ae02001c 	sw	v0,28(s0)
+    7f40:	ae030014 	sw	v1,20(s0)
+    7f44:	ae000018 	sw	zero,24(s0)
+    7f48:	00001021 	addu	v0,zero,zero
+    7f4c:	8fb00010 	lw	s0,16(sp)
+    7f50:	03e00008 	jr	ra
+    7f54:	27bd0018 	addiu	sp,sp,24
+
+00007f58 <cpu_compute_stats>:
+    7f58:	8c820040 	lw	v0,64(a0)
+    7f5c:	3c030001 	lui	v1,0x1
+    7f60:	00831821 	addu	v1,a0,v1
+    7f64:	0045282a 	slt	a1,v0,a1
+    7f68:	14a00018 	bnez	a1,7fcc <cpu_compute_stats+0x74>
+    7f6c:	8c638320 	lw	v1,-31968(v1)
+    7f70:	8c660148 	lw	a2,328(v1)
+    7f74:	00063900 	sll	a3,a2,0x4
+    7f78:	00062880 	sll	a1,a2,0x2
+    7f7c:	00a72821 	addu	a1,a1,a3
+    7f80:	00053080 	sll	a2,a1,0x2
+    7f84:	24070001 	addiu	a3,zero,1
+    7f88:	00e2100a 	movz	v0,a3,v0
+    7f8c:	00a62821 	addu	a1,a1,a2
+    7f90:	00a2001b 	divu	zero,a1,v0
+    7f94:	004001f4 	teq	v0,zero,0x7
+    7f98:	24060064 	addiu	a2,zero,100
+    7f9c:	8c850044 	lw	a1,68(a0)
+    7fa0:	00052842 	srl	a1,a1,0x1
+    7fa4:	00001012 	mflo	v0
+    7fa8:	2c470065 	sltiu	a3,v0,101
+    7fac:	00c7100a 	movz	v0,a2,a3
+    7fb0:	00c21023 	subu	v0,a2,v0
+    7fb4:	00452821 	addu	a1,v0,a1
+    7fb8:	ac850044 	sw	a1,68(a0)
+    7fbc:	ac820048 	sw	v0,72(a0)
+    7fc0:	0000000f 	sync
+    7fc4:	ac800040 	sw	zero,64(a0)
+    7fc8:	ac600148 	sw	zero,328(v1)
+    7fcc:	03e00008 	jr	ra
+    7fd0:	00000000 	sll	zero,zero,0x0
+
+00007fd4 <cpu_get_ms>:
+    7fd4:	40022002 	mfc0	v0,$4,2
+    7fd8:	8c420174 	lw	v0,372(v0)
+    7fdc:	03e00008 	jr	ra
+    7fe0:	8c420034 	lw	v0,52(v0)
+
+00007fe4 <cpu_get_time>:
+    7fe4:	40034800 	mfc0	v1,c0_count
+    7fe8:	00000000 	sll	zero,zero,0x0
+    7fec:	3c02431b 	lui	v0,0x431b
+    7ff0:	3442de83 	ori	v0,v0,0xde83
+    7ff4:	00620019 	multu	v1,v0
+    7ff8:	3c04000f 	lui	a0,0xf
+    7ffc:	00001010 	mfhi	v0
+    8000:	34844240 	ori	a0,a0,0x4240
+    8004:	00021482 	srl	v0,v0,0x12
+    8008:	70443802 	mul	a3,v0,a0
+    800c:	3c041062 	lui	a0,0x1062
+    8010:	00671823 	subu	v1,v1,a3
+    8014:	34844dd3 	ori	a0,a0,0x4dd3
+    8018:	00640019 	multu	v1,a0
+    801c:	aca20000 	sw	v0,0(a1)
+    8020:	00001810 	mfhi	v1
+    8024:	00031982 	srl	v1,v1,0x6
+    8028:	03e00008 	jr	ra
+    802c:	acc30000 	sw	v1,0(a2)
+
+00008030 <cpu_time_reset>:
+    8030:	8c860028 	lw	a2,40(a0)
+    8034:	8c85002c 	lw	a1,44(a0)
+    8038:	8c820030 	lw	v0,48(a0)
+    803c:	40034800 	mfc0	v1,c0_count
+    8040:	00000000 	sll	zero,zero,0x0
+    8044:	0062382b 	sltu	a3,v1,v0
+    8048:	14e0001a 	bnez	a3,80b4 <cpu_time_reset+0x84>
+    804c:	00000000 	sll	zero,zero,0x0
+    8050:	00621023 	subu	v0,v1,v0
+    8054:	8c870038 	lw	a3,56(a0)
+    8058:	00463021 	addu	a2,v0,a2
+    805c:	0047001b 	divu	zero,v0,a3
+    8060:	00e001f4 	teq	a3,zero,0x7
+    8064:	3c080001 	lui	t0,0x1
+    8068:	00c2102b 	sltu	v0,a2,v0
+    806c:	8c870034 	lw	a3,52(a0)
+    8070:	00452821 	addu	a1,v0,a1
+    8074:	00884021 	addu	t0,a0,t0
+    8078:	8d088320 	lw	t0,-31968(t0)
+    807c:	ac830030 	sw	v1,48(a0)
+    8080:	ac800040 	sw	zero,64(a0)
+    8084:	ac800044 	sw	zero,68(a0)
+    8088:	ac800048 	sw	zero,72(a0)
+    808c:	ac860028 	sw	a2,40(a0)
+    8090:	ac85002c 	sw	a1,44(a0)
+    8094:	00001012 	mflo	v0
+    8098:	00e23821 	addu	a3,a3,v0
+    809c:	24020064 	addiu	v0,zero,100
+    80a0:	ac870034 	sw	a3,52(a0)
+    80a4:	ad020148 	sw	v0,328(t0)
+    80a8:	0000000f 	sync
+    80ac:	03e00008 	jr	ra
+    80b0:	00000000 	sll	zero,zero,0x0
+    80b4:	00021027 	nor	v0,zero,v0
+    80b8:	08002015 	j	8054 <cpu_time_reset+0x24>
+    80bc:	00621021 	addu	v0,v1,v0
+
+000080c0 <cpu_ipi_notify>:
+    80c0:	03e00008 	jr	ra
+    80c4:	00000000 	sll	zero,zero,0x0
+
+000080c8 <cpu_kentry>:
+    80c8:	8ca20130 	lw	v0,304(a1)
+    80cc:	24030001 	addiu	v1,zero,1
+    80d0:	10430003 	beq	v0,v1,80e0 <cpu_kentry+0x18>
+    80d4:	3c030004 	lui	v1,0x4
+    80d8:	03e00008 	jr	ra
+    80dc:	00000000 	sll	zero,zero,0x0
+    80e0:	00042080 	sll	a0,a0,0x2
+    80e4:	24636da0 	addiu	v1,v1,28064
+    80e8:	00642021 	addu	a0,v1,a0
+    80ec:	03e00008 	jr	ra
+    80f0:	ac820000 	sw	v0,0(a0)
+
+000080f4 <cpu_kexit>:
+    80f4:	8ca20130 	lw	v0,304(a1)
+    80f8:	24030001 	addiu	v1,zero,1
+    80fc:	10430003 	beq	v0,v1,810c <cpu_kexit+0x18>
+    8100:	3c020004 	lui	v0,0x4
+    8104:	03e00008 	jr	ra
+    8108:	00000000 	sll	zero,zero,0x0
+    810c:	00042080 	sll	a0,a0,0x2
+    8110:	24426da0 	addiu	v0,v0,28064
+    8114:	00442021 	addu	a0,v0,a0
+    8118:	03e00008 	jr	ra
+    811c:	ac800000 	sw	zero,0(a0)
+
+00008120 <__cpu_in_kernel>:
+    8120:	3084ffff 	andi	a0,a0,0xffff
+    8124:	2c820101 	sltiu	v0,a0,257
+    8128:	14400003 	bnez	v0,8138 <__cpu_in_kernel+0x18>
+    812c:	00041100 	sll	v0,a0,0x4
+    8130:	0800204c 	j	8130 <__cpu_in_kernel+0x10>
+    8134:	00000000 	sll	zero,zero,0x0
+    8138:	00042080 	sll	a0,a0,0x2
+    813c:	00442023 	subu	a0,v0,a0
+    8140:	3c020004 	lui	v0,0x4
+    8144:	2442c9a0 	addiu	v0,v0,-13920
+    8148:	00441021 	addu	v0,v0,a0
+    814c:	3c035555 	lui	v1,0x5555
+    8150:	8c420000 	lw	v0,0(v0)
+    8154:	34635555 	ori	v1,v1,0x5555
+    8158:	1043fff5 	beq	v0,v1,8130 <__cpu_in_kernel+0x10>
+    815c:	3c030004 	lui	v1,0x4
+    8160:	00052880 	sll	a1,a1,0x2
+    8164:	24636da0 	addiu	v1,v1,28064
+    8168:	00651821 	addu	v1,v1,a1
+    816c:	4808c000 	mfc2	t0,$24
+    8170:	4882c000 	mtc2	v0,$24
+    8174:	8c620000 	lw	v0,0(v1)
+    8178:	4888c000 	mtc2	t0,$24
+    817c:	03e00008 	jr	ra
+    8180:	0002102b 	sltu	v0,zero,v0
+
+00008184 <cpu_in_kernel>:
+    8184:	3084ffff 	andi	a0,a0,0xffff
+    8188:	2c820101 	sltiu	v0,a0,257
+    818c:	14400003 	bnez	v0,819c <cpu_in_kernel+0x18>
+    8190:	00041100 	sll	v0,a0,0x4
+    8194:	08002065 	j	8194 <cpu_in_kernel+0x10>
+    8198:	00000000 	sll	zero,zero,0x0
+    819c:	00042080 	sll	a0,a0,0x2
+    81a0:	00442023 	subu	a0,v0,a0
+    81a4:	3c020004 	lui	v0,0x4
+    81a8:	2442c9a0 	addiu	v0,v0,-13920
+    81ac:	00441021 	addu	v0,v0,a0
+    81b0:	3c035555 	lui	v1,0x5555
+    81b4:	8c420000 	lw	v0,0(v0)
+    81b8:	34635555 	ori	v1,v1,0x5555
+    81bc:	1043fff5 	beq	v0,v1,8194 <cpu_in_kernel+0x10>
+    81c0:	3c030004 	lui	v1,0x4
+    81c4:	00052880 	sll	a1,a1,0x2
+    81c8:	24636da0 	addiu	v1,v1,28064
+    81cc:	00651821 	addu	v1,v1,a1
+    81d0:	4808c000 	mfc2	t0,$24
+    81d4:	4882c000 	mtc2	v0,$24
+    81d8:	8c620000 	lw	v0,0(v1)
+    81dc:	4888c000 	mtc2	t0,$24
+    81e0:	03e00008 	jr	ra
+    81e4:	0002102b 	sltu	v0,zero,v0
+
+000081e8 <cpu_lid2ptr>:
+    81e8:	00041280 	sll	v0,a0,0xa
+    81ec:	00042180 	sll	a0,a0,0x6
+    81f0:	00822021 	addu	a0,a0,v0
+    81f4:	00041140 	sll	v0,a0,0x5
+    81f8:	00442023 	subu	a0,v0,a0
+    81fc:	3c020004 	lui	v0,0x4
+    8200:	244271f0 	addiu	v0,v0,29168
+    8204:	03e00008 	jr	ra
+    8208:	00441021 	addu	v0,v0,a0
+
+0000820c <__cpu_check_sched>:
+    820c:	27bdffe8 	addiu	sp,sp,-24
+    8210:	afbf0014 	sw	ra,20(sp)
+    8214:	afb00010 	sw	s0,16(sp)
+    8218:	40034800 	mfc0	v1,c0_count
+    821c:	00000000 	sll	zero,zero,0x0
+    8220:	8c82013c 	lw	v0,316(a0)
+    8224:	14400007 	bnez	v0,8244 <__cpu_check_sched+0x38>
+    8228:	ac83014c 	sw	v1,332(a0)
+    822c:	8c820140 	lw	v0,320(a0)
+    8230:	14400005 	bnez	v0,8248 <__cpu_check_sched+0x3c>
+    8234:	00001021 	addu	v0,zero,zero
+    8238:	8c82028c 	lw	v0,652(a0)
+    823c:	10400006 	beqz	v0,8258 <__cpu_check_sched+0x4c>
+    8240:	00000000 	sll	zero,zero,0x0
+    8244:	00001021 	addu	v0,zero,zero
+    8248:	8fbf0014 	lw	ra,20(sp)
+    824c:	8fb00010 	lw	s0,16(sp)
+    8250:	03e00008 	jr	ra
+    8254:	27bd0018 	addiu	sp,sp,24
+    8258:	8c820134 	lw	v0,308(a0)
+    825c:	30420001 	andi	v0,v0,0x1
+    8260:	1440fff9 	bnez	v0,8248 <__cpu_check_sched+0x3c>
+    8264:	24020001 	addiu	v0,zero,1
+    8268:	40022002 	mfc0	v0,$4,2
+    826c:	0c003b3b 	jal	ecec <rpc_check>
+    8270:	8c500174 	lw	s0,372(v0)
+    8274:	8e020064 	lw	v0,100(s0)
+    8278:	30420001 	andi	v0,v0,0x1
+    827c:	1040fff1 	beqz	v0,8244 <__cpu_check_sched+0x38>
+    8280:	3c020001 	lui	v0,0x1
+    8284:	02028021 	addu	s0,s0,v0
+    8288:	8e0482c0 	lw	a0,-32064(s0)
+    828c:	24050002 	addiu	a1,zero,2
+    8290:	0c006d56 	jal	1b558 <wakeup_one>
+    8294:	2484027c 	addiu	a0,a0,636
+    8298:	08002092 	j	8248 <__cpu_check_sched+0x3c>
+    829c:	0002102b 	sltu	v0,zero,v0
+
+000082a0 <cpu_clock>:
+    82a0:	27bdffe0 	addiu	sp,sp,-32
+    82a4:	afb00014 	sw	s0,20(sp)
+    82a8:	00808021 	addu	s0,a0,zero
+    82ac:	afbf001c 	sw	ra,28(sp)
+    82b0:	afb10018 	sw	s1,24(sp)
+    82b4:	8c840028 	lw	a0,40(a0)
+    82b8:	8e07002c 	lw	a3,44(s0)
+    82bc:	8e020030 	lw	v0,48(s0)
+    82c0:	40034800 	mfc0	v1,c0_count
+    82c4:	00000000 	sll	zero,zero,0x0
+    82c8:	0062282b 	sltu	a1,v1,v0
+    82cc:	10a00025 	beqz	a1,8364 <cpu_clock+0xc4>
+    82d0:	00000000 	sll	zero,zero,0x0
+    82d4:	00021027 	nor	v0,zero,v0
+    82d8:	00621021 	addu	v0,v1,v0
+    82dc:	8e110038 	lw	s1,56(s0)
+    82e0:	8e060040 	lw	a2,64(s0)
+    82e4:	0051001b 	divu	zero,v0,s1
+    82e8:	022001f4 	teq	s1,zero,0x7
+    82ec:	00442021 	addu	a0,v0,a0
+    82f0:	8e110034 	lw	s1,52(s0)
+    82f4:	0082102b 	sltu	v0,a0,v0
+    82f8:	00473821 	addu	a3,v0,a3
+    82fc:	ae040028 	sw	a0,40(s0)
+    8300:	ae030030 	sw	v1,48(s0)
+    8304:	ae07002c 	sw	a3,44(s0)
+    8308:	26040050 	addiu	a0,s0,80
+    830c:	00002812 	mflo	a1
+    8310:	00c51021 	addu	v0,a2,a1
+    8314:	00b18821 	addu	s1,a1,s1
+    8318:	ae020040 	sw	v0,64(s0)
+    831c:	ae110034 	sw	s1,52(s0)
+    8320:	0c006cea 	jal	1b3a8 <alarm_clock>
+    8324:	02202821 	addu	a1,s1,zero
+    8328:	40042002 	mfc0	a0,$4,2
+    832c:	0c004448 	jal	11120 <sched_clock>
+    8330:	02202821 	addu	a1,s1,zero
+    8334:	3c020001 	lui	v0,0x1
+    8338:	02021021 	addu	v0,s0,v0
+    833c:	8c438328 	lw	v1,-31960(v0)
+    8340:	3c020003 	lui	v0,0x3
+    8344:	00621021 	addu	v0,v1,v0
+    8348:	8c429528 	lw	v0,-27352(v0)
+    834c:	10500007 	beq	v0,s0,836c <cpu_clock+0xcc>
+    8350:	8fbf001c 	lw	ra,28(sp)
+    8354:	8fb10018 	lw	s1,24(sp)
+    8358:	8fb00014 	lw	s0,20(sp)
+    835c:	03e00008 	jr	ra
+    8360:	27bd0020 	addiu	sp,sp,32
+    8364:	080020b7 	j	82dc <cpu_clock+0x3c>
+    8368:	00621023 	subu	v0,v1,v0
+    836c:	8fb10018 	lw	s1,24(sp)
+    8370:	8fb00014 	lw	s0,20(sp)
+    8374:	080028e8 	j	a3a0 <dqdt_update>
+    8378:	27bd0020 	addiu	sp,sp,32
+
+0000837c <cpu_init>:
+    837c:	27bdffc8 	addiu	sp,sp,-56
+    8380:	afb10028 	sw	s1,40(sp)
+    8384:	3c110001 	lui	s1,0x1
+    8388:	00918821 	addu	s1,a0,s1
+    838c:	24020004 	addiu	v0,zero,4
+    8390:	ac860000 	sw	a2,0(a0)
+    8394:	ae228338 	sw	v0,-31944(s1)
+    8398:	ac870004 	sw	a3,4(a0)
+    839c:	ae258328 	sw	a1,-31960(s1)
+    83a0:	ae208324 	sw	zero,-31964(s1)
+    83a4:	afb2002c 	sw	s2,44(sp)
+    83a8:	afb00024 	sw	s0,36(sp)
+    83ac:	afa60018 	sw	a2,24(sp)
+    83b0:	afbf0034 	sw	ra,52(sp)
+    83b4:	afb30030 	sw	s3,48(sp)
+    83b8:	00808021 	addu	s0,a0,zero
+    83bc:	0c00053e 	jal	14f8 <arch_cpu_init>
+    83c0:	00a09021 	addu	s2,a1,zero
+    83c4:	1040000c 	beqz	v0,83f8 <cpu_init+0x7c>
+    83c8:	8fa60018 	lw	a2,24(sp)
+    83cc:	8e020004 	lw	v0,4(s0)
+    83d0:	3c050003 	lui	a1,0x3
+    83d4:	3c070003 	lui	a3,0x3
+    83d8:	24a54a1c 	addiu	a1,a1,18972
+    83dc:	24e74a7c 	addiu	a3,a3,19068
+    83e0:	24040001 	addiu	a0,zero,1
+    83e4:	2406004f 	addiu	a2,zero,79
+    83e8:	0c00097d 	jal	25f4 <__perror>
+    83ec:	afa20010 	sw	v0,16(sp)
+    83f0:	080020fc 	j	83f0 <cpu_init+0x74>
+    83f4:	00000000 	sll	zero,zero,0x0
+    83f8:	3c02000f 	lui	v0,0xf
+    83fc:	34424240 	ori	v0,v0,0x4240
+    8400:	00001821 	addu	v1,zero,zero
+    8404:	ae020038 	sw	v0,56(s0)
+    8408:	00001021 	addu	v0,zero,zero
+    840c:	ae03002c 	sw	v1,44(s0)
+    8410:	26040050 	addiu	a0,s0,80
+    8414:	ae000030 	sw	zero,48(s0)
+    8418:	ae020028 	sw	v0,40(s0)
+    841c:	ae000034 	sw	zero,52(s0)
+    8420:	ae000040 	sw	zero,64(s0)
+    8424:	ae000044 	sw	zero,68(s0)
+    8428:	ae000048 	sw	zero,72(s0)
+    842c:	ae000020 	sw	zero,32(s0)
+    8430:	ae00004c 	sw	zero,76(s0)
+    8434:	0c006c66 	jal	1b198 <alarm_manager_init>
+    8438:	afa60018 	sw	a2,24(sp)
+    843c:	340482d8 	ori	a0,zero,0x82d8
+    8440:	0c004747 	jal	11d1c <sched_init>
+    8444:	02042021 	addu	a0,s0,a0
+    8448:	0c00294b 	jal	a52c <event_listner_init>
+    844c:	26040060 	addiu	a0,s0,96
+    8450:	0c003d19 	jal	f464 <rpc_listner_init>
+    8454:	260400e0 	addiu	a0,s0,224
+    8458:	3413833c 	ori	s3,zero,0x833c
+    845c:	0c003975 	jal	e5d4 <rpc_manager_init>
+    8460:	02002021 	addu	a0,s0,zero
+    8464:	02139821 	addu	s3,s0,s3
+    8468:	3c050003 	lui	a1,0x3
+    846c:	8fa60018 	lw	a2,24(sp)
+    8470:	24a54a88 	addiu	a1,a1,19080
+    8474:	0c00c414 	jal	31050 <sprintk>
+    8478:	02602021 	addu	a0,s3,zero
+    847c:	34038368 	ori	v1,zero,0x8368
+    8480:	ae338358 	sw	s3,-31912(s1)
+    8484:	ae20835c 	sw	zero,-31908(s1)
+    8488:	02031821 	addu	v1,s0,v1
+    848c:	00001021 	addu	v0,zero,zero
+    8490:	2405000a 	addiu	a1,zero,10
+    8494:	2444106d 	addiu	a0,v0,4205
+    8498:	000420c0 	sll	a0,a0,0x3
+    849c:	02042021 	addu	a0,s0,a0
+    84a0:	24420001 	addiu	v0,v0,1
+    84a4:	ac640004 	sw	a0,4(v1)
+    84a8:	ac640000 	sw	a0,0(v1)
+    84ac:	1445fff9 	bne	v0,a1,8494 <cpu_init+0x118>
+    84b0:	24630008 	addiu	v1,v1,8
+    84b4:	8e430434 	lw	v1,1076(s2)
+    84b8:	3c020001 	lui	v0,0x1
+    84bc:	8c640038 	lw	a0,56(v1)
+    84c0:	02021021 	addu	v0,s0,v0
+    84c4:	3c060001 	lui	a2,0x1
+    84c8:	24840001 	addiu	a0,a0,1
+    84cc:	8c458358 	lw	a1,-31912(v0)
+    84d0:	24c685a0 	addiu	a2,a2,-31328
+    84d4:	ac46834c 	sw	a2,-31924(v0)
+    84d8:	ac640038 	sw	a0,56(v1)
+    84dc:	ac408348 	sw	zero,-31928(v0)
+    84e0:	ac408350 	sw	zero,-31920(v0)
+    84e4:	ac408354 	sw	zero,-31916(v0)
+    84e8:	80a40000 	lb	a0,0(a1)
+    84ec:	1080000f 	beqz	a0,852c <cpu_init+0x1b0>
+    84f0:	00001021 	addu	v0,zero,zero
+    84f4:	24a50001 	addiu	a1,a1,1
+    84f8:	00823026 	xor	a2,a0,v0
+    84fc:	80a40000 	lb	a0,0(a1)
+    8500:	1480fffc 	bnez	a0,84f4 <cpu_init+0x178>
+    8504:	00461021 	addu	v0,v0,a2
+    8508:	3c04cccc 	lui	a0,0xcccc
+    850c:	3484cccd 	ori	a0,a0,0xcccd
+    8510:	00440019 	multu	v0,a0
+    8514:	00002010 	mfhi	a0
+    8518:	000420c2 	srl	a0,a0,0x3
+    851c:	000428c0 	sll	a1,a0,0x3
+    8520:	00042040 	sll	a0,a0,0x1
+    8524:	00852021 	addu	a0,a0,a1
+    8528:	00442023 	subu	a0,v0,a0
+    852c:	24840008 	addiu	a0,a0,8
+    8530:	000420c0 	sll	a0,a0,0x3
+    8534:	00641821 	addu	v1,v1,a0
+    8538:	8c630008 	lw	v1,8(v1)
+    853c:	34058360 	ori	a1,zero,0x8360
+    8540:	3c020001 	lui	v0,0x1
+    8544:	02021021 	addu	v0,s0,v0
+    8548:	8c640000 	lw	a0,0(v1)
+    854c:	02058021 	addu	s0,s0,a1
+    8550:	3405fa21 	ori	a1,zero,0xfa21
+    8554:	ac458330 	sw	a1,-31952(v0)
+    8558:	3405ffef 	ori	a1,zero,0xffef
+    855c:	ac448360 	sw	a0,-31904(v0)
+    8560:	ac438364 	sw	v1,-31900(v0)
+    8564:	ac45832c 	sw	a1,-31956(v0)
+    8568:	ac700000 	sw	s0,0(v1)
+    856c:	ac900004 	sw	s0,4(a0)
+    8570:	40044800 	mfc0	a0,c0_count
+    8574:	00000000 	sll	zero,zero,0x0
+    8578:	0c00c1d0 	jal	30740 <srand>
+    857c:	30840fff 	andi	a0,a0,0xfff
+    8580:	8fbf0034 	lw	ra,52(sp)
+    8584:	00001021 	addu	v0,zero,zero
+    8588:	8fb30030 	lw	s3,48(sp)
+    858c:	8fb2002c 	lw	s2,44(sp)
+    8590:	8fb10028 	lw	s1,40(sp)
+    8594:	8fb00024 	lw	s0,36(sp)
+    8598:	03e00008 	jr	ra
+    859c:	27bd0038 	addiu	sp,sp,56
+    85a0:	8cc20000 	lw	v0,0(a2)
+    85a4:	27bdffc0 	addiu	sp,sp,-64
+    85a8:	afb10034 	sw	s1,52(sp)
+    85ac:	afb00030 	sw	s0,48(sp)
+    85b0:	afbf003c 	sw	ra,60(sp)
+    85b4:	afb20038 	sw	s2,56(sp)
+    85b8:	00c08021 	addu	s0,a2,zero
+    85bc:	1040000a 	beqz	v0,85e8 <cpu_init+0x26c>
+    85c0:	00a08821 	addu	s1,a1,zero
+    85c4:	8fbf003c 	lw	ra,60(sp)
+    85c8:	acc00000 	sw	zero,0(a2)
+    85cc:	00001021 	addu	v0,zero,zero
+    85d0:	8fb20038 	lw	s2,56(sp)
+    85d4:	8fb10034 	lw	s1,52(sp)
+    85d8:	8fb00030 	lw	s0,48(sp)
+    85dc:	aca00004 	sw	zero,4(a1)
+    85e0:	03e00008 	jr	ra
+    85e4:	27bd0040 	addiu	sp,sp,64
+    85e8:	3c05ffff 	lui	a1,0xffff
+    85ec:	34a57cb8 	ori	a1,a1,0x7cb8
+    85f0:	00852821 	addu	a1,a0,a1
+    85f4:	8ca60044 	lw	a2,68(a1)
+    85f8:	24827cb8 	addiu	v0,a0,31928
+    85fc:	944382da 	lhu	v1,-32038(v0)
+    8600:	944882dc 	lhu	t0,-32036(v0)
+    8604:	944982de 	lhu	t1,-32034(v0)
+    8608:	944282d8 	lhu	v0,-32040(v0)
+    860c:	8cac0020 	lw	t4,32(a1)
+    8610:	8cad0034 	lw	t5,52(a1)
+    8614:	26320008 	addiu	s2,s1,8
+    8618:	2cca0065 	sltiu	t2,a2,101
+    861c:	24070064 	addiu	a3,zero,100
+    8620:	3c050003 	lui	a1,0x3
+    8624:	00ca380b 	movn	a3,a2,t2
+    8628:	01285821 	addu	t3,t1,t0
+    862c:	00435023 	subu	t2,v0,v1
+    8630:	2486fff4 	addiu	a2,a0,-12
+    8634:	24a54a90 	addiu	a1,a1,19088
+    8638:	02402021 	addu	a0,s2,zero
+    863c:	afad0010 	sw	t5,16(sp)
+    8640:	afac0014 	sw	t4,20(sp)
+    8644:	afab0018 	sw	t3,24(sp)
+    8648:	afa9001c 	sw	t1,28(sp)
+    864c:	afa80020 	sw	t0,32(sp)
+    8650:	afaa0028 	sw	t2,40(sp)
+    8654:	afa3002c 	sw	v1,44(sp)
+    8658:	0c00c414 	jal	31050 <sprintk>
+    865c:	afa20024 	sw	v0,36(sp)
+    8660:	0c00c4d1 	jal	31344 <strlen>
+    8664:	02402021 	addu	a0,s2,zero
+    8668:	8fbf003c 	lw	ra,60(sp)
+    866c:	ae220004 	sw	v0,4(s1)
+    8670:	8fb20038 	lw	s2,56(sp)
+    8674:	ae000000 	sw	zero,0(s0)
+    8678:	00001021 	addu	v0,zero,zero
+    867c:	8fb10034 	lw	s1,52(sp)
+    8680:	8fb00030 	lw	s0,48(sp)
+    8684:	03e00008 	jr	ra
+    8688:	27bd0040 	addiu	sp,sp,64
+
+0000868c <cpu_yield>:
+    868c:	27bdffe0 	addiu	sp,sp,-32
+    8690:	afbf001c 	sw	ra,28(sp)
+    8694:	afb10018 	sw	s1,24(sp)
+    8698:	afb00014 	sw	s0,20(sp)
+    869c:	40102002 	mfc0	s0,$4,2
+    86a0:	40034800 	mfc0	v1,c0_count
+    86a4:	00000000 	sll	zero,zero,0x0
+    86a8:	8e02013c 	lw	v0,316(s0)
+    86ac:	14400007 	bnez	v0,86cc <cpu_yield+0x40>
+    86b0:	ae03014c 	sw	v1,332(s0)
+    86b4:	8e020140 	lw	v0,320(s0)
+    86b8:	14400005 	bnez	v0,86d0 <cpu_yield+0x44>
+    86bc:	00001021 	addu	v0,zero,zero
+    86c0:	8e02028c 	lw	v0,652(s0)
+    86c4:	10400007 	beqz	v0,86e4 <cpu_yield+0x58>
+    86c8:	00000000 	sll	zero,zero,0x0
+    86cc:	00001021 	addu	v0,zero,zero
+    86d0:	8fbf001c 	lw	ra,28(sp)
+    86d4:	8fb10018 	lw	s1,24(sp)
+    86d8:	8fb00014 	lw	s0,20(sp)
+    86dc:	03e00008 	jr	ra
+    86e0:	27bd0020 	addiu	sp,sp,32
+    86e4:	8e020134 	lw	v0,308(s0)
+    86e8:	30420001 	andi	v0,v0,0x1
+    86ec:	10400005 	beqz	v0,8704 <cpu_yield+0x78>
+    86f0:	00000000 	sll	zero,zero,0x0
+    86f4:	0c004636 	jal	118d8 <sched_yield>
+    86f8:	02002021 	addu	a0,s0,zero
+    86fc:	080021b4 	j	86d0 <cpu_yield+0x44>
+    8700:	24020001 	addiu	v0,zero,1
+    8704:	40022002 	mfc0	v0,$4,2
+    8708:	0c003b3b 	jal	ecec <rpc_check>
+    870c:	8c510174 	lw	s1,372(v0)
+    8710:	8e220064 	lw	v0,100(s1)
+    8714:	30420001 	andi	v0,v0,0x1
+    8718:	1040ffed 	beqz	v0,86d0 <cpu_yield+0x44>
+    871c:	00001021 	addu	v0,zero,zero
+    8720:	3c020001 	lui	v0,0x1
+    8724:	02228821 	addu	s1,s1,v0
+    8728:	8e2482c0 	lw	a0,-32064(s1)
+    872c:	24050002 	addiu	a1,zero,2
+    8730:	0c006d56 	jal	1b558 <wakeup_one>
+    8734:	2484027c 	addiu	a0,a0,636
+    8738:	1440ffee 	bnez	v0,86f4 <cpu_yield+0x68>
+    873c:	00000000 	sll	zero,zero,0x0
+    8740:	080021b4 	j	86d0 <cpu_yield+0x44>
+    8744:	00001021 	addu	v0,zero,zero
+
+00008748 <device_alloc>:
+    8748:	3c030004 	lui	v1,0x4
+    874c:	8c62bca0 	lw	v0,-17248(v1)
+    8750:	2c440100 	sltiu	a0,v0,256
+    8754:	10800007 	beqz	a0,8774 <device_alloc+0x2c>
+    8758:	24440001 	addiu	a0,v0,1
+    875c:	ac64bca0 	sw	a0,-17248(v1)
+    8760:	3c030007 	lui	v1,0x7
+    8764:	246302e0 	addiu	v1,v1,736
+    8768:	00021200 	sll	v0,v0,0x8
+    876c:	03e00008 	jr	ra
+    8770:	00621021 	addu	v0,v1,v0
+    8774:	03e00008 	jr	ra
+    8778:	00001021 	addu	v0,zero,zero
+
+0000877c <remote_spinlock_trylock>:
+    877c:	30a5ffff 	andi	a1,a1,0xffff
+    8780:	400a2002 	mfc0	t2,$4,2
+    8784:	40016000 	mfc0	at,c0_status
+    8788:	00000000 	sll	zero,zero,0x0
+    878c:	00013025 	or	a2,zero,at
+    8790:	00010842 	srl	at,at,0x1
+    8794:	00010840 	sll	at,at,0x1
+    8798:	40816000 	mtc0	at,c0_status
+    879c:	2ca20101 	sltiu	v0,a1,257
+    87a0:	14400003 	bnez	v0,87b0 <remote_spinlock_trylock+0x34>
+    87a4:	00051100 	sll	v0,a1,0x4
+    87a8:	080021ea 	j	87a8 <remote_spinlock_trylock+0x2c>
+    87ac:	00000000 	sll	zero,zero,0x0
+    87b0:	00052880 	sll	a1,a1,0x2
+    87b4:	00452823 	subu	a1,v0,a1
+    87b8:	3c020004 	lui	v0,0x4
+    87bc:	2442c9a0 	addiu	v0,v0,-13920
+    87c0:	00451021 	addu	v0,v0,a1
+    87c4:	3c035555 	lui	v1,0x5555
+    87c8:	8c420000 	lw	v0,0(v0)
+    87cc:	34635555 	ori	v1,v1,0x5555
+    87d0:	1043fff5 	beq	v0,v1,87a8 <remote_spinlock_trylock+0x2c>
+    87d4:	00000000 	sll	zero,zero,0x0
+    87d8:	4808c000 	mfc2	t0,$24
+    87dc:	4882c000 	mtc2	v0,$24
+    87e0:	8c850000 	lw	a1,0(a0)
+    87e4:	4888c000 	mtc2	t0,$24
+    87e8:	14a00019 	bnez	a1,8850 <remote_spinlock_trylock+0xd4>
+    87ec:	240cffff 	addiu	t4,zero,-1
+    87f0:	4809c000 	mfc2	t1,$24
+    87f4:	4882c000 	mtc2	v0,$24
+    87f8:	0000000f 	sync
+    87fc:	000c4025 	or	t0,zero,t4
+    8800:	c0830000 	ll	v1,0(a0)
+    8804:	14650004 	bne	v1,a1,8818 <remote_spinlock_trylock+0x9c>
+    8808:	24070000 	addiu	a3,zero,0
+    880c:	e0880000 	sc	t0,0(a0)
+    8810:	01003825 	or	a3,t0,zero
+    8814:	0000000f 	sync
+    8818:	00e05825 	or	t3,a3,zero
+    881c:	4889c000 	mtc2	t1,$24
+    8820:	1160000b 	beqz	t3,8850 <remote_spinlock_trylock+0xd4>
+    8824:	00000000 	sll	zero,zero,0x0
+    8828:	8d420140 	lw	v0,320(t2)
+    882c:	24420001 	addiu	v0,v0,1
+    8830:	ad420140 	sw	v0,320(t2)
+    8834:	40016000 	mfc0	at,c0_status
+    8838:	340200ff 	ori	v0,zero,0xff
+    883c:	00461024 	and	v0,v0,a2
+    8840:	00220825 	or	at,at,v0
+    8844:	40816000 	mtc0	at,c0_status
+    8848:	03e00008 	jr	ra
+    884c:	00001021 	addu	v0,zero,zero
+    8850:	40016000 	mfc0	at,c0_status
+    8854:	340200ff 	ori	v0,zero,0xff
+    8858:	00461024 	and	v0,v0,a2
+    885c:	00220825 	or	at,at,v0
+    8860:	40816000 	mtc0	at,c0_status
+    8864:	03e00008 	jr	ra
+    8868:	24020001 	addiu	v0,zero,1
+
+0000886c <distlock_trylock>:
+    886c:	27bdffe0 	addiu	sp,sp,-32
+    8870:	afbf001c 	sw	ra,28(sp)
+    8874:	0c000575 	jal	15d4 <arch_boot_cid>
+    8878:	afa40010 	sw	a0,16(sp)
+    887c:	8fa40010 	lw	a0,16(sp)
+    8880:	8fbf001c 	lw	ra,28(sp)
+    8884:	00402821 	addu	a1,v0,zero
+    8888:	080021df 	j	877c <remote_spinlock_trylock>
+    888c:	27bd0020 	addiu	sp,sp,32
+
+00008890 <remote_spinlock_unlock>:
+    8890:	30a5ffff 	andi	a1,a1,0xffff
+    8894:	27bdffd0 	addiu	sp,sp,-48
+    8898:	2ca20101 	sltiu	v0,a1,257
+    889c:	14400003 	bnez	v0,88ac <remote_spinlock_unlock+0x1c>
+    88a0:	afbf002c 	sw	ra,44(sp)
+    88a4:	08002229 	j	88a4 <remote_spinlock_unlock+0x14>
+    88a8:	00000000 	sll	zero,zero,0x0
+    88ac:	00051100 	sll	v0,a1,0x4
+    88b0:	00052880 	sll	a1,a1,0x2
+    88b4:	00452823 	subu	a1,v0,a1
+    88b8:	3c020004 	lui	v0,0x4
+    88bc:	2442c9a0 	addiu	v0,v0,-13920
+    88c0:	00451021 	addu	v0,v0,a1
+    88c4:	3c035555 	lui	v1,0x5555
+    88c8:	8c420000 	lw	v0,0(v0)
+    88cc:	34635555 	ori	v1,v1,0x5555
+    88d0:	1043fff4 	beq	v0,v1,88a4 <remote_spinlock_unlock+0x14>
+    88d4:	00001821 	addu	v1,zero,zero
+    88d8:	4808c000 	mfc2	t0,$24
+    88dc:	4882c000 	mtc2	v0,$24
+    88e0:	ac830000 	sw	v1,0(a0)
+    88e4:	4888c000 	mtc2	t0,$24
+    88e8:	40032002 	mfc0	v1,$4,2
+    88ec:	8c620140 	lw	v0,320(v1)
+    88f0:	18400005 	blez	v0,8908 <remote_spinlock_unlock+0x78>
+    88f4:	8fbf002c 	lw	ra,44(sp)
+    88f8:	2442ffff 	addiu	v0,v0,-1
+    88fc:	ac620140 	sw	v0,320(v1)
+    8900:	03e00008 	jr	ra
+    8904:	27bd0030 	addiu	sp,sp,48
+    8908:	40064800 	mfc0	a2,c0_count
+    890c:	00000000 	sll	zero,zero,0x0
+    8910:	40082002 	mfc0	t0,$4,2
+    8914:	40057801 	mfc0	a1,$15,1
+    8918:	40024800 	mfc0	v0,c0_count
+    891c:	00000000 	sll	zero,zero,0x0
+    8920:	3c040003 	lui	a0,0x3
+    8924:	24844b80 	addiu	a0,a0,19328
+    8928:	afa30014 	sw	v1,20(sp)
+    892c:	afa40010 	sw	a0,16(sp)
+    8930:	8c640174 	lw	a0,372(v1)
+    8934:	30a50003 	andi	a1,a1,0x3
+    8938:	3c030004 	lui	v1,0x4
+    893c:	00052880 	sll	a1,a1,0x2
+    8940:	2463c950 	addiu	v1,v1,-14000
+    8944:	00a31821 	addu	v1,a1,v1
+    8948:	8c890004 	lw	t1,4(a0)
+    894c:	8c630000 	lw	v1,0(v1)
+    8950:	3c050003 	lui	a1,0x3
+    8954:	24a54afc 	addiu	a1,a1,19196
+    8958:	00002021 	addu	a0,zero,zero
+    895c:	24070071 	addiu	a3,zero,113
+    8960:	afa90018 	sw	t1,24(sp)
+    8964:	afa8001c 	sw	t0,28(sp)
+    8968:	afa30020 	sw	v1,32(sp)
+    896c:	0c00097d 	jal	25f4 <__perror>
+    8970:	afa20024 	sw	v0,36(sp)
+    8974:	0800225d 	j	8974 <remote_spinlock_unlock+0xe4>
+    8978:	00000000 	sll	zero,zero,0x0
+
+0000897c <distlock_unlock>:
+    897c:	27bdffe0 	addiu	sp,sp,-32
+    8980:	afbf001c 	sw	ra,28(sp)
+    8984:	0c000575 	jal	15d4 <arch_boot_cid>
+    8988:	afa40010 	sw	a0,16(sp)
+    898c:	8fa40010 	lw	a0,16(sp)
+    8990:	8fbf001c 	lw	ra,28(sp)
+    8994:	00402821 	addu	a1,v0,zero
+    8998:	08002224 	j	8890 <remote_spinlock_unlock>
+    899c:	27bd0020 	addiu	sp,sp,32
+    89a0:	27bdffe0 	addiu	sp,sp,-32
+    89a4:	afb00018 	sw	s0,24(sp)
+    89a8:	afbf001c 	sw	ra,28(sp)
+    89ac:	00808021 	addu	s0,a0,zero
+    89b0:	40024800 	mfc0	v0,c0_count
+    89b4:	00000000 	sll	zero,zero,0x0
+    89b8:	8c83014c 	lw	v1,332(a0)
+    89bc:	0043202b 	sltu	a0,v0,v1
+    89c0:	14800016 	bnez	a0,8a1c <distlock_unlock+0xa0>
+    89c4:	00000000 	sll	zero,zero,0x0
+    89c8:	00431023 	subu	v0,v0,v1
+    89cc:	2c4207d1 	sltiu	v0,v0,2001
+    89d0:	10400017 	beqz	v0,8a30 <distlock_unlock+0xb4>
+    89d4:	02002021 	addu	a0,s0,zero
+    89d8:	8ca30000 	lw	v1,0(a1)
+    89dc:	40016000 	mfc0	at,c0_status
+    89e0:	340200ff 	ori	v0,zero,0xff
+    89e4:	00431024 	and	v0,v0,v1
+    89e8:	00220825 	or	at,at,v0
+    89ec:	40816000 	mtc0	at,c0_status
+    89f0:	40016000 	mfc0	at,c0_status
+    89f4:	00000000 	sll	zero,zero,0x0
+    89f8:	00011025 	or	v0,zero,at
+    89fc:	00010842 	srl	at,at,0x1
+    8a00:	00010840 	sll	at,at,0x1
+    8a04:	40816000 	mtc0	at,c0_status
+    8a08:	8fbf001c 	lw	ra,28(sp)
+    8a0c:	8fb00018 	lw	s0,24(sp)
+    8a10:	aca20000 	sw	v0,0(a1)
+    8a14:	03e00008 	jr	ra
+    8a18:	27bd0020 	addiu	sp,sp,32
+    8a1c:	00031827 	nor	v1,zero,v1
+    8a20:	00431021 	addu	v0,v0,v1
+    8a24:	2c4207d1 	sltiu	v0,v0,2001
+    8a28:	1440ffeb 	bnez	v0,89d8 <distlock_unlock+0x5c>
+    8a2c:	02002021 	addu	a0,s0,zero
+    8a30:	0c002083 	jal	820c <__cpu_check_sched>
+    8a34:	afa50010 	sw	a1,16(sp)
+    8a38:	1040ffe7 	beqz	v0,89d8 <distlock_unlock+0x5c>
+    8a3c:	8fa50010 	lw	a1,16(sp)
+    8a40:	0c004636 	jal	118d8 <sched_yield>
+    8a44:	02002021 	addu	a0,s0,zero
+    8a48:	08002276 	j	89d8 <distlock_unlock+0x5c>
+    8a4c:	8fa50010 	lw	a1,16(sp)
+
+00008a50 <remote_spinlock_lock>:
+    8a50:	27bdffc8 	addiu	sp,sp,-56
+    8a54:	afb10020 	sw	s1,32(sp)
+    8a58:	afbf0034 	sw	ra,52(sp)
+    8a5c:	afb50030 	sw	s5,48(sp)
+    8a60:	afb4002c 	sw	s4,44(sp)
+    8a64:	afb30028 	sw	s3,40(sp)
+    8a68:	afb20024 	sw	s2,36(sp)
+    8a6c:	afb0001c 	sw	s0,28(sp)
+    8a70:	00808821 	addu	s1,a0,zero
+    8a74:	30a5ffff 	andi	a1,a1,0xffff
+    8a78:	40102002 	mfc0	s0,$4,2
+    8a7c:	40016000 	mfc0	at,c0_status
+    8a80:	00000000 	sll	zero,zero,0x0
+    8a84:	00011825 	or	v1,zero,at
+    8a88:	00010842 	srl	at,at,0x1
+    8a8c:	00010840 	sll	at,at,0x1
+    8a90:	40816000 	mtc0	at,c0_status
+    8a94:	2ca20101 	sltiu	v0,a1,257
+    8a98:	1040003b 	beqz	v0,8b88 <remote_spinlock_lock+0x138>
+    8a9c:	00000000 	sll	zero,zero,0x0
+    8aa0:	00059900 	sll	s3,a1,0x4
+    8aa4:	00052880 	sll	a1,a1,0x2
+    8aa8:	02652823 	subu	a1,s3,a1
+    8aac:	3c130004 	lui	s3,0x4
+    8ab0:	2673c9a0 	addiu	s3,s3,-13920
+    8ab4:	02659821 	addu	s3,s3,a1
+    8ab8:	3c125555 	lui	s2,0x5555
+    8abc:	8e620000 	lw	v0,0(s3)
+    8ac0:	36525555 	ori	s2,s2,0x5555
+    8ac4:	afa30010 	sw	v1,16(sp)
+    8ac8:	2415ffff 	addiu	s5,zero,-1
+    8acc:	27b40010 	addiu	s4,sp,16
+    8ad0:	1052002d 	beq	v0,s2,8b88 <remote_spinlock_lock+0x138>
+    8ad4:	00000000 	sll	zero,zero,0x0
+    8ad8:	4808c000 	mfc2	t0,$24
+    8adc:	4882c000 	mtc2	v0,$24
+    8ae0:	8e240000 	lw	a0,0(s1)
+    8ae4:	4888c000 	mtc2	t0,$24
+    8ae8:	14800021 	bnez	a0,8b70 <remote_spinlock_lock+0x120>
+    8aec:	00000000 	sll	zero,zero,0x0
+    8af0:	4809c000 	mfc2	t1,$24
+    8af4:	4882c000 	mtc2	v0,$24
+    8af8:	0000000f 	sync
+    8afc:	00154025 	or	t0,zero,s5
+    8b00:	c2230000 	ll	v1,0(s1)
+    8b04:	14640004 	bne	v1,a0,8b18 <remote_spinlock_lock+0xc8>
+    8b08:	24070000 	addiu	a3,zero,0
+    8b0c:	e2280000 	sc	t0,0(s1)
+    8b10:	01003825 	or	a3,t0,zero
+    8b14:	0000000f 	sync
+    8b18:	00e02825 	or	a1,a3,zero
+    8b1c:	4889c000 	mtc2	t1,$24
+    8b20:	10a0ffeb 	beqz	a1,8ad0 <remote_spinlock_lock+0x80>
+    8b24:	00000000 	sll	zero,zero,0x0
+    8b28:	8e020140 	lw	v0,320(s0)
+    8b2c:	24420001 	addiu	v0,v0,1
+    8b30:	ae020140 	sw	v0,320(s0)
+    8b34:	8fa30010 	lw	v1,16(sp)
+    8b38:	40016000 	mfc0	at,c0_status
+    8b3c:	340200ff 	ori	v0,zero,0xff
+    8b40:	00431024 	and	v0,v0,v1
+    8b44:	00220825 	or	at,at,v0
+    8b48:	40816000 	mtc0	at,c0_status
+    8b4c:	8fbf0034 	lw	ra,52(sp)
+    8b50:	8fb50030 	lw	s5,48(sp)
+    8b54:	8fb4002c 	lw	s4,44(sp)
+    8b58:	8fb30028 	lw	s3,40(sp)
+    8b5c:	8fb20024 	lw	s2,36(sp)
+    8b60:	8fb10020 	lw	s1,32(sp)
+    8b64:	8fb0001c 	lw	s0,28(sp)
+    8b68:	03e00008 	jr	ra
+    8b6c:	27bd0038 	addiu	sp,sp,56
+    8b70:	02002021 	addu	a0,s0,zero
+    8b74:	0c002268 	jal	89a0 <distlock_unlock+0x24>
+    8b78:	02802821 	addu	a1,s4,zero
+    8b7c:	8e620000 	lw	v0,0(s3)
+    8b80:	1452ffd5 	bne	v0,s2,8ad8 <remote_spinlock_lock+0x88>
+    8b84:	00000000 	sll	zero,zero,0x0
+    8b88:	080022e2 	j	8b88 <remote_spinlock_lock+0x138>
+    8b8c:	00000000 	sll	zero,zero,0x0
+
+00008b90 <distlock_lock>:
+    8b90:	27bdffe0 	addiu	sp,sp,-32
+    8b94:	afbf001c 	sw	ra,28(sp)
+    8b98:	0c000575 	jal	15d4 <arch_boot_cid>
+    8b9c:	afa40010 	sw	a0,16(sp)
+    8ba0:	8fa40010 	lw	a0,16(sp)
+    8ba4:	8fbf001c 	lw	ra,28(sp)
+    8ba8:	00402821 	addu	a1,v0,zero
+    8bac:	08002294 	j	8a50 <remote_spinlock_lock>
+    8bb0:	27bd0020 	addiu	sp,sp,32
+
+00008bb4 <args_len>:
+    8bb4:	27bdffb0 	addiu	sp,sp,-80
+    8bb8:	afbe0048 	sw	s8,72(sp)
+    8bbc:	afb70044 	sw	s7,68(sp)
+    8bc0:	afb60040 	sw	s6,64(sp)
+    8bc4:	afb5003c 	sw	s5,60(sp)
+    8bc8:	afb40038 	sw	s4,56(sp)
+    8bcc:	afb30034 	sw	s3,52(sp)
+    8bd0:	afb20030 	sw	s2,48(sp)
+    8bd4:	afb1002c 	sw	s1,44(sp)
+    8bd8:	afbf004c 	sw	ra,76(sp)
+    8bdc:	afb00028 	sw	s0,40(sp)
+    8be0:	8fb10060 	lw	s1,96(sp)
+    8be4:	8fb20064 	lw	s2,100(sp)
+    8be8:	00a09821 	addu	s3,a1,zero
+    8bec:	00c0a021 	addu	s4,a2,zero
+    8bf0:	afa7005c 	sw	a3,92(sp)
+    8bf4:	0080b021 	addu	s6,a0,zero
+    8bf8:	0000a821 	addu	s5,zero,zero
+    8bfc:	0000b821 	addu	s7,zero,zero
+    8c00:	0800230d 	j	8c34 <args_len+0x80>
+    8c04:	27be0024 	addiu	s8,sp,36
+    8c08:	02a3a821 	addu	s5,s5,v1
+    8c0c:	32a30fff 	andi	v1,s5,0xfff
+    8c10:	14600022 	bnez	v1,8c9c <args_len+0xe8>
+    8c14:	2404f000 	addiu	a0,zero,-4096
+    8c18:	02a01821 	addu	v1,s5,zero
+    8c1c:	00031b02 	srl	v1,v1,0xc
+    8c20:	0073182b 	sltu	v1,v1,s3
+    8c24:	10600023 	beqz	v1,8cb4 <args_len+0x100>
+    8c28:	26d60004 	addiu	s6,s6,4
+    8c2c:	afa20020 	sw	v0,32(sp)
+    8c30:	26f70001 	addiu	s7,s7,1
+    8c34:	03c02021 	addu	a0,s8,zero
+    8c38:	02c02821 	addu	a1,s6,zero
+    8c3c:	0220f809 	jalr	s1
+    8c40:	24060004 	addiu	a2,zero,4
+    8c44:	14400029 	bnez	v0,8cec <args_len+0x138>
+    8c48:	00408021 	addu	s0,v0,zero
+    8c4c:	8fa40024 	lw	a0,36(sp)
+    8c50:	10800041 	beqz	a0,8d58 <args_len+0x1a4>
+    8c54:	26e20001 	addiu	v0,s7,1
+    8c58:	0240f809 	jalr	s2
+    8c5c:	27a50020 	addiu	a1,sp,32
+    8c60:	14400054 	bnez	v0,8db4 <args_len+0x200>
+    8c64:	00408021 	addu	s0,v0,zero
+    8c68:	8fa20020 	lw	v0,32(sp)
+    8c6c:	24420001 	addiu	v0,v0,1
+    8c70:	30430007 	andi	v1,v0,0x7
+    8c74:	1060ffe4 	beqz	v1,8c08 <args_len+0x54>
+    8c78:	00401821 	addu	v1,v0,zero
+    8c7c:	2404fff8 	addiu	a0,zero,-8
+    8c80:	00441824 	and	v1,v0,a0
+    8c84:	24630008 	addiu	v1,v1,8
+    8c88:	02a3a821 	addu	s5,s5,v1
+    8c8c:	32a30fff 	andi	v1,s5,0xfff
+    8c90:	1060ffe2 	beqz	v1,8c1c <args_len+0x68>
+    8c94:	02a01821 	addu	v1,s5,zero
+    8c98:	2404f000 	addiu	a0,zero,-4096
+    8c9c:	02a41824 	and	v1,s5,a0
+    8ca0:	24631000 	addiu	v1,v1,4096
+    8ca4:	00031b02 	srl	v1,v1,0xc
+    8ca8:	0073182b 	sltu	v1,v1,s3
+    8cac:	1460ffdf 	bnez	v1,8c2c <args_len+0x78>
+    8cb0:	26d60004 	addiu	s6,s6,4
+    8cb4:	8fbf004c 	lw	ra,76(sp)
+    8cb8:	24100007 	addiu	s0,zero,7
+    8cbc:	02001021 	addu	v0,s0,zero
+    8cc0:	8fbe0048 	lw	s8,72(sp)
+    8cc4:	8fb70044 	lw	s7,68(sp)
+    8cc8:	8fb60040 	lw	s6,64(sp)
+    8ccc:	8fb5003c 	lw	s5,60(sp)
+    8cd0:	8fb40038 	lw	s4,56(sp)
+    8cd4:	8fb30034 	lw	s3,52(sp)
+    8cd8:	8fb20030 	lw	s2,48(sp)
+    8cdc:	8fb1002c 	lw	s1,44(sp)
+    8ce0:	8fb00028 	lw	s0,40(sp)
+    8ce4:	03e00008 	jr	ra
+    8ce8:	27bd0050 	addiu	sp,sp,80
+    8cec:	24020050 	addiu	v0,zero,80
+    8cf0:	afa20010 	sw	v0,16(sp)
+    8cf4:	afb70014 	sw	s7,20(sp)
+    8cf8:	3c020004 	lui	v0,0x4
+    8cfc:	afb60018 	sw	s6,24(sp)
+    8d00:	8c449100 	lw	a0,-28416(v0)
+    8d04:	3c060003 	lui	a2,0x3
+    8d08:	8ec20000 	lw	v0,0(s6)
+    8d0c:	24c64b90 	addiu	a2,a2,19344
+    8d10:	3c070003 	lui	a3,0x3
+    8d14:	24e74e94 	addiu	a3,a3,20116
+    8d18:	00002821 	addu	a1,zero,zero
+    8d1c:	0c0009b0 	jal	26c0 <__fprintk>
+    8d20:	afa2001c 	sw	v0,28(sp)
+    8d24:	8fbf004c 	lw	ra,76(sp)
+    8d28:	02001021 	addu	v0,s0,zero
+    8d2c:	8fbe0048 	lw	s8,72(sp)
+    8d30:	8fb70044 	lw	s7,68(sp)
+    8d34:	8fb60040 	lw	s6,64(sp)
+    8d38:	8fb5003c 	lw	s5,60(sp)
+    8d3c:	8fb40038 	lw	s4,56(sp)
+    8d40:	8fb30034 	lw	s3,52(sp)
+    8d44:	8fb20030 	lw	s2,48(sp)
+    8d48:	8fb1002c 	lw	s1,44(sp)
+    8d4c:	8fb00028 	lw	s0,40(sp)
+    8d50:	03e00008 	jr	ra
+    8d54:	27bd0050 	addiu	sp,sp,80
+    8d58:	00021080 	sll	v0,v0,0x2
+    8d5c:	30430fff 	andi	v1,v0,0xfff
+    8d60:	1060001e 	beqz	v1,8ddc <args_len+0x228>
+    8d64:	2403f000 	addiu	v1,zero,-4096
+    8d68:	00431024 	and	v0,v0,v1
+    8d6c:	24421000 	addiu	v0,v0,4096
+    8d70:	00021302 	srl	v0,v0,0xc
+    8d74:	ae820000 	sw	v0,0(s4)
+    8d78:	8fbf004c 	lw	ra,76(sp)
+    8d7c:	8fa2005c 	lw	v0,92(sp)
+    8d80:	8fbe0048 	lw	s8,72(sp)
+    8d84:	ac570000 	sw	s7,0(v0)
+    8d88:	8fb60040 	lw	s6,64(sp)
+    8d8c:	02001021 	addu	v0,s0,zero
+    8d90:	8fb70044 	lw	s7,68(sp)
+    8d94:	8fb5003c 	lw	s5,60(sp)
+    8d98:	8fb40038 	lw	s4,56(sp)
+    8d9c:	8fb30034 	lw	s3,52(sp)
+    8da0:	8fb20030 	lw	s2,48(sp)
+    8da4:	8fb1002c 	lw	s1,44(sp)
+    8da8:	8fb00028 	lw	s0,40(sp)
+    8dac:	03e00008 	jr	ra
+    8db0:	27bd0050 	addiu	sp,sp,80
+    8db4:	2402005a 	addiu	v0,zero,90
+    8db8:	afa20010 	sw	v0,16(sp)
+    8dbc:	afb70014 	sw	s7,20(sp)
+    8dc0:	3c020004 	lui	v0,0x4
+    8dc4:	afb60018 	sw	s6,24(sp)
+    8dc8:	3c060003 	lui	a2,0x3
+    8dcc:	8c449100 	lw	a0,-28416(v0)
+    8dd0:	24c64be0 	addiu	a2,a2,19424
+    8dd4:	08002344 	j	8d10 <args_len+0x15c>
+    8dd8:	8ec20000 	lw	v0,0(s6)
+    8ddc:	0800235d 	j	8d74 <args_len+0x1c0>
+    8de0:	00021302 	srl	v0,v0,0xc
+
+00008de4 <kexec_strlen>:
+    8de4:	27bdffe0 	addiu	sp,sp,-32
+    8de8:	afbf001c 	sw	ra,28(sp)
+    8dec:	0c00c4d1 	jal	31344 <strlen>
+    8df0:	afa50010 	sw	a1,16(sp)
+    8df4:	8fa50010 	lw	a1,16(sp)
+    8df8:	8fbf001c 	lw	ra,28(sp)
+    8dfc:	aca20000 	sw	v0,0(a1)
+    8e00:	27bd0020 	addiu	sp,sp,32
+    8e04:	03e00008 	jr	ra
+    8e08:	00001021 	addu	v0,zero,zero
+
+00008e0c <kexec_copy>:
+    8e0c:	27bdffe8 	addiu	sp,sp,-24
+    8e10:	afbf0014 	sw	ra,20(sp)
+    8e14:	0c00c12b 	jal	304ac <memcpy>
+    8e18:	00000000 	sll	zero,zero,0x0
+    8e1c:	8fbf0014 	lw	ra,20(sp)
+    8e20:	00001021 	addu	v0,zero,zero
+    8e24:	03e00008 	jr	ra
+    8e28:	27bd0018 	addiu	sp,sp,24
+
+00008e2c <free_args>:
+    8e2c:	27bdffe0 	addiu	sp,sp,-32
+    8e30:	afb20018 	sw	s2,24(sp)
+    8e34:	afb10014 	sw	s1,20(sp)
+    8e38:	afb00010 	sw	s0,16(sp)
+    8e3c:	afbf001c 	sw	ra,28(sp)
+    8e40:	00809021 	addu	s2,a0,zero
+    8e44:	00008021 	addu	s0,zero,zero
+    8e48:	24110010 	addiu	s1,zero,16
+    8e4c:	02501021 	addu	v0,s2,s0
+    8e50:	8c420000 	lw	v0,0(v0)
+    8e54:	26100004 	addiu	s0,s0,4
+    8e58:	10400003 	beqz	v0,8e68 <free_args+0x3c>
+    8e5c:	00402021 	addu	a0,v0,zero
+    8e60:	0c007d65 	jal	1f594 <ppm_free_pages>
+    8e64:	00000000 	sll	zero,zero,0x0
+    8e68:	1611fff9 	bne	s0,s1,8e50 <free_args+0x24>
+    8e6c:	02501021 	addu	v0,s2,s0
+    8e70:	8fbf001c 	lw	ra,28(sp)
+    8e74:	8fb20018 	lw	s2,24(sp)
+    8e78:	8fb10014 	lw	s1,20(sp)
+    8e7c:	8fb00010 	lw	s0,16(sp)
+    8e80:	03e00008 	jr	ra
+    8e84:	27bd0020 	addiu	sp,sp,32
+
+00008e88 <map_args>:
+    8e88:	27bdffb8 	addiu	sp,sp,-72
+    8e8c:	00c7102b 	sltu	v0,a2,a3
+    8e90:	afb4003c 	sw	s4,60(sp)
+    8e94:	afb30038 	sw	s3,56(sp)
+    8e98:	afbf0044 	sw	ra,68(sp)
+    8e9c:	afb50040 	sw	s5,64(sp)
+    8ea0:	afb20034 	sw	s2,52(sp)
+    8ea4:	afb10030 	sw	s1,48(sp)
+    8ea8:	afb0002c 	sw	s0,44(sp)
+    8eac:	00e09821 	addu	s3,a3,zero
+    8eb0:	8c8302e0 	lw	v1,736(a0)
+    8eb4:	10400021 	beqz	v0,8f3c <map_args+0xb4>
+    8eb8:	24940250 	addiu	s4,a0,592
+    8ebc:	00068080 	sll	s0,a2,0x2
+    8ec0:	3c028d00 	lui	v0,0x8d00
+    8ec4:	afa20010 	sw	v0,16(sp)
+    8ec8:	afa30018 	sw	v1,24(sp)
+    8ecc:	00b08021 	addu	s0,a1,s0
+    8ed0:	00c08821 	addu	s1,a2,zero
+    8ed4:	8fb20058 	lw	s2,88(sp)
+    8ed8:	080023bc 	j	8ef0 <map_args+0x68>
+    8edc:	27b50010 	addiu	s5,sp,16
+    8ee0:	ae000000 	sw	zero,0(s0)
+    8ee4:	1060000c 	beqz	v1,8f18 <map_args+0x90>
+    8ee8:	26100004 	addiu	s0,s0,4
+    8eec:	26521000 	addiu	s2,s2,4096
+    8ef0:	8e040000 	lw	a0,0(s0)
+    8ef4:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+    8ef8:	26310001 	addiu	s1,s1,1
+    8efc:	02402821 	addu	a1,s2,zero
+    8f00:	02802021 	addu	a0,s4,zero
+    8f04:	02a03021 	addu	a2,s5,zero
+    8f08:	0c000c15 	jal	3054 <pmm_set_page>
+    8f0c:	afa20014 	sw	v0,20(sp)
+    8f10:	1040fff3 	beqz	v0,8ee0 <map_args+0x58>
+    8f14:	0233182b 	sltu	v1,s1,s3
+    8f18:	8fbf0044 	lw	ra,68(sp)
+    8f1c:	8fb50040 	lw	s5,64(sp)
+    8f20:	8fb4003c 	lw	s4,60(sp)
+    8f24:	8fb30038 	lw	s3,56(sp)
+    8f28:	8fb20034 	lw	s2,52(sp)
+    8f2c:	8fb10030 	lw	s1,48(sp)
+    8f30:	8fb0002c 	lw	s0,44(sp)
+    8f34:	03e00008 	jr	ra
+    8f38:	27bd0048 	addiu	sp,sp,72
+    8f3c:	080023c6 	j	8f18 <map_args+0x90>
+    8f40:	00001021 	addu	v0,zero,zero
+
+00008f44 <do_exec>:
+    8f44:	27bdff70 	addiu	sp,sp,-144
+    8f48:	3c020004 	lui	v0,0x4
+    8f4c:	afb60088 	sw	s6,136(sp)
+    8f50:	afb40080 	sw	s4,128(sp)
+    8f54:	afb3007c 	sw	s3,124(sp)
+    8f58:	afb20078 	sw	s2,120(sp)
+    8f5c:	afb00070 	sw	s0,112(sp)
+    8f60:	2443c960 	addiu	v1,v0,-13984
+    8f64:	afbf008c 	sw	ra,140(sp)
+    8f68:	afb50084 	sw	s5,132(sp)
+    8f6c:	afb10074 	sw	s1,116(sp)
+    8f70:	88630003 	lwl	v1,3(v1)
+    8f74:	00808021 	addu	s0,a0,zero
+    8f78:	9843c960 	lwr	v1,-13984(v0)
+    8f7c:	8fb200a4 	lw	s2,164(sp)
+    8f80:	3063ffff 	andi	v1,v1,0xffff
+    8f84:	00031280 	sll	v0,v1,0xa
+    8f88:	8c8405c4 	lw	a0,1476(a0)
+    8f8c:	24480001 	addiu	t0,v0,1
+    8f90:	afa70048 	sw	a3,72(sp)
+    8f94:	00a0b021 	addu	s6,a1,zero
+    8f98:	00c0a021 	addu	s4,a2,zero
+    8f9c:	afb20044 	sw	s2,68(sp)
+    8fa0:	10880031 	beq	a0,t0,9068 <do_exec+0x124>
+    8fa4:	8fb300a0 	lw	s3,160(sp)
+    8fa8:	1460002f 	bnez	v1,9068 <do_exec+0x124>
+    8fac:	26110180 	addiu	s1,s0,384
+    8fb0:	0c0085ba 	jal	216e8 <vmm_destroy>
+    8fb4:	02202021 	addu	a0,s1,zero
+    8fb8:	0c000c53 	jal	314c <pmm_release>
+    8fbc:	26040250 	addiu	a0,s0,592
+    8fc0:	0c0085df 	jal	2177c <vmm_init>
+    8fc4:	02202021 	addu	a0,s1,zero
+    8fc8:	1440001c 	bnez	v0,903c <do_exec+0xf8>
+    8fcc:	00408821 	addu	s1,v0,zero
+    8fd0:	3c02fff8 	lui	v0,0xfff8
+    8fd4:	02429021 	addu	s2,s2,v0
+    8fd8:	3c078000 	lui	a3,0x8000
+    8fdc:	3c020008 	lui	v0,0x8
+    8fe0:	02403021 	addu	a2,s2,zero
+    8fe4:	00f23823 	subu	a3,a3,s2
+    8fe8:	afa20038 	sw	v0,56(sp)
+    8fec:	24150003 	addiu	s5,zero,3
+    8ff0:	2402004e 	addiu	v0,zero,78
+    8ff4:	02002021 	addu	a0,s0,zero
+    8ff8:	00002821 	addu	a1,zero,zero
+    8ffc:	afb20034 	sw	s2,52(sp)
+    9000:	afa20014 	sw	v0,20(sp)
+    9004:	afb50010 	sw	s5,16(sp)
+    9008:	afa00018 	sw	zero,24(sp)
+    900c:	0c0084ee 	jal	213b8 <vmm_mmap>
+    9010:	2412ffff 	addiu	s2,zero,-1
+    9014:	10520065 	beq	v0,s2,91ac <do_exec+0x268>
+    9018:	8fa20048 	lw	v0,72(sp)
+    901c:	02002021 	addu	a0,s0,zero
+    9020:	02802821 	addu	a1,s4,zero
+    9024:	00003021 	addu	a2,zero,zero
+    9028:	02603821 	addu	a3,s3,zero
+    902c:	0c0023a2 	jal	8e88 <map_args>
+    9030:	afa20010 	sw	v0,16(sp)
+    9034:	1040001b 	beqz	v0,90a4 <do_exec+0x160>
+    9038:	00408821 	addu	s1,v0,zero
+    903c:	8fbf008c 	lw	ra,140(sp)
+    9040:	02201021 	addu	v0,s1,zero
+    9044:	8fb60088 	lw	s6,136(sp)
+    9048:	8fb50084 	lw	s5,132(sp)
+    904c:	8fb40080 	lw	s4,128(sp)
+    9050:	8fb3007c 	lw	s3,124(sp)
+    9054:	8fb20078 	lw	s2,120(sp)
+    9058:	8fb10074 	lw	s1,116(sp)
+    905c:	8fb00070 	lw	s0,112(sp)
+    9060:	03e00008 	jr	ra
+    9064:	27bd0090 	addiu	sp,sp,144
+    9068:	1082ffda 	beq	a0,v0,8fd4 <do_exec+0x90>
+    906c:	3c02fff8 	lui	v0,0xfff8
+    9070:	1060ffd8 	beqz	v1,8fd4 <do_exec+0x90>
+    9074:	00000000 	sll	zero,zero,0x0
+    9078:	26110180 	addiu	s1,s0,384
+    907c:	0c0085ba 	jal	216e8 <vmm_destroy>
+    9080:	02202021 	addu	a0,s1,zero
+    9084:	0c000c53 	jal	314c <pmm_release>
+    9088:	26040250 	addiu	a0,s0,592
+    908c:	0c0085df 	jal	2177c <vmm_init>
+    9090:	02202021 	addu	a0,s1,zero
+    9094:	1440ffe9 	bnez	v0,903c <do_exec+0xf8>
+    9098:	00408821 	addu	s1,v0,zero
+    909c:	080023f5 	j	8fd4 <do_exec+0x90>
+    90a0:	3c02fff8 	lui	v0,0xfff8
+    90a4:	8fa20044 	lw	v0,68(sp)
+    90a8:	8fa700a8 	lw	a3,168(sp)
+    90ac:	02802821 	addu	a1,s4,zero
+    90b0:	02603021 	addu	a2,s3,zero
+    90b4:	02002021 	addu	a0,s0,zero
+    90b8:	0c0023a2 	jal	8e88 <map_args>
+    90bc:	afa20010 	sw	v0,16(sp)
+    90c0:	1440ffde 	bnez	v0,903c <do_exec+0xf8>
+    90c4:	00408821 	addu	s1,v0,zero
+    90c8:	02c02021 	addu	a0,s6,zero
+    90cc:	0c00b96e 	jal	2e5b8 <elf_load_task>
+    90d0:	02002821 	addu	a1,s0,zero
+    90d4:	1440004d 	bnez	v0,920c <do_exec+0x2c8>
+    90d8:	00408821 	addu	s1,v0,zero
+    90dc:	8e0602cc 	lw	a2,716(s0)
+    90e0:	24020846 	addiu	v0,zero,2118
+    90e4:	02002021 	addu	a0,s0,zero
+    90e8:	00002821 	addu	a1,zero,zero
+    90ec:	3c070001 	lui	a3,0x1
+    90f0:	afb50010 	sw	s5,16(sp)
+    90f4:	afa20014 	sw	v0,20(sp)
+    90f8:	0c0084ee 	jal	213b8 <vmm_mmap>
+    90fc:	afa00018 	sw	zero,24(sp)
+    9100:	10520071 	beq	v0,s2,92c8 <do_exec+0x384>
+    9104:	00000000 	sll	zero,zero,0x0
+    9108:	8e0302d0 	lw	v1,720(s0)
+    910c:	3c020001 	lui	v0,0x1
+    9110:	00621021 	addu	v0,v1,v0
+    9114:	ae0202d0 	sw	v0,720(s0)
+    9118:	40022002 	mfc0	v0,$4,2
+    911c:	8c430304 	lw	v1,772(v0)
+    9120:	8e0202e4 	lw	v0,740(s0)
+    9124:	34630001 	ori	v1,v1,0x1
+    9128:	afa30028 	sw	v1,40(sp)
+    912c:	afa0002c 	sw	zero,44(sp)
+    9130:	8c430000 	lw	v1,0(v0)
+    9134:	8e0402e0 	lw	a0,736(s0)
+    9138:	27a50024 	addiu	a1,sp,36
+    913c:	8c890400 	lw	t1,1024(a0)
+    9140:	afa30060 	sw	v1,96(sp)
+    9144:	8c480004 	lw	t0,4(v0)
+    9148:	8fa20038 	lw	v0,56(sp)
+    914c:	8fa30034 	lw	v1,52(sp)
+    9150:	2442f800 	addiu	v0,v0,-2048
+    9154:	8e0702d4 	lw	a3,724(s0)
+    9158:	00621821 	addu	v1,v1,v0
+    915c:	afa30050 	sw	v1,80(sp)
+    9160:	02002021 	addu	a0,s0,zero
+    9164:	24030800 	addiu	v1,zero,2048
+    9168:	27a60020 	addiu	a2,sp,32
+    916c:	a7a9005c 	sh	t1,92(sp)
+    9170:	afa80064 	sw	t0,100(sp)
+    9174:	afa7003c 	sw	a3,60(sp)
+    9178:	afa30054 	sw	v1,84(sp)
+    917c:	afa00040 	sw	zero,64(sp)
+    9180:	afa20038 	sw	v0,56(sp)
+    9184:	0c00683c 	jal	1a0f0 <thread_create>
+    9188:	afa0004c 	sw	zero,76(sp)
+    918c:	10400025 	beqz	v0,9224 <do_exec+0x2e0>
+    9190:	00408821 	addu	s1,v0,zero
+    9194:	3c020004 	lui	v0,0x4
+    9198:	3c060003 	lui	a2,0x3
+    919c:	8c449100 	lw	a0,-28416(v0)
+    91a0:	24c64cec 	addiu	a2,a2,19692
+    91a4:	08002472 	j	91c8 <do_exec+0x284>
+    91a8:	8e0205c4 	lw	v0,1476(s0)
+    91ac:	40022002 	mfc0	v0,$4,2
+    91b0:	3c030004 	lui	v1,0x4
+    91b4:	8c510258 	lw	s1,600(v0)
+    91b8:	3c060003 	lui	a2,0x3
+    91bc:	8c649100 	lw	a0,-28416(v1)
+    91c0:	8e0205c4 	lw	v0,1476(s0)
+    91c4:	24c64c28 	addiu	a2,a2,19496
+    91c8:	3c070003 	lui	a3,0x3
+    91cc:	24e74e7c 	addiu	a3,a3,20092
+    91d0:	00002821 	addu	a1,zero,zero
+    91d4:	afb10014 	sw	s1,20(sp)
+    91d8:	0c0009b0 	jal	26c0 <__fprintk>
+    91dc:	afa20010 	sw	v0,16(sp)
+    91e0:	8fbf008c 	lw	ra,140(sp)
+    91e4:	02201021 	addu	v0,s1,zero
+    91e8:	8fb60088 	lw	s6,136(sp)
+    91ec:	8fb50084 	lw	s5,132(sp)
+    91f0:	8fb40080 	lw	s4,128(sp)
+    91f4:	8fb3007c 	lw	s3,124(sp)
+    91f8:	8fb20078 	lw	s2,120(sp)
+    91fc:	8fb10074 	lw	s1,116(sp)
+    9200:	8fb00070 	lw	s0,112(sp)
+    9204:	03e00008 	jr	ra
+    9208:	27bd0090 	addiu	sp,sp,144
+    920c:	3c020004 	lui	v0,0x4
+    9210:	3c060003 	lui	a2,0x3
+    9214:	8c449100 	lw	a0,-28416(v0)
+    9218:	24c64c64 	addiu	a2,a2,19556
+    921c:	08002472 	j	91c8 <do_exec+0x284>
+    9220:	8e0205c4 	lw	v0,1476(s0)
+    9224:	8e020748 	lw	v0,1864(s0)
+    9228:	8fa30020 	lw	v1,32(sp)
+    922c:	8e060630 	lw	a2,1584(s0)
+    9230:	8c450000 	lw	a1,0(v0)
+    9234:	246401f0 	addiu	a0,v1,496
+    9238:	24c60001 	addiu	a2,a2,1
+    923c:	24130001 	addiu	s3,zero,1
+    9240:	ac6501f0 	sw	a1,496(v1)
+    9244:	ac6201f4 	sw	v0,500(v1)
+    9248:	ae060630 	sw	a2,1584(s0)
+    924c:	aca40004 	sw	a0,4(a1)
+    9250:	ac440000 	sw	a0,0(v0)
+    9254:	ae13062c 	sw	s3,1580(s0)
+    9258:	26040640 	addiu	a0,s0,1600
+    925c:	00002821 	addu	a1,zero,zero
+    9260:	0c00b895 	jal	2e254 <bitmap_ffs2>
+    9264:	24060100 	addiu	a2,zero,256
+    9268:	1052ff74 	beq	v0,s2,903c <do_exec+0xf8>
+    926c:	00022142 	srl	a0,v0,0x5
+    9270:	8e060740 	lw	a2,1856(s0)
+    9274:	24840190 	addiu	a0,a0,400
+    9278:	8fa30020 	lw	v1,32(sp)
+    927c:	00042080 	sll	a0,a0,0x2
+    9280:	00022880 	sll	a1,v0,0x2
+    9284:	00c52821 	addu	a1,a2,a1
+    9288:	02042021 	addu	a0,s0,a0
+    928c:	aca30000 	sw	v1,0(a1)
+    9290:	00533004 	sllv	a2,s3,v0
+    9294:	8c850000 	lw	a1,0(a0)
+    9298:	00063027 	nor	a2,zero,a2
+    929c:	00c53024 	and	a2,a2,a1
+    92a0:	ac860000 	sw	a2,0(a0)
+    92a4:	8fa60020 	lw	a2,32(sp)
+    92a8:	8fa400ac 	lw	a0,172(sp)
+    92ac:	24450001 	addiu	a1,v0,1
+    92b0:	ac620300 	sw	v0,768(v1)
+    92b4:	ac6202f8 	sw	v0,760(v1)
+    92b8:	ac860000 	sw	a2,0(a0)
+    92bc:	ae050638 	sw	a1,1592(s0)
+    92c0:	0800240f 	j	903c <do_exec+0xf8>
+    92c4:	ae02063c 	sw	v0,1596(s0)
+    92c8:	40022002 	mfc0	v0,$4,2
+    92cc:	3c030004 	lui	v1,0x4
+    92d0:	3c060003 	lui	a2,0x3
+    92d4:	8c510258 	lw	s1,600(v0)
+    92d8:	8c649100 	lw	a0,-28416(v1)
+    92dc:	8e0205c4 	lw	v0,1476(s0)
+    92e0:	08002472 	j	91c8 <do_exec+0x284>
+    92e4:	24c64cb4 	addiu	a2,a2,19636
+
+000092e8 <compute_args>:
+    92e8:	27bdff90 	addiu	sp,sp,-112
+    92ec:	afb40058 	sw	s4,88(sp)
+    92f0:	afb20050 	sw	s2,80(sp)
+    92f4:	8fb40094 	lw	s4,148(sp)
+    92f8:	8fb20090 	lw	s2,144(sp)
+    92fc:	3c030066 	lui	v1,0x66
+    9300:	8c8202e0 	lw	v0,736(a0)
+    9304:	afbe0068 	sw	s8,104(sp)
+    9308:	afb5005c 	sw	s5,92(sp)
+    930c:	00a0f021 	addu	s8,a1,zero
+    9310:	8fb5008c 	lw	s5,140(sp)
+    9314:	34630040 	ori	v1,v1,0x40
+    9318:	afb30054 	sw	s3,84(sp)
+    931c:	00e02821 	addu	a1,a3,zero
+    9320:	00c09821 	addu	s3,a2,zero
+    9324:	afa30030 	sw	v1,48(sp)
+    9328:	afa0002c 	sw	zero,44(sp)
+    932c:	afa0001c 	sw	zero,28(sp)
+    9330:	afa00018 	sw	zero,24(sp)
+    9334:	afb20010 	sw	s2,16(sp)
+    9338:	afb40014 	sw	s4,20(sp)
+    933c:	03c02021 	addu	a0,s8,zero
+    9340:	27a6001c 	addiu	a2,sp,28
+    9344:	27a70018 	addiu	a3,sp,24
+    9348:	afb70064 	sw	s7,100(sp)
+    934c:	afb60060 	sw	s6,96(sp)
+    9350:	afb00048 	sw	s0,72(sp)
+    9354:	afbf006c 	sw	ra,108(sp)
+    9358:	afb1004c 	sw	s1,76(sp)
+    935c:	afa20034 	sw	v0,52(sp)
+    9360:	afa00028 	sw	zero,40(sp)
+    9364:	8fb60084 	lw	s6,132(sp)
+    9368:	8fb70088 	lw	s7,136(sp)
+    936c:	0c0022ed 	jal	8bb4 <args_len>
+    9370:	8eb00000 	lw	s0,0(s5)
+    9374:	14400025 	bnez	v0,940c <compute_args+0x124>
+    9378:	8fa3001c 	lw	v1,28(sp)
+    937c:	8ee50000 	lw	a1,0(s7)
+    9380:	02032021 	addu	a0,s0,v1
+    9384:	00601021 	addu	v0,v1,zero
+    9388:	0204202b 	sltu	a0,s0,a0
+    938c:	00a31821 	addu	v1,a1,v1
+    9390:	1080002c 	beqz	a0,9444 <compute_args+0x15c>
+    9394:	aee30000 	sw	v1,0(s7)
+    9398:	00102080 	sll	a0,s0,0x2
+    939c:	afa40038 	sw	a0,56(sp)
+    93a0:	0264b821 	addu	s7,s3,a0
+    93a4:	080024f0 	j	93c0 <compute_args+0xd8>
+    93a8:	02008821 	addu	s1,s0,zero
+    93ac:	8fa2001c 	lw	v0,28(sp)
+    93b0:	02021821 	addu	v1,s0,v0
+    93b4:	0223182b 	sltu	v1,s1,v1
+    93b8:	10600024 	beqz	v1,944c <compute_args+0x164>
+    93bc:	26f70004 	addiu	s7,s7,4
+    93c0:	0c00713f 	jal	1c4fc <kmem_alloc>
+    93c4:	27a40028 	addiu	a0,sp,40
+    93c8:	26310001 	addiu	s1,s1,1
+    93cc:	1440fff7 	bnez	v0,93ac <compute_args+0xc4>
+    93d0:	aee20000 	sw	v0,0(s7)
+    93d4:	2411000c 	addiu	s1,zero,12
+    93d8:	8fbf006c 	lw	ra,108(sp)
+    93dc:	02201021 	addu	v0,s1,zero
+    93e0:	8fbe0068 	lw	s8,104(sp)
+    93e4:	8fb70064 	lw	s7,100(sp)
+    93e8:	8fb60060 	lw	s6,96(sp)
+    93ec:	8fb5005c 	lw	s5,92(sp)
+    93f0:	8fb40058 	lw	s4,88(sp)
+    93f4:	8fb30054 	lw	s3,84(sp)
+    93f8:	8fb20050 	lw	s2,80(sp)
+    93fc:	8fb1004c 	lw	s1,76(sp)
+    9400:	8fb00048 	lw	s0,72(sp)
+    9404:	03e00008 	jr	ra
+    9408:	27bd0070 	addiu	sp,sp,112
+    940c:	8fbf006c 	lw	ra,108(sp)
+    9410:	00408821 	addu	s1,v0,zero
+    9414:	02201021 	addu	v0,s1,zero
+    9418:	8fbe0068 	lw	s8,104(sp)
+    941c:	8fb70064 	lw	s7,100(sp)
+    9420:	8fb60060 	lw	s6,96(sp)
+    9424:	8fb5005c 	lw	s5,92(sp)
+    9428:	8fb40058 	lw	s4,88(sp)
+    942c:	8fb30054 	lw	s3,84(sp)
+    9430:	8fb20050 	lw	s2,80(sp)
+    9434:	8fb1004c 	lw	s1,76(sp)
+    9438:	8fb00048 	lw	s0,72(sp)
+    943c:	03e00008 	jr	ra
+    9440:	27bd0070 	addiu	sp,sp,112
+    9444:	00101880 	sll	v1,s0,0x2
+    9448:	afa30038 	sw	v1,56(sp)
+    944c:	8fa40038 	lw	a0,56(sp)
+    9450:	00021300 	sll	v0,v0,0xc
+    9454:	02641821 	addu	v1,s3,a0
+    9458:	8fa40080 	lw	a0,128(sp)
+    945c:	00821023 	subu	v0,a0,v0
+    9460:	8c640000 	lw	a0,0(v1)
+    9464:	0c007c15 	jal	1f054 <ppm_page2addr>
+    9468:	aec20000 	sw	v0,0(s6)
+    946c:	8fb70018 	lw	s7,24(sp)
+    9470:	afa2003c 	sw	v0,60(sp)
+    9474:	26f70001 	addiu	s7,s7,1
+    9478:	0017b880 	sll	s7,s7,0x2
+    947c:	2ee21001 	sltiu	v0,s7,4097
+    9480:	14400091 	bnez	v0,96c8 <compute_args+0x3e0>
+    9484:	afa0001c 	sw	zero,28(sp)
+    9488:	26020001 	addiu	v0,s0,1
+    948c:	00021080 	sll	v0,v0,0x2
+    9490:	02621021 	addu	v0,s3,v0
+    9494:	8fa3003c 	lw	v1,60(sp)
+    9498:	afa20038 	sw	v0,56(sp)
+    949c:	00002821 	addu	a1,zero,zero
+    94a0:	00052b80 	sll	a1,a1,0xe
+    94a4:	00602021 	addu	a0,v1,zero
+    94a8:	03c52821 	addu	a1,s8,a1
+    94ac:	0240f809 	jalr	s2
+    94b0:	24061000 	addiu	a2,zero,4096
+    94b4:	26f7f000 	addiu	s7,s7,-4096
+    94b8:	1440ffc7 	bnez	v0,93d8 <compute_args+0xf0>
+    94bc:	00408821 	addu	s1,v0,zero
+    94c0:	8fa20038 	lw	v0,56(sp)
+    94c4:	26100001 	addiu	s0,s0,1
+    94c8:	0c007c15 	jal	1f054 <ppm_page2addr>
+    94cc:	8c440000 	lw	a0,0(v0)
+    94d0:	8fa5001c 	lw	a1,28(sp)
+    94d4:	8fa40038 	lw	a0,56(sp)
+    94d8:	00401821 	addu	v1,v0,zero
+    94dc:	24a50001 	addiu	a1,a1,1
+    94e0:	24840004 	addiu	a0,a0,4
+    94e4:	2ee21001 	sltiu	v0,s7,4097
+    94e8:	afa5001c 	sw	a1,28(sp)
+    94ec:	1040ffec 	beqz	v0,94a0 <compute_args+0x1b8>
+    94f0:	afa40038 	sw	a0,56(sp)
+    94f4:	16e00068 	bnez	s7,9698 <compute_args+0x3b0>
+    94f8:	00000000 	sll	zero,zero,0x0
+    94fc:	8fa20018 	lw	v0,24(sp)
+    9500:	10400045 	beqz	v0,9618 <compute_args+0x330>
+    9504:	00000000 	sll	zero,zero,0x0
+    9508:	02e31821 	addu	v1,s7,v1
+    950c:	afbe0038 	sw	s8,56(sp)
+    9510:	afa00040 	sw	zero,64(sp)
+    9514:	8fa50038 	lw	a1,56(sp)
+    9518:	afa30044 	sw	v1,68(sp)
+    951c:	27a40020 	addiu	a0,sp,32
+    9520:	0240f809 	jalr	s2
+    9524:	24060004 	addiu	a2,zero,4
+    9528:	00408821 	addu	s1,v0,zero
+    952c:	14400068 	bnez	v0,96d0 <compute_args+0x3e8>
+    9530:	8fa30044 	lw	v1,68(sp)
+    9534:	8fa40020 	lw	a0,32(sp)
+    9538:	afa30044 	sw	v1,68(sp)
+    953c:	0280f809 	jalr	s4
+    9540:	27a50024 	addiu	a1,sp,36
+    9544:	00408821 	addu	s1,v0,zero
+    9548:	1440ffa3 	bnez	v0,93d8 <compute_args+0xf0>
+    954c:	8fa30044 	lw	v1,68(sp)
+    9550:	8fa2001c 	lw	v0,28(sp)
+    9554:	8ec40000 	lw	a0,0(s6)
+    9558:	8fa60024 	lw	a2,36(sp)
+    955c:	00021300 	sll	v0,v0,0xc
+    9560:	00441021 	addu	v0,v0,a0
+    9564:	8fa4003c 	lw	a0,60(sp)
+    9568:	24c60001 	addiu	a2,a2,1
+    956c:	00571021 	addu	v0,v0,s7
+    9570:	ac820000 	sw	v0,0(a0)
+    9574:	10c0001b 	beqz	a2,95e4 <compute_args+0x2fc>
+    9578:	afa60024 	sw	a2,36(sp)
+    957c:	24041000 	addiu	a0,zero,4096
+    9580:	30c20007 	andi	v0,a2,0x7
+    9584:	14400040 	bnez	v0,9688 <compute_args+0x3a0>
+    9588:	0097f023 	subu	s8,a0,s7
+    958c:	00c01021 	addu	v0,a2,zero
+    9590:	005e102b 	sltu	v0,v0,s8
+    9594:	10400024 	beqz	v0,9628 <compute_args+0x340>
+    9598:	8fa50020 	lw	a1,32(sp)
+    959c:	00602021 	addu	a0,v1,zero
+    95a0:	0240f809 	jalr	s2
+    95a4:	afa30044 	sw	v1,68(sp)
+    95a8:	00408821 	addu	s1,v0,zero
+    95ac:	1440ff8a 	bnez	v0,93d8 <compute_args+0xf0>
+    95b0:	8fa30044 	lw	v1,68(sp)
+    95b4:	8fa20024 	lw	v0,36(sp)
+    95b8:	30440007 	andi	a0,v0,0x7
+    95bc:	10800003 	beqz	a0,95cc <compute_args+0x2e4>
+    95c0:	2404fff8 	addiu	a0,zero,-8
+    95c4:	00441024 	and	v0,v0,a0
+    95c8:	24420008 	addiu	v0,v0,8
+    95cc:	afa00024 	sw	zero,36(sp)
+    95d0:	8fa60024 	lw	a2,36(sp)
+    95d4:	00621821 	addu	v1,v1,v0
+    95d8:	02e2b821 	addu	s7,s7,v0
+    95dc:	14c0ffe8 	bnez	a2,9580 <compute_args+0x298>
+    95e0:	24041000 	addiu	a0,zero,4096
+    95e4:	8fa20040 	lw	v0,64(sp)
+    95e8:	24420001 	addiu	v0,v0,1
+    95ec:	afa20040 	sw	v0,64(sp)
+    95f0:	8fa40040 	lw	a0,64(sp)
+    95f4:	8fa20018 	lw	v0,24(sp)
+    95f8:	0082102b 	sltu	v0,a0,v0
+    95fc:	8fa40038 	lw	a0,56(sp)
+    9600:	24840004 	addiu	a0,a0,4
+    9604:	afa40038 	sw	a0,56(sp)
+    9608:	8fa4003c 	lw	a0,60(sp)
+    960c:	24840004 	addiu	a0,a0,4
+    9610:	1440ffc0 	bnez	v0,9514 <compute_args+0x22c>
+    9614:	afa4003c 	sw	a0,60(sp)
+    9618:	26100001 	addiu	s0,s0,1
+    961c:	aeb00000 	sw	s0,0(s5)
+    9620:	080024f6 	j	93d8 <compute_args+0xf0>
+    9624:	00008821 	addu	s1,zero,zero
+    9628:	00602021 	addu	a0,v1,zero
+    962c:	0240f809 	jalr	s2
+    9630:	03c03021 	addu	a2,s8,zero
+    9634:	1440ff68 	bnez	v0,93d8 <compute_args+0xf0>
+    9638:	00408821 	addu	s1,v0,zero
+    963c:	8fa20024 	lw	v0,36(sp)
+    9640:	26100001 	addiu	s0,s0,1
+    9644:	2442f000 	addiu	v0,v0,-4096
+    9648:	00101880 	sll	v1,s0,0x2
+    964c:	02631821 	addu	v1,s3,v1
+    9650:	0057b821 	addu	s7,v0,s7
+    9654:	8fa20020 	lw	v0,32(sp)
+    9658:	8c640000 	lw	a0,0(v1)
+    965c:	005ef021 	addu	s8,v0,s8
+    9660:	afb70024 	sw	s7,36(sp)
+    9664:	0c007c15 	jal	1f054 <ppm_page2addr>
+    9668:	afbe0020 	sw	s8,32(sp)
+    966c:	00401821 	addu	v1,v0,zero
+    9670:	8fa2001c 	lw	v0,28(sp)
+    9674:	0000b821 	addu	s7,zero,zero
+    9678:	24420001 	addiu	v0,v0,1
+    967c:	afa2001c 	sw	v0,28(sp)
+    9680:	08002577 	j	95dc <compute_args+0x2f4>
+    9684:	8fa60024 	lw	a2,36(sp)
+    9688:	2404fff8 	addiu	a0,zero,-8
+    968c:	00c41024 	and	v0,a2,a0
+    9690:	08002564 	j	9590 <compute_args+0x2a8>
+    9694:	24420008 	addiu	v0,v0,8
+    9698:	8fa5001c 	lw	a1,28(sp)
+    969c:	00602021 	addu	a0,v1,zero
+    96a0:	00052b80 	sll	a1,a1,0xe
+    96a4:	afa30044 	sw	v1,68(sp)
+    96a8:	03c52821 	addu	a1,s8,a1
+    96ac:	0240f809 	jalr	s2
+    96b0:	02e03021 	addu	a2,s7,zero
+    96b4:	00408821 	addu	s1,v0,zero
+    96b8:	1040ff90 	beqz	v0,94fc <compute_args+0x214>
+    96bc:	8fa30044 	lw	v1,68(sp)
+    96c0:	080024f7 	j	93dc <compute_args+0xf4>
+    96c4:	8fbf006c 	lw	ra,108(sp)
+    96c8:	0800253d 	j	94f4 <compute_args+0x20c>
+    96cc:	8fa3003c 	lw	v1,60(sp)
+    96d0:	3c020004 	lui	v0,0x4
+    96d4:	8c449100 	lw	a0,-28416(v0)
+    96d8:	3c060003 	lui	a2,0x3
+    96dc:	3c070003 	lui	a3,0x3
+    96e0:	24c64d4c 	addiu	a2,a2,19788
+    96e4:	24e74e84 	addiu	a3,a3,20100
+    96e8:	0c0009b0 	jal	26c0 <__fprintk>
+    96ec:	00002821 	addu	a1,zero,zero
+    96f0:	080024f7 	j	93dc <compute_args+0xf4>
+    96f4:	8fbf006c 	lw	ra,108(sp)
+
+000096f8 <prepare_args>:
+    96f8:	27bdffa0 	addiu	sp,sp,-96
+    96fc:	afbe0058 	sw	s8,88(sp)
+    9700:	afb70054 	sw	s7,84(sp)
+    9704:	afb40048 	sw	s4,72(sp)
+    9708:	afb30044 	sw	s3,68(sp)
+    970c:	00c0a021 	addu	s4,a2,zero
+    9710:	afb20040 	sw	s2,64(sp)
+    9714:	afb1003c 	sw	s1,60(sp)
+    9718:	afb00038 	sw	s0,56(sp)
+    971c:	0080b821 	addu	s7,a0,zero
+    9720:	00e08021 	addu	s0,a3,zero
+    9724:	00e02021 	addu	a0,a3,zero
+    9728:	8fb30080 	lw	s3,128(sp)
+    972c:	8fb20084 	lw	s2,132(sp)
+    9730:	3c118000 	lui	s1,0x8000
+    9734:	24060010 	addiu	a2,zero,16
+    9738:	00a0f021 	addu	s8,a1,zero
+    973c:	00002821 	addu	a1,zero,zero
+    9740:	afbf005c 	sw	ra,92(sp)
+    9744:	afb60050 	sw	s6,80(sp)
+    9748:	afb5004c 	sw	s5,76(sp)
+    974c:	afb10028 	sw	s1,40(sp)
+    9750:	afa0002c 	sw	zero,44(sp)
+    9754:	afa00030 	sw	zero,48(sp)
+    9758:	0c00c182 	jal	30608 <memset>
+    975c:	27b60028 	addiu	s6,sp,40
+    9760:	27b5002c 	addiu	s5,sp,44
+    9764:	02802821 	addu	a1,s4,zero
+    9768:	02e02021 	addu	a0,s7,zero
+    976c:	27b40030 	addiu	s4,sp,48
+    9770:	02003021 	addu	a2,s0,zero
+    9774:	24070004 	addiu	a3,zero,4
+    9778:	afb10010 	sw	s1,16(sp)
+    977c:	afb60014 	sw	s6,20(sp)
+    9780:	afb50018 	sw	s5,24(sp)
+    9784:	afb4001c 	sw	s4,28(sp)
+    9788:	afb30020 	sw	s3,32(sp)
+    978c:	0c0024ba 	jal	92e8 <compute_args>
+    9790:	afb20024 	sw	s2,36(sp)
+    9794:	8fa50030 	lw	a1,48(sp)
+    9798:	8fa40074 	lw	a0,116(sp)
+    979c:	8fa30028 	lw	v1,40(sp)
+    97a0:	ac850000 	sw	a1,0(a0)
+    97a4:	8fa4007c 	lw	a0,124(sp)
+    97a8:	14400014 	bnez	v0,97fc <prepare_args+0x104>
+    97ac:	ac830000 	sw	v1,0(a0)
+    97b0:	8fa2002c 	lw	v0,44(sp)
+    97b4:	24070004 	addiu	a3,zero,4
+    97b8:	02e02021 	addu	a0,s7,zero
+    97bc:	03c02821 	addu	a1,s8,zero
+    97c0:	00e23823 	subu	a3,a3,v0
+    97c4:	02003021 	addu	a2,s0,zero
+    97c8:	afa30010 	sw	v1,16(sp)
+    97cc:	afb60014 	sw	s6,20(sp)
+    97d0:	afb50018 	sw	s5,24(sp)
+    97d4:	afb4001c 	sw	s4,28(sp)
+    97d8:	afb30020 	sw	s3,32(sp)
+    97dc:	0c0024ba 	jal	92e8 <compute_args>
+    97e0:	afb20024 	sw	s2,36(sp)
+    97e4:	8fa50030 	lw	a1,48(sp)
+    97e8:	8fa30070 	lw	v1,112(sp)
+    97ec:	8fa40028 	lw	a0,40(sp)
+    97f0:	ac650000 	sw	a1,0(v1)
+    97f4:	8fa30078 	lw	v1,120(sp)
+    97f8:	ac640000 	sw	a0,0(v1)
+    97fc:	8fbf005c 	lw	ra,92(sp)
+    9800:	8fbe0058 	lw	s8,88(sp)
+    9804:	8fb70054 	lw	s7,84(sp)
+    9808:	8fb60050 	lw	s6,80(sp)
+    980c:	8fb5004c 	lw	s5,76(sp)
+    9810:	8fb40048 	lw	s4,72(sp)
+    9814:	8fb30044 	lw	s3,68(sp)
+    9818:	8fb20040 	lw	s2,64(sp)
+    981c:	8fb1003c 	lw	s1,60(sp)
+    9820:	8fb00038 	lw	s0,56(sp)
+    9824:	03e00008 	jr	ra
+    9828:	27bd0060 	addiu	sp,sp,96
+
+0000982c <full_do_exec>:
+    982c:	27bdffa0 	addiu	sp,sp,-96
+    9830:	afb20050 	sw	s2,80(sp)
+    9834:	8fb20070 	lw	s2,112(sp)
+    9838:	27a20028 	addiu	v0,sp,40
+    983c:	ae400000 	sw	zero,0(s2)
+    9840:	afa20010 	sw	v0,16(sp)
+    9844:	27a2002c 	addiu	v0,sp,44
+    9848:	afa20014 	sw	v0,20(sp)
+    984c:	27a20030 	addiu	v0,sp,48
+    9850:	afa20018 	sw	v0,24(sp)
+    9854:	27a20034 	addiu	v0,sp,52
+    9858:	afa2001c 	sw	v0,28(sp)
+    985c:	8fa20078 	lw	v0,120(sp)
+    9860:	afb1004c 	sw	s1,76(sp)
+    9864:	afa20020 	sw	v0,32(sp)
+    9868:	27b10038 	addiu	s1,sp,56
+    986c:	8fa2007c 	lw	v0,124(sp)
+    9870:	afb30054 	sw	s3,84(sp)
+    9874:	00a09821 	addu	s3,a1,zero
+    9878:	00c02821 	addu	a1,a2,zero
+    987c:	00e03021 	addu	a2,a3,zero
+    9880:	02203821 	addu	a3,s1,zero
+    9884:	afb40058 	sw	s4,88(sp)
+    9888:	afb00048 	sw	s0,72(sp)
+    988c:	afbf005c 	sw	ra,92(sp)
+    9890:	afa20024 	sw	v0,36(sp)
+    9894:	0c0025be 	jal	96f8 <prepare_args>
+    9898:	0080a021 	addu	s4,a0,zero
+    989c:	1040000c 	beqz	v0,98d0 <full_do_exec+0xa4>
+    98a0:	00408021 	addu	s0,v0,zero
+    98a4:	0c00238b 	jal	8e2c <free_args>
+    98a8:	02202021 	addu	a0,s1,zero
+    98ac:	8fbf005c 	lw	ra,92(sp)
+    98b0:	02001021 	addu	v0,s0,zero
+    98b4:	8fb40058 	lw	s4,88(sp)
+    98b8:	8fb30054 	lw	s3,84(sp)
+    98bc:	8fb20050 	lw	s2,80(sp)
+    98c0:	8fb1004c 	lw	s1,76(sp)
+    98c4:	8fb00048 	lw	s0,72(sp)
+    98c8:	03e00008 	jr	ra
+    98cc:	27bd0060 	addiu	sp,sp,96
+    98d0:	8fa2002c 	lw	v0,44(sp)
+    98d4:	8fa70034 	lw	a3,52(sp)
+    98d8:	afa20010 	sw	v0,16(sp)
+    98dc:	8fa20030 	lw	v0,48(sp)
+    98e0:	02802021 	addu	a0,s4,zero
+    98e4:	afa20014 	sw	v0,20(sp)
+    98e8:	8fa20028 	lw	v0,40(sp)
+    98ec:	02602821 	addu	a1,s3,zero
+    98f0:	afa20018 	sw	v0,24(sp)
+    98f4:	8fa20074 	lw	v0,116(sp)
+    98f8:	02203021 	addu	a2,s1,zero
+    98fc:	0c0023d1 	jal	8f44 <do_exec>
+    9900:	afa2001c 	sw	v0,28(sp)
+    9904:	1040ffe9 	beqz	v0,98ac <full_do_exec+0x80>
+    9908:	00408021 	addu	s0,v0,zero
+    990c:	3c020004 	lui	v0,0x4
+    9910:	8c449100 	lw	a0,-28416(v0)
+    9914:	3c060003 	lui	a2,0x3
+    9918:	3c070003 	lui	a3,0x3
+    991c:	24c64d78 	addiu	a2,a2,19832
+    9920:	24e74e6c 	addiu	a3,a3,20076
+    9924:	0c0009b0 	jal	26c0 <__fprintk>
+    9928:	00002821 	addu	a1,zero,zero
+    992c:	24020001 	addiu	v0,zero,1
+    9930:	08002629 	j	98a4 <full_do_exec+0x78>
+    9934:	ae420000 	sw	v0,0(s2)
+
+00009938 <task_load_init>:
+    9938:	27bdfe88 	addiu	sp,sp,-376
+    993c:	3c030003 	lui	v1,0x3
+    9940:	afb20158 	sw	s2,344(sp)
+    9944:	afb10154 	sw	s1,340(sp)
+    9948:	24634d8c 	addiu	v1,v1,19852
+    994c:	3c120003 	lui	s2,0x3
+    9950:	3c110004 	lui	s1,0x4
+    9954:	26424dc8 	addiu	v0,s2,19912
+    9958:	afb3015c 	sw	s3,348(sp)
+    995c:	afa3002c 	sw	v1,44(sp)
+    9960:	00809821 	addu	s3,a0,zero
+    9964:	3c060003 	lui	a2,0x3
+    9968:	8e249100 	lw	a0,-28416(s1)
+    996c:	3c030003 	lui	v1,0x3
+    9970:	24634dd4 	addiu	v1,v1,19924
+    9974:	24c64ddc 	addiu	a2,a2,19932
+    9978:	00403821 	addu	a3,v0,zero
+    997c:	00002821 	addu	a1,zero,zero
+    9980:	afbf0174 	sw	ra,372(sp)
+    9984:	afa30038 	sw	v1,56(sp)
+    9988:	afb00150 	sw	s0,336(sp)
+    998c:	afbe0170 	sw	s8,368(sp)
+    9990:	afb7016c 	sw	s7,364(sp)
+    9994:	afb60168 	sw	s6,360(sp)
+    9998:	afb50164 	sw	s5,356(sp)
+    999c:	afb40160 	sw	s4,352(sp)
+    99a0:	afa00030 	sw	zero,48(sp)
+    99a4:	afa20034 	sw	v0,52(sp)
+    99a8:	0c0009b0 	jal	26c0 <__fprintk>
+    99ac:	afa0003c 	sw	zero,60(sp)
+    99b0:	3c020008 	lui	v0,0x8
+    99b4:	27b0005c 	addiu	s0,sp,92
+    99b8:	8c4426ec 	lw	a0,9964(v0)
+    99bc:	0c002913 	jal	a44c <dqdt_task_placement>
+    99c0:	02002821 	addu	a1,s0,zero
+    99c4:	3c030004 	lui	v1,0x4
+    99c8:	2462c960 	addiu	v0,v1,-13984
+    99cc:	88420003 	lwl	v0,3(v0)
+    99d0:	02002821 	addu	a1,s0,zero
+    99d4:	9862c960 	lwr	v0,-13984(v1)
+    99d8:	27a40020 	addiu	a0,sp,32
+    99dc:	3042ffff 	andi	v0,v0,0xffff
+    99e0:	3406fc11 	ori	a2,zero,0xfc11
+    99e4:	0c00655a 	jal	19568 <task_create>
+    99e8:	afa20060 	sw	v0,96(sp)
+    99ec:	1040000e 	beqz	v0,9a28 <task_load_init+0xf0>
+    99f0:	00408021 	addu	s0,v0,zero
+    99f4:	8fbf0174 	lw	ra,372(sp)
+    99f8:	02001021 	addu	v0,s0,zero
+    99fc:	8fbe0170 	lw	s8,368(sp)
+    9a00:	8fb7016c 	lw	s7,364(sp)
+    9a04:	8fb60168 	lw	s6,360(sp)
+    9a08:	8fb50164 	lw	s5,356(sp)
+    9a0c:	8fb40160 	lw	s4,352(sp)
+    9a10:	8fb3015c 	lw	s3,348(sp)
+    9a14:	8fb20158 	lw	s2,344(sp)
+    9a18:	8fb10154 	lw	s1,340(sp)
+    9a1c:	8fb00150 	lw	s0,336(sp)
+    9a20:	03e00008 	jr	ra
+    9a24:	27bd0178 	addiu	sp,sp,376
+    9a28:	8fa40020 	lw	a0,32(sp)
+    9a2c:	0c0085df 	jal	2177c <vmm_init>
+    9a30:	24840180 	addiu	a0,a0,384
+    9a34:	1440000e 	bnez	v0,9a70 <task_load_init+0x138>
+    9a38:	00408021 	addu	s0,v0,zero
+    9a3c:	8fa40020 	lw	a0,32(sp)
+    9a40:	3c050004 	lui	a1,0x4
+    9a44:	24840250 	addiu	a0,a0,592
+    9a48:	0c000d37 	jal	34dc <pmm_init>
+    9a4c:	24a56db0 	addiu	a1,a1,28080
+    9a50:	14400007 	bnez	v0,9a70 <task_load_init+0x138>
+    9a54:	00408021 	addu	s0,v0,zero
+    9a58:	8fa40020 	lw	a0,32(sp)
+    9a5c:	26650250 	addiu	a1,s3,592
+    9a60:	0c000ce6 	jal	3398 <pmm_dup>
+    9a64:	24840250 	addiu	a0,a0,592
+    9a68:	10400010 	beqz	v0,9aac <task_load_init+0x174>
+    9a6c:	00408021 	addu	s0,v0,zero
+    9a70:	0c0066f7 	jal	19bdc <task_destroy>
+    9a74:	8fa40020 	lw	a0,32(sp)
+    9a78:	8fbf0174 	lw	ra,372(sp)
+    9a7c:	02001021 	addu	v0,s0,zero
+    9a80:	8fbe0170 	lw	s8,368(sp)
+    9a84:	8fb7016c 	lw	s7,364(sp)
+    9a88:	8fb60168 	lw	s6,360(sp)
+    9a8c:	8fb50164 	lw	s5,356(sp)
+    9a90:	8fb40160 	lw	s4,352(sp)
+    9a94:	8fb3015c 	lw	s3,348(sp)
+    9a98:	8fb20158 	lw	s2,344(sp)
+    9a9c:	8fb10154 	lw	s1,340(sp)
+    9aa0:	8fb00150 	lw	s0,336(sp)
+    9aa4:	03e00008 	jr	ra
+    9aa8:	27bd0178 	addiu	sp,sp,376
+    9aac:	26700510 	addiu	s0,s3,1296
+    9ab0:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+    9ab4:	02002021 	addu	a0,s0,zero
+    9ab8:	8fa30020 	lw	v1,32(sp)
+    9abc:	02001021 	addu	v0,s0,zero
+    9ac0:	24630510 	addiu	v1,v1,1296
+    9ac4:	26740540 	addiu	s4,s3,1344
+    9ac8:	8c470000 	lw	a3,0(v0)
+    9acc:	8c460004 	lw	a2,4(v0)
+    9ad0:	8c450008 	lw	a1,8(v0)
+    9ad4:	8c44000c 	lw	a0,12(v0)
+    9ad8:	24420010 	addiu	v0,v0,16
+    9adc:	ac670000 	sw	a3,0(v1)
+    9ae0:	ac660004 	sw	a2,4(v1)
+    9ae4:	ac650008 	sw	a1,8(v1)
+    9ae8:	ac64000c 	sw	a0,12(v1)
+    9aec:	1454fff6 	bne	v0,s4,9ac8 <task_load_init+0x190>
+    9af0:	24630010 	addiu	v1,v1,16
+    9af4:	8e840008 	lw	a0,8(s4)
+    9af8:	8e850000 	lw	a1,0(s4)
+    9afc:	8e820004 	lw	v0,4(s4)
+    9b00:	ac640008 	sw	a0,8(v1)
+    9b04:	ac650000 	sw	a1,0(v1)
+    9b08:	ac620004 	sw	v0,4(v1)
+    9b0c:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+    9b10:	02002021 	addu	a0,s0,zero
+    9b14:	8fa20020 	lw	v0,32(sp)
+    9b18:	2443054c 	addiu	v1,v0,1356
+    9b1c:	8e070000 	lw	a3,0(s0)
+    9b20:	8e060004 	lw	a2,4(s0)
+    9b24:	8e050008 	lw	a1,8(s0)
+    9b28:	8e04000c 	lw	a0,12(s0)
+    9b2c:	26100010 	addiu	s0,s0,16
+    9b30:	ac670000 	sw	a3,0(v1)
+    9b34:	ac660004 	sw	a2,4(v1)
+    9b38:	ac650008 	sw	a1,8(v1)
+    9b3c:	ac64000c 	sw	a0,12(v1)
+    9b40:	1614fff6 	bne	s0,s4,9b1c <task_load_init+0x1e4>
+    9b44:	24630010 	addiu	v1,v1,16
+    9b48:	8e060008 	lw	a2,8(s0)
+    9b4c:	8e050000 	lw	a1,0(s0)
+    9b50:	8e040004 	lw	a0,4(s0)
+    9b54:	ac660008 	sw	a2,8(v1)
+    9b58:	ac650000 	sw	a1,0(v1)
+    9b5c:	ac640004 	sw	a0,4(v1)
+    9b60:	8e6305c4 	lw	v1,1476(s3)
+    9b64:	3c048000 	lui	a0,0x8000
+    9b68:	ac440290 	sw	a0,656(v0)
+    9b6c:	ac430618 	sw	v1,1560(v0)
+    9b70:	244405d4 	addiu	a0,v0,1492
+    9b74:	ac4005c8 	sw	zero,1480(v0)
+    9b78:	0c00199f 	jal	667c <atomic_init>
+    9b7c:	00002821 	addu	a1,zero,zero
+    9b80:	266405d4 	addiu	a0,s3,1492
+    9b84:	0c00199f 	jal	667c <atomic_init>
+    9b88:	24050001 	addiu	a1,zero,1
+    9b8c:	8e620620 	lw	v0,1568(s3)
+    9b90:	8fa40020 	lw	a0,32(sp)
+    9b94:	8c430000 	lw	v1,0(v0)
+    9b98:	24850624 	addiu	a1,a0,1572
+    9b9c:	ac830624 	sw	v1,1572(a0)
+    9ba0:	ac820628 	sw	v0,1576(a0)
+    9ba4:	27b50040 	addiu	s5,sp,64
+    9ba8:	ac650004 	sw	a1,4(v1)
+    9bac:	3c090001 	lui	t1,0x1
+    9bb0:	3c080001 	lui	t0,0x1
+    9bb4:	3c030001 	lui	v1,0x1
+    9bb8:	3c1e0001 	lui	s8,0x1
+    9bbc:	3c130001 	lui	s3,0x1
+    9bc0:	3c100003 	lui	s0,0x3
+    9bc4:	ac450000 	sw	a1,0(v0)
+    9bc8:	2529c048 	addiu	t1,t1,-16312
+    9bcc:	2508bff8 	addiu	t0,t0,-16392
+    9bd0:	2463be08 	addiu	v1,v1,-16888
+    9bd4:	2673bff0 	addiu	s3,s3,-16400
+    9bd8:	27debc88 	addiu	s8,s8,-17272
+    9bdc:	26104e00 	addiu	s0,s0,19968
+    9be0:	02a02821 	addu	a1,s5,zero
+    9be4:	2484054c 	addiu	a0,a0,1356
+    9be8:	3c060010 	lui	a2,0x10
+    9bec:	00003821 	addu	a3,zero,zero
+    9bf0:	27b70088 	addiu	s7,sp,136
+    9bf4:	afb00040 	sw	s0,64(sp)
+    9bf8:	afa90048 	sw	t1,72(sp)
+    9bfc:	afa8004c 	sw	t0,76(sp)
+    9c00:	afa30054 	sw	v1,84(sp)
+    9c04:	afb30058 	sw	s3,88(sp)
+    9c08:	afa30148 	sw	v1,328(sp)
+    9c0c:	afa80144 	sw	t0,324(sp)
+    9c10:	afa90140 	sw	t1,320(sp)
+    9c14:	afbe0050 	sw	s8,80(sp)
+    9c18:	afa00044 	sw	zero,68(sp)
+    9c1c:	0c00a4f2 	jal	293c8 <vfs_open>
+    9c20:	afb70010 	sw	s7,16(sp)
+    9c24:	8fa40020 	lw	a0,32(sp)
+    9c28:	8fa90140 	lw	t1,320(sp)
+    9c2c:	8fa80144 	lw	t0,324(sp)
+    9c30:	8fa30148 	lw	v1,328(sp)
+    9c34:	02a02821 	addu	a1,s5,zero
+    9c38:	2484054c 	addiu	a0,a0,1356
+    9c3c:	3c060020 	lui	a2,0x20
+    9c40:	00003821 	addu	a3,zero,zero
+    9c44:	27b600c4 	addiu	s6,sp,196
+    9c48:	afb00040 	sw	s0,64(sp)
+    9c4c:	afa90048 	sw	t1,72(sp)
+    9c50:	afa8004c 	sw	t0,76(sp)
+    9c54:	afa30054 	sw	v1,84(sp)
+    9c58:	afb30058 	sw	s3,88(sp)
+    9c5c:	0040a021 	addu	s4,v0,zero
+    9c60:	afbe0050 	sw	s8,80(sp)
+    9c64:	afa00044 	sw	zero,68(sp)
+    9c68:	0c00a4f2 	jal	293c8 <vfs_open>
+    9c6c:	afb60010 	sw	s6,16(sp)
+    9c70:	8fa40020 	lw	a0,32(sp)
+    9c74:	8fa90140 	lw	t1,320(sp)
+    9c78:	8fa80144 	lw	t0,324(sp)
+    9c7c:	8fa30148 	lw	v1,328(sp)
+    9c80:	00408021 	addu	s0,v0,zero
+    9c84:	3c020003 	lui	v0,0x3
+    9c88:	02a02821 	addu	a1,s5,zero
+    9c8c:	24424e0c 	addiu	v0,v0,19980
+    9c90:	2484054c 	addiu	a0,a0,1356
+    9c94:	27b50100 	addiu	s5,sp,256
+    9c98:	3c060020 	lui	a2,0x20
+    9c9c:	00003821 	addu	a3,zero,zero
+    9ca0:	afb30058 	sw	s3,88(sp)
+    9ca4:	afa20040 	sw	v0,64(sp)
+    9ca8:	afa90048 	sw	t1,72(sp)
+    9cac:	afa8004c 	sw	t0,76(sp)
+    9cb0:	afa30054 	sw	v1,84(sp)
+    9cb4:	afbe0050 	sw	s8,80(sp)
+    9cb8:	afa00044 	sw	zero,68(sp)
+    9cbc:	0c00a4f2 	jal	293c8 <vfs_open>
+    9cc0:	afb50010 	sw	s5,16(sp)
+    9cc4:	16800007 	bnez	s4,9ce4 <task_load_init+0x3ac>
+    9cc8:	00409821 	addu	s3,v0,zero
+    9ccc:	16000003 	bnez	s0,9cdc <task_load_init+0x3a4>
+    9cd0:	02e02021 	addu	a0,s7,zero
+    9cd4:	1040001b 	beqz	v0,9d44 <task_load_init+0x40c>
+    9cd8:	02e03021 	addu	a2,s7,zero
+    9cdc:	0c009f67 	jal	27d9c <vfs_close>
+    9ce0:	00002821 	addu	a1,zero,zero
+    9ce4:	1200000e 	beqz	s0,9d20 <task_load_init+0x3e8>
+    9ce8:	02c02021 	addu	a0,s6,zero
+    9cec:	12600010 	beqz	s3,9d30 <task_load_init+0x3f8>
+    9cf0:	00000000 	sll	zero,zero,0x0
+    9cf4:	8e249100 	lw	a0,-28416(s1)
+    9cf8:	3c060003 	lui	a2,0x3
+    9cfc:	24c64e18 	addiu	a2,a2,19992
+    9d00:	02803821 	addu	a3,s4,zero
+    9d04:	00002821 	addu	a1,zero,zero
+    9d08:	afb00010 	sw	s0,16(sp)
+    9d0c:	afb30014 	sw	s3,20(sp)
+    9d10:	0c0009b0 	jal	26c0 <__fprintk>
+    9d14:	2410000c 	addiu	s0,zero,12
+    9d18:	0800269c 	j	9a70 <task_load_init+0x138>
+    9d1c:	00000000 	sll	zero,zero,0x0
+    9d20:	0c009f67 	jal	27d9c <vfs_close>
+    9d24:	00002821 	addu	a1,zero,zero
+    9d28:	0800273b 	j	9cec <task_load_init+0x3b4>
+    9d2c:	00000000 	sll	zero,zero,0x0
+    9d30:	02a02021 	addu	a0,s5,zero
+    9d34:	0c009f67 	jal	27d9c <vfs_close>
+    9d38:	00002821 	addu	a1,zero,zero
+    9d3c:	0800273e 	j	9cf8 <task_load_init+0x3c0>
+    9d40:	8e249100 	lw	a0,-28416(s1)
+    9d44:	8fa40020 	lw	a0,32(sp)
+    9d48:	0c00614e 	jal	18538 <__task_fd_set>
+    9d4c:	00002821 	addu	a1,zero,zero
+    9d50:	8fa40020 	lw	a0,32(sp)
+    9d54:	02c03021 	addu	a2,s6,zero
+    9d58:	0c00614e 	jal	18538 <__task_fd_set>
+    9d5c:	24050001 	addiu	a1,zero,1
+    9d60:	8fa40020 	lw	a0,32(sp)
+    9d64:	02a03021 	addu	a2,s5,zero
+    9d68:	0c00614e 	jal	18538 <__task_fd_set>
+    9d6c:	24050002 	addiu	a1,zero,2
+    9d70:	40022002 	mfc0	v0,$4,2
+    9d74:	240300c8 	addiu	v1,zero,200
+    9d78:	ac430304 	sw	v1,772(v0)
+    9d7c:	27a20028 	addiu	v0,sp,40
+    9d80:	afa20010 	sw	v0,16(sp)
+    9d84:	27a20024 	addiu	v0,sp,36
+    9d88:	afa20014 	sw	v0,20(sp)
+    9d8c:	3c020001 	lui	v0,0x1
+    9d90:	24428e0c 	addiu	v0,v0,-29172
+    9d94:	afa20018 	sw	v0,24(sp)
+    9d98:	8fa40020 	lw	a0,32(sp)
+    9d9c:	3c020001 	lui	v0,0x1
+    9da0:	24428de4 	addiu	v0,v0,-29212
+    9da4:	26454dc8 	addiu	a1,s2,19912
+    9da8:	27a60034 	addiu	a2,sp,52
+    9dac:	27a7002c 	addiu	a3,sp,44
+    9db0:	0c00260b 	jal	982c <full_do_exec>
+    9db4:	afa2001c 	sw	v0,28(sp)
+    9db8:	1440ff2d 	bnez	v0,9a70 <task_load_init+0x138>
+    9dbc:	00408021 	addu	s0,v0,zero
+    9dc0:	8fa20020 	lw	v0,32(sp)
+    9dc4:	24030002 	addiu	v1,zero,2
+    9dc8:	8fa40024 	lw	a0,36(sp)
+    9dcc:	0c004715 	jal	11c54 <sched_register>
+    9dd0:	ac4305d0 	sw	v1,1488(v0)
+    9dd4:	0c0046cb 	jal	11b2c <sched_add_created>
+    9dd8:	8fa40024 	lw	a0,36(sp)
+    9ddc:	8e249100 	lw	a0,-28416(s1)
+    9de0:	3c060003 	lui	a2,0x3
+    9de4:	3c070003 	lui	a3,0x3
+    9de8:	24c64e48 	addiu	a2,a2,20040
+    9dec:	24e74dc8 	addiu	a3,a3,19912
+    9df0:	0c0009b0 	jal	26c0 <__fprintk>
+    9df4:	00002821 	addu	a1,zero,zero
+    9df8:	0800267e 	j	99f8 <task_load_init+0xc0>
+    9dfc:	8fbf0174 	lw	ra,372(sp)
+
+00009e00 <do_interrupt>:
+    9e00:	27bdffc8 	addiu	sp,sp,-56
+    9e04:	afb1002c 	sw	s1,44(sp)
+    9e08:	8c910174 	lw	s1,372(a0)
+    9e0c:	8c830130 	lw	v1,304(a0)
+    9e10:	8e220020 	lw	v0,32(s1)
+    9e14:	afb20030 	sw	s2,48(sp)
+    9e18:	24420001 	addiu	v0,v0,1
+    9e1c:	ae220020 	sw	v0,32(s1)
+    9e20:	24020001 	addiu	v0,zero,1
+    9e24:	afb00028 	sw	s0,40(sp)
+    9e28:	afbf0034 	sw	ra,52(sp)
+    9e2c:	00808021 	addu	s0,a0,zero
+    9e30:	10620010 	beq	v1,v0,9e74 <do_interrupt+0x74>
+    9e34:	00a09021 	addu	s2,a1,zero
+    9e38:	27a60020 	addiu	a2,sp,32
+    9e3c:	0c0004a2 	jal	1288 <arch_cpu_get_irq_entry>
+    9e40:	02202021 	addu	a0,s1,zero
+    9e44:	8fa40020 	lw	a0,32(sp)
+    9e48:	8c820004 	lw	v0,4(a0)
+    9e4c:	0040f809 	jalr	v0
+    9e50:	00000000 	sll	zero,zero,0x0
+    9e54:	0c0021a3 	jal	868c <cpu_yield>
+    9e58:	00000000 	sll	zero,zero,0x0
+    9e5c:	8fbf0034 	lw	ra,52(sp)
+    9e60:	8fb20030 	lw	s2,48(sp)
+    9e64:	8fb1002c 	lw	s1,44(sp)
+    9e68:	8fb00028 	lw	s0,40(sp)
+    9e6c:	03e00008 	jr	ra
+    9e70:	27bd0038 	addiu	sp,sp,56
+    9e74:	24020002 	addiu	v0,zero,2
+    9e78:	0c006cbd 	jal	1b2f4 <tm_usr_compute>
+    9e7c:	ac820130 	sw	v0,304(a0)
+    9e80:	02402821 	addu	a1,s2,zero
+    9e84:	27a60020 	addiu	a2,sp,32
+    9e88:	0c0004a2 	jal	1288 <arch_cpu_get_irq_entry>
+    9e8c:	02202021 	addu	a0,s1,zero
+    9e90:	8fa40020 	lw	a0,32(sp)
+    9e94:	8c820004 	lw	v0,4(a0)
+    9e98:	0040f809 	jalr	v0
+    9e9c:	00000000 	sll	zero,zero,0x0
+    9ea0:	0c0021a3 	jal	868c <cpu_yield>
+    9ea4:	00000000 	sll	zero,zero,0x0
+    9ea8:	8e020134 	lw	v0,308(s0)
+    9eac:	30430020 	andi	v1,v0,0x20
+    9eb0:	1460000d 	bnez	v1,9ee8 <do_interrupt+0xe8>
+    9eb4:	2403ff7f 	addiu	v1,zero,-129
+    9eb8:	0c006ca8 	jal	1b2a0 <tm_sys_compute>
+    9ebc:	02002021 	addu	a0,s0,zero
+    9ec0:	24020001 	addiu	v0,zero,1
+    9ec4:	ae020130 	sw	v0,304(s0)
+    9ec8:	0c0049c0 	jal	12700 <signal_notify>
+    9ecc:	02002021 	addu	a0,s0,zero
+    9ed0:	8fbf0034 	lw	ra,52(sp)
+    9ed4:	8fb20030 	lw	s2,48(sp)
+    9ed8:	8fb1002c 	lw	s1,44(sp)
+    9edc:	8fb00028 	lw	s0,40(sp)
+    9ee0:	03e00008 	jr	ra
+    9ee4:	27bd0038 	addiu	sp,sp,56
+    9ee8:	00431024 	and	v0,v0,v1
+    9eec:	ae020134 	sw	v0,308(s0)
+    9ef0:	40016000 	mfc0	at,c0_status
+    9ef4:	00000000 	sll	zero,zero,0x0
+    9ef8:	00018825 	or	s1,zero,at
+    9efc:	34210001 	ori	at,at,0x1
+    9f00:	40816000 	mtc0	at,c0_status
+    9f04:	00000000 	sll	zero,zero,0x0
+    9f08:	2405ffff 	addiu	a1,zero,-1
+    9f0c:	0c006b59 	jal	1ad64 <thread_migrate>
+    9f10:	02002021 	addu	a0,s0,zero
+    9f14:	00401821 	addu	v1,v0,zero
+    9f18:	40016000 	mfc0	at,c0_status
+    9f1c:	340200ff 	ori	v0,zero,0xff
+    9f20:	00511024 	and	v0,v0,s1
+    9f24:	00220825 	or	at,at,v0
+    9f28:	40816000 	mtc0	at,c0_status
+    9f2c:	40102002 	mfc0	s0,$4,2
+    9f30:	0000000f 	sync
+    9f34:	14600005 	bnez	v1,9f4c <do_interrupt+0x14c>
+    9f38:	2402ffdf 	addiu	v0,zero,-33
+    9f3c:	8e030134 	lw	v1,308(s0)
+    9f40:	00621024 	and	v0,v1,v0
+    9f44:	080027ae 	j	9eb8 <do_interrupt+0xb8>
+    9f48:	ae020134 	sw	v0,308(s0)
+    9f4c:	40047801 	mfc0	a0,$15,1
+    9f50:	3c020004 	lui	v0,0x4
+    9f54:	30840003 	andi	a0,a0,0x3
+    9f58:	00042080 	sll	a0,a0,0x2
+    9f5c:	2442c950 	addiu	v0,v0,-14000
+    9f60:	00821021 	addu	v0,a0,v0
+    9f64:	8c420000 	lw	v0,0(v0)
+    9f68:	3c040004 	lui	a0,0x4
+    9f6c:	afa20010 	sw	v0,16(sp)
+    9f70:	8e020180 	lw	v0,384(s0)
+    9f74:	8c849140 	lw	a0,-28352(a0)
+    9f78:	8c4205c4 	lw	v0,1476(v0)
+    9f7c:	3c060003 	lui	a2,0x3
+    9f80:	afa20014 	sw	v0,20(sp)
+    9f84:	8e0202f8 	lw	v0,760(s0)
+    9f88:	3c070003 	lui	a3,0x3
+    9f8c:	24c64ea0 	addiu	a2,a2,20128
+    9f90:	24e74ee0 	addiu	a3,a3,20192
+    9f94:	24050001 	addiu	a1,zero,1
+    9f98:	afa20018 	sw	v0,24(sp)
+    9f9c:	0c0009b0 	jal	26c0 <__fprintk>
+    9fa0:	afa3001c 	sw	v1,28(sp)
+    9fa4:	080027ae 	j	9eb8 <do_interrupt+0xb8>
+    9fa8:	00000000 	sll	zero,zero,0x0
+    9fac:	3c020004 	lui	v0,0x4
+    9fb0:	8c449100 	lw	a0,-28416(v0)
+    9fb4:	3c060003 	lui	a2,0x3
+    9fb8:	27bdffe8 	addiu	sp,sp,-24
+    9fbc:	24c64ef0 	addiu	a2,a2,20208
+    9fc0:	afbf0014 	sw	ra,20(sp)
+    9fc4:	0c0009b0 	jal	26c0 <__fprintk>
+    9fc8:	00002821 	addu	a1,zero,zero
+    9fcc:	8fbf0014 	lw	ra,20(sp)
+    9fd0:	24020026 	addiu	v0,zero,38
+    9fd4:	03e00008 	jr	ra
+    9fd8:	27bd0018 	addiu	sp,sp,24
+
+00009fdc <do_syscall>:
+    9fdc:	27bdffa8 	addiu	sp,sp,-88
+    9fe0:	afb60050 	sw	s6,80(sp)
+    9fe4:	afb5004c 	sw	s5,76(sp)
+    9fe8:	afb40048 	sw	s4,72(sp)
+    9fec:	afb20040 	sw	s2,64(sp)
+    9ff0:	afb1003c 	sw	s1,60(sp)
+    9ff4:	afbf0054 	sw	ra,84(sp)
+    9ff8:	afb30044 	sw	s3,68(sp)
+    9ffc:	afb00038 	sw	s0,56(sp)
+    a000:	8fb20068 	lw	s2,104(sp)
+    a004:	0080b021 	addu	s6,a0,zero
+    a008:	00a0a821 	addu	s5,a1,zero
+    a00c:	00c0a021 	addu	s4,a2,zero
+    a010:	00e08821 	addu	s1,a3,zero
+    a014:	40102002 	mfc0	s0,$4,2
+    a018:	24020002 	addiu	v0,zero,2
+    a01c:	ae020130 	sw	v0,304(s0)
+    a020:	02002021 	addu	a0,s0,zero
+    a024:	0c006cbd 	jal	1b2f4 <tm_usr_compute>
+    a028:	8e130174 	lw	s3,372(s0)
+    a02c:	8e020134 	lw	v0,308(s0)
+    a030:	30420020 	andi	v0,v0,0x20
+    a034:	14400084 	bnez	v0,a248 <do_syscall+0x26c>
+    a038:	00000000 	sll	zero,zero,0x0
+    a03c:	0c00cc3b 	jal	330ec <cpu_context_save>
+    a040:	26040298 	addiu	a0,s0,664
+    a044:	10400027 	beqz	v0,a0e4 <do_syscall+0x108>
+    a048:	00000000 	sll	zero,zero,0x0
+    a04c:	40102002 	mfc0	s0,$4,2
+    a050:	40022002 	mfc0	v0,$4,2
+    a054:	8c530174 	lw	s3,372(v0)
+    a058:	0000000f 	sync
+    a05c:	8e11025c 	lw	s1,604(s0)
+    a060:	40016000 	mfc0	at,c0_status
+    a064:	00000000 	sll	zero,zero,0x0
+    a068:	00011025 	or	v0,zero,at
+    a06c:	00010842 	srl	at,at,0x1
+    a070:	00010840 	sll	at,at,0x1
+    a074:	40816000 	mtc0	at,c0_status
+    a078:	8e020134 	lw	v0,308(s0)
+    a07c:	30430020 	andi	v1,v0,0x20
+    a080:	1460003e 	bnez	v1,a17c <do_syscall+0x1a0>
+    a084:	2403ff7f 	addiu	v1,zero,-129
+    a088:	0220a021 	addu	s4,s1,zero
+    a08c:	8e030214 	lw	v1,532(s0)
+    a090:	24020001 	addiu	v0,zero,1
+    a094:	10620056 	beq	v1,v0,a1f0 <do_syscall+0x214>
+    a098:	00000000 	sll	zero,zero,0x0
+    a09c:	0c006ca8 	jal	1b2a0 <tm_sys_compute>
+    a0a0:	02002021 	addu	a0,s0,zero
+    a0a4:	24020001 	addiu	v0,zero,1
+    a0a8:	ae11025c 	sw	s1,604(s0)
+    a0ac:	ae020130 	sw	v0,304(s0)
+    a0b0:	0c0049c0 	jal	12700 <signal_notify>
+    a0b4:	02002021 	addu	a0,s0,zero
+    a0b8:	8fbf0054 	lw	ra,84(sp)
+    a0bc:	02801021 	addu	v0,s4,zero
+    a0c0:	8fb60050 	lw	s6,80(sp)
+    a0c4:	8fb5004c 	lw	s5,76(sp)
+    a0c8:	8fb40048 	lw	s4,72(sp)
+    a0cc:	8fb30044 	lw	s3,68(sp)
+    a0d0:	8fb20040 	lw	s2,64(sp)
+    a0d4:	8fb1003c 	lw	s1,60(sp)
+    a0d8:	8fb00038 	lw	s0,56(sp)
+    a0dc:	03e00008 	jr	ra
+    a0e0:	27bd0058 	addiu	sp,sp,88
+    a0e4:	40016000 	mfc0	at,c0_status
+    a0e8:	00000000 	sll	zero,zero,0x0
+    a0ec:	00011025 	or	v0,zero,at
+    a0f0:	34210001 	ori	at,at,0x1
+    a0f4:	40816000 	mtc0	at,c0_status
+    a0f8:	00000000 	sll	zero,zero,0x0
+    a0fc:	2e420033 	sltiu	v0,s2,51
+    a100:	10400068 	beqz	v0,a2a4 <do_syscall+0x2c8>
+    a104:	24020001 	addiu	v0,zero,1
+    a108:	8e030214 	lw	v1,532(s0)
+    a10c:	1062008e 	beq	v1,v0,a348 <do_syscall+0x36c>
+    a110:	3c030004 	lui	v1,0x4
+    a114:	3c020003 	lui	v0,0x3
+    a118:	00121880 	sll	v1,s2,0x2
+    a11c:	24425020 	addiu	v0,v0,20512
+    a120:	00621021 	addu	v0,v1,v0
+    a124:	8c420000 	lw	v0,0(v0)
+    a128:	02203821 	addu	a3,s1,zero
+    a12c:	ae000258 	sw	zero,600(s0)
+    a130:	02c02021 	addu	a0,s6,zero
+    a134:	02a02821 	addu	a1,s5,zero
+    a138:	0040f809 	jalr	v0
+    a13c:	02803021 	addu	a2,s4,zero
+    a140:	00408821 	addu	s1,v0,zero
+    a144:	40102002 	mfc0	s0,$4,2
+    a148:	40022002 	mfc0	v0,$4,2
+    a14c:	8c530174 	lw	s3,372(v0)
+    a150:	0000000f 	sync
+    a154:	40016000 	mfc0	at,c0_status
+    a158:	00000000 	sll	zero,zero,0x0
+    a15c:	00011025 	or	v0,zero,at
+    a160:	00010842 	srl	at,at,0x1
+    a164:	00010840 	sll	at,at,0x1
+    a168:	40816000 	mtc0	at,c0_status
+    a16c:	8e020134 	lw	v0,308(s0)
+    a170:	30430020 	andi	v1,v0,0x20
+    a174:	1060ffc4 	beqz	v1,a088 <do_syscall+0xac>
+    a178:	2403ff7f 	addiu	v1,zero,-129
+    a17c:	00431024 	and	v0,v0,v1
+    a180:	ae020134 	sw	v0,308(s0)
+    a184:	40016000 	mfc0	at,c0_status
+    a188:	00000000 	sll	zero,zero,0x0
+    a18c:	00011025 	or	v0,zero,at
+    a190:	34210001 	ori	at,at,0x1
+    a194:	40816000 	mtc0	at,c0_status
+    a198:	00000000 	sll	zero,zero,0x0
+    a19c:	2405ffff 	addiu	a1,zero,-1
+    a1a0:	0c006b59 	jal	1ad64 <thread_migrate>
+    a1a4:	02002021 	addu	a0,s0,zero
+    a1a8:	40016000 	mfc0	at,c0_status
+    a1ac:	00000000 	sll	zero,zero,0x0
+    a1b0:	00011825 	or	v1,zero,at
+    a1b4:	00010842 	srl	at,at,0x1
+    a1b8:	00010840 	sll	at,at,0x1
+    a1bc:	40816000 	mtc0	at,c0_status
+    a1c0:	40102002 	mfc0	s0,$4,2
+    a1c4:	0000000f 	sync
+    a1c8:	14400047 	bnez	v0,a2e8 <do_syscall+0x30c>
+    a1cc:	00000000 	sll	zero,zero,0x0
+    a1d0:	8e030134 	lw	v1,308(s0)
+    a1d4:	2402ffdf 	addiu	v0,zero,-33
+    a1d8:	00621024 	and	v0,v1,v0
+    a1dc:	8e030214 	lw	v1,532(s0)
+    a1e0:	ae020134 	sw	v0,308(s0)
+    a1e4:	24020001 	addiu	v0,zero,1
+    a1e8:	1462ffac 	bne	v1,v0,a09c <do_syscall+0xc0>
+    a1ec:	0220a021 	addu	s4,s1,zero
+    a1f0:	8e020180 	lw	v0,384(s0)
+    a1f4:	3c030004 	lui	v1,0x4
+    a1f8:	8c4205c4 	lw	v0,1476(v0)
+    a1fc:	8c649100 	lw	a0,-28416(v1)
+    a200:	afa20010 	sw	v0,16(sp)
+    a204:	8e0202f8 	lw	v0,760(s0)
+    a208:	afb00018 	sw	s0,24(sp)
+    a20c:	afa20014 	sw	v0,20(sp)
+    a210:	8e620004 	lw	v0,4(s3)
+    a214:	afb20020 	sw	s2,32(sp)
+    a218:	afa2001c 	sw	v0,28(sp)
+    a21c:	afb10024 	sw	s1,36(sp)
+    a220:	8e020258 	lw	v0,600(s0)
+    a224:	3c060003 	lui	a2,0x3
+    a228:	3c070003 	lui	a3,0x3
+    a22c:	24c64fd4 	addiu	a2,a2,20436
+    a230:	24e750ec 	addiu	a3,a3,20716
+    a234:	00002821 	addu	a1,zero,zero
+    a238:	0c0009b0 	jal	26c0 <__fprintk>
+    a23c:	afa20028 	sw	v0,40(sp)
+    a240:	08002827 	j	a09c <do_syscall+0xc0>
+    a244:	00000000 	sll	zero,zero,0x0
+    a248:	40016000 	mfc0	at,c0_status
+    a24c:	00000000 	sll	zero,zero,0x0
+    a250:	00011025 	or	v0,zero,at
+    a254:	34210001 	ori	at,at,0x1
+    a258:	40816000 	mtc0	at,c0_status
+    a25c:	00000000 	sll	zero,zero,0x0
+    a260:	2405ffff 	addiu	a1,zero,-1
+    a264:	0c006b59 	jal	1ad64 <thread_migrate>
+    a268:	02002021 	addu	a0,s0,zero
+    a26c:	40016000 	mfc0	at,c0_status
+    a270:	00000000 	sll	zero,zero,0x0
+    a274:	00011825 	or	v1,zero,at
+    a278:	00010842 	srl	at,at,0x1
+    a27c:	00010840 	sll	at,at,0x1
+    a280:	40816000 	mtc0	at,c0_status
+    a284:	40102002 	mfc0	s0,$4,2
+    a288:	0000000f 	sync
+    a28c:	1440ff6b 	bnez	v0,a03c <do_syscall+0x60>
+    a290:	2402ffdf 	addiu	v0,zero,-33
+    a294:	8e030134 	lw	v1,308(s0)
+    a298:	00621024 	and	v0,v1,v0
+    a29c:	0800280f 	j	a03c <do_syscall+0x60>
+    a2a0:	ae020134 	sw	v0,308(s0)
+    a2a4:	3c020004 	lui	v0,0x4
+    a2a8:	afb20010 	sw	s2,16(sp)
+    a2ac:	afb00014 	sw	s0,20(sp)
+    a2b0:	8c449100 	lw	a0,-28416(v0)
+    a2b4:	3c060003 	lui	a2,0x3
+    a2b8:	8e620004 	lw	v0,4(s3)
+    a2bc:	3c070003 	lui	a3,0x3
+    a2c0:	24c64f3c 	addiu	a2,a2,20284
+    a2c4:	24e750ec 	addiu	a3,a3,20716
+    a2c8:	00002821 	addu	a1,zero,zero
+    a2cc:	0c0009b0 	jal	26c0 <__fprintk>
+    a2d0:	afa20018 	sw	v0,24(sp)
+    a2d4:	24020026 	addiu	v0,zero,38
+    a2d8:	ae020258 	sw	v0,600(s0)
+    a2dc:	0000a021 	addu	s4,zero,zero
+    a2e0:	08002823 	j	a08c <do_syscall+0xb0>
+    a2e4:	00008821 	addu	s1,zero,zero
+    a2e8:	40047801 	mfc0	a0,$15,1
+    a2ec:	3c030004 	lui	v1,0x4
+    a2f0:	30840003 	andi	a0,a0,0x3
+    a2f4:	00042080 	sll	a0,a0,0x2
+    a2f8:	2463c950 	addiu	v1,v1,-14000
+    a2fc:	00831821 	addu	v1,a0,v1
+    a300:	8c630000 	lw	v1,0(v1)
+    a304:	3c040004 	lui	a0,0x4
+    a308:	afa30010 	sw	v1,16(sp)
+    a30c:	8e030180 	lw	v1,384(s0)
+    a310:	8c849140 	lw	a0,-28352(a0)
+    a314:	8c6305c4 	lw	v1,1476(v1)
+    a318:	3c060003 	lui	a2,0x3
+    a31c:	afa30014 	sw	v1,20(sp)
+    a320:	8e0302f8 	lw	v1,760(s0)
+    a324:	3c070003 	lui	a3,0x3
+    a328:	24c64ea0 	addiu	a2,a2,20128
+    a32c:	24e750ec 	addiu	a3,a3,20716
+    a330:	24050001 	addiu	a1,zero,1
+    a334:	afa30018 	sw	v1,24(sp)
+    a338:	0c0009b0 	jal	26c0 <__fprintk>
+    a33c:	afa2001c 	sw	v0,28(sp)
+    a340:	08002823 	j	a08c <do_syscall+0xb0>
+    a344:	0220a021 	addu	s4,s1,zero
+    a348:	8e020180 	lw	v0,384(s0)
+    a34c:	8c4205c4 	lw	v0,1476(v0)
+    a350:	8c649100 	lw	a0,-28416(v1)
+    a354:	afa20010 	sw	v0,16(sp)
+    a358:	8e0202f8 	lw	v0,760(s0)
+    a35c:	afb00018 	sw	s0,24(sp)
+    a360:	afa20014 	sw	v0,20(sp)
+    a364:	8e620004 	lw	v0,4(s3)
+    a368:	3c060003 	lui	a2,0x3
+    a36c:	3c070003 	lui	a3,0x3
+    a370:	24c64f78 	addiu	a2,a2,20344
+    a374:	24e750ec 	addiu	a3,a3,20716
+    a378:	00002821 	addu	a1,zero,zero
+    a37c:	afa2001c 	sw	v0,28(sp)
+    a380:	afb20020 	sw	s2,32(sp)
+    a384:	afb60024 	sw	s6,36(sp)
+    a388:	afb50028 	sw	s5,40(sp)
+    a38c:	afb4002c 	sw	s4,44(sp)
+    a390:	0c0009b0 	jal	26c0 <__fprintk>
+    a394:	afb10030 	sw	s1,48(sp)
+    a398:	08002846 	j	a118 <do_syscall+0x13c>
+    a39c:	3c020003 	lui	v0,0x3
+
+0000a3a0 <dqdt_update>:
+    a3a0:	03e00008 	jr	ra
+    a3a4:	00001021 	addu	v0,zero,zero
+
+0000a3a8 <dqdt_update_threads_number>:
+    a3a8:	03e00008 	jr	ra
+    a3ac:	00000000 	sll	zero,zero,0x0
+
+0000a3b0 <dqdt_init>:
+    a3b0:	3c020008 	lui	v0,0x8
+    a3b4:	03e00008 	jr	ra
+    a3b8:	ac4026f0 	sw	zero,9968(v0)
+
+0000a3bc <dqdt_thread_placement>:
+    a3bc:	3c030004 	lui	v1,0x4
+    a3c0:	3c020004 	lui	v0,0x4
+    a3c4:	8c4471b4 	lw	a0,29108(v0)
+    a3c8:	8c66bcac 	lw	a2,-17236(v1)
+    a3cc:	3c020004 	lui	v0,0x4
+    a3d0:	00c4001b 	divu	zero,a2,a0
+    a3d4:	008001f4 	teq	a0,zero,0x7
+    a3d8:	2447c960 	addiu	a3,v0,-13984
+    a3dc:	88e70003 	lwl	a3,3(a3)
+    a3e0:	24c60001 	addiu	a2,a2,1
+    a3e4:	9847c960 	lwr	a3,-13984(v0)
+    a3e8:	00001021 	addu	v0,zero,zero
+    a3ec:	30e7ffff 	andi	a3,a3,0xffff
+    a3f0:	aca70000 	sw	a3,0(a1)
+    a3f4:	00002010 	mfhi	a0
+    a3f8:	aca40008 	sw	a0,8(a1)
+    a3fc:	03e00008 	jr	ra
+    a400:	ac66bcac 	sw	a2,-17236(v1)
+
+0000a404 <dqdt_thread_migrate>:
+    a404:	3c030004 	lui	v1,0x4
+    a408:	3c020004 	lui	v0,0x4
+    a40c:	8c4471b4 	lw	a0,29108(v0)
+    a410:	8c66bca8 	lw	a2,-17240(v1)
+    a414:	3c020004 	lui	v0,0x4
+    a418:	00c4001b 	divu	zero,a2,a0
+    a41c:	008001f4 	teq	a0,zero,0x7
+    a420:	2447c960 	addiu	a3,v0,-13984
+    a424:	88e70003 	lwl	a3,3(a3)
+    a428:	24c60001 	addiu	a2,a2,1
+    a42c:	9847c960 	lwr	a3,-13984(v0)
+    a430:	00001021 	addu	v0,zero,zero
+    a434:	30e7ffff 	andi	a3,a3,0xffff
+    a438:	aca70000 	sw	a3,0(a1)
+    a43c:	00002010 	mfhi	a0
+    a440:	aca40008 	sw	a0,8(a1)
+    a444:	03e00008 	jr	ra
+    a448:	ac66bca8 	sw	a2,-17240(v1)
+
+0000a44c <dqdt_task_placement>:
+    a44c:	3c040004 	lui	a0,0x4
+    a450:	3c030004 	lui	v1,0x4
+    a454:	24846db0 	addiu	a0,a0,28080
+    a458:	8c67bca4 	lw	a3,-17244(v1)
+    a45c:	8c860404 	lw	a2,1028(a0)
+    a460:	3c020004 	lui	v0,0x4
+    a464:	00e6001b 	divu	zero,a3,a2
+    a468:	00c001f4 	teq	a2,zero,0x7
+    a46c:	2448c960 	addiu	t0,v0,-13984
+    a470:	89080003 	lwl	t0,3(t0)
+    a474:	24e70001 	addiu	a3,a3,1
+    a478:	9848c960 	lwr	t0,-13984(v0)
+    a47c:	00001021 	addu	v0,zero,zero
+    a480:	3108ffff 	andi	t0,t0,0xffff
+    a484:	aca80000 	sw	t0,0(a1)
+    a488:	00003010 	mfhi	a2
+    a48c:	aca60008 	sw	a2,8(a1)
+    a490:	8c840410 	lw	a0,1040(a0)
+    a494:	00003012 	mflo	a2
+    a498:	00c4001b 	divu	zero,a2,a0
+    a49c:	008001f4 	teq	a0,zero,0x7
+    a4a0:	00002010 	mfhi	a0
+    a4a4:	aca40004 	sw	a0,4(a1)
+    a4a8:	03e00008 	jr	ra
+    a4ac:	ac67bca4 	sw	a3,-17244(v1)
+
+0000a4b0 <dqdt_mem_request>:
+    a4b0:	3c020004 	lui	v0,0x4
+    a4b4:	2443c960 	addiu	v1,v0,-13984
+    a4b8:	88630003 	lwl	v1,3(v1)
+    a4bc:	9843c960 	lwr	v1,-13984(v0)
+    a4c0:	aca00008 	sw	zero,8(a1)
+    a4c4:	3063ffff 	andi	v1,v1,0xffff
+    a4c8:	aca30000 	sw	v1,0(a1)
+    a4cc:	03e00008 	jr	ra
+    a4d0:	00001021 	addu	v0,zero,zero
+
+0000a4d4 <dqdt_print_summary>:
+    a4d4:	3c020004 	lui	v0,0x4
+    a4d8:	3c060003 	lui	a2,0x3
+    a4dc:	3c070003 	lui	a3,0x3
+    a4e0:	8c449100 	lw	a0,-28416(v0)
+    a4e4:	24c650f8 	addiu	a2,a2,20728
+    a4e8:	24e75114 	addiu	a3,a3,20756
+    a4ec:	080009b0 	j	26c0 <__fprintk>
+    a4f0:	00002821 	addu	a1,zero,zero
+
+0000a4f4 <dqdt_print>:
+    a4f4:	3c020004 	lui	v0,0x4
+    a4f8:	3c060003 	lui	a2,0x3
+    a4fc:	3c070003 	lui	a3,0x3
+    a500:	8c449100 	lw	a0,-28416(v0)
+    a504:	24c650f8 	addiu	a2,a2,20728
+    a508:	24e75128 	addiu	a3,a3,20776
+    a50c:	080009b0 	j	26c0 <__fprintk>
+    a510:	00002821 	addu	a1,zero,zero
+
+0000a514 <event_init>:
+    a514:	03e00008 	jr	ra
+    a518:	00001021 	addu	v0,zero,zero
+
+0000a51c <event_destroy>:
+    a51c:	03e00008 	jr	ra
+    a520:	00000000 	sll	zero,zero,0x0
+
+0000a524 <event_listner_destroy>:
+    a524:	03e00008 	jr	ra
+    a528:	00000000 	sll	zero,zero,0x0
+
+0000a52c <event_listner_init>:
+    a52c:	ac800004 	sw	zero,4(a0)
+    a530:	00801821 	addu	v1,a0,zero
+    a534:	ac800010 	sw	zero,16(a0)
+    a538:	00001021 	addu	v0,zero,zero
+    a53c:	24070009 	addiu	a3,zero,9
+    a540:	00022880 	sll	a1,v0,0x2
+    a544:	00023100 	sll	a2,v0,0x4
+    a548:	00c53023 	subu	a2,a2,a1
+    a54c:	00862821 	addu	a1,a0,a2
+    a550:	24a50018 	addiu	a1,a1,24
+    a554:	00863021 	addu	a2,a0,a2
+    a558:	24420001 	addiu	v0,v0,1
+    a55c:	ac65001c 	sw	a1,28(v1)
+    a560:	ac650018 	sw	a1,24(v1)
+    a564:	acc00014 	sw	zero,20(a2)
+    a568:	1447fff5 	bne	v0,a3,a540 <event_listner_init+0x14>
+    a56c:	2463000c 	addiu	v1,v1,12
+    a570:	03e00008 	jr	ra
+    a574:	00001021 	addu	v0,zero,zero
+
+0000a578 <event_listner_notify>:
+    a578:	8c830004 	lw	v1,4(a0)
+    a57c:	2402fffe 	addiu	v0,zero,-2
+    a580:	00621024 	and	v0,v1,v0
+    a584:	27bdffd8 	addiu	sp,sp,-40
+    a588:	ac820004 	sw	v0,4(a0)
+    a58c:	afb40020 	sw	s4,32(sp)
+    a590:	8c940010 	lw	s4,16(a0)
+    a594:	afb20018 	sw	s2,24(sp)
+    a598:	26830001 	addiu	v1,s4,1
+    a59c:	2e820009 	sltiu	v0,s4,9
+    a5a0:	afbf0024 	sw	ra,36(sp)
+    a5a4:	afb3001c 	sw	s3,28(sp)
+    a5a8:	afb10014 	sw	s1,20(sp)
+    a5ac:	afb00010 	sw	s0,16(sp)
+    a5b0:	00809021 	addu	s2,a0,zero
+    a5b4:	ac830010 	sw	v1,16(a0)
+    a5b8:	10400033 	beqz	v0,a688 <event_listner_notify+0x110>
+    a5bc:	00008821 	addu	s1,zero,zero
+    a5c0:	8e430010 	lw	v1,16(s2)
+    a5c4:	0283182b 	sltu	v1,s4,v1
+    a5c8:	1060002a 	beqz	v1,a674 <event_listner_notify+0xfc>
+    a5cc:	02801021 	addu	v0,s4,zero
+    a5d0:	24530001 	addiu	s3,v0,1
+    a5d4:	00028100 	sll	s0,v0,0x4
+    a5d8:	00021080 	sll	v0,v0,0x2
+    a5dc:	02028023 	subu	s0,s0,v0
+    a5e0:	02508021 	addu	s0,s2,s0
+    a5e4:	8e020014 	lw	v0,20(s0)
+    a5e8:	1040001c 	beqz	v0,a65c <event_listner_notify+0xe4>
+    a5ec:	2e620009 	sltiu	v0,s3,9
+    a5f0:	8e040018 	lw	a0,24(s0)
+    a5f4:	8e050014 	lw	a1,20(s0)
+    a5f8:	2484ffec 	addiu	a0,a0,-20
+    a5fc:	8c830014 	lw	v1,20(a0)
+    a600:	8c820018 	lw	v0,24(a0)
+    a604:	24a5ffff 	addiu	a1,a1,-1
+    a608:	ac620004 	sw	v0,4(v1)
+    a60c:	ae050014 	sw	a1,20(s0)
+    a610:	ac430000 	sw	v1,0(v0)
+    a614:	40016000 	mfc0	at,c0_status
+    a618:	00000000 	sll	zero,zero,0x0
+    a61c:	00011025 	or	v0,zero,at
+    a620:	34210001 	ori	at,at,0x1
+    a624:	40816000 	mtc0	at,c0_status
+    a628:	00000000 	sll	zero,zero,0x0
+    a62c:	8c820004 	lw	v0,4(a0)
+    a630:	0040f809 	jalr	v0
+    a634:	26310001 	addiu	s1,s1,1
+    a638:	40016000 	mfc0	at,c0_status
+    a63c:	00000000 	sll	zero,zero,0x0
+    a640:	00011025 	or	v0,zero,at
+    a644:	00010842 	srl	at,at,0x1
+    a648:	00010840 	sll	at,at,0x1
+    a64c:	40816000 	mtc0	at,c0_status
+    a650:	8e020014 	lw	v0,20(s0)
+    a654:	1440ffe6 	bnez	v0,a5f0 <event_listner_notify+0x78>
+    a658:	2e620009 	sltiu	v0,s3,9
+    a65c:	1040000a 	beqz	v0,a688 <event_listner_notify+0x110>
+    a660:	00000000 	sll	zero,zero,0x0
+    a664:	8e430010 	lw	v1,16(s2)
+    a668:	0283182b 	sltu	v1,s4,v1
+    a66c:	1460ffd8 	bnez	v1,a5d0 <event_listner_notify+0x58>
+    a670:	02601021 	addu	v0,s3,zero
+    a674:	8e540010 	lw	s4,16(s2)
+    a678:	26930001 	addiu	s3,s4,1
+    a67c:	ae530010 	sw	s3,16(s2)
+    a680:	08002975 	j	a5d4 <event_listner_notify+0x5c>
+    a684:	02801021 	addu	v0,s4,zero
+    a688:	8e420000 	lw	v0,0(s2)
+    a68c:	8fbf0024 	lw	ra,36(sp)
+    a690:	00518821 	addu	s1,v0,s1
+    a694:	ae510000 	sw	s1,0(s2)
+    a698:	8fb40020 	lw	s4,32(sp)
+    a69c:	8fb3001c 	lw	s3,28(sp)
+    a6a0:	8fb20018 	lw	s2,24(sp)
+    a6a4:	8fb10014 	lw	s1,20(sp)
+    a6a8:	8fb00010 	lw	s0,16(sp)
+    a6ac:	03e00008 	jr	ra
+    a6b0:	27bd0028 	addiu	sp,sp,40
+
+0000a6b4 <thread_event_manager>:
+    a6b4:	27bdffd8 	addiu	sp,sp,-40
+    a6b8:	afbf0024 	sw	ra,36(sp)
+    a6bc:	afb40020 	sw	s4,32(sp)
+    a6c0:	afb3001c 	sw	s3,28(sp)
+    a6c4:	afb20018 	sw	s2,24(sp)
+    a6c8:	afb10014 	sw	s1,20(sp)
+    a6cc:	afb00010 	sw	s0,16(sp)
+    a6d0:	40016000 	mfc0	at,c0_status
+    a6d4:	00000000 	sll	zero,zero,0x0
+    a6d8:	00011025 	or	v0,zero,at
+    a6dc:	34210001 	ori	at,at,0x1
+    a6e0:	40816000 	mtc0	at,c0_status
+    a6e4:	00000000 	sll	zero,zero,0x0
+    a6e8:	40112002 	mfc0	s1,$4,2
+    a6ec:	40022002 	mfc0	v0,$4,2
+    a6f0:	8c520174 	lw	s2,372(v0)
+    a6f4:	40016000 	mfc0	at,c0_status
+    a6f8:	00000000 	sll	zero,zero,0x0
+    a6fc:	00011825 	or	v1,zero,at
+    a700:	00010842 	srl	at,at,0x1
+    a704:	00010840 	sll	at,at,0x1
+    a708:	40816000 	mtc0	at,c0_status
+    a70c:	8e22013c 	lw	v0,316(s1)
+    a710:	24420001 	addiu	v0,v0,1
+    a714:	ae22013c 	sw	v0,316(s1)
+    a718:	40016000 	mfc0	at,c0_status
+    a71c:	340200ff 	ori	v0,zero,0xff
+    a720:	00431024 	and	v0,v0,v1
+    a724:	00220825 	or	at,at,v0
+    a728:	40816000 	mtc0	at,c0_status
+    a72c:	26540060 	addiu	s4,s2,96
+    a730:	080029d8 	j	a760 <thread_event_manager+0xac>
+    a734:	2633027c 	addiu	s3,s1,636
+    a738:	24050002 	addiu	a1,zero,2
+    a73c:	0c006d13 	jal	1b44c <wait_on>
+    a740:	02602021 	addu	a0,s3,zero
+    a744:	0c004634 	jal	118d0 <sched_sleep>
+    a748:	02202021 	addu	a0,s1,zero
+    a74c:	40016000 	mfc0	at,c0_status
+    a750:	340200ff 	ori	v0,zero,0xff
+    a754:	00501024 	and	v0,v0,s0
+    a758:	00220825 	or	at,at,v0
+    a75c:	40816000 	mtc0	at,c0_status
+    a760:	40016000 	mfc0	at,c0_status
+    a764:	00000000 	sll	zero,zero,0x0
+    a768:	00018025 	or	s0,zero,at
+    a76c:	00010842 	srl	at,at,0x1
+    a770:	00010840 	sll	at,at,0x1
+    a774:	40816000 	mtc0	at,c0_status
+    a778:	8e420064 	lw	v0,100(s2)
+    a77c:	30420001 	andi	v0,v0,0x1
+    a780:	1040ffed 	beqz	v0,a738 <thread_event_manager+0x84>
+    a784:	00000000 	sll	zero,zero,0x0
+    a788:	0c00295e 	jal	a578 <event_listner_notify>
+    a78c:	02802021 	addu	a0,s4,zero
+    a790:	080029cf 	j	a73c <thread_event_manager+0x88>
+    a794:	24050002 	addiu	a1,zero,2
+
+0000a798 <event_send>:
+    a798:	27bdffc8 	addiu	sp,sp,-56
+    a79c:	afbf0034 	sw	ra,52(sp)
+    a7a0:	afb10030 	sw	s1,48(sp)
+    a7a4:	afb0002c 	sw	s0,44(sp)
+    a7a8:	00808821 	addu	s1,a0,zero
+    a7ac:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    a7b0:	afa50020 	sw	a1,32(sp)
+    a7b4:	8fa50020 	lw	a1,32(sp)
+    a7b8:	00a2001b 	divu	zero,a1,v0
+    a7bc:	004001f4 	teq	v0,zero,0x7
+    a7c0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    a7c4:	00008012 	mflo	s0
+    a7c8:	3c030004 	lui	v1,0x4
+    a7cc:	2464c960 	addiu	a0,v1,-13984
+    a7d0:	88860003 	lwl	a2,3(a0)
+    a7d4:	9866c960 	lwr	a2,-13984(v1)
+    a7d8:	30c6ffff 	andi	a2,a2,0xffff
+    a7dc:	10d00016 	beq	a2,s0,a838 <event_send+0xa0>
+    a7e0:	8fa50020 	lw	a1,32(sp)
+    a7e4:	40047801 	mfc0	a0,$15,1
+    a7e8:	40024800 	mfc0	v0,c0_count
+    a7ec:	00000000 	sll	zero,zero,0x0
+    a7f0:	3c030004 	lui	v1,0x4
+    a7f4:	30840003 	andi	a0,a0,0x3
+    a7f8:	00042080 	sll	a0,a0,0x2
+    a7fc:	2463c950 	addiu	v1,v1,-14000
+    a800:	00831821 	addu	v1,a0,v1
+    a804:	8c630000 	lw	v1,0(v1)
+    a808:	3c050003 	lui	a1,0x3
+    a80c:	3c070003 	lui	a3,0x3
+    a810:	24a55134 	addiu	a1,a1,20788
+    a814:	24e75188 	addiu	a3,a3,20872
+    a818:	24040001 	addiu	a0,zero,1
+    a81c:	240600d3 	addiu	a2,zero,211
+    a820:	afa30010 	sw	v1,16(sp)
+    a824:	afb00014 	sw	s0,20(sp)
+    a828:	0c00097d 	jal	25f4 <__perror>
+    a82c:	afa20018 	sw	v0,24(sp)
+    a830:	08002a0c 	j	a830 <event_send+0x98>
+    a834:	00000000 	sll	zero,zero,0x0
+    a838:	00a2001b 	divu	zero,a1,v0
+    a83c:	004001f4 	teq	v0,zero,0x7
+    a840:	0c00207a 	jal	81e8 <cpu_lid2ptr>
+    a844:	00002010 	mfhi	a0
+    a848:	8e240000 	lw	a0,0(s1)
+    a84c:	40016000 	mfc0	at,c0_status
+    a850:	00000000 	sll	zero,zero,0x0
+    a854:	00011825 	or	v1,zero,at
+    a858:	00010842 	srl	at,at,0x1
+    a85c:	00010840 	sll	at,at,0x1
+    a860:	40816000 	mtc0	at,c0_status
+    a864:	00042880 	sll	a1,a0,0x2
+    a868:	00043100 	sll	a2,a0,0x4
+    a86c:	00c53023 	subu	a2,a2,a1
+    a870:	00463021 	addu	a2,v0,a2
+    a874:	8cc70074 	lw	a3,116(a2)
+    a878:	8cc5007c 	lw	a1,124(a2)
+    a87c:	24e70001 	addiu	a3,a3,1
+    a880:	acc70074 	sw	a3,116(a2)
+    a884:	8c480064 	lw	t0,100(v0)
+    a888:	8ca70000 	lw	a3,0(a1)
+    a88c:	26260014 	addiu	a2,s1,20
+    a890:	31080001 	andi	t0,t0,0x1
+    a894:	ae250018 	sw	a1,24(s1)
+    a898:	ae270014 	sw	a3,20(s1)
+    a89c:	ace60004 	sw	a2,4(a3)
+    a8a0:	11000006 	beqz	t0,a8bc <event_send+0x124>
+    a8a4:	aca60000 	sw	a2,0(a1)
+    a8a8:	8c450070 	lw	a1,112(v0)
+    a8ac:	0085282b 	sltu	a1,a0,a1
+    a8b0:	14a00002 	bnez	a1,a8bc <event_send+0x124>
+    a8b4:	00000000 	sll	zero,zero,0x0
+    a8b8:	8c440070 	lw	a0,112(v0)
+    a8bc:	ac440070 	sw	a0,112(v0)
+    a8c0:	8c440064 	lw	a0,100(v0)
+    a8c4:	34840001 	ori	a0,a0,0x1
+    a8c8:	ac440064 	sw	a0,100(v0)
+    a8cc:	40016000 	mfc0	at,c0_status
+    a8d0:	340200ff 	ori	v0,zero,0xff
+    a8d4:	00431024 	and	v0,v0,v1
+    a8d8:	00220825 	or	at,at,v0
+    a8dc:	40816000 	mtc0	at,c0_status
+    a8e0:	8fbf0034 	lw	ra,52(sp)
+    a8e4:	8fb10030 	lw	s1,48(sp)
+    a8e8:	8fb0002c 	lw	s0,44(sp)
+    a8ec:	03e00008 	jr	ra
+    a8f0:	27bd0038 	addiu	sp,sp,56
+
+0000a8f4 <hhinit>:
+    a8f4:	ac860008 	sw	a2,8(a0)
+    a8f8:	ac850004 	sw	a1,4(a0)
+    a8fc:	03e00008 	jr	ra
+    a900:	00001021 	addu	v0,zero,zero
+
+0000a904 <hninit>:
+    a904:	2402ffff 	addiu	v0,zero,-1
+    a908:	ac820000 	sw	v0,0(a0)
+    a90c:	ac800008 	sw	zero,8(a0)
+    a910:	ac800004 	sw	zero,4(a0)
+    a914:	03e00008 	jr	ra
+    a918:	00001021 	addu	v0,zero,zero
+
+0000a91c <__hfind>:
+    a91c:	27bdffd0 	addiu	sp,sp,-48
+    a920:	afb40024 	sw	s4,36(sp)
+    a924:	8c940000 	lw	s4,0(a0)
+    a928:	8c83000c 	lw	v1,12(a0)
+    a92c:	00b4001b 	divu	zero,a1,s4
+    a930:	028001f4 	teq	s4,zero,0x7
+    a934:	afb30020 	sw	s3,32(sp)
+    a938:	afb50028 	sw	s5,40(sp)
+    a93c:	afb2001c 	sw	s2,28(sp)
+    a940:	afb10018 	sw	s1,24(sp)
+    a944:	afb00014 	sw	s0,20(sp)
+    a948:	afbf002c 	sw	ra,44(sp)
+    a94c:	00808821 	addu	s1,a0,zero
+    a950:	00a08021 	addu	s0,a1,zero
+    a954:	00c0a821 	addu	s5,a2,zero
+    a958:	00001010 	mfhi	v0
+    a95c:	0002a0c0 	sll	s4,v0,0x3
+    a960:	0074a021 	addu	s4,v1,s4
+    a964:	8e930000 	lw	s3,0(s4)
+    a968:	16930004 	bne	s4,s3,a97c <__hfind+0x60>
+    a96c:	8e720000 	lw	s2,0(s3)
+    a970:	08002a6d 	j	a9b4 <__hfind+0x98>
+    a974:	00009821 	addu	s3,zero,zero
+    a978:	00409021 	addu	s2,v0,zero
+    a97c:	8e62fffc 	lw	v0,-4(s3)
+    a980:	2673fffc 	addiu	s3,s3,-4
+    a984:	02a02821 	addu	a1,s5,zero
+    a988:	14500006 	bne	v0,s0,a9a4 <__hfind+0x88>
+    a98c:	02602021 	addu	a0,s3,zero
+    a990:	8e220008 	lw	v0,8(s1)
+    a994:	0040f809 	jalr	v0
+    a998:	00000000 	sll	zero,zero,0x0
+    a99c:	14400006 	bnez	v0,a9b8 <__hfind+0x9c>
+    a9a0:	8fbf002c 	lw	ra,44(sp)
+    a9a4:	8e420000 	lw	v0,0(s2)
+    a9a8:	1692fff3 	bne	s4,s2,a978 <__hfind+0x5c>
+    a9ac:	02409821 	addu	s3,s2,zero
+    a9b0:	00009821 	addu	s3,zero,zero
+    a9b4:	8fbf002c 	lw	ra,44(sp)
+    a9b8:	02601021 	addu	v0,s3,zero
+    a9bc:	8fb50028 	lw	s5,40(sp)
+    a9c0:	8fb40024 	lw	s4,36(sp)
+    a9c4:	8fb30020 	lw	s3,32(sp)
+    a9c8:	8fb2001c 	lw	s2,28(sp)
+    a9cc:	8fb10018 	lw	s1,24(sp)
+    a9d0:	8fb00014 	lw	s0,20(sp)
+    a9d4:	03e00008 	jr	ra
+    a9d8:	27bd0030 	addiu	sp,sp,48
+
+0000a9dc <hfind>:
+    a9dc:	27bdffe0 	addiu	sp,sp,-32
+    a9e0:	8c820004 	lw	v0,4(a0)
+    a9e4:	afbf001c 	sw	ra,28(sp)
+    a9e8:	afb00018 	sw	s0,24(sp)
+    a9ec:	afa50010 	sw	a1,16(sp)
+    a9f0:	00808021 	addu	s0,a0,zero
+    a9f4:	0040f809 	jalr	v0
+    a9f8:	00a02021 	addu	a0,a1,zero
+    a9fc:	8fa60010 	lw	a2,16(sp)
+    aa00:	02002021 	addu	a0,s0,zero
+    aa04:	8fbf001c 	lw	ra,28(sp)
+    aa08:	8fb00018 	lw	s0,24(sp)
+    aa0c:	00402821 	addu	a1,v0,zero
+    aa10:	08002a47 	j	a91c <__hfind>
+    aa14:	27bd0020 	addiu	sp,sp,32
+
+0000aa18 <hinsert>:
+    aa18:	27bdffd8 	addiu	sp,sp,-40
+    aa1c:	8c820004 	lw	v0,4(a0)
+    aa20:	afb20020 	sw	s2,32(sp)
+    aa24:	afb1001c 	sw	s1,28(sp)
+    aa28:	afb00018 	sw	s0,24(sp)
+    aa2c:	afa60010 	sw	a2,16(sp)
+    aa30:	00808021 	addu	s0,a0,zero
+    aa34:	afbf0024 	sw	ra,36(sp)
+    aa38:	00c02021 	addu	a0,a2,zero
+    aa3c:	0040f809 	jalr	v0
+    aa40:	00a09021 	addu	s2,a1,zero
+    aa44:	8fa60010 	lw	a2,16(sp)
+    aa48:	02002021 	addu	a0,s0,zero
+    aa4c:	00402821 	addu	a1,v0,zero
+    aa50:	0c002a47 	jal	a91c <__hfind>
+    aa54:	00408821 	addu	s1,v0,zero
+    aa58:	10400007 	beqz	v0,aa78 <hinsert+0x60>
+    aa5c:	8fbf0024 	lw	ra,36(sp)
+    aa60:	2402ffff 	addiu	v0,zero,-1
+    aa64:	8fb20020 	lw	s2,32(sp)
+    aa68:	8fb1001c 	lw	s1,28(sp)
+    aa6c:	8fb00018 	lw	s0,24(sp)
+    aa70:	03e00008 	jr	ra
+    aa74:	27bd0028 	addiu	sp,sp,40
+    aa78:	8e040000 	lw	a0,0(s0)
+    aa7c:	8e03000c 	lw	v1,12(s0)
+    aa80:	0224001b 	divu	zero,s1,a0
+    aa84:	008001f4 	teq	a0,zero,0x7
+    aa88:	26450004 	addiu	a1,s2,4
+    aa8c:	ae510000 	sw	s1,0(s2)
+    aa90:	00001021 	addu	v0,zero,zero
+    aa94:	8fb1001c 	lw	s1,28(sp)
+    aa98:	8fb00018 	lw	s0,24(sp)
+    aa9c:	00002010 	mfhi	a0
+    aaa0:	000420c0 	sll	a0,a0,0x3
+    aaa4:	00641821 	addu	v1,v1,a0
+    aaa8:	8c640000 	lw	a0,0(v1)
+    aaac:	ae430008 	sw	v1,8(s2)
+    aab0:	ae440004 	sw	a0,4(s2)
+    aab4:	ac850004 	sw	a1,4(a0)
+    aab8:	8fb20020 	lw	s2,32(sp)
+    aabc:	ac650000 	sw	a1,0(v1)
+    aac0:	03e00008 	jr	ra
+    aac4:	27bd0028 	addiu	sp,sp,40
+
+0000aac8 <hremove>:
+    aac8:	27bdffe0 	addiu	sp,sp,-32
+    aacc:	8c820004 	lw	v0,4(a0)
+    aad0:	afb00018 	sw	s0,24(sp)
+    aad4:	afa50010 	sw	a1,16(sp)
+    aad8:	00808021 	addu	s0,a0,zero
+    aadc:	afbf001c 	sw	ra,28(sp)
+    aae0:	0040f809 	jalr	v0
+    aae4:	00a02021 	addu	a0,a1,zero
+    aae8:	8fa60010 	lw	a2,16(sp)
+    aaec:	02002021 	addu	a0,s0,zero
+    aaf0:	0c002a47 	jal	a91c <__hfind>
+    aaf4:	00402821 	addu	a1,v0,zero
+    aaf8:	10400009 	beqz	v0,ab20 <hremove+0x58>
+    aafc:	8fbf001c 	lw	ra,28(sp)
+    ab00:	8c430008 	lw	v1,8(v0)
+    ab04:	8c440004 	lw	a0,4(v0)
+    ab08:	00001021 	addu	v0,zero,zero
+    ab0c:	8fb00018 	lw	s0,24(sp)
+    ab10:	ac830004 	sw	v1,4(a0)
+    ab14:	ac640000 	sw	a0,0(v1)
+    ab18:	03e00008 	jr	ra
+    ab1c:	27bd0020 	addiu	sp,sp,32
+    ab20:	2402ffff 	addiu	v0,zero,-1
+    ab24:	8fb00018 	lw	s0,24(sp)
+    ab28:	03e00008 	jr	ra
+    ab2c:	27bd0020 	addiu	sp,sp,32
+
+0000ab30 <htable_int_default>:
+    ab30:	8c830000 	lw	v1,0(a0)
+    ab34:	3c0241c6 	lui	v0,0x41c6
+    ab38:	34424e6d 	ori	v0,v0,0x4e6d
+    ab3c:	70621002 	mul	v0,v1,v0
+    ab40:	24423039 	addiu	v0,v0,12345
+    ab44:	00021402 	srl	v0,v0,0x10
+    ab48:	03e00008 	jr	ra
+    ab4c:	30427fff 	andi	v0,v0,0x7fff
+
+0000ab50 <hhalloc>:
+    ab50:	27bdffd8 	addiu	sp,sp,-40
+    ab54:	afb00020 	sw	s0,32(sp)
+    ab58:	00808021 	addu	s0,a0,zero
+    ab5c:	27a40010 	addiu	a0,sp,16
+    ab60:	afbf0024 	sw	ra,36(sp)
+    ab64:	afa50018 	sw	a1,24(sp)
+    ab68:	afa00010 	sw	zero,16(sp)
+    ab6c:	0c00713f 	jal	1c4fc <kmem_alloc>
+    ab70:	afa00014 	sw	zero,20(sp)
+    ab74:	10400016 	beqz	v0,abd0 <hhalloc+0x80>
+    ab78:	24030200 	addiu	v1,zero,512
+    ab7c:	ae030000 	sw	v1,0(s0)
+    ab80:	0c007c15 	jal	1f054 <ppm_page2addr>
+    ab84:	00402021 	addu	a0,v0,zero
+    ab88:	8e050000 	lw	a1,0(s0)
+    ab8c:	10a0000b 	beqz	a1,abbc <hhalloc+0x6c>
+    ab90:	ae02000c 	sw	v0,12(s0)
+    ab94:	08002ae8 	j	aba0 <hhalloc+0x50>
+    ab98:	00001821 	addu	v1,zero,zero
+    ab9c:	8e02000c 	lw	v0,12(s0)
+    aba0:	000320c0 	sll	a0,v1,0x3
+    aba4:	24630001 	addiu	v1,v1,1
+    aba8:	00441021 	addu	v0,v0,a0
+    abac:	0065202b 	sltu	a0,v1,a1
+    abb0:	ac420004 	sw	v0,4(v0)
+    abb4:	1480fff9 	bnez	a0,ab9c <hhalloc+0x4c>
+    abb8:	ac420000 	sw	v0,0(v0)
+    abbc:	8fbf0024 	lw	ra,36(sp)
+    abc0:	00001021 	addu	v0,zero,zero
+    abc4:	8fb00020 	lw	s0,32(sp)
+    abc8:	03e00008 	jr	ra
+    abcc:	27bd0028 	addiu	sp,sp,40
+    abd0:	8fbf0024 	lw	ra,36(sp)
+    abd4:	2402000c 	addiu	v0,zero,12
+    abd8:	8fb00020 	lw	s0,32(sp)
+    abdc:	03e00008 	jr	ra
+    abe0:	27bd0028 	addiu	sp,sp,40
+
+0000abe4 <kern_init>:
+    abe4:	8c820058 	lw	v0,88(a0)
+    abe8:	27bdfc10 	addiu	sp,sp,-1008
+    abec:	afb303d4 	sw	s3,980(sp)
+    abf0:	afb103cc 	sw	s1,972(sp)
+    abf4:	afb003c8 	sw	s0,968(sp)
+    abf8:	afbf03ec 	sw	ra,1004(sp)
+    abfc:	afbe03e8 	sw	s8,1000(sp)
+    ac00:	afb703e4 	sw	s7,996(sp)
+    ac04:	afb603e0 	sw	s6,992(sp)
+    ac08:	afb503dc 	sw	s5,988(sp)
+    ac0c:	afb403d8 	sw	s4,984(sp)
+    ac10:	afb203d0 	sw	s2,976(sp)
+    ac14:	00808021 	addu	s0,a0,zero
+    ac18:	afa203b8 	sw	v0,952(sp)
+    ac1c:	0c00616c 	jal	185b0 <task_lookup_zero>
+    ac20:	8c930054 	lw	s3,84(a0)
+    ac24:	10400038 	beqz	v0,ad08 <kern_init+0x124>
+    ac28:	00408821 	addu	s1,v0,zero
+    ac2c:	27b20018 	addiu	s2,sp,24
+    ac30:	02402021 	addu	a0,s2,zero
+    ac34:	00002821 	addu	a1,zero,zero
+    ac38:	0c00c182 	jal	30608 <memset>
+    ac3c:	240603a0 	addiu	a2,zero,928
+    ac40:	40922002 	mtc0	s2,$4,2
+    ac44:	24030004 	addiu	v1,zero,4
+    ac48:	8e02006c 	lw	v0,108(s0)
+    ac4c:	afa3019c 	sw	v1,412(sp)
+    ac50:	24030002 	addiu	v1,zero,2
+    ac54:	afa30148 	sw	v1,328(sp)
+    ac58:	10400003 	beqz	v0,ac68 <kern_init+0x84>
+    ac5c:	afb10198 	sw	s1,408(sp)
+    ac60:	0040f809 	jalr	v0
+    ac64:	02002021 	addu	a0,s0,zero
+    ac68:	8e020064 	lw	v0,100(s0)
+    ac6c:	1053002f 	beq	v0,s3,ad2c <kern_init+0x148>
+    ac70:	3c04a5a5 	lui	a0,0xa5a5
+    ac74:	3484b5b5 	ori	a0,a0,0xb5b5
+    ac78:	3c030008 	lui	v1,0x8
+    ac7c:	8c6226f4 	lw	v0,9972(v1)
+    ac80:	1444fffe 	bne	v0,a0,ac7c <kern_init+0x98>
+    ac84:	00000000 	sll	zero,zero,0x0
+    ac88:	40034800 	mfc0	v1,c0_count
+    ac8c:	00000000 	sll	zero,zero,0x0
+    ac90:	246307d0 	addiu	v1,v1,2000
+    ac94:	40024800 	mfc0	v0,c0_count
+    ac98:	00000000 	sll	zero,zero,0x0
+    ac9c:	0043102b 	sltu	v0,v0,v1
+    aca0:	1440fffc 	bnez	v0,ac94 <kern_init+0xb0>
+    aca4:	00131280 	sll	v0,s3,0xa
+    aca8:	00139980 	sll	s3,s3,0x6
+    acac:	02629821 	addu	s3,s3,v0
+    acb0:	00131140 	sll	v0,s3,0x5
+    acb4:	00539823 	subu	s3,v0,s3
+    acb8:	3c020004 	lui	v0,0x4
+    acbc:	244271f0 	addiu	v0,v0,29168
+    acc0:	00539821 	addu	s3,v0,s3
+    acc4:	3c020001 	lui	v0,0x1
+    acc8:	02621021 	addu	v0,s3,v0
+    accc:	8c448320 	lw	a0,-31968(v0)
+    acd0:	0c00cc17 	jal	3305c <cpu_context_load>
+    acd4:	24840188 	addiu	a0,a0,392
+    acd8:	8fbf03ec 	lw	ra,1004(sp)
+    acdc:	8fbe03e8 	lw	s8,1000(sp)
+    ace0:	8fb703e4 	lw	s7,996(sp)
+    ace4:	8fb603e0 	lw	s6,992(sp)
+    ace8:	8fb503dc 	lw	s5,988(sp)
+    acec:	8fb403d8 	lw	s4,984(sp)
+    acf0:	8fb303d4 	lw	s3,980(sp)
+    acf4:	8fb203d0 	lw	s2,976(sp)
+    acf8:	8fb103cc 	lw	s1,972(sp)
+    acfc:	8fb003c8 	lw	s0,968(sp)
+    ad00:	03e00008 	jr	ra
+    ad04:	27bd03f0 	addiu	sp,sp,1008
+    ad08:	3c050003 	lui	a1,0x3
+    ad0c:	3c070003 	lui	a3,0x3
+    ad10:	24a55198 	addiu	a1,a1,20888
+    ad14:	24e751d8 	addiu	a3,a3,20952
+    ad18:	24040001 	addiu	a0,zero,1
+    ad1c:	0c00097d 	jal	25f4 <__perror>
+    ad20:	2406004f 	addiu	a2,zero,79
+    ad24:	08002b49 	j	ad24 <kern_init+0x140>
+    ad28:	00000000 	sll	zero,zero,0x0
+    ad2c:	0c0062ca 	jal	18b28 <task_bootstrap_init>
+    ad30:	02002021 	addu	a0,s0,zero
+    ad34:	0c0062a1 	jal	18a84 <task_manager_init>
+    ad38:	00000000 	sll	zero,zero,0x0
+    ad3c:	0c0089fb 	jal	227ec <devfs_root_init>
+    ad40:	00000000 	sll	zero,zero,0x0
+    ad44:	3c040008 	lui	a0,0x8
+    ad48:	3c020003 	lui	v0,0x3
+    ad4c:	24840390 	addiu	a0,a0,912
+    ad50:	244251ec 	addiu	v0,v0,20972
+    ad54:	3c030008 	lui	v1,0x8
+    ad58:	ac820010 	sw	v0,16(a0)
+    ad5c:	ac800014 	sw	zero,20(a0)
+    ad60:	246303b0 	addiu	v1,v1,944
+    ad64:	00001021 	addu	v0,zero,zero
+    ad68:	2406000a 	addiu	a2,zero,10
+    ad6c:	24450004 	addiu	a1,v0,4
+    ad70:	000528c0 	sll	a1,a1,0x3
+    ad74:	00852821 	addu	a1,a0,a1
+    ad78:	24420001 	addiu	v0,v0,1
+    ad7c:	ac650004 	sw	a1,4(v1)
+    ad80:	ac650000 	sw	a1,0(v1)
+    ad84:	1446fff9 	bne	v0,a2,ad6c <kern_init+0x188>
+    ad88:	24630008 	addiu	v1,v1,8
+    ad8c:	0c0008c6 	jal	2318 <arch_init>
+    ad90:	02002021 	addu	a0,s0,zero
+    ad94:	0c0062af 	jal	18abc <task_bootstrap_finalize>
+    ad98:	02002021 	addu	a0,s0,zero
+    ad9c:	0c001cce 	jal	7338 <clusters_sysfs_register>
+    ada0:	3c1e0004 	lui	s8,0x4
+    ada4:	0c00095f 	jal	257c <kdmsg_init>
+    ada8:	27de6db0 	addiu	s8,s8,28080
+    adac:	0c006361 	jal	18d84 <task_manager_init_finalize>
+    adb0:	3c170002 	lui	s7,0x2
+    adb4:	0c00b28f 	jal	2ca3c <vfs_init>
+    adb8:	03d7b821 	addu	s7,s8,s7
+    adbc:	0c004e4a 	jal	13928 <sysconf_init>
+    adc0:	00000000 	sll	zero,zero,0x0
+    adc4:	0c0028ec 	jal	a3b0 <dqdt_init>
+    adc8:	02002021 	addu	a0,s0,zero
+    adcc:	8e020020 	lw	v0,32(s0)
+    add0:	3c030008 	lui	v1,0x8
+    add4:	ac6202e0 	sw	v0,736(v1)
+    add8:	8e020024 	lw	v0,36(s0)
+    addc:	246302e0 	addiu	v1,v1,736
+    ade0:	aef11340 	sw	s1,4928(s7)
+    ade4:	ac620004 	sw	v0,4(v1)
+    ade8:	40027801 	mfc0	v0,$15,1
+    adec:	3c160004 	lui	s6,0x4
+    adf0:	30420003 	andi	v0,v0,0x3
+    adf4:	00021080 	sll	v0,v0,0x2
+    adf8:	26d6c950 	addiu	s6,s6,-14000
+    adfc:	02c21021 	addu	v0,s6,v0
+    ae00:	8c420000 	lw	v0,0(v0)
+    ae04:	3c140005 	lui	s4,0x5
+    ae08:	3c080002 	lui	t0,0x2
+    ae0c:	ac620008 	sw	v0,8(v1)
+    ae10:	2694f510 	addiu	s4,s4,-2800
+    ae14:	2508a694 	addiu	t0,t0,-22892
+    ae18:	00008821 	addu	s1,zero,zero
+    ae1c:	24150002 	addiu	s5,zero,2
+    ae20:	08002ba8 	j	aea0 <kern_init+0x2bc>
+    ae24:	340983c0 	ori	t1,zero,0x83c0
+    ae28:	8ee41340 	lw	a0,4928(s7)
+    ae2c:	afa303c0 	sw	v1,960(sp)
+    ae30:	afa803bc 	sw	t0,956(sp)
+    ae34:	0c002eaf 	jal	babc <kthread_create>
+    ae38:	afa903c4 	sw	t1,964(sp)
+    ae3c:	00409021 	addu	s2,v0,zero
+    ae40:	40057801 	mfc0	a1,$15,1
+    ae44:	40024800 	mfc0	v0,c0_count
+    ae48:	00000000 	sll	zero,zero,0x0
+    ae4c:	30a50003 	andi	a1,a1,0x3
+    ae50:	00052880 	sll	a1,a1,0x2
+    ae54:	02c52821 	addu	a1,s6,a1
+    ae58:	3c060004 	lui	a2,0x4
+    ae5c:	8caa0000 	lw	t2,0(a1)
+    ae60:	8cc49100 	lw	a0,-28416(a2)
+    ae64:	3c060003 	lui	a2,0x3
+    ae68:	00002821 	addu	a1,zero,zero
+    ae6c:	24c651f0 	addiu	a2,a2,20976
+    ae70:	02403821 	addu	a3,s2,zero
+    ae74:	afaa0010 	sw	t2,16(sp)
+    ae78:	0c0009b0 	jal	26c0 <__fprintk>
+    ae7c:	afa20014 	sw	v0,20(sp)
+    ae80:	8fa903c4 	lw	t1,964(sp)
+    ae84:	8fa803bc 	lw	t0,956(sp)
+    ae88:	8fa303c0 	lw	v1,960(sp)
+    ae8c:	ae920000 	sw	s2,0(s4)
+    ae90:	ae550130 	sw	s5,304(s2)
+    ae94:	ae550184 	sw	s5,388(s2)
+    ae98:	26310001 	addiu	s1,s1,1
+    ae9c:	0289a021 	addu	s4,s4,t1
+    aea0:	8fc20404 	lw	v0,1028(s8)
+    aea4:	01002821 	addu	a1,t0,zero
+    aea8:	0222102b 	sltu	v0,s1,v0
+    aeac:	00603021 	addu	a2,v1,zero
+    aeb0:	1440ffdd 	bnez	v0,ae28 <kern_init+0x244>
+    aeb4:	02203821 	addu	a3,s1,zero
+    aeb8:	0c001d2b 	jal	74ac <cluster_init_flag>
+    aebc:	02002021 	addu	a0,s0,zero
+    aec0:	0c001cfb 	jal	73ec <cluster_wait_flag>
+    aec4:	02002021 	addu	a0,s0,zero
+    aec8:	8e02005c 	lw	v0,92(s0)
+    aecc:	8fa303b8 	lw	v1,952(sp)
+    aed0:	10430008 	beq	v0,v1,aef4 <kern_init+0x310>
+    aed4:	00000000 	sll	zero,zero,0x0
+    aed8:	3c03a5a5 	lui	v1,0xa5a5
+    aedc:	3463b5b5 	ori	v1,v1,0xb5b5
+    aee0:	3c020008 	lui	v0,0x8
+    aee4:	ac4326f4 	sw	v1,9972(v0)
+    aee8:	0000000f 	sync
+    aeec:	08002b2a 	j	aca8 <kern_init+0xc4>
+    aef0:	00131280 	sll	v0,s3,0xa
+    aef4:	40074800 	mfc0	a3,c0_count
+    aef8:	00000000 	sll	zero,zero,0x0
+    aefc:	3c100004 	lui	s0,0x4
+    af00:	8e049100 	lw	a0,-28416(s0)
+    af04:	3c060003 	lui	a2,0x3
+    af08:	24c65220 	addiu	a2,a2,21024
+    af0c:	0c0009b0 	jal	26c0 <__fprintk>
+    af10:	00002821 	addu	a1,zero,zero
+    af14:	8e049100 	lw	a0,-28416(s0)
+    af18:	3c060003 	lui	a2,0x3
+    af1c:	24c6524c 	addiu	a2,a2,21068
+    af20:	0c0009b0 	jal	26c0 <__fprintk>
+    af24:	00002821 	addu	a1,zero,zero
+    af28:	8e049100 	lw	a0,-28416(s0)
+    af2c:	3c060003 	lui	a2,0x3
+    af30:	24c652bc 	addiu	a2,a2,21180
+    af34:	0c0009b0 	jal	26c0 <__fprintk>
+    af38:	00002821 	addu	a1,zero,zero
+    af3c:	8e049100 	lw	a0,-28416(s0)
+    af40:	3c060003 	lui	a2,0x3
+    af44:	24c6532c 	addiu	a2,a2,21292
+    af48:	0c0009b0 	jal	26c0 <__fprintk>
+    af4c:	00002821 	addu	a1,zero,zero
+    af50:	8e049100 	lw	a0,-28416(s0)
+    af54:	3c060003 	lui	a2,0x3
+    af58:	24c6539c 	addiu	a2,a2,21404
+    af5c:	0c0009b0 	jal	26c0 <__fprintk>
+    af60:	00002821 	addu	a1,zero,zero
+    af64:	8e049100 	lw	a0,-28416(s0)
+    af68:	3c060003 	lui	a2,0x3
+    af6c:	24c6540c 	addiu	a2,a2,21516
+    af70:	0c0009b0 	jal	26c0 <__fprintk>
+    af74:	00002821 	addu	a1,zero,zero
+    af78:	8e049100 	lw	a0,-28416(s0)
+    af7c:	3c060003 	lui	a2,0x3
+    af80:	24c65478 	addiu	a2,a2,21624
+    af84:	0c0009b0 	jal	26c0 <__fprintk>
+    af88:	00002821 	addu	a1,zero,zero
+    af8c:	8e049100 	lw	a0,-28416(s0)
+    af90:	3c060003 	lui	a2,0x3
+    af94:	24c654e4 	addiu	a2,a2,21732
+    af98:	0c0009b0 	jal	26c0 <__fprintk>
+    af9c:	00002821 	addu	a1,zero,zero
+    afa0:	8e049100 	lw	a0,-28416(s0)
+    afa4:	3c060003 	lui	a2,0x3
+    afa8:	24c65550 	addiu	a2,a2,21840
+    afac:	0c0009b0 	jal	26c0 <__fprintk>
+    afb0:	00002821 	addu	a1,zero,zero
+    afb4:	8e049100 	lw	a0,-28416(s0)
+    afb8:	3c060003 	lui	a2,0x3
+    afbc:	24c655bc 	addiu	a2,a2,21948
+    afc0:	0c0009b0 	jal	26c0 <__fprintk>
+    afc4:	00002821 	addu	a1,zero,zero
+    afc8:	8e049100 	lw	a0,-28416(s0)
+    afcc:	3c060003 	lui	a2,0x3
+    afd0:	3c070003 	lui	a3,0x3
+    afd4:	24c655f4 	addiu	a2,a2,22004
+    afd8:	24e75614 	addiu	a3,a3,22036
+    afdc:	0c0009b0 	jal	26c0 <__fprintk>
+    afe0:	00002821 	addu	a1,zero,zero
+    afe4:	08002bb7 	j	aedc <kern_init+0x2f8>
+    afe8:	3c03a5a5 	lui	v1,0xa5a5
+
+0000afec <keysrec_kmem_init>:
+    afec:	24030018 	addiu	v1,zero,24
+    aff0:	ac830000 	sw	v1,0(a0)
+    aff4:	3c030003 	lui	v1,0x3
+    aff8:	2463562c 	addiu	v1,v1,22060
+    affc:	24020002 	addiu	v0,zero,2
+    b000:	ac830004 	sw	v1,4(a0)
+    b004:	24030100 	addiu	v1,zero,256
+    b008:	ac820010 	sw	v0,16(a0)
+    b00c:	ac82000c 	sw	v0,12(a0)
+    b010:	ac830008 	sw	v1,8(a0)
+    b014:	ac80001c 	sw	zero,28(a0)
+    b018:	ac800014 	sw	zero,20(a0)
+    b01c:	ac800018 	sw	zero,24(a0)
+    b020:	03e00008 	jr	ra
+    b024:	00001021 	addu	v0,zero,zero
+
+0000b028 <keysdb_unbind>:
+    b028:	10c00017 	beqz	a2,b088 <keysdb_unbind+0x60>
+    b02c:	24080001 	addiu	t0,zero,1
+    b030:	8c820008 	lw	v0,8(a0)
+    b034:	8c87000c 	lw	a3,12(a0)
+    b038:	00e23823 	subu	a3,a3,v0
+    b03c:	00e84004 	sllv	t0,t0,a3
+    b040:	8c890000 	lw	t1,0(a0)
+    b044:	2508ffff 	addiu	t0,t0,-1
+    b048:	00001021 	addu	v0,zero,zero
+    b04c:	00452021 	addu	a0,v0,a1
+    b050:	00e41806 	srlv	v1,a0,a3
+    b054:	00031880 	sll	v1,v1,0x2
+    b058:	01231821 	addu	v1,t1,v1
+    b05c:	8c630000 	lw	v1,0(v1)
+    b060:	00882024 	and	a0,a0,t0
+    b064:	00042080 	sll	a0,a0,0x2
+    b068:	10600003 	beqz	v1,b078 <keysdb_unbind+0x50>
+    b06c:	00642021 	addu	a0,v1,a0
+    b070:	ac800000 	sw	zero,0(a0)
+    b074:	0000000f 	sync
+    b078:	24420001 	addiu	v0,v0,1
+    b07c:	0046182b 	sltu	v1,v0,a2
+    b080:	1460fff3 	bnez	v1,b050 <keysdb_unbind+0x28>
+    b084:	00452021 	addu	a0,v0,a1
+    b088:	03e00008 	jr	ra
+    b08c:	00001021 	addu	v0,zero,zero
+
+0000b090 <keysdb_remove>:
+    b090:	8c83000c 	lw	v1,12(a0)
+    b094:	8c820008 	lw	v0,8(a0)
+    b098:	8c840000 	lw	a0,0(a0)
+    b09c:	00621023 	subu	v0,v1,v0
+    b0a0:	00451806 	srlv	v1,a1,v0
+    b0a4:	00031880 	sll	v1,v1,0x2
+    b0a8:	00831821 	addu	v1,a0,v1
+    b0ac:	8c640000 	lw	a0,0(v1)
+    b0b0:	1080000b 	beqz	a0,b0e0 <keysdb_remove+0x50>
+    b0b4:	24030001 	addiu	v1,zero,1
+    b0b8:	00431004 	sllv	v0,v1,v0
+    b0bc:	2442ffff 	addiu	v0,v0,-1
+    b0c0:	00452824 	and	a1,v0,a1
+    b0c4:	00052880 	sll	a1,a1,0x2
+    b0c8:	00852021 	addu	a0,a0,a1
+    b0cc:	8c820000 	lw	v0,0(a0)
+    b0d0:	ac800000 	sw	zero,0(a0)
+    b0d4:	0000000f 	sync
+    b0d8:	03e00008 	jr	ra
+    b0dc:	00000000 	sll	zero,zero,0x0
+    b0e0:	03e00008 	jr	ra
+    b0e4:	00001021 	addu	v0,zero,zero
+
+0000b0e8 <keysdb_lookup>:
+    b0e8:	8c83000c 	lw	v1,12(a0)
+    b0ec:	8c820008 	lw	v0,8(a0)
+    b0f0:	8c840000 	lw	a0,0(a0)
+    b0f4:	00621023 	subu	v0,v1,v0
+    b0f8:	00451806 	srlv	v1,a1,v0
+    b0fc:	00031880 	sll	v1,v1,0x2
+    b100:	00831821 	addu	v1,a0,v1
+    b104:	8c640000 	lw	a0,0(v1)
+    b108:	10800008 	beqz	a0,b12c <keysdb_lookup+0x44>
+    b10c:	24030001 	addiu	v1,zero,1
+    b110:	00431004 	sllv	v0,v1,v0
+    b114:	2442ffff 	addiu	v0,v0,-1
+    b118:	00452824 	and	a1,v0,a1
+    b11c:	00052880 	sll	a1,a1,0x2
+    b120:	00852021 	addu	a0,a0,a1
+    b124:	03e00008 	jr	ra
+    b128:	8c820000 	lw	v0,0(a0)
+    b12c:	03e00008 	jr	ra
+    b130:	00001021 	addu	v0,zero,zero
+
+0000b134 <keysdb_insert_seq>:
+    b134:	27bdffc0 	addiu	sp,sp,-64
+    b138:	8c820008 	lw	v0,8(a0)
+    b13c:	afb2002c 	sw	s2,44(sp)
+    b140:	8c92000c 	lw	s2,12(a0)
+    b144:	afb50038 	sw	s5,56(sp)
+    b148:	02429023 	subu	s2,s2,v0
+    b14c:	afb30030 	sw	s3,48(sp)
+    b150:	8c950000 	lw	s5,0(a0)
+    b154:	02459806 	srlv	s3,a1,s2
+    b158:	00139880 	sll	s3,s3,0x2
+    b15c:	02b3a821 	addu	s5,s5,s3
+    b160:	8ea20000 	lw	v0,0(s5)
+    b164:	afb40034 	sw	s4,52(sp)
+    b168:	afb10028 	sw	s1,40(sp)
+    b16c:	afb00024 	sw	s0,36(sp)
+    b170:	afbf003c 	sw	ra,60(sp)
+    b174:	00808021 	addu	s0,a0,zero
+    b178:	00a08821 	addu	s1,a1,zero
+    b17c:	1040001e 	beqz	v0,b1f8 <keysdb_insert_seq+0xc4>
+    b180:	00c0a021 	addu	s4,a2,zero
+    b184:	24030001 	addiu	v1,zero,1
+    b188:	02439004 	sllv	s2,v1,s2
+    b18c:	2652ffff 	addiu	s2,s2,-1
+    b190:	02518824 	and	s1,s2,s1
+    b194:	00118880 	sll	s1,s1,0x2
+    b198:	00511021 	addu	v0,v0,s1
+    b19c:	8c430000 	lw	v1,0(v0)
+    b1a0:	1060000b 	beqz	v1,b1d0 <keysdb_insert_seq+0x9c>
+    b1a4:	8fbf003c 	lw	ra,60(sp)
+    b1a8:	24020011 	addiu	v0,zero,17
+    b1ac:	8fbf003c 	lw	ra,60(sp)
+    b1b0:	8fb50038 	lw	s5,56(sp)
+    b1b4:	8fb40034 	lw	s4,52(sp)
+    b1b8:	8fb30030 	lw	s3,48(sp)
+    b1bc:	8fb2002c 	lw	s2,44(sp)
+    b1c0:	8fb10028 	lw	s1,40(sp)
+    b1c4:	8fb00024 	lw	s0,36(sp)
+    b1c8:	03e00008 	jr	ra
+    b1cc:	27bd0040 	addiu	sp,sp,64
+    b1d0:	ac540000 	sw	s4,0(v0)
+    b1d4:	8fb50038 	lw	s5,56(sp)
+    b1d8:	00001021 	addu	v0,zero,zero
+    b1dc:	8fb40034 	lw	s4,52(sp)
+    b1e0:	8fb30030 	lw	s3,48(sp)
+    b1e4:	8fb2002c 	lw	s2,44(sp)
+    b1e8:	8fb10028 	lw	s1,40(sp)
+    b1ec:	8fb00024 	lw	s0,36(sp)
+    b1f0:	03e00008 	jr	ra
+    b1f4:	27bd0040 	addiu	sp,sp,64
+    b1f8:	24020018 	addiu	v0,zero,24
+    b1fc:	afa20010 	sw	v0,16(sp)
+    b200:	24020100 	addiu	v0,zero,256
+    b204:	afa20014 	sw	v0,20(sp)
+    b208:	3c020022 	lui	v0,0x22
+    b20c:	27a40010 	addiu	a0,sp,16
+    b210:	34420040 	ori	v0,v0,0x40
+    b214:	0c00713f 	jal	1c4fc <kmem_alloc>
+    b218:	afa20018 	sw	v0,24(sp)
+    b21c:	8e030000 	lw	v1,0(s0)
+    b220:	aea20000 	sw	v0,0(s5)
+    b224:	00731821 	addu	v1,v1,s3
+    b228:	8c640000 	lw	a0,0(v1)
+    b22c:	10800008 	beqz	a0,b250 <keysdb_insert_seq+0x11c>
+    b230:	00000000 	sll	zero,zero,0x0
+    b234:	8fa60014 	lw	a2,20(sp)
+    b238:	0c00c182 	jal	30608 <memset>
+    b23c:	00002821 	addu	a1,zero,zero
+    b240:	8e020000 	lw	v0,0(s0)
+    b244:	00539821 	addu	s3,v0,s3
+    b248:	08002c61 	j	b184 <keysdb_insert_seq+0x50>
+    b24c:	8e620000 	lw	v0,0(s3)
+    b250:	08002c6b 	j	b1ac <keysdb_insert_seq+0x78>
+    b254:	2402000c 	addiu	v0,zero,12
+
+0000b258 <keysdb_insert>:
+    b258:	27bdffb8 	addiu	sp,sp,-72
+    b25c:	8c820008 	lw	v0,8(a0)
+    b260:	afb50034 	sw	s5,52(sp)
+    b264:	8c95000c 	lw	s5,12(a0)
+    b268:	afb20028 	sw	s2,40(sp)
+    b26c:	02a2a823 	subu	s5,s5,v0
+    b270:	afb10024 	sw	s1,36(sp)
+    b274:	00809021 	addu	s2,a0,zero
+    b278:	02a58806 	srlv	s1,a1,s5
+    b27c:	8c840000 	lw	a0,0(a0)
+    b280:	00118880 	sll	s1,s1,0x2
+    b284:	afb3002c 	sw	s3,44(sp)
+    b288:	00919821 	addu	s3,a0,s1
+    b28c:	8e620000 	lw	v0,0(s3)
+    b290:	afb40030 	sw	s4,48(sp)
+    b294:	afbf0044 	sw	ra,68(sp)
+    b298:	afbe0040 	sw	s8,64(sp)
+    b29c:	afb7003c 	sw	s7,60(sp)
+    b2a0:	afb60038 	sw	s6,56(sp)
+    b2a4:	afb00020 	sw	s0,32(sp)
+    b2a8:	00a0a021 	addu	s4,a1,zero
+    b2ac:	14400022 	bnez	v0,b338 <keysdb_insert+0xe0>
+    b2b0:	afa60050 	sw	a2,80(sp)
+    b2b4:	3c170022 	lui	s7,0x22
+    b2b8:	36f70040 	ori	s7,s7,0x40
+    b2bc:	00005021 	addu	t2,zero,zero
+    b2c0:	00008021 	addu	s0,zero,zero
+    b2c4:	24160018 	addiu	s6,zero,24
+    b2c8:	241e0100 	addiu	s8,zero,256
+    b2cc:	12000030 	beqz	s0,b390 <keysdb_insert+0x138>
+    b2d0:	00000000 	sll	zero,zero,0x0
+    b2d4:	00912821 	addu	a1,a0,s1
+    b2d8:	00003021 	addu	a2,zero,zero
+    b2dc:	0000000f 	sync
+    b2e0:	00104025 	or	t0,zero,s0
+    b2e4:	c0a30000 	ll	v1,0(a1)
+    b2e8:	14660004 	bne	v1,a2,b2fc <keysdb_insert+0xa4>
+    b2ec:	24070000 	addiu	a3,zero,0
+    b2f0:	e0a80000 	sc	t0,0(a1)
+    b2f4:	01003825 	or	a3,t0,zero
+    b2f8:	0000000f 	sync
+    b2fc:	00e04825 	or	t1,a3,zero
+    b300:	14400003 	bnez	v0,b310 <keysdb_insert+0xb8>
+    b304:	00000000 	sll	zero,zero,0x0
+    b308:	1120fff0 	beqz	t1,b2cc <keysdb_insert+0x74>
+    b30c:	00000000 	sll	zero,zero,0x0
+    b310:	1140002e 	beqz	t2,b3cc <keysdb_insert+0x174>
+    b314:	24030001 	addiu	v1,zero,1
+    b318:	8ca20000 	lw	v0,0(a1)
+    b31c:	10500007 	beq	v0,s0,b33c <keysdb_insert+0xe4>
+    b320:	27a40010 	addiu	a0,sp,16
+    b324:	0c007134 	jal	1c4d0 <kmem_free>
+    b328:	afb0001c 	sw	s0,28(sp)
+    b32c:	8e420000 	lw	v0,0(s2)
+    b330:	00518821 	addu	s1,v0,s1
+    b334:	8e220000 	lw	v0,0(s1)
+    b338:	24030001 	addiu	v1,zero,1
+    b33c:	02a3a804 	sllv	s5,v1,s5
+    b340:	26b5ffff 	addiu	s5,s5,-1
+    b344:	02b4a024 	and	s4,s5,s4
+    b348:	0014a080 	sll	s4,s4,0x2
+    b34c:	00541021 	addu	v0,v0,s4
+    b350:	8c430000 	lw	v1,0(v0)
+    b354:	10600026 	beqz	v1,b3f0 <keysdb_insert+0x198>
+    b358:	8fa30050 	lw	v1,80(sp)
+    b35c:	24020011 	addiu	v0,zero,17
+    b360:	8fbf0044 	lw	ra,68(sp)
+    b364:	8fbe0040 	lw	s8,64(sp)
+    b368:	8fb7003c 	lw	s7,60(sp)
+    b36c:	8fb60038 	lw	s6,56(sp)
+    b370:	8fb50034 	lw	s5,52(sp)
+    b374:	8fb40030 	lw	s4,48(sp)
+    b378:	8fb3002c 	lw	s3,44(sp)
+    b37c:	8fb20028 	lw	s2,40(sp)
+    b380:	8fb10024 	lw	s1,36(sp)
+    b384:	8fb00020 	lw	s0,32(sp)
+    b388:	03e00008 	jr	ra
+    b38c:	27bd0048 	addiu	sp,sp,72
+    b390:	27a40010 	addiu	a0,sp,16
+    b394:	afb60010 	sw	s6,16(sp)
+    b398:	afbe0014 	sw	s8,20(sp)
+    b39c:	0c00713f 	jal	1c4fc <kmem_alloc>
+    b3a0:	afb70018 	sw	s7,24(sp)
+    b3a4:	00408021 	addu	s0,v0,zero
+    b3a8:	00402021 	addu	a0,v0,zero
+    b3ac:	1040001e 	beqz	v0,b428 <keysdb_insert+0x1d0>
+    b3b0:	00002821 	addu	a1,zero,zero
+    b3b4:	0c00c182 	jal	30608 <memset>
+    b3b8:	8fa60014 	lw	a2,20(sp)
+    b3bc:	8e440000 	lw	a0,0(s2)
+    b3c0:	8e620000 	lw	v0,0(s3)
+    b3c4:	08002cb5 	j	b2d4 <keysdb_insert+0x7c>
+    b3c8:	240a0001 	addiu	t2,zero,1
+    b3cc:	02a3a804 	sllv	s5,v1,s5
+    b3d0:	26b5ffff 	addiu	s5,s5,-1
+    b3d4:	8ca20000 	lw	v0,0(a1)
+    b3d8:	02b4a024 	and	s4,s5,s4
+    b3dc:	0014a080 	sll	s4,s4,0x2
+    b3e0:	00541021 	addu	v0,v0,s4
+    b3e4:	8c430000 	lw	v1,0(v0)
+    b3e8:	1460ffdc 	bnez	v1,b35c <keysdb_insert+0x104>
+    b3ec:	8fa30050 	lw	v1,80(sp)
+    b3f0:	8fbf0044 	lw	ra,68(sp)
+    b3f4:	ac430000 	sw	v1,0(v0)
+    b3f8:	8fbe0040 	lw	s8,64(sp)
+    b3fc:	00001021 	addu	v0,zero,zero
+    b400:	8fb7003c 	lw	s7,60(sp)
+    b404:	8fb60038 	lw	s6,56(sp)
+    b408:	8fb50034 	lw	s5,52(sp)
+    b40c:	8fb40030 	lw	s4,48(sp)
+    b410:	8fb3002c 	lw	s3,44(sp)
+    b414:	8fb20028 	lw	s2,40(sp)
+    b418:	8fb10024 	lw	s1,36(sp)
+    b41c:	8fb00020 	lw	s0,32(sp)
+    b420:	03e00008 	jr	ra
+    b424:	27bd0048 	addiu	sp,sp,72
+    b428:	08002cd8 	j	b360 <keysdb_insert+0x108>
+    b42c:	2402000c 	addiu	v0,zero,12
+
+0000b430 <keysdb_bind>:
+    b430:	27bdffd8 	addiu	sp,sp,-40
+    b434:	afb40020 	sw	s4,32(sp)
+    b438:	afb20018 	sw	s2,24(sp)
+    b43c:	afb10014 	sw	s1,20(sp)
+    b440:	afb00010 	sw	s0,16(sp)
+    b444:	afbf0024 	sw	ra,36(sp)
+    b448:	afb3001c 	sw	s3,28(sp)
+    b44c:	00c08821 	addu	s1,a2,zero
+    b450:	00808021 	addu	s0,a0,zero
+    b454:	00a09021 	addu	s2,a1,zero
+    b458:	10c00030 	beqz	a2,b51c <keysdb_bind+0xec>
+    b45c:	00e0a021 	addu	s4,a3,zero
+    b460:	08002d1d 	j	b474 <keysdb_bind+0x44>
+    b464:	00009821 	addu	s3,zero,zero
+    b468:	0271182b 	sltu	v1,s3,s1
+    b46c:	10600022 	beqz	v1,b4f8 <keysdb_bind+0xc8>
+    b470:	00404021 	addu	t0,v0,zero
+    b474:	02722821 	addu	a1,s3,s2
+    b478:	02002021 	addu	a0,s0,zero
+    b47c:	0c002c96 	jal	b258 <keysdb_insert>
+    b480:	02803021 	addu	a2,s4,zero
+    b484:	1040fff8 	beqz	v0,b468 <keysdb_bind+0x38>
+    b488:	26730001 	addiu	s3,s3,1
+    b48c:	2673ffff 	addiu	s3,s3,-1
+    b490:	12600019 	beqz	s3,b4f8 <keysdb_bind+0xc8>
+    b494:	00404021 	addu	t0,v0,zero
+    b498:	8e05000c 	lw	a1,12(s0)
+    b49c:	8e020008 	lw	v0,8(s0)
+    b4a0:	24060001 	addiu	a2,zero,1
+    b4a4:	00a22823 	subu	a1,a1,v0
+    b4a8:	00a63004 	sllv	a2,a2,a1
+    b4ac:	2652ffff 	addiu	s2,s2,-1
+    b4b0:	8e070000 	lw	a3,0(s0)
+    b4b4:	24c6ffff 	addiu	a2,a2,-1
+    b4b8:	02539021 	addu	s2,s2,s3
+    b4bc:	00b21806 	srlv	v1,s2,a1
+    b4c0:	00031880 	sll	v1,v1,0x2
+    b4c4:	00e31821 	addu	v1,a3,v1
+    b4c8:	8c630000 	lw	v1,0(v1)
+    b4cc:	00d22024 	and	a0,a2,s2
+    b4d0:	00042080 	sll	a0,a0,0x2
+    b4d4:	00642021 	addu	a0,v1,a0
+    b4d8:	10600003 	beqz	v1,b4e8 <keysdb_bind+0xb8>
+    b4dc:	2673ffff 	addiu	s3,s3,-1
+    b4e0:	ac800000 	sw	zero,0(a0)
+    b4e4:	0000000f 	sync
+    b4e8:	1660fff4 	bnez	s3,b4bc <keysdb_bind+0x8c>
+    b4ec:	2652ffff 	addiu	s2,s2,-1
+    b4f0:	08002d3f 	j	b4fc <keysdb_bind+0xcc>
+    b4f4:	8fbf0024 	lw	ra,36(sp)
+    b4f8:	8fbf0024 	lw	ra,36(sp)
+    b4fc:	01001021 	addu	v0,t0,zero
+    b500:	8fb40020 	lw	s4,32(sp)
+    b504:	8fb3001c 	lw	s3,28(sp)
+    b508:	8fb20018 	lw	s2,24(sp)
+    b50c:	8fb10014 	lw	s1,20(sp)
+    b510:	8fb00010 	lw	s0,16(sp)
+    b514:	03e00008 	jr	ra
+    b518:	27bd0028 	addiu	sp,sp,40
+    b51c:	08002d3e 	j	b4f8 <keysdb_bind+0xc8>
+    b520:	00004021 	addu	t0,zero,zero
+
+0000b524 <keysdb_destroy>:
+    b524:	8c830004 	lw	v1,4(a0)
+    b528:	27bdffd0 	addiu	sp,sp,-48
+    b52c:	24020018 	addiu	v0,zero,24
+    b530:	afb10024 	sw	s1,36(sp)
+    b534:	afbf002c 	sw	ra,44(sp)
+    b538:	afb20028 	sw	s2,40(sp)
+    b53c:	afb00020 	sw	s0,32(sp)
+    b540:	00808821 	addu	s1,a0,zero
+    b544:	1060001c 	beqz	v1,b5b8 <keysdb_destroy+0x94>
+    b548:	afa20010 	sw	v0,16(sp)
+    b54c:	00008021 	addu	s0,zero,zero
+    b550:	27b20010 	addiu	s2,sp,16
+    b554:	8e240000 	lw	a0,0(s1)
+    b558:	00101080 	sll	v0,s0,0x2
+    b55c:	00821021 	addu	v0,a0,v0
+    b560:	8c420000 	lw	v0,0(v0)
+    b564:	26100001 	addiu	s0,s0,1
+    b568:	10400004 	beqz	v0,b57c <keysdb_destroy+0x58>
+    b56c:	02402021 	addu	a0,s2,zero
+    b570:	0c007134 	jal	1c4d0 <kmem_free>
+    b574:	afa2001c 	sw	v0,28(sp)
+    b578:	8e230004 	lw	v1,4(s1)
+    b57c:	0203102b 	sltu	v0,s0,v1
+    b580:	1440fff4 	bnez	v0,b554 <keysdb_destroy+0x30>
+    b584:	00000000 	sll	zero,zero,0x0
+    b588:	8e220014 	lw	v0,20(s1)
+    b58c:	02402021 	addu	a0,s2,zero
+    b590:	afa2001c 	sw	v0,28(sp)
+    b594:	0c007134 	jal	1c4d0 <kmem_free>
+    b598:	afa00010 	sw	zero,16(sp)
+    b59c:	8fbf002c 	lw	ra,44(sp)
+    b5a0:	00001021 	addu	v0,zero,zero
+    b5a4:	8fb20028 	lw	s2,40(sp)
+    b5a8:	8fb10024 	lw	s1,36(sp)
+    b5ac:	8fb00020 	lw	s0,32(sp)
+    b5b0:	03e00008 	jr	ra
+    b5b4:	27bd0030 	addiu	sp,sp,48
+    b5b8:	08002d62 	j	b588 <keysdb_destroy+0x64>
+    b5bc:	27b20010 	addiu	s2,sp,16
+
+0000b5c0 <keysdb_record_print>:
+    b5c0:	27bdffd0 	addiu	sp,sp,-48
+    b5c4:	afb20020 	sw	s2,32(sp)
+    b5c8:	3c120004 	lui	s2,0x4
+    b5cc:	8e429100 	lw	v0,-28416(s2)
+    b5d0:	afb30024 	sw	s3,36(sp)
+    b5d4:	00c09821 	addu	s3,a2,zero
+    b5d8:	3c060003 	lui	a2,0x3
+    b5dc:	afb1001c 	sw	s1,28(sp)
+    b5e0:	00a03821 	addu	a3,a1,zero
+    b5e4:	00808821 	addu	s1,a0,zero
+    b5e8:	24c65638 	addiu	a2,a2,22072
+    b5ec:	00402021 	addu	a0,v0,zero
+    b5f0:	00002821 	addu	a1,zero,zero
+    b5f4:	afbf002c 	sw	ra,44(sp)
+    b5f8:	afb40028 	sw	s4,40(sp)
+    b5fc:	afb00018 	sw	s0,24(sp)
+    b600:	0c0009b0 	jal	26c0 <__fprintk>
+    b604:	afb10010 	sw	s1,16(sp)
+    b608:	1260000c 	beqz	s3,b63c <keysdb_record_print+0x7c>
+    b60c:	3c140003 	lui	s4,0x3
+    b610:	26945650 	addiu	s4,s4,22096
+    b614:	00008021 	addu	s0,zero,zero
+    b618:	8e270000 	lw	a3,0(s1)
+    b61c:	8e449100 	lw	a0,-28416(s2)
+    b620:	26100001 	addiu	s0,s0,1
+    b624:	00002821 	addu	a1,zero,zero
+    b628:	0c0009b0 	jal	26c0 <__fprintk>
+    b62c:	02803021 	addu	a2,s4,zero
+    b630:	0213102b 	sltu	v0,s0,s3
+    b634:	1440fff8 	bnez	v0,b618 <keysdb_record_print+0x58>
+    b638:	26310004 	addiu	s1,s1,4
+    b63c:	8e449100 	lw	a0,-28416(s2)
+    b640:	3c060003 	lui	a2,0x3
+    b644:	8fbf002c 	lw	ra,44(sp)
+    b648:	8fb40028 	lw	s4,40(sp)
+    b64c:	8fb30024 	lw	s3,36(sp)
+    b650:	8fb20020 	lw	s2,32(sp)
+    b654:	8fb1001c 	lw	s1,28(sp)
+    b658:	8fb00018 	lw	s0,24(sp)
+    b65c:	24c65ed8 	addiu	a2,a2,24280
+    b660:	00002821 	addu	a1,zero,zero
+    b664:	080009b0 	j	26c0 <__fprintk>
+    b668:	27bd0030 	addiu	sp,sp,48
+
+0000b66c <keysdb_print>:
+    b66c:	27bdffd8 	addiu	sp,sp,-40
+    b670:	afb0001c 	sw	s0,28(sp)
+    b674:	3c020004 	lui	v0,0x4
+    b678:	00808021 	addu	s0,a0,zero
+    b67c:	3c060003 	lui	a2,0x3
+    b680:	8c449100 	lw	a0,-28416(v0)
+    b684:	3c070003 	lui	a3,0x3
+    b688:	8e020010 	lw	v0,16(s0)
+    b68c:	24c65658 	addiu	a2,a2,22104
+    b690:	24e75680 	addiu	a3,a3,22144
+    b694:	00002821 	addu	a1,zero,zero
+    b698:	afbf0024 	sw	ra,36(sp)
+    b69c:	afb10020 	sw	s1,32(sp)
+    b6a0:	0c0009b0 	jal	26c0 <__fprintk>
+    b6a4:	afa20010 	sw	v0,16(sp)
+    b6a8:	8e030004 	lw	v1,4(s0)
+    b6ac:	1060000f 	beqz	v1,b6ec <keysdb_print+0x80>
+    b6b0:	00008821 	addu	s1,zero,zero
+    b6b4:	8e040000 	lw	a0,0(s0)
+    b6b8:	00111080 	sll	v0,s1,0x2
+    b6bc:	00821021 	addu	v0,a0,v0
+    b6c0:	8c420000 	lw	v0,0(v0)
+    b6c4:	02202821 	addu	a1,s1,zero
+    b6c8:	00402021 	addu	a0,v0,zero
+    b6cc:	10400004 	beqz	v0,b6e0 <keysdb_print+0x74>
+    b6d0:	26310001 	addiu	s1,s1,1
+    b6d4:	0c002d70 	jal	b5c0 <keysdb_record_print>
+    b6d8:	8e060010 	lw	a2,16(s0)
+    b6dc:	8e030004 	lw	v1,4(s0)
+    b6e0:	0223102b 	sltu	v0,s1,v1
+    b6e4:	1440fff3 	bnez	v0,b6b4 <keysdb_print+0x48>
+    b6e8:	00000000 	sll	zero,zero,0x0
+    b6ec:	8fbf0024 	lw	ra,36(sp)
+    b6f0:	8fb10020 	lw	s1,32(sp)
+    b6f4:	8fb0001c 	lw	s0,28(sp)
+    b6f8:	03e00008 	jr	ra
+    b6fc:	27bd0028 	addiu	sp,sp,40
+
+0000b700 <keysdb_init>:
+    b700:	27bdffd0 	addiu	sp,sp,-48
+    b704:	24020400 	addiu	v0,zero,1024
+    b708:	afb00024 	sw	s0,36(sp)
+    b70c:	ac820004 	sw	v0,4(a0)
+    b710:	afbf002c 	sw	ra,44(sp)
+    b714:	afb10028 	sw	s1,40(sp)
+    b718:	00808021 	addu	s0,a0,zero
+    b71c:	00001021 	addu	v0,zero,zero
+    b720:	2403000b 	addiu	v1,zero,11
+    b724:	00402021 	addu	a0,v0,zero
+    b728:	24420001 	addiu	v0,v0,1
+    b72c:	1443fffd 	bne	v0,v1,b724 <keysdb_init+0x24>
+    b730:	00000000 	sll	zero,zero,0x0
+    b734:	24020040 	addiu	v0,zero,64
+    b738:	ae020010 	sw	v0,16(s0)
+    b73c:	3c020026 	lui	v0,0x26
+    b740:	ae040008 	sw	a0,8(s0)
+    b744:	ae05000c 	sw	a1,12(s0)
+    b748:	34420040 	ori	v0,v0,0x40
+    b74c:	27a40010 	addiu	a0,sp,16
+    b750:	afa20018 	sw	v0,24(sp)
+    b754:	afa00010 	sw	zero,16(sp)
+    b758:	0c00713f 	jal	1c4fc <kmem_alloc>
+    b75c:	afa00014 	sw	zero,20(sp)
+    b760:	1040000b 	beqz	v0,b790 <keysdb_init+0x90>
+    b764:	00408821 	addu	s1,v0,zero
+    b768:	0c007c15 	jal	1f054 <ppm_page2addr>
+    b76c:	00402021 	addu	a0,v0,zero
+    b770:	8fbf002c 	lw	ra,44(sp)
+    b774:	ae110014 	sw	s1,20(s0)
+    b778:	ae020000 	sw	v0,0(s0)
+    b77c:	8fb10028 	lw	s1,40(sp)
+    b780:	00001021 	addu	v0,zero,zero
+    b784:	8fb00024 	lw	s0,36(sp)
+    b788:	03e00008 	jr	ra
+    b78c:	27bd0030 	addiu	sp,sp,48
+    b790:	8fbf002c 	lw	ra,44(sp)
+    b794:	2402000c 	addiu	v0,zero,12
+    b798:	8fb10028 	lw	s1,40(sp)
+    b79c:	8fb00024 	lw	s0,36(sp)
+    b7a0:	03e00008 	jr	ra
+    b7a4:	27bd0030 	addiu	sp,sp,48
+
+0000b7a8 <single_event_put>:
+    b7a8:	8c830000 	lw	v1,0(a0)
+    b7ac:	24820040 	addiu	v0,a0,64
+    b7b0:	8c860040 	lw	a2,64(a0)
+    b7b4:	bc510000 	cache	0x11,0(v0)
+    b7b8:	0000000f 	sync
+    b7bc:	8c820088 	lw	v0,136(a0)
+    b7c0:	24670001 	addiu	a3,v1,1
+    b7c4:	00e2001b 	divu	zero,a3,v0
+    b7c8:	004001f4 	teq	v0,zero,0x7
+    b7cc:	00001010 	mfhi	v0
+    b7d0:	10460009 	beq	v0,a2,b7f8 <single_event_put+0x50>
+    b7d4:	00031880 	sll	v1,v1,0x2
+    b7d8:	8c86008c 	lw	a2,140(a0)
+    b7dc:	00c31821 	addu	v1,a2,v1
+    b7e0:	ac650000 	sw	a1,0(v1)
+    b7e4:	0000000f 	sync
+    b7e8:	ac820000 	sw	v0,0(a0)
+    b7ec:	0000000f 	sync
+    b7f0:	03e00008 	jr	ra
+    b7f4:	00001021 	addu	v0,zero,zero
+    b7f8:	03e00008 	jr	ra
+    b7fc:	2402000b 	addiu	v0,zero,11
+
+0000b800 <multi_event_put>:
+    b800:	27bdfff8 	addiu	sp,sp,-8
+    b804:	8c820088 	lw	v0,136(a0)
+    b808:	240a2710 	addiu	t2,zero,10000
+    b80c:	afa00000 	sw	zero,0(sp)
+    b810:	8c860000 	lw	a2,0(a0)
+    b814:	8c830040 	lw	v1,64(a0)
+    b818:	24c90001 	addiu	t1,a2,1
+    b81c:	0122001b 	divu	zero,t1,v0
+    b820:	004001f4 	teq	v0,zero,0x7
+    b824:	00004810 	mfhi	t1
+    b828:	1123001a 	beq	t1,v1,b894 <multi_event_put+0x94>
+    b82c:	00000000 	sll	zero,zero,0x0
+    b830:	0000000f 	sync
+    b834:	00094025 	or	t0,zero,t1
+    b838:	c0830000 	ll	v1,0(a0)
+    b83c:	14660004 	bne	v1,a2,b850 <multi_event_put+0x50>
+    b840:	24070000 	addiu	a3,zero,0
+    b844:	e0880000 	sc	t0,0(a0)
+    b848:	01003825 	or	a3,t0,zero
+    b84c:	0000000f 	sync
+    b850:	00e05825 	or	t3,a3,zero
+    b854:	8fa30000 	lw	v1,0(sp)
+    b858:	24670001 	addiu	a3,v1,1
+    b85c:	106a0010 	beq	v1,t2,b8a0 <multi_event_put+0xa0>
+    b860:	afa70000 	sw	a3,0(sp)
+    b864:	1160ffea 	beqz	t3,b810 <multi_event_put+0x10>
+    b868:	00063080 	sll	a2,a2,0x2
+    b86c:	8c82008c 	lw	v0,140(a0)
+    b870:	00463021 	addu	a2,v0,a2
+    b874:	acc50000 	sw	a1,0(a2)
+    b878:	0000000f 	sync
+    b87c:	24840040 	addiu	a0,a0,64
+    b880:	bc910000 	cache	0x11,0(a0)
+    b884:	0000000f 	sync
+    b888:	00001021 	addu	v0,zero,zero
+    b88c:	03e00008 	jr	ra
+    b890:	27bd0008 	addiu	sp,sp,8
+    b894:	2402000b 	addiu	v0,zero,11
+    b898:	03e00008 	jr	ra
+    b89c:	27bd0008 	addiu	sp,sp,8
+    b8a0:	24020010 	addiu	v0,zero,16
+    b8a4:	03e00008 	jr	ra
+    b8a8:	27bd0008 	addiu	sp,sp,8
+
+0000b8ac <single_event_get>:
+    b8ac:	8c830040 	lw	v1,64(a0)
+    b8b0:	8c820000 	lw	v0,0(a0)
+    b8b4:	bc910000 	cache	0x11,0(a0)
+    b8b8:	0000000f 	sync
+    b8bc:	10620010 	beq	v1,v0,b900 <single_event_get+0x54>
+    b8c0:	00000000 	sll	zero,zero,0x0
+    b8c4:	8c86008c 	lw	a2,140(a0)
+    b8c8:	00031080 	sll	v0,v1,0x2
+    b8cc:	00c21021 	addu	v0,a2,v0
+    b8d0:	8c420000 	lw	v0,0(v0)
+    b8d4:	aca20000 	sw	v0,0(a1)
+    b8d8:	0000000f 	sync
+    b8dc:	8c850088 	lw	a1,136(a0)
+    b8e0:	24620001 	addiu	v0,v1,1
+    b8e4:	0045001b 	divu	zero,v0,a1
+    b8e8:	00a001f4 	teq	a1,zero,0x7
+    b8ec:	00001010 	mfhi	v0
+    b8f0:	ac820040 	sw	v0,64(a0)
+    b8f4:	0000000f 	sync
+    b8f8:	03e00008 	jr	ra
+    b8fc:	00001021 	addu	v0,zero,zero
+    b900:	03e00008 	jr	ra
+    b904:	2402000b 	addiu	v0,zero,11
+
+0000b908 <multi_event_get>:
+    b908:	27bdfff8 	addiu	sp,sp,-8
+    b90c:	8c820088 	lw	v0,136(a0)
+    b910:	afa00000 	sw	zero,0(sp)
+    b914:	248b0040 	addiu	t3,a0,64
+    b918:	240a2710 	addiu	t2,zero,10000
+    b91c:	8c860040 	lw	a2,64(a0)
+    b920:	8c870000 	lw	a3,0(a0)
+    b924:	00061880 	sll	v1,a2,0x2
+    b928:	10c7001c 	beq	a2,a3,b99c <multi_event_get+0x94>
+    b92c:	24c90001 	addiu	t1,a2,1
+    b930:	0122001b 	divu	zero,t1,v0
+    b934:	004001f4 	teq	v0,zero,0x7
+    b938:	8c87008c 	lw	a3,140(a0)
+    b93c:	00e31821 	addu	v1,a3,v1
+    b940:	8c630000 	lw	v1,0(v1)
+    b944:	aca30000 	sw	v1,0(a1)
+    b948:	00004810 	mfhi	t1
+    b94c:	0000000f 	sync
+    b950:	00094025 	or	t0,zero,t1
+    b954:	c1630000 	ll	v1,0(t3)
+    b958:	14660004 	bne	v1,a2,b96c <multi_event_get+0x64>
+    b95c:	24070000 	addiu	a3,zero,0
+    b960:	e1680000 	sc	t0,0(t3)
+    b964:	01003825 	or	a3,t0,zero
+    b968:	0000000f 	sync
+    b96c:	00e06025 	or	t4,a3,zero
+    b970:	8fa30000 	lw	v1,0(sp)
+    b974:	24660001 	addiu	a2,v1,1
+    b978:	106a000b 	beq	v1,t2,b9a8 <multi_event_get+0xa0>
+    b97c:	afa60000 	sw	a2,0(sp)
+    b980:	1180ffe6 	beqz	t4,b91c <multi_event_get+0x14>
+    b984:	00000000 	sll	zero,zero,0x0
+    b988:	bc910000 	cache	0x11,0(a0)
+    b98c:	0000000f 	sync
+    b990:	00001021 	addu	v0,zero,zero
+    b994:	03e00008 	jr	ra
+    b998:	27bd0008 	addiu	sp,sp,8
+    b99c:	2402000b 	addiu	v0,zero,11
+    b9a0:	03e00008 	jr	ra
+    b9a4:	27bd0008 	addiu	sp,sp,8
+    b9a8:	24020010 	addiu	v0,zero,16
+    b9ac:	03e00008 	jr	ra
+    b9b0:	27bd0008 	addiu	sp,sp,8
+
+0000b9b4 <kfifo_destroy>:
+    b9b4:	27bdffd8 	addiu	sp,sp,-40
+    b9b8:	24050001 	addiu	a1,zero,1
+    b9bc:	8c830088 	lw	v1,136(a0)
+    b9c0:	8c82008c 	lw	v0,140(a0)
+    b9c4:	afa50010 	sw	a1,16(sp)
+    b9c8:	3c050011 	lui	a1,0x11
+    b9cc:	27a40010 	addiu	a0,sp,16
+    b9d0:	34a50020 	ori	a1,a1,0x20
+    b9d4:	afbf0024 	sw	ra,36(sp)
+    b9d8:	afa50018 	sw	a1,24(sp)
+    b9dc:	afa30014 	sw	v1,20(sp)
+    b9e0:	0c007134 	jal	1c4d0 <kmem_free>
+    b9e4:	afa2001c 	sw	v0,28(sp)
+    b9e8:	8fbf0024 	lw	ra,36(sp)
+    b9ec:	03e00008 	jr	ra
+    b9f0:	27bd0028 	addiu	sp,sp,40
+
+0000b9f4 <kfifo_init>:
+    b9f4:	27bdffd0 	addiu	sp,sp,-48
+    b9f8:	24030001 	addiu	v1,zero,1
+    b9fc:	afa30010 	sw	v1,16(sp)
+    ba00:	3c030015 	lui	v1,0x15
+    ba04:	00051080 	sll	v0,a1,0x2
+    ba08:	afb00028 	sw	s0,40(sp)
+    ba0c:	34630020 	ori	v1,v1,0x20
+    ba10:	00808021 	addu	s0,a0,zero
+    ba14:	27a40010 	addiu	a0,sp,16
+    ba18:	afa50020 	sw	a1,32(sp)
+    ba1c:	afa60024 	sw	a2,36(sp)
+    ba20:	afbf002c 	sw	ra,44(sp)
+    ba24:	afa30018 	sw	v1,24(sp)
+    ba28:	0c00713f 	jal	1c4fc <kmem_alloc>
+    ba2c:	afa20014 	sw	v0,20(sp)
+    ba30:	ae02008c 	sw	v0,140(s0)
+    ba34:	8fa50020 	lw	a1,32(sp)
+    ba38:	1040001b 	beqz	v0,baa8 <kfifo_init+0xb4>
+    ba3c:	8fa60024 	lw	a2,36(sp)
+    ba40:	3c030001 	lui	v1,0x1
+    ba44:	2463b7a8 	addiu	v1,v1,-18520
+    ba48:	ae030080 	sw	v1,128(s0)
+    ba4c:	3c030001 	lui	v1,0x1
+    ba50:	30c20001 	andi	v0,a2,0x1
+    ba54:	2463b8ac 	addiu	v1,v1,-18260
+    ba58:	ae000000 	sw	zero,0(s0)
+    ba5c:	ae050088 	sw	a1,136(s0)
+    ba60:	ae030084 	sw	v1,132(s0)
+    ba64:	ae000040 	sw	zero,64(s0)
+    ba68:	1440000b 	bnez	v0,ba98 <kfifo_init+0xa4>
+    ba6c:	30c60003 	andi	a2,a2,0x3
+    ba70:	30c60002 	andi	a2,a2,0x2
+    ba74:	10c00003 	beqz	a2,ba84 <kfifo_init+0x90>
+    ba78:	3c020001 	lui	v0,0x1
+    ba7c:	2442b908 	addiu	v0,v0,-18168
+    ba80:	ae020084 	sw	v0,132(s0)
+    ba84:	8fbf002c 	lw	ra,44(sp)
+    ba88:	00001021 	addu	v0,zero,zero
+    ba8c:	8fb00028 	lw	s0,40(sp)
+    ba90:	03e00008 	jr	ra
+    ba94:	27bd0030 	addiu	sp,sp,48
+    ba98:	3c020001 	lui	v0,0x1
+    ba9c:	2442b800 	addiu	v0,v0,-18432
+    baa0:	08002e9c 	j	ba70 <kfifo_init+0x7c>
+    baa4:	ae020080 	sw	v0,128(s0)
+    baa8:	8fbf002c 	lw	ra,44(sp)
+    baac:	2402000c 	addiu	v0,zero,12
+    bab0:	8fb00028 	lw	s0,40(sp)
+    bab4:	03e00008 	jr	ra
+    bab8:	27bd0030 	addiu	sp,sp,48
+
+0000babc <kthread_create>:
+    babc:	27bdffb8 	addiu	sp,sp,-72
+    bac0:	afb00024 	sw	s0,36(sp)
+    bac4:	3c020055 	lui	v0,0x55
+    bac8:	3c100004 	lui	s0,0x4
+    bacc:	afb2002c 	sw	s2,44(sp)
+    bad0:	afb10028 	sw	s1,40(sp)
+    bad4:	34420020 	ori	v0,v0,0x20
+    bad8:	26106db0 	addiu	s0,s0,28080
+    badc:	00809021 	addu	s2,a0,zero
+    bae0:	24110001 	addiu	s1,zero,1
+    bae4:	27a40010 	addiu	a0,sp,16
+    bae8:	afb70040 	sw	s7,64(sp)
+    baec:	afb6003c 	sw	s6,60(sp)
+    baf0:	afb40034 	sw	s4,52(sp)
+    baf4:	afb30030 	sw	s3,48(sp)
+    baf8:	afbf0044 	sw	ra,68(sp)
+    bafc:	afb50038 	sw	s5,56(sp)
+    bb00:	afa20018 	sw	v0,24(sp)
+    bb04:	00a09821 	addu	s3,a1,zero
+    bb08:	00c0a021 	addu	s4,a2,zero
+    bb0c:	00e0b821 	addu	s7,a3,zero
+    bb10:	afa00010 	sw	zero,16(sp)
+    bb14:	afb10014 	sw	s1,20(sp)
+    bb18:	0c00713f 	jal	1c4fc <kmem_alloc>
+    bb1c:	afb0001c 	sw	s0,28(sp)
+    bb20:	10400036 	beqz	v0,bbfc <kthread_create+0x140>
+    bb24:	0040b021 	addu	s6,v0,zero
+    bb28:	0c007c15 	jal	1f054 <ppm_page2addr>
+    bb2c:	00402021 	addu	a0,v0,zero
+    bb30:	00402021 	addu	a0,v0,zero
+    bb34:	0c006827 	jal	1a09c <thread_init>
+    bb38:	0040a821 	addu	s5,v0,zero
+    bb3c:	00171280 	sll	v0,s7,0xa
+    bb40:	0017b980 	sll	s7,s7,0x6
+    bb44:	02e2b821 	addu	s7,s7,v0
+    bb48:	00171140 	sll	v0,s7,0x5
+    bb4c:	0057b823 	subu	s7,v0,s7
+    bb50:	02f01021 	addu	v0,s7,s0
+    bb54:	3c040004 	lui	a0,0x4
+    bb58:	8e030400 	lw	v1,1024(s0)
+    bb5c:	8c420444 	lw	v0,1092(v0)
+    bb60:	248471f0 	addiu	a0,a0,29168
+    bb64:	0097b821 	addu	s7,a0,s7
+    bb68:	aeb70174 	sw	s7,372(s5)
+    bb6c:	a6a30150 	sh	v1,336(s5)
+    bb70:	02a02021 	addu	a0,s5,zero
+    bb74:	aea20154 	sw	v0,340(s5)
+    bb78:	0c0044e0 	jal	11380 <sched_setpolicy>
+    bb7c:	00002821 	addu	a1,zero,zero
+    bb80:	3c02ffee 	lui	v0,0xffee
+    bb84:	3442ffff 	ori	v0,v0,0xffff
+    bb88:	aea20264 	sw	v0,612(s5)
+    bb8c:	aeb50344 	sw	s5,836(s5)
+    bb90:	24030002 	addiu	v1,zero,2
+    bb94:	8e4205c4 	lw	v0,1476(s2)
+    bb98:	aea30130 	sw	v1,304(s5)
+    bb9c:	3c030001 	lui	v1,0x1
+    bba0:	2463bc30 	addiu	v1,v1,-17360
+    bba4:	aeb10184 	sw	s1,388(s5)
+    bba8:	aeb30318 	sw	s3,792(s5)
+    bbac:	aeb40320 	sw	s4,800(s5)
+    bbb0:	aea20348 	sw	v0,840(s5)
+    bbb4:	aeb60388 	sw	s6,904(s5)
+    bbb8:	aeb20180 	sw	s2,384(s5)
+    bbbc:	aea3031c 	sw	v1,796(s5)
+    bbc0:	26a40188 	addiu	a0,s5,392
+    bbc4:	0c000169 	jal	5a4 <cpu_context_init>
+    bbc8:	02a02821 	addu	a1,s5,zero
+    bbcc:	8fbf0044 	lw	ra,68(sp)
+    bbd0:	02a01021 	addu	v0,s5,zero
+    bbd4:	8fb70040 	lw	s7,64(sp)
+    bbd8:	8fb6003c 	lw	s6,60(sp)
+    bbdc:	8fb50038 	lw	s5,56(sp)
+    bbe0:	8fb40034 	lw	s4,52(sp)
+    bbe4:	8fb30030 	lw	s3,48(sp)
+    bbe8:	8fb2002c 	lw	s2,44(sp)
+    bbec:	8fb10028 	lw	s1,40(sp)
+    bbf0:	8fb00024 	lw	s0,36(sp)
+    bbf4:	03e00008 	jr	ra
+    bbf8:	27bd0048 	addiu	sp,sp,72
+    bbfc:	8fbf0044 	lw	ra,68(sp)
+    bc00:	0000a821 	addu	s5,zero,zero
+    bc04:	02a01021 	addu	v0,s5,zero
+    bc08:	8fb70040 	lw	s7,64(sp)
+    bc0c:	8fb6003c 	lw	s6,60(sp)
+    bc10:	8fb50038 	lw	s5,56(sp)
+    bc14:	8fb40034 	lw	s4,52(sp)
+    bc18:	8fb30030 	lw	s3,48(sp)
+    bc1c:	8fb2002c 	lw	s2,44(sp)
+    bc20:	8fb10028 	lw	s1,40(sp)
+    bc24:	8fb00024 	lw	s0,36(sp)
+    bc28:	03e00008 	jr	ra
+    bc2c:	27bd0048 	addiu	sp,sp,72
+    bc30:	27bdffe0 	addiu	sp,sp,-32
+    bc34:	afbf001c 	sw	ra,28(sp)
+    bc38:	afb00018 	sw	s0,24(sp)
+    bc3c:	40102002 	mfc0	s0,$4,2
+    bc40:	0c005e49 	jal	17924 <sys_thread_exit>
+    bc44:	00002021 	addu	a0,zero,zero
+    bc48:	40022002 	mfc0	v0,$4,2
+    bc4c:	afb00010 	sw	s0,16(sp)
+    bc50:	8c420174 	lw	v0,372(v0)
+    bc54:	3c050003 	lui	a1,0x3
+    bc58:	8c420004 	lw	v0,4(v0)
+    bc5c:	3c070003 	lui	a3,0x3
+    bc60:	24a55690 	addiu	a1,a1,22160
+    bc64:	24e756d8 	addiu	a3,a3,22232
+    bc68:	24040001 	addiu	a0,zero,1
+    bc6c:	2406002f 	addiu	a2,zero,47
+    bc70:	0c00097d 	jal	25f4 <__perror>
+    bc74:	afa20014 	sw	v0,20(sp)
+    bc78:	08002f1e 	j	bc78 <kthread_create+0x1bc>
+    bc7c:	00000000 	sll	zero,zero,0x0
+
+0000bc80 <default_gsize>:
+    bc80:	03e00008 	jr	ra
+    bc84:	8c820004 	lw	v0,4(a0)
+
+0000bc88 <kk_get_ppn_max>:
+    bc88:	27bdffe8 	addiu	sp,sp,-24
+    bc8c:	8c820018 	lw	v0,24(a0)
+    bc90:	afb00010 	sw	s0,16(sp)
+    bc94:	afbf0014 	sw	ra,20(sp)
+    bc98:	0040f809 	jalr	v0
+    bc9c:	00808021 	addu	s0,a0,zero
+    bca0:	10400014 	beqz	v0,bcf4 <kk_get_ppn_max+0x6c>
+    bca4:	24031000 	addiu	v1,zero,4096
+    bca8:	8e040000 	lw	a0,0(s0)
+    bcac:	30840fff 	andi	a0,a0,0xfff
+    bcb0:	00642023 	subu	a0,v1,a0
+    bcb4:	0082182b 	sltu	v1,a0,v0
+    bcb8:	0043200a 	movz	a0,v0,v1
+    bcbc:	24051000 	addiu	a1,zero,4096
+    bcc0:	00001821 	addu	v1,zero,zero
+    bcc4:	00441023 	subu	v0,v0,a0
+    bcc8:	2c441001 	sltiu	a0,v0,4097
+    bccc:	00a03021 	addu	a2,a1,zero
+    bcd0:	0044300b 	movn	a2,v0,a0
+    bcd4:	00c02021 	addu	a0,a2,zero
+    bcd8:	1440fffa 	bnez	v0,bcc4 <kk_get_ppn_max+0x3c>
+    bcdc:	24630001 	addiu	v1,v1,1
+    bce0:	8fbf0014 	lw	ra,20(sp)
+    bce4:	00601021 	addu	v0,v1,zero
+    bce8:	8fb00010 	lw	s0,16(sp)
+    bcec:	03e00008 	jr	ra
+    bcf0:	27bd0018 	addiu	sp,sp,24
+    bcf4:	8fbf0014 	lw	ra,20(sp)
+    bcf8:	00001821 	addu	v1,zero,zero
+    bcfc:	00601021 	addu	v0,v1,zero
+    bd00:	8fb00010 	lw	s0,16(sp)
+    bd04:	03e00008 	jr	ra
+    bd08:	27bd0018 	addiu	sp,sp,24
+
+0000bd0c <ku_get_ppn_max>:
+    bd0c:	08002f22 	j	bc88 <kk_get_ppn_max>
+    bd10:	00000000 	sll	zero,zero,0x0
+
+0000bd14 <__get_ppn>:
+    bd14:	27bdffc8 	addiu	sp,sp,-56
+    bd18:	afb10018 	sw	s1,24(sp)
+    bd1c:	8c820018 	lw	v0,24(a0)
+    bd20:	8c910000 	lw	s1,0(a0)
+    bd24:	afb70030 	sw	s7,48(sp)
+    bd28:	afb6002c 	sw	s6,44(sp)
+    bd2c:	afb50028 	sw	s5,40(sp)
+    bd30:	afb2001c 	sw	s2,28(sp)
+    bd34:	afb00014 	sw	s0,20(sp)
+    bd38:	afbf0034 	sw	ra,52(sp)
+    bd3c:	afb40024 	sw	s4,36(sp)
+    bd40:	afb30020 	sw	s3,32(sp)
+    bd44:	00a08021 	addu	s0,a1,zero
+    bd48:	00c09021 	addu	s2,a2,zero
+    bd4c:	00e0a821 	addu	s5,a3,zero
+    bd50:	8fb60048 	lw	s6,72(sp)
+    bd54:	0040f809 	jalr	v0
+    bd58:	32370fff 	andi	s7,s1,0xfff
+    bd5c:	1040001d 	beqz	v0,bdd4 <__get_ppn+0xc0>
+    bd60:	8fbf0034 	lw	ra,52(sp)
+    bd64:	12400010 	beqz	s2,bda8 <__get_ppn+0x94>
+    bd68:	2402f000 	addiu	v0,zero,-4096
+    bd6c:	02228824 	and	s1,s1,v0
+    bd70:	0000a021 	addu	s4,zero,zero
+    bd74:	00009821 	addu	s3,zero,zero
+    bd78:	02202021 	addu	a0,s1,zero
+    bd7c:	26730001 	addiu	s3,s3,1
+    bd80:	02c02821 	addu	a1,s6,zero
+    bd84:	02a0f809 	jalr	s5
+    bd88:	0014a080 	sll	s4,s4,0x2
+    bd8c:	0214a021 	addu	s4,s0,s4
+    bd90:	0272182b 	sltu	v1,s3,s2
+    bd94:	ae820000 	sw	v0,0(s4)
+    bd98:	26311000 	addiu	s1,s1,4096
+    bd9c:	1460fff6 	bnez	v1,bd78 <__get_ppn+0x64>
+    bda0:	0260a021 	addu	s4,s3,zero
+    bda4:	8fbf0034 	lw	ra,52(sp)
+    bda8:	02e01021 	addu	v0,s7,zero
+    bdac:	8fb70030 	lw	s7,48(sp)
+    bdb0:	8fb6002c 	lw	s6,44(sp)
+    bdb4:	8fb50028 	lw	s5,40(sp)
+    bdb8:	8fb40024 	lw	s4,36(sp)
+    bdbc:	8fb30020 	lw	s3,32(sp)
+    bdc0:	8fb2001c 	lw	s2,28(sp)
+    bdc4:	8fb10018 	lw	s1,24(sp)
+    bdc8:	8fb00014 	lw	s0,20(sp)
+    bdcc:	03e00008 	jr	ra
+    bdd0:	27bd0038 	addiu	sp,sp,56
+    bdd4:	0000b821 	addu	s7,zero,zero
+    bdd8:	02e01021 	addu	v0,s7,zero
+    bddc:	ae000000 	sw	zero,0(s0)
+    bde0:	8fb70030 	lw	s7,48(sp)
+    bde4:	8fb6002c 	lw	s6,44(sp)
+    bde8:	8fb50028 	lw	s5,40(sp)
+    bdec:	8fb40024 	lw	s4,36(sp)
+    bdf0:	8fb30020 	lw	s3,32(sp)
+    bdf4:	8fb2001c 	lw	s2,28(sp)
+    bdf8:	8fb10018 	lw	s1,24(sp)
+    bdfc:	8fb00014 	lw	s0,20(sp)
+    be00:	03e00008 	jr	ra
+    be04:	27bd0038 	addiu	sp,sp,56
+
+0000be08 <kk_get_ppn>:
+    be08:	27bdffe0 	addiu	sp,sp,-32
+    be0c:	afa70010 	sw	a3,16(sp)
+    be10:	3c070001 	lui	a3,0x1
+    be14:	afbf001c 	sw	ra,28(sp)
+    be18:	0c002f45 	jal	bd14 <__get_ppn>
+    be1c:	24e7bea0 	addiu	a3,a3,-16736
+    be20:	8fbf001c 	lw	ra,28(sp)
+    be24:	03e00008 	jr	ra
+    be28:	27bd0020 	addiu	sp,sp,32
+
+0000be2c <ku_get_ppn>:
+    be2c:	27bdffe0 	addiu	sp,sp,-32
+    be30:	afa70010 	sw	a3,16(sp)
+    be34:	3c070001 	lui	a3,0x1
+    be38:	afbf001c 	sw	ra,28(sp)
+    be3c:	0c002f45 	jal	bd14 <__get_ppn>
+    be40:	24e7be50 	addiu	a3,a3,-16816
+    be44:	8fbf001c 	lw	ra,28(sp)
+    be48:	03e00008 	jr	ra
+    be4c:	27bd0020 	addiu	sp,sp,32
+
+0000be50 <ku_vma2ppn>:
+    be50:	27bdffe8 	addiu	sp,sp,-24
+    be54:	afbf0014 	sw	ra,20(sp)
+    be58:	00801021 	addu	v0,a0,zero
+    be5c:	00a03021 	addu	a2,a1,zero
+    be60:	40032002 	mfc0	v1,$4,2
+    be64:	8c640180 	lw	a0,384(v1)
+    be68:	0c006304 	jal	18c10 <task_vaddr2ppn>
+    be6c:	00402821 	addu	a1,v0,zero
+    be70:	10400003 	beqz	v0,be80 <ku_vma2ppn+0x30>
+    be74:	8fbf0014 	lw	ra,20(sp)
+    be78:	03e00008 	jr	ra
+    be7c:	27bd0018 	addiu	sp,sp,24
+    be80:	3c020004 	lui	v0,0x4
+    be84:	3c060003 	lui	a2,0x3
+    be88:	8c449100 	lw	a0,-28416(v0)
+    be8c:	24c656f0 	addiu	a2,a2,22256
+    be90:	0c0009b0 	jal	26c0 <__fprintk>
+    be94:	00002821 	addu	a1,zero,zero
+    be98:	08002fa6 	j	be98 <ku_vma2ppn+0x48>
+    be9c:	00000000 	sll	zero,zero,0x0
+
+0000bea0 <kk_vma2ppn>:
+    bea0:	00802821 	addu	a1,a0,zero
+    bea4:	3c040004 	lui	a0,0x4
+    bea8:	08007c4f 	j	1f13c <ppm_vma2ppn>
+    beac:	24846e60 	addiu	a0,a0,28256
+
+0000beb0 <ku_strlen>:
+    beb0:	27bdffe0 	addiu	sp,sp,-32
+    beb4:	8c840000 	lw	a0,0(a0)
+    beb8:	afbf001c 	sw	ra,28(sp)
+    bebc:	0c000159 	jal	564 <cpu_uspace_strlen>
+    bec0:	27a50010 	addiu	a1,sp,16
+    bec4:	14400004 	bnez	v0,bed8 <ku_strlen+0x28>
+    bec8:	8fbf001c 	lw	ra,28(sp)
+    becc:	8fa20010 	lw	v0,16(sp)
+    bed0:	03e00008 	jr	ra
+    bed4:	27bd0020 	addiu	sp,sp,32
+    bed8:	00001021 	addu	v0,zero,zero
+    bedc:	03e00008 	jr	ra
+    bee0:	27bd0020 	addiu	sp,sp,32
+
+0000bee4 <ku_copy_from>:
+    bee4:	27bdffd8 	addiu	sp,sp,-40
+    bee8:	8c820018 	lw	v0,24(a0)
+    beec:	afbf0024 	sw	ra,36(sp)
+    bef0:	afb10020 	sw	s1,32(sp)
+    bef4:	afb0001c 	sw	s0,28(sp)
+    bef8:	afa50010 	sw	a1,16(sp)
+    befc:	0040f809 	jalr	v0
+    bf00:	00808821 	addu	s1,a0,zero
+    bf04:	8fa50010 	lw	a1,16(sp)
+    bf08:	00403021 	addu	a2,v0,zero
+    bf0c:	00a02021 	addu	a0,a1,zero
+    bf10:	8e250000 	lw	a1,0(s1)
+    bf14:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+    bf18:	00408021 	addu	s0,v0,zero
+    bf1c:	8fbf0024 	lw	ra,36(sp)
+    bf20:	0002800b 	movn	s0,zero,v0
+    bf24:	02001021 	addu	v0,s0,zero
+    bf28:	8fb10020 	lw	s1,32(sp)
+    bf2c:	8fb0001c 	lw	s0,28(sp)
+    bf30:	03e00008 	jr	ra
+    bf34:	27bd0028 	addiu	sp,sp,40
+
+0000bf38 <ku_scpy_from>:
+    bf38:	8c820000 	lw	v0,0(a0)
+    bf3c:	27bdffe8 	addiu	sp,sp,-24
+    bf40:	00a02021 	addu	a0,a1,zero
+    bf44:	00402821 	addu	a1,v0,zero
+    bf48:	afbf0014 	sw	ra,20(sp)
+    bf4c:	afb00010 	sw	s0,16(sp)
+    bf50:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+    bf54:	00c08021 	addu	s0,a2,zero
+    bf58:	8fbf0014 	lw	ra,20(sp)
+    bf5c:	0002800b 	movn	s0,zero,v0
+    bf60:	02001021 	addu	v0,s0,zero
+    bf64:	8fb00010 	lw	s0,16(sp)
+    bf68:	03e00008 	jr	ra
+    bf6c:	27bd0018 	addiu	sp,sp,24
+
+0000bf70 <ku_copy_to>:
+    bf70:	27bdffd8 	addiu	sp,sp,-40
+    bf74:	8c820018 	lw	v0,24(a0)
+    bf78:	afbf0024 	sw	ra,36(sp)
+    bf7c:	afb10020 	sw	s1,32(sp)
+    bf80:	afb0001c 	sw	s0,28(sp)
+    bf84:	00808821 	addu	s1,a0,zero
+    bf88:	0040f809 	jalr	v0
+    bf8c:	afa50010 	sw	a1,16(sp)
+    bf90:	8e240000 	lw	a0,0(s1)
+    bf94:	8fa50010 	lw	a1,16(sp)
+    bf98:	00403021 	addu	a2,v0,zero
+    bf9c:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+    bfa0:	00408021 	addu	s0,v0,zero
+    bfa4:	8fbf0024 	lw	ra,36(sp)
+    bfa8:	0002800b 	movn	s0,zero,v0
+    bfac:	02001021 	addu	v0,s0,zero
+    bfb0:	8fb10020 	lw	s1,32(sp)
+    bfb4:	8fb0001c 	lw	s0,28(sp)
+    bfb8:	03e00008 	jr	ra
+    bfbc:	27bd0028 	addiu	sp,sp,40
+
+0000bfc0 <ku_scpy_to>:
+    bfc0:	8c840000 	lw	a0,0(a0)
+    bfc4:	27bdffe8 	addiu	sp,sp,-24
+    bfc8:	afbf0014 	sw	ra,20(sp)
+    bfcc:	afb00010 	sw	s0,16(sp)
+    bfd0:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+    bfd4:	00c08021 	addu	s0,a2,zero
+    bfd8:	8fbf0014 	lw	ra,20(sp)
+    bfdc:	0002800b 	movn	s0,zero,v0
+    bfe0:	02001021 	addu	v0,s0,zero
+    bfe4:	8fb00010 	lw	s0,16(sp)
+    bfe8:	03e00008 	jr	ra
+    bfec:	27bd0018 	addiu	sp,sp,24
+
+0000bff0 <kk_strlen>:
+    bff0:	0800c4d1 	j	31344 <strlen>
+    bff4:	8c840000 	lw	a0,0(a0)
+
+0000bff8 <kk_copy_from>:
+    bff8:	27bdffd8 	addiu	sp,sp,-40
+    bffc:	8c820018 	lw	v0,24(a0)
+    c000:	afbf0024 	sw	ra,36(sp)
+    c004:	afb10020 	sw	s1,32(sp)
+    c008:	afb0001c 	sw	s0,28(sp)
+    c00c:	afa50010 	sw	a1,16(sp)
+    c010:	0040f809 	jalr	v0
+    c014:	00808821 	addu	s1,a0,zero
+    c018:	8fa50010 	lw	a1,16(sp)
+    c01c:	00403021 	addu	a2,v0,zero
+    c020:	00a02021 	addu	a0,a1,zero
+    c024:	8e250000 	lw	a1,0(s1)
+    c028:	0c00c12b 	jal	304ac <memcpy>
+    c02c:	00408021 	addu	s0,v0,zero
+    c030:	8fbf0024 	lw	ra,36(sp)
+    c034:	02001021 	addu	v0,s0,zero
+    c038:	8fb10020 	lw	s1,32(sp)
+    c03c:	8fb0001c 	lw	s0,28(sp)
+    c040:	03e00008 	jr	ra
+    c044:	27bd0028 	addiu	sp,sp,40
+
+0000c048 <kk_copy_to>:
+    c048:	27bdffd8 	addiu	sp,sp,-40
+    c04c:	8c820018 	lw	v0,24(a0)
+    c050:	afbf0024 	sw	ra,36(sp)
+    c054:	afb10020 	sw	s1,32(sp)
+    c058:	afb0001c 	sw	s0,28(sp)
+    c05c:	00808821 	addu	s1,a0,zero
+    c060:	0040f809 	jalr	v0
+    c064:	afa50010 	sw	a1,16(sp)
+    c068:	8e240000 	lw	a0,0(s1)
+    c06c:	8fa50010 	lw	a1,16(sp)
+    c070:	00403021 	addu	a2,v0,zero
+    c074:	0c00c12b 	jal	304ac <memcpy>
+    c078:	00408021 	addu	s0,v0,zero
+    c07c:	8fbf0024 	lw	ra,36(sp)
+    c080:	02001021 	addu	v0,s0,zero
+    c084:	8fb10020 	lw	s1,32(sp)
+    c088:	8fb0001c 	lw	s0,28(sp)
+    c08c:	03e00008 	jr	ra
+    c090:	27bd0028 	addiu	sp,sp,40
+
+0000c094 <kk_scpy_from>:
+    c094:	8c820000 	lw	v0,0(a0)
+    c098:	27bdffe8 	addiu	sp,sp,-24
+    c09c:	00a02021 	addu	a0,a1,zero
+    c0a0:	00402821 	addu	a1,v0,zero
+    c0a4:	afbf0014 	sw	ra,20(sp)
+    c0a8:	afb00010 	sw	s0,16(sp)
+    c0ac:	0c00c12b 	jal	304ac <memcpy>
+    c0b0:	00c08021 	addu	s0,a2,zero
+    c0b4:	8fbf0014 	lw	ra,20(sp)
+    c0b8:	02001021 	addu	v0,s0,zero
+    c0bc:	8fb00010 	lw	s0,16(sp)
+    c0c0:	03e00008 	jr	ra
+    c0c4:	27bd0018 	addiu	sp,sp,24
+
+0000c0c8 <kk_scpy_to>:
+    c0c8:	8c840000 	lw	a0,0(a0)
+    c0cc:	27bdffe8 	addiu	sp,sp,-24
+    c0d0:	afbf0014 	sw	ra,20(sp)
+    c0d4:	afb00010 	sw	s0,16(sp)
+    c0d8:	0c00c12b 	jal	304ac <memcpy>
+    c0dc:	00c08021 	addu	s0,a2,zero
+    c0e0:	8fbf0014 	lw	ra,20(sp)
+    c0e4:	02001021 	addu	v0,s0,zero
+    c0e8:	8fb00010 	lw	s0,16(sp)
+    c0ec:	03e00008 	jr	ra
+    c0f0:	27bd0018 	addiu	sp,sp,24
+
+0000c0f4 <mcs_barrier_init>:
+    c0f4:	ac860080 	sw	a2,128(a0)
+    c0f8:	ac850140 	sw	a1,320(a0)
+    c0fc:	ac860000 	sw	a2,0(a0)
+    c100:	ac800040 	sw	zero,64(a0)
+    c104:	ac8000c0 	sw	zero,192(a0)
+    c108:	ac800100 	sw	zero,256(a0)
+    c10c:	0000000f 	sync
+    c110:	bc910000 	cache	0x11,0(a0)
+    c114:	0000000f 	sync
+    c118:	24820040 	addiu	v0,a0,64
+    c11c:	bc510000 	cache	0x11,0(v0)
+    c120:	0000000f 	sync
+    c124:	248200c0 	addiu	v0,a0,192
+    c128:	bc510000 	cache	0x11,0(v0)
+    c12c:	0000000f 	sync
+    c130:	24820100 	addiu	v0,a0,256
+    c134:	bc510000 	cache	0x11,0(v0)
+    c138:	0000000f 	sync
+    c13c:	24840080 	addiu	a0,a0,128
+    c140:	bc910000 	cache	0x11,0(a0)
+    c144:	0000000f 	sync
+    c148:	03e00008 	jr	ra
+    c14c:	00000000 	sll	zero,zero,0x0
+
+0000c150 <mcs_barrier_wait>:
+    c150:	8c890040 	lw	t1,64(a0)
+    c154:	1520001e 	bnez	t1,c1d0 <mcs_barrier_wait+0x80>
+    c158:	24860100 	addiu	a2,a0,256
+    c15c:	248700c0 	addiu	a3,a0,192
+    c160:	00e01021 	addu	v0,a3,zero
+    c164:	24850080 	addiu	a1,a0,128
+    c168:	240affff 	addiu	t2,zero,-1
+    c16c:	c0a80000 	ll	t0,0(a1)
+    c170:	010a1821 	addu	v1,t0,t2
+    c174:	e0a30000 	sc	v1,0(a1)
+    c178:	1060fffc 	beqz	v1,c16c <mcs_barrier_wait+0x1c>
+    c17c:	00000000 	sll	zero,zero,0x0
+    c180:	0000000f 	sync
+    c184:	24030001 	addiu	v1,zero,1
+    c188:	1103001e 	beq	t0,v1,c204 <mcs_barrier_wait+0xb4>
+    c18c:	00000000 	sll	zero,zero,0x0
+    c190:	24840040 	addiu	a0,a0,64
+    c194:	bc910000 	cache	0x11,0(a0)
+    c198:	0000000f 	sync
+    c19c:	bcf10000 	cache	0x11,0(a3)
+    c1a0:	0000000f 	sync
+    c1a4:	bcd10000 	cache	0x11,0(a2)
+    c1a8:	0000000f 	sync
+    c1ac:	bcb10000 	cache	0x11,0(a1)
+    c1b0:	0000000f 	sync
+    c1b4:	8c430000 	lw	v1,0(v0)
+    c1b8:	1060fffe 	beqz	v1,c1b4 <mcs_barrier_wait+0x64>
+    c1bc:	00000000 	sll	zero,zero,0x0
+    c1c0:	bc510000 	cache	0x11,0(v0)
+    c1c4:	0000000f 	sync
+    c1c8:	03e00008 	jr	ra
+    c1cc:	00000000 	sll	zero,zero,0x0
+    c1d0:	00c01021 	addu	v0,a2,zero
+    c1d4:	248700c0 	addiu	a3,a0,192
+    c1d8:	24850080 	addiu	a1,a0,128
+    c1dc:	240affff 	addiu	t2,zero,-1
+    c1e0:	c0a80000 	ll	t0,0(a1)
+    c1e4:	010a1821 	addu	v1,t0,t2
+    c1e8:	e0a30000 	sc	v1,0(a1)
+    c1ec:	1060fffc 	beqz	v1,c1e0 <mcs_barrier_wait+0x90>
+    c1f0:	00000000 	sll	zero,zero,0x0
+    c1f4:	0000000f 	sync
+    c1f8:	24030001 	addiu	v1,zero,1
+    c1fc:	1503ffe4 	bne	t0,v1,c190 <mcs_barrier_wait+0x40>
+    c200:	00000000 	sll	zero,zero,0x0
+    c204:	31290001 	andi	t1,t1,0x1
+    c208:	8c8a0000 	lw	t2,0(a0)
+    c20c:	39290001 	xori	t1,t1,0x1
+    c210:	00e01821 	addu	v1,a3,zero
+    c214:	00c9180b 	movn	v1,a2,t1
+    c218:	ac890040 	sw	t1,64(a0)
+    c21c:	ac8a0080 	sw	t2,128(a0)
+    c220:	ac600000 	sw	zero,0(v1)
+    c224:	ac480000 	sw	t0,0(v0)
+    c228:	0000000f 	sync
+    c22c:	24840040 	addiu	a0,a0,64
+    c230:	bc910000 	cache	0x11,0(a0)
+    c234:	0000000f 	sync
+    c238:	bcf10000 	cache	0x11,0(a3)
+    c23c:	0000000f 	sync
+    c240:	bcd10000 	cache	0x11,0(a2)
+    c244:	0000000f 	sync
+    c248:	bcb10000 	cache	0x11,0(a1)
+    c24c:	0000000f 	sync
+    c250:	03e00008 	jr	ra
+    c254:	00000000 	sll	zero,zero,0x0
+
+0000c258 <mcs_lock_init>:
+    c258:	ac850080 	sw	a1,128(a0)
+    c25c:	ac800000 	sw	zero,0(a0)
+    c260:	ac800040 	sw	zero,64(a0)
+    c264:	0000000f 	sync
+    c268:	bc910000 	cache	0x11,0(a0)
+    c26c:	0000000f 	sync
+    c270:	24840040 	addiu	a0,a0,64
+    c274:	bc910000 	cache	0x11,0(a0)
+    c278:	0000000f 	sync
+    c27c:	03e00008 	jr	ra
+    c280:	00000000 	sll	zero,zero,0x0
+
+0000c284 <mcs_lock>:
+    c284:	40016000 	mfc0	at,c0_status
+    c288:	00000000 	sll	zero,zero,0x0
+    c28c:	00011025 	or	v0,zero,at
+    c290:	00010842 	srl	at,at,0x1
+    c294:	00010840 	sll	at,at,0x1
+    c298:	10a00002 	beqz	a1,c2a4 <mcs_lock+0x20>
+    c29c:	40816000 	mtc0	at,c0_status
+    c2a0:	aca20000 	sw	v0,0(a1)
+    c2a4:	24850040 	addiu	a1,a0,64
+    c2a8:	24060001 	addiu	a2,zero,1
+    c2ac:	c0a20000 	ll	v0,0(a1)
+    c2b0:	00461821 	addu	v1,v0,a2
+    c2b4:	e0a30000 	sc	v1,0(a1)
+    c2b8:	1060fffc 	beqz	v1,c2ac <mcs_lock+0x28>
+    c2bc:	00000000 	sll	zero,zero,0x0
+    c2c0:	0000000f 	sync
+    c2c4:	8c830000 	lw	v1,0(a0)
+    c2c8:	1443fffe 	bne	v0,v1,c2c4 <mcs_lock+0x40>
+    c2cc:	00000000 	sll	zero,zero,0x0
+    c2d0:	40022002 	mfc0	v0,$4,2
+    c2d4:	8c43013c 	lw	v1,316(v0)
+    c2d8:	24630001 	addiu	v1,v1,1
+    c2dc:	03e00008 	jr	ra
+    c2e0:	ac43013c 	sw	v1,316(v0)
+
+0000c2e4 <mcs_lock_remote>:
+    c2e4:	30a5ffff 	andi	a1,a1,0xffff
+    c2e8:	40016000 	mfc0	at,c0_status
+    c2ec:	00000000 	sll	zero,zero,0x0
+    c2f0:	00011025 	or	v0,zero,at
+    c2f4:	00010842 	srl	at,at,0x1
+    c2f8:	00010840 	sll	at,at,0x1
+    c2fc:	10c00002 	beqz	a2,c308 <mcs_lock_remote+0x24>
+    c300:	40816000 	mtc0	at,c0_status
+    c304:	acc20000 	sw	v0,0(a2)
+    c308:	2ca20101 	sltiu	v0,a1,257
+    c30c:	14400003 	bnez	v0,c31c <mcs_lock_remote+0x38>
+    c310:	00051100 	sll	v0,a1,0x4
+    c314:	080030c5 	j	c314 <mcs_lock_remote+0x30>
+    c318:	00000000 	sll	zero,zero,0x0
+    c31c:	00052880 	sll	a1,a1,0x2
+    c320:	00452823 	subu	a1,v0,a1
+    c324:	3c020004 	lui	v0,0x4
+    c328:	2442c9a0 	addiu	v0,v0,-13920
+    c32c:	00451021 	addu	v0,v0,a1
+    c330:	3c035555 	lui	v1,0x5555
+    c334:	8c420000 	lw	v0,0(v0)
+    c338:	34635555 	ori	v1,v1,0x5555
+    c33c:	1043fff5 	beq	v0,v1,c314 <mcs_lock_remote+0x30>
+    c340:	24860040 	addiu	a2,a0,64
+    c344:	24070001 	addiu	a3,zero,1
+    c348:	4809c000 	mfc2	t1,$24
+    c34c:	4882c000 	mtc2	v0,$24
+    c350:	c0c50000 	ll	a1,0(a2)
+    c354:	00a71821 	addu	v1,a1,a3
+    c358:	e0c30000 	sc	v1,0(a2)
+    c35c:	1060fffc 	beqz	v1,c350 <mcs_lock_remote+0x6c>
+    c360:	00000000 	sll	zero,zero,0x0
+    c364:	4889c000 	mtc2	t1,$24
+    c368:	4808c000 	mfc2	t0,$24
+    c36c:	4882c000 	mtc2	v0,$24
+    c370:	8c830000 	lw	v1,0(a0)
+    c374:	4888c000 	mtc2	t0,$24
+    c378:	14a3fffb 	bne	a1,v1,c368 <mcs_lock_remote+0x84>
+    c37c:	00000000 	sll	zero,zero,0x0
+    c380:	40022002 	mfc0	v0,$4,2
+    c384:	8c430140 	lw	v1,320(v0)
+    c388:	24630001 	addiu	v1,v1,1
+    c38c:	03e00008 	jr	ra
+    c390:	ac430140 	sw	v1,320(v0)
+
+0000c394 <mcs_unlock_remote>:
+    c394:	27bdffd0 	addiu	sp,sp,-48
+    c398:	afbf002c 	sw	ra,44(sp)
+    c39c:	30a5ffff 	andi	a1,a1,0xffff
+    c3a0:	40032002 	mfc0	v1,$4,2
+    c3a4:	2ca20101 	sltiu	v0,a1,257
+    c3a8:	14400003 	bnez	v0,c3b8 <mcs_unlock_remote+0x24>
+    c3ac:	00051100 	sll	v0,a1,0x4
+    c3b0:	080030ec 	j	c3b0 <mcs_unlock_remote+0x1c>
+    c3b4:	00000000 	sll	zero,zero,0x0
+    c3b8:	00052880 	sll	a1,a1,0x2
+    c3bc:	00452823 	subu	a1,v0,a1
+    c3c0:	3c020004 	lui	v0,0x4
+    c3c4:	2442c9a0 	addiu	v0,v0,-13920
+    c3c8:	00451021 	addu	v0,v0,a1
+    c3cc:	8c420000 	lw	v0,0(v0)
+    c3d0:	3c055555 	lui	a1,0x5555
+    c3d4:	34a55555 	ori	a1,a1,0x5555
+    c3d8:	1045fff5 	beq	v0,a1,c3b0 <mcs_unlock_remote+0x1c>
+    c3dc:	00000000 	sll	zero,zero,0x0
+    c3e0:	4808c000 	mfc2	t0,$24
+    c3e4:	4882c000 	mtc2	v0,$24
+    c3e8:	8c850000 	lw	a1,0(a0)
+    c3ec:	4888c000 	mtc2	t0,$24
+    c3f0:	0000000f 	sync
+    c3f4:	bc910000 	cache	0x11,0(a0)
+    c3f8:	0000000f 	sync
+    c3fc:	24a50001 	addiu	a1,a1,1
+    c400:	4808c000 	mfc2	t0,$24
+    c404:	4882c000 	mtc2	v0,$24
+    c408:	ac850000 	sw	a1,0(a0)
+    c40c:	4888c000 	mtc2	t0,$24
+    c410:	0000000f 	sync
+    c414:	bc910000 	cache	0x11,0(a0)
+    c418:	0000000f 	sync
+    c41c:	8c620140 	lw	v0,320(v1)
+    c420:	1840000a 	blez	v0,c44c <mcs_unlock_remote+0xb8>
+    c424:	2442ffff 	addiu	v0,v0,-1
+    c428:	ac620140 	sw	v0,320(v1)
+    c42c:	40016000 	mfc0	at,c0_status
+    c430:	340200ff 	ori	v0,zero,0xff
+    c434:	00461024 	and	v0,v0,a2
+    c438:	00220825 	or	at,at,v0
+    c43c:	40816000 	mtc0	at,c0_status
+    c440:	8fbf002c 	lw	ra,44(sp)
+    c444:	03e00008 	jr	ra
+    c448:	27bd0030 	addiu	sp,sp,48
+    c44c:	40064800 	mfc0	a2,c0_count
+    c450:	00000000 	sll	zero,zero,0x0
+    c454:	40082002 	mfc0	t0,$4,2
+    c458:	40057801 	mfc0	a1,$15,1
+    c45c:	40024800 	mfc0	v0,c0_count
+    c460:	00000000 	sll	zero,zero,0x0
+    c464:	3c040003 	lui	a0,0x3
+    c468:	248456f8 	addiu	a0,a0,22264
+    c46c:	afa30014 	sw	v1,20(sp)
+    c470:	afa40010 	sw	a0,16(sp)
+    c474:	8c640174 	lw	a0,372(v1)
+    c478:	30a50003 	andi	a1,a1,0x3
+    c47c:	3c030004 	lui	v1,0x4
+    c480:	00052880 	sll	a1,a1,0x2
+    c484:	2463c950 	addiu	v1,v1,-14000
+    c488:	00a31821 	addu	v1,a1,v1
+    c48c:	8c890004 	lw	t1,4(a0)
+    c490:	8c630000 	lw	v1,0(v1)
+    c494:	3c050003 	lui	a1,0x3
+    c498:	24a54afc 	addiu	a1,a1,19196
+    c49c:	00002021 	addu	a0,zero,zero
+    c4a0:	240700b3 	addiu	a3,zero,179
+    c4a4:	afa90018 	sw	t1,24(sp)
+    c4a8:	afa8001c 	sw	t0,28(sp)
+    c4ac:	afa30020 	sw	v1,32(sp)
+    c4b0:	0c00097d 	jal	25f4 <__perror>
+    c4b4:	afa20024 	sw	v0,36(sp)
+    c4b8:	0800312e 	j	c4b8 <mcs_unlock_remote+0x124>
+    c4bc:	00000000 	sll	zero,zero,0x0
+
+0000c4c0 <mcs_unlock>:
+    c4c0:	27bdffd0 	addiu	sp,sp,-48
+    c4c4:	afbf002c 	sw	ra,44(sp)
+    c4c8:	40032002 	mfc0	v1,$4,2
+    c4cc:	8c820000 	lw	v0,0(a0)
+    c4d0:	24420001 	addiu	v0,v0,1
+    c4d4:	0000000f 	sync
+    c4d8:	bc910000 	cache	0x11,0(a0)
+    c4dc:	0000000f 	sync
+    c4e0:	ac820000 	sw	v0,0(a0)
+    c4e4:	0000000f 	sync
+    c4e8:	bc910000 	cache	0x11,0(a0)
+    c4ec:	0000000f 	sync
+    c4f0:	8c62013c 	lw	v0,316(v1)
+    c4f4:	1840000a 	blez	v0,c520 <mcs_unlock+0x60>
+    c4f8:	2442ffff 	addiu	v0,v0,-1
+    c4fc:	ac62013c 	sw	v0,316(v1)
+    c500:	40016000 	mfc0	at,c0_status
+    c504:	340200ff 	ori	v0,zero,0xff
+    c508:	00451024 	and	v0,v0,a1
+    c50c:	00220825 	or	at,at,v0
+    c510:	40816000 	mtc0	at,c0_status
+    c514:	8fbf002c 	lw	ra,44(sp)
+    c518:	03e00008 	jr	ra
+    c51c:	27bd0030 	addiu	sp,sp,48
+    c520:	40064800 	mfc0	a2,c0_count
+    c524:	00000000 	sll	zero,zero,0x0
+    c528:	40082002 	mfc0	t0,$4,2
+    c52c:	40057801 	mfc0	a1,$15,1
+    c530:	40024800 	mfc0	v0,c0_count
+    c534:	00000000 	sll	zero,zero,0x0
+    c538:	3c040003 	lui	a0,0x3
+    c53c:	248456f8 	addiu	a0,a0,22264
+    c540:	afa30014 	sw	v1,20(sp)
+    c544:	afa40010 	sw	a0,16(sp)
+    c548:	8c640174 	lw	a0,372(v1)
+    c54c:	30a50003 	andi	a1,a1,0x3
+    c550:	3c030004 	lui	v1,0x4
+    c554:	00052880 	sll	a1,a1,0x2
+    c558:	2463c950 	addiu	v1,v1,-14000
+    c55c:	00a31821 	addu	v1,a1,v1
+    c560:	8c890004 	lw	t1,4(a0)
+    c564:	8c630000 	lw	v1,0(v1)
+    c568:	3c050003 	lui	a1,0x3
+    c56c:	24a55708 	addiu	a1,a1,22280
+    c570:	00002021 	addu	a0,zero,zero
+    c574:	2407008a 	addiu	a3,zero,138
+    c578:	afa90018 	sw	t1,24(sp)
+    c57c:	afa8001c 	sw	t0,28(sp)
+    c580:	afa30020 	sw	v1,32(sp)
+    c584:	0c00097d 	jal	25f4 <__perror>
+    c588:	afa20024 	sw	v0,36(sp)
+    c58c:	08003163 	j	c58c <mcs_unlock+0xcc>
+    c590:	00000000 	sll	zero,zero,0x0
+
+0000c594 <mwmr_destroy>:
+    c594:	27bdffd0 	addiu	sp,sp,-48
+    c598:	afb00024 	sw	s0,36(sp)
+    c59c:	afbf002c 	sw	ra,44(sp)
+    c5a0:	afb10028 	sw	s1,40(sp)
+    c5a4:	1080000b 	beqz	a0,c5d4 <mwmr_destroy+0x40>
+    c5a8:	00808021 	addu	s0,a0,zero
+    c5ac:	8c820020 	lw	v0,32(a0)
+    c5b0:	27b10010 	addiu	s1,sp,16
+    c5b4:	02202021 	addu	a0,s1,zero
+    c5b8:	24030001 	addiu	v1,zero,1
+    c5bc:	afa30010 	sw	v1,16(sp)
+    c5c0:	0c007134 	jal	1c4d0 <kmem_free>
+    c5c4:	afa2001c 	sw	v0,28(sp)
+    c5c8:	02202021 	addu	a0,s1,zero
+    c5cc:	0c007134 	jal	1c4d0 <kmem_free>
+    c5d0:	afb0001c 	sw	s0,28(sp)
+    c5d4:	8fbf002c 	lw	ra,44(sp)
+    c5d8:	8fb10028 	lw	s1,40(sp)
+    c5dc:	8fb00024 	lw	s0,36(sp)
+    c5e0:	03e00008 	jr	ra
+    c5e4:	27bd0030 	addiu	sp,sp,48
+
+0000c5e8 <mwmr_write>:
+    c5e8:	27bdffe0 	addiu	sp,sp,-32
+    c5ec:	afb00018 	sw	s0,24(sp)
+    c5f0:	afbf001c 	sw	ra,28(sp)
+    c5f4:	10c00032 	beqz	a2,c6c0 <mwmr_write+0xd8>
+    c5f8:	00808021 	addu	s0,a0,zero
+    c5fc:	8c820010 	lw	v0,16(a0)
+    c600:	14400034 	bnez	v0,c6d4 <mwmr_write+0xec>
+    c604:	00000000 	sll	zero,zero,0x0
+    c608:	8e080028 	lw	t0,40(s0)
+    c60c:	8e030014 	lw	v1,20(s0)
+    c610:	01031023 	subu	v0,t0,v1
+    c614:	0046202b 	sltu	a0,v0,a2
+    c618:	0044300b 	movn	a2,v0,a0
+    c61c:	10c0001a 	beqz	a2,c688 <mwmr_write+0xa0>
+    c620:	00c01021 	addu	v0,a2,zero
+    c624:	8e04001c 	lw	a0,28(s0)
+    c628:	8e070020 	lw	a3,32(s0)
+    c62c:	00c44821 	addu	t1,a2,a0
+    c630:	0109482b 	sltu	t1,t0,t1
+    c634:	15200035 	bnez	t1,c70c <mwmr_write+0x124>
+    c638:	00e43821 	addu	a3,a3,a0
+    c63c:	18c0000c 	blez	a2,c670 <mwmr_write+0x88>
+    c640:	00c42021 	addu	a0,a2,a0
+    c644:	00001821 	addu	v1,zero,zero
+    c648:	00a32021 	addu	a0,a1,v1
+    c64c:	90880000 	lbu	t0,0(a0)
+    c650:	00e32021 	addu	a0,a3,v1
+    c654:	24630001 	addiu	v1,v1,1
+    c658:	14c3fffb 	bne	a2,v1,c648 <mwmr_write+0x60>
+    c65c:	a0880000 	sb	t0,0(a0)
+    c660:	8e030014 	lw	v1,20(s0)
+    c664:	8e080028 	lw	t0,40(s0)
+    c668:	8e04001c 	lw	a0,28(s0)
+    c66c:	00c42021 	addu	a0,a2,a0
+    c670:	0088001b 	divu	zero,a0,t0
+    c674:	010001f4 	teq	t0,zero,0x7
+    c678:	00663021 	addu	a2,v1,a2
+    c67c:	ae060014 	sw	a2,20(s0)
+    c680:	00002010 	mfhi	a0
+    c684:	ae04001c 	sw	a0,28(s0)
+    c688:	8e030010 	lw	v1,16(s0)
+    c68c:	14600004 	bnez	v1,c6a0 <mwmr_write+0xb8>
+    c690:	8fbf001c 	lw	ra,28(sp)
+    c694:	8fb00018 	lw	s0,24(sp)
+    c698:	03e00008 	jr	ra
+    c69c:	27bd0020 	addiu	sp,sp,32
+    c6a0:	02002021 	addu	a0,s0,zero
+    c6a4:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    c6a8:	afa20010 	sw	v0,16(sp)
+    c6ac:	8fbf001c 	lw	ra,28(sp)
+    c6b0:	8fa20010 	lw	v0,16(sp)
+    c6b4:	8fb00018 	lw	s0,24(sp)
+    c6b8:	03e00008 	jr	ra
+    c6bc:	27bd0020 	addiu	sp,sp,32
+    c6c0:	8fbf001c 	lw	ra,28(sp)
+    c6c4:	00001021 	addu	v0,zero,zero
+    c6c8:	8fb00018 	lw	s0,24(sp)
+    c6cc:	03e00008 	jr	ra
+    c6d0:	27bd0020 	addiu	sp,sp,32
+    c6d4:	afa50010 	sw	a1,16(sp)
+    c6d8:	0c004bc3 	jal	12f0c <spinlock_lock>
+    c6dc:	afa60014 	sw	a2,20(sp)
+    c6e0:	8e080028 	lw	t0,40(s0)
+    c6e4:	8e030014 	lw	v1,20(s0)
+    c6e8:	8fa60014 	lw	a2,20(sp)
+    c6ec:	01031023 	subu	v0,t0,v1
+    c6f0:	0046202b 	sltu	a0,v0,a2
+    c6f4:	0044300b 	movn	a2,v0,a0
+    c6f8:	8fa50010 	lw	a1,16(sp)
+    c6fc:	10c0ffe2 	beqz	a2,c688 <mwmr_write+0xa0>
+    c700:	00c01021 	addu	v0,a2,zero
+    c704:	0800318a 	j	c628 <mwmr_write+0x40>
+    c708:	8e04001c 	lw	a0,28(s0)
+    c70c:	01042023 	subu	a0,t0,a0
+    c710:	18800008 	blez	a0,c734 <mwmr_write+0x14c>
+    c714:	00c45023 	subu	t2,a2,a0
+    c718:	00001821 	addu	v1,zero,zero
+    c71c:	00a34021 	addu	t0,a1,v1
+    c720:	91090000 	lbu	t1,0(t0)
+    c724:	00e34021 	addu	t0,a3,v1
+    c728:	24630001 	addiu	v1,v1,1
+    c72c:	1483fffb 	bne	a0,v1,c71c <mwmr_write+0x134>
+    c730:	a1090000 	sb	t1,0(t0)
+    c734:	1940ffca 	blez	t2,c660 <mwmr_write+0x78>
+    c738:	00001821 	addu	v1,zero,zero
+    c73c:	00a42821 	addu	a1,a1,a0
+    c740:	8e040020 	lw	a0,32(s0)
+    c744:	90a70000 	lbu	a3,0(a1)
+    c748:	00832021 	addu	a0,a0,v1
+    c74c:	24630001 	addiu	v1,v1,1
+    c750:	a0870000 	sb	a3,0(a0)
+    c754:	146afffa 	bne	v1,t2,c740 <mwmr_write+0x158>
+    c758:	24a50001 	addiu	a1,a1,1
+    c75c:	08003199 	j	c664 <mwmr_write+0x7c>
+    c760:	8e030014 	lw	v1,20(s0)
+
+0000c764 <mwmr_read>:
+    c764:	27bdffe0 	addiu	sp,sp,-32
+    c768:	afb00018 	sw	s0,24(sp)
+    c76c:	afbf001c 	sw	ra,28(sp)
+    c770:	10c00031 	beqz	a2,c838 <mwmr_read+0xd4>
+    c774:	00808021 	addu	s0,a0,zero
+    c778:	8c820010 	lw	v0,16(a0)
+    c77c:	14400033 	bnez	v0,c84c <mwmr_read+0xe8>
+    c780:	00000000 	sll	zero,zero,0x0
+    c784:	8e030014 	lw	v1,20(s0)
+    c788:	0066102b 	sltu	v0,v1,a2
+    c78c:	0062300b 	movn	a2,v1,v0
+    c790:	10c0001b 	beqz	a2,c800 <mwmr_read+0x9c>
+    c794:	00c01021 	addu	v0,a2,zero
+    c798:	8e040018 	lw	a0,24(s0)
+    c79c:	8e080028 	lw	t0,40(s0)
+    c7a0:	8e070020 	lw	a3,32(s0)
+    c7a4:	00c44821 	addu	t1,a2,a0
+    c7a8:	0109482b 	sltu	t1,t0,t1
+    c7ac:	15200033 	bnez	t1,c87c <mwmr_read+0x118>
+    c7b0:	00e43821 	addu	a3,a3,a0
+    c7b4:	18c0000c 	blez	a2,c7e8 <mwmr_read+0x84>
+    c7b8:	00c42021 	addu	a0,a2,a0
+    c7bc:	00001821 	addu	v1,zero,zero
+    c7c0:	00e32021 	addu	a0,a3,v1
+    c7c4:	90880000 	lbu	t0,0(a0)
+    c7c8:	00a32021 	addu	a0,a1,v1
+    c7cc:	24630001 	addiu	v1,v1,1
+    c7d0:	14c3fffb 	bne	a2,v1,c7c0 <mwmr_read+0x5c>
+    c7d4:	a0880000 	sb	t0,0(a0)
+    c7d8:	8e030014 	lw	v1,20(s0)
+    c7dc:	8e040018 	lw	a0,24(s0)
+    c7e0:	8e080028 	lw	t0,40(s0)
+    c7e4:	00c42021 	addu	a0,a2,a0
+    c7e8:	0088001b 	divu	zero,a0,t0
+    c7ec:	010001f4 	teq	t0,zero,0x7
+    c7f0:	00663023 	subu	a2,v1,a2
+    c7f4:	ae060014 	sw	a2,20(s0)
+    c7f8:	00002010 	mfhi	a0
+    c7fc:	ae040018 	sw	a0,24(s0)
+    c800:	8e030010 	lw	v1,16(s0)
+    c804:	14600004 	bnez	v1,c818 <mwmr_read+0xb4>
+    c808:	8fbf001c 	lw	ra,28(sp)
+    c80c:	8fb00018 	lw	s0,24(sp)
+    c810:	03e00008 	jr	ra
+    c814:	27bd0020 	addiu	sp,sp,32
+    c818:	02002021 	addu	a0,s0,zero
+    c81c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+    c820:	afa20010 	sw	v0,16(sp)
+    c824:	8fbf001c 	lw	ra,28(sp)
+    c828:	8fa20010 	lw	v0,16(sp)
+    c82c:	8fb00018 	lw	s0,24(sp)
+    c830:	03e00008 	jr	ra
+    c834:	27bd0020 	addiu	sp,sp,32
+    c838:	8fbf001c 	lw	ra,28(sp)
+    c83c:	00001021 	addu	v0,zero,zero
+    c840:	8fb00018 	lw	s0,24(sp)
+    c844:	03e00008 	jr	ra
+    c848:	27bd0020 	addiu	sp,sp,32
+    c84c:	afa50010 	sw	a1,16(sp)
+    c850:	0c004bc3 	jal	12f0c <spinlock_lock>
+    c854:	afa60014 	sw	a2,20(sp)
+    c858:	8fa60014 	lw	a2,20(sp)
+    c85c:	8e030014 	lw	v1,20(s0)
+    c860:	8fa50010 	lw	a1,16(sp)
+    c864:	0066102b 	sltu	v0,v1,a2
+    c868:	0062300b 	movn	a2,v1,v0
+    c86c:	10c0ffe4 	beqz	a2,c800 <mwmr_read+0x9c>
+    c870:	00c01021 	addu	v0,a2,zero
+    c874:	080031e7 	j	c79c <mwmr_read+0x38>
+    c878:	8e040018 	lw	a0,24(s0)
+    c87c:	01042023 	subu	a0,t0,a0
+    c880:	18800008 	blez	a0,c8a4 <mwmr_read+0x140>
+    c884:	00c45023 	subu	t2,a2,a0
+    c888:	00001821 	addu	v1,zero,zero
+    c88c:	00e34021 	addu	t0,a3,v1
+    c890:	91090000 	lbu	t1,0(t0)
+    c894:	00a34021 	addu	t0,a1,v1
+    c898:	24630001 	addiu	v1,v1,1
+    c89c:	1483fffb 	bne	a0,v1,c88c <mwmr_read+0x128>
+    c8a0:	a1090000 	sb	t1,0(t0)
+    c8a4:	1940ffcc 	blez	t2,c7d8 <mwmr_read+0x74>
+    c8a8:	00001821 	addu	v1,zero,zero
+    c8ac:	00a42821 	addu	a1,a1,a0
+    c8b0:	8e040020 	lw	a0,32(s0)
+    c8b4:	00832021 	addu	a0,a0,v1
+    c8b8:	90840000 	lbu	a0,0(a0)
+    c8bc:	24630001 	addiu	v1,v1,1
+    c8c0:	a0a40000 	sb	a0,0(a1)
+    c8c4:	146afffa 	bne	v1,t2,c8b0 <mwmr_read+0x14c>
+    c8c8:	24a50001 	addiu	a1,a1,1
+    c8cc:	080031f7 	j	c7dc <mwmr_read+0x78>
+    c8d0:	8e030014 	lw	v1,20(s0)
+
+0000c8d4 <mwmr_init>:
+    c8d4:	27bdffc0 	addiu	sp,sp,-64
+    c8d8:	24020001 	addiu	v0,zero,1
+    c8dc:	afb20030 	sw	s2,48(sp)
+    c8e0:	afa20010 	sw	v0,16(sp)
+    c8e4:	27b20010 	addiu	s2,sp,16
+    c8e8:	24020030 	addiu	v0,zero,48
+    c8ec:	afb1002c 	sw	s1,44(sp)
+    c8f0:	afa20014 	sw	v0,20(sp)
+    c8f4:	00808821 	addu	s1,a0,zero
+    c8f8:	3c02000d 	lui	v0,0xd
+    c8fc:	02402021 	addu	a0,s2,zero
+    c900:	afb40038 	sw	s4,56(sp)
+    c904:	afb30034 	sw	s3,52(sp)
+    c908:	afb00028 	sw	s0,40(sp)
+    c90c:	afbf003c 	sw	ra,60(sp)
+    c910:	afa20018 	sw	v0,24(sp)
+    c914:	00a09821 	addu	s3,a1,zero
+    c918:	0c00713f 	jal	1c4fc <kmem_alloc>
+    c91c:	00c0a021 	addu	s4,a2,zero
+    c920:	10400012 	beqz	v0,c96c <mwmr_init+0x98>
+    c924:	00408021 	addu	s0,v0,zero
+    c928:	00111080 	sll	v0,s1,0x2
+    c92c:	70531002 	mul	v0,v0,s3
+    c930:	02402021 	addu	a0,s2,zero
+    c934:	0c00713f 	jal	1c4fc <kmem_alloc>
+    c938:	afa20014 	sw	v0,20(sp)
+    c93c:	10400014 	beqz	v0,c990 <mwmr_init+0xbc>
+    c940:	3c050003 	lui	a1,0x3
+    c944:	72719802 	mul	s3,s3,s1
+    c948:	24a557b0 	addiu	a1,a1,22448
+    c94c:	02002021 	addu	a0,s0,zero
+    c950:	0c004a24 	jal	12890 <spinlock_init>
+    c954:	afa20020 	sw	v0,32(sp)
+    c958:	8fa20020 	lw	v0,32(sp)
+    c95c:	ae140010 	sw	s4,16(s0)
+    c960:	ae130028 	sw	s3,40(s0)
+    c964:	ae020020 	sw	v0,32(s0)
+    c968:	ae110024 	sw	s1,36(s0)
+    c96c:	8fbf003c 	lw	ra,60(sp)
+    c970:	02001021 	addu	v0,s0,zero
+    c974:	8fb40038 	lw	s4,56(sp)
+    c978:	8fb30034 	lw	s3,52(sp)
+    c97c:	8fb20030 	lw	s2,48(sp)
+    c980:	8fb1002c 	lw	s1,44(sp)
+    c984:	8fb00028 	lw	s0,40(sp)
+    c988:	03e00008 	jr	ra
+    c98c:	27bd0040 	addiu	sp,sp,64
+    c990:	3c020004 	lui	v0,0x4
+    c994:	8c449100 	lw	a0,-28416(v0)
+    c998:	3c060003 	lui	a2,0x3
+    c99c:	24c65788 	addiu	a2,a2,22408
+    c9a0:	0c0009b0 	jal	26c0 <__fprintk>
+    c9a4:	00002821 	addu	a1,zero,zero
+    c9a8:	02402021 	addu	a0,s2,zero
+    c9ac:	0c007134 	jal	1c4d0 <kmem_free>
+    c9b0:	afb0001c 	sw	s0,28(sp)
+    c9b4:	0800325b 	j	c96c <mwmr_init+0x98>
+    c9b8:	00008021 	addu	s0,zero,zero
+
+0000c9bc <radix_node_kmem_init>:
+    c9bc:	24020003 	addiu	v0,zero,3
+    c9c0:	ac820000 	sw	v0,0(a0)
+    c9c4:	3c020003 	lui	v0,0x3
+    c9c8:	244257b8 	addiu	v0,v0,22456
+    c9cc:	ac820004 	sw	v0,4(a0)
+    c9d0:	24020118 	addiu	v0,zero,280
+    c9d4:	ac820008 	sw	v0,8(a0)
+    c9d8:	2402000a 	addiu	v0,zero,10
+    c9dc:	ac82000c 	sw	v0,12(a0)
+    c9e0:	2402001e 	addiu	v0,zero,30
+    c9e4:	ac820010 	sw	v0,16(a0)
+    c9e8:	ac80001c 	sw	zero,28(a0)
+    c9ec:	ac800014 	sw	zero,20(a0)
+    c9f0:	ac800018 	sw	zero,24(a0)
+    c9f4:	03e00008 	jr	ra
+    c9f8:	00001021 	addu	v0,zero,zero
+
+0000c9fc <radix_tree_init>:
+    c9fc:	ac800008 	sw	zero,8(a0)
+    ca00:	ac800000 	sw	zero,0(a0)
+    ca04:	03e00008 	jr	ra
+    ca08:	ac800004 	sw	zero,4(a0)
+
+0000ca0c <radix_item_info_lookup>:
+    ca0c:	8c820000 	lw	v0,0(a0)
+    ca10:	10400039 	beqz	v0,caf8 <radix_item_info_lookup+0xec>
+    ca14:	00000000 	sll	zero,zero,0x0
+    ca18:	8c830008 	lw	v1,8(a0)
+    ca1c:	0065182b 	sltu	v1,v1,a1
+    ca20:	14600035 	bnez	v1,caf8 <radix_item_info_lookup+0xec>
+    ca24:	00000000 	sll	zero,zero,0x0
+    ca28:	8c8b0004 	lw	t3,4(a0)
+    ca2c:	2569ffff 	addiu	t1,t3,-1
+    ca30:	19200033 	blez	t1,cb00 <radix_item_info_lookup+0xf4>
+    ca34:	00091840 	sll	v1,t1,0x1
+    ca38:	000920c0 	sll	a0,t1,0x3
+    ca3c:	00831823 	subu	v1,a0,v1
+    ca40:	2404003f 	addiu	a0,zero,63
+    ca44:	00642004 	sllv	a0,a0,v1
+    ca48:	00852024 	and	a0,a0,a1
+    ca4c:	00641806 	srlv	v1,a0,v1
+    ca50:	00031880 	sll	v1,v1,0x2
+    ca54:	00431021 	addu	v0,v0,v1
+    ca58:	8c420000 	lw	v0,0(v0)
+    ca5c:	10400026 	beqz	v0,caf8 <radix_item_info_lookup+0xec>
+    ca60:	000b20c0 	sll	a0,t3,0x3
+    ca64:	000b1840 	sll	v1,t3,0x1
+    ca68:	00831823 	subu	v1,a0,v1
+    ca6c:	2463fff4 	addiu	v1,v1,-12
+    ca70:	00002021 	addu	a0,zero,zero
+    ca74:	080032a2 	j	ca88 <radix_item_info_lookup+0x7c>
+    ca78:	240a003f 	addiu	t2,zero,63
+    ca7c:	8d020000 	lw	v0,0(t0)
+    ca80:	1040001d 	beqz	v0,caf8 <radix_item_info_lookup+0xec>
+    ca84:	2463fffa 	addiu	v1,v1,-6
+    ca88:	006a3804 	sllv	a3,t2,v1
+    ca8c:	00e53824 	and	a3,a3,a1
+    ca90:	00673806 	srlv	a3,a3,v1
+    ca94:	00073880 	sll	a3,a3,0x2
+    ca98:	24840001 	addiu	a0,a0,1
+    ca9c:	00474021 	addu	t0,v0,a3
+    caa0:	0089382a 	slt	a3,a0,t1
+    caa4:	14e0fff5 	bnez	a3,ca7c <radix_item_info_lookup+0x70>
+    caa8:	00000000 	sll	zero,zero,0x0
+    caac:	00044827 	nor	t1,zero,a0
+    cab0:	012b4821 	addu	t1,t1,t3
+    cab4:	000918c0 	sll	v1,t1,0x3
+    cab8:	00094840 	sll	t1,t1,0x1
+    cabc:	00691823 	subu	v1,v1,t1
+    cac0:	2409003f 	addiu	t1,zero,63
+    cac4:	00694804 	sllv	t1,t1,v1
+    cac8:	01254824 	and	t1,t1,a1
+    cacc:	00694806 	srlv	t1,t1,v1
+    cad0:	00091880 	sll	v1,t1,0x2
+    cad4:	00431821 	addu	v1,v0,v1
+    cad8:	8c630000 	lw	v1,0(v1)
+    cadc:	acc20004 	sw	v0,4(a2)
+    cae0:	acc40010 	sw	a0,16(a2)
+    cae4:	acc30000 	sw	v1,0(a2)
+    cae8:	acc50008 	sw	a1,8(a2)
+    caec:	acc9000c 	sw	t1,12(a2)
+    caf0:	03e00008 	jr	ra
+    caf4:	24020001 	addiu	v0,zero,1
+    caf8:	03e00008 	jr	ra
+    cafc:	00001021 	addu	v0,zero,zero
+    cb00:	080032ad 	j	cab4 <radix_item_info_lookup+0xa8>
+    cb04:	00002021 	addu	a0,zero,zero
+
+0000cb08 <radix_tree_lookup>:
+    cb08:	27bdffd0 	addiu	sp,sp,-48
+    cb0c:	afbf002c 	sw	ra,44(sp)
+    cb10:	0c003283 	jal	ca0c <radix_item_info_lookup>
+    cb14:	27a60010 	addiu	a2,sp,16
+    cb18:	10400005 	beqz	v0,cb30 <radix_tree_lookup+0x28>
+    cb1c:	8fa30014 	lw	v1,20(sp)
+    cb20:	8fa2001c 	lw	v0,28(sp)
+    cb24:	00021080 	sll	v0,v0,0x2
+    cb28:	00621021 	addu	v0,v1,v0
+    cb2c:	8c420000 	lw	v0,0(v0)
+    cb30:	8fbf002c 	lw	ra,44(sp)
+    cb34:	03e00008 	jr	ra
+    cb38:	27bd0030 	addiu	sp,sp,48
+
+0000cb3c <radix_tree_tag_set>:
+    cb3c:	8c830000 	lw	v1,0(a0)
+    cb40:	14600003 	bnez	v1,cb50 <radix_tree_tag_set+0x14>
+    cb44:	00000000 	sll	zero,zero,0x0
+    cb48:	03e00008 	jr	ra
+    cb4c:	00001021 	addu	v0,zero,zero
+    cb50:	8c820008 	lw	v0,8(a0)
+    cb54:	0045102b 	sltu	v0,v0,a1
+    cb58:	1440fffb 	bnez	v0,cb48 <radix_tree_tag_set+0xc>
+    cb5c:	00000000 	sll	zero,zero,0x0
+    cb60:	14c00054 	bnez	a2,ccb4 <radix_tree_tag_set+0x178>
+    cb64:	00001021 	addu	v0,zero,zero
+    cb68:	8c8a0004 	lw	t2,4(a0)
+    cb6c:	2548ffff 	addiu	t0,t2,-1
+    cb70:	19000020 	blez	t0,cbf4 <radix_tree_tag_set+0xb8>
+    cb74:	000820c0 	sll	a0,t0,0x3
+    cb78:	00081040 	sll	v0,t0,0x1
+    cb7c:	00821023 	subu	v0,a0,v0
+    cb80:	2404003f 	addiu	a0,zero,63
+    cb84:	00442004 	sllv	a0,a0,v0
+    cb88:	00852024 	and	a0,a0,a1
+    cb8c:	00441006 	srlv	v0,a0,v0
+    cb90:	00021080 	sll	v0,v0,0x2
+    cb94:	00621821 	addu	v1,v1,v0
+    cb98:	8c630000 	lw	v1,0(v1)
+    cb9c:	1060ffea 	beqz	v1,cb48 <radix_tree_tag_set+0xc>
+    cba0:	2409003f 	addiu	t1,zero,63
+    cba4:	000a1040 	sll	v0,t2,0x1
+    cba8:	000a20c0 	sll	a0,t2,0x3
+    cbac:	00821023 	subu	v0,a0,v0
+    cbb0:	2442fff4 	addiu	v0,v0,-12
+    cbb4:	080032f2 	j	cbc8 <radix_tree_tag_set+0x8c>
+    cbb8:	00003021 	addu	a2,zero,zero
+    cbbc:	8ce30000 	lw	v1,0(a3)
+    cbc0:	1060ffe1 	beqz	v1,cb48 <radix_tree_tag_set+0xc>
+    cbc4:	2442fffa 	addiu	v0,v0,-6
+    cbc8:	00492004 	sllv	a0,t1,v0
+    cbcc:	00852024 	and	a0,a0,a1
+    cbd0:	00442006 	srlv	a0,a0,v0
+    cbd4:	00042080 	sll	a0,a0,0x2
+    cbd8:	24c60001 	addiu	a2,a2,1
+    cbdc:	00643821 	addu	a3,v1,a0
+    cbe0:	00c8202a 	slt	a0,a2,t0
+    cbe4:	1480fff5 	bnez	a0,cbbc <radix_tree_tag_set+0x80>
+    cbe8:	00000000 	sll	zero,zero,0x0
+    cbec:	00064027 	nor	t0,zero,a2
+    cbf0:	010a4021 	addu	t0,t0,t2
+    cbf4:	000820c0 	sll	a0,t0,0x3
+    cbf8:	00084040 	sll	t0,t0,0x1
+    cbfc:	00884023 	subu	t0,a0,t0
+    cc00:	2404003f 	addiu	a0,zero,63
+    cc04:	01042004 	sllv	a0,a0,t0
+    cc08:	00852024 	and	a0,a0,a1
+    cc0c:	01042006 	srlv	a0,a0,t0
+    cc10:	00041080 	sll	v0,a0,0x2
+    cc14:	00621021 	addu	v0,v1,v0
+    cc18:	8c420000 	lw	v0,0(v0)
+    cc1c:	1040ffca 	beqz	v0,cb48 <radix_tree_tag_set+0xc>
+    cc20:	24070001 	addiu	a3,zero,1
+    cc24:	00873804 	sllv	a3,a3,a0
+    cc28:	30880020 	andi	t0,a0,0x20
+    cc2c:	8c6c0100 	lw	t4,256(v1)
+    cc30:	8c6b0104 	lw	t3,260(v1)
+    cc34:	00e04821 	addu	t1,a3,zero
+    cc38:	0008480a 	movz	t1,zero,t0
+    cc3c:	0008380b 	movn	a3,zero,t0
+    cc40:	8c640110 	lw	a0,272(v1)
+    cc44:	01873825 	or	a3,t4,a3
+    cc48:	01694025 	or	t0,t3,t1
+    cc4c:	ac670100 	sw	a3,256(v1)
+    cc50:	10800018 	beqz	a0,ccb4 <radix_tree_tag_set+0x178>
+    cc54:	ac680104 	sw	t0,260(v1)
+    cc58:	01465023 	subu	t2,t2,a2
+    cc5c:	000a30c0 	sll	a2,t2,0x3
+    cc60:	000a5040 	sll	t2,t2,0x1
+    cc64:	00ca3023 	subu	a2,a2,t2
+    cc68:	240c003f 	addiu	t4,zero,63
+    cc6c:	240b0001 	addiu	t3,zero,1
+    cc70:	00cc3804 	sllv	a3,t4,a2
+    cc74:	00e53824 	and	a3,a3,a1
+    cc78:	00c73806 	srlv	a3,a3,a2
+    cc7c:	00eb1804 	sllv	v1,t3,a3
+    cc80:	8c8a0100 	lw	t2,256(a0)
+    cc84:	8c890104 	lw	t1,260(a0)
+    cc88:	30e70020 	andi	a3,a3,0x20
+    cc8c:	00604021 	addu	t0,v1,zero
+    cc90:	0007400a 	movz	t0,zero,a3
+    cc94:	0007180b 	movn	v1,zero,a3
+    cc98:	01431825 	or	v1,t2,v1
+    cc9c:	01283825 	or	a3,t1,t0
+    cca0:	ac830100 	sw	v1,256(a0)
+    cca4:	ac870104 	sw	a3,260(a0)
+    cca8:	8c840110 	lw	a0,272(a0)
+    ccac:	1480fff0 	bnez	a0,cc70 <radix_tree_tag_set+0x134>
+    ccb0:	24c60006 	addiu	a2,a2,6
+    ccb4:	03e00008 	jr	ra
+    ccb8:	00000000 	sll	zero,zero,0x0
+
+0000ccbc <radix_tree_tag_clear>:
+    ccbc:	8c830000 	lw	v1,0(a0)
+    ccc0:	14600003 	bnez	v1,ccd0 <radix_tree_tag_clear+0x14>
+    ccc4:	00000000 	sll	zero,zero,0x0
+    ccc8:	03e00008 	jr	ra
+    cccc:	00001021 	addu	v0,zero,zero
+    ccd0:	8c820008 	lw	v0,8(a0)
+    ccd4:	0045102b 	sltu	v0,v0,a1
+    ccd8:	1440fffb 	bnez	v0,ccc8 <radix_tree_tag_clear+0xc>
+    ccdc:	00000000 	sll	zero,zero,0x0
+    cce0:	14c00058 	bnez	a2,ce44 <radix_tree_tag_clear+0x188>
+    cce4:	00001021 	addu	v0,zero,zero
+    cce8:	8c8a0004 	lw	t2,4(a0)
+    ccec:	2548ffff 	addiu	t0,t2,-1
+    ccf0:	19000020 	blez	t0,cd74 <radix_tree_tag_clear+0xb8>
+    ccf4:	000820c0 	sll	a0,t0,0x3
+    ccf8:	00081040 	sll	v0,t0,0x1
+    ccfc:	00821023 	subu	v0,a0,v0
+    cd00:	2404003f 	addiu	a0,zero,63
+    cd04:	00442004 	sllv	a0,a0,v0
+    cd08:	00852024 	and	a0,a0,a1
+    cd0c:	00441006 	srlv	v0,a0,v0
+    cd10:	00021080 	sll	v0,v0,0x2
+    cd14:	00621821 	addu	v1,v1,v0
+    cd18:	8c630000 	lw	v1,0(v1)
+    cd1c:	1060ffea 	beqz	v1,ccc8 <radix_tree_tag_clear+0xc>
+    cd20:	2409003f 	addiu	t1,zero,63
+    cd24:	000a1040 	sll	v0,t2,0x1
+    cd28:	000a20c0 	sll	a0,t2,0x3
+    cd2c:	00821023 	subu	v0,a0,v0
+    cd30:	2442fff4 	addiu	v0,v0,-12
+    cd34:	08003352 	j	cd48 <radix_tree_tag_clear+0x8c>
+    cd38:	00003021 	addu	a2,zero,zero
+    cd3c:	8ce30000 	lw	v1,0(a3)
+    cd40:	1060ffe1 	beqz	v1,ccc8 <radix_tree_tag_clear+0xc>
+    cd44:	2442fffa 	addiu	v0,v0,-6
+    cd48:	00492004 	sllv	a0,t1,v0
+    cd4c:	00852024 	and	a0,a0,a1
+    cd50:	00442006 	srlv	a0,a0,v0
+    cd54:	00042080 	sll	a0,a0,0x2
+    cd58:	24c60001 	addiu	a2,a2,1
+    cd5c:	00643821 	addu	a3,v1,a0
+    cd60:	00c8202a 	slt	a0,a2,t0
+    cd64:	1480fff5 	bnez	a0,cd3c <radix_tree_tag_clear+0x80>
+    cd68:	00000000 	sll	zero,zero,0x0
+    cd6c:	00064027 	nor	t0,zero,a2
+    cd70:	010a4021 	addu	t0,t0,t2
+    cd74:	000838c0 	sll	a3,t0,0x3
+    cd78:	00084040 	sll	t0,t0,0x1
+    cd7c:	00e84023 	subu	t0,a3,t0
+    cd80:	2407003f 	addiu	a3,zero,63
+    cd84:	01073804 	sllv	a3,a3,t0
+    cd88:	00e53824 	and	a3,a3,a1
+    cd8c:	01073806 	srlv	a3,a3,t0
+    cd90:	00071080 	sll	v0,a3,0x2
+    cd94:	00621021 	addu	v0,v1,v0
+    cd98:	8c420000 	lw	v0,0(v0)
+    cd9c:	1040ffca 	beqz	v0,ccc8 <radix_tree_tag_clear+0xc>
+    cda0:	24040001 	addiu	a0,zero,1
+    cda4:	00e42004 	sllv	a0,a0,a3
+    cda8:	00806021 	addu	t4,a0,zero
+    cdac:	30e70020 	andi	a3,a3,0x20
+    cdb0:	0007200b 	movn	a0,zero,a3
+    cdb4:	8c6b0100 	lw	t3,256(v1)
+    cdb8:	8c690104 	lw	t1,260(v1)
+    cdbc:	0007600a 	movz	t4,zero,a3
+    cdc0:	00044027 	nor	t0,zero,a0
+    cdc4:	000c3827 	nor	a3,zero,t4
+    cdc8:	8c640110 	lw	a0,272(v1)
+    cdcc:	01684024 	and	t0,t3,t0
+    cdd0:	01273824 	and	a3,t1,a3
+    cdd4:	ac680100 	sw	t0,256(v1)
+    cdd8:	1080001a 	beqz	a0,ce44 <radix_tree_tag_clear+0x188>
+    cddc:	ac670104 	sw	a3,260(v1)
+    cde0:	01465023 	subu	t2,t2,a2
+    cde4:	000a30c0 	sll	a2,t2,0x3
+    cde8:	000a5040 	sll	t2,t2,0x1
+    cdec:	00ca3023 	subu	a2,a2,t2
+    cdf0:	240c003f 	addiu	t4,zero,63
+    cdf4:	240b0001 	addiu	t3,zero,1
+    cdf8:	00cc3804 	sllv	a3,t4,a2
+    cdfc:	00e53824 	and	a3,a3,a1
+    ce00:	00c73806 	srlv	a3,a3,a2
+    ce04:	00eb1804 	sllv	v1,t3,a3
+    ce08:	00605021 	addu	t2,v1,zero
+    ce0c:	30e70020 	andi	a3,a3,0x20
+    ce10:	8c890100 	lw	t1,256(a0)
+    ce14:	8c880104 	lw	t0,260(a0)
+    ce18:	0007180b 	movn	v1,zero,a3
+    ce1c:	0007500a 	movz	t2,zero,a3
+    ce20:	00031827 	nor	v1,zero,v1
+    ce24:	000a3827 	nor	a3,zero,t2
+    ce28:	01231824 	and	v1,t1,v1
+    ce2c:	01073824 	and	a3,t0,a3
+    ce30:	ac830100 	sw	v1,256(a0)
+    ce34:	ac870104 	sw	a3,260(a0)
+    ce38:	8c840110 	lw	a0,272(a0)
+    ce3c:	1480ffee 	bnez	a0,cdf8 <radix_tree_tag_clear+0x13c>
+    ce40:	24c60006 	addiu	a2,a2,6
+    ce44:	03e00008 	jr	ra
+    ce48:	00000000 	sll	zero,zero,0x0
+
+0000ce4c <radix_tree_tag_get>:
+    ce4c:	8c830000 	lw	v1,0(a0)
+    ce50:	14600003 	bnez	v1,ce60 <radix_tree_tag_get+0x14>
+    ce54:	00000000 	sll	zero,zero,0x0
+    ce58:	03e00008 	jr	ra
+    ce5c:	2402ffea 	addiu	v0,zero,-22
+    ce60:	8c820008 	lw	v0,8(a0)
+    ce64:	0045102b 	sltu	v0,v0,a1
+    ce68:	1440fffb 	bnez	v0,ce58 <radix_tree_tag_get+0xc>
+    ce6c:	00000000 	sll	zero,zero,0x0
+    ce70:	14c0fff9 	bnez	a2,ce58 <radix_tree_tag_get+0xc>
+    ce74:	00000000 	sll	zero,zero,0x0
+    ce78:	8c8a0004 	lw	t2,4(a0)
+    ce7c:	2548ffff 	addiu	t0,t2,-1
+    ce80:	19000020 	blez	t0,cf04 <radix_tree_tag_get+0xb8>
+    ce84:	000820c0 	sll	a0,t0,0x3
+    ce88:	00081040 	sll	v0,t0,0x1
+    ce8c:	00821023 	subu	v0,a0,v0
+    ce90:	2404003f 	addiu	a0,zero,63
+    ce94:	00442004 	sllv	a0,a0,v0
+    ce98:	00852024 	and	a0,a0,a1
+    ce9c:	00441006 	srlv	v0,a0,v0
+    cea0:	00021080 	sll	v0,v0,0x2
+    cea4:	00621821 	addu	v1,v1,v0
+    cea8:	8c630000 	lw	v1,0(v1)
+    ceac:	10600028 	beqz	v1,cf50 <radix_tree_tag_get+0x104>
+    ceb0:	000a20c0 	sll	a0,t2,0x3
+    ceb4:	000a1040 	sll	v0,t2,0x1
+    ceb8:	00821023 	subu	v0,a0,v0
+    cebc:	2442fff4 	addiu	v0,v0,-12
+    cec0:	00002021 	addu	a0,zero,zero
+    cec4:	080033b6 	j	ced8 <radix_tree_tag_get+0x8c>
+    cec8:	2409003f 	addiu	t1,zero,63
+    cecc:	8ce30000 	lw	v1,0(a3)
+    ced0:	1060001f 	beqz	v1,cf50 <radix_tree_tag_get+0x104>
+    ced4:	2442fffa 	addiu	v0,v0,-6
+    ced8:	00493004 	sllv	a2,t1,v0
+    cedc:	00c53024 	and	a2,a2,a1
+    cee0:	00463006 	srlv	a2,a2,v0
+    cee4:	00063080 	sll	a2,a2,0x2
+    cee8:	24840001 	addiu	a0,a0,1
+    ceec:	00663821 	addu	a3,v1,a2
+    cef0:	0088302a 	slt	a2,a0,t0
+    cef4:	14c0fff5 	bnez	a2,cecc <radix_tree_tag_get+0x80>
+    cef8:	00000000 	sll	zero,zero,0x0
+    cefc:	00042027 	nor	a0,zero,a0
+    cf00:	008a4021 	addu	t0,a0,t2
+    cf04:	000810c0 	sll	v0,t0,0x3
+    cf08:	00084040 	sll	t0,t0,0x1
+    cf0c:	00484023 	subu	t0,v0,t0
+    cf10:	2402003f 	addiu	v0,zero,63
+    cf14:	01021004 	sllv	v0,v0,t0
+    cf18:	00452824 	and	a1,v0,a1
+    cf1c:	01052806 	srlv	a1,a1,t0
+    cf20:	00051080 	sll	v0,a1,0x2
+    cf24:	00621021 	addu	v0,v1,v0
+    cf28:	8c420000 	lw	v0,0(v0)
+    cf2c:	10400008 	beqz	v0,cf50 <radix_tree_tag_get+0x104>
+    cf30:	00000000 	sll	zero,zero,0x0
+    cf34:	24020001 	addiu	v0,zero,1
+    cf38:	00a21004 	sllv	v0,v0,a1
+    cf3c:	8c630100 	lw	v1,256(v1)
+    cf40:	30a50020 	andi	a1,a1,0x20
+    cf44:	0005100b 	movn	v0,zero,a1
+    cf48:	03e00008 	jr	ra
+    cf4c:	00621024 	and	v0,v1,v0
+    cf50:	03e00008 	jr	ra
+    cf54:	2402ffd6 	addiu	v0,zero,-42
+
+0000cf58 <radix_tree_gang_lookup_tag>:
+    cf58:	8c830000 	lw	v1,0(a0)
+    cf5c:	10600073 	beqz	v1,d12c <radix_tree_gang_lookup_tag+0x1d4>
+    cf60:	27bdffe8 	addiu	sp,sp,-24
+    cf64:	8c820008 	lw	v0,8(a0)
+    cf68:	0046102b 	sltu	v0,v0,a2
+    cf6c:	1440006f 	bnez	v0,d12c <radix_tree_gang_lookup_tag+0x1d4>
+    cf70:	00000000 	sll	zero,zero,0x0
+    cf74:	10e0006d 	beqz	a3,d12c <radix_tree_gang_lookup_tag+0x1d4>
+    cf78:	00000000 	sll	zero,zero,0x0
+    cf7c:	8c8c0004 	lw	t4,4(a0)
+    cf80:	258dffff 	addiu	t5,t4,-1
+    cf84:	19a0007e 	blez	t5,d180 <radix_tree_gang_lookup_tag+0x228>
+    cf88:	000d40c0 	sll	t0,t5,0x3
+    cf8c:	000d1040 	sll	v0,t5,0x1
+    cf90:	01021023 	subu	v0,t0,v0
+    cf94:	2408003f 	addiu	t0,zero,63
+    cf98:	00484004 	sllv	t0,t0,v0
+    cf9c:	01064024 	and	t0,t0,a2
+    cfa0:	00484006 	srlv	t0,t0,v0
+    cfa4:	00081080 	sll	v0,t0,0x2
+    cfa8:	00621821 	addu	v1,v1,v0
+    cfac:	8c630000 	lw	v1,0(v1)
+    cfb0:	1060007b 	beqz	v1,d1a0 <radix_tree_gang_lookup_tag+0x248>
+    cfb4:	afa80000 	sw	t0,0(sp)
+    cfb8:	000c20c0 	sll	a0,t4,0x3
+    cfbc:	000c1040 	sll	v0,t4,0x1
+    cfc0:	00821023 	subu	v0,a0,v0
+    cfc4:	2442fff4 	addiu	v0,v0,-12
+    cfc8:	27a90004 	addiu	t1,sp,4
+    cfcc:	00002021 	addu	a0,zero,zero
+    cfd0:	080033fb 	j	cfec <radix_tree_gang_lookup_tag+0x94>
+    cfd4:	240e003f 	addiu	t6,zero,63
+    cfd8:	8d630000 	lw	v1,0(t3)
+    cfdc:	ad280000 	sw	t0,0(t1)
+    cfe0:	2442fffa 	addiu	v0,v0,-6
+    cfe4:	10600013 	beqz	v1,d034 <radix_tree_gang_lookup_tag+0xdc>
+    cfe8:	25290004 	addiu	t1,t1,4
+    cfec:	004e4004 	sllv	t0,t6,v0
+    cff0:	01064024 	and	t0,t0,a2
+    cff4:	00484006 	srlv	t0,t0,v0
+    cff8:	00085080 	sll	t2,t0,0x2
+    cffc:	24840001 	addiu	a0,a0,1
+    d000:	006a5821 	addu	t3,v1,t2
+    d004:	008d502a 	slt	t2,a0,t5
+    d008:	1540fff3 	bnez	t2,cfd8 <radix_tree_gang_lookup_tag+0x80>
+    d00c:	00000000 	sll	zero,zero,0x0
+    d010:	00044827 	nor	t1,zero,a0
+    d014:	012c4821 	addu	t1,t1,t4
+    d018:	000910c0 	sll	v0,t1,0x3
+    d01c:	00094840 	sll	t1,t1,0x1
+    d020:	00491023 	subu	v0,v0,t1
+    d024:	2408003f 	addiu	t0,zero,63
+    d028:	00484004 	sllv	t0,t0,v0
+    d02c:	01063024 	and	a2,t0,a2
+    d030:	00464006 	srlv	t0,a2,v0
+    d034:	240e0001 	addiu	t6,zero,1
+    d038:	8fb80028 	lw	t8,40(sp)
+    d03c:	010e7004 	sllv	t6,t6,t0
+    d040:	00044880 	sll	t1,a0,0x2
+    d044:	31020020 	andi	v0,t0,0x20
+    d048:	01c07821 	addu	t7,t6,zero
+    d04c:	03a94821 	addu	t1,sp,t1
+    d050:	27180020 	addiu	t8,t8,32
+    d054:	25060001 	addiu	a2,t0,1
+    d058:	240b0040 	addiu	t3,zero,64
+    d05c:	0002780a 	movz	t7,zero,v0
+    d060:	0002700b 	movn	t6,zero,v0
+    d064:	ad260000 	sw	a2,0(t1)
+    d068:	0018c0c0 	sll	t8,t8,0x3
+    d06c:	10cb001c 	beq	a2,t3,d0e0 <radix_tree_gang_lookup_tag+0x188>
+    d070:	00001021 	addu	v0,zero,zero
+    d074:	00804021 	addu	t0,a0,zero
+    d078:	00062080 	sll	a0,a2,0x2
+    d07c:	00642021 	addu	a0,v1,a0
+    d080:	8c890000 	lw	t1,0(a0)
+    d084:	11200024 	beqz	t1,d118 <radix_tree_gang_lookup_tag+0x1c0>
+    d088:	00082080 	sll	a0,t0,0x2
+    d08c:	25040001 	addiu	a0,t0,1
+    d090:	108c0029 	beq	a0,t4,d138 <radix_tree_gang_lookup_tag+0x1e0>
+    d094:	00785021 	addu	t2,v1,t8
+    d098:	8d4d0004 	lw	t5,4(t2)
+    d09c:	8d4a0000 	lw	t2,0(t2)
+    d0a0:	01af6824 	and	t5,t5,t7
+    d0a4:	014e5024 	and	t2,t2,t6
+    d0a8:	014d5025 	or	t2,t2,t5
+    d0ac:	11400019 	beqz	t2,d114 <radix_tree_gang_lookup_tag+0x1bc>
+    d0b0:	00000000 	sll	zero,zero,0x0
+    d0b4:	00041880 	sll	v1,a0,0x2
+    d0b8:	03a31821 	addu	v1,sp,v1
+    d0bc:	ac600000 	sw	zero,0(v1)
+    d0c0:	01201821 	addu	v1,t1,zero
+    d0c4:	0047302b 	sltu	a2,v0,a3
+    d0c8:	10c00019 	beqz	a2,d130 <radix_tree_gang_lookup_tag+0x1d8>
+    d0cc:	00043080 	sll	a2,a0,0x2
+    d0d0:	03a63021 	addu	a2,sp,a2
+    d0d4:	8cc60000 	lw	a2,0(a2)
+    d0d8:	14cbffe6 	bne	a2,t3,d074 <radix_tree_gang_lookup_tag+0x11c>
+    d0dc:	00000000 	sll	zero,zero,0x0
+    d0e0:	8c630110 	lw	v1,272(v1)
+    d0e4:	10600012 	beqz	v1,d130 <radix_tree_gang_lookup_tag+0x1d8>
+    d0e8:	2488ffff 	addiu	t0,a0,-1
+    d0ec:	00082080 	sll	a0,t0,0x2
+    d0f0:	03a42021 	addu	a0,sp,a0
+    d0f4:	8c860000 	lw	a2,0(a0)
+    d0f8:	24c60001 	addiu	a2,a2,1
+    d0fc:	ac860000 	sw	a2,0(a0)
+    d100:	00062080 	sll	a0,a2,0x2
+    d104:	00642021 	addu	a0,v1,a0
+    d108:	8c890000 	lw	t1,0(a0)
+    d10c:	1520ffdf 	bnez	t1,d08c <radix_tree_gang_lookup_tag+0x134>
+    d110:	00000000 	sll	zero,zero,0x0
+    d114:	00082080 	sll	a0,t0,0x2
+    d118:	03a42021 	addu	a0,sp,a0
+    d11c:	24c60001 	addiu	a2,a2,1
+    d120:	ac860000 	sw	a2,0(a0)
+    d124:	08003431 	j	d0c4 <radix_tree_gang_lookup_tag+0x16c>
+    d128:	01002021 	addu	a0,t0,zero
+    d12c:	00001021 	addu	v0,zero,zero
+    d130:	03e00008 	jr	ra
+    d134:	27bd0018 	addiu	sp,sp,24
+    d138:	00782021 	addu	a0,v1,t8
+    d13c:	8c8a0004 	lw	t2,4(a0)
+    d140:	8c840000 	lw	a0,0(a0)
+    d144:	014f5024 	and	t2,t2,t7
+    d148:	008e2024 	and	a0,a0,t6
+    d14c:	008a2025 	or	a0,a0,t2
+    d150:	1080fff0 	beqz	a0,d114 <radix_tree_gang_lookup_tag+0x1bc>
+    d154:	00000000 	sll	zero,zero,0x0
+    d158:	00022080 	sll	a0,v0,0x2
+    d15c:	00a42021 	addu	a0,a1,a0
+    d160:	ac890000 	sw	t1,0(a0)
+    d164:	00082080 	sll	a0,t0,0x2
+    d168:	03a42021 	addu	a0,sp,a0
+    d16c:	24c60001 	addiu	a2,a2,1
+    d170:	ac860000 	sw	a2,0(a0)
+    d174:	24420001 	addiu	v0,v0,1
+    d178:	08003431 	j	d0c4 <radix_tree_gang_lookup_tag+0x16c>
+    d17c:	01002021 	addu	a0,t0,zero
+    d180:	000d6840 	sll	t5,t5,0x1
+    d184:	010d6823 	subu	t5,t0,t5
+    d188:	2408003f 	addiu	t0,zero,63
+    d18c:	01a84004 	sllv	t0,t0,t5
+    d190:	00c83024 	and	a2,a2,t0
+    d194:	01a64006 	srlv	t0,a2,t5
+    d198:	0800340d 	j	d034 <radix_tree_gang_lookup_tag+0xdc>
+    d19c:	00002021 	addu	a0,zero,zero
+    d1a0:	0800340d 	j	d034 <radix_tree_gang_lookup_tag+0xdc>
+    d1a4:	00002021 	addu	a0,zero,zero
+
+0000d1a8 <radix_tree_gang_lookup_tag_slot>:
+    d1a8:	8c830000 	lw	v1,0(a0)
+    d1ac:	10600072 	beqz	v1,d378 <radix_tree_gang_lookup_tag_slot+0x1d0>
+    d1b0:	27bdffe8 	addiu	sp,sp,-24
+    d1b4:	8c820008 	lw	v0,8(a0)
+    d1b8:	0046102b 	sltu	v0,v0,a2
+    d1bc:	1440006e 	bnez	v0,d378 <radix_tree_gang_lookup_tag_slot+0x1d0>
+    d1c0:	00000000 	sll	zero,zero,0x0
+    d1c4:	10e0006c 	beqz	a3,d378 <radix_tree_gang_lookup_tag_slot+0x1d0>
+    d1c8:	00000000 	sll	zero,zero,0x0
+    d1cc:	8c8c0004 	lw	t4,4(a0)
+    d1d0:	258dffff 	addiu	t5,t4,-1
+    d1d4:	19a0007d 	blez	t5,d3cc <radix_tree_gang_lookup_tag_slot+0x224>
+    d1d8:	000d40c0 	sll	t0,t5,0x3
+    d1dc:	000d1040 	sll	v0,t5,0x1
+    d1e0:	01021023 	subu	v0,t0,v0
+    d1e4:	2408003f 	addiu	t0,zero,63
+    d1e8:	00484004 	sllv	t0,t0,v0
+    d1ec:	01064024 	and	t0,t0,a2
+    d1f0:	00484006 	srlv	t0,t0,v0
+    d1f4:	00081080 	sll	v0,t0,0x2
+    d1f8:	00621821 	addu	v1,v1,v0
+    d1fc:	8c630000 	lw	v1,0(v1)
+    d200:	1060007a 	beqz	v1,d3ec <radix_tree_gang_lookup_tag_slot+0x244>
+    d204:	afa80000 	sw	t0,0(sp)
+    d208:	000c20c0 	sll	a0,t4,0x3
+    d20c:	000c1040 	sll	v0,t4,0x1
+    d210:	00821023 	subu	v0,a0,v0
+    d214:	2442fff4 	addiu	v0,v0,-12
+    d218:	27a90004 	addiu	t1,sp,4
+    d21c:	00002021 	addu	a0,zero,zero
+    d220:	0800348f 	j	d23c <radix_tree_gang_lookup_tag_slot+0x94>
+    d224:	240e003f 	addiu	t6,zero,63
+    d228:	8d630000 	lw	v1,0(t3)
+    d22c:	ad280000 	sw	t0,0(t1)
+    d230:	2442fffa 	addiu	v0,v0,-6
+    d234:	10600013 	beqz	v1,d284 <radix_tree_gang_lookup_tag_slot+0xdc>
+    d238:	25290004 	addiu	t1,t1,4
+    d23c:	004e4004 	sllv	t0,t6,v0
+    d240:	01064024 	and	t0,t0,a2
+    d244:	00484006 	srlv	t0,t0,v0
+    d248:	00085080 	sll	t2,t0,0x2
+    d24c:	24840001 	addiu	a0,a0,1
+    d250:	006a5821 	addu	t3,v1,t2
+    d254:	008d502a 	slt	t2,a0,t5
+    d258:	1540fff3 	bnez	t2,d228 <radix_tree_gang_lookup_tag_slot+0x80>
+    d25c:	00000000 	sll	zero,zero,0x0
+    d260:	00044827 	nor	t1,zero,a0
+    d264:	012c4821 	addu	t1,t1,t4
+    d268:	000910c0 	sll	v0,t1,0x3
+    d26c:	00094840 	sll	t1,t1,0x1
+    d270:	00491023 	subu	v0,v0,t1
+    d274:	2408003f 	addiu	t0,zero,63
+    d278:	00484004 	sllv	t0,t0,v0
+    d27c:	01063024 	and	a2,t0,a2
+    d280:	00464006 	srlv	t0,a2,v0
+    d284:	240e0001 	addiu	t6,zero,1
+    d288:	8fb80028 	lw	t8,40(sp)
+    d28c:	010e7004 	sllv	t6,t6,t0
+    d290:	00043080 	sll	a2,a0,0x2
+    d294:	31020020 	andi	v0,t0,0x20
+    d298:	01c07821 	addu	t7,t6,zero
+    d29c:	03a63021 	addu	a2,sp,a2
+    d2a0:	27180020 	addiu	t8,t8,32
+    d2a4:	240b0040 	addiu	t3,zero,64
+    d2a8:	0002780a 	movz	t7,zero,v0
+    d2ac:	0002700b 	movn	t6,zero,v0
+    d2b0:	acc80000 	sw	t0,0(a2)
+    d2b4:	0018c0c0 	sll	t8,t8,0x3
+    d2b8:	110b001c 	beq	t0,t3,d32c <radix_tree_gang_lookup_tag_slot+0x184>
+    d2bc:	00001021 	addu	v0,zero,zero
+    d2c0:	00804821 	addu	t1,a0,zero
+    d2c4:	00082080 	sll	a0,t0,0x2
+    d2c8:	00642021 	addu	a0,v1,a0
+    d2cc:	8c860000 	lw	a2,0(a0)
+    d2d0:	10c00024 	beqz	a2,d364 <radix_tree_gang_lookup_tag_slot+0x1bc>
+    d2d4:	00092080 	sll	a0,t1,0x2
+    d2d8:	25240001 	addiu	a0,t1,1
+    d2dc:	11840029 	beq	t4,a0,d384 <radix_tree_gang_lookup_tag_slot+0x1dc>
+    d2e0:	00785021 	addu	t2,v1,t8
+    d2e4:	8d4d0004 	lw	t5,4(t2)
+    d2e8:	8d4a0000 	lw	t2,0(t2)
+    d2ec:	01af6824 	and	t5,t5,t7
+    d2f0:	014e5024 	and	t2,t2,t6
+    d2f4:	014d5025 	or	t2,t2,t5
+    d2f8:	11400019 	beqz	t2,d360 <radix_tree_gang_lookup_tag_slot+0x1b8>
+    d2fc:	00000000 	sll	zero,zero,0x0
+    d300:	00041880 	sll	v1,a0,0x2
+    d304:	03a31821 	addu	v1,sp,v1
+    d308:	ac600000 	sw	zero,0(v1)
+    d30c:	00c01821 	addu	v1,a2,zero
+    d310:	0047302b 	sltu	a2,v0,a3
+    d314:	10c00019 	beqz	a2,d37c <radix_tree_gang_lookup_tag_slot+0x1d4>
+    d318:	00043080 	sll	a2,a0,0x2
+    d31c:	03a63021 	addu	a2,sp,a2
+    d320:	8cc80000 	lw	t0,0(a2)
+    d324:	150bffe6 	bne	t0,t3,d2c0 <radix_tree_gang_lookup_tag_slot+0x118>
+    d328:	00000000 	sll	zero,zero,0x0
+    d32c:	8c630110 	lw	v1,272(v1)
+    d330:	10600012 	beqz	v1,d37c <radix_tree_gang_lookup_tag_slot+0x1d4>
+    d334:	2489ffff 	addiu	t1,a0,-1
+    d338:	00092080 	sll	a0,t1,0x2
+    d33c:	03a42021 	addu	a0,sp,a0
+    d340:	8c880000 	lw	t0,0(a0)
+    d344:	25080001 	addiu	t0,t0,1
+    d348:	ac880000 	sw	t0,0(a0)
+    d34c:	00082080 	sll	a0,t0,0x2
+    d350:	00642021 	addu	a0,v1,a0
+    d354:	8c860000 	lw	a2,0(a0)
+    d358:	14c0ffdf 	bnez	a2,d2d8 <radix_tree_gang_lookup_tag_slot+0x130>
+    d35c:	00000000 	sll	zero,zero,0x0
+    d360:	00092080 	sll	a0,t1,0x2
+    d364:	03a42021 	addu	a0,sp,a0
+    d368:	25080001 	addiu	t0,t0,1
+    d36c:	ac880000 	sw	t0,0(a0)
+    d370:	080034c4 	j	d310 <radix_tree_gang_lookup_tag_slot+0x168>
+    d374:	01202021 	addu	a0,t1,zero
+    d378:	00001021 	addu	v0,zero,zero
+    d37c:	03e00008 	jr	ra
+    d380:	27bd0018 	addiu	sp,sp,24
+    d384:	00782021 	addu	a0,v1,t8
+    d388:	8c8a0004 	lw	t2,4(a0)
+    d38c:	8c840000 	lw	a0,0(a0)
+    d390:	014f5024 	and	t2,t2,t7
+    d394:	008e2024 	and	a0,a0,t6
+    d398:	008a2025 	or	a0,a0,t2
+    d39c:	1080fff0 	beqz	a0,d360 <radix_tree_gang_lookup_tag_slot+0x1b8>
+    d3a0:	00000000 	sll	zero,zero,0x0
+    d3a4:	00022080 	sll	a0,v0,0x2
+    d3a8:	00a42021 	addu	a0,a1,a0
+    d3ac:	ac860000 	sw	a2,0(a0)
+    d3b0:	00092080 	sll	a0,t1,0x2
+    d3b4:	03a42021 	addu	a0,sp,a0
+    d3b8:	25080001 	addiu	t0,t0,1
+    d3bc:	ac880000 	sw	t0,0(a0)
+    d3c0:	24420001 	addiu	v0,v0,1
+    d3c4:	080034c4 	j	d310 <radix_tree_gang_lookup_tag_slot+0x168>
+    d3c8:	01202021 	addu	a0,t1,zero
+    d3cc:	000d6840 	sll	t5,t5,0x1
+    d3d0:	010d6823 	subu	t5,t0,t5
+    d3d4:	2408003f 	addiu	t0,zero,63
+    d3d8:	01a84004 	sllv	t0,t0,t5
+    d3dc:	01063024 	and	a2,t0,a2
+    d3e0:	01a64006 	srlv	t0,a2,t5
+    d3e4:	080034a1 	j	d284 <radix_tree_gang_lookup_tag_slot+0xdc>
+    d3e8:	00002021 	addu	a0,zero,zero
+    d3ec:	080034a1 	j	d284 <radix_tree_gang_lookup_tag_slot+0xdc>
+    d3f0:	00002021 	addu	a0,zero,zero
+
+0000d3f4 <radix_tree_tagged>:
+    d3f4:	8c820004 	lw	v0,4(a0)
+    d3f8:	14400003 	bnez	v0,d408 <radix_tree_tagged+0x14>
+    d3fc:	00000000 	sll	zero,zero,0x0
+    d400:	03e00008 	jr	ra
+    d404:	2402ffea 	addiu	v0,zero,-22
+    d408:	14a0fffd 	bnez	a1,d400 <radix_tree_tagged+0xc>
+    d40c:	00000000 	sll	zero,zero,0x0
+    d410:	8c820000 	lw	v0,0(a0)
+    d414:	03e00008 	jr	ra
+    d418:	8c420100 	lw	v0,256(v0)
+
+0000d41c <radix_tree_gang_lookup>:
+    d41c:	27bdffb0 	addiu	sp,sp,-80
+    d420:	afb00030 	sw	s0,48(sp)
+    d424:	8c900000 	lw	s0,0(a0)
+    d428:	afb20038 	sw	s2,56(sp)
+    d42c:	afb10034 	sw	s1,52(sp)
+    d430:	afbf004c 	sw	ra,76(sp)
+    d434:	afb60048 	sw	s6,72(sp)
+    d438:	afb50044 	sw	s5,68(sp)
+    d43c:	afb40040 	sw	s4,64(sp)
+    d440:	afb3003c 	sw	s3,60(sp)
+    d444:	00808821 	addu	s1,a0,zero
+    d448:	1200005c 	beqz	s0,d5bc <radix_tree_gang_lookup+0x1a0>
+    d44c:	00a09021 	addu	s2,a1,zero
+    d450:	8c820008 	lw	v0,8(a0)
+    d454:	0046102b 	sltu	v0,v0,a2
+    d458:	14400058 	bnez	v0,d5bc <radix_tree_gang_lookup+0x1a0>
+    d45c:	00000000 	sll	zero,zero,0x0
+    d460:	10e00056 	beqz	a3,d5bc <radix_tree_gang_lookup+0x1a0>
+    d464:	00000000 	sll	zero,zero,0x0
+    d468:	8c8c0004 	lw	t4,4(a0)
+    d46c:	258affff 	addiu	t2,t4,-1
+    d470:	11400072 	beqz	t2,d63c <radix_tree_gang_lookup+0x220>
+    d474:	000a1040 	sll	v0,t2,0x1
+    d478:	000a18c0 	sll	v1,t2,0x3
+    d47c:	00621823 	subu	v1,v1,v0
+    d480:	2402003f 	addiu	v0,zero,63
+    d484:	00621004 	sllv	v0,v0,v1
+    d488:	00461024 	and	v0,v0,a2
+    d48c:	00621006 	srlv	v0,v0,v1
+    d490:	00021880 	sll	v1,v0,0x2
+    d494:	02031821 	addu	v1,s0,v1
+    d498:	8c680000 	lw	t0,0(v1)
+    d49c:	11000070 	beqz	t0,d660 <radix_tree_gang_lookup+0x244>
+    d4a0:	afa20010 	sw	v0,16(sp)
+    d4a4:	000c1040 	sll	v0,t4,0x1
+    d4a8:	000c18c0 	sll	v1,t4,0x3
+    d4ac:	00621823 	subu	v1,v1,v0
+    d4b0:	2463fff4 	addiu	v1,v1,-12
+    d4b4:	27a40014 	addiu	a0,sp,20
+    d4b8:	00009821 	addu	s3,zero,zero
+    d4bc:	08003536 	j	d4d8 <radix_tree_gang_lookup+0xbc>
+    d4c0:	240b003f 	addiu	t3,zero,63
+    d4c4:	8d250000 	lw	a1,0(t1)
+    d4c8:	ac820000 	sw	v0,0(a0)
+    d4cc:	10a00014 	beqz	a1,d520 <radix_tree_gang_lookup+0x104>
+    d4d0:	24840004 	addiu	a0,a0,4
+    d4d4:	00a04021 	addu	t0,a1,zero
+    d4d8:	006b1004 	sllv	v0,t3,v1
+    d4dc:	00461024 	and	v0,v0,a2
+    d4e0:	00621006 	srlv	v0,v0,v1
+    d4e4:	00022880 	sll	a1,v0,0x2
+    d4e8:	26730001 	addiu	s3,s3,1
+    d4ec:	01054821 	addu	t1,t0,a1
+    d4f0:	026a282b 	sltu	a1,s3,t2
+    d4f4:	14a0fff3 	bnez	a1,d4c4 <radix_tree_gang_lookup+0xa8>
+    d4f8:	2463fffa 	addiu	v1,v1,-6
+    d4fc:	00131027 	nor	v0,zero,s3
+    d500:	004c6021 	addu	t4,v0,t4
+    d504:	000c10c0 	sll	v0,t4,0x3
+    d508:	000c6040 	sll	t4,t4,0x1
+    d50c:	004c6023 	subu	t4,v0,t4
+    d510:	2402003f 	addiu	v0,zero,63
+    d514:	01821004 	sllv	v0,v0,t4
+    d518:	00461024 	and	v0,v0,a2
+    d51c:	01821006 	srlv	v0,v0,t4
+    d520:	11530048 	beq	t2,s3,d644 <radix_tree_gang_lookup+0x228>
+    d524:	01008021 	addu	s0,t0,zero
+    d528:	0000a021 	addu	s4,zero,zero
+    d52c:	0287182b 	sltu	v1,s4,a3
+    d530:	10600023 	beqz	v1,d5c0 <radix_tree_gang_lookup+0x1a4>
+    d534:	00131880 	sll	v1,s3,0x2
+    d538:	27b50010 	addiu	s5,sp,16
+    d53c:	24420001 	addiu	v0,v0,1
+    d540:	02a31821 	addu	v1,s5,v1
+    d544:	24160040 	addiu	s6,zero,64
+    d548:	10560013 	beq	v0,s6,d598 <radix_tree_gang_lookup+0x17c>
+    d54c:	ac620000 	sw	v0,0(v1)
+    d550:	00021880 	sll	v1,v0,0x2
+    d554:	02031821 	addu	v1,s0,v1
+    d558:	8c640000 	lw	a0,0(v1)
+    d55c:	10800027 	beqz	a0,d5fc <radix_tree_gang_lookup+0x1e0>
+    d560:	26630001 	addiu	v1,s3,1
+    d564:	8e250004 	lw	a1,4(s1)
+    d568:	10650020 	beq	v1,a1,d5ec <radix_tree_gang_lookup+0x1d0>
+    d56c:	00000000 	sll	zero,zero,0x0
+    d570:	00031080 	sll	v0,v1,0x2
+    d574:	02a21021 	addu	v0,s5,v0
+    d578:	ac400000 	sw	zero,0(v0)
+    d57c:	00808021 	addu	s0,a0,zero
+    d580:	00001021 	addu	v0,zero,zero
+    d584:	0287202b 	sltu	a0,s4,a3
+    d588:	1080000e 	beqz	a0,d5c4 <radix_tree_gang_lookup+0x1a8>
+    d58c:	8fbf004c 	lw	ra,76(sp)
+    d590:	1456ffef 	bne	v0,s6,d550 <radix_tree_gang_lookup+0x134>
+    d594:	00609821 	addu	s3,v1,zero
+    d598:	8e100110 	lw	s0,272(s0)
+    d59c:	12000008 	beqz	s0,d5c0 <radix_tree_gang_lookup+0x1a4>
+    d5a0:	2663ffff 	addiu	v1,s3,-1
+    d5a4:	00032080 	sll	a0,v1,0x2
+    d5a8:	02a42021 	addu	a0,s5,a0
+    d5ac:	8c820000 	lw	v0,0(a0)
+    d5b0:	24420001 	addiu	v0,v0,1
+    d5b4:	08003561 	j	d584 <radix_tree_gang_lookup+0x168>
+    d5b8:	ac820000 	sw	v0,0(a0)
+    d5bc:	0000a021 	addu	s4,zero,zero
+    d5c0:	8fbf004c 	lw	ra,76(sp)
+    d5c4:	02801021 	addu	v0,s4,zero
+    d5c8:	8fb60048 	lw	s6,72(sp)
+    d5cc:	8fb50044 	lw	s5,68(sp)
+    d5d0:	8fb40040 	lw	s4,64(sp)
+    d5d4:	8fb3003c 	lw	s3,60(sp)
+    d5d8:	8fb20038 	lw	s2,56(sp)
+    d5dc:	8fb10034 	lw	s1,52(sp)
+    d5e0:	8fb00030 	lw	s0,48(sp)
+    d5e4:	03e00008 	jr	ra
+    d5e8:	27bd0050 	addiu	sp,sp,80
+    d5ec:	00141880 	sll	v1,s4,0x2
+    d5f0:	02431821 	addu	v1,s2,v1
+    d5f4:	ac640000 	sw	a0,0(v1)
+    d5f8:	26940001 	addiu	s4,s4,1
+    d5fc:	24450001 	addiu	a1,v0,1
+    d600:	26040108 	addiu	a0,s0,264
+    d604:	24060008 	addiu	a2,zero,8
+    d608:	0c00b895 	jal	2e254 <bitmap_ffs2>
+    d60c:	afa70028 	sw	a3,40(sp)
+    d610:	04400007 	bltz	v0,d630 <radix_tree_gang_lookup+0x214>
+    d614:	8fa70028 	lw	a3,40(sp)
+    d618:	00402021 	addu	a0,v0,zero
+    d61c:	00131880 	sll	v1,s3,0x2
+    d620:	02a31821 	addu	v1,s5,v1
+    d624:	ac640000 	sw	a0,0(v1)
+    d628:	08003561 	j	d584 <radix_tree_gang_lookup+0x168>
+    d62c:	02601821 	addu	v1,s3,zero
+    d630:	24040040 	addiu	a0,zero,64
+    d634:	08003587 	j	d61c <radix_tree_gang_lookup+0x200>
+    d638:	24020040 	addiu	v0,zero,64
+    d63c:	30c2003f 	andi	v0,a2,0x3f
+    d640:	00009821 	addu	s3,zero,zero
+    d644:	00021880 	sll	v1,v0,0x2
+    d648:	02031821 	addu	v1,s0,v1
+    d64c:	8c630000 	lw	v1,0(v1)
+    d650:	1060ffb5 	beqz	v1,d528 <radix_tree_gang_lookup+0x10c>
+    d654:	24140001 	addiu	s4,zero,1
+    d658:	0800354b 	j	d52c <radix_tree_gang_lookup+0x110>
+    d65c:	ae430000 	sw	v1,0(s2)
+    d660:	00009821 	addu	s3,zero,zero
+    d664:	0800354b 	j	d52c <radix_tree_gang_lookup+0x110>
+    d668:	0000a021 	addu	s4,zero,zero
+
+0000d66c <radix_tree_insert>:
+    d66c:	27bdffb8 	addiu	sp,sp,-72
+    d670:	afb60038 	sw	s6,56(sp)
+    d674:	8c820004 	lw	v0,4(a0)
+    d678:	3c160011 	lui	s6,0x11
+    d67c:	afbe0040 	sw	s8,64(sp)
+    d680:	afb7003c 	sw	s7,60(sp)
+    d684:	afb50034 	sw	s5,52(sp)
+    d688:	afb40030 	sw	s4,48(sp)
+    d68c:	afb3002c 	sw	s3,44(sp)
+    d690:	afb20028 	sw	s2,40(sp)
+    d694:	afb10024 	sw	s1,36(sp)
+    d698:	afbf0044 	sw	ra,68(sp)
+    d69c:	afb00020 	sw	s0,32(sp)
+    d6a0:	00808821 	addu	s1,a0,zero
+    d6a4:	00a09021 	addu	s2,a1,zero
+    d6a8:	afa60050 	sw	a2,80(sp)
+    d6ac:	36d60020 	ori	s6,s6,0x20
+    d6b0:	24150003 	addiu	s5,zero,3
+    d6b4:	24140118 	addiu	s4,zero,280
+    d6b8:	27b30010 	addiu	s3,sp,16
+    d6bc:	24170001 	addiu	s7,zero,1
+    d6c0:	241e0006 	addiu	s8,zero,6
+    d6c4:	10400005 	beqz	v0,d6dc <radix_tree_insert+0x70>
+    d6c8:	02602021 	addu	a0,s3,zero
+    d6cc:	8e230008 	lw	v1,8(s1)
+    d6d0:	0072182b 	sltu	v1,v1,s2
+    d6d4:	10600039 	beqz	v1,d7bc <radix_tree_insert+0x150>
+    d6d8:	28430002 	slti	v1,v0,2
+    d6dc:	afb50010 	sw	s5,16(sp)
+    d6e0:	afb40014 	sw	s4,20(sp)
+    d6e4:	0c00713f 	jal	1c4fc <kmem_alloc>
+    d6e8:	afb60018 	sw	s6,24(sp)
+    d6ec:	10400026 	beqz	v0,d788 <radix_tree_insert+0x11c>
+    d6f0:	00408021 	addu	s0,v0,zero
+    d6f4:	00402021 	addu	a0,v0,zero
+    d6f8:	00002821 	addu	a1,zero,zero
+    d6fc:	0c00c182 	jal	30608 <memset>
+    d700:	24060118 	addiu	a2,zero,280
+    d704:	8e230000 	lw	v1,0(s1)
+    d708:	8e220004 	lw	v0,4(s1)
+    d70c:	10400010 	beqz	v0,d750 <radix_tree_insert+0xe4>
+    d710:	ae030000 	sw	v1,0(s0)
+    d714:	8c640100 	lw	a0,256(v1)
+    d718:	8c650104 	lw	a1,260(v1)
+    d71c:	00003021 	addu	a2,zero,zero
+    d720:	00852025 	or	a0,a0,a1
+    d724:	10800003 	beqz	a0,d734 <radix_tree_insert+0xc8>
+    d728:	00003821 	addu	a3,zero,zero
+    d72c:	24060001 	addiu	a2,zero,1
+    d730:	00003821 	addu	a3,zero,zero
+    d734:	8e040108 	lw	a0,264(s0)
+    d738:	ae060100 	sw	a2,256(s0)
+    d73c:	34840001 	ori	a0,a0,0x1
+    d740:	ae070104 	sw	a3,260(s0)
+    d744:	ae040108 	sw	a0,264(s0)
+    d748:	ac700110 	sw	s0,272(v1)
+    d74c:	ae170114 	sw	s7,276(s0)
+    d750:	24420001 	addiu	v0,v0,1
+    d754:	ae300000 	sw	s0,0(s1)
+    d758:	105e0008 	beq	v0,s8,d77c <radix_tree_insert+0x110>
+    d75c:	ae220004 	sw	v0,4(s1)
+    d760:	00021840 	sll	v1,v0,0x1
+    d764:	000220c0 	sll	a0,v0,0x3
+    d768:	00831823 	subu	v1,a0,v1
+    d76c:	00771804 	sllv	v1,s7,v1
+    d770:	2463ffff 	addiu	v1,v1,-1
+    d774:	080035b1 	j	d6c4 <radix_tree_insert+0x58>
+    d778:	ae230008 	sw	v1,8(s1)
+    d77c:	2403ffff 	addiu	v1,zero,-1
+    d780:	080035b1 	j	d6c4 <radix_tree_insert+0x58>
+    d784:	ae230008 	sw	v1,8(s1)
+    d788:	2402fff4 	addiu	v0,zero,-12
+    d78c:	8fbf0044 	lw	ra,68(sp)
+    d790:	8fbe0040 	lw	s8,64(sp)
+    d794:	8fb7003c 	lw	s7,60(sp)
+    d798:	8fb60038 	lw	s6,56(sp)
+    d79c:	8fb50034 	lw	s5,52(sp)
+    d7a0:	8fb40030 	lw	s4,48(sp)
+    d7a4:	8fb3002c 	lw	s3,44(sp)
+    d7a8:	8fb20028 	lw	s2,40(sp)
+    d7ac:	8fb10024 	lw	s1,36(sp)
+    d7b0:	8fb00020 	lw	s0,32(sp)
+    d7b4:	03e00008 	jr	ra
+    d7b8:	27bd0048 	addiu	sp,sp,72
+    d7bc:	14600066 	bnez	v1,d958 <radix_tree_insert+0x2ec>
+    d7c0:	8e330000 	lw	s3,0(s1)
+    d7c4:	24100001 	addiu	s0,zero,1
+    d7c8:	00002021 	addu	a0,zero,zero
+    d7cc:	2416003f 	addiu	s6,zero,63
+    d7d0:	080035fb 	j	d7ec <radix_tree_insert+0x180>
+    d7d4:	27be0010 	addiu	s8,sp,16
+    d7d8:	00a2182a 	slt	v1,a1,v0
+    d7dc:	10600034 	beqz	v1,d8b0 <radix_tree_insert+0x244>
+    d7e0:	02e09821 	addu	s3,s7,zero
+    d7e4:	02002021 	addu	a0,s0,zero
+    d7e8:	00a08021 	addu	s0,a1,zero
+    d7ec:	00042027 	nor	a0,zero,a0
+    d7f0:	00822021 	addu	a0,a0,v0
+    d7f4:	000418c0 	sll	v1,a0,0x3
+    d7f8:	00042040 	sll	a0,a0,0x1
+    d7fc:	00641823 	subu	v1,v1,a0
+    d800:	0076a004 	sllv	s4,s6,v1
+    d804:	0292a024 	and	s4,s4,s2
+    d808:	0074a006 	srlv	s4,s4,v1
+    d80c:	0014a880 	sll	s5,s4,0x2
+    d810:	0275a821 	addu	s5,s3,s5
+    d814:	8eb70000 	lw	s7,0(s5)
+    d818:	16e0ffef 	bnez	s7,d7d8 <radix_tree_insert+0x16c>
+    d81c:	26050001 	addiu	a1,s0,1
+    d820:	3c060011 	lui	a2,0x11
+    d824:	24050118 	addiu	a1,zero,280
+    d828:	34c60020 	ori	a2,a2,0x20
+    d82c:	03c02021 	addu	a0,s8,zero
+    d830:	24020003 	addiu	v0,zero,3
+    d834:	afa50014 	sw	a1,20(sp)
+    d838:	afa60018 	sw	a2,24(sp)
+    d83c:	0c00713f 	jal	1c4fc <kmem_alloc>
+    d840:	afa20010 	sw	v0,16(sp)
+    d844:	0040b821 	addu	s7,v0,zero
+    d848:	00402021 	addu	a0,v0,zero
+    d84c:	00002821 	addu	a1,zero,zero
+    d850:	1040ffcd 	beqz	v0,d788 <radix_tree_insert+0x11c>
+    d854:	24060118 	addiu	a2,zero,280
+    d858:	0c00c182 	jal	30608 <memset>
+    d85c:	00000000 	sll	zero,zero,0x0
+    d860:	00141942 	srl	v1,s4,0x5
+    d864:	24630042 	addiu	v1,v1,66
+    d868:	00031880 	sll	v1,v1,0x2
+    d86c:	02631821 	addu	v1,s3,v1
+    d870:	8c620000 	lw	v0,0(v1)
+    d874:	24050001 	addiu	a1,zero,1
+    d878:	aee00114 	sw	zero,276(s7)
+    d87c:	0285a004 	sllv	s4,a1,s4
+    d880:	8e640114 	lw	a0,276(s3)
+    d884:	0282a025 	or	s4,s4,v0
+    d888:	8e220004 	lw	v0,4(s1)
+    d88c:	26050001 	addiu	a1,s0,1
+    d890:	24840001 	addiu	a0,a0,1
+    d894:	ac740000 	sw	s4,0(v1)
+    d898:	00a2182a 	slt	v1,a1,v0
+    d89c:	ae640114 	sw	a0,276(s3)
+    d8a0:	aef30110 	sw	s3,272(s7)
+    d8a4:	aeb70000 	sw	s7,0(s5)
+    d8a8:	1460ffce 	bnez	v1,d7e4 <radix_tree_insert+0x178>
+    d8ac:	02e09821 	addu	s3,s7,zero
+    d8b0:	00108027 	nor	s0,zero,s0
+    d8b4:	02021021 	addu	v0,s0,v0
+    d8b8:	000218c0 	sll	v1,v0,0x3
+    d8bc:	00021040 	sll	v0,v0,0x1
+    d8c0:	00621023 	subu	v0,v1,v0
+    d8c4:	2403003f 	addiu	v1,zero,63
+    d8c8:	00431804 	sllv	v1,v1,v0
+    d8cc:	00729024 	and	s2,v1,s2
+    d8d0:	00521006 	srlv	v0,s2,v0
+    d8d4:	00021880 	sll	v1,v0,0x2
+    d8d8:	02631821 	addu	v1,s3,v1
+    d8dc:	8c640000 	lw	a0,0(v1)
+    d8e0:	1080000d 	beqz	a0,d918 <radix_tree_insert+0x2ac>
+    d8e4:	8fbf0044 	lw	ra,68(sp)
+    d8e8:	2402ffef 	addiu	v0,zero,-17
+    d8ec:	8fbe0040 	lw	s8,64(sp)
+    d8f0:	8fb7003c 	lw	s7,60(sp)
+    d8f4:	8fb60038 	lw	s6,56(sp)
+    d8f8:	8fb50034 	lw	s5,52(sp)
+    d8fc:	8fb40030 	lw	s4,48(sp)
+    d900:	8fb3002c 	lw	s3,44(sp)
+    d904:	8fb20028 	lw	s2,40(sp)
+    d908:	8fb10024 	lw	s1,36(sp)
+    d90c:	8fb00020 	lw	s0,32(sp)
+    d910:	03e00008 	jr	ra
+    d914:	27bd0048 	addiu	sp,sp,72
+    d918:	00022142 	srl	a0,v0,0x5
+    d91c:	24840042 	addiu	a0,a0,66
+    d920:	00042080 	sll	a0,a0,0x2
+    d924:	02642021 	addu	a0,s3,a0
+    d928:	8c860000 	lw	a2,0(a0)
+    d92c:	24070001 	addiu	a3,zero,1
+    d930:	8e650114 	lw	a1,276(s3)
+    d934:	00471004 	sllv	v0,a3,v0
+    d938:	00461025 	or	v0,v0,a2
+    d93c:	8fa60050 	lw	a2,80(sp)
+    d940:	24a50001 	addiu	a1,a1,1
+    d944:	ac820000 	sw	v0,0(a0)
+    d948:	ac660000 	sw	a2,0(v1)
+    d94c:	ae650114 	sw	a1,276(s3)
+    d950:	080035e3 	j	d78c <radix_tree_insert+0x120>
+    d954:	00001021 	addu	v0,zero,zero
+    d958:	0800362d 	j	d8b4 <radix_tree_insert+0x248>
+    d95c:	2410ffff 	addiu	s0,zero,-1
+
+0000d960 <radix_tree_remove_item>:
+    d960:	8ca2000c 	lw	v0,12(a1)
+    d964:	27bdffa0 	addiu	sp,sp,-96
+    d968:	00023942 	srl	a3,v0,0x5
+    d96c:	afb0003c 	sw	s0,60(sp)
+    d970:	24e70042 	addiu	a3,a3,66
+    d974:	8cb00004 	lw	s0,4(a1)
+    d978:	24080001 	addiu	t0,zero,1
+    d97c:	00073880 	sll	a3,a3,0x2
+    d980:	00481804 	sllv	v1,t0,v0
+    d984:	02073821 	addu	a3,s0,a3
+    d988:	30490020 	andi	t1,v0,0x20
+    d98c:	8cec0000 	lw	t4,0(a3)
+    d990:	00606821 	addu	t5,v1,zero
+    d994:	00484004 	sllv	t0,t0,v0
+    d998:	8e060114 	lw	a2,276(s0)
+    d99c:	0009180b 	movn	v1,zero,t1
+    d9a0:	8e0b0100 	lw	t3,256(s0)
+    d9a4:	8e0a0104 	lw	t2,260(s0)
+    d9a8:	0009680a 	movz	t5,zero,t1
+    d9ac:	00084027 	nor	t0,zero,t0
+    d9b0:	00031827 	nor	v1,zero,v1
+    d9b4:	000d4827 	nor	t1,zero,t5
+    d9b8:	00021080 	sll	v0,v0,0x2
+    d9bc:	010c4024 	and	t0,t0,t4
+    d9c0:	01631824 	and	v1,t3,v1
+    d9c4:	01494824 	and	t1,t2,t1
+    d9c8:	02021021 	addu	v0,s0,v0
+    d9cc:	24c6ffff 	addiu	a2,a2,-1
+    d9d0:	ace80000 	sw	t0,0(a3)
+    d9d4:	24070003 	addiu	a3,zero,3
+    d9d8:	afb10040 	sw	s1,64(sp)
+    d9dc:	afbf005c 	sw	ra,92(sp)
+    d9e0:	afb70058 	sw	s7,88(sp)
+    d9e4:	afb60054 	sw	s6,84(sp)
+    d9e8:	afb50050 	sw	s5,80(sp)
+    d9ec:	afb4004c 	sw	s4,76(sp)
+    d9f0:	afb30048 	sw	s3,72(sp)
+    d9f4:	afb20044 	sw	s2,68(sp)
+    d9f8:	afa70010 	sw	a3,16(sp)
+    d9fc:	ac400000 	sw	zero,0(v0)
+    da00:	ae030100 	sw	v1,256(s0)
+    da04:	ae090104 	sw	t1,260(s0)
+    da08:	00808821 	addu	s1,a0,zero
+    da0c:	10c000b5 	beqz	a2,dce4 <radix_tree_remove_item+0x384>
+    da10:	ae060114 	sw	a2,276(s0)
+    da14:	8c860004 	lw	a2,4(a0)
+    da18:	00003821 	addu	a3,zero,zero
+    da1c:	8e100110 	lw	s0,272(s0)
+    da20:	8cb20010 	lw	s2,16(a1)
+    da24:	12000058 	beqz	s0,db88 <radix_tree_remove_item+0x228>
+    da28:	8cb50008 	lw	s5,8(a1)
+    da2c:	00129023 	negu	s2,s2
+    da30:	00d22021 	addu	a0,a2,s2
+    da34:	000418c0 	sll	v1,a0,0x3
+    da38:	00042040 	sll	a0,a0,0x1
+    da3c:	00641823 	subu	v1,v1,a0
+    da40:	2416003f 	addiu	s6,zero,63
+    da44:	00761004 	sllv	v0,s6,v1
+    da48:	00551024 	and	v0,v0,s5
+    da4c:	24140001 	addiu	s4,zero,1
+    da50:	27b70010 	addiu	s7,sp,16
+    da54:	00621006 	srlv	v0,v0,v1
+    da58:	10e0002c 	beqz	a3,db0c <radix_tree_remove_item+0x1ac>
+    da5c:	8e130110 	lw	s3,272(s0)
+    da60:	00022942 	srl	a1,v0,0x5
+    da64:	24a50042 	addiu	a1,a1,66
+    da68:	00542004 	sllv	a0,s4,v0
+    da6c:	00052880 	sll	a1,a1,0x2
+    da70:	30470020 	andi	a3,v0,0x20
+    da74:	02052821 	addu	a1,s0,a1
+    da78:	00806021 	addu	t4,a0,zero
+    da7c:	8cab0000 	lw	t3,0(a1)
+    da80:	8e030114 	lw	v1,276(s0)
+    da84:	0007200b 	movn	a0,zero,a3
+    da88:	8e0a0100 	lw	t2,256(s0)
+    da8c:	8e090104 	lw	t1,260(s0)
+    da90:	00544004 	sllv	t0,s4,v0
+    da94:	0007600a 	movz	t4,zero,a3
+    da98:	00084027 	nor	t0,zero,t0
+    da9c:	00042027 	nor	a0,zero,a0
+    daa0:	000c3827 	nor	a3,zero,t4
+    daa4:	00021080 	sll	v0,v0,0x2
+    daa8:	010b4024 	and	t0,t0,t3
+    daac:	01442024 	and	a0,t2,a0
+    dab0:	01273824 	and	a3,t1,a3
+    dab4:	02021021 	addu	v0,s0,v0
+    dab8:	2463ffff 	addiu	v1,v1,-1
+    dabc:	aca80000 	sw	t0,0(a1)
+    dac0:	ac400000 	sw	zero,0(v0)
+    dac4:	ae040100 	sw	a0,256(s0)
+    dac8:	ae070104 	sw	a3,260(s0)
+    dacc:	10600024 	beqz	v1,db60 <radix_tree_remove_item+0x200>
+    dad0:	ae030114 	sw	v1,276(s0)
+    dad4:	00003821 	addu	a3,zero,zero
+    dad8:	1260002b 	beqz	s3,db88 <radix_tree_remove_item+0x228>
+    dadc:	26520001 	addiu	s2,s2,1
+    dae0:	8e260004 	lw	a2,4(s1)
+    dae4:	02608021 	addu	s0,s3,zero
+    dae8:	00d22021 	addu	a0,a2,s2
+    daec:	000418c0 	sll	v1,a0,0x3
+    daf0:	00042040 	sll	a0,a0,0x1
+    daf4:	00641823 	subu	v1,v1,a0
+    daf8:	00761004 	sllv	v0,s6,v1
+    dafc:	00551024 	and	v0,v0,s5
+    db00:	00621006 	srlv	v0,v0,v1
+    db04:	14e0ffd6 	bnez	a3,da60 <radix_tree_remove_item+0x100>
+    db08:	8e130110 	lw	s3,272(s0)
+    db0c:	00021880 	sll	v1,v0,0x2
+    db10:	02031821 	addu	v1,s0,v1
+    db14:	8c630000 	lw	v1,0(v1)
+    db18:	8c640104 	lw	a0,260(v1)
+    db1c:	8c630100 	lw	v1,256(v1)
+    db20:	00641825 	or	v1,v1,a0
+    db24:	1060004b 	beqz	v1,dc54 <radix_tree_remove_item+0x2f4>
+    db28:	00541804 	sllv	v1,s4,v0
+    db2c:	8e070100 	lw	a3,256(s0)
+    db30:	30420020 	andi	v0,v0,0x20
+    db34:	8e050104 	lw	a1,260(s0)
+    db38:	00602021 	addu	a0,v1,zero
+    db3c:	0002180b 	movn	v1,zero,v0
+    db40:	00e31825 	or	v1,a3,v1
+    db44:	0002200a 	movz	a0,zero,v0
+    db48:	00a41025 	or	v0,a1,a0
+    db4c:	ae030100 	sw	v1,256(s0)
+    db50:	8e030114 	lw	v1,276(s0)
+    db54:	ae020104 	sw	v0,260(s0)
+    db58:	1460ffdf 	bnez	v1,dad8 <radix_tree_remove_item+0x178>
+    db5c:	00003821 	addu	a3,zero,zero
+    db60:	02e02021 	addu	a0,s7,zero
+    db64:	0c007134 	jal	1c4d0 <kmem_free>
+    db68:	afb0001c 	sw	s0,28(sp)
+    db6c:	8e220000 	lw	v0,0(s1)
+    db70:	10500057 	beq	v0,s0,dcd0 <radix_tree_remove_item+0x370>
+    db74:	00003021 	addu	a2,zero,zero
+    db78:	8e260004 	lw	a2,4(s1)
+    db7c:	24070001 	addiu	a3,zero,1
+    db80:	1660ffd8 	bnez	s3,dae4 <radix_tree_remove_item+0x184>
+    db84:	26520001 	addiu	s2,s2,1
+    db88:	18c00020 	blez	a2,dc0c <radix_tree_remove_item+0x2ac>
+    db8c:	000610c0 	sll	v0,a2,0x3
+    db90:	8e220000 	lw	v0,0(s1)
+    db94:	24030001 	addiu	v1,zero,1
+    db98:	8c440114 	lw	a0,276(v0)
+    db9c:	1483003b 	bne	a0,v1,dc8c <radix_tree_remove_item+0x32c>
+    dba0:	00000000 	sll	zero,zero,0x0
+    dba4:	8c440000 	lw	a0,0(v0)
+    dba8:	10800038 	beqz	a0,dc8c <radix_tree_remove_item+0x32c>
+    dbac:	24030003 	addiu	v1,zero,3
+    dbb0:	afa30020 	sw	v1,32(sp)
+    dbb4:	27b00020 	addiu	s0,sp,32
+    dbb8:	8e230004 	lw	v1,4(s1)
+    dbbc:	080036f8 	j	dbe0 <radix_tree_remove_item+0x280>
+    dbc0:	24120001 	addiu	s2,zero,1
+    dbc4:	8e220000 	lw	v0,0(s1)
+    dbc8:	8c440114 	lw	a0,276(v0)
+    dbcc:	1492002f 	bne	a0,s2,dc8c <radix_tree_remove_item+0x32c>
+    dbd0:	00000000 	sll	zero,zero,0x0
+    dbd4:	8c440000 	lw	a0,0(v0)
+    dbd8:	1080002c 	beqz	a0,dc8c <radix_tree_remove_item+0x32c>
+    dbdc:	00000000 	sll	zero,zero,0x0
+    dbe0:	2463ffff 	addiu	v1,v1,-1
+    dbe4:	ae240000 	sw	a0,0(s1)
+    dbe8:	ae230004 	sw	v1,4(s1)
+    dbec:	ac800110 	sw	zero,272(a0)
+    dbf0:	02002021 	addu	a0,s0,zero
+    dbf4:	0c007134 	jal	1c4d0 <kmem_free>
+    dbf8:	afa2002c 	sw	v0,44(sp)
+    dbfc:	8e230004 	lw	v1,4(s1)
+    dc00:	1c60fff0 	bgtz	v1,dbc4 <radix_tree_remove_item+0x264>
+    dc04:	00603021 	addu	a2,v1,zero
+    dc08:	000610c0 	sll	v0,a2,0x3
+    dc0c:	00063040 	sll	a2,a2,0x1
+    dc10:	00463023 	subu	a2,v0,a2
+    dc14:	24020001 	addiu	v0,zero,1
+    dc18:	00c21004 	sllv	v0,v0,a2
+    dc1c:	8fbf005c 	lw	ra,92(sp)
+    dc20:	2442ffff 	addiu	v0,v0,-1
+    dc24:	ae220008 	sw	v0,8(s1)
+    dc28:	8fb70058 	lw	s7,88(sp)
+    dc2c:	00001021 	addu	v0,zero,zero
+    dc30:	8fb60054 	lw	s6,84(sp)
+    dc34:	8fb50050 	lw	s5,80(sp)
+    dc38:	8fb4004c 	lw	s4,76(sp)
+    dc3c:	8fb30048 	lw	s3,72(sp)
+    dc40:	8fb20044 	lw	s2,68(sp)
+    dc44:	8fb10040 	lw	s1,64(sp)
+    dc48:	8fb0003c 	lw	s0,60(sp)
+    dc4c:	03e00008 	jr	ra
+    dc50:	27bd0060 	addiu	sp,sp,96
+    dc54:	00603821 	addu	a3,v1,zero
+    dc58:	30420020 	andi	v0,v0,0x20
+    dc5c:	0002180b 	movn	v1,zero,v0
+    dc60:	8e050100 	lw	a1,256(s0)
+    dc64:	8e040104 	lw	a0,260(s0)
+    dc68:	0002380a 	movz	a3,zero,v0
+    dc6c:	00031827 	nor	v1,zero,v1
+    dc70:	00071027 	nor	v0,zero,a3
+    dc74:	00a31824 	and	v1,a1,v1
+    dc78:	00821024 	and	v0,a0,v0
+    dc7c:	ae030100 	sw	v1,256(s0)
+    dc80:	ae020104 	sw	v0,260(s0)
+    dc84:	080036d6 	j	db58 <radix_tree_remove_item+0x1f8>
+    dc88:	8e030114 	lw	v1,276(s0)
+    dc8c:	24020006 	addiu	v0,zero,6
+    dc90:	14c2ffde 	bne	a2,v0,dc0c <radix_tree_remove_item+0x2ac>
+    dc94:	000610c0 	sll	v0,a2,0x3
+    dc98:	8fbf005c 	lw	ra,92(sp)
+    dc9c:	2402ffff 	addiu	v0,zero,-1
+    dca0:	ae220008 	sw	v0,8(s1)
+    dca4:	8fb70058 	lw	s7,88(sp)
+    dca8:	00001021 	addu	v0,zero,zero
+    dcac:	8fb60054 	lw	s6,84(sp)
+    dcb0:	8fb50050 	lw	s5,80(sp)
+    dcb4:	8fb4004c 	lw	s4,76(sp)
+    dcb8:	8fb30048 	lw	s3,72(sp)
+    dcbc:	8fb20044 	lw	s2,68(sp)
+    dcc0:	8fb10040 	lw	s1,64(sp)
+    dcc4:	8fb0003c 	lw	s0,60(sp)
+    dcc8:	03e00008 	jr	ra
+    dccc:	27bd0060 	addiu	sp,sp,96
+    dcd0:	ae200000 	sw	zero,0(s1)
+    dcd4:	ae200004 	sw	zero,4(s1)
+    dcd8:	ae200008 	sw	zero,8(s1)
+    dcdc:	080036b6 	j	dad8 <radix_tree_remove_item+0x178>
+    dce0:	24070001 	addiu	a3,zero,1
+    dce4:	27a40010 	addiu	a0,sp,16
+    dce8:	afa50030 	sw	a1,48(sp)
+    dcec:	0c007134 	jal	1c4d0 <kmem_free>
+    dcf0:	afb0001c 	sw	s0,28(sp)
+    dcf4:	8e220000 	lw	v0,0(s1)
+    dcf8:	10500004 	beq	v0,s0,dd0c <radix_tree_remove_item+0x3ac>
+    dcfc:	8fa50030 	lw	a1,48(sp)
+    dd00:	8e260004 	lw	a2,4(s1)
+    dd04:	08003687 	j	da1c <radix_tree_remove_item+0xbc>
+    dd08:	24070001 	addiu	a3,zero,1
+    dd0c:	ae200000 	sw	zero,0(s1)
+    dd10:	ae200004 	sw	zero,4(s1)
+    dd14:	ae200008 	sw	zero,8(s1)
+    dd18:	00003021 	addu	a2,zero,zero
+    dd1c:	08003687 	j	da1c <radix_tree_remove_item+0xbc>
+    dd20:	24070001 	addiu	a3,zero,1
+
+0000dd24 <radix_tree_delete>:
+    dd24:	27bdffb8 	addiu	sp,sp,-72
+    dd28:	afb2003c 	sw	s2,60(sp)
+    dd2c:	27b20018 	addiu	s2,sp,24
+    dd30:	02403021 	addu	a2,s2,zero
+    dd34:	afb30040 	sw	s3,64(sp)
+    dd38:	afb10038 	sw	s1,56(sp)
+    dd3c:	afbf0044 	sw	ra,68(sp)
+    dd40:	afb00034 	sw	s0,52(sp)
+    dd44:	00809821 	addu	s3,a0,zero
+    dd48:	0c003283 	jal	ca0c <radix_item_info_lookup>
+    dd4c:	00a08821 	addu	s1,a1,zero
+    dd50:	10400012 	beqz	v0,dd9c <radix_tree_delete+0x78>
+    dd54:	8fa20024 	lw	v0,36(sp)
+    dd58:	8fa3001c 	lw	v1,28(sp)
+    dd5c:	00021080 	sll	v0,v0,0x2
+    dd60:	00621021 	addu	v0,v1,v0
+    dd64:	8c500000 	lw	s0,0(v0)
+    dd68:	12000015 	beqz	s0,ddc0 <radix_tree_delete+0x9c>
+    dd6c:	02602021 	addu	a0,s3,zero
+    dd70:	0c003658 	jal	d960 <radix_tree_remove_item>
+    dd74:	02402821 	addu	a1,s2,zero
+    dd78:	14400009 	bnez	v0,dda0 <radix_tree_delete+0x7c>
+    dd7c:	8fbf0044 	lw	ra,68(sp)
+    dd80:	02001021 	addu	v0,s0,zero
+    dd84:	8fb30040 	lw	s3,64(sp)
+    dd88:	8fb2003c 	lw	s2,60(sp)
+    dd8c:	8fb10038 	lw	s1,56(sp)
+    dd90:	8fb00034 	lw	s0,52(sp)
+    dd94:	03e00008 	jr	ra
+    dd98:	27bd0048 	addiu	sp,sp,72
+    dd9c:	8fbf0044 	lw	ra,68(sp)
+    dda0:	00008021 	addu	s0,zero,zero
+    dda4:	02001021 	addu	v0,s0,zero
+    dda8:	8fb30040 	lw	s3,64(sp)
+    ddac:	8fb2003c 	lw	s2,60(sp)
+    ddb0:	8fb10038 	lw	s1,56(sp)
+    ddb4:	8fb00034 	lw	s0,52(sp)
+    ddb8:	03e00008 	jr	ra
+    ddbc:	27bd0048 	addiu	sp,sp,72
+    ddc0:	3c020004 	lui	v0,0x4
+    ddc4:	8c449100 	lw	a0,-28416(v0)
+    ddc8:	3c060003 	lui	a2,0x3
+    ddcc:	3c070003 	lui	a3,0x3
+    ddd0:	24c657c8 	addiu	a2,a2,22472
+    ddd4:	24e75828 	addiu	a3,a3,22568
+    ddd8:	00002821 	addu	a1,zero,zero
+    dddc:	0c0009b0 	jal	26c0 <__fprintk>
+    dde0:	afb10010 	sw	s1,16(sp)
+    dde4:	08003760 	j	dd80 <radix_tree_delete+0x5c>
+    dde8:	8fbf0044 	lw	ra,68(sp)
+
+0000ddec <radix_item_info_apply>:
+    ddec:	27bdffe0 	addiu	sp,sp,-32
+    ddf0:	24020001 	addiu	v0,zero,1
+    ddf4:	afbf001c 	sw	ra,28(sp)
+    ddf8:	10c2001d 	beq	a2,v0,de70 <radix_item_info_apply+0x84>
+    ddfc:	00a01821 	addu	v1,a1,zero
+    de00:	10c00013 	beqz	a2,de50 <radix_item_info_apply+0x64>
+    de04:	8fbf001c 	lw	ra,28(sp)
+    de08:	24040002 	addiu	a0,zero,2
+    de0c:	10c4001b 	beq	a2,a0,de7c <radix_item_info_apply+0x90>
+    de10:	3c060003 	lui	a2,0x3
+    de14:	3c020004 	lui	v0,0x4
+    de18:	8ca30008 	lw	v1,8(a1)
+    de1c:	8c449100 	lw	a0,-28416(v0)
+    de20:	8ca2000c 	lw	v0,12(a1)
+    de24:	3c070003 	lui	a3,0x3
+    de28:	24c657f8 	addiu	a2,a2,22520
+    de2c:	24e7583c 	addiu	a3,a3,22588
+    de30:	00002821 	addu	a1,zero,zero
+    de34:	afa30010 	sw	v1,16(sp)
+    de38:	0c0009b0 	jal	26c0 <__fprintk>
+    de3c:	afa20014 	sw	v0,20(sp)
+    de40:	8fbf001c 	lw	ra,28(sp)
+    de44:	24020016 	addiu	v0,zero,22
+    de48:	03e00008 	jr	ra
+    de4c:	27bd0020 	addiu	sp,sp,32
+    de50:	8ca2000c 	lw	v0,12(a1)
+    de54:	8ca30004 	lw	v1,4(a1)
+    de58:	00021080 	sll	v0,v0,0x2
+    de5c:	00621021 	addu	v0,v1,v0
+    de60:	ac470000 	sw	a3,0(v0)
+    de64:	27bd0020 	addiu	sp,sp,32
+    de68:	03e00008 	jr	ra
+    de6c:	00001021 	addu	v0,zero,zero
+    de70:	8fbf001c 	lw	ra,28(sp)
+    de74:	08003658 	j	d960 <radix_tree_remove_item>
+    de78:	27bd0020 	addiu	sp,sp,32
+    de7c:	8ca40004 	lw	a0,4(a1)
+    de80:	8ca5000c 	lw	a1,12(a1)
+    de84:	8c860114 	lw	a2,276(a0)
+    de88:	00052880 	sll	a1,a1,0x2
+    de8c:	24c60001 	addiu	a2,a2,1
+    de90:	ac860114 	sw	a2,276(a0)
+    de94:	8c63000c 	lw	v1,12(v1)
+    de98:	00852821 	addu	a1,a0,a1
+    de9c:	00033142 	srl	a2,v1,0x5
+    dea0:	24c60042 	addiu	a2,a2,66
+    dea4:	00063080 	sll	a2,a2,0x2
+    dea8:	00862021 	addu	a0,a0,a2
+    deac:	8c860000 	lw	a2,0(a0)
+    deb0:	00621004 	sllv	v0,v0,v1
+    deb4:	8fbf001c 	lw	ra,28(sp)
+    deb8:	00461025 	or	v0,v0,a2
+    debc:	ac820000 	sw	v0,0(a0)
+    dec0:	aca70000 	sw	a3,0(a1)
+    dec4:	00001021 	addu	v0,zero,zero
+    dec8:	03e00008 	jr	ra
+    decc:	27bd0020 	addiu	sp,sp,32
+
+0000ded0 <item_get_base>:
+    ded0:	8c8200c4 	lw	v0,196(a0)
+    ded4:	248400cc 	addiu	a0,a0,204
+    ded8:	70a21802 	mul	v1,a1,v0
+    dedc:	03e00008 	jr	ra
+    dee0:	00641021 	addu	v0,v1,a0
+
+0000dee4 <item_get_base_remote>:
+    dee4:	30a5ffff 	andi	a1,a1,0xffff
+    dee8:	2ca30101 	sltiu	v1,a1,257
+    deec:	14600003 	bnez	v1,defc <item_get_base_remote+0x18>
+    def0:	00051100 	sll	v0,a1,0x4
+    def4:	080037bd 	j	def4 <item_get_base_remote+0x10>
+    def8:	00000000 	sll	zero,zero,0x0
+    defc:	00052880 	sll	a1,a1,0x2
+    df00:	00452823 	subu	a1,v0,a1
+    df04:	3c020004 	lui	v0,0x4
+    df08:	2442c9a0 	addiu	v0,v0,-13920
+    df0c:	00451021 	addu	v0,v0,a1
+    df10:	8c430000 	lw	v1,0(v0)
+    df14:	3c025555 	lui	v0,0x5555
+    df18:	34425555 	ori	v0,v0,0x5555
+    df1c:	1062fff5 	beq	v1,v0,def4 <item_get_base_remote+0x10>
+    df20:	00000000 	sll	zero,zero,0x0
+    df24:	248500cc 	addiu	a1,a0,204
+    df28:	4808c000 	mfc2	t0,$24
+    df2c:	4883c000 	mtc2	v1,$24
+    df30:	8ca50000 	lw	a1,0(a1)
+    df34:	4888c000 	mtc2	t0,$24
+    df38:	248200c4 	addiu	v0,a0,196
+    df3c:	4808c000 	mfc2	t0,$24
+    df40:	4883c000 	mtc2	v1,$24
+    df44:	8c420000 	lw	v0,0(v0)
+    df48:	4888c000 	mtc2	t0,$24
+    df4c:	70461802 	mul	v1,v0,a2
+    df50:	03e00008 	jr	ra
+    df54:	00651021 	addu	v0,v1,a1
+
+0000df58 <rf_get_index>:
+    df58:	8c8300c4 	lw	v1,196(a0)
+    df5c:	248400cc 	addiu	a0,a0,204
+    df60:	00a42023 	subu	a0,a1,a0
+    df64:	0083001b 	divu	zero,a0,v1
+    df68:	006001f4 	teq	v1,zero,0x7
+    df6c:	03e00008 	jr	ra
+    df70:	00001012 	mflo	v0
+
+0000df74 <remote_fifo_get>:
+    df74:	8c820080 	lw	v0,128(a0)
+    df78:	8c830000 	lw	v1,0(a0)
+    df7c:	10430016 	beq	v0,v1,dfd8 <remote_fifo_get+0x64>
+    df80:	8c8600c0 	lw	a2,192(a0)
+    df84:	0046001b 	divu	zero,v0,a2
+    df88:	00c001f4 	teq	a2,zero,0x7
+    df8c:	8c870080 	lw	a3,128(a0)
+    df90:	8c8600c4 	lw	a2,196(a0)
+    df94:	24e70001 	addiu	a3,a3,1
+    df98:	248200cc 	addiu	v0,a0,204
+    df9c:	ac870080 	sw	a3,128(a0)
+    dfa0:	00001810 	mfhi	v1
+    dfa4:	70662002 	mul	a0,v1,a2
+    dfa8:	00821821 	addu	v1,a0,v0
+    dfac:	24620002 	addiu	v0,v1,2
+    dfb0:	aca20000 	sw	v0,0(a1)
+    dfb4:	90620000 	lbu	v0,0(v1)
+    dfb8:	14400005 	bnez	v0,dfd0 <remote_fifo_get+0x5c>
+    dfbc:	00000000 	sll	zero,zero,0x0
+    dfc0:	0000000f 	sync
+    dfc4:	90640000 	lbu	a0,0(v1)
+    dfc8:	1080fffd 	beqz	a0,dfc0 <remote_fifo_get+0x4c>
+    dfcc:	00000000 	sll	zero,zero,0x0
+    dfd0:	03e00008 	jr	ra
+    dfd4:	00001021 	addu	v0,zero,zero
+    dfd8:	03e00008 	jr	ra
+    dfdc:	2402000b 	addiu	v0,zero,11
+
+0000dfe0 <remote_fifo_release>:
+    dfe0:	8c830080 	lw	v1,128(a0)
+    dfe4:	24a2fffe 	addiu	v0,a1,-2
+    dfe8:	8c830040 	lw	v1,64(a0)
+    dfec:	24030001 	addiu	v1,zero,1
+    dff0:	a0430001 	sb	v1,1(v0)
+    dff4:	a0a0fffe 	sb	zero,-2(a1)
+    dff8:	0000000f 	sync
+    dffc:	8c820040 	lw	v0,64(a0)
+    e000:	24420001 	addiu	v0,v0,1
+    e004:	ac820040 	sw	v0,64(a0)
+    e008:	0000000f 	sync
+    e00c:	03e00008 	jr	ra
+    e010:	00000000 	sll	zero,zero,0x0
+
+0000e014 <remote_fifo_destroy>:
+    e014:	03e00008 	jr	ra
+    e018:	00000000 	sll	zero,zero,0x0
+
+0000e01c <remote_fifo_init>:
+    e01c:	24c20002 	addiu	v0,a2,2
+    e020:	27bdffe8 	addiu	sp,sp,-24
+    e024:	3043003f 	andi	v1,v0,0x3f
+    e028:	10600004 	beqz	v1,e03c <remote_fifo_init+0x20>
+    e02c:	afbf0014 	sw	ra,20(sp)
+    e030:	2403ffc0 	addiu	v1,zero,-64
+    e034:	00431024 	and	v0,v0,v1
+    e038:	24420040 	addiu	v0,v0,64
+    e03c:	24030040 	addiu	v1,zero,64
+    e040:	10430009 	beq	v0,v1,e068 <remote_fifo_init+0x4c>
+    e044:	3c070003 	lui	a3,0x3
+    e048:	3c050003 	lui	a1,0x3
+    e04c:	24a55854 	addiu	a1,a1,22612
+    e050:	24e758a0 	addiu	a3,a3,22688
+    e054:	24040001 	addiu	a0,zero,1
+    e058:	0c00097d 	jal	25f4 <__perror>
+    e05c:	24060117 	addiu	a2,zero,279
+    e060:	08003818 	j	e060 <remote_fifo_init+0x44>
+    e064:	00000000 	sll	zero,zero,0x0
+    e068:	ac800000 	sw	zero,0(a0)
+    e06c:	ac800080 	sw	zero,128(a0)
+    e070:	ac800040 	sw	zero,64(a0)
+    e074:	8fbf0014 	lw	ra,20(sp)
+    e078:	ac8200c4 	sw	v0,196(a0)
+    e07c:	ac8600c8 	sw	a2,200(a0)
+    e080:	00001021 	addu	v0,zero,zero
+    e084:	ac8500c0 	sw	a1,192(a0)
+    e088:	03e00008 	jr	ra
+    e08c:	27bd0018 	addiu	sp,sp,24
+
+0000e090 <backoff>:
+    e090:	27bdffe8 	addiu	sp,sp,-24
+    e094:	afbf0014 	sw	ra,20(sp)
+    e098:	afb00010 	sw	s0,16(sp)
+    e09c:	40037801 	mfc0	v1,$15,1
+    e0a0:	3c020004 	lui	v0,0x4
+    e0a4:	30630003 	andi	v1,v1,0x3
+    e0a8:	00031880 	sll	v1,v1,0x2
+    e0ac:	2442c950 	addiu	v0,v0,-14000
+    e0b0:	00621021 	addu	v0,v1,v0
+    e0b4:	8c500000 	lw	s0,0(v0)
+    e0b8:	00108040 	sll	s0,s0,0x1
+    e0bc:	1600000d 	bnez	s0,e0f4 <backoff+0x64>
+    e0c0:	2610ffff 	addiu	s0,s0,-1
+    e0c4:	08003851 	j	e144 <backoff+0xb4>
+    e0c8:	8fbf0014 	lw	ra,20(sp)
+    e0cc:	40032002 	mfc0	v1,$4,2
+    e0d0:	8c63014c 	lw	v1,332(v1)
+    e0d4:	00431023 	subu	v0,v0,v1
+    e0d8:	2c4207d1 	sltiu	v0,v0,2001
+    e0dc:	10400013 	beqz	v0,e12c <backoff+0x9c>
+    e0e0:	00000000 	sll	zero,zero,0x0
+    e0e4:	0000000f 	sync
+    e0e8:	12000016 	beqz	s0,e144 <backoff+0xb4>
+    e0ec:	8fbf0014 	lw	ra,20(sp)
+    e0f0:	2610ffff 	addiu	s0,s0,-1
+    e0f4:	40024800 	mfc0	v0,c0_count
+    e0f8:	00000000 	sll	zero,zero,0x0
+    e0fc:	40032002 	mfc0	v1,$4,2
+    e100:	8c63014c 	lw	v1,332(v1)
+    e104:	0043182b 	sltu	v1,v0,v1
+    e108:	1060fff0 	beqz	v1,e0cc <backoff+0x3c>
+    e10c:	00000000 	sll	zero,zero,0x0
+    e110:	40032002 	mfc0	v1,$4,2
+    e114:	8c63014c 	lw	v1,332(v1)
+    e118:	00031827 	nor	v1,zero,v1
+    e11c:	00431021 	addu	v0,v0,v1
+    e120:	2c4207d1 	sltiu	v0,v0,2001
+    e124:	1440ffef 	bnez	v0,e0e4 <backoff+0x54>
+    e128:	00000000 	sll	zero,zero,0x0
+    e12c:	0c002083 	jal	820c <__cpu_check_sched>
+    e130:	40042002 	mfc0	a0,$4,2
+    e134:	0000000f 	sync
+    e138:	1600ffee 	bnez	s0,e0f4 <backoff+0x64>
+    e13c:	2610ffff 	addiu	s0,s0,-1
+    e140:	8fbf0014 	lw	ra,20(sp)
+    e144:	8fb00010 	lw	s0,16(sp)
+    e148:	03e00008 	jr	ra
+    e14c:	27bd0018 	addiu	sp,sp,24
+
+0000e150 <item_set>:
+    e150:	27bdffe0 	addiu	sp,sp,-32
+    e154:	afbf001c 	sw	ra,28(sp)
+    e158:	afb00018 	sw	s0,24(sp)
+    e15c:	00c01821 	addu	v1,a2,zero
+    e160:	30a5ffff 	andi	a1,a1,0xffff
+    e164:	40016000 	mfc0	at,c0_status
+    e168:	00000000 	sll	zero,zero,0x0
+    e16c:	00013025 	or	a2,zero,at
+    e170:	00010842 	srl	at,at,0x1
+    e174:	00010840 	sll	at,at,0x1
+    e178:	40816000 	mtc0	at,c0_status
+    e17c:	40022002 	mfc0	v0,$4,2
+    e180:	8c48013c 	lw	t0,316(v0)
+    e184:	25080001 	addiu	t0,t0,1
+    e188:	ac48013c 	sw	t0,316(v0)
+    e18c:	40016000 	mfc0	at,c0_status
+    e190:	340200ff 	ori	v0,zero,0xff
+    e194:	00461024 	and	v0,v0,a2
+    e198:	00220825 	or	at,at,v0
+    e19c:	40816000 	mtc0	at,c0_status
+    e1a0:	8c8600c4 	lw	a2,196(a0)
+    e1a4:	248200cc 	addiu	v0,a0,204
+    e1a8:	70e64002 	mul	t0,a3,a2
+    e1ac:	8c8600c8 	lw	a2,200(a0)
+    e1b0:	01023821 	addu	a3,t0,v0
+    e1b4:	2ca20101 	sltiu	v0,a1,257
+    e1b8:	14400003 	bnez	v0,e1c8 <item_set+0x78>
+    e1bc:	24ec0001 	addiu	t4,a3,1
+    e1c0:	08003870 	j	e1c0 <item_set+0x70>
+    e1c4:	00000000 	sll	zero,zero,0x0
+    e1c8:	00051080 	sll	v0,a1,0x2
+    e1cc:	00058100 	sll	s0,a1,0x4
+    e1d0:	3c0a0004 	lui	t2,0x4
+    e1d4:	02028023 	subu	s0,s0,v0
+    e1d8:	254ac9a0 	addiu	t2,t2,-13920
+    e1dc:	01508021 	addu	s0,t2,s0
+    e1e0:	3c095555 	lui	t1,0x5555
+    e1e4:	8e020000 	lw	v0,0(s0)
+    e1e8:	35295555 	ori	t1,t1,0x5555
+    e1ec:	1049fff4 	beq	v0,t1,e1c0 <item_set+0x70>
+    e1f0:	24e40002 	addiu	a0,a3,2
+    e1f4:	00005821 	addu	t3,zero,zero
+    e1f8:	4808c000 	mfc2	t0,$24
+    e1fc:	4882c000 	mtc2	v0,$24
+    e200:	a18b0000 	sb	t3,0(t4)
+    e204:	4888c000 	mtc2	t0,$24
+    e208:	3c0b0004 	lui	t3,0x4
+    e20c:	2568c960 	addiu	t0,t3,-13984
+    e210:	89080003 	lwl	t0,3(t0)
+    e214:	9968c960 	lwr	t0,-13984(t3)
+    e218:	3108ffff 	andi	t0,t0,0xffff
+    e21c:	10a8002c 	beq	a1,t0,e2d0 <item_set+0x180>
+    e220:	2d050101 	sltiu	a1,t0,257
+    e224:	10a0004d 	beqz	a1,e35c <item_set+0x20c>
+    e228:	00082900 	sll	a1,t0,0x4
+    e22c:	00084080 	sll	t0,t0,0x2
+    e230:	00a84023 	subu	t0,a1,t0
+    e234:	01485021 	addu	t2,t2,t0
+    e238:	8d4b0000 	lw	t3,0(t2)
+    e23c:	11690047 	beq	t3,t1,e35c <item_set+0x20c>
+    e240:	00642825 	or	a1,v1,a0
+    e244:	30a50003 	andi	a1,a1,0x3
+    e248:	10a00046 	beqz	a1,e364 <item_set+0x214>
+    e24c:	00000000 	sll	zero,zero,0x0
+    e250:	00002821 	addu	a1,zero,zero
+    e254:	00006021 	addu	t4,zero,zero
+    e258:	080038a1 	j	e284 <item_set+0x134>
+    e25c:	00005021 	addu	t2,zero,zero
+    e260:	008d7021 	addu	t6,a0,t5
+    e264:	006d6821 	addu	t5,v1,t5
+    e268:	4808c000 	mfc2	t0,$24
+    e26c:	488bc000 	mtc2	t3,$24
+    e270:	8da90000 	lw	t1,0(t5)
+    e274:	4882c000 	mtc2	v0,$24
+    e278:	adc90000 	sw	t1,0(t6)
+    e27c:	4888c000 	mtc2	t0,$24
+    e280:	254a0001 	addiu	t2,t2,1
+    e284:	154cfff6 	bne	t2,t4,e260 <item_set+0x110>
+    e288:	000a6880 	sll	t5,t2,0x2
+    e28c:	00651821 	addu	v1,v1,a1
+    e290:	080038af 	j	e2bc <item_set+0x16c>
+    e294:	00852021 	addu	a0,a0,a1
+    e298:	4808c000 	mfc2	t0,$24
+    e29c:	488bc000 	mtc2	t3,$24
+    e2a0:	80690000 	lb	t1,0(v1)
+    e2a4:	4882c000 	mtc2	v0,$24
+    e2a8:	a0890000 	sb	t1,0(a0)
+    e2ac:	4888c000 	mtc2	t0,$24
+    e2b0:	24a50001 	addiu	a1,a1,1
+    e2b4:	24630001 	addiu	v1,v1,1
+    e2b8:	24840001 	addiu	a0,a0,1
+    e2bc:	00a6402b 	sltu	t0,a1,a2
+    e2c0:	1500fff5 	bnez	t0,e298 <item_set+0x148>
+    e2c4:	00000000 	sll	zero,zero,0x0
+    e2c8:	080038b9 	j	e2e4 <item_set+0x194>
+    e2cc:	00000000 	sll	zero,zero,0x0
+    e2d0:	00602821 	addu	a1,v1,zero
+    e2d4:	0c00c12b 	jal	304ac <memcpy>
+    e2d8:	afa70010 	sw	a3,16(sp)
+    e2dc:	8e020000 	lw	v0,0(s0)
+    e2e0:	8fa70010 	lw	a3,16(sp)
+    e2e4:	0000000f 	sync
+    e2e8:	3c035555 	lui	v1,0x5555
+    e2ec:	34635555 	ori	v1,v1,0x5555
+    e2f0:	10430018 	beq	v0,v1,e354 <item_set+0x204>
+    e2f4:	24030001 	addiu	v1,zero,1
+    e2f8:	4808c000 	mfc2	t0,$24
+    e2fc:	4882c000 	mtc2	v0,$24
+    e300:	a0e30000 	sb	v1,0(a3)
+    e304:	4888c000 	mtc2	t0,$24
+    e308:	40016000 	mfc0	at,c0_status
+    e30c:	00000000 	sll	zero,zero,0x0
+    e310:	00011825 	or	v1,zero,at
+    e314:	00010842 	srl	at,at,0x1
+    e318:	00010840 	sll	at,at,0x1
+    e31c:	40816000 	mtc0	at,c0_status
+    e320:	40022002 	mfc0	v0,$4,2
+    e324:	8c44013c 	lw	a0,316(v0)
+    e328:	2484ffff 	addiu	a0,a0,-1
+    e32c:	ac44013c 	sw	a0,316(v0)
+    e330:	40016000 	mfc0	at,c0_status
+    e334:	340200ff 	ori	v0,zero,0xff
+    e338:	00431024 	and	v0,v0,v1
+    e33c:	00220825 	or	at,at,v0
+    e340:	40816000 	mtc0	at,c0_status
+    e344:	8fbf001c 	lw	ra,28(sp)
+    e348:	8fb00018 	lw	s0,24(sp)
+    e34c:	03e00008 	jr	ra
+    e350:	27bd0020 	addiu	sp,sp,32
+    e354:	080038d5 	j	e354 <item_set+0x204>
+    e358:	00000000 	sll	zero,zero,0x0
+    e35c:	080038d7 	j	e35c <item_set+0x20c>
+    e360:	00000000 	sll	zero,zero,0x0
+    e364:	00066082 	srl	t4,a2,0x2
+    e368:	08003896 	j	e258 <item_set+0x108>
+    e36c:	000c2880 	sll	a1,t4,0x2
+
+0000e370 <remote_fifo_put>:
+    e370:	27bdffb8 	addiu	sp,sp,-72
+    e374:	30a5ffff 	andi	a1,a1,0xffff
+    e378:	afa00010 	sw	zero,16(sp)
+    e37c:	2ca20101 	sltiu	v0,a1,257
+    e380:	afb40034 	sw	s4,52(sp)
+    e384:	afb2002c 	sw	s2,44(sp)
+    e388:	afb00024 	sw	s0,36(sp)
+    e38c:	afbf0044 	sw	ra,68(sp)
+    e390:	afb70040 	sw	s7,64(sp)
+    e394:	afb6003c 	sw	s6,60(sp)
+    e398:	afb50038 	sw	s5,56(sp)
+    e39c:	afb30030 	sw	s3,48(sp)
+    e3a0:	afb10028 	sw	s1,40(sp)
+    e3a4:	00808021 	addu	s0,a0,zero
+    e3a8:	00e0a021 	addu	s4,a3,zero
+    e3ac:	14400003 	bnez	v0,e3bc <remote_fifo_put+0x4c>
+    e3b0:	8c9200c0 	lw	s2,192(a0)
+    e3b4:	080038ed 	j	e3b4 <remote_fifo_put+0x44>
+    e3b8:	00000000 	sll	zero,zero,0x0
+    e3bc:	00059900 	sll	s3,a1,0x4
+    e3c0:	00051080 	sll	v0,a1,0x2
+    e3c4:	02621023 	subu	v0,s3,v0
+    e3c8:	3c130004 	lui	s3,0x4
+    e3cc:	2673c9a0 	addiu	s3,s3,-13920
+    e3d0:	02629821 	addu	s3,s3,v0
+    e3d4:	3c175555 	lui	s7,0x5555
+    e3d8:	8e620000 	lw	v0,0(s3)
+    e3dc:	36f75555 	ori	s7,s7,0x5555
+    e3e0:	1057fff4 	beq	v0,s7,e3b4 <remote_fifo_put+0x44>
+    e3e4:	00000000 	sll	zero,zero,0x0
+    e3e8:	24040001 	addiu	a0,zero,1
+    e3ec:	4809c000 	mfc2	t1,$24
+    e3f0:	4882c000 	mtc2	v0,$24
+    e3f4:	c2110000 	ll	s1,0(s0)
+    e3f8:	02241821 	addu	v1,s1,a0
+    e3fc:	e2030000 	sc	v1,0(s0)
+    e400:	1060fffc 	beqz	v1,e3f4 <remote_fifo_put+0x84>
+    e404:	00000000 	sll	zero,zero,0x0
+    e408:	4889c000 	mtc2	t1,$24
+    e40c:	26160040 	addiu	s6,s0,64
+    e410:	08003915 	j	e454 <remote_fifo_put+0xe4>
+    e414:	2655ffff 	addiu	s5,s2,-1
+    e418:	02221023 	subu	v0,s1,v0
+    e41c:	afa20010 	sw	v0,16(sp)
+    e420:	8fa20010 	lw	v0,16(sp)
+    e424:	0055102b 	sltu	v0,v0,s5
+    e428:	14400013 	bnez	v0,e478 <remote_fifo_put+0x108>
+    e42c:	00000000 	sll	zero,zero,0x0
+    e430:	8fa40010 	lw	a0,16(sp)
+    e434:	afa50018 	sw	a1,24(sp)
+    e438:	00922023 	subu	a0,a0,s2
+    e43c:	0c003824 	jal	e090 <backoff>
+    e440:	afa6001c 	sw	a2,28(sp)
+    e444:	8e620000 	lw	v0,0(s3)
+    e448:	8fa50018 	lw	a1,24(sp)
+    e44c:	1057001e 	beq	v0,s7,e4c8 <remote_fifo_put+0x158>
+    e450:	8fa6001c 	lw	a2,28(sp)
+    e454:	4808c000 	mfc2	t0,$24
+    e458:	4882c000 	mtc2	v0,$24
+    e45c:	8ec20000 	lw	v0,0(s6)
+    e460:	4888c000 	mtc2	t0,$24
+    e464:	0222202b 	sltu	a0,s1,v0
+    e468:	1080ffeb 	beqz	a0,e418 <remote_fifo_put+0xa8>
+    e46c:	00021827 	nor	v1,zero,v0
+    e470:	08003907 	j	e41c <remote_fifo_put+0xac>
+    e474:	00711021 	addu	v0,v1,s1
+    e478:	0232001b 	divu	zero,s1,s2
+    e47c:	024001f4 	teq	s2,zero,0x7
+    e480:	8fa20010 	lw	v0,16(sp)
+    e484:	02002021 	addu	a0,s0,zero
+    e488:	ae820000 	sw	v0,0(s4)
+    e48c:	0c003854 	jal	e150 <item_set>
+    e490:	00003810 	mfhi	a3
+    e494:	0000000f 	sync
+    e498:	8fbf0044 	lw	ra,68(sp)
+    e49c:	00001021 	addu	v0,zero,zero
+    e4a0:	8fb70040 	lw	s7,64(sp)
+    e4a4:	8fb6003c 	lw	s6,60(sp)
+    e4a8:	8fb50038 	lw	s5,56(sp)
+    e4ac:	8fb40034 	lw	s4,52(sp)
+    e4b0:	8fb30030 	lw	s3,48(sp)
+    e4b4:	8fb2002c 	lw	s2,44(sp)
+    e4b8:	8fb10028 	lw	s1,40(sp)
+    e4bc:	8fb00024 	lw	s0,36(sp)
+    e4c0:	03e00008 	jr	ra
+    e4c4:	27bd0048 	addiu	sp,sp,72
+    e4c8:	08003932 	j	e4c8 <remote_fifo_put+0x158>
+    e4cc:	00000000 	sll	zero,zero,0x0
+    e4d0:	8c820020 	lw	v0,32(a0)
+    e4d4:	03e00008 	jr	ra
+    e4d8:	0002102b 	sltu	v0,zero,v0
+
+0000e4dc <rpc_exec>:
+    e4dc:	27bdffe8 	addiu	sp,sp,-24
+    e4e0:	8c820018 	lw	v0,24(a0)
+    e4e4:	afbf0014 	sw	ra,20(sp)
+    e4e8:	0040f809 	jalr	v0
+    e4ec:	00000000 	sll	zero,zero,0x0
+    e4f0:	8fbf0014 	lw	ra,20(sp)
+    e4f4:	00001021 	addu	v0,zero,zero
+    e4f8:	03e00008 	jr	ra
+    e4fc:	27bd0018 	addiu	sp,sp,24
+
+0000e500 <rpc_listner_check_new>:
+    e500:	3c020004 	lui	v0,0x4
+    e504:	2443c960 	addiu	v1,v0,-13984
+    e508:	88630003 	lwl	v1,3(v1)
+    e50c:	9843c960 	lwr	v1,-13984(v0)
+    e510:	3063ffff 	andi	v1,v1,0xffff
+    e514:	00031080 	sll	v0,v1,0x2
+    e518:	00032900 	sll	a1,v1,0x4
+    e51c:	00a22823 	subu	a1,a1,v0
+    e520:	3c020004 	lui	v0,0x4
+    e524:	2442c9a0 	addiu	v0,v0,-13920
+    e528:	2c630101 	sltiu	v1,v1,257
+    e52c:	00451021 	addu	v0,v0,a1
+    e530:	1060001d 	beqz	v1,e5a8 <rpc_listner_check_new+0xa8>
+    e534:	248500c8 	addiu	a1,a0,200
+    e538:	3c035555 	lui	v1,0x5555
+    e53c:	8c420000 	lw	v0,0(v0)
+    e540:	34635555 	ori	v1,v1,0x5555
+    e544:	10430018 	beq	v0,v1,e5a8 <rpc_listner_check_new+0xa8>
+    e548:	00000000 	sll	zero,zero,0x0
+    e54c:	4808c000 	mfc2	t0,$24
+    e550:	4882c000 	mtc2	v0,$24
+    e554:	8ca50000 	lw	a1,0(a1)
+    e558:	4888c000 	mtc2	t0,$24
+    e55c:	24830048 	addiu	v1,a0,72
+    e560:	4808c000 	mfc2	t0,$24
+    e564:	4882c000 	mtc2	v0,$24
+    e568:	8c630000 	lw	v1,0(v1)
+    e56c:	4888c000 	mtc2	t0,$24
+    e570:	14a3000f 	bne	a1,v1,e5b0 <rpc_listner_check_new+0xb0>
+    e574:	24834194 	addiu	v1,a0,16788
+    e578:	4808c000 	mfc2	t0,$24
+    e57c:	4882c000 	mtc2	v0,$24
+    e580:	8c630000 	lw	v1,0(v1)
+    e584:	4888c000 	mtc2	t0,$24
+    e588:	24844114 	addiu	a0,a0,16660
+    e58c:	4808c000 	mfc2	t0,$24
+    e590:	4882c000 	mtc2	v0,$24
+    e594:	8c820000 	lw	v0,0(a0)
+    e598:	4888c000 	mtc2	t0,$24
+    e59c:	00621026 	xor	v0,v1,v0
+    e5a0:	03e00008 	jr	ra
+    e5a4:	0002102b 	sltu	v0,zero,v0
+    e5a8:	0800396a 	j	e5a8 <rpc_listner_check_new+0xa8>
+    e5ac:	00000000 	sll	zero,zero,0x0
+    e5b0:	03e00008 	jr	ra
+    e5b4:	24020001 	addiu	v0,zero,1
+
+0000e5b8 <rpc_after_wakeup>:
+    e5b8:	8c830174 	lw	v1,372(a0)
+    e5bc:	3c020001 	lui	v0,0x1
+    e5c0:	00621021 	addu	v0,v1,v0
+    e5c4:	8c4382d0 	lw	v1,-32048(v0)
+    e5c8:	24630001 	addiu	v1,v1,1
+    e5cc:	03e00008 	jr	ra
+    e5d0:	ac4382d0 	sw	v1,-32048(v0)
+
+0000e5d4 <rpc_manager_init>:
+    e5d4:	340282c8 	ori	v0,zero,0x82c8
+    e5d8:	3c030001 	lui	v1,0x1
+    e5dc:	00821021 	addu	v0,a0,v0
+    e5e0:	00832021 	addu	a0,a0,v1
+    e5e4:	ac8282cc 	sw	v0,-32052(a0)
+    e5e8:	ac8082d4 	sw	zero,-32044(a0)
+    e5ec:	ac8082d0 	sw	zero,-32048(a0)
+    e5f0:	03e00008 	jr	ra
+    e5f4:	ac8282c8 	sw	v0,-32056(a0)
+
+0000e5f8 <__increment_local>:
+    e5f8:	40027801 	mfc0	v0,$15,1
+    e5fc:	8ca20000 	lw	v0,0(a1)
+    e600:	24420001 	addiu	v0,v0,1
+    e604:	03e00008 	jr	ra
+    e608:	ac820000 	sw	v0,0(a0)
+
+0000e60c <__increment_main>:
+    e60c:	24e70001 	addiu	a3,a3,1
+    e610:	03e00008 	jr	ra
+    e614:	acc70000 	sw	a3,0(a2)
+
+0000e618 <__rpc_test>:
+    e618:	27bdffd8 	addiu	sp,sp,-40
+    e61c:	afb1001c 	sw	s1,28(sp)
+    e620:	3c110003 	lui	s1,0x3
+    e624:	afb20020 	sw	s2,32(sp)
+    e628:	afb00018 	sw	s0,24(sp)
+    e62c:	afbf0024 	sw	ra,36(sp)
+    e630:	26315b2c 	addiu	s1,s1,23340
+    e634:	00008021 	addu	s0,zero,zero
+    e638:	24120004 	addiu	s2,zero,4
+    e63c:	8e220000 	lw	v0,0(s1)
+    e640:	0040f809 	jalr	v0
+    e644:	02002021 	addu	a0,s0,zero
+    e648:	1440000b 	bnez	v0,e678 <__rpc_test+0x60>
+    e64c:	00000000 	sll	zero,zero,0x0
+    e650:	26100001 	addiu	s0,s0,1
+    e654:	1612fff9 	bne	s0,s2,e63c <__rpc_test+0x24>
+    e658:	26310004 	addiu	s1,s1,4
+    e65c:	8fbf0024 	lw	ra,36(sp)
+    e660:	00001021 	addu	v0,zero,zero
+    e664:	8fb20020 	lw	s2,32(sp)
+    e668:	8fb1001c 	lw	s1,28(sp)
+    e66c:	8fb00018 	lw	s0,24(sp)
+    e670:	03e00008 	jr	ra
+    e674:	27bd0028 	addiu	sp,sp,40
+    e678:	40037801 	mfc0	v1,$15,1
+    e67c:	3c020004 	lui	v0,0x4
+    e680:	30630003 	andi	v1,v1,0x3
+    e684:	00031880 	sll	v1,v1,0x2
+    e688:	2442c950 	addiu	v0,v0,-14000
+    e68c:	00621021 	addu	v0,v1,v0
+    e690:	3c030004 	lui	v1,0x4
+    e694:	8c470000 	lw	a3,0(v0)
+    e698:	8c649100 	lw	a0,-28416(v1)
+    e69c:	3c060003 	lui	a2,0x3
+    e6a0:	24c658b4 	addiu	a2,a2,22708
+    e6a4:	00002821 	addu	a1,zero,zero
+    e6a8:	0c0009b0 	jal	26c0 <__fprintk>
+    e6ac:	afb00010 	sw	s0,16(sp)
+    e6b0:	8fbf0024 	lw	ra,36(sp)
+    e6b4:	00001021 	addu	v0,zero,zero
+    e6b8:	8fb20020 	lw	s2,32(sp)
+    e6bc:	8fb1001c 	lw	s1,28(sp)
+    e6c0:	8fb00018 	lw	s0,24(sp)
+    e6c4:	03e00008 	jr	ra
+    e6c8:	27bd0028 	addiu	sp,sp,40
+
+0000e6cc <rpc_test>:
+    e6cc:	40027801 	mfc0	v0,$15,1
+    e6d0:	3c030004 	lui	v1,0x4
+    e6d4:	30420003 	andi	v0,v0,0x3
+    e6d8:	00021080 	sll	v0,v0,0x2
+    e6dc:	2463c950 	addiu	v1,v1,-14000
+    e6e0:	00431021 	addu	v0,v0,v1
+    e6e4:	8c420000 	lw	v0,0(v0)
+    e6e8:	10400003 	beqz	v0,e6f8 <rpc_test+0x2c>
+    e6ec:	00000000 	sll	zero,zero,0x0
+    e6f0:	03e00008 	jr	ra
+    e6f4:	00000000 	sll	zero,zero,0x0
+    e6f8:	08003986 	j	e618 <__rpc_test>
+    e6fc:	00000000 	sll	zero,zero,0x0
+
+0000e700 <rpc_print>:
+    e700:	27bdffd0 	addiu	sp,sp,-48
+    e704:	afb00024 	sw	s0,36(sp)
+    e708:	afbf002c 	sw	ra,44(sp)
+    e70c:	afb10028 	sw	s1,40(sp)
+    e710:	00808021 	addu	s0,a0,zero
+    e714:	40052002 	mfc0	a1,$4,2
+    e718:	3c020004 	lui	v0,0x4
+    e71c:	2443c960 	addiu	v1,v0,-13984
+    e720:	88630003 	lwl	v1,3(v1)
+    e724:	3c110004 	lui	s1,0x4
+    e728:	9843c960 	lwr	v1,-13984(v0)
+    e72c:	8e249100 	lw	a0,-28416(s1)
+    e730:	3063ffff 	andi	v1,v1,0xffff
+    e734:	afa30010 	sw	v1,16(sp)
+    e738:	8ca20174 	lw	v0,372(a1)
+    e73c:	3c060003 	lui	a2,0x3
+    e740:	8c420000 	lw	v0,0(v0)
+    e744:	02003821 	addu	a3,s0,zero
+    e748:	24c658dc 	addiu	a2,a2,22748
+    e74c:	00002821 	addu	a1,zero,zero
+    e750:	0c0009b0 	jal	26c0 <__fprintk>
+    e754:	afa20014 	sw	v0,20(sp)
+    e758:	8e070000 	lw	a3,0(s0)
+    e75c:	8e020008 	lw	v0,8(s0)
+    e760:	8e090004 	lw	t1,4(s0)
+    e764:	8e080014 	lw	t0,20(s0)
+    e768:	9203001c 	lbu	v1,28(s0)
+    e76c:	8e249100 	lw	a0,-28416(s1)
+    e770:	3c060003 	lui	a2,0x3
+    e774:	24c65914 	addiu	a2,a2,22804
+    e778:	00002821 	addu	a1,zero,zero
+    e77c:	afa90010 	sw	t1,16(sp)
+    e780:	afa80014 	sw	t0,20(sp)
+    e784:	afa30018 	sw	v1,24(sp)
+    e788:	0c0009b0 	jal	26c0 <__fprintk>
+    e78c:	afa2001c 	sw	v0,28(sp)
+    e790:	8fbf002c 	lw	ra,44(sp)
+    e794:	8fb10028 	lw	s1,40(sp)
+    e798:	8fb00024 	lw	s0,36(sp)
+    e79c:	03e00008 	jr	ra
+    e7a0:	27bd0030 	addiu	sp,sp,48
+
+0000e7a4 <rpc_get_arg>:
+    e7a4:	27bdffe8 	addiu	sp,sp,-24
+    e7a8:	afb00010 	sw	s0,16(sp)
+    e7ac:	afbf0014 	sw	ra,20(sp)
+    e7b0:	9082001c 	lbu	v0,28(a0)
+    e7b4:	00a2182b 	sltu	v1,a1,v0
+    e7b8:	1460000c 	bnez	v1,e7ec <rpc_get_arg+0x48>
+    e7bc:	00808021 	addu	s0,a0,zero
+    e7c0:	3c020004 	lui	v0,0x4
+    e7c4:	8c449100 	lw	a0,-28416(v0)
+    e7c8:	3c060003 	lui	a2,0x3
+    e7cc:	00a03821 	addu	a3,a1,zero
+    e7d0:	24c6594c 	addiu	a2,a2,22860
+    e7d4:	0c0009b0 	jal	26c0 <__fprintk>
+    e7d8:	00002821 	addu	a1,zero,zero
+    e7dc:	0c0039c0 	jal	e700 <rpc_print>
+    e7e0:	02002021 	addu	a0,s0,zero
+    e7e4:	080039f9 	j	e7e4 <rpc_get_arg+0x40>
+    e7e8:	00000000 	sll	zero,zero,0x0
+    e7ec:	24830024 	addiu	v1,a0,36
+    e7f0:	00052080 	sll	a0,a1,0x2
+    e7f4:	00642021 	addu	a0,v1,a0
+    e7f8:	8c840000 	lw	a0,0(a0)
+    e7fc:	1080000f 	beqz	a0,e83c <rpc_get_arg+0x98>
+    e800:	00021080 	sll	v0,v0,0x2
+    e804:	00621021 	addu	v0,v1,v0
+    e808:	00002021 	addu	a0,zero,zero
+    e80c:	2406fffc 	addiu	a2,zero,-4
+    e810:	0085182b 	sltu	v1,a0,a1
+    e814:	1060000a 	beqz	v1,e840 <rpc_get_arg+0x9c>
+    e818:	24840001 	addiu	a0,a0,1
+    e81c:	8e030024 	lw	v1,36(s0)
+    e820:	30680003 	andi	t0,v1,0x3
+    e824:	11000002 	beqz	t0,e830 <rpc_get_arg+0x8c>
+    e828:	00663824 	and	a3,v1,a2
+    e82c:	24e30004 	addiu	v1,a3,4
+    e830:	00431021 	addu	v0,v0,v1
+    e834:	08003a04 	j	e810 <rpc_get_arg+0x6c>
+    e838:	26100004 	addiu	s0,s0,4
+    e83c:	00001021 	addu	v0,zero,zero
+    e840:	8fbf0014 	lw	ra,20(sp)
+    e844:	8fb00010 	lw	s0,16(sp)
+    e848:	03e00008 	jr	ra
+    e84c:	27bd0018 	addiu	sp,sp,24
+
+0000e850 <rpc_release>:
+    e850:	8c820020 	lw	v0,32(a0)
+    e854:	14400005 	bnez	v0,e86c <rpc_release+0x1c>
+    e858:	00000000 	sll	zero,zero,0x0
+    e85c:	8c820008 	lw	v0,8(a0)
+    e860:	2c420801 	sltiu	v0,v0,2049
+    e864:	10400003 	beqz	v0,e874 <rpc_release+0x24>
+    e868:	00000000 	sll	zero,zero,0x0
+    e86c:	03e00008 	jr	ra
+    e870:	00000000 	sll	zero,zero,0x0
+    e874:	3c020004 	lui	v0,0x4
+    e878:	3c060003 	lui	a2,0x3
+    e87c:	8c449100 	lw	a0,-28416(v0)
+    e880:	24c65980 	addiu	a2,a2,22912
+    e884:	080009b0 	j	26c0 <__fprintk>
+    e888:	00002821 	addu	a1,zero,zero
+
+0000e88c <rpc_send_rsp_err>:
+    e88c:	27bdffe8 	addiu	sp,sp,-24
+    e890:	afbf0014 	sw	ra,20(sp)
+    e894:	40037801 	mfc0	v1,$15,1
+    e898:	3c020004 	lui	v0,0x4
+    e89c:	30630003 	andi	v1,v1,0x3
+    e8a0:	00031880 	sll	v1,v1,0x2
+    e8a4:	2442c950 	addiu	v0,v0,-14000
+    e8a8:	00621021 	addu	v0,v1,v0
+    e8ac:	3c030004 	lui	v1,0x4
+    e8b0:	3c060003 	lui	a2,0x3
+    e8b4:	8c649100 	lw	a0,-28416(v1)
+    e8b8:	8c470000 	lw	a3,0(v0)
+    e8bc:	24c65990 	addiu	a2,a2,22928
+    e8c0:	0c0009b0 	jal	26c0 <__fprintk>
+    e8c4:	00002821 	addu	a1,zero,zero
+    e8c8:	08003a32 	j	e8c8 <rpc_send_rsp_err+0x3c>
+    e8cc:	00000000 	sll	zero,zero,0x0
+
+0000e8d0 <rpc_before_sleep>:
+    e8d0:	27bdffe8 	addiu	sp,sp,-24
+    e8d4:	afb00010 	sw	s0,16(sp)
+    e8d8:	afbf0014 	sw	ra,20(sp)
+    e8dc:	00808021 	addu	s0,a0,zero
+    e8e0:	40022002 	mfc0	v0,$4,2
+    e8e4:	8c430174 	lw	v1,372(v0)
+    e8e8:	3c020001 	lui	v0,0x1
+    e8ec:	00621021 	addu	v0,v1,v0
+    e8f0:	8c4382d0 	lw	v1,-32048(v0)
+    e8f4:	8c84017c 	lw	a0,380(a0)
+    e8f8:	2463ffff 	addiu	v1,v1,-1
+    e8fc:	ac4382d0 	sw	v1,-32048(v0)
+    e900:	0c0019d5 	jal	6754 <atomic_get>
+    e904:	24840004 	addiu	a0,a0,4
+    e908:	40032002 	mfc0	v1,$4,2
+    e90c:	10620004 	beq	v1,v0,e920 <rpc_before_sleep+0x50>
+    e910:	8fbf0014 	lw	ra,20(sp)
+    e914:	8fb00010 	lw	s0,16(sp)
+    e918:	03e00008 	jr	ra
+    e91c:	27bd0018 	addiu	sp,sp,24
+    e920:	8e04017c 	lw	a0,380(s0)
+    e924:	8fb00010 	lw	s0,16(sp)
+    e928:	00002821 	addu	a1,zero,zero
+    e92c:	24840004 	addiu	a0,a0,4
+    e930:	0800199f 	j	667c <atomic_init>
+    e934:	27bd0018 	addiu	sp,sp,24
+
+0000e938 <rpc_thread_create>:
+    e938:	27bdffe0 	addiu	sp,sp,-32
+    e93c:	afb10014 	sw	s1,20(sp)
+    e940:	8c870000 	lw	a3,0(a0)
+    e944:	00a08821 	addu	s1,a1,zero
+    e948:	3c050001 	lui	a1,0x1
+    e94c:	afb00010 	sw	s0,16(sp)
+    e950:	24a5f1a4 	addiu	a1,a1,-3676
+    e954:	00808021 	addu	s0,a0,zero
+    e958:	00003021 	addu	a2,zero,zero
+    e95c:	afb20018 	sw	s2,24(sp)
+    e960:	afbf001c 	sw	ra,28(sp)
+    e964:	0c002eaf 	jal	babc <kthread_create>
+    e968:	02202021 	addu	a0,s1,zero
+    e96c:	10400038 	beqz	v0,ea50 <rpc_thread_create+0x118>
+    e970:	00409021 	addu	s2,v0,zero
+    e974:	8c430184 	lw	v1,388(v0)
+    e978:	3c040003 	lui	a0,0x3
+    e97c:	34630008 	ori	v1,v1,0x8
+    e980:	24420284 	addiu	v0,v0,644
+    e984:	248459b0 	addiu	a0,a0,22960
+    e988:	ae430184 	sw	v1,388(s2)
+    e98c:	ae44027c 	sw	a0,636(s2)
+    e990:	ae420288 	sw	v0,648(s2)
+    e994:	ae420284 	sw	v0,644(s2)
+    e998:	02402021 	addu	a0,s2,zero
+    e99c:	ae510180 	sw	s1,384(s2)
+    e9a0:	ae400280 	sw	zero,640(s2)
+    e9a4:	0c006c6a 	jal	1b1a8 <tm_create_compute>
+    e9a8:	ae400130 	sw	zero,304(s2)
+    e9ac:	0c004715 	jal	11c54 <sched_register>
+    e9b0:	02402021 	addu	a0,s2,zero
+    e9b4:	1440001f 	bnez	v0,ea34 <rpc_thread_create+0xfc>
+    e9b8:	00401821 	addu	v1,v0,zero
+    e9bc:	3c020001 	lui	v0,0x1
+    e9c0:	02021021 	addu	v0,s0,v0
+    e9c4:	8c4482d0 	lw	a0,-32048(v0)
+    e9c8:	8c4682d4 	lw	a2,-32044(v0)
+    e9cc:	24840001 	addiu	a0,a0,1
+    e9d0:	8c4582c8 	lw	a1,-32056(v0)
+    e9d4:	ac4482d0 	sw	a0,-32048(v0)
+    e9d8:	24c60001 	addiu	a2,a2,1
+    e9dc:	340482c8 	ori	a0,zero,0x82c8
+    e9e0:	ac4682d4 	sw	a2,-32044(v0)
+    e9e4:	02048021 	addu	s0,s0,a0
+    e9e8:	264401e8 	addiu	a0,s2,488
+    e9ec:	ae5001ec 	sw	s0,492(s2)
+    e9f0:	ae4501e8 	sw	a1,488(s2)
+    e9f4:	aca40004 	sw	a0,4(a1)
+    e9f8:	ac4482c8 	sw	a0,-32056(v0)
+    e9fc:	40016000 	mfc0	at,c0_status
+    ea00:	00000000 	sll	zero,zero,0x0
+    ea04:	00012025 	or	a0,zero,at
+    ea08:	00010842 	srl	at,at,0x1
+    ea0c:	00010840 	sll	at,at,0x1
+    ea10:	40816000 	mtc0	at,c0_status
+    ea14:	8e42013c 	lw	v0,316(s2)
+    ea18:	24420001 	addiu	v0,v0,1
+    ea1c:	ae42013c 	sw	v0,316(s2)
+    ea20:	40016000 	mfc0	at,c0_status
+    ea24:	340200ff 	ori	v0,zero,0xff
+    ea28:	00441024 	and	v0,v0,a0
+    ea2c:	00220825 	or	at,at,v0
+    ea30:	40816000 	mtc0	at,c0_status
+    ea34:	8fbf001c 	lw	ra,28(sp)
+    ea38:	00601021 	addu	v0,v1,zero
+    ea3c:	8fb20018 	lw	s2,24(sp)
+    ea40:	8fb10014 	lw	s1,20(sp)
+    ea44:	8fb00010 	lw	s0,16(sp)
+    ea48:	03e00008 	jr	ra
+    ea4c:	27bd0020 	addiu	sp,sp,32
+    ea50:	8fbf001c 	lw	ra,28(sp)
+    ea54:	2403000c 	addiu	v1,zero,12
+    ea58:	00601021 	addu	v0,v1,zero
+    ea5c:	8fb20018 	lw	s2,24(sp)
+    ea60:	8fb10014 	lw	s1,20(sp)
+    ea64:	8fb00010 	lw	s0,16(sp)
+    ea68:	03e00008 	jr	ra
+    ea6c:	27bd0020 	addiu	sp,sp,32
+
+0000ea70 <rpc_activate_thread>:
+    ea70:	27bdffc8 	addiu	sp,sp,-56
+    ea74:	afb2002c 	sw	s2,44(sp)
+    ea78:	afbf0034 	sw	ra,52(sp)
+    ea7c:	afb30030 	sw	s3,48(sp)
+    ea80:	afb10028 	sw	s1,40(sp)
+    ea84:	afb00024 	sw	s0,36(sp)
+    ea88:	00809021 	addu	s2,a0,zero
+    ea8c:	40022002 	mfc0	v0,$4,2
+    ea90:	8c440174 	lw	a0,372(v0)
+    ea94:	40102002 	mfc0	s0,$4,2
+    ea98:	40016000 	mfc0	at,c0_status
+    ea9c:	00000000 	sll	zero,zero,0x0
+    eaa0:	00011825 	or	v1,zero,at
+    eaa4:	00010842 	srl	at,at,0x1
+    eaa8:	00010840 	sll	at,at,0x1
+    eaac:	40816000 	mtc0	at,c0_status
+    eab0:	8e02013c 	lw	v0,316(s0)
+    eab4:	24420001 	addiu	v0,v0,1
+    eab8:	ae02013c 	sw	v0,316(s0)
+    eabc:	40016000 	mfc0	at,c0_status
+    eac0:	340200ff 	ori	v0,zero,0xff
+    eac4:	00431024 	and	v0,v0,v1
+    eac8:	00220825 	or	at,at,v0
+    eacc:	40816000 	mtc0	at,c0_status
+    ead0:	3c130001 	lui	s3,0x1
+    ead4:	00939821 	addu	s3,a0,s3
+    ead8:	340282c8 	ori	v0,zero,0x82c8
+    eadc:	8e7182c8 	lw	s1,-32056(s3)
+    eae0:	00821021 	addu	v0,a0,v0
+    eae4:	12220029 	beq	s1,v0,eb8c <rpc_activate_thread+0x11c>
+    eae8:	3c020004 	lui	v0,0x4
+    eaec:	2631fe18 	addiu	s1,s1,-488
+    eaf0:	26440004 	addiu	a0,s2,4
+    eaf4:	ae32017c 	sw	s2,380(s1)
+    eaf8:	0c00199f 	jal	667c <atomic_init>
+    eafc:	02202821 	addu	a1,s1,zero
+    eb00:	8e2301e8 	lw	v1,488(s1)
+    eb04:	8e2201ec 	lw	v0,492(s1)
+    eb08:	8e240130 	lw	a0,304(s1)
+    eb0c:	ac620004 	sw	v0,4(v1)
+    eb10:	1480001b 	bnez	a0,eb80 <rpc_activate_thread+0x110>
+    eb14:	ac430000 	sw	v1,0(v0)
+    eb18:	02202821 	addu	a1,s1,zero
+    eb1c:	0c004653 	jal	1194c <sched_switch>
+    eb20:	02002021 	addu	a0,s0,zero
+    eb24:	00008821 	addu	s1,zero,zero
+    eb28:	40016000 	mfc0	at,c0_status
+    eb2c:	00000000 	sll	zero,zero,0x0
+    eb30:	00011825 	or	v1,zero,at
+    eb34:	00010842 	srl	at,at,0x1
+    eb38:	00010840 	sll	at,at,0x1
+    eb3c:	40816000 	mtc0	at,c0_status
+    eb40:	8e02013c 	lw	v0,316(s0)
+    eb44:	2442ffff 	addiu	v0,v0,-1
+    eb48:	ae02013c 	sw	v0,316(s0)
+    eb4c:	40016000 	mfc0	at,c0_status
+    eb50:	340200ff 	ori	v0,zero,0xff
+    eb54:	00431024 	and	v0,v0,v1
+    eb58:	00220825 	or	at,at,v0
+    eb5c:	40816000 	mtc0	at,c0_status
+    eb60:	8fbf0034 	lw	ra,52(sp)
+    eb64:	02201021 	addu	v0,s1,zero
+    eb68:	8fb30030 	lw	s3,48(sp)
+    eb6c:	8fb2002c 	lw	s2,44(sp)
+    eb70:	8fb10028 	lw	s1,40(sp)
+    eb74:	8fb00024 	lw	s0,36(sp)
+    eb78:	03e00008 	jr	ra
+    eb7c:	27bd0038 	addiu	sp,sp,56
+    eb80:	24020003 	addiu	v0,zero,3
+    eb84:	08003ac6 	j	eb18 <rpc_activate_thread+0xa8>
+    eb88:	ae220130 	sw	v0,304(s1)
+    eb8c:	3c030002 	lui	v1,0x2
+    eb90:	24426db0 	addiu	v0,v0,28080
+    eb94:	00621021 	addu	v0,v1,v0
+    eb98:	0c003a4e 	jal	e938 <rpc_thread_create>
+    eb9c:	8c451340 	lw	a1,4928(v0)
+    eba0:	14400003 	bnez	v0,ebb0 <rpc_activate_thread+0x140>
+    eba4:	00408821 	addu	s1,v0,zero
+    eba8:	08003abb 	j	eaec <rpc_activate_thread+0x7c>
+    ebac:	8e7182c8 	lw	s1,-32056(s3)
+    ebb0:	8e030184 	lw	v1,388(s0)
+    ebb4:	3c020004 	lui	v0,0x4
+    ebb8:	30630008 	andi	v1,v1,0x8
+    ebbc:	8c449100 	lw	a0,-28416(v0)
+    ebc0:	1460000d 	bnez	v1,ebf8 <rpc_activate_thread+0x188>
+    ebc4:	8e6282d4 	lw	v0,-32044(s3)
+    ebc8:	8e6382d0 	lw	v1,-32048(s3)
+    ebcc:	3c060003 	lui	a2,0x3
+    ebd0:	3c070003 	lui	a3,0x3
+    ebd4:	24c659bc 	addiu	a2,a2,22972
+    ebd8:	24e75b3c 	addiu	a3,a3,23356
+    ebdc:	00002821 	addu	a1,zero,zero
+    ebe0:	afa20014 	sw	v0,20(sp)
+    ebe4:	afa30018 	sw	v1,24(sp)
+    ebe8:	0c0009b0 	jal	26c0 <__fprintk>
+    ebec:	afb10010 	sw	s1,16(sp)
+    ebf0:	08003aca 	j	eb28 <rpc_activate_thread+0xb8>
+    ebf4:	00000000 	sll	zero,zero,0x0
+    ebf8:	8e6382d0 	lw	v1,-32048(s3)
+    ebfc:	08003af3 	j	ebcc <rpc_activate_thread+0x15c>
+    ec00:	2463ffff 	addiu	v1,v1,-1
+
+0000ec04 <__rpc_check>:
+    ec04:	27bdffe0 	addiu	sp,sp,-32
+    ec08:	afb00010 	sw	s0,16(sp)
+    ec0c:	afbf001c 	sw	ra,28(sp)
+    ec10:	afb20018 	sw	s2,24(sp)
+    ec14:	afb10014 	sw	s1,20(sp)
+    ec18:	00808021 	addu	s0,a0,zero
+    ec1c:	40112002 	mfc0	s1,$4,2
+    ec20:	8e220184 	lw	v0,388(s1)
+    ec24:	30420008 	andi	v0,v0,0x8
+    ec28:	10400004 	beqz	v0,ec3c <__rpc_check+0x38>
+    ec2c:	00000000 	sll	zero,zero,0x0
+    ec30:	8e32017c 	lw	s2,380(s1)
+    ec34:	12440020 	beq	s2,a0,ecb8 <__rpc_check+0xb4>
+    ec38:	00000000 	sll	zero,zero,0x0
+    ec3c:	26110004 	addiu	s1,s0,4
+    ec40:	0c0019d5 	jal	6754 <atomic_get>
+    ec44:	02202021 	addu	a0,s1,zero
+    ec48:	10400007 	beqz	v0,ec68 <__rpc_check+0x64>
+    ec4c:	00001021 	addu	v0,zero,zero
+    ec50:	8fbf001c 	lw	ra,28(sp)
+    ec54:	8fb20018 	lw	s2,24(sp)
+    ec58:	8fb10014 	lw	s1,20(sp)
+    ec5c:	8fb00010 	lw	s0,16(sp)
+    ec60:	03e00008 	jr	ra
+    ec64:	27bd0020 	addiu	sp,sp,32
+    ec68:	0c003940 	jal	e500 <rpc_listner_check_new>
+    ec6c:	02002021 	addu	a0,s0,zero
+    ec70:	1040fff7 	beqz	v0,ec50 <__rpc_check+0x4c>
+    ec74:	00001021 	addu	v0,zero,zero
+    ec78:	40052002 	mfc0	a1,$4,2
+    ec7c:	0c0019ea 	jal	67a8 <atomic_test_set>
+    ec80:	02202021 	addu	a0,s1,zero
+    ec84:	1040fff2 	beqz	v0,ec50 <__rpc_check+0x4c>
+    ec88:	00001021 	addu	v0,zero,zero
+    ec8c:	0c003a9c 	jal	ea70 <rpc_activate_thread>
+    ec90:	02002021 	addu	a0,s0,zero
+    ec94:	14400003 	bnez	v0,eca4 <__rpc_check+0xa0>
+    ec98:	00000000 	sll	zero,zero,0x0
+    ec9c:	08003b14 	j	ec50 <__rpc_check+0x4c>
+    eca0:	24020001 	addiu	v0,zero,1
+    eca4:	02202021 	addu	a0,s1,zero
+    eca8:	0c00199f 	jal	667c <atomic_init>
+    ecac:	00002821 	addu	a1,zero,zero
+    ecb0:	08003b14 	j	ec50 <__rpc_check+0x4c>
+    ecb4:	00001021 	addu	v0,zero,zero
+    ecb8:	0c0019d5 	jal	6754 <atomic_get>
+    ecbc:	26440004 	addiu	a0,s2,4
+    ecc0:	40032002 	mfc0	v1,$4,2
+    ecc4:	1462ffdd 	bne	v1,v0,ec3c <__rpc_check+0x38>
+    ecc8:	00000000 	sll	zero,zero,0x0
+    eccc:	0c003940 	jal	e500 <rpc_listner_check_new>
+    ecd0:	8e24017c 	lw	a0,380(s1)
+    ecd4:	1040ffda 	beqz	v0,ec40 <__rpc_check+0x3c>
+    ecd8:	26110004 	addiu	s1,s0,4
+    ecdc:	0c003a9c 	jal	ea70 <rpc_activate_thread>
+    ece0:	02402021 	addu	a0,s2,zero
+    ece4:	08003b14 	j	ec50 <__rpc_check+0x4c>
+    ece8:	24020001 	addiu	v0,zero,1
+
+0000ecec <rpc_check>:
+    ecec:	27bdffe8 	addiu	sp,sp,-24
+    ecf0:	afbf0014 	sw	ra,20(sp)
+    ecf4:	afb00010 	sw	s0,16(sp)
+    ecf8:	40022002 	mfc0	v0,$4,2
+    ecfc:	40022002 	mfc0	v0,$4,2
+    ed00:	8c440174 	lw	a0,372(v0)
+    ed04:	0c003b01 	jal	ec04 <__rpc_check>
+    ed08:	248400e0 	addiu	a0,a0,224
+    ed0c:	3c040007 	lui	a0,0x7
+    ed10:	248480f8 	addiu	a0,a0,-32520
+    ed14:	0c003b01 	jal	ec04 <__rpc_check>
+    ed18:	00408021 	addu	s0,v0,zero
+    ed1c:	10400005 	beqz	v0,ed34 <rpc_check+0x48>
+    ed20:	8fbf0014 	lw	ra,20(sp)
+    ed24:	24020001 	addiu	v0,zero,1
+    ed28:	8fb00010 	lw	s0,16(sp)
+    ed2c:	03e00008 	jr	ra
+    ed30:	27bd0018 	addiu	sp,sp,24
+    ed34:	0010102b 	sltu	v0,zero,s0
+    ed38:	8fb00010 	lw	s0,16(sp)
+    ed3c:	03e00008 	jr	ra
+    ed40:	27bd0018 	addiu	sp,sp,24
+
+0000ed44 <rpc_get_arg_sz>:
+    ed44:	27bdffe0 	addiu	sp,sp,-32
+    ed48:	afb00018 	sw	s0,24(sp)
+    ed4c:	afbf001c 	sw	ra,28(sp)
+    ed50:	9083001c 	lbu	v1,28(a0)
+    ed54:	00a3182b 	sltu	v1,a1,v1
+    ed58:	10600008 	beqz	v1,ed7c <rpc_get_arg_sz+0x38>
+    ed5c:	00a08021 	addu	s0,a1,zero
+    ed60:	00058080 	sll	s0,a1,0x2
+    ed64:	8fbf001c 	lw	ra,28(sp)
+    ed68:	00901021 	addu	v0,a0,s0
+    ed6c:	8c420024 	lw	v0,36(v0)
+    ed70:	8fb00018 	lw	s0,24(sp)
+    ed74:	03e00008 	jr	ra
+    ed78:	27bd0020 	addiu	sp,sp,32
+    ed7c:	0c0039c0 	jal	e700 <rpc_print>
+    ed80:	00000000 	sll	zero,zero,0x0
+    ed84:	3c050003 	lui	a1,0x3
+    ed88:	3c070003 	lui	a3,0x3
+    ed8c:	24a559fc 	addiu	a1,a1,23036
+    ed90:	24e75a54 	addiu	a3,a3,23124
+    ed94:	24040001 	addiu	a0,zero,1
+    ed98:	240601cb 	addiu	a2,zero,459
+    ed9c:	0c00097d 	jal	25f4 <__perror>
+    eda0:	afb00010 	sw	s0,16(sp)
+    eda4:	08003b69 	j	eda4 <rpc_get_arg_sz+0x60>
+    eda8:	00000000 	sll	zero,zero,0x0
+
+0000edac <rpc_handle>:
+    edac:	27bdffd8 	addiu	sp,sp,-40
+    edb0:	afbe0020 	sw	s8,32(sp)
+    edb4:	afb3001c 	sw	s3,28(sp)
+    edb8:	afb20018 	sw	s2,24(sp)
+    edbc:	afbf0024 	sw	ra,36(sp)
+    edc0:	afb10014 	sw	s1,20(sp)
+    edc4:	afb00010 	sw	s0,16(sp)
+    edc8:	03a0f021 	addu	s8,sp,zero
+    edcc:	00809821 	addu	s3,a0,zero
+    edd0:	03a09021 	addu	s2,sp,zero
+    edd4:	8c860004 	lw	a2,4(a0)
+    edd8:	40112002 	mfc0	s1,$4,2
+    eddc:	2cc20801 	sltiu	v0,a2,2049
+    ede0:	14400009 	bnez	v0,ee08 <rpc_handle+0x5c>
+    ede4:	3c100004 	lui	s0,0x4
+    ede8:	3c110003 	lui	s1,0x3
+    edec:	26315a60 	addiu	s1,s1,23136
+    edf0:	8e049100 	lw	a0,-28416(s0)
+    edf4:	00002821 	addu	a1,zero,zero
+    edf8:	0c0009b0 	jal	26c0 <__fprintk>
+    edfc:	02203021 	addu	a2,s1,zero
+    ee00:	08003b7d 	j	edf4 <rpc_handle+0x48>
+    ee04:	8e049100 	lw	a0,-28416(s0)
+    ee08:	24c20012 	addiu	v0,a2,18
+    ee0c:	000210c2 	srl	v0,v0,0x3
+    ee10:	000210c0 	sll	v0,v0,0x3
+    ee14:	03a2e823 	subu	sp,sp,v0
+    ee18:	27b00010 	addiu	s0,sp,16
+    ee1c:	12000031 	beqz	s0,eee4 <rpc_handle+0x138>
+    ee20:	00000000 	sll	zero,zero,0x0
+    ee24:	3c040004 	lui	a0,0x4
+    ee28:	2482c960 	addiu	v0,a0,-13984
+    ee2c:	88430003 	lwl	v1,3(v0)
+    ee30:	96620008 	lhu	v0,8(s3)
+    ee34:	9883c960 	lwr	v1,-13984(a0)
+    ee38:	3063ffff 	andi	v1,v1,0xffff
+    ee3c:	10430048 	beq	v0,v1,ef60 <rpc_handle+0x1b4>
+    ee40:	00000000 	sll	zero,zero,0x0
+    ee44:	2c440101 	sltiu	a0,v0,257
+    ee48:	10800043 	beqz	a0,ef58 <rpc_handle+0x1ac>
+    ee4c:	8e650000 	lw	a1,0(s3)
+    ee50:	00023900 	sll	a3,v0,0x4
+    ee54:	00022080 	sll	a0,v0,0x2
+    ee58:	3c080004 	lui	t0,0x4
+    ee5c:	00e42023 	subu	a0,a3,a0
+    ee60:	2508c9a0 	addiu	t0,t0,-13920
+    ee64:	01042021 	addu	a0,t0,a0
+    ee68:	8c870000 	lw	a3,0(a0)
+    ee6c:	3c045555 	lui	a0,0x5555
+    ee70:	34845555 	ori	a0,a0,0x5555
+    ee74:	10e40038 	beq	a3,a0,ef58 <rpc_handle+0x1ac>
+    ee78:	2c690101 	sltiu	t1,v1,257
+    ee7c:	1120004c 	beqz	t1,efb0 <rpc_handle+0x204>
+    ee80:	00034900 	sll	t1,v1,0x4
+    ee84:	00031880 	sll	v1,v1,0x2
+    ee88:	01231823 	subu	v1,t1,v1
+    ee8c:	01034021 	addu	t0,t0,v1
+    ee90:	8d0a0000 	lw	t2,0(t0)
+    ee94:	11440046 	beq	t2,a0,efb0 <rpc_handle+0x204>
+    ee98:	00b01825 	or	v1,a1,s0
+    ee9c:	30630003 	andi	v1,v1,0x3
+    eea0:	1060002b 	beqz	v1,ef50 <rpc_handle+0x1a4>
+    eea4:	00065882 	srl	t3,a2,0x2
+    eea8:	00001821 	addu	v1,zero,zero
+    eeac:	00005821 	addu	t3,zero,zero
+    eeb0:	00002021 	addu	a0,zero,zero
+    eeb4:	108b0017 	beq	a0,t3,ef14 <rpc_handle+0x168>
+    eeb8:	00046080 	sll	t4,a0,0x2
+    eebc:	020c6821 	addu	t5,s0,t4
+    eec0:	00ac6021 	addu	t4,a1,t4
+    eec4:	4808c000 	mfc2	t0,$24
+    eec8:	4887c000 	mtc2	a3,$24
+    eecc:	8d890000 	lw	t1,0(t4)
+    eed0:	488ac000 	mtc2	t2,$24
+    eed4:	ada90000 	sw	t1,0(t5)
+    eed8:	4888c000 	mtc2	t0,$24
+    eedc:	08003bad 	j	eeb4 <rpc_handle+0x108>
+    eee0:	24840001 	addiu	a0,a0,1
+    eee4:	0c003a23 	jal	e88c <rpc_send_rsp_err>
+    eee8:	00000000 	sll	zero,zero,0x0
+    eeec:	0240e821 	addu	sp,s2,zero
+    eef0:	03c0e821 	addu	sp,s8,zero
+    eef4:	8fbf0024 	lw	ra,36(sp)
+    eef8:	8fbe0020 	lw	s8,32(sp)
+    eefc:	8fb3001c 	lw	s3,28(sp)
+    ef00:	8fb20018 	lw	s2,24(sp)
+    ef04:	8fb10014 	lw	s1,20(sp)
+    ef08:	8fb00010 	lw	s0,16(sp)
+    ef0c:	03e00008 	jr	ra
+    ef10:	27bd0028 	addiu	sp,sp,40
+    ef14:	00a32821 	addu	a1,a1,v1
+    ef18:	02032021 	addu	a0,s0,v1
+    ef1c:	0066402b 	sltu	t0,v1,a2
+    ef20:	11000013 	beqz	t0,ef70 <rpc_handle+0x1c4>
+    ef24:	00000000 	sll	zero,zero,0x0
+    ef28:	4808c000 	mfc2	t0,$24
+    ef2c:	4887c000 	mtc2	a3,$24
+    ef30:	80a90000 	lb	t1,0(a1)
+    ef34:	488ac000 	mtc2	t2,$24
+    ef38:	a0890000 	sb	t1,0(a0)
+    ef3c:	4888c000 	mtc2	t0,$24
+    ef40:	24630001 	addiu	v1,v1,1
+    ef44:	24a50001 	addiu	a1,a1,1
+    ef48:	08003bc7 	j	ef1c <rpc_handle+0x170>
+    ef4c:	24840001 	addiu	a0,a0,1
+    ef50:	08003bac 	j	eeb0 <rpc_handle+0x104>
+    ef54:	000b1880 	sll	v1,t3,0x2
+    ef58:	08003bd6 	j	ef58 <rpc_handle+0x1ac>
+    ef5c:	00000000 	sll	zero,zero,0x0
+    ef60:	8e650000 	lw	a1,0(s3)
+    ef64:	0c00c12b 	jal	304ac <memcpy>
+    ef68:	02002021 	addu	a0,s0,zero
+    ef6c:	96620008 	lhu	v0,8(s3)
+    ef70:	8e040000 	lw	a0,0(s0)
+    ef74:	8e030018 	lw	v1,24(s0)
+    ef78:	ae240154 	sw	a0,340(s1)
+    ef7c:	a6220150 	sh	v0,336(s1)
+    ef80:	0060f809 	jalr	v1
+    ef84:	02002021 	addu	a0,s0,zero
+    ef88:	40037801 	mfc0	v1,$15,1
+    ef8c:	3c020004 	lui	v0,0x4
+    ef90:	30630003 	andi	v1,v1,0x3
+    ef94:	00031880 	sll	v1,v1,0x2
+    ef98:	2442c950 	addiu	v0,v0,-14000
+    ef9c:	00621021 	addu	v0,v1,v0
+    efa0:	8c420000 	lw	v0,0(v0)
+    efa4:	a6220150 	sh	v0,336(s1)
+    efa8:	08003bbc 	j	eef0 <rpc_handle+0x144>
+    efac:	0240e821 	addu	sp,s2,zero
+    efb0:	08003bec 	j	efb0 <rpc_handle+0x204>
+    efb4:	00000000 	sll	zero,zero,0x0
+
+0000efb8 <rpc_ptr_copy>:
+    efb8:	00801021 	addu	v0,a0,zero
+    efbc:	27bdffe8 	addiu	sp,sp,-24
+    efc0:	00a02021 	addu	a0,a1,zero
+    efc4:	2406000c 	addiu	a2,zero,12
+    efc8:	afbf0014 	sw	ra,20(sp)
+    efcc:	0c00c12b 	jal	304ac <memcpy>
+    efd0:	00402821 	addu	a1,v0,zero
+    efd4:	8fbf0014 	lw	ra,20(sp)
+    efd8:	00001021 	addu	v0,zero,zero
+    efdc:	03e00008 	jr	ra
+    efe0:	27bd0018 	addiu	sp,sp,24
+
+0000efe4 <rpc_listner_notify>:
+    efe4:	27bdffb8 	addiu	sp,sp,-72
+    efe8:	afbe0040 	sw	s8,64(sp)
+    efec:	afb7003c 	sw	s7,60(sp)
+    eff0:	afb60038 	sw	s6,56(sp)
+    eff4:	afb50034 	sw	s5,52(sp)
+    eff8:	afb40030 	sw	s4,48(sp)
+    effc:	afb3002c 	sw	s3,44(sp)
+    f000:	afb10024 	sw	s1,36(sp)
+    f004:	afb00020 	sw	s0,32(sp)
+    f008:	afbf0044 	sw	ra,68(sp)
+    f00c:	afb20028 	sw	s2,40(sp)
+    f010:	0080b021 	addu	s6,a0,zero
+    f014:	00a09821 	addu	s3,a1,zero
+    f018:	27b40010 	addiu	s4,sp,16
+    f01c:	24950004 	addiu	s5,a0,4
+    f020:	0000f021 	addu	s8,zero,zero
+    f024:	0000b821 	addu	s7,zero,zero
+    f028:	00008021 	addu	s0,zero,zero
+    f02c:	27b10014 	addiu	s1,sp,20
+    f030:	240240cc 	addiu	v0,zero,16588
+    f034:	72e29002 	mul	s2,s7,v0
+    f038:	26520048 	addiu	s2,s2,72
+    f03c:	08003c2b 	j	f0ac <rpc_listner_notify+0xc8>
+    f040:	02d29021 	addu	s2,s6,s2
+    f044:	8fa50010 	lw	a1,16(sp)
+    f048:	0c0037f8 	jal	dfe0 <remote_fifo_release>
+    f04c:	02402021 	addu	a0,s2,zero
+    f050:	8e630000 	lw	v1,0(s3)
+    f054:	40016000 	mfc0	at,c0_status
+    f058:	340200ff 	ori	v0,zero,0xff
+    f05c:	00431024 	and	v0,v0,v1
+    f060:	00220825 	or	at,at,v0
+    f064:	40816000 	mtc0	at,c0_status
+    f068:	0c003b6b 	jal	edac <rpc_handle>
+    f06c:	02202021 	addu	a0,s1,zero
+    f070:	40016000 	mfc0	at,c0_status
+    f074:	00000000 	sll	zero,zero,0x0
+    f078:	00011025 	or	v0,zero,at
+    f07c:	00010842 	srl	at,at,0x1
+    f080:	00010840 	sll	at,at,0x1
+    f084:	40816000 	mtc0	at,c0_status
+    f088:	ae620000 	sw	v0,0(s3)
+    f08c:	0c0019d5 	jal	6754 <atomic_get>
+    f090:	02a02021 	addu	a0,s5,zero
+    f094:	40032002 	mfc0	v1,$4,2
+    f098:	14620015 	bne	v1,v0,f0f0 <rpc_listner_notify+0x10c>
+    f09c:	2e040101 	sltiu	a0,s0,257
+    f0a0:	10800013 	beqz	a0,f0f0 <rpc_listner_notify+0x10c>
+    f0a4:	00000000 	sll	zero,zero,0x0
+    f0a8:	26100001 	addiu	s0,s0,1
+    f0ac:	02802821 	addu	a1,s4,zero
+    f0b0:	0c0037dd 	jal	df74 <remote_fifo_get>
+    f0b4:	02402021 	addu	a0,s2,zero
+    f0b8:	14400009 	bnez	v0,f0e0 <rpc_listner_notify+0xfc>
+    f0bc:	02202821 	addu	a1,s1,zero
+    f0c0:	0c003bee 	jal	efb8 <rpc_ptr_copy>
+    f0c4:	8fa40010 	lw	a0,16(sp)
+    f0c8:	1040ffde 	beqz	v0,f044 <rpc_listner_notify+0x60>
+    f0cc:	00000000 	sll	zero,zero,0x0
+    f0d0:	0c003a23 	jal	e88c <rpc_send_rsp_err>
+    f0d4:	8fa40010 	lw	a0,16(sp)
+    f0d8:	08003c12 	j	f048 <rpc_listner_notify+0x64>
+    f0dc:	8fa50010 	lw	a1,16(sp)
+    f0e0:	27de0001 	addiu	s8,s8,1
+    f0e4:	24020002 	addiu	v0,zero,2
+    f0e8:	17c2ffd1 	bne	s8,v0,f030 <rpc_listner_notify+0x4c>
+    f0ec:	26f70001 	addiu	s7,s7,1
+    f0f0:	8ec30000 	lw	v1,0(s6)
+    f0f4:	8fbf0044 	lw	ra,68(sp)
+    f0f8:	00708021 	addu	s0,v1,s0
+    f0fc:	aed00000 	sw	s0,0(s6)
+    f100:	00001021 	addu	v0,zero,zero
+    f104:	8fbe0040 	lw	s8,64(sp)
+    f108:	8fb7003c 	lw	s7,60(sp)
+    f10c:	8fb60038 	lw	s6,56(sp)
+    f110:	8fb50034 	lw	s5,52(sp)
+    f114:	8fb40030 	lw	s4,48(sp)
+    f118:	8fb3002c 	lw	s3,44(sp)
+    f11c:	8fb20028 	lw	s2,40(sp)
+    f120:	8fb10024 	lw	s1,36(sp)
+    f124:	8fb00020 	lw	s0,32(sp)
+    f128:	03e00008 	jr	ra
+    f12c:	27bd0048 	addiu	sp,sp,72
+
+0000f130 <rpc_check_notify>:
+    f130:	27bdffe8 	addiu	sp,sp,-24
+    f134:	afbf0014 	sw	ra,20(sp)
+    f138:	afb00010 	sw	s0,16(sp)
+    f13c:	40022002 	mfc0	v0,$4,2
+    f140:	8c42017c 	lw	v0,380(v0)
+    f144:	00802821 	addu	a1,a0,zero
+    f148:	24500004 	addiu	s0,v0,4
+    f14c:	0c003bf9 	jal	efe4 <rpc_listner_notify>
+    f150:	00402021 	addu	a0,v0,zero
+    f154:	0c0019d5 	jal	6754 <atomic_get>
+    f158:	02002021 	addu	a0,s0,zero
+    f15c:	40032002 	mfc0	v1,$4,2
+    f160:	10620007 	beq	v1,v0,f180 <rpc_check_notify+0x50>
+    f164:	00000000 	sll	zero,zero,0x0
+    f168:	40022002 	mfc0	v0,$4,2
+    f16c:	8fbf0014 	lw	ra,20(sp)
+    f170:	8fb00010 	lw	s0,16(sp)
+    f174:	ac40017c 	sw	zero,380(v0)
+    f178:	03e00008 	jr	ra
+    f17c:	27bd0018 	addiu	sp,sp,24
+    f180:	02002021 	addu	a0,s0,zero
+    f184:	0c00199f 	jal	667c <atomic_init>
+    f188:	00002821 	addu	a1,zero,zero
+    f18c:	40022002 	mfc0	v0,$4,2
+    f190:	8fbf0014 	lw	ra,20(sp)
+    f194:	8fb00010 	lw	s0,16(sp)
+    f198:	ac40017c 	sw	zero,380(v0)
+    f19c:	03e00008 	jr	ra
+    f1a0:	27bd0018 	addiu	sp,sp,24
+
+0000f1a4 <thread_rpc_manager>:
+    f1a4:	27bdffc8 	addiu	sp,sp,-56
+    f1a8:	afbf0034 	sw	ra,52(sp)
+    f1ac:	afb60030 	sw	s6,48(sp)
+    f1b0:	afb5002c 	sw	s5,44(sp)
+    f1b4:	afb40028 	sw	s4,40(sp)
+    f1b8:	afb30024 	sw	s3,36(sp)
+    f1bc:	afb20020 	sw	s2,32(sp)
+    f1c0:	afb1001c 	sw	s1,28(sp)
+    f1c4:	afb00018 	sw	s0,24(sp)
+    f1c8:	40016000 	mfc0	at,c0_status
+    f1cc:	00000000 	sll	zero,zero,0x0
+    f1d0:	00011025 	or	v0,zero,at
+    f1d4:	34210001 	ori	at,at,0x1
+    f1d8:	40816000 	mtc0	at,c0_status
+    f1dc:	00000000 	sll	zero,zero,0x0
+    f1e0:	40102002 	mfc0	s0,$4,2
+    f1e4:	40022002 	mfc0	v0,$4,2
+    f1e8:	8c420174 	lw	v0,372(v0)
+    f1ec:	3c110001 	lui	s1,0x1
+    f1f0:	341682c8 	ori	s6,zero,0x82c8
+    f1f4:	3c150001 	lui	s5,0x1
+    f1f8:	3c140001 	lui	s4,0x1
+    f1fc:	00518821 	addu	s1,v0,s1
+    f200:	0056b021 	addu	s6,v0,s6
+    f204:	26b5e8d0 	addiu	s5,s5,-5936
+    f208:	2694e5b8 	addiu	s4,s4,-6728
+    f20c:	261201e8 	addiu	s2,s0,488
+    f210:	08003c93 	j	f24c <thread_rpc_manager+0xa8>
+    f214:	27b30010 	addiu	s3,sp,16
+    f218:	8e2282c8 	lw	v0,-32056(s1)
+    f21c:	ae1601ec 	sw	s6,492(s0)
+    f220:	ae0201e8 	sw	v0,488(s0)
+    f224:	ac520004 	sw	s2,4(v0)
+    f228:	ae3282c8 	sw	s2,-32056(s1)
+    f22c:	0c004634 	jal	118d0 <sched_sleep>
+    f230:	02002021 	addu	a0,s0,zero
+    f234:	8fa30010 	lw	v1,16(sp)
+    f238:	40016000 	mfc0	at,c0_status
+    f23c:	340200ff 	ori	v0,zero,0xff
+    f240:	00431024 	and	v0,v0,v1
+    f244:	00220825 	or	at,at,v0
+    f248:	40816000 	mtc0	at,c0_status
+    f24c:	40016000 	mfc0	at,c0_status
+    f250:	00000000 	sll	zero,zero,0x0
+    f254:	00011025 	or	v0,zero,at
+    f258:	00010842 	srl	at,at,0x1
+    f25c:	00010840 	sll	at,at,0x1
+    f260:	40816000 	mtc0	at,c0_status
+    f264:	ae150290 	sw	s5,656(s0)
+    f268:	ae140294 	sw	s4,660(s0)
+    f26c:	02602021 	addu	a0,s3,zero
+    f270:	0c003c4c 	jal	f130 <rpc_check_notify>
+    f274:	afa20010 	sw	v0,16(sp)
+    f278:	8e2282d4 	lw	v0,-32044(s1)
+    f27c:	ae000290 	sw	zero,656(s0)
+    f280:	2c43000b 	sltiu	v1,v0,11
+    f284:	1460ffe4 	bnez	v1,f218 <thread_rpc_manager+0x74>
+    f288:	ae000294 	sw	zero,660(s0)
+    f28c:	2442ffff 	addiu	v0,v0,-1
+    f290:	ae2282d4 	sw	v0,-32044(s1)
+    f294:	0c0046e4 	jal	11b90 <sched_exit>
+    f298:	02002021 	addu	a0,s0,zero
+    f29c:	08003c87 	j	f21c <thread_rpc_manager+0x78>
+    f2a0:	8e2282c8 	lw	v0,-32056(s1)
+
+0000f2a4 <rpc_response_notify>:
+    f2a4:	080044a3 	j	1128c <sched_wakeup>
+    f2a8:	8c840014 	lw	a0,20(a0)
+
+0000f2ac <__rpc_send>:
+    f2ac:	27bdffb0 	addiu	sp,sp,-80
+    f2b0:	3c020004 	lui	v0,0x4
+    f2b4:	afbe0048 	sw	s8,72(sp)
+    f2b8:	afb70044 	sw	s7,68(sp)
+    f2bc:	afb60040 	sw	s6,64(sp)
+    f2c0:	afb5003c 	sw	s5,60(sp)
+    f2c4:	afb40038 	sw	s4,56(sp)
+    f2c8:	afb30034 	sw	s3,52(sp)
+    f2cc:	afb20030 	sw	s2,48(sp)
+    f2d0:	afb1002c 	sw	s1,44(sp)
+    f2d4:	afb00028 	sw	s0,40(sp)
+    f2d8:	2443c960 	addiu	v1,v0,-13984
+    f2dc:	afbf004c 	sw	ra,76(sp)
+    f2e0:	88630003 	lwl	v1,3(v1)
+    f2e4:	8fb20060 	lw	s2,96(sp)
+    f2e8:	9843c960 	lwr	v1,-13984(v0)
+    f2ec:	8e420008 	lw	v0,8(s2)
+    f2f0:	3c170004 	lui	s7,0x4
+    f2f4:	afa20018 	sw	v0,24(sp)
+    f2f8:	a7a3001c 	sh	v1,28(sp)
+    f2fc:	0080b021 	addu	s6,a0,zero
+    f300:	00c0f021 	addu	s8,a2,zero
+    f304:	afa7005c 	sw	a3,92(sp)
+    f308:	30b0ffff 	andi	s0,a1,0xffff
+    f30c:	afb20014 	sw	s2,20(sp)
+    f310:	26f7c950 	addiu	s7,s7,-14000
+    f314:	27b50014 	addiu	s5,sp,20
+    f318:	27b40010 	addiu	s4,sp,16
+    f31c:	241340cc 	addiu	s3,zero,16588
+    f320:	3c110004 	lui	s1,0x4
+    f324:	8e440004 	lw	a0,4(s2)
+    f328:	02002821 	addu	a1,s0,zero
+    f32c:	70932002 	mul	a0,a0,s3
+    f330:	02a03021 	addu	a2,s5,zero
+    f334:	24840048 	addiu	a0,a0,72
+    f338:	02c42021 	addu	a0,s6,a0
+    f33c:	0c0038dc 	jal	e370 <remote_fifo_put>
+    f340:	02803821 	addu	a3,s4,zero
+    f344:	10400021 	beqz	v0,f3cc <__rpc_send+0x120>
+    f348:	8fa20010 	lw	v0,16(sp)
+    f34c:	40027801 	mfc0	v0,$15,1
+    f350:	30420003 	andi	v0,v0,0x3
+    f354:	00021080 	sll	v0,v0,0x2
+    f358:	00571021 	addu	v0,v0,s7
+    f35c:	8c430000 	lw	v1,0(v0)
+    f360:	8e24bcb0 	lw	a0,-17232(s1)
+    f364:	000310c0 	sll	v0,v1,0x3
+    f368:	00431023 	subu	v0,v0,v1
+    f36c:	00441021 	addu	v0,v0,a0
+    f370:	3042007f 	andi	v0,v0,0x7f
+    f374:	ae22bcb0 	sw	v0,-17232(s1)
+    f378:	40034800 	mfc0	v1,c0_count
+    f37c:	00000000 	sll	zero,zero,0x0
+    f380:	00431821 	addu	v1,v0,v1
+    f384:	0c0021a3 	jal	868c <cpu_yield>
+    f388:	afa30020 	sw	v1,32(sp)
+    f38c:	1440ffe5 	bnez	v0,f324 <__rpc_send+0x78>
+    f390:	00000000 	sll	zero,zero,0x0
+    f394:	40024800 	mfc0	v0,c0_count
+    f398:	00000000 	sll	zero,zero,0x0
+    f39c:	8fa30020 	lw	v1,32(sp)
+    f3a0:	0043102b 	sltu	v0,v0,v1
+    f3a4:	1040ffdf 	beqz	v0,f324 <__rpc_send+0x78>
+    f3a8:	00000000 	sll	zero,zero,0x0
+    f3ac:	40024800 	mfc0	v0,c0_count
+    f3b0:	00000000 	sll	zero,zero,0x0
+    f3b4:	8fa30020 	lw	v1,32(sp)
+    f3b8:	0043102b 	sltu	v0,v0,v1
+    f3bc:	1440fff5 	bnez	v0,f394 <__rpc_send+0xe8>
+    f3c0:	00000000 	sll	zero,zero,0x0
+    f3c4:	08003cca 	j	f328 <__rpc_send+0x7c>
+    f3c8:	8e440004 	lw	a0,4(s2)
+    f3cc:	14400019 	bnez	v0,f434 <__rpc_send+0x188>
+    f3d0:	3c110004 	lui	s1,0x4
+    f3d4:	08003d05 	j	f414 <__rpc_send+0x168>
+    f3d8:	2631c950 	addiu	s1,s1,-14000
+    f3dc:	0c001e30 	jal	78c0 <cluster_in_kernel>
+    f3e0:	00000000 	sll	zero,zero,0x0
+    f3e4:	14400014 	bnez	v0,f438 <__rpc_send+0x18c>
+    f3e8:	8fbf004c 	lw	ra,76(sp)
+    f3ec:	40027801 	mfc0	v0,$15,1
+    f3f0:	30420003 	andi	v0,v0,0x3
+    f3f4:	00021080 	sll	v0,v0,0x2
+    f3f8:	00511021 	addu	v0,v0,s1
+    f3fc:	8c450000 	lw	a1,0(v0)
+    f400:	0c0004a9 	jal	12a4 <arch_cpu_send_ipi>
+    f404:	8fa4005c 	lw	a0,92(sp)
+    f408:	8fa20010 	lw	v0,16(sp)
+    f40c:	1440000a 	bnez	v0,f438 <__rpc_send+0x18c>
+    f410:	8fbf004c 	lw	ra,76(sp)
+    f414:	8fa20064 	lw	v0,100(sp)
+    f418:	02002021 	addu	a0,s0,zero
+    f41c:	1440ffef 	bnez	v0,f3dc <__rpc_send+0x130>
+    f420:	03c02821 	addu	a1,s8,zero
+    f424:	0c002061 	jal	8184 <cpu_in_kernel>
+    f428:	02002021 	addu	a0,s0,zero
+    f42c:	1040ffef 	beqz	v0,f3ec <__rpc_send+0x140>
+    f430:	00000000 	sll	zero,zero,0x0
+    f434:	8fbf004c 	lw	ra,76(sp)
+    f438:	8fbe0048 	lw	s8,72(sp)
+    f43c:	8fb70044 	lw	s7,68(sp)
+    f440:	8fb60040 	lw	s6,64(sp)
+    f444:	8fb5003c 	lw	s5,60(sp)
+    f448:	8fb40038 	lw	s4,56(sp)
+    f44c:	8fb30034 	lw	s3,52(sp)
+    f450:	8fb20030 	lw	s2,48(sp)
+    f454:	8fb1002c 	lw	s1,44(sp)
+    f458:	8fb00028 	lw	s0,40(sp)
+    f45c:	03e00008 	jr	ra
+    f460:	27bd0050 	addiu	sp,sp,80
+
+0000f464 <rpc_listner_init>:
+    f464:	27bdffe8 	addiu	sp,sp,-24
+    f468:	afb00010 	sw	s0,16(sp)
+    f46c:	ac800000 	sw	zero,0(a0)
+    f470:	00808021 	addu	s0,a0,zero
+    f474:	ac800044 	sw	zero,68(a0)
+    f478:	00002821 	addu	a1,zero,zero
+    f47c:	afbf0014 	sw	ra,20(sp)
+    f480:	0c00199f 	jal	667c <atomic_init>
+    f484:	24840004 	addiu	a0,a0,4
+    f488:	26040048 	addiu	a0,s0,72
+    f48c:	24050100 	addiu	a1,zero,256
+    f490:	0c003807 	jal	e01c <remote_fifo_init>
+    f494:	2406000c 	addiu	a2,zero,12
+    f498:	14400009 	bnez	v0,f4c0 <rpc_listner_init+0x5c>
+    f49c:	26044114 	addiu	a0,s0,16660
+    f4a0:	24050100 	addiu	a1,zero,256
+    f4a4:	0c003807 	jal	e01c <remote_fifo_init>
+    f4a8:	2406000c 	addiu	a2,zero,12
+    f4ac:	14400004 	bnez	v0,f4c0 <rpc_listner_init+0x5c>
+    f4b0:	8fbf0014 	lw	ra,20(sp)
+    f4b4:	8fb00010 	lw	s0,16(sp)
+    f4b8:	03e00008 	jr	ra
+    f4bc:	27bd0018 	addiu	sp,sp,24
+    f4c0:	3c050003 	lui	a1,0x3
+    f4c4:	3c070003 	lui	a3,0x3
+    f4c8:	24a55a74 	addiu	a1,a1,23156
+    f4cc:	24e75a54 	addiu	a3,a3,23124
+    f4d0:	24040001 	addiu	a0,zero,1
+    f4d4:	0c00097d 	jal	25f4 <__perror>
+    f4d8:	2406001f 	addiu	a2,zero,31
+    f4dc:	08003d37 	j	f4dc <rpc_listner_init+0x78>
+    f4e0:	00000000 	sll	zero,zero,0x0
+
+0000f4e4 <rpc_send_sync>:
+    f4e4:	27bdffb0 	addiu	sp,sp,-80
+    f4e8:	afa50018 	sw	a1,24(sp)
+    f4ec:	afa7001c 	sw	a3,28(sp)
+    f4f0:	afbf004c 	sw	ra,76(sp)
+    f4f4:	afb70044 	sw	s7,68(sp)
+    f4f8:	afb60040 	sw	s6,64(sp)
+    f4fc:	afb5003c 	sw	s5,60(sp)
+    f500:	00c0b021 	addu	s6,a2,zero
+    f504:	0080a821 	addu	s5,a0,zero
+    f508:	afb40038 	sw	s4,56(sp)
+    f50c:	afb30034 	sw	s3,52(sp)
+    f510:	afb20030 	sw	s2,48(sp)
+    f514:	afb1002c 	sw	s1,44(sp)
+    f518:	afb00028 	sw	s0,40(sp)
+    f51c:	afbe0048 	sw	s8,72(sp)
+    f520:	8fb20060 	lw	s2,96(sp)
+    f524:	8fb30068 	lw	s3,104(sp)
+    f528:	8fb4006c 	lw	s4,108(sp)
+    f52c:	8fb10070 	lw	s1,112(sp)
+    f530:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    f534:	8fb00078 	lw	s0,120(sp)
+    f538:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    f53c:	0040b821 	addu	s7,v0,zero
+    f540:	02a2001b 	divu	zero,s5,v0
+    f544:	004001f4 	teq	v0,zero,0x7
+    f548:	8fa50018 	lw	a1,24(sp)
+    f54c:	8fa7001c 	lw	a3,28(sp)
+    f550:	10a00089 	beqz	a1,f778 <rpc_send_sync+0x294>
+    f554:	00003010 	mfhi	a2
+    f558:	3c040007 	lui	a0,0x7
+    f55c:	248480f8 	addiu	a0,a0,-32520
+    f560:	40037801 	mfc0	v1,$15,1
+    f564:	3c020004 	lui	v0,0x4
+    f568:	30630003 	andi	v1,v1,0x3
+    f56c:	00031880 	sll	v1,v1,0x2
+    f570:	2442c950 	addiu	v0,v0,-14000
+    f574:	00621021 	addu	v0,v1,v0
+    f578:	8c420000 	lw	v0,0(v0)
+    f57c:	ae270018 	sw	a3,24(s1)
+    f580:	ae220000 	sw	v0,0(s1)
+    f584:	8fa20074 	lw	v0,116(sp)
+    f588:	ae220008 	sw	v0,8(s1)
+    f58c:	8fa20064 	lw	v0,100(sp)
+    f590:	ae360004 	sw	s6,4(s1)
+    f594:	a222001c 	sb	v0,28(s1)
+    f598:	ae200020 	sw	zero,32(s1)
+    f59c:	40032002 	mfc0	v1,$4,2
+    f5a0:	02b7001b 	divu	zero,s5,s7
+    f5a4:	02e001f4 	teq	s7,zero,0x7
+    f5a8:	8fa2007c 	lw	v0,124(sp)
+    f5ac:	ae230014 	sw	v1,20(s1)
+    f5b0:	ae220010 	sw	v0,16(s1)
+    f5b4:	ae30000c 	sw	s0,12(s1)
+    f5b8:	02a03821 	addu	a3,s5,zero
+    f5bc:	afa50014 	sw	a1,20(sp)
+    f5c0:	afb10010 	sw	s1,16(sp)
+    f5c4:	00001012 	mflo	v0
+    f5c8:	0c003cab 	jal	f2ac <__rpc_send>
+    f5cc:	3045ffff 	andi	a1,v0,0xffff
+    f5d0:	16c00019 	bnez	s6,f638 <rpc_send_sync+0x154>
+    f5d4:	00000000 	sll	zero,zero,0x0
+    f5d8:	40152002 	mfc0	s5,$4,2
+    f5dc:	8ea20184 	lw	v0,388(s5)
+    f5e0:	30420008 	andi	v0,v0,0x8
+    f5e4:	14400053 	bnez	v0,f734 <rpc_send_sync+0x250>
+    f5e8:	00000000 	sll	zero,zero,0x0
+    f5ec:	3c160001 	lui	s6,0x1
+    f5f0:	26d6e4d0 	addiu	s6,s6,-6960
+    f5f4:	8e220020 	lw	v0,32(s1)
+    f5f8:	1440000b 	bnez	v0,f628 <rpc_send_sync+0x144>
+    f5fc:	02a02021 	addu	a0,s5,zero
+    f600:	0c002083 	jal	820c <__cpu_check_sched>
+    f604:	00000000 	sll	zero,zero,0x0
+    f608:	1040fffa 	beqz	v0,f5f4 <rpc_send_sync+0x110>
+    f60c:	02a02021 	addu	a0,s5,zero
+    f610:	02c02821 	addu	a1,s6,zero
+    f614:	0c004626 	jal	11898 <sched_sleep_check>
+    f618:	02203021 	addu	a2,s1,zero
+    f61c:	8e220020 	lw	v0,32(s1)
+    f620:	1040fff7 	beqz	v0,f600 <rpc_send_sync+0x11c>
+    f624:	02a02021 	addu	a0,s5,zero
+    f628:	8ea20184 	lw	v0,388(s5)
+    f62c:	30420008 	andi	v0,v0,0x8
+    f630:	1440002f 	bnez	v0,f6f0 <rpc_send_sync+0x20c>
+    f634:	00000000 	sll	zero,zero,0x0
+    f638:	12400020 	beqz	s2,f6bc <rpc_send_sync+0x1d8>
+    f63c:	0000a821 	addu	s5,zero,zero
+    f640:	08003da1 	j	f684 <rpc_send_sync+0x1a0>
+    f644:	00008821 	addu	s1,zero,zero
+    f648:	8ee60000 	lw	a2,0(s7)
+    f64c:	0276b021 	addu	s6,s3,s6
+    f650:	02a02821 	addu	a1,s5,zero
+    f654:	8ed60000 	lw	s6,0(s6)
+    f658:	02002021 	addu	a0,s0,zero
+    f65c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+    f660:	afa60020 	sw	a2,32(sp)
+    f664:	8fa60020 	lw	a2,32(sp)
+    f668:	26310001 	addiu	s1,s1,1
+    f66c:	02c02021 	addu	a0,s6,zero
+    f670:	0c00c12b 	jal	304ac <memcpy>
+    f674:	00402821 	addu	a1,v0,zero
+    f678:	0232102b 	sltu	v0,s1,s2
+    f67c:	1040000f 	beqz	v0,f6bc <rpc_send_sync+0x1d8>
+    f680:	0220a821 	addu	s5,s1,zero
+    f684:	0015b080 	sll	s6,s5,0x2
+    f688:	0296b821 	addu	s7,s4,s6
+    f68c:	8efe0000 	lw	s8,0(s7)
+    f690:	02a02821 	addu	a1,s5,zero
+    f694:	0c003b51 	jal	ed44 <rpc_get_arg_sz>
+    f698:	02002021 	addu	a0,s0,zero
+    f69c:	03c2102b 	sltu	v0,s8,v0
+    f6a0:	1440ffe9 	bnez	v0,f648 <rpc_send_sync+0x164>
+    f6a4:	00000000 	sll	zero,zero,0x0
+    f6a8:	02a02821 	addu	a1,s5,zero
+    f6ac:	0c003b51 	jal	ed44 <rpc_get_arg_sz>
+    f6b0:	02002021 	addu	a0,s0,zero
+    f6b4:	08003d93 	j	f64c <rpc_send_sync+0x168>
+    f6b8:	00403021 	addu	a2,v0,zero
+    f6bc:	8fbf004c 	lw	ra,76(sp)
+    f6c0:	00001021 	addu	v0,zero,zero
+    f6c4:	8fbe0048 	lw	s8,72(sp)
+    f6c8:	8fb70044 	lw	s7,68(sp)
+    f6cc:	8fb60040 	lw	s6,64(sp)
+    f6d0:	8fb5003c 	lw	s5,60(sp)
+    f6d4:	8fb40038 	lw	s4,56(sp)
+    f6d8:	8fb30034 	lw	s3,52(sp)
+    f6dc:	8fb20030 	lw	s2,48(sp)
+    f6e0:	8fb1002c 	lw	s1,44(sp)
+    f6e4:	8fb00028 	lw	s0,40(sp)
+    f6e8:	03e00008 	jr	ra
+    f6ec:	27bd0050 	addiu	sp,sp,80
+    f6f0:	40016000 	mfc0	at,c0_status
+    f6f4:	00000000 	sll	zero,zero,0x0
+    f6f8:	00011825 	or	v1,zero,at
+    f6fc:	00010842 	srl	at,at,0x1
+    f700:	00010840 	sll	at,at,0x1
+    f704:	40816000 	mtc0	at,c0_status
+    f708:	40022002 	mfc0	v0,$4,2
+    f70c:	8c44013c 	lw	a0,316(v0)
+    f710:	24840001 	addiu	a0,a0,1
+    f714:	ac44013c 	sw	a0,316(v0)
+    f718:	40016000 	mfc0	at,c0_status
+    f71c:	340200ff 	ori	v0,zero,0xff
+    f720:	00431024 	and	v0,v0,v1
+    f724:	00220825 	or	at,at,v0
+    f728:	40816000 	mtc0	at,c0_status
+    f72c:	08003d8e 	j	f638 <rpc_send_sync+0x154>
+    f730:	00000000 	sll	zero,zero,0x0
+    f734:	40016000 	mfc0	at,c0_status
+    f738:	00000000 	sll	zero,zero,0x0
+    f73c:	00011825 	or	v1,zero,at
+    f740:	00010842 	srl	at,at,0x1
+    f744:	00010840 	sll	at,at,0x1
+    f748:	40816000 	mtc0	at,c0_status
+    f74c:	40022002 	mfc0	v0,$4,2
+    f750:	8c44013c 	lw	a0,316(v0)
+    f754:	2484ffff 	addiu	a0,a0,-1
+    f758:	ac44013c 	sw	a0,316(v0)
+    f75c:	40016000 	mfc0	at,c0_status
+    f760:	340200ff 	ori	v0,zero,0xff
+    f764:	00431024 	and	v0,v0,v1
+    f768:	00220825 	or	at,at,v0
+    f76c:	40816000 	mtc0	at,c0_status
+    f770:	08003d7c 	j	f5f0 <rpc_send_sync+0x10c>
+    f774:	3c160001 	lui	s6,0x1
+    f778:	00c02021 	addu	a0,a2,zero
+    f77c:	afa50018 	sw	a1,24(sp)
+    f780:	afa60020 	sw	a2,32(sp)
+    f784:	0c00207a 	jal	81e8 <cpu_lid2ptr>
+    f788:	afa7001c 	sw	a3,28(sp)
+    f78c:	244400e0 	addiu	a0,v0,224
+    f790:	8fa7001c 	lw	a3,28(sp)
+    f794:	8fa60020 	lw	a2,32(sp)
+    f798:	08003d58 	j	f560 <rpc_send_sync+0x7c>
+    f79c:	8fa50018 	lw	a1,24(sp)
+
+0000f7a0 <rppc_generic>:
+    f7a0:	27bdff88 	addiu	sp,sp,-120
+    f7a4:	afbe0070 	sw	s8,112(sp)
+    f7a8:	03a0f021 	addu	s8,sp,zero
+    f7ac:	afb20058 	sw	s2,88(sp)
+    f7b0:	8fd2008c 	lw	s2,140(s8)
+    f7b4:	afb7006c 	sw	s7,108(sp)
+    f7b8:	afb60068 	sw	s6,104(sp)
+    f7bc:	afb50064 	sw	s5,100(sp)
+    f7c0:	afb40060 	sw	s4,96(sp)
+    f7c4:	afbf0074 	sw	ra,116(sp)
+    f7c8:	afb3005c 	sw	s3,92(sp)
+    f7cc:	afb10054 	sw	s1,84(sp)
+    f7d0:	afb00050 	sw	s0,80(sp)
+    f7d4:	0080b821 	addu	s7,a0,zero
+    f7d8:	00a0b021 	addu	s6,a1,zero
+    f7dc:	00c0a821 	addu	s5,a2,zero
+    f7e0:	8fd40088 	lw	s4,136(s8)
+    f7e4:	8fcc0094 	lw	t4,148(s8)
+    f7e8:	12400013 	beqz	s2,f838 <rppc_generic+0x98>
+    f7ec:	8fc3009c 	lw	v1,156(s8)
+    f7f0:	00002021 	addu	a0,zero,zero
+    f7f4:	00001021 	addu	v0,zero,zero
+    f7f8:	24110024 	addiu	s1,zero,36
+    f7fc:	08003e06 	j	f818 <rppc_generic+0x78>
+    f800:	2405fffc 	addiu	a1,zero,-4
+    f804:	24c40008 	addiu	a0,a2,8
+    f808:	24420001 	addiu	v0,v0,1
+    f80c:	02248821 	addu	s1,s1,a0
+    f810:	1052000a 	beq	v0,s2,f83c <rppc_generic+0x9c>
+    f814:	00402021 	addu	a0,v0,zero
+    f818:	00042080 	sll	a0,a0,0x2
+    f81c:	00642021 	addu	a0,v1,a0
+    f820:	8c840000 	lw	a0,0(a0)
+    f824:	30880003 	andi	t0,a0,0x3
+    f828:	1500fff6 	bnez	t0,f804 <rppc_generic+0x64>
+    f82c:	00853024 	and	a2,a0,a1
+    f830:	08003e02 	j	f808 <rppc_generic+0x68>
+    f834:	24840004 	addiu	a0,a0,4
+    f838:	24110024 	addiu	s1,zero,36
+    f83c:	12800012 	beqz	s4,f888 <rppc_generic+0xe8>
+    f840:	00002021 	addu	a0,zero,zero
+    f844:	00001021 	addu	v0,zero,zero
+    f848:	24100024 	addiu	s0,zero,36
+    f84c:	08003e1a 	j	f868 <rppc_generic+0xc8>
+    f850:	2405fffc 	addiu	a1,zero,-4
+    f854:	24c40008 	addiu	a0,a2,8
+    f858:	24420001 	addiu	v0,v0,1
+    f85c:	02048021 	addu	s0,s0,a0
+    f860:	1054000a 	beq	v0,s4,f88c <rppc_generic+0xec>
+    f864:	00402021 	addu	a0,v0,zero
+    f868:	00042080 	sll	a0,a0,0x2
+    f86c:	01842021 	addu	a0,t4,a0
+    f870:	8c840000 	lw	a0,0(a0)
+    f874:	30880003 	andi	t0,a0,0x3
+    f878:	1500fff6 	bnez	t0,f854 <rppc_generic+0xb4>
+    f87c:	00853024 	and	a2,a0,a1
+    f880:	08003e16 	j	f858 <rppc_generic+0xb8>
+    f884:	24840004 	addiu	a0,a0,4
+    f888:	24100024 	addiu	s0,zero,36
+    f88c:	0211102b 	sltu	v0,s0,s1
+    f890:	02202021 	addu	a0,s1,zero
+    f894:	0202200a 	movz	a0,s0,v0
+    f898:	00801021 	addu	v0,a0,zero
+    f89c:	2c840801 	sltiu	a0,a0,2049
+    f8a0:	1480000a 	bnez	a0,f8cc <rppc_generic+0x12c>
+    f8a4:	24420012 	addiu	v0,v0,18
+    f8a8:	3c110003 	lui	s1,0x3
+    f8ac:	26315a60 	addiu	s1,s1,23136
+    f8b0:	3c100004 	lui	s0,0x4
+    f8b4:	8e049100 	lw	a0,-28416(s0)
+    f8b8:	00002821 	addu	a1,zero,zero
+    f8bc:	0c0009b0 	jal	26c0 <__fprintk>
+    f8c0:	02203021 	addu	a2,s1,zero
+    f8c4:	08003e2e 	j	f8b8 <rppc_generic+0x118>
+    f8c8:	8e049100 	lw	a0,-28416(s0)
+    f8cc:	000210c2 	srl	v0,v0,0x3
+    f8d0:	000210c0 	sll	v0,v0,0x3
+    f8d4:	03a2e823 	subu	sp,sp,v0
+    f8d8:	27b30030 	addiu	s3,sp,48
+    f8dc:	266a0024 	addiu	t2,s3,36
+    f8e0:	02602821 	addu	a1,s3,zero
+    f8e4:	00602021 	addu	a0,v1,zero
+    f8e8:	00001021 	addu	v0,zero,zero
+    f8ec:	10520006 	beq	v0,s2,f908 <rppc_generic+0x168>
+    f8f0:	24a50004 	addiu	a1,a1,4
+    f8f4:	8c860000 	lw	a2,0(a0)
+    f8f8:	24420001 	addiu	v0,v0,1
+    f8fc:	aca60020 	sw	a2,32(a1)
+    f900:	08003e3b 	j	f8ec <rppc_generic+0x14c>
+    f904:	24840004 	addiu	a0,a0,4
+    f908:	00121080 	sll	v0,s2,0x2
+    f90c:	8fc90098 	lw	t1,152(s8)
+    f910:	01425021 	addu	t2,t2,v0
+    f914:	00004021 	addu	t0,zero,zero
+    f918:	240bfffc 	addiu	t3,zero,-4
+    f91c:	0112102b 	sltu	v0,t0,s2
+    f920:	1040001c 	beqz	v0,f994 <rppc_generic+0x1f4>
+    f924:	01402021 	addu	a0,t2,zero
+    f928:	8d250000 	lw	a1,0(t1)
+    f92c:	8c660000 	lw	a2,0(v1)
+    f930:	25080001 	addiu	t0,t0,1
+    f934:	afc30038 	sw	v1,56(s8)
+    f938:	afc70040 	sw	a3,64(s8)
+    f93c:	afc80030 	sw	t0,48(s8)
+    f940:	afc9003c 	sw	t1,60(s8)
+    f944:	afca0034 	sw	t2,52(s8)
+    f948:	afcb0048 	sw	t3,72(s8)
+    f94c:	0c00c12b 	jal	304ac <memcpy>
+    f950:	afcc0044 	sw	t4,68(s8)
+    f954:	8fc30038 	lw	v1,56(s8)
+    f958:	8fc9003c 	lw	t1,60(s8)
+    f95c:	8c620000 	lw	v0,0(v1)
+    f960:	8fcb0048 	lw	t3,72(s8)
+    f964:	30450003 	andi	a1,v0,0x3
+    f968:	25290004 	addiu	t1,t1,4
+    f96c:	004b2024 	and	a0,v0,t3
+    f970:	8fc70040 	lw	a3,64(s8)
+    f974:	8fc80030 	lw	t0,48(s8)
+    f978:	8fca0034 	lw	t2,52(s8)
+    f97c:	10a00002 	beqz	a1,f988 <rppc_generic+0x1e8>
+    f980:	8fcc0044 	lw	t4,68(s8)
+    f984:	24820004 	addiu	v0,a0,4
+    f988:	01425021 	addu	t2,t2,v0
+    f98c:	08003e47 	j	f91c <rppc_generic+0x17c>
+    f990:	24630004 	addiu	v1,v1,4
+    f994:	8fc20090 	lw	v0,144(s8)
+    f998:	02e02021 	addu	a0,s7,zero
+    f99c:	02c02821 	addu	a1,s6,zero
+    f9a0:	02a03021 	addu	a2,s5,zero
+    f9a4:	afb40010 	sw	s4,16(sp)
+    f9a8:	afb20014 	sw	s2,20(sp)
+    f9ac:	afb10024 	sw	s1,36(sp)
+    f9b0:	afb30028 	sw	s3,40(sp)
+    f9b4:	afb0002c 	sw	s0,44(sp)
+    f9b8:	afb30020 	sw	s3,32(sp)
+    f9bc:	afa20018 	sw	v0,24(sp)
+    f9c0:	0c003d39 	jal	f4e4 <rpc_send_sync>
+    f9c4:	afac001c 	sw	t4,28(sp)
+    f9c8:	03c0e821 	addu	sp,s8,zero
+    f9cc:	8fbf0074 	lw	ra,116(sp)
+    f9d0:	8fbe0070 	lw	s8,112(sp)
+    f9d4:	8fb7006c 	lw	s7,108(sp)
+    f9d8:	8fb60068 	lw	s6,104(sp)
+    f9dc:	8fb50064 	lw	s5,100(sp)
+    f9e0:	8fb40060 	lw	s4,96(sp)
+    f9e4:	8fb3005c 	lw	s3,92(sp)
+    f9e8:	8fb20058 	lw	s2,88(sp)
+    f9ec:	8fb10054 	lw	s1,84(sp)
+    f9f0:	8fb00050 	lw	s0,80(sp)
+    f9f4:	03e00008 	jr	ra
+    f9f8:	27bd0078 	addiu	sp,sp,120
+
+0000f9fc <__test1>:
+    f9fc:	27bdff98 	addiu	sp,sp,-104
+    fa00:	afb10044 	sw	s1,68(sp)
+    fa04:	afbf0064 	sw	ra,100(sp)
+    fa08:	afbe0060 	sw	s8,96(sp)
+    fa0c:	afb7005c 	sw	s7,92(sp)
+    fa10:	afb60058 	sw	s6,88(sp)
+    fa14:	afb50054 	sw	s5,84(sp)
+    fa18:	afb40050 	sw	s4,80(sp)
+    fa1c:	afb3004c 	sw	s3,76(sp)
+    fa20:	afb20048 	sw	s2,72(sp)
+    fa24:	afb00040 	sw	s0,64(sp)
+    fa28:	afa0002c 	sw	zero,44(sp)
+    fa2c:	0c00056c 	jal	15b0 <arch_onln_cpu_nr>
+    fa30:	afa00028 	sw	zero,40(sp)
+    fa34:	00408821 	addu	s1,v0,zero
+    fa38:	40022002 	mfc0	v0,$4,2
+    fa3c:	8c420174 	lw	v0,372(v0)
+    fa40:	8c520004 	lw	s2,4(v0)
+    fa44:	401e4800 	mfc0	s8,c0_count
+    fa48:	00000000 	sll	zero,zero,0x0
+    fa4c:	1220000e 	beqz	s1,fa88 <__test1+0x8c>
+    fa50:	3c170001 	lui	s7,0x1
+    fa54:	26f7ffe4 	addiu	s7,s7,-28
+    fa58:	00001021 	addu	v0,zero,zero
+    fa5c:	00008021 	addu	s0,zero,zero
+    fa60:	27b60028 	addiu	s6,sp,40
+    fa64:	24130004 	addiu	s3,zero,4
+    fa68:	27b5002c 	addiu	s5,sp,44
+    fa6c:	24140001 	addiu	s4,zero,1
+    fa70:	16420028 	bne	s2,v0,fb14 <__test1+0x118>
+    fa74:	00000000 	sll	zero,zero,0x0
+    fa78:	26100001 	addiu	s0,s0,1
+    fa7c:	0211182b 	sltu	v1,s0,s1
+    fa80:	1460fffb 	bnez	v1,fa70 <__test1+0x74>
+    fa84:	02001021 	addu	v0,s0,zero
+    fa88:	40034800 	mfc0	v1,c0_count
+    fa8c:	00000000 	sll	zero,zero,0x0
+    fa90:	40027801 	mfc0	v0,$15,1
+    fa94:	007ef023 	subu	s8,v1,s8
+    fa98:	2623ffff 	addiu	v1,s1,-1
+    fa9c:	03c3001b 	divu	zero,s8,v1
+    faa0:	006001f4 	teq	v1,zero,0x7
+    faa4:	30420003 	andi	v0,v0,0x3
+    faa8:	3c030004 	lui	v1,0x4
+    faac:	2463c950 	addiu	v1,v1,-14000
+    fab0:	00021080 	sll	v0,v0,0x2
+    fab4:	00431021 	addu	v0,v0,v1
+    fab8:	3c030004 	lui	v1,0x4
+    fabc:	8c470000 	lw	a3,0(v0)
+    fac0:	8c649100 	lw	a0,-28416(v1)
+    fac4:	3c060003 	lui	a2,0x3
+    fac8:	24c65ab8 	addiu	a2,a2,23224
+    facc:	00002821 	addu	a1,zero,zero
+    fad0:	afb10010 	sw	s1,16(sp)
+    fad4:	00001012 	mflo	v0
+    fad8:	0c0009b0 	jal	26c0 <__fprintk>
+    fadc:	afa20014 	sw	v0,20(sp)
+    fae0:	00001021 	addu	v0,zero,zero
+    fae4:	8fbf0064 	lw	ra,100(sp)
+    fae8:	8fbe0060 	lw	s8,96(sp)
+    faec:	8fb7005c 	lw	s7,92(sp)
+    faf0:	8fb60058 	lw	s6,88(sp)
+    faf4:	8fb50054 	lw	s5,84(sp)
+    faf8:	8fb40050 	lw	s4,80(sp)
+    fafc:	8fb3004c 	lw	s3,76(sp)
+    fb00:	8fb20048 	lw	s2,72(sp)
+    fb04:	8fb10044 	lw	s1,68(sp)
+    fb08:	8fb00040 	lw	s0,64(sp)
+    fb0c:	03e00008 	jr	ra
+    fb10:	27bd0068 	addiu	sp,sp,104
+    fb14:	afb30034 	sw	s3,52(sp)
+    fb18:	afb3003c 	sw	s3,60(sp)
+    fb1c:	afb60030 	sw	s6,48(sp)
+    fb20:	afb50038 	sw	s5,56(sp)
+    fb24:	40032002 	mfc0	v1,$4,2
+    fb28:	8c630174 	lw	v1,372(v1)
+    fb2c:	00402021 	addu	a0,v0,zero
+    fb30:	8c630004 	lw	v1,4(v1)
+    fb34:	00002821 	addu	a1,zero,zero
+    fb38:	00003021 	addu	a2,zero,zero
+    fb3c:	14430007 	bne	v0,v1,fb5c <__test1+0x160>
+    fb40:	02e03821 	addu	a3,s7,zero
+    fb44:	40027801 	mfc0	v0,$15,1
+    fb48:	8fa2002c 	lw	v0,44(sp)
+    fb4c:	24420001 	addiu	v0,v0,1
+    fb50:	afa2002c 	sw	v0,44(sp)
+    fb54:	08003e9e 	j	fa78 <__test1+0x7c>
+    fb58:	afa20028 	sw	v0,40(sp)
+    fb5c:	27a20030 	addiu	v0,sp,48
+    fb60:	afa20018 	sw	v0,24(sp)
+    fb64:	27a20034 	addiu	v0,sp,52
+    fb68:	afa2001c 	sw	v0,28(sp)
+    fb6c:	27a20038 	addiu	v0,sp,56
+    fb70:	afa20020 	sw	v0,32(sp)
+    fb74:	27a2003c 	addiu	v0,sp,60
+    fb78:	afb40010 	sw	s4,16(sp)
+    fb7c:	afb40014 	sw	s4,20(sp)
+    fb80:	0c003de8 	jal	f7a0 <rppc_generic>
+    fb84:	afa20024 	sw	v0,36(sp)
+    fb88:	8fa2002c 	lw	v0,44(sp)
+    fb8c:	8fa30028 	lw	v1,40(sp)
+    fb90:	24420001 	addiu	v0,v0,1
+    fb94:	14430003 	bne	v0,v1,fba4 <__test1+0x1a8>
+    fb98:	00000000 	sll	zero,zero,0x0
+    fb9c:	08003e9e 	j	fa78 <__test1+0x7c>
+    fba0:	afa2002c 	sw	v0,44(sp)
+    fba4:	08003eb9 	j	fae4 <__test1+0xe8>
+    fba8:	2402ffff 	addiu	v0,zero,-1
+
+0000fbac <__test0>:
+    fbac:	27bdff88 	addiu	sp,sp,-120
+    fbb0:	afb3005c 	sw	s3,92(sp)
+    fbb4:	3c130004 	lui	s3,0x4
+    fbb8:	afb50064 	sw	s5,100(sp)
+    fbbc:	2675c960 	addiu	s5,s3,-13984
+    fbc0:	afb20058 	sw	s2,88(sp)
+    fbc4:	8ab20003 	lwl	s2,3(s5)
+    fbc8:	3c020004 	lui	v0,0x4
+    fbcc:	afb10054 	sw	s1,84(sp)
+    fbd0:	afbf0074 	sw	ra,116(sp)
+    fbd4:	afbe0070 	sw	s8,112(sp)
+    fbd8:	afb7006c 	sw	s7,108(sp)
+    fbdc:	afb60068 	sw	s6,104(sp)
+    fbe0:	afb40060 	sw	s4,96(sp)
+    fbe4:	afb00050 	sw	s0,80(sp)
+    fbe8:	afa0002c 	sw	zero,44(sp)
+    fbec:	afa00028 	sw	zero,40(sp)
+    fbf0:	9a72c960 	lwr	s2,-13984(s3)
+    fbf4:	8c5171c0 	lw	s1,29120(v0)
+    fbf8:	40034800 	mfc0	v1,c0_count
+    fbfc:	00000000 	sll	zero,zero,0x0
+    fc00:	1220000d 	beqz	s1,fc38 <__test0+0x8c>
+    fc04:	3252ffff 	andi	s2,s2,0xffff
+    fc08:	00002021 	addu	a0,zero,zero
+    fc0c:	00008021 	addu	s0,zero,zero
+    fc10:	27be0028 	addiu	s8,sp,40
+    fc14:	24140004 	addiu	s4,zero,4
+    fc18:	27b7002c 	addiu	s7,sp,44
+    fc1c:	24160001 	addiu	s6,zero,1
+    fc20:	1650002a 	bne	s2,s0,fccc <__test0+0x120>
+    fc24:	00000000 	sll	zero,zero,0x0
+    fc28:	26100001 	addiu	s0,s0,1
+    fc2c:	0211102b 	sltu	v0,s0,s1
+    fc30:	1440fffb 	bnez	v0,fc20 <__test0+0x74>
+    fc34:	02002021 	addu	a0,s0,zero
+    fc38:	40044800 	mfc0	a0,c0_count
+    fc3c:	00000000 	sll	zero,zero,0x0
+    fc40:	2e220002 	sltiu	v0,s1,2
+    fc44:	14400005 	bnez	v0,fc5c <__test0+0xb0>
+    fc48:	00831823 	subu	v1,a0,v1
+    fc4c:	2622ffff 	addiu	v0,s1,-1
+    fc50:	0062001b 	divu	zero,v1,v0
+    fc54:	004001f4 	teq	v0,zero,0x7
+    fc58:	00001812 	mflo	v1
+    fc5c:	40047801 	mfc0	a0,$15,1
+    fc60:	3c020004 	lui	v0,0x4
+    fc64:	30840003 	andi	a0,a0,0x3
+    fc68:	00042080 	sll	a0,a0,0x2
+    fc6c:	2442c950 	addiu	v0,v0,-14000
+    fc70:	00821021 	addu	v0,a0,v0
+    fc74:	3c040004 	lui	a0,0x4
+    fc78:	8c470000 	lw	a3,0(v0)
+    fc7c:	8c849100 	lw	a0,-28416(a0)
+    fc80:	3c060003 	lui	a2,0x3
+    fc84:	24c65af0 	addiu	a2,a2,23280
+    fc88:	00002821 	addu	a1,zero,zero
+    fc8c:	afb10010 	sw	s1,16(sp)
+    fc90:	0c0009b0 	jal	26c0 <__fprintk>
+    fc94:	afa30014 	sw	v1,20(sp)
+    fc98:	00001021 	addu	v0,zero,zero
+    fc9c:	8fbf0074 	lw	ra,116(sp)
+    fca0:	8fbe0070 	lw	s8,112(sp)
+    fca4:	8fb7006c 	lw	s7,108(sp)
+    fca8:	8fb60068 	lw	s6,104(sp)
+    fcac:	8fb50064 	lw	s5,100(sp)
+    fcb0:	8fb40060 	lw	s4,96(sp)
+    fcb4:	8fb3005c 	lw	s3,92(sp)
+    fcb8:	8fb20058 	lw	s2,88(sp)
+    fcbc:	8fb10054 	lw	s1,84(sp)
+    fcc0:	8fb00050 	lw	s0,80(sp)
+    fcc4:	03e00008 	jr	ra
+    fcc8:	27bd0078 	addiu	sp,sp,120
+    fccc:	8aa20003 	lwl	v0,3(s5)
+    fcd0:	afbe0030 	sw	s8,48(sp)
+    fcd4:	9a62c960 	lwr	v0,-13984(s3)
+    fcd8:	afb40034 	sw	s4,52(sp)
+    fcdc:	3042ffff 	andi	v0,v0,0xffff
+    fce0:	afb70038 	sw	s7,56(sp)
+    fce4:	14500007 	bne	v0,s0,fd04 <__test0+0x158>
+    fce8:	afb4003c 	sw	s4,60(sp)
+    fcec:	40027801 	mfc0	v0,$15,1
+    fcf0:	8fa2002c 	lw	v0,44(sp)
+    fcf4:	24420001 	addiu	v0,v0,1
+    fcf8:	afa2002c 	sw	v0,44(sp)
+    fcfc:	08003f0a 	j	fc28 <__test0+0x7c>
+    fd00:	afa20028 	sw	v0,40(sp)
+    fd04:	40057801 	mfc0	a1,$15,1
+    fd08:	afa30048 	sw	v1,72(sp)
+    fd0c:	afa40044 	sw	a0,68(sp)
+    fd10:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    fd14:	afa50040 	sw	a1,64(sp)
+    fd18:	8fa40044 	lw	a0,68(sp)
+    fd1c:	8fa50040 	lw	a1,64(sp)
+    fd20:	70443002 	mul	a2,v0,a0
+    fd24:	27a20030 	addiu	v0,sp,48
+    fd28:	afa20018 	sw	v0,24(sp)
+    fd2c:	27a20034 	addiu	v0,sp,52
+    fd30:	30a50003 	andi	a1,a1,0x3
+    fd34:	afa2001c 	sw	v0,28(sp)
+    fd38:	3c070001 	lui	a3,0x1
+    fd3c:	27a20038 	addiu	v0,sp,56
+    fd40:	00c52021 	addu	a0,a2,a1
+    fd44:	afa20020 	sw	v0,32(sp)
+    fd48:	24050001 	addiu	a1,zero,1
+    fd4c:	27a2003c 	addiu	v0,sp,60
+    fd50:	00003021 	addu	a2,zero,zero
+    fd54:	24e7ffe4 	addiu	a3,a3,-28
+    fd58:	afb60010 	sw	s6,16(sp)
+    fd5c:	afb60014 	sw	s6,20(sp)
+    fd60:	0c003de8 	jal	f7a0 <rppc_generic>
+    fd64:	afa20024 	sw	v0,36(sp)
+    fd68:	8fa2002c 	lw	v0,44(sp)
+    fd6c:	8fa40028 	lw	a0,40(sp)
+    fd70:	24420001 	addiu	v0,v0,1
+    fd74:	14440003 	bne	v0,a0,fd84 <__test0+0x1d8>
+    fd78:	8fa30048 	lw	v1,72(sp)
+    fd7c:	08003f0a 	j	fc28 <__test0+0x7c>
+    fd80:	afa2002c 	sw	v0,44(sp)
+    fd84:	08003f27 	j	fc9c <__test0+0xf0>
+    fd88:	2402ffff 	addiu	v0,zero,-1
+
+0000fd8c <rpc_send_rsp>:
+    fd8c:	27bdffd0 	addiu	sp,sp,-48
+    fd90:	afb10024 	sw	s1,36(sp)
+    fd94:	8c910000 	lw	s1,0(a0)
+    fd98:	afbf002c 	sw	ra,44(sp)
+    fd9c:	afa50014 	sw	a1,20(sp)
+    fda0:	afa60018 	sw	a2,24(sp)
+    fda4:	afa70010 	sw	a3,16(sp)
+    fda8:	afb20028 	sw	s2,40(sp)
+    fdac:	afb00020 	sw	s0,32(sp)
+    fdb0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    fdb4:	00808021 	addu	s0,a0,zero
+    fdb8:	0222001b 	divu	zero,s1,v0
+    fdbc:	004001f4 	teq	v0,zero,0x7
+    fdc0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+    fdc4:	00009012 	mflo	s2
+    fdc8:	0222001b 	divu	zero,s1,v0
+    fdcc:	004001f4 	teq	v0,zero,0x7
+    fdd0:	0c00207a 	jal	81e8 <cpu_lid2ptr>
+    fdd4:	00002010 	mfhi	a0
+    fdd8:	40037801 	mfc0	v1,$15,1
+    fddc:	3c020004 	lui	v0,0x4
+    fde0:	30630003 	andi	v1,v1,0x3
+    fde4:	8fa50014 	lw	a1,20(sp)
+    fde8:	00031880 	sll	v1,v1,0x2
+    fdec:	8fa70010 	lw	a3,16(sp)
+    fdf0:	2442c950 	addiu	v0,v0,-14000
+    fdf4:	00621021 	addu	v0,v1,v0
+    fdf8:	8e030004 	lw	v1,4(s0)
+    fdfc:	8c440000 	lw	a0,0(v0)
+    fe00:	a0a7001c 	sb	a3,28(a1)
+    fe04:	8e020014 	lw	v0,20(s0)
+    fe08:	aca30004 	sw	v1,4(a1)
+    fe0c:	8fa60018 	lw	a2,24(sp)
+    fe10:	3c030001 	lui	v1,0x1
+    fe14:	2463f2a4 	addiu	v1,v1,-3420
+    fe18:	aca40000 	sw	a0,0(a1)
+    fe1c:	aca30018 	sw	v1,24(a1)
+    fe20:	aca20014 	sw	v0,20(a1)
+    fe24:	aca0000c 	sw	zero,12(a1)
+    fe28:	aca60008 	sw	a2,8(a1)
+    fe2c:	aca00020 	sw	zero,32(a1)
+    fe30:	aca00010 	sw	zero,16(a1)
+    fe34:	02002021 	addu	a0,s0,zero
+    fe38:	afa50014 	sw	a1,20(sp)
+    fe3c:	0c003a14 	jal	e850 <rpc_release>
+    fe40:	8e10000c 	lw	s0,12(s0)
+    fe44:	3c020004 	lui	v0,0x4
+    fe48:	2443c960 	addiu	v1,v0,-13984
+    fe4c:	88710003 	lwl	s1,3(v1)
+    fe50:	8fa50014 	lw	a1,20(sp)
+    fe54:	9851c960 	lwr	s1,-13984(v0)
+    fe58:	3231ffff 	andi	s1,s1,0xffff
+    fe5c:	1632001e 	bne	s1,s2,fed8 <rpc_send_rsp+0x14c>
+    fe60:	8fa60018 	lw	a2,24(sp)
+    fe64:	0c00c12b 	jal	304ac <memcpy>
+    fe68:	02002021 	addu	a0,s0,zero
+    fe6c:	3231ffff 	andi	s1,s1,0xffff
+    fe70:	3c030004 	lui	v1,0x4
+    fe74:	00113900 	sll	a3,s1,0x4
+    fe78:	2e2a0101 	sltiu	t2,s1,257
+    fe7c:	2463c9a0 	addiu	v1,v1,-13920
+    fe80:	00118880 	sll	s1,s1,0x2
+    fe84:	0000000f 	sync
+    fe88:	1140004f 	beqz	t2,ffc8 <rpc_send_rsp+0x23c>
+    fe8c:	26100020 	addiu	s0,s0,32
+    fe90:	00f13823 	subu	a3,a3,s1
+    fe94:	00671821 	addu	v1,v1,a3
+    fe98:	8c620000 	lw	v0,0(v1)
+    fe9c:	3c035555 	lui	v1,0x5555
+    fea0:	34635555 	ori	v1,v1,0x5555
+    fea4:	10430048 	beq	v0,v1,ffc8 <rpc_send_rsp+0x23c>
+    fea8:	24030001 	addiu	v1,zero,1
+    feac:	4808c000 	mfc2	t0,$24
+    feb0:	4882c000 	mtc2	v0,$24
+    feb4:	ae030000 	sw	v1,0(s0)
+    feb8:	4888c000 	mtc2	t0,$24
+    febc:	8fbf002c 	lw	ra,44(sp)
+    fec0:	00001021 	addu	v0,zero,zero
+    fec4:	8fb20028 	lw	s2,40(sp)
+    fec8:	8fb10024 	lw	s1,36(sp)
+    fecc:	8fb00020 	lw	s0,32(sp)
+    fed0:	03e00008 	jr	ra
+    fed4:	27bd0030 	addiu	sp,sp,48
+    fed8:	2e220101 	sltiu	v0,s1,257
+    fedc:	14400003 	bnez	v0,feec <rpc_send_rsp+0x160>
+    fee0:	00111100 	sll	v0,s1,0x4
+    fee4:	08003fb9 	j	fee4 <rpc_send_rsp+0x158>
+    fee8:	00000000 	sll	zero,zero,0x0
+    feec:	3c030004 	lui	v1,0x4
+    fef0:	00118880 	sll	s1,s1,0x2
+    fef4:	00511023 	subu	v0,v0,s1
+    fef8:	2463c9a0 	addiu	v1,v1,-13920
+    fefc:	00621021 	addu	v0,v1,v0
+    ff00:	8c4b0000 	lw	t3,0(v0)
+    ff04:	3c025555 	lui	v0,0x5555
+    ff08:	34425555 	ori	v0,v0,0x5555
+    ff0c:	1162fff5 	beq	t3,v0,fee4 <rpc_send_rsp+0x158>
+    ff10:	00000000 	sll	zero,zero,0x0
+    ff14:	3251ffff 	andi	s1,s2,0xffff
+    ff18:	2e2a0101 	sltiu	t2,s1,257
+    ff1c:	1140002c 	beqz	t2,ffd0 <rpc_send_rsp+0x244>
+    ff20:	00113900 	sll	a3,s1,0x4
+    ff24:	00118880 	sll	s1,s1,0x2
+    ff28:	00f12023 	subu	a0,a3,s1
+    ff2c:	00642021 	addu	a0,v1,a0
+    ff30:	8c8c0000 	lw	t4,0(a0)
+    ff34:	11820026 	beq	t4,v0,ffd0 <rpc_send_rsp+0x244>
+    ff38:	00b01025 	or	v0,a1,s0
+    ff3c:	30420003 	andi	v0,v0,0x3
+    ff40:	10400025 	beqz	v0,ffd8 <rpc_send_rsp+0x24c>
+    ff44:	00000000 	sll	zero,zero,0x0
+    ff48:	00001021 	addu	v0,zero,zero
+    ff4c:	00006821 	addu	t5,zero,zero
+    ff50:	08003fdf 	j	ff7c <rpc_send_rsp+0x1f0>
+    ff54:	00002021 	addu	a0,zero,zero
+    ff58:	020e7821 	addu	t7,s0,t6
+    ff5c:	00ae7021 	addu	t6,a1,t6
+    ff60:	4808c000 	mfc2	t0,$24
+    ff64:	488bc000 	mtc2	t3,$24
+    ff68:	8dc90000 	lw	t1,0(t6)
+    ff6c:	488cc000 	mtc2	t4,$24
+    ff70:	ade90000 	sw	t1,0(t7)
+    ff74:	4888c000 	mtc2	t0,$24
+    ff78:	24840001 	addiu	a0,a0,1
+    ff7c:	148dfff6 	bne	a0,t5,ff58 <rpc_send_rsp+0x1cc>
+    ff80:	00047080 	sll	t6,a0,0x2
+    ff84:	00a22821 	addu	a1,a1,v0
+    ff88:	08003fed 	j	ffb4 <rpc_send_rsp+0x228>
+    ff8c:	02022021 	addu	a0,s0,v0
+    ff90:	4808c000 	mfc2	t0,$24
+    ff94:	488bc000 	mtc2	t3,$24
+    ff98:	80a90000 	lb	t1,0(a1)
+    ff9c:	488cc000 	mtc2	t4,$24
+    ffa0:	a0890000 	sb	t1,0(a0)
+    ffa4:	4888c000 	mtc2	t0,$24
+    ffa8:	24420001 	addiu	v0,v0,1
+    ffac:	24a50001 	addiu	a1,a1,1
+    ffb0:	24840001 	addiu	a0,a0,1
+    ffb4:	0046402b 	sltu	t0,v0,a2
+    ffb8:	1500fff5 	bnez	t0,ff90 <rpc_send_rsp+0x204>
+    ffbc:	00000000 	sll	zero,zero,0x0
+    ffc0:	08003fa1 	j	fe84 <rpc_send_rsp+0xf8>
+    ffc4:	00000000 	sll	zero,zero,0x0
+    ffc8:	08003ff2 	j	ffc8 <rpc_send_rsp+0x23c>
+    ffcc:	00000000 	sll	zero,zero,0x0
+    ffd0:	08003ff4 	j	ffd0 <rpc_send_rsp+0x244>
+    ffd4:	00000000 	sll	zero,zero,0x0
+    ffd8:	00066882 	srl	t5,a2,0x2
+    ffdc:	08003fd4 	j	ff50 <rpc_send_rsp+0x1c4>
+    ffe0:	000d1080 	sll	v0,t5,0x2
+
+0000ffe4 <__increment_demarshall>:
+    ffe4:	27bdffd8 	addiu	sp,sp,-40
+    ffe8:	afbf0024 	sw	ra,36(sp)
+    ffec:	afbe0020 	sw	s8,32(sp)
+    fff0:	afb2001c 	sw	s2,28(sp)
+    fff4:	03a0f021 	addu	s8,sp,zero
+    fff8:	afb10018 	sw	s1,24(sp)
+    fffc:	afb00014 	sw	s0,20(sp)
+   10000:	27bdfff0 	addiu	sp,sp,-16
+   10004:	27b20010 	addiu	s2,sp,16
+   10008:	27bdffc8 	addiu	sp,sp,-56
+   1000c:	27b00010 	addiu	s0,sp,16
+   10010:	26020028 	addiu	v0,s0,40
+   10014:	2403002c 	addiu	v1,zero,44
+   10018:	00808821 	addu	s1,a0,zero
+   1001c:	ae030008 	sw	v1,8(s0)
+   10020:	ae420000 	sw	v0,0(s2)
+   10024:	24030004 	addiu	v1,zero,4
+   10028:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1002c:	ae030024 	sw	v1,36(s0)
+   10030:	02202021 	addu	a0,s1,zero
+   10034:	00002821 	addu	a1,zero,zero
+   10038:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1003c:	8e520000 	lw	s2,0(s2)
+   10040:	8c420000 	lw	v0,0(v0)
+   10044:	02202021 	addu	a0,s1,zero
+   10048:	24420001 	addiu	v0,v0,1
+   1004c:	ae420000 	sw	v0,0(s2)
+   10050:	02002821 	addu	a1,s0,zero
+   10054:	2406002c 	addiu	a2,zero,44
+   10058:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   1005c:	24070001 	addiu	a3,zero,1
+   10060:	03c0e821 	addu	sp,s8,zero
+   10064:	8fbf0024 	lw	ra,36(sp)
+   10068:	8fbe0020 	lw	s8,32(sp)
+   1006c:	8fb2001c 	lw	s2,28(sp)
+   10070:	8fb10018 	lw	s1,24(sp)
+   10074:	8fb00014 	lw	s0,20(sp)
+   10078:	03e00008 	jr	ra
+   1007c:	27bd0028 	addiu	sp,sp,40
+
+00010080 <rr_clock>:
+   10080:	8c820144 	lw	v0,324(a0)
+   10084:	18400003 	blez	v0,10094 <rr_clock+0x14>
+   10088:	00000000 	sll	zero,zero,0x0
+   1008c:	2442ffff 	addiu	v0,v0,-1
+   10090:	ac820144 	sw	v0,324(a0)
+   10094:	14400007 	bnez	v0,100b4 <rr_clock+0x34>
+   10098:	24020002 	addiu	v0,zero,2
+   1009c:	8c830184 	lw	v1,388(a0)
+   100a0:	10620004 	beq	v1,v0,100b4 <rr_clock+0x34>
+   100a4:	00000000 	sll	zero,zero,0x0
+   100a8:	8c820134 	lw	v0,308(a0)
+   100ac:	34420001 	ori	v0,v0,0x1
+   100b0:	ac820134 	sw	v0,308(a0)
+   100b4:	03e00008 	jr	ra
+   100b8:	00000000 	sll	zero,zero,0x0
+
+000100bc <rr_sched_strategy>:
+   100bc:	03e00008 	jr	ra
+   100c0:	00000000 	sll	zero,zero,0x0
+
+000100c4 <rr_yield>:
+   100c4:	03e00008 	jr	ra
+   100c8:	00000000 	sll	zero,zero,0x0
+
+000100cc <rr_remove>:
+   100cc:	8c820178 	lw	v0,376(a0)
+   100d0:	240affff 	addiu	t2,zero,-1
+   100d4:	8c45002c 	lw	a1,44(v0)
+   100d8:	24090001 	addiu	t1,zero,1
+   100dc:	8ca20000 	lw	v0,0(a1)
+   100e0:	1440fffe 	bnez	v0,100dc <rr_remove+0x10>
+   100e4:	00000000 	sll	zero,zero,0x0
+   100e8:	0000000f 	sync
+   100ec:	000a4025 	or	t0,zero,t2
+   100f0:	c0a30000 	ll	v1,0(a1)
+   100f4:	14620004 	bne	v1,v0,10108 <rr_remove+0x3c>
+   100f8:	24070000 	addiu	a3,zero,0
+   100fc:	e0a80000 	sc	t0,0(a1)
+   10100:	01003825 	or	a3,t0,zero
+   10104:	0000000f 	sync
+   10108:	00e03025 	or	a2,a3,zero
+   1010c:	14c9fff3 	bne	a2,t1,100dc <rr_remove+0x10>
+   10110:	3c020001 	lui	v0,0x1
+   10114:	8c830174 	lw	v1,372(a0)
+   10118:	00621021 	addu	v0,v1,v0
+   1011c:	944382d8 	lhu	v1,-32040(v0)
+   10120:	944482da 	lhu	a0,-32038(v0)
+   10124:	2463ffff 	addiu	v1,v1,-1
+   10128:	2484ffff 	addiu	a0,a0,-1
+   1012c:	a44482da 	sh	a0,-32038(v0)
+   10130:	a44382d8 	sh	v1,-32040(v0)
+   10134:	00051025 	or	v0,zero,a1
+   10138:	0000000f 	sync
+   1013c:	ac400000 	sw	zero,0(v0)
+   10140:	0000000f 	sync
+   10144:	03e00008 	jr	ra
+   10148:	00000000 	sll	zero,zero,0x0
+
+0001014c <rr_exit>:
+   1014c:	8c820178 	lw	v0,376(a0)
+   10150:	240affff 	addiu	t2,zero,-1
+   10154:	8c45002c 	lw	a1,44(v0)
+   10158:	24090001 	addiu	t1,zero,1
+   1015c:	8ca20000 	lw	v0,0(a1)
+   10160:	1440fffe 	bnez	v0,1015c <rr_exit+0x10>
+   10164:	00000000 	sll	zero,zero,0x0
+   10168:	0000000f 	sync
+   1016c:	000a4025 	or	t0,zero,t2
+   10170:	c0a30000 	ll	v1,0(a1)
+   10174:	14620004 	bne	v1,v0,10188 <rr_exit+0x3c>
+   10178:	24070000 	addiu	a3,zero,0
+   1017c:	e0a80000 	sc	t0,0(a1)
+   10180:	01003825 	or	a3,t0,zero
+   10184:	0000000f 	sync
+   10188:	00e03025 	or	a2,a3,zero
+   1018c:	14c9fff3 	bne	a2,t1,1015c <rr_exit+0x10>
+   10190:	3c020001 	lui	v0,0x1
+   10194:	8c830174 	lw	v1,372(a0)
+   10198:	00621021 	addu	v0,v1,v0
+   1019c:	944682d8 	lhu	a2,-32040(v0)
+   101a0:	8c830184 	lw	v1,388(a0)
+   101a4:	24c6ffff 	addiu	a2,a2,-1
+   101a8:	14600004 	bnez	v1,101bc <rr_exit+0x70>
+   101ac:	a44682d8 	sh	a2,-32040(v0)
+   101b0:	944382da 	lhu	v1,-32038(v0)
+   101b4:	2463ffff 	addiu	v1,v1,-1
+   101b8:	a44382da 	sh	v1,-32038(v0)
+   101bc:	24020005 	addiu	v0,zero,5
+   101c0:	ac820130 	sw	v0,304(a0)
+   101c4:	00051025 	or	v0,zero,a1
+   101c8:	0000000f 	sync
+   101cc:	ac400000 	sw	zero,0(v0)
+   101d0:	0000000f 	sync
+   101d4:	03e00008 	jr	ra
+   101d8:	00000000 	sll	zero,zero,0x0
+
+000101dc <rr_sleep>:
+   101dc:	8c820178 	lw	v0,376(a0)
+   101e0:	240affff 	addiu	t2,zero,-1
+   101e4:	8c45002c 	lw	a1,44(v0)
+   101e8:	24090001 	addiu	t1,zero,1
+   101ec:	8ca20000 	lw	v0,0(a1)
+   101f0:	1440fffe 	bnez	v0,101ec <rr_sleep+0x10>
+   101f4:	00000000 	sll	zero,zero,0x0
+   101f8:	0000000f 	sync
+   101fc:	000a4025 	or	t0,zero,t2
+   10200:	c0a30000 	ll	v1,0(a1)
+   10204:	14620004 	bne	v1,v0,10218 <rr_sleep+0x3c>
+   10208:	24070000 	addiu	a3,zero,0
+   1020c:	e0a80000 	sc	t0,0(a1)
+   10210:	01003825 	or	a3,t0,zero
+   10214:	0000000f 	sync
+   10218:	00e03025 	or	a2,a3,zero
+   1021c:	14c9fff3 	bne	a2,t1,101ec <rr_sleep+0x10>
+   10220:	24020003 	addiu	v0,zero,3
+   10224:	8c830130 	lw	v1,304(a0)
+   10228:	10620002 	beq	v1,v0,10234 <rr_sleep+0x58>
+   1022c:	24020004 	addiu	v0,zero,4
+   10230:	ac820130 	sw	v0,304(a0)
+   10234:	00051025 	or	v0,zero,a1
+   10238:	0000000f 	sync
+   1023c:	ac400000 	sw	zero,0(v0)
+   10240:	0000000f 	sync
+   10244:	03e00008 	jr	ra
+   10248:	00000000 	sll	zero,zero,0x0
+
+0001024c <rr_wakeup>:
+   1024c:	8c8b0178 	lw	t3,376(a0)
+   10250:	8c8c0184 	lw	t4,388(a0)
+   10254:	8d65002c 	lw	a1,44(t3)
+   10258:	240affff 	addiu	t2,zero,-1
+   1025c:	24090001 	addiu	t1,zero,1
+   10260:	8ca20000 	lw	v0,0(a1)
+   10264:	1440fffe 	bnez	v0,10260 <rr_wakeup+0x14>
+   10268:	00000000 	sll	zero,zero,0x0
+   1026c:	0000000f 	sync
+   10270:	000a4025 	or	t0,zero,t2
+   10274:	c0a30000 	ll	v1,0(a1)
+   10278:	14620004 	bne	v1,v0,1028c <rr_wakeup+0x40>
+   1027c:	24070000 	addiu	a3,zero,0
+   10280:	e0a80000 	sc	t0,0(a1)
+   10284:	01003825 	or	a3,t0,zero
+   10288:	0000000f 	sync
+   1028c:	00e03025 	or	a2,a3,zero
+   10290:	14c9fff3 	bne	a2,t1,10260 <rr_wakeup+0x14>
+   10294:	00000000 	sll	zero,zero,0x0
+   10298:	8d620000 	lw	v0,0(t3)
+   1029c:	318c0001 	andi	t4,t4,0x1
+   102a0:	24420001 	addiu	v0,v0,1
+   102a4:	ad620000 	sw	v0,0(t3)
+   102a8:	24020003 	addiu	v0,zero,3
+   102ac:	15800015 	bnez	t4,10304 <rr_wakeup+0xb8>
+   102b0:	ac820130 	sw	v0,304(a0)
+   102b4:	8ca60024 	lw	a2,36(a1)
+   102b8:	8ca7001c 	lw	a3,28(a1)
+   102bc:	94c80004 	lhu	t0,4(a2)
+   102c0:	8ca30030 	lw	v1,48(a1)
+   102c4:	248201e8 	addiu	v0,a0,488
+   102c8:	24e70001 	addiu	a3,a3,1
+   102cc:	25080001 	addiu	t0,t0,1
+   102d0:	24a90030 	addiu	t1,a1,48
+   102d4:	ac8901ec 	sw	t1,492(a0)
+   102d8:	ac8301e8 	sw	v1,488(a0)
+   102dc:	a4c80004 	sh	t0,4(a2)
+   102e0:	ac620004 	sw	v0,4(v1)
+   102e4:	aca7001c 	sw	a3,28(a1)
+   102e8:	aca20030 	sw	v0,48(a1)
+   102ec:	00051025 	or	v0,zero,a1
+   102f0:	0000000f 	sync
+   102f4:	ac400000 	sw	zero,0(v0)
+   102f8:	0000000f 	sync
+   102fc:	03e00008 	jr	ra
+   10300:	00000000 	sll	zero,zero,0x0
+   10304:	8ca60024 	lw	a2,36(a1)
+   10308:	8ca30028 	lw	v1,40(a1)
+   1030c:	94c70006 	lhu	a3,6(a2)
+   10310:	248201e8 	addiu	v0,a0,488
+   10314:	24e70001 	addiu	a3,a3,1
+   10318:	24a80028 	addiu	t0,a1,40
+   1031c:	ac8801ec 	sw	t0,492(a0)
+   10320:	ac8301e8 	sw	v1,488(a0)
+   10324:	a4c70006 	sh	a3,6(a2)
+   10328:	ac620004 	sw	v0,4(v1)
+   1032c:	aca20028 	sw	v0,40(a1)
+   10330:	40022002 	mfc0	v0,$4,2
+   10334:	8c430134 	lw	v1,308(v0)
+   10338:	34630401 	ori	v1,v1,0x401
+   1033c:	ac430134 	sw	v1,308(v0)
+   10340:	00051025 	or	v0,zero,a1
+   10344:	0000000f 	sync
+   10348:	ac400000 	sw	zero,0(v0)
+   1034c:	0000000f 	sync
+   10350:	03e00008 	jr	ra
+   10354:	00000000 	sll	zero,zero,0x0
+
+00010358 <rr_add_created>:
+   10358:	8c8b0178 	lw	t3,376(a0)
+   1035c:	8c8c0184 	lw	t4,388(a0)
+   10360:	8d65002c 	lw	a1,44(t3)
+   10364:	240affff 	addiu	t2,zero,-1
+   10368:	24090001 	addiu	t1,zero,1
+   1036c:	8ca20000 	lw	v0,0(a1)
+   10370:	1440fffe 	bnez	v0,1036c <rr_add_created+0x14>
+   10374:	00000000 	sll	zero,zero,0x0
+   10378:	0000000f 	sync
+   1037c:	000a4025 	or	t0,zero,t2
+   10380:	c0a30000 	ll	v1,0(a1)
+   10384:	14620004 	bne	v1,v0,10398 <rr_add_created+0x40>
+   10388:	24070000 	addiu	a3,zero,0
+   1038c:	e0a80000 	sc	t0,0(a1)
+   10390:	01003825 	or	a3,t0,zero
+   10394:	0000000f 	sync
+   10398:	00e03025 	or	a2,a3,zero
+   1039c:	14c9fff3 	bne	a2,t1,1036c <rr_add_created+0x14>
+   103a0:	00000000 	sll	zero,zero,0x0
+   103a4:	8ca20024 	lw	v0,36(a1)
+   103a8:	8d660000 	lw	a2,0(t3)
+   103ac:	94430000 	lhu	v1,0(v0)
+   103b0:	24c60001 	addiu	a2,a2,1
+   103b4:	24630001 	addiu	v1,v1,1
+   103b8:	318c0001 	andi	t4,t4,0x1
+   103bc:	ad660000 	sw	a2,0(t3)
+   103c0:	15800027 	bnez	t4,10460 <rr_add_created+0x108>
+   103c4:	a4430000 	sh	v1,0(v0)
+   103c8:	8ca6001c 	lw	a2,28(a1)
+   103cc:	8ca30034 	lw	v1,52(a1)
+   103d0:	24c60001 	addiu	a2,a2,1
+   103d4:	aca6001c 	sw	a2,28(a1)
+   103d8:	944a0002 	lhu	t2,2(v0)
+   103dc:	944b0004 	lhu	t3,4(v0)
+   103e0:	8c880134 	lw	t0,308(a0)
+   103e4:	8c660000 	lw	a2,0(v1)
+   103e8:	248701e8 	addiu	a3,a0,488
+   103ec:	254a0001 	addiu	t2,t2,1
+   103f0:	256b0001 	addiu	t3,t3,1
+   103f4:	31090200 	andi	t1,t0,0x200
+   103f8:	ac8601e8 	sw	a2,488(a0)
+   103fc:	ac8301ec 	sw	v1,492(a0)
+   10400:	a44b0004 	sh	t3,4(v0)
+   10404:	a44a0002 	sh	t2,2(v0)
+   10408:	ac670000 	sw	a3,0(v1)
+   1040c:	15200009 	bnez	t1,10434 <rr_add_created+0xdc>
+   10410:	acc70004 	sw	a3,4(a2)
+   10414:	24020004 	addiu	v0,zero,4
+   10418:	ac820160 	sw	v0,352(a0)
+   1041c:	00051025 	or	v0,zero,a1
+   10420:	0000000f 	sync
+   10424:	ac400000 	sw	zero,0(v0)
+   10428:	0000000f 	sync
+   1042c:	03e00008 	jr	ra
+   10430:	00000000 	sll	zero,zero,0x0
+   10434:	2402fdff 	addiu	v0,zero,-513
+   10438:	01024024 	and	t0,t0,v0
+   1043c:	2402000c 	addiu	v0,zero,12
+   10440:	ac880134 	sw	t0,308(a0)
+   10444:	ac820160 	sw	v0,352(a0)
+   10448:	00051025 	or	v0,zero,a1
+   1044c:	0000000f 	sync
+   10450:	ac400000 	sw	zero,0(v0)
+   10454:	0000000f 	sync
+   10458:	03e00008 	jr	ra
+   1045c:	00000000 	sll	zero,zero,0x0
+   10460:	8ca3002c 	lw	v1,44(a1)
+   10464:	94480006 	lhu	t0,6(v0)
+   10468:	8c670000 	lw	a3,0(v1)
+   1046c:	248601e8 	addiu	a2,a0,488
+   10470:	25080001 	addiu	t0,t0,1
+   10474:	ac8301ec 	sw	v1,492(a0)
+   10478:	ac8701e8 	sw	a3,488(a0)
+   1047c:	a4480006 	sh	t0,6(v0)
+   10480:	ace60004 	sw	a2,4(a3)
+   10484:	ac660000 	sw	a2,0(v1)
+   10488:	00051025 	or	v0,zero,a1
+   1048c:	0000000f 	sync
+   10490:	ac400000 	sw	zero,0(v0)
+   10494:	0000000f 	sync
+   10498:	03e00008 	jr	ra
+   1049c:	00000000 	sll	zero,zero,0x0
+
+000104a0 <rr_elect_balancing>:
+   104a0:	400b2002 	mfc0	t3,$4,2
+   104a4:	8d6c0134 	lw	t4,308(t3)
+   104a8:	2402fffe 	addiu	v0,zero,-2
+   104ac:	01826024 	and	t4,t4,v0
+   104b0:	8c85002c 	lw	a1,44(a0)
+   104b4:	ad6c0134 	sw	t4,308(t3)
+   104b8:	240affff 	addiu	t2,zero,-1
+   104bc:	24090001 	addiu	t1,zero,1
+   104c0:	8ca20000 	lw	v0,0(a1)
+   104c4:	1440fffe 	bnez	v0,104c0 <rr_elect_balancing+0x20>
+   104c8:	00000000 	sll	zero,zero,0x0
+   104cc:	0000000f 	sync
+   104d0:	000a4025 	or	t0,zero,t2
+   104d4:	c0a30000 	ll	v1,0(a1)
+   104d8:	14620004 	bne	v1,v0,104ec <rr_elect_balancing+0x4c>
+   104dc:	24070000 	addiu	a3,zero,0
+   104e0:	e0a80000 	sc	t0,0(a1)
+   104e4:	01003825 	or	a3,t0,zero
+   104e8:	0000000f 	sync
+   104ec:	00e03025 	or	a2,a3,zero
+   104f0:	14c9fff3 	bne	a2,t1,104c0 <rr_elect_balancing+0x20>
+   104f4:	24030002 	addiu	v1,zero,2
+   104f8:	8d660184 	lw	a2,388(t3)
+   104fc:	10c30004 	beq	a2,v1,10510 <rr_elect_balancing+0x70>
+   10500:	8c820000 	lw	v0,0(a0)
+   10504:	8d670130 	lw	a3,304(t3)
+   10508:	10e3001b 	beq	a3,v1,10578 <rr_elect_balancing+0xd8>
+   1050c:	24080003 	addiu	t0,zero,3
+   10510:	10400034 	beqz	v0,105e4 <rr_elect_balancing+0x144>
+   10514:	00000000 	sll	zero,zero,0x0
+   10518:	8ca30028 	lw	v1,40(a1)
+   1051c:	24a60028 	addiu	a2,a1,40
+   10520:	10660046 	beq	v1,a2,1063c <rr_elect_balancing+0x19c>
+   10524:	2463fe18 	addiu	v1,v1,-488
+   10528:	8ca60024 	lw	a2,36(a1)
+   1052c:	94c70006 	lhu	a3,6(a2)
+   10530:	24e7ffff 	addiu	a3,a3,-1
+   10534:	a4c70006 	sh	a3,6(a2)
+   10538:	8c690134 	lw	t1,308(v1)
+   1053c:	8c6701e8 	lw	a3,488(v1)
+   10540:	8c6601ec 	lw	a2,492(v1)
+   10544:	2408fbfe 	addiu	t0,zero,-1026
+   10548:	01284024 	and	t0,t1,t0
+   1054c:	2442ffff 	addiu	v0,v0,-1
+   10550:	ac680134 	sw	t0,308(v1)
+   10554:	ace60004 	sw	a2,4(a3)
+   10558:	acc70000 	sw	a3,0(a2)
+   1055c:	ac820000 	sw	v0,0(a0)
+   10560:	00051025 	or	v0,zero,a1
+   10564:	0000000f 	sync
+   10568:	ac400000 	sw	zero,0(v0)
+   1056c:	0000000f 	sync
+   10570:	03e00008 	jr	ra
+   10574:	00601021 	addu	v0,v1,zero
+   10578:	8d670160 	lw	a3,352(t3)
+   1057c:	8d630144 	lw	v1,324(t3)
+   10580:	00e33821 	addu	a3,a3,v1
+   10584:	ad680130 	sw	t0,304(t3)
+   10588:	ad670160 	sw	a3,352(t3)
+   1058c:	14c0001d 	bnez	a2,10604 <rr_elect_balancing+0x164>
+   10590:	24420001 	addiu	v0,v0,1
+   10594:	31860400 	andi	a2,t4,0x400
+   10598:	10c00035 	beqz	a2,10670 <rr_elect_balancing+0x1d0>
+   1059c:	24080004 	addiu	t0,zero,4
+   105a0:	8ca80030 	lw	t0,48(a1)
+   105a4:	256601e8 	addiu	a2,t3,488
+   105a8:	00e31823 	subu	v1,a3,v1
+   105ac:	24a90030 	addiu	t1,a1,48
+   105b0:	ad6901ec 	sw	t1,492(t3)
+   105b4:	ad6801e8 	sw	t0,488(t3)
+   105b8:	ad630160 	sw	v1,352(t3)
+   105bc:	ad060004 	sw	a2,4(t0)
+   105c0:	aca60030 	sw	a2,48(a1)
+   105c4:	8ca30024 	lw	v1,36(a1)
+   105c8:	8ca6001c 	lw	a2,28(a1)
+   105cc:	94670004 	lhu	a3,4(v1)
+   105d0:	24c60001 	addiu	a2,a2,1
+   105d4:	24e70001 	addiu	a3,a3,1
+   105d8:	a4670004 	sh	a3,4(v1)
+   105dc:	1440ffce 	bnez	v0,10518 <rr_elect_balancing+0x78>
+   105e0:	aca6001c 	sw	a2,28(a1)
+   105e4:	ac820000 	sw	v0,0(a0)
+   105e8:	00001821 	addu	v1,zero,zero
+   105ec:	00051025 	or	v0,zero,a1
+   105f0:	0000000f 	sync
+   105f4:	ac400000 	sw	zero,0(v0)
+   105f8:	0000000f 	sync
+   105fc:	03e00008 	jr	ra
+   10600:	00601021 	addu	v0,v1,zero
+   10604:	8ca80024 	lw	t0,36(a1)
+   10608:	8ca3002c 	lw	v1,44(a1)
+   1060c:	95090006 	lhu	t1,6(t0)
+   10610:	8c660000 	lw	a2,0(v1)
+   10614:	25290001 	addiu	t1,t1,1
+   10618:	256701e8 	addiu	a3,t3,488
+   1061c:	a5090006 	sh	t1,6(t0)
+   10620:	24080004 	addiu	t0,zero,4
+   10624:	ad6601e8 	sw	a2,488(t3)
+   10628:	ad6301ec 	sw	v1,492(t3)
+   1062c:	ad680144 	sw	t0,324(t3)
+   10630:	ac670000 	sw	a3,0(v1)
+   10634:	08004144 	j	10510 <rr_elect_balancing+0x70>
+   10638:	acc70004 	sw	a3,4(a2)
+   1063c:	8ca30038 	lw	v1,56(a1)
+   10640:	24a60038 	addiu	a2,a1,56
+   10644:	10660016 	beq	v1,a2,106a0 <rr_elect_balancing+0x200>
+   10648:	00000000 	sll	zero,zero,0x0
+   1064c:	8ca60024 	lw	a2,36(a1)
+   10650:	8ca70020 	lw	a3,32(a1)
+   10654:	94c80004 	lhu	t0,4(a2)
+   10658:	24e7ffff 	addiu	a3,a3,-1
+   1065c:	2508ffff 	addiu	t0,t0,-1
+   10660:	a4c80004 	sh	t0,4(a2)
+   10664:	aca70020 	sw	a3,32(a1)
+   10668:	0800414e 	j	10538 <rr_elect_balancing+0x98>
+   1066c:	2463fe18 	addiu	v1,v1,-488
+   10670:	8ca30034 	lw	v1,52(a1)
+   10674:	2407ffdf 	addiu	a3,zero,-33
+   10678:	8c660000 	lw	a2,0(v1)
+   1067c:	01876024 	and	t4,t4,a3
+   10680:	256701e8 	addiu	a3,t3,488
+   10684:	ad6601e8 	sw	a2,488(t3)
+   10688:	ad6301ec 	sw	v1,492(t3)
+   1068c:	ad680144 	sw	t0,324(t3)
+   10690:	ad6c0134 	sw	t4,308(t3)
+   10694:	ac670000 	sw	a3,0(v1)
+   10698:	08004171 	j	105c4 <rr_elect_balancing+0x124>
+   1069c:	acc70004 	sw	a3,4(a2)
+   106a0:	8ca60024 	lw	a2,36(a1)
+   106a4:	8ca7001c 	lw	a3,28(a1)
+   106a8:	94c80004 	lhu	t0,4(a2)
+   106ac:	8ca30030 	lw	v1,48(a1)
+   106b0:	2508ffff 	addiu	t0,t0,-1
+   106b4:	24e7ffff 	addiu	a3,a3,-1
+   106b8:	a4c80004 	sh	t0,4(a2)
+   106bc:	aca7001c 	sw	a3,28(a1)
+   106c0:	0800414e 	j	10538 <rr_elect_balancing+0x98>
+   106c4:	2463fe18 	addiu	v1,v1,-488
+
+000106c8 <rr_sched_load_balance>:
+   106c8:	40022002 	mfc0	v0,$4,2
+   106cc:	8c830134 	lw	v1,308(a0)
+   106d0:	24020040 	addiu	v0,zero,64
+   106d4:	30630140 	andi	v1,v1,0x140
+   106d8:	10620043 	beq	v1,v0,107e8 <rr_sched_load_balance+0x120>
+   106dc:	00000000 	sll	zero,zero,0x0
+   106e0:	8c830160 	lw	v1,352(a0)
+   106e4:	240cffff 	addiu	t4,zero,-1
+   106e8:	8c870134 	lw	a3,308(a0)
+   106ec:	8cc50030 	lw	a1,48(a2)
+   106f0:	2402ffdf 	addiu	v0,zero,-33
+   106f4:	00e21024 	and	v0,a3,v0
+   106f8:	00031843 	sra	v1,v1,0x1
+   106fc:	24c90030 	addiu	t1,a2,48
+   10700:	ac820134 	sw	v0,308(a0)
+   10704:	ac830160 	sw	v1,352(a0)
+   10708:	10a9003a 	beq	a1,t1,107f4 <rr_sched_load_balance+0x12c>
+   1070c:	8ca20000 	lw	v0,0(a1)
+   10710:	00805021 	addu	t2,a0,zero
+   10714:	240b0040 	addiu	t3,zero,64
+   10718:	080041cb 	j	1072c <rr_sched_load_balance+0x64>
+   1071c:	240fffdf 	addiu	t7,zero,-33
+   10720:	11220011 	beq	t1,v0,10768 <rr_sched_load_balance+0xa0>
+   10724:	8c430000 	lw	v1,0(v0)
+   10728:	00601021 	addu	v0,v1,zero
+   1072c:	24a3fe18 	addiu	v1,a1,-488
+   10730:	8c670134 	lw	a3,308(v1)
+   10734:	30e80140 	andi	t0,a3,0x140
+   10738:	150bfff9 	bne	t0,t3,10720 <rr_sched_load_balance+0x58>
+   1073c:	00402821 	addu	a1,v0,zero
+   10740:	8c680160 	lw	t0,352(v1)
+   10744:	00ef3824 	and	a3,a3,t7
+   10748:	0188682a 	slt	t5,t4,t0
+   1074c:	00087043 	sra	t6,t0,0x1
+   10750:	ac670134 	sw	a3,308(v1)
+   10754:	ac6e0160 	sw	t6,352(v1)
+   10758:	006d500b 	movn	t2,v1,t5
+   1075c:	010d600b 	movn	t4,t0,t5
+   10760:	1522fff1 	bne	t1,v0,10728 <rr_sched_load_balance+0x60>
+   10764:	8c430000 	lw	v1,0(v0)
+   10768:	0580001d 	bltz	t4,107e0 <rr_sched_load_balance+0x118>
+   1076c:	00000000 	sll	zero,zero,0x0
+   10770:	8c820184 	lw	v0,388(a0)
+   10774:	14400017 	bnez	v0,107d4 <rr_sched_load_balance+0x10c>
+   10778:	00000000 	sll	zero,zero,0x0
+   1077c:	8d420134 	lw	v0,308(t2)
+   10780:	34420020 	ori	v0,v0,0x20
+   10784:	11440016 	beq	t2,a0,107e0 <rr_sched_load_balance+0x118>
+   10788:	ad420134 	sw	v0,308(t2)
+   1078c:	8d4401e8 	lw	a0,488(t2)
+   10790:	8d4301ec 	lw	v1,492(t2)
+   10794:	8cc50020 	lw	a1,32(a2)
+   10798:	ac830004 	sw	v1,4(a0)
+   1079c:	8cc2003c 	lw	v0,60(a2)
+   107a0:	ac640000 	sw	a0,0(v1)
+   107a4:	8cc7001c 	lw	a3,28(a2)
+   107a8:	8c440000 	lw	a0,0(v0)
+   107ac:	254301e8 	addiu	v1,t2,488
+   107b0:	24a50001 	addiu	a1,a1,1
+   107b4:	24e7ffff 	addiu	a3,a3,-1
+   107b8:	ad4201ec 	sw	v0,492(t2)
+   107bc:	ad4401e8 	sw	a0,488(t2)
+   107c0:	acc7001c 	sw	a3,28(a2)
+   107c4:	ac830004 	sw	v1,4(a0)
+   107c8:	acc50020 	sw	a1,32(a2)
+   107cc:	03e00008 	jr	ra
+   107d0:	ac430000 	sw	v1,0(v0)
+   107d4:	8cc2001c 	lw	v0,28(a2)
+   107d8:	1440ffe8 	bnez	v0,1077c <rr_sched_load_balance+0xb4>
+   107dc:	00000000 	sll	zero,zero,0x0
+   107e0:	03e00008 	jr	ra
+   107e4:	00000000 	sll	zero,zero,0x0
+   107e8:	8c8c0160 	lw	t4,352(a0)
+   107ec:	080041ba 	j	106e8 <rr_sched_load_balance+0x20>
+   107f0:	01801821 	addu	v1,t4,zero
+   107f4:	080041da 	j	10768 <rr_sched_load_balance+0xa0>
+   107f8:	00805021 	addu	t2,a0,zero
+
+000107fc <rr_clock_balancing>:
+   107fc:	8c820144 	lw	v0,324(a0)
+   10800:	27bdffd8 	addiu	sp,sp,-40
+   10804:	afb10018 	sw	s1,24(sp)
+   10808:	afbf0024 	sw	ra,36(sp)
+   1080c:	afb30020 	sw	s3,32(sp)
+   10810:	afb2001c 	sw	s2,28(sp)
+   10814:	afb00014 	sw	s0,20(sp)
+   10818:	18400003 	blez	v0,10828 <rr_clock_balancing+0x2c>
+   1081c:	00808821 	addu	s1,a0,zero
+   10820:	2442ffff 	addiu	v0,v0,-1
+   10824:	ac820144 	sw	v0,324(a0)
+   10828:	14400008 	bnez	v0,1084c <rr_clock_balancing+0x50>
+   1082c:	00000000 	sll	zero,zero,0x0
+   10830:	8e230184 	lw	v1,388(s1)
+   10834:	24020002 	addiu	v0,zero,2
+   10838:	10620004 	beq	v1,v0,1084c <rr_clock_balancing+0x50>
+   1083c:	00000000 	sll	zero,zero,0x0
+   10840:	8e220134 	lw	v0,308(s1)
+   10844:	34420001 	ori	v0,v0,0x1
+   10848:	ae220134 	sw	v0,308(s1)
+   1084c:	8e320178 	lw	s2,376(s1)
+   10850:	3c040001 	lui	a0,0x1
+   10854:	8e50002c 	lw	s0,44(s2)
+   10858:	8e020010 	lw	v0,16(s0)
+   1085c:	8c430044 	lw	v1,68(v0)
+   10860:	00442021 	addu	a0,v0,a0
+   10864:	8c828328 	lw	v0,-31960(a0)
+   10868:	2c630096 	sltiu	v1,v1,150
+   1086c:	14600004 	bnez	v1,10880 <rr_clock_balancing+0x84>
+   10870:	8c420090 	lw	v0,144(v0)
+   10874:	8e03001c 	lw	v1,28(s0)
+   10878:	1460002a 	bnez	v1,10924 <rr_clock_balancing+0x128>
+   1087c:	00000000 	sll	zero,zero,0x0
+   10880:	00001821 	addu	v1,zero,zero
+   10884:	8c4202f4 	lw	v0,756(v0)
+   10888:	8c440060 	lw	a0,96(v0)
+   1088c:	2c84005b 	sltiu	a0,a0,91
+   10890:	10800020 	beqz	a0,10914 <rr_clock_balancing+0x118>
+   10894:	00000000 	sll	zero,zero,0x0
+   10898:	24020001 	addiu	v0,zero,1
+   1089c:	10600003 	beqz	v1,108ac <rr_clock_balancing+0xb0>
+   108a0:	00000000 	sll	zero,zero,0x0
+   108a4:	14400046 	bnez	v0,109c0 <rr_clock_balancing+0x1c4>
+   108a8:	00000000 	sll	zero,zero,0x0
+   108ac:	8e050014 	lw	a1,20(s0)
+   108b0:	8e040018 	lw	a0,24(s0)
+   108b4:	00009821 	addu	s3,zero,zero
+   108b8:	24020001 	addiu	v0,zero,1
+   108bc:	00a21021 	addu	v0,a1,v0
+   108c0:	0044202b 	sltu	a0,v0,a0
+   108c4:	14800003 	bnez	a0,108d4 <rr_clock_balancing+0xd8>
+   108c8:	ae020014 	sw	v0,20(s0)
+   108cc:	1460001a 	bnez	v1,10938 <rr_clock_balancing+0x13c>
+   108d0:	ae000014 	sw	zero,20(s0)
+   108d4:	8e020020 	lw	v0,32(s0)
+   108d8:	10400008 	beqz	v0,108fc <rr_clock_balancing+0x100>
+   108dc:	8fbf0024 	lw	ra,36(sp)
+   108e0:	8e220134 	lw	v0,308(s1)
+   108e4:	30430100 	andi	v1,v0,0x100
+   108e8:	14600004 	bnez	v1,108fc <rr_clock_balancing+0x100>
+   108ec:	34420001 	ori	v0,v0,0x1
+   108f0:	ae220134 	sw	v0,308(s1)
+   108f4:	ae200144 	sw	zero,324(s1)
+   108f8:	8fbf0024 	lw	ra,36(sp)
+   108fc:	8fb30020 	lw	s3,32(sp)
+   10900:	8fb2001c 	lw	s2,28(sp)
+   10904:	8fb10018 	lw	s1,24(sp)
+   10908:	8fb00014 	lw	s0,20(sp)
+   1090c:	03e00008 	jr	ra
+   10910:	27bd0028 	addiu	sp,sp,40
+   10914:	8c4202f4 	lw	v0,756(v0)
+   10918:	8c420060 	lw	v0,96(v0)
+   1091c:	08004227 	j	1089c <rr_clock_balancing+0xa0>
+   10920:	2c420060 	sltiu	v0,v0,96
+   10924:	8e030024 	lw	v1,36(s0)
+   10928:	94630002 	lhu	v1,2(v1)
+   1092c:	2c630002 	sltiu	v1,v1,2
+   10930:	08004221 	j	10884 <rr_clock_balancing+0x88>
+   10934:	38630001 	xori	v1,v1,0x1
+   10938:	3c020008 	lui	v0,0x8
+   1093c:	8c4426ec 	lw	a0,9964(v0)
+   10940:	8c820060 	lw	v0,96(a0)
+   10944:	2c420064 	sltiu	v0,v0,100
+   10948:	1040ffe2 	beqz	v0,108d4 <rr_clock_balancing+0xd8>
+   1094c:	24050002 	addiu	a1,zero,2
+   10950:	0c000a8c 	jal	2a30 <pmm_cache_flush_vaddr>
+   10954:	24840060 	addiu	a0,a0,96
+   10958:	2406ffff 	addiu	a2,zero,-1
+   1095c:	24050001 	addiu	a1,zero,1
+   10960:	8e020000 	lw	v0,0(s0)
+   10964:	1440fffe 	bnez	v0,10960 <rr_clock_balancing+0x164>
+   10968:	00000000 	sll	zero,zero,0x0
+   1096c:	0000000f 	sync
+   10970:	00064025 	or	t0,zero,a2
+   10974:	c2030000 	ll	v1,0(s0)
+   10978:	14620004 	bne	v1,v0,1098c <rr_clock_balancing+0x190>
+   1097c:	24070000 	addiu	a3,zero,0
+   10980:	e2080000 	sc	t0,0(s0)
+   10984:	01003825 	or	a3,t0,zero
+   10988:	0000000f 	sync
+   1098c:	00e02025 	or	a0,a3,zero
+   10990:	1485fff3 	bne	a0,a1,10960 <rr_clock_balancing+0x164>
+   10994:	02603821 	addu	a3,s3,zero
+   10998:	02402821 	addu	a1,s2,zero
+   1099c:	02202021 	addu	a0,s1,zero
+   109a0:	0c0041b2 	jal	106c8 <rr_sched_load_balance>
+   109a4:	02003021 	addu	a2,s0,zero
+   109a8:	00101025 	or	v0,zero,s0
+   109ac:	0000000f 	sync
+   109b0:	ac400000 	sw	zero,0(v0)
+   109b4:	0000000f 	sync
+   109b8:	08004236 	j	108d8 <rr_clock_balancing+0xdc>
+   109bc:	8e020020 	lw	v0,32(s0)
+   109c0:	8e040018 	lw	a0,24(s0)
+   109c4:	8e050014 	lw	a1,20(s0)
+   109c8:	00041042 	srl	v0,a0,0x1
+   109cc:	0800422f 	j	108bc <rr_clock_balancing+0xc0>
+   109d0:	24130001 	addiu	s3,zero,1
+
+000109d4 <rr_sched_init>:
+   109d4:	27bdffc0 	addiu	sp,sp,-64
+   109d8:	24020001 	addiu	v0,zero,1
+   109dc:	afa20018 	sw	v0,24(sp)
+   109e0:	24020040 	addiu	v0,zero,64
+   109e4:	afb10038 	sw	s1,56(sp)
+   109e8:	afa2001c 	sw	v0,28(sp)
+   109ec:	00808821 	addu	s1,a0,zero
+   109f0:	3c02000d 	lui	v0,0xd
+   109f4:	27a40018 	addiu	a0,sp,24
+   109f8:	afb00034 	sw	s0,52(sp)
+   109fc:	afbf003c 	sw	ra,60(sp)
+   10a00:	afa20020 	sw	v0,32(sp)
+   10a04:	0c00713f 	jal	1c4fc <kmem_alloc>
+   10a08:	00a08021 	addu	s0,a1,zero
+   10a0c:	10400030 	beqz	v0,10ad0 <rr_sched_init+0xfc>
+   10a10:	3c050003 	lui	a1,0x3
+   10a14:	24a55bb0 	addiu	a1,a1,23472
+   10a18:	00402021 	addu	a0,v0,zero
+   10a1c:	0c004a24 	jal	12890 <spinlock_init>
+   10a20:	afa20028 	sw	v0,40(sp)
+   10a24:	40032002 	mfc0	v1,$4,2
+   10a28:	8fa20028 	lw	v0,40(sp)
+   10a2c:	8c670174 	lw	a3,372(v1)
+   10a30:	3c030003 	lui	v1,0x3
+   10a34:	24450030 	addiu	a1,v0,48
+   10a38:	24440038 	addiu	a0,v0,56
+   10a3c:	24460028 	addiu	a2,v0,40
+   10a40:	24635bd4 	addiu	v1,v1,23508
+   10a44:	24080010 	addiu	t0,zero,16
+   10a48:	ac480018 	sw	t0,24(v0)
+   10a4c:	ac450034 	sw	a1,52(v0)
+   10a50:	ac44003c 	sw	a0,60(v0)
+   10a54:	ac450030 	sw	a1,48(v0)
+   10a58:	ac440038 	sw	a0,56(v0)
+   10a5c:	ac470010 	sw	a3,16(v0)
+   10a60:	ac510024 	sw	s1,36(v0)
+   10a64:	ac46002c 	sw	a2,44(v0)
+   10a68:	ac460028 	sw	a2,40(v0)
+   10a6c:	ae000000 	sw	zero,0(s0)
+   10a70:	26040004 	addiu	a0,s0,4
+   10a74:	24650020 	addiu	a1,v1,32
+   10a78:	8c690000 	lw	t1,0(v1)
+   10a7c:	8c680004 	lw	t0,4(v1)
+   10a80:	8c670008 	lw	a3,8(v1)
+   10a84:	8c66000c 	lw	a2,12(v1)
+   10a88:	24630010 	addiu	v1,v1,16
+   10a8c:	ac890000 	sw	t1,0(a0)
+   10a90:	ac880004 	sw	t0,4(a0)
+   10a94:	ac870008 	sw	a3,8(a0)
+   10a98:	ac86000c 	sw	a2,12(a0)
+   10a9c:	1465fff6 	bne	v1,a1,10a78 <rr_sched_init+0xa4>
+   10aa0:	24840010 	addiu	a0,a0,16
+   10aa4:	8c650004 	lw	a1,4(v1)
+   10aa8:	8fbf003c 	lw	ra,60(sp)
+   10aac:	8c630000 	lw	v1,0(v1)
+   10ab0:	ae02002c 	sw	v0,44(s0)
+   10ab4:	8fb10038 	lw	s1,56(sp)
+   10ab8:	00001021 	addu	v0,zero,zero
+   10abc:	8fb00034 	lw	s0,52(sp)
+   10ac0:	ac850004 	sw	a1,4(a0)
+   10ac4:	ac830000 	sw	v1,0(a0)
+   10ac8:	03e00008 	jr	ra
+   10acc:	27bd0040 	addiu	sp,sp,64
+   10ad0:	3c050003 	lui	a1,0x3
+   10ad4:	3c070003 	lui	a3,0x3
+   10ad8:	24a55b50 	addiu	a1,a1,23376
+   10adc:	24e75b98 	addiu	a3,a3,23448
+   10ae0:	24040001 	addiu	a0,zero,1
+   10ae4:	24060170 	addiu	a2,zero,368
+   10ae8:	0c00097d 	jal	25f4 <__perror>
+   10aec:	afa00010 	sw	zero,16(sp)
+   10af0:	080042bc 	j	10af0 <rr_sched_init+0x11c>
+   10af4:	00000000 	sll	zero,zero,0x0
+
+00010af8 <rr_elect>:
+   10af8:	27bdffc8 	addiu	sp,sp,-56
+   10afc:	afb10024 	sw	s1,36(sp)
+   10b00:	afbf0034 	sw	ra,52(sp)
+   10b04:	afb40030 	sw	s4,48(sp)
+   10b08:	afb3002c 	sw	s3,44(sp)
+   10b0c:	afb20028 	sw	s2,40(sp)
+   10b10:	afb00020 	sw	s0,32(sp)
+   10b14:	00808821 	addu	s1,a0,zero
+   10b18:	40092002 	mfc0	t1,$4,2
+   10b1c:	8d230134 	lw	v1,308(t1)
+   10b20:	2402fffe 	addiu	v0,zero,-2
+   10b24:	00621024 	and	v0,v1,v0
+   10b28:	8c90002c 	lw	s0,44(a0)
+   10b2c:	ad220134 	sw	v0,308(t1)
+   10b30:	2406ffff 	addiu	a2,zero,-1
+   10b34:	24050001 	addiu	a1,zero,1
+   10b38:	8e020000 	lw	v0,0(s0)
+   10b3c:	1440fffe 	bnez	v0,10b38 <rr_elect+0x40>
+   10b40:	00000000 	sll	zero,zero,0x0
+   10b44:	0000000f 	sync
+   10b48:	00064025 	or	t0,zero,a2
+   10b4c:	c2030000 	ll	v1,0(s0)
+   10b50:	14620004 	bne	v1,v0,10b64 <rr_elect+0x6c>
+   10b54:	24070000 	addiu	a3,zero,0
+   10b58:	e2080000 	sc	t0,0(s0)
+   10b5c:	01003825 	or	a3,t0,zero
+   10b60:	0000000f 	sync
+   10b64:	00e02025 	or	a0,a3,zero
+   10b68:	1485fff3 	bne	a0,a1,10b38 <rr_elect+0x40>
+   10b6c:	24030002 	addiu	v1,zero,2
+   10b70:	8d220130 	lw	v0,304(t1)
+   10b74:	1043003e 	beq	v0,v1,10c70 <rr_elect+0x178>
+   10b78:	8e330000 	lw	s3,0(s1)
+   10b7c:	1260004f 	beqz	s3,10cbc <rr_elect+0x1c4>
+   10b80:	00009021 	addu	s2,zero,zero
+   10b84:	8e120028 	lw	s2,40(s0)
+   10b88:	26020028 	addiu	v0,s0,40
+   10b8c:	12420066 	beq	s2,v0,10d28 <rr_elect+0x230>
+   10b90:	00000000 	sll	zero,zero,0x0
+   10b94:	8e020024 	lw	v0,36(s0)
+   10b98:	2652fe18 	addiu	s2,s2,-488
+   10b9c:	94430006 	lhu	v1,6(v0)
+   10ba0:	2463ffff 	addiu	v1,v1,-1
+   10ba4:	a4430006 	sh	v1,6(v0)
+   10ba8:	8e4301e8 	lw	v1,488(s2)
+   10bac:	8e4201ec 	lw	v0,492(s2)
+   10bb0:	8e440130 	lw	a0,304(s2)
+   10bb4:	ac620004 	sw	v0,4(v1)
+   10bb8:	14800016 	bnez	a0,10c14 <rr_elect+0x11c>
+   10bbc:	ac430000 	sw	v1,0(v0)
+   10bc0:	8e430134 	lw	v1,308(s2)
+   10bc4:	2402fffe 	addiu	v0,zero,-2
+   10bc8:	00621024 	and	v0,v1,v0
+   10bcc:	2673ffff 	addiu	s3,s3,-1
+   10bd0:	24030004 	addiu	v1,zero,4
+   10bd4:	ae430144 	sw	v1,324(s2)
+   10bd8:	ae420134 	sw	v0,308(s2)
+   10bdc:	ae330000 	sw	s3,0(s1)
+   10be0:	00101025 	or	v0,zero,s0
+   10be4:	0000000f 	sync
+   10be8:	ac400000 	sw	zero,0(v0)
+   10bec:	0000000f 	sync
+   10bf0:	8fbf0034 	lw	ra,52(sp)
+   10bf4:	02401021 	addu	v0,s2,zero
+   10bf8:	8fb40030 	lw	s4,48(sp)
+   10bfc:	8fb3002c 	lw	s3,44(sp)
+   10c00:	8fb20028 	lw	s2,40(sp)
+   10c04:	8fb10024 	lw	s1,36(sp)
+   10c08:	8fb00020 	lw	s0,32(sp)
+   10c0c:	03e00008 	jr	ra
+   10c10:	27bd0038 	addiu	sp,sp,56
+   10c14:	24020003 	addiu	v0,zero,3
+   10c18:	1082ffe9 	beq	a0,v0,10bc0 <rr_elect+0xc8>
+   10c1c:	3c020004 	lui	v0,0x4
+   10c20:	8c549180 	lw	s4,-28288(v0)
+   10c24:	40037801 	mfc0	v1,$15,1
+   10c28:	3c020004 	lui	v0,0x4
+   10c2c:	30630003 	andi	v1,v1,0x3
+   10c30:	00031880 	sll	v1,v1,0x2
+   10c34:	2442c950 	addiu	v0,v0,-14000
+   10c38:	00621021 	addu	v0,v1,v0
+   10c3c:	8c470000 	lw	a3,0(v0)
+   10c40:	0c00681c 	jal	1a070 <thread_get_state_name>
+   10c44:	afa70018 	sw	a3,24(sp)
+   10c48:	3c060003 	lui	a2,0x3
+   10c4c:	8fa70018 	lw	a3,24(sp)
+   10c50:	02802021 	addu	a0,s4,zero
+   10c54:	24c65bb8 	addiu	a2,a2,23480
+   10c58:	24050002 	addiu	a1,zero,2
+   10c5c:	afa20014 	sw	v0,20(sp)
+   10c60:	0c0009b0 	jal	26c0 <__fprintk>
+   10c64:	afb20010 	sw	s2,16(sp)
+   10c68:	080042f1 	j	10bc4 <rr_elect+0xcc>
+   10c6c:	8e430134 	lw	v1,308(s2)
+   10c70:	8d230184 	lw	v1,388(t1)
+   10c74:	1062ffc1 	beq	v1,v0,10b7c <rr_elect+0x84>
+   10c78:	24020003 	addiu	v0,zero,3
+   10c7c:	1460001d 	bnez	v1,10cf4 <rr_elect+0x1fc>
+   10c80:	ad220130 	sw	v0,304(t1)
+   10c84:	8e050024 	lw	a1,36(s0)
+   10c88:	8e020034 	lw	v0,52(s0)
+   10c8c:	94a60004 	lhu	a2,4(a1)
+   10c90:	8c440000 	lw	a0,0(v0)
+   10c94:	252301e8 	addiu	v1,t1,488
+   10c98:	24c60001 	addiu	a2,a2,1
+   10c9c:	ad2201ec 	sw	v0,492(t1)
+   10ca0:	ad2401e8 	sw	a0,488(t1)
+   10ca4:	a4a60004 	sh	a2,4(a1)
+   10ca8:	ac830004 	sw	v1,4(a0)
+   10cac:	ac430000 	sw	v1,0(v0)
+   10cb0:	26730001 	addiu	s3,s3,1
+   10cb4:	1660ffb3 	bnez	s3,10b84 <rr_elect+0x8c>
+   10cb8:	00009021 	addu	s2,zero,zero
+   10cbc:	ae330000 	sw	s3,0(s1)
+   10cc0:	00101025 	or	v0,zero,s0
+   10cc4:	0000000f 	sync
+   10cc8:	ac400000 	sw	zero,0(v0)
+   10ccc:	0000000f 	sync
+   10cd0:	8fbf0034 	lw	ra,52(sp)
+   10cd4:	02401021 	addu	v0,s2,zero
+   10cd8:	8fb40030 	lw	s4,48(sp)
+   10cdc:	8fb3002c 	lw	s3,44(sp)
+   10ce0:	8fb20028 	lw	s2,40(sp)
+   10ce4:	8fb10024 	lw	s1,36(sp)
+   10ce8:	8fb00020 	lw	s0,32(sp)
+   10cec:	03e00008 	jr	ra
+   10cf0:	27bd0038 	addiu	sp,sp,56
+   10cf4:	8e050024 	lw	a1,36(s0)
+   10cf8:	8e02002c 	lw	v0,44(s0)
+   10cfc:	94a60006 	lhu	a2,6(a1)
+   10d00:	8c440000 	lw	a0,0(v0)
+   10d04:	252301e8 	addiu	v1,t1,488
+   10d08:	24c60001 	addiu	a2,a2,1
+   10d0c:	ad2201ec 	sw	v0,492(t1)
+   10d10:	ad2401e8 	sw	a0,488(t1)
+   10d14:	a4a60006 	sh	a2,6(a1)
+   10d18:	ac830004 	sw	v1,4(a0)
+   10d1c:	ac430000 	sw	v1,0(v0)
+   10d20:	0800432d 	j	10cb4 <rr_elect+0x1bc>
+   10d24:	26730001 	addiu	s3,s3,1
+   10d28:	8e020024 	lw	v0,36(s0)
+   10d2c:	8e03001c 	lw	v1,28(s0)
+   10d30:	94440004 	lhu	a0,4(v0)
+   10d34:	8e120030 	lw	s2,48(s0)
+   10d38:	2484ffff 	addiu	a0,a0,-1
+   10d3c:	2463ffff 	addiu	v1,v1,-1
+   10d40:	a4440004 	sh	a0,4(v0)
+   10d44:	ae03001c 	sw	v1,28(s0)
+   10d48:	080042ea 	j	10ba8 <rr_elect+0xb0>
+   10d4c:	2652fe18 	addiu	s2,s2,-488
+
+00010d50 <rwlock_destroy>:
+   10d50:	27bdffd8 	addiu	sp,sp,-40
+   10d54:	afb00020 	sw	s0,32(sp)
+   10d58:	27a50010 	addiu	a1,sp,16
+   10d5c:	afbf0024 	sw	ra,36(sp)
+   10d60:	0c0030a1 	jal	c284 <mcs_lock>
+   10d64:	00808021 	addu	s0,a0,zero
+   10d68:	8e030094 	lw	v1,148(s0)
+   10d6c:	8fa50010 	lw	a1,16(sp)
+   10d70:	24020010 	addiu	v0,zero,16
+   10d74:	0003100a 	movz	v0,zero,v1
+   10d78:	02002021 	addu	a0,s0,zero
+   10d7c:	0c003130 	jal	c4c0 <mcs_unlock>
+   10d80:	afa20018 	sw	v0,24(sp)
+   10d84:	8fbf0024 	lw	ra,36(sp)
+   10d88:	8fa20018 	lw	v0,24(sp)
+   10d8c:	8fb00020 	lw	s0,32(sp)
+   10d90:	03e00008 	jr	ra
+   10d94:	27bd0028 	addiu	sp,sp,40
+
+00010d98 <rwlock_tryrdlock>:
+   10d98:	27bdffd8 	addiu	sp,sp,-40
+   10d9c:	afb00020 	sw	s0,32(sp)
+   10da0:	27a50010 	addiu	a1,sp,16
+   10da4:	afbf0024 	sw	ra,36(sp)
+   10da8:	0c0030a1 	jal	c284 <mcs_lock>
+   10dac:	00808021 	addu	s0,a0,zero
+   10db0:	8e020094 	lw	v0,148(s0)
+   10db4:	04400004 	bltz	v0,10dc8 <rwlock_tryrdlock+0x30>
+   10db8:	260300b0 	addiu	v1,s0,176
+   10dbc:	8e0400b0 	lw	a0,176(s0)
+   10dc0:	1083000b 	beq	a0,v1,10df0 <rwlock_tryrdlock+0x58>
+   10dc4:	24420001 	addiu	v0,v0,1
+   10dc8:	8fa50010 	lw	a1,16(sp)
+   10dcc:	24020010 	addiu	v0,zero,16
+   10dd0:	02002021 	addu	a0,s0,zero
+   10dd4:	0c003130 	jal	c4c0 <mcs_unlock>
+   10dd8:	afa20018 	sw	v0,24(sp)
+   10ddc:	8fbf0024 	lw	ra,36(sp)
+   10de0:	8fa20018 	lw	v0,24(sp)
+   10de4:	8fb00020 	lw	s0,32(sp)
+   10de8:	03e00008 	jr	ra
+   10dec:	27bd0028 	addiu	sp,sp,40
+   10df0:	ae020094 	sw	v0,148(s0)
+   10df4:	8fa50010 	lw	a1,16(sp)
+   10df8:	00001021 	addu	v0,zero,zero
+   10dfc:	02002021 	addu	a0,s0,zero
+   10e00:	0c003130 	jal	c4c0 <mcs_unlock>
+   10e04:	afa20018 	sw	v0,24(sp)
+   10e08:	8fbf0024 	lw	ra,36(sp)
+   10e0c:	8fa20018 	lw	v0,24(sp)
+   10e10:	8fb00020 	lw	s0,32(sp)
+   10e14:	03e00008 	jr	ra
+   10e18:	27bd0028 	addiu	sp,sp,40
+
+00010e1c <rwlock_trywrlock>:
+   10e1c:	27bdffd8 	addiu	sp,sp,-40
+   10e20:	afb00020 	sw	s0,32(sp)
+   10e24:	27a50010 	addiu	a1,sp,16
+   10e28:	afbf0024 	sw	ra,36(sp)
+   10e2c:	0c0030a1 	jal	c284 <mcs_lock>
+   10e30:	00808021 	addu	s0,a0,zero
+   10e34:	8e020094 	lw	v0,148(s0)
+   10e38:	1440000c 	bnez	v0,10e6c <rwlock_trywrlock+0x50>
+   10e3c:	2402ffff 	addiu	v0,zero,-1
+   10e40:	ae020094 	sw	v0,148(s0)
+   10e44:	8fa50010 	lw	a1,16(sp)
+   10e48:	00001021 	addu	v0,zero,zero
+   10e4c:	02002021 	addu	a0,s0,zero
+   10e50:	0c003130 	jal	c4c0 <mcs_unlock>
+   10e54:	afa20018 	sw	v0,24(sp)
+   10e58:	8fbf0024 	lw	ra,36(sp)
+   10e5c:	8fa20018 	lw	v0,24(sp)
+   10e60:	8fb00020 	lw	s0,32(sp)
+   10e64:	03e00008 	jr	ra
+   10e68:	27bd0028 	addiu	sp,sp,40
+   10e6c:	8fa50010 	lw	a1,16(sp)
+   10e70:	24020010 	addiu	v0,zero,16
+   10e74:	02002021 	addu	a0,s0,zero
+   10e78:	0c003130 	jal	c4c0 <mcs_unlock>
+   10e7c:	afa20018 	sw	v0,24(sp)
+   10e80:	8fbf0024 	lw	ra,36(sp)
+   10e84:	8fa20018 	lw	v0,24(sp)
+   10e88:	8fb00020 	lw	s0,32(sp)
+   10e8c:	03e00008 	jr	ra
+   10e90:	27bd0028 	addiu	sp,sp,40
+
+00010e94 <rwlock_unlock>:
+   10e94:	27bdffd0 	addiu	sp,sp,-48
+   10e98:	afb00024 	sw	s0,36(sp)
+   10e9c:	27a50010 	addiu	a1,sp,16
+   10ea0:	00808021 	addu	s0,a0,zero
+   10ea4:	afbf002c 	sw	ra,44(sp)
+   10ea8:	0c0030a1 	jal	c284 <mcs_lock>
+   10eac:	afb10028 	sw	s1,40(sp)
+   10eb0:	8e020094 	lw	v0,148(s0)
+   10eb4:	1040000f 	beqz	v0,10ef4 <rwlock_unlock+0x60>
+   10eb8:	28430002 	slti	v1,v0,2
+   10ebc:	1460001e 	bnez	v1,10f38 <rwlock_unlock+0xa4>
+   10ec0:	2442ffff 	addiu	v0,v0,-1
+   10ec4:	ae020094 	sw	v0,148(s0)
+   10ec8:	00001021 	addu	v0,zero,zero
+   10ecc:	8fa50010 	lw	a1,16(sp)
+   10ed0:	02002021 	addu	a0,s0,zero
+   10ed4:	0c003130 	jal	c4c0 <mcs_unlock>
+   10ed8:	afa20018 	sw	v0,24(sp)
+   10edc:	8fbf002c 	lw	ra,44(sp)
+   10ee0:	8fa20018 	lw	v0,24(sp)
+   10ee4:	8fb10028 	lw	s1,40(sp)
+   10ee8:	8fb00024 	lw	s0,36(sp)
+   10eec:	03e00008 	jr	ra
+   10ef0:	27bd0030 	addiu	sp,sp,48
+   10ef4:	3c020004 	lui	v0,0x4
+   10ef8:	8c449100 	lw	a0,-28416(v0)
+   10efc:	3c060003 	lui	a2,0x3
+   10f00:	24c65bfc 	addiu	a2,a2,23548
+   10f04:	0c0009b0 	jal	26c0 <__fprintk>
+   10f08:	00002821 	addu	a1,zero,zero
+   10f0c:	8fa50010 	lw	a1,16(sp)
+   10f10:	24020001 	addiu	v0,zero,1
+   10f14:	02002021 	addu	a0,s0,zero
+   10f18:	0c003130 	jal	c4c0 <mcs_unlock>
+   10f1c:	afa20018 	sw	v0,24(sp)
+   10f20:	8fbf002c 	lw	ra,44(sp)
+   10f24:	8fa20018 	lw	v0,24(sp)
+   10f28:	8fb10028 	lw	s1,40(sp)
+   10f2c:	8fb00024 	lw	s0,36(sp)
+   10f30:	03e00008 	jr	ra
+   10f34:	27bd0030 	addiu	sp,sp,48
+   10f38:	ae000094 	sw	zero,148(s0)
+   10f3c:	260400a8 	addiu	a0,s0,168
+   10f40:	0c006d56 	jal	1b558 <wakeup_one>
+   10f44:	00002821 	addu	a1,zero,zero
+   10f48:	1040000e 	beqz	v0,10f84 <rwlock_unlock+0xf0>
+   10f4c:	02002021 	addu	a0,s0,zero
+   10f50:	8e030094 	lw	v1,148(s0)
+   10f54:	00001021 	addu	v0,zero,zero
+   10f58:	2463ffff 	addiu	v1,v1,-1
+   10f5c:	ae030094 	sw	v1,148(s0)
+   10f60:	8fa50010 	lw	a1,16(sp)
+   10f64:	0c003130 	jal	c4c0 <mcs_unlock>
+   10f68:	afa20018 	sw	v0,24(sp)
+   10f6c:	8fbf002c 	lw	ra,44(sp)
+   10f70:	8fa20018 	lw	v0,24(sp)
+   10f74:	8fb10028 	lw	s1,40(sp)
+   10f78:	8fb00024 	lw	s0,36(sp)
+   10f7c:	03e00008 	jr	ra
+   10f80:	27bd0030 	addiu	sp,sp,48
+   10f84:	8e110094 	lw	s1,148(s0)
+   10f88:	0c006d29 	jal	1b4a4 <wakeup_all>
+   10f8c:	26040098 	addiu	a0,s0,152
+   10f90:	00511021 	addu	v0,v0,s1
+   10f94:	ae020094 	sw	v0,148(s0)
+   10f98:	080043b3 	j	10ecc <rwlock_unlock+0x38>
+   10f9c:	00001021 	addu	v0,zero,zero
+
+00010fa0 <rwlock_rdlock>:
+   10fa0:	27bdffe0 	addiu	sp,sp,-32
+   10fa4:	afb00018 	sw	s0,24(sp)
+   10fa8:	27a50010 	addiu	a1,sp,16
+   10fac:	afbf001c 	sw	ra,28(sp)
+   10fb0:	0c0030a1 	jal	c284 <mcs_lock>
+   10fb4:	00808021 	addu	s0,a0,zero
+   10fb8:	8e020094 	lw	v0,148(s0)
+   10fbc:	04400004 	bltz	v0,10fd0 <rwlock_rdlock+0x30>
+   10fc0:	260300b0 	addiu	v1,s0,176
+   10fc4:	8e0400b0 	lw	a0,176(s0)
+   10fc8:	1083000f 	beq	a0,v1,11008 <rwlock_rdlock+0x68>
+   10fcc:	24420001 	addiu	v0,v0,1
+   10fd0:	26040098 	addiu	a0,s0,152
+   10fd4:	0c006d13 	jal	1b44c <wait_on>
+   10fd8:	24050001 	addiu	a1,zero,1
+   10fdc:	8fa50010 	lw	a1,16(sp)
+   10fe0:	0c003130 	jal	c4c0 <mcs_unlock>
+   10fe4:	02002021 	addu	a0,s0,zero
+   10fe8:	40042002 	mfc0	a0,$4,2
+   10fec:	0c004634 	jal	118d0 <sched_sleep>
+   10ff0:	00000000 	sll	zero,zero,0x0
+   10ff4:	8fbf001c 	lw	ra,28(sp)
+   10ff8:	00001021 	addu	v0,zero,zero
+   10ffc:	8fb00018 	lw	s0,24(sp)
+   11000:	03e00008 	jr	ra
+   11004:	27bd0020 	addiu	sp,sp,32
+   11008:	8fa50010 	lw	a1,16(sp)
+   1100c:	02002021 	addu	a0,s0,zero
+   11010:	0c003130 	jal	c4c0 <mcs_unlock>
+   11014:	ae020094 	sw	v0,148(s0)
+   11018:	080043fe 	j	10ff8 <rwlock_rdlock+0x58>
+   1101c:	8fbf001c 	lw	ra,28(sp)
+
+00011020 <rwlock_wrlock>:
+   11020:	27bdffe0 	addiu	sp,sp,-32
+   11024:	afb00018 	sw	s0,24(sp)
+   11028:	27a50010 	addiu	a1,sp,16
+   1102c:	afbf001c 	sw	ra,28(sp)
+   11030:	0c0030a1 	jal	c284 <mcs_lock>
+   11034:	00808021 	addu	s0,a0,zero
+   11038:	8e020094 	lw	v0,148(s0)
+   1103c:	1040000e 	beqz	v0,11078 <rwlock_wrlock+0x58>
+   11040:	260400a8 	addiu	a0,s0,168
+   11044:	0c006d13 	jal	1b44c <wait_on>
+   11048:	24050001 	addiu	a1,zero,1
+   1104c:	8fa50010 	lw	a1,16(sp)
+   11050:	0c003130 	jal	c4c0 <mcs_unlock>
+   11054:	02002021 	addu	a0,s0,zero
+   11058:	40042002 	mfc0	a0,$4,2
+   1105c:	0c004634 	jal	118d0 <sched_sleep>
+   11060:	00000000 	sll	zero,zero,0x0
+   11064:	8fbf001c 	lw	ra,28(sp)
+   11068:	00001021 	addu	v0,zero,zero
+   1106c:	8fb00018 	lw	s0,24(sp)
+   11070:	03e00008 	jr	ra
+   11074:	27bd0020 	addiu	sp,sp,32
+   11078:	8fa50010 	lw	a1,16(sp)
+   1107c:	2402ffff 	addiu	v0,zero,-1
+   11080:	ae020094 	sw	v0,148(s0)
+   11084:	0c003130 	jal	c4c0 <mcs_unlock>
+   11088:	02002021 	addu	a0,s0,zero
+   1108c:	8fbf001c 	lw	ra,28(sp)
+   11090:	00001021 	addu	v0,zero,zero
+   11094:	8fb00018 	lw	s0,24(sp)
+   11098:	03e00008 	jr	ra
+   1109c:	27bd0020 	addiu	sp,sp,32
+
+000110a0 <rwlock_init>:
+   110a0:	3c050003 	lui	a1,0x3
+   110a4:	27bdffe8 	addiu	sp,sp,-24
+   110a8:	24a563f4 	addiu	a1,a1,25588
+   110ac:	afbf0014 	sw	ra,20(sp)
+   110b0:	afb00010 	sw	s0,16(sp)
+   110b4:	0c003096 	jal	c258 <mcs_lock_init>
+   110b8:	00808021 	addu	s0,a0,zero
+   110bc:	3c04d1a5 	lui	a0,0xd1a5
+   110c0:	3484b1ef 	ori	a0,a0,0xb1ef
+   110c4:	ae040090 	sw	a0,144(s0)
+   110c8:	3c040003 	lui	a0,0x3
+   110cc:	24845c20 	addiu	a0,a0,23584
+   110d0:	ae040098 	sw	a0,152(s0)
+   110d4:	8fbf0014 	lw	ra,20(sp)
+   110d8:	3c040003 	lui	a0,0x3
+   110dc:	260200b0 	addiu	v0,s0,176
+   110e0:	260300a0 	addiu	v1,s0,160
+   110e4:	24845c34 	addiu	a0,a0,23604
+   110e8:	ae0200b4 	sw	v0,180(s0)
+   110ec:	ae0200b0 	sw	v0,176(s0)
+   110f0:	ae0300a4 	sw	v1,164(s0)
+   110f4:	ae0400a8 	sw	a0,168(s0)
+   110f8:	ae000094 	sw	zero,148(s0)
+   110fc:	ae00009c 	sw	zero,156(s0)
+   11100:	ae0300a0 	sw	v1,160(s0)
+   11104:	ae0000ac 	sw	zero,172(s0)
+   11108:	00001021 	addu	v0,zero,zero
+   1110c:	8fb00010 	lw	s0,16(sp)
+   11110:	03e00008 	jr	ra
+   11114:	27bd0018 	addiu	sp,sp,24
+
+00011118 <sched_setprio>:
+   11118:	03e00008 	jr	ra
+   1111c:	ac850158 	sw	a1,344(a0)
+
+00011120 <sched_clock>:
+   11120:	8c830148 	lw	v1,328(a0)
+   11124:	8c820184 	lw	v0,388(a0)
+   11128:	24630001 	addiu	v1,v1,1
+   1112c:	30420001 	andi	v0,v0,0x1
+   11130:	ac830148 	sw	v1,328(a0)
+   11134:	10400007 	beqz	v0,11154 <sched_clock+0x34>
+   11138:	8c830174 	lw	v1,372(a0)
+   1113c:	3c020001 	lui	v0,0x1
+   11140:	00621021 	addu	v0,v1,v0
+   11144:	8c428320 	lw	v0,-31968(v0)
+   11148:	8c460148 	lw	a2,328(v0)
+   1114c:	24c60001 	addiu	a2,a2,1
+   11150:	ac460148 	sw	a2,328(v0)
+   11154:	0000000f 	sync
+   11158:	3c020001 	lui	v0,0x1
+   1115c:	00621821 	addu	v1,v1,v0
+   11160:	8c798314 	lw	t9,-31980(v1)
+   11164:	03200008 	jr	t9
+   11168:	00000000 	sll	zero,zero,0x0
+
+0001116c <sched_strategy>:
+   1116c:	8c990038 	lw	t9,56(a0)
+   11170:	03200008 	jr	t9
+   11174:	24840018 	addiu	a0,a0,24
+
+00011178 <sched_idle>:
+   11178:	03e00008 	jr	ra
+   1117c:	00000000 	sll	zero,zero,0x0
+
+00011180 <__sched_wakeup>:
+   11180:	27bdffe0 	addiu	sp,sp,-32
+   11184:	afb10018 	sw	s1,24(sp)
+   11188:	afbf001c 	sw	ra,28(sp)
+   1118c:	afb00014 	sw	s0,20(sp)
+   11190:	00808821 	addu	s1,a0,zero
+   11194:	40016000 	mfc0	at,c0_status
+   11198:	00000000 	sll	zero,zero,0x0
+   1119c:	00018025 	or	s0,zero,at
+   111a0:	00010842 	srl	at,at,0x1
+   111a4:	00010840 	sll	at,at,0x1
+   111a8:	40816000 	mtc0	at,c0_status
+   111ac:	8c820178 	lw	v0,376(a0)
+   111b0:	8c42001c 	lw	v0,28(v0)
+   111b4:	0040f809 	jalr	v0
+   111b8:	00000000 	sll	zero,zero,0x0
+   111bc:	8e220294 	lw	v0,660(s1)
+   111c0:	10400003 	beqz	v0,111d0 <__sched_wakeup+0x50>
+   111c4:	00000000 	sll	zero,zero,0x0
+   111c8:	0040f809 	jalr	v0
+   111cc:	02202021 	addu	a0,s1,zero
+   111d0:	40016000 	mfc0	at,c0_status
+   111d4:	340200ff 	ori	v0,zero,0xff
+   111d8:	00501024 	and	v0,v0,s0
+   111dc:	00220825 	or	at,at,v0
+   111e0:	40816000 	mtc0	at,c0_status
+   111e4:	8fbf001c 	lw	ra,28(sp)
+   111e8:	8fb10018 	lw	s1,24(sp)
+   111ec:	8fb00014 	lw	s0,20(sp)
+   111f0:	03e00008 	jr	ra
+   111f4:	27bd0020 	addiu	sp,sp,32
+
+000111f8 <check_sleeping>:
+   111f8:	27bdffe0 	addiu	sp,sp,-32
+   111fc:	afb10014 	sw	s1,20(sp)
+   11200:	8c910010 	lw	s1,16(a0)
+   11204:	afb20018 	sw	s2,24(sp)
+   11208:	24920010 	addiu	s2,a0,16
+   1120c:	afb00010 	sw	s0,16(sp)
+   11210:	afbf001c 	sw	ra,28(sp)
+   11214:	16320007 	bne	s1,s2,11234 <check_sleeping+0x3c>
+   11218:	8e300000 	lw	s0,0(s1)
+   1121c:	0800449e 	j	11278 <check_sleeping+0x80>
+   11220:	8fbf001c 	lw	ra,28(sp)
+   11224:	8e020000 	lw	v0,0(s0)
+   11228:	12500012 	beq	s2,s0,11274 <check_sleeping+0x7c>
+   1122c:	02008821 	addu	s1,s0,zero
+   11230:	00408021 	addu	s0,v0,zero
+   11234:	2631fe18 	addiu	s1,s1,-488
+   11238:	8e22016c 	lw	v0,364(s1)
+   1123c:	0040f809 	jalr	v0
+   11240:	8e240170 	lw	a0,368(s1)
+   11244:	1040fff7 	beqz	v0,11224 <check_sleeping+0x2c>
+   11248:	02202021 	addu	a0,s1,zero
+   1124c:	8e2301e8 	lw	v1,488(s1)
+   11250:	8e2201ec 	lw	v0,492(s1)
+   11254:	8fbf001c 	lw	ra,28(sp)
+   11258:	8fb20018 	lw	s2,24(sp)
+   1125c:	8fb10014 	lw	s1,20(sp)
+   11260:	8fb00010 	lw	s0,16(sp)
+   11264:	ac620004 	sw	v0,4(v1)
+   11268:	ac430000 	sw	v1,0(v0)
+   1126c:	08004460 	j	11180 <__sched_wakeup>
+   11270:	27bd0020 	addiu	sp,sp,32
+   11274:	8fbf001c 	lw	ra,28(sp)
+   11278:	8fb20018 	lw	s2,24(sp)
+   1127c:	8fb10014 	lw	s1,20(sp)
+   11280:	8fb00010 	lw	s0,16(sp)
+   11284:	03e00008 	jr	ra
+   11288:	27bd0020 	addiu	sp,sp,32
+
+0001128c <sched_wakeup>:
+   1128c:	08004460 	j	11180 <__sched_wakeup>
+   11290:	00000000 	sll	zero,zero,0x0
+
+00011294 <sched_get_listner>:
+   11294:	8c860174 	lw	a2,372(a0)
+   11298:	8c820168 	lw	v0,360(a0)
+   1129c:	3c030001 	lui	v1,0x1
+   112a0:	00c31821 	addu	v1,a2,v1
+   112a4:	8c6382e4 	lw	v1,-32028(v1)
+   112a8:	2442000a 	addiu	v0,v0,10
+   112ac:	000210c0 	sll	v0,v0,0x3
+   112b0:	00621021 	addu	v0,v1,v0
+   112b4:	30a500ff 	andi	a1,a1,0xff
+   112b8:	00052880 	sll	a1,a1,0x2
+   112bc:	24420004 	addiu	v0,v0,4
+   112c0:	03e00008 	jr	ra
+   112c4:	00451021 	addu	v0,v0,a1
+
+000112c8 <sched_add>:
+   112c8:	24020003 	addiu	v0,zero,3
+   112cc:	27bdffe0 	addiu	sp,sp,-32
+   112d0:	ac820130 	sw	v0,304(a0)
+   112d4:	afb10018 	sw	s1,24(sp)
+   112d8:	afbf001c 	sw	ra,28(sp)
+   112dc:	afb00014 	sw	s0,20(sp)
+   112e0:	0c006ca8 	jal	1b2a0 <tm_sys_compute>
+   112e4:	00808821 	addu	s1,a0,zero
+   112e8:	40016000 	mfc0	at,c0_status
+   112ec:	00000000 	sll	zero,zero,0x0
+   112f0:	00018025 	or	s0,zero,at
+   112f4:	00010842 	srl	at,at,0x1
+   112f8:	00010840 	sll	at,at,0x1
+   112fc:	40816000 	mtc0	at,c0_status
+   11300:	8e220178 	lw	v0,376(s1)
+   11304:	8c420004 	lw	v0,4(v0)
+   11308:	0040f809 	jalr	v0
+   1130c:	02202021 	addu	a0,s1,zero
+   11310:	40016000 	mfc0	at,c0_status
+   11314:	340200ff 	ori	v0,zero,0xff
+   11318:	00501024 	and	v0,v0,s0
+   1131c:	00220825 	or	at,at,v0
+   11320:	40816000 	mtc0	at,c0_status
+   11324:	8fbf001c 	lw	ra,28(sp)
+   11328:	8fb10018 	lw	s1,24(sp)
+   1132c:	8fb00014 	lw	s0,20(sp)
+   11330:	03e00008 	jr	ra
+   11334:	27bd0020 	addiu	sp,sp,32
+
+00011338 <sched_getpolicy>:
+   11338:	00803821 	addu	a3,a0,zero
+   1133c:	8c840174 	lw	a0,372(a0)
+   11340:	340282f0 	ori	v0,zero,0x82f0
+   11344:	8ce30178 	lw	v1,376(a3)
+   11348:	27bdffe8 	addiu	sp,sp,-24
+   1134c:	00821021 	addu	v0,a0,v0
+   11350:	10620007 	beq	v1,v0,11370 <sched_getpolicy+0x38>
+   11354:	afbf0014 	sw	ra,20(sp)
+   11358:	3c020004 	lui	v0,0x4
+   1135c:	3c060003 	lui	a2,0x3
+   11360:	8c449100 	lw	a0,-28416(v0)
+   11364:	24c65c44 	addiu	a2,a2,23620
+   11368:	0c0009b0 	jal	26c0 <__fprintk>
+   1136c:	00002821 	addu	a1,zero,zero
+   11370:	8fbf0014 	lw	ra,20(sp)
+   11374:	00001021 	addu	v0,zero,zero
+   11378:	03e00008 	jr	ra
+   1137c:	27bd0018 	addiu	sp,sp,24
+
+00011380 <sched_setpolicy>:
+   11380:	27bdffe0 	addiu	sp,sp,-32
+   11384:	afbf001c 	sw	ra,28(sp)
+   11388:	00803821 	addu	a3,a0,zero
+   1138c:	00a01021 	addu	v0,a1,zero
+   11390:	10a0000c 	beqz	a1,113c4 <sched_setpolicy+0x44>
+   11394:	8c830174 	lw	v1,372(a0)
+   11398:	3c030004 	lui	v1,0x4
+   1139c:	8c649100 	lw	a0,-28416(v1)
+   113a0:	3c060003 	lui	a2,0x3
+   113a4:	24c65c78 	addiu	a2,a2,23672
+   113a8:	00002821 	addu	a1,zero,zero
+   113ac:	0c0009b0 	jal	26c0 <__fprintk>
+   113b0:	afa20010 	sw	v0,16(sp)
+   113b4:	8fbf001c 	lw	ra,28(sp)
+   113b8:	2402ffff 	addiu	v0,zero,-1
+   113bc:	03e00008 	jr	ra
+   113c0:	27bd0020 	addiu	sp,sp,32
+   113c4:	340282f0 	ori	v0,zero,0x82f0
+   113c8:	8fbf001c 	lw	ra,28(sp)
+   113cc:	00621821 	addu	v1,v1,v0
+   113d0:	ac830178 	sw	v1,376(a0)
+   113d4:	00001021 	addu	v0,zero,zero
+   113d8:	03e00008 	jr	ra
+   113dc:	27bd0020 	addiu	sp,sp,32
+   113e0:	27bdffe0 	addiu	sp,sp,-32
+   113e4:	24840188 	addiu	a0,a0,392
+   113e8:	afb00018 	sw	s0,24(sp)
+   113ec:	afbf001c 	sw	ra,28(sp)
+   113f0:	0c00cc3b 	jal	330ec <cpu_context_save>
+   113f4:	00a08021 	addu	s0,a1,zero
+   113f8:	1440001c 	bnez	v0,1146c <sched_setpolicy+0xec>
+   113fc:	8fbf001c 	lw	ra,28(sp)
+   11400:	8e020130 	lw	v0,304(s0)
+   11404:	1440001c 	bnez	v0,11478 <sched_setpolicy+0xf8>
+   11408:	00000000 	sll	zero,zero,0x0
+   1140c:	0c006c6c 	jal	1b1b0 <tm_born_compute>
+   11410:	02002021 	addu	a0,s0,zero
+   11414:	8e040184 	lw	a0,388(s0)
+   11418:	24020002 	addiu	v0,zero,2
+   1141c:	24030001 	addiu	v1,zero,1
+   11420:	0064100a 	movz	v0,v1,a0
+   11424:	ae020130 	sw	v0,304(s0)
+   11428:	26040188 	addiu	a0,s0,392
+   1142c:	0c00cc4c 	jal	33130 <cpu_context_restore>
+   11430:	24050001 	addiu	a1,zero,1
+   11434:	40022002 	mfc0	v0,$4,2
+   11438:	afb00010 	sw	s0,16(sp)
+   1143c:	8c420174 	lw	v0,372(v0)
+   11440:	3c050003 	lui	a1,0x3
+   11444:	8c420004 	lw	v0,4(v0)
+   11448:	3c070003 	lui	a3,0x3
+   1144c:	24a55cb8 	addiu	a1,a1,23736
+   11450:	24e75d10 	addiu	a3,a3,23824
+   11454:	24040001 	addiu	a0,zero,1
+   11458:	2406016a 	addiu	a2,zero,362
+   1145c:	0c00097d 	jal	25f4 <__perror>
+   11460:	afa20014 	sw	v0,20(sp)
+   11464:	08004519 	j	11464 <sched_setpolicy+0xe4>
+   11468:	00000000 	sll	zero,zero,0x0
+   1146c:	8fb00018 	lw	s0,24(sp)
+   11470:	03e00008 	jr	ra
+   11474:	27bd0020 	addiu	sp,sp,32
+   11478:	0c006cd2 	jal	1b348 <tm_sleep_compute>
+   1147c:	02002021 	addu	a0,s0,zero
+   11480:	8e020204 	lw	v0,516(s0)
+   11484:	24420001 	addiu	v0,v0,1
+   11488:	ae020204 	sw	v0,516(s0)
+   1148c:	24020002 	addiu	v0,zero,2
+   11490:	0800450a 	j	11428 <sched_setpolicy+0xa8>
+   11494:	ae020130 	sw	v0,304(s0)
+   11498:	27bdffc8 	addiu	sp,sp,-56
+   1149c:	afb00028 	sw	s0,40(sp)
+   114a0:	afbf0034 	sw	ra,52(sp)
+   114a4:	afb20030 	sw	s2,48(sp)
+   114a8:	afb1002c 	sw	s1,44(sp)
+   114ac:	00808021 	addu	s0,a0,zero
+   114b0:	40022002 	mfc0	v0,$4,2
+   114b4:	8c510174 	lw	s1,372(v0)
+   114b8:	340482d8 	ori	a0,zero,0x82d8
+   114bc:	0c00447e 	jal	111f8 <check_sleeping>
+   114c0:	02242021 	addu	a0,s1,a0
+   114c4:	40016000 	mfc0	at,c0_status
+   114c8:	00000000 	sll	zero,zero,0x0
+   114cc:	00011825 	or	v1,zero,at
+   114d0:	00010842 	srl	at,at,0x1
+   114d4:	00010840 	sll	at,at,0x1
+   114d8:	40816000 	mtc0	at,c0_status
+   114dc:	8e02013c 	lw	v0,316(s0)
+   114e0:	24420001 	addiu	v0,v0,1
+   114e4:	ae02013c 	sw	v0,316(s0)
+   114e8:	40016000 	mfc0	at,c0_status
+   114ec:	340200ff 	ori	v0,zero,0xff
+   114f0:	00431024 	and	v0,v0,v1
+   114f4:	00220825 	or	at,at,v0
+   114f8:	40816000 	mtc0	at,c0_status
+   114fc:	3c120001 	lui	s2,0x1
+   11500:	02329021 	addu	s2,s1,s2
+   11504:	340482f0 	ori	a0,zero,0x82f0
+   11508:	8e428300 	lw	v0,-32000(s2)
+   1150c:	0040f809 	jalr	v0
+   11510:	02242021 	addu	a0,s1,a0
+   11514:	10400043 	beqz	v0,11624 <sched_setpolicy+0x2a4>
+   11518:	00000000 	sll	zero,zero,0x0
+   1151c:	ae408338 	sw	zero,-31944(s2)
+   11520:	3c03deef 	lui	v1,0xdeef
+   11524:	8c440390 	lw	a0,912(v0)
+   11528:	3463baad 	ori	v1,v1,0xbaad
+   1152c:	10830010 	beq	a0,v1,11570 <sched_setpolicy+0x1f0>
+   11530:	24030005 	addiu	v1,zero,5
+   11534:	40034800 	mfc0	v1,c0_count
+   11538:	00000000 	sll	zero,zero,0x0
+   1153c:	afa30010 	sw	v1,16(sp)
+   11540:	afa20014 	sw	v0,20(sp)
+   11544:	8e220004 	lw	v0,4(s1)
+   11548:	3c050003 	lui	a1,0x3
+   1154c:	3c070003 	lui	a3,0x3
+   11550:	24a55d24 	addiu	a1,a1,23844
+   11554:	24e75d10 	addiu	a3,a3,23824
+   11558:	24040001 	addiu	a0,zero,1
+   1155c:	240601a7 	addiu	a2,zero,423
+   11560:	0c00097d 	jal	25f4 <__perror>
+   11564:	afa20018 	sw	v0,24(sp)
+   11568:	0800455a 	j	11568 <sched_setpolicy+0x1e8>
+   1156c:	00000000 	sll	zero,zero,0x0
+   11570:	8e040130 	lw	a0,304(s0)
+   11574:	1083006b 	beq	a0,v1,11724 <sched_setpolicy+0x3a4>
+   11578:	26040354 	addiu	a0,s0,852
+   1157c:	10500066 	beq	v0,s0,11718 <sched_setpolicy+0x398>
+   11580:	00402821 	addu	a1,v0,zero
+   11584:	0c0044f8 	jal	113e0 <sched_setpolicy+0x60>
+   11588:	02002021 	addu	a0,s0,zero
+   1158c:	40016000 	mfc0	at,c0_status
+   11590:	00000000 	sll	zero,zero,0x0
+   11594:	00011825 	or	v1,zero,at
+   11598:	00010842 	srl	at,at,0x1
+   1159c:	00010840 	sll	at,at,0x1
+   115a0:	40816000 	mtc0	at,c0_status
+   115a4:	8e02013c 	lw	v0,316(s0)
+   115a8:	2442ffff 	addiu	v0,v0,-1
+   115ac:	ae02013c 	sw	v0,316(s0)
+   115b0:	40016000 	mfc0	at,c0_status
+   115b4:	340200ff 	ori	v0,zero,0xff
+   115b8:	00431024 	and	v0,v0,v1
+   115bc:	00220825 	or	at,at,v0
+   115c0:	40816000 	mtc0	at,c0_status
+   115c4:	8e020184 	lw	v0,388(s0)
+   115c8:	14400011 	bnez	v0,11610 <sched_setpolicy+0x290>
+   115cc:	8fbf0034 	lw	ra,52(sp)
+   115d0:	3c020001 	lui	v0,0x1
+   115d4:	02228821 	addu	s1,s1,v0
+   115d8:	8e228324 	lw	v0,-31964(s1)
+   115dc:	10500030 	beq	v0,s0,116a0 <sched_setpolicy+0x320>
+   115e0:	00000000 	sll	zero,zero,0x0
+   115e4:	3c1bdfff 	lui	k1,0xdfff
+   115e8:	377bffff 	ori	k1,k1,0xffff
+   115ec:	40016000 	mfc0	at,c0_status
+   115f0:	003bd824 	and	k1,at,k1
+   115f4:	409b6000 	mtc0	k1,c0_status
+   115f8:	8e020134 	lw	v0,308(s0)
+   115fc:	240300e0 	addiu	v1,zero,224
+   11600:	304400e0 	andi	a0,v0,0xe0
+   11604:	1083000b 	beq	a0,v1,11634 <sched_setpolicy+0x2b4>
+   11608:	2403ff7f 	addiu	v1,zero,-129
+   1160c:	8fbf0034 	lw	ra,52(sp)
+   11610:	8fb20030 	lw	s2,48(sp)
+   11614:	8fb1002c 	lw	s1,44(sp)
+   11618:	8fb00028 	lw	s0,40(sp)
+   1161c:	03e00008 	jr	ra
+   11620:	27bd0038 	addiu	sp,sp,56
+   11624:	24020001 	addiu	v0,zero,1
+   11628:	ae428338 	sw	v0,-31944(s2)
+   1162c:	08004548 	j	11520 <sched_setpolicy+0x1a0>
+   11630:	8e428320 	lw	v0,-31968(s2)
+   11634:	00431024 	and	v0,v0,v1
+   11638:	ae020134 	sw	v0,308(s0)
+   1163c:	40016000 	mfc0	at,c0_status
+   11640:	00000000 	sll	zero,zero,0x0
+   11644:	00018825 	or	s1,zero,at
+   11648:	34210001 	ori	at,at,0x1
+   1164c:	40816000 	mtc0	at,c0_status
+   11650:	00000000 	sll	zero,zero,0x0
+   11654:	2405ffff 	addiu	a1,zero,-1
+   11658:	0c006b59 	jal	1ad64 <thread_migrate>
+   1165c:	02002021 	addu	a0,s0,zero
+   11660:	00401821 	addu	v1,v0,zero
+   11664:	40016000 	mfc0	at,c0_status
+   11668:	340200ff 	ori	v0,zero,0xff
+   1166c:	00511024 	and	v0,v0,s1
+   11670:	00220825 	or	at,at,v0
+   11674:	40816000 	mtc0	at,c0_status
+   11678:	1460000f 	bnez	v1,116b8 <sched_setpolicy+0x338>
+   1167c:	00000000 	sll	zero,zero,0x0
+   11680:	40102002 	mfc0	s0,$4,2
+   11684:	8e030134 	lw	v1,308(s0)
+   11688:	2402ffdf 	addiu	v0,zero,-33
+   1168c:	00621024 	and	v0,v1,v0
+   11690:	ae020134 	sw	v0,308(s0)
+   11694:	34420080 	ori	v0,v0,0x80
+   11698:	08004583 	j	1160c <sched_setpolicy+0x28c>
+   1169c:	ae020134 	sw	v0,308(s0)
+   116a0:	3c1b2000 	lui	k1,0x2000
+   116a4:	40016000 	mfc0	at,c0_status
+   116a8:	003bd825 	or	k1,at,k1
+   116ac:	409b6000 	mtc0	k1,c0_status
+   116b0:	0800457f 	j	115fc <sched_setpolicy+0x27c>
+   116b4:	8e020134 	lw	v0,308(s0)
+   116b8:	40047801 	mfc0	a0,$15,1
+   116bc:	3c020004 	lui	v0,0x4
+   116c0:	30840003 	andi	a0,a0,0x3
+   116c4:	00042080 	sll	a0,a0,0x2
+   116c8:	2442c950 	addiu	v0,v0,-14000
+   116cc:	00821021 	addu	v0,a0,v0
+   116d0:	8c420000 	lw	v0,0(v0)
+   116d4:	3c040004 	lui	a0,0x4
+   116d8:	afa20010 	sw	v0,16(sp)
+   116dc:	8e020180 	lw	v0,384(s0)
+   116e0:	8c849140 	lw	a0,-28352(a0)
+   116e4:	8c4205c4 	lw	v0,1476(v0)
+   116e8:	3c060003 	lui	a2,0x3
+   116ec:	afa20014 	sw	v0,20(sp)
+   116f0:	8e0202f8 	lw	v0,760(s0)
+   116f4:	3c070003 	lui	a3,0x3
+   116f8:	24c64ea0 	addiu	a2,a2,20128
+   116fc:	24e75d94 	addiu	a3,a3,23956
+   11700:	24050001 	addiu	a1,zero,1
+   11704:	afa20018 	sw	v0,24(sp)
+   11708:	0c0009b0 	jal	26c0 <__fprintk>
+   1170c:	afa3001c 	sw	v1,28(sp)
+   11710:	080045a5 	j	11694 <sched_setpolicy+0x314>
+   11714:	8e020134 	lw	v0,308(s0)
+   11718:	24020002 	addiu	v0,zero,2
+   1171c:	08004563 	j	1158c <sched_setpolicy+0x20c>
+   11720:	ae020130 	sw	v0,304(s0)
+   11724:	8e250004 	lw	a1,4(s1)
+   11728:	0c0029e6 	jal	a798 <event_send>
+   1172c:	afa20020 	sw	v0,32(sp)
+   11730:	0800455f 	j	1157c <sched_setpolicy+0x1fc>
+   11734:	8fa20020 	lw	v0,32(sp)
+
+00011738 <__sched_sleep>:
+   11738:	27bdffe0 	addiu	sp,sp,-32
+   1173c:	afb20018 	sw	s2,24(sp)
+   11740:	afb00010 	sw	s0,16(sp)
+   11744:	afbf001c 	sw	ra,28(sp)
+   11748:	afb10014 	sw	s1,20(sp)
+   1174c:	00a09021 	addu	s2,a1,zero
+   11750:	0c006ca8 	jal	1b2a0 <tm_sys_compute>
+   11754:	00808021 	addu	s0,a0,zero
+   11758:	40016000 	mfc0	at,c0_status
+   1175c:	00000000 	sll	zero,zero,0x0
+   11760:	00011825 	or	v1,zero,at
+   11764:	00010842 	srl	at,at,0x1
+   11768:	00010840 	sll	at,at,0x1
+   1176c:	40816000 	mtc0	at,c0_status
+   11770:	8e02013c 	lw	v0,316(s0)
+   11774:	24420001 	addiu	v0,v0,1
+   11778:	ae02013c 	sw	v0,316(s0)
+   1177c:	40016000 	mfc0	at,c0_status
+   11780:	340200ff 	ori	v0,zero,0xff
+   11784:	00431024 	and	v0,v0,v1
+   11788:	00220825 	or	at,at,v0
+   1178c:	40816000 	mtc0	at,c0_status
+   11790:	40016000 	mfc0	at,c0_status
+   11794:	00000000 	sll	zero,zero,0x0
+   11798:	00018825 	or	s1,zero,at
+   1179c:	00010842 	srl	at,at,0x1
+   117a0:	00010840 	sll	at,at,0x1
+   117a4:	40816000 	mtc0	at,c0_status
+   117a8:	8e020134 	lw	v0,308(s0)
+   117ac:	30430010 	andi	v1,v0,0x10
+   117b0:	10600004 	beqz	v1,117c4 <__sched_sleep+0x8c>
+   117b4:	34420008 	ori	v0,v0,0x8
+   117b8:	2403ffef 	addiu	v1,zero,-17
+   117bc:	00431024 	and	v0,v0,v1
+   117c0:	ae020134 	sw	v0,308(s0)
+   117c4:	8e020290 	lw	v0,656(s0)
+   117c8:	10400003 	beqz	v0,117d8 <__sched_sleep+0xa0>
+   117cc:	00000000 	sll	zero,zero,0x0
+   117d0:	0040f809 	jalr	v0
+   117d4:	02002021 	addu	a0,s0,zero
+   117d8:	8e020178 	lw	v0,376(s0)
+   117dc:	8c420018 	lw	v0,24(v0)
+   117e0:	0040f809 	jalr	v0
+   117e4:	02002021 	addu	a0,s0,zero
+   117e8:	1240000c 	beqz	s2,1181c <__sched_sleep+0xe4>
+   117ec:	00000000 	sll	zero,zero,0x0
+   117f0:	40022002 	mfc0	v0,$4,2
+   117f4:	8c430174 	lw	v1,372(v0)
+   117f8:	3c020001 	lui	v0,0x1
+   117fc:	00621021 	addu	v0,v1,v0
+   11800:	8c4282ec 	lw	v0,-32020(v0)
+   11804:	260301e8 	addiu	v1,s0,488
+   11808:	8c440000 	lw	a0,0(v0)
+   1180c:	ae0201ec 	sw	v0,492(s0)
+   11810:	ae0401e8 	sw	a0,488(s0)
+   11814:	ac830004 	sw	v1,4(a0)
+   11818:	ac430000 	sw	v1,0(v0)
+   1181c:	0c004526 	jal	11498 <sched_setpolicy+0x118>
+   11820:	02002021 	addu	a0,s0,zero
+   11824:	8e030134 	lw	v1,308(s0)
+   11828:	2402fff7 	addiu	v0,zero,-9
+   1182c:	00621024 	and	v0,v1,v0
+   11830:	ae020134 	sw	v0,308(s0)
+   11834:	40016000 	mfc0	at,c0_status
+   11838:	340200ff 	ori	v0,zero,0xff
+   1183c:	00511024 	and	v0,v0,s1
+   11840:	00220825 	or	at,at,v0
+   11844:	40816000 	mtc0	at,c0_status
+   11848:	40016000 	mfc0	at,c0_status
+   1184c:	00000000 	sll	zero,zero,0x0
+   11850:	00011825 	or	v1,zero,at
+   11854:	00010842 	srl	at,at,0x1
+   11858:	00010840 	sll	at,at,0x1
+   1185c:	40816000 	mtc0	at,c0_status
+   11860:	8e02013c 	lw	v0,316(s0)
+   11864:	2442ffff 	addiu	v0,v0,-1
+   11868:	ae02013c 	sw	v0,316(s0)
+   1186c:	40016000 	mfc0	at,c0_status
+   11870:	340200ff 	ori	v0,zero,0xff
+   11874:	00431024 	and	v0,v0,v1
+   11878:	00220825 	or	at,at,v0
+   1187c:	40816000 	mtc0	at,c0_status
+   11880:	8fbf001c 	lw	ra,28(sp)
+   11884:	8fb20018 	lw	s2,24(sp)
+   11888:	8fb10014 	lw	s1,20(sp)
+   1188c:	8fb00010 	lw	s0,16(sp)
+   11890:	03e00008 	jr	ra
+   11894:	27bd0020 	addiu	sp,sp,32
+
+00011898 <sched_sleep_check>:
+   11898:	27bdffe8 	addiu	sp,sp,-24
+   1189c:	ac85016c 	sw	a1,364(a0)
+   118a0:	ac860170 	sw	a2,368(a0)
+   118a4:	24050001 	addiu	a1,zero,1
+   118a8:	afbf0014 	sw	ra,20(sp)
+   118ac:	afb00010 	sw	s0,16(sp)
+   118b0:	0c0045ce 	jal	11738 <__sched_sleep>
+   118b4:	00808021 	addu	s0,a0,zero
+   118b8:	8fbf0014 	lw	ra,20(sp)
+   118bc:	ae000170 	sw	zero,368(s0)
+   118c0:	ae00016c 	sw	zero,364(s0)
+   118c4:	8fb00010 	lw	s0,16(sp)
+   118c8:	03e00008 	jr	ra
+   118cc:	27bd0018 	addiu	sp,sp,24
+
+000118d0 <sched_sleep>:
+   118d0:	080045ce 	j	11738 <__sched_sleep>
+   118d4:	00002821 	addu	a1,zero,zero
+
+000118d8 <sched_yield>:
+   118d8:	27bdffe0 	addiu	sp,sp,-32
+   118dc:	afb10018 	sw	s1,24(sp)
+   118e0:	afbf001c 	sw	ra,28(sp)
+   118e4:	afb00014 	sw	s0,20(sp)
+   118e8:	0c006ca8 	jal	1b2a0 <tm_sys_compute>
+   118ec:	00808821 	addu	s1,a0,zero
+   118f0:	40016000 	mfc0	at,c0_status
+   118f4:	00000000 	sll	zero,zero,0x0
+   118f8:	00018025 	or	s0,zero,at
+   118fc:	00010842 	srl	at,at,0x1
+   11900:	00010840 	sll	at,at,0x1
+   11904:	40816000 	mtc0	at,c0_status
+   11908:	8e220178 	lw	v0,376(s1)
+   1190c:	8c420014 	lw	v0,20(v0)
+   11910:	0040f809 	jalr	v0
+   11914:	02202021 	addu	a0,s1,zero
+   11918:	0c004526 	jal	11498 <sched_setpolicy+0x118>
+   1191c:	02202021 	addu	a0,s1,zero
+   11920:	40016000 	mfc0	at,c0_status
+   11924:	340200ff 	ori	v0,zero,0xff
+   11928:	00501024 	and	v0,v0,s0
+   1192c:	00220825 	or	at,at,v0
+   11930:	40816000 	mtc0	at,c0_status
+   11934:	8fbf001c 	lw	ra,28(sp)
+   11938:	00001021 	addu	v0,zero,zero
+   1193c:	8fb10018 	lw	s1,24(sp)
+   11940:	8fb00014 	lw	s0,20(sp)
+   11944:	03e00008 	jr	ra
+   11948:	27bd0020 	addiu	sp,sp,32
+
+0001194c <sched_switch>:
+   1194c:	27bdffd8 	addiu	sp,sp,-40
+   11950:	afb10020 	sw	s1,32(sp)
+   11954:	afbf0024 	sw	ra,36(sp)
+   11958:	afb0001c 	sw	s0,28(sp)
+   1195c:	00808821 	addu	s1,a0,zero
+   11960:	0c006ca8 	jal	1b2a0 <tm_sys_compute>
+   11964:	afa50010 	sw	a1,16(sp)
+   11968:	40016000 	mfc0	at,c0_status
+   1196c:	00000000 	sll	zero,zero,0x0
+   11970:	00018025 	or	s0,zero,at
+   11974:	00010842 	srl	at,at,0x1
+   11978:	00010840 	sll	at,at,0x1
+   1197c:	40816000 	mtc0	at,c0_status
+   11980:	8e220178 	lw	v0,376(s1)
+   11984:	24030003 	addiu	v1,zero,3
+   11988:	8c420004 	lw	v0,4(v0)
+   1198c:	ae230130 	sw	v1,304(s1)
+   11990:	0040f809 	jalr	v0
+   11994:	02202021 	addu	a0,s1,zero
+   11998:	8fa50010 	lw	a1,16(sp)
+   1199c:	0c0044f8 	jal	113e0 <sched_setpolicy+0x60>
+   119a0:	02202021 	addu	a0,s1,zero
+   119a4:	40016000 	mfc0	at,c0_status
+   119a8:	340200ff 	ori	v0,zero,0xff
+   119ac:	00501024 	and	v0,v0,s0
+   119b0:	00220825 	or	at,at,v0
+   119b4:	40816000 	mtc0	at,c0_status
+   119b8:	8fbf0024 	lw	ra,36(sp)
+   119bc:	8fb10020 	lw	s1,32(sp)
+   119c0:	8fb0001c 	lw	s0,28(sp)
+   119c4:	03e00008 	jr	ra
+   119c8:	27bd0028 	addiu	sp,sp,40
+   119cc:	8c830174 	lw	v1,372(a0)
+   119d0:	3c020001 	lui	v0,0x1
+   119d4:	27bdffe0 	addiu	sp,sp,-32
+   119d8:	00621021 	addu	v0,v1,v0
+   119dc:	afb00014 	sw	s0,20(sp)
+   119e0:	8c5082e4 	lw	s0,-32028(v0)
+   119e4:	afb10018 	sw	s1,24(sp)
+   119e8:	00808821 	addu	s1,a0,zero
+   119ec:	afbf001c 	sw	ra,28(sp)
+   119f0:	0c004bc3 	jal	12f0c <spinlock_lock>
+   119f4:	02002021 	addu	a0,s0,zero
+   119f8:	8e240168 	lw	a0,360(s1)
+   119fc:	26020054 	addiu	v0,s0,84
+   11a00:	000420c0 	sll	a0,a0,0x3
+   11a04:	00442021 	addu	a0,v0,a0
+   11a08:	00002821 	addu	a1,zero,zero
+   11a0c:	0c00c182 	jal	30608 <memset>
+   11a10:	24060008 	addiu	a2,zero,8
+   11a14:	8e230168 	lw	v1,360(s1)
+   11a18:	24050001 	addiu	a1,zero,1
+   11a1c:	00031142 	srl	v0,v1,0x5
+   11a20:	24420004 	addiu	v0,v0,4
+   11a24:	00021080 	sll	v0,v0,0x2
+   11a28:	02021021 	addu	v0,s0,v0
+   11a2c:	8c440000 	lw	a0,0(v0)
+   11a30:	00651804 	sllv	v1,a1,v1
+   11a34:	00641825 	or	v1,v1,a0
+   11a38:	ac430000 	sw	v1,0(v0)
+   11a3c:	8e220168 	lw	v0,360(s1)
+   11a40:	8e030014 	lw	v1,20(s0)
+   11a44:	0043182b 	sltu	v1,v0,v1
+   11a48:	10600002 	beqz	v1,11a54 <sched_switch+0x108>
+   11a4c:	02002021 	addu	a0,s0,zero
+   11a50:	ae020014 	sw	v0,20(s0)
+   11a54:	8fbf001c 	lw	ra,28(sp)
+   11a58:	8fb10018 	lw	s1,24(sp)
+   11a5c:	8fb00014 	lw	s0,20(sp)
+   11a60:	08004b0b 	j	12c2c <spinlock_unlock>
+   11a64:	27bd0020 	addiu	sp,sp,32
+
+00011a68 <sched_remove>:
+   11a68:	27bdffb0 	addiu	sp,sp,-80
+   11a6c:	afb00048 	sw	s0,72(sp)
+   11a70:	afbf004c 	sw	ra,76(sp)
+   11a74:	0c004673 	jal	119cc <sched_switch+0x80>
+   11a78:	00808021 	addu	s0,a0,zero
+   11a7c:	40022002 	mfc0	v0,$4,2
+   11a80:	24030008 	addiu	v1,zero,8
+   11a84:	8c420174 	lw	v0,372(v0)
+   11a88:	afa30010 	sw	v1,16(sp)
+   11a8c:	3c030002 	lui	v1,0x2
+   11a90:	2463a4fc 	addiu	v1,v1,-23300
+   11a94:	afa30014 	sw	v1,20(sp)
+   11a98:	afa2001c 	sw	v0,28(sp)
+   11a9c:	afb00018 	sw	s0,24(sp)
+   11aa0:	27a20010 	addiu	v0,sp,16
+   11aa4:	26030354 	addiu	v1,s0,852
+   11aa8:	27a40040 	addiu	a0,sp,64
+   11aac:	8c480000 	lw	t0,0(v0)
+   11ab0:	8c470004 	lw	a3,4(v0)
+   11ab4:	8c460008 	lw	a2,8(v0)
+   11ab8:	8c45000c 	lw	a1,12(v0)
+   11abc:	24420010 	addiu	v0,v0,16
+   11ac0:	ac680000 	sw	t0,0(v1)
+   11ac4:	ac670004 	sw	a3,4(v1)
+   11ac8:	ac660008 	sw	a2,8(v1)
+   11acc:	ac65000c 	sw	a1,12(v1)
+   11ad0:	1444fff6 	bne	v0,a0,11aac <sched_remove+0x44>
+   11ad4:	24630010 	addiu	v1,v1,16
+   11ad8:	8c420000 	lw	v0,0(v0)
+   11adc:	ac620000 	sw	v0,0(v1)
+   11ae0:	40016000 	mfc0	at,c0_status
+   11ae4:	00000000 	sll	zero,zero,0x0
+   11ae8:	00011025 	or	v0,zero,at
+   11aec:	00010842 	srl	at,at,0x1
+   11af0:	00010840 	sll	at,at,0x1
+   11af4:	40816000 	mtc0	at,c0_status
+   11af8:	8e020178 	lw	v0,376(s0)
+   11afc:	8c420008 	lw	v0,8(v0)
+   11b00:	0040f809 	jalr	v0
+   11b04:	02002021 	addu	a0,s0,zero
+   11b08:	24020001 	addiu	v0,zero,1
+   11b0c:	ae020184 	sw	v0,388(s0)
+   11b10:	24020005 	addiu	v0,zero,5
+   11b14:	ae020130 	sw	v0,304(s0)
+   11b18:	02002021 	addu	a0,s0,zero
+   11b1c:	8fbf004c 	lw	ra,76(sp)
+   11b20:	8fb00048 	lw	s0,72(sp)
+   11b24:	08004526 	j	11498 <sched_setpolicy+0x118>
+   11b28:	27bd0050 	addiu	sp,sp,80
+
+00011b2c <sched_add_created>:
+   11b2c:	27bdffe8 	addiu	sp,sp,-24
+   11b30:	afb00010 	sw	s0,16(sp)
+   11b34:	afbf0014 	sw	ra,20(sp)
+   11b38:	0c006c6a 	jal	1b1a8 <tm_create_compute>
+   11b3c:	00808021 	addu	s0,a0,zero
+   11b40:	8e020178 	lw	v0,376(s0)
+   11b44:	ae000130 	sw	zero,304(s0)
+   11b48:	8c420004 	lw	v0,4(v0)
+   11b4c:	0040f809 	jalr	v0
+   11b50:	02002021 	addu	a0,s0,zero
+   11b54:	40016000 	mfc0	at,c0_status
+   11b58:	00000000 	sll	zero,zero,0x0
+   11b5c:	00011825 	or	v1,zero,at
+   11b60:	00010842 	srl	at,at,0x1
+   11b64:	00010840 	sll	at,at,0x1
+   11b68:	40816000 	mtc0	at,c0_status
+   11b6c:	40016000 	mfc0	at,c0_status
+   11b70:	340200ff 	ori	v0,zero,0xff
+   11b74:	00431024 	and	v0,v0,v1
+   11b78:	00220825 	or	at,at,v0
+   11b7c:	40816000 	mtc0	at,c0_status
+   11b80:	8fbf0014 	lw	ra,20(sp)
+   11b84:	8fb00010 	lw	s0,16(sp)
+   11b88:	03e00008 	jr	ra
+   11b8c:	27bd0018 	addiu	sp,sp,24
+
+00011b90 <sched_exit>:
+   11b90:	27bdffb0 	addiu	sp,sp,-80
+   11b94:	afb00048 	sw	s0,72(sp)
+   11b98:	afbf004c 	sw	ra,76(sp)
+   11b9c:	0c006c7a 	jal	1b1e8 <tm_exit_compute>
+   11ba0:	00808021 	addu	s0,a0,zero
+   11ba4:	0c004673 	jal	119cc <sched_switch+0x80>
+   11ba8:	02002021 	addu	a0,s0,zero
+   11bac:	40022002 	mfc0	v0,$4,2
+   11bb0:	24030008 	addiu	v1,zero,8
+   11bb4:	8c420174 	lw	v0,372(v0)
+   11bb8:	afa30010 	sw	v1,16(sp)
+   11bbc:	3c030002 	lui	v1,0x2
+   11bc0:	2463a4fc 	addiu	v1,v1,-23300
+   11bc4:	afa30014 	sw	v1,20(sp)
+   11bc8:	afa2001c 	sw	v0,28(sp)
+   11bcc:	afb00018 	sw	s0,24(sp)
+   11bd0:	27a20010 	addiu	v0,sp,16
+   11bd4:	26030354 	addiu	v1,s0,852
+   11bd8:	27a40040 	addiu	a0,sp,64
+   11bdc:	8c480000 	lw	t0,0(v0)
+   11be0:	8c470004 	lw	a3,4(v0)
+   11be4:	8c460008 	lw	a2,8(v0)
+   11be8:	8c45000c 	lw	a1,12(v0)
+   11bec:	24420010 	addiu	v0,v0,16
+   11bf0:	ac680000 	sw	t0,0(v1)
+   11bf4:	ac670004 	sw	a3,4(v1)
+   11bf8:	ac660008 	sw	a2,8(v1)
+   11bfc:	ac65000c 	sw	a1,12(v1)
+   11c00:	1444fff6 	bne	v0,a0,11bdc <sched_exit+0x4c>
+   11c04:	24630010 	addiu	v1,v1,16
+   11c08:	8c420000 	lw	v0,0(v0)
+   11c0c:	ac620000 	sw	v0,0(v1)
+   11c10:	40016000 	mfc0	at,c0_status
+   11c14:	00000000 	sll	zero,zero,0x0
+   11c18:	00011025 	or	v0,zero,at
+   11c1c:	00010842 	srl	at,at,0x1
+   11c20:	00010840 	sll	at,at,0x1
+   11c24:	40816000 	mtc0	at,c0_status
+   11c28:	8e020178 	lw	v0,376(s0)
+   11c2c:	8c42000c 	lw	v0,12(v0)
+   11c30:	0040f809 	jalr	v0
+   11c34:	02002021 	addu	a0,s0,zero
+   11c38:	24020005 	addiu	v0,zero,5
+   11c3c:	ae020130 	sw	v0,304(s0)
+   11c40:	02002021 	addu	a0,s0,zero
+   11c44:	8fbf004c 	lw	ra,76(sp)
+   11c48:	8fb00048 	lw	s0,72(sp)
+   11c4c:	08004526 	j	11498 <sched_setpolicy+0x118>
+   11c50:	27bd0050 	addiu	sp,sp,80
+
+00011c54 <sched_register>:
+   11c54:	8c830174 	lw	v1,372(a0)
+   11c58:	3c020001 	lui	v0,0x1
+   11c5c:	27bdffe0 	addiu	sp,sp,-32
+   11c60:	00621021 	addu	v0,v1,v0
+   11c64:	afb00014 	sw	s0,20(sp)
+   11c68:	8c5082e4 	lw	s0,-32028(v0)
+   11c6c:	afb10018 	sw	s1,24(sp)
+   11c70:	00808821 	addu	s1,a0,zero
+   11c74:	afbf001c 	sw	ra,28(sp)
+   11c78:	0c004bc3 	jal	12f0c <spinlock_lock>
+   11c7c:	02002021 	addu	a0,s0,zero
+   11c80:	8e050014 	lw	a1,20(s0)
+   11c84:	2ca20020 	sltiu	v0,a1,32
+   11c88:	14400003 	bnez	v0,11c98 <sched_register+0x44>
+   11c8c:	26040010 	addiu	a0,s0,16
+   11c90:	ae000014 	sw	zero,20(s0)
+   11c94:	00002821 	addu	a1,zero,zero
+   11c98:	0c00b895 	jal	2e254 <bitmap_ffs2>
+   11c9c:	24060004 	addiu	a2,zero,4
+   11ca0:	2403ffff 	addiu	v1,zero,-1
+   11ca4:	10430015 	beq	v0,v1,11cfc <sched_register+0xa8>
+   11ca8:	00021942 	srl	v1,v0,0x5
+   11cac:	24630004 	addiu	v1,v1,4
+   11cb0:	00031880 	sll	v1,v1,0x2
+   11cb4:	02031821 	addu	v1,s0,v1
+   11cb8:	24050001 	addiu	a1,zero,1
+   11cbc:	8c640000 	lw	a0,0(v1)
+   11cc0:	00452804 	sllv	a1,a1,v0
+   11cc4:	00052827 	nor	a1,zero,a1
+   11cc8:	00a42824 	and	a1,a1,a0
+   11ccc:	24440001 	addiu	a0,v0,1
+   11cd0:	ae040014 	sw	a0,20(s0)
+   11cd4:	ac650000 	sw	a1,0(v1)
+   11cd8:	02002021 	addu	a0,s0,zero
+   11cdc:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   11ce0:	ae220168 	sw	v0,360(s1)
+   11ce4:	8fbf001c 	lw	ra,28(sp)
+   11ce8:	00001021 	addu	v0,zero,zero
+   11cec:	8fb10018 	lw	s1,24(sp)
+   11cf0:	8fb00014 	lw	s0,20(sp)
+   11cf4:	03e00008 	jr	ra
+   11cf8:	27bd0020 	addiu	sp,sp,32
+   11cfc:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   11d00:	02002021 	addu	a0,s0,zero
+   11d04:	8fbf001c 	lw	ra,28(sp)
+   11d08:	24020022 	addiu	v0,zero,34
+   11d0c:	8fb10018 	lw	s1,24(sp)
+   11d10:	8fb00014 	lw	s0,20(sp)
+   11d14:	03e00008 	jr	ra
+   11d18:	27bd0020 	addiu	sp,sp,32
+
+00011d1c <sched_init>:
+   11d1c:	27bdffc8 	addiu	sp,sp,-56
+   11d20:	24020001 	addiu	v0,zero,1
+   11d24:	afb20030 	sw	s2,48(sp)
+   11d28:	afa20010 	sw	v0,16(sp)
+   11d2c:	27b20010 	addiu	s2,sp,16
+   11d30:	24020160 	addiu	v0,zero,352
+   11d34:	afb00028 	sw	s0,40(sp)
+   11d38:	afa20014 	sw	v0,20(sp)
+   11d3c:	00808021 	addu	s0,a0,zero
+   11d40:	3c02000d 	lui	v0,0xd
+   11d44:	02402021 	addu	a0,s2,zero
+   11d48:	afb1002c 	sw	s1,44(sp)
+   11d4c:	afbf0034 	sw	ra,52(sp)
+   11d50:	0c00713f 	jal	1c4fc <kmem_alloc>
+   11d54:	afa20018 	sw	v0,24(sp)
+   11d58:	10400017 	beqz	v0,11db8 <sched_init+0x9c>
+   11d5c:	00408821 	addu	s1,v0,zero
+   11d60:	3c050003 	lui	a1,0x3
+   11d64:	00402021 	addu	a0,v0,zero
+   11d68:	0c004a24 	jal	12890 <spinlock_init>
+   11d6c:	24a55d88 	addiu	a1,a1,23944
+   11d70:	26020010 	addiu	v0,s0,16
+   11d74:	00002821 	addu	a1,zero,zero
+   11d78:	26240010 	addiu	a0,s1,16
+   11d7c:	ae020014 	sw	v0,20(s0)
+   11d80:	ae020010 	sw	v0,16(s0)
+   11d84:	0c00b8f0 	jal	2e3c0 <bitmap_set_range>
+   11d88:	24060020 	addiu	a2,zero,32
+   11d8c:	02002021 	addu	a0,s0,zero
+   11d90:	0c004275 	jal	109d4 <rr_sched_init>
+   11d94:	26050018 	addiu	a1,s0,24
+   11d98:	1440000e 	bnez	v0,11dd4 <sched_init+0xb8>
+   11d9c:	8fbf0034 	lw	ra,52(sp)
+   11da0:	ae11000c 	sw	s1,12(s0)
+   11da4:	8fb20030 	lw	s2,48(sp)
+   11da8:	8fb1002c 	lw	s1,44(sp)
+   11dac:	8fb00028 	lw	s0,40(sp)
+   11db0:	03e00008 	jr	ra
+   11db4:	27bd0038 	addiu	sp,sp,56
+   11db8:	8fbf0034 	lw	ra,52(sp)
+   11dbc:	2402000c 	addiu	v0,zero,12
+   11dc0:	8fb20030 	lw	s2,48(sp)
+   11dc4:	8fb1002c 	lw	s1,44(sp)
+   11dc8:	8fb00028 	lw	s0,40(sp)
+   11dcc:	03e00008 	jr	ra
+   11dd0:	27bd0038 	addiu	sp,sp,56
+   11dd4:	02402021 	addu	a0,s2,zero
+   11dd8:	afb1001c 	sw	s1,28(sp)
+   11ddc:	0c007134 	jal	1c4d0 <kmem_free>
+   11de0:	afa20020 	sw	v0,32(sp)
+   11de4:	8fbf0034 	lw	ra,52(sp)
+   11de8:	8fa20020 	lw	v0,32(sp)
+   11dec:	8fb20030 	lw	s2,48(sp)
+   11df0:	8fb1002c 	lw	s1,44(sp)
+   11df4:	8fb00028 	lw	s0,40(sp)
+   11df8:	03e00008 	jr	ra
+   11dfc:	27bd0038 	addiu	sp,sp,56
+
+00011e00 <sem_getvalue>:
+   11e00:	8c830018 	lw	v1,24(a0)
+   11e04:	00001021 	addu	v0,zero,zero
+   11e08:	03e00008 	jr	ra
+   11e0c:	aca30000 	sw	v1,0(a1)
+
+00011e10 <sem_destroy>:
+   11e10:	27bdffe0 	addiu	sp,sp,-32
+   11e14:	afb00018 	sw	s0,24(sp)
+   11e18:	afbf001c 	sw	ra,28(sp)
+   11e1c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   11e20:	00808021 	addu	s0,a0,zero
+   11e24:	8e030018 	lw	v1,24(s0)
+   11e28:	8e020014 	lw	v0,20(s0)
+   11e2c:	10620009 	beq	v1,v0,11e54 <sem_destroy+0x44>
+   11e30:	24020010 	addiu	v0,zero,16
+   11e34:	02002021 	addu	a0,s0,zero
+   11e38:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   11e3c:	afa20010 	sw	v0,16(sp)
+   11e40:	8fbf001c 	lw	ra,28(sp)
+   11e44:	8fa20010 	lw	v0,16(sp)
+   11e48:	8fb00018 	lw	s0,24(sp)
+   11e4c:	03e00008 	jr	ra
+   11e50:	27bd0020 	addiu	sp,sp,32
+   11e54:	00001021 	addu	v0,zero,zero
+   11e58:	ae000020 	sw	zero,32(s0)
+   11e5c:	02002021 	addu	a0,s0,zero
+   11e60:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   11e64:	afa20010 	sw	v0,16(sp)
+   11e68:	8fbf001c 	lw	ra,28(sp)
+   11e6c:	8fa20010 	lw	v0,16(sp)
+   11e70:	8fb00018 	lw	s0,24(sp)
+   11e74:	03e00008 	jr	ra
+   11e78:	27bd0020 	addiu	sp,sp,32
+
+00011e7c <sem_trywait>:
+   11e7c:	27bdffc8 	addiu	sp,sp,-56
+   11e80:	afb0002c 	sw	s0,44(sp)
+   11e84:	afbf0034 	sw	ra,52(sp)
+   11e88:	afb10030 	sw	s1,48(sp)
+   11e8c:	00808021 	addu	s0,a0,zero
+   11e90:	40112002 	mfc0	s1,$4,2
+   11e94:	8c820014 	lw	v0,20(a0)
+   11e98:	24030001 	addiu	v1,zero,1
+   11e9c:	10430013 	beq	v0,v1,11eec <sem_trywait+0x70>
+   11ea0:	00000000 	sll	zero,zero,0x0
+   11ea4:	0c004bc3 	jal	12f0c <spinlock_lock>
+   11ea8:	02002021 	addu	a0,s0,zero
+   11eac:	8e020018 	lw	v0,24(s0)
+   11eb0:	18400021 	blez	v0,11f38 <sem_trywait+0xbc>
+   11eb4:	00000000 	sll	zero,zero,0x0
+   11eb8:	2442ffff 	addiu	v0,v0,-1
+   11ebc:	ae020018 	sw	v0,24(s0)
+   11ec0:	ae110020 	sw	s1,32(s0)
+   11ec4:	00001021 	addu	v0,zero,zero
+   11ec8:	02002021 	addu	a0,s0,zero
+   11ecc:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   11ed0:	afa20020 	sw	v0,32(sp)
+   11ed4:	8fa20020 	lw	v0,32(sp)
+   11ed8:	8fbf0034 	lw	ra,52(sp)
+   11edc:	8fb10030 	lw	s1,48(sp)
+   11ee0:	8fb0002c 	lw	s0,44(sp)
+   11ee4:	03e00008 	jr	ra
+   11ee8:	27bd0038 	addiu	sp,sp,56
+   11eec:	8c830018 	lw	v1,24(a0)
+   11ef0:	1062ffec 	beq	v1,v0,11ea4 <sem_trywait+0x28>
+   11ef4:	00000000 	sll	zero,zero,0x0
+   11ef8:	8c820020 	lw	v0,32(a0)
+   11efc:	1451ffe9 	bne	v0,s1,11ea4 <sem_trywait+0x28>
+   11f00:	3c030004 	lui	v1,0x4
+   11f04:	8c649100 	lw	a0,-28416(v1)
+   11f08:	3c060003 	lui	a2,0x3
+   11f0c:	8e03001c 	lw	v1,28(s0)
+   11f10:	3c070003 	lui	a3,0x3
+   11f14:	24c65da0 	addiu	a2,a2,23968
+   11f18:	24e75e50 	addiu	a3,a3,24144
+   11f1c:	00002821 	addu	a1,zero,zero
+   11f20:	afa30010 	sw	v1,16(sp)
+   11f24:	afa20014 	sw	v0,20(sp)
+   11f28:	0c0009b0 	jal	26c0 <__fprintk>
+   11f2c:	afb00018 	sw	s0,24(sp)
+   11f30:	080047b6 	j	11ed8 <sem_trywait+0x5c>
+   11f34:	24020023 	addiu	v0,zero,35
+   11f38:	080047b2 	j	11ec8 <sem_trywait+0x4c>
+   11f3c:	2402000b 	addiu	v0,zero,11
+
+00011f40 <sem_post>:
+   11f40:	27bdffd8 	addiu	sp,sp,-40
+   11f44:	afb00020 	sw	s0,32(sp)
+   11f48:	afbf0024 	sw	ra,36(sp)
+   11f4c:	00808021 	addu	s0,a0,zero
+   11f50:	40022002 	mfc0	v0,$4,2
+   11f54:	8c840014 	lw	a0,20(a0)
+   11f58:	24030001 	addiu	v1,zero,1
+   11f5c:	10830010 	beq	a0,v1,11fa0 <sem_post+0x60>
+   11f60:	00000000 	sll	zero,zero,0x0
+   11f64:	0c004bc3 	jal	12f0c <spinlock_lock>
+   11f68:	02002021 	addu	a0,s0,zero
+   11f6c:	8e020018 	lw	v0,24(s0)
+   11f70:	24420001 	addiu	v0,v0,1
+   11f74:	1840001d 	blez	v0,11fec <sem_post+0xac>
+   11f78:	ae020018 	sw	v0,24(s0)
+   11f7c:	00001021 	addu	v0,zero,zero
+   11f80:	ae020020 	sw	v0,32(s0)
+   11f84:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   11f88:	02002021 	addu	a0,s0,zero
+   11f8c:	8fbf0024 	lw	ra,36(sp)
+   11f90:	00001021 	addu	v0,zero,zero
+   11f94:	8fb00020 	lw	s0,32(sp)
+   11f98:	03e00008 	jr	ra
+   11f9c:	27bd0028 	addiu	sp,sp,40
+   11fa0:	8e030018 	lw	v1,24(s0)
+   11fa4:	18600016 	blez	v1,12000 <sem_post+0xc0>
+   11fa8:	3c030004 	lui	v1,0x4
+   11fac:	8c649100 	lw	a0,-28416(v1)
+   11fb0:	3c060003 	lui	a2,0x3
+   11fb4:	8e03001c 	lw	v1,28(s0)
+   11fb8:	3c070003 	lui	a3,0x3
+   11fbc:	24c65dd4 	addiu	a2,a2,24020
+   11fc0:	24e75e5c 	addiu	a3,a3,24156
+   11fc4:	00002821 	addu	a1,zero,zero
+   11fc8:	afb00018 	sw	s0,24(sp)
+   11fcc:	afa30010 	sw	v1,16(sp)
+   11fd0:	0c0009b0 	jal	26c0 <__fprintk>
+   11fd4:	afa20014 	sw	v0,20(sp)
+   11fd8:	8fbf0024 	lw	ra,36(sp)
+   11fdc:	24020016 	addiu	v0,zero,22
+   11fe0:	8fb00020 	lw	s0,32(sp)
+   11fe4:	03e00008 	jr	ra
+   11fe8:	27bd0028 	addiu	sp,sp,40
+   11fec:	26040024 	addiu	a0,s0,36
+   11ff0:	0c006d56 	jal	1b558 <wakeup_one>
+   11ff4:	00002821 	addu	a1,zero,zero
+   11ff8:	080047e1 	j	11f84 <sem_post+0x44>
+   11ffc:	ae020020 	sw	v0,32(s0)
+   12000:	8e030020 	lw	v1,32(s0)
+   12004:	1462ffe9 	bne	v1,v0,11fac <sem_post+0x6c>
+   12008:	3c030004 	lui	v1,0x4
+   1200c:	080047d9 	j	11f64 <sem_post+0x24>
+   12010:	00000000 	sll	zero,zero,0x0
+
+00012014 <sem_wait>:
+   12014:	27bdffd0 	addiu	sp,sp,-48
+   12018:	afb00024 	sw	s0,36(sp)
+   1201c:	afbf002c 	sw	ra,44(sp)
+   12020:	afb10028 	sw	s1,40(sp)
+   12024:	00808021 	addu	s0,a0,zero
+   12028:	40112002 	mfc0	s1,$4,2
+   1202c:	8c820014 	lw	v0,20(a0)
+   12030:	24030001 	addiu	v1,zero,1
+   12034:	10430010 	beq	v0,v1,12078 <sem_wait+0x64>
+   12038:	00000000 	sll	zero,zero,0x0
+   1203c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   12040:	02002021 	addu	a0,s0,zero
+   12044:	8e020018 	lw	v0,24(s0)
+   12048:	2442ffff 	addiu	v0,v0,-1
+   1204c:	0440001d 	bltz	v0,120c4 <sem_wait+0xb0>
+   12050:	ae020018 	sw	v0,24(s0)
+   12054:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   12058:	02002021 	addu	a0,s0,zero
+   1205c:	ae110020 	sw	s1,32(s0)
+   12060:	00001021 	addu	v0,zero,zero
+   12064:	8fbf002c 	lw	ra,44(sp)
+   12068:	8fb10028 	lw	s1,40(sp)
+   1206c:	8fb00024 	lw	s0,36(sp)
+   12070:	03e00008 	jr	ra
+   12074:	27bd0030 	addiu	sp,sp,48
+   12078:	8c830018 	lw	v1,24(a0)
+   1207c:	1062ffef 	beq	v1,v0,1203c <sem_wait+0x28>
+   12080:	00000000 	sll	zero,zero,0x0
+   12084:	8c820020 	lw	v0,32(a0)
+   12088:	1451ffec 	bne	v0,s1,1203c <sem_wait+0x28>
+   1208c:	3c030004 	lui	v1,0x4
+   12090:	8c649100 	lw	a0,-28416(v1)
+   12094:	3c060003 	lui	a2,0x3
+   12098:	8e03001c 	lw	v1,28(s0)
+   1209c:	3c070003 	lui	a3,0x3
+   120a0:	24c65e0c 	addiu	a2,a2,24076
+   120a4:	24e75e68 	addiu	a3,a3,24168
+   120a8:	00002821 	addu	a1,zero,zero
+   120ac:	afa30010 	sw	v1,16(sp)
+   120b0:	afa20014 	sw	v0,20(sp)
+   120b4:	0c0009b0 	jal	26c0 <__fprintk>
+   120b8:	afb00018 	sw	s0,24(sp)
+   120bc:	08004819 	j	12064 <sem_wait+0x50>
+   120c0:	24020023 	addiu	v0,zero,35
+   120c4:	24050001 	addiu	a1,zero,1
+   120c8:	0c006d13 	jal	1b44c <wait_on>
+   120cc:	26040024 	addiu	a0,s0,36
+   120d0:	0c004b07 	jal	12c1c <spinlock_unlock_nosched>
+   120d4:	02002021 	addu	a0,s0,zero
+   120d8:	40042002 	mfc0	a0,$4,2
+   120dc:	0c004634 	jal	118d0 <sched_sleep>
+   120e0:	00000000 	sll	zero,zero,0x0
+   120e4:	08004818 	j	12060 <sem_wait+0x4c>
+   120e8:	ae110020 	sw	s1,32(s0)
+
+000120ec <sem_init>:
+   120ec:	27bdffd8 	addiu	sp,sp,-40
+   120f0:	2ca20801 	sltiu	v0,a1,2049
+   120f4:	afb1001c 	sw	s1,28(sp)
+   120f8:	afb00018 	sw	s0,24(sp)
+   120fc:	afbf0024 	sw	ra,36(sp)
+   12100:	afb20020 	sw	s2,32(sp)
+   12104:	00a08021 	addu	s0,a1,zero
+   12108:	1040001a 	beqz	v0,12174 <sem_init+0x88>
+   1210c:	00808821 	addu	s1,a0,zero
+   12110:	10800018 	beqz	a0,12174 <sem_init+0x88>
+   12114:	3c120003 	lui	s2,0x3
+   12118:	26455e40 	addiu	a1,s2,24128
+   1211c:	0c004a24 	jal	12890 <spinlock_init>
+   12120:	afa60010 	sw	a2,16(sp)
+   12124:	8fa60010 	lw	a2,16(sp)
+   12128:	3c03a0b1 	lui	v1,0xa0b1
+   1212c:	8fbf0024 	lw	ra,36(sp)
+   12130:	2622002c 	addiu	v0,s1,44
+   12134:	26525e40 	addiu	s2,s2,24128
+   12138:	3463c0b3 	ori	v1,v1,0xc0b3
+   1213c:	ae220030 	sw	v0,48(s1)
+   12140:	ae300018 	sw	s0,24(s1)
+   12144:	ae320024 	sw	s2,36(s1)
+   12148:	ae300014 	sw	s0,20(s1)
+   1214c:	ae22002c 	sw	v0,44(s1)
+   12150:	ae230010 	sw	v1,16(s1)
+   12154:	ae26001c 	sw	a2,28(s1)
+   12158:	ae200028 	sw	zero,40(s1)
+   1215c:	00001021 	addu	v0,zero,zero
+   12160:	8fb20020 	lw	s2,32(sp)
+   12164:	8fb1001c 	lw	s1,28(sp)
+   12168:	8fb00018 	lw	s0,24(sp)
+   1216c:	03e00008 	jr	ra
+   12170:	27bd0028 	addiu	sp,sp,40
+   12174:	8fbf0024 	lw	ra,36(sp)
+   12178:	24020016 	addiu	v0,zero,22
+   1217c:	8fb20020 	lw	s2,32(sp)
+   12180:	8fb1001c 	lw	s1,28(sp)
+   12184:	8fb00018 	lw	s0,24(sp)
+   12188:	03e00008 	jr	ra
+   1218c:	27bd0028 	addiu	sp,sp,40
+
+00012190 <signal_init>:
+   12190:	ac800260 	sw	zero,608(a0)
+   12194:	40022002 	mfc0	v0,$4,2
+   12198:	8c430264 	lw	v1,612(v0)
+   1219c:	00001021 	addu	v0,zero,zero
+   121a0:	03e00008 	jr	ra
+   121a4:	ac830264 	sw	v1,612(a0)
+
+000121a8 <__signal_rise_main>:
+   121a8:	27bdffc8 	addiu	sp,sp,-56
+   121ac:	afb20020 	sw	s2,32(sp)
+   121b0:	3c120004 	lui	s2,0x4
+   121b4:	afb30024 	sw	s3,36(sp)
+   121b8:	afb1001c 	sw	s1,28(sp)
+   121bc:	afb00018 	sw	s0,24(sp)
+   121c0:	afbf0034 	sw	ra,52(sp)
+   121c4:	afb60030 	sw	s6,48(sp)
+   121c8:	afb5002c 	sw	s5,44(sp)
+   121cc:	afb40028 	sw	s4,40(sp)
+   121d0:	2653c960 	addiu	s3,s2,-13984
+   121d4:	8a620003 	lwl	v0,3(s3)
+   121d8:	00c08821 	addu	s1,a2,zero
+   121dc:	9a42c960 	lwr	v0,-13984(s2)
+   121e0:	3042ffff 	andi	v0,v0,0xffff
+   121e4:	00021a80 	sll	v1,v0,0xa
+   121e8:	1067005b 	beq	v1,a3,12358 <__signal_rise_main+0x1b0>
+   121ec:	8fb00048 	lw	s0,72(sp)
+   121f0:	24630001 	addiu	v1,v1,1
+   121f4:	10670058 	beq	v1,a3,12358 <__signal_rise_main+0x1b0>
+   121f8:	00000000 	sll	zero,zero,0x0
+   121fc:	0c0061d9 	jal	18764 <tasks_manager_lock>
+   12200:	afa70010 	sw	a3,16(sp)
+   12204:	8a620003 	lwl	v0,3(s3)
+   12208:	8fa70010 	lw	a3,16(sp)
+   1220c:	9a42c960 	lwr	v0,-13984(s2)
+   12210:	00071a82 	srl	v1,a3,0xa
+   12214:	3042ffff 	andi	v0,v0,0xffff
+   12218:	1062005c 	beq	v1,v0,1238c <__signal_rise_main+0x1e4>
+   1221c:	00000000 	sll	zero,zero,0x0
+   12220:	0c006174 	jal	185d0 <tasks_manager_get_htable>
+   12224:	afa70010 	sw	a3,16(sp)
+   12228:	8fa70010 	lw	a3,16(sp)
+   1222c:	00402021 	addu	a0,v0,zero
+   12230:	0c002a77 	jal	a9dc <hfind>
+   12234:	00e02821 	addu	a1,a3,zero
+   12238:	2455f82c 	addiu	s5,v0,-2004
+   1223c:	12a00059 	beqz	s5,123a4 <__signal_rise_main+0x1fc>
+   12240:	24020003 	addiu	v0,zero,3
+   12244:	2402000f 	addiu	v0,zero,15
+   12248:	1202001f 	beq	s0,v0,122c8 <__signal_rise_main+0x120>
+   1224c:	24020009 	addiu	v0,zero,9
+   12250:	1202001d 	beq	s0,v0,122c8 <__signal_rise_main+0x120>
+   12254:	26b300a0 	addiu	s3,s5,160
+   12258:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1225c:	02602021 	addu	a0,s3,zero
+   12260:	8eb207d0 	lw	s2,2000(s5)
+   12264:	1240005a 	beqz	s2,123d0 <__signal_rise_main+0x228>
+   12268:	00000000 	sll	zero,zero,0x0
+   1226c:	26540120 	addiu	s4,s2,288
+   12270:	0c004bc3 	jal	12f0c <spinlock_lock>
+   12274:	02802021 	addu	a0,s4,zero
+   12278:	8e420260 	lw	v0,608(s2)
+   1227c:	24030001 	addiu	v1,zero,1
+   12280:	02038004 	sllv	s0,v1,s0
+   12284:	00508025 	or	s0,v0,s0
+   12288:	ae500260 	sw	s0,608(s2)
+   1228c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   12290:	02802021 	addu	a0,s4,zero
+   12294:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   12298:	02602021 	addu	a0,s3,zero
+   1229c:	ae200000 	sw	zero,0(s1)
+   122a0:	8fbf0034 	lw	ra,52(sp)
+   122a4:	8fb60030 	lw	s6,48(sp)
+   122a8:	8fb5002c 	lw	s5,44(sp)
+   122ac:	8fb40028 	lw	s4,40(sp)
+   122b0:	8fb30024 	lw	s3,36(sp)
+   122b4:	8fb20020 	lw	s2,32(sp)
+   122b8:	8fb1001c 	lw	s1,28(sp)
+   122bc:	8fb00018 	lw	s0,24(sp)
+   122c0:	080061d6 	j	18758 <tasks_manager_unlock>
+   122c4:	27bd0038 	addiu	sp,sp,56
+   122c8:	26b600a0 	addiu	s6,s5,160
+   122cc:	0c004bc3 	jal	12f0c <spinlock_lock>
+   122d0:	02c02021 	addu	a0,s6,zero
+   122d4:	8eb30744 	lw	s3,1860(s5)
+   122d8:	26b50744 	addiu	s5,s5,1860
+   122dc:	12750011 	beq	s3,s5,12324 <__signal_rise_main+0x17c>
+   122e0:	8e720000 	lw	s2,0(s3)
+   122e4:	24020001 	addiu	v0,zero,1
+   122e8:	080048bd 	j	122f4 <__signal_rise_main+0x14c>
+   122ec:	02028004 	sllv	s0,v0,s0
+   122f0:	00409021 	addu	s2,v0,zero
+   122f4:	2674ff30 	addiu	s4,s3,-208
+   122f8:	02802021 	addu	a0,s4,zero
+   122fc:	0c004bc3 	jal	12f0c <spinlock_lock>
+   12300:	2673fe10 	addiu	s3,s3,-496
+   12304:	8e620260 	lw	v0,608(s3)
+   12308:	02802021 	addu	a0,s4,zero
+   1230c:	00501025 	or	v0,v0,s0
+   12310:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   12314:	ae620260 	sw	v0,608(s3)
+   12318:	02409821 	addu	s3,s2,zero
+   1231c:	16b2fff4 	bne	s5,s2,122f0 <__signal_rise_main+0x148>
+   12320:	8e420000 	lw	v0,0(s2)
+   12324:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   12328:	02c02021 	addu	a0,s6,zero
+   1232c:	ae200000 	sw	zero,0(s1)
+   12330:	8fbf0034 	lw	ra,52(sp)
+   12334:	8fb60030 	lw	s6,48(sp)
+   12338:	8fb5002c 	lw	s5,44(sp)
+   1233c:	8fb40028 	lw	s4,40(sp)
+   12340:	8fb30024 	lw	s3,36(sp)
+   12344:	8fb20020 	lw	s2,32(sp)
+   12348:	8fb1001c 	lw	s1,28(sp)
+   1234c:	8fb00018 	lw	s0,24(sp)
+   12350:	080061d6 	j	18758 <tasks_manager_unlock>
+   12354:	27bd0038 	addiu	sp,sp,56
+   12358:	1440ffa8 	bnez	v0,121fc <__signal_rise_main+0x54>
+   1235c:	8fbf0034 	lw	ra,52(sp)
+   12360:	24020001 	addiu	v0,zero,1
+   12364:	ae220000 	sw	v0,0(s1)
+   12368:	8fb60030 	lw	s6,48(sp)
+   1236c:	8fb5002c 	lw	s5,44(sp)
+   12370:	8fb40028 	lw	s4,40(sp)
+   12374:	8fb30024 	lw	s3,36(sp)
+   12378:	8fb20020 	lw	s2,32(sp)
+   1237c:	8fb1001c 	lw	s1,28(sp)
+   12380:	8fb00018 	lw	s0,24(sp)
+   12384:	03e00008 	jr	ra
+   12388:	27bd0038 	addiu	sp,sp,56
+   1238c:	0c006220 	jal	18880 <task_lookup>
+   12390:	00e02021 	addu	a0,a3,zero
+   12394:	8c550004 	lw	s5,4(v0)
+   12398:	16a0ffab 	bnez	s5,12248 <__signal_rise_main+0xa0>
+   1239c:	2402000f 	addiu	v0,zero,15
+   123a0:	24020003 	addiu	v0,zero,3
+   123a4:	ae220000 	sw	v0,0(s1)
+   123a8:	8fbf0034 	lw	ra,52(sp)
+   123ac:	8fb60030 	lw	s6,48(sp)
+   123b0:	8fb5002c 	lw	s5,44(sp)
+   123b4:	8fb40028 	lw	s4,40(sp)
+   123b8:	8fb30024 	lw	s3,36(sp)
+   123bc:	8fb20020 	lw	s2,32(sp)
+   123c0:	8fb1001c 	lw	s1,28(sp)
+   123c4:	8fb00018 	lw	s0,24(sp)
+   123c8:	080061d6 	j	18758 <tasks_manager_unlock>
+   123cc:	27bd0038 	addiu	sp,sp,56
+   123d0:	8eb20744 	lw	s2,1860(s5)
+   123d4:	0800489b 	j	1226c <__signal_rise_main+0xc4>
+   123d8:	2652fe10 	addiu	s2,s2,-496
+
+000123dc <__signal_rise_local>:
+   123dc:	27bdffe0 	addiu	sp,sp,-32
+   123e0:	afbf001c 	sw	ra,28(sp)
+   123e4:	00801821 	addu	v1,a0,zero
+   123e8:	00a01021 	addu	v0,a1,zero
+   123ec:	40077801 	mfc0	a3,$15,1
+   123f0:	3c050004 	lui	a1,0x4
+   123f4:	24a4c960 	addiu	a0,a1,-13984
+   123f8:	88840003 	lwl	a0,3(a0)
+   123fc:	30e70003 	andi	a3,a3,0x3
+   12400:	3c080004 	lui	t0,0x4
+   12404:	2508c950 	addiu	t0,t0,-14000
+   12408:	00073880 	sll	a3,a3,0x2
+   1240c:	00e83821 	addu	a3,a3,t0
+   12410:	98a4c960 	lwr	a0,-13984(a1)
+   12414:	8ce50000 	lw	a1,0(a3)
+   12418:	8c470000 	lw	a3,0(v0)
+   1241c:	8cc20000 	lw	v0,0(a2)
+   12420:	3084ffff 	andi	a0,a0,0xffff
+   12424:	00603021 	addu	a2,v1,zero
+   12428:	0c00486a 	jal	121a8 <__signal_rise_main>
+   1242c:	afa20010 	sw	v0,16(sp)
+   12430:	8fbf001c 	lw	ra,28(sp)
+   12434:	03e00008 	jr	ra
+   12438:	27bd0020 	addiu	sp,sp,32
+
+0001243c <signal_rise>:
+   1243c:	27bdffa8 	addiu	sp,sp,-88
+   12440:	afb0004c 	sw	s0,76(sp)
+   12444:	3402ffff 	ori	v0,zero,0xffff
+   12448:	30b0ffff 	andi	s0,a1,0xffff
+   1244c:	afbf0054 	sw	ra,84(sp)
+   12450:	afb10050 	sw	s1,80(sp)
+   12454:	afa60060 	sw	a2,96(sp)
+   12458:	12020034 	beq	s0,v0,1252c <signal_rise+0xf0>
+   1245c:	afa40058 	sw	a0,88(sp)
+   12460:	3c020004 	lui	v0,0x4
+   12464:	2443c960 	addiu	v1,v0,-13984
+   12468:	88640003 	lwl	a0,3(v1)
+   1246c:	2405000b 	addiu	a1,zero,11
+   12470:	9844c960 	lwr	a0,-13984(v0)
+   12474:	24030004 	addiu	v1,zero,4
+   12478:	3082ffff 	andi	v0,a0,0xffff
+   1247c:	27a60060 	addiu	a2,sp,96
+   12480:	27a40028 	addiu	a0,sp,40
+   12484:	afa50028 	sw	a1,40(sp)
+   12488:	27a50058 	addiu	a1,sp,88
+   1248c:	afa30040 	sw	v1,64(sp)
+   12490:	afa4002c 	sw	a0,44(sp)
+   12494:	afa30030 	sw	v1,48(sp)
+   12498:	afa50034 	sw	a1,52(sp)
+   1249c:	afa60038 	sw	a2,56(sp)
+   124a0:	1202001e 	beq	s0,v0,1251c <signal_rise+0xe0>
+   124a4:	afa3003c 	sw	v1,60(sp)
+   124a8:	40117801 	mfc0	s1,$15,1
+   124ac:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   124b0:	00000000 	sll	zero,zero,0x0
+   124b4:	70501802 	mul	v1,v0,s0
+   124b8:	24020001 	addiu	v0,zero,1
+   124bc:	afa20010 	sw	v0,16(sp)
+   124c0:	24020002 	addiu	v0,zero,2
+   124c4:	afa20014 	sw	v0,20(sp)
+   124c8:	27a2002c 	addiu	v0,sp,44
+   124cc:	afa20018 	sw	v0,24(sp)
+   124d0:	27a20030 	addiu	v0,sp,48
+   124d4:	32240003 	andi	a0,s1,0x3
+   124d8:	3c070001 	lui	a3,0x1
+   124dc:	afa2001c 	sw	v0,28(sp)
+   124e0:	27a20034 	addiu	v0,sp,52
+   124e4:	afa20020 	sw	v0,32(sp)
+   124e8:	00642021 	addu	a0,v1,a0
+   124ec:	27a2003c 	addiu	v0,sp,60
+   124f0:	24e72564 	addiu	a3,a3,9572
+   124f4:	24050001 	addiu	a1,zero,1
+   124f8:	00003021 	addu	a2,zero,zero
+   124fc:	0c003de8 	jal	f7a0 <rppc_generic>
+   12500:	afa20024 	sw	v0,36(sp)
+   12504:	8fa20028 	lw	v0,40(sp)
+   12508:	8fbf0054 	lw	ra,84(sp)
+   1250c:	8fb10050 	lw	s1,80(sp)
+   12510:	8fb0004c 	lw	s0,76(sp)
+   12514:	03e00008 	jr	ra
+   12518:	27bd0058 	addiu	sp,sp,88
+   1251c:	0c0048f7 	jal	123dc <__signal_rise_local>
+   12520:	00000000 	sll	zero,zero,0x0
+   12524:	08004942 	j	12508 <signal_rise+0xcc>
+   12528:	8fa20028 	lw	v0,40(sp)
+   1252c:	3c020004 	lui	v0,0x4
+   12530:	8c429100 	lw	v0,-28416(v0)
+   12534:	3c060003 	lui	a2,0x3
+   12538:	3c070003 	lui	a3,0x3
+   1253c:	afa40010 	sw	a0,16(sp)
+   12540:	24c65e74 	addiu	a2,a2,24180
+   12544:	00402021 	addu	a0,v0,zero
+   12548:	24e75edc 	addiu	a3,a3,24284
+   1254c:	24020003 	addiu	v0,zero,3
+   12550:	00002821 	addu	a1,zero,zero
+   12554:	0c0009b0 	jal	26c0 <__fprintk>
+   12558:	afa20028 	sw	v0,40(sp)
+   1255c:	08004942 	j	12508 <signal_rise+0xcc>
+   12560:	8fa20028 	lw	v0,40(sp)
+
+00012564 <__signal_rise_demarshall>:
+   12564:	27bdffc0 	addiu	sp,sp,-64
+   12568:	afbf003c 	sw	ra,60(sp)
+   1256c:	afbe0038 	sw	s8,56(sp)
+   12570:	afb40034 	sw	s4,52(sp)
+   12574:	03a0f021 	addu	s8,sp,zero
+   12578:	afb30030 	sw	s3,48(sp)
+   1257c:	afb2002c 	sw	s2,44(sp)
+   12580:	afb10028 	sw	s1,40(sp)
+   12584:	afb00024 	sw	s0,36(sp)
+   12588:	27bdfff0 	addiu	sp,sp,-16
+   1258c:	27b20018 	addiu	s2,sp,24
+   12590:	27bdffc8 	addiu	sp,sp,-56
+   12594:	27b10018 	addiu	s1,sp,24
+   12598:	26220028 	addiu	v0,s1,40
+   1259c:	2403002c 	addiu	v1,zero,44
+   125a0:	ae230008 	sw	v1,8(s1)
+   125a4:	ae420000 	sw	v0,0(s2)
+   125a8:	24030004 	addiu	v1,zero,4
+   125ac:	00808021 	addu	s0,a0,zero
+   125b0:	ae230024 	sw	v1,36(s1)
+   125b4:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   125b8:	8c940000 	lw	s4,0(a0)
+   125bc:	8e460000 	lw	a2,0(s2)
+   125c0:	02002021 	addu	a0,s0,zero
+   125c4:	00002821 	addu	a1,zero,zero
+   125c8:	8e120000 	lw	s2,0(s0)
+   125cc:	afc6001c 	sw	a2,28(s8)
+   125d0:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   125d4:	00409821 	addu	s3,v0,zero
+   125d8:	8c470000 	lw	a3,0(v0)
+   125dc:	02002021 	addu	a0,s0,zero
+   125e0:	24050001 	addiu	a1,zero,1
+   125e4:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   125e8:	afc70018 	sw	a3,24(s8)
+   125ec:	0293001b 	divu	zero,s4,s3
+   125f0:	026001f4 	teq	s3,zero,0x7
+   125f4:	8c420000 	lw	v0,0(v0)
+   125f8:	8fc6001c 	lw	a2,28(s8)
+   125fc:	8fc70018 	lw	a3,24(s8)
+   12600:	02402821 	addu	a1,s2,zero
+   12604:	afa20010 	sw	v0,16(sp)
+   12608:	00002012 	mflo	a0
+   1260c:	0c00486a 	jal	121a8 <__signal_rise_main>
+   12610:	3084ffff 	andi	a0,a0,0xffff
+   12614:	02002021 	addu	a0,s0,zero
+   12618:	02202821 	addu	a1,s1,zero
+   1261c:	2406002c 	addiu	a2,zero,44
+   12620:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   12624:	24070001 	addiu	a3,zero,1
+   12628:	03c0e821 	addu	sp,s8,zero
+   1262c:	8fbf003c 	lw	ra,60(sp)
+   12630:	8fbe0038 	lw	s8,56(sp)
+   12634:	8fb40034 	lw	s4,52(sp)
+   12638:	8fb30030 	lw	s3,48(sp)
+   1263c:	8fb2002c 	lw	s2,44(sp)
+   12640:	8fb10028 	lw	s1,40(sp)
+   12644:	8fb00024 	lw	s0,36(sp)
+   12648:	03e00008 	jr	ra
+   1264c:	27bd0040 	addiu	sp,sp,64
+
+00012650 <signal_manager_init>:
+   12650:	27bdffe8 	addiu	sp,sp,-24
+   12654:	afb00010 	sw	s0,16(sp)
+   12658:	00002821 	addu	a1,zero,zero
+   1265c:	00808021 	addu	s0,a0,zero
+   12660:	24060084 	addiu	a2,zero,132
+   12664:	afbf0014 	sw	ra,20(sp)
+   12668:	0c00c182 	jal	30608 <memset>
+   1266c:	24840750 	addiu	a0,a0,1872
+   12670:	8fbf0014 	lw	ra,20(sp)
+   12674:	24020001 	addiu	v0,zero,1
+   12678:	ae020790 	sw	v0,1936(s0)
+   1267c:	ae0207a0 	sw	v0,1952(s0)
+   12680:	00001021 	addu	v0,zero,zero
+   12684:	8fb00010 	lw	s0,16(sp)
+   12688:	03e00008 	jr	ra
+   1268c:	27bd0018 	addiu	sp,sp,24
+
+00012690 <kill_sigaction>:
+   12690:	27bdffd8 	addiu	sp,sp,-40
+   12694:	afbf0024 	sw	ra,36(sp)
+   12698:	00803821 	addu	a3,a0,zero
+   1269c:	40022002 	mfc0	v0,$4,2
+   126a0:	24030002 	addiu	v1,zero,2
+   126a4:	ac430130 	sw	v1,304(v0)
+   126a8:	40037801 	mfc0	v1,$15,1
+   126ac:	3c040004 	lui	a0,0x4
+   126b0:	30630003 	andi	v1,v1,0x3
+   126b4:	8c450180 	lw	a1,384(v0)
+   126b8:	2484c950 	addiu	a0,a0,-14000
+   126bc:	00031880 	sll	v1,v1,0x2
+   126c0:	00641821 	addu	v1,v1,a0
+   126c4:	3c040004 	lui	a0,0x4
+   126c8:	8ca805c4 	lw	t0,1476(a1)
+   126cc:	8c630000 	lw	v1,0(v1)
+   126d0:	8c849100 	lw	a0,-28416(a0)
+   126d4:	3c060003 	lui	a2,0x3
+   126d8:	24c65e9c 	addiu	a2,a2,24220
+   126dc:	00002821 	addu	a1,zero,zero
+   126e0:	afa80010 	sw	t0,16(sp)
+   126e4:	afa20014 	sw	v0,20(sp)
+   126e8:	0c0009b0 	jal	26c0 <__fprintk>
+   126ec:	afa30018 	sw	v1,24(sp)
+   126f0:	8fbf0024 	lw	ra,36(sp)
+   126f4:	24040004 	addiu	a0,zero,4
+   126f8:	08005e49 	j	17924 <sys_thread_exit>
+   126fc:	27bd0028 	addiu	sp,sp,40
+
+00012700 <signal_notify>:
+   12700:	8c830264 	lw	v1,612(a0)
+   12704:	8c820260 	lw	v0,608(a0)
+   12708:	27bdffd8 	addiu	sp,sp,-40
+   1270c:	00621024 	and	v0,v1,v0
+   12710:	afb20018 	sw	s2,24(sp)
+   12714:	afbf0024 	sw	ra,36(sp)
+   12718:	afb40020 	sw	s4,32(sp)
+   1271c:	afb3001c 	sw	s3,28(sp)
+   12720:	afb10014 	sw	s1,20(sp)
+   12724:	afb00010 	sw	s0,16(sp)
+   12728:	10400010 	beqz	v0,1276c <signal_notify+0x6c>
+   1272c:	00809021 	addu	s2,a0,zero
+   12730:	30430001 	andi	v1,v0,0x1
+   12734:	1460000d 	bnez	v1,1276c <signal_notify+0x6c>
+   12738:	00008821 	addu	s1,zero,zero
+   1273c:	080049d5 	j	12754 <signal_notify+0x54>
+   12740:	24040020 	addiu	a0,zero,32
+   12744:	14600007 	bnez	v1,12764 <signal_notify+0x64>
+   12748:	00000000 	sll	zero,zero,0x0
+   1274c:	1224000f 	beq	s1,a0,1278c <signal_notify+0x8c>
+   12750:	24100020 	addiu	s0,zero,32
+   12754:	00021042 	srl	v0,v0,0x1
+   12758:	30430001 	andi	v1,v0,0x1
+   1275c:	1440fff9 	bnez	v0,12744 <signal_notify+0x44>
+   12760:	26310001 	addiu	s1,s1,1
+   12764:	16200009 	bnez	s1,1278c <signal_notify+0x8c>
+   12768:	02208021 	addu	s0,s1,zero
+   1276c:	8fbf0024 	lw	ra,36(sp)
+   12770:	8fb40020 	lw	s4,32(sp)
+   12774:	8fb3001c 	lw	s3,28(sp)
+   12778:	8fb20018 	lw	s2,24(sp)
+   1277c:	8fb10014 	lw	s1,20(sp)
+   12780:	8fb00010 	lw	s0,16(sp)
+   12784:	03e00008 	jr	ra
+   12788:	27bd0028 	addiu	sp,sp,40
+   1278c:	40016000 	mfc0	at,c0_status
+   12790:	00000000 	sll	zero,zero,0x0
+   12794:	00011825 	or	v1,zero,at
+   12798:	00010842 	srl	at,at,0x1
+   1279c:	00010840 	sll	at,at,0x1
+   127a0:	40816000 	mtc0	at,c0_status
+   127a4:	8e420134 	lw	v0,308(s2)
+   127a8:	30440800 	andi	a0,v0,0x800
+   127ac:	1080000e 	beqz	a0,127e8 <signal_notify+0xe8>
+   127b0:	34420800 	ori	v0,v0,0x800
+   127b4:	40016000 	mfc0	at,c0_status
+   127b8:	340200ff 	ori	v0,zero,0xff
+   127bc:	00431024 	and	v0,v0,v1
+   127c0:	00220825 	or	at,at,v0
+   127c4:	40816000 	mtc0	at,c0_status
+   127c8:	8fbf0024 	lw	ra,36(sp)
+   127cc:	8fb40020 	lw	s4,32(sp)
+   127d0:	8fb3001c 	lw	s3,28(sp)
+   127d4:	8fb20018 	lw	s2,24(sp)
+   127d8:	8fb10014 	lw	s1,20(sp)
+   127dc:	8fb00010 	lw	s0,16(sp)
+   127e0:	03e00008 	jr	ra
+   127e4:	27bd0028 	addiu	sp,sp,40
+   127e8:	ae420134 	sw	v0,308(s2)
+   127ec:	40016000 	mfc0	at,c0_status
+   127f0:	340200ff 	ori	v0,zero,0xff
+   127f4:	00431024 	and	v0,v0,v1
+   127f8:	00220825 	or	at,at,v0
+   127fc:	40816000 	mtc0	at,c0_status
+   12800:	26540120 	addiu	s4,s2,288
+   12804:	02802021 	addu	a0,s4,zero
+   12808:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1280c:	24130001 	addiu	s3,zero,1
+   12810:	8e430260 	lw	v1,608(s2)
+   12814:	02131004 	sllv	v0,s3,s0
+   12818:	00021027 	nor	v0,zero,v0
+   1281c:	00621024 	and	v0,v1,v0
+   12820:	ae420260 	sw	v0,608(s2)
+   12824:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   12828:	02802021 	addu	a0,s4,zero
+   1282c:	8e540180 	lw	s4,384(s2)
+   12830:	260201d4 	addiu	v0,s0,468
+   12834:	00021080 	sll	v0,v0,0x2
+   12838:	02821021 	addu	v0,s4,v0
+   1283c:	8c450000 	lw	a1,0(v0)
+   12840:	10b3ffcb 	beq	a1,s3,12770 <signal_notify+0x70>
+   12844:	8fbf0024 	lw	ra,36(sp)
+   12848:	10a0000b 	beqz	a1,12878 <signal_notify+0x178>
+   1284c:	263101d4 	addiu	s1,s1,468
+   12850:	02402021 	addu	a0,s2,zero
+   12854:	02003021 	addu	a2,s0,zero
+   12858:	8fbf0024 	lw	ra,36(sp)
+   1285c:	8fb40020 	lw	s4,32(sp)
+   12860:	8fb3001c 	lw	s3,28(sp)
+   12864:	8fb20018 	lw	s2,24(sp)
+   12868:	8fb10014 	lw	s1,20(sp)
+   1286c:	8fb00010 	lw	s0,16(sp)
+   12870:	08000452 	j	1148 <cpu_signal_notify>
+   12874:	27bd0028 	addiu	sp,sp,40
+   12878:	00118880 	sll	s1,s1,0x2
+   1287c:	02002021 	addu	a0,s0,zero
+   12880:	0c0049a4 	jal	12690 <kill_sigaction>
+   12884:	0291a021 	addu	s4,s4,s1
+   12888:	08004a14 	j	12850 <signal_notify+0x150>
+   1288c:	8e850000 	lw	a1,0(s4)
+
+00012890 <spinlock_init>:
+   12890:	ac850004 	sw	a1,4(a0)
+   12894:	03e00008 	jr	ra
+   12898:	ac800000 	sw	zero,0(a0)
+
+0001289c <spin_init>:
+   1289c:	03e00008 	jr	ra
+   128a0:	ac800000 	sw	zero,0(a0)
+
+000128a4 <spinlock_destroy>:
+   128a4:	03e00008 	jr	ra
+   128a8:	ac800000 	sw	zero,0(a0)
+
+000128ac <__spinlock_trylock>:
+   128ac:	40062002 	mfc0	a2,$4,2
+   128b0:	40016000 	mfc0	at,c0_status
+   128b4:	00000000 	sll	zero,zero,0x0
+   128b8:	00012825 	or	a1,zero,at
+   128bc:	00010842 	srl	at,at,0x1
+   128c0:	00010840 	sll	at,at,0x1
+   128c4:	40816000 	mtc0	at,c0_status
+   128c8:	8c820000 	lw	v0,0(a0)
+   128cc:	10400008 	beqz	v0,128f0 <__spinlock_trylock+0x44>
+   128d0:	240affff 	addiu	t2,zero,-1
+   128d4:	40016000 	mfc0	at,c0_status
+   128d8:	340200ff 	ori	v0,zero,0xff
+   128dc:	00451024 	and	v0,v0,a1
+   128e0:	00220825 	or	at,at,v0
+   128e4:	40816000 	mtc0	at,c0_status
+   128e8:	03e00008 	jr	ra
+   128ec:	24020001 	addiu	v0,zero,1
+   128f0:	0000000f 	sync
+   128f4:	000a4025 	or	t0,zero,t2
+   128f8:	c0830000 	ll	v1,0(a0)
+   128fc:	14620004 	bne	v1,v0,12910 <__spinlock_trylock+0x64>
+   12900:	24070000 	addiu	a3,zero,0
+   12904:	e0880000 	sc	t0,0(a0)
+   12908:	01003825 	or	a3,t0,zero
+   1290c:	0000000f 	sync
+   12910:	00e04825 	or	t1,a3,zero
+   12914:	1120ffef 	beqz	t1,128d4 <__spinlock_trylock+0x28>
+   12918:	00000000 	sll	zero,zero,0x0
+   1291c:	8cc2013c 	lw	v0,316(a2)
+   12920:	24420001 	addiu	v0,v0,1
+   12924:	acc2013c 	sw	v0,316(a2)
+   12928:	40016000 	mfc0	at,c0_status
+   1292c:	340200ff 	ori	v0,zero,0xff
+   12930:	00451024 	and	v0,v0,a1
+   12934:	00220825 	or	at,at,v0
+   12938:	40816000 	mtc0	at,c0_status
+   1293c:	03e00008 	jr	ra
+   12940:	00001021 	addu	v0,zero,zero
+
+00012944 <spinlock_trylock>:
+   12944:	40062002 	mfc0	a2,$4,2
+   12948:	40016000 	mfc0	at,c0_status
+   1294c:	00000000 	sll	zero,zero,0x0
+   12950:	00012825 	or	a1,zero,at
+   12954:	00010842 	srl	at,at,0x1
+   12958:	00010840 	sll	at,at,0x1
+   1295c:	40816000 	mtc0	at,c0_status
+   12960:	8c820000 	lw	v0,0(a0)
+   12964:	10400008 	beqz	v0,12988 <spinlock_trylock+0x44>
+   12968:	240affff 	addiu	t2,zero,-1
+   1296c:	40016000 	mfc0	at,c0_status
+   12970:	340200ff 	ori	v0,zero,0xff
+   12974:	00451024 	and	v0,v0,a1
+   12978:	00220825 	or	at,at,v0
+   1297c:	40816000 	mtc0	at,c0_status
+   12980:	03e00008 	jr	ra
+   12984:	24020001 	addiu	v0,zero,1
+   12988:	0000000f 	sync
+   1298c:	000a4025 	or	t0,zero,t2
+   12990:	c0830000 	ll	v1,0(a0)
+   12994:	14620004 	bne	v1,v0,129a8 <spinlock_trylock+0x64>
+   12998:	24070000 	addiu	a3,zero,0
+   1299c:	e0880000 	sc	t0,0(a0)
+   129a0:	01003825 	or	a3,t0,zero
+   129a4:	0000000f 	sync
+   129a8:	00e04825 	or	t1,a3,zero
+   129ac:	1120ffef 	beqz	t1,1296c <spinlock_trylock+0x28>
+   129b0:	00000000 	sll	zero,zero,0x0
+   129b4:	8cc2013c 	lw	v0,316(a2)
+   129b8:	24420001 	addiu	v0,v0,1
+   129bc:	acc2013c 	sw	v0,316(a2)
+   129c0:	40016000 	mfc0	at,c0_status
+   129c4:	340200ff 	ori	v0,zero,0xff
+   129c8:	00451024 	and	v0,v0,a1
+   129cc:	00220825 	or	at,at,v0
+   129d0:	40816000 	mtc0	at,c0_status
+   129d4:	03e00008 	jr	ra
+   129d8:	00001021 	addu	v0,zero,zero
+
+000129dc <spinlock_tryrdlock>:
+   129dc:	40062002 	mfc0	a2,$4,2
+   129e0:	40016000 	mfc0	at,c0_status
+   129e4:	00000000 	sll	zero,zero,0x0
+   129e8:	00012825 	or	a1,zero,at
+   129ec:	00010842 	srl	at,at,0x1
+   129f0:	00010840 	sll	at,at,0x1
+   129f4:	40816000 	mtc0	at,c0_status
+   129f8:	8c820000 	lw	v0,0(a0)
+   129fc:	04400016 	bltz	v0,12a58 <spinlock_tryrdlock+0x7c>
+   12a00:	244a0001 	addiu	t2,v0,1
+   12a04:	0000000f 	sync
+   12a08:	000a4025 	or	t0,zero,t2
+   12a0c:	c0830000 	ll	v1,0(a0)
+   12a10:	14620004 	bne	v1,v0,12a24 <spinlock_tryrdlock+0x48>
+   12a14:	24070000 	addiu	a3,zero,0
+   12a18:	e0880000 	sc	t0,0(a0)
+   12a1c:	01003825 	or	a3,t0,zero
+   12a20:	0000000f 	sync
+   12a24:	00e04825 	or	t1,a3,zero
+   12a28:	1120000b 	beqz	t1,12a58 <spinlock_tryrdlock+0x7c>
+   12a2c:	00000000 	sll	zero,zero,0x0
+   12a30:	8cc2013c 	lw	v0,316(a2)
+   12a34:	24420001 	addiu	v0,v0,1
+   12a38:	acc2013c 	sw	v0,316(a2)
+   12a3c:	40016000 	mfc0	at,c0_status
+   12a40:	340200ff 	ori	v0,zero,0xff
+   12a44:	00451024 	and	v0,v0,a1
+   12a48:	00220825 	or	at,at,v0
+   12a4c:	40816000 	mtc0	at,c0_status
+   12a50:	03e00008 	jr	ra
+   12a54:	00001021 	addu	v0,zero,zero
+   12a58:	40016000 	mfc0	at,c0_status
+   12a5c:	340200ff 	ori	v0,zero,0xff
+   12a60:	00451024 	and	v0,v0,a1
+   12a64:	00220825 	or	at,at,v0
+   12a68:	40816000 	mtc0	at,c0_status
+   12a6c:	03e00008 	jr	ra
+   12a70:	24020001 	addiu	v0,zero,1
+   12a74:	27bdffc8 	addiu	sp,sp,-56
+   12a78:	afbf0034 	sw	ra,52(sp)
+   12a7c:	afb10030 	sw	s1,48(sp)
+   12a80:	10e0001d 	beqz	a3,12af8 <spinlock_tryrdlock+0x11c>
+   12a84:	afb0002c 	sw	s0,44(sp)
+   12a88:	00c08021 	addu	s0,a2,zero
+   12a8c:	8c820000 	lw	v0,0(a0)
+   12a90:	04400020 	bltz	v0,12b14 <spinlock_tryrdlock+0x138>
+   12a94:	2402ffff 	addiu	v0,zero,-1
+   12a98:	c0860000 	ll	a2,0(a0)
+   12a9c:	00c21821 	addu	v1,a2,v0
+   12aa0:	e0830000 	sc	v1,0(a0)
+   12aa4:	1060fffc 	beqz	v1,12a98 <spinlock_tryrdlock+0xbc>
+   12aa8:	00000000 	sll	zero,zero,0x0
+   12aac:	0000000f 	sync
+   12ab0:	40112002 	mfc0	s1,$4,2
+   12ab4:	8e22013c 	lw	v0,316(s1)
+   12ab8:	1840002c 	blez	v0,12b6c <spinlock_tryrdlock+0x190>
+   12abc:	2442ffff 	addiu	v0,v0,-1
+   12ac0:	ae22013c 	sw	v0,316(s1)
+   12ac4:	24020001 	addiu	v0,zero,1
+   12ac8:	10a20016 	beq	a1,v0,12b24 <spinlock_tryrdlock+0x148>
+   12acc:	00000000 	sll	zero,zero,0x0
+   12ad0:	40016000 	mfc0	at,c0_status
+   12ad4:	340200ff 	ori	v0,zero,0xff
+   12ad8:	00501024 	and	v0,v0,s0
+   12adc:	00220825 	or	at,at,v0
+   12ae0:	40816000 	mtc0	at,c0_status
+   12ae4:	8fbf0034 	lw	ra,52(sp)
+   12ae8:	8fb10030 	lw	s1,48(sp)
+   12aec:	8fb0002c 	lw	s0,44(sp)
+   12af0:	03e00008 	jr	ra
+   12af4:	27bd0038 	addiu	sp,sp,56
+   12af8:	40016000 	mfc0	at,c0_status
+   12afc:	00000000 	sll	zero,zero,0x0
+   12b00:	00018025 	or	s0,zero,at
+   12b04:	00010842 	srl	at,at,0x1
+   12b08:	00010840 	sll	at,at,0x1
+   12b0c:	08004aa3 	j	12a8c <spinlock_tryrdlock+0xb0>
+   12b10:	40816000 	mtc0	at,c0_status
+   12b14:	ac800000 	sw	zero,0(a0)
+   12b18:	0000000f 	sync
+   12b1c:	08004aac 	j	12ab0 <spinlock_tryrdlock+0xd4>
+   12b20:	00000000 	sll	zero,zero,0x0
+   12b24:	40024800 	mfc0	v0,c0_count
+   12b28:	00000000 	sll	zero,zero,0x0
+   12b2c:	8e23014c 	lw	v1,332(s1)
+   12b30:	0043202b 	sltu	a0,v0,v1
+   12b34:	1480002a 	bnez	a0,12be0 <spinlock_tryrdlock+0x204>
+   12b38:	00000000 	sll	zero,zero,0x0
+   12b3c:	00431023 	subu	v0,v0,v1
+   12b40:	2c4207d1 	sltiu	v0,v0,2001
+   12b44:	1440ffe2 	bnez	v0,12ad0 <spinlock_tryrdlock+0xf4>
+   12b48:	00000000 	sll	zero,zero,0x0
+   12b4c:	0c002083 	jal	820c <__cpu_check_sched>
+   12b50:	02202021 	addu	a0,s1,zero
+   12b54:	1040ffde 	beqz	v0,12ad0 <spinlock_tryrdlock+0xf4>
+   12b58:	00000000 	sll	zero,zero,0x0
+   12b5c:	0c004636 	jal	118d8 <sched_yield>
+   12b60:	02202021 	addu	a0,s1,zero
+   12b64:	08004ab4 	j	12ad0 <spinlock_tryrdlock+0xf4>
+   12b68:	00000000 	sll	zero,zero,0x0
+   12b6c:	40064800 	mfc0	a2,c0_count
+   12b70:	00000000 	sll	zero,zero,0x0
+   12b74:	40082002 	mfc0	t0,$4,2
+   12b78:	40057801 	mfc0	a1,$15,1
+   12b7c:	40024800 	mfc0	v0,c0_count
+   12b80:	00000000 	sll	zero,zero,0x0
+   12b84:	3c030003 	lui	v1,0x3
+   12b88:	24635ee8 	addiu	v1,v1,24296
+   12b8c:	afa30010 	sw	v1,16(sp)
+   12b90:	afb10014 	sw	s1,20(sp)
+   12b94:	30a50003 	andi	a1,a1,0x3
+   12b98:	3c030004 	lui	v1,0x4
+   12b9c:	8e240174 	lw	a0,372(s1)
+   12ba0:	00052880 	sll	a1,a1,0x2
+   12ba4:	2463c950 	addiu	v1,v1,-14000
+   12ba8:	00a31821 	addu	v1,a1,v1
+   12bac:	8c890004 	lw	t1,4(a0)
+   12bb0:	8c630000 	lw	v1,0(v1)
+   12bb4:	3c050003 	lui	a1,0x3
+   12bb8:	24a55708 	addiu	a1,a1,22280
+   12bbc:	00002021 	addu	a0,zero,zero
+   12bc0:	240700bb 	addiu	a3,zero,187
+   12bc4:	afa90018 	sw	t1,24(sp)
+   12bc8:	afa8001c 	sw	t0,28(sp)
+   12bcc:	afa30020 	sw	v1,32(sp)
+   12bd0:	0c00097d 	jal	25f4 <__perror>
+   12bd4:	afa20024 	sw	v0,36(sp)
+   12bd8:	08004af6 	j	12bd8 <spinlock_tryrdlock+0x1fc>
+   12bdc:	00000000 	sll	zero,zero,0x0
+   12be0:	00031827 	nor	v1,zero,v1
+   12be4:	08004ad0 	j	12b40 <spinlock_tryrdlock+0x164>
+   12be8:	00431021 	addu	v0,v0,v1
+
+00012bec <spinlock_unlock_noirq>:
+   12bec:	00a03021 	addu	a2,a1,zero
+   12bf0:	24070001 	addiu	a3,zero,1
+   12bf4:	08004a9d 	j	12a74 <spinlock_tryrdlock+0x98>
+   12bf8:	00002821 	addu	a1,zero,zero
+
+00012bfc <spin_unlock_nosched>:
+   12bfc:	00002821 	addu	a1,zero,zero
+   12c00:	00003021 	addu	a2,zero,zero
+   12c04:	08004a9d 	j	12a74 <spinlock_tryrdlock+0x98>
+   12c08:	00003821 	addu	a3,zero,zero
+
+00012c0c <spin_unlock>:
+   12c0c:	24050001 	addiu	a1,zero,1
+   12c10:	00003021 	addu	a2,zero,zero
+   12c14:	08004a9d 	j	12a74 <spinlock_tryrdlock+0x98>
+   12c18:	00003821 	addu	a3,zero,zero
+
+00012c1c <spinlock_unlock_nosched>:
+   12c1c:	00002821 	addu	a1,zero,zero
+   12c20:	00003021 	addu	a2,zero,zero
+   12c24:	08004a9d 	j	12a74 <spinlock_tryrdlock+0x98>
+   12c28:	00003821 	addu	a3,zero,zero
+
+00012c2c <spinlock_unlock>:
+   12c2c:	24050001 	addiu	a1,zero,1
+   12c30:	00003021 	addu	a2,zero,zero
+   12c34:	08004a9d 	j	12a74 <spinlock_tryrdlock+0x98>
+   12c38:	00003821 	addu	a3,zero,zero
+   12c3c:	27bdffe0 	addiu	sp,sp,-32
+   12c40:	afb00018 	sw	s0,24(sp)
+   12c44:	afbf001c 	sw	ra,28(sp)
+   12c48:	00808021 	addu	s0,a0,zero
+   12c4c:	40024800 	mfc0	v0,c0_count
+   12c50:	00000000 	sll	zero,zero,0x0
+   12c54:	8c83014c 	lw	v1,332(a0)
+   12c58:	0043202b 	sltu	a0,v0,v1
+   12c5c:	14800016 	bnez	a0,12cb8 <spinlock_unlock+0x8c>
+   12c60:	00000000 	sll	zero,zero,0x0
+   12c64:	00431023 	subu	v0,v0,v1
+   12c68:	2c4207d1 	sltiu	v0,v0,2001
+   12c6c:	10400017 	beqz	v0,12ccc <spinlock_unlock+0xa0>
+   12c70:	02002021 	addu	a0,s0,zero
+   12c74:	8ca30000 	lw	v1,0(a1)
+   12c78:	40016000 	mfc0	at,c0_status
+   12c7c:	340200ff 	ori	v0,zero,0xff
+   12c80:	00431024 	and	v0,v0,v1
+   12c84:	00220825 	or	at,at,v0
+   12c88:	40816000 	mtc0	at,c0_status
+   12c8c:	40016000 	mfc0	at,c0_status
+   12c90:	00000000 	sll	zero,zero,0x0
+   12c94:	00011025 	or	v0,zero,at
+   12c98:	00010842 	srl	at,at,0x1
+   12c9c:	00010840 	sll	at,at,0x1
+   12ca0:	40816000 	mtc0	at,c0_status
+   12ca4:	8fbf001c 	lw	ra,28(sp)
+   12ca8:	8fb00018 	lw	s0,24(sp)
+   12cac:	aca20000 	sw	v0,0(a1)
+   12cb0:	03e00008 	jr	ra
+   12cb4:	27bd0020 	addiu	sp,sp,32
+   12cb8:	00031827 	nor	v1,zero,v1
+   12cbc:	00431021 	addu	v0,v0,v1
+   12cc0:	2c4207d1 	sltiu	v0,v0,2001
+   12cc4:	1440ffeb 	bnez	v0,12c74 <spinlock_unlock+0x48>
+   12cc8:	02002021 	addu	a0,s0,zero
+   12ccc:	0c002083 	jal	820c <__cpu_check_sched>
+   12cd0:	afa50010 	sw	a1,16(sp)
+   12cd4:	1040ffe7 	beqz	v0,12c74 <spinlock_unlock+0x48>
+   12cd8:	8fa50010 	lw	a1,16(sp)
+   12cdc:	0c004636 	jal	118d8 <sched_yield>
+   12ce0:	02002021 	addu	a0,s0,zero
+   12ce4:	08004b1d 	j	12c74 <spinlock_unlock+0x48>
+   12ce8:	8fa50010 	lw	a1,16(sp)
+
+00012cec <spinlock_rdlock>:
+   12cec:	27bdffd8 	addiu	sp,sp,-40
+   12cf0:	afb00018 	sw	s0,24(sp)
+   12cf4:	afbf0024 	sw	ra,36(sp)
+   12cf8:	afb20020 	sw	s2,32(sp)
+   12cfc:	afb1001c 	sw	s1,28(sp)
+   12d00:	00808021 	addu	s0,a0,zero
+   12d04:	40112002 	mfc0	s1,$4,2
+   12d08:	40016000 	mfc0	at,c0_status
+   12d0c:	00000000 	sll	zero,zero,0x0
+   12d10:	00011025 	or	v0,zero,at
+   12d14:	00010842 	srl	at,at,0x1
+   12d18:	00010840 	sll	at,at,0x1
+   12d1c:	40816000 	mtc0	at,c0_status
+   12d20:	afa20010 	sw	v0,16(sp)
+   12d24:	27b20010 	addiu	s2,sp,16
+   12d28:	8e020000 	lw	v0,0(s0)
+   12d2c:	0440001b 	bltz	v0,12d9c <spinlock_rdlock+0xb0>
+   12d30:	24450001 	addiu	a1,v0,1
+   12d34:	0000000f 	sync
+   12d38:	00054025 	or	t0,zero,a1
+   12d3c:	c2030000 	ll	v1,0(s0)
+   12d40:	14620004 	bne	v1,v0,12d54 <spinlock_rdlock+0x68>
+   12d44:	24070000 	addiu	a3,zero,0
+   12d48:	e2080000 	sc	t0,0(s0)
+   12d4c:	01003825 	or	a3,t0,zero
+   12d50:	0000000f 	sync
+   12d54:	00e02025 	or	a0,a3,zero
+   12d58:	1080fff3 	beqz	a0,12d28 <spinlock_rdlock+0x3c>
+   12d5c:	00000000 	sll	zero,zero,0x0
+   12d60:	8e22013c 	lw	v0,316(s1)
+   12d64:	24420001 	addiu	v0,v0,1
+   12d68:	ae22013c 	sw	v0,316(s1)
+   12d6c:	8fa30010 	lw	v1,16(sp)
+   12d70:	40016000 	mfc0	at,c0_status
+   12d74:	340200ff 	ori	v0,zero,0xff
+   12d78:	00431024 	and	v0,v0,v1
+   12d7c:	00220825 	or	at,at,v0
+   12d80:	40816000 	mtc0	at,c0_status
+   12d84:	8fbf0024 	lw	ra,36(sp)
+   12d88:	8fb20020 	lw	s2,32(sp)
+   12d8c:	8fb1001c 	lw	s1,28(sp)
+   12d90:	8fb00018 	lw	s0,24(sp)
+   12d94:	03e00008 	jr	ra
+   12d98:	27bd0028 	addiu	sp,sp,40
+   12d9c:	02202021 	addu	a0,s1,zero
+   12da0:	0c004b0f 	jal	12c3c <spinlock_unlock+0x10>
+   12da4:	02402821 	addu	a1,s2,zero
+   12da8:	08004b4a 	j	12d28 <spinlock_rdlock+0x3c>
+   12dac:	00000000 	sll	zero,zero,0x0
+
+00012db0 <__full_spinlock_lock>:
+   12db0:	27bdffc8 	addiu	sp,sp,-56
+   12db4:	afb4002c 	sw	s4,44(sp)
+   12db8:	afb0001c 	sw	s0,28(sp)
+   12dbc:	afbf0034 	sw	ra,52(sp)
+   12dc0:	afb50030 	sw	s5,48(sp)
+   12dc4:	afb30028 	sw	s3,40(sp)
+   12dc8:	afb20024 	sw	s2,36(sp)
+   12dcc:	afb10020 	sw	s1,32(sp)
+   12dd0:	00808021 	addu	s0,a0,zero
+   12dd4:	00a0a021 	addu	s4,a1,zero
+   12dd8:	40122002 	mfc0	s2,$4,2
+   12ddc:	40016000 	mfc0	at,c0_status
+   12de0:	00000000 	sll	zero,zero,0x0
+   12de4:	00011025 	or	v0,zero,at
+   12de8:	00010842 	srl	at,at,0x1
+   12dec:	00010840 	sll	at,at,0x1
+   12df0:	40816000 	mtc0	at,c0_status
+   12df4:	3c118000 	lui	s1,0x8000
+   12df8:	afa20010 	sw	v0,16(sp)
+   12dfc:	2413ffff 	addiu	s3,zero,-1
+   12e00:	27b50010 	addiu	s5,sp,16
+   12e04:	8e020000 	lw	v0,0(s0)
+   12e08:	1840000d 	blez	v0,12e40 <__full_spinlock_lock+0x90>
+   12e0c:	00512025 	or	a0,v0,s1
+   12e10:	0000000f 	sync
+   12e14:	00044025 	or	t0,zero,a0
+   12e18:	c2030000 	ll	v1,0(s0)
+   12e1c:	14620004 	bne	v1,v0,12e30 <__full_spinlock_lock+0x80>
+   12e20:	24070000 	addiu	a3,zero,0
+   12e24:	e2080000 	sc	t0,0(s0)
+   12e28:	01003825 	or	a3,t0,zero
+   12e2c:	0000000f 	sync
+   12e30:	00e02825 	or	a1,a3,zero
+   12e34:	8e020000 	lw	v0,0(s0)
+   12e38:	1c40fff5 	bgtz	v0,12e10 <__full_spinlock_lock+0x60>
+   12e3c:	00512025 	or	a0,v0,s1
+   12e40:	1440001b 	bnez	v0,12eb0 <__full_spinlock_lock+0x100>
+   12e44:	02402021 	addu	a0,s2,zero
+   12e48:	0000000f 	sync
+   12e4c:	00134025 	or	t0,zero,s3
+   12e50:	c2030000 	ll	v1,0(s0)
+   12e54:	14620004 	bne	v1,v0,12e68 <__full_spinlock_lock+0xb8>
+   12e58:	24070000 	addiu	a3,zero,0
+   12e5c:	e2080000 	sc	t0,0(s0)
+   12e60:	01003825 	or	a3,t0,zero
+   12e64:	0000000f 	sync
+   12e68:	00e02025 	or	a0,a3,zero
+   12e6c:	1080ffe5 	beqz	a0,12e04 <__full_spinlock_lock+0x54>
+   12e70:	00000000 	sll	zero,zero,0x0
+   12e74:	8e42013c 	lw	v0,316(s2)
+   12e78:	24420001 	addiu	v0,v0,1
+   12e7c:	12800010 	beqz	s4,12ec0 <__full_spinlock_lock+0x110>
+   12e80:	ae42013c 	sw	v0,316(s2)
+   12e84:	8fa20010 	lw	v0,16(sp)
+   12e88:	8fbf0034 	lw	ra,52(sp)
+   12e8c:	ae820000 	sw	v0,0(s4)
+   12e90:	8fb50030 	lw	s5,48(sp)
+   12e94:	8fb4002c 	lw	s4,44(sp)
+   12e98:	8fb30028 	lw	s3,40(sp)
+   12e9c:	8fb20024 	lw	s2,36(sp)
+   12ea0:	8fb10020 	lw	s1,32(sp)
+   12ea4:	8fb0001c 	lw	s0,28(sp)
+   12ea8:	03e00008 	jr	ra
+   12eac:	27bd0038 	addiu	sp,sp,56
+   12eb0:	0c004b0f 	jal	12c3c <spinlock_unlock+0x10>
+   12eb4:	02a02821 	addu	a1,s5,zero
+   12eb8:	08004b81 	j	12e04 <__full_spinlock_lock+0x54>
+   12ebc:	00000000 	sll	zero,zero,0x0
+   12ec0:	8fa30010 	lw	v1,16(sp)
+   12ec4:	40016000 	mfc0	at,c0_status
+   12ec8:	340200ff 	ori	v0,zero,0xff
+   12ecc:	00431024 	and	v0,v0,v1
+   12ed0:	00220825 	or	at,at,v0
+   12ed4:	40816000 	mtc0	at,c0_status
+   12ed8:	8fbf0034 	lw	ra,52(sp)
+   12edc:	8fb50030 	lw	s5,48(sp)
+   12ee0:	8fb4002c 	lw	s4,44(sp)
+   12ee4:	8fb30028 	lw	s3,40(sp)
+   12ee8:	8fb20024 	lw	s2,36(sp)
+   12eec:	8fb10020 	lw	s1,32(sp)
+   12ef0:	8fb0001c 	lw	s0,28(sp)
+   12ef4:	03e00008 	jr	ra
+   12ef8:	27bd0038 	addiu	sp,sp,56
+
+00012efc <spinlock_lock_noirq>:
+   12efc:	08004b6c 	j	12db0 <__full_spinlock_lock>
+   12f00:	00000000 	sll	zero,zero,0x0
+
+00012f04 <__spinlock_lock>:
+   12f04:	08004b6c 	j	12db0 <__full_spinlock_lock>
+   12f08:	00002821 	addu	a1,zero,zero
+
+00012f0c <spinlock_lock>:
+   12f0c:	08004bc1 	j	12f04 <__spinlock_lock>
+   12f10:	00000000 	sll	zero,zero,0x0
+
+00012f14 <spin_lock>:
+   12f14:	08004bc1 	j	12f04 <__spinlock_lock>
+   12f18:	00000000 	sll	zero,zero,0x0
+
+00012f1c <sys_alarm>:
+   12f1c:	27bdffa0 	addiu	sp,sp,-96
+   12f20:	afbf005c 	sw	ra,92(sp)
+   12f24:	1080000f 	beqz	a0,12f64 <sys_alarm+0x48>
+   12f28:	afb00058 	sw	s0,88(sp)
+   12f2c:	40102002 	mfc0	s0,$4,2
+   12f30:	3c020001 	lui	v0,0x1
+   12f34:	24422f78 	addiu	v0,v0,12152
+   12f38:	afa20028 	sw	v0,40(sp)
+   12f3c:	24020008 	addiu	v0,zero,8
+   12f40:	00042880 	sll	a1,a0,0x2
+   12f44:	afa20024 	sw	v0,36(sp)
+   12f48:	27a40010 	addiu	a0,sp,16
+   12f4c:	27a20024 	addiu	v0,sp,36
+   12f50:	afa20014 	sw	v0,20(sp)
+   12f54:	0c006c2b 	jal	1b0ac <alarm_wait>
+   12f58:	afb0002c 	sw	s0,44(sp)
+   12f5c:	0c004634 	jal	118d0 <sched_sleep>
+   12f60:	02002021 	addu	a0,s0,zero
+   12f64:	8fbf005c 	lw	ra,92(sp)
+   12f68:	00001021 	addu	v0,zero,zero
+   12f6c:	8fb00058 	lw	s0,88(sp)
+   12f70:	03e00008 	jr	ra
+   12f74:	27bd0060 	addiu	sp,sp,96
+
+00012f78 <sys_alarm_event_handler>:
+   12f78:	8c840008 	lw	a0,8(a0)
+   12f7c:	27bdffe8 	addiu	sp,sp,-24
+   12f80:	afbf0014 	sw	ra,20(sp)
+   12f84:	0c0044a3 	jal	1128c <sched_wakeup>
+   12f88:	00000000 	sll	zero,zero,0x0
+   12f8c:	8fbf0014 	lw	ra,20(sp)
+   12f90:	00001021 	addu	v0,zero,zero
+   12f94:	03e00008 	jr	ra
+   12f98:	27bd0018 	addiu	sp,sp,24
+
+00012f9c <barrier_kmem_init>:
+   12f9c:	24030015 	addiu	v1,zero,21
+   12fa0:	ac830000 	sw	v1,0(a0)
+   12fa4:	3c030003 	lui	v1,0x3
+   12fa8:	24635ef8 	addiu	v1,v1,24312
+   12fac:	24020002 	addiu	v0,zero,2
+   12fb0:	ac830004 	sw	v1,4(a0)
+   12fb4:	240300c0 	addiu	v1,zero,192
+   12fb8:	ac820010 	sw	v0,16(a0)
+   12fbc:	ac82000c 	sw	v0,12(a0)
+   12fc0:	ac830008 	sw	v1,8(a0)
+   12fc4:	ac80001c 	sw	zero,28(a0)
+   12fc8:	ac800014 	sw	zero,20(a0)
+   12fcc:	ac800018 	sw	zero,24(a0)
+   12fd0:	03e00008 	jr	ra
+   12fd4:	00001021 	addu	v0,zero,zero
+
+00012fd8 <sys_barrier>:
+   12fd8:	27bdfe38 	addiu	sp,sp,-456
+   12fdc:	afb201b8 	sw	s2,440(sp)
+   12fe0:	afb101b4 	sw	s1,436(sp)
+   12fe4:	afb001b0 	sw	s0,432(sp)
+   12fe8:	afbf01c4 	sw	ra,452(sp)
+   12fec:	afb401c0 	sw	s4,448(sp)
+   12ff0:	afb301bc 	sw	s3,444(sp)
+   12ff4:	00808021 	addu	s0,a0,zero
+   12ff8:	00a08821 	addu	s1,a1,zero
+   12ffc:	00c09021 	addu	s2,a2,zero
+   13000:	40022002 	mfc0	v0,$4,2
+   13004:	3c040003 	lui	a0,0x3
+   13008:	8c450180 	lw	a1,384(v0)
+   1300c:	24845f04 	addiu	a0,a0,24324
+   13010:	02003021 	addu	a2,s0,zero
+   13014:	0c008099 	jal	20264 <vmm_check_address>
+   13018:	24070004 	addiu	a3,zero,4
+   1301c:	1040000b 	beqz	v0,1304c <sys_barrier+0x74>
+   13020:	27b30010 	addiu	s3,sp,16
+   13024:	40032002 	mfc0	v1,$4,2
+   13028:	ac620258 	sw	v0,600(v1)
+   1302c:	8fbf01c4 	lw	ra,452(sp)
+   13030:	8fb401c0 	lw	s4,448(sp)
+   13034:	8fb301bc 	lw	s3,444(sp)
+   13038:	8fb201b8 	lw	s2,440(sp)
+   1303c:	8fb101b4 	lw	s1,436(sp)
+   13040:	8fb001b0 	lw	s0,432(sp)
+   13044:	03e00008 	jr	ra
+   13048:	27bd01c8 	addiu	sp,sp,456
+   1304c:	02602021 	addu	a0,s3,zero
+   13050:	02002821 	addu	a1,s0,zero
+   13054:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   13058:	24060004 	addiu	a2,zero,4
+   1305c:	1440fff1 	bnez	v0,13024 <sys_barrier+0x4c>
+   13060:	00000000 	sll	zero,zero,0x0
+   13064:	24020001 	addiu	v0,zero,1
+   13068:	12220047 	beq	s1,v0,13188 <sys_barrier+0x1b0>
+   1306c:	00000000 	sll	zero,zero,0x0
+   13070:	1620001e 	bnez	s1,130ec <sys_barrier+0x114>
+   13074:	24020002 	addiu	v0,zero,2
+   13078:	24020015 	addiu	v0,zero,21
+   1307c:	afa20014 	sw	v0,20(sp)
+   13080:	240200c0 	addiu	v0,zero,192
+   13084:	27b40014 	addiu	s4,sp,20
+   13088:	afa20018 	sw	v0,24(sp)
+   1308c:	3c020022 	lui	v0,0x22
+   13090:	34420040 	ori	v0,v0,0x40
+   13094:	02802021 	addu	a0,s4,zero
+   13098:	0c00713f 	jal	1c4fc <kmem_alloc>
+   1309c:	afa2001c 	sw	v0,28(sp)
+   130a0:	10400037 	beqz	v0,13180 <sys_barrier+0x1a8>
+   130a4:	00402021 	addu	a0,v0,zero
+   130a8:	02402821 	addu	a1,s2,zero
+   130ac:	02203021 	addu	a2,s1,zero
+   130b0:	0c001a62 	jal	6988 <barrier_init>
+   130b4:	afa20010 	sw	v0,16(sp)
+   130b8:	1440ffda 	bnez	v0,13024 <sys_barrier+0x4c>
+   130bc:	02002021 	addu	a0,s0,zero
+   130c0:	02602821 	addu	a1,s3,zero
+   130c4:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   130c8:	24060004 	addiu	a2,zero,4
+   130cc:	1040ffd5 	beqz	v0,13024 <sys_barrier+0x4c>
+   130d0:	8fa30010 	lw	v1,16(sp)
+   130d4:	02802021 	addu	a0,s4,zero
+   130d8:	afa201a8 	sw	v0,424(sp)
+   130dc:	0c007134 	jal	1c4d0 <kmem_free>
+   130e0:	afa30020 	sw	v1,32(sp)
+   130e4:	08004c09 	j	13024 <sys_barrier+0x4c>
+   130e8:	8fa201a8 	lw	v0,424(sp)
+   130ec:	12220005 	beq	s1,v0,13104 <sys_barrier+0x12c>
+   130f0:	24020003 	addiu	v0,zero,3
+   130f4:	1222ffe0 	beq	s1,v0,13078 <sys_barrier+0xa0>
+   130f8:	00000000 	sll	zero,zero,0x0
+   130fc:	08004c09 	j	13024 <sys_barrier+0x4c>
+   13100:	24020016 	addiu	v0,zero,22
+   13104:	0c00616c 	jal	185b0 <task_lookup_zero>
+   13108:	00000000 	sll	zero,zero,0x0
+   1310c:	3c040003 	lui	a0,0x3
+   13110:	8fa60010 	lw	a2,16(sp)
+   13114:	24845f14 	addiu	a0,a0,24340
+   13118:	00402821 	addu	a1,v0,zero
+   1311c:	0c008099 	jal	20264 <vmm_check_address>
+   13120:	240700c0 	addiu	a3,zero,192
+   13124:	1440ffbf 	bnez	v0,13024 <sys_barrier+0x4c>
+   13128:	8fa50010 	lw	a1,16(sp)
+   1312c:	27a400e8 	addiu	a0,sp,232
+   13130:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   13134:	240600c0 	addiu	a2,zero,192
+   13138:	1440ffba 	bnez	v0,13024 <sys_barrier+0x4c>
+   1313c:	8fa30128 	lw	v1,296(sp)
+   13140:	3c02cfa5 	lui	v0,0xcfa5
+   13144:	3442b1a3 	ori	v0,v0,0xb1a3
+   13148:	1462ffb6 	bne	v1,v0,13024 <sys_barrier+0x4c>
+   1314c:	24020016 	addiu	v0,zero,22
+   13150:	0c001a2b 	jal	68ac <barrier_destroy>
+   13154:	8fa40010 	lw	a0,16(sp)
+   13158:	1440ffb2 	bnez	v0,13024 <sys_barrier+0x4c>
+   1315c:	24030015 	addiu	v1,zero,21
+   13160:	afa30014 	sw	v1,20(sp)
+   13164:	8fa30010 	lw	v1,16(sp)
+   13168:	27a40014 	addiu	a0,sp,20
+   1316c:	afa201a8 	sw	v0,424(sp)
+   13170:	0c007134 	jal	1c4d0 <kmem_free>
+   13174:	afa30020 	sw	v1,32(sp)
+   13178:	08004c0b 	j	1302c <sys_barrier+0x54>
+   1317c:	8fa201a8 	lw	v0,424(sp)
+   13180:	08004c09 	j	13024 <sys_barrier+0x4c>
+   13184:	2402000c 	addiu	v0,zero,12
+   13188:	0c00616c 	jal	185b0 <task_lookup_zero>
+   1318c:	00000000 	sll	zero,zero,0x0
+   13190:	3c040003 	lui	a0,0x3
+   13194:	8fa60010 	lw	a2,16(sp)
+   13198:	24845f14 	addiu	a0,a0,24340
+   1319c:	00402821 	addu	a1,v0,zero
+   131a0:	0c008099 	jal	20264 <vmm_check_address>
+   131a4:	240700c0 	addiu	a3,zero,192
+   131a8:	1440ff9e 	bnez	v0,13024 <sys_barrier+0x4c>
+   131ac:	8fa50010 	lw	a1,16(sp)
+   131b0:	27a40028 	addiu	a0,sp,40
+   131b4:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   131b8:	240600c0 	addiu	a2,zero,192
+   131bc:	1440ff99 	bnez	v0,13024 <sys_barrier+0x4c>
+   131c0:	8fa30068 	lw	v1,104(sp)
+   131c4:	3c02cfa5 	lui	v0,0xcfa5
+   131c8:	3442b1a3 	ori	v0,v0,0xb1a3
+   131cc:	1462ffcb 	bne	v1,v0,130fc <sys_barrier+0x124>
+   131d0:	00000000 	sll	zero,zero,0x0
+   131d4:	0c001af5 	jal	6bd4 <barrier_wait>
+   131d8:	8fa40010 	lw	a0,16(sp)
+   131dc:	08004c09 	j	13024 <sys_barrier+0x4c>
+   131e0:	00000000 	sll	zero,zero,0x0
+
+000131e4 <sys_chdir>:
+   131e4:	27bdffc0 	addiu	sp,sp,-64
+   131e8:	afbf003c 	sw	ra,60(sp)
+   131ec:	afb20038 	sw	s2,56(sp)
+   131f0:	afb10034 	sw	s1,52(sp)
+   131f4:	afb00030 	sw	s0,48(sp)
+   131f8:	00801021 	addu	v0,a0,zero
+   131fc:	40112002 	mfc0	s1,$4,2
+   13200:	40032002 	mfc0	v1,$4,2
+   13204:	1080002d 	beqz	a0,132bc <sys_chdir+0xd8>
+   13208:	8c720180 	lw	s2,384(v1)
+   1320c:	afa20010 	sw	v0,16(sp)
+   13210:	3c020001 	lui	v0,0x1
+   13214:	2442bf70 	addiu	v0,v0,-16528
+   13218:	afa20018 	sw	v0,24(sp)
+   1321c:	3c020001 	lui	v0,0x1
+   13220:	2442bee4 	addiu	v0,v0,-16668
+   13224:	afa2001c 	sw	v0,28(sp)
+   13228:	3c020001 	lui	v0,0x1
+   1322c:	2442be2c 	addiu	v0,v0,-16852
+   13230:	afa20024 	sw	v0,36(sp)
+   13234:	3c020001 	lui	v0,0x1
+   13238:	2442bd0c 	addiu	v0,v0,-17140
+   1323c:	265000b0 	addiu	s0,s2,176
+   13240:	afa20020 	sw	v0,32(sp)
+   13244:	3c020001 	lui	v0,0x1
+   13248:	02002021 	addu	a0,s0,zero
+   1324c:	2442beb0 	addiu	v0,v0,-16720
+   13250:	afa20028 	sw	v0,40(sp)
+   13254:	0c004408 	jal	11020 <rwlock_wrlock>
+   13258:	afa00014 	sw	zero,20(sp)
+   1325c:	2645054c 	addiu	a1,s2,1356
+   13260:	0c00a5a5 	jal	29694 <vfs_chdir>
+   13264:	27a40010 	addiu	a0,sp,16
+   13268:	1440000a 	bnez	v0,13294 <sys_chdir+0xb0>
+   1326c:	00409021 	addu	s2,v0,zero
+   13270:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   13274:	02002021 	addu	a0,s0,zero
+   13278:	00001021 	addu	v0,zero,zero
+   1327c:	8fbf003c 	lw	ra,60(sp)
+   13280:	8fb20038 	lw	s2,56(sp)
+   13284:	8fb10034 	lw	s1,52(sp)
+   13288:	8fb00030 	lw	s0,48(sp)
+   1328c:	03e00008 	jr	ra
+   13290:	27bd0040 	addiu	sp,sp,64
+   13294:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   13298:	02002021 	addu	a0,s0,zero
+   1329c:	06400003 	bltz	s2,132ac <sys_chdir+0xc8>
+   132a0:	ae320258 	sw	s2,600(s1)
+   132a4:	08004c9f 	j	1327c <sys_chdir+0x98>
+   132a8:	2402ffff 	addiu	v0,zero,-1
+   132ac:	00129023 	negu	s2,s2
+   132b0:	ae320258 	sw	s2,600(s1)
+   132b4:	08004c9f 	j	1327c <sys_chdir+0x98>
+   132b8:	2402ffff 	addiu	v0,zero,-1
+   132bc:	24020016 	addiu	v0,zero,22
+   132c0:	ae220258 	sw	v0,600(s1)
+   132c4:	08004c9f 	j	1327c <sys_chdir+0x98>
+   132c8:	2402ffff 	addiu	v0,zero,-1
+
+000132cc <sys_chmod>:
+   132cc:	27bdffb8 	addiu	sp,sp,-72
+   132d0:	afbf0044 	sw	ra,68(sp)
+   132d4:	afb20040 	sw	s2,64(sp)
+   132d8:	afb1003c 	sw	s1,60(sp)
+   132dc:	afb00038 	sw	s0,56(sp)
+   132e0:	00801021 	addu	v0,a0,zero
+   132e4:	40112002 	mfc0	s1,$4,2
+   132e8:	40032002 	mfc0	v1,$4,2
+   132ec:	1080002b 	beqz	a0,1339c <sys_chmod+0xd0>
+   132f0:	8c720180 	lw	s2,384(v1)
+   132f4:	28834000 	slti	v1,a0,16384
+   132f8:	14600028 	bnez	v1,1339c <sys_chmod+0xd0>
+   132fc:	3c038000 	lui	v1,0x8000
+   13300:	34630001 	ori	v1,v1,0x1
+   13304:	0083182b 	sltu	v1,a0,v1
+   13308:	10600024 	beqz	v1,1339c <sys_chmod+0xd0>
+   1330c:	265000b0 	addiu	s0,s2,176
+   13310:	afa20010 	sw	v0,16(sp)
+   13314:	3c020001 	lui	v0,0x1
+   13318:	2442bf70 	addiu	v0,v0,-16528
+   1331c:	afa20018 	sw	v0,24(sp)
+   13320:	3c020001 	lui	v0,0x1
+   13324:	2442bee4 	addiu	v0,v0,-16668
+   13328:	afa2001c 	sw	v0,28(sp)
+   1332c:	3c020001 	lui	v0,0x1
+   13330:	2442be2c 	addiu	v0,v0,-16852
+   13334:	afa20024 	sw	v0,36(sp)
+   13338:	3c020001 	lui	v0,0x1
+   1333c:	2442bd0c 	addiu	v0,v0,-17140
+   13340:	afa20020 	sw	v0,32(sp)
+   13344:	3c020001 	lui	v0,0x1
+   13348:	02002021 	addu	a0,s0,zero
+   1334c:	2442beb0 	addiu	v0,v0,-16720
+   13350:	afa50030 	sw	a1,48(sp)
+   13354:	afa20028 	sw	v0,40(sp)
+   13358:	0c004408 	jal	11020 <rwlock_wrlock>
+   1335c:	afa00014 	sw	zero,20(sp)
+   13360:	8fa60030 	lw	a2,48(sp)
+   13364:	2645054c 	addiu	a1,s2,1356
+   13368:	0c00a336 	jal	28cd8 <vfs_chmod>
+   1336c:	27a40010 	addiu	a0,sp,16
+   13370:	14400013 	bnez	v0,133c0 <sys_chmod+0xf4>
+   13374:	00409021 	addu	s2,v0,zero
+   13378:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   1337c:	02002021 	addu	a0,s0,zero
+   13380:	00001021 	addu	v0,zero,zero
+   13384:	8fbf0044 	lw	ra,68(sp)
+   13388:	8fb20040 	lw	s2,64(sp)
+   1338c:	8fb1003c 	lw	s1,60(sp)
+   13390:	8fb00038 	lw	s0,56(sp)
+   13394:	03e00008 	jr	ra
+   13398:	27bd0048 	addiu	sp,sp,72
+   1339c:	8fbf0044 	lw	ra,68(sp)
+   133a0:	24020016 	addiu	v0,zero,22
+   133a4:	ae220258 	sw	v0,600(s1)
+   133a8:	8fb20040 	lw	s2,64(sp)
+   133ac:	2402ffff 	addiu	v0,zero,-1
+   133b0:	8fb1003c 	lw	s1,60(sp)
+   133b4:	8fb00038 	lw	s0,56(sp)
+   133b8:	03e00008 	jr	ra
+   133bc:	27bd0048 	addiu	sp,sp,72
+   133c0:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   133c4:	02002021 	addu	a0,s0,zero
+   133c8:	06400003 	bltz	s2,133d8 <sys_chmod+0x10c>
+   133cc:	ae320258 	sw	s2,600(s1)
+   133d0:	08004ce1 	j	13384 <sys_chmod+0xb8>
+   133d4:	2402ffff 	addiu	v0,zero,-1
+   133d8:	00129023 	negu	s2,s2
+   133dc:	ae320258 	sw	s2,600(s1)
+   133e0:	08004ce1 	j	13384 <sys_chmod+0xb8>
+   133e4:	2402ffff 	addiu	v0,zero,-1
+
+000133e8 <sys_clock>:
+   133e8:	27bdffe0 	addiu	sp,sp,-32
+   133ec:	10800020 	beqz	a0,13470 <sys_clock+0x88>
+   133f0:	afbf001c 	sw	ra,28(sp)
+   133f4:	28824000 	slti	v0,a0,16384
+   133f8:	1440001d 	bnez	v0,13470 <sys_clock+0x88>
+   133fc:	3c028000 	lui	v0,0x8000
+   13400:	34420001 	ori	v0,v0,0x1
+   13404:	0082102b 	sltu	v0,a0,v0
+   13408:	1040001a 	beqz	v0,13474 <sys_clock+0x8c>
+   1340c:	24020016 	addiu	v0,zero,22
+   13410:	40022002 	mfc0	v0,$4,2
+   13414:	8c430174 	lw	v1,372(v0)
+   13418:	8c67002c 	lw	a3,44(v1)
+   1341c:	8c650030 	lw	a1,48(v1)
+   13420:	8c630028 	lw	v1,40(v1)
+   13424:	40064800 	mfc0	a2,c0_count
+   13428:	00000000 	sll	zero,zero,0x0
+   1342c:	00c5102b 	sltu	v0,a2,a1
+   13430:	14400015 	bnez	v0,13488 <sys_clock+0xa0>
+   13434:	00000000 	sll	zero,zero,0x0
+   13438:	00c52823 	subu	a1,a2,a1
+   1343c:	00a31821 	addu	v1,a1,v1
+   13440:	0065282b 	sltu	a1,v1,a1
+   13444:	00a71021 	addu	v0,a1,a3
+   13448:	27a50010 	addiu	a1,sp,16
+   1344c:	24060008 	addiu	a2,zero,8
+   13450:	afa30010 	sw	v1,16(sp)
+   13454:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   13458:	afa20014 	sw	v0,20(sp)
+   1345c:	40032002 	mfc0	v1,$4,2
+   13460:	8fbf001c 	lw	ra,28(sp)
+   13464:	ac620258 	sw	v0,600(v1)
+   13468:	03e00008 	jr	ra
+   1346c:	27bd0020 	addiu	sp,sp,32
+   13470:	24020016 	addiu	v0,zero,22
+   13474:	40032002 	mfc0	v1,$4,2
+   13478:	8fbf001c 	lw	ra,28(sp)
+   1347c:	ac620258 	sw	v0,600(v1)
+   13480:	03e00008 	jr	ra
+   13484:	27bd0020 	addiu	sp,sp,32
+   13488:	00052827 	nor	a1,zero,a1
+   1348c:	00c53021 	addu	a2,a2,a1
+   13490:	00c31821 	addu	v1,a2,v1
+   13494:	0066302b 	sltu	a2,v1,a2
+   13498:	08004d12 	j	13448 <sys_clock+0x60>
+   1349c:	00c71021 	addu	v0,a2,a3
+
+000134a0 <sys_close>:
+   134a0:	27bdffd8 	addiu	sp,sp,-40
+   134a4:	afb00018 	sw	s0,24(sp)
+   134a8:	afbf0024 	sw	ra,36(sp)
+   134ac:	afb20020 	sw	s2,32(sp)
+   134b0:	afb1001c 	sw	s1,28(sp)
+   134b4:	00808021 	addu	s0,a0,zero
+   134b8:	40122002 	mfc0	s2,$4,2
+   134bc:	40032002 	mfc0	v1,$4,2
+   134c0:	2c820008 	sltiu	v0,a0,8
+   134c4:	10400016 	beqz	v0,13520 <sys_close+0x80>
+   134c8:	8c710180 	lw	s1,384(v1)
+   134cc:	02202021 	addu	a0,s1,zero
+   134d0:	02002821 	addu	a1,s0,zero
+   134d4:	27a60010 	addiu	a2,sp,16
+   134d8:	0c0061dc 	jal	18770 <task_fd_lookup>
+   134dc:	afa00010 	sw	zero,16(sp)
+   134e0:	1440000f 	bnez	v0,13520 <sys_close+0x80>
+   134e4:	8fa40010 	lw	a0,16(sp)
+   134e8:	0c009f67 	jal	27d9c <vfs_close>
+   134ec:	00002821 	addu	a1,zero,zero
+   134f0:	14400014 	bnez	v0,13544 <sys_close+0xa4>
+   134f4:	02202021 	addu	a0,s1,zero
+   134f8:	0c0061fe 	jal	187f8 <task_fd_put>
+   134fc:	02002821 	addu	a1,s0,zero
+   13500:	0000000f 	sync
+   13504:	00001021 	addu	v0,zero,zero
+   13508:	8fbf0024 	lw	ra,36(sp)
+   1350c:	8fb20020 	lw	s2,32(sp)
+   13510:	8fb1001c 	lw	s1,28(sp)
+   13514:	8fb00018 	lw	s0,24(sp)
+   13518:	03e00008 	jr	ra
+   1351c:	27bd0028 	addiu	sp,sp,40
+   13520:	8fbf0024 	lw	ra,36(sp)
+   13524:	2402004d 	addiu	v0,zero,77
+   13528:	ae420258 	sw	v0,600(s2)
+   1352c:	8fb1001c 	lw	s1,28(sp)
+   13530:	2402ffff 	addiu	v0,zero,-1
+   13534:	8fb20020 	lw	s2,32(sp)
+   13538:	8fb00018 	lw	s0,24(sp)
+   1353c:	03e00008 	jr	ra
+   13540:	27bd0028 	addiu	sp,sp,40
+   13544:	ae420258 	sw	v0,600(s2)
+   13548:	08004d42 	j	13508 <sys_close+0x68>
+   1354c:	2402ffff 	addiu	v0,zero,-1
+
+00013550 <sys_closedir>:
+   13550:	27bdffd8 	addiu	sp,sp,-40
+   13554:	afb00018 	sw	s0,24(sp)
+   13558:	afbf0024 	sw	ra,36(sp)
+   1355c:	afb20020 	sw	s2,32(sp)
+   13560:	afb1001c 	sw	s1,28(sp)
+   13564:	00808021 	addu	s0,a0,zero
+   13568:	40122002 	mfc0	s2,$4,2
+   1356c:	40032002 	mfc0	v1,$4,2
+   13570:	2c820008 	sltiu	v0,a0,8
+   13574:	10400015 	beqz	v0,135cc <sys_closedir+0x7c>
+   13578:	8c710180 	lw	s1,384(v1)
+   1357c:	02202021 	addu	a0,s1,zero
+   13580:	02002821 	addu	a1,s0,zero
+   13584:	27a60010 	addiu	a2,sp,16
+   13588:	0c0061dc 	jal	18770 <task_fd_lookup>
+   1358c:	afa00010 	sw	zero,16(sp)
+   13590:	1440000e 	bnez	v0,135cc <sys_closedir+0x7c>
+   13594:	8fa40010 	lw	a0,16(sp)
+   13598:	0c009f74 	jal	27dd0 <vfs_closedir>
+   1359c:	00002821 	addu	a1,zero,zero
+   135a0:	14400013 	bnez	v0,135f0 <sys_closedir+0xa0>
+   135a4:	02202021 	addu	a0,s1,zero
+   135a8:	0c0061fe 	jal	187f8 <task_fd_put>
+   135ac:	02002821 	addu	a1,s0,zero
+   135b0:	00001021 	addu	v0,zero,zero
+   135b4:	8fbf0024 	lw	ra,36(sp)
+   135b8:	8fb20020 	lw	s2,32(sp)
+   135bc:	8fb1001c 	lw	s1,28(sp)
+   135c0:	8fb00018 	lw	s0,24(sp)
+   135c4:	03e00008 	jr	ra
+   135c8:	27bd0028 	addiu	sp,sp,40
+   135cc:	8fbf0024 	lw	ra,36(sp)
+   135d0:	2402004d 	addiu	v0,zero,77
+   135d4:	ae420258 	sw	v0,600(s2)
+   135d8:	8fb1001c 	lw	s1,28(sp)
+   135dc:	2402ffff 	addiu	v0,zero,-1
+   135e0:	8fb20020 	lw	s2,32(sp)
+   135e4:	8fb00018 	lw	s0,24(sp)
+   135e8:	03e00008 	jr	ra
+   135ec:	27bd0028 	addiu	sp,sp,40
+   135f0:	04400003 	bltz	v0,13600 <sys_closedir+0xb0>
+   135f4:	ae420258 	sw	v0,600(s2)
+   135f8:	08004d6d 	j	135b4 <sys_closedir+0x64>
+   135fc:	2402ffff 	addiu	v0,zero,-1
+   13600:	00021023 	negu	v0,v0
+   13604:	ae420258 	sw	v0,600(s2)
+   13608:	08004d6d 	j	135b4 <sys_closedir+0x64>
+   1360c:	2402ffff 	addiu	v0,zero,-1
+
+00013610 <cv_kmem_init>:
+   13610:	24030014 	addiu	v1,zero,20
+   13614:	ac830000 	sw	v1,0(a0)
+   13618:	3c030003 	lui	v1,0x3
+   1361c:	24635f20 	addiu	v1,v1,24352
+   13620:	24020002 	addiu	v0,zero,2
+   13624:	ac830004 	sw	v1,4(a0)
+   13628:	24030030 	addiu	v1,zero,48
+   1362c:	ac820010 	sw	v0,16(a0)
+   13630:	ac82000c 	sw	v0,12(a0)
+   13634:	ac830008 	sw	v1,8(a0)
+   13638:	ac80001c 	sw	zero,28(a0)
+   1363c:	ac800014 	sw	zero,20(a0)
+   13640:	ac800018 	sw	zero,24(a0)
+   13644:	03e00008 	jr	ra
+   13648:	00001021 	addu	v0,zero,zero
+   1364c:	27bdffb8 	addiu	sp,sp,-72
+   13650:	afb00040 	sw	s0,64(sp)
+   13654:	afbf0044 	sw	ra,68(sp)
+   13658:	0c00616c 	jal	185b0 <task_lookup_zero>
+   1365c:	00808021 	addu	s0,a0,zero
+   13660:	3c040003 	lui	a0,0x3
+   13664:	24845f38 	addiu	a0,a0,24376
+   13668:	00402821 	addu	a1,v0,zero
+   1366c:	02003021 	addu	a2,s0,zero
+   13670:	0c008099 	jal	20264 <vmm_check_address>
+   13674:	24070030 	addiu	a3,zero,48
+   13678:	10400005 	beqz	v0,13690 <cv_kmem_init+0x80>
+   1367c:	02002821 	addu	a1,s0,zero
+   13680:	8fbf0044 	lw	ra,68(sp)
+   13684:	8fb00040 	lw	s0,64(sp)
+   13688:	03e00008 	jr	ra
+   1368c:	27bd0048 	addiu	sp,sp,72
+   13690:	27a40010 	addiu	a0,sp,16
+   13694:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   13698:	24060030 	addiu	a2,zero,48
+   1369c:	1440fff8 	bnez	v0,13680 <cv_kmem_init+0x70>
+   136a0:	3c03b1ca 	lui	v1,0xb1ca
+   136a4:	8fa20020 	lw	v0,32(sp)
+   136a8:	34630ba5 	ori	v1,v1,0xba5
+   136ac:	8fbf0044 	lw	ra,68(sp)
+   136b0:	00431826 	xor	v1,v0,v1
+   136b4:	24020016 	addiu	v0,zero,22
+   136b8:	0003100a 	movz	v0,zero,v1
+   136bc:	8fb00040 	lw	s0,64(sp)
+   136c0:	03e00008 	jr	ra
+   136c4:	27bd0048 	addiu	sp,sp,72
+
+000136c8 <sys_cond_var>:
+   136c8:	27bdff80 	addiu	sp,sp,-128
+   136cc:	afb30074 	sw	s3,116(sp)
+   136d0:	afb20070 	sw	s2,112(sp)
+   136d4:	afb1006c 	sw	s1,108(sp)
+   136d8:	afbf007c 	sw	ra,124(sp)
+   136dc:	afb40078 	sw	s4,120(sp)
+   136e0:	afb00068 	sw	s0,104(sp)
+   136e4:	00808821 	addu	s1,a0,zero
+   136e8:	00a09021 	addu	s2,a1,zero
+   136ec:	00c09821 	addu	s3,a2,zero
+   136f0:	40022002 	mfc0	v0,$4,2
+   136f4:	3c040003 	lui	a0,0x3
+   136f8:	8c450180 	lw	a1,384(v0)
+   136fc:	24845f44 	addiu	a0,a0,24388
+   13700:	02203021 	addu	a2,s1,zero
+   13704:	0c008099 	jal	20264 <vmm_check_address>
+   13708:	24070004 	addiu	a3,zero,4
+   1370c:	1040000c 	beqz	v0,13740 <sys_cond_var+0x78>
+   13710:	00408021 	addu	s0,v0,zero
+   13714:	40022002 	mfc0	v0,$4,2
+   13718:	ac500258 	sw	s0,600(v0)
+   1371c:	8fbf007c 	lw	ra,124(sp)
+   13720:	02001021 	addu	v0,s0,zero
+   13724:	8fb40078 	lw	s4,120(sp)
+   13728:	8fb30074 	lw	s3,116(sp)
+   1372c:	8fb20070 	lw	s2,112(sp)
+   13730:	8fb1006c 	lw	s1,108(sp)
+   13734:	8fb00068 	lw	s0,104(sp)
+   13738:	03e00008 	jr	ra
+   1373c:	27bd0080 	addiu	sp,sp,128
+   13740:	27b40010 	addiu	s4,sp,16
+   13744:	02802021 	addu	a0,s4,zero
+   13748:	02202821 	addu	a1,s1,zero
+   1374c:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   13750:	24060004 	addiu	a2,zero,4
+   13754:	1440ffef 	bnez	v0,13714 <sys_cond_var+0x4c>
+   13758:	00408021 	addu	s0,v0,zero
+   1375c:	2e420005 	sltiu	v0,s2,5
+   13760:	14400003 	bnez	v0,13770 <sys_cond_var+0xa8>
+   13764:	3c020003 	lui	v0,0x3
+   13768:	08004dc5 	j	13714 <sys_cond_var+0x4c>
+   1376c:	24100016 	addiu	s0,zero,22
+   13770:	24425f6c 	addiu	v0,v0,24428
+   13774:	00129080 	sll	s2,s2,0x2
+   13778:	00529021 	addu	s2,v0,s2
+   1377c:	8e420000 	lw	v0,0(s2)
+   13780:	00400008 	jr	v0
+   13784:	00000000 	sll	zero,zero,0x0
+   13788:	0c004d93 	jal	1364c <cv_kmem_init+0x3c>
+   1378c:	8fa40010 	lw	a0,16(sp)
+   13790:	1440ffe0 	bnez	v0,13714 <sys_cond_var+0x4c>
+   13794:	00000000 	sll	zero,zero,0x0
+   13798:	0c001f66 	jal	7d98 <cv_broadcast>
+   1379c:	8fa40010 	lw	a0,16(sp)
+   137a0:	08004dc7 	j	1371c <sys_cond_var+0x54>
+   137a4:	00408021 	addu	s0,v0,zero
+   137a8:	0c004d93 	jal	1364c <cv_kmem_init+0x3c>
+   137ac:	8fa40010 	lw	a0,16(sp)
+   137b0:	1440ffd8 	bnez	v0,13714 <sys_cond_var+0x4c>
+   137b4:	00000000 	sll	zero,zero,0x0
+   137b8:	0c001f74 	jal	7dd0 <cv_signal>
+   137bc:	8fa40010 	lw	a0,16(sp)
+   137c0:	08004dc7 	j	1371c <sys_cond_var+0x54>
+   137c4:	00408021 	addu	s0,v0,zero
+   137c8:	40022002 	mfc0	v0,$4,2
+   137cc:	3c040003 	lui	a0,0x3
+   137d0:	8c450180 	lw	a1,384(v0)
+   137d4:	24845f50 	addiu	a0,a0,24400
+   137d8:	02603021 	addu	a2,s3,zero
+   137dc:	0c008099 	jal	20264 <vmm_check_address>
+   137e0:	24070004 	addiu	a3,zero,4
+   137e4:	1440ffcb 	bnez	v0,13714 <sys_cond_var+0x4c>
+   137e8:	00408021 	addu	s0,v0,zero
+   137ec:	02602821 	addu	a1,s3,zero
+   137f0:	27a40014 	addiu	a0,sp,20
+   137f4:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   137f8:	24060004 	addiu	a2,zero,4
+   137fc:	1440ffc5 	bnez	v0,13714 <sys_cond_var+0x4c>
+   13800:	00408021 	addu	s0,v0,zero
+   13804:	0c00616c 	jal	185b0 <task_lookup_zero>
+   13808:	8fb10014 	lw	s1,20(sp)
+   1380c:	3c040003 	lui	a0,0x3
+   13810:	24845f5c 	addiu	a0,a0,24412
+   13814:	00402821 	addu	a1,v0,zero
+   13818:	02203021 	addu	a2,s1,zero
+   1381c:	0c008099 	jal	20264 <vmm_check_address>
+   13820:	24070040 	addiu	a3,zero,64
+   13824:	1440ffbb 	bnez	v0,13714 <sys_cond_var+0x4c>
+   13828:	02202821 	addu	a1,s1,zero
+   1382c:	27a40028 	addiu	a0,sp,40
+   13830:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   13834:	24060040 	addiu	a2,zero,64
+   13838:	1440ffb6 	bnez	v0,13714 <sys_cond_var+0x4c>
+   1383c:	3c02a0b1 	lui	v0,0xa0b1
+   13840:	8fa30038 	lw	v1,56(sp)
+   13844:	3442c0b3 	ori	v0,v0,0xc0b3
+   13848:	1462ffb2 	bne	v1,v0,13714 <sys_cond_var+0x4c>
+   1384c:	00000000 	sll	zero,zero,0x0
+   13850:	0c004d93 	jal	1364c <cv_kmem_init+0x3c>
+   13854:	8fa40010 	lw	a0,16(sp)
+   13858:	1440ffae 	bnez	v0,13714 <sys_cond_var+0x4c>
+   1385c:	8fa40010 	lw	a0,16(sp)
+   13860:	0c001f83 	jal	7e0c <cv_wait>
+   13864:	8fa50014 	lw	a1,20(sp)
+   13868:	08004dc7 	j	1371c <sys_cond_var+0x54>
+   1386c:	00408021 	addu	s0,v0,zero
+   13870:	24020014 	addiu	v0,zero,20
+   13874:	afa20018 	sw	v0,24(sp)
+   13878:	24020030 	addiu	v0,zero,48
+   1387c:	27b20018 	addiu	s2,sp,24
+   13880:	afa2001c 	sw	v0,28(sp)
+   13884:	3c020022 	lui	v0,0x22
+   13888:	34420040 	ori	v0,v0,0x40
+   1388c:	02402021 	addu	a0,s2,zero
+   13890:	0c00713f 	jal	1c4fc <kmem_alloc>
+   13894:	afa20020 	sw	v0,32(sp)
+   13898:	10400021 	beqz	v0,13920 <sys_cond_var+0x258>
+   1389c:	00402021 	addu	a0,v0,zero
+   138a0:	0c001fc0 	jal	7f00 <cv_init>
+   138a4:	afa20010 	sw	v0,16(sp)
+   138a8:	1440ff9a 	bnez	v0,13714 <sys_cond_var+0x4c>
+   138ac:	00408021 	addu	s0,v0,zero
+   138b0:	02202021 	addu	a0,s1,zero
+   138b4:	02802821 	addu	a1,s4,zero
+   138b8:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   138bc:	24060004 	addiu	a2,zero,4
+   138c0:	1040ff94 	beqz	v0,13714 <sys_cond_var+0x4c>
+   138c4:	00408021 	addu	s0,v0,zero
+   138c8:	8fa20010 	lw	v0,16(sp)
+   138cc:	02402021 	addu	a0,s2,zero
+   138d0:	0c007134 	jal	1c4d0 <kmem_free>
+   138d4:	afa20024 	sw	v0,36(sp)
+   138d8:	08004dc5 	j	13714 <sys_cond_var+0x4c>
+   138dc:	00000000 	sll	zero,zero,0x0
+   138e0:	0c004d93 	jal	1364c <cv_kmem_init+0x3c>
+   138e4:	8fa40010 	lw	a0,16(sp)
+   138e8:	1440ff8a 	bnez	v0,13714 <sys_cond_var+0x4c>
+   138ec:	00000000 	sll	zero,zero,0x0
+   138f0:	0c001f54 	jal	7d50 <cv_destroy>
+   138f4:	8fa40010 	lw	a0,16(sp)
+   138f8:	1440ff86 	bnez	v0,13714 <sys_cond_var+0x4c>
+   138fc:	00408021 	addu	s0,v0,zero
+   13900:	24020014 	addiu	v0,zero,20
+   13904:	afa20018 	sw	v0,24(sp)
+   13908:	8fa20010 	lw	v0,16(sp)
+   1390c:	27a40018 	addiu	a0,sp,24
+   13910:	0c007134 	jal	1c4d0 <kmem_free>
+   13914:	afa20024 	sw	v0,36(sp)
+   13918:	08004dc8 	j	13720 <sys_cond_var+0x58>
+   1391c:	8fbf007c 	lw	ra,124(sp)
+   13920:	08004dc5 	j	13714 <sys_cond_var+0x4c>
+   13924:	2410000c 	addiu	s0,zero,12
+
+00013928 <sysconf_init>:
+   13928:	3c030004 	lui	v1,0x4
+   1392c:	3c060003 	lui	a2,0x3
+   13930:	2463bcb4 	addiu	v1,v1,-17228
+   13934:	24c65f80 	addiu	a2,a2,24448
+   13938:	3c040004 	lui	a0,0x4
+   1393c:	ac660010 	sw	a2,16(v1)
+   13940:	ac600014 	sw	zero,20(v1)
+   13944:	2484bcd4 	addiu	a0,a0,-17196
+   13948:	00001021 	addu	v0,zero,zero
+   1394c:	00604021 	addu	t0,v1,zero
+   13950:	2407000a 	addiu	a3,zero,10
+   13954:	24450004 	addiu	a1,v0,4
+   13958:	000528c0 	sll	a1,a1,0x3
+   1395c:	00652821 	addu	a1,v1,a1
+   13960:	24420001 	addiu	v0,v0,1
+   13964:	ac850004 	sw	a1,4(a0)
+   13968:	ac850000 	sw	a1,0(a0)
+   1396c:	1447fff9 	bne	v0,a3,13954 <sysconf_init+0x2c>
+   13970:	24840008 	addiu	a0,a0,8
+   13974:	3c040008 	lui	a0,0x8
+   13978:	24840390 	addiu	a0,a0,912
+   1397c:	8c820014 	lw	v0,20(a0)
+   13980:	3c050004 	lui	a1,0x4
+   13984:	aca0bcb4 	sw	zero,-17228(a1)
+   13988:	3c050001 	lui	a1,0x1
+   1398c:	24420001 	addiu	v0,v0,1
+   13990:	24a53a18 	addiu	a1,a1,14872
+   13994:	ad050004 	sw	a1,4(t0)
+   13998:	ac820014 	sw	v0,20(a0)
+   1399c:	ad00000c 	sw	zero,12(t0)
+   139a0:	ad000008 	sw	zero,8(t0)
+   139a4:	24050053 	addiu	a1,zero,83
+   139a8:	00001021 	addu	v0,zero,zero
+   139ac:	24c60001 	addiu	a2,a2,1
+   139b0:	00a23826 	xor	a3,a1,v0
+   139b4:	80c50000 	lb	a1,0(a2)
+   139b8:	14a0fffc 	bnez	a1,139ac <sysconf_init+0x84>
+   139bc:	00471021 	addu	v0,v0,a3
+   139c0:	3c05cccc 	lui	a1,0xcccc
+   139c4:	34a5cccd 	ori	a1,a1,0xcccd
+   139c8:	00450019 	multu	v0,a1
+   139cc:	00002810 	mfhi	a1
+   139d0:	000528c2 	srl	a1,a1,0x3
+   139d4:	000530c0 	sll	a2,a1,0x3
+   139d8:	00052840 	sll	a1,a1,0x1
+   139dc:	00a62821 	addu	a1,a1,a2
+   139e0:	00451023 	subu	v0,v0,a1
+   139e4:	24420004 	addiu	v0,v0,4
+   139e8:	000210c0 	sll	v0,v0,0x3
+   139ec:	00822021 	addu	a0,a0,v0
+   139f0:	8c820004 	lw	v0,4(a0)
+   139f4:	3c040004 	lui	a0,0x4
+   139f8:	8c450000 	lw	a1,0(v0)
+   139fc:	2484bccc 	addiu	a0,a0,-17204
+   13a00:	ac62001c 	sw	v0,28(v1)
+   13a04:	ac650018 	sw	a1,24(v1)
+   13a08:	aca40004 	sw	a0,4(a1)
+   13a0c:	ac440000 	sw	a0,0(v0)
+   13a10:	03e00008 	jr	ra
+   13a14:	00001021 	addu	v0,zero,zero
+   13a18:	8cc20000 	lw	v0,0(a2)
+   13a1c:	27bdffc8 	addiu	sp,sp,-56
+   13a20:	afb1002c 	sw	s1,44(sp)
+   13a24:	afb00028 	sw	s0,40(sp)
+   13a28:	afbf0034 	sw	ra,52(sp)
+   13a2c:	afb20030 	sw	s2,48(sp)
+   13a30:	00c08021 	addu	s0,a2,zero
+   13a34:	1040000a 	beqz	v0,13a60 <sysconf_init+0x138>
+   13a38:	00a08821 	addu	s1,a1,zero
+   13a3c:	8fbf0034 	lw	ra,52(sp)
+   13a40:	acc00000 	sw	zero,0(a2)
+   13a44:	00001021 	addu	v0,zero,zero
+   13a48:	8fb20030 	lw	s2,48(sp)
+   13a4c:	8fb1002c 	lw	s1,44(sp)
+   13a50:	8fb00028 	lw	s0,40(sp)
+   13a54:	aca00004 	sw	zero,4(a1)
+   13a58:	03e00008 	jr	ra
+   13a5c:	27bd0038 	addiu	sp,sp,56
+   13a60:	40022002 	mfc0	v0,$4,2
+   13a64:	0c00056f 	jal	15bc <arch_onln_cluster_nr>
+   13a68:	24b20008 	addiu	s2,a1,8
+   13a6c:	0c00056c 	jal	15b0 <arch_onln_cpu_nr>
+   13a70:	afa20020 	sw	v0,32(sp)
+   13a74:	00403821 	addu	a3,v0,zero
+   13a78:	24020040 	addiu	v0,zero,64
+   13a7c:	8fa60020 	lw	a2,32(sp)
+   13a80:	afa20010 	sw	v0,16(sp)
+   13a84:	3c050003 	lui	a1,0x3
+   13a88:	24021000 	addiu	v0,zero,4096
+   13a8c:	02402021 	addu	a0,s2,zero
+   13a90:	afa20014 	sw	v0,20(sp)
+   13a94:	24a55f88 	addiu	a1,a1,24456
+   13a98:	3c023000 	lui	v0,0x3000
+   13a9c:	0c00c414 	jal	31050 <sprintk>
+   13aa0:	afa20018 	sw	v0,24(sp)
+   13aa4:	0c00c4d1 	jal	31344 <strlen>
+   13aa8:	02402021 	addu	a0,s2,zero
+   13aac:	8fbf0034 	lw	ra,52(sp)
+   13ab0:	ae220004 	sw	v0,4(s1)
+   13ab4:	8fb20030 	lw	s2,48(sp)
+   13ab8:	ae000000 	sw	zero,0(s0)
+   13abc:	00001021 	addu	v0,zero,zero
+   13ac0:	8fb1002c 	lw	s1,44(sp)
+   13ac4:	8fb00028 	lw	s0,40(sp)
+   13ac8:	03e00008 	jr	ra
+   13acc:	27bd0038 	addiu	sp,sp,56
+
+00013ad0 <sys_creat>:
+   13ad0:	27bdff68 	addiu	sp,sp,-152
+   13ad4:	2402ffff 	addiu	v0,zero,-1
+   13ad8:	afb30090 	sw	s3,144(sp)
+   13adc:	afbf0094 	sw	ra,148(sp)
+   13ae0:	afb2008c 	sw	s2,140(sp)
+   13ae4:	afb10088 	sw	s1,136(sp)
+   13ae8:	afb00084 	sw	s0,132(sp)
+   13aec:	afa20018 	sw	v0,24(sp)
+   13af0:	00809821 	addu	s3,a0,zero
+   13af4:	40112002 	mfc0	s1,$4,2
+   13af8:	40022002 	mfc0	v0,$4,2
+   13afc:	8c500180 	lw	s0,384(v0)
+   13b00:	afa50078 	sw	a1,120(sp)
+   13b04:	0c006147 	jal	1851c <task_fd_check>
+   13b08:	02002021 	addu	a0,s0,zero
+   13b0c:	1040000b 	beqz	v0,13b3c <sys_creat+0x6c>
+   13b10:	8fa50078 	lw	a1,120(sp)
+   13b14:	24020017 	addiu	v0,zero,23
+   13b18:	8fbf0094 	lw	ra,148(sp)
+   13b1c:	ae220258 	sw	v0,600(s1)
+   13b20:	8fa20018 	lw	v0,24(sp)
+   13b24:	8fb30090 	lw	s3,144(sp)
+   13b28:	8fb2008c 	lw	s2,140(sp)
+   13b2c:	8fb10088 	lw	s1,136(sp)
+   13b30:	8fb00084 	lw	s0,132(sp)
+   13b34:	03e00008 	jr	ra
+   13b38:	27bd0098 	addiu	sp,sp,152
+   13b3c:	3c020001 	lui	v0,0x1
+   13b40:	2442bf70 	addiu	v0,v0,-16528
+   13b44:	afa20024 	sw	v0,36(sp)
+   13b48:	3c020001 	lui	v0,0x1
+   13b4c:	2442bee4 	addiu	v0,v0,-16668
+   13b50:	afa20028 	sw	v0,40(sp)
+   13b54:	3c020001 	lui	v0,0x1
+   13b58:	2442be2c 	addiu	v0,v0,-16852
+   13b5c:	afa20030 	sw	v0,48(sp)
+   13b60:	3c020001 	lui	v0,0x1
+   13b64:	2442bd0c 	addiu	v0,v0,-17140
+   13b68:	afa2002c 	sw	v0,44(sp)
+   13b6c:	261200b0 	addiu	s2,s0,176
+   13b70:	3c020001 	lui	v0,0x1
+   13b74:	02402021 	addu	a0,s2,zero
+   13b78:	2442beb0 	addiu	v0,v0,-16720
+   13b7c:	afb3001c 	sw	s3,28(sp)
+   13b80:	afa50078 	sw	a1,120(sp)
+   13b84:	afa20034 	sw	v0,52(sp)
+   13b88:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   13b8c:	afa00020 	sw	zero,32(sp)
+   13b90:	8fa50078 	lw	a1,120(sp)
+   13b94:	27b30038 	addiu	s3,sp,56
+   13b98:	00a03821 	addu	a3,a1,zero
+   13b9c:	2604054c 	addiu	a0,s0,1356
+   13ba0:	27a5001c 	addiu	a1,sp,28
+   13ba4:	00003021 	addu	a2,zero,zero
+   13ba8:	0c00a5a0 	jal	29680 <vfs_create>
+   13bac:	afb30010 	sw	s3,16(sp)
+   13bb0:	1040000d 	beqz	v0,13be8 <sys_creat+0x118>
+   13bb4:	02002021 	addu	a0,s0,zero
+   13bb8:	04400015 	bltz	v0,13c10 <sys_creat+0x140>
+   13bbc:	ae220258 	sw	v0,600(s1)
+   13bc0:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   13bc4:	02402021 	addu	a0,s2,zero
+   13bc8:	8fbf0094 	lw	ra,148(sp)
+   13bcc:	8fa20018 	lw	v0,24(sp)
+   13bd0:	8fb30090 	lw	s3,144(sp)
+   13bd4:	8fb2008c 	lw	s2,140(sp)
+   13bd8:	8fb10088 	lw	s1,136(sp)
+   13bdc:	8fb00084 	lw	s0,132(sp)
+   13be0:	03e00008 	jr	ra
+   13be4:	27bd0098 	addiu	sp,sp,152
+   13be8:	02602821 	addu	a1,s3,zero
+   13bec:	0c006226 	jal	18898 <task_fd_set>
+   13bf0:	27a60018 	addiu	a2,sp,24
+   13bf4:	1040fff2 	beqz	v0,13bc0 <sys_creat+0xf0>
+   13bf8:	00408021 	addu	s0,v0,zero
+   13bfc:	02602021 	addu	a0,s3,zero
+   13c00:	0c009f67 	jal	27d9c <vfs_close>
+   13c04:	00002821 	addu	a1,zero,zero
+   13c08:	08004ef0 	j	13bc0 <sys_creat+0xf0>
+   13c0c:	ae300258 	sw	s0,600(s1)
+   13c10:	00021023 	negu	v0,v0
+   13c14:	08004ef0 	j	13bc0 <sys_creat+0xf0>
+   13c18:	ae220258 	sw	v0,600(s1)
+
+00013c1c <dma_kmem_request_init>:
+   13c1c:	3c030003 	lui	v1,0x3
+   13c20:	24635fe0 	addiu	v1,v1,24544
+   13c24:	ac830004 	sw	v1,4(a0)
+   13c28:	2403005c 	addiu	v1,zero,92
+   13c2c:	24020004 	addiu	v0,zero,4
+   13c30:	ac830008 	sw	v1,8(a0)
+   13c34:	24030002 	addiu	v1,zero,2
+   13c38:	ac820010 	sw	v0,16(a0)
+   13c3c:	ac820000 	sw	v0,0(a0)
+   13c40:	ac83000c 	sw	v1,12(a0)
+   13c44:	ac80001c 	sw	zero,28(a0)
+   13c48:	ac800014 	sw	zero,20(a0)
+   13c4c:	ac800018 	sw	zero,24(a0)
+   13c50:	03e00008 	jr	ra
+   13c54:	00001021 	addu	v0,zero,zero
+
+00013c58 <sys_dma_memcpy>:
+   13c58:	3c020008 	lui	v0,0x8
+   13c5c:	27bdff88 	addiu	sp,sp,-120
+   13c60:	8c4226e8 	lw	v0,9960(v0)
+   13c64:	afbf0074 	sw	ra,116(sp)
+   13c68:	afa40010 	sw	a0,16(sp)
+   13c6c:	afa50014 	sw	a1,20(sp)
+   13c70:	afa60018 	sw	a2,24(sp)
+   13c74:	afa0001c 	sw	zero,28(sp)
+   13c78:	8c430038 	lw	v1,56(v0)
+   13c7c:	27a50010 	addiu	a1,sp,16
+   13c80:	0060f809 	jalr	v1
+   13c84:	00402021 	addu	a0,v0,zero
+   13c88:	8fbf0074 	lw	ra,116(sp)
+   13c8c:	03e00008 	jr	ra
+   13c90:	27bd0078 	addiu	sp,sp,120
+
+00013c94 <dma_memcpy>:
+   13c94:	27bdff60 	addiu	sp,sp,-160
+   13c98:	24020001 	addiu	v0,zero,1
+   13c9c:	afb30098 	sw	s3,152(sp)
+   13ca0:	afb20094 	sw	s2,148(sp)
+   13ca4:	afb10090 	sw	s1,144(sp)
+   13ca8:	afbf009c 	sw	ra,156(sp)
+   13cac:	afb0008c 	sw	s0,140(sp)
+   13cb0:	00809021 	addu	s2,a0,zero
+   13cb4:	00a09821 	addu	s3,a1,zero
+   13cb8:	10e20011 	beq	a3,v0,13d00 <dma_memcpy+0x6c>
+   13cbc:	00c08821 	addu	s1,a2,zero
+   13cc0:	3c020008 	lui	v0,0x8
+   13cc4:	8c4426e8 	lw	a0,9960(v0)
+   13cc8:	afa50020 	sw	a1,32(sp)
+   13ccc:	afb20024 	sw	s2,36(sp)
+   13cd0:	afa60028 	sw	a2,40(sp)
+   13cd4:	afa0002c 	sw	zero,44(sp)
+   13cd8:	8c820038 	lw	v0,56(a0)
+   13cdc:	0040f809 	jalr	v0
+   13ce0:	27a50020 	addiu	a1,sp,32
+   13ce4:	8fbf009c 	lw	ra,156(sp)
+   13ce8:	8fb30098 	lw	s3,152(sp)
+   13cec:	8fb20094 	lw	s2,148(sp)
+   13cf0:	8fb10090 	lw	s1,144(sp)
+   13cf4:	8fb0008c 	lw	s0,140(sp)
+   13cf8:	03e00008 	jr	ra
+   13cfc:	27bd00a0 	addiu	sp,sp,160
+   13d00:	24020004 	addiu	v0,zero,4
+   13d04:	afa20010 	sw	v0,16(sp)
+   13d08:	2402005c 	addiu	v0,zero,92
+   13d0c:	afa20014 	sw	v0,20(sp)
+   13d10:	3c020011 	lui	v0,0x11
+   13d14:	34420020 	ori	v0,v0,0x20
+   13d18:	27a40010 	addiu	a0,sp,16
+   13d1c:	afa70080 	sw	a3,128(sp)
+   13d20:	0c00713f 	jal	1c4fc <kmem_alloc>
+   13d24:	afa20018 	sw	v0,24(sp)
+   13d28:	00408021 	addu	s0,v0,zero
+   13d2c:	1040001d 	beqz	v0,13da4 <dma_memcpy+0x110>
+   13d30:	8fa70080 	lw	a3,128(sp)
+   13d34:	00402021 	addu	a0,v0,zero
+   13d38:	00002821 	addu	a1,zero,zero
+   13d3c:	2406005c 	addiu	a2,zero,92
+   13d40:	0c00c182 	jal	30608 <memset>
+   13d44:	afa70080 	sw	a3,128(sp)
+   13d48:	3c020008 	lui	v0,0x8
+   13d4c:	8c4426e8 	lw	a0,9960(v0)
+   13d50:	24020008 	addiu	v0,zero,8
+   13d54:	ae020018 	sw	v0,24(s0)
+   13d58:	8fa70080 	lw	a3,128(sp)
+   13d5c:	3c020001 	lui	v0,0x1
+   13d60:	24423dac 	addiu	v0,v0,15788
+   13d64:	ae130000 	sw	s3,0(s0)
+   13d68:	ae120004 	sw	s2,4(s0)
+   13d6c:	ae110008 	sw	s1,8(s0)
+   13d70:	ae07000c 	sw	a3,12(s0)
+   13d74:	ae02001c 	sw	v0,28(s0)
+   13d78:	ae100020 	sw	s0,32(s0)
+   13d7c:	8c820038 	lw	v0,56(a0)
+   13d80:	0040f809 	jalr	v0
+   13d84:	02002821 	addu	a1,s0,zero
+   13d88:	8fbf009c 	lw	ra,156(sp)
+   13d8c:	8fb30098 	lw	s3,152(sp)
+   13d90:	8fb20094 	lw	s2,148(sp)
+   13d94:	8fb10090 	lw	s1,144(sp)
+   13d98:	8fb0008c 	lw	s0,140(sp)
+   13d9c:	03e00008 	jr	ra
+   13da0:	27bd00a0 	addiu	sp,sp,160
+   13da4:	08004f39 	j	13ce4 <dma_memcpy+0x50>
+   13da8:	2402000c 	addiu	v0,zero,12
+   13dac:	8c870010 	lw	a3,16(a0)
+   13db0:	27bdffd8 	addiu	sp,sp,-40
+   13db4:	afb00020 	sw	s0,32(sp)
+   13db8:	afbf0024 	sw	ra,36(sp)
+   13dbc:	10e00007 	beqz	a3,13ddc <dma_memcpy+0x148>
+   13dc0:	00808021 	addu	s0,a0,zero
+   13dc4:	3c020004 	lui	v0,0x4
+   13dc8:	3c060003 	lui	a2,0x3
+   13dcc:	8c449100 	lw	a0,-28416(v0)
+   13dd0:	24c65ff0 	addiu	a2,a2,24560
+   13dd4:	0c0009b0 	jal	26c0 <__fprintk>
+   13dd8:	00002821 	addu	a1,zero,zero
+   13ddc:	8e020008 	lw	v0,8(s0)
+   13de0:	27a40010 	addiu	a0,sp,16
+   13de4:	24030004 	addiu	v1,zero,4
+   13de8:	afa2001c 	sw	v0,28(sp)
+   13dec:	0c007134 	jal	1c4d0 <kmem_free>
+   13df0:	afa30010 	sw	v1,16(sp)
+   13df4:	8fbf0024 	lw	ra,36(sp)
+   13df8:	00001021 	addu	v0,zero,zero
+   13dfc:	8fb00020 	lw	s0,32(sp)
+   13e00:	03e00008 	jr	ra
+   13e04:	27bd0028 	addiu	sp,sp,40
+
+00013e08 <pages_to_ppns>:
+   13e08:	27bdffd8 	addiu	sp,sp,-40
+   13e0c:	afb30020 	sw	s3,32(sp)
+   13e10:	afb2001c 	sw	s2,28(sp)
+   13e14:	afb10018 	sw	s1,24(sp)
+   13e18:	afb00014 	sw	s0,20(sp)
+   13e1c:	afbf0024 	sw	ra,36(sp)
+   13e20:	00808021 	addu	s0,a0,zero
+   13e24:	00a09021 	addu	s2,a1,zero
+   13e28:	00008821 	addu	s1,zero,zero
+   13e2c:	24130010 	addiu	s3,zero,16
+   13e30:	02111021 	addu	v0,s0,s1
+   13e34:	8c420000 	lw	v0,0(v0)
+   13e38:	1040000e 	beqz	v0,13e74 <pages_to_ppns+0x6c>
+   13e3c:	00402021 	addu	a0,v0,zero
+   13e40:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   13e44:	00000000 	sll	zero,zero,0x0
+   13e48:	ae420000 	sw	v0,0(s2)
+   13e4c:	26310004 	addiu	s1,s1,4
+   13e50:	1633fff7 	bne	s1,s3,13e30 <pages_to_ppns+0x28>
+   13e54:	26520004 	addiu	s2,s2,4
+   13e58:	8fbf0024 	lw	ra,36(sp)
+   13e5c:	8fb30020 	lw	s3,32(sp)
+   13e60:	8fb2001c 	lw	s2,28(sp)
+   13e64:	8fb10018 	lw	s1,24(sp)
+   13e68:	8fb00014 	lw	s0,20(sp)
+   13e6c:	03e00008 	jr	ra
+   13e70:	27bd0028 	addiu	sp,sp,40
+   13e74:	08004f93 	j	13e4c <pages_to_ppns+0x44>
+   13e78:	ae400000 	sw	zero,0(s2)
+
+00013e7c <drop_args_ppns>:
+   13e7c:	27bdffc8 	addiu	sp,sp,-56
+   13e80:	afb00020 	sw	s0,32(sp)
+   13e84:	afbf0034 	sw	ra,52(sp)
+   13e88:	afb40030 	sw	s4,48(sp)
+   13e8c:	afb3002c 	sw	s3,44(sp)
+   13e90:	afb20028 	sw	s2,40(sp)
+   13e94:	afb10024 	sw	s1,36(sp)
+   13e98:	14a00012 	bnez	a1,13ee4 <drop_args_ppns+0x68>
+   13e9c:	00808021 	addu	s0,a0,zero
+   13ea0:	3c140022 	lui	s4,0x22
+   13ea4:	36940040 	ori	s4,s4,0x40
+   13ea8:	00008821 	addu	s1,zero,zero
+   13eac:	27b30010 	addiu	s3,sp,16
+   13eb0:	24120010 	addiu	s2,zero,16
+   13eb4:	02111021 	addu	v0,s0,s1
+   13eb8:	8c420000 	lw	v0,0(v0)
+   13ebc:	26310004 	addiu	s1,s1,4
+   13ec0:	10400006 	beqz	v0,13edc <drop_args_ppns+0x60>
+   13ec4:	02602021 	addu	a0,s3,zero
+   13ec8:	afa2001c 	sw	v0,28(sp)
+   13ecc:	afa00010 	sw	zero,16(sp)
+   13ed0:	afa00014 	sw	zero,20(sp)
+   13ed4:	0c007134 	jal	1c4d0 <kmem_free>
+   13ed8:	afb40018 	sw	s4,24(sp)
+   13edc:	1632fff6 	bne	s1,s2,13eb8 <drop_args_ppns+0x3c>
+   13ee0:	02111021 	addu	v0,s0,s1
+   13ee4:	8fbf0034 	lw	ra,52(sp)
+   13ee8:	8fb40030 	lw	s4,48(sp)
+   13eec:	8fb3002c 	lw	s3,44(sp)
+   13ef0:	8fb20028 	lw	s2,40(sp)
+   13ef4:	8fb10024 	lw	s1,36(sp)
+   13ef8:	8fb00020 	lw	s0,32(sp)
+   13efc:	03e00008 	jr	ra
+   13f00:	27bd0038 	addiu	sp,sp,56
+
+00013f04 <drop_path>:
+   13f04:	27bdffd8 	addiu	sp,sp,-40
+   13f08:	afbf0024 	sw	ra,36(sp)
+   13f0c:	14a0000d 	bnez	a1,13f44 <drop_path+0x40>
+   13f10:	00801021 	addu	v0,a0,zero
+   13f14:	3c040004 	lui	a0,0x4
+   13f18:	24846e60 	addiu	a0,a0,28256
+   13f1c:	0c007c21 	jal	1f084 <ppm_addr2page>
+   13f20:	00402821 	addu	a1,v0,zero
+   13f24:	afa2001c 	sw	v0,28(sp)
+   13f28:	3c020022 	lui	v0,0x22
+   13f2c:	34420040 	ori	v0,v0,0x40
+   13f30:	27a40010 	addiu	a0,sp,16
+   13f34:	afa20018 	sw	v0,24(sp)
+   13f38:	afa00010 	sw	zero,16(sp)
+   13f3c:	0c007134 	jal	1c4d0 <kmem_free>
+   13f40:	afa00014 	sw	zero,20(sp)
+   13f44:	8fbf0024 	lw	ra,36(sp)
+   13f48:	03e00008 	jr	ra
+   13f4c:	27bd0028 	addiu	sp,sp,40
+
+00013f50 <args_ppns2pages>:
+   13f50:	27bdffb8 	addiu	sp,sp,-72
+   13f54:	3c020022 	lui	v0,0x22
+   13f58:	afb70040 	sw	s7,64(sp)
+   13f5c:	34420040 	ori	v0,v0,0x40
+   13f60:	3c170004 	lui	s7,0x4
+   13f64:	afb6003c 	sw	s6,60(sp)
+   13f68:	afb50038 	sw	s5,56(sp)
+   13f6c:	afb40034 	sw	s4,52(sp)
+   13f70:	afb2002c 	sw	s2,44(sp)
+   13f74:	afb10028 	sw	s1,40(sp)
+   13f78:	afb00024 	sw	s0,36(sp)
+   13f7c:	afbf0044 	sw	ra,68(sp)
+   13f80:	afb30030 	sw	s3,48(sp)
+   13f84:	afa20018 	sw	v0,24(sp)
+   13f88:	00c0b021 	addu	s6,a2,zero
+   13f8c:	afa00010 	sw	zero,16(sp)
+   13f90:	afa00014 	sw	zero,20(sp)
+   13f94:	00808021 	addu	s0,a0,zero
+   13f98:	00a09021 	addu	s2,a1,zero
+   13f9c:	26f76e60 	addiu	s7,s7,28256
+   13fa0:	00008821 	addu	s1,zero,zero
+   13fa4:	27b50010 	addiu	s5,sp,16
+   13fa8:	24140004 	addiu	s4,zero,4
+   13fac:	8e050000 	lw	a1,0(s0)
+   13fb0:	10a0001e 	beqz	a1,1402c <args_ppns2pages+0xdc>
+   13fb4:	00000000 	sll	zero,zero,0x0
+   13fb8:	16c0001e 	bnez	s6,14034 <args_ppns2pages+0xe4>
+   13fbc:	02a02021 	addu	a0,s5,zero
+   13fc0:	0c00713f 	jal	1c4fc <kmem_alloc>
+   13fc4:	00000000 	sll	zero,zero,0x0
+   13fc8:	00409821 	addu	s3,v0,zero
+   13fcc:	1040001d 	beqz	v0,14044 <args_ppns2pages+0xf4>
+   13fd0:	00402021 	addu	a0,v0,zero
+   13fd4:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   13fd8:	00000000 	sll	zero,zero,0x0
+   13fdc:	8e050000 	lw	a1,0(s0)
+   13fe0:	0c00802f 	jal	200bc <ppn_copy>
+   13fe4:	00402021 	addu	a0,v0,zero
+   13fe8:	ae530000 	sw	s3,0(s2)
+   13fec:	26310001 	addiu	s1,s1,1
+   13ff0:	26100004 	addiu	s0,s0,4
+   13ff4:	1634ffed 	bne	s1,s4,13fac <args_ppns2pages+0x5c>
+   13ff8:	26520004 	addiu	s2,s2,4
+   13ffc:	8fbf0044 	lw	ra,68(sp)
+   14000:	00001021 	addu	v0,zero,zero
+   14004:	8fb70040 	lw	s7,64(sp)
+   14008:	8fb6003c 	lw	s6,60(sp)
+   1400c:	8fb50038 	lw	s5,56(sp)
+   14010:	8fb40034 	lw	s4,52(sp)
+   14014:	8fb30030 	lw	s3,48(sp)
+   14018:	8fb2002c 	lw	s2,44(sp)
+   1401c:	8fb10028 	lw	s1,40(sp)
+   14020:	8fb00024 	lw	s0,36(sp)
+   14024:	03e00008 	jr	ra
+   14028:	27bd0048 	addiu	sp,sp,72
+   1402c:	08004ffb 	j	13fec <args_ppns2pages+0x9c>
+   14030:	ae400000 	sw	zero,0(s2)
+   14034:	0c007c41 	jal	1f104 <ppm_ppn2page>
+   14038:	02e02021 	addu	a0,s7,zero
+   1403c:	08004ffb 	j	13fec <args_ppns2pages+0x9c>
+   14040:	ae420000 	sw	v0,0(s2)
+   14044:	8fbf0044 	lw	ra,68(sp)
+   14048:	2402000c 	addiu	v0,zero,12
+   1404c:	8fb70040 	lw	s7,64(sp)
+   14050:	8fb6003c 	lw	s6,60(sp)
+   14054:	8fb50038 	lw	s5,56(sp)
+   14058:	8fb40034 	lw	s4,52(sp)
+   1405c:	8fb30030 	lw	s3,48(sp)
+   14060:	8fb2002c 	lw	s2,44(sp)
+   14064:	8fb10028 	lw	s1,40(sp)
+   14068:	8fb00024 	lw	s0,36(sp)
+   1406c:	03e00008 	jr	ra
+   14070:	27bd0048 	addiu	sp,sp,72
+
+00014074 <get_path>:
+   14074:	27bdffd0 	addiu	sp,sp,-48
+   14078:	afb20028 	sw	s2,40(sp)
+   1407c:	afb00020 	sw	s0,32(sp)
+   14080:	afbf002c 	sw	ra,44(sp)
+   14084:	afb10024 	sw	s1,36(sp)
+   14088:	00a08021 	addu	s0,a1,zero
+   1408c:	14c00020 	bnez	a2,14110 <get_path+0x9c>
+   14090:	00809021 	addu	s2,a0,zero
+   14094:	3c020022 	lui	v0,0x22
+   14098:	34420040 	ori	v0,v0,0x40
+   1409c:	27a40010 	addiu	a0,sp,16
+   140a0:	afa20018 	sw	v0,24(sp)
+   140a4:	afa00010 	sw	zero,16(sp)
+   140a8:	0c00713f 	jal	1c4fc <kmem_alloc>
+   140ac:	afa00014 	sw	zero,20(sp)
+   140b0:	10400010 	beqz	v0,140f4 <get_path+0x80>
+   140b4:	00408821 	addu	s1,v0,zero
+   140b8:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   140bc:	00402021 	addu	a0,v0,zero
+   140c0:	00402021 	addu	a0,v0,zero
+   140c4:	0c00802f 	jal	200bc <ppn_copy>
+   140c8:	02402821 	addu	a1,s2,zero
+   140cc:	0c007c15 	jal	1f054 <ppm_page2addr>
+   140d0:	02202021 	addu	a0,s1,zero
+   140d4:	8fbf002c 	lw	ra,44(sp)
+   140d8:	ae020000 	sw	v0,0(s0)
+   140dc:	8fb20028 	lw	s2,40(sp)
+   140e0:	00001021 	addu	v0,zero,zero
+   140e4:	8fb10024 	lw	s1,36(sp)
+   140e8:	8fb00020 	lw	s0,32(sp)
+   140ec:	03e00008 	jr	ra
+   140f0:	27bd0030 	addiu	sp,sp,48
+   140f4:	8fbf002c 	lw	ra,44(sp)
+   140f8:	2402000c 	addiu	v0,zero,12
+   140fc:	8fb20028 	lw	s2,40(sp)
+   14100:	8fb10024 	lw	s1,36(sp)
+   14104:	8fb00020 	lw	s0,32(sp)
+   14108:	03e00008 	jr	ra
+   1410c:	27bd0030 	addiu	sp,sp,48
+   14110:	0c00802d 	jal	200b4 <ppn_ppn2vma>
+   14114:	00000000 	sll	zero,zero,0x0
+   14118:	8fbf002c 	lw	ra,44(sp)
+   1411c:	ae020000 	sw	v0,0(s0)
+   14120:	8fb20028 	lw	s2,40(sp)
+   14124:	00001021 	addu	v0,zero,zero
+   14128:	8fb10024 	lw	s1,36(sp)
+   1412c:	8fb00020 	lw	s0,32(sp)
+   14130:	03e00008 	jr	ra
+   14134:	27bd0030 	addiu	sp,sp,48
+
+00014138 <__sys_exec_main>:
+   14138:	27bdffa8 	addiu	sp,sp,-88
+   1413c:	3c020004 	lui	v0,0x4
+   14140:	acc00000 	sw	zero,0(a2)
+   14144:	afb40050 	sw	s4,80(sp)
+   14148:	ace00000 	sw	zero,0(a3)
+   1414c:	afb10044 	sw	s1,68(sp)
+   14150:	afb00040 	sw	s0,64(sp)
+   14154:	afbf0054 	sw	ra,84(sp)
+   14158:	afb3004c 	sw	s3,76(sp)
+   1415c:	afb20048 	sw	s2,72(sp)
+   14160:	2443c960 	addiu	v1,v0,-13984
+   14164:	88720003 	lwl	s2,3(v1)
+   14168:	8fb10068 	lw	s1,104(sp)
+   1416c:	9852c960 	lwr	s2,-13984(v0)
+   14170:	00c08021 	addu	s0,a2,zero
+   14174:	02449026 	xor	s2,s2,a0
+   14178:	3252ffff 	andi	s2,s2,0xffff
+   1417c:	2e520001 	sltiu	s2,s2,1
+   14180:	8e240028 	lw	a0,40(s1)
+   14184:	27a50028 	addiu	a1,sp,40
+   14188:	02403021 	addu	a2,s2,zero
+   1418c:	0c00501d 	jal	14074 <get_path>
+   14190:	00e0a021 	addu	s4,a3,zero
+   14194:	10400009 	beqz	v0,141bc <__sys_exec_main+0x84>
+   14198:	ae020000 	sw	v0,0(s0)
+   1419c:	8fbf0054 	lw	ra,84(sp)
+   141a0:	8fb40050 	lw	s4,80(sp)
+   141a4:	8fb3004c 	lw	s3,76(sp)
+   141a8:	8fb20048 	lw	s2,72(sp)
+   141ac:	8fb10044 	lw	s1,68(sp)
+   141b0:	8fb00040 	lw	s0,64(sp)
+   141b4:	03e00008 	jr	ra
+   141b8:	27bd0058 	addiu	sp,sp,88
+   141bc:	27b3002c 	addiu	s3,sp,44
+   141c0:	26240018 	addiu	a0,s1,24
+   141c4:	02602821 	addu	a1,s3,zero
+   141c8:	0c004fd4 	jal	13f50 <args_ppns2pages>
+   141cc:	02403021 	addu	a2,s2,zero
+   141d0:	1440001b 	bnez	v0,14240 <__sys_exec_main+0x108>
+   141d4:	ae020000 	sw	v0,0(s0)
+   141d8:	12400024 	beqz	s2,1426c <__sys_exec_main+0x134>
+   141dc:	27a40020 	addiu	a0,sp,32
+   141e0:	0c006220 	jal	18880 <task_lookup>
+   141e4:	8e240000 	lw	a0,0(s1)
+   141e8:	8c440004 	lw	a0,4(v0)
+   141ec:	10800014 	beqz	a0,14240 <__sys_exec_main+0x108>
+   141f0:	afa40020 	sw	a0,32(sp)
+   141f4:	24020001 	addiu	v0,zero,1
+   141f8:	ae820000 	sw	v0,0(s4)
+   141fc:	0c004994 	jal	12650 <signal_manager_init>
+   14200:	00000000 	sll	zero,zero,0x0
+   14204:	8e220008 	lw	v0,8(s1)
+   14208:	8e270014 	lw	a3,20(s1)
+   1420c:	8e28000c 	lw	t0,12(s1)
+   14210:	8e230010 	lw	v1,16(s1)
+   14214:	8fa40020 	lw	a0,32(sp)
+   14218:	8fa50028 	lw	a1,40(sp)
+   1421c:	afa20018 	sw	v0,24(sp)
+   14220:	02603021 	addu	a2,s3,zero
+   14224:	27a20024 	addiu	v0,sp,36
+   14228:	afa80010 	sw	t0,16(sp)
+   1422c:	afa30014 	sw	v1,20(sp)
+   14230:	0c0023d1 	jal	8f44 <do_exec>
+   14234:	afa2001c 	sw	v0,28(sp)
+   14238:	10400019 	beqz	v0,142a0 <__sys_exec_main+0x168>
+   1423c:	ae020000 	sw	v0,0(s0)
+   14240:	8fa40028 	lw	a0,40(sp)
+   14244:	0c004fc1 	jal	13f04 <drop_path>
+   14248:	02402821 	addu	a1,s2,zero
+   1424c:	8fbf0054 	lw	ra,84(sp)
+   14250:	8fb40050 	lw	s4,80(sp)
+   14254:	8fb3004c 	lw	s3,76(sp)
+   14258:	8fb20048 	lw	s2,72(sp)
+   1425c:	8fb10044 	lw	s1,68(sp)
+   14260:	8fb00040 	lw	s0,64(sp)
+   14264:	03e00008 	jr	ra
+   14268:	27bd0058 	addiu	sp,sp,88
+   1426c:	8e260000 	lw	a2,0(s1)
+   14270:	8e270004 	lw	a3,4(s1)
+   14274:	0c00674a 	jal	19d28 <task_create_clone>
+   14278:	3405fc11 	ori	a1,zero,0xfc11
+   1427c:	1440fff0 	bnez	v0,14240 <__sys_exec_main+0x108>
+   14280:	ae020000 	sw	v0,0(s0)
+   14284:	8fa40020 	lw	a0,32(sp)
+   14288:	0c00638f 	jal	18e3c <task_restore>
+   1428c:	02202821 	addu	a1,s1,zero
+   14290:	1440ffeb 	bnez	v0,14240 <__sys_exec_main+0x108>
+   14294:	ae020000 	sw	v0,0(s0)
+   14298:	0800507f 	j	141fc <__sys_exec_main+0xc4>
+   1429c:	8fa40020 	lw	a0,32(sp)
+   142a0:	0c004715 	jal	11c54 <sched_register>
+   142a4:	8fa40024 	lw	a0,36(sp)
+   142a8:	ae020000 	sw	v0,0(s0)
+   142ac:	8fa20020 	lw	v0,32(sp)
+   142b0:	24030002 	addiu	v1,zero,2
+   142b4:	8fa40024 	lw	a0,36(sp)
+   142b8:	0c0046cb 	jal	11b2c <sched_add_created>
+   142bc:	ac4305d0 	sw	v1,1488(v0)
+   142c0:	08005068 	j	141a0 <__sys_exec_main+0x68>
+   142c4:	8fbf0054 	lw	ra,84(sp)
+
+000142c8 <__sys_exec_demarshall>:
+   142c8:	27bdffc0 	addiu	sp,sp,-64
+   142cc:	afbf003c 	sw	ra,60(sp)
+   142d0:	afbe0038 	sw	s8,56(sp)
+   142d4:	afb50034 	sw	s5,52(sp)
+   142d8:	03a0f021 	addu	s8,sp,zero
+   142dc:	afb40030 	sw	s4,48(sp)
+   142e0:	afb3002c 	sw	s3,44(sp)
+   142e4:	afb20028 	sw	s2,40(sp)
+   142e8:	afb10024 	sw	s1,36(sp)
+   142ec:	afb00020 	sw	s0,32(sp)
+   142f0:	27bdfff0 	addiu	sp,sp,-16
+   142f4:	27b30018 	addiu	s3,sp,24
+   142f8:	27bdffc0 	addiu	sp,sp,-64
+   142fc:	27b00018 	addiu	s0,sp,24
+   14300:	26030030 	addiu	v1,s0,48
+   14304:	00808821 	addu	s1,a0,zero
+   14308:	8c950000 	lw	s5,0(a0)
+   1430c:	24020004 	addiu	v0,zero,4
+   14310:	2604002c 	addiu	a0,s0,44
+   14314:	24050034 	addiu	a1,zero,52
+   14318:	ae630004 	sw	v1,4(s3)
+   1431c:	ae050008 	sw	a1,8(s0)
+   14320:	ae640000 	sw	a0,0(s3)
+   14324:	ae020028 	sw	v0,40(s0)
+   14328:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1432c:	ae020024 	sw	v0,36(s0)
+   14330:	8e670004 	lw	a3,4(s3)
+   14334:	8e660000 	lw	a2,0(s3)
+   14338:	0040a021 	addu	s4,v0,zero
+   1433c:	02202021 	addu	a0,s1,zero
+   14340:	00002821 	addu	a1,zero,zero
+   14344:	8e320000 	lw	s2,0(s1)
+   14348:	afc6001c 	sw	a2,28(s8)
+   1434c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   14350:	afc70018 	sw	a3,24(s8)
+   14354:	02b4001b 	divu	zero,s5,s4
+   14358:	028001f4 	teq	s4,zero,0x7
+   1435c:	8fc6001c 	lw	a2,28(s8)
+   14360:	8fc70018 	lw	a3,24(s8)
+   14364:	02402821 	addu	a1,s2,zero
+   14368:	afa20010 	sw	v0,16(sp)
+   1436c:	00002012 	mflo	a0
+   14370:	0c00504e 	jal	14138 <__sys_exec_main>
+   14374:	3084ffff 	andi	a0,a0,0xffff
+   14378:	02202021 	addu	a0,s1,zero
+   1437c:	02002821 	addu	a1,s0,zero
+   14380:	24060034 	addiu	a2,zero,52
+   14384:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   14388:	24070002 	addiu	a3,zero,2
+   1438c:	03c0e821 	addu	sp,s8,zero
+   14390:	8fbf003c 	lw	ra,60(sp)
+   14394:	8fbe0038 	lw	s8,56(sp)
+   14398:	8fb50034 	lw	s5,52(sp)
+   1439c:	8fb40030 	lw	s4,48(sp)
+   143a0:	8fb3002c 	lw	s3,44(sp)
+   143a4:	8fb20028 	lw	s2,40(sp)
+   143a8:	8fb10024 	lw	s1,36(sp)
+   143ac:	8fb00020 	lw	s0,32(sp)
+   143b0:	03e00008 	jr	ra
+   143b4:	27bd0040 	addiu	sp,sp,64
+
+000143b8 <__sys_exec_local>:
+   143b8:	27bdffe0 	addiu	sp,sp,-32
+   143bc:	afbf001c 	sw	ra,28(sp)
+   143c0:	00801821 	addu	v1,a0,zero
+   143c4:	00a03821 	addu	a3,a1,zero
+   143c8:	00c01021 	addu	v0,a2,zero
+   143cc:	40067801 	mfc0	a2,$15,1
+   143d0:	3c050004 	lui	a1,0x4
+   143d4:	24a4c960 	addiu	a0,a1,-13984
+   143d8:	88840003 	lwl	a0,3(a0)
+   143dc:	30c60003 	andi	a2,a2,0x3
+   143e0:	3c080004 	lui	t0,0x4
+   143e4:	2508c950 	addiu	t0,t0,-14000
+   143e8:	00063080 	sll	a2,a2,0x2
+   143ec:	00c83021 	addu	a2,a2,t0
+   143f0:	98a4c960 	lwr	a0,-13984(a1)
+   143f4:	8cc50000 	lw	a1,0(a2)
+   143f8:	3084ffff 	andi	a0,a0,0xffff
+   143fc:	00603021 	addu	a2,v1,zero
+   14400:	0c00504e 	jal	14138 <__sys_exec_main>
+   14404:	afa20010 	sw	v0,16(sp)
+   14408:	8fbf001c 	lw	ra,28(sp)
+   1440c:	03e00008 	jr	ra
+   14410:	27bd0020 	addiu	sp,sp,32
+
+00014414 <sys_exec>:
+   14414:	27bdf978 	addiu	sp,sp,-1672
+   14418:	afb60678 	sw	s6,1656(sp)
+   1441c:	afb20668 	sw	s2,1640(sp)
+   14420:	afb10664 	sw	s1,1636(sp)
+   14424:	afbf0684 	sw	ra,1668(sp)
+   14428:	afbe0680 	sw	s8,1664(sp)
+   1442c:	afb7067c 	sw	s7,1660(sp)
+   14430:	afb50674 	sw	s5,1652(sp)
+   14434:	afb40670 	sw	s4,1648(sp)
+   14438:	afb3066c 	sw	s3,1644(sp)
+   1443c:	afb00660 	sw	s0,1632(sp)
+   14440:	00808821 	addu	s1,a0,zero
+   14444:	00a09021 	addu	s2,a1,zero
+   14448:	00c0b021 	addu	s6,a2,zero
+   1444c:	40022002 	mfc0	v0,$4,2
+   14450:	8c500180 	lw	s0,384(v0)
+   14454:	afa00028 	sw	zero,40(sp)
+   14458:	10800115 	beqz	a0,148b0 <sys_exec+0x49c>
+   1445c:	afa0002c 	sw	zero,44(sp)
+   14460:	10a00114 	beqz	a1,148b4 <sys_exec+0x4a0>
+   14464:	24020016 	addiu	v0,zero,22
+   14468:	10c00112 	beqz	a2,148b4 <sys_exec+0x4a0>
+   1446c:	00000000 	sll	zero,zero,0x0
+   14470:	8e03062c 	lw	v1,1580(s0)
+   14474:	24020001 	addiu	v0,zero,1
+   14478:	146200e9 	bne	v1,v0,14820 <sys_exec+0x40c>
+   1447c:	3c130004 	lui	s3,0x4
+   14480:	0c0061d9 	jal	18764 <tasks_manager_lock>
+   14484:	27b50120 	addiu	s5,sp,288
+   14488:	24020004 	addiu	v0,zero,4
+   1448c:	8e1305d0 	lw	s3,1488(s0)
+   14490:	0c0061d6 	jal	18758 <tasks_manager_unlock>
+   14494:	ae0205d0 	sw	v0,1488(s0)
+   14498:	8e1e05c4 	lw	s8,1476(s0)
+   1449c:	8e170618 	lw	s7,1560(s0)
+   144a0:	260202f0 	addiu	v0,s0,752
+   144a4:	02a01821 	addu	v1,s5,zero
+   144a8:	26040510 	addiu	a0,s0,1296
+   144ac:	8c480000 	lw	t0,0(v0)
+   144b0:	8c470004 	lw	a3,4(v0)
+   144b4:	8c460008 	lw	a2,8(v0)
+   144b8:	8c45000c 	lw	a1,12(v0)
+   144bc:	24420010 	addiu	v0,v0,16
+   144c0:	ac680000 	sw	t0,0(v1)
+   144c4:	ac670004 	sw	a3,4(v1)
+   144c8:	ac660008 	sw	a2,8(v1)
+   144cc:	ac65000c 	sw	a1,12(v1)
+   144d0:	1444fff6 	bne	v0,a0,144ac <sys_exec+0x98>
+   144d4:	24630010 	addiu	v1,v1,16
+   144d8:	27a3006c 	addiu	v1,sp,108
+   144dc:	00602021 	addu	a0,v1,zero
+   144e0:	26050540 	addiu	a1,s0,1344
+   144e4:	8c490000 	lw	t1,0(v0)
+   144e8:	8c480004 	lw	t0,4(v0)
+   144ec:	8c470008 	lw	a3,8(v0)
+   144f0:	8c46000c 	lw	a2,12(v0)
+   144f4:	24420010 	addiu	v0,v0,16
+   144f8:	ac890000 	sw	t1,0(a0)
+   144fc:	ac880004 	sw	t0,4(a0)
+   14500:	ac870008 	sw	a3,8(a0)
+   14504:	ac86000c 	sw	a2,12(a0)
+   14508:	1445fff6 	bne	v0,a1,144e4 <sys_exec+0xd0>
+   1450c:	24840010 	addiu	a0,a0,16
+   14510:	8c450000 	lw	a1,0(v0)
+   14514:	8c460008 	lw	a2,8(v0)
+   14518:	8c420004 	lw	v0,4(v0)
+   1451c:	27a700a8 	addiu	a3,sp,168
+   14520:	ac850000 	sw	a1,0(a0)
+   14524:	ac820004 	sw	v0,4(a0)
+   14528:	ac860008 	sw	a2,8(a0)
+   1452c:	2602054c 	addiu	v0,s0,1356
+   14530:	00e02021 	addu	a0,a3,zero
+   14534:	2605057c 	addiu	a1,s0,1404
+   14538:	8c4a0000 	lw	t2,0(v0)
+   1453c:	8c490004 	lw	t1,4(v0)
+   14540:	8c480008 	lw	t0,8(v0)
+   14544:	8c46000c 	lw	a2,12(v0)
+   14548:	24420010 	addiu	v0,v0,16
+   1454c:	ac8a0000 	sw	t2,0(a0)
+   14550:	ac890004 	sw	t1,4(a0)
+   14554:	ac880008 	sw	t0,8(a0)
+   14558:	ac86000c 	sw	a2,12(a0)
+   1455c:	1445fff6 	bne	v0,a1,14538 <sys_exec+0x124>
+   14560:	24840010 	addiu	a0,a0,16
+   14564:	8c450000 	lw	a1,0(v0)
+   14568:	8c460008 	lw	a2,8(v0)
+   1456c:	8c420004 	lw	v0,4(v0)
+   14570:	27a800e4 	addiu	t0,sp,228
+   14574:	ac850000 	sw	a1,0(a0)
+   14578:	ac820004 	sw	v0,4(a0)
+   1457c:	ac860008 	sw	a2,8(a0)
+   14580:	01001021 	addu	v0,t0,zero
+   14584:	26040588 	addiu	a0,s0,1416
+   14588:	260505b8 	addiu	a1,s0,1464
+   1458c:	8c8b0000 	lw	t3,0(a0)
+   14590:	8c8a0004 	lw	t2,4(a0)
+   14594:	8c890008 	lw	t1,8(a0)
+   14598:	8c86000c 	lw	a2,12(a0)
+   1459c:	24840010 	addiu	a0,a0,16
+   145a0:	ac4b0000 	sw	t3,0(v0)
+   145a4:	ac4a0004 	sw	t2,4(v0)
+   145a8:	ac490008 	sw	t1,8(v0)
+   145ac:	ac46000c 	sw	a2,12(v0)
+   145b0:	1485fff6 	bne	a0,a1,1458c <sys_exec+0x178>
+   145b4:	24420010 	addiu	v0,v0,16
+   145b8:	8c8b0008 	lw	t3,8(a0)
+   145bc:	8c8a0000 	lw	t2,0(a0)
+   145c0:	8c890004 	lw	t1,4(a0)
+   145c4:	27b40340 	addiu	s4,sp,832
+   145c8:	02802021 	addu	a0,s4,zero
+   145cc:	00002821 	addu	a1,zero,zero
+   145d0:	24060310 	addiu	a2,zero,784
+   145d4:	ac4b0008 	sw	t3,8(v0)
+   145d8:	ac4a0000 	sw	t2,0(v0)
+   145dc:	ac490004 	sw	t1,4(v0)
+   145e0:	afa30654 	sw	v1,1620(sp)
+   145e4:	afa70650 	sw	a3,1616(sp)
+   145e8:	0c00c182 	jal	30608 <memset>
+   145ec:	afa80658 	sw	t0,1624(sp)
+   145f0:	8fa80658 	lw	t0,1624(sp)
+   145f4:	8fa70650 	lw	a3,1616(sp)
+   145f8:	8fa30654 	lw	v1,1620(sp)
+   145fc:	afbe0340 	sw	s8,832(sp)
+   14600:	afb70344 	sw	s7,836(sp)
+   14604:	27a20370 	addiu	v0,sp,880
+   14608:	8ea90000 	lw	t1,0(s5)
+   1460c:	8ea60004 	lw	a2,4(s5)
+   14610:	8ea50008 	lw	a1,8(s5)
+   14614:	8ea4000c 	lw	a0,12(s5)
+   14618:	26b50010 	addiu	s5,s5,16
+   1461c:	ac490000 	sw	t1,0(v0)
+   14620:	ac460004 	sw	a2,4(v0)
+   14624:	ac450008 	sw	a1,8(v0)
+   14628:	ac44000c 	sw	a0,12(v0)
+   1462c:	1695fff6 	bne	s4,s5,14608 <sys_exec+0x1f4>
+   14630:	24420010 	addiu	v0,v0,16
+   14634:	27a20590 	addiu	v0,sp,1424
+   14638:	27a4009c 	addiu	a0,sp,156
+   1463c:	8c6a0000 	lw	t2,0(v1)
+   14640:	8c690004 	lw	t1,4(v1)
+   14644:	8c660008 	lw	a2,8(v1)
+   14648:	8c65000c 	lw	a1,12(v1)
+   1464c:	24630010 	addiu	v1,v1,16
+   14650:	ac4a0000 	sw	t2,0(v0)
+   14654:	ac490004 	sw	t1,4(v0)
+   14658:	ac460008 	sw	a2,8(v0)
+   1465c:	ac45000c 	sw	a1,12(v0)
+   14660:	1464fff6 	bne	v1,a0,1463c <sys_exec+0x228>
+   14664:	24420010 	addiu	v0,v0,16
+   14668:	8c650008 	lw	a1,8(v1)
+   1466c:	8c640000 	lw	a0,0(v1)
+   14670:	8c630004 	lw	v1,4(v1)
+   14674:	ac450008 	sw	a1,8(v0)
+   14678:	ac430004 	sw	v1,4(v0)
+   1467c:	ac440000 	sw	a0,0(v0)
+   14680:	27a300d8 	addiu	v1,sp,216
+   14684:	27a205cc 	addiu	v0,sp,1484
+   14688:	8ce90000 	lw	t1,0(a3)
+   1468c:	8ce60004 	lw	a2,4(a3)
+   14690:	8ce50008 	lw	a1,8(a3)
+   14694:	8ce4000c 	lw	a0,12(a3)
+   14698:	24e70010 	addiu	a3,a3,16
+   1469c:	ac490000 	sw	t1,0(v0)
+   146a0:	ac460004 	sw	a2,4(v0)
+   146a4:	ac450008 	sw	a1,8(v0)
+   146a8:	ac44000c 	sw	a0,12(v0)
+   146ac:	14e3fff6 	bne	a3,v1,14688 <sys_exec+0x274>
+   146b0:	24420010 	addiu	v0,v0,16
+   146b4:	8ce30004 	lw	v1,4(a3)
+   146b8:	8ce50008 	lw	a1,8(a3)
+   146bc:	8ce40000 	lw	a0,0(a3)
+   146c0:	ac430004 	sw	v1,4(v0)
+   146c4:	ac450008 	sw	a1,8(v0)
+   146c8:	ac440000 	sw	a0,0(v0)
+   146cc:	27a30114 	addiu	v1,sp,276
+   146d0:	27a20608 	addiu	v0,sp,1544
+   146d4:	8d070000 	lw	a3,0(t0)
+   146d8:	8d060004 	lw	a2,4(t0)
+   146dc:	8d050008 	lw	a1,8(t0)
+   146e0:	8d04000c 	lw	a0,12(t0)
+   146e4:	25080010 	addiu	t0,t0,16
+   146e8:	ac470000 	sw	a3,0(v0)
+   146ec:	ac460004 	sw	a2,4(v0)
+   146f0:	ac450008 	sw	a1,8(v0)
+   146f4:	ac44000c 	sw	a0,12(v0)
+   146f8:	1503fff6 	bne	t0,v1,146d4 <sys_exec+0x2c0>
+   146fc:	24420010 	addiu	v0,v0,16
+   14700:	8d0a0008 	lw	t2,8(t0)
+   14704:	8d090000 	lw	t1,0(t0)
+   14708:	8d030004 	lw	v1,4(t0)
+   1470c:	ac4a0008 	sw	t2,8(v0)
+   14710:	ac490000 	sw	t1,0(v0)
+   14714:	ac430004 	sw	v1,4(v0)
+   14718:	27a20348 	addiu	v0,sp,840
+   1471c:	afa20010 	sw	v0,16(sp)
+   14720:	27a2034c 	addiu	v0,sp,844
+   14724:	afa20014 	sw	v0,20(sp)
+   14728:	27a20350 	addiu	v0,sp,848
+   1472c:	afa20018 	sw	v0,24(sp)
+   14730:	27a20354 	addiu	v0,sp,852
+   14734:	afa2001c 	sw	v0,28(sp)
+   14738:	3c020000 	lui	v0,0x0
+   1473c:	2442046c 	addiu	v0,v0,1132
+   14740:	afa20020 	sw	v0,32(sp)
+   14744:	27b5004c 	addiu	s5,sp,76
+   14748:	3c020000 	lui	v0,0x0
+   1474c:	24420564 	addiu	v0,v0,1380
+   14750:	02402821 	addu	a1,s2,zero
+   14754:	02c03021 	addu	a2,s6,zero
+   14758:	02002021 	addu	a0,s0,zero
+   1475c:	02a03821 	addu	a3,s5,zero
+   14760:	0c0025be 	jal	96f8 <prepare_args>
+   14764:	afa20024 	sw	v0,36(sp)
+   14768:	144000de 	bnez	v0,14ae4 <sys_exec+0x6d0>
+   1476c:	afa20028 	sw	v0,40(sp)
+   14770:	02a02021 	addu	a0,s5,zero
+   14774:	0c004f82 	jal	13e08 <pages_to_ppns>
+   14778:	27a50358 	addiu	a1,sp,856
+   1477c:	27b2005c 	addiu	s2,sp,92
+   14780:	3c020022 	lui	v0,0x22
+   14784:	34420040 	ori	v0,v0,0x40
+   14788:	02402021 	addu	a0,s2,zero
+   1478c:	afa20064 	sw	v0,100(sp)
+   14790:	afa0005c 	sw	zero,92(sp)
+   14794:	0c00713f 	jal	1c4fc <kmem_alloc>
+   14798:	afa00060 	sw	zero,96(sp)
+   1479c:	1040004f 	beqz	v0,148dc <sys_exec+0x4c8>
+   147a0:	0040b821 	addu	s7,v0,zero
+   147a4:	02202021 	addu	a0,s1,zero
+   147a8:	0c000159 	jal	564 <cpu_uspace_strlen>
+   147ac:	27a50038 	addiu	a1,sp,56
+   147b0:	14400007 	bnez	v0,147d0 <sys_exec+0x3bc>
+   147b4:	0040b021 	addu	s6,v0,zero
+   147b8:	8fa20038 	lw	v0,56(sp)
+   147bc:	24420001 	addiu	v0,v0,1
+   147c0:	2c431000 	sltiu	v1,v0,4096
+   147c4:	14600047 	bnez	v1,148e4 <sys_exec+0x4d0>
+   147c8:	afa20038 	sw	v0,56(sp)
+   147cc:	24160007 	addiu	s6,zero,7
+   147d0:	02402021 	addu	a0,s2,zero
+   147d4:	0c007134 	jal	1c4d0 <kmem_free>
+   147d8:	afb70068 	sw	s7,104(sp)
+   147dc:	3c130004 	lui	s3,0x4
+   147e0:	3c140003 	lui	s4,0x3
+   147e4:	3c110003 	lui	s1,0x3
+   147e8:	8e649100 	lw	a0,-28416(s3)
+   147ec:	00002821 	addu	a1,zero,zero
+   147f0:	26866080 	addiu	a2,s4,24704
+   147f4:	262760a0 	addiu	a3,s1,24736
+   147f8:	afb60010 	sw	s6,16(sp)
+   147fc:	0c0009b0 	jal	26c0 <__fprintk>
+   14800:	afb60028 	sw	s6,40(sp)
+   14804:	0c00238b 	jal	8e2c <free_args>
+   14808:	02a02021 	addu	a0,s5,zero
+   1480c:	8fa2002c 	lw	v0,44(sp)
+   14810:	1440002d 	bnez	v0,148c8 <sys_exec+0x4b4>
+   14814:	00000000 	sll	zero,zero,0x0
+   14818:	08005214 	j	14850 <sys_exec+0x43c>
+   1481c:	8fa20028 	lw	v0,40(sp)
+   14820:	8e0205c4 	lw	v0,1476(s0)
+   14824:	8e649100 	lw	a0,-28416(s3)
+   14828:	3c110003 	lui	s1,0x3
+   1482c:	3c060003 	lui	a2,0x3
+   14830:	24c66044 	addiu	a2,a2,24644
+   14834:	00002821 	addu	a1,zero,zero
+   14838:	262760a0 	addiu	a3,s1,24736
+   1483c:	0c0009b0 	jal	26c0 <__fprintk>
+   14840:	afa20010 	sw	v0,16(sp)
+   14844:	2402000d 	addiu	v0,zero,13
+   14848:	afa20028 	sw	v0,40(sp)
+   1484c:	3c140003 	lui	s4,0x3
+   14850:	8e649100 	lw	a0,-28416(s3)
+   14854:	26866080 	addiu	a2,s4,24704
+   14858:	262760a0 	addiu	a3,s1,24736
+   1485c:	00002821 	addu	a1,zero,zero
+   14860:	0c0009b0 	jal	26c0 <__fprintk>
+   14864:	afa20010 	sw	v0,16(sp)
+   14868:	40022002 	mfc0	v0,$4,2
+   1486c:	8fa30028 	lw	v1,40(sp)
+   14870:	8fbf0684 	lw	ra,1668(sp)
+   14874:	ac430258 	sw	v1,600(v0)
+   14878:	24020002 	addiu	v0,zero,2
+   1487c:	ae0205d0 	sw	v0,1488(s0)
+   14880:	8fbe0680 	lw	s8,1664(sp)
+   14884:	2402ffff 	addiu	v0,zero,-1
+   14888:	8fb7067c 	lw	s7,1660(sp)
+   1488c:	8fb60678 	lw	s6,1656(sp)
+   14890:	8fb50674 	lw	s5,1652(sp)
+   14894:	8fb40670 	lw	s4,1648(sp)
+   14898:	8fb3066c 	lw	s3,1644(sp)
+   1489c:	8fb20668 	lw	s2,1640(sp)
+   148a0:	8fb10664 	lw	s1,1636(sp)
+   148a4:	8fb00660 	lw	s0,1632(sp)
+   148a8:	03e00008 	jr	ra
+   148ac:	27bd0688 	addiu	sp,sp,1672
+   148b0:	24020016 	addiu	v0,zero,22
+   148b4:	afa20028 	sw	v0,40(sp)
+   148b8:	3c130004 	lui	s3,0x4
+   148bc:	3c110003 	lui	s1,0x3
+   148c0:	08005214 	j	14850 <sys_exec+0x43c>
+   148c4:	3c140003 	lui	s4,0x3
+   148c8:	40042002 	mfc0	a0,$4,2
+   148cc:	0c0046e4 	jal	11b90 <sched_exit>
+   148d0:	00000000 	sll	zero,zero,0x0
+   148d4:	08005214 	j	14850 <sys_exec+0x43c>
+   148d8:	8fa20028 	lw	v0,40(sp)
+   148dc:	080051f7 	j	147dc <sys_exec+0x3c8>
+   148e0:	2416000c 	addiu	s6,zero,12
+   148e4:	0c007c15 	jal	1f054 <ppm_page2addr>
+   148e8:	02e02021 	addu	a0,s7,zero
+   148ec:	8fa60038 	lw	a2,56(sp)
+   148f0:	02202821 	addu	a1,s1,zero
+   148f4:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   148f8:	00402021 	addu	a0,v0,zero
+   148fc:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   14900:	02e02021 	addu	a0,s7,zero
+   14904:	afa20368 	sw	v0,872(sp)
+   14908:	8e1605c4 	lw	s6,1476(s0)
+   1490c:	afa00028 	sw	zero,40(sp)
+   14910:	0016b282 	srl	s6,s6,0xa
+   14914:	40022002 	mfc0	v0,$4,2
+   14918:	8c420174 	lw	v0,372(v0)
+   1491c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   14920:	8c510000 	lw	s1,0(v0)
+   14924:	70563802 	mul	a3,v0,s6
+   14928:	24060004 	addiu	a2,zero,4
+   1492c:	27a30028 	addiu	v1,sp,40
+   14930:	27a5002c 	addiu	a1,sp,44
+   14934:	24020310 	addiu	v0,zero,784
+   14938:	afa60048 	sw	a2,72(sp)
+   1493c:	afa20034 	sw	v0,52(sp)
+   14940:	afa60044 	sw	a2,68(sp)
+   14944:	00f12021 	addu	a0,a3,s1
+   14948:	afa3003c 	sw	v1,60(sp)
+   1494c:	afa50040 	sw	a1,64(sp)
+   14950:	afb40030 	sw	s4,48(sp)
+   14954:	40022002 	mfc0	v0,$4,2
+   14958:	8c420174 	lw	v0,372(v0)
+   1495c:	8c420004 	lw	v0,4(v0)
+   14960:	1044002d 	beq	v0,a0,14a18 <sys_exec+0x604>
+   14964:	3c070001 	lui	a3,0x1
+   14968:	24020002 	addiu	v0,zero,2
+   1496c:	afa20010 	sw	v0,16(sp)
+   14970:	24020001 	addiu	v0,zero,1
+   14974:	afa20014 	sw	v0,20(sp)
+   14978:	27a2003c 	addiu	v0,sp,60
+   1497c:	afa20018 	sw	v0,24(sp)
+   14980:	27a20044 	addiu	v0,sp,68
+   14984:	afa2001c 	sw	v0,28(sp)
+   14988:	27a20030 	addiu	v0,sp,48
+   1498c:	afa20020 	sw	v0,32(sp)
+   14990:	24e742c8 	addiu	a3,a3,17096
+   14994:	27a20034 	addiu	v0,sp,52
+   14998:	00002821 	addu	a1,zero,zero
+   1499c:	00003021 	addu	a2,zero,zero
+   149a0:	0c003de8 	jal	f7a0 <rppc_generic>
+   149a4:	afa20024 	sw	v0,36(sp)
+   149a8:	8fa30028 	lw	v1,40(sp)
+   149ac:	00431025 	or	v0,v0,v1
+   149b0:	14400035 	bnez	v0,14a88 <sys_exec+0x674>
+   149b4:	afa20028 	sw	v0,40(sp)
+   149b8:	3c020004 	lui	v0,0x4
+   149bc:	2443c960 	addiu	v1,v0,-13984
+   149c0:	88630003 	lwl	v1,3(v1)
+   149c4:	8e0405c4 	lw	a0,1476(s0)
+   149c8:	9843c960 	lwr	v1,-13984(v0)
+   149cc:	00041282 	srl	v0,a0,0xa
+   149d0:	3063ffff 	andi	v1,v1,0xffff
+   149d4:	10430015 	beq	v0,v1,14a2c <sys_exec+0x618>
+   149d8:	00000000 	sll	zero,zero,0x0
+   149dc:	0c00469a 	jal	11a68 <sched_remove>
+   149e0:	40042002 	mfc0	a0,$4,2
+   149e4:	8fbf0684 	lw	ra,1668(sp)
+   149e8:	00001021 	addu	v0,zero,zero
+   149ec:	8fbe0680 	lw	s8,1664(sp)
+   149f0:	8fb7067c 	lw	s7,1660(sp)
+   149f4:	8fb60678 	lw	s6,1656(sp)
+   149f8:	8fb50674 	lw	s5,1652(sp)
+   149fc:	8fb40670 	lw	s4,1648(sp)
+   14a00:	8fb3066c 	lw	s3,1644(sp)
+   14a04:	8fb20668 	lw	s2,1640(sp)
+   14a08:	8fb10664 	lw	s1,1636(sp)
+   14a0c:	8fb00660 	lw	s0,1632(sp)
+   14a10:	03e00008 	jr	ra
+   14a14:	27bd0688 	addiu	sp,sp,1672
+   14a18:	00602021 	addu	a0,v1,zero
+   14a1c:	0c0050ee 	jal	143b8 <__sys_exec_local>
+   14a20:	02803021 	addu	a2,s4,zero
+   14a24:	0800526a 	j	149a8 <sys_exec+0x594>
+   14a28:	00001021 	addu	v0,zero,zero
+   14a2c:	0c0061d9 	jal	18764 <tasks_manager_lock>
+   14a30:	00000000 	sll	zero,zero,0x0
+   14a34:	0c0061d6 	jal	18758 <tasks_manager_unlock>
+   14a38:	ae1305d0 	sw	s3,1488(s0)
+   14a3c:	40022002 	mfc0	v0,$4,2
+   14a40:	8c430134 	lw	v1,308(v0)
+   14a44:	34630004 	ori	v1,v1,0x4
+   14a48:	ac430134 	sw	v1,308(v0)
+   14a4c:	0c0046e4 	jal	11b90 <sched_exit>
+   14a50:	40042002 	mfc0	a0,$4,2
+   14a54:	8fbf0684 	lw	ra,1668(sp)
+   14a58:	00001021 	addu	v0,zero,zero
+   14a5c:	8fbe0680 	lw	s8,1664(sp)
+   14a60:	8fb7067c 	lw	s7,1660(sp)
+   14a64:	8fb60678 	lw	s6,1656(sp)
+   14a68:	8fb50674 	lw	s5,1652(sp)
+   14a6c:	8fb40670 	lw	s4,1648(sp)
+   14a70:	8fb3066c 	lw	s3,1644(sp)
+   14a74:	8fb20668 	lw	s2,1640(sp)
+   14a78:	8fb10664 	lw	s1,1636(sp)
+   14a7c:	8fb00660 	lw	s0,1632(sp)
+   14a80:	03e00008 	jr	ra
+   14a84:	27bd0688 	addiu	sp,sp,1672
+   14a88:	3c130004 	lui	s3,0x4
+   14a8c:	8e649100 	lw	a0,-28416(s3)
+   14a90:	3c140003 	lui	s4,0x3
+   14a94:	3c110003 	lui	s1,0x3
+   14a98:	26866080 	addiu	a2,s4,24704
+   14a9c:	262760a0 	addiu	a3,s1,24736
+   14aa0:	00002821 	addu	a1,zero,zero
+   14aa4:	0c0009b0 	jal	26c0 <__fprintk>
+   14aa8:	afa20010 	sw	v0,16(sp)
+   14aac:	8fa50368 	lw	a1,872(sp)
+   14ab0:	3c040004 	lui	a0,0x4
+   14ab4:	0c007c41 	jal	1f104 <ppm_ppn2page>
+   14ab8:	24846e60 	addiu	a0,a0,28256
+   14abc:	afa20068 	sw	v0,104(sp)
+   14ac0:	3c020022 	lui	v0,0x22
+   14ac4:	34420040 	ori	v0,v0,0x40
+   14ac8:	02402021 	addu	a0,s2,zero
+   14acc:	afa20064 	sw	v0,100(sp)
+   14ad0:	afa0005c 	sw	zero,92(sp)
+   14ad4:	0c007134 	jal	1c4d0 <kmem_free>
+   14ad8:	afa00060 	sw	zero,96(sp)
+   14adc:	08005201 	j	14804 <sys_exec+0x3f0>
+   14ae0:	00000000 	sll	zero,zero,0x0
+   14ae4:	3c130004 	lui	s3,0x4
+   14ae8:	3c110003 	lui	s1,0x3
+   14aec:	08005214 	j	14850 <sys_exec+0x43c>
+   14af0:	3c140003 	lui	s4,0x3
+   14af4:	27bdff88 	addiu	sp,sp,-120
+   14af8:	8c820014 	lw	v0,20(a0)
+   14afc:	afb50070 	sw	s5,112(sp)
+   14b00:	3c150001 	lui	s5,0x1
+   14b04:	00551821 	addu	v1,v0,s5
+   14b08:	afb10060 	sw	s1,96(sp)
+   14b0c:	00808821 	addu	s1,a0,zero
+   14b10:	8c648328 	lw	a0,-31960(v1)
+   14b14:	afb30068 	sw	s3,104(sp)
+   14b18:	8c930400 	lw	s3,1024(a0)
+   14b1c:	96230060 	lhu	v1,96(s1)
+   14b20:	afb3002c 	sw	s3,44(sp)
+   14b24:	8c420000 	lw	v0,0(v0)
+   14b28:	24060001 	addiu	a2,zero,1
+   14b2c:	00402821 	addu	a1,v0,zero
+   14b30:	02602021 	addu	a0,s3,zero
+   14b34:	afbf0074 	sw	ra,116(sp)
+   14b38:	afb0005c 	sw	s0,92(sp)
+   14b3c:	afa30030 	sw	v1,48(sp)
+   14b40:	afa20034 	sw	v0,52(sp)
+   14b44:	afb4006c 	sw	s4,108(sp)
+   14b48:	afb20064 	sw	s2,100(sp)
+   14b4c:	0c0028ea 	jal	a3a8 <dqdt_update_threads_number>
+   14b50:	afa00018 	sw	zero,24(sp)
+   14b54:	27a40018 	addiu	a0,sp,24
+   14b58:	27a5002c 	addiu	a1,sp,44
+   14b5c:	0c00655a 	jal	19568 <task_create>
+   14b60:	3406fc11 	ori	a2,zero,0xfc11
+   14b64:	00408021 	addu	s0,v0,zero
+   14b68:	1440008d 	bnez	v0,14da0 <sys_exec+0x98c>
+   14b6c:	afb3002c 	sw	s3,44(sp)
+   14b70:	24030001 	addiu	v1,zero,1
+   14b74:	8e220010 	lw	v0,16(s1)
+   14b78:	afa30020 	sw	v1,32(sp)
+   14b7c:	27b4001c 	addiu	s4,sp,28
+   14b80:	3c030051 	lui	v1,0x51
+   14b84:	34630020 	ori	v1,v1,0x20
+   14b88:	02802021 	addu	a0,s4,zero
+   14b8c:	afa30024 	sw	v1,36(sp)
+   14b90:	afa20028 	sw	v0,40(sp)
+   14b94:	0c00713f 	jal	1c4fc <kmem_alloc>
+   14b98:	afa0001c 	sw	zero,28(sp)
+   14b9c:	1040007f 	beqz	v0,14d9c <sys_exec+0x988>
+   14ba0:	00409821 	addu	s3,v0,zero
+   14ba4:	8fa40018 	lw	a0,24(sp)
+   14ba8:	0c006459 	jal	19164 <task_dup>
+   14bac:	8e25000c 	lw	a1,12(s1)
+   14bb0:	144000a0 	bnez	v0,14e34 <sys_exec+0xa20>
+   14bb4:	00408021 	addu	s0,v0,zero
+   14bb8:	0c004994 	jal	12650 <signal_manager_init>
+   14bbc:	8fa40018 	lw	a0,24(sp)
+   14bc0:	8fa40018 	lw	a0,24(sp)
+   14bc4:	8e220010 	lw	v0,16(s1)
+   14bc8:	8e25000c 	lw	a1,12(s1)
+   14bcc:	ac8202e8 	sw	v0,744(a0)
+   14bd0:	24a50180 	addiu	a1,a1,384
+   14bd4:	0c0085f7 	jal	217dc <vmm_dup>
+   14bd8:	24840180 	addiu	a0,a0,384
+   14bdc:	14400095 	bnez	v0,14e34 <sys_exec+0xa20>
+   14be0:	00408021 	addu	s0,v0,zero
+   14be4:	0c007c15 	jal	1f054 <ppm_page2addr>
+   14be8:	02602021 	addu	a0,s3,zero
+   14bec:	8e260014 	lw	a2,20(s1)
+   14bf0:	00409021 	addu	s2,v0,zero
+   14bf4:	00d5a821 	addu	s5,a2,s5
+   14bf8:	8ea78328 	lw	a3,-31960(s5)
+   14bfc:	8e220008 	lw	v0,8(s1)
+   14c00:	8fa40018 	lw	a0,24(sp)
+   14c04:	ae530388 	sw	s3,904(s2)
+   14c08:	02402821 	addu	a1,s2,zero
+   14c0c:	0c006948 	jal	1a520 <thread_dup>
+   14c10:	afa20010 	sw	v0,16(sp)
+   14c14:	14400087 	bnez	v0,14e34 <sys_exec+0xa20>
+   14c18:	00408021 	addu	s0,v0,zero
+   14c1c:	8e220054 	lw	v0,84(s1)
+   14c20:	30430004 	andi	v1,v0,0x4
+   14c24:	1060001b 	beqz	v1,14c94 <sys_exec+0x880>
+   14c28:	2404fffc 	addiu	a0,zero,-4
+   14c2c:	8e430304 	lw	v1,772(s2)
+   14c30:	00441024 	and	v0,v0,a0
+   14c34:	00431025 	or	v0,v0,v1
+   14c38:	ae420304 	sw	v0,772(s2)
+   14c3c:	8e230054 	lw	v1,84(s1)
+   14c40:	30640008 	andi	a0,v1,0x8
+   14c44:	14800005 	bnez	a0,14c5c <sys_exec+0x848>
+   14c48:	00000000 	sll	zero,zero,0x0
+   14c4c:	2403fff7 	addiu	v1,zero,-9
+   14c50:	00431024 	and	v0,v0,v1
+   14c54:	ae420304 	sw	v0,772(s2)
+   14c58:	8e230054 	lw	v1,84(s1)
+   14c5c:	30620040 	andi	v0,v1,0x40
+   14c60:	14400007 	bnez	v0,14c80 <sys_exec+0x86c>
+   14c64:	30630080 	andi	v1,v1,0x80
+   14c68:	8e430304 	lw	v1,772(s2)
+   14c6c:	2402ffbf 	addiu	v0,zero,-65
+   14c70:	00621024 	and	v0,v1,v0
+   14c74:	ae420304 	sw	v0,772(s2)
+   14c78:	8e230054 	lw	v1,84(s1)
+   14c7c:	30630080 	andi	v1,v1,0x80
+   14c80:	14600004 	bnez	v1,14c94 <sys_exec+0x880>
+   14c84:	2402ff7f 	addiu	v0,zero,-129
+   14c88:	8e430304 	lw	v1,772(s2)
+   14c8c:	00621024 	and	v0,v1,v0
+   14c90:	ae420304 	sw	v0,772(s2)
+   14c94:	8e22005c 	lw	v0,92(s1)
+   14c98:	10400073 	beqz	v0,14e68 <sys_exec+0xa54>
+   14c9c:	2402ffbf 	addiu	v0,zero,-65
+   14ca0:	8e430134 	lw	v1,308(s2)
+   14ca4:	00621024 	and	v0,v1,v0
+   14ca8:	ae420134 	sw	v0,308(s2)
+   14cac:	8fa40018 	lw	a0,24(sp)
+   14cb0:	264501f0 	addiu	a1,s2,496
+   14cb4:	8c820748 	lw	v0,1864(a0)
+   14cb8:	8c860630 	lw	a2,1584(a0)
+   14cbc:	8c430000 	lw	v1,0(v0)
+   14cc0:	24c60001 	addiu	a2,a2,1
+   14cc4:	ac860630 	sw	a2,1584(a0)
+   14cc8:	24150001 	addiu	s5,zero,1
+   14ccc:	24060002 	addiu	a2,zero,2
+   14cd0:	ac8605d0 	sw	a2,1488(a0)
+   14cd4:	ae4301f0 	sw	v1,496(s2)
+   14cd8:	ae4201f4 	sw	v0,500(s2)
+   14cdc:	ac450000 	sw	a1,0(v0)
+   14ce0:	ac650004 	sw	a1,4(v1)
+   14ce4:	ac95062c 	sw	s5,1580(a0)
+   14ce8:	00002821 	addu	a1,zero,zero
+   14cec:	24840640 	addiu	a0,a0,1600
+   14cf0:	0c00b895 	jal	2e254 <bitmap_ffs2>
+   14cf4:	24060100 	addiu	a2,zero,256
+   14cf8:	2403ffff 	addiu	v1,zero,-1
+   14cfc:	1043004d 	beq	v0,v1,14e34 <sys_exec+0xa20>
+   14d00:	00022942 	srl	a1,v0,0x5
+   14d04:	8fa30018 	lw	v1,24(sp)
+   14d08:	24a50190 	addiu	a1,a1,400
+   14d0c:	00052880 	sll	a1,a1,0x2
+   14d10:	00652821 	addu	a1,v1,a1
+   14d14:	8ca40000 	lw	a0,0(a1)
+   14d18:	00553004 	sllv	a2,s5,v0
+   14d1c:	00063027 	nor	a2,zero,a2
+   14d20:	00c43024 	and	a2,a2,a0
+   14d24:	8e24000c 	lw	a0,12(s1)
+   14d28:	aca60000 	sw	a2,0(a1)
+   14d2c:	ae420300 	sw	v0,768(s2)
+   14d30:	ae4202f8 	sw	v0,760(s2)
+   14d34:	8c8605c4 	lw	a2,1476(a0)
+   14d38:	8c8405c8 	lw	a0,1480(a0)
+   14d3c:	24450001 	addiu	a1,v0,1
+   14d40:	ac650638 	sw	a1,1592(v1)
+   14d44:	ac6405c8 	sw	a0,1480(v1)
+   14d48:	ac660618 	sw	a2,1560(v1)
+   14d4c:	ac62063c 	sw	v0,1596(v1)
+   14d50:	26530298 	addiu	s3,s2,664
+   14d54:	0c004715 	jal	11c54 <sched_register>
+   14d58:	02402021 	addu	a0,s2,zero
+   14d5c:	02602021 	addu	a0,s3,zero
+   14d60:	0c0001cf 	jal	73c <cpu_context_set_tid>
+   14d64:	02402821 	addu	a1,s2,zero
+   14d68:	8fa50018 	lw	a1,24(sp)
+   14d6c:	02602021 	addu	a0,s3,zero
+   14d70:	0c0001d2 	jal	748 <cpu_context_set_pmm>
+   14d74:	24a50250 	addiu	a1,a1,592
+   14d78:	02602821 	addu	a1,s3,zero
+   14d7c:	0c0001dd 	jal	774 <cpu_context_dup_finlize>
+   14d80:	26440188 	addiu	a0,s2,392
+   14d84:	8fa20018 	lw	v0,24(sp)
+   14d88:	ae32004c 	sw	s2,76(s1)
+   14d8c:	ae220050 	sw	v0,80(s1)
+   14d90:	ae40025c 	sw	zero,604(s2)
+   14d94:	08005383 	j	14e0c <sys_exec+0x9f8>
+   14d98:	ae400258 	sw	zero,600(s2)
+   14d9c:	8fb3002c 	lw	s3,44(sp)
+   14da0:	3c120004 	lui	s2,0x4
+   14da4:	3c110003 	lui	s1,0x3
+   14da8:	8fa50034 	lw	a1,52(sp)
+   14dac:	02602021 	addu	a0,s3,zero
+   14db0:	0c0028ea 	jal	a3a8 <dqdt_update_threads_number>
+   14db4:	2406ffff 	addiu	a2,zero,-1
+   14db8:	8e449100 	lw	a0,-28416(s2)
+   14dbc:	3c060003 	lui	a2,0x3
+   14dc0:	24c660d0 	addiu	a2,a2,24784
+   14dc4:	00002821 	addu	a1,zero,zero
+   14dc8:	0c0009b0 	jal	26c0 <__fprintk>
+   14dcc:	2627613c 	addiu	a3,s1,24892
+   14dd0:	8fa40018 	lw	a0,24(sp)
+   14dd4:	10800003 	beqz	a0,14de4 <sys_exec+0x9d0>
+   14dd8:	00000000 	sll	zero,zero,0x0
+   14ddc:	0c0066f7 	jal	19bdc <task_destroy>
+   14de0:	00000000 	sll	zero,zero,0x0
+   14de4:	40024800 	mfc0	v0,c0_count
+   14de8:	00000000 	sll	zero,zero,0x0
+   14dec:	3c060003 	lui	a2,0x3
+   14df0:	8e449100 	lw	a0,-28416(s2)
+   14df4:	24c660f4 	addiu	a2,a2,24820
+   14df8:	2627613c 	addiu	a3,s1,24892
+   14dfc:	00002821 	addu	a1,zero,zero
+   14e00:	afa20014 	sw	v0,20(sp)
+   14e04:	0c0009b0 	jal	26c0 <__fprintk>
+   14e08:	afb00010 	sw	s0,16(sp)
+   14e0c:	8fbf0074 	lw	ra,116(sp)
+   14e10:	02001021 	addu	v0,s0,zero
+   14e14:	8fb50070 	lw	s5,112(sp)
+   14e18:	8fb4006c 	lw	s4,108(sp)
+   14e1c:	8fb30068 	lw	s3,104(sp)
+   14e20:	8fb20064 	lw	s2,100(sp)
+   14e24:	8fb10060 	lw	s1,96(sp)
+   14e28:	8fb0005c 	lw	s0,92(sp)
+   14e2c:	03e00008 	jr	ra
+   14e30:	27bd0078 	addiu	sp,sp,120
+   14e34:	3c120004 	lui	s2,0x4
+   14e38:	8e449100 	lw	a0,-28416(s2)
+   14e3c:	3c110003 	lui	s1,0x3
+   14e40:	3c060003 	lui	a2,0x3
+   14e44:	24c660ac 	addiu	a2,a2,24748
+   14e48:	00002821 	addu	a1,zero,zero
+   14e4c:	0c0009b0 	jal	26c0 <__fprintk>
+   14e50:	2627613c 	addiu	a3,s1,24892
+   14e54:	02802021 	addu	a0,s4,zero
+   14e58:	0c007134 	jal	1c4d0 <kmem_free>
+   14e5c:	afb30028 	sw	s3,40(sp)
+   14e60:	0800536a 	j	14da8 <sys_exec+0x994>
+   14e64:	8fb3002c 	lw	s3,44(sp)
+   14e68:	8e420134 	lw	v0,308(s2)
+   14e6c:	34420040 	ori	v0,v0,0x40
+   14e70:	0800532b 	j	14cac <sys_exec+0x898>
+   14e74:	ae420134 	sw	v0,308(s2)
+
+00014e78 <sys_fork>:
+   14e78:	27bdff38 	addiu	sp,sp,-200
+   14e7c:	afb400bc 	sw	s4,188(sp)
+   14e80:	afb200b4 	sw	s2,180(sp)
+   14e84:	afbf00c4 	sw	ra,196(sp)
+   14e88:	afb500c0 	sw	s5,192(sp)
+   14e8c:	afb300b8 	sw	s3,184(sp)
+   14e90:	afb100b0 	sw	s1,176(sp)
+   14e94:	afb000ac 	sw	s0,172(sp)
+   14e98:	00809021 	addu	s2,a0,zero
+   14e9c:	00a0a021 	addu	s4,a1,zero
+   14ea0:	40024800 	mfc0	v0,c0_count
+   14ea4:	00000000 	sll	zero,zero,0x0
+   14ea8:	40102002 	mfc0	s0,$4,2
+   14eac:	8e130180 	lw	s3,384(s0)
+   14eb0:	3c020004 	lui	v0,0x4
+   14eb4:	267105d4 	addiu	s1,s3,1492
+   14eb8:	24426db0 	addiu	v0,v0,28080
+   14ebc:	02202021 	addu	a0,s1,zero
+   14ec0:	24050001 	addiu	a1,zero,1
+   14ec4:	0c0019b9 	jal	66e4 <atomic_add>
+   14ec8:	afa2004c 	sw	v0,76(sp)
+   14ecc:	28420200 	slti	v0,v0,512
+   14ed0:	10400074 	beqz	v0,150a4 <sys_fork+0x22c>
+   14ed4:	3c020004 	lui	v0,0x4
+   14ed8:	afb00044 	sw	s0,68(sp)
+   14edc:	afa0003c 	sw	zero,60(sp)
+   14ee0:	afb30048 	sw	s3,72(sp)
+   14ee4:	afb20090 	sw	s2,144(sp)
+   14ee8:	40016000 	mfc0	at,c0_status
+   14eec:	00000000 	sll	zero,zero,0x0
+   14ef0:	00011825 	or	v1,zero,at
+   14ef4:	00010842 	srl	at,at,0x1
+   14ef8:	00010840 	sll	at,at,0x1
+   14efc:	40816000 	mtc0	at,c0_status
+   14f00:	40016000 	mfc0	at,c0_status
+   14f04:	340200ff 	ori	v0,zero,0xff
+   14f08:	00431024 	and	v0,v0,v1
+   14f0c:	00220825 	or	at,at,v0
+   14f10:	40816000 	mtc0	at,c0_status
+   14f14:	40022002 	mfc0	v0,$4,2
+   14f18:	8c430174 	lw	v1,372(v0)
+   14f1c:	3c020001 	lui	v0,0x1
+   14f20:	00621021 	addu	v0,v1,v0
+   14f24:	8c428324 	lw	v0,-31964(v0)
+   14f28:	10500074 	beq	v0,s0,150fc <sys_fork+0x284>
+   14f2c:	00000000 	sll	zero,zero,0x0
+   14f30:	32520002 	andi	s2,s2,0x2
+   14f34:	16400042 	bnez	s2,15040 <sys_fork+0x1c8>
+   14f38:	3c020008 	lui	v0,0x8
+   14f3c:	8c4426ec 	lw	a0,9964(v0)
+   14f40:	27a50010 	addiu	a1,sp,16
+   14f44:	2402ffff 	addiu	v0,zero,-1
+   14f48:	afa20018 	sw	v0,24(sp)
+   14f4c:	afa00098 	sw	zero,152(sp)
+   14f50:	afa20010 	sw	v0,16(sp)
+   14f54:	afa00030 	sw	zero,48(sp)
+   14f58:	afa0001c 	sw	zero,28(sp)
+   14f5c:	0c002913 	jal	a44c <dqdt_task_placement>
+   14f60:	3c120004 	lui	s2,0x4
+   14f64:	8fa40018 	lw	a0,24(sp)
+   14f68:	2655c960 	addiu	s5,s2,-13984
+   14f6c:	0c00207a 	jal	81e8 <cpu_lid2ptr>
+   14f70:	00000000 	sll	zero,zero,0x0
+   14f74:	8aa30003 	lwl	v1,3(s5)
+   14f78:	8e6505c4 	lw	a1,1476(s3)
+   14f7c:	9a43c960 	lwr	v1,-13984(s2)
+   14f80:	afa20050 	sw	v0,80(sp)
+   14f84:	3063ffff 	andi	v1,v1,0xffff
+   14f88:	00032280 	sll	a0,v1,0xa
+   14f8c:	24840002 	addiu	a0,a0,2
+   14f90:	8fa20014 	lw	v0,20(sp)
+   14f94:	00a4202b 	sltu	a0,a1,a0
+   14f98:	10800004 	beqz	a0,14fac <sys_fork+0x134>
+   14f9c:	a7a2009c 	sh	v0,156(sp)
+   14fa0:	14600002 	bnez	v1,14fac <sys_fork+0x134>
+   14fa4:	00000000 	sll	zero,zero,0x0
+   14fa8:	a7a0009c 	sh	zero,156(sp)
+   14fac:	40024800 	mfc0	v0,c0_count
+   14fb0:	00000000 	sll	zero,zero,0x0
+   14fb4:	0c0052bd 	jal	14af4 <sys_exec+0x6e0>
+   14fb8:	27a4003c 	addiu	a0,sp,60
+   14fbc:	00409021 	addu	s2,v0,zero
+   14fc0:	40024800 	mfc0	v0,c0_count
+   14fc4:	00000000 	sll	zero,zero,0x0
+   14fc8:	16400037 	bnez	s2,150a8 <sys_fork+0x230>
+   14fcc:	3c020004 	lui	v0,0x4
+   14fd0:	26710090 	addiu	s1,s3,144
+   14fd4:	8fb0008c 	lw	s0,140(sp)
+   14fd8:	02202021 	addu	a0,s1,zero
+   14fdc:	0c004bc3 	jal	12f0c <spinlock_lock>
+   14fe0:	8fb20088 	lw	s2,136(sp)
+   14fe4:	8e62061c 	lw	v0,1564(s3)
+   14fe8:	26030624 	addiu	v1,s0,1572
+   14fec:	2664061c 	addiu	a0,s3,1564
+   14ff0:	ae040628 	sw	a0,1576(s0)
+   14ff4:	ae63061c 	sw	v1,1564(s3)
+   14ff8:	ac430004 	sw	v1,4(v0)
+   14ffc:	ae020624 	sw	v0,1572(s0)
+   15000:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   15004:	02202021 	addu	a0,s1,zero
+   15008:	0c0046cb 	jal	11b2c <sched_add_created>
+   1500c:	02402021 	addu	a0,s2,zero
+   15010:	40024800 	mfc0	v0,c0_count
+   15014:	00000000 	sll	zero,zero,0x0
+   15018:	8fbf00c4 	lw	ra,196(sp)
+   1501c:	8e0205c4 	lw	v0,1476(s0)
+   15020:	8fb500c0 	lw	s5,192(sp)
+   15024:	8fb400bc 	lw	s4,188(sp)
+   15028:	8fb300b8 	lw	s3,184(sp)
+   1502c:	8fb200b4 	lw	s2,180(sp)
+   15030:	8fb100b0 	lw	s1,176(sp)
+   15034:	8fb000ac 	lw	s0,172(sp)
+   15038:	03e00008 	jr	ra
+   1503c:	27bd00c8 	addiu	sp,sp,200
+   15040:	0c00056c 	jal	15b0 <arch_onln_cpu_nr>
+   15044:	3c120004 	lui	s2,0x4
+   15048:	0282001b 	divu	zero,s4,v0
+   1504c:	004001f4 	teq	v0,zero,0x7
+   15050:	2655c960 	addiu	s5,s2,-13984
+   15054:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   15058:	0000a010 	mfhi	s4
+   1505c:	0282001b 	divu	zero,s4,v0
+   15060:	004001f4 	teq	v0,zero,0x7
+   15064:	00002010 	mfhi	a0
+   15068:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1506c:	afa400a0 	sw	a0,160(sp)
+   15070:	0282001b 	divu	zero,s4,v0
+   15074:	004001f4 	teq	v0,zero,0x7
+   15078:	8aa30003 	lwl	v1,3(s5)
+   1507c:	8fa400a0 	lw	a0,160(sp)
+   15080:	9a43c960 	lwr	v1,-13984(s2)
+   15084:	24050001 	addiu	a1,zero,1
+   15088:	3063ffff 	andi	v1,v1,0xffff
+   1508c:	afa50098 	sw	a1,152(sp)
+   15090:	afa30010 	sw	v1,16(sp)
+   15094:	afa40018 	sw	a0,24(sp)
+   15098:	0000a012 	mflo	s4
+   1509c:	080053db 	j	14f6c <sys_fork+0xf4>
+   150a0:	afb40014 	sw	s4,20(sp)
+   150a4:	2412000b 	addiu	s2,zero,11
+   150a8:	8c449100 	lw	a0,-28416(v0)
+   150ac:	3c060003 	lui	a2,0x3
+   150b0:	3c070003 	lui	a3,0x3
+   150b4:	24c66114 	addiu	a2,a2,24852
+   150b8:	24e76130 	addiu	a3,a3,24880
+   150bc:	0c0009b0 	jal	26c0 <__fprintk>
+   150c0:	00002821 	addu	a1,zero,zero
+   150c4:	02202021 	addu	a0,s1,zero
+   150c8:	0c0019b9 	jal	66e4 <atomic_add>
+   150cc:	2405ffff 	addiu	a1,zero,-1
+   150d0:	8fbf00c4 	lw	ra,196(sp)
+   150d4:	ae120258 	sw	s2,600(s0)
+   150d8:	2402ffff 	addiu	v0,zero,-1
+   150dc:	8fb500c0 	lw	s5,192(sp)
+   150e0:	8fb400bc 	lw	s4,188(sp)
+   150e4:	8fb300b8 	lw	s3,184(sp)
+   150e8:	8fb200b4 	lw	s2,180(sp)
+   150ec:	8fb100b0 	lw	s1,176(sp)
+   150f0:	8fb000ac 	lw	s0,172(sp)
+   150f4:	03e00008 	jr	ra
+   150f8:	27bd00c8 	addiu	sp,sp,200
+   150fc:	0c00cc61 	jal	33184 <cpu_fpu_context_save>
+   15100:	02002021 	addu	a0,s0,zero
+   15104:	080053cd 	j	14f34 <sys_fork+0xbc>
+   15108:	32520002 	andi	s2,s2,0x2
+
+0001510c <fork_event_handler>:
+   1510c:	27bdff78 	addiu	sp,sp,-136
+   15110:	afbf0084 	sw	ra,132(sp)
+   15114:	afb10080 	sw	s1,128(sp)
+   15118:	afb0007c 	sw	s0,124(sp)
+   1511c:	40114800 	mfc0	s1,c0_count
+   15120:	00000000 	sll	zero,zero,0x0
+   15124:	8c900008 	lw	s0,8(a0)
+   15128:	27a40010 	addiu	a0,sp,16
+   1512c:	8e070008 	lw	a3,8(s0)
+   15130:	8e06000c 	lw	a2,12(s0)
+   15134:	8e050014 	lw	a1,20(s0)
+   15138:	8e03005c 	lw	v1,92(s0)
+   1513c:	8e020054 	lw	v0,84(s0)
+   15140:	afa70018 	sw	a3,24(sp)
+   15144:	afa6001c 	sw	a2,28(sp)
+   15148:	afa50024 	sw	a1,36(sp)
+   1514c:	afa3006c 	sw	v1,108(sp)
+   15150:	afa20064 	sw	v0,100(sp)
+   15154:	afa0005c 	sw	zero,92(sp)
+   15158:	0c0052bd 	jal	14af4 <sys_exec+0x6e0>
+   1515c:	afa00060 	sw	zero,96(sp)
+   15160:	40034800 	mfc0	v1,c0_count
+   15164:	00000000 	sll	zero,zero,0x0
+   15168:	ae020004 	sw	v0,4(s0)
+   1516c:	8fa2005c 	lw	v0,92(sp)
+   15170:	00718823 	subu	s1,v1,s1
+   15174:	ae02004c 	sw	v0,76(s0)
+   15178:	8fa20060 	lw	v0,96(sp)
+   1517c:	ae110058 	sw	s1,88(s0)
+   15180:	ae020050 	sw	v0,80(s0)
+   15184:	0000000f 	sync
+   15188:	24020001 	addiu	v0,zero,1
+   1518c:	ae020000 	sw	v0,0(s0)
+   15190:	0000000f 	sync
+   15194:	8fbf0084 	lw	ra,132(sp)
+   15198:	00001021 	addu	v0,zero,zero
+   1519c:	8fb10080 	lw	s1,128(sp)
+   151a0:	8fb0007c 	lw	s0,124(sp)
+   151a4:	03e00008 	jr	ra
+   151a8:	27bd0088 	addiu	sp,sp,136
+
+000151ac <sys_fsync>:
+   151ac:	03e00008 	jr	ra
+   151b0:	00001021 	addu	v0,zero,zero
+
+000151b4 <sys_ftime>:
+   151b4:	27bdffd8 	addiu	sp,sp,-40
+   151b8:	afb00020 	sw	s0,32(sp)
+   151bc:	afbf0024 	sw	ra,36(sp)
+   151c0:	10800008 	beqz	a0,151e4 <sys_ftime+0x30>
+   151c4:	00808021 	addu	s0,a0,zero
+   151c8:	28824000 	slti	v0,a0,16384
+   151cc:	14400005 	bnez	v0,151e4 <sys_ftime+0x30>
+   151d0:	3c028000 	lui	v0,0x8000
+   151d4:	34420001 	ori	v0,v0,0x1
+   151d8:	0082102b 	sltu	v0,a0,v0
+   151dc:	14400008 	bnez	v0,15200 <sys_ftime+0x4c>
+   151e0:	00000000 	sll	zero,zero,0x0
+   151e4:	24020016 	addiu	v0,zero,22
+   151e8:	40032002 	mfc0	v1,$4,2
+   151ec:	8fbf0024 	lw	ra,36(sp)
+   151f0:	8fb00020 	lw	s0,32(sp)
+   151f4:	ac620258 	sw	v0,600(v1)
+   151f8:	03e00008 	jr	ra
+   151fc:	27bd0028 	addiu	sp,sp,40
+   15200:	40022002 	mfc0	v0,$4,2
+   15204:	0c001ff5 	jal	7fd4 <cpu_get_ms>
+   15208:	8c440174 	lw	a0,372(v0)
+   1520c:	3c031062 	lui	v1,0x1062
+   15210:	34634dd3 	ori	v1,v1,0x4dd3
+   15214:	00430019 	multu	v0,v1
+   15218:	02002021 	addu	a0,s0,zero
+   1521c:	00001810 	mfhi	v1
+   15220:	00031982 	srl	v1,v1,0x6
+   15224:	000331c0 	sll	a2,v1,0x7
+   15228:	00032880 	sll	a1,v1,0x2
+   1522c:	00c52823 	subu	a1,a2,a1
+   15230:	00a31821 	addu	v1,a1,v1
+   15234:	000318c0 	sll	v1,v1,0x3
+   15238:	00431023 	subu	v0,v0,v1
+   1523c:	a7a20014 	sh	v0,20(sp)
+   15240:	24020078 	addiu	v0,zero,120
+   15244:	a7a20016 	sh	v0,22(sp)
+   15248:	27a50010 	addiu	a1,sp,16
+   1524c:	2406000c 	addiu	a2,zero,12
+   15250:	24020001 	addiu	v0,zero,1
+   15254:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   15258:	afa20010 	sw	v0,16(sp)
+   1525c:	40032002 	mfc0	v1,$4,2
+   15260:	8fbf0024 	lw	ra,36(sp)
+   15264:	8fb00020 	lw	s0,32(sp)
+   15268:	ac620258 	sw	v0,600(v1)
+   1526c:	03e00008 	jr	ra
+   15270:	27bd0028 	addiu	sp,sp,40
+
+00015274 <sys_getcwd>:
+   15274:	27bdffb8 	addiu	sp,sp,-72
+   15278:	afb10034 	sw	s1,52(sp)
+   1527c:	afb00030 	sw	s0,48(sp)
+   15280:	afbf0044 	sw	ra,68(sp)
+   15284:	afb40040 	sw	s4,64(sp)
+   15288:	afb3003c 	sw	s3,60(sp)
+   1528c:	afb20038 	sw	s2,56(sp)
+   15290:	00808021 	addu	s0,a0,zero
+   15294:	00a08821 	addu	s1,a1,zero
+   15298:	40122002 	mfc0	s2,$4,2
+   1529c:	40032002 	mfc0	v1,$4,2
+   152a0:	2ca200ff 	sltiu	v0,a1,255
+   152a4:	14400014 	bnez	v0,152f8 <sys_getcwd+0x84>
+   152a8:	8c730180 	lw	s3,384(v1)
+   152ac:	10800012 	beqz	a0,152f8 <sys_getcwd+0x84>
+   152b0:	3c040003 	lui	a0,0x3
+   152b4:	24846144 	addiu	a0,a0,24900
+   152b8:	02602821 	addu	a1,s3,zero
+   152bc:	02003021 	addu	a2,s0,zero
+   152c0:	0c008099 	jal	20264 <vmm_check_address>
+   152c4:	02203821 	addu	a3,s1,zero
+   152c8:	10400016 	beqz	v0,15324 <sys_getcwd+0xb0>
+   152cc:	8fbf0044 	lw	ra,68(sp)
+   152d0:	2411000e 	addiu	s1,zero,14
+   152d4:	ae510258 	sw	s1,600(s2)
+   152d8:	02001021 	addu	v0,s0,zero
+   152dc:	8fb40040 	lw	s4,64(sp)
+   152e0:	8fb3003c 	lw	s3,60(sp)
+   152e4:	8fb20038 	lw	s2,56(sp)
+   152e8:	8fb10034 	lw	s1,52(sp)
+   152ec:	8fb00030 	lw	s0,48(sp)
+   152f0:	03e00008 	jr	ra
+   152f4:	27bd0048 	addiu	sp,sp,72
+   152f8:	8fbf0044 	lw	ra,68(sp)
+   152fc:	24110022 	addiu	s1,zero,34
+   15300:	ae510258 	sw	s1,600(s2)
+   15304:	02001021 	addu	v0,s0,zero
+   15308:	8fb40040 	lw	s4,64(sp)
+   1530c:	8fb3003c 	lw	s3,60(sp)
+   15310:	8fb20038 	lw	s2,56(sp)
+   15314:	8fb10034 	lw	s1,52(sp)
+   15318:	8fb00030 	lw	s0,48(sp)
+   1531c:	03e00008 	jr	ra
+   15320:	27bd0048 	addiu	sp,sp,72
+   15324:	3c020001 	lui	v0,0x1
+   15328:	2442bfc0 	addiu	v0,v0,-16448
+   1532c:	afa20018 	sw	v0,24(sp)
+   15330:	3c020001 	lui	v0,0x1
+   15334:	2442bf38 	addiu	v0,v0,-16584
+   15338:	afa2001c 	sw	v0,28(sp)
+   1533c:	3c020001 	lui	v0,0x1
+   15340:	2442be2c 	addiu	v0,v0,-16852
+   15344:	afa20024 	sw	v0,36(sp)
+   15348:	3c020001 	lui	v0,0x1
+   1534c:	2442bd0c 	addiu	v0,v0,-17140
+   15350:	267400b0 	addiu	s4,s3,176
+   15354:	afa20020 	sw	v0,32(sp)
+   15358:	3c020001 	lui	v0,0x1
+   1535c:	02802021 	addu	a0,s4,zero
+   15360:	2442bc80 	addiu	v0,v0,-17280
+   15364:	afb10014 	sw	s1,20(sp)
+   15368:	afb00010 	sw	s0,16(sp)
+   1536c:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   15370:	afa20028 	sw	v0,40(sp)
+   15374:	2664054c 	addiu	a0,s3,1356
+   15378:	0c00a43a 	jal	290e8 <vfs_get_path>
+   1537c:	27a50010 	addiu	a1,sp,16
+   15380:	02802021 	addu	a0,s4,zero
+   15384:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   15388:	00408821 	addu	s1,v0,zero
+   1538c:	8fbf0044 	lw	ra,68(sp)
+   15390:	ae510258 	sw	s1,600(s2)
+   15394:	02001021 	addu	v0,s0,zero
+   15398:	8fb40040 	lw	s4,64(sp)
+   1539c:	8fb3003c 	lw	s3,60(sp)
+   153a0:	8fb20038 	lw	s2,56(sp)
+   153a4:	8fb10034 	lw	s1,52(sp)
+   153a8:	8fb00030 	lw	s0,48(sp)
+   153ac:	03e00008 	jr	ra
+   153b0:	27bd0048 	addiu	sp,sp,72
+
+000153b4 <sys_getpid>:
+   153b4:	40022002 	mfc0	v0,$4,2
+   153b8:	8c420180 	lw	v0,384(v0)
+   153bc:	03e00008 	jr	ra
+   153c0:	8c4205c4 	lw	v0,1476(v0)
+
+000153c4 <sys_gettimeofday>:
+   153c4:	27bdffd0 	addiu	sp,sp,-48
+   153c8:	afb00028 	sw	s0,40(sp)
+   153cc:	afbf002c 	sw	ra,44(sp)
+   153d0:	10800015 	beqz	a0,15428 <sys_gettimeofday+0x64>
+   153d4:	00808021 	addu	s0,a0,zero
+   153d8:	28824000 	slti	v0,a0,16384
+   153dc:	14400013 	bnez	v0,1542c <sys_gettimeofday+0x68>
+   153e0:	24020016 	addiu	v0,zero,22
+   153e4:	3c028000 	lui	v0,0x8000
+   153e8:	34420001 	ori	v0,v0,0x1
+   153ec:	0082102b 	sltu	v0,a0,v0
+   153f0:	1040000e 	beqz	v0,1542c <sys_gettimeofday+0x68>
+   153f4:	24020016 	addiu	v0,zero,22
+   153f8:	3c027fff 	lui	v0,0x7fff
+   153fc:	2483c010 	addiu	v1,a0,-16368
+   15400:	3442c001 	ori	v0,v0,0xc001
+   15404:	0062102b 	sltu	v0,v1,v0
+   15408:	10400008 	beqz	v0,1542c <sys_gettimeofday+0x68>
+   1540c:	24020016 	addiu	v0,zero,22
+   15410:	10a0000c 	beqz	a1,15444 <sys_gettimeofday+0x80>
+   15414:	8fbf002c 	lw	ra,44(sp)
+   15418:	2402007e 	addiu	v0,zero,126
+   1541c:	8fb00028 	lw	s0,40(sp)
+   15420:	03e00008 	jr	ra
+   15424:	27bd0030 	addiu	sp,sp,48
+   15428:	24020016 	addiu	v0,zero,22
+   1542c:	40032002 	mfc0	v1,$4,2
+   15430:	8fbf002c 	lw	ra,44(sp)
+   15434:	8fb00028 	lw	s0,40(sp)
+   15438:	ac620258 	sw	v0,600(v1)
+   1543c:	03e00008 	jr	ra
+   15440:	27bd0030 	addiu	sp,sp,48
+   15444:	40022002 	mfc0	v0,$4,2
+   15448:	8c440174 	lw	a0,372(v0)
+   1544c:	27a50010 	addiu	a1,sp,16
+   15450:	0c001ff9 	jal	7fe4 <cpu_get_time>
+   15454:	27a60014 	addiu	a2,sp,20
+   15458:	8fa30010 	lw	v1,16(sp)
+   1545c:	3c021062 	lui	v0,0x1062
+   15460:	34424dd3 	ori	v0,v0,0x4dd3
+   15464:	00620019 	multu	v1,v0
+   15468:	24060010 	addiu	a2,zero,16
+   1546c:	00001010 	mfhi	v0
+   15470:	afa0001c 	sw	zero,28(sp)
+   15474:	00021182 	srl	v0,v0,0x6
+   15478:	000229c0 	sll	a1,v0,0x7
+   1547c:	00022080 	sll	a0,v0,0x2
+   15480:	00a42023 	subu	a0,a1,a0
+   15484:	00822021 	addu	a0,a0,v0
+   15488:	000420c0 	sll	a0,a0,0x3
+   1548c:	00641823 	subu	v1,v1,a0
+   15490:	000329c0 	sll	a1,v1,0x7
+   15494:	00032080 	sll	a0,v1,0x2
+   15498:	00a42023 	subu	a0,a1,a0
+   1549c:	00831821 	addu	v1,a0,v1
+   154a0:	8fa40014 	lw	a0,20(sp)
+   154a4:	000318c0 	sll	v1,v1,0x3
+   154a8:	00641821 	addu	v1,v1,a0
+   154ac:	27a50018 	addiu	a1,sp,24
+   154b0:	02002021 	addu	a0,s0,zero
+   154b4:	afa30020 	sw	v1,32(sp)
+   154b8:	afa20018 	sw	v0,24(sp)
+   154bc:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   154c0:	afa00024 	sw	zero,36(sp)
+   154c4:	0800550b 	j	1542c <sys_gettimeofday+0x68>
+   154c8:	00000000 	sll	zero,zero,0x0
+
+000154cc <sys_lseek>:
+   154cc:	27bdffd8 	addiu	sp,sp,-40
+   154d0:	afb20020 	sw	s2,32(sp)
+   154d4:	afb1001c 	sw	s1,28(sp)
+   154d8:	afbf0024 	sw	ra,36(sp)
+   154dc:	afb00018 	sw	s0,24(sp)
+   154e0:	00801021 	addu	v0,a0,zero
+   154e4:	00a09021 	addu	s2,a1,zero
+   154e8:	00c08821 	addu	s1,a2,zero
+   154ec:	40102002 	mfc0	s0,$4,2
+   154f0:	40042002 	mfc0	a0,$4,2
+   154f4:	2c430008 	sltiu	v1,v0,8
+   154f8:	10600014 	beqz	v1,1554c <sys_lseek+0x80>
+   154fc:	8c840180 	lw	a0,384(a0)
+   15500:	00402821 	addu	a1,v0,zero
+   15504:	27a60014 	addiu	a2,sp,20
+   15508:	0c0061dc 	jal	18770 <task_fd_lookup>
+   1550c:	afa00014 	sw	zero,20(sp)
+   15510:	1440000e 	bnez	v0,1554c <sys_lseek+0x80>
+   15514:	8fa40014 	lw	a0,20(sp)
+   15518:	02402821 	addu	a1,s2,zero
+   1551c:	02203021 	addu	a2,s1,zero
+   15520:	0c00a689 	jal	29a24 <vfs_lseek>
+   15524:	27a70010 	addiu	a3,sp,16
+   15528:	14400011 	bnez	v0,15570 <sys_lseek+0xa4>
+   1552c:	00000000 	sll	zero,zero,0x0
+   15530:	8fa20010 	lw	v0,16(sp)
+   15534:	8fbf0024 	lw	ra,36(sp)
+   15538:	8fb20020 	lw	s2,32(sp)
+   1553c:	8fb1001c 	lw	s1,28(sp)
+   15540:	8fb00018 	lw	s0,24(sp)
+   15544:	03e00008 	jr	ra
+   15548:	27bd0028 	addiu	sp,sp,40
+   1554c:	8fbf0024 	lw	ra,36(sp)
+   15550:	2402004d 	addiu	v0,zero,77
+   15554:	ae020258 	sw	v0,600(s0)
+   15558:	8fb20020 	lw	s2,32(sp)
+   1555c:	2402ffff 	addiu	v0,zero,-1
+   15560:	8fb1001c 	lw	s1,28(sp)
+   15564:	8fb00018 	lw	s0,24(sp)
+   15568:	03e00008 	jr	ra
+   1556c:	27bd0028 	addiu	sp,sp,40
+   15570:	04400003 	bltz	v0,15580 <sys_lseek+0xb4>
+   15574:	ae020258 	sw	v0,600(s0)
+   15578:	0800554d 	j	15534 <sys_lseek+0x68>
+   1557c:	2402ffff 	addiu	v0,zero,-1
+   15580:	00021023 	negu	v0,v0
+   15584:	ae020258 	sw	v0,600(s0)
+   15588:	0800554d 	j	15534 <sys_lseek+0x68>
+   1558c:	2402ffff 	addiu	v0,zero,-1
+
+00015590 <sys_madvise>:
+   15590:	27bdffc8 	addiu	sp,sp,-56
+   15594:	afb20024 	sw	s2,36(sp)
+   15598:	afb0001c 	sw	s0,28(sp)
+   1559c:	afbf0034 	sw	ra,52(sp)
+   155a0:	afb50030 	sw	s5,48(sp)
+   155a4:	afb4002c 	sw	s4,44(sp)
+   155a8:	afb30028 	sw	s3,40(sp)
+   155ac:	afb10020 	sw	s1,32(sp)
+   155b0:	00808021 	addu	s0,a0,zero
+   155b4:	00a09021 	addu	s2,a1,zero
+   155b8:	40112002 	mfc0	s1,$4,2
+   155bc:	1080000b 	beqz	a0,155ec <sys_madvise+0x5c>
+   155c0:	24020016 	addiu	v0,zero,22
+   155c4:	30820fff 	andi	v0,a0,0xfff
+   155c8:	14400008 	bnez	v0,155ec <sys_madvise+0x5c>
+   155cc:	24020016 	addiu	v0,zero,22
+   155d0:	00851821 	addu	v1,a0,a1
+   155d4:	3c027fff 	lui	v0,0x7fff
+   155d8:	2463c000 	addiu	v1,v1,-16384
+   155dc:	3442c001 	ori	v0,v0,0xc001
+   155e0:	0062102b 	sltu	v0,v1,v0
+   155e4:	1440000d 	bnez	v0,1561c <sys_madvise+0x8c>
+   155e8:	24020001 	addiu	v0,zero,1
+   155ec:	ae220258 	sw	v0,600(s1)
+   155f0:	8fbf0034 	lw	ra,52(sp)
+   155f4:	8fb50030 	lw	s5,48(sp)
+   155f8:	8fb4002c 	lw	s4,44(sp)
+   155fc:	8fb30028 	lw	s3,40(sp)
+   15600:	8fb20024 	lw	s2,36(sp)
+   15604:	8fb10020 	lw	s1,32(sp)
+   15608:	8fb0001c 	lw	s0,28(sp)
+   1560c:	03e00008 	jr	ra
+   15610:	27bd0038 	addiu	sp,sp,56
+   15614:	0800557b 	j	155ec <sys_madvise+0x5c>
+   15618:	24020016 	addiu	v0,zero,22
+   1561c:	8e340180 	lw	s4,384(s1)
+   15620:	afa60010 	sw	a2,16(sp)
+   15624:	26930190 	addiu	s3,s4,400
+   15628:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   1562c:	02602021 	addu	a0,s3,zero
+   15630:	8e950264 	lw	s5,612(s4)
+   15634:	8fa60010 	lw	a2,16(sp)
+   15638:	8ea200f8 	lw	v0,248(s5)
+   1563c:	0202102b 	sltu	v0,s0,v0
+   15640:	10400005 	beqz	v0,15658 <sys_madvise+0xc8>
+   15644:	26940180 	addiu	s4,s4,384
+   15648:	8ea200f4 	lw	v0,244(s5)
+   1564c:	0202102b 	sltu	v0,s0,v0
+   15650:	10400022 	beqz	v0,156dc <sys_madvise+0x14c>
+   15654:	00000000 	sll	zero,zero,0x0
+   15658:	02802021 	addu	a0,s4,zero
+   1565c:	02002821 	addu	a1,s0,zero
+   15660:	0c00868b 	jal	21a2c <vm_region_find>
+   15664:	afa60010 	sw	a2,16(sp)
+   15668:	0040a821 	addu	s5,v0,zero
+   1566c:	10400005 	beqz	v0,15684 <sys_madvise+0xf4>
+   15670:	8fa60010 	lw	a2,16(sp)
+   15674:	8c4200f4 	lw	v0,244(v0)
+   15678:	0202102b 	sltu	v0,s0,v0
+   1567c:	10400017 	beqz	v0,156dc <sys_madvise+0x14c>
+   15680:	00000000 	sll	zero,zero,0x0
+   15684:	02602021 	addu	a0,s3,zero
+   15688:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   1568c:	afa60010 	sw	a2,16(sp)
+   15690:	8ea20104 	lw	v0,260(s5)
+   15694:	30420081 	andi	v0,v0,0x81
+   15698:	1440000e 	bnez	v0,156d4 <sys_madvise+0x144>
+   1569c:	8fa60010 	lw	a2,16(sp)
+   156a0:	24020004 	addiu	v0,zero,4
+   156a4:	10c2ffd2 	beq	a2,v0,155f0 <sys_madvise+0x60>
+   156a8:	00001021 	addu	v0,zero,zero
+   156ac:	2cc20004 	sltiu	v0,a2,4
+   156b0:	1440000d 	bnez	v0,156e8 <sys_madvise+0x158>
+   156b4:	02802021 	addu	a0,s4,zero
+   156b8:	24020005 	addiu	v0,zero,5
+   156bc:	14c2ffd5 	bne	a2,v0,15614 <sys_madvise+0x84>
+   156c0:	02002821 	addu	a1,s0,zero
+   156c4:	0c0081e0 	jal	20780 <vmm_madvise_migrate>
+   156c8:	02403021 	addu	a2,s2,zero
+   156cc:	0800557c 	j	155f0 <sys_madvise+0x60>
+   156d0:	ae220258 	sw	v0,600(s1)
+   156d4:	0800557c 	j	155f0 <sys_madvise+0x60>
+   156d8:	00001021 	addu	v0,zero,zero
+   156dc:	8ea200f8 	lw	v0,248(s5)
+   156e0:	080055a2 	j	15688 <sys_madvise+0xf8>
+   156e4:	02602021 	addu	a0,s3,zero
+   156e8:	02002821 	addu	a1,s0,zero
+   156ec:	0c008097 	jal	2025c <vmm_madvise_willneed>
+   156f0:	02403021 	addu	a2,s2,zero
+   156f4:	0800557c 	j	155f0 <sys_madvise+0x60>
+   156f8:	ae220258 	sw	v0,600(s1)
+
+000156fc <sys_mcntl>:
+   156fc:	27bdffa0 	addiu	sp,sp,-96
+   15700:	24030001 	addiu	v1,zero,1
+   15704:	afb40058 	sw	s4,88(sp)
+   15708:	afb1004c 	sw	s1,76(sp)
+   1570c:	afbf005c 	sw	ra,92(sp)
+   15710:	afb30054 	sw	s3,84(sp)
+   15714:	afb20050 	sw	s2,80(sp)
+   15718:	afb00048 	sw	s0,72(sp)
+   1571c:	00a08821 	addu	s1,a1,zero
+   15720:	10830037 	beq	a0,v1,15800 <sys_mcntl+0x104>
+   15724:	00e0a021 	addu	s4,a3,zero
+   15728:	10a00003 	beqz	a1,15738 <sys_mcntl+0x3c>
+   1572c:	28820002 	slti	v0,a0,2
+   15730:	14400021 	bnez	v0,157b8 <sys_mcntl+0xbc>
+   15734:	00000000 	sll	zero,zero,0x0
+   15738:	24100016 	addiu	s0,zero,22
+   1573c:	3c130004 	lui	s3,0x4
+   15740:	3c120003 	lui	s2,0x3
+   15744:	40047801 	mfc0	a0,$15,1
+   15748:	40022002 	mfc0	v0,$4,2
+   1574c:	3c030004 	lui	v1,0x4
+   15750:	30840003 	andi	a0,a0,0x3
+   15754:	00042080 	sll	a0,a0,0x2
+   15758:	2463c950 	addiu	v1,v1,-14000
+   1575c:	00831821 	addu	v1,a0,v1
+   15760:	8c630000 	lw	v1,0(v1)
+   15764:	8e649100 	lw	a0,-28416(s3)
+   15768:	3c060003 	lui	a2,0x3
+   1576c:	24c661a8 	addiu	a2,a2,25000
+   15770:	264761d8 	addiu	a3,s2,25048
+   15774:	00002821 	addu	a1,zero,zero
+   15778:	afa30010 	sw	v1,16(sp)
+   1577c:	afa20014 	sw	v0,20(sp)
+   15780:	afb10018 	sw	s1,24(sp)
+   15784:	0c0009b0 	jal	26c0 <__fprintk>
+   15788:	afb0001c 	sw	s0,28(sp)
+   1578c:	40022002 	mfc0	v0,$4,2
+   15790:	ac500258 	sw	s0,600(v0)
+   15794:	8fbf005c 	lw	ra,92(sp)
+   15798:	02001021 	addu	v0,s0,zero
+   1579c:	8fb40058 	lw	s4,88(sp)
+   157a0:	8fb30054 	lw	s3,84(sp)
+   157a4:	8fb20050 	lw	s2,80(sp)
+   157a8:	8fb1004c 	lw	s1,76(sp)
+   157ac:	8fb00048 	lw	s0,72(sp)
+   157b0:	03e00008 	jr	ra
+   157b4:	27bd0060 	addiu	sp,sp,96
+   157b8:	10e0ffdf 	beqz	a3,15738 <sys_mcntl+0x3c>
+   157bc:	2402f000 	addiu	v0,zero,-4096
+   157c0:	00a28824 	and	s1,a1,v0
+   157c4:	2622c000 	addiu	v0,s1,-16384
+   157c8:	00063300 	sll	a2,a2,0xc
+   157cc:	00463021 	addu	a2,v0,a2
+   157d0:	3c027fff 	lui	v0,0x7fff
+   157d4:	3442c001 	ori	v0,v0,0xc001
+   157d8:	00c2302b 	sltu	a2,a2,v0
+   157dc:	10c00005 	beqz	a2,157f4 <sys_mcntl+0xf8>
+   157e0:	2410000d 	addiu	s0,zero,13
+   157e4:	24e3c010 	addiu	v1,a3,-16368
+   157e8:	0062102b 	sltu	v0,v1,v0
+   157ec:	14400008 	bnez	v0,15810 <sys_mcntl+0x114>
+   157f0:	00000000 	sll	zero,zero,0x0
+   157f4:	3c130004 	lui	s3,0x4
+   157f8:	080055d1 	j	15744 <sys_mcntl+0x48>
+   157fc:	3c120003 	lui	s2,0x3
+   15800:	0c000aa0 	jal	2a80 <pmm_cache_flush>
+   15804:	00008021 	addu	s0,zero,zero
+   15808:	080055e6 	j	15798 <sys_mcntl+0x9c>
+   1580c:	8fbf005c 	lw	ra,92(sp)
+   15810:	40022002 	mfc0	v0,$4,2
+   15814:	8c440180 	lw	a0,384(v0)
+   15818:	02202821 	addu	a1,s1,zero
+   1581c:	24840250 	addiu	a0,a0,592
+   15820:	0c000a56 	jal	2958 <pmm_get_page>
+   15824:	27a60030 	addiu	a2,sp,48
+   15828:	1440fff2 	bnez	v0,157f4 <sys_mcntl+0xf8>
+   1582c:	00408021 	addu	s0,v0,zero
+   15830:	0c000a1d 	jal	2874 <pmm_ppn2ppm>
+   15834:	8fa40034 	lw	a0,52(sp)
+   15838:	8c440000 	lw	a0,0(v0)
+   1583c:	3c03f0f0 	lui	v1,0xf0f0
+   15840:	3463a5a5 	ori	v1,v1,0xa5a5
+   15844:	10830004 	beq	a0,v1,15858 <sys_mcntl+0x15c>
+   15848:	24100005 	addiu	s0,zero,5
+   1584c:	3c130004 	lui	s3,0x4
+   15850:	080055d1 	j	15744 <sys_mcntl+0x48>
+   15854:	3c120003 	lui	s2,0x3
+   15858:	2442ff50 	addiu	v0,v0,-176
+   1585c:	3c130004 	lui	s3,0x4
+   15860:	8c490400 	lw	t1,1024(v0)
+   15864:	94430420 	lhu	v1,1056(v0)
+   15868:	9448041c 	lhu	t0,1052(v0)
+   1586c:	8e649100 	lw	a0,-28416(s3)
+   15870:	9442041e 	lhu	v0,1054(v0)
+   15874:	3c120003 	lui	s2,0x3
+   15878:	3c060003 	lui	a2,0x3
+   1587c:	24c66154 	addiu	a2,a2,24916
+   15880:	00002821 	addu	a1,zero,zero
+   15884:	264761d8 	addiu	a3,s2,25048
+   15888:	afa90010 	sw	t1,16(sp)
+   1588c:	afa80014 	sw	t0,20(sp)
+   15890:	afa3001c 	sw	v1,28(sp)
+   15894:	afa90020 	sw	t1,32(sp)
+   15898:	afa80024 	sw	t0,36(sp)
+   1589c:	afa3002c 	sw	v1,44(sp)
+   158a0:	afa20018 	sw	v0,24(sp)
+   158a4:	0c0009b0 	jal	26c0 <__fprintk>
+   158a8:	afa20028 	sw	v0,40(sp)
+   158ac:	02802021 	addu	a0,s4,zero
+   158b0:	27a50020 	addiu	a1,sp,32
+   158b4:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   158b8:	24060010 	addiu	a2,zero,16
+   158bc:	1040ffb5 	beqz	v0,15794 <sys_mcntl+0x98>
+   158c0:	00408021 	addu	s0,v0,zero
+   158c4:	8e649100 	lw	a0,-28416(s3)
+   158c8:	3c060003 	lui	a2,0x3
+   158cc:	24c66178 	addiu	a2,a2,24952
+   158d0:	00002821 	addu	a1,zero,zero
+   158d4:	264761d8 	addiu	a3,s2,25048
+   158d8:	afa20010 	sw	v0,16(sp)
+   158dc:	0c0009b0 	jal	26c0 <__fprintk>
+   158e0:	24100034 	addiu	s0,zero,52
+   158e4:	080055d1 	j	15744 <sys_mcntl+0x48>
+   158e8:	00000000 	sll	zero,zero,0x0
+
+000158ec <sys_mkdir>:
+   158ec:	27bdffb8 	addiu	sp,sp,-72
+   158f0:	afbf0044 	sw	ra,68(sp)
+   158f4:	afb10040 	sw	s1,64(sp)
+   158f8:	afb0003c 	sw	s0,60(sp)
+   158fc:	00801021 	addu	v0,a0,zero
+   15900:	40032002 	mfc0	v1,$4,2
+   15904:	afa20010 	sw	v0,16(sp)
+   15908:	3c020001 	lui	v0,0x1
+   1590c:	2442bf70 	addiu	v0,v0,-16528
+   15910:	8c710180 	lw	s1,384(v1)
+   15914:	afa20018 	sw	v0,24(sp)
+   15918:	3c020001 	lui	v0,0x1
+   1591c:	2442bee4 	addiu	v0,v0,-16668
+   15920:	afa2001c 	sw	v0,28(sp)
+   15924:	3c020001 	lui	v0,0x1
+   15928:	2442be2c 	addiu	v0,v0,-16852
+   1592c:	afa20024 	sw	v0,36(sp)
+   15930:	3c020001 	lui	v0,0x1
+   15934:	2442bd0c 	addiu	v0,v0,-17140
+   15938:	afa20020 	sw	v0,32(sp)
+   1593c:	263000b0 	addiu	s0,s1,176
+   15940:	3c020001 	lui	v0,0x1
+   15944:	02002021 	addu	a0,s0,zero
+   15948:	2442beb0 	addiu	v0,v0,-16720
+   1594c:	afa50030 	sw	a1,48(sp)
+   15950:	afa20028 	sw	v0,40(sp)
+   15954:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   15958:	afa00014 	sw	zero,20(sp)
+   1595c:	8fa50030 	lw	a1,48(sp)
+   15960:	2624054c 	addiu	a0,s1,1356
+   15964:	00a03021 	addu	a2,a1,zero
+   15968:	0c009f5b 	jal	27d6c <vfs_mkdir>
+   1596c:	27a50010 	addiu	a1,sp,16
+   15970:	14400009 	bnez	v0,15998 <sys_mkdir+0xac>
+   15974:	00000000 	sll	zero,zero,0x0
+   15978:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   1597c:	02002021 	addu	a0,s0,zero
+   15980:	00001021 	addu	v0,zero,zero
+   15984:	8fbf0044 	lw	ra,68(sp)
+   15988:	8fb10040 	lw	s1,64(sp)
+   1598c:	8fb0003c 	lw	s0,60(sp)
+   15990:	03e00008 	jr	ra
+   15994:	27bd0048 	addiu	sp,sp,72
+   15998:	40032002 	mfc0	v1,$4,2
+   1599c:	04400005 	bltz	v0,159b4 <sys_mkdir+0xc8>
+   159a0:	ac620258 	sw	v0,600(v1)
+   159a4:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   159a8:	02002021 	addu	a0,s0,zero
+   159ac:	08005661 	j	15984 <sys_mkdir+0x98>
+   159b0:	2402ffff 	addiu	v0,zero,-1
+   159b4:	00021023 	negu	v0,v0
+   159b8:	08005669 	j	159a4 <sys_mkdir+0xb8>
+   159bc:	ac620258 	sw	v0,600(v1)
+
+000159c0 <sys_mkfifo>:
+   159c0:	40022002 	mfc0	v0,$4,2
+   159c4:	40022002 	mfc0	v0,$4,2
+   159c8:	24030026 	addiu	v1,zero,38
+   159cc:	ac430258 	sw	v1,600(v0)
+   159d0:	03e00008 	jr	ra
+   159d4:	2402ffff 	addiu	v0,zero,-1
+
+000159d8 <sys_mmap>:
+   159d8:	27bdffa8 	addiu	sp,sp,-88
+   159dc:	afb10048 	sw	s1,72(sp)
+   159e0:	afbf0054 	sw	ra,84(sp)
+   159e4:	afb30050 	sw	s3,80(sp)
+   159e8:	afb2004c 	sw	s2,76(sp)
+   159ec:	afb00044 	sw	s0,68(sp)
+   159f0:	00808821 	addu	s1,a0,zero
+   159f4:	40102002 	mfc0	s0,$4,2
+   159f8:	24060018 	addiu	a2,zero,24
+   159fc:	27a40028 	addiu	a0,sp,40
+   15a00:	02202821 	addu	a1,s1,zero
+   15a04:	afa00024 	sw	zero,36(sp)
+   15a08:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   15a0c:	8e120180 	lw	s2,384(s0)
+   15a10:	144000bd 	bnez	v0,15d08 <sys_mmap+0x330>
+   15a14:	3c020004 	lui	v0,0x4
+   15a18:	8fa20034 	lw	v0,52(sp)
+   15a1c:	30430800 	andi	v1,v0,0x800
+   15a20:	146000a4 	bnez	v1,15cb4 <sys_mmap+0x2dc>
+   15a24:	24040003 	addiu	a0,zero,3
+   15a28:	30430003 	andi	v1,v0,0x3
+   15a2c:	106400a1 	beq	v1,a0,15cb4 <sys_mmap+0x2dc>
+   15a30:	00000000 	sll	zero,zero,0x0
+   15a34:	106000a0 	beqz	v1,15cb8 <sys_mmap+0x2e0>
+   15a38:	8fa3002c 	lw	v1,44(sp)
+   15a3c:	10600072 	beqz	v1,15c08 <sys_mmap+0x230>
+   15a40:	00604821 	addu	t1,v1,zero
+   15a44:	8fa4003c 	lw	a0,60(sp)
+   15a48:	30840fff 	andi	a0,a0,0xfff
+   15a4c:	1480006e 	bnez	a0,15c08 <sys_mmap+0x230>
+   15a50:	8fa40028 	lw	a0,40(sp)
+   15a54:	10800010 	beqz	a0,15a98 <sys_mmap+0xc0>
+   15a58:	00804021 	addu	t0,a0,zero
+   15a5c:	30850fff 	andi	a1,a0,0xfff
+   15a60:	14a0006a 	bnez	a1,15c0c <sys_mmap+0x234>
+   15a64:	2466c000 	addiu	a2,v1,-16384
+   15a68:	3c057fff 	lui	a1,0x7fff
+   15a6c:	00863021 	addu	a2,a0,a2
+   15a70:	34a5c001 	ori	a1,a1,0xc001
+   15a74:	00c5282b 	sltu	a1,a2,a1
+   15a78:	10a00064 	beqz	a1,15c0c <sys_mmap+0x234>
+   15a7c:	28854000 	slti	a1,a0,16384
+   15a80:	14a00062 	bnez	a1,15c0c <sys_mmap+0x234>
+   15a84:	3c058000 	lui	a1,0x8000
+   15a88:	34a50001 	ori	a1,a1,0x1
+   15a8c:	0085282b 	sltu	a1,a0,a1
+   15a90:	10a0005e 	beqz	a1,15c0c <sys_mmap+0x234>
+   15a94:	00000000 	sll	zero,zero,0x0
+   15a98:	30430004 	andi	v1,v0,0x4
+   15a9c:	14600043 	bnez	v1,15bac <sys_mmap+0x1d4>
+   15aa0:	30460040 	andi	a2,v0,0x40
+   15aa4:	8fa20038 	lw	v0,56(sp)
+   15aa8:	2c430008 	sltiu	v1,v0,8
+   15aac:	10600089 	beqz	v1,15cd4 <sys_mmap+0x2fc>
+   15ab0:	00402821 	addu	a1,v0,zero
+   15ab4:	02402021 	addu	a0,s2,zero
+   15ab8:	0c0061dc 	jal	18770 <task_fd_lookup>
+   15abc:	27a60024 	addiu	a2,sp,36
+   15ac0:	14400084 	bnez	v0,15cd4 <sys_mmap+0x2fc>
+   15ac4:	8fa20038 	lw	v0,56(sp)
+   15ac8:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+   15acc:	8fa40024 	lw	a0,36(sp)
+   15ad0:	8fa20024 	lw	v0,36(sp)
+   15ad4:	9445001c 	lhu	a1,28(v0)
+   15ad8:	0c00a996 	jal	2a658 <vfs_inode_size_get_remote>
+   15adc:	8c440018 	lw	a0,24(v0)
+   15ae0:	8fa8003c 	lw	t0,60(sp)
+   15ae4:	8fa9002c 	lw	t1,44(sp)
+   15ae8:	01091821 	addu	v1,t0,t1
+   15aec:	0043182b 	sltu	v1,v0,v1
+   15af0:	14600091 	bnez	v1,15d38 <sys_mmap+0x360>
+   15af4:	8fa30030 	lw	v1,48(sp)
+   15af8:	30620001 	andi	v0,v1,0x1
+   15afc:	14400058 	bnez	v0,15c60 <sys_mmap+0x288>
+   15b00:	8fa40024 	lw	a0,36(sp)
+   15b04:	00802821 	addu	a1,a0,zero
+   15b08:	30620002 	andi	v0,v1,0x2
+   15b0c:	10400066 	beqz	v0,15ca8 <sys_mmap+0x2d0>
+   15b10:	8fa60028 	lw	a2,40(sp)
+   15b14:	8c820000 	lw	v0,0(a0)
+   15b18:	3c040020 	lui	a0,0x20
+   15b1c:	00442024 	and	a0,v0,a0
+   15b20:	10800054 	beqz	a0,15c74 <sys_mmap+0x29c>
+   15b24:	3c040008 	lui	a0,0x8
+   15b28:	00442024 	and	a0,v0,a0
+   15b2c:	14800051 	bnez	a0,15c74 <sys_mmap+0x29c>
+   15b30:	01203821 	addu	a3,t1,zero
+   15b34:	8fa20034 	lw	v0,52(sp)
+   15b38:	02402021 	addu	a0,s2,zero
+   15b3c:	afa30010 	sw	v1,16(sp)
+   15b40:	afa20014 	sw	v0,20(sp)
+   15b44:	0c0084ee 	jal	213b8 <vmm_mmap>
+   15b48:	afa80018 	sw	t0,24(sp)
+   15b4c:	2403ffff 	addiu	v1,zero,-1
+   15b50:	14430027 	bne	v0,v1,15bf0 <sys_mmap+0x218>
+   15b54:	8fbf0054 	lw	ra,84(sp)
+   15b58:	8fa30034 	lw	v1,52(sp)
+   15b5c:	30630004 	andi	v1,v1,0x4
+   15b60:	14600023 	bnez	v1,15bf0 <sys_mmap+0x218>
+   15b64:	8fbf0054 	lw	ra,84(sp)
+   15b68:	3c130004 	lui	s3,0x4
+   15b6c:	3c110003 	lui	s1,0x3
+   15b70:	8e649100 	lw	a0,-28416(s3)
+   15b74:	3c060003 	lui	a2,0x3
+   15b78:	24c662dc 	addiu	a2,a2,25308
+   15b7c:	26276300 	addiu	a3,s1,25344
+   15b80:	0c0009b0 	jal	26c0 <__fprintk>
+   15b84:	00002821 	addu	a1,zero,zero
+   15b88:	8fa40024 	lw	a0,36(sp)
+   15b8c:	0c009f67 	jal	27d9c <vfs_close>
+   15b90:	27a50020 	addiu	a1,sp,32
+   15b94:	8fa30020 	lw	v1,32(sp)
+   15b98:	24020001 	addiu	v0,zero,1
+   15b9c:	10620048 	beq	v1,v0,15cc0 <sys_mmap+0x2e8>
+   15ba0:	00000000 	sll	zero,zero,0x0
+   15ba4:	080056fb 	j	15bec <sys_mmap+0x214>
+   15ba8:	2402ffff 	addiu	v0,zero,-1
+   15bac:	0006200a 	movz	a0,zero,a2
+   15bb0:	8fa50024 	lw	a1,36(sp)
+   15bb4:	8fa30030 	lw	v1,48(sp)
+   15bb8:	00803021 	addu	a2,a0,zero
+   15bbc:	afa0003c 	sw	zero,60(sp)
+   15bc0:	afa40028 	sw	a0,40(sp)
+   15bc4:	00004021 	addu	t0,zero,zero
+   15bc8:	01203821 	addu	a3,t1,zero
+   15bcc:	02402021 	addu	a0,s2,zero
+   15bd0:	afa30010 	sw	v1,16(sp)
+   15bd4:	afa20014 	sw	v0,20(sp)
+   15bd8:	0c0084ee 	jal	213b8 <vmm_mmap>
+   15bdc:	afa80018 	sw	t0,24(sp)
+   15be0:	2403ffff 	addiu	v1,zero,-1
+   15be4:	1043ffdd 	beq	v0,v1,15b5c <sys_mmap+0x184>
+   15be8:	8fa30034 	lw	v1,52(sp)
+   15bec:	8fbf0054 	lw	ra,84(sp)
+   15bf0:	8fb30050 	lw	s3,80(sp)
+   15bf4:	8fb2004c 	lw	s2,76(sp)
+   15bf8:	8fb10048 	lw	s1,72(sp)
+   15bfc:	8fb00044 	lw	s0,68(sp)
+   15c00:	03e00008 	jr	ra
+   15c04:	27bd0058 	addiu	sp,sp,88
+   15c08:	8fa80028 	lw	t0,40(sp)
+   15c0c:	3c040004 	lui	a0,0x4
+   15c10:	8c849100 	lw	a0,-28416(a0)
+   15c14:	3c060003 	lui	a2,0x3
+   15c18:	3c070003 	lui	a3,0x3
+   15c1c:	24c6620c 	addiu	a2,a2,25100
+   15c20:	24e76300 	addiu	a3,a3,25344
+   15c24:	00002821 	addu	a1,zero,zero
+   15c28:	afa20010 	sw	v0,16(sp)
+   15c2c:	afa30014 	sw	v1,20(sp)
+   15c30:	0c0009b0 	jal	26c0 <__fprintk>
+   15c34:	afa80018 	sw	t0,24(sp)
+   15c38:	8fbf0054 	lw	ra,84(sp)
+   15c3c:	24020016 	addiu	v0,zero,22
+   15c40:	ae020258 	sw	v0,600(s0)
+   15c44:	8fb30050 	lw	s3,80(sp)
+   15c48:	2402ffff 	addiu	v0,zero,-1
+   15c4c:	8fb2004c 	lw	s2,76(sp)
+   15c50:	8fb10048 	lw	s1,72(sp)
+   15c54:	8fb00044 	lw	s0,68(sp)
+   15c58:	03e00008 	jr	ra
+   15c5c:	27bd0058 	addiu	sp,sp,88
+   15c60:	3c060010 	lui	a2,0x10
+   15c64:	8c820000 	lw	v0,0(a0)
+   15c68:	00463024 	and	a2,v0,a2
+   15c6c:	14c0ffa6 	bnez	a2,15b08 <sys_mmap+0x130>
+   15c70:	00802821 	addu	a1,a0,zero
+   15c74:	3c130004 	lui	s3,0x4
+   15c78:	8e649100 	lw	a0,-28416(s3)
+   15c7c:	3c110003 	lui	s1,0x3
+   15c80:	3c060003 	lui	a2,0x3
+   15c84:	24c662b0 	addiu	a2,a2,25264
+   15c88:	00002821 	addu	a1,zero,zero
+   15c8c:	26276300 	addiu	a3,s1,25344
+   15c90:	afa30010 	sw	v1,16(sp)
+   15c94:	0c0009b0 	jal	26c0 <__fprintk>
+   15c98:	afa20014 	sw	v0,20(sp)
+   15c9c:	2402000d 	addiu	v0,zero,13
+   15ca0:	080056dc 	j	15b70 <sys_mmap+0x198>
+   15ca4:	ae020258 	sw	v0,600(s0)
+   15ca8:	8fa20034 	lw	v0,52(sp)
+   15cac:	080056f2 	j	15bc8 <sys_mmap+0x1f0>
+   15cb0:	00802821 	addu	a1,a0,zero
+   15cb4:	8fa3002c 	lw	v1,44(sp)
+   15cb8:	08005703 	j	15c0c <sys_mmap+0x234>
+   15cbc:	8fa80028 	lw	t0,40(sp)
+   15cc0:	8fa50038 	lw	a1,56(sp)
+   15cc4:	0c0061fe 	jal	187f8 <task_fd_put>
+   15cc8:	02402021 	addu	a0,s2,zero
+   15ccc:	080056fb 	j	15bec <sys_mmap+0x214>
+   15cd0:	2402ffff 	addiu	v0,zero,-1
+   15cd4:	3c030004 	lui	v1,0x4
+   15cd8:	8c649100 	lw	a0,-28416(v1)
+   15cdc:	3c060003 	lui	a2,0x3
+   15ce0:	3c070003 	lui	a3,0x3
+   15ce4:	24c66250 	addiu	a2,a2,25168
+   15ce8:	24e76300 	addiu	a3,a3,25344
+   15cec:	00002821 	addu	a1,zero,zero
+   15cf0:	0c0009b0 	jal	26c0 <__fprintk>
+   15cf4:	afa20010 	sw	v0,16(sp)
+   15cf8:	2402004d 	addiu	v0,zero,77
+   15cfc:	ae020258 	sw	v0,600(s0)
+   15d00:	080056fb 	j	15bec <sys_mmap+0x214>
+   15d04:	2402ffff 	addiu	v0,zero,-1
+   15d08:	8c449100 	lw	a0,-28416(v0)
+   15d0c:	3c060003 	lui	a2,0x3
+   15d10:	3c070003 	lui	a3,0x3
+   15d14:	24c661e4 	addiu	a2,a2,25060
+   15d18:	24e76300 	addiu	a3,a3,25344
+   15d1c:	00002821 	addu	a1,zero,zero
+   15d20:	0c0009b0 	jal	26c0 <__fprintk>
+   15d24:	afb10010 	sw	s1,16(sp)
+   15d28:	2402000e 	addiu	v0,zero,14
+   15d2c:	ae020258 	sw	v0,600(s0)
+   15d30:	080056fb 	j	15bec <sys_mmap+0x214>
+   15d34:	2402ffff 	addiu	v0,zero,-1
+   15d38:	3c130004 	lui	s3,0x4
+   15d3c:	8e649100 	lw	a0,-28416(s3)
+   15d40:	3c110003 	lui	s1,0x3
+   15d44:	3c060003 	lui	a2,0x3
+   15d48:	24c66278 	addiu	a2,a2,25208
+   15d4c:	00002821 	addu	a1,zero,zero
+   15d50:	26276300 	addiu	a3,s1,25344
+   15d54:	afa80010 	sw	t0,16(sp)
+   15d58:	afa90014 	sw	t1,20(sp)
+   15d5c:	0c0009b0 	jal	26c0 <__fprintk>
+   15d60:	afa20018 	sw	v0,24(sp)
+   15d64:	24020022 	addiu	v0,zero,34
+   15d68:	080056dc 	j	15b70 <sys_mmap+0x198>
+   15d6c:	ae020258 	sw	v0,600(s0)
+
+00015d70 <sys_open>:
+   15d70:	27bdff68 	addiu	sp,sp,-152
+   15d74:	2402ffff 	addiu	v0,zero,-1
+   15d78:	afb50090 	sw	s5,144(sp)
+   15d7c:	afb4008c 	sw	s4,140(sp)
+   15d80:	afb30088 	sw	s3,136(sp)
+   15d84:	afbf0094 	sw	ra,148(sp)
+   15d88:	afb20084 	sw	s2,132(sp)
+   15d8c:	afb10080 	sw	s1,128(sp)
+   15d90:	afb0007c 	sw	s0,124(sp)
+   15d94:	afa20018 	sw	v0,24(sp)
+   15d98:	00809821 	addu	s3,a0,zero
+   15d9c:	00a0a021 	addu	s4,a1,zero
+   15da0:	00c0a821 	addu	s5,a2,zero
+   15da4:	40112002 	mfc0	s1,$4,2
+   15da8:	40022002 	mfc0	v0,$4,2
+   15dac:	8c500180 	lw	s0,384(v0)
+   15db0:	0c006147 	jal	1851c <task_fd_check>
+   15db4:	02002021 	addu	a0,s0,zero
+   15db8:	1440002f 	bnez	v0,15e78 <sys_open+0x108>
+   15dbc:	3c030004 	lui	v1,0x4
+   15dc0:	02831824 	and	v1,s4,v1
+   15dc4:	36820001 	ori	v0,s4,0x1
+   15dc8:	0043a00b 	movn	s4,v0,v1
+   15dcc:	3c020001 	lui	v0,0x1
+   15dd0:	2442bf70 	addiu	v0,v0,-16528
+   15dd4:	afa20024 	sw	v0,36(sp)
+   15dd8:	3c020001 	lui	v0,0x1
+   15ddc:	2442bee4 	addiu	v0,v0,-16668
+   15de0:	afa20028 	sw	v0,40(sp)
+   15de4:	3c020001 	lui	v0,0x1
+   15de8:	2442be2c 	addiu	v0,v0,-16852
+   15dec:	afa20030 	sw	v0,48(sp)
+   15df0:	3c020001 	lui	v0,0x1
+   15df4:	2442bd0c 	addiu	v0,v0,-17140
+   15df8:	afa2002c 	sw	v0,44(sp)
+   15dfc:	261200b0 	addiu	s2,s0,176
+   15e00:	3c020001 	lui	v0,0x1
+   15e04:	02402021 	addu	a0,s2,zero
+   15e08:	2442beb0 	addiu	v0,v0,-16720
+   15e0c:	afb3001c 	sw	s3,28(sp)
+   15e10:	afa20034 	sw	v0,52(sp)
+   15e14:	afa00020 	sw	zero,32(sp)
+   15e18:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   15e1c:	27b30038 	addiu	s3,sp,56
+   15e20:	02803021 	addu	a2,s4,zero
+   15e24:	02a03821 	addu	a3,s5,zero
+   15e28:	2604054c 	addiu	a0,s0,1356
+   15e2c:	27a5001c 	addiu	a1,sp,28
+   15e30:	0c00a4f2 	jal	293c8 <vfs_open>
+   15e34:	afb30010 	sw	s3,16(sp)
+   15e38:	1040001b 	beqz	v0,15ea8 <sys_open+0x138>
+   15e3c:	02002021 	addu	a0,s0,zero
+   15e40:	04400023 	bltz	v0,15ed0 <sys_open+0x160>
+   15e44:	ae220258 	sw	v0,600(s1)
+   15e48:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   15e4c:	02402021 	addu	a0,s2,zero
+   15e50:	8fbf0094 	lw	ra,148(sp)
+   15e54:	8fa20018 	lw	v0,24(sp)
+   15e58:	8fb50090 	lw	s5,144(sp)
+   15e5c:	8fb4008c 	lw	s4,140(sp)
+   15e60:	8fb30088 	lw	s3,136(sp)
+   15e64:	8fb20084 	lw	s2,132(sp)
+   15e68:	8fb10080 	lw	s1,128(sp)
+   15e6c:	8fb0007c 	lw	s0,124(sp)
+   15e70:	03e00008 	jr	ra
+   15e74:	27bd0098 	addiu	sp,sp,152
+   15e78:	24020017 	addiu	v0,zero,23
+   15e7c:	8fbf0094 	lw	ra,148(sp)
+   15e80:	ae220258 	sw	v0,600(s1)
+   15e84:	8fa20018 	lw	v0,24(sp)
+   15e88:	8fb50090 	lw	s5,144(sp)
+   15e8c:	8fb4008c 	lw	s4,140(sp)
+   15e90:	8fb30088 	lw	s3,136(sp)
+   15e94:	8fb20084 	lw	s2,132(sp)
+   15e98:	8fb10080 	lw	s1,128(sp)
+   15e9c:	8fb0007c 	lw	s0,124(sp)
+   15ea0:	03e00008 	jr	ra
+   15ea4:	27bd0098 	addiu	sp,sp,152
+   15ea8:	02602821 	addu	a1,s3,zero
+   15eac:	0c006226 	jal	18898 <task_fd_set>
+   15eb0:	27a60018 	addiu	a2,sp,24
+   15eb4:	1040ffe4 	beqz	v0,15e48 <sys_open+0xd8>
+   15eb8:	00408021 	addu	s0,v0,zero
+   15ebc:	02602021 	addu	a0,s3,zero
+   15ec0:	0c009f67 	jal	27d9c <vfs_close>
+   15ec4:	00002821 	addu	a1,zero,zero
+   15ec8:	08005792 	j	15e48 <sys_open+0xd8>
+   15ecc:	ae300258 	sw	s0,600(s1)
+   15ed0:	00021023 	negu	v0,v0
+   15ed4:	08005792 	j	15e48 <sys_open+0xd8>
+   15ed8:	ae220258 	sw	v0,600(s1)
+
+00015edc <sys_opendir>:
+   15edc:	27bdff78 	addiu	sp,sp,-136
+   15ee0:	2402ffff 	addiu	v0,zero,-1
+   15ee4:	afb40080 	sw	s4,128(sp)
+   15ee8:	afbf0084 	sw	ra,132(sp)
+   15eec:	afb3007c 	sw	s3,124(sp)
+   15ef0:	afb20078 	sw	s2,120(sp)
+   15ef4:	afb10074 	sw	s1,116(sp)
+   15ef8:	afb00070 	sw	s0,112(sp)
+   15efc:	afa20010 	sw	v0,16(sp)
+   15f00:	0080a021 	addu	s4,a0,zero
+   15f04:	40112002 	mfc0	s1,$4,2
+   15f08:	40022002 	mfc0	v0,$4,2
+   15f0c:	8c500180 	lw	s0,384(v0)
+   15f10:	0c006147 	jal	1851c <task_fd_check>
+   15f14:	02002021 	addu	a0,s0,zero
+   15f18:	1040000b 	beqz	v0,15f48 <sys_opendir+0x6c>
+   15f1c:	24020017 	addiu	v0,zero,23
+   15f20:	8fbf0084 	lw	ra,132(sp)
+   15f24:	ae220258 	sw	v0,600(s1)
+   15f28:	8fa20010 	lw	v0,16(sp)
+   15f2c:	8fb40080 	lw	s4,128(sp)
+   15f30:	8fb3007c 	lw	s3,124(sp)
+   15f34:	8fb20078 	lw	s2,120(sp)
+   15f38:	8fb10074 	lw	s1,116(sp)
+   15f3c:	8fb00070 	lw	s0,112(sp)
+   15f40:	03e00008 	jr	ra
+   15f44:	27bd0088 	addiu	sp,sp,136
+   15f48:	3c020001 	lui	v0,0x1
+   15f4c:	2442bf70 	addiu	v0,v0,-16528
+   15f50:	afa2001c 	sw	v0,28(sp)
+   15f54:	3c020001 	lui	v0,0x1
+   15f58:	2442bee4 	addiu	v0,v0,-16668
+   15f5c:	afa20020 	sw	v0,32(sp)
+   15f60:	3c020001 	lui	v0,0x1
+   15f64:	2442be2c 	addiu	v0,v0,-16852
+   15f68:	afa20028 	sw	v0,40(sp)
+   15f6c:	3c020001 	lui	v0,0x1
+   15f70:	2442bd0c 	addiu	v0,v0,-17140
+   15f74:	afa20024 	sw	v0,36(sp)
+   15f78:	261200b0 	addiu	s2,s0,176
+   15f7c:	3c020001 	lui	v0,0x1
+   15f80:	02402021 	addu	a0,s2,zero
+   15f84:	2442beb0 	addiu	v0,v0,-16720
+   15f88:	27b30030 	addiu	s3,sp,48
+   15f8c:	afb40014 	sw	s4,20(sp)
+   15f90:	afa2002c 	sw	v0,44(sp)
+   15f94:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   15f98:	afa00018 	sw	zero,24(sp)
+   15f9c:	2604054c 	addiu	a0,s0,1356
+   15fa0:	27a50014 	addiu	a1,sp,20
+   15fa4:	00003021 	addu	a2,zero,zero
+   15fa8:	0c00a58f 	jal	2963c <vfs_opendir>
+   15fac:	02603821 	addu	a3,s3,zero
+   15fb0:	1040000e 	beqz	v0,15fec <sys_opendir+0x110>
+   15fb4:	02002021 	addu	a0,s0,zero
+   15fb8:	04400016 	bltz	v0,16014 <sys_opendir+0x138>
+   15fbc:	ae220258 	sw	v0,600(s1)
+   15fc0:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   15fc4:	02402021 	addu	a0,s2,zero
+   15fc8:	8fbf0084 	lw	ra,132(sp)
+   15fcc:	8fa20010 	lw	v0,16(sp)
+   15fd0:	8fb40080 	lw	s4,128(sp)
+   15fd4:	8fb3007c 	lw	s3,124(sp)
+   15fd8:	8fb20078 	lw	s2,120(sp)
+   15fdc:	8fb10074 	lw	s1,116(sp)
+   15fe0:	8fb00070 	lw	s0,112(sp)
+   15fe4:	03e00008 	jr	ra
+   15fe8:	27bd0088 	addiu	sp,sp,136
+   15fec:	02602821 	addu	a1,s3,zero
+   15ff0:	0c006226 	jal	18898 <task_fd_set>
+   15ff4:	27a60010 	addiu	a2,sp,16
+   15ff8:	1040fff1 	beqz	v0,15fc0 <sys_opendir+0xe4>
+   15ffc:	00408021 	addu	s0,v0,zero
+   16000:	02602021 	addu	a0,s3,zero
+   16004:	0c009f67 	jal	27d9c <vfs_close>
+   16008:	00002821 	addu	a1,zero,zero
+   1600c:	080057f0 	j	15fc0 <sys_opendir+0xe4>
+   16010:	ae300258 	sw	s0,600(s1)
+   16014:	00021023 	negu	v0,v0
+   16018:	080057f0 	j	15fc0 <sys_opendir+0xe4>
+   1601c:	ae220258 	sw	v0,600(s1)
+
+00016020 <sys_pipe>:
+   16020:	40022002 	mfc0	v0,$4,2
+   16024:	24030026 	addiu	v1,zero,38
+   16028:	ac430258 	sw	v1,600(v0)
+   1602c:	03e00008 	jr	ra
+   16030:	2402ffff 	addiu	v0,zero,-1
+   16034:	27bdffc8 	addiu	sp,sp,-56
+   16038:	afb00030 	sw	s0,48(sp)
+   1603c:	afbf0034 	sw	ra,52(sp)
+   16040:	14800006 	bnez	a0,1605c <sys_pipe+0x3c>
+   16044:	00808021 	addu	s0,a0,zero
+   16048:	24020016 	addiu	v0,zero,22
+   1604c:	8fbf0034 	lw	ra,52(sp)
+   16050:	8fb00030 	lw	s0,48(sp)
+   16054:	03e00008 	jr	ra
+   16058:	27bd0038 	addiu	sp,sp,56
+   1605c:	afa50024 	sw	a1,36(sp)
+   16060:	0c006688 	jal	19a20 <task_whereis>
+   16064:	afa60028 	sw	a2,40(sp)
+   16068:	0c0061d9 	jal	18764 <tasks_manager_lock>
+   1606c:	afa20020 	sw	v0,32(sp)
+   16070:	3c040004 	lui	a0,0x4
+   16074:	2483c960 	addiu	v1,a0,-13984
+   16078:	88630003 	lwl	v1,3(v1)
+   1607c:	8fa20020 	lw	v0,32(sp)
+   16080:	9883c960 	lwr	v1,-13984(a0)
+   16084:	3063ffff 	andi	v1,v1,0xffff
+   16088:	10430010 	beq	v0,v1,160cc <sys_pipe+0xac>
+   1608c:	3c040004 	lui	a0,0x4
+   16090:	8c849100 	lw	a0,-28416(a0)
+   16094:	3c060003 	lui	a2,0x3
+   16098:	3c070003 	lui	a3,0x3
+   1609c:	24c6630c 	addiu	a2,a2,25356
+   160a0:	24e763c0 	addiu	a3,a3,25536
+   160a4:	00002821 	addu	a1,zero,zero
+   160a8:	afb00014 	sw	s0,20(sp)
+   160ac:	afa30010 	sw	v1,16(sp)
+   160b0:	0c0009b0 	jal	26c0 <__fprintk>
+   160b4:	afa20018 	sw	v0,24(sp)
+   160b8:	8fbf0034 	lw	ra,52(sp)
+   160bc:	24020026 	addiu	v0,zero,38
+   160c0:	8fb00030 	lw	s0,48(sp)
+   160c4:	03e00008 	jr	ra
+   160c8:	27bd0038 	addiu	sp,sp,56
+   160cc:	0c006220 	jal	18880 <task_lookup>
+   160d0:	02002021 	addu	a0,s0,zero
+   160d4:	8c420004 	lw	v0,4(v0)
+   160d8:	8fa50024 	lw	a1,36(sp)
+   160dc:	1040ffda 	beqz	v0,16048 <sys_pipe+0x28>
+   160e0:	8fa60028 	lw	a2,40(sp)
+   160e4:	8c43063c 	lw	v1,1596(v0)
+   160e8:	0065182b 	sltu	v1,v1,a1
+   160ec:	1460ffd6 	bnez	v1,16048 <sys_pipe+0x28>
+   160f0:	00000000 	sll	zero,zero,0x0
+   160f4:	8c430740 	lw	v1,1856(v0)
+   160f8:	00051080 	sll	v0,a1,0x2
+   160fc:	00621021 	addu	v0,v1,v0
+   16100:	8c420000 	lw	v0,0(v0)
+   16104:	10400005 	beqz	v0,1611c <sys_pipe+0xfc>
+   16108:	3c03deef 	lui	v1,0xdeef
+   1610c:	8c440390 	lw	a0,912(v0)
+   16110:	3463baad 	ori	v1,v1,0xbaad
+   16114:	10830003 	beq	a0,v1,16124 <sys_pipe+0x104>
+   16118:	00000000 	sll	zero,zero,0x0
+   1611c:	08005813 	j	1604c <sys_pipe+0x2c>
+   16120:	24020003 	addiu	v0,zero,3
+   16124:	8c430300 	lw	v1,768(v0)
+   16128:	1465fffc 	bne	v1,a1,1611c <sys_pipe+0xfc>
+   1612c:	00000000 	sll	zero,zero,0x0
+   16130:	acc20000 	sw	v0,0(a2)
+   16134:	08005813 	j	1604c <sys_pipe+0x2c>
+   16138:	00001021 	addu	v0,zero,zero
+
+0001613c <__ps_func_main>:
+   1613c:	27bdffe0 	addiu	sp,sp,-32
+   16140:	00002021 	addu	a0,zero,zero
+   16144:	afbf001c 	sw	ra,28(sp)
+   16148:	0c00cb61 	jal	32d84 <ps_func>
+   1614c:	afa60010 	sw	a2,16(sp)
+   16150:	8fa60010 	lw	a2,16(sp)
+   16154:	8fbf001c 	lw	ra,28(sp)
+   16158:	acc20000 	sw	v0,0(a2)
+   1615c:	03e00008 	jr	ra
+   16160:	27bd0020 	addiu	sp,sp,32
+
+00016164 <__ps_func_local>:
+   16164:	00803021 	addu	a2,a0,zero
+   16168:	00a03821 	addu	a3,a1,zero
+   1616c:	40057801 	mfc0	a1,$15,1
+   16170:	3c020004 	lui	v0,0x4
+   16174:	2443c960 	addiu	v1,v0,-13984
+   16178:	88640003 	lwl	a0,3(v1)
+   1617c:	30a50003 	andi	a1,a1,0x3
+   16180:	3c030004 	lui	v1,0x4
+   16184:	00052880 	sll	a1,a1,0x2
+   16188:	2463c950 	addiu	v1,v1,-14000
+   1618c:	9844c960 	lwr	a0,-13984(v0)
+   16190:	00a31021 	addu	v0,a1,v1
+   16194:	8c450000 	lw	a1,0(v0)
+   16198:	0800584f 	j	1613c <__ps_func_main>
+   1619c:	3084ffff 	andi	a0,a0,0xffff
+
+000161a0 <sys_ps>:
+   161a0:	27bdff90 	addiu	sp,sp,-112
+   161a4:	24020001 	addiu	v0,zero,1
+   161a8:	afb20050 	sw	s2,80(sp)
+   161ac:	afb1004c 	sw	s1,76(sp)
+   161b0:	afb00048 	sw	s0,72(sp)
+   161b4:	afbf006c 	sw	ra,108(sp)
+   161b8:	afbe0068 	sw	s8,104(sp)
+   161bc:	afb70064 	sw	s7,100(sp)
+   161c0:	afb60060 	sw	s6,96(sp)
+   161c4:	afb5005c 	sw	s5,92(sp)
+   161c8:	afb40058 	sw	s4,88(sp)
+   161cc:	afb30054 	sw	s3,84(sp)
+   161d0:	00808821 	addu	s1,a0,zero
+   161d4:	00a09021 	addu	s2,a1,zero
+   161d8:	00c08021 	addu	s0,a2,zero
+   161dc:	1082006c 	beq	a0,v0,16390 <sys_ps+0x1f0>
+   161e0:	afa00028 	sw	zero,40(sp)
+   161e4:	1480000f 	bnez	a0,16224 <sys_ps+0x84>
+   161e8:	24020002 	addiu	v0,zero,2
+   161ec:	00a02021 	addu	a0,a1,zero
+   161f0:	00c02821 	addu	a1,a2,zero
+   161f4:	0c00580d 	jal	16034 <sys_pipe+0x14>
+   161f8:	27a6002c 	addiu	a2,sp,44
+   161fc:	1440000c 	bnez	v0,16230 <sys_ps+0x90>
+   16200:	afa20028 	sw	v0,40(sp)
+   16204:	8fa2002c 	lw	v0,44(sp)
+   16208:	ac400214 	sw	zero,532(v0)
+   1620c:	0000000f 	sync
+   16210:	3c020004 	lui	v0,0x4
+   16214:	3c060003 	lui	a2,0x3
+   16218:	8c449100 	lw	a0,-28416(v0)
+   1621c:	080058f1 	j	163c4 <sys_ps+0x224>
+   16220:	24c66360 	addiu	a2,a2,25440
+   16224:	10820010 	beq	a0,v0,16268 <sys_ps+0xc8>
+   16228:	3c020004 	lui	v0,0x4
+   1622c:	00001021 	addu	v0,zero,zero
+   16230:	40032002 	mfc0	v1,$4,2
+   16234:	8fbf006c 	lw	ra,108(sp)
+   16238:	8fbe0068 	lw	s8,104(sp)
+   1623c:	8fb70064 	lw	s7,100(sp)
+   16240:	8fb60060 	lw	s6,96(sp)
+   16244:	8fb5005c 	lw	s5,92(sp)
+   16248:	8fb40058 	lw	s4,88(sp)
+   1624c:	8fb30054 	lw	s3,84(sp)
+   16250:	8fb20050 	lw	s2,80(sp)
+   16254:	8fb1004c 	lw	s1,76(sp)
+   16258:	8fb00048 	lw	s0,72(sp)
+   1625c:	ac620258 	sw	v0,600(v1)
+   16260:	03e00008 	jr	ra
+   16264:	27bd0070 	addiu	sp,sp,112
+   16268:	8c4371c0 	lw	v1,29120(v0)
+   1626c:	3c120008 	lui	s2,0x8
+   16270:	2463ffff 	addiu	v1,v1,-1
+   16274:	3063ffff 	andi	v1,v1,0xffff
+   16278:	3402ffff 	ori	v0,zero,0xffff
+   1627c:	1062ffeb 	beq	v1,v0,1622c <sys_ps+0x8c>
+   16280:	a64326d4 	sh	v1,9940(s2)
+   16284:	3c100004 	lui	s0,0x4
+   16288:	27b10028 	addiu	s1,sp,40
+   1628c:	2616c960 	addiu	s6,s0,-13984
+   16290:	24130004 	addiu	s3,zero,4
+   16294:	24140001 	addiu	s4,zero,1
+   16298:	27be0038 	addiu	s8,sp,56
+   1629c:	27b7003c 	addiu	s7,sp,60
+   162a0:	080058c5 	j	16314 <sys_ps+0x174>
+   162a4:	3415ffff 	ori	s5,zero,0xffff
+   162a8:	40047801 	mfc0	a0,$15,1
+   162ac:	afa30044 	sw	v1,68(sp)
+   162b0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   162b4:	afa40040 	sw	a0,64(sp)
+   162b8:	8fa30044 	lw	v1,68(sp)
+   162bc:	8fa40040 	lw	a0,64(sp)
+   162c0:	70432802 	mul	a1,v0,v1
+   162c4:	30840003 	andi	a0,a0,0x3
+   162c8:	27a20030 	addiu	v0,sp,48
+   162cc:	3c070001 	lui	a3,0x1
+   162d0:	00a42021 	addu	a0,a1,a0
+   162d4:	afa20018 	sw	v0,24(sp)
+   162d8:	24050001 	addiu	a1,zero,1
+   162dc:	27a20034 	addiu	v0,sp,52
+   162e0:	00003021 	addu	a2,zero,zero
+   162e4:	24e763dc 	addiu	a3,a3,25564
+   162e8:	afb40010 	sw	s4,16(sp)
+   162ec:	afb40014 	sw	s4,20(sp)
+   162f0:	afa2001c 	sw	v0,28(sp)
+   162f4:	afbe0020 	sw	s8,32(sp)
+   162f8:	0c003de8 	jal	f7a0 <rppc_generic>
+   162fc:	afb70024 	sw	s7,36(sp)
+   16300:	964326d4 	lhu	v1,9940(s2)
+   16304:	2463ffff 	addiu	v1,v1,-1
+   16308:	3063ffff 	andi	v1,v1,0xffff
+   1630c:	10750011 	beq	v1,s5,16354 <sys_ps+0x1b4>
+   16310:	a64326d4 	sh	v1,9940(s2)
+   16314:	8ac20003 	lwl	v0,3(s6)
+   16318:	afb10030 	sw	s1,48(sp)
+   1631c:	9a02c960 	lwr	v0,-13984(s0)
+   16320:	afb30034 	sw	s3,52(sp)
+   16324:	3042ffff 	andi	v0,v0,0xffff
+   16328:	afb10038 	sw	s1,56(sp)
+   1632c:	1462ffde 	bne	v1,v0,162a8 <sys_ps+0x108>
+   16330:	afb3003c 	sw	s3,60(sp)
+   16334:	02202021 	addu	a0,s1,zero
+   16338:	0c005859 	jal	16164 <__ps_func_local>
+   1633c:	02202821 	addu	a1,s1,zero
+   16340:	964326d4 	lhu	v1,9940(s2)
+   16344:	2463ffff 	addiu	v1,v1,-1
+   16348:	3063ffff 	andi	v1,v1,0xffff
+   1634c:	1475fff1 	bne	v1,s5,16314 <sys_ps+0x174>
+   16350:	a64326d4 	sh	v1,9940(s2)
+   16354:	8fa20028 	lw	v0,40(sp)
+   16358:	40032002 	mfc0	v1,$4,2
+   1635c:	8fbf006c 	lw	ra,108(sp)
+   16360:	8fbe0068 	lw	s8,104(sp)
+   16364:	8fb70064 	lw	s7,100(sp)
+   16368:	8fb60060 	lw	s6,96(sp)
+   1636c:	8fb5005c 	lw	s5,92(sp)
+   16370:	8fb40058 	lw	s4,88(sp)
+   16374:	8fb30054 	lw	s3,84(sp)
+   16378:	8fb20050 	lw	s2,80(sp)
+   1637c:	8fb1004c 	lw	s1,76(sp)
+   16380:	8fb00048 	lw	s0,72(sp)
+   16384:	ac620258 	sw	v0,600(v1)
+   16388:	03e00008 	jr	ra
+   1638c:	27bd0070 	addiu	sp,sp,112
+   16390:	00a02021 	addu	a0,a1,zero
+   16394:	00c02821 	addu	a1,a2,zero
+   16398:	0c00580d 	jal	16034 <sys_pipe+0x14>
+   1639c:	27a6002c 	addiu	a2,sp,44
+   163a0:	1440ffa3 	bnez	v0,16230 <sys_ps+0x90>
+   163a4:	afa20028 	sw	v0,40(sp)
+   163a8:	8fa2002c 	lw	v0,44(sp)
+   163ac:	ac510214 	sw	s1,532(v0)
+   163b0:	0000000f 	sync
+   163b4:	3c020004 	lui	v0,0x4
+   163b8:	3c060003 	lui	a2,0x3
+   163bc:	8c449100 	lw	a0,-28416(v0)
+   163c0:	24c66390 	addiu	a2,a2,25488
+   163c4:	02403821 	addu	a3,s2,zero
+   163c8:	00002821 	addu	a1,zero,zero
+   163cc:	0c0009b0 	jal	26c0 <__fprintk>
+   163d0:	afb00010 	sw	s0,16(sp)
+   163d4:	080058d6 	j	16358 <sys_ps+0x1b8>
+   163d8:	8fa20028 	lw	v0,40(sp)
+
+000163dc <__ps_func_demarshall>:
+   163dc:	27bdffc8 	addiu	sp,sp,-56
+   163e0:	afbf0034 	sw	ra,52(sp)
+   163e4:	afbe0030 	sw	s8,48(sp)
+   163e8:	afb4002c 	sw	s4,44(sp)
+   163ec:	03a0f021 	addu	s8,sp,zero
+   163f0:	afb30028 	sw	s3,40(sp)
+   163f4:	afb20024 	sw	s2,36(sp)
+   163f8:	afb10020 	sw	s1,32(sp)
+   163fc:	afb0001c 	sw	s0,28(sp)
+   16400:	27bdfff0 	addiu	sp,sp,-16
+   16404:	27b20010 	addiu	s2,sp,16
+   16408:	27bdffc8 	addiu	sp,sp,-56
+   1640c:	27b00010 	addiu	s0,sp,16
+   16410:	26020028 	addiu	v0,s0,40
+   16414:	2403002c 	addiu	v1,zero,44
+   16418:	ae030008 	sw	v1,8(s0)
+   1641c:	ae420000 	sw	v0,0(s2)
+   16420:	24030004 	addiu	v1,zero,4
+   16424:	00808821 	addu	s1,a0,zero
+   16428:	ae030024 	sw	v1,36(s0)
+   1642c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   16430:	8c940000 	lw	s4,0(a0)
+   16434:	8e460000 	lw	a2,0(s2)
+   16438:	00409821 	addu	s3,v0,zero
+   1643c:	02202021 	addu	a0,s1,zero
+   16440:	00002821 	addu	a1,zero,zero
+   16444:	8e320000 	lw	s2,0(s1)
+   16448:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1644c:	afc60010 	sw	a2,16(s8)
+   16450:	0293001b 	divu	zero,s4,s3
+   16454:	026001f4 	teq	s3,zero,0x7
+   16458:	8fc60010 	lw	a2,16(s8)
+   1645c:	00403821 	addu	a3,v0,zero
+   16460:	02402821 	addu	a1,s2,zero
+   16464:	00002012 	mflo	a0
+   16468:	0c00584f 	jal	1613c <__ps_func_main>
+   1646c:	3084ffff 	andi	a0,a0,0xffff
+   16470:	02202021 	addu	a0,s1,zero
+   16474:	02002821 	addu	a1,s0,zero
+   16478:	2406002c 	addiu	a2,zero,44
+   1647c:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   16480:	24070001 	addiu	a3,zero,1
+   16484:	03c0e821 	addu	sp,s8,zero
+   16488:	8fbf0034 	lw	ra,52(sp)
+   1648c:	8fbe0030 	lw	s8,48(sp)
+   16490:	8fb4002c 	lw	s4,44(sp)
+   16494:	8fb30028 	lw	s3,40(sp)
+   16498:	8fb20024 	lw	s2,36(sp)
+   1649c:	8fb10020 	lw	s1,32(sp)
+   164a0:	8fb0001c 	lw	s0,28(sp)
+   164a4:	03e00008 	jr	ra
+   164a8:	27bd0038 	addiu	sp,sp,56
+
+000164ac <sys_read>:
+   164ac:	27bdffc0 	addiu	sp,sp,-64
+   164b0:	afb10034 	sw	s1,52(sp)
+   164b4:	afb00030 	sw	s0,48(sp)
+   164b8:	afbf003c 	sw	ra,60(sp)
+   164bc:	afb20038 	sw	s2,56(sp)
+   164c0:	00801021 	addu	v0,a0,zero
+   164c4:	00a08821 	addu	s1,a1,zero
+   164c8:	00c08021 	addu	s0,a2,zero
+   164cc:	40122002 	mfc0	s2,$4,2
+   164d0:	40042002 	mfc0	a0,$4,2
+   164d4:	2c430008 	sltiu	v1,v0,8
+   164d8:	10600022 	beqz	v1,16564 <sys_read+0xb8>
+   164dc:	8c840180 	lw	a0,384(a0)
+   164e0:	00402821 	addu	a1,v0,zero
+   164e4:	27a60010 	addiu	a2,sp,16
+   164e8:	0c0061dc 	jal	18770 <task_fd_lookup>
+   164ec:	afa00010 	sw	zero,16(sp)
+   164f0:	1440001c 	bnez	v0,16564 <sys_read+0xb8>
+   164f4:	3c020001 	lui	v0,0x1
+   164f8:	2442bfc0 	addiu	v0,v0,-16448
+   164fc:	afa2001c 	sw	v0,28(sp)
+   16500:	3c020001 	lui	v0,0x1
+   16504:	2442bf38 	addiu	v0,v0,-16584
+   16508:	afa20020 	sw	v0,32(sp)
+   1650c:	3c020001 	lui	v0,0x1
+   16510:	2442be2c 	addiu	v0,v0,-16852
+   16514:	afa20028 	sw	v0,40(sp)
+   16518:	3c020001 	lui	v0,0x1
+   1651c:	2442bd0c 	addiu	v0,v0,-17140
+   16520:	afa20024 	sw	v0,36(sp)
+   16524:	8fa40010 	lw	a0,16(sp)
+   16528:	3c020001 	lui	v0,0x1
+   1652c:	2442bc80 	addiu	v0,v0,-17280
+   16530:	27a50014 	addiu	a1,sp,20
+   16534:	afb10014 	sw	s1,20(sp)
+   16538:	afa2002c 	sw	v0,44(sp)
+   1653c:	0c009e63 	jal	2798c <vfs_read>
+   16540:	afb00018 	sw	s0,24(sp)
+   16544:	04400010 	bltz	v0,16588 <sys_read+0xdc>
+   16548:	00023823 	negu	a3,v0
+   1654c:	8fbf003c 	lw	ra,60(sp)
+   16550:	8fb20038 	lw	s2,56(sp)
+   16554:	8fb10034 	lw	s1,52(sp)
+   16558:	8fb00030 	lw	s0,48(sp)
+   1655c:	03e00008 	jr	ra
+   16560:	27bd0040 	addiu	sp,sp,64
+   16564:	8fbf003c 	lw	ra,60(sp)
+   16568:	2402004d 	addiu	v0,zero,77
+   1656c:	ae420258 	sw	v0,600(s2)
+   16570:	8fb10034 	lw	s1,52(sp)
+   16574:	2402ffff 	addiu	v0,zero,-1
+   16578:	8fb20038 	lw	s2,56(sp)
+   1657c:	8fb00030 	lw	s0,48(sp)
+   16580:	03e00008 	jr	ra
+   16584:	27bd0040 	addiu	sp,sp,64
+   16588:	ae470258 	sw	a3,600(s2)
+   1658c:	3c020004 	lui	v0,0x4
+   16590:	8c449100 	lw	a0,-28416(v0)
+   16594:	3c060003 	lui	a2,0x3
+   16598:	24c663d4 	addiu	a2,a2,25556
+   1659c:	0c0009b0 	jal	26c0 <__fprintk>
+   165a0:	00002821 	addu	a1,zero,zero
+   165a4:	08005953 	j	1654c <sys_read+0xa0>
+   165a8:	2402ffff 	addiu	v0,zero,-1
+
+000165ac <sys_readdir>:
+   165ac:	27bdffc0 	addiu	sp,sp,-64
+   165b0:	afb00034 	sw	s0,52(sp)
+   165b4:	afbf003c 	sw	ra,60(sp)
+   165b8:	afb10038 	sw	s1,56(sp)
+   165bc:	00801021 	addu	v0,a0,zero
+   165c0:	00a08021 	addu	s0,a1,zero
+   165c4:	40032002 	mfc0	v1,$4,2
+   165c8:	8c640180 	lw	a0,384(v1)
+   165cc:	40112002 	mfc0	s1,$4,2
+   165d0:	10a00023 	beqz	a1,16660 <sys_readdir+0xb4>
+   165d4:	2c430008 	sltiu	v1,v0,8
+   165d8:	10600021 	beqz	v1,16660 <sys_readdir+0xb4>
+   165dc:	00402821 	addu	a1,v0,zero
+   165e0:	27a60010 	addiu	a2,sp,16
+   165e4:	0c0061dc 	jal	18770 <task_fd_lookup>
+   165e8:	afa00010 	sw	zero,16(sp)
+   165ec:	1440001c 	bnez	v0,16660 <sys_readdir+0xb4>
+   165f0:	3c020001 	lui	v0,0x1
+   165f4:	2442bf70 	addiu	v0,v0,-16528
+   165f8:	afa2001c 	sw	v0,28(sp)
+   165fc:	3c020001 	lui	v0,0x1
+   16600:	2442bee4 	addiu	v0,v0,-16668
+   16604:	afa20020 	sw	v0,32(sp)
+   16608:	3c020001 	lui	v0,0x1
+   1660c:	2442be2c 	addiu	v0,v0,-16852
+   16610:	afa20028 	sw	v0,40(sp)
+   16614:	3c020001 	lui	v0,0x1
+   16618:	2442bd0c 	addiu	v0,v0,-17140
+   1661c:	afa20024 	sw	v0,36(sp)
+   16620:	3c020001 	lui	v0,0x1
+   16624:	2442bc80 	addiu	v0,v0,-17280
+   16628:	8fa40010 	lw	a0,16(sp)
+   1662c:	afa2002c 	sw	v0,44(sp)
+   16630:	27a50014 	addiu	a1,sp,20
+   16634:	24020108 	addiu	v0,zero,264
+   16638:	afb00014 	sw	s0,20(sp)
+   1663c:	0c00a79c 	jal	29e70 <vfs_readdir>
+   16640:	afa20018 	sw	v0,24(sp)
+   16644:	1440000e 	bnez	v0,16680 <sys_readdir+0xd4>
+   16648:	00000000 	sll	zero,zero,0x0
+   1664c:	8fbf003c 	lw	ra,60(sp)
+   16650:	8fb10038 	lw	s1,56(sp)
+   16654:	8fb00034 	lw	s0,52(sp)
+   16658:	03e00008 	jr	ra
+   1665c:	27bd0040 	addiu	sp,sp,64
+   16660:	8fbf003c 	lw	ra,60(sp)
+   16664:	2402004d 	addiu	v0,zero,77
+   16668:	ae220258 	sw	v0,600(s1)
+   1666c:	8fb00034 	lw	s0,52(sp)
+   16670:	2402ffff 	addiu	v0,zero,-1
+   16674:	8fb10038 	lw	s1,56(sp)
+   16678:	03e00008 	jr	ra
+   1667c:	27bd0040 	addiu	sp,sp,64
+   16680:	04400003 	bltz	v0,16690 <sys_readdir+0xe4>
+   16684:	ae220258 	sw	v0,600(s1)
+   16688:	08005993 	j	1664c <sys_readdir+0xa0>
+   1668c:	2402ffff 	addiu	v0,zero,-1
+   16690:	00021023 	negu	v0,v0
+   16694:	ae220258 	sw	v0,600(s1)
+   16698:	08005993 	j	1664c <sys_readdir+0xa0>
+   1669c:	2402ffff 	addiu	v0,zero,-1
+
+000166a0 <sys_rmdir>:
+   166a0:	27bdffc8 	addiu	sp,sp,-56
+   166a4:	afbf0034 	sw	ra,52(sp)
+   166a8:	afb00030 	sw	s0,48(sp)
+   166ac:	00801021 	addu	v0,a0,zero
+   166b0:	40042002 	mfc0	a0,$4,2
+   166b4:	40032002 	mfc0	v1,$4,2
+   166b8:	1040002a 	beqz	v0,16764 <sys_rmdir+0xc4>
+   166bc:	8c700180 	lw	s0,384(v1)
+   166c0:	afa20010 	sw	v0,16(sp)
+   166c4:	3c020001 	lui	v0,0x1
+   166c8:	2442bf70 	addiu	v0,v0,-16528
+   166cc:	afa20018 	sw	v0,24(sp)
+   166d0:	3c020001 	lui	v0,0x1
+   166d4:	2442bee4 	addiu	v0,v0,-16668
+   166d8:	afa2001c 	sw	v0,28(sp)
+   166dc:	3c020001 	lui	v0,0x1
+   166e0:	2442be2c 	addiu	v0,v0,-16852
+   166e4:	afa20024 	sw	v0,36(sp)
+   166e8:	3c020001 	lui	v0,0x1
+   166ec:	2442bd0c 	addiu	v0,v0,-17140
+   166f0:	afa20020 	sw	v0,32(sp)
+   166f4:	261000b0 	addiu	s0,s0,176
+   166f8:	3c020001 	lui	v0,0x1
+   166fc:	02002021 	addu	a0,s0,zero
+   16700:	2442beb0 	addiu	v0,v0,-16720
+   16704:	afa20028 	sw	v0,40(sp)
+   16708:	0c004408 	jal	11020 <rwlock_wrlock>
+   1670c:	afa00014 	sw	zero,20(sp)
+   16710:	40022002 	mfc0	v0,$4,2
+   16714:	8c440180 	lw	a0,384(v0)
+   16718:	27a50010 	addiu	a1,sp,16
+   1671c:	0c00a436 	jal	290d8 <vfs_rmdir>
+   16720:	2484054c 	addiu	a0,a0,1356
+   16724:	14400008 	bnez	v0,16748 <sys_rmdir+0xa8>
+   16728:	00000000 	sll	zero,zero,0x0
+   1672c:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   16730:	02002021 	addu	a0,s0,zero
+   16734:	00001021 	addu	v0,zero,zero
+   16738:	8fbf0034 	lw	ra,52(sp)
+   1673c:	8fb00030 	lw	s0,48(sp)
+   16740:	03e00008 	jr	ra
+   16744:	27bd0038 	addiu	sp,sp,56
+   16748:	40032002 	mfc0	v1,$4,2
+   1674c:	04400009 	bltz	v0,16774 <sys_rmdir+0xd4>
+   16750:	ac620258 	sw	v0,600(v1)
+   16754:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   16758:	02002021 	addu	a0,s0,zero
+   1675c:	080059ce 	j	16738 <sys_rmdir+0x98>
+   16760:	2402ffff 	addiu	v0,zero,-1
+   16764:	24020016 	addiu	v0,zero,22
+   16768:	ac820258 	sw	v0,600(a0)
+   1676c:	080059ce 	j	16738 <sys_rmdir+0x98>
+   16770:	2402ffff 	addiu	v0,zero,-1
+   16774:	00021023 	negu	v0,v0
+   16778:	080059d5 	j	16754 <sys_rmdir+0xb4>
+   1677c:	ac620258 	sw	v0,600(v1)
+
+00016780 <rwlock_kmem_init>:
+   16780:	24030016 	addiu	v1,zero,22
+   16784:	ac830000 	sw	v1,0(a0)
+   16788:	3c030003 	lui	v1,0x3
+   1678c:	246363f0 	addiu	v1,v1,25584
+   16790:	24020002 	addiu	v0,zero,2
+   16794:	ac830004 	sw	v1,4(a0)
+   16798:	240300c0 	addiu	v1,zero,192
+   1679c:	ac820010 	sw	v0,16(a0)
+   167a0:	ac82000c 	sw	v0,12(a0)
+   167a4:	ac830008 	sw	v1,8(a0)
+   167a8:	ac80001c 	sw	zero,28(a0)
+   167ac:	ac800014 	sw	zero,20(a0)
+   167b0:	ac800018 	sw	zero,24(a0)
+   167b4:	03e00008 	jr	ra
+   167b8:	00001021 	addu	v0,zero,zero
+   167bc:	27bdff28 	addiu	sp,sp,-216
+   167c0:	afb000d0 	sw	s0,208(sp)
+   167c4:	afbf00d4 	sw	ra,212(sp)
+   167c8:	0c00616c 	jal	185b0 <task_lookup_zero>
+   167cc:	00808021 	addu	s0,a0,zero
+   167d0:	3c040003 	lui	a0,0x3
+   167d4:	248463fc 	addiu	a0,a0,25596
+   167d8:	00402821 	addu	a1,v0,zero
+   167dc:	02003021 	addu	a2,s0,zero
+   167e0:	0c008099 	jal	20264 <vmm_check_address>
+   167e4:	240700c0 	addiu	a3,zero,192
+   167e8:	10400005 	beqz	v0,16800 <rwlock_kmem_init+0x80>
+   167ec:	02002821 	addu	a1,s0,zero
+   167f0:	8fbf00d4 	lw	ra,212(sp)
+   167f4:	8fb000d0 	lw	s0,208(sp)
+   167f8:	03e00008 	jr	ra
+   167fc:	27bd00d8 	addiu	sp,sp,216
+   16800:	27a40010 	addiu	a0,sp,16
+   16804:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16808:	240600c0 	addiu	a2,zero,192
+   1680c:	1440fff8 	bnez	v0,167f0 <rwlock_kmem_init+0x70>
+   16810:	3c03d1a5 	lui	v1,0xd1a5
+   16814:	8fa200a0 	lw	v0,160(sp)
+   16818:	3463b1ef 	ori	v1,v1,0xb1ef
+   1681c:	8fbf00d4 	lw	ra,212(sp)
+   16820:	00431826 	xor	v1,v0,v1
+   16824:	24020016 	addiu	v0,zero,22
+   16828:	0003100a 	movz	v0,zero,v1
+   1682c:	8fb000d0 	lw	s0,208(sp)
+   16830:	03e00008 	jr	ra
+   16834:	27bd00d8 	addiu	sp,sp,216
+
+00016838 <sys_rwlock>:
+   16838:	27bdffb8 	addiu	sp,sp,-72
+   1683c:	afb10038 	sw	s1,56(sp)
+   16840:	afb00034 	sw	s0,52(sp)
+   16844:	afbf0044 	sw	ra,68(sp)
+   16848:	afb30040 	sw	s3,64(sp)
+   1684c:	afb2003c 	sw	s2,60(sp)
+   16850:	00808021 	addu	s0,a0,zero
+   16854:	00a08821 	addu	s1,a1,zero
+   16858:	40022002 	mfc0	v0,$4,2
+   1685c:	3c040003 	lui	a0,0x3
+   16860:	8c450180 	lw	a1,384(v0)
+   16864:	24846408 	addiu	a0,a0,25608
+   16868:	02003021 	addu	a2,s0,zero
+   1686c:	0c008099 	jal	20264 <vmm_check_address>
+   16870:	24070004 	addiu	a3,zero,4
+   16874:	1040000a 	beqz	v0,168a0 <sys_rwlock+0x68>
+   16878:	27b20010 	addiu	s2,sp,16
+   1687c:	40032002 	mfc0	v1,$4,2
+   16880:	ac620258 	sw	v0,600(v1)
+   16884:	8fbf0044 	lw	ra,68(sp)
+   16888:	8fb30040 	lw	s3,64(sp)
+   1688c:	8fb2003c 	lw	s2,60(sp)
+   16890:	8fb10038 	lw	s1,56(sp)
+   16894:	8fb00034 	lw	s0,52(sp)
+   16898:	03e00008 	jr	ra
+   1689c:	27bd0048 	addiu	sp,sp,72
+   168a0:	02402021 	addu	a0,s2,zero
+   168a4:	02002821 	addu	a1,s0,zero
+   168a8:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   168ac:	24060004 	addiu	a2,zero,4
+   168b0:	14400006 	bnez	v0,168cc <sys_rwlock+0x94>
+   168b4:	00409821 	addu	s3,v0,zero
+   168b8:	2e220007 	sltiu	v0,s1,7
+   168bc:	14400005 	bnez	v0,168d4 <sys_rwlock+0x9c>
+   168c0:	00118880 	sll	s1,s1,0x2
+   168c4:	08005a1f 	j	1687c <sys_rwlock+0x44>
+   168c8:	24020016 	addiu	v0,zero,22
+   168cc:	08005a1f 	j	1687c <sys_rwlock+0x44>
+   168d0:	02601021 	addu	v0,s3,zero
+   168d4:	3c020003 	lui	v0,0x3
+   168d8:	24426418 	addiu	v0,v0,25624
+   168dc:	00518821 	addu	s1,v0,s1
+   168e0:	8e220000 	lw	v0,0(s1)
+   168e4:	00400008 	jr	v0
+   168e8:	00000000 	sll	zero,zero,0x0
+   168ec:	0c0059ef 	jal	167bc <rwlock_kmem_init+0x3c>
+   168f0:	8fa40010 	lw	a0,16(sp)
+   168f4:	1440ffe1 	bnez	v0,1687c <sys_rwlock+0x44>
+   168f8:	02601021 	addu	v0,s3,zero
+   168fc:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   16900:	8fa40010 	lw	a0,16(sp)
+   16904:	1440ffdd 	bnez	v0,1687c <sys_rwlock+0x44>
+   16908:	00000000 	sll	zero,zero,0x0
+   1690c:	0c0059ef 	jal	167bc <rwlock_kmem_init+0x3c>
+   16910:	8fa40010 	lw	a0,16(sp)
+   16914:	1440ffd9 	bnez	v0,1687c <sys_rwlock+0x44>
+   16918:	02601021 	addu	v0,s3,zero
+   1691c:	0c004354 	jal	10d50 <rwlock_destroy>
+   16920:	8fa40010 	lw	a0,16(sp)
+   16924:	1440ffd5 	bnez	v0,1687c <sys_rwlock+0x44>
+   16928:	24030016 	addiu	v1,zero,22
+   1692c:	afa30014 	sw	v1,20(sp)
+   16930:	8fa30010 	lw	v1,16(sp)
+   16934:	27a40014 	addiu	a0,sp,20
+   16938:	afa20028 	sw	v0,40(sp)
+   1693c:	0c007134 	jal	1c4d0 <kmem_free>
+   16940:	afa30020 	sw	v1,32(sp)
+   16944:	08005a21 	j	16884 <sys_rwlock+0x4c>
+   16948:	8fa20028 	lw	v0,40(sp)
+   1694c:	0c0059ef 	jal	167bc <rwlock_kmem_init+0x3c>
+   16950:	8fa40010 	lw	a0,16(sp)
+   16954:	1440ffdd 	bnez	v0,168cc <sys_rwlock+0x94>
+   16958:	00000000 	sll	zero,zero,0x0
+   1695c:	0c004366 	jal	10d98 <rwlock_tryrdlock>
+   16960:	8fa40010 	lw	a0,16(sp)
+   16964:	08005a22 	j	16888 <sys_rwlock+0x50>
+   16968:	8fbf0044 	lw	ra,68(sp)
+   1696c:	0c0059ef 	jal	167bc <rwlock_kmem_init+0x3c>
+   16970:	8fa40010 	lw	a0,16(sp)
+   16974:	1440ffd5 	bnez	v0,168cc <sys_rwlock+0x94>
+   16978:	00000000 	sll	zero,zero,0x0
+   1697c:	0c004387 	jal	10e1c <rwlock_trywrlock>
+   16980:	8fa40010 	lw	a0,16(sp)
+   16984:	08005a22 	j	16888 <sys_rwlock+0x50>
+   16988:	8fbf0044 	lw	ra,68(sp)
+   1698c:	0c0059ef 	jal	167bc <rwlock_kmem_init+0x3c>
+   16990:	8fa40010 	lw	a0,16(sp)
+   16994:	1440ffcd 	bnez	v0,168cc <sys_rwlock+0x94>
+   16998:	00000000 	sll	zero,zero,0x0
+   1699c:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   169a0:	8fa40010 	lw	a0,16(sp)
+   169a4:	08005a22 	j	16888 <sys_rwlock+0x50>
+   169a8:	8fbf0044 	lw	ra,68(sp)
+   169ac:	0c0059ef 	jal	167bc <rwlock_kmem_init+0x3c>
+   169b0:	8fa40010 	lw	a0,16(sp)
+   169b4:	1440ffc5 	bnez	v0,168cc <sys_rwlock+0x94>
+   169b8:	00000000 	sll	zero,zero,0x0
+   169bc:	0c004408 	jal	11020 <rwlock_wrlock>
+   169c0:	8fa40010 	lw	a0,16(sp)
+   169c4:	08005a22 	j	16888 <sys_rwlock+0x50>
+   169c8:	8fbf0044 	lw	ra,68(sp)
+   169cc:	24020016 	addiu	v0,zero,22
+   169d0:	afa20014 	sw	v0,20(sp)
+   169d4:	240200c0 	addiu	v0,zero,192
+   169d8:	27b10014 	addiu	s1,sp,20
+   169dc:	afa20018 	sw	v0,24(sp)
+   169e0:	3c020022 	lui	v0,0x22
+   169e4:	34420040 	ori	v0,v0,0x40
+   169e8:	02202021 	addu	a0,s1,zero
+   169ec:	0c00713f 	jal	1c4fc <kmem_alloc>
+   169f0:	afa2001c 	sw	v0,28(sp)
+   169f4:	10400010 	beqz	v0,16a38 <sys_rwlock+0x200>
+   169f8:	00402021 	addu	a0,v0,zero
+   169fc:	0c004428 	jal	110a0 <rwlock_init>
+   16a00:	afa20010 	sw	v0,16(sp)
+   16a04:	1440ff9d 	bnez	v0,1687c <sys_rwlock+0x44>
+   16a08:	02002021 	addu	a0,s0,zero
+   16a0c:	02402821 	addu	a1,s2,zero
+   16a10:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   16a14:	24060004 	addiu	a2,zero,4
+   16a18:	1040ff98 	beqz	v0,1687c <sys_rwlock+0x44>
+   16a1c:	8fa30010 	lw	v1,16(sp)
+   16a20:	02202021 	addu	a0,s1,zero
+   16a24:	afa20028 	sw	v0,40(sp)
+   16a28:	0c007134 	jal	1c4d0 <kmem_free>
+   16a2c:	afa30020 	sw	v1,32(sp)
+   16a30:	08005a1f 	j	1687c <sys_rwlock+0x44>
+   16a34:	8fa20028 	lw	v0,40(sp)
+   16a38:	08005a1f 	j	1687c <sys_rwlock+0x44>
+   16a3c:	2402000c 	addiu	v0,zero,12
+
+00016a40 <sys_sbrk>:
+   16a40:	14a00003 	bnez	a1,16a50 <sys_sbrk+0x10>
+   16a44:	00a03021 	addu	a2,a1,zero
+   16a48:	03e00008 	jr	ra
+   16a4c:	3c020001 	lui	v0,0x1
+   16a50:	40022002 	mfc0	v0,$4,2
+   16a54:	8c420180 	lw	v0,384(v0)
+   16a58:	00802821 	addu	a1,a0,zero
+   16a5c:	00063300 	sll	a2,a2,0xc
+   16a60:	08008482 	j	21208 <vmm_sbrk>
+   16a64:	24440180 	addiu	a0,v0,384
+
+00016a68 <sem_kmem_init>:
+   16a68:	24030013 	addiu	v1,zero,19
+   16a6c:	ac830000 	sw	v1,0(a0)
+   16a70:	3c030003 	lui	v1,0x3
+   16a74:	24636434 	addiu	v1,v1,25652
+   16a78:	24020002 	addiu	v0,zero,2
+   16a7c:	ac830004 	sw	v1,4(a0)
+   16a80:	24030040 	addiu	v1,zero,64
+   16a84:	ac820010 	sw	v0,16(a0)
+   16a88:	ac82000c 	sw	v0,12(a0)
+   16a8c:	ac830008 	sw	v1,8(a0)
+   16a90:	ac80001c 	sw	zero,28(a0)
+   16a94:	ac800014 	sw	zero,20(a0)
+   16a98:	ac800018 	sw	zero,24(a0)
+   16a9c:	03e00008 	jr	ra
+   16aa0:	00001021 	addu	v0,zero,zero
+
+00016aa4 <sys_sem>:
+   16aa4:	27bdff78 	addiu	sp,sp,-136
+   16aa8:	afb50080 	sw	s5,128(sp)
+   16aac:	afb20074 	sw	s2,116(sp)
+   16ab0:	afb10070 	sw	s1,112(sp)
+   16ab4:	afbf0084 	sw	ra,132(sp)
+   16ab8:	afb4007c 	sw	s4,124(sp)
+   16abc:	afb30078 	sw	s3,120(sp)
+   16ac0:	afb0006c 	sw	s0,108(sp)
+   16ac4:	00808821 	addu	s1,a0,zero
+   16ac8:	00a09021 	addu	s2,a1,zero
+   16acc:	00e0a821 	addu	s5,a3,zero
+   16ad0:	40022002 	mfc0	v0,$4,2
+   16ad4:	8c530180 	lw	s3,384(v0)
+   16ad8:	3c040003 	lui	a0,0x3
+   16adc:	24845f50 	addiu	a0,a0,24400
+   16ae0:	02602821 	addu	a1,s3,zero
+   16ae4:	02203021 	addu	a2,s1,zero
+   16ae8:	0c008099 	jal	20264 <vmm_check_address>
+   16aec:	24070004 	addiu	a3,zero,4
+   16af0:	1440000c 	bnez	v0,16b24 <sys_sem+0x80>
+   16af4:	00408021 	addu	s0,v0,zero
+   16af8:	27b40010 	addiu	s4,sp,16
+   16afc:	02802021 	addu	a0,s4,zero
+   16b00:	02202821 	addu	a1,s1,zero
+   16b04:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16b08:	24060004 	addiu	a2,zero,4
+   16b0c:	14400005 	bnez	v0,16b24 <sys_sem+0x80>
+   16b10:	00408021 	addu	s0,v0,zero
+   16b14:	2e420006 	sltiu	v0,s2,6
+   16b18:	1440000e 	bnez	v0,16b54 <sys_sem+0xb0>
+   16b1c:	3c020003 	lui	v0,0x3
+   16b20:	24100016 	addiu	s0,zero,22
+   16b24:	40022002 	mfc0	v0,$4,2
+   16b28:	ac500258 	sw	s0,600(v0)
+   16b2c:	2402ffff 	addiu	v0,zero,-1
+   16b30:	8fbf0084 	lw	ra,132(sp)
+   16b34:	8fb50080 	lw	s5,128(sp)
+   16b38:	8fb4007c 	lw	s4,124(sp)
+   16b3c:	8fb30078 	lw	s3,120(sp)
+   16b40:	8fb20074 	lw	s2,116(sp)
+   16b44:	8fb10070 	lw	s1,112(sp)
+   16b48:	8fb0006c 	lw	s0,108(sp)
+   16b4c:	03e00008 	jr	ra
+   16b50:	27bd0088 	addiu	sp,sp,136
+   16b54:	2442645c 	addiu	v0,v0,25692
+   16b58:	00129080 	sll	s2,s2,0x2
+   16b5c:	00529021 	addu	s2,v0,s2
+   16b60:	8e420000 	lw	v0,0(s2)
+   16b64:	00400008 	jr	v0
+   16b68:	00000000 	sll	zero,zero,0x0
+   16b6c:	0c00616c 	jal	185b0 <task_lookup_zero>
+   16b70:	8fb10010 	lw	s1,16(sp)
+   16b74:	3c040003 	lui	a0,0x3
+   16b78:	24845f5c 	addiu	a0,a0,24412
+   16b7c:	00402821 	addu	a1,v0,zero
+   16b80:	02203021 	addu	a2,s1,zero
+   16b84:	0c008099 	jal	20264 <vmm_check_address>
+   16b88:	24070040 	addiu	a3,zero,64
+   16b8c:	1440ffe5 	bnez	v0,16b24 <sys_sem+0x80>
+   16b90:	02202821 	addu	a1,s1,zero
+   16b94:	27a40028 	addiu	a0,sp,40
+   16b98:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16b9c:	24060040 	addiu	a2,zero,64
+   16ba0:	1440ffe0 	bnez	v0,16b24 <sys_sem+0x80>
+   16ba4:	3c02a0b1 	lui	v0,0xa0b1
+   16ba8:	8fa30038 	lw	v1,56(sp)
+   16bac:	3442c0b3 	ori	v0,v0,0xc0b3
+   16bb0:	1462ffdc 	bne	v1,v0,16b24 <sys_sem+0x80>
+   16bb4:	00000000 	sll	zero,zero,0x0
+   16bb8:	0c0047d0 	jal	11f40 <sem_post>
+   16bbc:	8fa40010 	lw	a0,16(sp)
+   16bc0:	1440ffd8 	bnez	v0,16b24 <sys_sem+0x80>
+   16bc4:	00408021 	addu	s0,v0,zero
+   16bc8:	00001021 	addu	v0,zero,zero
+   16bcc:	8fbf0084 	lw	ra,132(sp)
+   16bd0:	8fb50080 	lw	s5,128(sp)
+   16bd4:	8fb4007c 	lw	s4,124(sp)
+   16bd8:	8fb30078 	lw	s3,120(sp)
+   16bdc:	8fb20074 	lw	s2,116(sp)
+   16be0:	8fb10070 	lw	s1,112(sp)
+   16be4:	8fb0006c 	lw	s0,108(sp)
+   16be8:	03e00008 	jr	ra
+   16bec:	27bd0088 	addiu	sp,sp,136
+   16bf0:	0c00616c 	jal	185b0 <task_lookup_zero>
+   16bf4:	8fb10010 	lw	s1,16(sp)
+   16bf8:	3c040003 	lui	a0,0x3
+   16bfc:	24845f5c 	addiu	a0,a0,24412
+   16c00:	00402821 	addu	a1,v0,zero
+   16c04:	02203021 	addu	a2,s1,zero
+   16c08:	0c008099 	jal	20264 <vmm_check_address>
+   16c0c:	24070040 	addiu	a3,zero,64
+   16c10:	1440ffc4 	bnez	v0,16b24 <sys_sem+0x80>
+   16c14:	02202821 	addu	a1,s1,zero
+   16c18:	27a40028 	addiu	a0,sp,40
+   16c1c:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16c20:	24060040 	addiu	a2,zero,64
+   16c24:	1440ffbf 	bnez	v0,16b24 <sys_sem+0x80>
+   16c28:	3c02a0b1 	lui	v0,0xa0b1
+   16c2c:	8fa30038 	lw	v1,56(sp)
+   16c30:	3442c0b3 	ori	v0,v0,0xc0b3
+   16c34:	1462ffbb 	bne	v1,v0,16b24 <sys_sem+0x80>
+   16c38:	00000000 	sll	zero,zero,0x0
+   16c3c:	0c00479f 	jal	11e7c <sem_trywait>
+   16c40:	8fa40010 	lw	a0,16(sp)
+   16c44:	08005acd 	j	16b34 <sys_sem+0x90>
+   16c48:	8fbf0084 	lw	ra,132(sp)
+   16c4c:	0c00616c 	jal	185b0 <task_lookup_zero>
+   16c50:	8fb10010 	lw	s1,16(sp)
+   16c54:	3c040003 	lui	a0,0x3
+   16c58:	24845f5c 	addiu	a0,a0,24412
+   16c5c:	00402821 	addu	a1,v0,zero
+   16c60:	02203021 	addu	a2,s1,zero
+   16c64:	0c008099 	jal	20264 <vmm_check_address>
+   16c68:	24070040 	addiu	a3,zero,64
+   16c6c:	1440ffad 	bnez	v0,16b24 <sys_sem+0x80>
+   16c70:	02202821 	addu	a1,s1,zero
+   16c74:	27a40028 	addiu	a0,sp,40
+   16c78:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16c7c:	24060040 	addiu	a2,zero,64
+   16c80:	1440ffa8 	bnez	v0,16b24 <sys_sem+0x80>
+   16c84:	3c02a0b1 	lui	v0,0xa0b1
+   16c88:	8fa30038 	lw	v1,56(sp)
+   16c8c:	3442c0b3 	ori	v0,v0,0xc0b3
+   16c90:	1462ffa4 	bne	v1,v0,16b24 <sys_sem+0x80>
+   16c94:	00000000 	sll	zero,zero,0x0
+   16c98:	0c004805 	jal	12014 <sem_wait>
+   16c9c:	8fa40010 	lw	a0,16(sp)
+   16ca0:	1440ffa0 	bnez	v0,16b24 <sys_sem+0x80>
+   16ca4:	00408021 	addu	s0,v0,zero
+   16ca8:	08005af3 	j	16bcc <sys_sem+0x128>
+   16cac:	00001021 	addu	v0,zero,zero
+   16cb0:	0c00616c 	jal	185b0 <task_lookup_zero>
+   16cb4:	8fb10010 	lw	s1,16(sp)
+   16cb8:	3c040003 	lui	a0,0x3
+   16cbc:	24845f5c 	addiu	a0,a0,24412
+   16cc0:	00402821 	addu	a1,v0,zero
+   16cc4:	02203021 	addu	a2,s1,zero
+   16cc8:	0c008099 	jal	20264 <vmm_check_address>
+   16ccc:	24070040 	addiu	a3,zero,64
+   16cd0:	1440ff94 	bnez	v0,16b24 <sys_sem+0x80>
+   16cd4:	02202821 	addu	a1,s1,zero
+   16cd8:	27a40028 	addiu	a0,sp,40
+   16cdc:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16ce0:	24060040 	addiu	a2,zero,64
+   16ce4:	1440ff8f 	bnez	v0,16b24 <sys_sem+0x80>
+   16ce8:	3c02a0b1 	lui	v0,0xa0b1
+   16cec:	8fa30038 	lw	v1,56(sp)
+   16cf0:	3442c0b3 	ori	v0,v0,0xc0b3
+   16cf4:	1462ff8b 	bne	v1,v0,16b24 <sys_sem+0x80>
+   16cf8:	3c040003 	lui	a0,0x3
+   16cfc:	24846450 	addiu	a0,a0,25680
+   16d00:	02602821 	addu	a1,s3,zero
+   16d04:	02a03021 	addu	a2,s5,zero
+   16d08:	0c008099 	jal	20264 <vmm_check_address>
+   16d0c:	24070004 	addiu	a3,zero,4
+   16d10:	1440ff84 	bnez	v0,16b24 <sys_sem+0x80>
+   16d14:	00408021 	addu	s0,v0,zero
+   16d18:	27b10014 	addiu	s1,sp,20
+   16d1c:	8fa40010 	lw	a0,16(sp)
+   16d20:	0c004780 	jal	11e00 <sem_getvalue>
+   16d24:	02202821 	addu	a1,s1,zero
+   16d28:	1440ff7e 	bnez	v0,16b24 <sys_sem+0x80>
+   16d2c:	00408021 	addu	s0,v0,zero
+   16d30:	02a02021 	addu	a0,s5,zero
+   16d34:	02202821 	addu	a1,s1,zero
+   16d38:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   16d3c:	24060004 	addiu	a2,zero,4
+   16d40:	1440ff78 	bnez	v0,16b24 <sys_sem+0x80>
+   16d44:	00408021 	addu	s0,v0,zero
+   16d48:	08005af3 	j	16bcc <sys_sem+0x128>
+   16d4c:	00001021 	addu	v0,zero,zero
+   16d50:	3c040003 	lui	a0,0x3
+   16d54:	24846444 	addiu	a0,a0,25668
+   16d58:	02602821 	addu	a1,s3,zero
+   16d5c:	02a03021 	addu	a2,s5,zero
+   16d60:	0c008099 	jal	20264 <vmm_check_address>
+   16d64:	24070004 	addiu	a3,zero,4
+   16d68:	1440ff6e 	bnez	v0,16b24 <sys_sem+0x80>
+   16d6c:	00408021 	addu	s0,v0,zero
+   16d70:	02a02821 	addu	a1,s5,zero
+   16d74:	27a40014 	addiu	a0,sp,20
+   16d78:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16d7c:	24060004 	addiu	a2,zero,4
+   16d80:	1440ff68 	bnez	v0,16b24 <sys_sem+0x80>
+   16d84:	00408021 	addu	s0,v0,zero
+   16d88:	24020013 	addiu	v0,zero,19
+   16d8c:	afa20018 	sw	v0,24(sp)
+   16d90:	24020040 	addiu	v0,zero,64
+   16d94:	27b20018 	addiu	s2,sp,24
+   16d98:	afa2001c 	sw	v0,28(sp)
+   16d9c:	3c020022 	lui	v0,0x22
+   16da0:	34420040 	ori	v0,v0,0x40
+   16da4:	02402021 	addu	a0,s2,zero
+   16da8:	0c00713f 	jal	1c4fc <kmem_alloc>
+   16dac:	afa20020 	sw	v0,32(sp)
+   16db0:	1040003a 	beqz	v0,16e9c <sys_sem+0x3f8>
+   16db4:	8fa50014 	lw	a1,20(sp)
+   16db8:	00402021 	addu	a0,v0,zero
+   16dbc:	24060002 	addiu	a2,zero,2
+   16dc0:	0c00483b 	jal	120ec <sem_init>
+   16dc4:	afa20010 	sw	v0,16(sp)
+   16dc8:	1440ff56 	bnez	v0,16b24 <sys_sem+0x80>
+   16dcc:	00408021 	addu	s0,v0,zero
+   16dd0:	02202021 	addu	a0,s1,zero
+   16dd4:	02802821 	addu	a1,s4,zero
+   16dd8:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   16ddc:	24060004 	addiu	a2,zero,4
+   16de0:	1040ff79 	beqz	v0,16bc8 <sys_sem+0x124>
+   16de4:	00408021 	addu	s0,v0,zero
+   16de8:	8fa20010 	lw	v0,16(sp)
+   16dec:	02402021 	addu	a0,s2,zero
+   16df0:	0c007134 	jal	1c4d0 <kmem_free>
+   16df4:	afa20024 	sw	v0,36(sp)
+   16df8:	08005ac9 	j	16b24 <sys_sem+0x80>
+   16dfc:	00000000 	sll	zero,zero,0x0
+   16e00:	0c00616c 	jal	185b0 <task_lookup_zero>
+   16e04:	8fb10010 	lw	s1,16(sp)
+   16e08:	3c040003 	lui	a0,0x3
+   16e0c:	24845f5c 	addiu	a0,a0,24412
+   16e10:	00402821 	addu	a1,v0,zero
+   16e14:	02203021 	addu	a2,s1,zero
+   16e18:	0c008099 	jal	20264 <vmm_check_address>
+   16e1c:	24070040 	addiu	a3,zero,64
+   16e20:	1440ff40 	bnez	v0,16b24 <sys_sem+0x80>
+   16e24:	02202821 	addu	a1,s1,zero
+   16e28:	27a40028 	addiu	a0,sp,40
+   16e2c:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   16e30:	24060040 	addiu	a2,zero,64
+   16e34:	1440ff3b 	bnez	v0,16b24 <sys_sem+0x80>
+   16e38:	3c02a0b1 	lui	v0,0xa0b1
+   16e3c:	8fa30038 	lw	v1,56(sp)
+   16e40:	3442c0b3 	ori	v0,v0,0xc0b3
+   16e44:	1462ff37 	bne	v1,v0,16b24 <sys_sem+0x80>
+   16e48:	00000000 	sll	zero,zero,0x0
+   16e4c:	0c004784 	jal	11e10 <sem_destroy>
+   16e50:	8fa40010 	lw	a0,16(sp)
+   16e54:	1440ff33 	bnez	v0,16b24 <sys_sem+0x80>
+   16e58:	00408021 	addu	s0,v0,zero
+   16e5c:	24020013 	addiu	v0,zero,19
+   16e60:	afa20018 	sw	v0,24(sp)
+   16e64:	8fa20010 	lw	v0,16(sp)
+   16e68:	27a40018 	addiu	a0,sp,24
+   16e6c:	0c007134 	jal	1c4d0 <kmem_free>
+   16e70:	afa20024 	sw	v0,36(sp)
+   16e74:	8fbf0084 	lw	ra,132(sp)
+   16e78:	00001021 	addu	v0,zero,zero
+   16e7c:	8fb50080 	lw	s5,128(sp)
+   16e80:	8fb4007c 	lw	s4,124(sp)
+   16e84:	8fb30078 	lw	s3,120(sp)
+   16e88:	8fb20074 	lw	s2,116(sp)
+   16e8c:	8fb10070 	lw	s1,112(sp)
+   16e90:	8fb0006c 	lw	s0,108(sp)
+   16e94:	03e00008 	jr	ra
+   16e98:	27bd0088 	addiu	sp,sp,136
+   16e9c:	08005ac9 	j	16b24 <sys_sem+0x80>
+   16ea0:	2410000c 	addiu	s0,zero,12
+
+00016ea4 <sys_signal>:
+   16ea4:	40032002 	mfc0	v1,$4,2
+   16ea8:	2482ffff 	addiu	v0,a0,-1
+   16eac:	2c42001f 	sltiu	v0,v0,31
+   16eb0:	1040000e 	beqz	v0,16eec <sys_signal+0x48>
+   16eb4:	24020016 	addiu	v0,zero,22
+   16eb8:	24020009 	addiu	v0,zero,9
+   16ebc:	1082000b 	beq	a0,v0,16eec <sys_signal+0x48>
+   16ec0:	24020016 	addiu	v0,zero,22
+   16ec4:	24020011 	addiu	v0,zero,17
+   16ec8:	10820007 	beq	a0,v0,16ee8 <sys_signal+0x44>
+   16ecc:	248401d4 	addiu	a0,a0,468
+   16ed0:	8c620180 	lw	v0,384(v1)
+   16ed4:	00042080 	sll	a0,a0,0x2
+   16ed8:	00442021 	addu	a0,v0,a0
+   16edc:	8c820000 	lw	v0,0(a0)
+   16ee0:	03e00008 	jr	ra
+   16ee4:	ac850000 	sw	a1,0(a0)
+   16ee8:	24020016 	addiu	v0,zero,22
+   16eec:	ac620258 	sw	v0,600(v1)
+   16ef0:	03e00008 	jr	ra
+   16ef4:	2402ffff 	addiu	v0,zero,-1
+
+00016ef8 <sys_kill>:
+   16ef8:	24a2ffff 	addiu	v0,a1,-1
+   16efc:	27bdffe0 	addiu	sp,sp,-32
+   16f00:	2c42001f 	sltiu	v0,v0,31
+   16f04:	afb00018 	sw	s0,24(sp)
+   16f08:	afbf001c 	sw	ra,28(sp)
+   16f0c:	00a03021 	addu	a2,a1,zero
+   16f10:	10400015 	beqz	v0,16f68 <sys_kill+0x70>
+   16f14:	00808021 	addu	s0,a0,zero
+   16f18:	3c030004 	lui	v1,0x4
+   16f1c:	2462c960 	addiu	v0,v1,-13984
+   16f20:	88450003 	lwl	a1,3(v0)
+   16f24:	00041282 	srl	v0,a0,0xa
+   16f28:	9865c960 	lwr	a1,-13984(v1)
+   16f2c:	30a5ffff 	andi	a1,a1,0xffff
+   16f30:	10450005 	beq	v0,a1,16f48 <sys_kill+0x50>
+   16f34:	00000000 	sll	zero,zero,0x0
+   16f38:	0c006688 	jal	19a20 <task_whereis>
+   16f3c:	afa60010 	sw	a2,16(sp)
+   16f40:	8fa60010 	lw	a2,16(sp)
+   16f44:	00402821 	addu	a1,v0,zero
+   16f48:	0c00490f 	jal	1243c <signal_rise>
+   16f4c:	02002021 	addu	a0,s0,zero
+   16f50:	14400006 	bnez	v0,16f6c <sys_kill+0x74>
+   16f54:	00000000 	sll	zero,zero,0x0
+   16f58:	8fbf001c 	lw	ra,28(sp)
+   16f5c:	8fb00018 	lw	s0,24(sp)
+   16f60:	03e00008 	jr	ra
+   16f64:	27bd0020 	addiu	sp,sp,32
+   16f68:	24020016 	addiu	v0,zero,22
+   16f6c:	40032002 	mfc0	v1,$4,2
+   16f70:	ac620258 	sw	v0,600(v1)
+   16f74:	08005bd6 	j	16f58 <sys_kill+0x60>
+   16f78:	2402ffff 	addiu	v0,zero,-1
+
+00016f7c <sys_sigreturn_setup>:
+   16f7c:	27bdffe8 	addiu	sp,sp,-24
+   16f80:	afbf0014 	sw	ra,20(sp)
+   16f84:	00802821 	addu	a1,a0,zero
+   16f88:	40042002 	mfc0	a0,$4,2
+   16f8c:	ac850328 	sw	a1,808(a0)
+   16f90:	0c00044f 	jal	113c <cpu_context_set_sigreturn>
+   16f94:	24840188 	addiu	a0,a0,392
+   16f98:	8fbf0014 	lw	ra,20(sp)
+   16f9c:	00001021 	addu	v0,zero,zero
+   16fa0:	03e00008 	jr	ra
+   16fa4:	27bd0018 	addiu	sp,sp,24
+
+00016fa8 <sys_stat>:
+   16fa8:	27bdffb8 	addiu	sp,sp,-72
+   16fac:	afb00034 	sw	s0,52(sp)
+   16fb0:	afbf0044 	sw	ra,68(sp)
+   16fb4:	afb30040 	sw	s3,64(sp)
+   16fb8:	afb2003c 	sw	s2,60(sp)
+   16fbc:	afb10038 	sw	s1,56(sp)
+   16fc0:	00801021 	addu	v0,a0,zero
+   16fc4:	00a08021 	addu	s0,a1,zero
+   16fc8:	40122002 	mfc0	s2,$4,2
+   16fcc:	40032002 	mfc0	v1,$4,2
+   16fd0:	10a0004a 	beqz	a1,170fc <sys_stat+0x154>
+   16fd4:	8c710180 	lw	s1,384(v1)
+   16fd8:	10800046 	beqz	a0,170f4 <sys_stat+0x14c>
+   16fdc:	2403ffff 	addiu	v1,zero,-1
+   16fe0:	2a034000 	slti	v1,s0,16384
+   16fe4:	14600049 	bnez	v1,1710c <sys_stat+0x164>
+   16fe8:	3c038000 	lui	v1,0x8000
+   16fec:	34630001 	ori	v1,v1,0x1
+   16ff0:	0203182b 	sltu	v1,s0,v1
+   16ff4:	10600045 	beqz	v1,1710c <sys_stat+0x164>
+   16ff8:	00000000 	sll	zero,zero,0x0
+   16ffc:	10400026 	beqz	v0,17098 <sys_stat+0xf0>
+   17000:	afa00010 	sw	zero,16(sp)
+   17004:	afa20014 	sw	v0,20(sp)
+   17008:	3c020001 	lui	v0,0x1
+   1700c:	2442bf70 	addiu	v0,v0,-16528
+   17010:	afa2001c 	sw	v0,28(sp)
+   17014:	3c020001 	lui	v0,0x1
+   17018:	2442bee4 	addiu	v0,v0,-16668
+   1701c:	afa20020 	sw	v0,32(sp)
+   17020:	3c020001 	lui	v0,0x1
+   17024:	2442be2c 	addiu	v0,v0,-16852
+   17028:	afa20028 	sw	v0,40(sp)
+   1702c:	3c020001 	lui	v0,0x1
+   17030:	2442bd0c 	addiu	v0,v0,-17140
+   17034:	263300b0 	addiu	s3,s1,176
+   17038:	afa20024 	sw	v0,36(sp)
+   1703c:	3c020001 	lui	v0,0x1
+   17040:	02602021 	addu	a0,s3,zero
+   17044:	2442beb0 	addiu	v0,v0,-16720
+   17048:	afa2002c 	sw	v0,44(sp)
+   1704c:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   17050:	afa00018 	sw	zero,24(sp)
+   17054:	2624054c 	addiu	a0,s1,1356
+   17058:	02003021 	addu	a2,s0,zero
+   1705c:	27a50014 	addiu	a1,sp,20
+   17060:	0c00a5d7 	jal	2975c <vfs_stat>
+   17064:	00003821 	addu	a3,zero,zero
+   17068:	02602021 	addu	a0,s3,zero
+   1706c:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   17070:	00408021 	addu	s0,v0,zero
+   17074:	ae500258 	sw	s0,600(s2)
+   17078:	00001021 	addu	v0,zero,zero
+   1707c:	8fbf0044 	lw	ra,68(sp)
+   17080:	8fb30040 	lw	s3,64(sp)
+   17084:	8fb2003c 	lw	s2,60(sp)
+   17088:	8fb10038 	lw	s1,56(sp)
+   1708c:	8fb00034 	lw	s0,52(sp)
+   17090:	03e00008 	jr	ra
+   17094:	27bd0048 	addiu	sp,sp,72
+   17098:	28c20008 	slti	v0,a2,8
+   1709c:	14400009 	bnez	v0,170c4 <sys_stat+0x11c>
+   170a0:	00c02821 	addu	a1,a2,zero
+   170a4:	8fbf0044 	lw	ra,68(sp)
+   170a8:	2402004d 	addiu	v0,zero,77
+   170ac:	8fb30040 	lw	s3,64(sp)
+   170b0:	8fb2003c 	lw	s2,60(sp)
+   170b4:	8fb10038 	lw	s1,56(sp)
+   170b8:	8fb00034 	lw	s0,52(sp)
+   170bc:	03e00008 	jr	ra
+   170c0:	27bd0048 	addiu	sp,sp,72
+   170c4:	02202021 	addu	a0,s1,zero
+   170c8:	0c0061dc 	jal	18770 <task_fd_lookup>
+   170cc:	27a60010 	addiu	a2,sp,16
+   170d0:	1440fff5 	bnez	v0,170a8 <sys_stat+0x100>
+   170d4:	8fbf0044 	lw	ra,68(sp)
+   170d8:	8fa70010 	lw	a3,16(sp)
+   170dc:	02003021 	addu	a2,s0,zero
+   170e0:	2624054c 	addiu	a0,s1,1356
+   170e4:	0c00a5d7 	jal	2975c <vfs_stat>
+   170e8:	00002821 	addu	a1,zero,zero
+   170ec:	08005c1d 	j	17074 <sys_stat+0xcc>
+   170f0:	00408021 	addu	s0,v0,zero
+   170f4:	14c3ffbb 	bne	a2,v1,16fe4 <sys_stat+0x3c>
+   170f8:	2a034000 	slti	v1,s0,16384
+   170fc:	24020016 	addiu	v0,zero,22
+   17100:	ae420258 	sw	v0,600(s2)
+   17104:	08005c1f 	j	1707c <sys_stat+0xd4>
+   17108:	2402ffff 	addiu	v0,zero,-1
+   1710c:	24020001 	addiu	v0,zero,1
+   17110:	ae420258 	sw	v0,600(s2)
+   17114:	08005c1f 	j	1707c <sys_stat+0xd4>
+   17118:	2402ffff 	addiu	v0,zero,-1
+
+0001711c <do_thread_create>:
+   1711c:	27bdffb8 	addiu	sp,sp,-72
+   17120:	3c020004 	lui	v0,0x4
+   17124:	afb20034 	sw	s2,52(sp)
+   17128:	afb10030 	sw	s1,48(sp)
+   1712c:	afb0002c 	sw	s0,44(sp)
+   17130:	afbf0044 	sw	ra,68(sp)
+   17134:	afb50040 	sw	s5,64(sp)
+   17138:	afb4003c 	sw	s4,60(sp)
+   1713c:	afb30038 	sw	s3,56(sp)
+   17140:	2443c960 	addiu	v1,v0,-13984
+   17144:	88630003 	lwl	v1,3(v1)
+   17148:	8c91004c 	lw	s1,76(a0)
+   1714c:	9843c960 	lwr	v1,-13984(v0)
+   17150:	96270038 	lhu	a3,56(s1)
+   17154:	3063ffff 	andi	v1,v1,0xffff
+   17158:	00809021 	addu	s2,a0,zero
+   1715c:	10e30007 	beq	a3,v1,1717c <do_thread_create+0x60>
+   17160:	8c900050 	lw	s0,80(a0)
+   17164:	3c020004 	lui	v0,0x4
+   17168:	3c060003 	lui	a2,0x3
+   1716c:	8c449100 	lw	a0,-28416(v0)
+   17170:	24c66474 	addiu	a2,a2,25716
+   17174:	0c0009b0 	jal	26c0 <__fprintk>
+   17178:	00002821 	addu	a1,zero,zero
+   1717c:	3c130004 	lui	s3,0x4
+   17180:	26736db0 	addiu	s3,s3,28080
+   17184:	8e640400 	lw	a0,1024(s3)
+   17188:	8e25003c 	lw	a1,60(s1)
+   1718c:	0c0028ea 	jal	a3a8 <dqdt_update_threads_number>
+   17190:	24060001 	addiu	a2,zero,1
+   17194:	8e220010 	lw	v0,16(s1)
+   17198:	10400071 	beqz	v0,17360 <do_thread_create+0x244>
+   1719c:	24071000 	addiu	a3,zero,4096
+   171a0:	ae200008 	sw	zero,8(s1)
+   171a4:	02002021 	addu	a0,s0,zero
+   171a8:	02202821 	addu	a1,s1,zero
+   171ac:	0c00683c 	jal	1a0f0 <thread_create>
+   171b0:	27a60020 	addiu	a2,sp,32
+   171b4:	14400040 	bnez	v0,172b8 <do_thread_create+0x19c>
+   171b8:	0040a021 	addu	s4,v0,zero
+   171bc:	8e420008 	lw	v0,8(s2)
+   171c0:	14400038 	bnez	v0,172a4 <do_thread_create+0x188>
+   171c4:	8fa20020 	lw	v0,32(sp)
+   171c8:	8c430134 	lw	v1,308(v0)
+   171cc:	34630040 	ori	v1,v1,0x40
+   171d0:	ac430134 	sw	v1,308(v0)
+   171d4:	8e430048 	lw	v1,72(s2)
+   171d8:	261100a0 	addiu	s1,s0,160
+   171dc:	ac4302f8 	sw	v1,760(v0)
+   171e0:	8e430048 	lw	v1,72(s2)
+   171e4:	02202021 	addu	a0,s1,zero
+   171e8:	0c004bc3 	jal	12f0c <spinlock_lock>
+   171ec:	ac430300 	sw	v1,768(v0)
+   171f0:	8e02062c 	lw	v0,1580(s0)
+   171f4:	8e03063c 	lw	v1,1596(s0)
+   171f8:	24420001 	addiu	v0,v0,1
+   171fc:	ae02062c 	sw	v0,1580(s0)
+   17200:	8e440048 	lw	a0,72(s2)
+   17204:	8fa20020 	lw	v0,32(sp)
+   17208:	0083282b 	sltu	a1,a0,v1
+   1720c:	0085180a 	movz	v1,a0,a1
+   17210:	ae03063c 	sw	v1,1596(s0)
+   17214:	8c4602f8 	lw	a2,760(v0)
+   17218:	8e030748 	lw	v1,1864(s0)
+   1721c:	8e050740 	lw	a1,1856(s0)
+   17220:	8c640000 	lw	a0,0(v1)
+   17224:	00063080 	sll	a2,a2,0x2
+   17228:	00a63021 	addu	a2,a1,a2
+   1722c:	244501f0 	addiu	a1,v0,496
+   17230:	ac4301f4 	sw	v1,500(v0)
+   17234:	acc20000 	sw	v0,0(a2)
+   17238:	ac850004 	sw	a1,4(a0)
+   1723c:	ac4401f0 	sw	a0,496(v0)
+   17240:	ac650000 	sw	a1,0(v1)
+   17244:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   17248:	02202021 	addu	a0,s1,zero
+   1724c:	0c004715 	jal	11c54 <sched_register>
+   17250:	8fa40020 	lw	a0,32(sp)
+   17254:	8fa20020 	lw	v0,32(sp)
+   17258:	00402021 	addu	a0,v0,zero
+   1725c:	0c006c6a 	jal	1b1a8 <tm_create_compute>
+   17260:	ac400130 	sw	zero,304(v0)
+   17264:	8fa40020 	lw	a0,32(sp)
+   17268:	0c0044a5 	jal	11294 <sched_get_listner>
+   1726c:	24050200 	addiu	a1,zero,512
+   17270:	ae420010 	sw	v0,16(s2)
+   17274:	8fbf0044 	lw	ra,68(sp)
+   17278:	8fa20020 	lw	v0,32(sp)
+   1727c:	8fb50040 	lw	s5,64(sp)
+   17280:	ae42000c 	sw	v0,12(s2)
+   17284:	8fb30038 	lw	s3,56(sp)
+   17288:	02801021 	addu	v0,s4,zero
+   1728c:	8fb4003c 	lw	s4,60(sp)
+   17290:	8fb20034 	lw	s2,52(sp)
+   17294:	8fb10030 	lw	s1,48(sp)
+   17298:	8fb0002c 	lw	s0,44(sp)
+   1729c:	03e00008 	jr	ra
+   172a0:	27bd0048 	addiu	sp,sp,72
+   172a4:	2403ffbf 	addiu	v1,zero,-65
+   172a8:	8c440134 	lw	a0,308(v0)
+   172ac:	00831824 	and	v1,a0,v1
+   172b0:	08005c75 	j	171d4 <do_thread_create+0xb8>
+   172b4:	ac430134 	sw	v1,308(v0)
+   172b8:	261500a0 	addiu	s5,s0,160
+   172bc:	0c004bc3 	jal	12f0c <spinlock_lock>
+   172c0:	02a02021 	addu	a0,s5,zero
+   172c4:	8e020630 	lw	v0,1584(s0)
+   172c8:	24060001 	addiu	a2,zero,1
+   172cc:	2442ffff 	addiu	v0,v0,-1
+   172d0:	ae020630 	sw	v0,1584(s0)
+   172d4:	8e440048 	lw	a0,72(s2)
+   172d8:	8e020638 	lw	v0,1592(s0)
+   172dc:	00041942 	srl	v1,a0,0x5
+   172e0:	24630190 	addiu	v1,v1,400
+   172e4:	00031880 	sll	v1,v1,0x2
+   172e8:	02031821 	addu	v1,s0,v1
+   172ec:	8c650000 	lw	a1,0(v1)
+   172f0:	00862004 	sllv	a0,a2,a0
+   172f4:	00852025 	or	a0,a0,a1
+   172f8:	ac640000 	sw	a0,0(v1)
+   172fc:	8e430048 	lw	v1,72(s2)
+   17300:	02a02021 	addu	a0,s5,zero
+   17304:	0043282b 	sltu	a1,v0,v1
+   17308:	0065100a 	movz	v0,v1,a1
+   1730c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   17310:	ae020638 	sw	v0,1592(s0)
+   17314:	8e260014 	lw	a2,20(s1)
+   17318:	8e250010 	lw	a1,16(s1)
+   1731c:	26040180 	addiu	a0,s0,384
+   17320:	0c008588 	jal	21620 <vmm_munmap>
+   17324:	24c60800 	addiu	a2,a2,2048
+   17328:	8e640400 	lw	a0,1024(s3)
+   1732c:	8e25003c 	lw	a1,60(s1)
+   17330:	0c0028ea 	jal	a3a8 <dqdt_update_threads_number>
+   17334:	2406ffff 	addiu	a2,zero,-1
+   17338:	8fbf0044 	lw	ra,68(sp)
+   1733c:	02801021 	addu	v0,s4,zero
+   17340:	8fb50040 	lw	s5,64(sp)
+   17344:	8fb4003c 	lw	s4,60(sp)
+   17348:	8fb30038 	lw	s3,56(sp)
+   1734c:	8fb20034 	lw	s2,52(sp)
+   17350:	8fb10030 	lw	s1,48(sp)
+   17354:	8fb0002c 	lw	s0,44(sp)
+   17358:	03e00008 	jr	ra
+   1735c:	27bd0048 	addiu	sp,sp,72
+   17360:	8e220014 	lw	v0,20(s1)
+   17364:	2c431000 	sltiu	v1,v0,4096
+   17368:	0043380a 	movz	a3,v0,v1
+   1736c:	24020003 	addiu	v0,zero,3
+   17370:	ae270014 	sw	a3,20(s1)
+   17374:	02002021 	addu	a0,s0,zero
+   17378:	afa20010 	sw	v0,16(sp)
+   1737c:	00002821 	addu	a1,zero,zero
+   17380:	2402000e 	addiu	v0,zero,14
+   17384:	00003021 	addu	a2,zero,zero
+   17388:	afa20014 	sw	v0,20(sp)
+   1738c:	0c0084ee 	jal	213b8 <vmm_mmap>
+   17390:	afa00018 	sw	zero,24(sp)
+   17394:	2403ffff 	addiu	v1,zero,-1
+   17398:	10430009 	beq	v0,v1,173c0 <do_thread_create+0x2a4>
+   1739c:	ae220010 	sw	v0,16(s1)
+   173a0:	8e230014 	lw	v1,20(s1)
+   173a4:	2463f800 	addiu	v1,v1,-2048
+   173a8:	00431021 	addu	v0,v0,v1
+   173ac:	ae22002c 	sw	v0,44(s1)
+   173b0:	24020800 	addiu	v0,zero,2048
+   173b4:	ae220030 	sw	v0,48(s1)
+   173b8:	08005c68 	j	171a0 <do_thread_create+0x84>
+   173bc:	ae230014 	sw	v1,20(s1)
+   173c0:	08005cca 	j	17328 <do_thread_create+0x20c>
+   173c4:	2414000c 	addiu	s4,zero,12
+
+000173c8 <sys_thread_create>:
+   173c8:	27bdfef8 	addiu	sp,sp,-264
+   173cc:	afb000e8 	sw	s0,232(sp)
+   173d0:	afbf0104 	sw	ra,260(sp)
+   173d4:	afb60100 	sw	s6,256(sp)
+   173d8:	afb500fc 	sw	s5,252(sp)
+   173dc:	afb400f8 	sw	s4,248(sp)
+   173e0:	afb300f4 	sw	s3,244(sp)
+   173e4:	afb200f0 	sw	s2,240(sp)
+   173e8:	afb100ec 	sw	s1,236(sp)
+   173ec:	00808021 	addu	s0,a0,zero
+   173f0:	40034800 	mfc0	v1,c0_count
+   173f4:	00000000 	sll	zero,zero,0x0
+   173f8:	40122002 	mfc0	s2,$4,2
+   173fc:	8e510180 	lw	s1,384(s2)
+   17400:	10800097 	beqz	a0,17660 <sys_thread_create+0x298>
+   17404:	8e33062c 	lw	s3,1580(s1)
+   17408:	10a00095 	beqz	a1,17660 <sys_thread_create+0x298>
+   1740c:	28a34000 	slti	v1,a1,16384
+   17410:	1060000f 	beqz	v1,17450 <sys_thread_create+0x88>
+   17414:	3c038000 	lui	v1,0x8000
+   17418:	24150001 	addiu	s5,zero,1
+   1741c:	40022002 	mfc0	v0,$4,2
+   17420:	ac550258 	sw	s5,600(v0)
+   17424:	8fbf0104 	lw	ra,260(sp)
+   17428:	02a01021 	addu	v0,s5,zero
+   1742c:	8fb60100 	lw	s6,256(sp)
+   17430:	8fb500fc 	lw	s5,252(sp)
+   17434:	8fb400f8 	lw	s4,248(sp)
+   17438:	8fb300f4 	lw	s3,244(sp)
+   1743c:	8fb200f0 	lw	s2,240(sp)
+   17440:	8fb100ec 	lw	s1,236(sp)
+   17444:	8fb000e8 	lw	s0,232(sp)
+   17448:	03e00008 	jr	ra
+   1744c:	27bd0108 	addiu	sp,sp,264
+   17450:	34630001 	ori	v1,v1,0x1
+   17454:	00a3102b 	sltu	v0,a1,v1
+   17458:	1040fff0 	beqz	v0,1741c <sys_thread_create+0x54>
+   1745c:	24150001 	addiu	s5,zero,1
+   17460:	28823ff8 	slti	v0,a0,16376
+   17464:	1440ffed 	bnez	v0,1741c <sys_thread_create+0x54>
+   17468:	24820008 	addiu	v0,a0,8
+   1746c:	0043182b 	sltu	v1,v0,v1
+   17470:	1060ffea 	beqz	v1,1741c <sys_thread_create+0x54>
+   17474:	27b40044 	addiu	s4,sp,68
+   17478:	02802021 	addu	a0,s4,zero
+   1747c:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   17480:	2406004c 	addiu	a2,zero,76
+   17484:	1440ffe5 	bnez	v0,1741c <sys_thread_create+0x54>
+   17488:	0040a821 	addu	s5,v0,zero
+   1748c:	27a40014 	addiu	a0,sp,20
+   17490:	02002821 	addu	a1,s0,zero
+   17494:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   17498:	24060004 	addiu	a2,zero,4
+   1749c:	1440ffdf 	bnez	v0,1741c <sys_thread_create+0x54>
+   174a0:	0040a821 	addu	s5,v0,zero
+   174a4:	8fa20058 	lw	v0,88(sp)
+   174a8:	10400004 	beqz	v0,174bc <sys_thread_create+0xf4>
+   174ac:	8fa30054 	lw	v1,84(sp)
+   174b0:	30430fff 	andi	v1,v0,0xfff
+   174b4:	1460006a 	bnez	v1,17660 <sys_thread_create+0x298>
+   174b8:	8fa30054 	lw	v1,84(sp)
+   174bc:	10600003 	beqz	v1,174cc <sys_thread_create+0x104>
+   174c0:	2c431000 	sltiu	v1,v0,4096
+   174c4:	14600066 	bnez	v1,17660 <sys_thread_create+0x298>
+   174c8:	00000000 	sll	zero,zero,0x0
+   174cc:	8fa30084 	lw	v1,132(sp)
+   174d0:	28630400 	slti	v1,v1,1024
+   174d4:	10600062 	beqz	v1,17660 <sys_thread_create+0x298>
+   174d8:	00000000 	sll	zero,zero,0x0
+   174dc:	14400002 	bnez	v0,174e8 <sys_thread_create+0x120>
+   174e0:	3c020008 	lui	v0,0x8
+   174e4:	afa20058 	sw	v0,88(sp)
+   174e8:	8e230630 	lw	v1,1584(s1)
+   174ec:	8e220634 	lw	v0,1588(s1)
+   174f0:	1062ffca 	beq	v1,v0,1741c <sys_thread_create+0x54>
+   174f4:	2415000b 	addiu	s5,zero,11
+   174f8:	8e420304 	lw	v0,772(s2)
+   174fc:	30420020 	andi	v0,v0,0x20
+   17500:	14400059 	bnez	v0,17668 <sys_thread_create+0x2a0>
+   17504:	8fa20048 	lw	v0,72(sp)
+   17508:	2403ffe7 	addiu	v1,zero,-25
+   1750c:	263500a0 	addiu	s5,s1,160
+   17510:	00431024 	and	v0,v0,v1
+   17514:	02a02021 	addu	a0,s5,zero
+   17518:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1751c:	afa20048 	sw	v0,72(sp)
+   17520:	8e250638 	lw	a1,1592(s1)
+   17524:	26240640 	addiu	a0,s1,1600
+   17528:	0c00b895 	jal	2e254 <bitmap_ffs2>
+   1752c:	24060100 	addiu	a2,zero,256
+   17530:	2403ffff 	addiu	v1,zero,-1
+   17534:	1043000f 	beq	v0,v1,17574 <sys_thread_create+0x1ac>
+   17538:	00021942 	srl	v1,v0,0x5
+   1753c:	24630190 	addiu	v1,v1,400
+   17540:	00031880 	sll	v1,v1,0x2
+   17544:	02231821 	addu	v1,s1,v1
+   17548:	24060001 	addiu	a2,zero,1
+   1754c:	8c650000 	lw	a1,0(v1)
+   17550:	8e240630 	lw	a0,1584(s1)
+   17554:	00463004 	sllv	a2,a2,v0
+   17558:	00063027 	nor	a2,zero,a2
+   1755c:	00c53024 	and	a2,a2,a1
+   17560:	24840001 	addiu	a0,a0,1
+   17564:	24450001 	addiu	a1,v0,1
+   17568:	ac660000 	sw	a2,0(v1)
+   1756c:	ae250638 	sw	a1,1592(s1)
+   17570:	ae240630 	sw	a0,1584(s1)
+   17574:	02a02021 	addu	a0,s5,zero
+   17578:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1757c:	afa20010 	sw	v0,16(sp)
+   17580:	8fa30010 	lw	v1,16(sp)
+   17584:	2402ffff 	addiu	v0,zero,-1
+   17588:	1062ffa4 	beq	v1,v0,1741c <sys_thread_create+0x54>
+   1758c:	2415000b 	addiu	s5,zero,11
+   17590:	8fb50084 	lw	s5,132(sp)
+   17594:	06a00044 	bltz	s5,176a8 <sys_thread_create+0x2e0>
+   17598:	3c030004 	lui	v1,0x4
+   1759c:	0c00056c 	jal	15b0 <arch_onln_cpu_nr>
+   175a0:	00000000 	sll	zero,zero,0x0
+   175a4:	02a2001b 	divu	zero,s5,v0
+   175a8:	004001f4 	teq	v0,zero,0x7
+   175ac:	0000a810 	mfhi	s5
+   175b0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   175b4:	afb50084 	sw	s5,132(sp)
+   175b8:	02a2001b 	divu	zero,s5,v0
+   175bc:	004001f4 	teq	v0,zero,0x7
+   175c0:	8fb50084 	lw	s5,132(sp)
+   175c4:	00001010 	mfhi	v0
+   175c8:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   175cc:	afa20080 	sw	v0,128(sp)
+   175d0:	02a2001b 	divu	zero,s5,v0
+   175d4:	004001f4 	teq	v0,zero,0x7
+   175d8:	24020001 	addiu	v0,zero,1
+   175dc:	afa20098 	sw	v0,152(sp)
+   175e0:	afa00028 	sw	zero,40(sp)
+   175e4:	0000a812 	mflo	s5
+   175e8:	a7b5007c 	sh	s5,124(sp)
+   175ec:	8fa20010 	lw	v0,16(sp)
+   175f0:	afa00090 	sw	zero,144(sp)
+   175f4:	afa200d8 	sw	v0,216(sp)
+   175f8:	24020001 	addiu	v0,zero,1
+   175fc:	afb400dc 	sw	s4,220(sp)
+   17600:	afb100e0 	sw	s1,224(sp)
+   17604:	1262001a 	beq	s3,v0,17670 <sys_thread_create+0x2a8>
+   17608:	afa00094 	sw	zero,148(sp)
+   1760c:	40024800 	mfc0	v0,c0_count
+   17610:	00000000 	sll	zero,zero,0x0
+   17614:	0c005c47 	jal	1711c <do_thread_create>
+   17618:	27a40090 	addiu	a0,sp,144
+   1761c:	0040a821 	addu	s5,v0,zero
+   17620:	40024800 	mfc0	v0,c0_count
+   17624:	00000000 	sll	zero,zero,0x0
+   17628:	16a0ff7c 	bnez	s5,1741c <sys_thread_create+0x54>
+   1762c:	00000000 	sll	zero,zero,0x0
+   17630:	02002021 	addu	a0,s0,zero
+   17634:	27a50010 	addiu	a1,sp,16
+   17638:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   1763c:	24060004 	addiu	a2,zero,4
+   17640:	1040003f 	beqz	v0,17740 <sys_thread_create+0x378>
+   17644:	0040a821 	addu	s5,v0,zero
+   17648:	8fa4009c 	lw	a0,156(sp)
+   1764c:	24020005 	addiu	v0,zero,5
+   17650:	0c00692f 	jal	1a4bc <thread_destroy>
+   17654:	ac820130 	sw	v0,304(a0)
+   17658:	08005d07 	j	1741c <sys_thread_create+0x54>
+   1765c:	00000000 	sll	zero,zero,0x0
+   17660:	08005d07 	j	1741c <sys_thread_create+0x54>
+   17664:	24150016 	addiu	s5,zero,22
+   17668:	08005d42 	j	17508 <sys_thread_create+0x140>
+   1766c:	34420020 	ori	v0,v0,0x20
+   17670:	0c00056f 	jal	15bc <arch_onln_cluster_nr>
+   17674:	00000000 	sll	zero,zero,0x0
+   17678:	2c420002 	sltiu	v0,v0,2
+   1767c:	1440ffe3 	bnez	v0,1760c <sys_thread_create+0x244>
+   17680:	00000000 	sll	zero,zero,0x0
+   17684:	8e420304 	lw	v0,772(s2)
+   17688:	30420080 	andi	v0,v0,0x80
+   1768c:	1040ffdf 	beqz	v0,1760c <sys_thread_create+0x244>
+   17690:	26240180 	addiu	a0,s1,384
+   17694:	8e2502c4 	lw	a1,708(s1)
+   17698:	0c008212 	jal	20848 <vmm_set_auto_migrate>
+   1769c:	00003021 	addu	a2,zero,zero
+   176a0:	08005d83 	j	1760c <sys_thread_create+0x244>
+   176a4:	00000000 	sll	zero,zero,0x0
+   176a8:	8c646e40 	lw	a0,28224(v1)
+   176ac:	27a50018 	addiu	a1,sp,24
+   176b0:	afa20020 	sw	v0,32(sp)
+   176b4:	afa00098 	sw	zero,152(sp)
+   176b8:	afa20018 	sw	v0,24(sp)
+   176bc:	afa00038 	sw	zero,56(sp)
+   176c0:	0c0028ef 	jal	a3bc <dqdt_thread_placement>
+   176c4:	afa00024 	sw	zero,36(sp)
+   176c8:	1440000b 	bnez	v0,176f8 <sys_thread_create+0x330>
+   176cc:	8fb60018 	lw	s6,24(sp)
+   176d0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   176d4:	8fb50020 	lw	s5,32(sp)
+   176d8:	70561802 	mul	v1,v0,s6
+   176dc:	00751021 	addu	v0,v1,s5
+   176e0:	afa20084 	sw	v0,132(sp)
+   176e4:	8fa20020 	lw	v0,32(sp)
+   176e8:	afa20080 	sw	v0,128(sp)
+   176ec:	8fa20018 	lw	v0,24(sp)
+   176f0:	08005d7b 	j	175ec <sys_thread_create+0x224>
+   176f4:	a7a2007c 	sh	v0,124(sp)
+   176f8:	0c00056c 	jal	15b0 <arch_onln_cpu_nr>
+   176fc:	8e350630 	lw	s5,1584(s1)
+   17700:	02a2001b 	divu	zero,s5,v0
+   17704:	004001f4 	teq	v0,zero,0x7
+   17708:	0000a810 	mfhi	s5
+   1770c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   17710:	afb50084 	sw	s5,132(sp)
+   17714:	02a2001b 	divu	zero,s5,v0
+   17718:	004001f4 	teq	v0,zero,0x7
+   1771c:	8fb50084 	lw	s5,132(sp)
+   17720:	00001010 	mfhi	v0
+   17724:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   17728:	afa20080 	sw	v0,128(sp)
+   1772c:	02a2001b 	divu	zero,s5,v0
+   17730:	004001f4 	teq	v0,zero,0x7
+   17734:	0000a812 	mflo	s5
+   17738:	08005d7b 	j	175ec <sys_thread_create+0x224>
+   1773c:	a7b5007c 	sh	s5,124(sp)
+   17740:	0c0046cb 	jal	11b2c <sched_add_created>
+   17744:	8fa4009c 	lw	a0,156(sp)
+   17748:	8e430304 	lw	v1,772(s2)
+   1774c:	2402ffe7 	addiu	v0,zero,-25
+   17750:	00621024 	and	v0,v1,v0
+   17754:	ae420304 	sw	v0,772(s2)
+   17758:	40024800 	mfc0	v0,c0_count
+   1775c:	00000000 	sll	zero,zero,0x0
+   17760:	08005d0a 	j	17428 <sys_thread_create+0x60>
+   17764:	8fbf0104 	lw	ra,260(sp)
+
+00017768 <thread_create_event_handler>:
+   17768:	27bdff38 	addiu	sp,sp,-200
+   1776c:	afbf00c4 	sw	ra,196(sp)
+   17770:	afb200c0 	sw	s2,192(sp)
+   17774:	afb100bc 	sw	s1,188(sp)
+   17778:	afb000b8 	sw	s0,184(sp)
+   1777c:	40124800 	mfc0	s2,c0_count
+   17780:	00000000 	sll	zero,zero,0x0
+   17784:	8c900008 	lw	s0,8(a0)
+   17788:	27b10010 	addiu	s1,sp,16
+   1778c:	8e05004c 	lw	a1,76(s0)
+   17790:	02202021 	addu	a0,s1,zero
+   17794:	0c00c12b 	jal	304ac <memcpy>
+   17798:	2406004c 	addiu	a2,zero,76
+   1779c:	8e050008 	lw	a1,8(s0)
+   177a0:	8e030048 	lw	v1,72(s0)
+   177a4:	8e020050 	lw	v0,80(s0)
+   177a8:	27a4005c 	addiu	a0,sp,92
+   177ac:	afa50064 	sw	a1,100(sp)
+   177b0:	afa300a4 	sw	v1,164(sp)
+   177b4:	afb100a8 	sw	s1,168(sp)
+   177b8:	0c005c47 	jal	1711c <do_thread_create>
+   177bc:	afa200ac 	sw	v0,172(sp)
+   177c0:	40034800 	mfc0	v1,c0_count
+   177c4:	00000000 	sll	zero,zero,0x0
+   177c8:	ae020004 	sw	v0,4(s0)
+   177cc:	8fa2006c 	lw	v0,108(sp)
+   177d0:	00729023 	subu	s2,v1,s2
+   177d4:	ae020010 	sw	v0,16(s0)
+   177d8:	8fa20068 	lw	v0,104(sp)
+   177dc:	ae120054 	sw	s2,84(s0)
+   177e0:	ae02000c 	sw	v0,12(s0)
+   177e4:	0000000f 	sync
+   177e8:	24020001 	addiu	v0,zero,1
+   177ec:	ae020000 	sw	v0,0(s0)
+   177f0:	0000000f 	sync
+   177f4:	8fbf00c4 	lw	ra,196(sp)
+   177f8:	00001021 	addu	v0,zero,zero
+   177fc:	8fb200c0 	lw	s2,192(sp)
+   17800:	8fb100bc 	lw	s1,188(sp)
+   17804:	8fb000b8 	lw	s0,184(sp)
+   17808:	03e00008 	jr	ra
+   1780c:	27bd00c8 	addiu	sp,sp,200
+
+00017810 <sys_thread_detach>:
+   17810:	27bdffd8 	addiu	sp,sp,-40
+   17814:	afb1001c 	sw	s1,28(sp)
+   17818:	afbf0024 	sw	ra,36(sp)
+   1781c:	afb20020 	sw	s2,32(sp)
+   17820:	afb00018 	sw	s0,24(sp)
+   17824:	00808821 	addu	s1,a0,zero
+   17828:	40022002 	mfc0	v0,$4,2
+   1782c:	8c500180 	lw	s0,384(v0)
+   17830:	8e02063c 	lw	v0,1596(s0)
+   17834:	0044102b 	sltu	v0,v0,a0
+   17838:	10400009 	beqz	v0,17860 <sys_thread_detach+0x50>
+   1783c:	24020016 	addiu	v0,zero,22
+   17840:	40032002 	mfc0	v1,$4,2
+   17844:	8fbf0024 	lw	ra,36(sp)
+   17848:	8fb20020 	lw	s2,32(sp)
+   1784c:	8fb1001c 	lw	s1,28(sp)
+   17850:	8fb00018 	lw	s0,24(sp)
+   17854:	ac620258 	sw	v0,600(v1)
+   17858:	03e00008 	jr	ra
+   1785c:	27bd0028 	addiu	sp,sp,40
+   17860:	0c004bc3 	jal	12f0c <spinlock_lock>
+   17864:	260400a0 	addiu	a0,s0,160
+   17868:	8e030740 	lw	v1,1856(s0)
+   1786c:	00111080 	sll	v0,s1,0x2
+   17870:	00621021 	addu	v0,v1,v0
+   17874:	8c520000 	lw	s2,0(v0)
+   17878:	12400005 	beqz	s2,17890 <sys_thread_detach+0x80>
+   1787c:	3c02deef 	lui	v0,0xdeef
+   17880:	8e430390 	lw	v1,912(s2)
+   17884:	3442baad 	ori	v0,v0,0xbaad
+   17888:	1062000e 	beq	v1,v0,178c4 <sys_thread_detach+0xb4>
+   1788c:	00000000 	sll	zero,zero,0x0
+   17890:	24020003 	addiu	v0,zero,3
+   17894:	26040090 	addiu	a0,s0,144
+   17898:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1789c:	afa20010 	sw	v0,16(sp)
+   178a0:	8fa20010 	lw	v0,16(sp)
+   178a4:	40032002 	mfc0	v1,$4,2
+   178a8:	8fbf0024 	lw	ra,36(sp)
+   178ac:	8fb20020 	lw	s2,32(sp)
+   178b0:	8fb1001c 	lw	s1,28(sp)
+   178b4:	8fb00018 	lw	s0,24(sp)
+   178b8:	ac620258 	sw	v0,600(v1)
+   178bc:	03e00008 	jr	ra
+   178c0:	27bd0028 	addiu	sp,sp,40
+   178c4:	8e420300 	lw	v0,768(s2)
+   178c8:	1451fff2 	bne	v0,s1,17894 <sys_thread_detach+0x84>
+   178cc:	24020003 	addiu	v0,zero,3
+   178d0:	8e420138 	lw	v0,312(s2)
+   178d4:	1040ffef 	beqz	v0,17894 <sys_thread_detach+0x84>
+   178d8:	24020016 	addiu	v0,zero,22
+   178dc:	26510120 	addiu	s1,s2,288
+   178e0:	0c004bc3 	jal	12f0c <spinlock_lock>
+   178e4:	02202021 	addu	a0,s1,zero
+   178e8:	8e420274 	lw	v0,628(s2)
+   178ec:	10400005 	beqz	v0,17904 <sys_thread_detach+0xf4>
+   178f0:	ae400138 	sw	zero,312(s2)
+   178f4:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   178f8:	02202021 	addu	a0,s1,zero
+   178fc:	08005e25 	j	17894 <sys_thread_detach+0x84>
+   17900:	00001021 	addu	v0,zero,zero
+   17904:	8e430284 	lw	v1,644(s2)
+   17908:	26420284 	addiu	v0,s2,644
+   1790c:	1062fff9 	beq	v1,v0,178f4 <sys_thread_detach+0xe4>
+   17910:	2644027c 	addiu	a0,s2,636
+   17914:	0c006d56 	jal	1b558 <wakeup_one>
+   17918:	24050002 	addiu	a1,zero,2
+   1791c:	08005e3d 	j	178f4 <sys_thread_detach+0xe4>
+   17920:	00000000 	sll	zero,zero,0x0
+
+00017924 <sys_thread_exit>:
+   17924:	27bdffd8 	addiu	sp,sp,-40
+   17928:	afb20020 	sw	s2,32(sp)
+   1792c:	afbf0024 	sw	ra,36(sp)
+   17930:	afb1001c 	sw	s1,28(sp)
+   17934:	afb00018 	sw	s0,24(sp)
+   17938:	00809021 	addu	s2,a0,zero
+   1793c:	40102002 	mfc0	s0,$4,2
+   17940:	40022002 	mfc0	v0,$4,2
+   17944:	8e030180 	lw	v1,384(s0)
+   17948:	8c6405c4 	lw	a0,1476(v1)
+   1794c:	8c430174 	lw	v1,372(v0)
+   17950:	24020001 	addiu	v0,zero,1
+   17954:	10820008 	beq	a0,v0,17978 <sys_thread_exit+0x54>
+   17958:	3c020004 	lui	v0,0x4
+   1795c:	2444c960 	addiu	a0,v0,-13984
+   17960:	88840003 	lwl	a0,3(a0)
+   17964:	8c650000 	lw	a1,0(v1)
+   17968:	9844c960 	lwr	a0,-13984(v0)
+   1796c:	2406ffff 	addiu	a2,zero,-1
+   17970:	0c0028ea 	jal	a3a8 <dqdt_update_threads_number>
+   17974:	3084ffff 	andi	a0,a0,0xffff
+   17978:	26110120 	addiu	s1,s0,288
+   1797c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   17980:	02202021 	addu	a0,s1,zero
+   17984:	8e020138 	lw	v0,312(s0)
+   17988:	10400009 	beqz	v0,179b0 <sys_thread_exit+0x8c>
+   1798c:	26020284 	addiu	v0,s0,644
+   17990:	8e030284 	lw	v1,644(s0)
+   17994:	1062002f 	beq	v1,v0,17a54 <sys_thread_exit+0x130>
+   17998:	24050002 	addiu	a1,zero,2
+   1799c:	8e020274 	lw	v0,628(s0)
+   179a0:	2604027c 	addiu	a0,s0,636
+   179a4:	ac520270 	sw	s2,624(v0)
+   179a8:	0c006d56 	jal	1b558 <wakeup_one>
+   179ac:	24050002 	addiu	a1,zero,2
+   179b0:	0c004b07 	jal	12c1c <spinlock_unlock_nosched>
+   179b4:	02202021 	addu	a0,s1,zero
+   179b8:	40016000 	mfc0	at,c0_status
+   179bc:	00000000 	sll	zero,zero,0x0
+   179c0:	00011825 	or	v1,zero,at
+   179c4:	00010842 	srl	at,at,0x1
+   179c8:	00010840 	sll	at,at,0x1
+   179cc:	40816000 	mtc0	at,c0_status
+   179d0:	40022002 	mfc0	v0,$4,2
+   179d4:	8c440174 	lw	a0,372(v0)
+   179d8:	3c020001 	lui	v0,0x1
+   179dc:	00822021 	addu	a0,a0,v0
+   179e0:	8c848324 	lw	a0,-31964(a0)
+   179e4:	10900016 	beq	a0,s0,17a40 <sys_thread_exit+0x11c>
+   179e8:	00000000 	sll	zero,zero,0x0
+   179ec:	40016000 	mfc0	at,c0_status
+   179f0:	340200ff 	ori	v0,zero,0xff
+   179f4:	00431024 	and	v0,v0,v1
+   179f8:	00220825 	or	at,at,v0
+   179fc:	40816000 	mtc0	at,c0_status
+   17a00:	0c0046e4 	jal	11b90 <sched_exit>
+   17a04:	02002021 	addu	a0,s0,zero
+   17a08:	40022002 	mfc0	v0,$4,2
+   17a0c:	afb00010 	sw	s0,16(sp)
+   17a10:	8c420174 	lw	v0,372(v0)
+   17a14:	3c050003 	lui	a1,0x3
+   17a18:	8c420004 	lw	v0,4(v0)
+   17a1c:	3c070003 	lui	a3,0x3
+   17a20:	24a55690 	addiu	a1,a1,22160
+   17a24:	24e76498 	addiu	a3,a3,25752
+   17a28:	24040001 	addiu	a0,zero,1
+   17a2c:	24060060 	addiu	a2,zero,96
+   17a30:	0c00097d 	jal	25f4 <__perror>
+   17a34:	afa20014 	sw	v0,20(sp)
+   17a38:	08005e8e 	j	17a38 <sys_thread_exit+0x114>
+   17a3c:	00000000 	sll	zero,zero,0x0
+   17a40:	40042002 	mfc0	a0,$4,2
+   17a44:	8c840174 	lw	a0,372(a0)
+   17a48:	00821021 	addu	v0,a0,v0
+   17a4c:	08005e7b 	j	179ec <sys_thread_exit+0xc8>
+   17a50:	ac408324 	sw	zero,-31964(v0)
+   17a54:	2604027c 	addiu	a0,s0,636
+   17a58:	0c006d13 	jal	1b44c <wait_on>
+   17a5c:	ae120270 	sw	s2,624(s0)
+   17a60:	0c004b07 	jal	12c1c <spinlock_unlock_nosched>
+   17a64:	02202021 	addu	a0,s1,zero
+   17a68:	0c004634 	jal	118d0 <sched_sleep>
+   17a6c:	02002021 	addu	a0,s0,zero
+   17a70:	08005e6e 	j	179b8 <sys_thread_exit+0x94>
+   17a74:	00000000 	sll	zero,zero,0x0
+
+00017a78 <sys_thread_getattr>:
+   17a78:	27bdffe8 	addiu	sp,sp,-24
+   17a7c:	afbf0014 	sw	ra,20(sp)
+   17a80:	afb00010 	sw	s0,16(sp)
+   17a84:	40102002 	mfc0	s0,$4,2
+   17a88:	40052002 	mfc0	a1,$4,2
+   17a8c:	28834000 	slti	v1,a0,16384
+   17a90:	14600006 	bnez	v1,17aac <sys_thread_getattr+0x34>
+   17a94:	8ca50174 	lw	a1,372(a1)
+   17a98:	3c038000 	lui	v1,0x8000
+   17a9c:	34630001 	ori	v1,v1,0x1
+   17aa0:	0083102b 	sltu	v0,a0,v1
+   17aa4:	14400007 	bnez	v0,17ac4 <sys_thread_getattr+0x4c>
+   17aa8:	3c020001 	lui	v0,0x1
+   17aac:	8fbf0014 	lw	ra,20(sp)
+   17ab0:	24020001 	addiu	v0,zero,1
+   17ab4:	ae020258 	sw	v0,600(s0)
+   17ab8:	8fb00010 	lw	s0,16(sp)
+   17abc:	03e00008 	jr	ra
+   17ac0:	27bd0018 	addiu	sp,sp,24
+   17ac4:	00a21021 	addu	v0,a1,v0
+   17ac8:	8c438328 	lw	v1,-31960(v0)
+   17acc:	8ca20000 	lw	v0,0(a1)
+   17ad0:	8c630400 	lw	v1,1024(v1)
+   17ad4:	ae02033c 	sw	v0,828(s0)
+   17ad8:	8ca20004 	lw	v0,4(a1)
+   17adc:	a6030338 	sh	v1,824(s0)
+   17ae0:	ae020340 	sw	v0,832(s0)
+   17ae4:	26050300 	addiu	a1,s0,768
+   17ae8:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   17aec:	2406004c 	addiu	a2,zero,76
+   17af0:	8fbf0014 	lw	ra,20(sp)
+   17af4:	ae020258 	sw	v0,600(s0)
+   17af8:	8fb00010 	lw	s0,16(sp)
+   17afc:	03e00008 	jr	ra
+   17b00:	27bd0018 	addiu	sp,sp,24
+
+00017b04 <sys_thread_join>:
+   17b04:	27bdffc0 	addiu	sp,sp,-64
+   17b08:	afb30030 	sw	s3,48(sp)
+   17b0c:	afb2002c 	sw	s2,44(sp)
+   17b10:	afbf003c 	sw	ra,60(sp)
+   17b14:	afb50038 	sw	s5,56(sp)
+   17b18:	afb40034 	sw	s4,52(sp)
+   17b1c:	afb10028 	sw	s1,40(sp)
+   17b20:	afb00024 	sw	s0,36(sp)
+   17b24:	00809021 	addu	s2,a0,zero
+   17b28:	00a09821 	addu	s3,a1,zero
+   17b2c:	40102002 	mfc0	s0,$4,2
+   17b30:	8e110180 	lw	s1,384(s0)
+   17b34:	8e22063c 	lw	v0,1596(s1)
+   17b38:	0044102b 	sltu	v0,v0,a0
+   17b3c:	1440000f 	bnez	v0,17b7c <sys_thread_join+0x78>
+   17b40:	24020016 	addiu	v0,zero,22
+   17b44:	10a00017 	beqz	a1,17ba4 <sys_thread_join+0xa0>
+   17b48:	afa00010 	sw	zero,16(sp)
+   17b4c:	3c027fff 	lui	v0,0x7fff
+   17b50:	24a3c004 	addiu	v1,a1,-16380
+   17b54:	3442c001 	ori	v0,v0,0xc001
+   17b58:	0062102b 	sltu	v0,v1,v0
+   17b5c:	10400007 	beqz	v0,17b7c <sys_thread_join+0x78>
+   17b60:	24020016 	addiu	v0,zero,22
+   17b64:	00a02021 	addu	a0,a1,zero
+   17b68:	24060004 	addiu	a2,zero,4
+   17b6c:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   17b70:	27a50010 	addiu	a1,sp,16
+   17b74:	1040000c 	beqz	v0,17ba8 <sys_thread_join+0xa4>
+   17b78:	263400a0 	addiu	s4,s1,160
+   17b7c:	ae020258 	sw	v0,600(s0)
+   17b80:	8fbf003c 	lw	ra,60(sp)
+   17b84:	8fb50038 	lw	s5,56(sp)
+   17b88:	8fb40034 	lw	s4,52(sp)
+   17b8c:	8fb30030 	lw	s3,48(sp)
+   17b90:	8fb2002c 	lw	s2,44(sp)
+   17b94:	8fb10028 	lw	s1,40(sp)
+   17b98:	8fb00024 	lw	s0,36(sp)
+   17b9c:	03e00008 	jr	ra
+   17ba0:	27bd0040 	addiu	sp,sp,64
+   17ba4:	263400a0 	addiu	s4,s1,160
+   17ba8:	0c004bc3 	jal	12f0c <spinlock_lock>
+   17bac:	02802021 	addu	a0,s4,zero
+   17bb0:	8e230740 	lw	v1,1856(s1)
+   17bb4:	00121080 	sll	v0,s2,0x2
+   17bb8:	00621021 	addu	v0,v1,v0
+   17bbc:	8c550000 	lw	s5,0(v0)
+   17bc0:	12a00007 	beqz	s5,17be0 <sys_thread_join+0xdc>
+   17bc4:	24020003 	addiu	v0,zero,3
+   17bc8:	3c02deef 	lui	v0,0xdeef
+   17bcc:	8ea30390 	lw	v1,912(s5)
+   17bd0:	3442baad 	ori	v0,v0,0xbaad
+   17bd4:	10620007 	beq	v1,v0,17bf4 <sys_thread_join+0xf0>
+   17bd8:	00000000 	sll	zero,zero,0x0
+   17bdc:	24020003 	addiu	v0,zero,3
+   17be0:	02802021 	addu	a0,s4,zero
+   17be4:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   17be8:	afa20018 	sw	v0,24(sp)
+   17bec:	08005edf 	j	17b7c <sys_thread_join+0x78>
+   17bf0:	8fa20018 	lw	v0,24(sp)
+   17bf4:	8ea20300 	lw	v0,768(s5)
+   17bf8:	1452fff8 	bne	v0,s2,17bdc <sys_thread_join+0xd8>
+   17bfc:	00000000 	sll	zero,zero,0x0
+   17c00:	12b0fff7 	beq	s5,s0,17be0 <sys_thread_join+0xdc>
+   17c04:	24020023 	addiu	v0,zero,35
+   17c08:	8ea20138 	lw	v0,312(s5)
+   17c0c:	1040fff4 	beqz	v0,17be0 <sys_thread_join+0xdc>
+   17c10:	24020016 	addiu	v0,zero,22
+   17c14:	26b10120 	addiu	s1,s5,288
+   17c18:	0c004bc3 	jal	12f0c <spinlock_lock>
+   17c1c:	02202021 	addu	a0,s1,zero
+   17c20:	8ea20274 	lw	v0,628(s5)
+   17c24:	10400005 	beqz	v0,17c3c <sys_thread_join+0x138>
+   17c28:	00000000 	sll	zero,zero,0x0
+   17c2c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   17c30:	02202021 	addu	a0,s1,zero
+   17c34:	08005ef8 	j	17be0 <sys_thread_join+0xdc>
+   17c38:	24020016 	addiu	v0,zero,22
+   17c3c:	8ea30284 	lw	v1,644(s5)
+   17c40:	26a20284 	addiu	v0,s5,644
+   17c44:	10620014 	beq	v1,v0,17c98 <sys_thread_join+0x194>
+   17c48:	24050002 	addiu	a1,zero,2
+   17c4c:	8ea20270 	lw	v0,624(s5)
+   17c50:	26a4027c 	addiu	a0,s5,636
+   17c54:	0c006d56 	jal	1b558 <wakeup_one>
+   17c58:	afa20010 	sw	v0,16(sp)
+   17c5c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   17c60:	02202021 	addu	a0,s1,zero
+   17c64:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   17c68:	02802021 	addu	a0,s4,zero
+   17c6c:	12600008 	beqz	s3,17c90 <sys_thread_join+0x18c>
+   17c70:	02602021 	addu	a0,s3,zero
+   17c74:	27a50010 	addiu	a1,sp,16
+   17c78:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   17c7c:	24060004 	addiu	a2,zero,4
+   17c80:	1440ffbe 	bnez	v0,17b7c <sys_thread_join+0x78>
+   17c84:	8fbf003c 	lw	ra,60(sp)
+   17c88:	08005ee2 	j	17b88 <sys_thread_join+0x84>
+   17c8c:	8fb50038 	lw	s5,56(sp)
+   17c90:	08005ee0 	j	17b80 <sys_thread_join+0x7c>
+   17c94:	00001021 	addu	v0,zero,zero
+   17c98:	26a4027c 	addiu	a0,s5,636
+   17c9c:	0c006d13 	jal	1b44c <wait_on>
+   17ca0:	aeb00274 	sw	s0,628(s5)
+   17ca4:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   17ca8:	02202021 	addu	a0,s1,zero
+   17cac:	0c004b07 	jal	12c1c <spinlock_unlock_nosched>
+   17cb0:	02802021 	addu	a0,s4,zero
+   17cb4:	0c004634 	jal	118d0 <sched_sleep>
+   17cb8:	02002021 	addu	a0,s0,zero
+   17cbc:	8e020270 	lw	v0,624(s0)
+   17cc0:	08005f1b 	j	17c6c <sys_thread_join+0x168>
+   17cc4:	afa20010 	sw	v0,16(sp)
+
+00017cc8 <sys_thread_migrate>:
+   17cc8:	27bdff90 	addiu	sp,sp,-112
+   17ccc:	afbf006c 	sw	ra,108(sp)
+   17cd0:	afb10068 	sw	s1,104(sp)
+   17cd4:	afb00064 	sw	s0,100(sp)
+   17cd8:	40102002 	mfc0	s0,$4,2
+   17cdc:	10800005 	beqz	a0,17cf4 <sys_thread_migrate+0x2c>
+   17ce0:	24020016 	addiu	v0,zero,22
+   17ce4:	28824000 	slti	v0,a0,16384
+   17ce8:	10400009 	beqz	v0,17d10 <sys_thread_migrate+0x48>
+   17cec:	3c028000 	lui	v0,0x8000
+   17cf0:	24020001 	addiu	v0,zero,1
+   17cf4:	ae020258 	sw	v0,600(s0)
+   17cf8:	2402ffff 	addiu	v0,zero,-1
+   17cfc:	8fbf006c 	lw	ra,108(sp)
+   17d00:	8fb10068 	lw	s1,104(sp)
+   17d04:	8fb00064 	lw	s0,100(sp)
+   17d08:	03e00008 	jr	ra
+   17d0c:	27bd0070 	addiu	sp,sp,112
+   17d10:	34420001 	ori	v0,v0,0x1
+   17d14:	0082102b 	sltu	v0,a0,v0
+   17d18:	1040fff6 	beqz	v0,17cf4 <sys_thread_migrate+0x2c>
+   17d1c:	24020001 	addiu	v0,zero,1
+   17d20:	00802821 	addu	a1,a0,zero
+   17d24:	2406004c 	addiu	a2,zero,76
+   17d28:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   17d2c:	27a40010 	addiu	a0,sp,16
+   17d30:	1440fff0 	bnez	v0,17cf4 <sys_thread_migrate+0x2c>
+   17d34:	00000000 	sll	zero,zero,0x0
+   17d38:	40037801 	mfc0	v1,$15,1
+   17d3c:	3c020004 	lui	v0,0x4
+   17d40:	30630003 	andi	v1,v1,0x3
+   17d44:	00031880 	sll	v1,v1,0x2
+   17d48:	2442c950 	addiu	v0,v0,-14000
+   17d4c:	00621021 	addu	v0,v1,v0
+   17d50:	8c420000 	lw	v0,0(v0)
+   17d54:	8fb10050 	lw	s1,80(sp)
+   17d58:	12220035 	beq	s1,v0,17e30 <sys_thread_migrate+0x168>
+   17d5c:	00000000 	sll	zero,zero,0x0
+   17d60:	2a220400 	slti	v0,s1,1024
+   17d64:	1040ffe3 	beqz	v0,17cf4 <sys_thread_migrate+0x2c>
+   17d68:	24020016 	addiu	v0,zero,22
+   17d6c:	06210041 	bgez	s1,17e74 <sys_thread_migrate+0x1ac>
+   17d70:	00000000 	sll	zero,zero,0x0
+   17d74:	2405ffff 	addiu	a1,zero,-1
+   17d78:	8fa20014 	lw	v0,20(sp)
+   17d7c:	30420040 	andi	v0,v0,0x40
+   17d80:	10400004 	beqz	v0,17d94 <sys_thread_migrate+0xcc>
+   17d84:	00000000 	sll	zero,zero,0x0
+   17d88:	8e020304 	lw	v0,772(s0)
+   17d8c:	34420040 	ori	v0,v0,0x40
+   17d90:	ae020304 	sw	v0,772(s0)
+   17d94:	40016000 	mfc0	at,c0_status
+   17d98:	00000000 	sll	zero,zero,0x0
+   17d9c:	00011825 	or	v1,zero,at
+   17da0:	00010842 	srl	at,at,0x1
+   17da4:	00010840 	sll	at,at,0x1
+   17da8:	40816000 	mtc0	at,c0_status
+   17dac:	8e040134 	lw	a0,308(s0)
+   17db0:	2402ff7f 	addiu	v0,zero,-129
+   17db4:	00821024 	and	v0,a0,v0
+   17db8:	ae020134 	sw	v0,308(s0)
+   17dbc:	40016000 	mfc0	at,c0_status
+   17dc0:	340200ff 	ori	v0,zero,0xff
+   17dc4:	00431024 	and	v0,v0,v1
+   17dc8:	00220825 	or	at,at,v0
+   17dcc:	40816000 	mtc0	at,c0_status
+   17dd0:	0c006b59 	jal	1ad64 <thread_migrate>
+   17dd4:	02002021 	addu	a0,s0,zero
+   17dd8:	00402021 	addu	a0,v0,zero
+   17ddc:	40032002 	mfc0	v1,$4,2
+   17de0:	40016000 	mfc0	at,c0_status
+   17de4:	00000000 	sll	zero,zero,0x0
+   17de8:	00012825 	or	a1,zero,at
+   17dec:	00010842 	srl	at,at,0x1
+   17df0:	00010840 	sll	at,at,0x1
+   17df4:	40816000 	mtc0	at,c0_status
+   17df8:	8c620134 	lw	v0,308(v1)
+   17dfc:	2406ffdf 	addiu	a2,zero,-33
+   17e00:	34420080 	ori	v0,v0,0x80
+   17e04:	00461024 	and	v0,v0,a2
+   17e08:	ac620134 	sw	v0,308(v1)
+   17e0c:	40016000 	mfc0	at,c0_status
+   17e10:	340200ff 	ori	v0,zero,0xff
+   17e14:	00451024 	and	v0,v0,a1
+   17e18:	00220825 	or	at,at,v0
+   17e1c:	40816000 	mtc0	at,c0_status
+   17e20:	2402ffff 	addiu	v0,zero,-1
+   17e24:	ac640258 	sw	a0,600(v1)
+   17e28:	08005f3f 	j	17cfc <sys_thread_migrate+0x34>
+   17e2c:	0004100a 	movz	v0,zero,a0
+   17e30:	40016000 	mfc0	at,c0_status
+   17e34:	00000000 	sll	zero,zero,0x0
+   17e38:	00011825 	or	v1,zero,at
+   17e3c:	00010842 	srl	at,at,0x1
+   17e40:	00010840 	sll	at,at,0x1
+   17e44:	40816000 	mtc0	at,c0_status
+   17e48:	8e040134 	lw	a0,308(s0)
+   17e4c:	2402ffbf 	addiu	v0,zero,-65
+   17e50:	00821024 	and	v0,a0,v0
+   17e54:	ae020134 	sw	v0,308(s0)
+   17e58:	40016000 	mfc0	at,c0_status
+   17e5c:	340200ff 	ori	v0,zero,0xff
+   17e60:	00431024 	and	v0,v0,v1
+   17e64:	00220825 	or	at,at,v0
+   17e68:	40816000 	mtc0	at,c0_status
+   17e6c:	08005f3f 	j	17cfc <sys_thread_migrate+0x34>
+   17e70:	00001021 	addu	v0,zero,zero
+   17e74:	0c00056c 	jal	15b0 <arch_onln_cpu_nr>
+   17e78:	00000000 	sll	zero,zero,0x0
+   17e7c:	0222001b 	divu	zero,s1,v0
+   17e80:	004001f4 	teq	v0,zero,0x7
+   17e84:	08005f5e 	j	17d78 <sys_thread_migrate+0xb0>
+   17e88:	00002810 	mfhi	a1
+
+00017e8c <sys_thread_sleep>:
+   17e8c:	27bdffd8 	addiu	sp,sp,-40
+   17e90:	afbf0024 	sw	ra,36(sp)
+   17e94:	afb00020 	sw	s0,32(sp)
+   17e98:	40102002 	mfc0	s0,$4,2
+   17e9c:	8e030214 	lw	v1,532(s0)
+   17ea0:	24020001 	addiu	v0,zero,1
+   17ea4:	10620036 	beq	v1,v0,17f80 <sys_thread_sleep+0xf4>
+   17ea8:	00000000 	sll	zero,zero,0x0
+   17eac:	40016000 	mfc0	at,c0_status
+   17eb0:	00000000 	sll	zero,zero,0x0
+   17eb4:	00011825 	or	v1,zero,at
+   17eb8:	00010842 	srl	at,at,0x1
+   17ebc:	00010840 	sll	at,at,0x1
+   17ec0:	40816000 	mtc0	at,c0_status
+   17ec4:	8e020134 	lw	v0,308(s0)
+   17ec8:	34420010 	ori	v0,v0,0x10
+   17ecc:	ae020134 	sw	v0,308(s0)
+   17ed0:	40016000 	mfc0	at,c0_status
+   17ed4:	340200ff 	ori	v0,zero,0xff
+   17ed8:	00431024 	and	v0,v0,v1
+   17edc:	00220825 	or	at,at,v0
+   17ee0:	40816000 	mtc0	at,c0_status
+   17ee4:	0c004634 	jal	118d0 <sched_sleep>
+   17ee8:	02002021 	addu	a0,s0,zero
+   17eec:	8e030214 	lw	v1,532(s0)
+   17ef0:	24020001 	addiu	v0,zero,1
+   17ef4:	10620005 	beq	v1,v0,17f0c <sys_thread_sleep+0x80>
+   17ef8:	8fbf0024 	lw	ra,36(sp)
+   17efc:	00001021 	addu	v0,zero,zero
+   17f00:	8fb00020 	lw	s0,32(sp)
+   17f04:	03e00008 	jr	ra
+   17f08:	27bd0028 	addiu	sp,sp,40
+   17f0c:	40047801 	mfc0	a0,$15,1
+   17f10:	40024800 	mfc0	v0,c0_count
+   17f14:	00000000 	sll	zero,zero,0x0
+   17f18:	3c030004 	lui	v1,0x4
+   17f1c:	30840003 	andi	a0,a0,0x3
+   17f20:	00042080 	sll	a0,a0,0x2
+   17f24:	2463c950 	addiu	v1,v1,-14000
+   17f28:	00831821 	addu	v1,a0,v1
+   17f2c:	8c630000 	lw	v1,0(v1)
+   17f30:	3c040004 	lui	a0,0x4
+   17f34:	afa30010 	sw	v1,16(sp)
+   17f38:	8e030180 	lw	v1,384(s0)
+   17f3c:	8c849100 	lw	a0,-28416(a0)
+   17f40:	8c6305c4 	lw	v1,1476(v1)
+   17f44:	3c060003 	lui	a2,0x3
+   17f48:	afa30014 	sw	v1,20(sp)
+   17f4c:	8e0302f8 	lw	v1,760(s0)
+   17f50:	3c070003 	lui	a3,0x3
+   17f54:	24c664e4 	addiu	a2,a2,25828
+   17f58:	24e76510 	addiu	a3,a3,25872
+   17f5c:	00002821 	addu	a1,zero,zero
+   17f60:	afa30018 	sw	v1,24(sp)
+   17f64:	0c0009b0 	jal	26c0 <__fprintk>
+   17f68:	afa2001c 	sw	v0,28(sp)
+   17f6c:	8fbf0024 	lw	ra,36(sp)
+   17f70:	00001021 	addu	v0,zero,zero
+   17f74:	8fb00020 	lw	s0,32(sp)
+   17f78:	03e00008 	jr	ra
+   17f7c:	27bd0028 	addiu	sp,sp,40
+   17f80:	40047801 	mfc0	a0,$15,1
+   17f84:	40024800 	mfc0	v0,c0_count
+   17f88:	00000000 	sll	zero,zero,0x0
+   17f8c:	3c030004 	lui	v1,0x4
+   17f90:	30840003 	andi	a0,a0,0x3
+   17f94:	00042080 	sll	a0,a0,0x2
+   17f98:	2463c950 	addiu	v1,v1,-14000
+   17f9c:	00831821 	addu	v1,a0,v1
+   17fa0:	8c630000 	lw	v1,0(v1)
+   17fa4:	3c040004 	lui	a0,0x4
+   17fa8:	afa30010 	sw	v1,16(sp)
+   17fac:	8e030180 	lw	v1,384(s0)
+   17fb0:	8c849100 	lw	a0,-28416(a0)
+   17fb4:	8c6305c4 	lw	v1,1476(v1)
+   17fb8:	3c060003 	lui	a2,0x3
+   17fbc:	afa30014 	sw	v1,20(sp)
+   17fc0:	8e0302f8 	lw	v1,760(s0)
+   17fc4:	3c070003 	lui	a3,0x3
+   17fc8:	24c664b0 	addiu	a2,a2,25776
+   17fcc:	24e76510 	addiu	a3,a3,25872
+   17fd0:	00002821 	addu	a1,zero,zero
+   17fd4:	afa30018 	sw	v1,24(sp)
+   17fd8:	0c0009b0 	jal	26c0 <__fprintk>
+   17fdc:	afa2001c 	sw	v0,28(sp)
+   17fe0:	08005fab 	j	17eac <sys_thread_sleep+0x20>
+   17fe4:	00000000 	sll	zero,zero,0x0
+
+00017fe8 <sys_thread_wakeup>:
+   17fe8:	27bdfe18 	addiu	sp,sp,-488
+   17fec:	afb701dc 	sw	s7,476(sp)
+   17ff0:	afb101c4 	sw	s1,452(sp)
+   17ff4:	afbf01e4 	sw	ra,484(sp)
+   17ff8:	afbe01e0 	sw	s8,480(sp)
+   17ffc:	afb601d8 	sw	s6,472(sp)
+   18000:	afb501d4 	sw	s5,468(sp)
+   18004:	afb401d0 	sw	s4,464(sp)
+   18008:	afb301cc 	sw	s3,460(sp)
+   1800c:	afb201c8 	sw	s2,456(sp)
+   18010:	afb001c0 	sw	s0,448(sp)
+   18014:	00808821 	addu	s1,a0,zero
+   18018:	00c0b821 	addu	s7,a2,zero
+   1801c:	40162002 	mfc0	s6,$4,2
+   18020:	10a00093 	beqz	a1,18270 <sys_thread_wakeup+0x288>
+   18024:	8ed40180 	lw	s4,384(s6)
+   18028:	24a2c000 	addiu	v0,a1,-16384
+   1802c:	00063080 	sll	a2,a2,0x2
+   18030:	3c037fff 	lui	v1,0x7fff
+   18034:	00461021 	addu	v0,v0,a2
+   18038:	3463c001 	ori	v1,v1,0xc001
+   1803c:	0043102b 	sltu	v0,v0,v1
+   18040:	10400089 	beqz	v0,18268 <sys_thread_wakeup+0x280>
+   18044:	2402ffff 	addiu	v0,zero,-1
+   18048:	12e00087 	beqz	s7,18268 <sys_thread_wakeup+0x280>
+   1804c:	00000000 	sll	zero,zero,0x0
+   18050:	2ee20065 	sltiu	v0,s7,101
+   18054:	10400084 	beqz	v0,18268 <sys_thread_wakeup+0x280>
+   18058:	2402ffff 	addiu	v0,zero,-1
+   1805c:	0c00011b 	jal	46c <cpu_copy_from_uspace>
+   18060:	27a40030 	addiu	a0,sp,48
+   18064:	14400080 	bnez	v0,18268 <sys_thread_wakeup+0x280>
+   18068:	00000000 	sll	zero,zero,0x0
+   1806c:	8fa20030 	lw	v0,48(sp)
+   18070:	14510082 	bne	v0,s1,1827c <sys_thread_wakeup+0x294>
+   18074:	2402fffe 	addiu	v0,zero,-2
+   18078:	8e82063c 	lw	v0,1596(s4)
+   1807c:	0051102b 	sltu	v0,v0,s1
+   18080:	14400083 	bnez	v0,18290 <sys_thread_wakeup+0x2a8>
+   18084:	2402fffd 	addiu	v0,zero,-3
+   18088:	8e830740 	lw	v1,1856(s4)
+   1808c:	00111080 	sll	v0,s1,0x2
+   18090:	00621021 	addu	v0,v1,v0
+   18094:	8c500000 	lw	s0,0(v0)
+   18098:	1200007a 	beqz	s0,18284 <sys_thread_wakeup+0x29c>
+   1809c:	3c03deef 	lui	v1,0xdeef
+   180a0:	8e020390 	lw	v0,912(s0)
+   180a4:	3463baad 	ori	v1,v1,0xbaad
+   180a8:	14430076 	bne	v0,v1,18284 <sys_thread_wakeup+0x29c>
+   180ac:	27b30034 	addiu	s3,sp,52
+   180b0:	00009021 	addu	s2,zero,zero
+   180b4:	08006045 	j	18114 <sys_thread_wakeup+0x12c>
+   180b8:	241e0001 	addiu	s8,zero,1
+   180bc:	36100101 	ori	s0,s0,0x101
+   180c0:	aeb00000 	sw	s0,0(s5)
+   180c4:	0000000f 	sync
+   180c8:	26520001 	addiu	s2,s2,1
+   180cc:	0257102b 	sltu	v0,s2,s7
+   180d0:	1040002d 	beqz	v0,18188 <sys_thread_wakeup+0x1a0>
+   180d4:	8fbf01e4 	lw	ra,484(sp)
+   180d8:	8e710000 	lw	s1,0(s3)
+   180dc:	8e82063c 	lw	v0,1596(s4)
+   180e0:	0051102b 	sltu	v0,v0,s1
+   180e4:	1440005e 	bnez	v0,18260 <sys_thread_wakeup+0x278>
+   180e8:	00111880 	sll	v1,s1,0x2
+   180ec:	8e820740 	lw	v0,1856(s4)
+   180f0:	00431821 	addu	v1,v0,v1
+   180f4:	8c700000 	lw	s0,0(v1)
+   180f8:	1200002f 	beqz	s0,181b8 <sys_thread_wakeup+0x1d0>
+   180fc:	26730004 	addiu	s3,s3,4
+   18100:	3c03deef 	lui	v1,0xdeef
+   18104:	8e020390 	lw	v0,912(s0)
+   18108:	3463baad 	ori	v1,v1,0xbaad
+   1810c:	1443002b 	bne	v0,v1,181bc <sys_thread_wakeup+0x1d4>
+   18110:	2402fffc 	addiu	v0,zero,-4
+   18114:	02002021 	addu	a0,s0,zero
+   18118:	0c0044a5 	jal	11294 <sched_get_listner>
+   1811c:	24050101 	addiu	a1,zero,257
+   18120:	0040a821 	addu	s5,v0,zero
+   18124:	8ec20214 	lw	v0,532(s6)
+   18128:	145effe4 	bne	v0,s8,180bc <sys_thread_wakeup+0xd4>
+   1812c:	00000000 	sll	zero,zero,0x0
+   18130:	40024800 	mfc0	v0,c0_count
+   18134:	00000000 	sll	zero,zero,0x0
+   18138:	3c030004 	lui	v1,0x4
+   1813c:	8c649100 	lw	a0,-28416(v1)
+   18140:	3c060003 	lui	a2,0x3
+   18144:	8ec302f8 	lw	v1,760(s6)
+   18148:	3c070003 	lui	a3,0x3
+   1814c:	00002821 	addu	a1,zero,zero
+   18150:	24c66524 	addiu	a2,a2,25892
+   18154:	24e765a0 	addiu	a3,a3,26016
+   18158:	36100101 	ori	s0,s0,0x101
+   1815c:	afa30010 	sw	v1,16(sp)
+   18160:	afb10014 	sw	s1,20(sp)
+   18164:	afa20018 	sw	v0,24(sp)
+   18168:	0c0009b0 	jal	26c0 <__fprintk>
+   1816c:	afb2001c 	sw	s2,28(sp)
+   18170:	aeb00000 	sw	s0,0(s5)
+   18174:	0000000f 	sync
+   18178:	26520001 	addiu	s2,s2,1
+   1817c:	0257102b 	sltu	v0,s2,s7
+   18180:	1440ffd5 	bnez	v0,180d8 <sys_thread_wakeup+0xf0>
+   18184:	8fbf01e4 	lw	ra,484(sp)
+   18188:	00001021 	addu	v0,zero,zero
+   1818c:	8fbe01e0 	lw	s8,480(sp)
+   18190:	8fb701dc 	lw	s7,476(sp)
+   18194:	8fb601d8 	lw	s6,472(sp)
+   18198:	8fb501d4 	lw	s5,468(sp)
+   1819c:	8fb401d0 	lw	s4,464(sp)
+   181a0:	8fb301cc 	lw	s3,460(sp)
+   181a4:	8fb201c8 	lw	s2,456(sp)
+   181a8:	8fb101c4 	lw	s1,452(sp)
+   181ac:	8fb001c0 	lw	s0,448(sp)
+   181b0:	03e00008 	jr	ra
+   181b4:	27bd01e8 	addiu	sp,sp,488
+   181b8:	2402fffc 	addiu	v0,zero,-4
+   181bc:	40057801 	mfc0	a1,$15,1
+   181c0:	40034800 	mfc0	v1,c0_count
+   181c4:	00000000 	sll	zero,zero,0x0
+   181c8:	3c040004 	lui	a0,0x4
+   181cc:	30a50003 	andi	a1,a1,0x3
+   181d0:	00052880 	sll	a1,a1,0x2
+   181d4:	2484c950 	addiu	a0,a0,-14000
+   181d8:	00a42021 	addu	a0,a1,a0
+   181dc:	8c840000 	lw	a0,0(a0)
+   181e0:	3c060003 	lui	a2,0x3
+   181e4:	afa40010 	sw	a0,16(sp)
+   181e8:	3c040004 	lui	a0,0x4
+   181ec:	8e8805c4 	lw	t0,1476(s4)
+   181f0:	8c849100 	lw	a0,-28416(a0)
+   181f4:	3c070003 	lui	a3,0x3
+   181f8:	24c66544 	addiu	a2,a2,25924
+   181fc:	24e765a0 	addiu	a3,a3,26016
+   18200:	00002821 	addu	a1,zero,zero
+   18204:	afb2001c 	sw	s2,28(sp)
+   18208:	afb70020 	sw	s7,32(sp)
+   1820c:	afb10024 	sw	s1,36(sp)
+   18210:	afb60018 	sw	s6,24(sp)
+   18214:	afa80014 	sw	t0,20(sp)
+   18218:	afa20028 	sw	v0,40(sp)
+   1821c:	0c0009b0 	jal	26c0 <__fprintk>
+   18220:	afa3002c 	sw	v1,44(sp)
+   18224:	8fbf01e4 	lw	ra,484(sp)
+   18228:	24020016 	addiu	v0,zero,22
+   1822c:	aec20258 	sw	v0,600(s6)
+   18230:	8fbe01e0 	lw	s8,480(sp)
+   18234:	2402ffff 	addiu	v0,zero,-1
+   18238:	8fb701dc 	lw	s7,476(sp)
+   1823c:	8fb601d8 	lw	s6,472(sp)
+   18240:	8fb501d4 	lw	s5,468(sp)
+   18244:	8fb401d0 	lw	s4,464(sp)
+   18248:	8fb301cc 	lw	s3,460(sp)
+   1824c:	8fb201c8 	lw	s2,456(sp)
+   18250:	8fb101c4 	lw	s1,452(sp)
+   18254:	8fb001c0 	lw	s0,448(sp)
+   18258:	03e00008 	jr	ra
+   1825c:	27bd01e8 	addiu	sp,sp,488
+   18260:	0800606f 	j	181bc <sys_thread_wakeup+0x1d4>
+   18264:	2402fffd 	addiu	v0,zero,-3
+   18268:	0800606f 	j	181bc <sys_thread_wakeup+0x1d4>
+   1826c:	2412ffff 	addiu	s2,zero,-1
+   18270:	afa40030 	sw	a0,48(sp)
+   18274:	0800601e 	j	18078 <sys_thread_wakeup+0x90>
+   18278:	24170001 	addiu	s7,zero,1
+   1827c:	0800606f 	j	181bc <sys_thread_wakeup+0x1d4>
+   18280:	2412ffff 	addiu	s2,zero,-1
+   18284:	2402fffc 	addiu	v0,zero,-4
+   18288:	0800606f 	j	181bc <sys_thread_wakeup+0x1d4>
+   1828c:	00009021 	addu	s2,zero,zero
+   18290:	0800606f 	j	181bc <sys_thread_wakeup+0x1d4>
+   18294:	00009021 	addu	s2,zero,zero
+
+00018298 <sys_thread_yield>:
+   18298:	08004636 	j	118d8 <sched_yield>
+   1829c:	40042002 	mfc0	a0,$4,2
+
+000182a0 <sys_times>:
+   182a0:	27bdffc8 	addiu	sp,sp,-56
+   182a4:	afbf0034 	sw	ra,52(sp)
+   182a8:	1080000d 	beqz	a0,182e0 <sys_times+0x40>
+   182ac:	afb00030 	sw	s0,48(sp)
+   182b0:	28834000 	slti	v1,a0,16384
+   182b4:	1460000a 	bnez	v1,182e0 <sys_times+0x40>
+   182b8:	3c038000 	lui	v1,0x8000
+   182bc:	34630001 	ori	v1,v1,0x1
+   182c0:	0083182b 	sltu	v1,a0,v1
+   182c4:	10600006 	beqz	v1,182e0 <sys_times+0x40>
+   182c8:	3c037fff 	lui	v1,0x7fff
+   182cc:	2482c020 	addiu	v0,a0,-16352
+   182d0:	3463c001 	ori	v1,v1,0xc001
+   182d4:	0043102b 	sltu	v0,v0,v1
+   182d8:	14400006 	bnez	v0,182f4 <sys_times+0x54>
+   182dc:	00000000 	sll	zero,zero,0x0
+   182e0:	24020016 	addiu	v0,zero,22
+   182e4:	8fbf0034 	lw	ra,52(sp)
+   182e8:	8fb00030 	lw	s0,48(sp)
+   182ec:	03e00008 	jr	ra
+   182f0:	27bd0038 	addiu	sp,sp,56
+   182f4:	40102002 	mfc0	s0,$4,2
+   182f8:	8e020248 	lw	v0,584(s0)
+   182fc:	8e03024c 	lw	v1,588(s0)
+   18300:	afa20010 	sw	v0,16(sp)
+   18304:	afa30014 	sw	v1,20(sp)
+   18308:	8e020250 	lw	v0,592(s0)
+   1830c:	8e030254 	lw	v1,596(s0)
+   18310:	27a50010 	addiu	a1,sp,16
+   18314:	afa20018 	sw	v0,24(sp)
+   18318:	afa3001c 	sw	v1,28(sp)
+   1831c:	00001021 	addu	v0,zero,zero
+   18320:	00001821 	addu	v1,zero,zero
+   18324:	24060020 	addiu	a2,zero,32
+   18328:	afa30024 	sw	v1,36(sp)
+   1832c:	afa3002c 	sw	v1,44(sp)
+   18330:	afa20020 	sw	v0,32(sp)
+   18334:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   18338:	afa20028 	sw	v0,40(sp)
+   1833c:	2403ffff 	addiu	v1,zero,-1
+   18340:	0002180a 	movz	v1,zero,v0
+   18344:	ae020258 	sw	v0,600(s0)
+   18348:	080060b9 	j	182e4 <sys_times+0x44>
+   1834c:	00601021 	addu	v0,v1,zero
+
+00018350 <sys_unlink>:
+   18350:	3c020001 	lui	v0,0x1
+   18354:	27bdffc8 	addiu	sp,sp,-56
+   18358:	2442bf70 	addiu	v0,v0,-16528
+   1835c:	afa20018 	sw	v0,24(sp)
+   18360:	3c020001 	lui	v0,0x1
+   18364:	2442bee4 	addiu	v0,v0,-16668
+   18368:	afa2001c 	sw	v0,28(sp)
+   1836c:	3c020001 	lui	v0,0x1
+   18370:	2442be2c 	addiu	v0,v0,-16852
+   18374:	afa20024 	sw	v0,36(sp)
+   18378:	3c020001 	lui	v0,0x1
+   1837c:	2442bd0c 	addiu	v0,v0,-17140
+   18380:	afa20020 	sw	v0,32(sp)
+   18384:	3c020001 	lui	v0,0x1
+   18388:	2442beb0 	addiu	v0,v0,-16720
+   1838c:	afbf0034 	sw	ra,52(sp)
+   18390:	afa40010 	sw	a0,16(sp)
+   18394:	afa20028 	sw	v0,40(sp)
+   18398:	afa00014 	sw	zero,20(sp)
+   1839c:	40022002 	mfc0	v0,$4,2
+   183a0:	8c440180 	lw	a0,384(v0)
+   183a4:	27a50010 	addiu	a1,sp,16
+   183a8:	0c00a438 	jal	290e0 <vfs_unlink>
+   183ac:	2484054c 	addiu	a0,a0,1356
+   183b0:	14400004 	bnez	v0,183c4 <sys_unlink+0x74>
+   183b4:	00000000 	sll	zero,zero,0x0
+   183b8:	8fbf0034 	lw	ra,52(sp)
+   183bc:	03e00008 	jr	ra
+   183c0:	27bd0038 	addiu	sp,sp,56
+   183c4:	40032002 	mfc0	v1,$4,2
+   183c8:	04400003 	bltz	v0,183d8 <sys_unlink+0x88>
+   183cc:	ac620258 	sw	v0,600(v1)
+   183d0:	080060ee 	j	183b8 <sys_unlink+0x68>
+   183d4:	2402ffff 	addiu	v0,zero,-1
+   183d8:	00021023 	negu	v0,v0
+   183dc:	ac620258 	sw	v0,600(v1)
+   183e0:	080060ee 	j	183b8 <sys_unlink+0x68>
+   183e4:	2402ffff 	addiu	v0,zero,-1
+
+000183e8 <sys_utls>:
+   183e8:	40022002 	mfc0	v0,$4,2
+   183ec:	24030002 	addiu	v1,zero,2
+   183f0:	1083000d 	beq	a0,v1,18428 <sys_utls+0x40>
+   183f4:	24030003 	addiu	v1,zero,3
+   183f8:	10830009 	beq	a0,v1,18420 <sys_utls+0x38>
+   183fc:	24030001 	addiu	v1,zero,1
+   18400:	10830004 	beq	a0,v1,18414 <sys_utls+0x2c>
+   18404:	24030016 	addiu	v1,zero,22
+   18408:	ac430258 	sw	v1,600(v0)
+   1840c:	03e00008 	jr	ra
+   18410:	2402ffff 	addiu	v0,zero,-1
+   18414:	ac4502fc 	sw	a1,764(v0)
+   18418:	03e00008 	jr	ra
+   1841c:	00001021 	addu	v0,zero,zero
+   18420:	03e00008 	jr	ra
+   18424:	8c420258 	lw	v0,600(v0)
+   18428:	03e00008 	jr	ra
+   1842c:	8c4202fc 	lw	v0,764(v0)
+
+00018430 <sys_write>:
+   18430:	27bdffc0 	addiu	sp,sp,-64
+   18434:	afb10034 	sw	s1,52(sp)
+   18438:	afb00030 	sw	s0,48(sp)
+   1843c:	afbf003c 	sw	ra,60(sp)
+   18440:	afb20038 	sw	s2,56(sp)
+   18444:	00801021 	addu	v0,a0,zero
+   18448:	00a08821 	addu	s1,a1,zero
+   1844c:	00c08021 	addu	s0,a2,zero
+   18450:	40122002 	mfc0	s2,$4,2
+   18454:	40042002 	mfc0	a0,$4,2
+   18458:	2c430008 	sltiu	v1,v0,8
+   1845c:	10600022 	beqz	v1,184e8 <sys_write+0xb8>
+   18460:	8c840180 	lw	a0,384(a0)
+   18464:	00402821 	addu	a1,v0,zero
+   18468:	27a60010 	addiu	a2,sp,16
+   1846c:	0c0061dc 	jal	18770 <task_fd_lookup>
+   18470:	afa00010 	sw	zero,16(sp)
+   18474:	1440001c 	bnez	v0,184e8 <sys_write+0xb8>
+   18478:	3c020001 	lui	v0,0x1
+   1847c:	2442bfc0 	addiu	v0,v0,-16448
+   18480:	afa2001c 	sw	v0,28(sp)
+   18484:	3c020001 	lui	v0,0x1
+   18488:	2442bf38 	addiu	v0,v0,-16584
+   1848c:	afa20020 	sw	v0,32(sp)
+   18490:	3c020001 	lui	v0,0x1
+   18494:	2442be2c 	addiu	v0,v0,-16852
+   18498:	afa20028 	sw	v0,40(sp)
+   1849c:	3c020001 	lui	v0,0x1
+   184a0:	2442bd0c 	addiu	v0,v0,-17140
+   184a4:	afa20024 	sw	v0,36(sp)
+   184a8:	8fa40010 	lw	a0,16(sp)
+   184ac:	3c020001 	lui	v0,0x1
+   184b0:	2442bc80 	addiu	v0,v0,-17280
+   184b4:	27a50014 	addiu	a1,sp,20
+   184b8:	afb10014 	sw	s1,20(sp)
+   184bc:	afa2002c 	sw	v0,44(sp)
+   184c0:	0c009e78 	jal	279e0 <vfs_write>
+   184c4:	afb00018 	sw	s0,24(sp)
+   184c8:	04400010 	bltz	v0,1850c <sys_write+0xdc>
+   184cc:	00000000 	sll	zero,zero,0x0
+   184d0:	8fbf003c 	lw	ra,60(sp)
+   184d4:	8fb20038 	lw	s2,56(sp)
+   184d8:	8fb10034 	lw	s1,52(sp)
+   184dc:	8fb00030 	lw	s0,48(sp)
+   184e0:	03e00008 	jr	ra
+   184e4:	27bd0040 	addiu	sp,sp,64
+   184e8:	8fbf003c 	lw	ra,60(sp)
+   184ec:	2402004d 	addiu	v0,zero,77
+   184f0:	ae420258 	sw	v0,600(s2)
+   184f4:	8fb10034 	lw	s1,52(sp)
+   184f8:	2402ffff 	addiu	v0,zero,-1
+   184fc:	8fb20038 	lw	s2,56(sp)
+   18500:	8fb00030 	lw	s0,48(sp)
+   18504:	03e00008 	jr	ra
+   18508:	27bd0040 	addiu	sp,sp,64
+   1850c:	00021023 	negu	v0,v0
+   18510:	ae420258 	sw	v0,600(s2)
+   18514:	08006134 	j	184d0 <sys_write+0xa0>
+   18518:	2402ffff 	addiu	v0,zero,-1
+
+0001851c <task_fd_check>:
+   1851c:	8c830304 	lw	v1,772(a0)
+   18520:	8c820308 	lw	v0,776(a0)
+   18524:	0062102b 	sltu	v0,v1,v0
+   18528:	24030018 	addiu	v1,zero,24
+   1852c:	0002180b 	movn	v1,zero,v0
+   18530:	03e00008 	jr	ra
+   18534:	00601021 	addu	v0,v1,zero
+
+00018538 <__task_fd_set>:
+   18538:	8c82030c 	lw	v0,780(a0)
+   1853c:	00052980 	sll	a1,a1,0x6
+   18540:	00451821 	addu	v1,v0,a1
+   18544:	24630004 	addiu	v1,v1,4
+   18548:	24c70030 	addiu	a3,a2,48
+   1854c:	8ccb0000 	lw	t3,0(a2)
+   18550:	8cca0004 	lw	t2,4(a2)
+   18554:	8cc90008 	lw	t1,8(a2)
+   18558:	8cc8000c 	lw	t0,12(a2)
+   1855c:	24c60010 	addiu	a2,a2,16
+   18560:	ac6b0000 	sw	t3,0(v1)
+   18564:	ac6a0004 	sw	t2,4(v1)
+   18568:	ac690008 	sw	t1,8(v1)
+   1856c:	ac68000c 	sw	t0,12(v1)
+   18570:	14c7fff6 	bne	a2,a3,1854c <__task_fd_set+0x14>
+   18574:	24630010 	addiu	v1,v1,16
+   18578:	8cc80008 	lw	t0,8(a2)
+   1857c:	8cc70000 	lw	a3,0(a2)
+   18580:	8cc60004 	lw	a2,4(a2)
+   18584:	00451021 	addu	v0,v0,a1
+   18588:	ac680008 	sw	t0,8(v1)
+   1858c:	ac670000 	sw	a3,0(v1)
+   18590:	ac660004 	sw	a2,4(v1)
+   18594:	24030001 	addiu	v1,zero,1
+   18598:	a0430000 	sb	v1,0(v0)
+   1859c:	8c830304 	lw	v1,772(a0)
+   185a0:	00001021 	addu	v0,zero,zero
+   185a4:	24630001 	addiu	v1,v1,1
+   185a8:	03e00008 	jr	ra
+   185ac:	ac830304 	sw	v1,772(a0)
+
+000185b0 <task_lookup_zero>:
+   185b0:	3c020004 	lui	v0,0x4
+   185b4:	03e00008 	jr	ra
+   185b8:	8c429ad8 	lw	v0,-25896(v0)
+
+000185bc <task_htable_pid_compare>:
+   185bc:	8c82fdf0 	lw	v0,-528(a0)
+   185c0:	8ca30000 	lw	v1,0(a1)
+   185c4:	00431026 	xor	v0,v0,v1
+   185c8:	03e00008 	jr	ra
+   185cc:	2c420001 	sltiu	v0,v0,1
+
+000185d0 <tasks_manager_get_htable>:
+   185d0:	3c020004 	lui	v0,0x4
+   185d4:	03e00008 	jr	ra
+   185d8:	2442bad4 	addiu	v0,v0,-17708
+
+000185dc <task_kmem_init>:
+   185dc:	24020006 	addiu	v0,zero,6
+   185e0:	ac820000 	sw	v0,0(a0)
+   185e4:	3c020003 	lui	v0,0x3
+   185e8:	244265b4 	addiu	v0,v0,26036
+   185ec:	ac820004 	sw	v0,4(a0)
+   185f0:	240207e0 	addiu	v0,zero,2016
+   185f4:	ac820008 	sw	v0,8(a0)
+   185f8:	24020002 	addiu	v0,zero,2
+   185fc:	ac82000c 	sw	v0,12(a0)
+   18600:	24020003 	addiu	v0,zero,3
+   18604:	ac820010 	sw	v0,16(a0)
+   18608:	3c020002 	lui	v0,0x2
+   1860c:	244286d4 	addiu	v0,v0,-31020
+   18610:	ac820018 	sw	v0,24(a0)
+   18614:	ac80001c 	sw	zero,28(a0)
+   18618:	ac800014 	sw	zero,20(a0)
+   1861c:	03e00008 	jr	ra
+   18620:	00001021 	addu	v0,zero,zero
+
+00018624 <task_fdinfo_kmem_init>:
+   18624:	24030007 	addiu	v1,zero,7
+   18628:	ac830000 	sw	v1,0(a0)
+   1862c:	3c030003 	lui	v1,0x3
+   18630:	246365c0 	addiu	v1,v1,26048
+   18634:	24020002 	addiu	v0,zero,2
+   18638:	ac830004 	sw	v1,4(a0)
+   1863c:	24030220 	addiu	v1,zero,544
+   18640:	ac820010 	sw	v0,16(a0)
+   18644:	ac82000c 	sw	v0,12(a0)
+   18648:	ac830008 	sw	v1,8(a0)
+   1864c:	ac80001c 	sw	zero,28(a0)
+   18650:	ac800014 	sw	zero,20(a0)
+   18654:	ac800018 	sw	zero,24(a0)
+   18658:	03e00008 	jr	ra
+   1865c:	00001021 	addu	v0,zero,zero
+
+00018660 <task_fd_init>:
+   18660:	27bdffe8 	addiu	sp,sp,-24
+   18664:	3c050003 	lui	a1,0x3
+   18668:	afb00010 	sw	s0,16(sp)
+   1866c:	24a565cc 	addiu	a1,a1,26060
+   18670:	00808021 	addu	s0,a0,zero
+   18674:	afbf0014 	sw	ra,20(sp)
+   18678:	0c004a24 	jal	12890 <spinlock_init>
+   1867c:	248402f0 	addiu	a0,a0,752
+   18680:	24020008 	addiu	v0,zero,8
+   18684:	26030310 	addiu	v1,s0,784
+   18688:	ae020308 	sw	v0,776(s0)
+   1868c:	ae000300 	sw	zero,768(s0)
+   18690:	ae000304 	sw	zero,772(s0)
+   18694:	ae03030c 	sw	v1,780(s0)
+   18698:	080061a9 	j	186a4 <task_fd_init+0x44>
+   1869c:	00001021 	addu	v0,zero,zero
+   186a0:	8e03030c 	lw	v1,780(s0)
+   186a4:	00022180 	sll	a0,v0,0x6
+   186a8:	00641821 	addu	v1,v1,a0
+   186ac:	a0600000 	sb	zero,0(v1)
+   186b0:	8e030308 	lw	v1,776(s0)
+   186b4:	24420001 	addiu	v0,v0,1
+   186b8:	0043182b 	sltu	v1,v0,v1
+   186bc:	1460fff8 	bnez	v1,186a0 <task_fd_init+0x40>
+   186c0:	8fbf0014 	lw	ra,20(sp)
+   186c4:	00001021 	addu	v0,zero,zero
+   186c8:	8fb00010 	lw	s0,16(sp)
+   186cc:	03e00008 	jr	ra
+   186d0:	27bd0018 	addiu	sp,sp,24
+   186d4:	27bdffe0 	addiu	sp,sp,-32
+   186d8:	afb10018 	sw	s1,24(sp)
+   186dc:	3c110003 	lui	s1,0x3
+   186e0:	afb00014 	sw	s0,20(sp)
+   186e4:	00a02021 	addu	a0,a1,zero
+   186e8:	00a08021 	addu	s0,a1,zero
+   186ec:	afbf001c 	sw	ra,28(sp)
+   186f0:	0c003096 	jal	c258 <mcs_lock_init>
+   186f4:	262565b8 	addiu	a1,s1,26040
+   186f8:	262565b8 	addiu	a1,s1,26040
+   186fc:	0c004a24 	jal	12890 <spinlock_init>
+   18700:	26040090 	addiu	a0,s0,144
+   18704:	0c004428 	jal	110a0 <rwlock_init>
+   18708:	260400b0 	addiu	a0,s0,176
+   1870c:	3c050003 	lui	a1,0x3
+   18710:	260400a0 	addiu	a0,s0,160
+   18714:	0c004a24 	jal	12890 <spinlock_init>
+   18718:	24a565d8 	addiu	a1,a1,26072
+   1871c:	3c050003 	lui	a1,0x3
+   18720:	26040170 	addiu	a0,s0,368
+   18724:	0c004a24 	jal	12890 <spinlock_init>
+   18728:	24a565e8 	addiu	a1,a1,26088
+   1872c:	8fbf001c 	lw	ra,28(sp)
+   18730:	2603061c 	addiu	v1,s0,1564
+   18734:	26020744 	addiu	v0,s0,1860
+   18738:	ae020748 	sw	v0,1864(s0)
+   1873c:	ae030620 	sw	v1,1568(s0)
+   18740:	ae03061c 	sw	v1,1564(s0)
+   18744:	ae020744 	sw	v0,1860(s0)
+   18748:	8fb10018 	lw	s1,24(sp)
+   1874c:	8fb00014 	lw	s0,20(sp)
+   18750:	03e00008 	jr	ra
+   18754:	27bd0020 	addiu	sp,sp,32
+
+00018758 <tasks_manager_unlock>:
+   18758:	3c040004 	lui	a0,0x4
+   1875c:	08004b0b 	j	12c2c <spinlock_unlock>
+   18760:	24849ac0 	addiu	a0,a0,-25920
+
+00018764 <tasks_manager_lock>:
+   18764:	3c040004 	lui	a0,0x4
+   18768:	08004bc3 	j	12f0c <spinlock_lock>
+   1876c:	24849ac0 	addiu	a0,a0,-25920
+
+00018770 <task_fd_lookup>:
+   18770:	8c820308 	lw	v0,776(a0)
+   18774:	27bdffd8 	addiu	sp,sp,-40
+   18778:	00a2102b 	sltu	v0,a1,v0
+   1877c:	afb0001c 	sw	s0,28(sp)
+   18780:	afbf0024 	sw	ra,36(sp)
+   18784:	afb10020 	sw	s1,32(sp)
+   18788:	14400007 	bnez	v0,187a8 <task_fd_lookup+0x38>
+   1878c:	00808021 	addu	s0,a0,zero
+   18790:	8fbf0024 	lw	ra,36(sp)
+   18794:	2402004d 	addiu	v0,zero,77
+   18798:	8fb10020 	lw	s1,32(sp)
+   1879c:	8fb0001c 	lw	s0,28(sp)
+   187a0:	03e00008 	jr	ra
+   187a4:	27bd0028 	addiu	sp,sp,40
+   187a8:	249102f0 	addiu	s1,a0,752
+   187ac:	02202021 	addu	a0,s1,zero
+   187b0:	afa50010 	sw	a1,16(sp)
+   187b4:	0c004bc3 	jal	12f0c <spinlock_lock>
+   187b8:	afa60014 	sw	a2,20(sp)
+   187bc:	8fa50010 	lw	a1,16(sp)
+   187c0:	8e02030c 	lw	v0,780(s0)
+   187c4:	00052980 	sll	a1,a1,0x6
+   187c8:	00452821 	addu	a1,v0,a1
+   187cc:	8fa60014 	lw	a2,20(sp)
+   187d0:	24a50004 	addiu	a1,a1,4
+   187d4:	02202021 	addu	a0,s1,zero
+   187d8:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   187dc:	acc50000 	sw	a1,0(a2)
+   187e0:	8fbf0024 	lw	ra,36(sp)
+   187e4:	00001021 	addu	v0,zero,zero
+   187e8:	8fb10020 	lw	s1,32(sp)
+   187ec:	8fb0001c 	lw	s0,28(sp)
+   187f0:	03e00008 	jr	ra
+   187f4:	27bd0028 	addiu	sp,sp,40
+
+000187f8 <task_fd_put>:
+   187f8:	8c820308 	lw	v0,776(a0)
+   187fc:	27bdffd8 	addiu	sp,sp,-40
+   18800:	0045102b 	sltu	v0,v0,a1
+   18804:	afb0001c 	sw	s0,28(sp)
+   18808:	afbf0024 	sw	ra,36(sp)
+   1880c:	afb10020 	sw	s1,32(sp)
+   18810:	10400007 	beqz	v0,18830 <task_fd_put+0x38>
+   18814:	00808021 	addu	s0,a0,zero
+   18818:	8fbf0024 	lw	ra,36(sp)
+   1881c:	24020009 	addiu	v0,zero,9
+   18820:	8fb10020 	lw	s1,32(sp)
+   18824:	8fb0001c 	lw	s0,28(sp)
+   18828:	03e00008 	jr	ra
+   1882c:	27bd0028 	addiu	sp,sp,40
+   18830:	249102f0 	addiu	s1,a0,752
+   18834:	02202021 	addu	a0,s1,zero
+   18838:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1883c:	afa50010 	sw	a1,16(sp)
+   18840:	8fa50010 	lw	a1,16(sp)
+   18844:	8e02030c 	lw	v0,780(s0)
+   18848:	00052980 	sll	a1,a1,0x6
+   1884c:	00452821 	addu	a1,v0,a1
+   18850:	a0a00000 	sb	zero,0(a1)
+   18854:	8e020304 	lw	v0,772(s0)
+   18858:	02202021 	addu	a0,s1,zero
+   1885c:	2442ffff 	addiu	v0,v0,-1
+   18860:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   18864:	ae020304 	sw	v0,772(s0)
+   18868:	8fbf0024 	lw	ra,36(sp)
+   1886c:	00001021 	addu	v0,zero,zero
+   18870:	8fb10020 	lw	s1,32(sp)
+   18874:	8fb0001c 	lw	s0,28(sp)
+   18878:	03e00008 	jr	ra
+   1887c:	27bd0028 	addiu	sp,sp,40
+
+00018880 <task_lookup>:
+   18880:	308403ff 	andi	a0,a0,0x3ff
+   18884:	3c020004 	lui	v0,0x4
+   18888:	000420c0 	sll	a0,a0,0x3
+   1888c:	24429ad4 	addiu	v0,v0,-25900
+   18890:	03e00008 	jr	ra
+   18894:	00441021 	addu	v0,v0,a0
+
+00018898 <task_fd_set>:
+   18898:	27bdffd8 	addiu	sp,sp,-40
+   1889c:	afb10020 	sw	s1,32(sp)
+   188a0:	249102f0 	addiu	s1,a0,752
+   188a4:	afb0001c 	sw	s0,28(sp)
+   188a8:	00808021 	addu	s0,a0,zero
+   188ac:	afa50010 	sw	a1,16(sp)
+   188b0:	afa60014 	sw	a2,20(sp)
+   188b4:	afbf0024 	sw	ra,36(sp)
+   188b8:	0c004bc3 	jal	12f0c <spinlock_lock>
+   188bc:	02202021 	addu	a0,s1,zero
+   188c0:	8e070308 	lw	a3,776(s0)
+   188c4:	8fa50010 	lw	a1,16(sp)
+   188c8:	10e00010 	beqz	a3,1890c <task_fd_set+0x74>
+   188cc:	8fa60014 	lw	a2,20(sp)
+   188d0:	8e0a030c 	lw	t2,780(s0)
+   188d4:	81420000 	lb	v0,0(t2)
+   188d8:	1040001b 	beqz	v0,18948 <task_fd_set+0xb0>
+   188dc:	01404021 	addu	t0,t2,zero
+   188e0:	25430040 	addiu	v1,t2,64
+   188e4:	0800623f 	j	188fc <task_fd_set+0x64>
+   188e8:	00001021 	addu	v0,zero,zero
+   188ec:	80640000 	lb	a0,0(v1)
+   188f0:	00024980 	sll	t1,v0,0x6
+   188f4:	10800015 	beqz	a0,1894c <task_fd_set+0xb4>
+   188f8:	24630040 	addiu	v1,v1,64
+   188fc:	24420001 	addiu	v0,v0,1
+   18900:	0047202b 	sltu	a0,v0,a3
+   18904:	1480fff9 	bnez	a0,188ec <task_fd_set+0x54>
+   18908:	00604021 	addu	t0,v1,zero
+   1890c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   18910:	02202021 	addu	a0,s1,zero
+   18914:	3c020004 	lui	v0,0x4
+   18918:	8e070308 	lw	a3,776(s0)
+   1891c:	8c449100 	lw	a0,-28416(v0)
+   18920:	3c060003 	lui	a2,0x3
+   18924:	24c665f4 	addiu	a2,a2,26100
+   18928:	0c0009b0 	jal	26c0 <__fprintk>
+   1892c:	00002821 	addu	a1,zero,zero
+   18930:	8fbf0024 	lw	ra,36(sp)
+   18934:	24020018 	addiu	v0,zero,24
+   18938:	8fb10020 	lw	s1,32(sp)
+   1893c:	8fb0001c 	lw	s0,28(sp)
+   18940:	03e00008 	jr	ra
+   18944:	27bd0028 	addiu	sp,sp,40
+   18948:	00004821 	addu	t1,zero,zero
+   1894c:	25080004 	addiu	t0,t0,4
+   18950:	24a30030 	addiu	v1,a1,48
+   18954:	8cac0000 	lw	t4,0(a1)
+   18958:	8cab0004 	lw	t3,4(a1)
+   1895c:	8ca70008 	lw	a3,8(a1)
+   18960:	8ca4000c 	lw	a0,12(a1)
+   18964:	24a50010 	addiu	a1,a1,16
+   18968:	ad0c0000 	sw	t4,0(t0)
+   1896c:	ad0b0004 	sw	t3,4(t0)
+   18970:	ad070008 	sw	a3,8(t0)
+   18974:	ad04000c 	sw	a0,12(t0)
+   18978:	14a3fff6 	bne	a1,v1,18954 <task_fd_set+0xbc>
+   1897c:	25080010 	addiu	t0,t0,16
+   18980:	8ca30004 	lw	v1,4(a1)
+   18984:	8ca40000 	lw	a0,0(a1)
+   18988:	8ca70008 	lw	a3,8(a1)
+   1898c:	01494821 	addu	t1,t2,t1
+   18990:	ad030004 	sw	v1,4(t0)
+   18994:	24030001 	addiu	v1,zero,1
+   18998:	ad040000 	sw	a0,0(t0)
+   1899c:	ad070008 	sw	a3,8(t0)
+   189a0:	a1230000 	sb	v1,0(t1)
+   189a4:	8e030304 	lw	v1,772(s0)
+   189a8:	02202021 	addu	a0,s1,zero
+   189ac:	24630001 	addiu	v1,v1,1
+   189b0:	ae030304 	sw	v1,772(s0)
+   189b4:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   189b8:	acc20000 	sw	v0,0(a2)
+   189bc:	8fbf0024 	lw	ra,36(sp)
+   189c0:	00001021 	addu	v0,zero,zero
+   189c4:	8fb10020 	lw	s1,32(sp)
+   189c8:	8fb0001c 	lw	s0,28(sp)
+   189cc:	03e00008 	jr	ra
+   189d0:	27bd0028 	addiu	sp,sp,40
+
+000189d4 <task_fd_destroy>:
+   189d4:	8c820308 	lw	v0,776(a0)
+   189d8:	27bdffd8 	addiu	sp,sp,-40
+   189dc:	afb1001c 	sw	s1,28(sp)
+   189e0:	afbf0024 	sw	ra,36(sp)
+   189e4:	afb20020 	sw	s2,32(sp)
+   189e8:	afb00018 	sw	s0,24(sp)
+   189ec:	1040001d 	beqz	v0,18a64 <task_fd_destroy+0x90>
+   189f0:	00808821 	addu	s1,a0,zero
+   189f4:	00008021 	addu	s0,zero,zero
+   189f8:	08006284 	j	18a10 <task_fd_destroy+0x3c>
+   189fc:	27b20010 	addiu	s2,sp,16
+   18a00:	8e220308 	lw	v0,776(s1)
+   18a04:	0202102b 	sltu	v0,s0,v0
+   18a08:	10400016 	beqz	v0,18a64 <task_fd_destroy+0x90>
+   18a0c:	00000000 	sll	zero,zero,0x0
+   18a10:	02002821 	addu	a1,s0,zero
+   18a14:	02202021 	addu	a0,s1,zero
+   18a18:	0c0061dc 	jal	18770 <task_fd_lookup>
+   18a1c:	02403021 	addu	a2,s2,zero
+   18a20:	00101980 	sll	v1,s0,0x6
+   18a24:	14400011 	bnez	v0,18a6c <task_fd_destroy+0x98>
+   18a28:	26100001 	addiu	s0,s0,1
+   18a2c:	8fa40010 	lw	a0,16(sp)
+   18a30:	1080fff3 	beqz	a0,18a00 <task_fd_destroy+0x2c>
+   18a34:	00000000 	sll	zero,zero,0x0
+   18a38:	8e22030c 	lw	v0,780(s1)
+   18a3c:	00431821 	addu	v1,v0,v1
+   18a40:	80620000 	lb	v0,0(v1)
+   18a44:	1040ffee 	beqz	v0,18a00 <task_fd_destroy+0x2c>
+   18a48:	00000000 	sll	zero,zero,0x0
+   18a4c:	0c009f67 	jal	27d9c <vfs_close>
+   18a50:	00002821 	addu	a1,zero,zero
+   18a54:	8e220308 	lw	v0,776(s1)
+   18a58:	0202102b 	sltu	v0,s0,v0
+   18a5c:	1440ffec 	bnez	v0,18a10 <task_fd_destroy+0x3c>
+   18a60:	00000000 	sll	zero,zero,0x0
+   18a64:	ae20030c 	sw	zero,780(s1)
+   18a68:	00001021 	addu	v0,zero,zero
+   18a6c:	8fbf0024 	lw	ra,36(sp)
+   18a70:	8fb20020 	lw	s2,32(sp)
+   18a74:	8fb1001c 	lw	s1,28(sp)
+   18a78:	8fb00018 	lw	s0,24(sp)
+   18a7c:	03e00008 	jr	ra
+   18a80:	27bd0028 	addiu	sp,sp,40
+
+00018a84 <task_manager_init>:
+   18a84:	3c040004 	lui	a0,0x4
+   18a88:	3c050003 	lui	a1,0x3
+   18a8c:	27bdffe8 	addiu	sp,sp,-24
+   18a90:	24849ac0 	addiu	a0,a0,-25920
+   18a94:	afbf0014 	sw	ra,20(sp)
+   18a98:	0c004a24 	jal	12890 <spinlock_init>
+   18a9c:	24a5661c 	addiu	a1,a1,26140
+   18aa0:	3c040004 	lui	a0,0x4
+   18aa4:	8fbf0014 	lw	ra,20(sp)
+   18aa8:	24849adc 	addiu	a0,a0,-25892
+   18aac:	3405ffff 	ori	a1,zero,0xffff
+   18ab0:	24061ff8 	addiu	a2,zero,8184
+   18ab4:	0800c182 	j	30608 <memset>
+   18ab8:	27bd0018 	addiu	sp,sp,24
+
+00018abc <task_bootstrap_finalize>:
+   18abc:	3c040004 	lui	a0,0x4
+   18ac0:	27bdffe0 	addiu	sp,sp,-32
+   18ac4:	afbf001c 	sw	ra,28(sp)
+   18ac8:	0c0085df 	jal	2177c <vmm_init>
+   18acc:	2484beb0 	addiu	a0,a0,-16720
+   18ad0:	10400004 	beqz	v0,18ae4 <task_bootstrap_finalize+0x28>
+   18ad4:	3c050004 	lui	a1,0x4
+   18ad8:	8fbf001c 	lw	ra,28(sp)
+   18adc:	03e00008 	jr	ra
+   18ae0:	27bd0020 	addiu	sp,sp,32
+   18ae4:	3c040004 	lui	a0,0x4
+   18ae8:	2484bf80 	addiu	a0,a0,-16512
+   18aec:	0c000d37 	jal	34dc <pmm_init>
+   18af0:	24a56db0 	addiu	a1,a1,28080
+   18af4:	1040fff9 	beqz	v0,18adc <task_bootstrap_finalize+0x20>
+   18af8:	8fbf001c 	lw	ra,28(sp)
+   18afc:	3c030004 	lui	v1,0x4
+   18b00:	3c060003 	lui	a2,0x3
+   18b04:	3c070003 	lui	a3,0x3
+   18b08:	8c649100 	lw	a0,-28416(v1)
+   18b0c:	24c66628 	addiu	a2,a2,26152
+   18b10:	24e767c0 	addiu	a3,a3,26560
+   18b14:	00002821 	addu	a1,zero,zero
+   18b18:	0c0009b0 	jal	26c0 <__fprintk>
+   18b1c:	afa20010 	sw	v0,16(sp)
+   18b20:	080062c8 	j	18b20 <task_bootstrap_finalize+0x64>
+   18b24:	00000000 	sll	zero,zero,0x0
+
+00018b28 <task_bootstrap_init>:
+   18b28:	27bdffe0 	addiu	sp,sp,-32
+   18b2c:	afb00014 	sw	s0,20(sp)
+   18b30:	3c100004 	lui	s0,0x4
+   18b34:	afb10018 	sw	s1,24(sp)
+   18b38:	2605bd30 	addiu	a1,s0,-17104
+   18b3c:	00808821 	addu	s1,a0,zero
+   18b40:	afbf001c 	sw	ra,28(sp)
+   18b44:	0c0061b5 	jal	186d4 <task_fd_init+0x74>
+   18b48:	00002021 	addu	a0,zero,zero
+   18b4c:	3c040004 	lui	a0,0x4
+   18b50:	24060160 	addiu	a2,zero,352
+   18b54:	2484beb0 	addiu	a0,a0,-16720
+   18b58:	00002821 	addu	a1,zero,zero
+   18b5c:	0c00c182 	jal	30608 <memset>
+   18b60:	2610bd30 	addiu	s0,s0,-17104
+   18b64:	2402ffff 	addiu	v0,zero,-1
+   18b68:	ae020294 	sw	v0,660(s0)
+   18b6c:	ae0002bc 	sw	zero,700(s0)
+   18b70:	ae000290 	sw	zero,656(s0)
+   18b74:	8e250028 	lw	a1,40(s1)
+   18b78:	3c040004 	lui	a0,0x4
+   18b7c:	0c000a29 	jal	28a4 <pmm_bootstrap_init>
+   18b80:	2484bf80 	addiu	a0,a0,-16512
+   18b84:	26040510 	addiu	a0,s0,1296
+   18b88:	00002821 	addu	a1,zero,zero
+   18b8c:	0c00c182 	jal	30608 <memset>
+   18b90:	2406003c 	addiu	a2,zero,60
+   18b94:	2604054c 	addiu	a0,s0,1356
+   18b98:	00002821 	addu	a1,zero,zero
+   18b9c:	0c00c182 	jal	30608 <memset>
+   18ba0:	2406003c 	addiu	a2,zero,60
+   18ba4:	26040588 	addiu	a0,s0,1416
+   18ba8:	00002821 	addu	a1,zero,zero
+   18bac:	0c00c182 	jal	30608 <memset>
+   18bb0:	2406003c 	addiu	a2,zero,60
+   18bb4:	3c030004 	lui	v1,0x4
+   18bb8:	2462c960 	addiu	v0,v1,-13984
+   18bbc:	88420003 	lwl	v0,3(v0)
+   18bc0:	3c040004 	lui	a0,0x4
+   18bc4:	9862c960 	lwr	v0,-13984(v1)
+   18bc8:	2484c304 	addiu	a0,a0,-15612
+   18bcc:	3042ffff 	andi	v0,v0,0xffff
+   18bd0:	00021280 	sll	v0,v0,0xa
+   18bd4:	24030800 	addiu	v1,zero,2048
+   18bd8:	00002821 	addu	a1,zero,zero
+   18bdc:	ae0205c4 	sw	v0,1476(s0)
+   18be0:	ae030634 	sw	v1,1588(s0)
+   18be4:	ae00062c 	sw	zero,1580(s0)
+   18be8:	0c00199f 	jal	667c <atomic_init>
+   18bec:	ae000630 	sw	zero,1584(s0)
+   18bf0:	8fbf001c 	lw	ra,28(sp)
+   18bf4:	24020200 	addiu	v0,zero,512
+   18bf8:	a6020614 	sh	v0,1556(s0)
+   18bfc:	8fb10018 	lw	s1,24(sp)
+   18c00:	00001021 	addu	v0,zero,zero
+   18c04:	8fb00014 	lw	s0,20(sp)
+   18c08:	03e00008 	jr	ra
+   18c0c:	27bd0020 	addiu	sp,sp,32
+
+00018c10 <task_vaddr2ppn>:
+   18c10:	27bdffa0 	addiu	sp,sp,-96
+   18c14:	afb30058 	sw	s3,88(sp)
+   18c18:	afb20054 	sw	s2,84(sp)
+   18c1c:	00c09821 	addu	s3,a2,zero
+   18c20:	00809021 	addu	s2,a0,zero
+   18c24:	27a60030 	addiu	a2,sp,48
+   18c28:	24840250 	addiu	a0,a0,592
+   18c2c:	afb10050 	sw	s1,80(sp)
+   18c30:	afb0004c 	sw	s0,76(sp)
+   18c34:	afbf005c 	sw	ra,92(sp)
+   18c38:	0c000a56 	jal	2958 <pmm_get_page>
+   18c3c:	00a08821 	addu	s1,a1,zero
+   18c40:	14400030 	bnez	v0,18d04 <task_vaddr2ppn+0xf4>
+   18c44:	00408021 	addu	s0,v0,zero
+   18c48:	8fa20030 	lw	v0,48(sp)
+   18c4c:	04400032 	bltz	v0,18d18 <task_vaddr2ppn+0x108>
+   18c50:	00000000 	sll	zero,zero,0x0
+   18c54:	24051103 	addiu	a1,zero,4355
+   18c58:	12600005 	beqz	s3,18c70 <task_vaddr2ppn+0x60>
+   18c5c:	3c030400 	lui	v1,0x400
+   18c60:	00431024 	and	v0,v0,v1
+   18c64:	14400002 	bnez	v0,18c70 <task_vaddr2ppn+0x60>
+   18c68:	2402efff 	addiu	v0,zero,-4097
+   18c6c:	00a22824 	and	a1,a1,v0
+   18c70:	0c0080c9 	jal	20324 <__vmm_fault_handler>
+   18c74:	02202021 	addu	a0,s1,zero
+   18c78:	40047801 	mfc0	a0,$15,1
+   18c7c:	40022002 	mfc0	v0,$4,2
+   18c80:	3c030004 	lui	v1,0x4
+   18c84:	30840003 	andi	a0,a0,0x3
+   18c88:	00042080 	sll	a0,a0,0x2
+   18c8c:	2463c950 	addiu	v1,v1,-14000
+   18c90:	00831821 	addu	v1,a0,v1
+   18c94:	8c640000 	lw	a0,0(v1)
+   18c98:	8e4305c4 	lw	v1,1476(s2)
+   18c9c:	afa40010 	sw	a0,16(sp)
+   18ca0:	afa30014 	sw	v1,20(sp)
+   18ca4:	8c4202f8 	lw	v0,760(v0)
+   18ca8:	3c030004 	lui	v1,0x4
+   18cac:	afa20018 	sw	v0,24(sp)
+   18cb0:	8fa20030 	lw	v0,48(sp)
+   18cb4:	8c649100 	lw	a0,-28416(v1)
+   18cb8:	afa20024 	sw	v0,36(sp)
+   18cbc:	3c060003 	lui	a2,0x3
+   18cc0:	8fa20034 	lw	v0,52(sp)
+   18cc4:	3c070003 	lui	a3,0x3
+   18cc8:	24c66644 	addiu	a2,a2,26180
+   18ccc:	24e767d8 	addiu	a3,a3,26584
+   18cd0:	00002821 	addu	a1,zero,zero
+   18cd4:	afb1001c 	sw	s1,28(sp)
+   18cd8:	afb00020 	sw	s0,32(sp)
+   18cdc:	0c0009b0 	jal	26c0 <__fprintk>
+   18ce0:	afa20028 	sw	v0,40(sp)
+   18ce4:	8fbf005c 	lw	ra,92(sp)
+   18ce8:	00001021 	addu	v0,zero,zero
+   18cec:	8fb30058 	lw	s3,88(sp)
+   18cf0:	8fb20054 	lw	s2,84(sp)
+   18cf4:	8fb10050 	lw	s1,80(sp)
+   18cf8:	8fb0004c 	lw	s0,76(sp)
+   18cfc:	03e00008 	jr	ra
+   18d00:	27bd0060 	addiu	sp,sp,96
+   18d04:	8fa20030 	lw	v0,48(sp)
+   18d08:	0441ffd2 	bgez	v0,18c54 <task_vaddr2ppn+0x44>
+   18d0c:	24051100 	addiu	a1,zero,4352
+   18d10:	08006316 	j	18c58 <task_vaddr2ppn+0x48>
+   18d14:	00000000 	sll	zero,zero,0x0
+   18d18:	12600009 	beqz	s3,18d40 <task_vaddr2ppn+0x130>
+   18d1c:	8fbf005c 	lw	ra,92(sp)
+   18d20:	3c030400 	lui	v1,0x400
+   18d24:	00431024 	and	v0,v0,v1
+   18d28:	14400006 	bnez	v0,18d44 <task_vaddr2ppn+0x134>
+   18d2c:	8fa20034 	lw	v0,52(sp)
+   18d30:	24051100 	addiu	a1,zero,4352
+   18d34:	2402efff 	addiu	v0,zero,-4097
+   18d38:	0800631c 	j	18c70 <task_vaddr2ppn+0x60>
+   18d3c:	00a22824 	and	a1,a1,v0
+   18d40:	8fa20034 	lw	v0,52(sp)
+   18d44:	8fb30058 	lw	s3,88(sp)
+   18d48:	8fb20054 	lw	s2,84(sp)
+   18d4c:	8fb10050 	lw	s1,80(sp)
+   18d50:	8fb0004c 	lw	s0,76(sp)
+   18d54:	03e00008 	jr	ra
+   18d58:	27bd0060 	addiu	sp,sp,96
+
+00018d5c <tasks_manager_htable_hremove>:
+   18d5c:	248505c4 	addiu	a1,a0,1476
+   18d60:	3c040004 	lui	a0,0x4
+   18d64:	08002ab2 	j	aac8 <hremove>
+   18d68:	2484bad4 	addiu	a0,a0,-17708
+
+00018d6c <tasks_manager_htable_hinsert>:
+   18d6c:	00802821 	addu	a1,a0,zero
+   18d70:	3c040004 	lui	a0,0x4
+   18d74:	24a605c4 	addiu	a2,a1,1476
+   18d78:	2484bad4 	addiu	a0,a0,-17708
+   18d7c:	08002a86 	j	aa18 <hinsert>
+   18d80:	24a507d4 	addiu	a1,a1,2004
+
+00018d84 <task_manager_init_finalize>:
+   18d84:	3c020004 	lui	v0,0x4
+   18d88:	27bdffe8 	addiu	sp,sp,-24
+   18d8c:	afb00010 	sw	s0,16(sp)
+   18d90:	2443c960 	addiu	v1,v0,-13984
+   18d94:	afbf0014 	sw	ra,20(sp)
+   18d98:	88630003 	lwl	v1,3(v1)
+   18d9c:	3c100004 	lui	s0,0x4
+   18da0:	9843c960 	lwr	v1,-13984(v0)
+   18da4:	2604bad4 	addiu	a0,s0,-17708
+   18da8:	3063ffff 	andi	v1,v1,0xffff
+   18dac:	00031a80 	sll	v1,v1,0xa
+   18db0:	24630001 	addiu	v1,v1,1
+   18db4:	3c020004 	lui	v0,0x4
+   18db8:	00002821 	addu	a1,zero,zero
+   18dbc:	0c002ad4 	jal	ab50 <hhalloc>
+   18dc0:	ac439ad0 	sw	v1,-25904(v0)
+   18dc4:	1040000a 	beqz	v0,18df0 <task_manager_init_finalize+0x6c>
+   18dc8:	3c050001 	lui	a1,0x1
+   18dcc:	3c050003 	lui	a1,0x3
+   18dd0:	3c070003 	lui	a3,0x3
+   18dd4:	24a56694 	addiu	a1,a1,26260
+   18dd8:	24e766e8 	addiu	a3,a3,26344
+   18ddc:	24040001 	addiu	a0,zero,1
+   18de0:	0c00097d 	jal	25f4 <__perror>
+   18de4:	2406013f 	addiu	a2,zero,319
+   18de8:	0800637a 	j	18de8 <task_manager_init_finalize+0x64>
+   18dec:	00000000 	sll	zero,zero,0x0
+   18df0:	3c060002 	lui	a2,0x2
+   18df4:	2604bad4 	addiu	a0,s0,-17708
+   18df8:	24a5ab30 	addiu	a1,a1,-21712
+   18dfc:	0c002a3d 	jal	a8f4 <hhinit>
+   18e00:	24c685bc 	addiu	a2,a2,-31300
+   18e04:	14400004 	bnez	v0,18e18 <task_manager_init_finalize+0x94>
+   18e08:	8fbf0014 	lw	ra,20(sp)
+   18e0c:	8fb00010 	lw	s0,16(sp)
+   18e10:	03e00008 	jr	ra
+   18e14:	27bd0018 	addiu	sp,sp,24
+   18e18:	3c050003 	lui	a1,0x3
+   18e1c:	3c070003 	lui	a3,0x3
+   18e20:	24a566f4 	addiu	a1,a1,26356
+   18e24:	24e766e8 	addiu	a3,a3,26344
+   18e28:	24040001 	addiu	a0,zero,1
+   18e2c:	0c00097d 	jal	25f4 <__perror>
+   18e30:	24060146 	addiu	a2,zero,326
+   18e34:	0800638d 	j	18e34 <task_manager_init_finalize+0xb0>
+   18e38:	00000000 	sll	zero,zero,0x0
+
+00018e3c <task_restore>:
+   18e3c:	8ca30048 	lw	v1,72(a1)
+   18e40:	27bdffe0 	addiu	sp,sp,-32
+   18e44:	24a20050 	addiu	v0,a1,80
+   18e48:	afb10018 	sw	s1,24(sp)
+   18e4c:	afbf001c 	sw	ra,28(sp)
+   18e50:	afb00014 	sw	s0,20(sp)
+   18e54:	00808821 	addu	s1,a0,zero
+   18e58:	1060001c 	beqz	v1,18ecc <task_restore+0x90>
+   18e5c:	aca2004c 	sw	v0,76(a1)
+   18e60:	00002021 	addu	a0,zero,zero
+   18e64:	00043180 	sll	a2,a0,0x6
+   18e68:	00461021 	addu	v0,v0,a2
+   18e6c:	80470000 	lb	a3,0(v0)
+   18e70:	10e00010 	beqz	a3,18eb4 <task_restore+0x78>
+   18e74:	00000000 	sll	zero,zero,0x0
+   18e78:	8e23030c 	lw	v1,780(s1)
+   18e7c:	00661821 	addu	v1,v1,a2
+   18e80:	24460040 	addiu	a2,v0,64
+   18e84:	8c4a0000 	lw	t2,0(v0)
+   18e88:	8c490004 	lw	t1,4(v0)
+   18e8c:	8c480008 	lw	t0,8(v0)
+   18e90:	8c47000c 	lw	a3,12(v0)
+   18e94:	24420010 	addiu	v0,v0,16
+   18e98:	ac6a0000 	sw	t2,0(v1)
+   18e9c:	ac690004 	sw	t1,4(v1)
+   18ea0:	ac680008 	sw	t0,8(v1)
+   18ea4:	ac67000c 	sw	a3,12(v1)
+   18ea8:	1446fff6 	bne	v0,a2,18e84 <task_restore+0x48>
+   18eac:	24630010 	addiu	v1,v1,16
+   18eb0:	8ca30048 	lw	v1,72(a1)
+   18eb4:	24840001 	addiu	a0,a0,1
+   18eb8:	0083102b 	sltu	v0,a0,v1
+   18ebc:	10400003 	beqz	v0,18ecc <task_restore+0x90>
+   18ec0:	00000000 	sll	zero,zero,0x0
+   18ec4:	08006399 	j	18e64 <task_restore+0x28>
+   18ec8:	8ca2004c 	lw	v0,76(a1)
+   18ecc:	24a20250 	addiu	v0,a1,592
+   18ed0:	26230510 	addiu	v1,s1,1296
+   18ed4:	24a40280 	addiu	a0,a1,640
+   18ed8:	8c490000 	lw	t1,0(v0)
+   18edc:	8c480004 	lw	t0,4(v0)
+   18ee0:	8c470008 	lw	a3,8(v0)
+   18ee4:	8c46000c 	lw	a2,12(v0)
+   18ee8:	24420010 	addiu	v0,v0,16
+   18eec:	ac690000 	sw	t1,0(v1)
+   18ef0:	ac680004 	sw	t0,4(v1)
+   18ef4:	ac670008 	sw	a3,8(v1)
+   18ef8:	ac66000c 	sw	a2,12(v1)
+   18efc:	1444fff6 	bne	v0,a0,18ed8 <task_restore+0x9c>
+   18f00:	24630010 	addiu	v1,v1,16
+   18f04:	8c440000 	lw	a0,0(v0)
+   18f08:	8c460008 	lw	a2,8(v0)
+   18f0c:	8c420004 	lw	v0,4(v0)
+   18f10:	ac640000 	sw	a0,0(v1)
+   18f14:	ac620004 	sw	v0,4(v1)
+   18f18:	ac660008 	sw	a2,8(v1)
+   18f1c:	24a2028c 	addiu	v0,a1,652
+   18f20:	2623054c 	addiu	v1,s1,1356
+   18f24:	24a402bc 	addiu	a0,a1,700
+   18f28:	8c490000 	lw	t1,0(v0)
+   18f2c:	8c480004 	lw	t0,4(v0)
+   18f30:	8c470008 	lw	a3,8(v0)
+   18f34:	8c46000c 	lw	a2,12(v0)
+   18f38:	24420010 	addiu	v0,v0,16
+   18f3c:	ac690000 	sw	t1,0(v1)
+   18f40:	ac680004 	sw	t0,4(v1)
+   18f44:	ac670008 	sw	a3,8(v1)
+   18f48:	ac66000c 	sw	a2,12(v1)
+   18f4c:	1444fff6 	bne	v0,a0,18f28 <task_restore+0xec>
+   18f50:	24630010 	addiu	v1,v1,16
+   18f54:	8c460008 	lw	a2,8(v0)
+   18f58:	8c440000 	lw	a0,0(v0)
+   18f5c:	8c420004 	lw	v0,4(v0)
+   18f60:	ac660008 	sw	a2,8(v1)
+   18f64:	ac620004 	sw	v0,4(v1)
+   18f68:	ac640000 	sw	a0,0(v1)
+   18f6c:	26220588 	addiu	v0,s1,1416
+   18f70:	24a302f8 	addiu	v1,a1,760
+   18f74:	24a502c8 	addiu	a1,a1,712
+   18f78:	8ca80000 	lw	t0,0(a1)
+   18f7c:	8ca70004 	lw	a3,4(a1)
+   18f80:	8ca60008 	lw	a2,8(a1)
+   18f84:	8ca4000c 	lw	a0,12(a1)
+   18f88:	24a50010 	addiu	a1,a1,16
+   18f8c:	ac480000 	sw	t0,0(v0)
+   18f90:	ac470004 	sw	a3,4(v0)
+   18f94:	ac460008 	sw	a2,8(v0)
+   18f98:	ac44000c 	sw	a0,12(v0)
+   18f9c:	14a3fff6 	bne	a1,v1,18f78 <task_restore+0x13c>
+   18fa0:	24420010 	addiu	v0,v0,16
+   18fa4:	8ca60008 	lw	a2,8(a1)
+   18fa8:	8ca40000 	lw	a0,0(a1)
+   18fac:	8ca30004 	lw	v1,4(a1)
+   18fb0:	ac460008 	sw	a2,8(v0)
+   18fb4:	ac440000 	sw	a0,0(v0)
+   18fb8:	ac430004 	sw	v1,4(v0)
+   18fbc:	0c0085df 	jal	2177c <vmm_init>
+   18fc0:	26240180 	addiu	a0,s1,384
+   18fc4:	26300250 	addiu	s0,s1,592
+   18fc8:	3c028000 	lui	v0,0x8000
+   18fcc:	3c050004 	lui	a1,0x4
+   18fd0:	02002021 	addu	a0,s0,zero
+   18fd4:	ae220290 	sw	v0,656(s1)
+   18fd8:	0c000d37 	jal	34dc <pmm_init>
+   18fdc:	24a56db0 	addiu	a1,a1,28080
+   18fe0:	3c050004 	lui	a1,0x4
+   18fe4:	02002021 	addu	a0,s0,zero
+   18fe8:	8fbf001c 	lw	ra,28(sp)
+   18fec:	8fb10018 	lw	s1,24(sp)
+   18ff0:	8fb00014 	lw	s0,20(sp)
+   18ff4:	24a5bf80 	addiu	a1,a1,-16512
+   18ff8:	08000ce6 	j	3398 <pmm_dup>
+   18ffc:	27bd0020 	addiu	sp,sp,32
+
+00019000 <__task_fd_dup>:
+   19000:	8ca20018 	lw	v0,24(a1)
+   19004:	27bdffc8 	addiu	sp,sp,-56
+   19008:	afb50028 	sw	s5,40(sp)
+   1900c:	afb30020 	sw	s3,32(sp)
+   19010:	afbf0034 	sw	ra,52(sp)
+   19014:	afb70030 	sw	s7,48(sp)
+   19018:	afb6002c 	sw	s6,44(sp)
+   1901c:	afb40024 	sw	s4,36(sp)
+   19020:	afb2001c 	sw	s2,28(sp)
+   19024:	afb10018 	sw	s1,24(sp)
+   19028:	afb00014 	sw	s0,20(sp)
+   1902c:	00a09821 	addu	s3,a1,zero
+   19030:	10400023 	beqz	v0,190c0 <__task_fd_dup+0xc0>
+   19034:	0080a821 	addu	s5,a0,zero
+   19038:	00008021 	addu	s0,zero,zero
+   1903c:	3c161400 	lui	s6,0x1400
+   19040:	3c171000 	lui	s7,0x1000
+   19044:	8e71001c 	lw	s1,28(s3)
+   19048:	00109180 	sll	s2,s0,0x6
+   1904c:	02328821 	addu	s1,s1,s2
+   19050:	82230000 	lb	v1,0(s1)
+   19054:	10600016 	beqz	v1,190b0 <__task_fd_dup+0xb0>
+   19058:	00000000 	sll	zero,zero,0x0
+   1905c:	8e220004 	lw	v0,4(s1)
+   19060:	00561024 	and	v0,v0,s6
+   19064:	10400022 	beqz	v0,190f0 <__task_fd_dup+0xf0>
+   19068:	26340004 	addiu	s4,s1,4
+   1906c:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+   19070:	02802021 	addu	a0,s4,zero
+   19074:	8ea2001c 	lw	v0,28(s5)
+   19078:	00529021 	addu	s2,v0,s2
+   1907c:	26220040 	addiu	v0,s1,64
+   19080:	8e260000 	lw	a2,0(s1)
+   19084:	8e250004 	lw	a1,4(s1)
+   19088:	8e240008 	lw	a0,8(s1)
+   1908c:	8e23000c 	lw	v1,12(s1)
+   19090:	26310010 	addiu	s1,s1,16
+   19094:	ae460000 	sw	a2,0(s2)
+   19098:	ae450004 	sw	a1,4(s2)
+   1909c:	ae440008 	sw	a0,8(s2)
+   190a0:	ae43000c 	sw	v1,12(s2)
+   190a4:	1622fff6 	bne	s1,v0,19080 <__task_fd_dup+0x80>
+   190a8:	26520010 	addiu	s2,s2,16
+   190ac:	8e620018 	lw	v0,24(s3)
+   190b0:	26100001 	addiu	s0,s0,1
+   190b4:	0202182b 	sltu	v1,s0,v0
+   190b8:	1460ffe2 	bnez	v1,19044 <__task_fd_dup+0x44>
+   190bc:	00000000 	sll	zero,zero,0x0
+   190c0:	8fbf0034 	lw	ra,52(sp)
+   190c4:	00001021 	addu	v0,zero,zero
+   190c8:	8fb70030 	lw	s7,48(sp)
+   190cc:	8fb6002c 	lw	s6,44(sp)
+   190d0:	8fb50028 	lw	s5,40(sp)
+   190d4:	8fb40024 	lw	s4,36(sp)
+   190d8:	8fb30020 	lw	s3,32(sp)
+   190dc:	8fb2001c 	lw	s2,28(sp)
+   190e0:	8fb10018 	lw	s1,24(sp)
+   190e4:	8fb00014 	lw	s0,20(sp)
+   190e8:	03e00008 	jr	ra
+   190ec:	27bd0038 	addiu	sp,sp,56
+   190f0:	8e250014 	lw	a1,20(s1)
+   190f4:	02802021 	addu	a0,s4,zero
+   190f8:	00003021 	addu	a2,zero,zero
+   190fc:	0c00a641 	jal	29904 <vfs_lseek_remote>
+   19100:	00003821 	addu	a3,zero,zero
+   19104:	8e220004 	lw	v0,4(s1)
+   19108:	00571025 	or	v0,v0,s7
+   1910c:	0800641b 	j	1906c <__task_fd_dup+0x6c>
+   19110:	ae220004 	sw	v0,4(s1)
+
+00019114 <task_fd_fork>:
+   19114:	27bdffd8 	addiu	sp,sp,-40
+   19118:	afb0001c 	sw	s0,28(sp)
+   1911c:	24b002f0 	addiu	s0,a1,752
+   19120:	afb10020 	sw	s1,32(sp)
+   19124:	00808821 	addu	s1,a0,zero
+   19128:	afbf0024 	sw	ra,36(sp)
+   1912c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   19130:	02002021 	addu	a0,s0,zero
+   19134:	262402f0 	addiu	a0,s1,752
+   19138:	0c006400 	jal	19000 <__task_fd_dup>
+   1913c:	02002821 	addu	a1,s0,zero
+   19140:	02002021 	addu	a0,s0,zero
+   19144:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   19148:	afa20010 	sw	v0,16(sp)
+   1914c:	8fbf0024 	lw	ra,36(sp)
+   19150:	8fa20010 	lw	v0,16(sp)
+   19154:	8fb10020 	lw	s1,32(sp)
+   19158:	8fb0001c 	lw	s0,28(sp)
+   1915c:	03e00008 	jr	ra
+   19160:	27bd0028 	addiu	sp,sp,40
+
+00019164 <task_dup>:
+   19164:	27bdffd8 	addiu	sp,sp,-40
+   19168:	afb40020 	sw	s4,32(sp)
+   1916c:	24b400b0 	addiu	s4,a1,176
+   19170:	afb20018 	sw	s2,24(sp)
+   19174:	afb10014 	sw	s1,20(sp)
+   19178:	24b20510 	addiu	s2,a1,1296
+   1917c:	afb00010 	sw	s0,16(sp)
+   19180:	00808821 	addu	s1,a0,zero
+   19184:	00a08021 	addu	s0,a1,zero
+   19188:	02802021 	addu	a0,s4,zero
+   1918c:	afbf0024 	sw	ra,36(sp)
+   19190:	0c004408 	jal	11020 <rwlock_wrlock>
+   19194:	afb3001c 	sw	s3,28(sp)
+   19198:	2613054c 	addiu	s3,s0,1356
+   1919c:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+   191a0:	02402021 	addu	a0,s2,zero
+   191a4:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+   191a8:	02602021 	addu	a0,s3,zero
+   191ac:	26220510 	addiu	v0,s1,1296
+   191b0:	26030540 	addiu	v1,s0,1344
+   191b4:	8e470000 	lw	a3,0(s2)
+   191b8:	8e460004 	lw	a2,4(s2)
+   191bc:	8e450008 	lw	a1,8(s2)
+   191c0:	8e44000c 	lw	a0,12(s2)
+   191c4:	26520010 	addiu	s2,s2,16
+   191c8:	ac470000 	sw	a3,0(v0)
+   191cc:	ac460004 	sw	a2,4(v0)
+   191d0:	ac450008 	sw	a1,8(v0)
+   191d4:	ac44000c 	sw	a0,12(v0)
+   191d8:	1643fff6 	bne	s2,v1,191b4 <task_dup+0x50>
+   191dc:	24420010 	addiu	v0,v0,16
+   191e0:	8e430004 	lw	v1,4(s2)
+   191e4:	8e450008 	lw	a1,8(s2)
+   191e8:	8e440000 	lw	a0,0(s2)
+   191ec:	ac430004 	sw	v1,4(v0)
+   191f0:	ac450008 	sw	a1,8(v0)
+   191f4:	ac440000 	sw	a0,0(v0)
+   191f8:	2603057c 	addiu	v1,s0,1404
+   191fc:	2622054c 	addiu	v0,s1,1356
+   19200:	8e670000 	lw	a3,0(s3)
+   19204:	8e660004 	lw	a2,4(s3)
+   19208:	8e650008 	lw	a1,8(s3)
+   1920c:	8e64000c 	lw	a0,12(s3)
+   19210:	26730010 	addiu	s3,s3,16
+   19214:	ac470000 	sw	a3,0(v0)
+   19218:	ac460004 	sw	a2,4(v0)
+   1921c:	ac450008 	sw	a1,8(v0)
+   19220:	ac44000c 	sw	a0,12(v0)
+   19224:	1663fff6 	bne	s3,v1,19200 <task_dup+0x9c>
+   19228:	24420010 	addiu	v0,v0,16
+   1922c:	8e630004 	lw	v1,4(s3)
+   19230:	8e650008 	lw	a1,8(s3)
+   19234:	8e640000 	lw	a0,0(s3)
+   19238:	ac430004 	sw	v1,4(v0)
+   1923c:	ac450008 	sw	a1,8(v0)
+   19240:	ac440000 	sw	a0,0(v0)
+   19244:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   19248:	02802021 	addu	a0,s4,zero
+   1924c:	26120588 	addiu	s2,s0,1416
+   19250:	02202021 	addu	a0,s1,zero
+   19254:	0c006445 	jal	19114 <task_fd_fork>
+   19258:	02002821 	addu	a1,s0,zero
+   1925c:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+   19260:	02402021 	addu	a0,s2,zero
+   19264:	26310588 	addiu	s1,s1,1416
+   19268:	261005b8 	addiu	s0,s0,1464
+   1926c:	8e450000 	lw	a1,0(s2)
+   19270:	8e440004 	lw	a0,4(s2)
+   19274:	8e430008 	lw	v1,8(s2)
+   19278:	8e42000c 	lw	v0,12(s2)
+   1927c:	26520010 	addiu	s2,s2,16
+   19280:	ae250000 	sw	a1,0(s1)
+   19284:	ae240004 	sw	a0,4(s1)
+   19288:	ae230008 	sw	v1,8(s1)
+   1928c:	ae22000c 	sw	v0,12(s1)
+   19290:	1650fff6 	bne	s2,s0,1926c <task_dup+0x108>
+   19294:	26310010 	addiu	s1,s1,16
+   19298:	8e420004 	lw	v0,4(s2)
+   1929c:	8e440008 	lw	a0,8(s2)
+   192a0:	8e430000 	lw	v1,0(s2)
+   192a4:	8fbf0024 	lw	ra,36(sp)
+   192a8:	ae220004 	sw	v0,4(s1)
+   192ac:	ae240008 	sw	a0,8(s1)
+   192b0:	ae230000 	sw	v1,0(s1)
+   192b4:	00001021 	addu	v0,zero,zero
+   192b8:	8fb40020 	lw	s4,32(sp)
+   192bc:	8fb3001c 	lw	s3,28(sp)
+   192c0:	8fb20018 	lw	s2,24(sp)
+   192c4:	8fb10014 	lw	s1,20(sp)
+   192c8:	8fb00010 	lw	s0,16(sp)
+   192cc:	03e00008 	jr	ra
+   192d0:	27bd0028 	addiu	sp,sp,40
+
+000192d4 <__task_pid_alloc_main>:
+   192d4:	27bdffd8 	addiu	sp,sp,-40
+   192d8:	afb00018 	sw	s0,24(sp)
+   192dc:	3c100004 	lui	s0,0x4
+   192e0:	afb1001c 	sw	s1,28(sp)
+   192e4:	3091ffff 	andi	s1,a0,0xffff
+   192e8:	26049ac0 	addiu	a0,s0,-25920
+   192ec:	afb20020 	sw	s2,32(sp)
+   192f0:	afa60010 	sw	a2,16(sp)
+   192f4:	afa70014 	sw	a3,20(sp)
+   192f8:	afbf0024 	sw	ra,36(sp)
+   192fc:	0c004bc3 	jal	12f0c <spinlock_lock>
+   19300:	8fb20038 	lw	s2,56(sp)
+   19304:	3c020004 	lui	v0,0x4
+   19308:	2443c960 	addiu	v1,v0,-13984
+   1930c:	88690003 	lwl	t1,3(v1)
+   19310:	3c050004 	lui	a1,0x4
+   19314:	9849c960 	lwr	t1,-13984(v0)
+   19318:	24a59a40 	addiu	a1,a1,-26048
+   1931c:	3129ffff 	andi	t1,t1,0xffff
+   19320:	00096280 	sll	t4,t1,0xa
+   19324:	8ca20090 	lw	v0,144(a1)
+   19328:	8fa60010 	lw	a2,16(sp)
+   1932c:	8fa70014 	lw	a3,20(sp)
+   19330:	258903ff 	addiu	t1,t4,1023
+   19334:	00005021 	addu	t2,zero,zero
+   19338:	258c0001 	addiu	t4,t4,1
+   1933c:	00a06821 	addu	t5,a1,zero
+   19340:	3408ffff 	ori	t0,zero,0xffff
+   19344:	240b0001 	addiu	t3,zero,1
+   19348:	304303ff 	andi	v1,v0,0x3ff
+   1934c:	24630012 	addiu	v1,v1,18
+   19350:	000320c0 	sll	a0,v1,0x3
+   19354:	00a42021 	addu	a0,a1,a0
+   19358:	94840004 	lhu	a0,4(a0)
+   1935c:	1088000f 	beq	a0,t0,1939c <__task_pid_alloc_main+0xc8>
+   19360:	000318c0 	sll	v1,v1,0x3
+   19364:	24420001 	addiu	v0,v0,1
+   19368:	0122182b 	sltu	v1,t1,v0
+   1936c:	1060fff7 	beqz	v1,1934c <__task_pid_alloc_main+0x78>
+   19370:	304303ff 	andi	v1,v0,0x3ff
+   19374:	114b0017 	beq	t2,t3,193d4 <__task_pid_alloc_main+0x100>
+   19378:	01801021 	addu	v0,t4,zero
+   1937c:	304303ff 	andi	v1,v0,0x3ff
+   19380:	24630012 	addiu	v1,v1,18
+   19384:	000320c0 	sll	a0,v1,0x3
+   19388:	00a42021 	addu	a0,a1,a0
+   1938c:	94840004 	lhu	a0,4(a0)
+   19390:	1488fff4 	bne	a0,t0,19364 <__task_pid_alloc_main+0x90>
+   19394:	240a0001 	addiu	t2,zero,1
+   19398:	000318c0 	sll	v1,v1,0x3
+   1939c:	00a31821 	addu	v1,a1,v1
+   193a0:	ac720008 	sw	s2,8(v1)
+   193a4:	a4710004 	sh	s1,4(v1)
+   193a8:	00001821 	addu	v1,zero,zero
+   193ac:	aca20090 	sw	v0,144(a1)
+   193b0:	26049ac0 	addiu	a0,s0,-25920
+   193b4:	ace20000 	sw	v0,0(a3)
+   193b8:	8fbf0024 	lw	ra,36(sp)
+   193bc:	8fb20020 	lw	s2,32(sp)
+   193c0:	8fb1001c 	lw	s1,28(sp)
+   193c4:	8fb00018 	lw	s0,24(sp)
+   193c8:	acc30000 	sw	v1,0(a2)
+   193cc:	08004b0b 	j	12c2c <spinlock_unlock>
+   193d0:	27bd0028 	addiu	sp,sp,40
+   193d4:	318303ff 	andi	v1,t4,0x3ff
+   193d8:	24630012 	addiu	v1,v1,18
+   193dc:	000320c0 	sll	a0,v1,0x3
+   193e0:	008d6821 	addu	t5,a0,t5
+   193e4:	95a80004 	lhu	t0,4(t5)
+   193e8:	3404ffff 	ori	a0,zero,0xffff
+   193ec:	1104ffea 	beq	t0,a0,19398 <__task_pid_alloc_main+0xc4>
+   193f0:	26049ac0 	addiu	a0,s0,-25920
+   193f4:	2403000b 	addiu	v1,zero,11
+   193f8:	aca20090 	sw	v0,144(a1)
+   193fc:	ace20000 	sw	v0,0(a3)
+   19400:	8fbf0024 	lw	ra,36(sp)
+   19404:	8fb20020 	lw	s2,32(sp)
+   19408:	8fb1001c 	lw	s1,28(sp)
+   1940c:	8fb00018 	lw	s0,24(sp)
+   19410:	acc30000 	sw	v1,0(a2)
+   19414:	08004b0b 	j	12c2c <spinlock_unlock>
+   19418:	27bd0028 	addiu	sp,sp,40
+
+0001941c <__task_pid_alloc_local>:
+   1941c:	27bdffe0 	addiu	sp,sp,-32
+   19420:	afbf001c 	sw	ra,28(sp)
+   19424:	00801821 	addu	v1,a0,zero
+   19428:	00a03821 	addu	a3,a1,zero
+   1942c:	40057801 	mfc0	a1,$15,1
+   19430:	3c020004 	lui	v0,0x4
+   19434:	2444c960 	addiu	a0,v0,-13984
+   19438:	88840003 	lwl	a0,3(a0)
+   1943c:	30a50003 	andi	a1,a1,0x3
+   19440:	3c080004 	lui	t0,0x4
+   19444:	2508c950 	addiu	t0,t0,-14000
+   19448:	00052880 	sll	a1,a1,0x2
+   1944c:	9844c960 	lwr	a0,-13984(v0)
+   19450:	00a82821 	addu	a1,a1,t0
+   19454:	8cc20000 	lw	v0,0(a2)
+   19458:	8ca50000 	lw	a1,0(a1)
+   1945c:	3084ffff 	andi	a0,a0,0xffff
+   19460:	00603021 	addu	a2,v1,zero
+   19464:	0c0064b5 	jal	192d4 <__task_pid_alloc_main>
+   19468:	afa20010 	sw	v0,16(sp)
+   1946c:	8fbf001c 	lw	ra,28(sp)
+   19470:	03e00008 	jr	ra
+   19474:	27bd0020 	addiu	sp,sp,32
+
+00019478 <task_pid_alloc>:
+   19478:	27bdffa8 	addiu	sp,sp,-88
+   1947c:	3c020004 	lui	v0,0x4
+   19480:	afb0004c 	sw	s0,76(sp)
+   19484:	2443c960 	addiu	v1,v0,-13984
+   19488:	afbf0054 	sw	ra,84(sp)
+   1948c:	afb10050 	sw	s1,80(sp)
+   19490:	88630003 	lwl	v1,3(v1)
+   19494:	00803821 	addu	a3,a0,zero
+   19498:	9843c960 	lwr	v1,-13984(v0)
+   1949c:	30b0ffff 	andi	s0,a1,0xffff
+   194a0:	27a40028 	addiu	a0,sp,40
+   194a4:	24050004 	addiu	a1,zero,4
+   194a8:	27a20060 	addiu	v0,sp,96
+   194ac:	3063ffff 	andi	v1,v1,0xffff
+   194b0:	afa60060 	sw	a2,96(sp)
+   194b4:	afa50030 	sw	a1,48(sp)
+   194b8:	afa40034 	sw	a0,52(sp)
+   194bc:	afa70038 	sw	a3,56(sp)
+   194c0:	afa5003c 	sw	a1,60(sp)
+   194c4:	afa50040 	sw	a1,64(sp)
+   194c8:	1203001e 	beq	s0,v1,19544 <task_pid_alloc+0xcc>
+   194cc:	afa2002c 	sw	v0,44(sp)
+   194d0:	40117801 	mfc0	s1,$15,1
+   194d4:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   194d8:	00000000 	sll	zero,zero,0x0
+   194dc:	70501802 	mul	v1,v0,s0
+   194e0:	24020002 	addiu	v0,zero,2
+   194e4:	afa20010 	sw	v0,16(sp)
+   194e8:	24020001 	addiu	v0,zero,1
+   194ec:	afa20014 	sw	v0,20(sp)
+   194f0:	27a20034 	addiu	v0,sp,52
+   194f4:	afa20018 	sw	v0,24(sp)
+   194f8:	27a2003c 	addiu	v0,sp,60
+   194fc:	afa2001c 	sw	v0,28(sp)
+   19500:	32240003 	andi	a0,s1,0x3
+   19504:	27a2002c 	addiu	v0,sp,44
+   19508:	3c070002 	lui	a3,0x2
+   1950c:	afa20020 	sw	v0,32(sp)
+   19510:	00642021 	addu	a0,v1,a0
+   19514:	27a20030 	addiu	v0,sp,48
+   19518:	24e798a0 	addiu	a3,a3,-26464
+   1951c:	24050001 	addiu	a1,zero,1
+   19520:	00003021 	addu	a2,zero,zero
+   19524:	0c003de8 	jal	f7a0 <rppc_generic>
+   19528:	afa20024 	sw	v0,36(sp)
+   1952c:	8fbf0054 	lw	ra,84(sp)
+   19530:	8fa20028 	lw	v0,40(sp)
+   19534:	8fb10050 	lw	s1,80(sp)
+   19538:	8fb0004c 	lw	s0,76(sp)
+   1953c:	03e00008 	jr	ra
+   19540:	27bd0058 	addiu	sp,sp,88
+   19544:	00403021 	addu	a2,v0,zero
+   19548:	0c006507 	jal	1941c <__task_pid_alloc_local>
+   1954c:	00e02821 	addu	a1,a3,zero
+   19550:	8fbf0054 	lw	ra,84(sp)
+   19554:	8fa20028 	lw	v0,40(sp)
+   19558:	8fb10050 	lw	s1,80(sp)
+   1955c:	8fb0004c 	lw	s0,76(sp)
+   19560:	03e00008 	jr	ra
+   19564:	27bd0058 	addiu	sp,sp,88
+
+00019568 <task_create>:
+   19568:	27bdffb0 	addiu	sp,sp,-80
+   1956c:	24020006 	addiu	v0,zero,6
+   19570:	afa2001c 	sw	v0,28(sp)
+   19574:	240207e0 	addiu	v0,zero,2016
+   19578:	afb40040 	sw	s4,64(sp)
+   1957c:	afb3003c 	sw	s3,60(sp)
+   19580:	afa20020 	sw	v0,32(sp)
+   19584:	27b3001c 	addiu	s3,sp,28
+   19588:	3c140004 	lui	s4,0x4
+   1958c:	3c020051 	lui	v0,0x51
+   19590:	afb50044 	sw	s5,68(sp)
+   19594:	34420020 	ori	v0,v0,0x20
+   19598:	26946db0 	addiu	s4,s4,28080
+   1959c:	0080a821 	addu	s5,a0,zero
+   195a0:	02602021 	addu	a0,s3,zero
+   195a4:	afb20038 	sw	s2,56(sp)
+   195a8:	afb00030 	sw	s0,48(sp)
+   195ac:	afbf004c 	sw	ra,76(sp)
+   195b0:	afb60048 	sw	s6,72(sp)
+   195b4:	afb10034 	sw	s1,52(sp)
+   195b8:	afa20024 	sw	v0,36(sp)
+   195bc:	00a09021 	addu	s2,a1,zero
+   195c0:	0c00713f 	jal	1c4fc <kmem_alloc>
+   195c4:	afb40028 	sw	s4,40(sp)
+   195c8:	10400052 	beqz	v0,19714 <task_create+0x1ac>
+   195cc:	00408021 	addu	s0,v0,zero
+   195d0:	96450004 	lhu	a1,4(s2)
+   195d4:	27a40018 	addiu	a0,sp,24
+   195d8:	00403021 	addu	a2,v0,zero
+   195dc:	0c00651e 	jal	19478 <task_pid_alloc>
+   195e0:	afa00018 	sw	zero,24(sp)
+   195e4:	10400030 	beqz	v0,196a8 <task_create+0x140>
+   195e8:	00408821 	addu	s1,v0,zero
+   195ec:	3c020004 	lui	v0,0x4
+   195f0:	8c449100 	lw	a0,-28416(v0)
+   195f4:	3c060003 	lui	a2,0x3
+   195f8:	8e420000 	lw	v0,0(s2)
+   195fc:	3c070003 	lui	a3,0x3
+   19600:	24c6674c 	addiu	a2,a2,26444
+   19604:	24e767b4 	addiu	a3,a3,26548
+   19608:	00002821 	addu	a1,zero,zero
+   1960c:	3c140004 	lui	s4,0x4
+   19610:	afa20010 	sw	v0,16(sp)
+   19614:	0c0009b0 	jal	26c0 <__fprintk>
+   19618:	2696c960 	addiu	s6,s4,-13984
+   1961c:	8ac20003 	lwl	v0,3(s6)
+   19620:	3c040004 	lui	a0,0x4
+   19624:	9a82c960 	lwr	v0,-13984(s4)
+   19628:	24849a40 	addiu	a0,a0,-26048
+   1962c:	3042ffff 	andi	v0,v0,0xffff
+   19630:	8c850090 	lw	a1,144(a0)
+   19634:	00021a80 	sll	v1,v0,0xa
+   19638:	24630001 	addiu	v1,v1,1
+   1963c:	0065182b 	sltu	v1,v1,a1
+   19640:	10600005 	beqz	v1,19658 <task_create+0xf0>
+   19644:	00401821 	addu	v1,v0,zero
+   19648:	8e430004 	lw	v1,4(s2)
+   1964c:	10620046 	beq	v1,v0,19768 <task_create+0x200>
+   19650:	24a5ffff 	addiu	a1,a1,-1
+   19654:	00401821 	addu	v1,v0,zero
+   19658:	8e420000 	lw	v0,0(s2)
+   1965c:	10430038 	beq	v0,v1,19740 <task_create+0x1d8>
+   19660:	8fa30018 	lw	v1,24(sp)
+   19664:	24020006 	addiu	v0,zero,6
+   19668:	02602021 	addu	a0,s3,zero
+   1966c:	afa2001c 	sw	v0,28(sp)
+   19670:	0c007134 	jal	1c4d0 <kmem_free>
+   19674:	afb00028 	sw	s0,40(sp)
+   19678:	02201021 	addu	v0,s1,zero
+   1967c:	aea00000 	sw	zero,0(s5)
+   19680:	8fbf004c 	lw	ra,76(sp)
+   19684:	8fb60048 	lw	s6,72(sp)
+   19688:	8fb50044 	lw	s5,68(sp)
+   1968c:	8fb40040 	lw	s4,64(sp)
+   19690:	8fb3003c 	lw	s3,60(sp)
+   19694:	8fb20038 	lw	s2,56(sp)
+   19698:	8fb10034 	lw	s1,52(sp)
+   1969c:	8fb00030 	lw	s0,48(sp)
+   196a0:	03e00008 	jr	ra
+   196a4:	27bd0050 	addiu	sp,sp,80
+   196a8:	0c004994 	jal	12650 <signal_manager_init>
+   196ac:	02002021 	addu	a0,s0,zero
+   196b0:	1440001a 	bnez	v0,1971c <task_create+0x1b4>
+   196b4:	00408821 	addu	s1,v0,zero
+   196b8:	24160001 	addiu	s6,zero,1
+   196bc:	02602021 	addu	a0,s3,zero
+   196c0:	afa0001c 	sw	zero,28(sp)
+   196c4:	0c00713f 	jal	1c4fc <kmem_alloc>
+   196c8:	afb60020 	sw	s6,32(sp)
+   196cc:	1040006d 	beqz	v0,19884 <task_create+0x31c>
+   196d0:	ae02074c 	sw	v0,1868(s0)
+   196d4:	0c007c15 	jal	1f054 <ppm_page2addr>
+   196d8:	00402021 	addu	a0,v0,zero
+   196dc:	ae020740 	sw	v0,1856(s0)
+   196e0:	0c006198 	jal	18660 <task_fd_init>
+   196e4:	02002021 	addu	a0,s0,zero
+   196e8:	10400021 	beqz	v0,19770 <task_create+0x208>
+   196ec:	00408821 	addu	s1,v0,zero
+   196f0:	3c140004 	lui	s4,0x4
+   196f4:	2696c960 	addiu	s6,s4,-13984
+   196f8:	8e02074c 	lw	v0,1868(s0)
+   196fc:	02602021 	addu	a0,s3,zero
+   19700:	afa20028 	sw	v0,40(sp)
+   19704:	0c007134 	jal	1c4d0 <kmem_free>
+   19708:	afa0001c 	sw	zero,28(sp)
+   1970c:	08006588 	j	19620 <task_create+0xb8>
+   19710:	8ac20003 	lwl	v0,3(s6)
+   19714:	0800659f 	j	1967c <task_create+0x114>
+   19718:	2402000c 	addiu	v0,zero,12
+   1971c:	3c020004 	lui	v0,0x4
+   19720:	2443c960 	addiu	v1,v0,-13984
+   19724:	88630003 	lwl	v1,3(v1)
+   19728:	9843c960 	lwr	v1,-13984(v0)
+   1972c:	8e420000 	lw	v0,0(s2)
+   19730:	3063ffff 	andi	v1,v1,0xffff
+   19734:	1443ffcc 	bne	v0,v1,19668 <task_create+0x100>
+   19738:	24020006 	addiu	v0,zero,6
+   1973c:	8fa30018 	lw	v1,24(sp)
+   19740:	3c020004 	lui	v0,0x4
+   19744:	306303ff 	andi	v1,v1,0x3ff
+   19748:	24630012 	addiu	v1,v1,18
+   1974c:	000318c0 	sll	v1,v1,0x3
+   19750:	24429a40 	addiu	v0,v0,-26048
+   19754:	00621021 	addu	v0,v1,v0
+   19758:	2403ffff 	addiu	v1,zero,-1
+   1975c:	a4430004 	sh	v1,4(v0)
+   19760:	08006599 	j	19664 <task_create+0xfc>
+   19764:	ac400008 	sw	zero,8(v0)
+   19768:	08006596 	j	19658 <task_create+0xf0>
+   1976c:	ac850090 	sw	a1,144(a0)
+   19770:	00002821 	addu	a1,zero,zero
+   19774:	24060160 	addiu	a2,zero,352
+   19778:	0c00c182 	jal	30608 <memset>
+   1977c:	26040180 	addiu	a0,s0,384
+   19780:	0c0061d9 	jal	18764 <tasks_manager_lock>
+   19784:	00000000 	sll	zero,zero,0x0
+   19788:	8e440008 	lw	a0,8(s2)
+   1978c:	0c00207a 	jal	81e8 <cpu_lid2ptr>
+   19790:	ae1402e0 	sw	s4,736(s0)
+   19794:	ae0202e4 	sw	v0,740(s0)
+   19798:	26040510 	addiu	a0,s0,1296
+   1979c:	00002821 	addu	a1,zero,zero
+   197a0:	0c00c182 	jal	30608 <memset>
+   197a4:	2406003c 	addiu	a2,zero,60
+   197a8:	2604054c 	addiu	a0,s0,1356
+   197ac:	00002821 	addu	a1,zero,zero
+   197b0:	0c00c182 	jal	30608 <memset>
+   197b4:	2406003c 	addiu	a2,zero,60
+   197b8:	26040588 	addiu	a0,s0,1416
+   197bc:	00002821 	addu	a1,zero,zero
+   197c0:	0c00c182 	jal	30608 <memset>
+   197c4:	2406003c 	addiu	a2,zero,60
+   197c8:	24020800 	addiu	v0,zero,2048
+   197cc:	ae020634 	sw	v0,1588(s0)
+   197d0:	26040640 	addiu	a0,s0,1600
+   197d4:	00002821 	addu	a1,zero,zero
+   197d8:	24060800 	addiu	a2,zero,2048
+   197dc:	ae00062c 	sw	zero,1580(s0)
+   197e0:	0c00b8f0 	jal	2e3c0 <bitmap_set_range>
+   197e4:	ae000630 	sw	zero,1584(s0)
+   197e8:	8fa30018 	lw	v1,24(sp)
+   197ec:	8e0202e4 	lw	v0,740(s0)
+   197f0:	ae0305c4 	sw	v1,1476(s0)
+   197f4:	8c420004 	lw	v0,4(v0)
+   197f8:	260405d4 	addiu	a0,s0,1492
+   197fc:	ae1605d0 	sw	s6,1488(s0)
+   19800:	ae0205cc 	sw	v0,1484(s0)
+   19804:	0c00199f 	jal	667c <atomic_init>
+   19808:	00002821 	addu	a1,zero,zero
+   1980c:	3c140004 	lui	s4,0x4
+   19810:	24020200 	addiu	v0,zero,512
+   19814:	a6020614 	sh	v0,1556(s0)
+   19818:	aeb00000 	sw	s0,0(s5)
+   1981c:	2696c960 	addiu	s6,s4,-13984
+   19820:	8ac20003 	lwl	v0,3(s6)
+   19824:	8e0305c4 	lw	v1,1476(s0)
+   19828:	9a82c960 	lwr	v0,-13984(s4)
+   1982c:	00031a82 	srl	v1,v1,0xa
+   19830:	3042ffff 	andi	v0,v0,0xffff
+   19834:	1062000a 	beq	v1,v0,19860 <task_create+0x2f8>
+   19838:	8fa40018 	lw	a0,24(sp)
+   1983c:	0c00635b 	jal	18d6c <tasks_manager_htable_hinsert>
+   19840:	02002021 	addu	a0,s0,zero
+   19844:	1440ffac 	bnez	v0,196f8 <task_create+0x190>
+   19848:	00408821 	addu	s1,v0,zero
+   1984c:	0c0061d6 	jal	18758 <tasks_manager_unlock>
+   19850:	00000000 	sll	zero,zero,0x0
+   19854:	0000000f 	sync
+   19858:	080065a0 	j	19680 <task_create+0x118>
+   1985c:	00001021 	addu	v0,zero,zero
+   19860:	3c020004 	lui	v0,0x4
+   19864:	308403ff 	andi	a0,a0,0x3ff
+   19868:	24840012 	addiu	a0,a0,18
+   1986c:	000420c0 	sll	a0,a0,0x3
+   19870:	24429a40 	addiu	v0,v0,-26048
+   19874:	00821021 	addu	v0,a0,v0
+   19878:	ac500008 	sw	s0,8(v0)
+   1987c:	08006613 	j	1984c <task_create+0x2e4>
+   19880:	a4430004 	sh	v1,4(v0)
+   19884:	3c020004 	lui	v0,0x4
+   19888:	2443c960 	addiu	v1,v0,-13984
+   1988c:	88630003 	lwl	v1,3(v1)
+   19890:	2411000c 	addiu	s1,zero,12
+   19894:	9843c960 	lwr	v1,-13984(v0)
+   19898:	08006596 	j	19658 <task_create+0xf0>
+   1989c:	3063ffff 	andi	v1,v1,0xffff
+
+000198a0 <__task_pid_alloc_demarshall>:
+   198a0:	27bdffc0 	addiu	sp,sp,-64
+   198a4:	afbf003c 	sw	ra,60(sp)
+   198a8:	afbe0038 	sw	s8,56(sp)
+   198ac:	afb50034 	sw	s5,52(sp)
+   198b0:	03a0f021 	addu	s8,sp,zero
+   198b4:	afb40030 	sw	s4,48(sp)
+   198b8:	afb3002c 	sw	s3,44(sp)
+   198bc:	afb20028 	sw	s2,40(sp)
+   198c0:	afb10024 	sw	s1,36(sp)
+   198c4:	afb00020 	sw	s0,32(sp)
+   198c8:	27bdfff0 	addiu	sp,sp,-16
+   198cc:	27b30018 	addiu	s3,sp,24
+   198d0:	27bdffc0 	addiu	sp,sp,-64
+   198d4:	27b00018 	addiu	s0,sp,24
+   198d8:	26030030 	addiu	v1,s0,48
+   198dc:	00808821 	addu	s1,a0,zero
+   198e0:	8c950000 	lw	s5,0(a0)
+   198e4:	24020004 	addiu	v0,zero,4
+   198e8:	2604002c 	addiu	a0,s0,44
+   198ec:	24050034 	addiu	a1,zero,52
+   198f0:	ae630004 	sw	v1,4(s3)
+   198f4:	ae050008 	sw	a1,8(s0)
+   198f8:	ae640000 	sw	a0,0(s3)
+   198fc:	ae020028 	sw	v0,40(s0)
+   19900:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   19904:	ae020024 	sw	v0,36(s0)
+   19908:	8e670004 	lw	a3,4(s3)
+   1990c:	8e660000 	lw	a2,0(s3)
+   19910:	0040a021 	addu	s4,v0,zero
+   19914:	02202021 	addu	a0,s1,zero
+   19918:	00002821 	addu	a1,zero,zero
+   1991c:	8e320000 	lw	s2,0(s1)
+   19920:	afc6001c 	sw	a2,28(s8)
+   19924:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   19928:	afc70018 	sw	a3,24(s8)
+   1992c:	02b4001b 	divu	zero,s5,s4
+   19930:	028001f4 	teq	s4,zero,0x7
+   19934:	8c420000 	lw	v0,0(v0)
+   19938:	8fc6001c 	lw	a2,28(s8)
+   1993c:	8fc70018 	lw	a3,24(s8)
+   19940:	02402821 	addu	a1,s2,zero
+   19944:	afa20010 	sw	v0,16(sp)
+   19948:	00002012 	mflo	a0
+   1994c:	0c0064b5 	jal	192d4 <__task_pid_alloc_main>
+   19950:	3084ffff 	andi	a0,a0,0xffff
+   19954:	02202021 	addu	a0,s1,zero
+   19958:	02002821 	addu	a1,s0,zero
+   1995c:	24060034 	addiu	a2,zero,52
+   19960:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   19964:	24070002 	addiu	a3,zero,2
+   19968:	03c0e821 	addu	sp,s8,zero
+   1996c:	8fbf003c 	lw	ra,60(sp)
+   19970:	8fbe0038 	lw	s8,56(sp)
+   19974:	8fb50034 	lw	s5,52(sp)
+   19978:	8fb40030 	lw	s4,48(sp)
+   1997c:	8fb3002c 	lw	s3,44(sp)
+   19980:	8fb20028 	lw	s2,40(sp)
+   19984:	8fb10024 	lw	s1,36(sp)
+   19988:	8fb00020 	lw	s0,32(sp)
+   1998c:	03e00008 	jr	ra
+   19990:	27bd0040 	addiu	sp,sp,64
+
+00019994 <__task_whereis_main>:
+   19994:	27bdffe0 	addiu	sp,sp,-32
+   19998:	afb00018 	sw	s0,24(sp)
+   1999c:	3c100004 	lui	s0,0x4
+   199a0:	26049ac0 	addiu	a0,s0,-25920
+   199a4:	afbf001c 	sw	ra,28(sp)
+   199a8:	afa60014 	sw	a2,20(sp)
+   199ac:	0c004bc3 	jal	12f0c <spinlock_lock>
+   199b0:	afa70010 	sw	a3,16(sp)
+   199b4:	8fa70010 	lw	a3,16(sp)
+   199b8:	0c006220 	jal	18880 <task_lookup>
+   199bc:	00e02021 	addu	a0,a3,zero
+   199c0:	94420000 	lhu	v0,0(v0)
+   199c4:	8fa60014 	lw	a2,20(sp)
+   199c8:	26049ac0 	addiu	a0,s0,-25920
+   199cc:	8fbf001c 	lw	ra,28(sp)
+   199d0:	8fb00018 	lw	s0,24(sp)
+   199d4:	a4c20000 	sh	v0,0(a2)
+   199d8:	08004b0b 	j	12c2c <spinlock_unlock>
+   199dc:	27bd0020 	addiu	sp,sp,32
+
+000199e0 <__task_whereis_local>:
+   199e0:	00803021 	addu	a2,a0,zero
+   199e4:	00a01021 	addu	v0,a1,zero
+   199e8:	40077801 	mfc0	a3,$15,1
+   199ec:	3c030004 	lui	v1,0x4
+   199f0:	2464c960 	addiu	a0,v1,-13984
+   199f4:	88840003 	lwl	a0,3(a0)
+   199f8:	30e70003 	andi	a3,a3,0x3
+   199fc:	3c050004 	lui	a1,0x4
+   19a00:	00073880 	sll	a3,a3,0x2
+   19a04:	24a5c950 	addiu	a1,a1,-14000
+   19a08:	9864c960 	lwr	a0,-13984(v1)
+   19a0c:	00e51821 	addu	v1,a3,a1
+   19a10:	8c650000 	lw	a1,0(v1)
+   19a14:	8c470000 	lw	a3,0(v0)
+   19a18:	08006665 	j	19994 <__task_whereis_main>
+   19a1c:	3084ffff 	andi	a0,a0,0xffff
+
+00019a20 <task_whereis>:
+   19a20:	27bdffb0 	addiu	sp,sp,-80
+   19a24:	3c020004 	lui	v0,0x4
+   19a28:	afb00044 	sw	s0,68(sp)
+   19a2c:	2443c960 	addiu	v1,v0,-13984
+   19a30:	afbf004c 	sw	ra,76(sp)
+   19a34:	afb10048 	sw	s1,72(sp)
+   19a38:	88630003 	lwl	v1,3(v1)
+   19a3c:	2405ffff 	addiu	a1,zero,-1
+   19a40:	9843c960 	lwr	v1,-13984(v0)
+   19a44:	a7a50028 	sh	a1,40(sp)
+   19a48:	24050002 	addiu	a1,zero,2
+   19a4c:	00048282 	srl	s0,a0,0xa
+   19a50:	27a20028 	addiu	v0,sp,40
+   19a54:	afa50030 	sw	a1,48(sp)
+   19a58:	afa40050 	sw	a0,80(sp)
+   19a5c:	24050004 	addiu	a1,zero,4
+   19a60:	27a40050 	addiu	a0,sp,80
+   19a64:	3063ffff 	andi	v1,v1,0xffff
+   19a68:	afa50038 	sw	a1,56(sp)
+   19a6c:	afa2002c 	sw	v0,44(sp)
+   19a70:	1203001d 	beq	s0,v1,19ae8 <task_whereis+0xc8>
+   19a74:	afa40034 	sw	a0,52(sp)
+   19a78:	40117801 	mfc0	s1,$15,1
+   19a7c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   19a80:	00000000 	sll	zero,zero,0x0
+   19a84:	70501802 	mul	v1,v0,s0
+   19a88:	32240003 	andi	a0,s1,0x3
+   19a8c:	00642021 	addu	a0,v1,a0
+   19a90:	27a3002c 	addiu	v1,sp,44
+   19a94:	afa30018 	sw	v1,24(sp)
+   19a98:	27a30030 	addiu	v1,sp,48
+   19a9c:	afa3001c 	sw	v1,28(sp)
+   19aa0:	3c070002 	lui	a3,0x2
+   19aa4:	27a30034 	addiu	v1,sp,52
+   19aa8:	24020001 	addiu	v0,zero,1
+   19aac:	afa30020 	sw	v1,32(sp)
+   19ab0:	24e79b0c 	addiu	a3,a3,-25844
+   19ab4:	27a30038 	addiu	v1,sp,56
+   19ab8:	24050001 	addiu	a1,zero,1
+   19abc:	00003021 	addu	a2,zero,zero
+   19ac0:	afa20014 	sw	v0,20(sp)
+   19ac4:	afa30024 	sw	v1,36(sp)
+   19ac8:	0c003de8 	jal	f7a0 <rppc_generic>
+   19acc:	afa20010 	sw	v0,16(sp)
+   19ad0:	8fbf004c 	lw	ra,76(sp)
+   19ad4:	97a20028 	lhu	v0,40(sp)
+   19ad8:	8fb10048 	lw	s1,72(sp)
+   19adc:	8fb00044 	lw	s0,68(sp)
+   19ae0:	03e00008 	jr	ra
+   19ae4:	27bd0050 	addiu	sp,sp,80
+   19ae8:	00402021 	addu	a0,v0,zero
+   19aec:	0c006678 	jal	199e0 <__task_whereis_local>
+   19af0:	27a50050 	addiu	a1,sp,80
+   19af4:	8fbf004c 	lw	ra,76(sp)
+   19af8:	97a20028 	lhu	v0,40(sp)
+   19afc:	8fb10048 	lw	s1,72(sp)
+   19b00:	8fb00044 	lw	s0,68(sp)
+   19b04:	03e00008 	jr	ra
+   19b08:	27bd0050 	addiu	sp,sp,80
+
+00019b0c <__task_whereis_demarshall>:
+   19b0c:	27bdffc8 	addiu	sp,sp,-56
+   19b10:	afbf0034 	sw	ra,52(sp)
+   19b14:	afbe0030 	sw	s8,48(sp)
+   19b18:	afb4002c 	sw	s4,44(sp)
+   19b1c:	03a0f021 	addu	s8,sp,zero
+   19b20:	afb30028 	sw	s3,40(sp)
+   19b24:	afb20024 	sw	s2,36(sp)
+   19b28:	afb10020 	sw	s1,32(sp)
+   19b2c:	afb0001c 	sw	s0,28(sp)
+   19b30:	27bdfff0 	addiu	sp,sp,-16
+   19b34:	27b20010 	addiu	s2,sp,16
+   19b38:	27bdffc8 	addiu	sp,sp,-56
+   19b3c:	27b00010 	addiu	s0,sp,16
+   19b40:	26020028 	addiu	v0,s0,40
+   19b44:	2403002c 	addiu	v1,zero,44
+   19b48:	ae030008 	sw	v1,8(s0)
+   19b4c:	ae420000 	sw	v0,0(s2)
+   19b50:	24030002 	addiu	v1,zero,2
+   19b54:	00808821 	addu	s1,a0,zero
+   19b58:	ae030024 	sw	v1,36(s0)
+   19b5c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   19b60:	8c940000 	lw	s4,0(a0)
+   19b64:	8e460000 	lw	a2,0(s2)
+   19b68:	00409821 	addu	s3,v0,zero
+   19b6c:	02202021 	addu	a0,s1,zero
+   19b70:	00002821 	addu	a1,zero,zero
+   19b74:	8e320000 	lw	s2,0(s1)
+   19b78:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   19b7c:	afc60010 	sw	a2,16(s8)
+   19b80:	0293001b 	divu	zero,s4,s3
+   19b84:	026001f4 	teq	s3,zero,0x7
+   19b88:	8c470000 	lw	a3,0(v0)
+   19b8c:	8fc60010 	lw	a2,16(s8)
+   19b90:	02402821 	addu	a1,s2,zero
+   19b94:	00002012 	mflo	a0
+   19b98:	0c006665 	jal	19994 <__task_whereis_main>
+   19b9c:	3084ffff 	andi	a0,a0,0xffff
+   19ba0:	02202021 	addu	a0,s1,zero
+   19ba4:	02002821 	addu	a1,s0,zero
+   19ba8:	2406002c 	addiu	a2,zero,44
+   19bac:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   19bb0:	24070001 	addiu	a3,zero,1
+   19bb4:	03c0e821 	addu	sp,s8,zero
+   19bb8:	8fbf0034 	lw	ra,52(sp)
+   19bbc:	8fbe0030 	lw	s8,48(sp)
+   19bc0:	8fb4002c 	lw	s4,44(sp)
+   19bc4:	8fb30028 	lw	s3,40(sp)
+   19bc8:	8fb20024 	lw	s2,36(sp)
+   19bcc:	8fb10020 	lw	s1,32(sp)
+   19bd0:	8fb0001c 	lw	s0,28(sp)
+   19bd4:	03e00008 	jr	ra
+   19bd8:	27bd0038 	addiu	sp,sp,56
+
+00019bdc <task_destroy>:
+   19bdc:	27bdffc8 	addiu	sp,sp,-56
+   19be0:	afb20030 	sw	s2,48(sp)
+   19be4:	3c120004 	lui	s2,0x4
+   19be8:	afb00028 	sw	s0,40(sp)
+   19bec:	00808021 	addu	s0,a0,zero
+   19bf0:	26449ac0 	addiu	a0,s2,-25920
+   19bf4:	afb1002c 	sw	s1,44(sp)
+   19bf8:	afbf0034 	sw	ra,52(sp)
+   19bfc:	0c004bc3 	jal	12f0c <spinlock_lock>
+   19c00:	8e1105c4 	lw	s1,1476(s0)
+   19c04:	3c020004 	lui	v0,0x4
+   19c08:	8e0405c4 	lw	a0,1476(s0)
+   19c0c:	2443c960 	addiu	v1,v0,-13984
+   19c10:	88630003 	lwl	v1,3(v1)
+   19c14:	308503ff 	andi	a1,a0,0x3ff
+   19c18:	9843c960 	lwr	v1,-13984(v0)
+   19c1c:	24a20012 	addiu	v0,a1,18
+   19c20:	3c050004 	lui	a1,0x4
+   19c24:	24a59a40 	addiu	a1,a1,-26048
+   19c28:	000210c0 	sll	v0,v0,0x3
+   19c2c:	00451021 	addu	v0,v0,a1
+   19c30:	00042282 	srl	a0,a0,0xa
+   19c34:	2405ffff 	addiu	a1,zero,-1
+   19c38:	3063ffff 	andi	v1,v1,0xffff
+   19c3c:	a4450004 	sh	a1,4(v0)
+   19c40:	10830005 	beq	a0,v1,19c58 <task_destroy+0x7c>
+   19c44:	ac400008 	sw	zero,8(v0)
+   19c48:	3c040004 	lui	a0,0x4
+   19c4c:	2484bad4 	addiu	a0,a0,-17708
+   19c50:	0c002ab2 	jal	aac8 <hremove>
+   19c54:	260505c4 	addiu	a1,s0,1476
+   19c58:	0000000f 	sync
+   19c5c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   19c60:	26449ac0 	addiu	a0,s2,-25920
+   19c64:	8e0305d0 	lw	v1,1488(s0)
+   19c68:	24020004 	addiu	v0,zero,4
+   19c6c:	1062000c 	beq	v1,v0,19ca0 <task_destroy+0xc4>
+   19c70:	00000000 	sll	zero,zero,0x0
+   19c74:	0c006275 	jal	189d4 <task_fd_destroy>
+   19c78:	02002021 	addu	a0,s0,zero
+   19c7c:	14400020 	bnez	v0,19d00 <task_destroy+0x124>
+   19c80:	3c020004 	lui	v0,0x4
+   19c84:	26040588 	addiu	a0,s0,1416
+   19c88:	0c009f67 	jal	27d9c <vfs_close>
+   19c8c:	00002821 	addu	a1,zero,zero
+   19c90:	0c00aff6 	jal	2bfd8 <vfs_file_down>
+   19c94:	26040510 	addiu	a0,s0,1296
+   19c98:	0c00aff6 	jal	2bfd8 <vfs_file_down>
+   19c9c:	2604054c 	addiu	a0,s0,1356
+   19ca0:	26110250 	addiu	s1,s0,592
+   19ca4:	0c0085ba 	jal	216e8 <vmm_destroy>
+   19ca8:	26040180 	addiu	a0,s0,384
+   19cac:	0c000c53 	jal	314c <pmm_release>
+   19cb0:	02202021 	addu	a0,s1,zero
+   19cb4:	0c000ae7 	jal	2b9c <pmm_destroy>
+   19cb8:	02202021 	addu	a0,s1,zero
+   19cbc:	27b10018 	addiu	s1,sp,24
+   19cc0:	8e02074c 	lw	v0,1868(s0)
+   19cc4:	02202021 	addu	a0,s1,zero
+   19cc8:	afa20024 	sw	v0,36(sp)
+   19ccc:	0c007134 	jal	1c4d0 <kmem_free>
+   19cd0:	afa00018 	sw	zero,24(sp)
+   19cd4:	02202021 	addu	a0,s1,zero
+   19cd8:	24020006 	addiu	v0,zero,6
+   19cdc:	afb00024 	sw	s0,36(sp)
+   19ce0:	0c007134 	jal	1c4d0 <kmem_free>
+   19ce4:	afa20018 	sw	v0,24(sp)
+   19ce8:	8fbf0034 	lw	ra,52(sp)
+   19cec:	8fb20030 	lw	s2,48(sp)
+   19cf0:	8fb1002c 	lw	s1,44(sp)
+   19cf4:	8fb00028 	lw	s0,40(sp)
+   19cf8:	03e00008 	jr	ra
+   19cfc:	27bd0038 	addiu	sp,sp,56
+   19d00:	8c449100 	lw	a0,-28416(v0)
+   19d04:	3c060003 	lui	a2,0x3
+   19d08:	3c070003 	lui	a3,0x3
+   19d0c:	24c66774 	addiu	a2,a2,26484
+   19d10:	24e767a4 	addiu	a3,a3,26532
+   19d14:	00002821 	addu	a1,zero,zero
+   19d18:	0c0009b0 	jal	26c0 <__fprintk>
+   19d1c:	afb10010 	sw	s1,16(sp)
+   19d20:	08006722 	j	19c88 <task_destroy+0xac>
+   19d24:	26040588 	addiu	a0,s0,1416
+
+00019d28 <task_create_clone>:
+   19d28:	27bdffc0 	addiu	sp,sp,-64
+   19d2c:	24020006 	addiu	v0,zero,6
+   19d30:	afa20010 	sw	v0,16(sp)
+   19d34:	240207e0 	addiu	v0,zero,2016
+   19d38:	afb40038 	sw	s4,56(sp)
+   19d3c:	afb20030 	sw	s2,48(sp)
+   19d40:	afa20014 	sw	v0,20(sp)
+   19d44:	27b40010 	addiu	s4,sp,16
+   19d48:	3c120004 	lui	s2,0x4
+   19d4c:	3c020011 	lui	v0,0x11
+   19d50:	afb30034 	sw	s3,52(sp)
+   19d54:	34420020 	ori	v0,v0,0x20
+   19d58:	26526db0 	addiu	s2,s2,28080
+   19d5c:	00809821 	addu	s3,a0,zero
+   19d60:	02802021 	addu	a0,s4,zero
+   19d64:	afb1002c 	sw	s1,44(sp)
+   19d68:	afb00028 	sw	s0,40(sp)
+   19d6c:	afbf003c 	sw	ra,60(sp)
+   19d70:	afa20018 	sw	v0,24(sp)
+   19d74:	00c08821 	addu	s1,a2,zero
+   19d78:	0c00713f 	jal	1c4fc <kmem_alloc>
+   19d7c:	afb2001c 	sw	s2,28(sp)
+   19d80:	10400032 	beqz	v0,19e4c <task_create_clone+0x124>
+   19d84:	00408021 	addu	s0,v0,zero
+   19d88:	0c004994 	jal	12650 <signal_manager_init>
+   19d8c:	00402021 	addu	a0,v0,zero
+   19d90:	14400015 	bnez	v0,19de8 <task_create_clone+0xc0>
+   19d94:	02802021 	addu	a0,s4,zero
+   19d98:	24020001 	addiu	v0,zero,1
+   19d9c:	afa20014 	sw	v0,20(sp)
+   19da0:	0c00713f 	jal	1c4fc <kmem_alloc>
+   19da4:	afa00010 	sw	zero,16(sp)
+   19da8:	1040002a 	beqz	v0,19e54 <task_create_clone+0x12c>
+   19dac:	ae02074c 	sw	v0,1868(s0)
+   19db0:	0c007c15 	jal	1f054 <ppm_page2addr>
+   19db4:	00402021 	addu	a0,v0,zero
+   19db8:	ae020740 	sw	v0,1856(s0)
+   19dbc:	0c006198 	jal	18660 <task_fd_init>
+   19dc0:	02002021 	addu	a0,s0,zero
+   19dc4:	10400025 	beqz	v0,19e5c <task_create_clone+0x134>
+   19dc8:	26040180 	addiu	a0,s0,384
+   19dcc:	8e03074c 	lw	v1,1868(s0)
+   19dd0:	02802021 	addu	a0,s4,zero
+   19dd4:	afa20020 	sw	v0,32(sp)
+   19dd8:	afa3001c 	sw	v1,28(sp)
+   19ddc:	0c007134 	jal	1c4d0 <kmem_free>
+   19de0:	afa00010 	sw	zero,16(sp)
+   19de4:	8fa20020 	lw	v0,32(sp)
+   19de8:	24030006 	addiu	v1,zero,6
+   19dec:	02802021 	addu	a0,s4,zero
+   19df0:	afa20020 	sw	v0,32(sp)
+   19df4:	afa30010 	sw	v1,16(sp)
+   19df8:	0c007134 	jal	1c4d0 <kmem_free>
+   19dfc:	afb0001c 	sw	s0,28(sp)
+   19e00:	8fa20020 	lw	v0,32(sp)
+   19e04:	323103ff 	andi	s1,s1,0x3ff
+   19e08:	26310012 	addiu	s1,s1,18
+   19e0c:	3c030004 	lui	v1,0x4
+   19e10:	24639a40 	addiu	v1,v1,-26048
+   19e14:	001188c0 	sll	s1,s1,0x3
+   19e18:	8fbf003c 	lw	ra,60(sp)
+   19e1c:	02238821 	addu	s1,s1,v1
+   19e20:	2403ffff 	addiu	v1,zero,-1
+   19e24:	ae200008 	sw	zero,8(s1)
+   19e28:	a6230004 	sh	v1,4(s1)
+   19e2c:	ae600000 	sw	zero,0(s3)
+   19e30:	8fb40038 	lw	s4,56(sp)
+   19e34:	8fb30034 	lw	s3,52(sp)
+   19e38:	8fb20030 	lw	s2,48(sp)
+   19e3c:	8fb1002c 	lw	s1,44(sp)
+   19e40:	8fb00028 	lw	s0,40(sp)
+   19e44:	03e00008 	jr	ra
+   19e48:	27bd0040 	addiu	sp,sp,64
+   19e4c:	08006781 	j	19e04 <task_create_clone+0xdc>
+   19e50:	2402000c 	addiu	v0,zero,12
+   19e54:	0800677a 	j	19de8 <task_create_clone+0xc0>
+   19e58:	2402000c 	addiu	v0,zero,12
+   19e5c:	00002821 	addu	a1,zero,zero
+   19e60:	24060160 	addiu	a2,zero,352
+   19e64:	0c00c182 	jal	30608 <memset>
+   19e68:	3c140004 	lui	s4,0x4
+   19e6c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   19e70:	26849ac0 	addiu	a0,s4,-25920
+   19e74:	ae1202e0 	sw	s2,736(s0)
+   19e78:	40022002 	mfc0	v0,$4,2
+   19e7c:	8c420174 	lw	v0,372(v0)
+   19e80:	26040510 	addiu	a0,s0,1296
+   19e84:	ae0202e4 	sw	v0,740(s0)
+   19e88:	00002821 	addu	a1,zero,zero
+   19e8c:	0c00c182 	jal	30608 <memset>
+   19e90:	2406003c 	addiu	a2,zero,60
+   19e94:	2604054c 	addiu	a0,s0,1356
+   19e98:	00002821 	addu	a1,zero,zero
+   19e9c:	0c00c182 	jal	30608 <memset>
+   19ea0:	2406003c 	addiu	a2,zero,60
+   19ea4:	26040588 	addiu	a0,s0,1416
+   19ea8:	00002821 	addu	a1,zero,zero
+   19eac:	0c00c182 	jal	30608 <memset>
+   19eb0:	2406003c 	addiu	a2,zero,60
+   19eb4:	24020800 	addiu	v0,zero,2048
+   19eb8:	24060800 	addiu	a2,zero,2048
+   19ebc:	ae020634 	sw	v0,1588(s0)
+   19ec0:	26040640 	addiu	a0,s0,1600
+   19ec4:	ae00062c 	sw	zero,1580(s0)
+   19ec8:	ae000630 	sw	zero,1584(s0)
+   19ecc:	0c00b8f0 	jal	2e3c0 <bitmap_set_range>
+   19ed0:	00002821 	addu	a1,zero,zero
+   19ed4:	8e0202e4 	lw	v0,740(s0)
+   19ed8:	ae1105c4 	sw	s1,1476(s0)
+   19edc:	8c420004 	lw	v0,4(v0)
+   19ee0:	260405d4 	addiu	a0,s0,1492
+   19ee4:	ae0205cc 	sw	v0,1484(s0)
+   19ee8:	24020004 	addiu	v0,zero,4
+   19eec:	ae0205d0 	sw	v0,1488(s0)
+   19ef0:	0c00199f 	jal	667c <atomic_init>
+   19ef4:	00002821 	addu	a1,zero,zero
+   19ef8:	3c030004 	lui	v1,0x4
+   19efc:	24020200 	addiu	v0,zero,512
+   19f00:	a6020614 	sh	v0,1556(s0)
+   19f04:	ae700000 	sw	s0,0(s3)
+   19f08:	2462c960 	addiu	v0,v1,-13984
+   19f0c:	88420003 	lwl	v0,3(v0)
+   19f10:	323103ff 	andi	s1,s1,0x3ff
+   19f14:	9862c960 	lwr	v0,-13984(v1)
+   19f18:	26310012 	addiu	s1,s1,18
+   19f1c:	3c030004 	lui	v1,0x4
+   19f20:	24639a40 	addiu	v1,v1,-26048
+   19f24:	001188c0 	sll	s1,s1,0x3
+   19f28:	02238821 	addu	s1,s1,v1
+   19f2c:	26849ac0 	addiu	a0,s4,-25920
+   19f30:	ae300008 	sw	s0,8(s1)
+   19f34:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   19f38:	a6220004 	sh	v0,4(s1)
+   19f3c:	0000000f 	sync
+   19f40:	8fbf003c 	lw	ra,60(sp)
+   19f44:	00001021 	addu	v0,zero,zero
+   19f48:	8fb40038 	lw	s4,56(sp)
+   19f4c:	8fb30034 	lw	s3,52(sp)
+   19f50:	8fb20030 	lw	s2,48(sp)
+   19f54:	8fb1002c 	lw	s1,44(sp)
+   19f58:	8fb00028 	lw	s0,40(sp)
+   19f5c:	03e00008 	jr	ra
+   19f60:	27bd0040 	addiu	sp,sp,64
+
+00019f64 <task_vaddr2paddr>:
+   19f64:	27bdffa8 	addiu	sp,sp,-88
+   19f68:	afb20050 	sw	s2,80(sp)
+   19f6c:	27a60030 	addiu	a2,sp,48
+   19f70:	00809021 	addu	s2,a0,zero
+   19f74:	24840250 	addiu	a0,a0,592
+   19f78:	afb1004c 	sw	s1,76(sp)
+   19f7c:	afb00048 	sw	s0,72(sp)
+   19f80:	afbf0054 	sw	ra,84(sp)
+   19f84:	0c000a56 	jal	2958 <pmm_get_page>
+   19f88:	00a08021 	addu	s0,a1,zero
+   19f8c:	14400029 	bnez	v0,1a034 <task_vaddr2paddr+0xd0>
+   19f90:	00408821 	addu	s1,v0,zero
+   19f94:	8fa20030 	lw	v0,48(sp)
+   19f98:	0440002b 	bltz	v0,1a048 <task_vaddr2paddr+0xe4>
+   19f9c:	8fa20034 	lw	v0,52(sp)
+   19fa0:	24051103 	addiu	a1,zero,4355
+   19fa4:	0c0080c9 	jal	20324 <__vmm_fault_handler>
+   19fa8:	02002021 	addu	a0,s0,zero
+   19fac:	40047801 	mfc0	a0,$15,1
+   19fb0:	40022002 	mfc0	v0,$4,2
+   19fb4:	3c030004 	lui	v1,0x4
+   19fb8:	30840003 	andi	a0,a0,0x3
+   19fbc:	00042080 	sll	a0,a0,0x2
+   19fc0:	2463c950 	addiu	v1,v1,-14000
+   19fc4:	00831821 	addu	v1,a0,v1
+   19fc8:	8c640000 	lw	a0,0(v1)
+   19fcc:	8e4305c4 	lw	v1,1476(s2)
+   19fd0:	afa40010 	sw	a0,16(sp)
+   19fd4:	afa30014 	sw	v1,20(sp)
+   19fd8:	8c4202f8 	lw	v0,760(v0)
+   19fdc:	3c030004 	lui	v1,0x4
+   19fe0:	afa20018 	sw	v0,24(sp)
+   19fe4:	8fa20030 	lw	v0,48(sp)
+   19fe8:	8c649100 	lw	a0,-28416(v1)
+   19fec:	afa20024 	sw	v0,36(sp)
+   19ff0:	3c060003 	lui	a2,0x3
+   19ff4:	8fa20034 	lw	v0,52(sp)
+   19ff8:	3c070003 	lui	a3,0x3
+   19ffc:	24c66644 	addiu	a2,a2,26180
+   1a000:	24e767d8 	addiu	a3,a3,26584
+   1a004:	00002821 	addu	a1,zero,zero
+   1a008:	afb0001c 	sw	s0,28(sp)
+   1a00c:	afb10020 	sw	s1,32(sp)
+   1a010:	0c0009b0 	jal	26c0 <__fprintk>
+   1a014:	afa20028 	sw	v0,40(sp)
+   1a018:	00001021 	addu	v0,zero,zero
+   1a01c:	8fbf0054 	lw	ra,84(sp)
+   1a020:	8fb20050 	lw	s2,80(sp)
+   1a024:	8fb1004c 	lw	s1,76(sp)
+   1a028:	8fb00048 	lw	s0,72(sp)
+   1a02c:	03e00008 	jr	ra
+   1a030:	27bd0058 	addiu	sp,sp,88
+   1a034:	8fa20030 	lw	v0,48(sp)
+   1a038:	0441ffd9 	bgez	v0,19fa0 <task_vaddr2paddr+0x3c>
+   1a03c:	24051100 	addiu	a1,zero,4352
+   1a040:	080067e9 	j	19fa4 <task_vaddr2paddr+0x40>
+   1a044:	00000000 	sll	zero,zero,0x0
+   1a048:	1040fff4 	beqz	v0,1a01c <task_vaddr2paddr+0xb8>
+   1a04c:	8fbf0054 	lw	ra,84(sp)
+   1a050:	32100fff 	andi	s0,s0,0xfff
+   1a054:	00021300 	sll	v0,v0,0xc
+   1a058:	02021025 	or	v0,s0,v0
+   1a05c:	8fb20050 	lw	s2,80(sp)
+   1a060:	8fb1004c 	lw	s1,76(sp)
+   1a064:	8fb00048 	lw	s0,72(sp)
+   1a068:	03e00008 	jr	ra
+   1a06c:	27bd0058 	addiu	sp,sp,88
+
+0001a070 <thread_get_state_name>:
+   1a070:	2c820007 	sltiu	v0,a0,7
+   1a074:	10400006 	beqz	v0,1a090 <thread_get_state_name+0x20>
+   1a078:	00042080 	sll	a0,a0,0x2
+   1a07c:	3c020003 	lui	v0,0x3
+   1a080:	24426850 	addiu	v0,v0,26704
+   1a084:	00822021 	addu	a0,a0,v0
+   1a088:	03e00008 	jr	ra
+   1a08c:	8c820000 	lw	v0,0(a0)
+   1a090:	3c020004 	lui	v0,0x4
+   1a094:	03e00008 	jr	ra
+   1a098:	8c42baf0 	lw	v0,-17680(v0)
+
+0001a09c <thread_init>:
+   1a09c:	27bdffe8 	addiu	sp,sp,-24
+   1a0a0:	3c050003 	lui	a1,0x3
+   1a0a4:	afb00010 	sw	s0,16(sp)
+   1a0a8:	24a559b4 	addiu	a1,a1,22964
+   1a0ac:	00808021 	addu	s0,a0,zero
+   1a0b0:	afbf0014 	sw	ra,20(sp)
+   1a0b4:	0c004a24 	jal	12890 <spinlock_init>
+   1a0b8:	24840120 	addiu	a0,a0,288
+   1a0bc:	24022000 	addiu	v0,zero,8192
+   1a0c0:	ae020350 	sw	v0,848(s0)
+   1a0c4:	8fbf0014 	lw	ra,20(sp)
+   1a0c8:	3c02deef 	lui	v0,0xdeef
+   1a0cc:	3442baad 	ori	v0,v0,0xbaad
+   1a0d0:	ae020390 	sw	v0,912(s0)
+   1a0d4:	ae00014c 	sw	zero,332(s0)
+   1a0d8:	ae10034c 	sw	s0,844(s0)
+   1a0dc:	ae000290 	sw	zero,656(s0)
+   1a0e0:	ae000294 	sw	zero,660(s0)
+   1a0e4:	8fb00010 	lw	s0,16(sp)
+   1a0e8:	03e00008 	jr	ra
+   1a0ec:	27bd0018 	addiu	sp,sp,24
+
+0001a0f0 <thread_create>:
+   1a0f0:	27bdffc0 	addiu	sp,sp,-64
+   1a0f4:	afb3002c 	sw	s3,44(sp)
+   1a0f8:	00809821 	addu	s3,a0,zero
+   1a0fc:	8ca4003c 	lw	a0,60(a1)
+   1a100:	afbf003c 	sw	ra,60(sp)
+   1a104:	afb60038 	sw	s6,56(sp)
+   1a108:	afb50034 	sw	s5,52(sp)
+   1a10c:	afb40030 	sw	s4,48(sp)
+   1a110:	afb20028 	sw	s2,40(sp)
+   1a114:	afb10024 	sw	s1,36(sp)
+   1a118:	00c0a021 	addu	s4,a2,zero
+   1a11c:	00a08821 	addu	s1,a1,zero
+   1a120:	0c00207a 	jal	81e8 <cpu_lid2ptr>
+   1a124:	afb00020 	sw	s0,32(sp)
+   1a128:	0040a821 	addu	s5,v0,zero
+   1a12c:	24020001 	addiu	v0,zero,1
+   1a130:	afa20014 	sw	v0,20(sp)
+   1a134:	3c160004 	lui	s6,0x4
+   1a138:	3c020055 	lui	v0,0x55
+   1a13c:	34420020 	ori	v0,v0,0x20
+   1a140:	26d66db0 	addiu	s6,s6,28080
+   1a144:	27a40010 	addiu	a0,sp,16
+   1a148:	afa20018 	sw	v0,24(sp)
+   1a14c:	afa00010 	sw	zero,16(sp)
+   1a150:	0c00713f 	jal	1c4fc <kmem_alloc>
+   1a154:	afb6001c 	sw	s6,28(sp)
+   1a158:	10400036 	beqz	v0,1a234 <thread_create+0x144>
+   1a15c:	00409021 	addu	s2,v0,zero
+   1a160:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1a164:	00402021 	addu	a0,v0,zero
+   1a168:	00402021 	addu	a0,v0,zero
+   1a16c:	0c006827 	jal	1a09c <thread_init>
+   1a170:	00408021 	addu	s0,v0,zero
+   1a174:	8ea30004 	lw	v1,4(s5)
+   1a178:	8ec20400 	lw	v0,1024(s6)
+   1a17c:	ae030154 	sw	v1,340(s0)
+   1a180:	8e250008 	lw	a1,8(s1)
+   1a184:	ae150174 	sw	s5,372(s0)
+   1a188:	02002021 	addu	a0,s0,zero
+   1a18c:	0c0044e0 	jal	11380 <sched_setpolicy>
+   1a190:	a6020150 	sh	v0,336(s0)
+   1a194:	8e220004 	lw	v0,4(s1)
+   1a198:	ae130180 	sw	s3,384(s0)
+   1a19c:	30420001 	andi	v0,v0,0x1
+   1a1a0:	2c420001 	sltiu	v0,v0,1
+   1a1a4:	02002021 	addu	a0,s0,zero
+   1a1a8:	ae020138 	sw	v0,312(s0)
+   1a1ac:	0c004864 	jal	12190 <signal_init>
+   1a1b0:	ae000184 	sw	zero,388(s0)
+   1a1b4:	ae300044 	sw	s0,68(s1)
+   1a1b8:	8e6205c4 	lw	v0,1476(s3)
+   1a1bc:	26040300 	addiu	a0,s0,768
+   1a1c0:	02202821 	addu	a1,s1,zero
+   1a1c4:	ae220048 	sw	v0,72(s1)
+   1a1c8:	0c00c12b 	jal	304ac <memcpy>
+   1a1cc:	2406004c 	addiu	a2,zero,76
+   1a1d0:	96230038 	lhu	v1,56(s1)
+   1a1d4:	26020284 	addiu	v0,s0,644
+   1a1d8:	ae030208 	sw	v1,520(s0)
+   1a1dc:	3c030003 	lui	v1,0x3
+   1a1e0:	246367e8 	addiu	v1,v1,26600
+   1a1e4:	ae120388 	sw	s2,904(s0)
+   1a1e8:	ae020288 	sw	v0,648(s0)
+   1a1ec:	ae020284 	sw	v0,644(s0)
+   1a1f0:	ae03027c 	sw	v1,636(s0)
+   1a1f4:	ae000280 	sw	zero,640(s0)
+   1a1f8:	26040188 	addiu	a0,s0,392
+   1a1fc:	0c000169 	jal	5a4 <cpu_context_init>
+   1a200:	02002821 	addu	a1,s0,zero
+   1a204:	8fbf003c 	lw	ra,60(sp)
+   1a208:	ae900000 	sw	s0,0(s4)
+   1a20c:	00001021 	addu	v0,zero,zero
+   1a210:	8fb60038 	lw	s6,56(sp)
+   1a214:	8fb50034 	lw	s5,52(sp)
+   1a218:	8fb40030 	lw	s4,48(sp)
+   1a21c:	8fb3002c 	lw	s3,44(sp)
+   1a220:	8fb20028 	lw	s2,40(sp)
+   1a224:	8fb10024 	lw	s1,36(sp)
+   1a228:	8fb00020 	lw	s0,32(sp)
+   1a22c:	03e00008 	jr	ra
+   1a230:	27bd0040 	addiu	sp,sp,64
+   1a234:	8fbf003c 	lw	ra,60(sp)
+   1a238:	2402000b 	addiu	v0,zero,11
+   1a23c:	8fb60038 	lw	s6,56(sp)
+   1a240:	8fb50034 	lw	s5,52(sp)
+   1a244:	8fb40030 	lw	s4,48(sp)
+   1a248:	8fb3002c 	lw	s3,44(sp)
+   1a24c:	8fb20028 	lw	s2,40(sp)
+   1a250:	8fb10024 	lw	s1,36(sp)
+   1a254:	8fb00020 	lw	s0,32(sp)
+   1a258:	03e00008 	jr	ra
+   1a25c:	27bd0040 	addiu	sp,sp,64
+
+0001a260 <thread_get_attr_name>:
+   1a260:	70842020 	clz	a0,a0
+   1a264:	24020020 	addiu	v0,zero,32
+   1a268:	00441023 	subu	v0,v0,a0
+   1a26c:	3c030003 	lui	v1,0x3
+   1a270:	24636868 	addiu	v1,v1,26728
+   1a274:	00021080 	sll	v0,v0,0x2
+   1a278:	00431021 	addu	v0,v0,v1
+   1a27c:	03e00008 	jr	ra
+   1a280:	8c420000 	lw	v0,0(v0)
+
+0001a284 <kthread_destroy>:
+   1a284:	27bdffd8 	addiu	sp,sp,-40
+   1a288:	afb00020 	sw	s0,32(sp)
+   1a28c:	ac800390 	sw	zero,912(a0)
+   1a290:	00808021 	addu	s0,a0,zero
+   1a294:	afbf0024 	sw	ra,36(sp)
+   1a298:	0c004a29 	jal	128a4 <spinlock_destroy>
+   1a29c:	24840120 	addiu	a0,a0,288
+   1a2a0:	0c0001cd 	jal	734 <cpu_context_destroy>
+   1a2a4:	26040188 	addiu	a0,s0,392
+   1a2a8:	8e020388 	lw	v0,904(s0)
+   1a2ac:	ae000180 	sw	zero,384(s0)
+   1a2b0:	27a40010 	addiu	a0,sp,16
+   1a2b4:	afa2001c 	sw	v0,28(sp)
+   1a2b8:	0c007134 	jal	1c4d0 <kmem_free>
+   1a2bc:	afa00010 	sw	zero,16(sp)
+   1a2c0:	8fbf0024 	lw	ra,36(sp)
+   1a2c4:	8fb00020 	lw	s0,32(sp)
+   1a2c8:	03e00008 	jr	ra
+   1a2cc:	27bd0028 	addiu	sp,sp,40
+
+0001a2d0 <pthread_destroy>:
+   1a2d0:	27bdffb8 	addiu	sp,sp,-72
+   1a2d4:	afb00020 	sw	s0,32(sp)
+   1a2d8:	afbf0044 	sw	ra,68(sp)
+   1a2dc:	afbe0040 	sw	s8,64(sp)
+   1a2e0:	afb7003c 	sw	s7,60(sp)
+   1a2e4:	afb60038 	sw	s6,56(sp)
+   1a2e8:	afb50034 	sw	s5,52(sp)
+   1a2ec:	afb40030 	sw	s4,48(sp)
+   1a2f0:	afb3002c 	sw	s3,44(sp)
+   1a2f4:	afb20028 	sw	s2,40(sp)
+   1a2f8:	afb10024 	sw	s1,36(sp)
+   1a2fc:	00808021 	addu	s0,a0,zero
+   1a300:	40024800 	mfc0	v0,c0_count
+   1a304:	00000000 	sll	zero,zero,0x0
+   1a308:	8c9601f8 	lw	s6,504(a0)
+   1a30c:	8c950200 	lw	s5,512(a0)
+   1a310:	8c9401fc 	lw	s4,508(a0)
+   1a314:	8c930218 	lw	s3,536(a0)
+   1a318:	8c92021c 	lw	s2,540(a0)
+   1a31c:	8c910180 	lw	s1,384(a0)
+   1a320:	40022002 	mfc0	v0,$4,2
+   1a324:	ac800390 	sw	zero,912(a0)
+   1a328:	8c840174 	lw	a0,372(a0)
+   1a32c:	40016000 	mfc0	at,c0_status
+   1a330:	00000000 	sll	zero,zero,0x0
+   1a334:	00011825 	or	v1,zero,at
+   1a338:	00010842 	srl	at,at,0x1
+   1a33c:	00010840 	sll	at,at,0x1
+   1a340:	40816000 	mtc0	at,c0_status
+   1a344:	3c020001 	lui	v0,0x1
+   1a348:	00821021 	addu	v0,a0,v0
+   1a34c:	8c448324 	lw	a0,-31964(v0)
+   1a350:	10900053 	beq	a0,s0,1a4a0 <pthread_destroy+0x1d0>
+   1a354:	00000000 	sll	zero,zero,0x0
+   1a358:	40016000 	mfc0	at,c0_status
+   1a35c:	340200ff 	ori	v0,zero,0xff
+   1a360:	00431024 	and	v0,v0,v1
+   1a364:	00220825 	or	at,at,v0
+   1a368:	40816000 	mtc0	at,c0_status
+   1a36c:	263e00a0 	addiu	s8,s1,160
+   1a370:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1a374:	03c02021 	addu	a0,s8,zero
+   1a378:	8e370630 	lw	s7,1584(s1)
+   1a37c:	8e0702f8 	lw	a3,760(s0)
+   1a380:	26e2ffff 	addiu	v0,s7,-1
+   1a384:	ae220630 	sw	v0,1584(s1)
+   1a388:	8e0202f8 	lw	v0,760(s0)
+   1a38c:	8e2a0740 	lw	t2,1856(s1)
+   1a390:	00022942 	srl	a1,v0,0x5
+   1a394:	24a50190 	addiu	a1,a1,400
+   1a398:	00052880 	sll	a1,a1,0x2
+   1a39c:	02252821 	addu	a1,s1,a1
+   1a3a0:	8ca90000 	lw	t1,0(a1)
+   1a3a4:	8e260638 	lw	a2,1592(s1)
+   1a3a8:	24080001 	addiu	t0,zero,1
+   1a3ac:	8e0401f0 	lw	a0,496(s0)
+   1a3b0:	8e0301f4 	lw	v1,500(s0)
+   1a3b4:	00073880 	sll	a3,a3,0x2
+   1a3b8:	00484004 	sllv	t0,t0,v0
+   1a3bc:	01473821 	addu	a3,t2,a3
+   1a3c0:	01094025 	or	t0,t0,t1
+   1a3c4:	0046302b 	sltu	a2,v0,a2
+   1a3c8:	ac830004 	sw	v1,4(a0)
+   1a3cc:	aca80000 	sw	t0,0(a1)
+   1a3d0:	ace00000 	sw	zero,0(a3)
+   1a3d4:	10c00002 	beqz	a2,1a3e0 <pthread_destroy+0x110>
+   1a3d8:	ac640000 	sw	a0,0(v1)
+   1a3dc:	ae220638 	sw	v0,1592(s1)
+   1a3e0:	8e260298 	lw	a2,664(s1)
+   1a3e4:	8e25029c 	lw	a1,668(s1)
+   1a3e8:	8e2302b4 	lw	v1,692(s1)
+   1a3ec:	8e2202b8 	lw	v0,696(s1)
+   1a3f0:	8e2402a0 	lw	a0,672(s1)
+   1a3f4:	00d6b021 	addu	s6,a2,s6
+   1a3f8:	00b5a821 	addu	s5,a1,s5
+   1a3fc:	00739821 	addu	s3,v1,s3
+   1a400:	00529021 	addu	s2,v0,s2
+   1a404:	0094a021 	addu	s4,a0,s4
+   1a408:	ae360298 	sw	s6,664(s1)
+   1a40c:	03c02021 	addu	a0,s8,zero
+   1a410:	ae35029c 	sw	s5,668(s1)
+   1a414:	ae3402a0 	sw	s4,672(s1)
+   1a418:	ae3302b4 	sw	s3,692(s1)
+   1a41c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1a420:	ae3202b8 	sw	s2,696(s1)
+   1a424:	0c004a29 	jal	128a4 <spinlock_destroy>
+   1a428:	26040120 	addiu	a0,s0,288
+   1a42c:	0c0001cd 	jal	734 <cpu_context_destroy>
+   1a430:	26040188 	addiu	a0,s0,392
+   1a434:	8e020388 	lw	v0,904(s0)
+   1a438:	ae000180 	sw	zero,384(s0)
+   1a43c:	27a40010 	addiu	a0,sp,16
+   1a440:	afa2001c 	sw	v0,28(sp)
+   1a444:	0c007134 	jal	1c4d0 <kmem_free>
+   1a448:	afa00010 	sw	zero,16(sp)
+   1a44c:	24020001 	addiu	v0,zero,1
+   1a450:	12e2000f 	beq	s7,v0,1a490 <pthread_destroy+0x1c0>
+   1a454:	00000000 	sll	zero,zero,0x0
+   1a458:	40024800 	mfc0	v0,c0_count
+   1a45c:	00000000 	sll	zero,zero,0x0
+   1a460:	8fbf0044 	lw	ra,68(sp)
+   1a464:	8fbe0040 	lw	s8,64(sp)
+   1a468:	8fb7003c 	lw	s7,60(sp)
+   1a46c:	8fb60038 	lw	s6,56(sp)
+   1a470:	8fb50034 	lw	s5,52(sp)
+   1a474:	8fb40030 	lw	s4,48(sp)
+   1a478:	8fb3002c 	lw	s3,44(sp)
+   1a47c:	8fb20028 	lw	s2,40(sp)
+   1a480:	8fb10024 	lw	s1,36(sp)
+   1a484:	8fb00020 	lw	s0,32(sp)
+   1a488:	03e00008 	jr	ra
+   1a48c:	27bd0048 	addiu	sp,sp,72
+   1a490:	0c0066f7 	jal	19bdc <task_destroy>
+   1a494:	02202021 	addu	a0,s1,zero
+   1a498:	08006916 	j	1a458 <pthread_destroy+0x188>
+   1a49c:	00000000 	sll	zero,zero,0x0
+   1a4a0:	ac408324 	sw	zero,-31964(v0)
+   1a4a4:	3c1bdfff 	lui	k1,0xdfff
+   1a4a8:	377bffff 	ori	k1,k1,0xffff
+   1a4ac:	40016000 	mfc0	at,c0_status
+   1a4b0:	003bd824 	and	k1,at,k1
+   1a4b4:	080068d6 	j	1a358 <pthread_destroy+0x88>
+   1a4b8:	409b6000 	mtc0	k1,c0_status
+
+0001a4bc <thread_destroy>:
+   1a4bc:	8c820184 	lw	v0,388(a0)
+   1a4c0:	27bdffe8 	addiu	sp,sp,-24
+   1a4c4:	10400007 	beqz	v0,1a4e4 <thread_destroy+0x28>
+   1a4c8:	afbf0014 	sw	ra,20(sp)
+   1a4cc:	0c0068a1 	jal	1a284 <kthread_destroy>
+   1a4d0:	00000000 	sll	zero,zero,0x0
+   1a4d4:	8fbf0014 	lw	ra,20(sp)
+   1a4d8:	00001021 	addu	v0,zero,zero
+   1a4dc:	03e00008 	jr	ra
+   1a4e0:	27bd0018 	addiu	sp,sp,24
+   1a4e4:	0c0068b4 	jal	1a2d0 <pthread_destroy>
+   1a4e8:	00000000 	sll	zero,zero,0x0
+   1a4ec:	8fbf0014 	lw	ra,20(sp)
+   1a4f0:	00001021 	addu	v0,zero,zero
+   1a4f4:	03e00008 	jr	ra
+   1a4f8:	27bd0018 	addiu	sp,sp,24
+
+0001a4fc <thread_destroy_handler>:
+   1a4fc:	8c840008 	lw	a0,8(a0)
+   1a500:	27bdffe8 	addiu	sp,sp,-24
+   1a504:	afbf0014 	sw	ra,20(sp)
+   1a508:	0c00692f 	jal	1a4bc <thread_destroy>
+   1a50c:	00000000 	sll	zero,zero,0x0
+   1a510:	8fbf0014 	lw	ra,20(sp)
+   1a514:	00001021 	addu	v0,zero,zero
+   1a518:	03e00008 	jr	ra
+   1a51c:	27bd0018 	addiu	sp,sp,24
+
+0001a520 <thread_dup>:
+   1a520:	27bdffc8 	addiu	sp,sp,-56
+   1a524:	afb2001c 	sw	s2,28(sp)
+   1a528:	8fb20048 	lw	s2,72(sp)
+   1a52c:	afb10018 	sw	s1,24(sp)
+   1a530:	afb00014 	sw	s0,20(sp)
+   1a534:	00808821 	addu	s1,a0,zero
+   1a538:	00a08021 	addu	s0,a1,zero
+   1a53c:	02402021 	addu	a0,s2,zero
+   1a540:	afbf0034 	sw	ra,52(sp)
+   1a544:	afb70030 	sw	s7,48(sp)
+   1a548:	afb6002c 	sw	s6,44(sp)
+   1a54c:	afb50028 	sw	s5,40(sp)
+   1a550:	00e0b021 	addu	s6,a3,zero
+   1a554:	afb40024 	sw	s4,36(sp)
+   1a558:	afb30020 	sw	s3,32(sp)
+   1a55c:	0c0044ce 	jal	11338 <sched_getpolicy>
+   1a560:	00c09821 	addu	s3,a2,zero
+   1a564:	8e140388 	lw	s4,904(s0)
+   1a568:	8e450388 	lw	a1,904(s2)
+   1a56c:	02802021 	addu	a0,s4,zero
+   1a570:	0040a821 	addu	s5,v0,zero
+   1a574:	8ed20400 	lw	s2,1024(s6)
+   1a578:	0c007a47 	jal	1e91c <page_copy>
+   1a57c:	8e770000 	lw	s7,0(s3)
+   1a580:	3c050003 	lui	a1,0x3
+   1a584:	26040120 	addiu	a0,s0,288
+   1a588:	0c004a24 	jal	12890 <spinlock_init>
+   1a58c:	24a559b4 	addiu	a1,a1,22964
+   1a590:	ae000134 	sw	zero,308(s0)
+   1a594:	ae000138 	sw	zero,312(s0)
+   1a598:	ae00013c 	sw	zero,316(s0)
+   1a59c:	ae000148 	sw	zero,328(s0)
+   1a5a0:	8ec30400 	lw	v1,1024(s6)
+   1a5a4:	8e620004 	lw	v0,4(s3)
+   1a5a8:	a6030150 	sh	v1,336(s0)
+   1a5ac:	ae130174 	sw	s3,372(s0)
+   1a5b0:	02002021 	addu	a0,s0,zero
+   1a5b4:	02a02821 	addu	a1,s5,zero
+   1a5b8:	0c0044e0 	jal	11380 <sched_setpolicy>
+   1a5bc:	ae020154 	sw	v0,340(s0)
+   1a5c0:	00001821 	addu	v1,zero,zero
+   1a5c4:	00001021 	addu	v0,zero,zero
+   1a5c8:	ae110180 	sw	s1,384(s0)
+   1a5cc:	ae120208 	sw	s2,520(s0)
+   1a5d0:	ae03024c 	sw	v1,588(s0)
+   1a5d4:	ae030254 	sw	v1,596(s0)
+   1a5d8:	ae03023c 	sw	v1,572(s0)
+   1a5dc:	ae030244 	sw	v1,580(s0)
+   1a5e0:	02002021 	addu	a0,s0,zero
+   1a5e4:	ae000184 	sw	zero,388(s0)
+   1a5e8:	ae000204 	sw	zero,516(s0)
+   1a5ec:	ae000210 	sw	zero,528(s0)
+   1a5f0:	ae00020c 	sw	zero,524(s0)
+   1a5f4:	ae000224 	sw	zero,548(s0)
+   1a5f8:	ae000220 	sw	zero,544(s0)
+   1a5fc:	ae020248 	sw	v0,584(s0)
+   1a600:	ae020250 	sw	v0,592(s0)
+   1a604:	ae020238 	sw	v0,568(s0)
+   1a608:	0c004864 	jal	12190 <signal_init>
+   1a60c:	ae020240 	sw	v0,576(s0)
+   1a610:	ae150308 	sw	s5,776(s0)
+   1a614:	ae17033c 	sw	s7,828(s0)
+   1a618:	ae000280 	sw	zero,640(s0)
+   1a61c:	8e620004 	lw	v0,4(s3)
+   1a620:	3c04deef 	lui	a0,0xdeef
+   1a624:	ae020340 	sw	v0,832(s0)
+   1a628:	ae100344 	sw	s0,836(s0)
+   1a62c:	3484baad 	ori	a0,a0,0xbaad
+   1a630:	8e2305c4 	lw	v1,1476(s1)
+   1a634:	8fbf0034 	lw	ra,52(sp)
+   1a638:	ae040390 	sw	a0,912(s0)
+   1a63c:	3c040003 	lui	a0,0x3
+   1a640:	26020284 	addiu	v0,s0,644
+   1a644:	248467e8 	addiu	a0,a0,26600
+   1a648:	ae020288 	sw	v0,648(s0)
+   1a64c:	a6120338 	sh	s2,824(s0)
+   1a650:	ae140388 	sw	s4,904(s0)
+   1a654:	ae020284 	sw	v0,644(s0)
+   1a658:	ae04027c 	sw	a0,636(s0)
+   1a65c:	ae030348 	sw	v1,840(s0)
+   1a660:	ae000274 	sw	zero,628(s0)
+   1a664:	ae10034c 	sw	s0,844(s0)
+   1a668:	00001021 	addu	v0,zero,zero
+   1a66c:	8fb70030 	lw	s7,48(sp)
+   1a670:	8fb6002c 	lw	s6,44(sp)
+   1a674:	8fb50028 	lw	s5,40(sp)
+   1a678:	8fb40024 	lw	s4,36(sp)
+   1a67c:	8fb30020 	lw	s3,32(sp)
+   1a680:	8fb2001c 	lw	s2,28(sp)
+   1a684:	8fb10018 	lw	s1,24(sp)
+   1a688:	8fb00014 	lw	s0,20(sp)
+   1a68c:	03e00008 	jr	ra
+   1a690:	27bd0038 	addiu	sp,sp,56
+
+0001a694 <thread_idle>:
+   1a694:	27bdffb0 	addiu	sp,sp,-80
+   1a698:	afb20030 	sw	s2,48(sp)
+   1a69c:	afbf004c 	sw	ra,76(sp)
+   1a6a0:	afbe0048 	sw	s8,72(sp)
+   1a6a4:	afb70044 	sw	s7,68(sp)
+   1a6a8:	afb60040 	sw	s6,64(sp)
+   1a6ac:	afb5003c 	sw	s5,60(sp)
+   1a6b0:	afb40038 	sw	s4,56(sp)
+   1a6b4:	afb30034 	sw	s3,52(sp)
+   1a6b8:	afb1002c 	sw	s1,44(sp)
+   1a6bc:	afb00028 	sw	s0,40(sp)
+   1a6c0:	00809021 	addu	s2,a0,zero
+   1a6c4:	40102002 	mfc0	s0,$4,2
+   1a6c8:	40022002 	mfc0	v0,$4,2
+   1a6cc:	8c510174 	lw	s1,372(v0)
+   1a6d0:	0c00056c 	jal	15b0 <arch_onln_cpu_nr>
+   1a6d4:	8e330004 	lw	s3,4(s1)
+   1a6d8:	3c020001 	lui	v0,0x1
+   1a6dc:	02221021 	addu	v0,s1,v0
+   1a6e0:	8c438328 	lw	v1,-31960(v0)
+   1a6e4:	3c020003 	lui	v0,0x3
+   1a6e8:	00621021 	addu	v0,v1,v0
+   1a6ec:	8c559528 	lw	s5,-27352(v0)
+   1a6f0:	0235a826 	xor	s5,s1,s5
+   1a6f4:	2eb50001 	sltiu	s5,s5,1
+   1a6f8:	40016000 	mfc0	at,c0_status
+   1a6fc:	00000000 	sll	zero,zero,0x0
+   1a700:	00011825 	or	v1,zero,at
+   1a704:	00010842 	srl	at,at,0x1
+   1a708:	00010840 	sll	at,at,0x1
+   1a70c:	40816000 	mtc0	at,c0_status
+   1a710:	8e02013c 	lw	v0,316(s0)
+   1a714:	24420001 	addiu	v0,v0,1
+   1a718:	ae02013c 	sw	v0,316(s0)
+   1a71c:	40016000 	mfc0	at,c0_status
+   1a720:	340200ff 	ori	v0,zero,0xff
+   1a724:	00431024 	and	v0,v0,v1
+   1a728:	00220825 	or	at,at,v0
+   1a72c:	40816000 	mtc0	at,c0_status
+   1a730:	12a00006 	beqz	s5,1a74c <thread_idle+0xb8>
+   1a734:	3c140001 	lui	s4,0x1
+   1a738:	3c040000 	lui	a0,0x0
+   1a73c:	24840000 	addiu	a0,a0,0
+   1a740:	0c000a82 	jal	2a08 <pmm_tlb_flush_vaddr>
+   1a744:	24050003 	addiu	a1,zero,3
+   1a748:	3c140001 	lui	s4,0x1
+   1a74c:	0234a021 	addu	s4,s1,s4
+   1a750:	27a40018 	addiu	a0,sp,24
+   1a754:	0c000d66 	jal	3598 <rt_timer_read>
+   1a758:	ae808338 	sw	zero,-31944(s4)
+   1a75c:	8fa20018 	lw	v0,24(sp)
+   1a760:	02202021 	addu	a0,s1,zero
+   1a764:	ae020220 	sw	v0,544(s0)
+   1a768:	ae02022c 	sw	v0,556(s0)
+   1a76c:	0c00200c 	jal	8030 <cpu_time_reset>
+   1a770:	3c160004 	lui	s6,0x4
+   1a774:	8ec49100 	lw	a0,-28416(s6)
+   1a778:	8e270004 	lw	a3,4(s1)
+   1a77c:	3c060003 	lui	a2,0x3
+   1a780:	24c6688c 	addiu	a2,a2,26764
+   1a784:	0c0009b0 	jal	26c0 <__fprintk>
+   1a788:	00002821 	addu	a1,zero,zero
+   1a78c:	8e420008 	lw	v0,8(s2)
+   1a790:	105300ac 	beq	v0,s3,1aa44 <thread_idle+0x3b0>
+   1a794:	00000000 	sll	zero,zero,0x0
+   1a798:	8e040180 	lw	a0,384(s0)
+   1a79c:	8e270000 	lw	a3,0(s1)
+   1a7a0:	3c050001 	lui	a1,0x1
+   1a7a4:	24a5a6b4 	addiu	a1,a1,-22860
+   1a7a8:	0c002eaf 	jal	babc <kthread_create>
+   1a7ac:	00003021 	addu	a2,zero,zero
+   1a7b0:	1040007d 	beqz	v0,1a9a8 <thread_idle+0x314>
+   1a7b4:	00409021 	addu	s2,v0,zero
+   1a7b8:	3c030001 	lui	v1,0x1
+   1a7bc:	02231821 	addu	v1,s1,v1
+   1a7c0:	8e040180 	lw	a0,384(s0)
+   1a7c4:	ac7282c0 	sw	s2,-32064(v1)
+   1a7c8:	3c030003 	lui	v1,0x3
+   1a7cc:	2463692c 	addiu	v1,v1,26924
+   1a7d0:	24420284 	addiu	v0,v0,644
+   1a7d4:	ae440180 	sw	a0,384(s2)
+   1a7d8:	ae43027c 	sw	v1,636(s2)
+   1a7dc:	02402021 	addu	a0,s2,zero
+   1a7e0:	ae420288 	sw	v0,648(s2)
+   1a7e4:	ae400280 	sw	zero,640(s2)
+   1a7e8:	0c004715 	jal	11c54 <sched_register>
+   1a7ec:	ae420284 	sw	v0,644(s2)
+   1a7f0:	0c0046cb 	jal	11b2c <sched_add_created>
+   1a7f4:	02402021 	addu	a0,s2,zero
+   1a7f8:	40016000 	mfc0	at,c0_status
+   1a7fc:	00000000 	sll	zero,zero,0x0
+   1a800:	00011825 	or	v1,zero,at
+   1a804:	00010842 	srl	at,at,0x1
+   1a808:	00010840 	sll	at,at,0x1
+   1a80c:	40816000 	mtc0	at,c0_status
+   1a810:	8e42013c 	lw	v0,316(s2)
+   1a814:	24420001 	addiu	v0,v0,1
+   1a818:	ae42013c 	sw	v0,316(s2)
+   1a81c:	40016000 	mfc0	at,c0_status
+   1a820:	340200ff 	ori	v0,zero,0xff
+   1a824:	00431024 	and	v0,v0,v1
+   1a828:	00220825 	or	at,at,v0
+   1a82c:	40816000 	mtc0	at,c0_status
+   1a830:	3c1e0003 	lui	s8,0x3
+   1a834:	27de6990 	addiu	s8,s8,27024
+   1a838:	0000a021 	addu	s4,zero,zero
+   1a83c:	24170002 	addiu	s7,zero,2
+   1a840:	8e050180 	lw	a1,384(s0)
+   1a844:	0c003a4e 	jal	e938 <rpc_thread_create>
+   1a848:	02202021 	addu	a0,s1,zero
+   1a84c:	10400005 	beqz	v0,1a864 <thread_idle+0x1d0>
+   1a850:	02202021 	addu	a0,s1,zero
+   1a854:	0c003a4e 	jal	e938 <rpc_thread_create>
+   1a858:	8e050180 	lw	a1,384(s0)
+   1a85c:	1440008f 	bnez	v0,1aa9c <thread_idle+0x408>
+   1a860:	3c050003 	lui	a1,0x3
+   1a864:	40024800 	mfc0	v0,c0_count
+   1a868:	00000000 	sll	zero,zero,0x0
+   1a86c:	8ec49100 	lw	a0,-28416(s6)
+   1a870:	26940001 	addiu	s4,s4,1
+   1a874:	00002821 	addu	a1,zero,zero
+   1a878:	03c03021 	addu	a2,s8,zero
+   1a87c:	02403821 	addu	a3,s2,zero
+   1a880:	afa20014 	sw	v0,20(sp)
+   1a884:	0c0009b0 	jal	26c0 <__fprintk>
+   1a888:	afb30010 	sw	s3,16(sp)
+   1a88c:	1697ffec 	bne	s4,s7,1a840 <thread_idle+0x1ac>
+   1a890:	00000000 	sll	zero,zero,0x0
+   1a894:	12a0000b 	beqz	s5,1a8c4 <thread_idle+0x230>
+   1a898:	00000000 	sll	zero,zero,0x0
+   1a89c:	0c0028e8 	jal	a3a0 <dqdt_update>
+   1a8a0:	00000000 	sll	zero,zero,0x0
+   1a8a4:	3c020004 	lui	v0,0x4
+   1a8a8:	2443c960 	addiu	v1,v0,-13984
+   1a8ac:	88720003 	lwl	s2,3(v1)
+   1a8b0:	9852c960 	lwr	s2,-13984(v0)
+   1a8b4:	0c000575 	jal	15d4 <arch_boot_cid>
+   1a8b8:	3252ffff 	andi	s2,s2,0xffff
+   1a8bc:	10520044 	beq	v0,s2,1a9d0 <thread_idle+0x33c>
+   1a8c0:	3c050002 	lui	a1,0x2
+   1a8c4:	0c0039b3 	jal	e6cc <rpc_test>
+   1a8c8:	00000000 	sll	zero,zero,0x0
+   1a8cc:	40016000 	mfc0	at,c0_status
+   1a8d0:	00000000 	sll	zero,zero,0x0
+   1a8d4:	00011825 	or	v1,zero,at
+   1a8d8:	00010842 	srl	at,at,0x1
+   1a8dc:	00010840 	sll	at,at,0x1
+   1a8e0:	40816000 	mtc0	at,c0_status
+   1a8e4:	8e02013c 	lw	v0,316(s0)
+   1a8e8:	2442ffff 	addiu	v0,v0,-1
+   1a8ec:	ae02013c 	sw	v0,316(s0)
+   1a8f0:	40016000 	mfc0	at,c0_status
+   1a8f4:	340200ff 	ori	v0,zero,0xff
+   1a8f8:	00431024 	and	v0,v0,v1
+   1a8fc:	00220825 	or	at,at,v0
+   1a900:	40816000 	mtc0	at,c0_status
+   1a904:	3c020001 	lui	v0,0x1
+   1a908:	02221021 	addu	v0,s1,v0
+   1a90c:	24030001 	addiu	v1,zero,1
+   1a910:	ac438338 	sw	v1,-31944(v0)
+   1a914:	0c004636 	jal	118d8 <sched_yield>
+   1a918:	02002021 	addu	a0,s0,zero
+   1a91c:	341382de 	ori	s3,zero,0x82de
+   1a920:	341282d8 	ori	s2,zero,0x82d8
+   1a924:	340282dc 	ori	v0,zero,0x82dc
+   1a928:	02339821 	addu	s3,s1,s3
+   1a92c:	02329021 	addu	s2,s1,s2
+   1a930:	02228821 	addu	s1,s1,v0
+   1a934:	40016000 	mfc0	at,c0_status
+   1a938:	00000000 	sll	zero,zero,0x0
+   1a93c:	00011025 	or	v0,zero,at
+   1a940:	00010842 	srl	at,at,0x1
+   1a944:	00010840 	sll	at,at,0x1
+   1a948:	40816000 	mtc0	at,c0_status
+   1a94c:	0c00445e 	jal	11178 <sched_idle>
+   1a950:	02002021 	addu	a0,s0,zero
+   1a954:	0c002083 	jal	820c <__cpu_check_sched>
+   1a958:	02002021 	addu	a0,s0,zero
+   1a95c:	0c00447e 	jal	111f8 <check_sleeping>
+   1a960:	02402021 	addu	a0,s2,zero
+   1a964:	96230000 	lhu	v1,0(s1)
+   1a968:	96620000 	lhu	v0,0(s3)
+   1a96c:	3063ffff 	andi	v1,v1,0xffff
+   1a970:	3042ffff 	andi	v0,v0,0xffff
+   1a974:	40016000 	mfc0	at,c0_status
+   1a978:	00000000 	sll	zero,zero,0x0
+   1a97c:	00012025 	or	a0,zero,at
+   1a980:	34210001 	ori	at,at,0x1
+   1a984:	40816000 	mtc0	at,c0_status
+   1a988:	00000000 	sll	zero,zero,0x0
+   1a98c:	00431021 	addu	v0,v0,v1
+   1a990:	1040ffe8 	beqz	v0,1a934 <thread_idle+0x2a0>
+   1a994:	00000000 	sll	zero,zero,0x0
+   1a998:	0c004636 	jal	118d8 <sched_yield>
+   1a99c:	02002021 	addu	a0,s0,zero
+   1a9a0:	08006a4d 	j	1a934 <thread_idle+0x2a0>
+   1a9a4:	00000000 	sll	zero,zero,0x0
+   1a9a8:	3c050003 	lui	a1,0x3
+   1a9ac:	3c070003 	lui	a3,0x3
+   1a9b0:	24a568b8 	addiu	a1,a1,26808
+   1a9b4:	24e76918 	addiu	a3,a3,26904
+   1a9b8:	24040001 	addiu	a0,zero,1
+   1a9bc:	2406006a 	addiu	a2,zero,106
+   1a9c0:	0c00097d 	jal	25f4 <__perror>
+   1a9c4:	afb30010 	sw	s3,16(sp)
+   1a9c8:	08006a72 	j	1a9c8 <thread_idle+0x334>
+   1a9cc:	00000000 	sll	zero,zero,0x0
+   1a9d0:	8e040180 	lw	a0,384(s0)
+   1a9d4:	8e270000 	lw	a3,0(s1)
+   1a9d8:	24a57734 	addiu	a1,a1,30516
+   1a9dc:	0c002eaf 	jal	babc <kthread_create>
+   1a9e0:	00003021 	addu	a2,zero,zero
+   1a9e4:	10400036 	beqz	v0,1aac0 <thread_idle+0x42c>
+   1a9e8:	00409021 	addu	s2,v0,zero
+   1a9ec:	8e030180 	lw	v1,384(s0)
+   1a9f0:	24420284 	addiu	v0,v0,644
+   1a9f4:	ae430180 	sw	v1,384(s2)
+   1a9f8:	3c030003 	lui	v1,0x3
+   1a9fc:	24636a14 	addiu	v1,v1,27156
+   1aa00:	ae43027c 	sw	v1,636(s2)
+   1aa04:	02402021 	addu	a0,s2,zero
+   1aa08:	ae420288 	sw	v0,648(s2)
+   1aa0c:	ae400280 	sw	zero,640(s2)
+   1aa10:	0c004715 	jal	11c54 <sched_register>
+   1aa14:	ae420284 	sw	v0,644(s2)
+   1aa18:	0c0046cb 	jal	11b2c <sched_add_created>
+   1aa1c:	02402021 	addu	a0,s2,zero
+   1aa20:	3c020004 	lui	v0,0x4
+   1aa24:	8c449100 	lw	a0,-28416(v0)
+   1aa28:	3c060003 	lui	a2,0x3
+   1aa2c:	24c66a1c 	addiu	a2,a2,27164
+   1aa30:	02603821 	addu	a3,s3,zero
+   1aa34:	0c0009b0 	jal	26c0 <__fprintk>
+   1aa38:	00002821 	addu	a1,zero,zero
+   1aa3c:	08006a31 	j	1a8c4 <thread_idle+0x230>
+   1aa40:	00000000 	sll	zero,zero,0x0
+   1aa44:	8e570000 	lw	s7,0(s2)
+   1aa48:	8e420004 	lw	v0,4(s2)
+   1aa4c:	02e2102b 	sltu	v0,s7,v0
+   1aa50:	1040ff51 	beqz	v0,1a798 <thread_idle+0x104>
+   1aa54:	02e02821 	addu	a1,s7,zero
+   1aa58:	8e9e8328 	lw	s8,-31960(s4)
+   1aa5c:	26f71000 	addiu	s7,s7,4096
+   1aa60:	27de00b0 	addiu	s8,s8,176
+   1aa64:	0c007c4f 	jal	1f13c <ppm_vma2ppn>
+   1aa68:	03c02021 	addu	a0,s8,zero
+   1aa6c:	00402821 	addu	a1,v0,zero
+   1aa70:	0c007c41 	jal	1f104 <ppm_ppn2page>
+   1aa74:	03c02021 	addu	a0,s8,zero
+   1aa78:	00402021 	addu	a0,v0,zero
+   1aa7c:	24050001 	addiu	a1,zero,1
+   1aa80:	0c007a9f 	jal	1ea7c <page_state_set>
+   1aa84:	afa20020 	sw	v0,32(sp)
+   1aa88:	8fa20020 	lw	v0,32(sp)
+   1aa8c:	0c007d65 	jal	1f594 <ppm_free_pages>
+   1aa90:	00402021 	addu	a0,v0,zero
+   1aa94:	08006a93 	j	1aa4c <thread_idle+0x3b8>
+   1aa98:	8e420004 	lw	v0,4(s2)
+   1aa9c:	3c070003 	lui	a3,0x3
+   1aaa0:	24a56934 	addiu	a1,a1,26932
+   1aaa4:	24e76918 	addiu	a3,a3,26904
+   1aaa8:	24040001 	addiu	a0,zero,1
+   1aaac:	2406007d 	addiu	a2,zero,125
+   1aab0:	0c00097d 	jal	25f4 <__perror>
+   1aab4:	afb30010 	sw	s3,16(sp)
+   1aab8:	08006aae 	j	1aab8 <thread_idle+0x424>
+   1aabc:	00000000 	sll	zero,zero,0x0
+   1aac0:	3c020001 	lui	v0,0x1
+   1aac4:	02221021 	addu	v0,s1,v0
+   1aac8:	8c428328 	lw	v0,-31960(v0)
+   1aacc:	3c050003 	lui	a1,0x3
+   1aad0:	8c420400 	lw	v0,1024(v0)
+   1aad4:	3c070003 	lui	a3,0x3
+   1aad8:	afa20010 	sw	v0,16(sp)
+   1aadc:	8e220004 	lw	v0,4(s1)
+   1aae0:	24a569c0 	addiu	a1,a1,27072
+   1aae4:	24e76918 	addiu	a3,a3,26904
+   1aae8:	24040001 	addiu	a0,zero,1
+   1aaec:	240600ab 	addiu	a2,zero,171
+   1aaf0:	0c00097d 	jal	25f4 <__perror>
+   1aaf4:	afa20014 	sw	v0,20(sp)
+   1aaf8:	08006abe 	j	1aaf8 <thread_idle+0x464>
+   1aafc:	00000000 	sll	zero,zero,0x0
+
+0001ab00 <do_migrate>:
+   1ab00:	27bdffb8 	addiu	sp,sp,-72
+   1ab04:	afb40030 	sw	s4,48(sp)
+   1ab08:	afb20028 	sw	s2,40(sp)
+   1ab0c:	afb00020 	sw	s0,32(sp)
+   1ab10:	afbf0044 	sw	ra,68(sp)
+   1ab14:	afbe0040 	sw	s8,64(sp)
+   1ab18:	afb7003c 	sw	s7,60(sp)
+   1ab1c:	afb60038 	sw	s6,56(sp)
+   1ab20:	afb50034 	sw	s5,52(sp)
+   1ab24:	afb3002c 	sw	s3,44(sp)
+   1ab28:	afb10024 	sw	s1,36(sp)
+   1ab2c:	8c940008 	lw	s4,8(a0)
+   1ab30:	8c900004 	lw	s0,4(a0)
+   1ab34:	00809021 	addu	s2,a0,zero
+   1ab38:	40022002 	mfc0	v0,$4,2
+   1ab3c:	8c510174 	lw	s1,372(v0)
+   1ab40:	3c130001 	lui	s3,0x1
+   1ab44:	02339821 	addu	s3,s1,s3
+   1ab48:	8e628328 	lw	v0,-31960(s3)
+   1ab4c:	8e250000 	lw	a1,0(s1)
+   1ab50:	8c440400 	lw	a0,1024(v0)
+   1ab54:	0c0028ea 	jal	a3a8 <dqdt_update_threads_number>
+   1ab58:	24060001 	addiu	a2,zero,1
+   1ab5c:	3c020011 	lui	v0,0x11
+   1ab60:	34420020 	ori	v0,v0,0x20
+   1ab64:	27a40010 	addiu	a0,sp,16
+   1ab68:	afa20018 	sw	v0,24(sp)
+   1ab6c:	afa00010 	sw	zero,16(sp)
+   1ab70:	0c00713f 	jal	1c4fc <kmem_alloc>
+   1ab74:	afa00014 	sw	zero,20(sp)
+   1ab78:	10400064 	beqz	v0,1ad0c <do_migrate+0x20c>
+   1ab7c:	0040b021 	addu	s6,v0,zero
+   1ab80:	00402021 	addu	a0,v0,zero
+   1ab84:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1ab88:	269700a0 	addiu	s7,s4,160
+   1ab8c:	261e0120 	addiu	s8,s0,288
+   1ab90:	02e02021 	addu	a0,s7,zero
+   1ab94:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1ab98:	0040a821 	addu	s5,v0,zero
+   1ab9c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1aba0:	03c02021 	addu	a0,s8,zero
+   1aba4:	8e050388 	lw	a1,904(s0)
+   1aba8:	0c007a47 	jal	1e91c <page_copy>
+   1abac:	02c02021 	addu	a0,s6,zero
+   1abb0:	8e628328 	lw	v0,-31960(s3)
+   1abb4:	8e44000c 	lw	a0,12(s2)
+   1abb8:	8c430400 	lw	v1,1024(v0)
+   1abbc:	8e220004 	lw	v0,4(s1)
+   1abc0:	8ea50308 	lw	a1,776(s5)
+   1abc4:	a6a30150 	sh	v1,336(s5)
+   1abc8:	aea40268 	sw	a0,616(s5)
+   1abcc:	aea20154 	sw	v0,340(s5)
+   1abd0:	02a02021 	addu	a0,s5,zero
+   1abd4:	0c0044e0 	jal	11380 <sched_setpolicy>
+   1abd8:	aeb10174 	sw	s1,372(s5)
+   1abdc:	0c004715 	jal	11c54 <sched_register>
+   1abe0:	02a02021 	addu	a0,s5,zero
+   1abe4:	8e820748 	lw	v0,1864(s4)
+   1abe8:	26a301f0 	addiu	v1,s5,496
+   1abec:	8c440000 	lw	a0,0(v0)
+   1abf0:	aea201f4 	sw	v0,500(s5)
+   1abf4:	aea401f0 	sw	a0,496(s5)
+   1abf8:	ac830004 	sw	v1,4(a0)
+   1abfc:	ac430000 	sw	v1,0(v0)
+   1ac00:	8e658328 	lw	a1,-31960(s3)
+   1ac04:	8e220000 	lw	v0,0(s1)
+   1ac08:	8e0301f0 	lw	v1,496(s0)
+   1ac0c:	8e0401f4 	lw	a0,500(s0)
+   1ac10:	8ea902f8 	lw	t1,760(s5)
+   1ac14:	8ca80400 	lw	t0,1024(a1)
+   1ac18:	ac830000 	sw	v1,0(a0)
+   1ac1c:	aea2033c 	sw	v0,828(s5)
+   1ac20:	8e850740 	lw	a1,1856(s4)
+   1ac24:	8e270004 	lw	a3,4(s1)
+   1ac28:	00094880 	sll	t1,t1,0x2
+   1ac2c:	8e06027c 	lw	a2,636(s0)
+   1ac30:	8e020284 	lw	v0,644(s0)
+   1ac34:	00a94821 	addu	t1,a1,t1
+   1ac38:	26050284 	addiu	a1,s0,644
+   1ac3c:	ac640004 	sw	a0,4(v1)
+   1ac40:	ad350000 	sw	s5,0(t1)
+   1ac44:	a6a80338 	sh	t0,824(s5)
+   1ac48:	aea70340 	sw	a3,832(s5)
+   1ac4c:	aeb60388 	sw	s6,904(s5)
+   1ac50:	aea6027c 	sw	a2,636(s5)
+   1ac54:	aeb50344 	sw	s5,836(s5)
+   1ac58:	aeb5034c 	sw	s5,844(s5)
+   1ac5c:	1045003d 	beq	v0,a1,1ad54 <do_migrate+0x254>
+   1ac60:	aea00280 	sw	zero,640(s5)
+   1ac64:	8e040288 	lw	a0,648(s0)
+   1ac68:	26a30284 	addiu	v1,s5,644
+   1ac6c:	aea20284 	sw	v0,644(s5)
+   1ac70:	aea40288 	sw	a0,648(s5)
+   1ac74:	ac830000 	sw	v1,0(a0)
+   1ac78:	ac430004 	sw	v1,4(v0)
+   1ac7c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1ac80:	03c02021 	addu	a0,s8,zero
+   1ac84:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1ac88:	26a40120 	addiu	a0,s5,288
+   1ac8c:	26b00298 	addiu	s0,s5,664
+   1ac90:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1ac94:	02e02021 	addu	a0,s7,zero
+   1ac98:	02002021 	addu	a0,s0,zero
+   1ac9c:	0c0001cf 	jal	73c <cpu_context_set_tid>
+   1aca0:	02a02821 	addu	a1,s5,zero
+   1aca4:	02002821 	addu	a1,s0,zero
+   1aca8:	0c0001dd 	jal	774 <cpu_context_dup_finlize>
+   1acac:	26a40188 	addiu	a0,s5,392
+   1acb0:	8ea30134 	lw	v1,308(s5)
+   1acb4:	8ea20210 	lw	v0,528(s5)
+   1acb8:	2404feff 	addiu	a0,zero,-257
+   1acbc:	34630200 	ori	v1,v1,0x200
+   1acc0:	00641824 	and	v1,v1,a0
+   1acc4:	24420001 	addiu	v0,v0,1
+   1acc8:	aea20210 	sw	v0,528(s5)
+   1accc:	aea30134 	sw	v1,308(s5)
+   1acd0:	0c0044b2 	jal	112c8 <sched_add>
+   1acd4:	02a02021 	addu	a0,s5,zero
+   1acd8:	8fbf0044 	lw	ra,68(sp)
+   1acdc:	00001021 	addu	v0,zero,zero
+   1ace0:	8fbe0040 	lw	s8,64(sp)
+   1ace4:	8fb7003c 	lw	s7,60(sp)
+   1ace8:	8fb60038 	lw	s6,56(sp)
+   1acec:	8fb50034 	lw	s5,52(sp)
+   1acf0:	8fb40030 	lw	s4,48(sp)
+   1acf4:	8fb3002c 	lw	s3,44(sp)
+   1acf8:	8fb20028 	lw	s2,40(sp)
+   1acfc:	8fb10024 	lw	s1,36(sp)
+   1ad00:	8fb00020 	lw	s0,32(sp)
+   1ad04:	03e00008 	jr	ra
+   1ad08:	27bd0048 	addiu	sp,sp,72
+   1ad0c:	8e628328 	lw	v0,-31960(s3)
+   1ad10:	8e250000 	lw	a1,0(s1)
+   1ad14:	8c440400 	lw	a0,1024(v0)
+   1ad18:	0c0028ea 	jal	a3a8 <dqdt_update_threads_number>
+   1ad1c:	2406ffff 	addiu	a2,zero,-1
+   1ad20:	8fbf0044 	lw	ra,68(sp)
+   1ad24:	2402000c 	addiu	v0,zero,12
+   1ad28:	8fbe0040 	lw	s8,64(sp)
+   1ad2c:	8fb7003c 	lw	s7,60(sp)
+   1ad30:	8fb60038 	lw	s6,56(sp)
+   1ad34:	8fb50034 	lw	s5,52(sp)
+   1ad38:	8fb40030 	lw	s4,48(sp)
+   1ad3c:	8fb3002c 	lw	s3,44(sp)
+   1ad40:	8fb20028 	lw	s2,40(sp)
+   1ad44:	8fb10024 	lw	s1,36(sp)
+   1ad48:	8fb00020 	lw	s0,32(sp)
+   1ad4c:	03e00008 	jr	ra
+   1ad50:	27bd0048 	addiu	sp,sp,72
+   1ad54:	26a20284 	addiu	v0,s5,644
+   1ad58:	aea20288 	sw	v0,648(s5)
+   1ad5c:	08006b1f 	j	1ac7c <do_migrate+0x17c>
+   1ad60:	aea20284 	sw	v0,644(s5)
+
+0001ad64 <thread_migrate>:
+   1ad64:	27bdff50 	addiu	sp,sp,-176
+   1ad68:	afb200a0 	sw	s2,160(sp)
+   1ad6c:	afb00098 	sw	s0,152(sp)
+   1ad70:	afbf00ac 	sw	ra,172(sp)
+   1ad74:	afb400a8 	sw	s4,168(sp)
+   1ad78:	afb300a4 	sw	s3,164(sp)
+   1ad7c:	afb1009c 	sw	s1,156(sp)
+   1ad80:	00808021 	addu	s0,a0,zero
+   1ad84:	8c920180 	lw	s2,384(a0)
+   1ad88:	40022002 	mfc0	v0,$4,2
+   1ad8c:	8c510174 	lw	s1,372(v0)
+   1ad90:	40024800 	mfc0	v0,c0_count
+   1ad94:	00000000 	sll	zero,zero,0x0
+   1ad98:	04a00040 	bltz	a1,1ae9c <thread_migrate+0x138>
+   1ad9c:	3c020001 	lui	v0,0x1
+   1ada0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1ada4:	afa50090 	sw	a1,144(sp)
+   1ada8:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1adac:	00409821 	addu	s3,v0,zero
+   1adb0:	8fa50090 	lw	a1,144(sp)
+   1adb4:	afa00020 	sw	zero,32(sp)
+   1adb8:	00a2001b 	divu	zero,a1,v0
+   1adbc:	004001f4 	teq	v0,zero,0x7
+   1adc0:	00001012 	mflo	v0
+   1adc4:	00b3001b 	divu	zero,a1,s3
+   1adc8:	026001f4 	teq	s3,zero,0x7
+   1adcc:	afa20010 	sw	v0,16(sp)
+   1add0:	00001810 	mfhi	v1
+   1add4:	afa30018 	sw	v1,24(sp)
+   1add8:	40016000 	mfc0	at,c0_status
+   1addc:	00000000 	sll	zero,zero,0x0
+   1ade0:	00019825 	or	s3,zero,at
+   1ade4:	00010842 	srl	at,at,0x1
+   1ade8:	00010840 	sll	at,at,0x1
+   1adec:	40816000 	mtc0	at,c0_status
+   1adf0:	3c140001 	lui	s4,0x1
+   1adf4:	0234a021 	addu	s4,s1,s4
+   1adf8:	8e828324 	lw	v0,-31964(s4)
+   1adfc:	10500084 	beq	v0,s0,1b010 <thread_migrate+0x2ac>
+   1ae00:	00000000 	sll	zero,zero,0x0
+   1ae04:	40016000 	mfc0	at,c0_status
+   1ae08:	340200ff 	ori	v0,zero,0xff
+   1ae0c:	00531024 	and	v0,v0,s3
+   1ae10:	00220825 	or	at,at,v0
+   1ae14:	40816000 	mtc0	at,c0_status
+   1ae18:	0c00cc3b 	jal	330ec <cpu_context_save>
+   1ae1c:	26040298 	addiu	a0,s0,664
+   1ae20:	10400036 	beqz	v0,1aefc <thread_migrate+0x198>
+   1ae24:	24020001 	addiu	v0,zero,1
+   1ae28:	8e43062c 	lw	v1,1580(s2)
+   1ae2c:	1062000a 	beq	v1,v0,1ae58 <thread_migrate+0xf4>
+   1ae30:	3c020001 	lui	v0,0x1
+   1ae34:	00001021 	addu	v0,zero,zero
+   1ae38:	8fbf00ac 	lw	ra,172(sp)
+   1ae3c:	8fb400a8 	lw	s4,168(sp)
+   1ae40:	8fb300a4 	lw	s3,164(sp)
+   1ae44:	8fb200a0 	lw	s2,160(sp)
+   1ae48:	8fb1009c 	lw	s1,156(sp)
+   1ae4c:	8fb00098 	lw	s0,152(sp)
+   1ae50:	03e00008 	jr	ra
+   1ae54:	27bd00b0 	addiu	sp,sp,176
+   1ae58:	02228821 	addu	s1,s1,v0
+   1ae5c:	8e228328 	lw	v0,-31960(s1)
+   1ae60:	3c030004 	lui	v1,0x4
+   1ae64:	8c6371b0 	lw	v1,29104(v1)
+   1ae68:	8c420400 	lw	v0,1024(v0)
+   1ae6c:	1062fff2 	beq	v1,v0,1ae38 <thread_migrate+0xd4>
+   1ae70:	00001021 	addu	v0,zero,zero
+   1ae74:	8e020304 	lw	v0,772(s0)
+   1ae78:	30420040 	andi	v0,v0,0x40
+   1ae7c:	1040ffed 	beqz	v0,1ae34 <thread_migrate+0xd0>
+   1ae80:	00000000 	sll	zero,zero,0x0
+   1ae84:	8e4502c4 	lw	a1,708(s2)
+   1ae88:	26440180 	addiu	a0,s2,384
+   1ae8c:	0c008212 	jal	20848 <vmm_set_auto_migrate>
+   1ae90:	24060001 	addiu	a2,zero,1
+   1ae94:	08006b8e 	j	1ae38 <thread_migrate+0xd4>
+   1ae98:	00001021 	addu	v0,zero,zero
+   1ae9c:	02221021 	addu	v0,s1,v0
+   1aea0:	8c438328 	lw	v1,-31960(v0)
+   1aea4:	27a50010 	addiu	a1,sp,16
+   1aea8:	8c640090 	lw	a0,144(v1)
+   1aeac:	2402ffff 	addiu	v0,zero,-1
+   1aeb0:	afa20018 	sw	v0,24(sp)
+   1aeb4:	afa20010 	sw	v0,16(sp)
+   1aeb8:	afa00030 	sw	zero,48(sp)
+   1aebc:	0c002901 	jal	a404 <dqdt_thread_migrate>
+   1aec0:	afa0001c 	sw	zero,28(sp)
+   1aec4:	10400046 	beqz	v0,1afe0 <thread_migrate+0x27c>
+   1aec8:	8fa30018 	lw	v1,24(sp)
+   1aecc:	8e03020c 	lw	v1,524(s0)
+   1aed0:	8fbf00ac 	lw	ra,172(sp)
+   1aed4:	24630001 	addiu	v1,v1,1
+   1aed8:	2402000b 	addiu	v0,zero,11
+   1aedc:	ae03020c 	sw	v1,524(s0)
+   1aee0:	8fb400a8 	lw	s4,168(sp)
+   1aee4:	8fb300a4 	lw	s3,164(sp)
+   1aee8:	8fb200a0 	lw	s2,160(sp)
+   1aeec:	8fb1009c 	lw	s1,156(sp)
+   1aef0:	8fb00098 	lw	s0,152(sp)
+   1aef4:	03e00008 	jr	ra
+   1aef8:	27bd00b0 	addiu	sp,sp,176
+   1aefc:	27a2003c 	addiu	v0,sp,60
+   1af00:	afa20060 	sw	v0,96(sp)
+   1af04:	3c020002 	lui	v0,0x2
+   1af08:	2442b034 	addiu	v0,v0,-20428
+   1af0c:	afa2005c 	sw	v0,92(sp)
+   1af10:	24020004 	addiu	v0,zero,4
+   1af14:	afa20058 	sw	v0,88(sp)
+   1af18:	afb20044 	sw	s2,68(sp)
+   1af1c:	afb10048 	sw	s1,72(sp)
+   1af20:	afb00040 	sw	s0,64(sp)
+   1af24:	40016000 	mfc0	at,c0_status
+   1af28:	00000000 	sll	zero,zero,0x0
+   1af2c:	00011825 	or	v1,zero,at
+   1af30:	00010842 	srl	at,at,0x1
+   1af34:	00010840 	sll	at,at,0x1
+   1af38:	40816000 	mtc0	at,c0_status
+   1af3c:	8e020134 	lw	v0,308(s0)
+   1af40:	34420100 	ori	v0,v0,0x100
+   1af44:	ae020134 	sw	v0,308(s0)
+   1af48:	40016000 	mfc0	at,c0_status
+   1af4c:	340200ff 	ori	v0,zero,0xff
+   1af50:	00431024 	and	v0,v0,v1
+   1af54:	00220825 	or	at,at,v0
+   1af58:	40816000 	mtc0	at,c0_status
+   1af5c:	8fb20010 	lw	s2,16(sp)
+   1af60:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1af64:	8fb10018 	lw	s1,24(sp)
+   1af68:	70521802 	mul	v1,v0,s2
+   1af6c:	27a40058 	addiu	a0,sp,88
+   1af70:	0c0029e6 	jal	a798 <event_send>
+   1af74:	00712821 	addu	a1,v1,s1
+   1af78:	0c004634 	jal	118d0 <sched_sleep>
+   1af7c:	02002021 	addu	a0,s0,zero
+   1af80:	8fa2003c 	lw	v0,60(sp)
+   1af84:	1040000f 	beqz	v0,1afc4 <thread_migrate+0x260>
+   1af88:	8fbf00ac 	lw	ra,172(sp)
+   1af8c:	8e03020c 	lw	v1,524(s0)
+   1af90:	8e050134 	lw	a1,308(s0)
+   1af94:	2404feff 	addiu	a0,zero,-257
+   1af98:	00a42024 	and	a0,a1,a0
+   1af9c:	24630001 	addiu	v1,v1,1
+   1afa0:	ae040134 	sw	a0,308(s0)
+   1afa4:	ae03020c 	sw	v1,524(s0)
+   1afa8:	8fb400a8 	lw	s4,168(sp)
+   1afac:	8fb300a4 	lw	s3,164(sp)
+   1afb0:	8fb200a0 	lw	s2,160(sp)
+   1afb4:	8fb1009c 	lw	s1,156(sp)
+   1afb8:	8fb00098 	lw	s0,152(sp)
+   1afbc:	03e00008 	jr	ra
+   1afc0:	27bd00b0 	addiu	sp,sp,176
+   1afc4:	40034800 	mfc0	v1,c0_count
+   1afc8:	00000000 	sll	zero,zero,0x0
+   1afcc:	02002021 	addu	a0,s0,zero
+   1afd0:	0c00469a 	jal	11a68 <sched_remove>
+   1afd4:	afa20090 	sw	v0,144(sp)
+   1afd8:	08006b8e 	j	1ae38 <thread_migrate+0xd4>
+   1afdc:	8fa20090 	lw	v0,144(sp)
+   1afe0:	8e220000 	lw	v0,0(s1)
+   1afe4:	1462ff7c 	bne	v1,v0,1add8 <thread_migrate+0x74>
+   1afe8:	3c020004 	lui	v0,0x4
+   1afec:	2443c960 	addiu	v1,v0,-13984
+   1aff0:	88630003 	lwl	v1,3(v1)
+   1aff4:	9843c960 	lwr	v1,-13984(v0)
+   1aff8:	8fa20010 	lw	v0,16(sp)
+   1affc:	3063ffff 	andi	v1,v1,0xffff
+   1b000:	1443ff75 	bne	v0,v1,1add8 <thread_migrate+0x74>
+   1b004:	00000000 	sll	zero,zero,0x0
+   1b008:	08006bb4 	j	1aed0 <thread_migrate+0x16c>
+   1b00c:	8e03020c 	lw	v1,524(s0)
+   1b010:	0c00cc61 	jal	33184 <cpu_fpu_context_save>
+   1b014:	02002021 	addu	a0,s0,zero
+   1b018:	ae808324 	sw	zero,-31964(s4)
+   1b01c:	3c1bdfff 	lui	k1,0xdfff
+   1b020:	377bffff 	ori	k1,k1,0xffff
+   1b024:	40016000 	mfc0	at,c0_status
+   1b028:	003bd824 	and	k1,at,k1
+   1b02c:	08006b81 	j	1ae04 <thread_migrate+0xa0>
+   1b030:	409b6000 	mtc0	k1,c0_status
+
+0001b034 <migrate_event_handler>:
+   1b034:	27bdff90 	addiu	sp,sp,-112
+   1b038:	afbf006c 	sw	ra,108(sp)
+   1b03c:	afb10068 	sw	s1,104(sp)
+   1b040:	afb00064 	sw	s0,100(sp)
+   1b044:	40114800 	mfc0	s1,c0_count
+   1b048:	00000000 	sll	zero,zero,0x0
+   1b04c:	8c900008 	lw	s0,8(a0)
+   1b050:	8e040004 	lw	a0,4(s0)
+   1b054:	8e030008 	lw	v1,8(s0)
+   1b058:	8e02000c 	lw	v0,12(s0)
+   1b05c:	afa40014 	sw	a0,20(sp)
+   1b060:	afa30018 	sw	v1,24(sp)
+   1b064:	afa2001c 	sw	v0,28(sp)
+   1b068:	0000000f 	sync
+   1b06c:	0c006ac0 	jal	1ab00 <do_migrate>
+   1b070:	27a40010 	addiu	a0,sp,16
+   1b074:	40034800 	mfc0	v1,c0_count
+   1b078:	00000000 	sll	zero,zero,0x0
+   1b07c:	00718823 	subu	s1,v1,s1
+   1b080:	ae110018 	sw	s1,24(s0)
+   1b084:	ae020000 	sw	v0,0(s0)
+   1b088:	0000000f 	sync
+   1b08c:	0c0044a3 	jal	1128c <sched_wakeup>
+   1b090:	8fa40014 	lw	a0,20(sp)
+   1b094:	8fbf006c 	lw	ra,108(sp)
+   1b098:	00001021 	addu	v0,zero,zero
+   1b09c:	8fb10068 	lw	s1,104(sp)
+   1b0a0:	8fb00064 	lw	s0,100(sp)
+   1b0a4:	03e00008 	jr	ra
+   1b0a8:	27bd0070 	addiu	sp,sp,112
+
+0001b0ac <alarm_wait>:
+   1b0ac:	40022002 	mfc0	v0,$4,2
+   1b0b0:	8c490174 	lw	t1,372(v0)
+   1b0b4:	40016000 	mfc0	at,c0_status
+   1b0b8:	00000000 	sll	zero,zero,0x0
+   1b0bc:	00011825 	or	v1,zero,at
+   1b0c0:	00010842 	srl	at,at,0x1
+   1b0c4:	00010840 	sll	at,at,0x1
+   1b0c8:	40816000 	mtc0	at,c0_status
+   1b0cc:	8d220034 	lw	v0,52(t1)
+   1b0d0:	8d260050 	lw	a2,80(t1)
+   1b0d4:	00a22821 	addu	a1,a1,v0
+   1b0d8:	3c02af5f 	lui	v0,0xaf5f
+   1b0dc:	3442abe5 	ori	v0,v0,0xabe5
+   1b0e0:	25280050 	addiu	t0,t1,80
+   1b0e4:	ac820000 	sw	v0,0(a0)
+   1b0e8:	1106001f 	beq	t0,a2,1b168 <alarm_wait+0xbc>
+   1b0ec:	ac850008 	sw	a1,8(a0)
+   1b0f0:	8cc7fffc 	lw	a3,-4(a2)
+   1b0f4:	00e5382b 	sltu	a3,a3,a1
+   1b0f8:	14e00008 	bnez	a3,1b11c <alarm_wait+0x70>
+   1b0fc:	8cc20000 	lw	v0,0(a2)
+   1b100:	08006c4a 	j	1b128 <alarm_wait+0x7c>
+   1b104:	8cc20004 	lw	v0,4(a2)
+   1b108:	8c47fffc 	lw	a3,-4(v0)
+   1b10c:	00e5382b 	sltu	a3,a3,a1
+   1b110:	10e00012 	beqz	a3,1b15c <alarm_wait+0xb0>
+   1b114:	00000000 	sll	zero,zero,0x0
+   1b118:	00c01021 	addu	v0,a2,zero
+   1b11c:	1502fffa 	bne	t0,v0,1b108 <alarm_wait+0x5c>
+   1b120:	8c460000 	lw	a2,0(v0)
+   1b124:	8d220054 	lw	v0,84(t1)
+   1b128:	8c460000 	lw	a2,0(v0)
+   1b12c:	2485000c 	addiu	a1,a0,12
+   1b130:	ac820010 	sw	v0,16(a0)
+   1b134:	ac86000c 	sw	a2,12(a0)
+   1b138:	acc50004 	sw	a1,4(a2)
+   1b13c:	ac450000 	sw	a1,0(v0)
+   1b140:	40016000 	mfc0	at,c0_status
+   1b144:	340200ff 	ori	v0,zero,0xff
+   1b148:	00431024 	and	v0,v0,v1
+   1b14c:	00220825 	or	at,at,v0
+   1b150:	40816000 	mtc0	at,c0_status
+   1b154:	03e00008 	jr	ra
+   1b158:	00001021 	addu	v0,zero,zero
+   1b15c:	00403021 	addu	a2,v0,zero
+   1b160:	08006c4a 	j	1b128 <alarm_wait+0x7c>
+   1b164:	8cc20004 	lw	v0,4(a2)
+   1b168:	2482000c 	addiu	v0,a0,12
+   1b16c:	ac880010 	sw	t0,16(a0)
+   1b170:	ac88000c 	sw	t0,12(a0)
+   1b174:	ad220054 	sw	v0,84(t1)
+   1b178:	ad220050 	sw	v0,80(t1)
+   1b17c:	40016000 	mfc0	at,c0_status
+   1b180:	340200ff 	ori	v0,zero,0xff
+   1b184:	00431024 	and	v0,v0,v1
+   1b188:	00220825 	or	at,at,v0
+   1b18c:	40816000 	mtc0	at,c0_status
+   1b190:	03e00008 	jr	ra
+   1b194:	00001021 	addu	v0,zero,zero
+
+0001b198 <alarm_manager_init>:
+   1b198:	ac840004 	sw	a0,4(a0)
+   1b19c:	ac840000 	sw	a0,0(a0)
+   1b1a0:	03e00008 	jr	ra
+   1b1a4:	00001021 	addu	v0,zero,zero
+
+0001b1a8 <tm_create_compute>:
+   1b1a8:	08000d66 	j	3598 <rt_timer_read>
+   1b1ac:	24840228 	addiu	a0,a0,552
+
+0001b1b0 <tm_born_compute>:
+   1b1b0:	27bdffe0 	addiu	sp,sp,-32
+   1b1b4:	afb00018 	sw	s0,24(sp)
+   1b1b8:	00808021 	addu	s0,a0,zero
+   1b1bc:	afbf001c 	sw	ra,28(sp)
+   1b1c0:	0c000d66 	jal	3598 <rt_timer_read>
+   1b1c4:	27a40010 	addiu	a0,sp,16
+   1b1c8:	8fa20010 	lw	v0,16(sp)
+   1b1cc:	8fbf001c 	lw	ra,28(sp)
+   1b1d0:	ae020224 	sw	v0,548(s0)
+   1b1d4:	ae02022c 	sw	v0,556(s0)
+   1b1d8:	ae020220 	sw	v0,544(s0)
+   1b1dc:	8fb00018 	lw	s0,24(sp)
+   1b1e0:	03e00008 	jr	ra
+   1b1e4:	27bd0020 	addiu	sp,sp,32
+
+0001b1e8 <tm_exit_compute>:
+   1b1e8:	27bdffe0 	addiu	sp,sp,-32
+   1b1ec:	afb00018 	sw	s0,24(sp)
+   1b1f0:	00808021 	addu	s0,a0,zero
+   1b1f4:	afbf001c 	sw	ra,28(sp)
+   1b1f8:	0c000d66 	jal	3598 <rt_timer_read>
+   1b1fc:	27a40010 	addiu	a0,sp,16
+   1b200:	8fa30010 	lw	v1,16(sp)
+   1b204:	8e020220 	lw	v0,544(s0)
+   1b208:	8e040250 	lw	a0,592(s0)
+   1b20c:	00621023 	subu	v0,v1,v0
+   1b210:	8e050254 	lw	a1,596(s0)
+   1b214:	00821021 	addu	v0,a0,v0
+   1b218:	0044202b 	sltu	a0,v0,a0
+   1b21c:	8fbf001c 	lw	ra,28(sp)
+   1b220:	00852021 	addu	a0,a0,a1
+   1b224:	ae030230 	sw	v1,560(s0)
+   1b228:	ae020250 	sw	v0,592(s0)
+   1b22c:	ae040254 	sw	a0,596(s0)
+   1b230:	8fb00018 	lw	s0,24(sp)
+   1b234:	03e00008 	jr	ra
+   1b238:	27bd0020 	addiu	sp,sp,32
+
+0001b23c <tm_wait_compute>:
+   1b23c:	8c830184 	lw	v1,388(a0)
+   1b240:	27bdffe0 	addiu	sp,sp,-32
+   1b244:	24020002 	addiu	v0,zero,2
+   1b248:	afb00018 	sw	s0,24(sp)
+   1b24c:	afbf001c 	sw	ra,28(sp)
+   1b250:	1062000f 	beq	v1,v0,1b290 <tm_wait_compute+0x54>
+   1b254:	00808021 	addu	s0,a0,zero
+   1b258:	0c000d66 	jal	3598 <rt_timer_read>
+   1b25c:	27a40010 	addiu	a0,sp,16
+   1b260:	8fa20010 	lw	v0,16(sp)
+   1b264:	8e030220 	lw	v1,544(s0)
+   1b268:	8e040240 	lw	a0,576(s0)
+   1b26c:	00431823 	subu	v1,v0,v1
+   1b270:	00831821 	addu	v1,a0,v1
+   1b274:	8e050244 	lw	a1,580(s0)
+   1b278:	0064202b 	sltu	a0,v1,a0
+   1b27c:	00852021 	addu	a0,a0,a1
+   1b280:	ae020224 	sw	v0,548(s0)
+   1b284:	ae030240 	sw	v1,576(s0)
+   1b288:	ae040244 	sw	a0,580(s0)
+   1b28c:	ae020220 	sw	v0,544(s0)
+   1b290:	8fbf001c 	lw	ra,28(sp)
+   1b294:	8fb00018 	lw	s0,24(sp)
+   1b298:	03e00008 	jr	ra
+   1b29c:	27bd0020 	addiu	sp,sp,32
+
+0001b2a0 <tm_sys_compute>:
+   1b2a0:	27bdffe0 	addiu	sp,sp,-32
+   1b2a4:	afb00018 	sw	s0,24(sp)
+   1b2a8:	00808021 	addu	s0,a0,zero
+   1b2ac:	afbf001c 	sw	ra,28(sp)
+   1b2b0:	0c000d66 	jal	3598 <rt_timer_read>
+   1b2b4:	27a40010 	addiu	a0,sp,16
+   1b2b8:	8fa30010 	lw	v1,16(sp)
+   1b2bc:	8e020220 	lw	v0,544(s0)
+   1b2c0:	8e040250 	lw	a0,592(s0)
+   1b2c4:	00621023 	subu	v0,v1,v0
+   1b2c8:	8e050254 	lw	a1,596(s0)
+   1b2cc:	00821021 	addu	v0,a0,v0
+   1b2d0:	0044202b 	sltu	a0,v0,a0
+   1b2d4:	8fbf001c 	lw	ra,28(sp)
+   1b2d8:	00852021 	addu	a0,a0,a1
+   1b2dc:	ae030220 	sw	v1,544(s0)
+   1b2e0:	ae020250 	sw	v0,592(s0)
+   1b2e4:	ae040254 	sw	a0,596(s0)
+   1b2e8:	8fb00018 	lw	s0,24(sp)
+   1b2ec:	03e00008 	jr	ra
+   1b2f0:	27bd0020 	addiu	sp,sp,32
+
+0001b2f4 <tm_usr_compute>:
+   1b2f4:	27bdffe0 	addiu	sp,sp,-32
+   1b2f8:	afb00018 	sw	s0,24(sp)
+   1b2fc:	00808021 	addu	s0,a0,zero
+   1b300:	afbf001c 	sw	ra,28(sp)
+   1b304:	0c000d66 	jal	3598 <rt_timer_read>
+   1b308:	27a40010 	addiu	a0,sp,16
+   1b30c:	8fa30010 	lw	v1,16(sp)
+   1b310:	8e020220 	lw	v0,544(s0)
+   1b314:	8e040248 	lw	a0,584(s0)
+   1b318:	00621023 	subu	v0,v1,v0
+   1b31c:	8e05024c 	lw	a1,588(s0)
+   1b320:	00821021 	addu	v0,a0,v0
+   1b324:	0044202b 	sltu	a0,v0,a0
+   1b328:	8fbf001c 	lw	ra,28(sp)
+   1b32c:	00852021 	addu	a0,a0,a1
+   1b330:	ae030220 	sw	v1,544(s0)
+   1b334:	ae020248 	sw	v0,584(s0)
+   1b338:	ae04024c 	sw	a0,588(s0)
+   1b33c:	8fb00018 	lw	s0,24(sp)
+   1b340:	03e00008 	jr	ra
+   1b344:	27bd0020 	addiu	sp,sp,32
+
+0001b348 <tm_sleep_compute>:
+   1b348:	8c830184 	lw	v1,388(a0)
+   1b34c:	27bdffe0 	addiu	sp,sp,-32
+   1b350:	24020002 	addiu	v0,zero,2
+   1b354:	afb00018 	sw	s0,24(sp)
+   1b358:	afbf001c 	sw	ra,28(sp)
+   1b35c:	1062000e 	beq	v1,v0,1b398 <tm_sleep_compute+0x50>
+   1b360:	00808021 	addu	s0,a0,zero
+   1b364:	0c000d66 	jal	3598 <rt_timer_read>
+   1b368:	27a40010 	addiu	a0,sp,16
+   1b36c:	8fa30010 	lw	v1,16(sp)
+   1b370:	8e020220 	lw	v0,544(s0)
+   1b374:	8e040238 	lw	a0,568(s0)
+   1b378:	00621023 	subu	v0,v1,v0
+   1b37c:	00821021 	addu	v0,a0,v0
+   1b380:	8e05023c 	lw	a1,572(s0)
+   1b384:	0044202b 	sltu	a0,v0,a0
+   1b388:	00852021 	addu	a0,a0,a1
+   1b38c:	ae030220 	sw	v1,544(s0)
+   1b390:	ae020238 	sw	v0,568(s0)
+   1b394:	ae04023c 	sw	a0,572(s0)
+   1b398:	8fbf001c 	lw	ra,28(sp)
+   1b39c:	8fb00018 	lw	s0,24(sp)
+   1b3a0:	03e00008 	jr	ra
+   1b3a4:	27bd0020 	addiu	sp,sp,32
+
+0001b3a8 <alarm_clock>:
+   1b3a8:	27bdffd8 	addiu	sp,sp,-40
+   1b3ac:	afb10018 	sw	s1,24(sp)
+   1b3b0:	8c910000 	lw	s1,0(a0)
+   1b3b4:	afb30020 	sw	s3,32(sp)
+   1b3b8:	afb2001c 	sw	s2,28(sp)
+   1b3bc:	afb00014 	sw	s0,20(sp)
+   1b3c0:	afbf0024 	sw	ra,36(sp)
+   1b3c4:	00809021 	addu	s2,a0,zero
+   1b3c8:	00a09821 	addu	s3,a1,zero
+   1b3cc:	12240018 	beq	s1,a0,1b430 <alarm_clock+0x88>
+   1b3d0:	8e300000 	lw	s0,0(s1)
+   1b3d4:	2622fff4 	addiu	v0,s1,-12
+   1b3d8:	8c430008 	lw	v1,8(v0)
+   1b3dc:	00a3182b 	sltu	v1,a1,v1
+   1b3e0:	10600007 	beqz	v1,1b400 <alarm_clock+0x58>
+   1b3e4:	8fbf0024 	lw	ra,36(sp)
+   1b3e8:	08006d0e 	j	1b438 <alarm_clock+0x90>
+   1b3ec:	8fb30020 	lw	s3,32(sp)
+   1b3f0:	8c430008 	lw	v1,8(v0)
+   1b3f4:	0263182b 	sltu	v1,s3,v1
+   1b3f8:	1460000e 	bnez	v1,1b434 <alarm_clock+0x8c>
+   1b3fc:	8fbf0024 	lw	ra,36(sp)
+   1b400:	8e230004 	lw	v1,4(s1)
+   1b404:	02008821 	addu	s1,s0,zero
+   1b408:	ae030004 	sw	v1,4(s0)
+   1b40c:	ac700000 	sw	s0,0(v1)
+   1b410:	40032002 	mfc0	v1,$4,2
+   1b414:	8c630174 	lw	v1,372(v1)
+   1b418:	8c440004 	lw	a0,4(v0)
+   1b41c:	0c0029e6 	jal	a798 <event_send>
+   1b420:	8c650004 	lw	a1,4(v1)
+   1b424:	2602fff4 	addiu	v0,s0,-12
+   1b428:	1651fff1 	bne	s2,s1,1b3f0 <alarm_clock+0x48>
+   1b42c:	8e100000 	lw	s0,0(s0)
+   1b430:	8fbf0024 	lw	ra,36(sp)
+   1b434:	8fb30020 	lw	s3,32(sp)
+   1b438:	8fb2001c 	lw	s2,28(sp)
+   1b43c:	8fb10018 	lw	s1,24(sp)
+   1b440:	8fb00014 	lw	s0,20(sp)
+   1b444:	03e00008 	jr	ra
+   1b448:	27bd0028 	addiu	sp,sp,40
+
+0001b44c <wait_on>:
+   1b44c:	40022002 	mfc0	v0,$4,2
+   1b450:	24030001 	addiu	v1,zero,1
+   1b454:	10a3000a 	beq	a1,v1,1b480 <wait_on+0x34>
+   1b458:	ac44028c 	sw	a0,652(v0)
+   1b45c:	8c850008 	lw	a1,8(a0)
+   1b460:	244301e8 	addiu	v1,v0,488
+   1b464:	24860008 	addiu	a2,a0,8
+   1b468:	ac4601ec 	sw	a2,492(v0)
+   1b46c:	ac4501e8 	sw	a1,488(v0)
+   1b470:	aca30004 	sw	v1,4(a1)
+   1b474:	ac830008 	sw	v1,8(a0)
+   1b478:	03e00008 	jr	ra
+   1b47c:	00001021 	addu	v0,zero,zero
+   1b480:	8c83000c 	lw	v1,12(a0)
+   1b484:	244401e8 	addiu	a0,v0,488
+   1b488:	8c650000 	lw	a1,0(v1)
+   1b48c:	ac4301ec 	sw	v1,492(v0)
+   1b490:	ac4501e8 	sw	a1,488(v0)
+   1b494:	aca40004 	sw	a0,4(a1)
+   1b498:	ac640000 	sw	a0,0(v1)
+   1b49c:	03e00008 	jr	ra
+   1b4a0:	00001021 	addu	v0,zero,zero
+
+0001b4a4 <wakeup_all>:
+   1b4a4:	27bdffd8 	addiu	sp,sp,-40
+   1b4a8:	8c820008 	lw	v0,8(a0)
+   1b4ac:	afb1001c 	sw	s1,28(sp)
+   1b4b0:	24910008 	addiu	s1,a0,8
+   1b4b4:	afb00018 	sw	s0,24(sp)
+   1b4b8:	afbf0024 	sw	ra,36(sp)
+   1b4bc:	afb20020 	sw	s2,32(sp)
+   1b4c0:	10510021 	beq	v0,s1,1b548 <wakeup_all+0xa4>
+   1b4c4:	8c500000 	lw	s0,0(v0)
+   1b4c8:	2443fe18 	addiu	v1,v0,-488
+   1b4cc:	8c420004 	lw	v0,4(v0)
+   1b4d0:	8c720390 	lw	s2,912(v1)
+   1b4d4:	ae020004 	sw	v0,4(s0)
+   1b4d8:	ac500000 	sw	s0,0(v0)
+   1b4dc:	3c02deef 	lui	v0,0xdeef
+   1b4e0:	3442baad 	ori	v0,v0,0xbaad
+   1b4e4:	1642001a 	bne	s2,v0,1b550 <wakeup_all+0xac>
+   1b4e8:	00001021 	addu	v0,zero,zero
+   1b4ec:	08006d44 	j	1b510 <wakeup_all+0x6c>
+   1b4f0:	00602021 	addu	a0,v1,zero
+   1b4f4:	8e050004 	lw	a1,4(s0)
+   1b4f8:	8c660390 	lw	a2,912(v1)
+   1b4fc:	ac850004 	sw	a1,4(a0)
+   1b500:	14d20013 	bne	a2,s2,1b550 <wakeup_all+0xac>
+   1b504:	aca40000 	sw	a0,0(a1)
+   1b508:	00808021 	addu	s0,a0,zero
+   1b50c:	00602021 	addu	a0,v1,zero
+   1b510:	ac60028c 	sw	zero,652(v1)
+   1b514:	0c0044a3 	jal	1128c <sched_wakeup>
+   1b518:	afa20010 	sw	v0,16(sp)
+   1b51c:	8fa20010 	lw	v0,16(sp)
+   1b520:	2603fe18 	addiu	v1,s0,-488
+   1b524:	24420001 	addiu	v0,v0,1
+   1b528:	1630fff2 	bne	s1,s0,1b4f4 <wakeup_all+0x50>
+   1b52c:	8e040000 	lw	a0,0(s0)
+   1b530:	8fbf0024 	lw	ra,36(sp)
+   1b534:	8fb20020 	lw	s2,32(sp)
+   1b538:	8fb1001c 	lw	s1,28(sp)
+   1b53c:	8fb00018 	lw	s0,24(sp)
+   1b540:	03e00008 	jr	ra
+   1b544:	27bd0028 	addiu	sp,sp,40
+   1b548:	08006d4c 	j	1b530 <wakeup_all+0x8c>
+   1b54c:	00001021 	addu	v0,zero,zero
+   1b550:	08006d54 	j	1b550 <wakeup_all+0xac>
+   1b554:	00000000 	sll	zero,zero,0x0
+
+0001b558 <wakeup_one>:
+   1b558:	8c820008 	lw	v0,8(a0)
+   1b55c:	27bdffe0 	addiu	sp,sp,-32
+   1b560:	24830008 	addiu	v1,a0,8
+   1b564:	10430014 	beq	v0,v1,1b5b8 <wakeup_one+0x60>
+   1b568:	afbf001c 	sw	ra,28(sp)
+   1b56c:	24030001 	addiu	v1,zero,1
+   1b570:	10a3000e 	beq	a1,v1,1b5ac <wakeup_one+0x54>
+   1b574:	00000000 	sll	zero,zero,0x0
+   1b578:	2442fe18 	addiu	v0,v0,-488
+   1b57c:	8c4401e8 	lw	a0,488(v0)
+   1b580:	8c4301ec 	lw	v1,492(v0)
+   1b584:	ac40028c 	sw	zero,652(v0)
+   1b588:	ac830004 	sw	v1,4(a0)
+   1b58c:	ac640000 	sw	a0,0(v1)
+   1b590:	00402021 	addu	a0,v0,zero
+   1b594:	0c0044a3 	jal	1128c <sched_wakeup>
+   1b598:	afa20010 	sw	v0,16(sp)
+   1b59c:	8fbf001c 	lw	ra,28(sp)
+   1b5a0:	8fa20010 	lw	v0,16(sp)
+   1b5a4:	03e00008 	jr	ra
+   1b5a8:	27bd0020 	addiu	sp,sp,32
+   1b5ac:	8c82000c 	lw	v0,12(a0)
+   1b5b0:	08006d5f 	j	1b57c <wakeup_one+0x24>
+   1b5b4:	2442fe18 	addiu	v0,v0,-488
+   1b5b8:	8fbf001c 	lw	ra,28(sp)
+   1b5bc:	00001021 	addu	v0,zero,zero
+   1b5c0:	03e00008 	jr	ra
+   1b5c4:	27bd0020 	addiu	sp,sp,32
+
+0001b5c8 <heap_manager_free>:
+   1b5c8:	27bdffe0 	addiu	sp,sp,-32
+   1b5cc:	afb20018 	sw	s2,24(sp)
+   1b5d0:	afbf001c 	sw	ra,28(sp)
+   1b5d4:	afb10014 	sw	s1,20(sp)
+   1b5d8:	afb00010 	sw	s0,16(sp)
+   1b5dc:	1080004d 	beqz	a0,1b714 <heap_manager_free+0x14c>
+   1b5e0:	00809021 	addu	s2,a0,zero
+   1b5e4:	2490fff8 	addiu	s0,a0,-8
+   1b5e8:	8a110007 	lwl	s1,7(s0)
+   1b5ec:	9a110004 	lwr	s1,4(s0)
+   1b5f0:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1b5f4:	02202021 	addu	a0,s1,zero
+   1b5f8:	9242fff8 	lbu	v0,-8(s2)
+   1b5fc:	304200fe 	andi	v0,v0,0xfe
+   1b600:	a242fff8 	sb	v0,-8(s2)
+   1b604:	92050001 	lbu	a1,1(s0)
+   1b608:	92040002 	lbu	a0,2(s0)
+   1b60c:	00021042 	srl	v0,v0,0x1
+   1b610:	000529c0 	sll	a1,a1,0x7
+   1b614:	92030003 	lbu	v1,3(s0)
+   1b618:	00a21025 	or	v0,a1,v0
+   1b61c:	000423c0 	sll	a0,a0,0xf
+   1b620:	00821025 	or	v0,a0,v0
+   1b624:	00031dc0 	sll	v1,v1,0x17
+   1b628:	00621825 	or	v1,v1,v0
+   1b62c:	02031021 	addu	v0,s0,v1
+   1b630:	1040002d 	beqz	v0,1b6e8 <heap_manager_free+0x120>
+   1b634:	00000000 	sll	zero,zero,0x0
+   1b638:	8e28001c 	lw	t0,28(s1)
+   1b63c:	0048202b 	sltu	a0,v0,t0
+   1b640:	10800029 	beqz	a0,1b6e8 <heap_manager_free+0x120>
+   1b644:	00000000 	sll	zero,zero,0x0
+   1b648:	90440000 	lbu	a0,0(v0)
+   1b64c:	30840001 	andi	a0,a0,0x1
+   1b650:	14800025 	bnez	a0,1b6e8 <heap_manager_free+0x120>
+   1b654:	3c097fff 	lui	t1,0x7fff
+   1b658:	3529ffff 	ori	t1,t1,0xffff
+   1b65c:	08006d9f 	j	1b67c <heap_manager_free+0xb4>
+   1b660:	92040000 	lbu	a0,0(s0)
+   1b664:	11400020 	beqz	t2,1b6e8 <heap_manager_free+0x120>
+   1b668:	00000000 	sll	zero,zero,0x0
+   1b66c:	90450000 	lbu	a1,0(v0)
+   1b670:	30a50001 	andi	a1,a1,0x1
+   1b674:	14a0001c 	bnez	a1,1b6e8 <heap_manager_free+0x120>
+   1b678:	00000000 	sll	zero,zero,0x0
+   1b67c:	90470000 	lbu	a3,0(v0)
+   1b680:	90460001 	lbu	a2,1(v0)
+   1b684:	90450002 	lbu	a1,2(v0)
+   1b688:	00073842 	srl	a3,a3,0x1
+   1b68c:	90420003 	lbu	v0,3(v0)
+   1b690:	000631c0 	sll	a2,a2,0x7
+   1b694:	00c73025 	or	a2,a2,a3
+   1b698:	00052bc0 	sll	a1,a1,0xf
+   1b69c:	00a62825 	or	a1,a1,a2
+   1b6a0:	000215c0 	sll	v0,v0,0x17
+   1b6a4:	00451025 	or	v0,v0,a1
+   1b6a8:	00621821 	addu	v1,v1,v0
+   1b6ac:	3062007f 	andi	v0,v1,0x7f
+   1b6b0:	00021040 	sll	v0,v0,0x1
+   1b6b4:	00691824 	and	v1,v1,t1
+   1b6b8:	30840001 	andi	a0,a0,0x1
+   1b6bc:	00822025 	or	a0,a0,v0
+   1b6c0:	000339c2 	srl	a3,v1,0x7
+   1b6c4:	02031021 	addu	v0,s0,v1
+   1b6c8:	000333c2 	srl	a2,v1,0xf
+   1b6cc:	00032dc2 	srl	a1,v1,0x17
+   1b6d0:	0048502b 	sltu	t2,v0,t0
+   1b6d4:	a2040000 	sb	a0,0(s0)
+   1b6d8:	a2070001 	sb	a3,1(s0)
+   1b6dc:	a2060002 	sb	a2,2(s0)
+   1b6e0:	1440ffe0 	bnez	v0,1b664 <heap_manager_free+0x9c>
+   1b6e4:	a2050003 	sb	a1,3(s0)
+   1b6e8:	8e220024 	lw	v0,36(s1)
+   1b6ec:	0202102b 	sltu	v0,s0,v0
+   1b6f0:	10400002 	beqz	v0,1b6fc <heap_manager_free+0x134>
+   1b6f4:	02202021 	addu	a0,s1,zero
+   1b6f8:	ae300024 	sw	s0,36(s1)
+   1b6fc:	8fbf001c 	lw	ra,28(sp)
+   1b700:	8fb20018 	lw	s2,24(sp)
+   1b704:	8fb10014 	lw	s1,20(sp)
+   1b708:	8fb00010 	lw	s0,16(sp)
+   1b70c:	08004b0b 	j	12c2c <spinlock_unlock>
+   1b710:	27bd0020 	addiu	sp,sp,32
+   1b714:	8fbf001c 	lw	ra,28(sp)
+   1b718:	8fb20018 	lw	s2,24(sp)
+   1b71c:	8fb10014 	lw	s1,20(sp)
+   1b720:	8fb00010 	lw	s0,16(sp)
+   1b724:	03e00008 	jr	ra
+   1b728:	27bd0020 	addiu	sp,sp,32
+
+0001b72c <heap_manager_malloc>:
+   1b72c:	27bdffe0 	addiu	sp,sp,-32
+   1b730:	afb00010 	sw	s0,16(sp)
+   1b734:	24b00008 	addiu	s0,a1,8
+   1b738:	3202003f 	andi	v0,s0,0x3f
+   1b73c:	afb20018 	sw	s2,24(sp)
+   1b740:	afbf001c 	sw	ra,28(sp)
+   1b744:	afb10014 	sw	s1,20(sp)
+   1b748:	10400004 	beqz	v0,1b75c <heap_manager_malloc+0x30>
+   1b74c:	00809021 	addu	s2,a0,zero
+   1b750:	2402ffc0 	addiu	v0,zero,-64
+   1b754:	02028024 	and	s0,s0,v0
+   1b758:	26100040 	addiu	s0,s0,64
+   1b75c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1b760:	02402021 	addu	a0,s2,zero
+   1b764:	8e44001c 	lw	a0,28(s2)
+   1b768:	8e510024 	lw	s1,36(s2)
+   1b76c:	00901023 	subu	v0,a0,s0
+   1b770:	0051102b 	sltu	v0,v0,s1
+   1b774:	10400015 	beqz	v0,1b7cc <heap_manager_malloc+0xa0>
+   1b778:	00000000 	sll	zero,zero,0x0
+   1b77c:	08006df3 	j	1b7cc <heap_manager_malloc+0xa0>
+   1b780:	8e510018 	lw	s1,24(s2)
+   1b784:	92250000 	lbu	a1,0(s1)
+   1b788:	92260001 	lbu	a2,1(s1)
+   1b78c:	92220002 	lbu	v0,2(s1)
+   1b790:	000631c0 	sll	a2,a2,0x7
+   1b794:	92230003 	lbu	v1,3(s1)
+   1b798:	00053842 	srl	a3,a1,0x1
+   1b79c:	00c73025 	or	a2,a2,a3
+   1b7a0:	000213c0 	sll	v0,v0,0xf
+   1b7a4:	00461025 	or	v0,v0,a2
+   1b7a8:	00031dc0 	sll	v1,v1,0x17
+   1b7ac:	00621825 	or	v1,v1,v0
+   1b7b0:	0070302b 	sltu	a2,v1,s0
+   1b7b4:	10c00028 	beqz	a2,1b858 <heap_manager_malloc+0x12c>
+   1b7b8:	00601021 	addu	v0,v1,zero
+   1b7bc:	02228821 	addu	s1,s1,v0
+   1b7c0:	0224102b 	sltu	v0,s1,a0
+   1b7c4:	10400014 	beqz	v0,1b818 <heap_manager_malloc+0xec>
+   1b7c8:	00000000 	sll	zero,zero,0x0
+   1b7cc:	92220000 	lbu	v0,0(s1)
+   1b7d0:	30420001 	andi	v0,v0,0x1
+   1b7d4:	1040ffeb 	beqz	v0,1b784 <heap_manager_malloc+0x58>
+   1b7d8:	00000000 	sll	zero,zero,0x0
+   1b7dc:	92260000 	lbu	a2,0(s1)
+   1b7e0:	92250001 	lbu	a1,1(s1)
+   1b7e4:	92230002 	lbu	v1,2(s1)
+   1b7e8:	92220003 	lbu	v0,3(s1)
+   1b7ec:	00063042 	srl	a2,a2,0x1
+   1b7f0:	000529c0 	sll	a1,a1,0x7
+   1b7f4:	00a62825 	or	a1,a1,a2
+   1b7f8:	00031bc0 	sll	v1,v1,0xf
+   1b7fc:	00651825 	or	v1,v1,a1
+   1b800:	000215c0 	sll	v0,v0,0x17
+   1b804:	00431025 	or	v0,v0,v1
+   1b808:	02228821 	addu	s1,s1,v0
+   1b80c:	0224102b 	sltu	v0,s1,a0
+   1b810:	1440ffee 	bnez	v0,1b7cc <heap_manager_malloc+0xa0>
+   1b814:	00000000 	sll	zero,zero,0x0
+   1b818:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1b81c:	02402021 	addu	a0,s2,zero
+   1b820:	3c020004 	lui	v0,0x4
+   1b824:	8c449100 	lw	a0,-28416(v0)
+   1b828:	3c060003 	lui	a2,0x3
+   1b82c:	02003821 	addu	a3,s0,zero
+   1b830:	24c66a44 	addiu	a2,a2,27204
+   1b834:	0c0009b0 	jal	26c0 <__fprintk>
+   1b838:	00002821 	addu	a1,zero,zero
+   1b83c:	8fbf001c 	lw	ra,28(sp)
+   1b840:	00001021 	addu	v0,zero,zero
+   1b844:	8fb20018 	lw	s2,24(sp)
+   1b848:	8fb10014 	lw	s1,20(sp)
+   1b84c:	8fb00010 	lw	s0,16(sp)
+   1b850:	03e00008 	jr	ra
+   1b854:	27bd0020 	addiu	sp,sp,32
+   1b858:	00701823 	subu	v1,v1,s0
+   1b85c:	2c620040 	sltiu	v0,v1,64
+   1b860:	14400020 	bnez	v0,1b8e4 <heap_manager_malloc+0x1b8>
+   1b864:	34a50001 	ori	a1,a1,0x1
+   1b868:	3204007f 	andi	a0,s0,0x7f
+   1b86c:	00042040 	sll	a0,a0,0x1
+   1b870:	02301021 	addu	v0,s1,s0
+   1b874:	00033840 	sll	a3,v1,0x1
+   1b878:	00102dc2 	srl	a1,s0,0x17
+   1b87c:	000349c2 	srl	t1,v1,0x7
+   1b880:	000343c2 	srl	t0,v1,0xf
+   1b884:	001031c2 	srl	a2,s0,0x7
+   1b888:	34840001 	ori	a0,a0,0x1
+   1b88c:	00031dc2 	srl	v1,v1,0x17
+   1b890:	001083c2 	srl	s0,s0,0xf
+   1b894:	a0490001 	sb	t1,1(v0)
+   1b898:	a0480002 	sb	t0,2(v0)
+   1b89c:	a0430003 	sb	v1,3(v0)
+   1b8a0:	a0470000 	sb	a3,0(v0)
+   1b8a4:	ae420024 	sw	v0,36(s2)
+   1b8a8:	a2260001 	sb	a2,1(s1)
+   1b8ac:	a2300002 	sb	s0,2(s1)
+   1b8b0:	a2250003 	sb	a1,3(s1)
+   1b8b4:	a2240000 	sb	a0,0(s1)
+   1b8b8:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1b8bc:	02402021 	addu	a0,s2,zero
+   1b8c0:	aa320007 	swl	s2,7(s1)
+   1b8c4:	ba320004 	swr	s2,4(s1)
+   1b8c8:	8fbf001c 	lw	ra,28(sp)
+   1b8cc:	26220008 	addiu	v0,s1,8
+   1b8d0:	8fb20018 	lw	s2,24(sp)
+   1b8d4:	8fb10014 	lw	s1,20(sp)
+   1b8d8:	8fb00010 	lw	s0,16(sp)
+   1b8dc:	03e00008 	jr	ra
+   1b8e0:	27bd0020 	addiu	sp,sp,32
+   1b8e4:	08006e2e 	j	1b8b8 <heap_manager_malloc+0x18c>
+   1b8e8:	a2250000 	sb	a1,0(s1)
+
+0001b8ec <heap_manager_init>:
+   1b8ec:	27bdffd8 	addiu	sp,sp,-40
+   1b8f0:	afb10020 	sw	s1,32(sp)
+   1b8f4:	00a08821 	addu	s1,a1,zero
+   1b8f8:	3c050003 	lui	a1,0x3
+   1b8fc:	24a56a88 	addiu	a1,a1,27272
+   1b900:	afbf0024 	sw	ra,36(sp)
+   1b904:	afb0001c 	sw	s0,28(sp)
+   1b908:	afa60010 	sw	a2,16(sp)
+   1b90c:	00808021 	addu	s0,a0,zero
+   1b910:	0c004a24 	jal	12890 <spinlock_init>
+   1b914:	afa70014 	sw	a3,20(sp)
+   1b918:	8fa60010 	lw	a2,16(sp)
+   1b91c:	8fa70014 	lw	a3,20(sp)
+   1b920:	ae000010 	sw	zero,16(s0)
+   1b924:	00e61023 	subu	v0,a3,a2
+   1b928:	00021840 	sll	v1,v0,0x1
+   1b92c:	000229c2 	srl	a1,v0,0x7
+   1b930:	000223c2 	srl	a0,v0,0xf
+   1b934:	000215c2 	srl	v0,v0,0x17
+   1b938:	a0c20003 	sb	v0,3(a2)
+   1b93c:	a0c50001 	sb	a1,1(a2)
+   1b940:	a0c40002 	sb	a0,2(a2)
+   1b944:	a0c30000 	sb	v1,0(a2)
+   1b948:	8fbf0024 	lw	ra,36(sp)
+   1b94c:	ae110014 	sw	s1,20(s0)
+   1b950:	ae060024 	sw	a2,36(s0)
+   1b954:	ae07001c 	sw	a3,28(s0)
+   1b958:	ae060018 	sw	a2,24(s0)
+   1b95c:	ae060020 	sw	a2,32(s0)
+   1b960:	00001021 	addu	v0,zero,zero
+   1b964:	8fb10020 	lw	s1,32(sp)
+   1b968:	8fb0001c 	lw	s0,28(sp)
+   1b96c:	03e00008 	jr	ra
+   1b970:	27bd0028 	addiu	sp,sp,40
+
+0001b974 <put_block>:
+   1b974:	2402f000 	addiu	v0,zero,-4096
+   1b978:	00a21024 	and	v0,a1,v0
+   1b97c:	8c430010 	lw	v1,16(v0)
+   1b980:	8c860010 	lw	a2,16(a0)
+   1b984:	00a32823 	subu	a1,a1,v1
+   1b988:	00a6001b 	divu	zero,a1,a2
+   1b98c:	00c001f4 	teq	a2,zero,0x7
+   1b990:	90430018 	lbu	v1,24(v0)
+   1b994:	90480019 	lbu	t0,25(v0)
+   1b998:	9046001b 	lbu	a2,27(v0)
+   1b99c:	240b0001 	addiu	t3,zero,1
+   1b9a0:	2508ffff 	addiu	t0,t0,-1
+   1b9a4:	310800ff 	andi	t0,t0,0xff
+   1b9a8:	30c90002 	andi	t1,a2,0x2
+   1b9ac:	a0480019 	sb	t0,25(v0)
+   1b9b0:	00002812 	mflo	a1
+   1b9b4:	00053942 	srl	a3,a1,0x5
+   1b9b8:	00073880 	sll	a3,a3,0x2
+   1b9bc:	00473821 	addu	a3,v0,a3
+   1b9c0:	8cea0000 	lw	t2,0(a3)
+   1b9c4:	00ab5804 	sllv	t3,t3,a1
+   1b9c8:	0065602b 	sltu	t4,v1,a1
+   1b9cc:	006c280b 	movn	a1,v1,t4
+   1b9d0:	016a1825 	or	v1,t3,t2
+   1b9d4:	ace30000 	sw	v1,0(a3)
+   1b9d8:	15200018 	bnez	t1,1ba3c <put_block+0xc8>
+   1b9dc:	a0450018 	sb	a1,24(v0)
+   1b9e0:	30c60001 	andi	a2,a2,0x1
+   1b9e4:	14c00013 	bnez	a2,1ba34 <put_block+0xc0>
+   1b9e8:	00000000 	sll	zero,zero,0x0
+   1b9ec:	15000011 	bnez	t0,1ba34 <put_block+0xc0>
+   1b9f0:	2443001c 	addiu	v1,v0,28
+   1b9f4:	8c46001c 	lw	a2,28(v0)
+   1b9f8:	8c470020 	lw	a3,32(v0)
+   1b9fc:	8c880034 	lw	t0,52(a0)
+   1ba00:	ace60000 	sw	a2,0(a3)
+   1ba04:	8c8a0044 	lw	t2,68(a0)
+   1ba08:	8c85002c 	lw	a1,44(a0)
+   1ba0c:	25080001 	addiu	t0,t0,1
+   1ba10:	254affff 	addiu	t2,t2,-1
+   1ba14:	2489002c 	addiu	t1,a0,44
+   1ba18:	acc70004 	sw	a3,4(a2)
+   1ba1c:	ac45001c 	sw	a1,28(v0)
+   1ba20:	ac490020 	sw	t1,32(v0)
+   1ba24:	ac8a0044 	sw	t2,68(a0)
+   1ba28:	aca30004 	sw	v1,4(a1)
+   1ba2c:	ac880034 	sw	t0,52(a0)
+   1ba30:	ac83002c 	sw	v1,44(a0)
+   1ba34:	03e00008 	jr	ra
+   1ba38:	00001021 	addu	v0,zero,zero
+   1ba3c:	8c47001c 	lw	a3,28(v0)
+   1ba40:	8c450020 	lw	a1,32(v0)
+   1ba44:	30c600fd 	andi	a2,a2,0xfd
+   1ba48:	a046001b 	sb	a2,27(v0)
+   1ba4c:	ace50004 	sw	a1,4(a3)
+   1ba50:	8c830020 	lw	v1,32(a0)
+   1ba54:	aca70000 	sw	a3,0(a1)
+   1ba58:	8c880044 	lw	t0,68(a0)
+   1ba5c:	8c870040 	lw	a3,64(a0)
+   1ba60:	8c660000 	lw	a2,0(v1)
+   1ba64:	2445001c 	addiu	a1,v0,28
+   1ba68:	24e7ffff 	addiu	a3,a3,-1
+   1ba6c:	25080001 	addiu	t0,t0,1
+   1ba70:	ac430020 	sw	v1,32(v0)
+   1ba74:	ac46001c 	sw	a2,28(v0)
+   1ba78:	ac880044 	sw	t0,68(a0)
+   1ba7c:	acc50004 	sw	a1,4(a2)
+   1ba80:	ac870040 	sw	a3,64(a0)
+   1ba84:	ac650000 	sw	a1,0(v1)
+   1ba88:	03e00008 	jr	ra
+   1ba8c:	00001021 	addu	v0,zero,zero
+
+0001ba90 <freelist_release>:
+   1ba90:	27bdffd0 	addiu	sp,sp,-48
+   1ba94:	afb50024 	sw	s5,36(sp)
+   1ba98:	8c95002c 	lw	s5,44(a0)
+   1ba9c:	afb60028 	sw	s6,40(sp)
+   1baa0:	2496002c 	addiu	s6,a0,44
+   1baa4:	afb3001c 	sw	s3,28(sp)
+   1baa8:	afb00010 	sw	s0,16(sp)
+   1baac:	afbf002c 	sw	ra,44(sp)
+   1bab0:	afb40020 	sw	s4,32(sp)
+   1bab4:	afb20018 	sw	s2,24(sp)
+   1bab8:	afb10014 	sw	s1,20(sp)
+   1babc:	00808021 	addu	s0,a0,zero
+   1bac0:	12b6002c 	beq	s5,s6,1bb74 <freelist_release+0xe4>
+   1bac4:	8eb30000 	lw	s3,0(s5)
+   1bac8:	8c820038 	lw	v0,56(a0)
+   1bacc:	8c830034 	lw	v1,52(a0)
+   1bad0:	0043102b 	sltu	v0,v0,v1
+   1bad4:	10400028 	beqz	v0,1bb78 <freelist_release+0xe8>
+   1bad8:	8fbf002c 	lw	ra,44(sp)
+   1badc:	8ea40004 	lw	a0,4(s5)
+   1bae0:	8e02004c 	lw	v0,76(s0)
+   1bae4:	2463ffff 	addiu	v1,v1,-1
+   1bae8:	26b2000c 	addiu	s2,s5,12
+   1baec:	ae640004 	sw	a0,4(s3)
+   1baf0:	ae030034 	sw	v1,52(s0)
+   1baf4:	ac930000 	sw	s3,0(a0)
+   1baf8:	0260a021 	addu	s4,s3,zero
+   1bafc:	10400012 	beqz	v0,1bb48 <freelist_release+0xb8>
+   1bb00:	26b5ffe4 	addiu	s5,s5,-28
+   1bb04:	8e030014 	lw	v1,20(s0)
+   1bb08:	1060000f 	beqz	v1,1bb48 <freelist_release+0xb8>
+   1bb0c:	00000000 	sll	zero,zero,0x0
+   1bb10:	8e050010 	lw	a1,16(s0)
+   1bb14:	08006ec9 	j	1bb24 <freelist_release+0x94>
+   1bb18:	00008821 	addu	s1,zero,zero
+   1bb1c:	8e02004c 	lw	v0,76(s0)
+   1bb20:	8e050010 	lw	a1,16(s0)
+   1bb24:	72251802 	mul	v1,s1,a1
+   1bb28:	02002021 	addu	a0,s0,zero
+   1bb2c:	0040f809 	jalr	v0
+   1bb30:	00722821 	addu	a1,v1,s2
+   1bb34:	8e020014 	lw	v0,20(s0)
+   1bb38:	26310001 	addiu	s1,s1,1
+   1bb3c:	0222102b 	sltu	v0,s1,v0
+   1bb40:	1440fff6 	bnez	v0,1bb1c <freelist_release+0x8c>
+   1bb44:	00000000 	sll	zero,zero,0x0
+   1bb48:	8ea50024 	lw	a1,36(s5)
+   1bb4c:	8e020054 	lw	v0,84(s0)
+   1bb50:	0040f809 	jalr	v0
+   1bb54:	02002021 	addu	a0,s0,zero
+   1bb58:	12d40006 	beq	s6,s4,1bb74 <freelist_release+0xe4>
+   1bb5c:	8e730000 	lw	s3,0(s3)
+   1bb60:	8e030034 	lw	v1,52(s0)
+   1bb64:	8e020038 	lw	v0,56(s0)
+   1bb68:	0043102b 	sltu	v0,v0,v1
+   1bb6c:	1440ffdb 	bnez	v0,1badc <freelist_release+0x4c>
+   1bb70:	0280a821 	addu	s5,s4,zero
+   1bb74:	8fbf002c 	lw	ra,44(sp)
+   1bb78:	8fb60028 	lw	s6,40(sp)
+   1bb7c:	8fb50024 	lw	s5,36(sp)
+   1bb80:	8fb40020 	lw	s4,32(sp)
+   1bb84:	8fb3001c 	lw	s3,28(sp)
+   1bb88:	8fb20018 	lw	s2,24(sp)
+   1bb8c:	8fb10014 	lw	s1,20(sp)
+   1bb90:	8fb00010 	lw	s0,16(sp)
+   1bb94:	03e00008 	jr	ra
+   1bb98:	27bd0030 	addiu	sp,sp,48
+
+0001bb9c <kcm_print>:
+   1bb9c:	27bdffd0 	addiu	sp,sp,-48
+   1bba0:	afb20024 	sw	s2,36(sp)
+   1bba4:	afb10020 	sw	s1,32(sp)
+   1bba8:	00809021 	addu	s2,a0,zero
+   1bbac:	3c110004 	lui	s1,0x4
+   1bbb0:	8e470060 	lw	a3,96(s2)
+   1bbb4:	8e249100 	lw	a0,-28416(s1)
+   1bbb8:	3c060003 	lui	a2,0x3
+   1bbbc:	24c66a94 	addiu	a2,a2,27284
+   1bbc0:	00002821 	addu	a1,zero,zero
+   1bbc4:	afbf002c 	sw	ra,44(sp)
+   1bbc8:	afb0001c 	sw	s0,28(sp)
+   1bbcc:	0c0009b0 	jal	26c0 <__fprintk>
+   1bbd0:	afb30028 	sw	s3,40(sp)
+   1bbd4:	8e470034 	lw	a3,52(s2)
+   1bbd8:	8e420040 	lw	v0,64(s2)
+   1bbdc:	8e249100 	lw	a0,-28416(s1)
+   1bbe0:	3c060003 	lui	a2,0x3
+   1bbe4:	24c66ab4 	addiu	a2,a2,27316
+   1bbe8:	00002821 	addu	a1,zero,zero
+   1bbec:	0c0009b0 	jal	26c0 <__fprintk>
+   1bbf0:	afa20010 	sw	v0,16(sp)
+   1bbf4:	8e249100 	lw	a0,-28416(s1)
+   1bbf8:	3c060003 	lui	a2,0x3
+   1bbfc:	24c66adc 	addiu	a2,a2,27356
+   1bc00:	0c0009b0 	jal	26c0 <__fprintk>
+   1bc04:	00002821 	addu	a1,zero,zero
+   1bc08:	8e42001c 	lw	v0,28(s2)
+   1bc0c:	2652001c 	addiu	s2,s2,28
+   1bc10:	10520010 	beq	v0,s2,1bc54 <kcm_print+0xb8>
+   1bc14:	8c500000 	lw	s0,0(v0)
+   1bc18:	3c130003 	lui	s3,0x3
+   1bc1c:	08006f0a 	j	1bc28 <kcm_print+0x8c>
+   1bc20:	26736af8 	addiu	s3,s3,27384
+   1bc24:	00608021 	addu	s0,v1,zero
+   1bc28:	2442ffe4 	addiu	v0,v0,-28
+   1bc2c:	90470018 	lbu	a3,24(v0)
+   1bc30:	8e249100 	lw	a0,-28416(s1)
+   1bc34:	90420019 	lbu	v0,25(v0)
+   1bc38:	00002821 	addu	a1,zero,zero
+   1bc3c:	02603021 	addu	a2,s3,zero
+   1bc40:	0c0009b0 	jal	26c0 <__fprintk>
+   1bc44:	afa20010 	sw	v0,16(sp)
+   1bc48:	8e030000 	lw	v1,0(s0)
+   1bc4c:	1650fff5 	bne	s2,s0,1bc24 <kcm_print+0x88>
+   1bc50:	02001021 	addu	v0,s0,zero
+   1bc54:	8e249100 	lw	a0,-28416(s1)
+   1bc58:	3c060003 	lui	a2,0x3
+   1bc5c:	8fbf002c 	lw	ra,44(sp)
+   1bc60:	8fb30028 	lw	s3,40(sp)
+   1bc64:	8fb20024 	lw	s2,36(sp)
+   1bc68:	8fb10020 	lw	s1,32(sp)
+   1bc6c:	8fb0001c 	lw	s0,28(sp)
+   1bc70:	24c66b20 	addiu	a2,a2,27424
+   1bc74:	00002821 	addu	a1,zero,zero
+   1bc78:	080009b0 	j	26c0 <__fprintk>
+   1bc7c:	27bd0030 	addiu	sp,sp,48
+
+0001bc80 <kcm_page_free>:
+   1bc80:	08007d65 	j	1f594 <ppm_free_pages>
+   1bc84:	00a02021 	addu	a0,a1,zero
+
+0001bc88 <kcm_page_alloc>:
+   1bc88:	3c040004 	lui	a0,0x4
+   1bc8c:	3c060011 	lui	a2,0x11
+   1bc90:	27bdffe0 	addiu	sp,sp,-32
+   1bc94:	24846e60 	addiu	a0,a0,28256
+   1bc98:	34c60020 	ori	a2,a2,0x20
+   1bc9c:	afb00018 	sw	s0,24(sp)
+   1bca0:	afbf001c 	sw	ra,28(sp)
+   1bca4:	0c007d90 	jal	1f640 <ppm_alloc_pages>
+   1bca8:	00002821 	addu	a1,zero,zero
+   1bcac:	10400006 	beqz	v0,1bcc8 <kcm_page_alloc+0x40>
+   1bcb0:	00408021 	addu	s0,v0,zero
+   1bcb4:	8fbf001c 	lw	ra,28(sp)
+   1bcb8:	02001021 	addu	v0,s0,zero
+   1bcbc:	8fb00018 	lw	s0,24(sp)
+   1bcc0:	03e00008 	jr	ra
+   1bcc4:	27bd0020 	addiu	sp,sp,32
+   1bcc8:	40037801 	mfc0	v1,$15,1
+   1bccc:	3c020004 	lui	v0,0x4
+   1bcd0:	30630003 	andi	v1,v1,0x3
+   1bcd4:	00031880 	sll	v1,v1,0x2
+   1bcd8:	2442c950 	addiu	v0,v0,-14000
+   1bcdc:	00621021 	addu	v0,v1,v0
+   1bce0:	8c470000 	lw	a3,0(v0)
+   1bce4:	3c030004 	lui	v1,0x4
+   1bce8:	3c020004 	lui	v0,0x4
+   1bcec:	8c649100 	lw	a0,-28416(v1)
+   1bcf0:	8c4271b0 	lw	v0,29104(v0)
+   1bcf4:	3c060003 	lui	a2,0x3
+   1bcf8:	24c66b38 	addiu	a2,a2,27448
+   1bcfc:	00002821 	addu	a1,zero,zero
+   1bd00:	0c0009b0 	jal	26c0 <__fprintk>
+   1bd04:	afa20010 	sw	v0,16(sp)
+   1bd08:	08006f2e 	j	1bcb8 <kcm_page_alloc+0x30>
+   1bd0c:	8fbf001c 	lw	ra,28(sp)
+
+0001bd10 <freelist_populate>:
+   1bd10:	27bdffd8 	addiu	sp,sp,-40
+   1bd14:	8c820050 	lw	v0,80(a0)
+   1bd18:	afb10018 	sw	s1,24(sp)
+   1bd1c:	afb00014 	sw	s0,20(sp)
+   1bd20:	afbf0024 	sw	ra,36(sp)
+   1bd24:	afb30020 	sw	s3,32(sp)
+   1bd28:	afb2001c 	sw	s2,28(sp)
+   1bd2c:	0040f809 	jalr	v0
+   1bd30:	00808021 	addu	s0,a0,zero
+   1bd34:	1040003c 	beqz	v0,1be28 <freelist_populate+0x118>
+   1bd38:	00408821 	addu	s1,v0,zero
+   1bd3c:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1bd40:	00402021 	addu	a0,v0,zero
+   1bd44:	8e060014 	lw	a2,20(s0)
+   1bd48:	00409021 	addu	s2,v0,zero
+   1bd4c:	00402021 	addu	a0,v0,zero
+   1bd50:	0c00b8f0 	jal	2e3c0 <bitmap_set_range>
+   1bd54:	00002821 	addu	a1,zero,zero
+   1bd58:	a2400018 	sb	zero,24(s2)
+   1bd5c:	a240001b 	sb	zero,27(s2)
+   1bd60:	a2400019 	sb	zero,25(s2)
+   1bd64:	8e020018 	lw	v0,24(s0)
+   1bd68:	2443ffff 	addiu	v1,v0,-1
+   1bd6c:	30630028 	andi	v1,v1,0x28
+   1bd70:	1460002a 	bnez	v1,1be1c <freelist_populate+0x10c>
+   1bd74:	00029823 	negu	s3,v0
+   1bd78:	24130028 	addiu	s3,zero,40
+   1bd7c:	8e020048 	lw	v0,72(s0)
+   1bd80:	02539821 	addu	s3,s2,s3
+   1bd84:	ae510024 	sw	s1,36(s2)
+   1bd88:	ae530010 	sw	s3,16(s2)
+   1bd8c:	10400011 	beqz	v0,1bdd4 <freelist_populate+0xc4>
+   1bd90:	ae500014 	sw	s0,20(s2)
+   1bd94:	8e030014 	lw	v1,20(s0)
+   1bd98:	1060000e 	beqz	v1,1bdd4 <freelist_populate+0xc4>
+   1bd9c:	00008821 	addu	s1,zero,zero
+   1bda0:	08006f6c 	j	1bdb0 <freelist_populate+0xa0>
+   1bda4:	8e050010 	lw	a1,16(s0)
+   1bda8:	8e020048 	lw	v0,72(s0)
+   1bdac:	8e050010 	lw	a1,16(s0)
+   1bdb0:	72251802 	mul	v1,s1,a1
+   1bdb4:	02002021 	addu	a0,s0,zero
+   1bdb8:	0040f809 	jalr	v0
+   1bdbc:	00732821 	addu	a1,v1,s3
+   1bdc0:	8e020014 	lw	v0,20(s0)
+   1bdc4:	26310001 	addiu	s1,s1,1
+   1bdc8:	0222102b 	sltu	v0,s1,v0
+   1bdcc:	1440fff6 	bnez	v0,1bda8 <freelist_populate+0x98>
+   1bdd0:	00000000 	sll	zero,zero,0x0
+   1bdd4:	8e040034 	lw	a0,52(s0)
+   1bdd8:	8e03002c 	lw	v1,44(s0)
+   1bddc:	8fbf0024 	lw	ra,36(sp)
+   1bde0:	2642001c 	addiu	v0,s2,28
+   1bde4:	2605002c 	addiu	a1,s0,44
+   1bde8:	24840001 	addiu	a0,a0,1
+   1bdec:	ae450020 	sw	a1,32(s2)
+   1bdf0:	ae43001c 	sw	v1,28(s2)
+   1bdf4:	ae040034 	sw	a0,52(s0)
+   1bdf8:	ae02002c 	sw	v0,44(s0)
+   1bdfc:	ac620004 	sw	v0,4(v1)
+   1be00:	8fb30020 	lw	s3,32(sp)
+   1be04:	00001021 	addu	v0,zero,zero
+   1be08:	8fb2001c 	lw	s2,28(sp)
+   1be0c:	8fb10018 	lw	s1,24(sp)
+   1be10:	8fb00014 	lw	s0,20(sp)
+   1be14:	03e00008 	jr	ra
+   1be18:	27bd0028 	addiu	sp,sp,40
+   1be1c:	32730028 	andi	s3,s3,0x28
+   1be20:	08006f5f 	j	1bd7c <freelist_populate+0x6c>
+   1be24:	02629821 	addu	s3,s3,v0
+   1be28:	8fbf0024 	lw	ra,36(sp)
+   1be2c:	2402ffff 	addiu	v0,zero,-1
+   1be30:	8fb30020 	lw	s3,32(sp)
+   1be34:	8fb2001c 	lw	s2,28(sp)
+   1be38:	8fb10018 	lw	s1,24(sp)
+   1be3c:	8fb00014 	lw	s0,20(sp)
+   1be40:	03e00008 	jr	ra
+   1be44:	27bd0028 	addiu	sp,sp,40
+
+0001be48 <freelist_get>:
+   1be48:	8c830034 	lw	v1,52(a0)
+   1be4c:	8c820038 	lw	v0,56(a0)
+   1be50:	27bdffe8 	addiu	sp,sp,-24
+   1be54:	afb00010 	sw	s0,16(sp)
+   1be58:	00808021 	addu	s0,a0,zero
+   1be5c:	0043202b 	sltu	a0,v0,v1
+   1be60:	10800011 	beqz	a0,1bea8 <freelist_get+0x60>
+   1be64:	afbf0014 	sw	ra,20(sp)
+   1be68:	1060001c 	beqz	v1,1bedc <freelist_get+0x94>
+   1be6c:	8fbf0014 	lw	ra,20(sp)
+   1be70:	8e02002c 	lw	v0,44(s0)
+   1be74:	8fbf0014 	lw	ra,20(sp)
+   1be78:	2442ffe4 	addiu	v0,v0,-28
+   1be7c:	8c45001c 	lw	a1,28(v0)
+   1be80:	8c440020 	lw	a0,32(v0)
+   1be84:	2463ffff 	addiu	v1,v1,-1
+   1be88:	ae030034 	sw	v1,52(s0)
+   1be8c:	aca40004 	sw	a0,4(a1)
+   1be90:	8fb00010 	lw	s0,16(sp)
+   1be94:	ac850000 	sw	a1,0(a0)
+   1be98:	03e00008 	jr	ra
+   1be9c:	27bd0018 	addiu	sp,sp,24
+   1bea0:	8e030034 	lw	v1,52(s0)
+   1bea4:	8e020038 	lw	v0,56(s0)
+   1bea8:	8e05003c 	lw	a1,60(s0)
+   1beac:	00451021 	addu	v0,v0,a1
+   1beb0:	00021042 	srl	v0,v0,0x1
+   1beb4:	0062102b 	sltu	v0,v1,v0
+   1beb8:	1040ffeb 	beqz	v0,1be68 <freelist_get+0x20>
+   1bebc:	02002021 	addu	a0,s0,zero
+   1bec0:	0c006f44 	jal	1bd10 <freelist_populate>
+   1bec4:	00000000 	sll	zero,zero,0x0
+   1bec8:	1040fff5 	beqz	v0,1bea0 <freelist_get+0x58>
+   1becc:	00000000 	sll	zero,zero,0x0
+   1bed0:	8e030034 	lw	v1,52(s0)
+   1bed4:	1460ffe6 	bnez	v1,1be70 <freelist_get+0x28>
+   1bed8:	8fbf0014 	lw	ra,20(sp)
+   1bedc:	00001021 	addu	v0,zero,zero
+   1bee0:	8fb00010 	lw	s0,16(sp)
+   1bee4:	03e00008 	jr	ra
+   1bee8:	27bd0018 	addiu	sp,sp,24
+
+0001beec <compute_active_page>:
+   1beec:	27bdffe0 	addiu	sp,sp,-32
+   1bef0:	8c82001c 	lw	v0,28(a0)
+   1bef4:	afb10018 	sw	s1,24(sp)
+   1bef8:	00808821 	addu	s1,a0,zero
+   1befc:	2484001c 	addiu	a0,a0,28
+   1bf00:	afb00014 	sw	s0,20(sp)
+   1bf04:	afbf001c 	sw	ra,28(sp)
+   1bf08:	10440026 	beq	v0,a0,1bfa4 <compute_active_page+0xb8>
+   1bf0c:	2450ffe4 	addiu	s0,v0,-28
+   1bf10:	8e03001c 	lw	v1,28(s0)
+   1bf14:	10830023 	beq	a0,v1,1bfa4 <compute_active_page+0xb8>
+   1bf18:	00000000 	sll	zero,zero,0x0
+   1bf1c:	10600021 	beqz	v1,1bfa4 <compute_active_page+0xb8>
+   1bf20:	2462ffe4 	addiu	v0,v1,-28
+   1bf24:	9205001b 	lbu	a1,27(s0)
+   1bf28:	8e040020 	lw	a0,32(s0)
+   1bf2c:	30a500fe 	andi	a1,a1,0xfe
+   1bf30:	a205001b 	sb	a1,27(s0)
+   1bf34:	8e250044 	lw	a1,68(s1)
+   1bf38:	ac830000 	sw	v1,0(a0)
+   1bf3c:	24a5ffff 	addiu	a1,a1,-1
+   1bf40:	ac640004 	sw	a0,4(v1)
+   1bf44:	ae250044 	sw	a1,68(s1)
+   1bf48:	9204001b 	lbu	a0,27(s0)
+   1bf4c:	2603001c 	addiu	v1,s0,28
+   1bf50:	34840002 	ori	a0,a0,0x2
+   1bf54:	a204001b 	sb	a0,27(s0)
+   1bf58:	8e250040 	lw	a1,64(s1)
+   1bf5c:	8e240024 	lw	a0,36(s1)
+   1bf60:	24a50001 	addiu	a1,a1,1
+   1bf64:	26260024 	addiu	a2,s1,36
+   1bf68:	ae060020 	sw	a2,32(s0)
+   1bf6c:	ae250040 	sw	a1,64(s1)
+   1bf70:	ac830004 	sw	v1,4(a0)
+   1bf74:	ae04001c 	sw	a0,28(s0)
+   1bf78:	ae230024 	sw	v1,36(s1)
+   1bf7c:	9043001b 	lbu	v1,27(v0)
+   1bf80:	00408021 	addu	s0,v0,zero
+   1bf84:	34630001 	ori	v1,v1,0x1
+   1bf88:	a043001b 	sb	v1,27(v0)
+   1bf8c:	8fbf001c 	lw	ra,28(sp)
+   1bf90:	02001021 	addu	v0,s0,zero
+   1bf94:	8fb10018 	lw	s1,24(sp)
+   1bf98:	8fb00014 	lw	s0,20(sp)
+   1bf9c:	03e00008 	jr	ra
+   1bfa0:	27bd0020 	addiu	sp,sp,32
+   1bfa4:	0c006f92 	jal	1be48 <freelist_get>
+   1bfa8:	02202021 	addu	a0,s1,zero
+   1bfac:	1040fff7 	beqz	v0,1bf8c <compute_active_page+0xa0>
+   1bfb0:	2445001c 	addiu	a1,v0,28
+   1bfb4:	8e230020 	lw	v1,32(s1)
+   1bfb8:	8e260044 	lw	a2,68(s1)
+   1bfbc:	8c640000 	lw	a0,0(v1)
+   1bfc0:	ac44001c 	sw	a0,28(v0)
+   1bfc4:	24c60001 	addiu	a2,a2,1
+   1bfc8:	ac650000 	sw	a1,0(v1)
+   1bfcc:	ac430020 	sw	v1,32(v0)
+   1bfd0:	ae260044 	sw	a2,68(s1)
+   1bfd4:	ac850004 	sw	a1,4(a0)
+   1bfd8:	08006fc9 	j	1bf24 <compute_active_page+0x38>
+   1bfdc:	8e03001c 	lw	v1,28(s0)
+
+0001bfe0 <get_block>:
+   1bfe0:	27bdffe0 	addiu	sp,sp,-32
+   1bfe4:	afb10018 	sw	s1,24(sp)
+   1bfe8:	afb00014 	sw	s0,20(sp)
+   1bfec:	afbf001c 	sw	ra,28(sp)
+   1bff0:	00a08021 	addu	s0,a1,zero
+   1bff4:	8c820014 	lw	v0,20(a0)
+   1bff8:	90a50018 	lbu	a1,24(a1)
+   1bffc:	00a2102b 	sltu	v0,a1,v0
+   1c000:	14400007 	bnez	v0,1c020 <get_block+0x40>
+   1c004:	00808821 	addu	s1,a0,zero
+   1c008:	00001021 	addu	v0,zero,zero
+   1c00c:	8fbf001c 	lw	ra,28(sp)
+   1c010:	8fb10018 	lw	s1,24(sp)
+   1c014:	8fb00014 	lw	s0,20(sp)
+   1c018:	03e00008 	jr	ra
+   1c01c:	27bd0020 	addiu	sp,sp,32
+   1c020:	02002021 	addu	a0,s0,zero
+   1c024:	0c00b895 	jal	2e254 <bitmap_ffs2>
+   1c028:	24060010 	addiu	a2,zero,16
+   1c02c:	2403ffff 	addiu	v1,zero,-1
+   1c030:	1043fff5 	beq	v0,v1,1c008 <get_block+0x28>
+   1c034:	00000000 	sll	zero,zero,0x0
+   1c038:	8e230014 	lw	v1,20(s1)
+   1c03c:	0043182b 	sltu	v1,v0,v1
+   1c040:	1060fff1 	beqz	v1,1c008 <get_block+0x28>
+   1c044:	00021942 	srl	v1,v0,0x5
+   1c048:	00031880 	sll	v1,v1,0x2
+   1c04c:	02031821 	addu	v1,s0,v1
+   1c050:	24060001 	addiu	a2,zero,1
+   1c054:	8c650000 	lw	a1,0(v1)
+   1c058:	00463004 	sllv	a2,a2,v0
+   1c05c:	92040019 	lbu	a0,25(s0)
+   1c060:	00063027 	nor	a2,zero,a2
+   1c064:	00c53024 	and	a2,a2,a1
+   1c068:	24840001 	addiu	a0,a0,1
+   1c06c:	24450001 	addiu	a1,v0,1
+   1c070:	ac660000 	sw	a2,0(v1)
+   1c074:	a2050018 	sb	a1,24(s0)
+   1c078:	a2040019 	sb	a0,25(s0)
+   1c07c:	8e240010 	lw	a0,16(s1)
+   1c080:	8e030010 	lw	v1,16(s0)
+   1c084:	70442802 	mul	a1,v0,a0
+   1c088:	08007003 	j	1c00c <get_block+0x2c>
+   1c08c:	00a31021 	addu	v0,a1,v1
+
+0001c090 <kcm_release>:
+   1c090:	27bdffe8 	addiu	sp,sp,-24
+   1c094:	afb00010 	sw	s0,16(sp)
+   1c098:	afbf0014 	sw	ra,20(sp)
+   1c09c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1c0a0:	00808021 	addu	s0,a0,zero
+   1c0a4:	0c006ea4 	jal	1ba90 <freelist_release>
+   1c0a8:	02002021 	addu	a0,s0,zero
+   1c0ac:	02002021 	addu	a0,s0,zero
+   1c0b0:	8fbf0014 	lw	ra,20(sp)
+   1c0b4:	8fb00010 	lw	s0,16(sp)
+   1c0b8:	08004b0b 	j	12c2c <spinlock_unlock>
+   1c0bc:	27bd0018 	addiu	sp,sp,24
+
+0001c0c0 <kcm_free>:
+   1c0c0:	27bdffe0 	addiu	sp,sp,-32
+   1c0c4:	afbf001c 	sw	ra,28(sp)
+   1c0c8:	afb00018 	sw	s0,24(sp)
+   1c0cc:	1080000f 	beqz	a0,1c10c <kcm_free+0x4c>
+   1c0d0:	00802821 	addu	a1,a0,zero
+   1c0d4:	2402f000 	addiu	v0,zero,-4096
+   1c0d8:	00821024 	and	v0,a0,v0
+   1c0dc:	8c500014 	lw	s0,20(v0)
+   1c0e0:	afa50010 	sw	a1,16(sp)
+   1c0e4:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1c0e8:	02002021 	addu	a0,s0,zero
+   1c0ec:	8fa50010 	lw	a1,16(sp)
+   1c0f0:	0c006e5d 	jal	1b974 <put_block>
+   1c0f4:	02002021 	addu	a0,s0,zero
+   1c0f8:	02002021 	addu	a0,s0,zero
+   1c0fc:	8fbf001c 	lw	ra,28(sp)
+   1c100:	8fb00018 	lw	s0,24(sp)
+   1c104:	08004b0b 	j	12c2c <spinlock_unlock>
+   1c108:	27bd0020 	addiu	sp,sp,32
+   1c10c:	8fbf001c 	lw	ra,28(sp)
+   1c110:	8fb00018 	lw	s0,24(sp)
+   1c114:	03e00008 	jr	ra
+   1c118:	27bd0020 	addiu	sp,sp,32
+
+0001c11c <kcm_alloc>:
+   1c11c:	27bdffe0 	addiu	sp,sp,-32
+   1c120:	afb00010 	sw	s0,16(sp)
+   1c124:	00808021 	addu	s0,a0,zero
+   1c128:	afbf001c 	sw	ra,28(sp)
+   1c12c:	afb20018 	sw	s2,24(sp)
+   1c130:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1c134:	afb10014 	sw	s1,20(sp)
+   1c138:	8e11001c 	lw	s1,28(s0)
+   1c13c:	02002021 	addu	a0,s0,zero
+   1c140:	2631ffe4 	addiu	s1,s1,-28
+   1c144:	0c006ff8 	jal	1bfe0 <get_block>
+   1c148:	02202821 	addu	a1,s1,zero
+   1c14c:	1040000a 	beqz	v0,1c178 <kcm_alloc+0x5c>
+   1c150:	00409021 	addu	s2,v0,zero
+   1c154:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1c158:	02002021 	addu	a0,s0,zero
+   1c15c:	8fbf001c 	lw	ra,28(sp)
+   1c160:	02401021 	addu	v0,s2,zero
+   1c164:	8fb20018 	lw	s2,24(sp)
+   1c168:	8fb10014 	lw	s1,20(sp)
+   1c16c:	8fb00010 	lw	s0,16(sp)
+   1c170:	03e00008 	jr	ra
+   1c174:	27bd0020 	addiu	sp,sp,32
+   1c178:	0c006fbb 	jal	1beec <compute_active_page>
+   1c17c:	02002021 	addu	a0,s0,zero
+   1c180:	1040fff4 	beqz	v0,1c154 <kcm_alloc+0x38>
+   1c184:	00000000 	sll	zero,zero,0x0
+   1c188:	1222fff2 	beq	s1,v0,1c154 <kcm_alloc+0x38>
+   1c18c:	00402821 	addu	a1,v0,zero
+   1c190:	0c006ff8 	jal	1bfe0 <get_block>
+   1c194:	02002021 	addu	a0,s0,zero
+   1c198:	08007055 	j	1c154 <kcm_alloc+0x38>
+   1c19c:	00409021 	addu	s2,v0,zero
+
+0001c1a0 <kcm_init>:
+   1c1a0:	27bdffd8 	addiu	sp,sp,-40
+   1c1a4:	afb1001c 	sw	s1,28(sp)
+   1c1a8:	00a08821 	addu	s1,a1,zero
+   1c1ac:	3c050003 	lui	a1,0x3
+   1c1b0:	24a549a0 	addiu	a1,a1,18848
+   1c1b4:	afb00018 	sw	s0,24(sp)
+   1c1b8:	afa60010 	sw	a2,16(sp)
+   1c1bc:	00808021 	addu	s0,a0,zero
+   1c1c0:	afa70014 	sw	a3,20(sp)
+   1c1c4:	afbf0024 	sw	ra,36(sp)
+   1c1c8:	0c004a24 	jal	12890 <spinlock_init>
+   1c1cc:	afb20020 	sw	s2,32(sp)
+   1c1d0:	8fa70014 	lw	a3,20(sp)
+   1c1d4:	2402001f 	addiu	v0,zero,31
+   1c1d8:	24e7ffff 	addiu	a3,a3,-1
+   1c1dc:	2ce70020 	sltiu	a3,a3,32
+   1c1e0:	2403003f 	addiu	v1,zero,63
+   1c1e4:	0047180b 	movn	v1,v0,a3
+   1c1e8:	24040020 	addiu	a0,zero,32
+   1c1ec:	24020040 	addiu	v0,zero,64
+   1c1f0:	0087100b 	movn	v0,a0,a3
+   1c1f4:	8fa40038 	lw	a0,56(sp)
+   1c1f8:	8fa60010 	lw	a2,16(sp)
+   1c1fc:	ae040038 	sw	a0,56(s0)
+   1c200:	8fa4003c 	lw	a0,60(sp)
+   1c204:	00661824 	and	v1,v1,a2
+   1c208:	ae04003c 	sw	a0,60(s0)
+   1c20c:	ae000034 	sw	zero,52(s0)
+   1c210:	ae000040 	sw	zero,64(s0)
+   1c214:	ae000044 	sw	zero,68(s0)
+   1c218:	10600004 	beqz	v1,1c22c <kcm_init+0x8c>
+   1c21c:	ae020018 	sw	v0,24(s0)
+   1c220:	00021823 	negu	v1,v0
+   1c224:	00663024 	and	a2,v1,a2
+   1c228:	00c23021 	addu	a2,a2,v0
+   1c22c:	24021000 	addiu	v0,zero,4096
+   1c230:	0046001b 	divu	zero,v0,a2
+   1c234:	00c001f4 	teq	a2,zero,0x7
+   1c238:	8fa50040 	lw	a1,64(sp)
+   1c23c:	26030024 	addiu	v1,s0,36
+   1c240:	ae050048 	sw	a1,72(s0)
+   1c244:	8fa50044 	lw	a1,68(sp)
+   1c248:	ae030028 	sw	v1,40(s0)
+   1c24c:	ae05004c 	sw	a1,76(s0)
+   1c250:	8fa50048 	lw	a1,72(sp)
+   1c254:	ae030024 	sw	v1,36(s0)
+   1c258:	ae050050 	sw	a1,80(s0)
+   1c25c:	8fa5004c 	lw	a1,76(sp)
+   1c260:	2604002c 	addiu	a0,s0,44
+   1c264:	2612001c 	addiu	s2,s0,28
+   1c268:	ae040030 	sw	a0,48(s0)
+   1c26c:	ae04002c 	sw	a0,44(s0)
+   1c270:	ae110060 	sw	s1,96(s0)
+   1c274:	ae050054 	sw	a1,84(s0)
+   1c278:	ae060010 	sw	a2,16(s0)
+   1c27c:	ae12001c 	sw	s2,28(s0)
+   1c280:	ae120020 	sw	s2,32(s0)
+   1c284:	02002021 	addu	a0,s0,zero
+   1c288:	00001010 	mfhi	v0
+   1c28c:	00001812 	mflo	v1
+   1c290:	2c420028 	sltiu	v0,v0,40
+   1c294:	00621023 	subu	v0,v1,v0
+   1c298:	0c006f92 	jal	1be48 <freelist_get>
+   1c29c:	ae020014 	sw	v0,20(s0)
+   1c2a0:	10400015 	beqz	v0,1c2f8 <kcm_init+0x158>
+   1c2a4:	00000000 	sll	zero,zero,0x0
+   1c2a8:	8e04001c 	lw	a0,28(s0)
+   1c2ac:	2443001c 	addiu	v1,v0,28
+   1c2b0:	ac44001c 	sw	a0,28(v0)
+   1c2b4:	ac520020 	sw	s2,32(v0)
+   1c2b8:	ae03001c 	sw	v1,28(s0)
+   1c2bc:	ac830004 	sw	v1,4(a0)
+   1c2c0:	9044001b 	lbu	a0,27(v0)
+   1c2c4:	00001821 	addu	v1,zero,zero
+   1c2c8:	34840001 	ori	a0,a0,0x1
+   1c2cc:	a044001b 	sb	a0,27(v0)
+   1c2d0:	8e020044 	lw	v0,68(s0)
+   1c2d4:	24420001 	addiu	v0,v0,1
+   1c2d8:	ae020044 	sw	v0,68(s0)
+   1c2dc:	8fbf0024 	lw	ra,36(sp)
+   1c2e0:	00601021 	addu	v0,v1,zero
+   1c2e4:	8fb20020 	lw	s2,32(sp)
+   1c2e8:	8fb1001c 	lw	s1,28(sp)
+   1c2ec:	8fb00018 	lw	s0,24(sp)
+   1c2f0:	03e00008 	jr	ra
+   1c2f4:	27bd0028 	addiu	sp,sp,40
+   1c2f8:	0c004a29 	jal	128a4 <spinlock_destroy>
+   1c2fc:	02002021 	addu	a0,s0,zero
+   1c300:	080070b7 	j	1c2dc <kcm_init+0x13c>
+   1c304:	2403ffff 	addiu	v1,zero,-1
+
+0001c308 <kmem_get_kcm>:
+   1c308:	8cc20000 	lw	v0,0(a2)
+   1c30c:	27bdffc0 	addiu	sp,sp,-64
+   1c310:	24030006 	addiu	v1,zero,6
+   1c314:	afb10030 	sw	s1,48(sp)
+   1c318:	afb0002c 	sw	s0,44(sp)
+   1c31c:	afbf003c 	sw	ra,60(sp)
+   1c320:	afb30038 	sw	s3,56(sp)
+   1c324:	afb20034 	sw	s2,52(sp)
+   1c328:	00c08021 	addu	s0,a2,zero
+   1c32c:	10430005 	beq	v0,v1,1c344 <kmem_get_kcm+0x3c>
+   1c330:	00808821 	addu	s1,a0,zero
+   1c334:	8cc20008 	lw	v0,8(a2)
+   1c338:	2c430401 	sltiu	v1,v0,1025
+   1c33c:	10600027 	beqz	v1,1c3dc <kmem_get_kcm+0xd4>
+   1c340:	00000000 	sll	zero,zero,0x0
+   1c344:	262402d0 	addiu	a0,s1,720
+   1c348:	0c007047 	jal	1c11c <kcm_alloc>
+   1c34c:	00002821 	addu	a1,zero,zero
+   1c350:	10400056 	beqz	v0,1c4ac <kmem_get_kcm+0x1a4>
+   1c354:	00409821 	addu	s3,v0,zero
+   1c358:	8e050004 	lw	a1,4(s0)
+   1c35c:	8e060008 	lw	a2,8(s0)
+   1c360:	8e070014 	lw	a3,20(s0)
+   1c364:	8e0b000c 	lw	t3,12(s0)
+   1c368:	8e0a0010 	lw	t2,16(s0)
+   1c36c:	8e090018 	lw	t1,24(s0)
+   1c370:	8e08001c 	lw	t0,28(s0)
+   1c374:	8e230320 	lw	v1,800(s1)
+   1c378:	8e220324 	lw	v0,804(s1)
+   1c37c:	02602021 	addu	a0,s3,zero
+   1c380:	afab0010 	sw	t3,16(sp)
+   1c384:	afaa0014 	sw	t2,20(sp)
+   1c388:	afa90018 	sw	t1,24(sp)
+   1c38c:	afa8001c 	sw	t0,28(sp)
+   1c390:	afa30020 	sw	v1,32(sp)
+   1c394:	0c007068 	jal	1c1a0 <kcm_init>
+   1c398:	afa20024 	sw	v0,36(sp)
+   1c39c:	14400030 	bnez	v0,1c460 <kmem_get_kcm+0x158>
+   1c3a0:	00409021 	addu	s2,v0,zero
+   1c3a4:	8e020000 	lw	v0,0(s0)
+   1c3a8:	244200dc 	addiu	v0,v0,220
+   1c3ac:	00021080 	sll	v0,v0,0x2
+   1c3b0:	02228821 	addu	s1,s1,v0
+   1c3b4:	ae330000 	sw	s3,0(s1)
+   1c3b8:	0000000f 	sync
+   1c3bc:	8fbf003c 	lw	ra,60(sp)
+   1c3c0:	02401021 	addu	v0,s2,zero
+   1c3c4:	8fb30038 	lw	s3,56(sp)
+   1c3c8:	8fb20034 	lw	s2,52(sp)
+   1c3cc:	8fb10030 	lw	s1,48(sp)
+   1c3d0:	8fb0002c 	lw	s0,44(sp)
+   1c3d4:	03e00008 	jr	ra
+   1c3d8:	27bd0040 	addiu	sp,sp,64
+   1c3dc:	40032002 	mfc0	v1,$4,2
+   1c3e0:	40057801 	mfc0	a1,$15,1
+   1c3e4:	3c040004 	lui	a0,0x4
+   1c3e8:	30a50003 	andi	a1,a1,0x3
+   1c3ec:	00052880 	sll	a1,a1,0x2
+   1c3f0:	2484c950 	addiu	a0,a0,-14000
+   1c3f4:	00a42021 	addu	a0,a1,a0
+   1c3f8:	8c840000 	lw	a0,0(a0)
+   1c3fc:	3c070003 	lui	a3,0x3
+   1c400:	afa40010 	sw	a0,16(sp)
+   1c404:	8c650180 	lw	a1,384(v1)
+   1c408:	3c040004 	lui	a0,0x4
+   1c40c:	8ca905c4 	lw	t1,1476(a1)
+   1c410:	8cc80004 	lw	t0,4(a2)
+   1c414:	8c849100 	lw	a0,-28416(a0)
+   1c418:	3c060003 	lui	a2,0x3
+   1c41c:	24c66b70 	addiu	a2,a2,27504
+   1c420:	24e76c58 	addiu	a3,a3,27736
+   1c424:	00002821 	addu	a1,zero,zero
+   1c428:	afa90014 	sw	t1,20(sp)
+   1c42c:	afa30018 	sw	v1,24(sp)
+   1c430:	afa2001c 	sw	v0,28(sp)
+   1c434:	0c0009b0 	jal	26c0 <__fprintk>
+   1c438:	afa80020 	sw	t0,32(sp)
+   1c43c:	8fbf003c 	lw	ra,60(sp)
+   1c440:	24120026 	addiu	s2,zero,38
+   1c444:	02401021 	addu	v0,s2,zero
+   1c448:	8fb30038 	lw	s3,56(sp)
+   1c44c:	8fb20034 	lw	s2,52(sp)
+   1c450:	8fb10030 	lw	s1,48(sp)
+   1c454:	8fb0002c 	lw	s0,44(sp)
+   1c458:	03e00008 	jr	ra
+   1c45c:	27bd0040 	addiu	sp,sp,64
+   1c460:	3c020004 	lui	v0,0x4
+   1c464:	8c449100 	lw	a0,-28416(v0)
+   1c468:	3c060003 	lui	a2,0x3
+   1c46c:	8e020004 	lw	v0,4(s0)
+   1c470:	3c070003 	lui	a3,0x3
+   1c474:	24c66bbc 	addiu	a2,a2,27580
+   1c478:	24e76c58 	addiu	a3,a3,27736
+   1c47c:	00002821 	addu	a1,zero,zero
+   1c480:	afb20014 	sw	s2,20(sp)
+   1c484:	0c0009b0 	jal	26c0 <__fprintk>
+   1c488:	afa20010 	sw	v0,16(sp)
+   1c48c:	8fbf003c 	lw	ra,60(sp)
+   1c490:	02401021 	addu	v0,s2,zero
+   1c494:	8fb30038 	lw	s3,56(sp)
+   1c498:	8fb20034 	lw	s2,52(sp)
+   1c49c:	8fb10030 	lw	s1,48(sp)
+   1c4a0:	8fb0002c 	lw	s0,44(sp)
+   1c4a4:	03e00008 	jr	ra
+   1c4a8:	27bd0040 	addiu	sp,sp,64
+   1c4ac:	8fbf003c 	lw	ra,60(sp)
+   1c4b0:	2412000c 	addiu	s2,zero,12
+   1c4b4:	02401021 	addu	v0,s2,zero
+   1c4b8:	8fb30038 	lw	s3,56(sp)
+   1c4bc:	8fb20034 	lw	s2,52(sp)
+   1c4c0:	8fb10030 	lw	s1,48(sp)
+   1c4c4:	8fb0002c 	lw	s0,44(sp)
+   1c4c8:	03e00008 	jr	ra
+   1c4cc:	27bd0040 	addiu	sp,sp,64
+
+0001c4d0 <kmem_free>:
+   1c4d0:	8c820000 	lw	v0,0(a0)
+   1c4d4:	14400003 	bnez	v0,1c4e4 <kmem_free+0x14>
+   1c4d8:	24030001 	addiu	v1,zero,1
+   1c4dc:	08007d65 	j	1f594 <ppm_free_pages>
+   1c4e0:	8c84000c 	lw	a0,12(a0)
+   1c4e4:	10430003 	beq	v0,v1,1c4f4 <kmem_free+0x24>
+   1c4e8:	00000000 	sll	zero,zero,0x0
+   1c4ec:	08007030 	j	1c0c0 <kcm_free>
+   1c4f0:	8c84000c 	lw	a0,12(a0)
+   1c4f4:	08006d72 	j	1b5c8 <heap_manager_free>
+   1c4f8:	8c84000c 	lw	a0,12(a0)
+
+0001c4fc <kmem_alloc>:
+   1c4fc:	27bdff88 	addiu	sp,sp,-120
+   1c500:	afb0005c 	sw	s0,92(sp)
+   1c504:	8c900008 	lw	s0,8(a0)
+   1c508:	3c020040 	lui	v0,0x40
+   1c50c:	02021024 	and	v0,s0,v0
+   1c510:	afb50070 	sw	s5,112(sp)
+   1c514:	afb20064 	sw	s2,100(sp)
+   1c518:	afb10060 	sw	s1,96(sp)
+   1c51c:	afbf0074 	sw	ra,116(sp)
+   1c520:	afb4006c 	sw	s4,108(sp)
+   1c524:	afb30068 	sw	s3,104(sp)
+   1c528:	0080a821 	addu	s5,a0,zero
+   1c52c:	8c910000 	lw	s1,0(a0)
+   1c530:	10400004 	beqz	v0,1c544 <kmem_alloc+0x48>
+   1c534:	8c920004 	lw	s2,4(a0)
+   1c538:	3c02ffbf 	lui	v0,0xffbf
+   1c53c:	3442ffff 	ori	v0,v0,0xffff
+   1c540:	02028024 	and	s0,s0,v0
+   1c544:	1620002d 	bnez	s1,1c5fc <kmem_alloc+0x100>
+   1c548:	24020001 	addiu	v0,zero,1
+   1c54c:	3c040004 	lui	a0,0x4
+   1c550:	24846e60 	addiu	a0,a0,28256
+   1c554:	02402821 	addu	a1,s2,zero
+   1c558:	0c007d90 	jal	1f640 <ppm_alloc_pages>
+   1c55c:	02003021 	addu	a2,s0,zero
+   1c560:	00409821 	addu	s3,v0,zero
+   1c564:	3c020004 	lui	v0,0x4
+   1c568:	02021024 	and	v0,s0,v0
+   1c56c:	10400006 	beqz	v0,1c588 <kmem_alloc+0x8c>
+   1c570:	3c020004 	lui	v0,0x4
+   1c574:	12600005 	beqz	s3,1c58c <kmem_alloc+0x90>
+   1c578:	24426db0 	addiu	v0,v0,28080
+   1c57c:	0c007a39 	jal	1e8e4 <page_zero>
+   1c580:	02602021 	addu	a0,s3,zero
+   1c584:	3c020004 	lui	v0,0x4
+   1c588:	24426db0 	addiu	v0,v0,28080
+   1c58c:	8c4301ac 	lw	v1,428(v0)
+   1c590:	8c4201a4 	lw	v0,420(v0)
+   1c594:	0043102b 	sltu	v0,v0,v1
+   1c598:	1040000c 	beqz	v0,1c5cc <kmem_alloc+0xd0>
+   1c59c:	3c140004 	lui	s4,0x4
+   1c5a0:	3c150004 	lui	s5,0x4
+   1c5a4:	26947120 	addiu	s4,s4,28960
+   1c5a8:	26b571ac 	addiu	s5,s5,29100
+   1c5ac:	8e820000 	lw	v0,0(s4)
+   1c5b0:	26940004 	addiu	s4,s4,4
+   1c5b4:	10400003 	beqz	v0,1c5c4 <kmem_alloc+0xc8>
+   1c5b8:	00402021 	addu	a0,v0,zero
+   1c5bc:	0c007024 	jal	1c090 <kcm_release>
+   1c5c0:	00000000 	sll	zero,zero,0x0
+   1c5c4:	1695fff9 	bne	s4,s5,1c5ac <kmem_alloc+0xb0>
+   1c5c8:	00000000 	sll	zero,zero,0x0
+   1c5cc:	12600046 	beqz	s3,1c6e8 <kmem_alloc+0x1ec>
+   1c5d0:	00000000 	sll	zero,zero,0x0
+   1c5d4:	8fbf0074 	lw	ra,116(sp)
+   1c5d8:	02601021 	addu	v0,s3,zero
+   1c5dc:	8fb50070 	lw	s5,112(sp)
+   1c5e0:	8fb4006c 	lw	s4,108(sp)
+   1c5e4:	8fb30068 	lw	s3,104(sp)
+   1c5e8:	8fb20064 	lw	s2,100(sp)
+   1c5ec:	8fb10060 	lw	s1,96(sp)
+   1c5f0:	8fb0005c 	lw	s0,92(sp)
+   1c5f4:	03e00008 	jr	ra
+   1c5f8:	27bd0078 	addiu	sp,sp,120
+   1c5fc:	1222000c 	beq	s1,v0,1c630 <kmem_alloc+0x134>
+   1c600:	263400dc 	addiu	s4,s1,220
+   1c604:	3c130004 	lui	s3,0x4
+   1c608:	0014a080 	sll	s4,s4,0x2
+   1c60c:	26736db0 	addiu	s3,s3,28080
+   1c610:	0293a021 	addu	s4,s4,s3
+   1c614:	8e840000 	lw	a0,0(s4)
+   1c618:	1080001e 	beqz	a0,1c694 <kmem_alloc+0x198>
+   1c61c:	00000000 	sll	zero,zero,0x0
+   1c620:	0c007047 	jal	1c11c <kcm_alloc>
+   1c624:	00002821 	addu	a1,zero,zero
+   1c628:	08007173 	j	1c5cc <kmem_alloc+0xd0>
+   1c62c:	00409821 	addu	s3,v0,zero
+   1c630:	3c040004 	lui	a0,0x4
+   1c634:	248470f0 	addiu	a0,a0,28912
+   1c638:	02402821 	addu	a1,s2,zero
+   1c63c:	0c006dcb 	jal	1b72c <heap_manager_malloc>
+   1c640:	02003021 	addu	a2,s0,zero
+   1c644:	00409821 	addu	s3,v0,zero
+   1c648:	3c020004 	lui	v0,0x4
+   1c64c:	02021024 	and	v0,s0,v0
+   1c650:	1040ffde 	beqz	v0,1c5cc <kmem_alloc+0xd0>
+   1c654:	00000000 	sll	zero,zero,0x0
+   1c658:	12600023 	beqz	s3,1c6e8 <kmem_alloc+0x1ec>
+   1c65c:	02403021 	addu	a2,s2,zero
+   1c660:	02602021 	addu	a0,s3,zero
+   1c664:	0c00c182 	jal	30608 <memset>
+   1c668:	00002821 	addu	a1,zero,zero
+   1c66c:	8fbf0074 	lw	ra,116(sp)
+   1c670:	02601021 	addu	v0,s3,zero
+   1c674:	8fb50070 	lw	s5,112(sp)
+   1c678:	8fb4006c 	lw	s4,108(sp)
+   1c67c:	8fb30068 	lw	s3,104(sp)
+   1c680:	8fb20064 	lw	s2,100(sp)
+   1c684:	8fb10060 	lw	s1,96(sp)
+   1c688:	8fb0005c 	lw	s0,92(sp)
+   1c68c:	03e00008 	jr	ra
+   1c690:	27bd0078 	addiu	sp,sp,120
+   1c694:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1c698:	02602021 	addu	a0,s3,zero
+   1c69c:	8e820000 	lw	v0,0(s4)
+   1c6a0:	10400005 	beqz	v0,1c6b8 <kmem_alloc+0x1bc>
+   1c6a4:	3c020003 	lui	v0,0x3
+   1c6a8:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1c6ac:	02602021 	addu	a0,s3,zero
+   1c6b0:	08007188 	j	1c620 <kmem_alloc+0x124>
+   1c6b4:	8e840000 	lw	a0,0(s4)
+   1c6b8:	00111880 	sll	v1,s1,0x2
+   1c6bc:	24426c74 	addiu	v0,v0,27764
+   1c6c0:	00621021 	addu	v0,v1,v0
+   1c6c4:	27a60030 	addiu	a2,sp,48
+   1c6c8:	8c420000 	lw	v0,0(v0)
+   1c6cc:	00c02021 	addu	a0,a2,zero
+   1c6d0:	0040f809 	jalr	v0
+   1c6d4:	afa60050 	sw	a2,80(sp)
+   1c6d8:	10400023 	beqz	v0,1c768 <kmem_alloc+0x26c>
+   1c6dc:	8fa60050 	lw	a2,80(sp)
+   1c6e0:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1c6e4:	02602021 	addu	a0,s3,zero
+   1c6e8:	40057801 	mfc0	a1,$15,1
+   1c6ec:	40032002 	mfc0	v1,$4,2
+   1c6f0:	40022002 	mfc0	v0,$4,2
+   1c6f4:	3c040004 	lui	a0,0x4
+   1c6f8:	30a50003 	andi	a1,a1,0x3
+   1c6fc:	00052880 	sll	a1,a1,0x2
+   1c700:	2484c950 	addiu	a0,a0,-14000
+   1c704:	00a42021 	addu	a0,a1,a0
+   1c708:	8c850000 	lw	a1,0(a0)
+   1c70c:	3c040004 	lui	a0,0x4
+   1c710:	8c8471b0 	lw	a0,29104(a0)
+   1c714:	afa50010 	sw	a1,16(sp)
+   1c718:	afa40014 	sw	a0,20(sp)
+   1c71c:	8c630180 	lw	v1,384(v1)
+   1c720:	3c040004 	lui	a0,0x4
+   1c724:	8c6305c4 	lw	v1,1476(v1)
+   1c728:	8c849100 	lw	a0,-28416(a0)
+   1c72c:	afa30018 	sw	v1,24(sp)
+   1c730:	8c4202f8 	lw	v0,760(v0)
+   1c734:	3c060003 	lui	a2,0x3
+   1c738:	3c070003 	lui	a3,0x3
+   1c73c:	24c66bfc 	addiu	a2,a2,27644
+   1c740:	24e76c68 	addiu	a3,a3,27752
+   1c744:	00002821 	addu	a1,zero,zero
+   1c748:	afa2001c 	sw	v0,28(sp)
+   1c74c:	afb10020 	sw	s1,32(sp)
+   1c750:	afb20024 	sw	s2,36(sp)
+   1c754:	afb00028 	sw	s0,40(sp)
+   1c758:	0c0009b0 	jal	26c0 <__fprintk>
+   1c75c:	00009821 	addu	s3,zero,zero
+   1c760:	08007176 	j	1c5d8 <kmem_alloc+0xdc>
+   1c764:	8fbf0074 	lw	ra,116(sp)
+   1c768:	02a02821 	addu	a1,s5,zero
+   1c76c:	0c0070c2 	jal	1c308 <kmem_get_kcm>
+   1c770:	02602021 	addu	a0,s3,zero
+   1c774:	02602021 	addu	a0,s3,zero
+   1c778:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1c77c:	afa20050 	sw	v0,80(sp)
+   1c780:	8fa20050 	lw	v0,80(sp)
+   1c784:	1440ffd8 	bnez	v0,1c6e8 <kmem_alloc+0x1ec>
+   1c788:	00000000 	sll	zero,zero,0x0
+   1c78c:	08007188 	j	1c620 <kmem_alloc+0x124>
+   1c790:	8e840000 	lw	a0,0(s4)
+   1c794:	3c020004 	lui	v0,0x4
+   1c798:	aca00000 	sw	zero,0(a1)
+   1c79c:	aca50004 	sw	a1,4(a1)
+   1c7a0:	2443c960 	addiu	v1,v0,-13984
+   1c7a4:	88630003 	lwl	v1,3(v1)
+   1c7a8:	9843c960 	lwr	v1,-13984(v0)
+   1c7ac:	03e00008 	jr	ra
+   1c7b0:	a4a30008 	sh	v1,8(a1)
+
+0001c7b4 <mapper_kmem_init>:
+   1c7b4:	24020005 	addiu	v0,zero,5
+   1c7b8:	ac820000 	sw	v0,0(a0)
+   1c7bc:	3c020003 	lui	v0,0x3
+   1c7c0:	24426ce0 	addiu	v0,v0,27872
+   1c7c4:	ac820004 	sw	v0,4(a0)
+   1c7c8:	2402000c 	addiu	v0,zero,12
+   1c7cc:	ac820008 	sw	v0,8(a0)
+   1c7d0:	24020003 	addiu	v0,zero,3
+   1c7d4:	ac82000c 	sw	v0,12(a0)
+   1c7d8:	24020006 	addiu	v0,zero,6
+   1c7dc:	ac820010 	sw	v0,16(a0)
+   1c7e0:	3c020002 	lui	v0,0x2
+   1c7e4:	2442c794 	addiu	v0,v0,-14444
+   1c7e8:	ac820018 	sw	v0,24(a0)
+   1c7ec:	ac80001c 	sw	zero,28(a0)
+   1c7f0:	ac800014 	sw	zero,20(a0)
+   1c7f4:	03e00008 	jr	ra
+   1c7f8:	00001021 	addu	v0,zero,zero
+
+0001c7fc <mapper_cnt_kmem_init>:
+   1c7fc:	2402001a 	addiu	v0,zero,26
+   1c800:	ac820000 	sw	v0,0(a0)
+   1c804:	3c020003 	lui	v0,0x3
+   1c808:	24426cec 	addiu	v0,v0,27884
+   1c80c:	ac820004 	sw	v0,4(a0)
+   1c810:	240201d0 	addiu	v0,zero,464
+   1c814:	ac820008 	sw	v0,8(a0)
+   1c818:	24020003 	addiu	v0,zero,3
+   1c81c:	ac82000c 	sw	v0,12(a0)
+   1c820:	24020006 	addiu	v0,zero,6
+   1c824:	ac820010 	sw	v0,16(a0)
+   1c828:	ac80001c 	sw	zero,28(a0)
+   1c82c:	ac800014 	sw	zero,20(a0)
+   1c830:	ac800018 	sw	zero,24(a0)
+   1c834:	03e00008 	jr	ra
+   1c838:	00001021 	addu	v0,zero,zero
+
+0001c83c <mapper_replicate>:
+   1c83c:	a4860008 	sh	a2,8(a0)
+   1c840:	ac850004 	sw	a1,4(a0)
+   1c844:	ac800000 	sw	zero,0(a0)
+   1c848:	03e00008 	jr	ra
+   1c84c:	00001021 	addu	v0,zero,zero
+
+0001c850 <init_pages_table>:
+   1c850:	00001021 	addu	v0,zero,zero
+   1c854:	24050028 	addiu	a1,zero,40
+   1c858:	00821821 	addu	v1,a0,v0
+   1c85c:	24420004 	addiu	v0,v0,4
+   1c860:	1445fffd 	bne	v0,a1,1c858 <init_pages_table+0x8>
+   1c864:	ac600000 	sw	zero,0(v1)
+   1c868:	03e00008 	jr	ra
+   1c86c:	00000000 	sll	zero,zero,0x0
+
+0001c870 <mapper_default_release_page>:
+   1c870:	03e00008 	jr	ra
+   1c874:	00001021 	addu	v0,zero,zero
+
+0001c878 <mapper_default_write_page>:
+   1c878:	03e00008 	jr	ra
+   1c87c:	00001021 	addu	v0,zero,zero
+
+0001c880 <mapper_default_read_page>:
+   1c880:	27bdffe8 	addiu	sp,sp,-24
+   1c884:	afbf0014 	sw	ra,20(sp)
+   1c888:	0c007a39 	jal	1e8e4 <page_zero>
+   1c88c:	00000000 	sll	zero,zero,0x0
+   1c890:	8fbf0014 	lw	ra,20(sp)
+   1c894:	00001021 	addu	v0,zero,zero
+   1c898:	03e00008 	jr	ra
+   1c89c:	27bd0018 	addiu	sp,sp,24
+
+0001c8a0 <mapper_default_sync_page>:
+   1c8a0:	27bdffd8 	addiu	sp,sp,-40
+   1c8a4:	afb20020 	sw	s2,32(sp)
+   1c8a8:	afb00018 	sw	s0,24(sp)
+   1c8ac:	afbf0024 	sw	ra,36(sp)
+   1c8b0:	afb1001c 	sw	s1,28(sp)
+   1c8b4:	8c820000 	lw	v0,0(a0)
+   1c8b8:	00808021 	addu	s0,a0,zero
+   1c8bc:	00021102 	srl	v0,v0,0x4
+   1c8c0:	30420080 	andi	v0,v0,0x80
+   1c8c4:	14400009 	bnez	v0,1c8ec <mapper_default_sync_page+0x4c>
+   1c8c8:	8c920018 	lw	s2,24(a0)
+   1c8cc:	00008821 	addu	s1,zero,zero
+   1c8d0:	8fbf0024 	lw	ra,36(sp)
+   1c8d4:	02201021 	addu	v0,s1,zero
+   1c8d8:	8fb20020 	lw	s2,32(sp)
+   1c8dc:	8fb1001c 	lw	s1,28(sp)
+   1c8e0:	8fb00018 	lw	s0,24(sp)
+   1c8e4:	03e00008 	jr	ra
+   1c8e8:	27bd0028 	addiu	sp,sp,40
+   1c8ec:	8e420000 	lw	v0,0(s2)
+   1c8f0:	8c4200a4 	lw	v0,164(v0)
+   1c8f4:	8c420004 	lw	v0,4(v0)
+   1c8f8:	0040f809 	jalr	v0
+   1c8fc:	24050001 	addiu	a1,zero,1
+   1c900:	1440fff3 	bnez	v0,1c8d0 <mapper_default_sync_page+0x30>
+   1c904:	00408821 	addu	s1,v0,zero
+   1c908:	8e440000 	lw	a0,0(s2)
+   1c90c:	27a50010 	addiu	a1,sp,16
+   1c910:	0c0030a1 	jal	c284 <mcs_lock>
+   1c914:	24840010 	addiu	a0,a0,16
+   1c918:	8e440000 	lw	a0,0(s2)
+   1c91c:	8e050014 	lw	a1,20(s0)
+   1c920:	00003021 	addu	a2,zero,zero
+   1c924:	0c00332f 	jal	ccbc <radix_tree_tag_clear>
+   1c928:	248400e8 	addiu	a0,a0,232
+   1c92c:	8e440000 	lw	a0,0(s2)
+   1c930:	8fa50010 	lw	a1,16(sp)
+   1c934:	0c003130 	jal	c4c0 <mcs_unlock>
+   1c938:	24840010 	addiu	a0,a0,16
+   1c93c:	0c007bb0 	jal	1eec0 <page_clear_dirty>
+   1c940:	02002021 	addu	a0,s0,zero
+   1c944:	8fbf0024 	lw	ra,36(sp)
+   1c948:	02201021 	addu	v0,s1,zero
+   1c94c:	8fb20020 	lw	s2,32(sp)
+   1c950:	8fb1001c 	lw	s1,28(sp)
+   1c954:	8fb00018 	lw	s0,24(sp)
+   1c958:	03e00008 	jr	ra
+   1c95c:	27bd0028 	addiu	sp,sp,40
+
+0001c960 <mapper_default_clear_page_dirty>:
+   1c960:	27bdffd8 	addiu	sp,sp,-40
+   1c964:	afb0001c 	sw	s0,28(sp)
+   1c968:	afbf0024 	sw	ra,36(sp)
+   1c96c:	afb10020 	sw	s1,32(sp)
+   1c970:	8c820000 	lw	v0,0(a0)
+   1c974:	00021102 	srl	v0,v0,0x4
+   1c978:	30420080 	andi	v0,v0,0x80
+   1c97c:	10400012 	beqz	v0,1c9c8 <mapper_default_clear_page_dirty+0x68>
+   1c980:	00808021 	addu	s0,a0,zero
+   1c984:	8c910018 	lw	s1,24(a0)
+   1c988:	27a50010 	addiu	a1,sp,16
+   1c98c:	8e240000 	lw	a0,0(s1)
+   1c990:	0c0030a1 	jal	c284 <mcs_lock>
+   1c994:	24840010 	addiu	a0,a0,16
+   1c998:	8e240000 	lw	a0,0(s1)
+   1c99c:	8e050014 	lw	a1,20(s0)
+   1c9a0:	00003021 	addu	a2,zero,zero
+   1c9a4:	0c00332f 	jal	ccbc <radix_tree_tag_clear>
+   1c9a8:	248400e8 	addiu	a0,a0,232
+   1c9ac:	8e240000 	lw	a0,0(s1)
+   1c9b0:	8fa50010 	lw	a1,16(sp)
+   1c9b4:	0c003130 	jal	c4c0 <mcs_unlock>
+   1c9b8:	24840010 	addiu	a0,a0,16
+   1c9bc:	0c007bb0 	jal	1eec0 <page_clear_dirty>
+   1c9c0:	02002021 	addu	a0,s0,zero
+   1c9c4:	24020001 	addiu	v0,zero,1
+   1c9c8:	8fbf0024 	lw	ra,36(sp)
+   1c9cc:	8fb10020 	lw	s1,32(sp)
+   1c9d0:	8fb0001c 	lw	s0,28(sp)
+   1c9d4:	03e00008 	jr	ra
+   1c9d8:	27bd0028 	addiu	sp,sp,40
+
+0001c9dc <mapper_default_set_page_dirty>:
+   1c9dc:	27bdffd8 	addiu	sp,sp,-40
+   1c9e0:	afb0001c 	sw	s0,28(sp)
+   1c9e4:	afbf0024 	sw	ra,36(sp)
+   1c9e8:	afb10020 	sw	s1,32(sp)
+   1c9ec:	8c820000 	lw	v0,0(a0)
+   1c9f0:	00021102 	srl	v0,v0,0x4
+   1c9f4:	30420080 	andi	v0,v0,0x80
+   1c9f8:	10400007 	beqz	v0,1ca18 <mapper_default_set_page_dirty+0x3c>
+   1c9fc:	00808021 	addu	s0,a0,zero
+   1ca00:	8fbf0024 	lw	ra,36(sp)
+   1ca04:	00001021 	addu	v0,zero,zero
+   1ca08:	8fb10020 	lw	s1,32(sp)
+   1ca0c:	8fb0001c 	lw	s0,28(sp)
+   1ca10:	03e00008 	jr	ra
+   1ca14:	27bd0028 	addiu	sp,sp,40
+   1ca18:	8c910018 	lw	s1,24(a0)
+   1ca1c:	27a50010 	addiu	a1,sp,16
+   1ca20:	8e240000 	lw	a0,0(s1)
+   1ca24:	0c0030a1 	jal	c284 <mcs_lock>
+   1ca28:	24840010 	addiu	a0,a0,16
+   1ca2c:	8e240000 	lw	a0,0(s1)
+   1ca30:	8e050014 	lw	a1,20(s0)
+   1ca34:	00003021 	addu	a2,zero,zero
+   1ca38:	0c0032cf 	jal	cb3c <radix_tree_tag_set>
+   1ca3c:	248400e8 	addiu	a0,a0,232
+   1ca40:	8e240000 	lw	a0,0(s1)
+   1ca44:	8fa50010 	lw	a1,16(sp)
+   1ca48:	0c003130 	jal	c4c0 <mcs_unlock>
+   1ca4c:	24840010 	addiu	a0,a0,16
+   1ca50:	0c007bdc 	jal	1ef70 <page_set_dirty>
+   1ca54:	02002021 	addu	a0,s0,zero
+   1ca58:	8fbf0024 	lw	ra,36(sp)
+   1ca5c:	24020001 	addiu	v0,zero,1
+   1ca60:	8fb10020 	lw	s1,32(sp)
+   1ca64:	8fb0001c 	lw	s0,28(sp)
+   1ca68:	03e00008 	jr	ra
+   1ca6c:	27bd0028 	addiu	sp,sp,40
+
+0001ca70 <mapper_add_page>:
+   1ca70:	27bdffd0 	addiu	sp,sp,-48
+   1ca74:	afb00020 	sw	s0,32(sp)
+   1ca78:	00808021 	addu	s0,a0,zero
+   1ca7c:	8c840000 	lw	a0,0(a0)
+   1ca80:	afb10024 	sw	s1,36(sp)
+   1ca84:	24840010 	addiu	a0,a0,16
+   1ca88:	00a08821 	addu	s1,a1,zero
+   1ca8c:	27a50010 	addiu	a1,sp,16
+   1ca90:	afb20028 	sw	s2,40(sp)
+   1ca94:	afbf002c 	sw	ra,44(sp)
+   1ca98:	0c0030a1 	jal	c284 <mcs_lock>
+   1ca9c:	00c09021 	addu	s2,a2,zero
+   1caa0:	8e040000 	lw	a0,0(s0)
+   1caa4:	02402821 	addu	a1,s2,zero
+   1caa8:	248400e8 	addiu	a0,a0,232
+   1caac:	0c00359b 	jal	d66c <radix_tree_insert>
+   1cab0:	02203021 	addu	a2,s1,zero
+   1cab4:	14400003 	bnez	v0,1cac4 <mapper_add_page+0x54>
+   1cab8:	00000000 	sll	zero,zero,0x0
+   1cabc:	ae320014 	sw	s2,20(s1)
+   1cac0:	ae300018 	sw	s0,24(s1)
+   1cac4:	8e040000 	lw	a0,0(s0)
+   1cac8:	8fa50010 	lw	a1,16(sp)
+   1cacc:	24840010 	addiu	a0,a0,16
+   1cad0:	0c003130 	jal	c4c0 <mcs_unlock>
+   1cad4:	afa20018 	sw	v0,24(sp)
+   1cad8:	8fbf002c 	lw	ra,44(sp)
+   1cadc:	8fa20018 	lw	v0,24(sp)
+   1cae0:	8fb20028 	lw	s2,40(sp)
+   1cae4:	8fb10024 	lw	s1,36(sp)
+   1cae8:	8fb00020 	lw	s0,32(sp)
+   1caec:	03e00008 	jr	ra
+   1caf0:	27bd0030 	addiu	sp,sp,48
+   1caf4:	27bdffe8 	addiu	sp,sp,-24
+   1caf8:	afb00010 	sw	s0,16(sp)
+   1cafc:	afbf0014 	sw	ra,20(sp)
+   1cb00:	8c840000 	lw	a0,0(a0)
+   1cb04:	00a08021 	addu	s0,a1,zero
+   1cb08:	8ca50014 	lw	a1,20(a1)
+   1cb0c:	0c003749 	jal	dd24 <radix_tree_delete>
+   1cb10:	248400e8 	addiu	a0,a0,232
+   1cb14:	8e030000 	lw	v1,0(s0)
+   1cb18:	3c04ffff 	lui	a0,0xffff
+   1cb1c:	00031102 	srl	v0,v1,0x4
+   1cb20:	30420f7f 	andi	v0,v0,0xf7f
+   1cb24:	3484000f 	ori	a0,a0,0xf
+   1cb28:	00641824 	and	v1,v1,a0
+   1cb2c:	00022100 	sll	a0,v0,0x4
+   1cb30:	00641825 	or	v1,v1,a0
+   1cb34:	30420020 	andi	v0,v0,0x20
+   1cb38:	10400003 	beqz	v0,1cb48 <mapper_add_page+0xd8>
+   1cb3c:	ae030000 	sw	v1,0(s0)
+   1cb40:	0c001bab 	jal	6eac <blkio_destroy>
+   1cb44:	02002021 	addu	a0,s0,zero
+   1cb48:	8fbf0014 	lw	ra,20(sp)
+   1cb4c:	ae000018 	sw	zero,24(s0)
+   1cb50:	8fb00010 	lw	s0,16(sp)
+   1cb54:	03e00008 	jr	ra
+   1cb58:	27bd0018 	addiu	sp,sp,24
+
+0001cb5c <mapper_find_pages_by_tag>:
+   1cb5c:	27bdffc8 	addiu	sp,sp,-56
+   1cb60:	afb00028 	sw	s0,40(sp)
+   1cb64:	00808021 	addu	s0,a0,zero
+   1cb68:	8c840000 	lw	a0,0(a0)
+   1cb6c:	afb20030 	sw	s2,48(sp)
+   1cb70:	24840010 	addiu	a0,a0,16
+   1cb74:	00a09021 	addu	s2,a1,zero
+   1cb78:	27a50018 	addiu	a1,sp,24
+   1cb7c:	afbf0034 	sw	ra,52(sp)
+   1cb80:	afb1002c 	sw	s1,44(sp)
+   1cb84:	afa70020 	sw	a3,32(sp)
+   1cb88:	0c0030a1 	jal	c284 <mcs_lock>
+   1cb8c:	00c08821 	addu	s1,a2,zero
+   1cb90:	8e040000 	lw	a0,0(s0)
+   1cb94:	8fa50048 	lw	a1,72(sp)
+   1cb98:	8fa70020 	lw	a3,32(sp)
+   1cb9c:	02403021 	addu	a2,s2,zero
+   1cba0:	248400e8 	addiu	a0,a0,232
+   1cba4:	0c0033d6 	jal	cf58 <radix_tree_gang_lookup_tag>
+   1cba8:	afb10010 	sw	s1,16(sp)
+   1cbac:	8e040000 	lw	a0,0(s0)
+   1cbb0:	8fa50018 	lw	a1,24(sp)
+   1cbb4:	24840010 	addiu	a0,a0,16
+   1cbb8:	0c003130 	jal	c4c0 <mcs_unlock>
+   1cbbc:	afa20020 	sw	v0,32(sp)
+   1cbc0:	8fbf0034 	lw	ra,52(sp)
+   1cbc4:	8fa20020 	lw	v0,32(sp)
+   1cbc8:	8fb20030 	lw	s2,48(sp)
+   1cbcc:	8fb1002c 	lw	s1,44(sp)
+   1cbd0:	8fb00028 	lw	s0,40(sp)
+   1cbd4:	03e00008 	jr	ra
+   1cbd8:	27bd0038 	addiu	sp,sp,56
+
+0001cbdc <mapper_find_pages_contig>:
+   1cbdc:	27bdffd0 	addiu	sp,sp,-48
+   1cbe0:	afb20024 	sw	s2,36(sp)
+   1cbe4:	00809021 	addu	s2,a0,zero
+   1cbe8:	8c840000 	lw	a0,0(a0)
+   1cbec:	afb30028 	sw	s3,40(sp)
+   1cbf0:	24840010 	addiu	a0,a0,16
+   1cbf4:	00a09821 	addu	s3,a1,zero
+   1cbf8:	27a50010 	addiu	a1,sp,16
+   1cbfc:	afbf002c 	sw	ra,44(sp)
+   1cc00:	afb10020 	sw	s1,32(sp)
+   1cc04:	afb0001c 	sw	s0,28(sp)
+   1cc08:	00e08821 	addu	s1,a3,zero
+   1cc0c:	0c0030a1 	jal	c284 <mcs_lock>
+   1cc10:	00c08021 	addu	s0,a2,zero
+   1cc14:	8e440000 	lw	a0,0(s2)
+   1cc18:	02603021 	addu	a2,s3,zero
+   1cc1c:	248400e8 	addiu	a0,a0,232
+   1cc20:	02202821 	addu	a1,s1,zero
+   1cc24:	0c003507 	jal	d41c <radix_tree_gang_lookup>
+   1cc28:	02003821 	addu	a3,s0,zero
+   1cc2c:	8e440000 	lw	a0,0(s2)
+   1cc30:	8fa50010 	lw	a1,16(sp)
+   1cc34:	00409821 	addu	s3,v0,zero
+   1cc38:	0c003130 	jal	c4c0 <mcs_unlock>
+   1cc3c:	24840010 	addiu	a0,a0,16
+   1cc40:	12600012 	beqz	s3,1cc8c <mapper_find_pages_contig+0xb0>
+   1cc44:	00001021 	addu	v0,zero,zero
+   1cc48:	8e220000 	lw	v0,0(s1)
+   1cc4c:	8c420014 	lw	v0,20(v0)
+   1cc50:	1602001f 	bne	s0,v0,1ccd0 <mapper_find_pages_contig+0xf4>
+   1cc54:	26230004 	addiu	v1,s1,4
+   1cc58:	0800731d 	j	1cc74 <mapper_find_pages_contig+0x98>
+   1cc5c:	00001021 	addu	v0,zero,zero
+   1cc60:	8c640000 	lw	a0,0(v1)
+   1cc64:	00603021 	addu	a2,v1,zero
+   1cc68:	8c840014 	lw	a0,20(a0)
+   1cc6c:	1485000f 	bne	a0,a1,1ccac <mapper_find_pages_contig+0xd0>
+   1cc70:	24630004 	addiu	v1,v1,4
+   1cc74:	24420001 	addiu	v0,v0,1
+   1cc78:	0053202b 	sltu	a0,v0,s3
+   1cc7c:	1480fff8 	bnez	a0,1cc60 <mapper_find_pages_contig+0x84>
+   1cc80:	02022821 	addu	a1,s0,v0
+   1cc84:	00021880 	sll	v1,v0,0x2
+   1cc88:	02238821 	addu	s1,s1,v1
+   1cc8c:	8fbf002c 	lw	ra,44(sp)
+   1cc90:	ae200000 	sw	zero,0(s1)
+   1cc94:	8fb30028 	lw	s3,40(sp)
+   1cc98:	8fb20024 	lw	s2,36(sp)
+   1cc9c:	8fb10020 	lw	s1,32(sp)
+   1cca0:	8fb0001c 	lw	s0,28(sp)
+   1cca4:	03e00008 	jr	ra
+   1cca8:	27bd0030 	addiu	sp,sp,48
+   1ccac:	8fbf002c 	lw	ra,44(sp)
+   1ccb0:	00c08821 	addu	s1,a2,zero
+   1ccb4:	ae200000 	sw	zero,0(s1)
+   1ccb8:	8fb30028 	lw	s3,40(sp)
+   1ccbc:	8fb20024 	lw	s2,36(sp)
+   1ccc0:	8fb10020 	lw	s1,32(sp)
+   1ccc4:	8fb0001c 	lw	s0,28(sp)
+   1ccc8:	03e00008 	jr	ra
+   1cccc:	27bd0030 	addiu	sp,sp,48
+   1ccd0:	08007323 	j	1cc8c <mapper_find_pages_contig+0xb0>
+   1ccd4:	00001021 	addu	v0,zero,zero
+
+0001ccd8 <mapper_set_auto_migrate>:
+   1ccd8:	27bdffa8 	addiu	sp,sp,-88
+   1ccdc:	afb20048 	sw	s2,72(sp)
+   1cce0:	00809021 	addu	s2,a0,zero
+   1cce4:	8c840000 	lw	a0,0(a0)
+   1cce8:	27a50010 	addiu	a1,sp,16
+   1ccec:	24840010 	addiu	a0,a0,16
+   1ccf0:	afb40050 	sw	s4,80(sp)
+   1ccf4:	afb3004c 	sw	s3,76(sp)
+   1ccf8:	afb10044 	sw	s1,68(sp)
+   1ccfc:	afb00040 	sw	s0,64(sp)
+   1cd00:	afbf0054 	sw	ra,84(sp)
+   1cd04:	0c0030a1 	jal	c284 <mcs_lock>
+   1cd08:	27b30014 	addiu	s3,sp,20
+   1cd0c:	00008821 	addu	s1,zero,zero
+   1cd10:	00008021 	addu	s0,zero,zero
+   1cd14:	27b40018 	addiu	s4,sp,24
+   1cd18:	8e440000 	lw	a0,0(s2)
+   1cd1c:	02203021 	addu	a2,s1,zero
+   1cd20:	248400e8 	addiu	a0,a0,232
+   1cd24:	02602821 	addu	a1,s3,zero
+   1cd28:	0c003507 	jal	d41c <radix_tree_gang_lookup>
+   1cd2c:	2407000a 	addiu	a3,zero,10
+   1cd30:	10400017 	beqz	v0,1cd90 <mapper_set_auto_migrate+0xb8>
+   1cd34:	02228821 	addu	s1,s1,v0
+   1cd38:	8fa30014 	lw	v1,20(sp)
+   1cd3c:	1060fff6 	beqz	v1,1cd18 <mapper_set_auto_migrate+0x40>
+   1cd40:	02802821 	addu	a1,s4,zero
+   1cd44:	00002021 	addu	a0,zero,zero
+   1cd48:	8c670000 	lw	a3,0(v1)
+   1cd4c:	24840001 	addiu	a0,a0,1
+   1cd50:	34e74000 	ori	a3,a3,0x4000
+   1cd54:	0082302b 	sltu	a2,a0,v0
+   1cd58:	ac670000 	sw	a3,0(v1)
+   1cd5c:	10c0ffee 	beqz	a2,1cd18 <mapper_set_auto_migrate+0x40>
+   1cd60:	26100001 	addiu	s0,s0,1
+   1cd64:	8ca30000 	lw	v1,0(a1)
+   1cd68:	1460fff7 	bnez	v1,1cd48 <mapper_set_auto_migrate+0x70>
+   1cd6c:	24a50004 	addiu	a1,a1,4
+   1cd70:	8e440000 	lw	a0,0(s2)
+   1cd74:	02203021 	addu	a2,s1,zero
+   1cd78:	248400e8 	addiu	a0,a0,232
+   1cd7c:	02602821 	addu	a1,s3,zero
+   1cd80:	0c003507 	jal	d41c <radix_tree_gang_lookup>
+   1cd84:	2407000a 	addiu	a3,zero,10
+   1cd88:	1440ffeb 	bnez	v0,1cd38 <mapper_set_auto_migrate+0x60>
+   1cd8c:	02228821 	addu	s1,s1,v0
+   1cd90:	8e440000 	lw	a0,0(s2)
+   1cd94:	8fa50010 	lw	a1,16(sp)
+   1cd98:	0c003130 	jal	c4c0 <mcs_unlock>
+   1cd9c:	24840010 	addiu	a0,a0,16
+   1cda0:	8fbf0054 	lw	ra,84(sp)
+   1cda4:	02001021 	addu	v0,s0,zero
+   1cda8:	8fb40050 	lw	s4,80(sp)
+   1cdac:	8fb3004c 	lw	s3,76(sp)
+   1cdb0:	8fb20048 	lw	s2,72(sp)
+   1cdb4:	8fb10044 	lw	s1,68(sp)
+   1cdb8:	8fb00040 	lw	s0,64(sp)
+   1cdbc:	03e00008 	jr	ra
+   1cdc0:	27bd0058 	addiu	sp,sp,88
+
+0001cdc4 <mapper_find_pages>:
+   1cdc4:	27bdffd0 	addiu	sp,sp,-48
+   1cdc8:	afb00020 	sw	s0,32(sp)
+   1cdcc:	00808021 	addu	s0,a0,zero
+   1cdd0:	8c840000 	lw	a0,0(a0)
+   1cdd4:	afb20028 	sw	s2,40(sp)
+   1cdd8:	24840010 	addiu	a0,a0,16
+   1cddc:	00a09021 	addu	s2,a1,zero
+   1cde0:	27a50010 	addiu	a1,sp,16
+   1cde4:	afbf002c 	sw	ra,44(sp)
+   1cde8:	afb10024 	sw	s1,36(sp)
+   1cdec:	afa70018 	sw	a3,24(sp)
+   1cdf0:	0c0030a1 	jal	c284 <mcs_lock>
+   1cdf4:	00c08821 	addu	s1,a2,zero
+   1cdf8:	8fa70018 	lw	a3,24(sp)
+   1cdfc:	8e040000 	lw	a0,0(s0)
+   1ce00:	00e02821 	addu	a1,a3,zero
+   1ce04:	02403021 	addu	a2,s2,zero
+   1ce08:	02203821 	addu	a3,s1,zero
+   1ce0c:	0c003507 	jal	d41c <radix_tree_gang_lookup>
+   1ce10:	248400e8 	addiu	a0,a0,232
+   1ce14:	8e040000 	lw	a0,0(s0)
+   1ce18:	8fa50010 	lw	a1,16(sp)
+   1ce1c:	24840010 	addiu	a0,a0,16
+   1ce20:	0c003130 	jal	c4c0 <mcs_unlock>
+   1ce24:	afa20018 	sw	v0,24(sp)
+   1ce28:	8fbf002c 	lw	ra,44(sp)
+   1ce2c:	8fa20018 	lw	v0,24(sp)
+   1ce30:	8fb20028 	lw	s2,40(sp)
+   1ce34:	8fb10024 	lw	s1,36(sp)
+   1ce38:	8fb00020 	lw	s0,32(sp)
+   1ce3c:	03e00008 	jr	ra
+   1ce40:	27bd0030 	addiu	sp,sp,48
+
+0001ce44 <mapper_find_page>:
+   1ce44:	27bdffd0 	addiu	sp,sp,-48
+   1ce48:	afb00024 	sw	s0,36(sp)
+   1ce4c:	00808021 	addu	s0,a0,zero
+   1ce50:	8c840000 	lw	a0,0(a0)
+   1ce54:	afb10028 	sw	s1,40(sp)
+   1ce58:	24840010 	addiu	a0,a0,16
+   1ce5c:	00a08821 	addu	s1,a1,zero
+   1ce60:	afbf002c 	sw	ra,44(sp)
+   1ce64:	0c0030a1 	jal	c284 <mcs_lock>
+   1ce68:	27a50010 	addiu	a1,sp,16
+   1ce6c:	8e040000 	lw	a0,0(s0)
+   1ce70:	02202821 	addu	a1,s1,zero
+   1ce74:	0c0032c2 	jal	cb08 <radix_tree_lookup>
+   1ce78:	248400e8 	addiu	a0,a0,232
+   1ce7c:	8e040000 	lw	a0,0(s0)
+   1ce80:	8fa50010 	lw	a1,16(sp)
+   1ce84:	24840010 	addiu	a0,a0,16
+   1ce88:	0c003130 	jal	c4c0 <mcs_unlock>
+   1ce8c:	afa20018 	sw	v0,24(sp)
+   1ce90:	8fbf002c 	lw	ra,44(sp)
+   1ce94:	8fa20018 	lw	v0,24(sp)
+   1ce98:	8fb10028 	lw	s1,40(sp)
+   1ce9c:	8fb00024 	lw	s0,36(sp)
+   1cea0:	03e00008 	jr	ra
+   1cea4:	27bd0030 	addiu	sp,sp,48
+
+0001cea8 <mapper_init>:
+   1cea8:	27bdffc8 	addiu	sp,sp,-56
+   1ceac:	2402001a 	addiu	v0,zero,26
+   1ceb0:	afa20010 	sw	v0,16(sp)
+   1ceb4:	3c020002 	lui	v0,0x2
+   1ceb8:	afb00024 	sw	s0,36(sp)
+   1cebc:	afa20018 	sw	v0,24(sp)
+   1cec0:	00808021 	addu	s0,a0,zero
+   1cec4:	240201d0 	addiu	v0,zero,464
+   1cec8:	27a40010 	addiu	a0,sp,16
+   1cecc:	afb30030 	sw	s3,48(sp)
+   1ced0:	afb2002c 	sw	s2,44(sp)
+   1ced4:	afb10028 	sw	s1,40(sp)
+   1ced8:	afbf0034 	sw	ra,52(sp)
+   1cedc:	afa20014 	sw	v0,20(sp)
+   1cee0:	00a08821 	addu	s1,a1,zero
+   1cee4:	00c09021 	addu	s2,a2,zero
+   1cee8:	0c00713f 	jal	1c4fc <kmem_alloc>
+   1ceec:	00e09821 	addu	s3,a3,zero
+   1cef0:	10400022 	beqz	v0,1cf7c <mapper_init+0xd4>
+   1cef4:	ae020000 	sw	v0,0(s0)
+   1cef8:	244400a8 	addiu	a0,v0,168
+   1cefc:	0c00199f 	jal	667c <atomic_init>
+   1cf00:	24050001 	addiu	a1,zero,1
+   1cf04:	8e040000 	lw	a0,0(s0)
+   1cf08:	ac9100a4 	sw	s1,164(a0)
+   1cf0c:	ac9200a0 	sw	s2,160(a0)
+   1cf10:	ac9301c8 	sw	s3,456(a0)
+   1cf14:	0c00327f 	jal	c9fc <radix_tree_init>
+   1cf18:	248400e8 	addiu	a0,a0,232
+   1cf1c:	8e040000 	lw	a0,0(s0)
+   1cf20:	3c050003 	lui	a1,0x3
+   1cf24:	0c004a24 	jal	12890 <spinlock_init>
+   1cf28:	24a56cfc 	addiu	a1,a1,27900
+   1cf2c:	8e040000 	lw	a0,0(s0)
+   1cf30:	3c050003 	lui	a1,0x3
+   1cf34:	24840010 	addiu	a0,a0,16
+   1cf38:	0c003096 	jal	c258 <mcs_lock_init>
+   1cf3c:	24a56d0c 	addiu	a1,a1,27916
+   1cf40:	8e040000 	lw	a0,0(s0)
+   1cf44:	0c004428 	jal	110a0 <rwlock_init>
+   1cf48:	24840100 	addiu	a0,a0,256
+   1cf4c:	8e030000 	lw	v1,0(s0)
+   1cf50:	8fbf0034 	lw	ra,52(sp)
+   1cf54:	246401c0 	addiu	a0,v1,448
+   1cf58:	00001021 	addu	v0,zero,zero
+   1cf5c:	8fb30030 	lw	s3,48(sp)
+   1cf60:	8fb2002c 	lw	s2,44(sp)
+   1cf64:	8fb10028 	lw	s1,40(sp)
+   1cf68:	8fb00024 	lw	s0,36(sp)
+   1cf6c:	ac6401c4 	sw	a0,452(v1)
+   1cf70:	ac6401c0 	sw	a0,448(v1)
+   1cf74:	03e00008 	jr	ra
+   1cf78:	27bd0038 	addiu	sp,sp,56
+   1cf7c:	8fbf0034 	lw	ra,52(sp)
+   1cf80:	2402000c 	addiu	v0,zero,12
+   1cf84:	8fb30030 	lw	s3,48(sp)
+   1cf88:	8fb2002c 	lw	s2,44(sp)
+   1cf8c:	8fb10028 	lw	s1,40(sp)
+   1cf90:	8fb00024 	lw	s0,36(sp)
+   1cf94:	03e00008 	jr	ra
+   1cf98:	27bd0038 	addiu	sp,sp,56
+
+0001cf9c <mapper_get_page>:
+   1cf9c:	27bdff48 	addiu	sp,sp,-184
+   1cfa0:	3c020022 	lui	v0,0x22
+   1cfa4:	afb600a8 	sw	s6,168(sp)
+   1cfa8:	34420040 	ori	v0,v0,0x40
+   1cfac:	3c16ffff 	lui	s6,0xffff
+   1cfb0:	afb700ac 	sw	s7,172(sp)
+   1cfb4:	afb500a4 	sw	s5,164(sp)
+   1cfb8:	afb3009c 	sw	s3,156(sp)
+   1cfbc:	afb20098 	sw	s2,152(sp)
+   1cfc0:	afb00090 	sw	s0,144(sp)
+   1cfc4:	afbf00b4 	sw	ra,180(sp)
+   1cfc8:	afbe00b0 	sw	s8,176(sp)
+   1cfcc:	afb400a0 	sw	s4,160(sp)
+   1cfd0:	afb10094 	sw	s1,148(sp)
+   1cfd4:	afa20038 	sw	v0,56(sp)
+   1cfd8:	00808021 	addu	s0,a0,zero
+   1cfdc:	00a09821 	addu	s3,a1,zero
+   1cfe0:	afa600c0 	sw	a2,192(sp)
+   1cfe4:	afa00030 	sw	zero,48(sp)
+   1cfe8:	afa00034 	sw	zero,52(sp)
+   1cfec:	36d6000f 	ori	s6,s6,0xf
+   1cff0:	27b7002c 	addiu	s7,sp,44
+   1cff4:	27b20040 	addiu	s2,sp,64
+   1cff8:	27b50084 	addiu	s5,sp,132
+   1cffc:	8e040000 	lw	a0,0(s0)
+   1d000:	02e02821 	addu	a1,s7,zero
+   1d004:	0c0030a1 	jal	c284 <mcs_lock>
+   1d008:	24840010 	addiu	a0,a0,16
+   1d00c:	8e040000 	lw	a0,0(s0)
+   1d010:	02403021 	addu	a2,s2,zero
+   1d014:	248400e8 	addiu	a0,a0,232
+   1d018:	0c003283 	jal	ca0c <radix_item_info_lookup>
+   1d01c:	02602821 	addu	a1,s3,zero
+   1d020:	0040f021 	addu	s8,v0,zero
+   1d024:	3c020100 	lui	v0,0x100
+   1d028:	34460001 	ori	a2,v0,0x1
+   1d02c:	13c000af 	beqz	s8,1d2ec <mapper_get_page+0x350>
+   1d030:	02a02021 	addu	a0,s5,zero
+   1d034:	8fb10040 	lw	s1,64(sp)
+   1d038:	122000ac 	beqz	s1,1d2ec <mapper_get_page+0x350>
+   1d03c:	00000000 	sll	zero,zero,0x0
+   1d040:	8e220000 	lw	v0,0(s1)
+   1d044:	0220f021 	addu	s8,s1,zero
+   1d048:	00562824 	and	a1,v0,s6
+   1d04c:	00021102 	srl	v0,v0,0x4
+   1d050:	30420fff 	andi	v0,v0,0xfff
+   1d054:	30430bff 	andi	v1,v0,0xbff
+   1d058:	00031900 	sll	v1,v1,0x4
+   1d05c:	00a31825 	or	v1,a1,v1
+   1d060:	00032c02 	srl	a1,v1,0x10
+   1d064:	30a70fff 	andi	a3,a1,0xfff
+   1d068:	30450008 	andi	a1,v0,0x8
+   1d06c:	14a00072 	bnez	a1,1d238 <mapper_get_page+0x29c>
+   1d070:	30420400 	andi	v0,v0,0x400
+   1d074:	10400145 	beqz	v0,1d58c <mapper_get_page+0x5f0>
+   1d078:	8fa5002c 	lw	a1,44(sp)
+   1d07c:	ae230000 	sw	v1,0(s1)
+   1d080:	8e020000 	lw	v0,0(s0)
+   1d084:	8c4300a0 	lw	v1,160(v0)
+   1d088:	146000f3 	bnez	v1,1d458 <mapper_get_page+0x4bc>
+   1d08c:	3c050004 	lui	a1,0x4
+   1d090:	24a56db0 	addiu	a1,a1,28080
+   1d094:	8ca30400 	lw	v1,1024(a1)
+   1d098:	106700ef 	beq	v1,a3,1d458 <mapper_get_page+0x4bc>
+   1d09c:	27a50060 	addiu	a1,sp,96
+   1d0a0:	3c020003 	lui	v0,0x3
+   1d0a4:	24426f78 	addiu	v0,v0,28536
+   1d0a8:	afa60054 	sw	a2,84(sp)
+   1d0ac:	afa50060 	sw	a1,96(sp)
+   1d0b0:	afa50064 	sw	a1,100(sp)
+   1d0b4:	afa20058 	sw	v0,88(sp)
+   1d0b8:	0c0019fe 	jal	67f8 <refcount_init>
+   1d0bc:	afa0005c 	sw	zero,92(sp)
+   1d0c0:	0c004a27 	jal	1289c <spin_init>
+   1d0c4:	27a40088 	addiu	a0,sp,136
+   1d0c8:	8fa20054 	lw	v0,84(sp)
+   1d0cc:	02a02021 	addu	a0,s5,zero
+   1d0d0:	00021902 	srl	v1,v0,0x4
+   1d0d4:	30630ffe 	andi	v1,v1,0xffe
+   1d0d8:	34630008 	ori	v1,v1,0x8
+   1d0dc:	00031900 	sll	v1,v1,0x4
+   1d0e0:	00561024 	and	v0,v0,s6
+   1d0e4:	00431025 	or	v0,v0,v1
+   1d0e8:	afa20054 	sw	v0,84(sp)
+   1d0ec:	afa00068 	sw	zero,104(sp)
+   1d0f0:	afa0006c 	sw	zero,108(sp)
+   1d0f4:	0c001a00 	jal	6800 <refcount_up>
+   1d0f8:	afa00070 	sw	zero,112(sp)
+   1d0fc:	8e040000 	lw	a0,0(s0)
+   1d100:	02402821 	addu	a1,s2,zero
+   1d104:	248400e8 	addiu	a0,a0,232
+   1d108:	00003021 	addu	a2,zero,zero
+   1d10c:	27a70054 	addiu	a3,sp,84
+   1d110:	afb0006c 	sw	s0,108(sp)
+   1d114:	0c00377b 	jal	ddec <radix_item_info_apply>
+   1d118:	afb30068 	sw	s3,104(sp)
+   1d11c:	10400007 	beqz	v0,1d13c <mapper_get_page+0x1a0>
+   1d120:	0040a021 	addu	s4,v0,zero
+   1d124:	8e040000 	lw	a0,0(s0)
+   1d128:	8fa5002c 	lw	a1,44(sp)
+   1d12c:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d130:	24840010 	addiu	a0,a0,16
+   1d134:	08007400 	j	1d000 <mapper_get_page+0x64>
+   1d138:	8e040000 	lw	a0,0(s0)
+   1d13c:	8e040000 	lw	a0,0(s0)
+   1d140:	8fa5002c 	lw	a1,44(sp)
+   1d144:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d148:	24840010 	addiu	a0,a0,16
+   1d14c:	8e040000 	lw	a0,0(s0)
+   1d150:	afa00028 	sw	zero,40(sp)
+   1d154:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   1d158:	24840100 	addiu	a0,a0,256
+   1d15c:	8e040000 	lw	a0,0(s0)
+   1d160:	8c9301c0 	lw	s3,448(a0)
+   1d164:	248201c0 	addiu	v0,a0,448
+   1d168:	1262000b 	beq	s3,v0,1d198 <mapper_get_page+0x1fc>
+   1d16c:	00000000 	sll	zero,zero,0x0
+   1d170:	0c007a7a 	jal	1e9e8 <page_lock>
+   1d174:	02202021 	addu	a0,s1,zero
+   1d178:	2664fea8 	addiu	a0,s3,-344
+   1d17c:	02202821 	addu	a1,s1,zero
+   1d180:	0c008401 	jal	21004 <vmm_migrate_shared_page_seq>
+   1d184:	27a60028 	addiu	a2,sp,40
+   1d188:	02202021 	addu	a0,s1,zero
+   1d18c:	0c007a5c 	jal	1e970 <page_unlock>
+   1d190:	0040a021 	addu	s4,v0,zero
+   1d194:	8e040000 	lw	a0,0(s0)
+   1d198:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   1d19c:	24840100 	addiu	a0,a0,256
+   1d1a0:	8e040000 	lw	a0,0(s0)
+   1d1a4:	02e02821 	addu	a1,s7,zero
+   1d1a8:	0c0030a1 	jal	c284 <mcs_lock>
+   1d1ac:	24840010 	addiu	a0,a0,16
+   1d1b0:	8fa20028 	lw	v0,40(sp)
+   1d1b4:	10400044 	beqz	v0,1d2c8 <mapper_get_page+0x32c>
+   1d1b8:	02402821 	addu	a1,s2,zero
+   1d1bc:	1280002a 	beqz	s4,1d268 <mapper_get_page+0x2cc>
+   1d1c0:	8fa70028 	lw	a3,40(sp)
+   1d1c4:	00009021 	addu	s2,zero,zero
+   1d1c8:	0c006d29 	jal	1b4a4 <wakeup_all>
+   1d1cc:	27a40058 	addiu	a0,sp,88
+   1d1d0:	8e040000 	lw	a0,0(s0)
+   1d1d4:	8fa5002c 	lw	a1,44(sp)
+   1d1d8:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d1dc:	24840010 	addiu	a0,a0,16
+   1d1e0:	8fa20028 	lw	v0,40(sp)
+   1d1e4:	10400008 	beqz	v0,1d208 <mapper_get_page+0x26c>
+   1d1e8:	8fbf00b4 	lw	ra,180(sp)
+   1d1ec:	16800003 	bnez	s4,1d1fc <mapper_get_page+0x260>
+   1d1f0:	27a40030 	addiu	a0,sp,48
+   1d1f4:	12400024 	beqz	s2,1d288 <mapper_get_page+0x2ec>
+   1d1f8:	00000000 	sll	zero,zero,0x0
+   1d1fc:	0c007134 	jal	1c4d0 <kmem_free>
+   1d200:	afa2003c 	sw	v0,60(sp)
+   1d204:	8fbf00b4 	lw	ra,180(sp)
+   1d208:	03c01021 	addu	v0,s8,zero
+   1d20c:	8fbe00b0 	lw	s8,176(sp)
+   1d210:	8fb700ac 	lw	s7,172(sp)
+   1d214:	8fb600a8 	lw	s6,168(sp)
+   1d218:	8fb500a4 	lw	s5,164(sp)
+   1d21c:	8fb400a0 	lw	s4,160(sp)
+   1d220:	8fb3009c 	lw	s3,156(sp)
+   1d224:	8fb20098 	lw	s2,152(sp)
+   1d228:	8fb10094 	lw	s1,148(sp)
+   1d22c:	8fb00090 	lw	s0,144(sp)
+   1d230:	03e00008 	jr	ra
+   1d234:	27bd00b8 	addiu	sp,sp,184
+   1d238:	26240004 	addiu	a0,s1,4
+   1d23c:	0c006d13 	jal	1b44c <wait_on>
+   1d240:	24050001 	addiu	a1,zero,1
+   1d244:	8e040000 	lw	a0,0(s0)
+   1d248:	8fa5002c 	lw	a1,44(sp)
+   1d24c:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d250:	24840010 	addiu	a0,a0,16
+   1d254:	40042002 	mfc0	a0,$4,2
+   1d258:	0c004634 	jal	118d0 <sched_sleep>
+   1d25c:	00000000 	sll	zero,zero,0x0
+   1d260:	08007400 	j	1d000 <mapper_get_page+0x64>
+   1d264:	8e040000 	lw	a0,0(s0)
+   1d268:	10e0ffd6 	beqz	a3,1d1c4 <mapper_get_page+0x228>
+   1d26c:	02402821 	addu	a1,s2,zero
+   1d270:	8e040000 	lw	a0,0(s0)
+   1d274:	248400e8 	addiu	a0,a0,232
+   1d278:	0c00377b 	jal	ddec <radix_item_info_apply>
+   1d27c:	00003021 	addu	a2,zero,zero
+   1d280:	08007472 	j	1d1c8 <mapper_get_page+0x22c>
+   1d284:	00409021 	addu	s2,v0,zero
+   1d288:	0c007134 	jal	1c4d0 <kmem_free>
+   1d28c:	afb1003c 	sw	s1,60(sp)
+   1d290:	8fbe0028 	lw	s8,40(sp)
+   1d294:	8fbf00b4 	lw	ra,180(sp)
+   1d298:	03c01021 	addu	v0,s8,zero
+   1d29c:	8fbe00b0 	lw	s8,176(sp)
+   1d2a0:	8fb700ac 	lw	s7,172(sp)
+   1d2a4:	8fb600a8 	lw	s6,168(sp)
+   1d2a8:	8fb500a4 	lw	s5,164(sp)
+   1d2ac:	8fb400a0 	lw	s4,160(sp)
+   1d2b0:	8fb3009c 	lw	s3,156(sp)
+   1d2b4:	8fb20098 	lw	s2,152(sp)
+   1d2b8:	8fb10094 	lw	s1,148(sp)
+   1d2bc:	8fb00090 	lw	s0,144(sp)
+   1d2c0:	03e00008 	jr	ra
+   1d2c4:	27bd00b8 	addiu	sp,sp,184
+   1d2c8:	8e040000 	lw	a0,0(s0)
+   1d2cc:	248400e8 	addiu	a0,a0,232
+   1d2d0:	00003021 	addu	a2,zero,zero
+   1d2d4:	0c00377b 	jal	ddec <radix_item_info_apply>
+   1d2d8:	02203821 	addu	a3,s1,zero
+   1d2dc:	1680ffb9 	bnez	s4,1d1c4 <mapper_get_page+0x228>
+   1d2e0:	8fa70028 	lw	a3,40(sp)
+   1d2e4:	0800749a 	j	1d268 <mapper_get_page+0x2cc>
+   1d2e8:	00000000 	sll	zero,zero,0x0
+   1d2ec:	27b10084 	addiu	s1,sp,132
+   1d2f0:	3c030100 	lui	v1,0x100
+   1d2f4:	3c050003 	lui	a1,0x3
+   1d2f8:	27a20060 	addiu	v0,sp,96
+   1d2fc:	34630001 	ori	v1,v1,0x1
+   1d300:	24a56f78 	addiu	a1,a1,28536
+   1d304:	02202021 	addu	a0,s1,zero
+   1d308:	afa50058 	sw	a1,88(sp)
+   1d30c:	afa20064 	sw	v0,100(sp)
+   1d310:	afa30054 	sw	v1,84(sp)
+   1d314:	afa20060 	sw	v0,96(sp)
+   1d318:	0c0019fe 	jal	67f8 <refcount_init>
+   1d31c:	afa0005c 	sw	zero,92(sp)
+   1d320:	0c004a27 	jal	1289c <spin_init>
+   1d324:	27a40088 	addiu	a0,sp,136
+   1d328:	8fa20054 	lw	v0,84(sp)
+   1d32c:	3c05ffff 	lui	a1,0xffff
+   1d330:	00021902 	srl	v1,v0,0x4
+   1d334:	30630ffe 	andi	v1,v1,0xffe
+   1d338:	34a5000f 	ori	a1,a1,0xf
+   1d33c:	34630008 	ori	v1,v1,0x8
+   1d340:	00451024 	and	v0,v0,a1
+   1d344:	00031900 	sll	v1,v1,0x4
+   1d348:	00431025 	or	v0,v0,v1
+   1d34c:	02202021 	addu	a0,s1,zero
+   1d350:	afa20054 	sw	v0,84(sp)
+   1d354:	afa00068 	sw	zero,104(sp)
+   1d358:	afa0006c 	sw	zero,108(sp)
+   1d35c:	0c001a00 	jal	6800 <refcount_up>
+   1d360:	afa00070 	sw	zero,112(sp)
+   1d364:	24020001 	addiu	v0,zero,1
+   1d368:	afb0006c 	sw	s0,108(sp)
+   1d36c:	afb30068 	sw	s3,104(sp)
+   1d370:	13c200ad 	beq	s8,v0,1d628 <mapper_get_page+0x68c>
+   1d374:	27b40054 	addiu	s4,sp,84
+   1d378:	8e040000 	lw	a0,0(s0)
+   1d37c:	02602821 	addu	a1,s3,zero
+   1d380:	248400e8 	addiu	a0,a0,232
+   1d384:	0c00359b 	jal	d66c <radix_tree_insert>
+   1d388:	02803021 	addu	a2,s4,zero
+   1d38c:	00408821 	addu	s1,v0,zero
+   1d390:	16200083 	bnez	s1,1d5a0 <mapper_get_page+0x604>
+   1d394:	8fa5002c 	lw	a1,44(sp)
+   1d398:	8e040000 	lw	a0,0(s0)
+   1d39c:	24840010 	addiu	a0,a0,16
+   1d3a0:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d3a4:	27b50030 	addiu	s5,sp,48
+   1d3a8:	0c00713f 	jal	1c4fc <kmem_alloc>
+   1d3ac:	02a02021 	addu	a0,s5,zero
+   1d3b0:	1040002e 	beqz	v0,1d46c <mapper_get_page+0x4d0>
+   1d3b4:	0040f021 	addu	s8,v0,zero
+   1d3b8:	8c420000 	lw	v0,0(v0)
+   1d3bc:	afd30014 	sw	s3,20(s8)
+   1d3c0:	34420080 	ori	v0,v0,0x80
+   1d3c4:	afc20000 	sw	v0,0(s8)
+   1d3c8:	8e020000 	lw	v0,0(s0)
+   1d3cc:	8fa500c0 	lw	a1,192(sp)
+   1d3d0:	8c4200a4 	lw	v0,164(v0)
+   1d3d4:	afd00018 	sw	s0,24(s8)
+   1d3d8:	8c420000 	lw	v0,0(v0)
+   1d3dc:	0040f809 	jalr	v0
+   1d3e0:	03c02021 	addu	a0,s8,zero
+   1d3e4:	14400051 	bnez	v0,1d52c <mapper_get_page+0x590>
+   1d3e8:	00408821 	addu	s1,v0,zero
+   1d3ec:	8e040000 	lw	a0,0(s0)
+   1d3f0:	02e02821 	addu	a1,s7,zero
+   1d3f4:	0c0030a1 	jal	c284 <mcs_lock>
+   1d3f8:	24840010 	addiu	a0,a0,16
+   1d3fc:	8e040000 	lw	a0,0(s0)
+   1d400:	02602821 	addu	a1,s3,zero
+   1d404:	02403021 	addu	a2,s2,zero
+   1d408:	0c003283 	jal	ca0c <radix_item_info_lookup>
+   1d40c:	248400e8 	addiu	a0,a0,232
+   1d410:	8e040000 	lw	a0,0(s0)
+   1d414:	02402821 	addu	a1,s2,zero
+   1d418:	00003021 	addu	a2,zero,zero
+   1d41c:	03c03821 	addu	a3,s8,zero
+   1d420:	0c00377b 	jal	ddec <radix_item_info_apply>
+   1d424:	248400e8 	addiu	a0,a0,232
+   1d428:	8fc20000 	lw	v0,0(s8)
+   1d42c:	2403ff7f 	addiu	v1,zero,-129
+   1d430:	00621024 	and	v0,v1,v0
+   1d434:	27a40058 	addiu	a0,sp,88
+   1d438:	0c006d29 	jal	1b4a4 <wakeup_all>
+   1d43c:	afc20000 	sw	v0,0(s8)
+   1d440:	8e040000 	lw	a0,0(s0)
+   1d444:	8fa5002c 	lw	a1,44(sp)
+   1d448:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d44c:	24840010 	addiu	a0,a0,16
+   1d450:	08007482 	j	1d208 <mapper_get_page+0x26c>
+   1d454:	8fbf00b4 	lw	ra,180(sp)
+   1d458:	8fa5002c 	lw	a1,44(sp)
+   1d45c:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d460:	24440010 	addiu	a0,v0,16
+   1d464:	08007482 	j	1d208 <mapper_get_page+0x26c>
+   1d468:	8fbf00b4 	lw	ra,180(sp)
+   1d46c:	8e040000 	lw	a0,0(s0)
+   1d470:	02e02821 	addu	a1,s7,zero
+   1d474:	0c0030a1 	jal	c284 <mcs_lock>
+   1d478:	24840010 	addiu	a0,a0,16
+   1d47c:	02802821 	addu	a1,s4,zero
+   1d480:	0c0072bd 	jal	1caf4 <mapper_add_page+0x84>
+   1d484:	02002021 	addu	a0,s0,zero
+   1d488:	0c006d29 	jal	1b4a4 <wakeup_all>
+   1d48c:	27a40058 	addiu	a0,sp,88
+   1d490:	8e040000 	lw	a0,0(s0)
+   1d494:	8fa5002c 	lw	a1,44(sp)
+   1d498:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d49c:	24840010 	addiu	a0,a0,16
+   1d4a0:	40067801 	mfc0	a2,$15,1
+   1d4a4:	40042002 	mfc0	a0,$4,2
+   1d4a8:	40032002 	mfc0	v1,$4,2
+   1d4ac:	40024800 	mfc0	v0,c0_count
+   1d4b0:	00000000 	sll	zero,zero,0x0
+   1d4b4:	3c050004 	lui	a1,0x4
+   1d4b8:	30c60003 	andi	a2,a2,0x3
+   1d4bc:	00063080 	sll	a2,a2,0x2
+   1d4c0:	24a5c950 	addiu	a1,a1,-14000
+   1d4c4:	00c52821 	addu	a1,a2,a1
+   1d4c8:	8ca50000 	lw	a1,0(a1)
+   1d4cc:	3c060003 	lui	a2,0x3
+   1d4d0:	afa50010 	sw	a1,16(sp)
+   1d4d4:	8c850180 	lw	a1,384(a0)
+   1d4d8:	3c040004 	lui	a0,0x4
+   1d4dc:	8ca505c4 	lw	a1,1476(a1)
+   1d4e0:	8c849100 	lw	a0,-28416(a0)
+   1d4e4:	afa50014 	sw	a1,20(sp)
+   1d4e8:	8c6302f8 	lw	v1,760(v1)
+   1d4ec:	3c070003 	lui	a3,0x3
+   1d4f0:	24c66d6c 	addiu	a2,a2,28012
+   1d4f4:	24e76e94 	addiu	a3,a3,28308
+   1d4f8:	00002821 	addu	a1,zero,zero
+   1d4fc:	afa30018 	sw	v1,24(sp)
+   1d500:	afb3001c 	sw	s3,28(sp)
+   1d504:	afa20024 	sw	v0,36(sp)
+   1d508:	0c0009b0 	jal	26c0 <__fprintk>
+   1d50c:	afb10020 	sw	s1,32(sp)
+   1d510:	40032002 	mfc0	v1,$4,2
+   1d514:	24020005 	addiu	v0,zero,5
+   1d518:	2404000c 	addiu	a0,zero,12
+   1d51c:	0091100a 	movz	v0,a0,s1
+   1d520:	ac620258 	sw	v0,600(v1)
+   1d524:	08007481 	j	1d204 <mapper_get_page+0x268>
+   1d528:	0000f021 	addu	s8,zero,zero
+   1d52c:	8e040000 	lw	a0,0(s0)
+   1d530:	02e02821 	addu	a1,s7,zero
+   1d534:	0c0030a1 	jal	c284 <mcs_lock>
+   1d538:	24840010 	addiu	a0,a0,16
+   1d53c:	02802821 	addu	a1,s4,zero
+   1d540:	0c0072bd 	jal	1caf4 <mapper_add_page+0x84>
+   1d544:	02002021 	addu	a0,s0,zero
+   1d548:	0c006d29 	jal	1b4a4 <wakeup_all>
+   1d54c:	27a40058 	addiu	a0,sp,88
+   1d550:	8e040000 	lw	a0,0(s0)
+   1d554:	8fa5002c 	lw	a1,44(sp)
+   1d558:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d55c:	24840010 	addiu	a0,a0,16
+   1d560:	8fc20000 	lw	v0,0(s8)
+   1d564:	00021102 	srl	v0,v0,0x4
+   1d568:	30420020 	andi	v0,v0,0x20
+   1d56c:	14400036 	bnez	v0,1d648 <mapper_get_page+0x6ac>
+   1d570:	00000000 	sll	zero,zero,0x0
+   1d574:	afc00018 	sw	zero,24(s8)
+   1d578:	02a02021 	addu	a0,s5,zero
+   1d57c:	0c007134 	jal	1c4d0 <kmem_free>
+   1d580:	afbe003c 	sw	s8,60(sp)
+   1d584:	08007528 	j	1d4a0 <mapper_get_page+0x504>
+   1d588:	00000000 	sll	zero,zero,0x0
+   1d58c:	8e040000 	lw	a0,0(s0)
+   1d590:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d594:	24840010 	addiu	a0,a0,16
+   1d598:	08007482 	j	1d208 <mapper_get_page+0x26c>
+   1d59c:	8fbf00b4 	lw	ra,180(sp)
+   1d5a0:	02802821 	addu	a1,s4,zero
+   1d5a4:	0c0072bd 	jal	1caf4 <mapper_add_page+0x84>
+   1d5a8:	02002021 	addu	a0,s0,zero
+   1d5ac:	8e040000 	lw	a0,0(s0)
+   1d5b0:	8fa5002c 	lw	a1,44(sp)
+   1d5b4:	0c003130 	jal	c4c0 <mcs_unlock>
+   1d5b8:	24840010 	addiu	a0,a0,16
+   1d5bc:	40057801 	mfc0	a1,$15,1
+   1d5c0:	40032002 	mfc0	v1,$4,2
+   1d5c4:	40022002 	mfc0	v0,$4,2
+   1d5c8:	3c040004 	lui	a0,0x4
+   1d5cc:	30a50003 	andi	a1,a1,0x3
+   1d5d0:	00052880 	sll	a1,a1,0x2
+   1d5d4:	2484c950 	addiu	a0,a0,-14000
+   1d5d8:	00a42021 	addu	a0,a1,a0
+   1d5dc:	8c840000 	lw	a0,0(a0)
+   1d5e0:	3c060003 	lui	a2,0x3
+   1d5e4:	afa40010 	sw	a0,16(sp)
+   1d5e8:	8c630180 	lw	v1,384(v1)
+   1d5ec:	3c040004 	lui	a0,0x4
+   1d5f0:	8c6305c4 	lw	v1,1476(v1)
+   1d5f4:	8c849100 	lw	a0,-28416(a0)
+   1d5f8:	afa30014 	sw	v1,20(sp)
+   1d5fc:	8c4202f8 	lw	v0,760(v0)
+   1d600:	3c070003 	lui	a3,0x3
+   1d604:	24c66d1c 	addiu	a2,a2,27932
+   1d608:	24e76e94 	addiu	a3,a3,28308
+   1d60c:	00002821 	addu	a1,zero,zero
+   1d610:	afa20018 	sw	v0,24(sp)
+   1d614:	0c0009b0 	jal	26c0 <__fprintk>
+   1d618:	afb1001c 	sw	s1,28(sp)
+   1d61c:	40032002 	mfc0	v1,$4,2
+   1d620:	08007545 	j	1d514 <mapper_get_page+0x578>
+   1d624:	3a31000c 	xori	s1,s1,0xc
+   1d628:	8e040000 	lw	a0,0(s0)
+   1d62c:	02402821 	addu	a1,s2,zero
+   1d630:	248400e8 	addiu	a0,a0,232
+   1d634:	24060002 	addiu	a2,zero,2
+   1d638:	0c00377b 	jal	ddec <radix_item_info_apply>
+   1d63c:	02803821 	addu	a3,s4,zero
+   1d640:	080074e4 	j	1d390 <mapper_get_page+0x3f4>
+   1d644:	00408821 	addu	s1,v0,zero
+   1d648:	0c001bab 	jal	6eac <blkio_destroy>
+   1d64c:	03c02021 	addu	a0,s8,zero
+   1d650:	0800755e 	j	1d578 <mapper_get_page+0x5dc>
+   1d654:	afc00018 	sw	zero,24(s8)
+
+0001d658 <__mapper_request_>:
+   1d658:	8c820000 	lw	v0,0(a0)
+   1d65c:	27bdff98 	addiu	sp,sp,-104
+   1d660:	afb7005c 	sw	s7,92(sp)
+   1d664:	afb00040 	sw	s0,64(sp)
+   1d668:	00073e00 	sll	a3,a3,0x18
+   1d66c:	8cb00004 	lw	s0,4(a1)
+   1d670:	8c5700a0 	lw	s7,160(v0)
+   1d674:	8ca30000 	lw	v1,0(a1)
+   1d678:	8fa20078 	lw	v0,120(sp)
+   1d67c:	00073e03 	sra	a3,a3,0x18
+   1d680:	afb10044 	sw	s1,68(sp)
+   1d684:	afbf0064 	sw	ra,100(sp)
+   1d688:	afbe0060 	sw	s8,96(sp)
+   1d68c:	afb60058 	sw	s6,88(sp)
+   1d690:	afb50054 	sw	s5,84(sp)
+   1d694:	afb40050 	sw	s4,80(sp)
+   1d698:	afb3004c 	sw	s3,76(sp)
+   1d69c:	afb20048 	sw	s2,72(sp)
+   1d6a0:	00a08821 	addu	s1,a1,zero
+   1d6a4:	afa40068 	sw	a0,104(sp)
+   1d6a8:	afa70038 	sw	a3,56(sp)
+   1d6ac:	ac400000 	sw	zero,0(v0)
+   1d6b0:	12000015 	beqz	s0,1d708 <__mapper_request_+0xb0>
+   1d6b4:	afa30030 	sw	v1,48(sp)
+   1d6b8:	8fa40030 	lw	a0,48(sp)
+   1d6bc:	108000e8 	beqz	a0,1da60 <__mapper_request_+0x408>
+   1d6c0:	00000000 	sll	zero,zero,0x0
+   1d6c4:	0c004408 	jal	11020 <rwlock_wrlock>
+   1d6c8:	24840050 	addiu	a0,a0,80
+   1d6cc:	8fa50030 	lw	a1,48(sp)
+   1d6d0:	8cb50004 	lw	s5,4(a1)
+   1d6d4:	8e22000c 	lw	v0,12(s1)
+   1d6d8:	8fa30038 	lw	v1,56(sp)
+   1d6dc:	10600017 	beqz	v1,1d73c <__mapper_request_+0xe4>
+   1d6e0:	afa20034 	sw	v0,52(sp)
+   1d6e4:	8ee30018 	lw	v1,24(s7)
+   1d6e8:	8ee4001c 	lw	a0,28(s7)
+   1d6ec:	00751023 	subu	v0,v1,s5
+   1d6f0:	0062182b 	sltu	v1,v1,v0
+   1d6f4:	108300d6 	beq	a0,v1,1da50 <__mapper_request_+0x3f8>
+   1d6f8:	0202182b 	sltu	v1,s0,v0
+   1d6fc:	02001021 	addu	v0,s0,zero
+   1d700:	080075d0 	j	1d740 <__mapper_request_+0xe8>
+   1d704:	afa2002c 	sw	v0,44(sp)
+   1d708:	00001021 	addu	v0,zero,zero
+   1d70c:	8fbf0064 	lw	ra,100(sp)
+   1d710:	8fbe0060 	lw	s8,96(sp)
+   1d714:	8fb7005c 	lw	s7,92(sp)
+   1d718:	8fb60058 	lw	s6,88(sp)
+   1d71c:	8fb50054 	lw	s5,84(sp)
+   1d720:	8fb40050 	lw	s4,80(sp)
+   1d724:	8fb3004c 	lw	s3,76(sp)
+   1d728:	8fb20048 	lw	s2,72(sp)
+   1d72c:	8fb10044 	lw	s1,68(sp)
+   1d730:	8fb00040 	lw	s0,64(sp)
+   1d734:	03e00008 	jr	ra
+   1d738:	27bd0068 	addiu	sp,sp,104
+   1d73c:	afb0002c 	sw	s0,44(sp)
+   1d740:	3c1e0004 	lui	s8,0x4
+   1d744:	0000b021 	addu	s6,zero,zero
+   1d748:	00001821 	addu	v1,zero,zero
+   1d74c:	afa00028 	sw	zero,40(sp)
+   1d750:	0000a021 	addu	s4,zero,zero
+   1d754:	00009821 	addu	s3,zero,zero
+   1d758:	8fa4002c 	lw	a0,44(sp)
+   1d75c:	10800100 	beqz	a0,1db60 <__mapper_request_+0x508>
+   1d760:	00000000 	sll	zero,zero,0x0
+   1d764:	106000e8 	beqz	v1,1db08 <__mapper_request_+0x4b0>
+   1d768:	8fa40068 	lw	a0,104(sp)
+   1d76c:	8fa20028 	lw	v0,40(sp)
+   1d770:	14400019 	bnez	v0,1d7d8 <__mapper_request_+0x180>
+   1d774:	8fa40038 	lw	a0,56(sp)
+   1d778:	8fa40034 	lw	a0,52(sp)
+   1d77c:	00041302 	srl	v0,a0,0xc
+   1d780:	8e240014 	lw	a0,20(s1)
+   1d784:	00021080 	sll	v0,v0,0x2
+   1d788:	00821021 	addu	v0,a0,v0
+   1d78c:	8c520000 	lw	s2,0(v0)
+   1d790:	124000b9 	beqz	s2,1da78 <__mapper_request_+0x420>
+   1d794:	02402021 	addu	a0,s2,zero
+   1d798:	0c007fbb 	jal	1feec <ppn_ppn2cid>
+   1d79c:	afa3003c 	sw	v1,60(sp)
+   1d7a0:	02402021 	addu	a0,s2,zero
+   1d7a4:	0c00802d 	jal	200b4 <ppn_ppn2vma>
+   1d7a8:	0040b021 	addu	s6,v0,zero
+   1d7ac:	8fa50034 	lw	a1,52(sp)
+   1d7b0:	8fa3003c 	lw	v1,60(sp)
+   1d7b4:	30b40fff 	andi	s4,a1,0xfff
+   1d7b8:	24051000 	addiu	a1,zero,4096
+   1d7bc:	00b42023 	subu	a0,a1,s4
+   1d7c0:	0204282b 	sltu	a1,s0,a0
+   1d7c4:	0205200b 	movn	a0,s0,a1
+   1d7c8:	afa40028 	sw	a0,40(sp)
+   1d7cc:	0054a021 	addu	s4,v0,s4
+   1d7d0:	8fa20028 	lw	v0,40(sp)
+   1d7d4:	8fa40038 	lw	a0,56(sp)
+   1d7d8:	0062902b 	sltu	s2,v1,v0
+   1d7dc:	0072100b 	movn	v0,v1,s2
+   1d7e0:	10800043 	beqz	a0,1d8f0 <__mapper_request_+0x298>
+   1d7e4:	00409021 	addu	s2,v0,zero
+   1d7e8:	3c050004 	lui	a1,0x4
+   1d7ec:	24a5c960 	addiu	a1,a1,-13984
+   1d7f0:	88a20003 	lwl	v0,3(a1)
+   1d7f4:	9bc2c960 	lwr	v0,-13984(s8)
+   1d7f8:	3042ffff 	andi	v0,v0,0xffff
+   1d7fc:	12c2007e 	beq	s6,v0,1d9f8 <__mapper_request_+0x3a0>
+   1d800:	2c440101 	sltiu	a0,v0,257
+   1d804:	1080009a 	beqz	a0,1da70 <__mapper_request_+0x418>
+   1d808:	00022100 	sll	a0,v0,0x4
+   1d80c:	00021080 	sll	v0,v0,0x2
+   1d810:	00821023 	subu	v0,a0,v0
+   1d814:	3c040004 	lui	a0,0x4
+   1d818:	2484c9a0 	addiu	a0,a0,-13920
+   1d81c:	00821021 	addu	v0,a0,v0
+   1d820:	8c450000 	lw	a1,0(v0)
+   1d824:	3c025555 	lui	v0,0x5555
+   1d828:	34425555 	ori	v0,v0,0x5555
+   1d82c:	10a20090 	beq	a1,v0,1da70 <__mapper_request_+0x418>
+   1d830:	2ec20101 	sltiu	v0,s6,257
+   1d834:	104000b2 	beqz	v0,1db00 <__mapper_request_+0x4a8>
+   1d838:	00162100 	sll	a0,s6,0x4
+   1d83c:	00161080 	sll	v0,s6,0x2
+   1d840:	00821023 	subu	v0,a0,v0
+   1d844:	3c040004 	lui	a0,0x4
+   1d848:	2484c9a0 	addiu	a0,a0,-13920
+   1d84c:	00821021 	addu	v0,a0,v0
+   1d850:	8c460000 	lw	a2,0(v0)
+   1d854:	3c025555 	lui	v0,0x5555
+   1d858:	34425555 	ori	v0,v0,0x5555
+   1d85c:	10c200a8 	beq	a2,v0,1db00 <__mapper_request_+0x4a8>
+   1d860:	02931025 	or	v0,s4,s3
+   1d864:	30420003 	andi	v0,v0,0x3
+   1d868:	104000a2 	beqz	v0,1daf4 <__mapper_request_+0x49c>
+   1d86c:	00000000 	sll	zero,zero,0x0
+   1d870:	00001021 	addu	v0,zero,zero
+   1d874:	00003821 	addu	a3,zero,zero
+   1d878:	08007629 	j	1d8a4 <__mapper_request_+0x24c>
+   1d87c:	00002021 	addu	a0,zero,zero
+   1d880:	028a5821 	addu	t3,s4,t2
+   1d884:	026a5021 	addu	t2,s3,t2
+   1d888:	4808c000 	mfc2	t0,$24
+   1d88c:	4885c000 	mtc2	a1,$24
+   1d890:	8d490000 	lw	t1,0(t2)
+   1d894:	4886c000 	mtc2	a2,$24
+   1d898:	ad690000 	sw	t1,0(t3)
+   1d89c:	4888c000 	mtc2	t0,$24
+   1d8a0:	24840001 	addiu	a0,a0,1
+   1d8a4:	1487fff6 	bne	a0,a3,1d880 <__mapper_request_+0x228>
+   1d8a8:	00045080 	sll	t2,a0,0x2
+   1d8ac:	02623821 	addu	a3,s3,v0
+   1d8b0:	08007637 	j	1d8dc <__mapper_request_+0x284>
+   1d8b4:	02822021 	addu	a0,s4,v0
+   1d8b8:	4808c000 	mfc2	t0,$24
+   1d8bc:	4885c000 	mtc2	a1,$24
+   1d8c0:	80e90000 	lb	t1,0(a3)
+   1d8c4:	4886c000 	mtc2	a2,$24
+   1d8c8:	a0890000 	sb	t1,0(a0)
+   1d8cc:	4888c000 	mtc2	t0,$24
+   1d8d0:	24420001 	addiu	v0,v0,1
+   1d8d4:	24e70001 	addiu	a3,a3,1
+   1d8d8:	24840001 	addiu	a0,a0,1
+   1d8dc:	0052402b 	sltu	t0,v0,s2
+   1d8e0:	1500fff5 	bnez	t0,1d8b8 <__mapper_request_+0x260>
+   1d8e4:	00000000 	sll	zero,zero,0x0
+   1d8e8:	08007685 	j	1da14 <__mapper_request_+0x3bc>
+   1d8ec:	02128023 	subu	s0,s0,s2
+   1d8f0:	3c040004 	lui	a0,0x4
+   1d8f4:	2484c960 	addiu	a0,a0,-13984
+   1d8f8:	88820003 	lwl	v0,3(a0)
+   1d8fc:	9bc2c960 	lwr	v0,-13984(s8)
+   1d900:	3042ffff 	andi	v0,v0,0xffff
+   1d904:	12c2008f 	beq	s6,v0,1db44 <__mapper_request_+0x4ec>
+   1d908:	2ec40101 	sltiu	a0,s6,257
+   1d90c:	10800056 	beqz	a0,1da68 <__mapper_request_+0x410>
+   1d910:	00162900 	sll	a1,s6,0x4
+   1d914:	00162080 	sll	a0,s6,0x2
+   1d918:	00a42023 	subu	a0,a1,a0
+   1d91c:	3c050004 	lui	a1,0x4
+   1d920:	24a5c9a0 	addiu	a1,a1,-13920
+   1d924:	00a42021 	addu	a0,a1,a0
+   1d928:	8c850000 	lw	a1,0(a0)
+   1d92c:	3c045555 	lui	a0,0x5555
+   1d930:	34845555 	ori	a0,a0,0x5555
+   1d934:	10a4004c 	beq	a1,a0,1da68 <__mapper_request_+0x410>
+   1d938:	2c440101 	sltiu	a0,v0,257
+   1d93c:	108000a3 	beqz	a0,1dbcc <__mapper_request_+0x574>
+   1d940:	00022100 	sll	a0,v0,0x4
+   1d944:	00021080 	sll	v0,v0,0x2
+   1d948:	00821023 	subu	v0,a0,v0
+   1d94c:	3c040004 	lui	a0,0x4
+   1d950:	2484c9a0 	addiu	a0,a0,-13920
+   1d954:	00821021 	addu	v0,a0,v0
+   1d958:	8c460000 	lw	a2,0(v0)
+   1d95c:	3c025555 	lui	v0,0x5555
+   1d960:	34425555 	ori	v0,v0,0x5555
+   1d964:	10c20099 	beq	a2,v0,1dbcc <__mapper_request_+0x574>
+   1d968:	02931025 	or	v0,s4,s3
+   1d96c:	30420003 	andi	v0,v0,0x3
+   1d970:	1040009a 	beqz	v0,1dbdc <__mapper_request_+0x584>
+   1d974:	00000000 	sll	zero,zero,0x0
+   1d978:	00001021 	addu	v0,zero,zero
+   1d97c:	00003821 	addu	a3,zero,zero
+   1d980:	0800766b 	j	1d9ac <__mapper_request_+0x354>
+   1d984:	00002021 	addu	a0,zero,zero
+   1d988:	026a5821 	addu	t3,s3,t2
+   1d98c:	028a5021 	addu	t2,s4,t2
+   1d990:	4808c000 	mfc2	t0,$24
+   1d994:	4885c000 	mtc2	a1,$24
+   1d998:	8d490000 	lw	t1,0(t2)
+   1d99c:	4886c000 	mtc2	a2,$24
+   1d9a0:	ad690000 	sw	t1,0(t3)
+   1d9a4:	4888c000 	mtc2	t0,$24
+   1d9a8:	24840001 	addiu	a0,a0,1
+   1d9ac:	1487fff6 	bne	a0,a3,1d988 <__mapper_request_+0x330>
+   1d9b0:	00045080 	sll	t2,a0,0x2
+   1d9b4:	02823821 	addu	a3,s4,v0
+   1d9b8:	08007679 	j	1d9e4 <__mapper_request_+0x38c>
+   1d9bc:	02622021 	addu	a0,s3,v0
+   1d9c0:	4808c000 	mfc2	t0,$24
+   1d9c4:	4885c000 	mtc2	a1,$24
+   1d9c8:	80e90000 	lb	t1,0(a3)
+   1d9cc:	4886c000 	mtc2	a2,$24
+   1d9d0:	a0890000 	sb	t1,0(a0)
+   1d9d4:	4888c000 	mtc2	t0,$24
+   1d9d8:	24420001 	addiu	v0,v0,1
+   1d9dc:	24e70001 	addiu	a3,a3,1
+   1d9e0:	24840001 	addiu	a0,a0,1
+   1d9e4:	0052402b 	sltu	t0,v0,s2
+   1d9e8:	1500fff5 	bnez	t0,1d9c0 <__mapper_request_+0x368>
+   1d9ec:	00000000 	sll	zero,zero,0x0
+   1d9f0:	08007685 	j	1da14 <__mapper_request_+0x3bc>
+   1d9f4:	02128023 	subu	s0,s0,s2
+   1d9f8:	02802021 	addu	a0,s4,zero
+   1d9fc:	02602821 	addu	a1,s3,zero
+   1da00:	02403021 	addu	a2,s2,zero
+   1da04:	0c00c12b 	jal	304ac <memcpy>
+   1da08:	afa3003c 	sw	v1,60(sp)
+   1da0c:	8fa3003c 	lw	v1,60(sp)
+   1da10:	02128023 	subu	s0,s0,s2
+   1da14:	12000052 	beqz	s0,1db60 <__mapper_request_+0x508>
+   1da18:	02b2a821 	addu	s5,s5,s2
+   1da1c:	8fa40034 	lw	a0,52(sp)
+   1da20:	8fa50028 	lw	a1,40(sp)
+   1da24:	8fa2002c 	lw	v0,44(sp)
+   1da28:	00922021 	addu	a0,a0,s2
+   1da2c:	00b22823 	subu	a1,a1,s2
+   1da30:	00521023 	subu	v0,v0,s2
+   1da34:	afa40034 	sw	a0,52(sp)
+   1da38:	afa50028 	sw	a1,40(sp)
+   1da3c:	00721823 	subu	v1,v1,s2
+   1da40:	afa2002c 	sw	v0,44(sp)
+   1da44:	02729821 	addu	s3,s3,s2
+   1da48:	080075d6 	j	1d758 <__mapper_request_+0x100>
+   1da4c:	0292a021 	addu	s4,s4,s2
+   1da50:	1060ff2b 	beqz	v1,1d700 <__mapper_request_+0xa8>
+   1da54:	00000000 	sll	zero,zero,0x0
+   1da58:	080075c0 	j	1d700 <__mapper_request_+0xa8>
+   1da5c:	02001021 	addu	v0,s0,zero
+   1da60:	080075b5 	j	1d6d4 <__mapper_request_+0x7c>
+   1da64:	8cb50008 	lw	s5,8(a1)
+   1da68:	0800769a 	j	1da68 <__mapper_request_+0x410>
+   1da6c:	00000000 	sll	zero,zero,0x0
+   1da70:	0800769c 	j	1da70 <__mapper_request_+0x418>
+   1da74:	00000000 	sll	zero,zero,0x0
+   1da78:	40064800 	mfc0	a2,c0_count
+   1da7c:	00000000 	sll	zero,zero,0x0
+   1da80:	40042002 	mfc0	a0,$4,2
+   1da84:	40032002 	mfc0	v1,$4,2
+   1da88:	40082002 	mfc0	t0,$4,2
+   1da8c:	40057801 	mfc0	a1,$15,1
+   1da90:	40024800 	mfc0	v0,c0_count
+   1da94:	00000000 	sll	zero,zero,0x0
+   1da98:	3c070003 	lui	a3,0x3
+   1da9c:	24e76e30 	addiu	a3,a3,28208
+   1daa0:	afa70010 	sw	a3,16(sp)
+   1daa4:	afa40014 	sw	a0,20(sp)
+   1daa8:	8c640174 	lw	a0,372(v1)
+   1daac:	30a50003 	andi	a1,a1,0x3
+   1dab0:	3c030004 	lui	v1,0x4
+   1dab4:	00052880 	sll	a1,a1,0x2
+   1dab8:	2463c950 	addiu	v1,v1,-14000
+   1dabc:	00a31821 	addu	v1,a1,v1
+   1dac0:	8c890004 	lw	t1,4(a0)
+   1dac4:	8c630000 	lw	v1,0(v1)
+   1dac8:	3c050003 	lui	a1,0x3
+   1dacc:	24a56dc4 	addiu	a1,a1,28100
+   1dad0:	00002021 	addu	a0,zero,zero
+   1dad4:	240702d2 	addiu	a3,zero,722
+   1dad8:	afa90018 	sw	t1,24(sp)
+   1dadc:	afa8001c 	sw	t0,28(sp)
+   1dae0:	afa30020 	sw	v1,32(sp)
+   1dae4:	0c00097d 	jal	25f4 <__perror>
+   1dae8:	afa20024 	sw	v0,36(sp)
+   1daec:	080076bb 	j	1daec <__mapper_request_+0x494>
+   1daf0:	00000000 	sll	zero,zero,0x0
+   1daf4:	00123882 	srl	a3,s2,0x2
+   1daf8:	0800761e 	j	1d878 <__mapper_request_+0x220>
+   1dafc:	00071080 	sll	v0,a3,0x2
+   1db00:	080076c0 	j	1db00 <__mapper_request_+0x4a8>
+   1db04:	00000000 	sll	zero,zero,0x0
+   1db08:	00152b02 	srl	a1,s5,0xc
+   1db0c:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   1db10:	24060001 	addiu	a2,zero,1
+   1db14:	1040002f 	beqz	v0,1dbd4 <__mapper_request_+0x57c>
+   1db18:	00000000 	sll	zero,zero,0x0
+   1db1c:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1db20:	00402021 	addu	a0,v0,zero
+   1db24:	32b30fff 	andi	s3,s5,0xfff
+   1db28:	24041000 	addiu	a0,zero,4096
+   1db2c:	8fa5002c 	lw	a1,44(sp)
+   1db30:	00931823 	subu	v1,a0,s3
+   1db34:	00a3202b 	sltu	a0,a1,v1
+   1db38:	00a4180b 	movn	v1,a1,a0
+   1db3c:	080075db 	j	1d76c <__mapper_request_+0x114>
+   1db40:	00539821 	addu	s3,v0,s3
+   1db44:	02602021 	addu	a0,s3,zero
+   1db48:	02802821 	addu	a1,s4,zero
+   1db4c:	02403021 	addu	a2,s2,zero
+   1db50:	0c00c12b 	jal	304ac <memcpy>
+   1db54:	afa3003c 	sw	v1,60(sp)
+   1db58:	08007684 	j	1da10 <__mapper_request_+0x3b8>
+   1db5c:	8fa3003c 	lw	v1,60(sp)
+   1db60:	8ee2001c 	lw	v0,28(s7)
+   1db64:	1040000d 	beqz	v0,1db9c <__mapper_request_+0x544>
+   1db68:	00000000 	sll	zero,zero,0x0
+   1db6c:	8fa50030 	lw	a1,48(sp)
+   1db70:	10a00004 	beqz	a1,1db84 <__mapper_request_+0x52c>
+   1db74:	00000000 	sll	zero,zero,0x0
+   1db78:	acb50004 	sw	s5,4(a1)
+   1db7c:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   1db80:	24a40050 	addiu	a0,a1,80
+   1db84:	8e230004 	lw	v1,4(s1)
+   1db88:	00001021 	addu	v0,zero,zero
+   1db8c:	00708023 	subu	s0,v1,s0
+   1db90:	8fa30078 	lw	v1,120(sp)
+   1db94:	080075c3 	j	1d70c <__mapper_request_+0xb4>
+   1db98:	ac700000 	sw	s0,0(v1)
+   1db9c:	8ee20018 	lw	v0,24(s7)
+   1dba0:	0055102b 	sltu	v0,v0,s5
+   1dba4:	1040fff1 	beqz	v0,1db6c <__mapper_request_+0x514>
+   1dba8:	00000000 	sll	zero,zero,0x0
+   1dbac:	8ee20014 	lw	v0,20(s7)
+   1dbb0:	aef50018 	sw	s5,24(s7)
+   1dbb4:	34420004 	ori	v0,v0,0x4
+   1dbb8:	aee20014 	sw	v0,20(s7)
+   1dbbc:	aee0001c 	sw	zero,28(s7)
+   1dbc0:	0000000f 	sync
+   1dbc4:	080076dc 	j	1db70 <__mapper_request_+0x518>
+   1dbc8:	8fa50030 	lw	a1,48(sp)
+   1dbcc:	080076f3 	j	1dbcc <__mapper_request_+0x574>
+   1dbd0:	00000000 	sll	zero,zero,0x0
+   1dbd4:	080075c3 	j	1d70c <__mapper_request_+0xb4>
+   1dbd8:	2402fffb 	addiu	v0,zero,-5
+   1dbdc:	00123882 	srl	a3,s2,0x2
+   1dbe0:	08007660 	j	1d980 <__mapper_request_+0x328>
+   1dbe4:	00071080 	sll	v0,a3,0x2
+
+0001dbe8 <__mapper_request_main>:
+   1dbe8:	27bdffc0 	addiu	sp,sp,-64
+   1dbec:	afb40038 	sw	s4,56(sp)
+   1dbf0:	8fb40050 	lw	s4,80(sp)
+   1dbf4:	afb00028 	sw	s0,40(sp)
+   1dbf8:	8fb00060 	lw	s0,96(sp)
+   1dbfc:	8fa50054 	lw	a1,84(sp)
+   1dc00:	8e830000 	lw	v1,0(s4)
+   1dc04:	8fa40058 	lw	a0,88(sp)
+   1dc08:	32020001 	andi	v0,s0,0x1
+   1dc0c:	afb30034 	sw	s3,52(sp)
+   1dc10:	afb20030 	sw	s2,48(sp)
+   1dc14:	afb1002c 	sw	s1,44(sp)
+   1dc18:	00e09021 	addu	s2,a3,zero
+   1dc1c:	00c08821 	addu	s1,a2,zero
+   1dc20:	afbf003c 	sw	ra,60(sp)
+   1dc24:	aca40014 	sw	a0,20(a1)
+   1dc28:	8c7300a0 	lw	s3,160(v1)
+   1dc2c:	8fa6005c 	lw	a2,92(sp)
+   1dc30:	1040000a 	beqz	v0,1dc5c <__mapper_request_main+0x74>
+   1dc34:	32070004 	andi	a3,s0,0x4
+   1dc38:	10e00016 	beqz	a3,1dc94 <__mapper_request_main+0xac>
+   1dc3c:	266400e0 	addiu	a0,s3,224
+   1dc40:	afa5001c 	sw	a1,28(sp)
+   1dc44:	afa60020 	sw	a2,32(sp)
+   1dc48:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   1dc4c:	afa70018 	sw	a3,24(sp)
+   1dc50:	8fa5001c 	lw	a1,28(sp)
+   1dc54:	8fa60020 	lw	a2,32(sp)
+   1dc58:	8fa70018 	lw	a3,24(sp)
+   1dc5c:	02802021 	addu	a0,s4,zero
+   1dc60:	afb20010 	sw	s2,16(sp)
+   1dc64:	0c007596 	jal	1d658 <__mapper_request_>
+   1dc68:	32100002 	andi	s0,s0,0x2
+   1dc6c:	16000016 	bnez	s0,1dcc8 <__mapper_request_main+0xe0>
+   1dc70:	ae220000 	sw	v0,0(s1)
+   1dc74:	8fbf003c 	lw	ra,60(sp)
+   1dc78:	8fb40038 	lw	s4,56(sp)
+   1dc7c:	8fb30034 	lw	s3,52(sp)
+   1dc80:	8fb20030 	lw	s2,48(sp)
+   1dc84:	8fb1002c 	lw	s1,44(sp)
+   1dc88:	8fb00028 	lw	s0,40(sp)
+   1dc8c:	03e00008 	jr	ra
+   1dc90:	27bd0040 	addiu	sp,sp,64
+   1dc94:	afa5001c 	sw	a1,28(sp)
+   1dc98:	afa60020 	sw	a2,32(sp)
+   1dc9c:	0c004408 	jal	11020 <rwlock_wrlock>
+   1dca0:	afa70018 	sw	a3,24(sp)
+   1dca4:	8fa70018 	lw	a3,24(sp)
+   1dca8:	8fa60020 	lw	a2,32(sp)
+   1dcac:	8fa5001c 	lw	a1,28(sp)
+   1dcb0:	02802021 	addu	a0,s4,zero
+   1dcb4:	afb20010 	sw	s2,16(sp)
+   1dcb8:	0c007596 	jal	1d658 <__mapper_request_>
+   1dcbc:	32100002 	andi	s0,s0,0x2
+   1dcc0:	1200ffec 	beqz	s0,1dc74 <__mapper_request_main+0x8c>
+   1dcc4:	ae220000 	sw	v0,0(s1)
+   1dcc8:	266400e0 	addiu	a0,s3,224
+   1dccc:	8fbf003c 	lw	ra,60(sp)
+   1dcd0:	8fb40038 	lw	s4,56(sp)
+   1dcd4:	8fb30034 	lw	s3,52(sp)
+   1dcd8:	8fb20030 	lw	s2,48(sp)
+   1dcdc:	8fb1002c 	lw	s1,44(sp)
+   1dce0:	8fb00028 	lw	s0,40(sp)
+   1dce4:	080043a5 	j	10e94 <rwlock_unlock>
+   1dce8:	27bd0040 	addiu	sp,sp,64
+
+0001dcec <__mapper_request_demarshall>:
+   1dcec:	27bdffa0 	addiu	sp,sp,-96
+   1dcf0:	afbf005c 	sw	ra,92(sp)
+   1dcf4:	afbe0058 	sw	s8,88(sp)
+   1dcf8:	afb70054 	sw	s7,84(sp)
+   1dcfc:	03a0f021 	addu	s8,sp,zero
+   1dd00:	afb60050 	sw	s6,80(sp)
+   1dd04:	afb5004c 	sw	s5,76(sp)
+   1dd08:	afb40048 	sw	s4,72(sp)
+   1dd0c:	afb30044 	sw	s3,68(sp)
+   1dd10:	afb20040 	sw	s2,64(sp)
+   1dd14:	afb1003c 	sw	s1,60(sp)
+   1dd18:	afb00038 	sw	s0,56(sp)
+   1dd1c:	27bdfff0 	addiu	sp,sp,-16
+   1dd20:	27b30028 	addiu	s3,sp,40
+   1dd24:	27bdffc0 	addiu	sp,sp,-64
+   1dd28:	27b10028 	addiu	s1,sp,40
+   1dd2c:	00808021 	addu	s0,a0,zero
+   1dd30:	26230030 	addiu	v1,s1,48
+   1dd34:	2624002c 	addiu	a0,s1,44
+   1dd38:	ae630004 	sw	v1,4(s3)
+   1dd3c:	24020004 	addiu	v0,zero,4
+   1dd40:	24050034 	addiu	a1,zero,52
+   1dd44:	ae640000 	sw	a0,0(s3)
+   1dd48:	8e150000 	lw	s5,0(s0)
+   1dd4c:	ae250008 	sw	a1,8(s1)
+   1dd50:	ae220028 	sw	v0,40(s1)
+   1dd54:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1dd58:	ae220024 	sw	v0,36(s1)
+   1dd5c:	8e670004 	lw	a3,4(s3)
+   1dd60:	8e660000 	lw	a2,0(s3)
+   1dd64:	02002021 	addu	a0,s0,zero
+   1dd68:	00002821 	addu	a1,zero,zero
+   1dd6c:	afc60030 	sw	a2,48(s8)
+   1dd70:	afc7002c 	sw	a3,44(s8)
+   1dd74:	8e120000 	lw	s2,0(s0)
+   1dd78:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1dd7c:	0040a021 	addu	s4,v0,zero
+   1dd80:	8c430000 	lw	v1,0(v0)
+   1dd84:	02002021 	addu	a0,s0,zero
+   1dd88:	24050001 	addiu	a1,zero,1
+   1dd8c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1dd90:	afc30028 	sw	v1,40(s8)
+   1dd94:	02002021 	addu	a0,s0,zero
+   1dd98:	24050002 	addiu	a1,zero,2
+   1dd9c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1dda0:	0040b821 	addu	s7,v0,zero
+   1dda4:	02002021 	addu	a0,s0,zero
+   1dda8:	24050003 	addiu	a1,zero,3
+   1ddac:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1ddb0:	0040b021 	addu	s6,v0,zero
+   1ddb4:	02002021 	addu	a0,s0,zero
+   1ddb8:	24050004 	addiu	a1,zero,4
+   1ddbc:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1ddc0:	8c530000 	lw	s3,0(v0)
+   1ddc4:	02b4001b 	divu	zero,s5,s4
+   1ddc8:	028001f4 	teq	s4,zero,0x7
+   1ddcc:	8fc30028 	lw	v1,40(s8)
+   1ddd0:	afb70014 	sw	s7,20(sp)
+   1ddd4:	afa30010 	sw	v1,16(sp)
+   1ddd8:	afb60018 	sw	s6,24(sp)
+   1dddc:	afb3001c 	sw	s3,28(sp)
+   1dde0:	8c420000 	lw	v0,0(v0)
+   1dde4:	8fc60030 	lw	a2,48(s8)
+   1dde8:	8fc7002c 	lw	a3,44(s8)
+   1ddec:	02402821 	addu	a1,s2,zero
+   1ddf0:	afa20020 	sw	v0,32(sp)
+   1ddf4:	00002012 	mflo	a0
+   1ddf8:	0c0076fa 	jal	1dbe8 <__mapper_request_main>
+   1ddfc:	3084ffff 	andi	a0,a0,0xffff
+   1de00:	02002021 	addu	a0,s0,zero
+   1de04:	02202821 	addu	a1,s1,zero
+   1de08:	24060034 	addiu	a2,zero,52
+   1de0c:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   1de10:	24070002 	addiu	a3,zero,2
+   1de14:	03c0e821 	addu	sp,s8,zero
+   1de18:	8fbf005c 	lw	ra,92(sp)
+   1de1c:	8fbe0058 	lw	s8,88(sp)
+   1de20:	8fb70054 	lw	s7,84(sp)
+   1de24:	8fb60050 	lw	s6,80(sp)
+   1de28:	8fb5004c 	lw	s5,76(sp)
+   1de2c:	8fb40048 	lw	s4,72(sp)
+   1de30:	8fb30044 	lw	s3,68(sp)
+   1de34:	8fb20040 	lw	s2,64(sp)
+   1de38:	8fb1003c 	lw	s1,60(sp)
+   1de3c:	8fb00038 	lw	s0,56(sp)
+   1de40:	03e00008 	jr	ra
+   1de44:	27bd0060 	addiu	sp,sp,96
+
+0001de48 <__mapper_request_local>:
+   1de48:	27bdffd0 	addiu	sp,sp,-48
+   1de4c:	afbf002c 	sw	ra,44(sp)
+   1de50:	00805821 	addu	t3,a0,zero
+   1de54:	00a05021 	addu	t2,a1,zero
+   1de58:	00e04021 	addu	t0,a3,zero
+   1de5c:	40037801 	mfc0	v1,$15,1
+   1de60:	3c020004 	lui	v0,0x4
+   1de64:	2444c960 	addiu	a0,v0,-13984
+   1de68:	88840003 	lwl	a0,3(a0)
+   1de6c:	30630003 	andi	v1,v1,0x3
+   1de70:	3c050004 	lui	a1,0x4
+   1de74:	9844c960 	lwr	a0,-13984(v0)
+   1de78:	24a5c950 	addiu	a1,a1,-14000
+   1de7c:	8fa20044 	lw	v0,68(sp)
+   1de80:	00031880 	sll	v1,v1,0x2
+   1de84:	00651821 	addu	v1,v1,a1
+   1de88:	8c650000 	lw	a1,0(v1)
+   1de8c:	8c430000 	lw	v1,0(v0)
+   1de90:	8fa20048 	lw	v0,72(sp)
+   1de94:	8cc90000 	lw	t1,0(a2)
+   1de98:	8c420000 	lw	v0,0(v0)
+   1de9c:	afa80014 	sw	t0,20(sp)
+   1dea0:	8fa80040 	lw	t0,64(sp)
+   1dea4:	3084ffff 	andi	a0,a0,0xffff
+   1dea8:	01603021 	addu	a2,t3,zero
+   1deac:	01403821 	addu	a3,t2,zero
+   1deb0:	afa90010 	sw	t1,16(sp)
+   1deb4:	afa80018 	sw	t0,24(sp)
+   1deb8:	afa3001c 	sw	v1,28(sp)
+   1debc:	0c0076fa 	jal	1dbe8 <__mapper_request_main>
+   1dec0:	afa20020 	sw	v0,32(sp)
+   1dec4:	8fbf002c 	lw	ra,44(sp)
+   1dec8:	03e00008 	jr	ra
+   1decc:	27bd0030 	addiu	sp,sp,48
+
+0001ded0 <mapper_request>:
+   1ded0:	00073e00 	sll	a3,a3,0x18
+   1ded4:	27bdff58 	addiu	sp,sp,-168
+   1ded8:	24020001 	addiu	v0,zero,1
+   1dedc:	00073e03 	sra	a3,a3,0x18
+   1dee0:	afb20088 	sw	s2,136(sp)
+   1dee4:	afbf00a4 	sw	ra,164(sp)
+   1dee8:	afbe00a0 	sw	s8,160(sp)
+   1deec:	afb7009c 	sw	s7,156(sp)
+   1def0:	afb60098 	sw	s6,152(sp)
+   1def4:	afb50094 	sw	s5,148(sp)
+   1def8:	afb40090 	sw	s4,144(sp)
+   1defc:	afb3008c 	sw	s3,140(sp)
+   1df00:	afb10084 	sw	s1,132(sp)
+   1df04:	afb00080 	sw	s0,128(sp)
+   1df08:	afa2002c 	sw	v0,44(sp)
+   1df0c:	afa400a8 	sw	a0,168(sp)
+   1df10:	00a09021 	addu	s2,a1,zero
+   1df14:	afa600b0 	sw	a2,176(sp)
+   1df18:	10e00003 	beqz	a3,1df28 <mapper_request+0x58>
+   1df1c:	afa00030 	sw	zero,48(sp)
+   1df20:	24020005 	addiu	v0,zero,5
+   1df24:	afa2002c 	sw	v0,44(sp)
+   1df28:	8fa200b0 	lw	v0,176(sp)
+   1df2c:	1040005f 	beqz	v0,1e0ac <mapper_request+0x1dc>
+   1df30:	8fa500a8 	lw	a1,168(sp)
+   1df34:	2444ffff 	addiu	a0,v0,-1
+   1df38:	3c130004 	lui	s3,0x4
+   1df3c:	afa40070 	sw	a0,112(sp)
+   1df40:	24be0004 	addiu	s8,a1,4
+   1df44:	00008821 	addu	s1,zero,zero
+   1df48:	27b70030 	addiu	s7,sp,48
+   1df4c:	27b60028 	addiu	s6,sp,40
+   1df50:	27b500b8 	addiu	s5,sp,184
+   1df54:	27b4002c 	addiu	s4,sp,44
+   1df58:	08007814 	j	1e050 <mapper_request+0x180>
+   1df5c:	24100004 	addiu	s0,zero,4
+   1df60:	3c020004 	lui	v0,0x4
+   1df64:	2442c960 	addiu	v0,v0,-13984
+   1df68:	88440003 	lwl	a0,3(v0)
+   1df6c:	8e450010 	lw	a1,16(s2)
+   1df70:	8fa600a8 	lw	a2,168(sp)
+   1df74:	9a64c960 	lwr	a0,-13984(s3)
+   1df78:	00052880 	sll	a1,a1,0x2
+   1df7c:	8e420014 	lw	v0,20(s2)
+   1df80:	94c30008 	lhu	v1,8(a2)
+   1df84:	afa50060 	sw	a1,96(sp)
+   1df88:	3084ffff 	andi	a0,a0,0xffff
+   1df8c:	24050018 	addiu	a1,zero,24
+   1df90:	afb70034 	sw	s7,52(sp)
+   1df94:	afb60038 	sw	s6,56(sp)
+   1df98:	afb0003c 	sw	s0,60(sp)
+   1df9c:	afb00040 	sw	s0,64(sp)
+   1dfa0:	afbe0044 	sw	s8,68(sp)
+   1dfa4:	afb20048 	sw	s2,72(sp)
+   1dfa8:	afa2004c 	sw	v0,76(sp)
+   1dfac:	afb50050 	sw	s5,80(sp)
+   1dfb0:	afb40054 	sw	s4,84(sp)
+   1dfb4:	afb00058 	sw	s0,88(sp)
+   1dfb8:	afa5005c 	sw	a1,92(sp)
+   1dfbc:	afb00064 	sw	s0,100(sp)
+   1dfc0:	1064002a 	beq	v1,a0,1e06c <mapper_request+0x19c>
+   1dfc4:	afb00068 	sw	s0,104(sp)
+   1dfc8:	40047801 	mfc0	a0,$15,1
+   1dfcc:	afa30078 	sw	v1,120(sp)
+   1dfd0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1dfd4:	afa40074 	sw	a0,116(sp)
+   1dfd8:	8fa30078 	lw	v1,120(sp)
+   1dfdc:	8fa40074 	lw	a0,116(sp)
+   1dfe0:	70432802 	mul	a1,v0,v1
+   1dfe4:	24020002 	addiu	v0,zero,2
+   1dfe8:	afa20010 	sw	v0,16(sp)
+   1dfec:	24020005 	addiu	v0,zero,5
+   1dff0:	afa20014 	sw	v0,20(sp)
+   1dff4:	27a20034 	addiu	v0,sp,52
+   1dff8:	afa20018 	sw	v0,24(sp)
+   1dffc:	27a2003c 	addiu	v0,sp,60
+   1e000:	afa2001c 	sw	v0,28(sp)
+   1e004:	30840003 	andi	a0,a0,0x3
+   1e008:	27a20044 	addiu	v0,sp,68
+   1e00c:	3c070002 	lui	a3,0x2
+   1e010:	00a42021 	addu	a0,a1,a0
+   1e014:	afa20020 	sw	v0,32(sp)
+   1e018:	24050001 	addiu	a1,zero,1
+   1e01c:	27a20058 	addiu	v0,sp,88
+   1e020:	00003021 	addu	a2,zero,zero
+   1e024:	24e7dcec 	addiu	a3,a3,-8980
+   1e028:	0c003de8 	jal	f7a0 <rppc_generic>
+   1e02c:	afa20024 	sw	v0,36(sp)
+   1e030:	8fa3002c 	lw	v1,44(sp)
+   1e034:	8fa500b0 	lw	a1,176(sp)
+   1e038:	26310001 	addiu	s1,s1,1
+   1e03c:	2404fffe 	addiu	a0,zero,-2
+   1e040:	00641824 	and	v1,v1,a0
+   1e044:	0225102b 	sltu	v0,s1,a1
+   1e048:	10400018 	beqz	v0,1e0ac <mapper_request+0x1dc>
+   1e04c:	afa3002c 	sw	v1,44(sp)
+   1e050:	8fa60070 	lw	a2,112(sp)
+   1e054:	14d1ffc3 	bne	a2,s1,1df64 <mapper_request+0x94>
+   1e058:	3c020004 	lui	v0,0x4
+   1e05c:	8fa2002c 	lw	v0,44(sp)
+   1e060:	34420002 	ori	v0,v0,0x2
+   1e064:	080077d8 	j	1df60 <mapper_request+0x90>
+   1e068:	afa2002c 	sw	v0,44(sp)
+   1e06c:	02e02021 	addu	a0,s7,zero
+   1e070:	02c02821 	addu	a1,s6,zero
+   1e074:	03c03021 	addu	a2,s8,zero
+   1e078:	02403821 	addu	a3,s2,zero
+   1e07c:	afa20010 	sw	v0,16(sp)
+   1e080:	afb50014 	sw	s5,20(sp)
+   1e084:	0c007792 	jal	1de48 <__mapper_request_local>
+   1e088:	afb40018 	sw	s4,24(sp)
+   1e08c:	8fa3002c 	lw	v1,44(sp)
+   1e090:	8fa500b0 	lw	a1,176(sp)
+   1e094:	26310001 	addiu	s1,s1,1
+   1e098:	2404fffe 	addiu	a0,zero,-2
+   1e09c:	00641824 	and	v1,v1,a0
+   1e0a0:	0225102b 	sltu	v0,s1,a1
+   1e0a4:	1440ffea 	bnez	v0,1e050 <mapper_request+0x180>
+   1e0a8:	afa3002c 	sw	v1,44(sp)
+   1e0ac:	8fa40028 	lw	a0,40(sp)
+   1e0b0:	8fa300bc 	lw	v1,188(sp)
+   1e0b4:	8fbf00a4 	lw	ra,164(sp)
+   1e0b8:	8fa20030 	lw	v0,48(sp)
+   1e0bc:	8fbe00a0 	lw	s8,160(sp)
+   1e0c0:	8fb7009c 	lw	s7,156(sp)
+   1e0c4:	8fb60098 	lw	s6,152(sp)
+   1e0c8:	8fb50094 	lw	s5,148(sp)
+   1e0cc:	8fb40090 	lw	s4,144(sp)
+   1e0d0:	8fb3008c 	lw	s3,140(sp)
+   1e0d4:	8fb20088 	lw	s2,136(sp)
+   1e0d8:	8fb10084 	lw	s1,132(sp)
+   1e0dc:	8fb00080 	lw	s0,128(sp)
+   1e0e0:	ac640000 	sw	a0,0(v1)
+   1e0e4:	03e00008 	jr	ra
+   1e0e8:	27bd00a8 	addiu	sp,sp,168
+
+0001e0ec <mapper_write>:
+   1e0ec:	27bdffe0 	addiu	sp,sp,-32
+   1e0f0:	8fa20030 	lw	v0,48(sp)
+   1e0f4:	afa70010 	sw	a3,16(sp)
+   1e0f8:	00003821 	addu	a3,zero,zero
+   1e0fc:	afbf001c 	sw	ra,28(sp)
+   1e100:	0c0077b4 	jal	1ded0 <mapper_request>
+   1e104:	afa20014 	sw	v0,20(sp)
+   1e108:	8fbf001c 	lw	ra,28(sp)
+   1e10c:	03e00008 	jr	ra
+   1e110:	27bd0020 	addiu	sp,sp,32
+
+0001e114 <mapper_read>:
+   1e114:	27bdffe0 	addiu	sp,sp,-32
+   1e118:	8fa20030 	lw	v0,48(sp)
+   1e11c:	afa70010 	sw	a3,16(sp)
+   1e120:	24070001 	addiu	a3,zero,1
+   1e124:	afbf001c 	sw	ra,28(sp)
+   1e128:	0c0077b4 	jal	1ded0 <mapper_request>
+   1e12c:	afa20014 	sw	v0,20(sp)
+   1e130:	8fbf001c 	lw	ra,28(sp)
+   1e134:	03e00008 	jr	ra
+   1e138:	27bd0020 	addiu	sp,sp,32
+
+0001e13c <__mapper_get_ppn_main>:
+   1e13c:	27bdffe0 	addiu	sp,sp,-32
+   1e140:	8fa50030 	lw	a1,48(sp)
+   1e144:	afb00014 	sw	s0,20(sp)
+   1e148:	00c08021 	addu	s0,a2,zero
+   1e14c:	8fa60034 	lw	a2,52(sp)
+   1e150:	00e02021 	addu	a0,a3,zero
+   1e154:	afbf001c 	sw	ra,28(sp)
+   1e158:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   1e15c:	afb10018 	sw	s1,24(sp)
+   1e160:	00408821 	addu	s1,v0,zero
+   1e164:	0c001a00 	jal	6800 <refcount_up>
+   1e168:	24440030 	addiu	a0,v0,48
+   1e16c:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   1e170:	02202021 	addu	a0,s1,zero
+   1e174:	8fbf001c 	lw	ra,28(sp)
+   1e178:	ae020000 	sw	v0,0(s0)
+   1e17c:	8fb10018 	lw	s1,24(sp)
+   1e180:	8fb00014 	lw	s0,20(sp)
+   1e184:	03e00008 	jr	ra
+   1e188:	27bd0020 	addiu	sp,sp,32
+
+0001e18c <__mapper_get_ppn_demarshall>:
+   1e18c:	27bdffc0 	addiu	sp,sp,-64
+   1e190:	afbf003c 	sw	ra,60(sp)
+   1e194:	afbe0038 	sw	s8,56(sp)
+   1e198:	afb50034 	sw	s5,52(sp)
+   1e19c:	03a0f021 	addu	s8,sp,zero
+   1e1a0:	afb40030 	sw	s4,48(sp)
+   1e1a4:	afb3002c 	sw	s3,44(sp)
+   1e1a8:	afb20028 	sw	s2,40(sp)
+   1e1ac:	afb10024 	sw	s1,36(sp)
+   1e1b0:	afb00020 	sw	s0,32(sp)
+   1e1b4:	27bdfff0 	addiu	sp,sp,-16
+   1e1b8:	27b20018 	addiu	s2,sp,24
+   1e1bc:	27bdffc8 	addiu	sp,sp,-56
+   1e1c0:	27b10018 	addiu	s1,sp,24
+   1e1c4:	26220028 	addiu	v0,s1,40
+   1e1c8:	2403002c 	addiu	v1,zero,44
+   1e1cc:	ae230008 	sw	v1,8(s1)
+   1e1d0:	ae420000 	sw	v0,0(s2)
+   1e1d4:	24030004 	addiu	v1,zero,4
+   1e1d8:	00808021 	addu	s0,a0,zero
+   1e1dc:	ae230024 	sw	v1,36(s1)
+   1e1e0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1e1e4:	8c940000 	lw	s4,0(a0)
+   1e1e8:	8e460000 	lw	a2,0(s2)
+   1e1ec:	02002021 	addu	a0,s0,zero
+   1e1f0:	00002821 	addu	a1,zero,zero
+   1e1f4:	afc6001c 	sw	a2,28(s8)
+   1e1f8:	8e120000 	lw	s2,0(s0)
+   1e1fc:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1e200:	00409821 	addu	s3,v0,zero
+   1e204:	8c470000 	lw	a3,0(v0)
+   1e208:	02002021 	addu	a0,s0,zero
+   1e20c:	24050001 	addiu	a1,zero,1
+   1e210:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1e214:	afc70018 	sw	a3,24(s8)
+   1e218:	02002021 	addu	a0,s0,zero
+   1e21c:	24050002 	addiu	a1,zero,2
+   1e220:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1e224:	8c550000 	lw	s5,0(v0)
+   1e228:	0293001b 	divu	zero,s4,s3
+   1e22c:	026001f4 	teq	s3,zero,0x7
+   1e230:	afb50010 	sw	s5,16(sp)
+   1e234:	8c420000 	lw	v0,0(v0)
+   1e238:	8fc6001c 	lw	a2,28(s8)
+   1e23c:	8fc70018 	lw	a3,24(s8)
+   1e240:	02402821 	addu	a1,s2,zero
+   1e244:	afa20014 	sw	v0,20(sp)
+   1e248:	00002012 	mflo	a0
+   1e24c:	0c00784f 	jal	1e13c <__mapper_get_ppn_main>
+   1e250:	3084ffff 	andi	a0,a0,0xffff
+   1e254:	02002021 	addu	a0,s0,zero
+   1e258:	02202821 	addu	a1,s1,zero
+   1e25c:	2406002c 	addiu	a2,zero,44
+   1e260:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   1e264:	24070001 	addiu	a3,zero,1
+   1e268:	03c0e821 	addu	sp,s8,zero
+   1e26c:	8fbf003c 	lw	ra,60(sp)
+   1e270:	8fbe0038 	lw	s8,56(sp)
+   1e274:	8fb50034 	lw	s5,52(sp)
+   1e278:	8fb40030 	lw	s4,48(sp)
+   1e27c:	8fb3002c 	lw	s3,44(sp)
+   1e280:	8fb20028 	lw	s2,40(sp)
+   1e284:	8fb10024 	lw	s1,36(sp)
+   1e288:	8fb00020 	lw	s0,32(sp)
+   1e28c:	03e00008 	jr	ra
+   1e290:	27bd0040 	addiu	sp,sp,64
+
+0001e294 <__mapper_get_ppn_local>:
+   1e294:	27bdffe0 	addiu	sp,sp,-32
+   1e298:	afbf001c 	sw	ra,28(sp)
+   1e29c:	00804021 	addu	t0,a0,zero
+   1e2a0:	00a01021 	addu	v0,a1,zero
+   1e2a4:	00e04821 	addu	t1,a3,zero
+   1e2a8:	40057801 	mfc0	a1,$15,1
+   1e2ac:	3c030004 	lui	v1,0x4
+   1e2b0:	2464c960 	addiu	a0,v1,-13984
+   1e2b4:	88840003 	lwl	a0,3(a0)
+   1e2b8:	30a50003 	andi	a1,a1,0x3
+   1e2bc:	3c070004 	lui	a3,0x4
+   1e2c0:	24e7c950 	addiu	a3,a3,-14000
+   1e2c4:	00052880 	sll	a1,a1,0x2
+   1e2c8:	9864c960 	lwr	a0,-13984(v1)
+   1e2cc:	00a72821 	addu	a1,a1,a3
+   1e2d0:	8cc30000 	lw	v1,0(a2)
+   1e2d4:	8c470000 	lw	a3,0(v0)
+   1e2d8:	8ca50000 	lw	a1,0(a1)
+   1e2dc:	8d220000 	lw	v0,0(t1)
+   1e2e0:	3084ffff 	andi	a0,a0,0xffff
+   1e2e4:	01003021 	addu	a2,t0,zero
+   1e2e8:	afa30010 	sw	v1,16(sp)
+   1e2ec:	0c00784f 	jal	1e13c <__mapper_get_ppn_main>
+   1e2f0:	afa20014 	sw	v0,20(sp)
+   1e2f4:	8fbf001c 	lw	ra,28(sp)
+   1e2f8:	03e00008 	jr	ra
+   1e2fc:	27bd0020 	addiu	sp,sp,32
+
+0001e300 <mapper_get_ppn>:
+   1e300:	27bdffa0 	addiu	sp,sp,-96
+   1e304:	3c020004 	lui	v0,0x4
+   1e308:	afb00054 	sw	s0,84(sp)
+   1e30c:	2443c960 	addiu	v1,v0,-13984
+   1e310:	afbf005c 	sw	ra,92(sp)
+   1e314:	afb10058 	sw	s1,88(sp)
+   1e318:	88630003 	lwl	v1,3(v1)
+   1e31c:	94900008 	lhu	s0,8(a0)
+   1e320:	9843c960 	lwr	v1,-13984(v0)
+   1e324:	24090004 	addiu	t1,zero,4
+   1e328:	27aa0028 	addiu	t2,sp,40
+   1e32c:	24880004 	addiu	t0,a0,4
+   1e330:	27a20064 	addiu	v0,sp,100
+   1e334:	27a70068 	addiu	a3,sp,104
+   1e338:	3063ffff 	andi	v1,v1,0xffff
+   1e33c:	afa50064 	sw	a1,100(sp)
+   1e340:	afa60068 	sw	a2,104(sp)
+   1e344:	afa90048 	sw	t1,72(sp)
+   1e348:	afaa002c 	sw	t2,44(sp)
+   1e34c:	afa90030 	sw	t1,48(sp)
+   1e350:	afa80034 	sw	t0,52(sp)
+   1e354:	afa20038 	sw	v0,56(sp)
+   1e358:	afa7003c 	sw	a3,60(sp)
+   1e35c:	afa90040 	sw	t1,64(sp)
+   1e360:	1203001e 	beq	s0,v1,1e3dc <mapper_get_ppn+0xdc>
+   1e364:	afa90044 	sw	t1,68(sp)
+   1e368:	40117801 	mfc0	s1,$15,1
+   1e36c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1e370:	00000000 	sll	zero,zero,0x0
+   1e374:	70501802 	mul	v1,v0,s0
+   1e378:	24020001 	addiu	v0,zero,1
+   1e37c:	afa20010 	sw	v0,16(sp)
+   1e380:	24020003 	addiu	v0,zero,3
+   1e384:	afa20014 	sw	v0,20(sp)
+   1e388:	27a2002c 	addiu	v0,sp,44
+   1e38c:	afa20018 	sw	v0,24(sp)
+   1e390:	27a20030 	addiu	v0,sp,48
+   1e394:	afa2001c 	sw	v0,28(sp)
+   1e398:	32240003 	andi	a0,s1,0x3
+   1e39c:	27a20034 	addiu	v0,sp,52
+   1e3a0:	3c070002 	lui	a3,0x2
+   1e3a4:	afa20020 	sw	v0,32(sp)
+   1e3a8:	00642021 	addu	a0,v1,a0
+   1e3ac:	27a20040 	addiu	v0,sp,64
+   1e3b0:	24e7e18c 	addiu	a3,a3,-7796
+   1e3b4:	24050001 	addiu	a1,zero,1
+   1e3b8:	00003021 	addu	a2,zero,zero
+   1e3bc:	0c003de8 	jal	f7a0 <rppc_generic>
+   1e3c0:	afa20024 	sw	v0,36(sp)
+   1e3c4:	8fbf005c 	lw	ra,92(sp)
+   1e3c8:	8fa20028 	lw	v0,40(sp)
+   1e3cc:	8fb10058 	lw	s1,88(sp)
+   1e3d0:	8fb00054 	lw	s0,84(sp)
+   1e3d4:	03e00008 	jr	ra
+   1e3d8:	27bd0060 	addiu	sp,sp,96
+   1e3dc:	00403021 	addu	a2,v0,zero
+   1e3e0:	01402021 	addu	a0,t2,zero
+   1e3e4:	0c0078a5 	jal	1e294 <__mapper_get_ppn_local>
+   1e3e8:	01002821 	addu	a1,t0,zero
+   1e3ec:	8fbf005c 	lw	ra,92(sp)
+   1e3f0:	8fa20028 	lw	v0,40(sp)
+   1e3f4:	8fb10058 	lw	s1,88(sp)
+   1e3f8:	8fb00054 	lw	s0,84(sp)
+   1e3fc:	03e00008 	jr	ra
+   1e400:	27bd0060 	addiu	sp,sp,96
+
+0001e404 <mapper_destroy>:
+   1e404:	3c020022 	lui	v0,0x22
+   1e408:	27bdff68 	addiu	sp,sp,-152
+   1e40c:	34420040 	ori	v0,v0,0x40
+   1e410:	afa20038 	sw	v0,56(sp)
+   1e414:	24020001 	addiu	v0,zero,1
+   1e418:	afb20078 	sw	s2,120(sp)
+   1e41c:	afbf0094 	sw	ra,148(sp)
+   1e420:	afbe0090 	sw	s8,144(sp)
+   1e424:	afb7008c 	sw	s7,140(sp)
+   1e428:	afb60088 	sw	s6,136(sp)
+   1e42c:	afb50084 	sw	s5,132(sp)
+   1e430:	afb40080 	sw	s4,128(sp)
+   1e434:	afb3007c 	sw	s3,124(sp)
+   1e438:	afb10074 	sw	s1,116(sp)
+   1e43c:	afb00070 	sw	s0,112(sp)
+   1e440:	00809021 	addu	s2,a0,zero
+   1e444:	10a20087 	beq	a1,v0,1e664 <mapper_destroy+0x260>
+   1e448:	afa00030 	sw	zero,48(sp)
+   1e44c:	27b70040 	addiu	s7,sp,64
+   1e450:	27b40030 	addiu	s4,sp,48
+   1e454:	3c16ffff 	lui	s6,0xffff
+   1e458:	36d6000f 	ori	s6,s6,0xf
+   1e45c:	0000f021 	addu	s8,zero,zero
+   1e460:	27b50068 	addiu	s5,sp,104
+   1e464:	02e08021 	addu	s0,s7,zero
+   1e468:	02e01021 	addu	v0,s7,zero
+   1e46c:	ac400000 	sw	zero,0(v0)
+   1e470:	24420004 	addiu	v0,v0,4
+   1e474:	1455fffd 	bne	v0,s5,1e46c <mapper_destroy+0x68>
+   1e478:	02e02821 	addu	a1,s7,zero
+   1e47c:	8e440000 	lw	a0,0(s2)
+   1e480:	248400e8 	addiu	a0,a0,232
+   1e484:	00003021 	addu	a2,zero,zero
+   1e488:	0c003507 	jal	d41c <radix_tree_gang_lookup>
+   1e48c:	2407000a 	addiu	a3,zero,10
+   1e490:	1040005d 	beqz	v0,1e608 <mapper_destroy+0x204>
+   1e494:	00409821 	addu	s3,v0,zero
+   1e498:	8fa40040 	lw	a0,64(sp)
+   1e49c:	10800047 	beqz	a0,1e5bc <mapper_destroy+0x1b8>
+   1e4a0:	00000000 	sll	zero,zero,0x0
+   1e4a4:	08007950 	j	1e540 <mapper_destroy+0x13c>
+   1e4a8:	00008821 	addu	s1,zero,zero
+   1e4ac:	8e030000 	lw	v1,0(s0)
+   1e4b0:	8c620000 	lw	v0,0(v1)
+   1e4b4:	00021102 	srl	v0,v0,0x4
+   1e4b8:	30420080 	andi	v0,v0,0x80
+   1e4bc:	14400041 	bnez	v0,1e5c4 <mapper_destroy+0x1c0>
+   1e4c0:	00000000 	sll	zero,zero,0x0
+   1e4c4:	8e440000 	lw	a0,0(s2)
+   1e4c8:	8c650014 	lw	a1,20(v1)
+   1e4cc:	248400e8 	addiu	a0,a0,232
+   1e4d0:	0c003749 	jal	dd24 <radix_tree_delete>
+   1e4d4:	afa30068 	sw	v1,104(sp)
+   1e4d8:	8fa30068 	lw	v1,104(sp)
+   1e4dc:	8c640000 	lw	a0,0(v1)
+   1e4e0:	00041102 	srl	v0,a0,0x4
+   1e4e4:	30420f7f 	andi	v0,v0,0xf7f
+   1e4e8:	00022900 	sll	a1,v0,0x4
+   1e4ec:	00962024 	and	a0,a0,s6
+   1e4f0:	00852025 	or	a0,a0,a1
+   1e4f4:	30420020 	andi	v0,v0,0x20
+   1e4f8:	10400005 	beqz	v0,1e510 <mapper_destroy+0x10c>
+   1e4fc:	ac640000 	sw	a0,0(v1)
+   1e500:	00602021 	addu	a0,v1,zero
+   1e504:	0c001bab 	jal	6eac <blkio_destroy>
+   1e508:	afa30068 	sw	v1,104(sp)
+   1e50c:	8fa30068 	lw	v1,104(sp)
+   1e510:	8e020000 	lw	v0,0(s0)
+   1e514:	ac600018 	sw	zero,24(v1)
+   1e518:	02802021 	addu	a0,s4,zero
+   1e51c:	26310001 	addiu	s1,s1,1
+   1e520:	0c007134 	jal	1c4d0 <kmem_free>
+   1e524:	afa2003c 	sw	v0,60(sp)
+   1e528:	0233102b 	sltu	v0,s1,s3
+   1e52c:	10400023 	beqz	v0,1e5bc <mapper_destroy+0x1b8>
+   1e530:	00000000 	sll	zero,zero,0x0
+   1e534:	8e040004 	lw	a0,4(s0)
+   1e538:	10800020 	beqz	a0,1e5bc <mapper_destroy+0x1b8>
+   1e53c:	26100004 	addiu	s0,s0,4
+   1e540:	0c007c35 	jal	1f0d4 <ppm_page_is_valid>
+   1e544:	00000000 	sll	zero,zero,0x0
+   1e548:	1440ffd8 	bnez	v0,1e4ac <mapper_destroy+0xa8>
+   1e54c:	00000000 	sll	zero,zero,0x0
+   1e550:	40027801 	mfc0	v0,$15,1
+   1e554:	40034800 	mfc0	v1,c0_count
+   1e558:	00000000 	sll	zero,zero,0x0
+   1e55c:	3c040004 	lui	a0,0x4
+   1e560:	30420003 	andi	v0,v0,0x3
+   1e564:	2484c950 	addiu	a0,a0,-14000
+   1e568:	00021080 	sll	v0,v0,0x2
+   1e56c:	00441021 	addu	v0,v0,a0
+   1e570:	8c470000 	lw	a3,0(v0)
+   1e574:	3c020004 	lui	v0,0x4
+   1e578:	8c449100 	lw	a0,-28416(v0)
+   1e57c:	3c060003 	lui	a2,0x3
+   1e580:	8e020000 	lw	v0,0(s0)
+   1e584:	00002821 	addu	a1,zero,zero
+   1e588:	afb10020 	sw	s1,32(sp)
+   1e58c:	24c66e3c 	addiu	a2,a2,28220
+   1e590:	26310001 	addiu	s1,s1,1
+   1e594:	afa30010 	sw	v1,16(sp)
+   1e598:	afa2001c 	sw	v0,28(sp)
+   1e59c:	afb20014 	sw	s2,20(sp)
+   1e5a0:	afb00018 	sw	s0,24(sp)
+   1e5a4:	afb30024 	sw	s3,36(sp)
+   1e5a8:	0c0009b0 	jal	26c0 <__fprintk>
+   1e5ac:	afbe0028 	sw	s8,40(sp)
+   1e5b0:	0233102b 	sltu	v0,s1,s3
+   1e5b4:	1440ffdf 	bnez	v0,1e534 <mapper_destroy+0x130>
+   1e5b8:	00000000 	sll	zero,zero,0x0
+   1e5bc:	08007919 	j	1e464 <mapper_destroy+0x60>
+   1e5c0:	27de0001 	addiu	s8,s8,1
+   1e5c4:	0c007a7a 	jal	1e9e8 <page_lock>
+   1e5c8:	00602021 	addu	a0,v1,zero
+   1e5cc:	8e420000 	lw	v0,0(s2)
+   1e5d0:	8c4200a4 	lw	v0,164(v0)
+   1e5d4:	8c420008 	lw	v0,8(v0)
+   1e5d8:	0040f809 	jalr	v0
+   1e5dc:	8e040000 	lw	a0,0(s0)
+   1e5e0:	0c007a5c 	jal	1e970 <page_unlock>
+   1e5e4:	8e040000 	lw	a0,0(s0)
+   1e5e8:	0c007a7a 	jal	1e9e8 <page_lock>
+   1e5ec:	8e040000 	lw	a0,0(s0)
+   1e5f0:	0c007bb0 	jal	1eec0 <page_clear_dirty>
+   1e5f4:	8e040000 	lw	a0,0(s0)
+   1e5f8:	0c007a5c 	jal	1e970 <page_unlock>
+   1e5fc:	8e040000 	lw	a0,0(s0)
+   1e600:	08007931 	j	1e4c4 <mapper_destroy+0xc0>
+   1e604:	8e030000 	lw	v1,0(s0)
+   1e608:	2403001a 	addiu	v1,zero,26
+   1e60c:	8e420000 	lw	v0,0(s2)
+   1e610:	afa30030 	sw	v1,48(sp)
+   1e614:	3c030002 	lui	v1,0x2
+   1e618:	afa30038 	sw	v1,56(sp)
+   1e61c:	02802021 	addu	a0,s4,zero
+   1e620:	240301d0 	addiu	v1,zero,464
+   1e624:	afa30034 	sw	v1,52(sp)
+   1e628:	0c007134 	jal	1c4d0 <kmem_free>
+   1e62c:	afa2003c 	sw	v0,60(sp)
+   1e630:	8fbf0094 	lw	ra,148(sp)
+   1e634:	ae400000 	sw	zero,0(s2)
+   1e638:	8fbe0090 	lw	s8,144(sp)
+   1e63c:	8fb7008c 	lw	s7,140(sp)
+   1e640:	8fb60088 	lw	s6,136(sp)
+   1e644:	8fb50084 	lw	s5,132(sp)
+   1e648:	8fb40080 	lw	s4,128(sp)
+   1e64c:	8fb3007c 	lw	s3,124(sp)
+   1e650:	8fb20078 	lw	s2,120(sp)
+   1e654:	8fb10074 	lw	s1,116(sp)
+   1e658:	8fb00070 	lw	s0,112(sp)
+   1e65c:	03e00008 	jr	ra
+   1e660:	27bd0098 	addiu	sp,sp,152
+   1e664:	3c10ffff 	lui	s0,0xffff
+   1e668:	3610000f 	ori	s0,s0,0xf
+   1e66c:	27b70040 	addiu	s7,sp,64
+   1e670:	00001021 	addu	v0,zero,zero
+   1e674:	27b40030 	addiu	s4,sp,48
+   1e678:	2843000a 	slti	v1,v0,10
+   1e67c:	14600036 	bnez	v1,1e758 <mapper_destroy+0x354>
+   1e680:	00021880 	sll	v1,v0,0x2
+   1e684:	8e440000 	lw	a0,0(s2)
+   1e688:	02e02821 	addu	a1,s7,zero
+   1e68c:	248400e8 	addiu	a0,a0,232
+   1e690:	00003021 	addu	a2,zero,zero
+   1e694:	2407000a 	addiu	a3,zero,10
+   1e698:	0c0033d6 	jal	cf58 <radix_tree_gang_lookup_tag>
+   1e69c:	afa00010 	sw	zero,16(sp)
+   1e6a0:	1040ff6c 	beqz	v0,1e454 <mapper_destroy+0x50>
+   1e6a4:	0040b021 	addu	s6,v0,zero
+   1e6a8:	8fa40040 	lw	a0,64(sp)
+   1e6ac:	10800029 	beqz	a0,1e754 <mapper_destroy+0x350>
+   1e6b0:	00001021 	addu	v0,zero,zero
+   1e6b4:	02e08821 	addu	s1,s7,zero
+   1e6b8:	080079b3 	j	1e6cc <mapper_destroy+0x2c8>
+   1e6bc:	0000a821 	addu	s5,zero,zero
+   1e6c0:	8e240004 	lw	a0,4(s1)
+   1e6c4:	10800022 	beqz	a0,1e750 <mapper_destroy+0x34c>
+   1e6c8:	26310004 	addiu	s1,s1,4
+   1e6cc:	0c007a7a 	jal	1e9e8 <page_lock>
+   1e6d0:	26b50001 	addiu	s5,s5,1
+   1e6d4:	8e420000 	lw	v0,0(s2)
+   1e6d8:	8c4200a4 	lw	v0,164(v0)
+   1e6dc:	8c420008 	lw	v0,8(v0)
+   1e6e0:	0040f809 	jalr	v0
+   1e6e4:	8e240000 	lw	a0,0(s1)
+   1e6e8:	0c007a5c 	jal	1e970 <page_unlock>
+   1e6ec:	8e240000 	lw	a0,0(s1)
+   1e6f0:	8e330000 	lw	s3,0(s1)
+   1e6f4:	8e440000 	lw	a0,0(s2)
+   1e6f8:	8e650014 	lw	a1,20(s3)
+   1e6fc:	0c003749 	jal	dd24 <radix_tree_delete>
+   1e700:	248400e8 	addiu	a0,a0,232
+   1e704:	8e630000 	lw	v1,0(s3)
+   1e708:	00031102 	srl	v0,v1,0x4
+   1e70c:	30420f7f 	andi	v0,v0,0xf7f
+   1e710:	00022100 	sll	a0,v0,0x4
+   1e714:	00701824 	and	v1,v1,s0
+   1e718:	00641825 	or	v1,v1,a0
+   1e71c:	30420020 	andi	v0,v0,0x20
+   1e720:	10400003 	beqz	v0,1e730 <mapper_destroy+0x32c>
+   1e724:	ae630000 	sw	v1,0(s3)
+   1e728:	0c001bab 	jal	6eac <blkio_destroy>
+   1e72c:	02602021 	addu	a0,s3,zero
+   1e730:	8e220000 	lw	v0,0(s1)
+   1e734:	ae600018 	sw	zero,24(s3)
+   1e738:	02802021 	addu	a0,s4,zero
+   1e73c:	0c007134 	jal	1c4d0 <kmem_free>
+   1e740:	afa2003c 	sw	v0,60(sp)
+   1e744:	02b6102b 	sltu	v0,s5,s6
+   1e748:	1440ffdd 	bnez	v0,1e6c0 <mapper_destroy+0x2bc>
+   1e74c:	00000000 	sll	zero,zero,0x0
+   1e750:	00001021 	addu	v0,zero,zero
+   1e754:	00021880 	sll	v1,v0,0x2
+   1e758:	00771821 	addu	v1,v1,s7
+   1e75c:	ac600000 	sw	zero,0(v1)
+   1e760:	0800799e 	j	1e678 <mapper_destroy+0x274>
+   1e764:	24420001 	addiu	v0,v0,1
+
+0001e768 <mapper_remove_page>:
+   1e768:	27bdffc8 	addiu	sp,sp,-56
+   1e76c:	afb10030 	sw	s1,48(sp)
+   1e770:	8c910018 	lw	s1,24(a0)
+   1e774:	afb0002c 	sw	s0,44(sp)
+   1e778:	00808021 	addu	s0,a0,zero
+   1e77c:	8e240000 	lw	a0,0(s1)
+   1e780:	27a50010 	addiu	a1,sp,16
+   1e784:	24840010 	addiu	a0,a0,16
+   1e788:	afbf0034 	sw	ra,52(sp)
+   1e78c:	afa00014 	sw	zero,20(sp)
+   1e790:	0c0030a1 	jal	c284 <mcs_lock>
+   1e794:	afb00020 	sw	s0,32(sp)
+   1e798:	8e240000 	lw	a0,0(s1)
+   1e79c:	8e050014 	lw	a1,20(s0)
+   1e7a0:	0c003749 	jal	dd24 <radix_tree_delete>
+   1e7a4:	248400e8 	addiu	a0,a0,232
+   1e7a8:	8e030000 	lw	v1,0(s0)
+   1e7ac:	3c04ffff 	lui	a0,0xffff
+   1e7b0:	00031102 	srl	v0,v1,0x4
+   1e7b4:	30420f7f 	andi	v0,v0,0xf7f
+   1e7b8:	3484000f 	ori	a0,a0,0xf
+   1e7bc:	00641824 	and	v1,v1,a0
+   1e7c0:	00022100 	sll	a0,v0,0x4
+   1e7c4:	00641825 	or	v1,v1,a0
+   1e7c8:	30420020 	andi	v0,v0,0x20
+   1e7cc:	10400003 	beqz	v0,1e7dc <mapper_remove_page+0x74>
+   1e7d0:	ae030000 	sw	v1,0(s0)
+   1e7d4:	0c001bab 	jal	6eac <blkio_destroy>
+   1e7d8:	02002021 	addu	a0,s0,zero
+   1e7dc:	8e240000 	lw	a0,0(s1)
+   1e7e0:	8fa50010 	lw	a1,16(sp)
+   1e7e4:	ae000018 	sw	zero,24(s0)
+   1e7e8:	0c003130 	jal	c4c0 <mcs_unlock>
+   1e7ec:	24840010 	addiu	a0,a0,16
+   1e7f0:	0c007134 	jal	1c4d0 <kmem_free>
+   1e7f4:	27a40014 	addiu	a0,sp,20
+   1e7f8:	8fbf0034 	lw	ra,52(sp)
+   1e7fc:	8fb10030 	lw	s1,48(sp)
+   1e800:	8fb0002c 	lw	s0,44(sp)
+   1e804:	03e00008 	jr	ra
+   1e808:	27bd0038 	addiu	sp,sp,56
+
+0001e80c <page_get_ppm>:
+   1e80c:	3c020004 	lui	v0,0x4
+   1e810:	03e00008 	jr	ra
+   1e814:	24426e60 	addiu	v0,v0,28256
+
+0001e818 <page_print>:
+   1e818:	27bdffa8 	addiu	sp,sp,-88
+   1e81c:	afb5004c 	sw	s5,76(sp)
+   1e820:	3c020004 	lui	v0,0x4
+   1e824:	0080a821 	addu	s5,a0,zero
+   1e828:	afbf0054 	sw	ra,84(sp)
+   1e82c:	afb60050 	sw	s6,80(sp)
+   1e830:	afb40048 	sw	s4,72(sp)
+   1e834:	afb30044 	sw	s3,68(sp)
+   1e838:	afb20040 	sw	s2,64(sp)
+   1e83c:	afb1003c 	sw	s1,60(sp)
+   1e840:	afb00038 	sw	s0,56(sp)
+   1e844:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1e848:	8c569100 	lw	s6,-28416(v0)
+   1e84c:	8eb30000 	lw	s3,0(s5)
+   1e850:	26a40030 	addiu	a0,s5,48
+   1e854:	0040a021 	addu	s4,v0,zero
+   1e858:	0c001a17 	jal	685c <refcount_get>
+   1e85c:	00139102 	srl	s2,s3,0x4
+   1e860:	00138c02 	srl	s1,s3,0x10
+   1e864:	8ea90014 	lw	t1,20(s5)
+   1e868:	8ea80018 	lw	t0,24(s5)
+   1e86c:	8ea3001c 	lw	v1,28(s5)
+   1e870:	3c060003 	lui	a2,0x3
+   1e874:	00138702 	srl	s0,s3,0x1c
+   1e878:	32520fff 	andi	s2,s2,0xfff
+   1e87c:	32310fff 	andi	s1,s1,0xfff
+   1e880:	3273000f 	andi	s3,s3,0xf
+   1e884:	02c02021 	addu	a0,s6,zero
+   1e888:	02a03821 	addu	a3,s5,zero
+   1e88c:	24c66ea4 	addiu	a2,a2,28324
+   1e890:	00002821 	addu	a1,zero,zero
+   1e894:	afb40010 	sw	s4,16(sp)
+   1e898:	afb30014 	sw	s3,20(sp)
+   1e89c:	afb20018 	sw	s2,24(sp)
+   1e8a0:	afb1001c 	sw	s1,28(sp)
+   1e8a4:	afb00020 	sw	s0,32(sp)
+   1e8a8:	afa20024 	sw	v0,36(sp)
+   1e8ac:	afa90028 	sw	t1,40(sp)
+   1e8b0:	afa8002c 	sw	t0,44(sp)
+   1e8b4:	0c0009b0 	jal	26c0 <__fprintk>
+   1e8b8:	afa30030 	sw	v1,48(sp)
+   1e8bc:	8fbf0054 	lw	ra,84(sp)
+   1e8c0:	8fb60050 	lw	s6,80(sp)
+   1e8c4:	8fb5004c 	lw	s5,76(sp)
+   1e8c8:	8fb40048 	lw	s4,72(sp)
+   1e8cc:	8fb30044 	lw	s3,68(sp)
+   1e8d0:	8fb20040 	lw	s2,64(sp)
+   1e8d4:	8fb1003c 	lw	s1,60(sp)
+   1e8d8:	8fb00038 	lw	s0,56(sp)
+   1e8dc:	03e00008 	jr	ra
+   1e8e0:	27bd0058 	addiu	sp,sp,88
+
+0001e8e4 <page_zero>:
+   1e8e4:	27bdffe0 	addiu	sp,sp,-32
+   1e8e8:	afbf001c 	sw	ra,28(sp)
+   1e8ec:	8c860000 	lw	a2,0(a0)
+   1e8f0:	24021000 	addiu	v0,zero,4096
+   1e8f4:	00063702 	srl	a2,a2,0x1c
+   1e8f8:	00c23004 	sllv	a2,v0,a2
+   1e8fc:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1e900:	afa60010 	sw	a2,16(sp)
+   1e904:	8fa60010 	lw	a2,16(sp)
+   1e908:	8fbf001c 	lw	ra,28(sp)
+   1e90c:	00402021 	addu	a0,v0,zero
+   1e910:	00002821 	addu	a1,zero,zero
+   1e914:	0800c182 	j	30608 <memset>
+   1e918:	27bd0020 	addiu	sp,sp,32
+
+0001e91c <page_copy>:
+   1e91c:	27bdffe0 	addiu	sp,sp,-32
+   1e920:	afbf001c 	sw	ra,28(sp)
+   1e924:	afb00018 	sw	s0,24(sp)
+   1e928:	8c860000 	lw	a2,0(a0)
+   1e92c:	24021000 	addiu	v0,zero,4096
+   1e930:	00063702 	srl	a2,a2,0x1c
+   1e934:	00c23004 	sllv	a2,v0,a2
+   1e938:	00808021 	addu	s0,a0,zero
+   1e93c:	00a02021 	addu	a0,a1,zero
+   1e940:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1e944:	afa60014 	sw	a2,20(sp)
+   1e948:	02002021 	addu	a0,s0,zero
+   1e94c:	0c007c15 	jal	1f054 <ppm_page2addr>
+   1e950:	afa20010 	sw	v0,16(sp)
+   1e954:	8fa50010 	lw	a1,16(sp)
+   1e958:	8fa60014 	lw	a2,20(sp)
+   1e95c:	8fbf001c 	lw	ra,28(sp)
+   1e960:	8fb00018 	lw	s0,24(sp)
+   1e964:	00402021 	addu	a0,v0,zero
+   1e968:	0800c12b 	j	304ac <memcpy>
+   1e96c:	27bd0020 	addiu	sp,sp,32
+
+0001e970 <page_unlock>:
+   1e970:	27bdffe0 	addiu	sp,sp,-32
+   1e974:	afb00014 	sw	s0,20(sp)
+   1e978:	24900034 	addiu	s0,a0,52
+   1e97c:	afb10018 	sw	s1,24(sp)
+   1e980:	00808821 	addu	s1,a0,zero
+   1e984:	afbf001c 	sw	ra,28(sp)
+   1e988:	0c004bc5 	jal	12f14 <spin_lock>
+   1e98c:	02002021 	addu	a0,s0,zero
+   1e990:	8e23000c 	lw	v1,12(s1)
+   1e994:	2622000c 	addiu	v0,s1,12
+   1e998:	10620009 	beq	v1,v0,1e9c0 <page_unlock+0x50>
+   1e99c:	26240004 	addiu	a0,s1,4
+   1e9a0:	0c006d56 	jal	1b558 <wakeup_one>
+   1e9a4:	00002821 	addu	a1,zero,zero
+   1e9a8:	02002021 	addu	a0,s0,zero
+   1e9ac:	8fbf001c 	lw	ra,28(sp)
+   1e9b0:	8fb10018 	lw	s1,24(sp)
+   1e9b4:	8fb00014 	lw	s0,20(sp)
+   1e9b8:	08004b03 	j	12c0c <spin_unlock>
+   1e9bc:	27bd0020 	addiu	sp,sp,32
+   1e9c0:	8e220000 	lw	v0,0(s1)
+   1e9c4:	2403efff 	addiu	v1,zero,-4097
+   1e9c8:	00621024 	and	v0,v1,v0
+   1e9cc:	ae220000 	sw	v0,0(s1)
+   1e9d0:	02002021 	addu	a0,s0,zero
+   1e9d4:	8fbf001c 	lw	ra,28(sp)
+   1e9d8:	8fb10018 	lw	s1,24(sp)
+   1e9dc:	8fb00014 	lw	s0,20(sp)
+   1e9e0:	08004b03 	j	12c0c <spin_unlock>
+   1e9e4:	27bd0020 	addiu	sp,sp,32
+
+0001e9e8 <page_lock>:
+   1e9e8:	27bdffe0 	addiu	sp,sp,-32
+   1e9ec:	afb00014 	sw	s0,20(sp)
+   1e9f0:	24900034 	addiu	s0,a0,52
+   1e9f4:	afb10018 	sw	s1,24(sp)
+   1e9f8:	00808821 	addu	s1,a0,zero
+   1e9fc:	afbf001c 	sw	ra,28(sp)
+   1ea00:	0c004bc5 	jal	12f14 <spin_lock>
+   1ea04:	02002021 	addu	a0,s0,zero
+   1ea08:	8e220000 	lw	v0,0(s1)
+   1ea0c:	00021902 	srl	v1,v0,0x4
+   1ea10:	30630fff 	andi	v1,v1,0xfff
+   1ea14:	30640100 	andi	a0,v1,0x100
+   1ea18:	1480000d 	bnez	a0,1ea50 <page_lock+0x68>
+   1ea1c:	34630100 	ori	v1,v1,0x100
+   1ea20:	3c04ffff 	lui	a0,0xffff
+   1ea24:	3484000f 	ori	a0,a0,0xf
+   1ea28:	00441024 	and	v0,v0,a0
+   1ea2c:	00031900 	sll	v1,v1,0x4
+   1ea30:	00431025 	or	v0,v0,v1
+   1ea34:	ae220000 	sw	v0,0(s1)
+   1ea38:	02002021 	addu	a0,s0,zero
+   1ea3c:	8fbf001c 	lw	ra,28(sp)
+   1ea40:	8fb10018 	lw	s1,24(sp)
+   1ea44:	8fb00014 	lw	s0,20(sp)
+   1ea48:	08004b03 	j	12c0c <spin_unlock>
+   1ea4c:	27bd0020 	addiu	sp,sp,32
+   1ea50:	26240004 	addiu	a0,s1,4
+   1ea54:	0c006d13 	jal	1b44c <wait_on>
+   1ea58:	24050001 	addiu	a1,zero,1
+   1ea5c:	0c004aff 	jal	12bfc <spin_unlock_nosched>
+   1ea60:	02002021 	addu	a0,s0,zero
+   1ea64:	40042002 	mfc0	a0,$4,2
+   1ea68:	8fbf001c 	lw	ra,28(sp)
+   1ea6c:	8fb10018 	lw	s1,24(sp)
+   1ea70:	8fb00014 	lw	s0,20(sp)
+   1ea74:	08004634 	j	118d0 <sched_sleep>
+   1ea78:	27bd0020 	addiu	sp,sp,32
+
+0001ea7c <page_state_set>:
+   1ea7c:	27bdffa8 	addiu	sp,sp,-88
+   1ea80:	2ca20008 	sltiu	v0,a1,8
+   1ea84:	afb00038 	sw	s0,56(sp)
+   1ea88:	afbf0054 	sw	ra,84(sp)
+   1ea8c:	afb60050 	sw	s6,80(sp)
+   1ea90:	afb5004c 	sw	s5,76(sp)
+   1ea94:	afb40048 	sw	s4,72(sp)
+   1ea98:	afb30044 	sw	s3,68(sp)
+   1ea9c:	afb20040 	sw	s2,64(sp)
+   1eaa0:	afb1003c 	sw	s1,60(sp)
+   1eaa4:	00a03821 	addu	a3,a1,zero
+   1eaa8:	14400010 	bnez	v0,1eaec <page_state_set+0x70>
+   1eaac:	00808021 	addu	s0,a0,zero
+   1eab0:	3c020004 	lui	v0,0x4
+   1eab4:	3c060003 	lui	a2,0x3
+   1eab8:	8c449100 	lw	a0,-28416(v0)
+   1eabc:	8fbf0054 	lw	ra,84(sp)
+   1eac0:	8fb60050 	lw	s6,80(sp)
+   1eac4:	8fb5004c 	lw	s5,76(sp)
+   1eac8:	8fb40048 	lw	s4,72(sp)
+   1eacc:	8fb30044 	lw	s3,68(sp)
+   1ead0:	8fb20040 	lw	s2,64(sp)
+   1ead4:	8fb1003c 	lw	s1,60(sp)
+   1ead8:	8fb00038 	lw	s0,56(sp)
+   1eadc:	24c66f4c 	addiu	a2,a2,28492
+   1eae0:	00002821 	addu	a1,zero,zero
+   1eae4:	080009b0 	j	26c0 <__fprintk>
+   1eae8:	27bd0058 	addiu	sp,sp,88
+   1eaec:	3c020003 	lui	v0,0x3
+   1eaf0:	00051880 	sll	v1,a1,0x2
+   1eaf4:	24426fe0 	addiu	v0,v0,28640
+   1eaf8:	00431021 	addu	v0,v0,v1
+   1eafc:	8c420000 	lw	v0,0(v0)
+   1eb00:	00400008 	jr	v0
+   1eb04:	00000000 	sll	zero,zero,0x0
+   1eb08:	24840030 	addiu	a0,a0,48
+   1eb0c:	24050001 	addiu	a1,zero,1
+   1eb10:	0c001a12 	jal	6848 <refcount_set>
+   1eb14:	afa70030 	sw	a3,48(sp)
+   1eb18:	8fa70030 	lw	a3,48(sp)
+   1eb1c:	8e030000 	lw	v1,0(s0)
+   1eb20:	2402fff0 	addiu	v0,zero,-16
+   1eb24:	00621024 	and	v0,v1,v0
+   1eb28:	30e7000f 	andi	a3,a3,0xf
+   1eb2c:	00473825 	or	a3,v0,a3
+   1eb30:	ae070000 	sw	a3,0(s0)
+   1eb34:	8fbf0054 	lw	ra,84(sp)
+   1eb38:	8fb60050 	lw	s6,80(sp)
+   1eb3c:	8fb5004c 	lw	s5,76(sp)
+   1eb40:	8fb40048 	lw	s4,72(sp)
+   1eb44:	8fb30044 	lw	s3,68(sp)
+   1eb48:	8fb20040 	lw	s2,64(sp)
+   1eb4c:	8fb1003c 	lw	s1,60(sp)
+   1eb50:	8fb00038 	lw	s0,56(sp)
+   1eb54:	03e00008 	jr	ra
+   1eb58:	27bd0058 	addiu	sp,sp,88
+   1eb5c:	0c007a7a 	jal	1e9e8 <page_lock>
+   1eb60:	00000000 	sll	zero,zero,0x0
+   1eb64:	8e030000 	lw	v1,0(s0)
+   1eb68:	2402fff0 	addiu	v0,zero,-16
+   1eb6c:	00621024 	and	v0,v1,v0
+   1eb70:	34420007 	ori	v0,v0,0x7
+   1eb74:	ae020000 	sw	v0,0(s0)
+   1eb78:	8fbf0054 	lw	ra,84(sp)
+   1eb7c:	8fb60050 	lw	s6,80(sp)
+   1eb80:	8fb5004c 	lw	s5,76(sp)
+   1eb84:	8fb40048 	lw	s4,72(sp)
+   1eb88:	8fb30044 	lw	s3,68(sp)
+   1eb8c:	8fb20040 	lw	s2,64(sp)
+   1eb90:	8fb1003c 	lw	s1,60(sp)
+   1eb94:	8fb00038 	lw	s0,56(sp)
+   1eb98:	03e00008 	jr	ra
+   1eb9c:	27bd0058 	addiu	sp,sp,88
+   1eba0:	24950030 	addiu	s5,a0,48
+   1eba4:	0c001a17 	jal	685c <refcount_get>
+   1eba8:	02a02021 	addu	a0,s5,zero
+   1ebac:	10400021 	beqz	v0,1ec34 <page_state_set+0x1b8>
+   1ebb0:	3c020004 	lui	v0,0x4
+   1ebb4:	8c569100 	lw	s6,-28416(v0)
+   1ebb8:	40037801 	mfc0	v1,$15,1
+   1ebbc:	3c020004 	lui	v0,0x4
+   1ebc0:	30630003 	andi	v1,v1,0x3
+   1ebc4:	00031880 	sll	v1,v1,0x2
+   1ebc8:	2442c950 	addiu	v0,v0,-14000
+   1ebcc:	00621021 	addu	v0,v1,v0
+   1ebd0:	8c540000 	lw	s4,0(v0)
+   1ebd4:	40022002 	mfc0	v0,$4,2
+   1ebd8:	8c420180 	lw	v0,384(v0)
+   1ebdc:	8c5305c4 	lw	s3,1476(v0)
+   1ebe0:	40122002 	mfc0	s2,$4,2
+   1ebe4:	8e110000 	lw	s1,0(s0)
+   1ebe8:	0c001a17 	jal	685c <refcount_get>
+   1ebec:	02a02021 	addu	a0,s5,zero
+   1ebf0:	3231000f 	andi	s1,s1,0xf
+   1ebf4:	40034800 	mfc0	v1,c0_count
+   1ebf8:	00000000 	sll	zero,zero,0x0
+   1ebfc:	3c060003 	lui	a2,0x3
+   1ec00:	3c070003 	lui	a3,0x3
+   1ec04:	02c02021 	addu	a0,s6,zero
+   1ec08:	24c66f04 	addiu	a2,a2,28420
+   1ec0c:	24e77000 	addiu	a3,a3,28672
+   1ec10:	00002821 	addu	a1,zero,zero
+   1ec14:	afb40010 	sw	s4,16(sp)
+   1ec18:	afb30014 	sw	s3,20(sp)
+   1ec1c:	afb20018 	sw	s2,24(sp)
+   1ec20:	afb10020 	sw	s1,32(sp)
+   1ec24:	afa20024 	sw	v0,36(sp)
+   1ec28:	afa30028 	sw	v1,40(sp)
+   1ec2c:	0c0009b0 	jal	26c0 <__fprintk>
+   1ec30:	afb0001c 	sw	s0,28(sp)
+   1ec34:	8e030000 	lw	v1,0(s0)
+   1ec38:	2402fff0 	addiu	v0,zero,-16
+   1ec3c:	00621024 	and	v0,v1,v0
+   1ec40:	34420003 	ori	v0,v0,0x3
+   1ec44:	ae020000 	sw	v0,0(s0)
+   1ec48:	8fbf0054 	lw	ra,84(sp)
+   1ec4c:	8fb60050 	lw	s6,80(sp)
+   1ec50:	8fb5004c 	lw	s5,76(sp)
+   1ec54:	8fb40048 	lw	s4,72(sp)
+   1ec58:	8fb30044 	lw	s3,68(sp)
+   1ec5c:	8fb20040 	lw	s2,64(sp)
+   1ec60:	8fb1003c 	lw	s1,60(sp)
+   1ec64:	8fb00038 	lw	s0,56(sp)
+   1ec68:	03e00008 	jr	ra
+   1ec6c:	27bd0058 	addiu	sp,sp,88
+   1ec70:	8c820000 	lw	v0,0(a0)
+   1ec74:	24030006 	addiu	v1,zero,6
+   1ec78:	3044000f 	andi	a0,v0,0xf
+   1ec7c:	10830036 	beq	a0,v1,1ed58 <page_state_set+0x2dc>
+   1ec80:	2403fff0 	addiu	v1,zero,-16
+   1ec84:	00431024 	and	v0,v0,v1
+   1ec88:	34420004 	ori	v0,v0,0x4
+   1ec8c:	ae020000 	sw	v0,0(s0)
+   1ec90:	8fbf0054 	lw	ra,84(sp)
+   1ec94:	8fb60050 	lw	s6,80(sp)
+   1ec98:	8fb5004c 	lw	s5,76(sp)
+   1ec9c:	8fb40048 	lw	s4,72(sp)
+   1eca0:	8fb30044 	lw	s3,68(sp)
+   1eca4:	8fb20040 	lw	s2,64(sp)
+   1eca8:	8fb1003c 	lw	s1,60(sp)
+   1ecac:	8fb00038 	lw	s0,56(sp)
+   1ecb0:	03e00008 	jr	ra
+   1ecb4:	27bd0058 	addiu	sp,sp,88
+   1ecb8:	8c820000 	lw	v0,0(a0)
+   1ecbc:	24030004 	addiu	v1,zero,4
+   1ecc0:	3044000f 	andi	a0,v0,0xf
+   1ecc4:	14830016 	bne	a0,v1,1ed20 <page_state_set+0x2a4>
+   1ecc8:	2403fff0 	addiu	v1,zero,-16
+   1eccc:	00431024 	and	v0,v0,v1
+   1ecd0:	34420005 	ori	v0,v0,0x5
+   1ecd4:	08007acd 	j	1eb34 <page_state_set+0xb8>
+   1ecd8:	ae020000 	sw	v0,0(s0)
+   1ecdc:	0c007a7a 	jal	1e9e8 <page_lock>
+   1ece0:	00000000 	sll	zero,zero,0x0
+   1ece4:	8e030000 	lw	v1,0(s0)
+   1ece8:	2402fff0 	addiu	v0,zero,-16
+   1ecec:	00621024 	and	v0,v1,v0
+   1ecf0:	34420006 	ori	v0,v0,0x6
+   1ecf4:	ae020000 	sw	v0,0(s0)
+   1ecf8:	8fbf0054 	lw	ra,84(sp)
+   1ecfc:	8fb60050 	lw	s6,80(sp)
+   1ed00:	8fb5004c 	lw	s5,76(sp)
+   1ed04:	8fb40048 	lw	s4,72(sp)
+   1ed08:	8fb30044 	lw	s3,68(sp)
+   1ed0c:	8fb20040 	lw	s2,64(sp)
+   1ed10:	8fb1003c 	lw	s1,60(sp)
+   1ed14:	8fb00038 	lw	s0,56(sp)
+   1ed18:	03e00008 	jr	ra
+   1ed1c:	27bd0058 	addiu	sp,sp,88
+   1ed20:	00431024 	and	v0,v0,v1
+   1ed24:	34420005 	ori	v0,v0,0x5
+   1ed28:	ae020000 	sw	v0,0(s0)
+   1ed2c:	02002021 	addu	a0,s0,zero
+   1ed30:	8fbf0054 	lw	ra,84(sp)
+   1ed34:	8fb60050 	lw	s6,80(sp)
+   1ed38:	8fb5004c 	lw	s5,76(sp)
+   1ed3c:	8fb40048 	lw	s4,72(sp)
+   1ed40:	8fb30044 	lw	s3,68(sp)
+   1ed44:	8fb20040 	lw	s2,64(sp)
+   1ed48:	8fb1003c 	lw	s1,60(sp)
+   1ed4c:	8fb00038 	lw	s0,56(sp)
+   1ed50:	08007a5c 	j	1e970 <page_unlock>
+   1ed54:	27bd0058 	addiu	sp,sp,88
+   1ed58:	00431024 	and	v0,v0,v1
+   1ed5c:	08007b4a 	j	1ed28 <page_state_set+0x2ac>
+   1ed60:	34420004 	ori	v0,v0,0x4
+
+0001ed64 <sync_all_pages>:
+   1ed64:	27bdffb8 	addiu	sp,sp,-72
+   1ed68:	afbe0040 	sw	s8,64(sp)
+   1ed6c:	3c1e0004 	lui	s8,0x4
+   1ed70:	afb20028 	sw	s2,40(sp)
+   1ed74:	27c4c520 	addiu	a0,s8,-15072
+   1ed78:	3c120004 	lui	s2,0x4
+   1ed7c:	afb3002c 	sw	s3,44(sp)
+   1ed80:	afb00020 	sw	s0,32(sp)
+   1ed84:	afbf0044 	sw	ra,68(sp)
+   1ed88:	afb7003c 	sw	s7,60(sp)
+   1ed8c:	afb60038 	sw	s6,56(sp)
+   1ed90:	afb50034 	sw	s5,52(sp)
+   1ed94:	afb40030 	sw	s4,48(sp)
+   1ed98:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1ed9c:	afb10024 	sw	s1,36(sp)
+   1eda0:	8e50c510 	lw	s0,-15088(s2)
+   1eda4:	2653c510 	addiu	s3,s2,-15088
+   1eda8:	12130038 	beq	s0,s3,1ee8c <sync_all_pages+0x128>
+   1edac:	3c170003 	lui	s7,0x3
+   1edb0:	3c160003 	lui	s6,0x3
+   1edb4:	3c150003 	lui	s5,0x3
+   1edb8:	26f76f90 	addiu	s7,s7,28560
+   1edbc:	26d66f80 	addiu	s6,s6,28544
+   1edc0:	26b56f9c 	addiu	s5,s5,28572
+   1edc4:	3c140004 	lui	s4,0x4
+   1edc8:	08007b84 	j	1ee10 <sync_all_pages+0xac>
+   1edcc:	27d1c520 	addiu	s1,s8,-15072
+   1edd0:	8c420000 	lw	v0,0(v0)
+   1edd4:	00002821 	addu	a1,zero,zero
+   1edd8:	8c4700a0 	lw	a3,160(v0)
+   1eddc:	02c01021 	addu	v0,s6,zero
+   1ede0:	02e7100b 	movn	v0,s7,a3
+   1ede4:	00403821 	addu	a3,v0,zero
+   1ede8:	8e020014 	lw	v0,20(s0)
+   1edec:	02a03021 	addu	a2,s5,zero
+   1edf0:	afb00014 	sw	s0,20(sp)
+   1edf4:	0c0009b0 	jal	26c0 <__fprintk>
+   1edf8:	afa20010 	sw	v0,16(sp)
+   1edfc:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1ee00:	02202021 	addu	a0,s1,zero
+   1ee04:	8e50c510 	lw	s0,-15088(s2)
+   1ee08:	12130020 	beq	s0,s3,1ee8c <sync_all_pages+0x128>
+   1ee0c:	00000000 	sll	zero,zero,0x0
+   1ee10:	2610ffe0 	addiu	s0,s0,-32
+   1ee14:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1ee18:	02202021 	addu	a0,s1,zero
+   1ee1c:	8e020018 	lw	v0,24(s0)
+   1ee20:	02002021 	addu	a0,s0,zero
+   1ee24:	0c007a7a 	jal	1e9e8 <page_lock>
+   1ee28:	afa20018 	sw	v0,24(sp)
+   1ee2c:	8fa20018 	lw	v0,24(sp)
+   1ee30:	8c420000 	lw	v0,0(v0)
+   1ee34:	8c4200a4 	lw	v0,164(v0)
+   1ee38:	8c420008 	lw	v0,8(v0)
+   1ee3c:	0040f809 	jalr	v0
+   1ee40:	02002021 	addu	a0,s0,zero
+   1ee44:	0c007a5c 	jal	1e970 <page_unlock>
+   1ee48:	02002021 	addu	a0,s0,zero
+   1ee4c:	8e020018 	lw	v0,24(s0)
+   1ee50:	1440ffdf 	bnez	v0,1edd0 <sync_all_pages+0x6c>
+   1ee54:	8e849100 	lw	a0,-28416(s4)
+   1ee58:	8e020014 	lw	v0,20(s0)
+   1ee5c:	3c070003 	lui	a3,0x3
+   1ee60:	24e76f70 	addiu	a3,a3,28528
+   1ee64:	00002821 	addu	a1,zero,zero
+   1ee68:	02a03021 	addu	a2,s5,zero
+   1ee6c:	afb00014 	sw	s0,20(sp)
+   1ee70:	0c0009b0 	jal	26c0 <__fprintk>
+   1ee74:	afa20010 	sw	v0,16(sp)
+   1ee78:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1ee7c:	02202021 	addu	a0,s1,zero
+   1ee80:	8e50c510 	lw	s0,-15088(s2)
+   1ee84:	1613ffe3 	bne	s0,s3,1ee14 <sync_all_pages+0xb0>
+   1ee88:	2610ffe0 	addiu	s0,s0,-32
+   1ee8c:	27c4c520 	addiu	a0,s8,-15072
+   1ee90:	8fbf0044 	lw	ra,68(sp)
+   1ee94:	8fbe0040 	lw	s8,64(sp)
+   1ee98:	8fb7003c 	lw	s7,60(sp)
+   1ee9c:	8fb60038 	lw	s6,56(sp)
+   1eea0:	8fb50034 	lw	s5,52(sp)
+   1eea4:	8fb40030 	lw	s4,48(sp)
+   1eea8:	8fb3002c 	lw	s3,44(sp)
+   1eeac:	8fb20028 	lw	s2,40(sp)
+   1eeb0:	8fb10024 	lw	s1,36(sp)
+   1eeb4:	8fb00020 	lw	s0,32(sp)
+   1eeb8:	08004b0b 	j	12c2c <spinlock_unlock>
+   1eebc:	27bd0048 	addiu	sp,sp,72
+
+0001eec0 <page_clear_dirty>:
+   1eec0:	27bdffd8 	addiu	sp,sp,-40
+   1eec4:	afb10020 	sw	s1,32(sp)
+   1eec8:	3c110004 	lui	s1,0x4
+   1eecc:	afb0001c 	sw	s0,28(sp)
+   1eed0:	00808021 	addu	s0,a0,zero
+   1eed4:	afbf0024 	sw	ra,36(sp)
+   1eed8:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1eedc:	2624c520 	addiu	a0,s1,-15072
+   1eee0:	8e020000 	lw	v0,0(s0)
+   1eee4:	00021902 	srl	v1,v0,0x4
+   1eee8:	30630fff 	andi	v1,v1,0xfff
+   1eeec:	30640080 	andi	a0,v1,0x80
+   1eef0:	10800015 	beqz	a0,1ef48 <page_clear_dirty+0x88>
+   1eef4:	3c04ffff 	lui	a0,0xffff
+   1eef8:	3484000f 	ori	a0,a0,0xf
+   1eefc:	30630f7f 	andi	v1,v1,0xf7f
+   1ef00:	8e050020 	lw	a1,32(s0)
+   1ef04:	00441024 	and	v0,v0,a0
+   1ef08:	00031900 	sll	v1,v1,0x4
+   1ef0c:	8e040024 	lw	a0,36(s0)
+   1ef10:	00431025 	or	v0,v0,v1
+   1ef14:	ae020000 	sw	v0,0(s0)
+   1ef18:	24020001 	addiu	v0,zero,1
+   1ef1c:	aca40004 	sw	a0,4(a1)
+   1ef20:	ac850000 	sw	a1,0(a0)
+   1ef24:	2624c520 	addiu	a0,s1,-15072
+   1ef28:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1ef2c:	afa20010 	sw	v0,16(sp)
+   1ef30:	8fbf0024 	lw	ra,36(sp)
+   1ef34:	8fa20010 	lw	v0,16(sp)
+   1ef38:	8fb10020 	lw	s1,32(sp)
+   1ef3c:	8fb0001c 	lw	s0,28(sp)
+   1ef40:	03e00008 	jr	ra
+   1ef44:	27bd0028 	addiu	sp,sp,40
+   1ef48:	00001021 	addu	v0,zero,zero
+   1ef4c:	2624c520 	addiu	a0,s1,-15072
+   1ef50:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1ef54:	afa20010 	sw	v0,16(sp)
+   1ef58:	8fbf0024 	lw	ra,36(sp)
+   1ef5c:	8fa20010 	lw	v0,16(sp)
+   1ef60:	8fb10020 	lw	s1,32(sp)
+   1ef64:	8fb0001c 	lw	s0,28(sp)
+   1ef68:	03e00008 	jr	ra
+   1ef6c:	27bd0028 	addiu	sp,sp,40
+
+0001ef70 <page_set_dirty>:
+   1ef70:	27bdffd8 	addiu	sp,sp,-40
+   1ef74:	afb10020 	sw	s1,32(sp)
+   1ef78:	3c110004 	lui	s1,0x4
+   1ef7c:	afb0001c 	sw	s0,28(sp)
+   1ef80:	00808021 	addu	s0,a0,zero
+   1ef84:	afbf0024 	sw	ra,36(sp)
+   1ef88:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1ef8c:	2624c520 	addiu	a0,s1,-15072
+   1ef90:	8e020000 	lw	v0,0(s0)
+   1ef94:	00021902 	srl	v1,v0,0x4
+   1ef98:	30630fff 	andi	v1,v1,0xfff
+   1ef9c:	30640080 	andi	a0,v1,0x80
+   1efa0:	14800019 	bnez	a0,1f008 <page_set_dirty+0x98>
+   1efa4:	3c04ffff 	lui	a0,0xffff
+   1efa8:	3484000f 	ori	a0,a0,0xf
+   1efac:	34630080 	ori	v1,v1,0x80
+   1efb0:	00441024 	and	v0,v0,a0
+   1efb4:	00031900 	sll	v1,v1,0x4
+   1efb8:	00431025 	or	v0,v0,v1
+   1efbc:	ae020000 	sw	v0,0(s0)
+   1efc0:	3c020004 	lui	v0,0x4
+   1efc4:	8c44c510 	lw	a0,-15088(v0)
+   1efc8:	26030020 	addiu	v1,s0,32
+   1efcc:	2445c510 	addiu	a1,v0,-15088
+   1efd0:	ae040020 	sw	a0,32(s0)
+   1efd4:	ae050024 	sw	a1,36(s0)
+   1efd8:	ac43c510 	sw	v1,-15088(v0)
+   1efdc:	ac830004 	sw	v1,4(a0)
+   1efe0:	24020001 	addiu	v0,zero,1
+   1efe4:	2624c520 	addiu	a0,s1,-15072
+   1efe8:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1efec:	afa20010 	sw	v0,16(sp)
+   1eff0:	8fbf0024 	lw	ra,36(sp)
+   1eff4:	8fa20010 	lw	v0,16(sp)
+   1eff8:	8fb10020 	lw	s1,32(sp)
+   1effc:	8fb0001c 	lw	s0,28(sp)
+   1f000:	03e00008 	jr	ra
+   1f004:	27bd0028 	addiu	sp,sp,40
+   1f008:	00001021 	addu	v0,zero,zero
+   1f00c:	2624c520 	addiu	a0,s1,-15072
+   1f010:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   1f014:	afa20010 	sw	v0,16(sp)
+   1f018:	8fbf0024 	lw	ra,36(sp)
+   1f01c:	8fa20010 	lw	v0,16(sp)
+   1f020:	8fb10020 	lw	s1,32(sp)
+   1f024:	8fb0001c 	lw	s0,28(sp)
+   1f028:	03e00008 	jr	ra
+   1f02c:	27bd0028 	addiu	sp,sp,40
+
+0001f030 <dirty_pages_init>:
+   1f030:	3c030004 	lui	v1,0x4
+   1f034:	3c040004 	lui	a0,0x4
+   1f038:	3c050003 	lui	a1,0x3
+   1f03c:	2462c510 	addiu	v0,v1,-15088
+   1f040:	2484c520 	addiu	a0,a0,-15072
+   1f044:	24a56fd4 	addiu	a1,a1,28628
+   1f048:	ac62c510 	sw	v0,-15088(v1)
+   1f04c:	08004a24 	j	12890 <spinlock_init>
+   1f050:	ac420004 	sw	v0,4(v0)
+
+0001f054 <ppm_page2addr>:
+   1f054:	3c030004 	lui	v1,0x4
+   1f058:	24636db0 	addiu	v1,v1,28080
+   1f05c:	8c62019c 	lw	v0,412(v1)
+   1f060:	3c05b6db 	lui	a1,0xb6db
+   1f064:	00821023 	subu	v0,a0,v0
+   1f068:	34a56db7 	ori	a1,a1,0x6db7
+   1f06c:	000210c3 	sra	v0,v0,0x3
+   1f070:	70451002 	mul	v0,v0,a1
+   1f074:	8c6300d4 	lw	v1,212(v1)
+   1f078:	00021300 	sll	v0,v0,0xc
+   1f07c:	03e00008 	jr	ra
+   1f080:	00431021 	addu	v0,v0,v1
+
+0001f084 <ppm_addr2page>:
+   1f084:	8c820024 	lw	v0,36(a0)
+   1f088:	8c8300ec 	lw	v1,236(a0)
+   1f08c:	00a21023 	subu	v0,a1,v0
+   1f090:	00021302 	srl	v0,v0,0xc
+   1f094:	00022180 	sll	a0,v0,0x6
+   1f098:	000210c0 	sll	v0,v0,0x3
+   1f09c:	00821023 	subu	v0,a0,v0
+   1f0a0:	03e00008 	jr	ra
+   1f0a4:	00621021 	addu	v0,v1,v0
+
+0001f0a8 <ppm_page2ppn>:
+   1f0a8:	3c030004 	lui	v1,0x4
+   1f0ac:	24636db0 	addiu	v1,v1,28080
+   1f0b0:	8c62019c 	lw	v0,412(v1)
+   1f0b4:	3c05b6db 	lui	a1,0xb6db
+   1f0b8:	00821023 	subu	v0,a0,v0
+   1f0bc:	000210c3 	sra	v0,v0,0x3
+   1f0c0:	34a56db7 	ori	a1,a1,0x6db7
+   1f0c4:	70452002 	mul	a0,v0,a1
+   1f0c8:	8c6300d0 	lw	v1,208(v1)
+   1f0cc:	03e00008 	jr	ra
+   1f0d0:	00831021 	addu	v0,a0,v1
+
+0001f0d4 <ppm_page_is_valid>:
+   1f0d4:	3c030004 	lui	v1,0x4
+   1f0d8:	24636db0 	addiu	v1,v1,28080
+   1f0dc:	8c62019c 	lw	v0,412(v1)
+   1f0e0:	3c05b6db 	lui	a1,0xb6db
+   1f0e4:	00821023 	subu	v0,a0,v0
+   1f0e8:	34a56db7 	ori	a1,a1,0x6db7
+   1f0ec:	000210c3 	sra	v0,v0,0x3
+   1f0f0:	70451002 	mul	v0,v0,a1
+   1f0f4:	8c6301a0 	lw	v1,416(v1)
+   1f0f8:	0062102b 	sltu	v0,v1,v0
+   1f0fc:	03e00008 	jr	ra
+   1f100:	38420001 	xori	v0,v0,0x1
+
+0001f104 <ppm_ppn2page>:
+   1f104:	8c820020 	lw	v0,32(a0)
+   1f108:	8c8300ec 	lw	v1,236(a0)
+   1f10c:	00a21023 	subu	v0,a1,v0
+   1f110:	00022180 	sll	a0,v0,0x6
+   1f114:	000210c0 	sll	v0,v0,0x3
+   1f118:	00821023 	subu	v0,a0,v0
+   1f11c:	03e00008 	jr	ra
+   1f120:	00621021 	addu	v0,v1,v0
+
+0001f124 <ppm_ppn2vma>:
+   1f124:	8c820020 	lw	v0,32(a0)
+   1f128:	8c830024 	lw	v1,36(a0)
+   1f12c:	00a21023 	subu	v0,a1,v0
+   1f130:	00021300 	sll	v0,v0,0xc
+   1f134:	03e00008 	jr	ra
+   1f138:	00431021 	addu	v0,v0,v1
+
+0001f13c <ppm_vma2ppn>:
+   1f13c:	8c820024 	lw	v0,36(a0)
+   1f140:	8c830020 	lw	v1,32(a0)
+   1f144:	00a21023 	subu	v0,a1,v0
+   1f148:	00021302 	srl	v0,v0,0xc
+   1f14c:	03e00008 	jr	ra
+   1f150:	00431021 	addu	v0,v0,v1
+
+0001f154 <ppm_assert_order>:
+   1f154:	00805021 	addu	t2,a0,zero
+   1f158:	00003021 	addu	a2,zero,zero
+   1f15c:	240b0010 	addiu	t3,zero,16
+   1f160:	00061080 	sll	v0,a2,0x2
+   1f164:	00063900 	sll	a3,a2,0x4
+   1f168:	00e23823 	subu	a3,a3,v0
+   1f16c:	00873821 	addu	a3,a0,a3
+   1f170:	8d49002c 	lw	t1,44(t2)
+   1f174:	24e7002c 	addiu	a3,a3,44
+   1f178:	10e9000f 	beq	a3,t1,1f1b8 <ppm_assert_order+0x64>
+   1f17c:	00000000 	sll	zero,zero,0x0
+   1f180:	8d28ffd8 	lw	t0,-40(t1)
+   1f184:	8d220000 	lw	v0,0(t1)
+   1f188:	00084702 	srl	t0,t0,0x1c
+   1f18c:	11060008 	beq	t0,a2,1f1b0 <ppm_assert_order+0x5c>
+   1f190:	2529ffd8 	addiu	t1,t1,-40
+   1f194:	08007c75 	j	1f1d4 <ppm_assert_order+0x80>
+   1f198:	3c020004 	lui	v0,0x4
+   1f19c:	8c45ffd8 	lw	a1,-40(v0)
+   1f1a0:	2449ffd8 	addiu	t1,v0,-40
+   1f1a4:	00051702 	srl	v0,a1,0x1c
+   1f1a8:	14480008 	bne	v0,t0,1f1cc <ppm_assert_order+0x78>
+   1f1ac:	00601021 	addu	v0,v1,zero
+   1f1b0:	14e2fffa 	bne	a3,v0,1f19c <ppm_assert_order+0x48>
+   1f1b4:	8c430000 	lw	v1,0(v0)
+   1f1b8:	24c60001 	addiu	a2,a2,1
+   1f1bc:	14cbffe8 	bne	a2,t3,1f160 <ppm_assert_order+0xc>
+   1f1c0:	254a000c 	addiu	t2,t2,12
+   1f1c4:	03e00008 	jr	ra
+   1f1c8:	00000000 	sll	zero,zero,0x0
+   1f1cc:	01003021 	addu	a2,t0,zero
+   1f1d0:	3c020004 	lui	v0,0x4
+   1f1d4:	2443c960 	addiu	v1,v0,-13984
+   1f1d8:	88630003 	lwl	v1,3(v1)
+   1f1dc:	9843c960 	lwr	v1,-13984(v0)
+   1f1e0:	3062ffff 	andi	v0,v1,0xffff
+   1f1e4:	10400003 	beqz	v0,1f1f4 <ppm_assert_order+0xa0>
+   1f1e8:	3c02b6db 	lui	v0,0xb6db
+   1f1ec:	03e00008 	jr	ra
+   1f1f0:	00000000 	sll	zero,zero,0x0
+   1f1f4:	8c8700ec 	lw	a3,236(a0)
+   1f1f8:	01273823 	subu	a3,t1,a3
+   1f1fc:	000738c3 	sra	a3,a3,0x3
+   1f200:	34426db7 	ori	v0,v0,0x6db7
+   1f204:	70e23802 	mul	a3,a3,v0
+   1f208:	3c040003 	lui	a0,0x3
+   1f20c:	3c050003 	lui	a1,0x3
+   1f210:	24847010 	addiu	a0,a0,28688
+   1f214:	080009ea 	j	27a8 <__arch_boot_dmsg>
+   1f218:	24a57164 	addiu	a1,a1,29028
+
+0001f21c <ppm_print>:
+   1f21c:	27bdffb8 	addiu	sp,sp,-72
+   1f220:	afb3002c 	sw	s3,44(sp)
+   1f224:	afb00020 	sw	s0,32(sp)
+   1f228:	24930010 	addiu	s3,a0,16
+   1f22c:	3c100004 	lui	s0,0x4
+   1f230:	afb20028 	sw	s2,40(sp)
+   1f234:	afb10024 	sw	s1,36(sp)
+   1f238:	00809021 	addu	s2,a0,zero
+   1f23c:	2611c960 	addiu	s1,s0,-13984
+   1f240:	02602021 	addu	a0,s3,zero
+   1f244:	afbf0044 	sw	ra,68(sp)
+   1f248:	afbe0040 	sw	s8,64(sp)
+   1f24c:	afb7003c 	sw	s7,60(sp)
+   1f250:	afb60038 	sw	s6,56(sp)
+   1f254:	afb50034 	sw	s5,52(sp)
+   1f258:	0c004bc3 	jal	12f0c <spinlock_lock>
+   1f25c:	afb40030 	sw	s4,48(sp)
+   1f260:	8a220003 	lwl	v0,3(s1)
+   1f264:	9a02c960 	lwr	v0,-13984(s0)
+   1f268:	3043ffff 	andi	v1,v0,0xffff
+   1f26c:	10600057 	beqz	v1,1f3cc <ppm_print+0x1b0>
+   1f270:	3c050003 	lui	a1,0x3
+   1f274:	3c17b6db 	lui	s7,0xb6db
+   1f278:	3c160003 	lui	s6,0x3
+   1f27c:	3042ffff 	andi	v0,v0,0xffff
+   1f280:	36f76db7 	ori	s7,s7,0x6db7
+   1f284:	26d670a0 	addiu	s6,s6,28832
+   1f288:	0240a821 	addu	s5,s2,zero
+   1f28c:	0000a021 	addu	s4,zero,zero
+   1f290:	241e0010 	addiu	s8,zero,16
+   1f294:	1040002f 	beqz	v0,1f354 <ppm_print+0x138>
+   1f298:	00402021 	addu	a0,v0,zero
+   1f29c:	00141880 	sll	v1,s4,0x2
+   1f2a0:	00143100 	sll	a2,s4,0x4
+   1f2a4:	00c33023 	subu	a2,a2,v1
+   1f2a8:	02463021 	addu	a2,s2,a2
+   1f2ac:	8ea7002c 	lw	a3,44(s5)
+   1f2b0:	24c6002c 	addiu	a2,a2,44
+   1f2b4:	14e6000a 	bne	a3,a2,1f2e0 <ppm_print+0xc4>
+   1f2b8:	8ce30000 	lw	v1,0(a3)
+   1f2bc:	08007ccb 	j	1f32c <ppm_print+0x110>
+   1f2c0:	00000000 	sll	zero,zero,0x0
+   1f2c4:	00603821 	addu	a3,v1,zero
+   1f2c8:	10660018 	beq	v1,a2,1f32c <ppm_print+0x110>
+   1f2cc:	8c650000 	lw	a1,0(v1)
+   1f2d0:	8a220003 	lwl	v0,3(s1)
+   1f2d4:	00a01821 	addu	v1,a1,zero
+   1f2d8:	9a02c960 	lwr	v0,-13984(s0)
+   1f2dc:	3042ffff 	andi	v0,v0,0xffff
+   1f2e0:	1440fff8 	bnez	v0,1f2c4 <ppm_print+0xa8>
+   1f2e4:	00402021 	addu	a0,v0,zero
+   1f2e8:	8e4200ec 	lw	v0,236(s2)
+   1f2ec:	24e5ffd8 	addiu	a1,a3,-40
+   1f2f0:	00a22823 	subu	a1,a1,v0
+   1f2f4:	000528c3 	sra	a1,a1,0x3
+   1f2f8:	70b72802 	mul	a1,a1,s7
+   1f2fc:	02c02021 	addu	a0,s6,zero
+   1f300:	afa30018 	sw	v1,24(sp)
+   1f304:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+   1f308:	afa6001c 	sw	a2,28(sp)
+   1f30c:	8a240003 	lwl	a0,3(s1)
+   1f310:	8fa30018 	lw	v1,24(sp)
+   1f314:	9a04c960 	lwr	a0,-13984(s0)
+   1f318:	8fa6001c 	lw	a2,28(sp)
+   1f31c:	3084ffff 	andi	a0,a0,0xffff
+   1f320:	00603821 	addu	a3,v1,zero
+   1f324:	1466ffea 	bne	v1,a2,1f2d0 <ppm_print+0xb4>
+   1f328:	8c650000 	lw	a1,0(v1)
+   1f32c:	10800013 	beqz	a0,1f37c <ppm_print+0x160>
+   1f330:	00000000 	sll	zero,zero,0x0
+   1f334:	26940001 	addiu	s4,s4,1
+   1f338:	129e0017 	beq	s4,s8,1f398 <ppm_print+0x17c>
+   1f33c:	26b5000c 	addiu	s5,s5,12
+   1f340:	8a220003 	lwl	v0,3(s1)
+   1f344:	9a02c960 	lwr	v0,-13984(s0)
+   1f348:	3042ffff 	andi	v0,v0,0xffff
+   1f34c:	1440ffd3 	bnez	v0,1f29c <ppm_print+0x80>
+   1f350:	00402021 	addu	a0,v0,zero
+   1f354:	8ea60034 	lw	a2,52(s5)
+   1f358:	3c040003 	lui	a0,0x3
+   1f35c:	24847084 	addiu	a0,a0,28804
+   1f360:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+   1f364:	02802821 	addu	a1,s4,zero
+   1f368:	8a220003 	lwl	v0,3(s1)
+   1f36c:	9a02c960 	lwr	v0,-13984(s0)
+   1f370:	3042ffff 	andi	v0,v0,0xffff
+   1f374:	08007ca7 	j	1f29c <ppm_print+0x80>
+   1f378:	00402021 	addu	a0,v0,zero
+   1f37c:	3c040003 	lui	a0,0x3
+   1f380:	248470a8 	addiu	a0,a0,28840
+   1f384:	00002821 	addu	a1,zero,zero
+   1f388:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+   1f38c:	26940001 	addiu	s4,s4,1
+   1f390:	169effeb 	bne	s4,s8,1f340 <ppm_print+0x124>
+   1f394:	26b5000c 	addiu	s5,s5,12
+   1f398:	02602021 	addu	a0,s3,zero
+   1f39c:	8fbf0044 	lw	ra,68(sp)
+   1f3a0:	8fbe0040 	lw	s8,64(sp)
+   1f3a4:	8fb7003c 	lw	s7,60(sp)
+   1f3a8:	8fb60038 	lw	s6,56(sp)
+   1f3ac:	8fb50034 	lw	s5,52(sp)
+   1f3b0:	8fb40030 	lw	s4,48(sp)
+   1f3b4:	8fb3002c 	lw	s3,44(sp)
+   1f3b8:	8fb20028 	lw	s2,40(sp)
+   1f3bc:	8fb10024 	lw	s1,36(sp)
+   1f3c0:	8fb00020 	lw	s0,32(sp)
+   1f3c4:	08004b0b 	j	12c2c <spinlock_unlock>
+   1f3c8:	27bd0048 	addiu	sp,sp,72
+   1f3cc:	8e460108 	lw	a2,264(s2)
+   1f3d0:	8e430028 	lw	v1,40(s2)
+   1f3d4:	8e4200f4 	lw	v0,244(s2)
+   1f3d8:	3c040003 	lui	a0,0x3
+   1f3dc:	24847040 	addiu	a0,a0,28736
+   1f3e0:	24a57178 	addiu	a1,a1,29048
+   1f3e4:	00003821 	addu	a3,zero,zero
+   1f3e8:	afa30010 	sw	v1,16(sp)
+   1f3ec:	0c0009ea 	jal	27a8 <__arch_boot_dmsg>
+   1f3f0:	afa20014 	sw	v0,20(sp)
+   1f3f4:	8a220003 	lwl	v0,3(s1)
+   1f3f8:	08007c9d 	j	1f274 <ppm_print+0x58>
+   1f3fc:	9a02c960 	lwr	v0,-13984(s0)
+   1f400:	27bdffd8 	addiu	sp,sp,-40
+   1f404:	afb0001c 	sw	s0,28(sp)
+   1f408:	00808021 	addu	s0,a0,zero
+   1f40c:	00a02021 	addu	a0,a1,zero
+   1f410:	24050003 	addiu	a1,zero,3
+   1f414:	afb10020 	sw	s1,32(sp)
+   1f418:	afa60010 	sw	a2,16(sp)
+   1f41c:	afa70014 	sw	a3,20(sp)
+   1f420:	afbf0024 	sw	ra,36(sp)
+   1f424:	0c007a9f 	jal	1ea7c <page_state_set>
+   1f428:	8e1100ec 	lw	s1,236(s0)
+   1f42c:	8fa60010 	lw	a2,16(sp)
+   1f430:	8e0400f4 	lw	a0,244(s0)
+   1f434:	24030001 	addiu	v1,zero,1
+   1f438:	00c31804 	sllv	v1,v1,a2
+   1f43c:	00832021 	addu	a0,a0,v1
+   1f440:	2cc2000f 	sltiu	v0,a2,15
+   1f444:	ae0400f4 	sw	a0,244(s0)
+   1f448:	10400050 	beqz	v0,1f58c <ppm_print+0x370>
+   1f44c:	8fa70014 	lw	a3,20(sp)
+   1f450:	00671826 	xor	v1,v1,a3
+   1f454:	00032180 	sll	a0,v1,0x6
+   1f458:	000310c0 	sll	v0,v1,0x3
+   1f45c:	00821023 	subu	v0,a0,v0
+   1f460:	02221021 	addu	v0,s1,v0
+   1f464:	8c440000 	lw	a0,0(v0)
+   1f468:	24050003 	addiu	a1,zero,3
+   1f46c:	3088000f 	andi	t0,a0,0xf
+   1f470:	15050046 	bne	t0,a1,1f58c <ppm_print+0x370>
+   1f474:	00000000 	sll	zero,zero,0x0
+   1f478:	00042702 	srl	a0,a0,0x1c
+   1f47c:	14c40025 	bne	a2,a0,1f514 <ppm_print+0x2f8>
+   1f480:	00c02021 	addu	a0,a2,zero
+   1f484:	3c0b0fff 	lui	t3,0xfff
+   1f488:	356bffff 	ori	t3,t3,0xffff
+   1f48c:	240a0001 	addiu	t2,zero,1
+   1f490:	08007d2d 	j	1f4b4 <ppm_print+0x298>
+   1f494:	240c0003 	addiu	t4,zero,3
+   1f498:	8c450000 	lw	a1,0(v0)
+   1f49c:	00053702 	srl	a2,a1,0x1c
+   1f4a0:	30a5000f 	andi	a1,a1,0xf
+   1f4a4:	14ac001b 	bne	a1,t4,1f514 <ppm_print+0x2f8>
+   1f4a8:	00000000 	sll	zero,zero,0x0
+   1f4ac:	14c40019 	bne	a2,a0,1f514 <ppm_print+0x2f8>
+   1f4b0:	00000000 	sll	zero,zero,0x0
+   1f4b4:	00062080 	sll	a0,a2,0x2
+   1f4b8:	00064100 	sll	t0,a2,0x4
+   1f4bc:	01044023 	subu	t0,t0,a0
+   1f4c0:	02084021 	addu	t0,s0,t0
+   1f4c4:	8d090034 	lw	t1,52(t0)
+   1f4c8:	8c450028 	lw	a1,40(v0)
+   1f4cc:	8c44002c 	lw	a0,44(v0)
+   1f4d0:	2529ffff 	addiu	t1,t1,-1
+   1f4d4:	aca40004 	sw	a0,4(a1)
+   1f4d8:	ac850000 	sw	a1,0(a0)
+   1f4dc:	ad090034 	sw	t1,52(t0)
+   1f4e0:	8c480000 	lw	t0,0(v0)
+   1f4e4:	24c40001 	addiu	a0,a2,1
+   1f4e8:	008a3004 	sllv	a2,t2,a0
+   1f4ec:	00e33824 	and	a3,a3,v1
+   1f4f0:	00c71826 	xor	v1,a2,a3
+   1f4f4:	010b4024 	and	t0,t0,t3
+   1f4f8:	ac480000 	sw	t0,0(v0)
+   1f4fc:	00033180 	sll	a2,v1,0x6
+   1f500:	000310c0 	sll	v0,v1,0x3
+   1f504:	00c21023 	subu	v0,a2,v0
+   1f508:	2c85000f 	sltiu	a1,a0,15
+   1f50c:	14a0ffe2 	bnez	a1,1f498 <ppm_print+0x27c>
+   1f510:	02221021 	addu	v0,s1,v0
+   1f514:	00071180 	sll	v0,a3,0x6
+   1f518:	000738c0 	sll	a3,a3,0x3
+   1f51c:	00473823 	subu	a3,v0,a3
+   1f520:	02278821 	addu	s1,s1,a3
+   1f524:	8e230000 	lw	v1,0(s1)
+   1f528:	3c020fff 	lui	v0,0xfff
+   1f52c:	3442ffff 	ori	v0,v0,0xffff
+   1f530:	00042900 	sll	a1,a0,0x4
+   1f534:	00621024 	and	v0,v1,v0
+   1f538:	00041f00 	sll	v1,a0,0x1c
+   1f53c:	00042080 	sll	a0,a0,0x2
+   1f540:	00a42023 	subu	a0,a1,a0
+   1f544:	00431025 	or	v0,v0,v1
+   1f548:	ae220000 	sw	v0,0(s1)
+   1f54c:	02041021 	addu	v0,s0,a0
+   1f550:	8c460034 	lw	a2,52(v0)
+   1f554:	8c45002c 	lw	a1,44(v0)
+   1f558:	8fbf0024 	lw	ra,36(sp)
+   1f55c:	26230028 	addiu	v1,s1,40
+   1f560:	2444002c 	addiu	a0,v0,44
+   1f564:	24c60001 	addiu	a2,a2,1
+   1f568:	ae24002c 	sw	a0,44(s1)
+   1f56c:	ae250028 	sw	a1,40(s1)
+   1f570:	8fb0001c 	lw	s0,28(sp)
+   1f574:	8fb10020 	lw	s1,32(sp)
+   1f578:	ac460034 	sw	a2,52(v0)
+   1f57c:	aca30004 	sw	v1,4(a1)
+   1f580:	ac43002c 	sw	v1,44(v0)
+   1f584:	03e00008 	jr	ra
+   1f588:	27bd0028 	addiu	sp,sp,40
+   1f58c:	08007d45 	j	1f514 <ppm_print+0x2f8>
+   1f590:	00c02021 	addu	a0,a2,zero
+
+0001f594 <ppm_free_pages>:
+   1f594:	27bdffd0 	addiu	sp,sp,-48
+   1f598:	afb10028 	sw	s1,40(sp)
+   1f59c:	00808821 	addu	s1,a0,zero
+   1f5a0:	24840030 	addiu	a0,a0,48
+   1f5a4:	afbf002c 	sw	ra,44(sp)
+   1f5a8:	0c001a09 	jal	6824 <refcount_down>
+   1f5ac:	afb00024 	sw	s0,36(sp)
+   1f5b0:	2c420002 	sltiu	v0,v0,2
+   1f5b4:	14400005 	bnez	v0,1f5cc <ppm_free_pages+0x38>
+   1f5b8:	8fbf002c 	lw	ra,44(sp)
+   1f5bc:	8fb10028 	lw	s1,40(sp)
+   1f5c0:	8fb00024 	lw	s0,36(sp)
+   1f5c4:	03e00008 	jr	ra
+   1f5c8:	27bd0030 	addiu	sp,sp,48
+   1f5cc:	3c020004 	lui	v0,0x4
+   1f5d0:	8c476f4c 	lw	a3,28492(v0)
+   1f5d4:	3c02b6db 	lui	v0,0xb6db
+   1f5d8:	02273823 	subu	a3,s1,a3
+   1f5dc:	34426db7 	ori	v0,v0,0x6db7
+   1f5e0:	000738c3 	sra	a3,a3,0x3
+   1f5e4:	70e23802 	mul	a3,a3,v0
+   1f5e8:	8e260000 	lw	a2,0(s1)
+   1f5ec:	3c100004 	lui	s0,0x4
+   1f5f0:	26046e70 	addiu	a0,s0,28272
+   1f5f4:	27a50010 	addiu	a1,sp,16
+   1f5f8:	00063702 	srl	a2,a2,0x1c
+   1f5fc:	afa60018 	sw	a2,24(sp)
+   1f600:	0c004bbf 	jal	12efc <spinlock_lock_noirq>
+   1f604:	afa7001c 	sw	a3,28(sp)
+   1f608:	8fa60018 	lw	a2,24(sp)
+   1f60c:	8fa7001c 	lw	a3,28(sp)
+   1f610:	3c040004 	lui	a0,0x4
+   1f614:	02202821 	addu	a1,s1,zero
+   1f618:	0c007d00 	jal	1f400 <ppm_print+0x1e4>
+   1f61c:	24846e60 	addiu	a0,a0,28256
+   1f620:	8fa50010 	lw	a1,16(sp)
+   1f624:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+   1f628:	26046e70 	addiu	a0,s0,28272
+   1f62c:	8fbf002c 	lw	ra,44(sp)
+   1f630:	8fb10028 	lw	s1,40(sp)
+   1f634:	8fb00024 	lw	s0,36(sp)
+   1f638:	03e00008 	jr	ra
+   1f63c:	27bd0030 	addiu	sp,sp,48
+
+0001f640 <ppm_alloc_pages>:
+   1f640:	3c020004 	lui	v0,0x4
+   1f644:	27bdffb8 	addiu	sp,sp,-72
+   1f648:	24426e60 	addiu	v0,v0,28256
+   1f64c:	afb10034 	sw	s1,52(sp)
+   1f650:	afbf0044 	sw	ra,68(sp)
+   1f654:	afb40040 	sw	s4,64(sp)
+   1f658:	afb3003c 	sw	s3,60(sp)
+   1f65c:	afb20038 	sw	s2,56(sp)
+   1f660:	afb00030 	sw	s0,48(sp)
+   1f664:	10440020 	beq	v0,a0,1f6e8 <ppm_alloc_pages+0xa8>
+   1f668:	00a08821 	addu	s1,a1,zero
+   1f66c:	40064800 	mfc0	a2,c0_count
+   1f670:	00000000 	sll	zero,zero,0x0
+   1f674:	40042002 	mfc0	a0,$4,2
+   1f678:	40032002 	mfc0	v1,$4,2
+   1f67c:	40082002 	mfc0	t0,$4,2
+   1f680:	40057801 	mfc0	a1,$15,1
+   1f684:	40024800 	mfc0	v0,c0_count
+   1f688:	00000000 	sll	zero,zero,0x0
+   1f68c:	3c070003 	lui	a3,0x3
+   1f690:	24e77138 	addiu	a3,a3,28984
+   1f694:	afa70010 	sw	a3,16(sp)
+   1f698:	afa40014 	sw	a0,20(sp)
+   1f69c:	8c640174 	lw	a0,372(v1)
+   1f6a0:	30a50003 	andi	a1,a1,0x3
+   1f6a4:	3c030004 	lui	v1,0x4
+   1f6a8:	00052880 	sll	a1,a1,0x2
+   1f6ac:	2463c950 	addiu	v1,v1,-14000
+   1f6b0:	00a31821 	addu	v1,a1,v1
+   1f6b4:	8c890004 	lw	t1,4(a0)
+   1f6b8:	8c630000 	lw	v1,0(v1)
+   1f6bc:	3c050003 	lui	a1,0x3
+   1f6c0:	24a570b0 	addiu	a1,a1,28848
+   1f6c4:	00002021 	addu	a0,zero,zero
+   1f6c8:	240700b0 	addiu	a3,zero,176
+   1f6cc:	afa90018 	sw	t1,24(sp)
+   1f6d0:	afa8001c 	sw	t0,28(sp)
+   1f6d4:	afa30020 	sw	v1,32(sp)
+   1f6d8:	0c00097d 	jal	25f4 <__perror>
+   1f6dc:	afa20024 	sw	v0,36(sp)
+   1f6e0:	08007db8 	j	1f6e0 <ppm_alloc_pages+0xa0>
+   1f6e4:	00000000 	sll	zero,zero,0x0
+   1f6e8:	3c140004 	lui	s4,0x4
+   1f6ec:	26946db0 	addiu	s4,s4,28080
+   1f6f0:	8e8201a4 	lw	v0,420(s4)
+   1f6f4:	1440000a 	bnez	v0,1f720 <ppm_alloc_pages+0xe0>
+   1f6f8:	00008021 	addu	s0,zero,zero
+   1f6fc:	8fbf0044 	lw	ra,68(sp)
+   1f700:	02001021 	addu	v0,s0,zero
+   1f704:	8fb40040 	lw	s4,64(sp)
+   1f708:	8fb3003c 	lw	s3,60(sp)
+   1f70c:	8fb20038 	lw	s2,56(sp)
+   1f710:	8fb10034 	lw	s1,52(sp)
+   1f714:	8fb00030 	lw	s0,48(sp)
+   1f718:	03e00008 	jr	ra
+   1f71c:	27bd0048 	addiu	sp,sp,72
+   1f720:	3c130004 	lui	s3,0x4
+   1f724:	26646e70 	addiu	a0,s3,28272
+   1f728:	0c004bbf 	jal	12efc <spinlock_lock_noirq>
+   1f72c:	27a50028 	addiu	a1,sp,40
+   1f730:	00111080 	sll	v0,s1,0x2
+   1f734:	00112100 	sll	a0,s1,0x4
+   1f738:	00822023 	subu	a0,a0,v0
+   1f73c:	02842021 	addu	a0,s4,a0
+   1f740:	248400dc 	addiu	a0,a0,220
+   1f744:	02201021 	addu	v0,s1,zero
+   1f748:	02801821 	addu	v1,s4,zero
+   1f74c:	00022880 	sll	a1,v0,0x2
+   1f750:	00024100 	sll	t0,v0,0x4
+   1f754:	01054023 	subu	t0,t0,a1
+   1f758:	02883021 	addu	a2,s4,t0
+   1f75c:	2c450010 	sltiu	a1,v0,16
+   1f760:	10a00006 	beqz	a1,1f77c <ppm_alloc_pages+0x13c>
+   1f764:	24c600dc 	addiu	a2,a2,220
+   1f768:	8c920000 	lw	s2,0(a0)
+   1f76c:	16460009 	bne	s2,a2,1f794 <ppm_alloc_pages+0x154>
+   1f770:	2484000c 	addiu	a0,a0,12
+   1f774:	08007dd3 	j	1f74c <ppm_alloc_pages+0x10c>
+   1f778:	24420001 	addiu	v0,v0,1
+   1f77c:	00008021 	addu	s0,zero,zero
+   1f780:	8fa50028 	lw	a1,40(sp)
+   1f784:	0c004afb 	jal	12bec <spinlock_unlock_noirq>
+   1f788:	26646e70 	addiu	a0,s3,28272
+   1f78c:	08007dc0 	j	1f700 <ppm_alloc_pages+0xc0>
+   1f790:	8fbf0044 	lw	ra,68(sp)
+   1f794:	8c6601a4 	lw	a2,420(v1)
+   1f798:	24050001 	addiu	a1,zero,1
+   1f79c:	02252004 	sllv	a0,a1,s1
+   1f7a0:	00c42023 	subu	a0,a2,a0
+   1f7a4:	ac6401a4 	sw	a0,420(v1)
+   1f7a8:	01034021 	addu	t0,t0,v1
+   1f7ac:	2446ffff 	addiu	a2,v0,-1
+   1f7b0:	8d0900e4 	lw	t1,228(t0)
+   1f7b4:	00062080 	sll	a0,a2,0x2
+   1f7b8:	00065100 	sll	t2,a2,0x4
+   1f7bc:	2650ffd8 	addiu	s0,s2,-40
+   1f7c0:	01445023 	subu	t2,t2,a0
+   1f7c4:	8e070028 	lw	a3,40(s0)
+   1f7c8:	8e04002c 	lw	a0,44(s0)
+   1f7cc:	2529ffff 	addiu	t1,t1,-1
+   1f7d0:	006a1821 	addu	v1,v1,t2
+   1f7d4:	ad0900e4 	sw	t1,228(t0)
+   1f7d8:	3c090fff 	lui	t1,0xfff
+   1f7dc:	ace40004 	sw	a0,4(a3)
+   1f7e0:	ac870000 	sw	a3,0(a0)
+   1f7e4:	00452804 	sllv	a1,a1,v0
+   1f7e8:	246300dc 	addiu	v1,v1,220
+   1f7ec:	3529ffff 	ori	t1,t1,0xffff
+   1f7f0:	30c6000f 	andi	a2,a2,0xf
+   1f7f4:	00052842 	srl	a1,a1,0x1
+   1f7f8:	00053980 	sll	a3,a1,0x6
+   1f7fc:	000520c0 	sll	a0,a1,0x3
+   1f800:	0222402b 	sltu	t0,s1,v0
+   1f804:	2442ffff 	addiu	v0,v0,-1
+   1f808:	00e42023 	subu	a0,a3,a0
+   1f80c:	00025100 	sll	t2,v0,0x4
+   1f810:	00023880 	sll	a3,v0,0x2
+   1f814:	01475023 	subu	t2,t2,a3
+   1f818:	02042021 	addu	a0,s0,a0
+   1f81c:	028a5021 	addu	t2,s4,t2
+   1f820:	00065f00 	sll	t3,a2,0x1c
+   1f824:	254a00dc 	addiu	t2,t2,220
+   1f828:	24c6ffff 	addiu	a2,a2,-1
+   1f82c:	11000010 	beqz	t0,1f870 <ppm_alloc_pages+0x230>
+   1f830:	24870028 	addiu	a3,a0,40
+   1f834:	8c880000 	lw	t0,0(a0)
+   1f838:	ac8a002c 	sw	t2,44(a0)
+   1f83c:	01094024 	and	t0,t0,t1
+   1f840:	010b5825 	or	t3,t0,t3
+   1f844:	ac8b0000 	sw	t3,0(a0)
+   1f848:	8c6a0008 	lw	t2,8(v1)
+   1f84c:	8c680000 	lw	t0,0(v1)
+   1f850:	254a0001 	addiu	t2,t2,1
+   1f854:	ac6a0008 	sw	t2,8(v1)
+   1f858:	ac880028 	sw	t0,40(a0)
+   1f85c:	ad070004 	sw	a3,4(t0)
+   1f860:	ac670000 	sw	a3,0(v1)
+   1f864:	30c6000f 	andi	a2,a2,0xf
+   1f868:	08007dfd 	j	1f7f4 <ppm_alloc_pages+0x1b4>
+   1f86c:	2463fff4 	addiu	v1,v1,-12
+   1f870:	02002021 	addu	a0,s0,zero
+   1f874:	0c007a9f 	jal	1ea7c <page_state_set>
+   1f878:	24050004 	addiu	a1,zero,4
+   1f87c:	0c001a00 	jal	6800 <refcount_up>
+   1f880:	26040030 	addiu	a0,s0,48
+   1f884:	8e43ffd8 	lw	v1,-40(s2)
+   1f888:	3c020fff 	lui	v0,0xfff
+   1f88c:	3442ffff 	ori	v0,v0,0xffff
+   1f890:	00621024 	and	v0,v1,v0
+   1f894:	00118f00 	sll	s1,s1,0x1c
+   1f898:	00518825 	or	s1,v0,s1
+   1f89c:	08007de0 	j	1f780 <ppm_alloc_pages+0x140>
+   1f8a0:	ae51ffd8 	sw	s1,-40(s2)
+
+0001f8a4 <ppm_init>:
+   1f8a4:	3c02f0f0 	lui	v0,0xf0f0
+   1f8a8:	27bdffc0 	addiu	sp,sp,-64
+   1f8ac:	3442a5a5 	ori	v0,v0,0xa5a5
+   1f8b0:	3c050003 	lui	a1,0x3
+   1f8b4:	ac820000 	sw	v0,0(a0)
+   1f8b8:	afb00018 	sw	s0,24(sp)
+   1f8bc:	24a57144 	addiu	a1,a1,28996
+   1f8c0:	00808021 	addu	s0,a0,zero
+   1f8c4:	24840010 	addiu	a0,a0,16
+   1f8c8:	afb30024 	sw	s3,36(sp)
+   1f8cc:	afb20020 	sw	s2,32(sp)
+   1f8d0:	afb1001c 	sw	s1,28(sp)
+   1f8d4:	afa60010 	sw	a2,16(sp)
+   1f8d8:	afa70014 	sw	a3,20(sp)
+   1f8dc:	afbf003c 	sw	ra,60(sp)
+   1f8e0:	afbe0038 	sw	s8,56(sp)
+   1f8e4:	afb70034 	sw	s7,52(sp)
+   1f8e8:	afb60030 	sw	s6,48(sp)
+   1f8ec:	afb5002c 	sw	s5,44(sp)
+   1f8f0:	afb40028 	sw	s4,40(sp)
+   1f8f4:	8fb20050 	lw	s2,80(sp)
+   1f8f8:	0c004a24 	jal	12890 <spinlock_init>
+   1f8fc:	8fb30060 	lw	s3,96(sp)
+   1f900:	8fa70014 	lw	a3,20(sp)
+   1f904:	8fa60010 	lw	a2,16(sp)
+   1f908:	00071d00 	sll	v1,a3,0x14
+   1f90c:	00061302 	srl	v0,a2,0xc
+   1f910:	00621025 	or	v0,v1,v0
+   1f914:	ae020020 	sw	v0,32(s0)
+   1f918:	8fa20058 	lw	v0,88(sp)
+   1f91c:	02008821 	addu	s1,s0,zero
+   1f920:	ae020024 	sw	v0,36(s0)
+   1f924:	8fa2005c 	lw	v0,92(sp)
+   1f928:	02001821 	addu	v1,s0,zero
+   1f92c:	ae020028 	sw	v0,40(s0)
+   1f930:	24080010 	addiu	t0,zero,16
+   1f934:	00001021 	addu	v0,zero,zero
+   1f938:	00022080 	sll	a0,v0,0x2
+   1f93c:	00022900 	sll	a1,v0,0x4
+   1f940:	00a42023 	subu	a0,a1,a0
+   1f944:	02042021 	addu	a0,s0,a0
+   1f948:	2484002c 	addiu	a0,a0,44
+   1f94c:	24420001 	addiu	v0,v0,1
+   1f950:	ac640030 	sw	a0,48(v1)
+   1f954:	ac64002c 	sw	a0,44(v1)
+   1f958:	ac600034 	sw	zero,52(v1)
+   1f95c:	1448fff6 	bne	v0,t0,1f938 <ppm_init+0x94>
+   1f960:	2463000c 	addiu	v1,v1,12
+   1f964:	02469023 	subu	s2,s2,a2
+   1f968:	00129302 	srl	s2,s2,0xc
+   1f96c:	3c050003 	lui	a1,0x3
+   1f970:	24a57148 	addiu	a1,a1,29000
+   1f974:	26040110 	addiu	a0,s0,272
+   1f978:	ae1200f0 	sw	s2,240(s0)
+   1f97c:	ae060108 	sw	a2,264(s0)
+   1f980:	ae07010c 	sw	a3,268(s0)
+   1f984:	0c004a24 	jal	12890 <spinlock_init>
+   1f988:	ae0000f4 	sw	zero,244(s0)
+   1f98c:	3c050003 	lui	a1,0x3
+   1f990:	24a57154 	addiu	a1,a1,29012
+   1f994:	00001021 	addu	v0,zero,zero
+   1f998:	24040010 	addiu	a0,zero,16
+   1f99c:	00021900 	sll	v1,v0,0x4
+   1f9a0:	24630128 	addiu	v1,v1,296
+   1f9a4:	02031821 	addu	v1,s0,v1
+   1f9a8:	24420001 	addiu	v0,v0,1
+   1f9ac:	ae23012c 	sw	v1,300(s1)
+   1f9b0:	ae250120 	sw	a1,288(s1)
+   1f9b4:	ae200124 	sw	zero,292(s1)
+   1f9b8:	ae230128 	sw	v1,296(s1)
+   1f9bc:	1444fff7 	bne	v0,a0,1f99c <ppm_init+0xf8>
+   1f9c0:	26310010 	addiu	s1,s1,16
+   1f9c4:	8e0200f0 	lw	v0,240(s0)
+   1f9c8:	8e120028 	lw	s2,40(s0)
+   1f9cc:	000218c0 	sll	v1,v0,0x3
+   1f9d0:	0002a180 	sll	s4,v0,0x6
+   1f9d4:	0283a023 	subu	s4,s4,v1
+   1f9d8:	32830fff 	andi	v1,s4,0xfff
+   1f9dc:	ae1200ec 	sw	s2,236(s0)
+   1f9e0:	8e750058 	lw	s5,88(s3)
+   1f9e4:	1060008d 	beqz	v1,1fc1c <ppm_init+0x378>
+   1f9e8:	02408821 	addu	s1,s2,zero
+   1f9ec:	2403f000 	addiu	v1,zero,-4096
+   1f9f0:	0283a024 	and	s4,s4,v1
+   1f9f4:	26941000 	addiu	s4,s4,4096
+   1f9f8:	0014a302 	srl	s4,s4,0xc
+   1f9fc:	8e030024 	lw	v1,36(s0)
+   1fa00:	02431823 	subu	v1,s2,v1
+   1fa04:	00031b02 	srl	v1,v1,0xc
+   1fa08:	10400019 	beqz	v0,1fa70 <ppm_init+0x1cc>
+   1fa0c:	0283a021 	addu	s4,s4,v1
+   1fa10:	32b70fff 	andi	s7,s5,0xfff
+   1fa14:	3c1e0003 	lui	s8,0x3
+   1fa18:	27de6f78 	addiu	s8,s8,28536
+   1fa1c:	0017bc00 	sll	s7,s7,0x10
+   1fa20:	0000b021 	addu	s6,zero,zero
+   1fa24:	2642000c 	addiu	v0,s2,12
+   1fa28:	36e30001 	ori	v1,s7,0x1
+   1fa2c:	ae420010 	sw	v0,16(s2)
+   1fa30:	ae42000c 	sw	v0,12(s2)
+   1fa34:	ae430000 	sw	v1,0(s2)
+   1fa38:	26440030 	addiu	a0,s2,48
+   1fa3c:	ae5e0004 	sw	s8,4(s2)
+   1fa40:	0c0019fe 	jal	67f8 <refcount_init>
+   1fa44:	ae400008 	sw	zero,8(s2)
+   1fa48:	0c004a27 	jal	1289c <spin_init>
+   1fa4c:	26440034 	addiu	a0,s2,52
+   1fa50:	ae400014 	sw	zero,20(s2)
+   1fa54:	ae40001c 	sw	zero,28(s2)
+   1fa58:	8e0200f0 	lw	v0,240(s0)
+   1fa5c:	26d60001 	addiu	s6,s6,1
+   1fa60:	02c2102b 	sltu	v0,s6,v0
+   1fa64:	ae400018 	sw	zero,24(s2)
+   1fa68:	1440ffee 	bnez	v0,1fa24 <ppm_init+0x180>
+   1fa6c:	26520038 	addiu	s2,s2,56
+   1fa70:	12800009 	beqz	s4,1fa98 <ppm_init+0x1f4>
+   1fa74:	00000000 	sll	zero,zero,0x0
+   1fa78:	00009021 	addu	s2,zero,zero
+   1fa7c:	02202021 	addu	a0,s1,zero
+   1fa80:	26520001 	addiu	s2,s2,1
+   1fa84:	0c007a9f 	jal	1ea7c <page_state_set>
+   1fa88:	24050002 	addiu	a1,zero,2
+   1fa8c:	0254102b 	sltu	v0,s2,s4
+   1fa90:	1440fffa 	bnez	v0,1fa7c <ppm_init+0x1d8>
+   1fa94:	26310038 	addiu	s1,s1,56
+   1fa98:	8e710020 	lw	s1,32(s3)
+   1fa9c:	8e620024 	lw	v0,36(s3)
+   1faa0:	0222102b 	sltu	v0,s1,v0
+   1faa4:	10400028 	beqz	v0,1fb48 <ppm_init+0x2a4>
+   1faa8:	3c120004 	lui	s2,0x4
+   1faac:	08007ebc 	j	1faf0 <ppm_init+0x24c>
+   1fab0:	26526db0 	addiu	s2,s2,28080
+   1fab4:	8e020024 	lw	v0,36(s0)
+   1fab8:	8e0400ec 	lw	a0,236(s0)
+   1fabc:	02221023 	subu	v0,s1,v0
+   1fac0:	00021302 	srl	v0,v0,0xc
+   1fac4:	00021980 	sll	v1,v0,0x6
+   1fac8:	000210c0 	sll	v0,v0,0x3
+   1facc:	00621023 	subu	v0,v1,v0
+   1fad0:	00822021 	addu	a0,a0,v0
+   1fad4:	0c007a9f 	jal	1ea7c <page_state_set>
+   1fad8:	24050002 	addiu	a1,zero,2
+   1fadc:	8e620024 	lw	v0,36(s3)
+   1fae0:	26311000 	addiu	s1,s1,4096
+   1fae4:	0222102b 	sltu	v0,s1,v0
+   1fae8:	10400017 	beqz	v0,1fb48 <ppm_init+0x2a4>
+   1faec:	00000000 	sll	zero,zero,0x0
+   1faf0:	8e62005c 	lw	v0,92(s3)
+   1faf4:	16a2ffef 	bne	s5,v0,1fab4 <ppm_init+0x210>
+   1faf8:	00000000 	sll	zero,zero,0x0
+   1fafc:	8e4300d4 	lw	v1,212(s2)
+   1fb00:	8e040020 	lw	a0,32(s0)
+   1fb04:	8e4200d0 	lw	v0,208(s2)
+   1fb08:	02231823 	subu	v1,s1,v1
+   1fb0c:	00441023 	subu	v0,v0,a0
+   1fb10:	00031b02 	srl	v1,v1,0xc
+   1fb14:	00431021 	addu	v0,v0,v1
+   1fb18:	00021980 	sll	v1,v0,0x6
+   1fb1c:	8e0400ec 	lw	a0,236(s0)
+   1fb20:	000210c0 	sll	v0,v0,0x3
+   1fb24:	00621023 	subu	v0,v1,v0
+   1fb28:	00822021 	addu	a0,a0,v0
+   1fb2c:	0c007a9f 	jal	1ea7c <page_state_set>
+   1fb30:	24050002 	addiu	a1,zero,2
+   1fb34:	8e620024 	lw	v0,36(s3)
+   1fb38:	26311000 	addiu	s1,s1,4096
+   1fb3c:	0222102b 	sltu	v0,s1,v0
+   1fb40:	1440ffeb 	bnez	v0,1faf0 <ppm_init+0x24c>
+   1fb44:	00000000 	sll	zero,zero,0x0
+   1fb48:	8e0300f0 	lw	v1,240(s0)
+   1fb4c:	10600011 	beqz	v1,1fb94 <ppm_init+0x2f0>
+   1fb50:	8e1200ec 	lw	s2,236(s0)
+   1fb54:	00008821 	addu	s1,zero,zero
+   1fb58:	24130002 	addiu	s3,zero,2
+   1fb5c:	8e420000 	lw	v0,0(s2)
+   1fb60:	02203821 	addu	a3,s1,zero
+   1fb64:	00023702 	srl	a2,v0,0x1c
+   1fb68:	3042000f 	andi	v0,v0,0xf
+   1fb6c:	02402821 	addu	a1,s2,zero
+   1fb70:	26310001 	addiu	s1,s1,1
+   1fb74:	10530004 	beq	v0,s3,1fb88 <ppm_init+0x2e4>
+   1fb78:	02002021 	addu	a0,s0,zero
+   1fb7c:	0c007d00 	jal	1f400 <ppm_print+0x1e4>
+   1fb80:	00000000 	sll	zero,zero,0x0
+   1fb84:	8e0300f0 	lw	v1,240(s0)
+   1fb88:	0223102b 	sltu	v0,s1,v1
+   1fb8c:	1440fff3 	bnez	v0,1fb5c <ppm_init+0x2b8>
+   1fb90:	26520038 	addiu	s2,s2,56
+   1fb94:	8e0200f4 	lw	v0,244(s0)
+   1fb98:	3c0351eb 	lui	v1,0x51eb
+   1fb9c:	00022080 	sll	a0,v0,0x2
+   1fba0:	3463851f 	ori	v1,v1,0x851f
+   1fba4:	00822021 	addu	a0,a0,v0
+   1fba8:	00023100 	sll	a2,v0,0x4
+   1fbac:	00830019 	multu	a0,v1
+   1fbb0:	00022980 	sll	a1,v0,0x6
+   1fbb4:	00c52821 	addu	a1,a2,a1
+   1fbb8:	00002010 	mfhi	a0
+   1fbbc:	00a30019 	multu	a1,v1
+   1fbc0:	00c23023 	subu	a2,a2,v0
+   1fbc4:	00002810 	mfhi	a1
+   1fbc8:	00c30019 	multu	a2,v1
+   1fbcc:	8fbf003c 	lw	ra,60(sp)
+   1fbd0:	00001810 	mfhi	v1
+   1fbd4:	00042142 	srl	a0,a0,0x5
+   1fbd8:	00052942 	srl	a1,a1,0x5
+   1fbdc:	00031942 	srl	v1,v1,0x5
+   1fbe0:	00001021 	addu	v0,zero,zero
+   1fbe4:	ae040100 	sw	a0,256(s0)
+   1fbe8:	ae0500f8 	sw	a1,248(s0)
+   1fbec:	ae0300fc 	sw	v1,252(s0)
+   1fbf0:	8fbe0038 	lw	s8,56(sp)
+   1fbf4:	8fb70034 	lw	s7,52(sp)
+   1fbf8:	8fb60030 	lw	s6,48(sp)
+   1fbfc:	8fb5002c 	lw	s5,44(sp)
+   1fc00:	8fb40028 	lw	s4,40(sp)
+   1fc04:	8fb30024 	lw	s3,36(sp)
+   1fc08:	8fb20020 	lw	s2,32(sp)
+   1fc0c:	8fb1001c 	lw	s1,28(sp)
+   1fc10:	8fb00018 	lw	s0,24(sp)
+   1fc14:	03e00008 	jr	ra
+   1fc18:	27bd0040 	addiu	sp,sp,64
+   1fc1c:	08007e7f 	j	1f9fc <ppm_init+0x158>
+   1fc20:	0014a302 	srl	s4,s4,0xc
+
+0001fc24 <__ppn_refcount_up_main>:
+   1fc24:	3c040004 	lui	a0,0x4
+   1fc28:	27bdffe0 	addiu	sp,sp,-32
+   1fc2c:	24846e60 	addiu	a0,a0,28256
+   1fc30:	00e02821 	addu	a1,a3,zero
+   1fc34:	afbf001c 	sw	ra,28(sp)
+   1fc38:	0c007c41 	jal	1f104 <ppm_ppn2page>
+   1fc3c:	afa60010 	sw	a2,16(sp)
+   1fc40:	0c001a00 	jal	6800 <refcount_up>
+   1fc44:	24440030 	addiu	a0,v0,48
+   1fc48:	8fa60010 	lw	a2,16(sp)
+   1fc4c:	8fbf001c 	lw	ra,28(sp)
+   1fc50:	acc00000 	sw	zero,0(a2)
+   1fc54:	03e00008 	jr	ra
+   1fc58:	27bd0020 	addiu	sp,sp,32
+
+0001fc5c <__ppn_refcount_up_local>:
+   1fc5c:	00803021 	addu	a2,a0,zero
+   1fc60:	00a01021 	addu	v0,a1,zero
+   1fc64:	40077801 	mfc0	a3,$15,1
+   1fc68:	3c030004 	lui	v1,0x4
+   1fc6c:	2464c960 	addiu	a0,v1,-13984
+   1fc70:	88840003 	lwl	a0,3(a0)
+   1fc74:	30e70003 	andi	a3,a3,0x3
+   1fc78:	3c050004 	lui	a1,0x4
+   1fc7c:	00073880 	sll	a3,a3,0x2
+   1fc80:	24a5c950 	addiu	a1,a1,-14000
+   1fc84:	9864c960 	lwr	a0,-13984(v1)
+   1fc88:	00e51821 	addu	v1,a3,a1
+   1fc8c:	8c650000 	lw	a1,0(v1)
+   1fc90:	8c470000 	lw	a3,0(v0)
+   1fc94:	08007f09 	j	1fc24 <__ppn_refcount_up_main>
+   1fc98:	3084ffff 	andi	a0,a0,0xffff
+
+0001fc9c <__ppn_refcount_up_demarshall>:
+   1fc9c:	27bdffc8 	addiu	sp,sp,-56
+   1fca0:	afbf0034 	sw	ra,52(sp)
+   1fca4:	afbe0030 	sw	s8,48(sp)
+   1fca8:	afb4002c 	sw	s4,44(sp)
+   1fcac:	03a0f021 	addu	s8,sp,zero
+   1fcb0:	afb30028 	sw	s3,40(sp)
+   1fcb4:	afb20024 	sw	s2,36(sp)
+   1fcb8:	afb10020 	sw	s1,32(sp)
+   1fcbc:	afb0001c 	sw	s0,28(sp)
+   1fcc0:	27bdfff0 	addiu	sp,sp,-16
+   1fcc4:	27b20010 	addiu	s2,sp,16
+   1fcc8:	27bdffc8 	addiu	sp,sp,-56
+   1fccc:	27b00010 	addiu	s0,sp,16
+   1fcd0:	26020028 	addiu	v0,s0,40
+   1fcd4:	2403002c 	addiu	v1,zero,44
+   1fcd8:	ae030008 	sw	v1,8(s0)
+   1fcdc:	ae420000 	sw	v0,0(s2)
+   1fce0:	24030004 	addiu	v1,zero,4
+   1fce4:	00808821 	addu	s1,a0,zero
+   1fce8:	ae030024 	sw	v1,36(s0)
+   1fcec:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1fcf0:	8c940000 	lw	s4,0(a0)
+   1fcf4:	8e460000 	lw	a2,0(s2)
+   1fcf8:	00409821 	addu	s3,v0,zero
+   1fcfc:	02202021 	addu	a0,s1,zero
+   1fd00:	00002821 	addu	a1,zero,zero
+   1fd04:	8e320000 	lw	s2,0(s1)
+   1fd08:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1fd0c:	afc60010 	sw	a2,16(s8)
+   1fd10:	0293001b 	divu	zero,s4,s3
+   1fd14:	026001f4 	teq	s3,zero,0x7
+   1fd18:	8c470000 	lw	a3,0(v0)
+   1fd1c:	8fc60010 	lw	a2,16(s8)
+   1fd20:	02402821 	addu	a1,s2,zero
+   1fd24:	00002012 	mflo	a0
+   1fd28:	0c007f09 	jal	1fc24 <__ppn_refcount_up_main>
+   1fd2c:	3084ffff 	andi	a0,a0,0xffff
+   1fd30:	02202021 	addu	a0,s1,zero
+   1fd34:	02002821 	addu	a1,s0,zero
+   1fd38:	2406002c 	addiu	a2,zero,44
+   1fd3c:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   1fd40:	24070001 	addiu	a3,zero,1
+   1fd44:	03c0e821 	addu	sp,s8,zero
+   1fd48:	8fbf0034 	lw	ra,52(sp)
+   1fd4c:	8fbe0030 	lw	s8,48(sp)
+   1fd50:	8fb4002c 	lw	s4,44(sp)
+   1fd54:	8fb30028 	lw	s3,40(sp)
+   1fd58:	8fb20024 	lw	s2,36(sp)
+   1fd5c:	8fb10020 	lw	s1,32(sp)
+   1fd60:	8fb0001c 	lw	s0,28(sp)
+   1fd64:	03e00008 	jr	ra
+   1fd68:	27bd0038 	addiu	sp,sp,56
+
+0001fd6c <__ppn_refcount_down_main>:
+   1fd6c:	3c040004 	lui	a0,0x4
+   1fd70:	27bdffe0 	addiu	sp,sp,-32
+   1fd74:	00e02821 	addu	a1,a3,zero
+   1fd78:	24846e60 	addiu	a0,a0,28256
+   1fd7c:	afbf001c 	sw	ra,28(sp)
+   1fd80:	0c007c41 	jal	1f104 <ppm_ppn2page>
+   1fd84:	afa60010 	sw	a2,16(sp)
+   1fd88:	0c007d65 	jal	1f594 <ppm_free_pages>
+   1fd8c:	00402021 	addu	a0,v0,zero
+   1fd90:	8fa60010 	lw	a2,16(sp)
+   1fd94:	8fbf001c 	lw	ra,28(sp)
+   1fd98:	acc00000 	sw	zero,0(a2)
+   1fd9c:	03e00008 	jr	ra
+   1fda0:	27bd0020 	addiu	sp,sp,32
+
+0001fda4 <__ppn_refcount_down_demarshall>:
+   1fda4:	27bdffc8 	addiu	sp,sp,-56
+   1fda8:	afbf0034 	sw	ra,52(sp)
+   1fdac:	afbe0030 	sw	s8,48(sp)
+   1fdb0:	afb4002c 	sw	s4,44(sp)
+   1fdb4:	03a0f021 	addu	s8,sp,zero
+   1fdb8:	afb30028 	sw	s3,40(sp)
+   1fdbc:	afb20024 	sw	s2,36(sp)
+   1fdc0:	afb10020 	sw	s1,32(sp)
+   1fdc4:	afb0001c 	sw	s0,28(sp)
+   1fdc8:	27bdfff0 	addiu	sp,sp,-16
+   1fdcc:	27b20010 	addiu	s2,sp,16
+   1fdd0:	27bdffc8 	addiu	sp,sp,-56
+   1fdd4:	27b00010 	addiu	s0,sp,16
+   1fdd8:	26020028 	addiu	v0,s0,40
+   1fddc:	2403002c 	addiu	v1,zero,44
+   1fde0:	ae030008 	sw	v1,8(s0)
+   1fde4:	ae420000 	sw	v0,0(s2)
+   1fde8:	24030004 	addiu	v1,zero,4
+   1fdec:	00808821 	addu	s1,a0,zero
+   1fdf0:	ae030024 	sw	v1,36(s0)
+   1fdf4:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1fdf8:	8c940000 	lw	s4,0(a0)
+   1fdfc:	8e460000 	lw	a2,0(s2)
+   1fe00:	00409821 	addu	s3,v0,zero
+   1fe04:	02202021 	addu	a0,s1,zero
+   1fe08:	00002821 	addu	a1,zero,zero
+   1fe0c:	8e320000 	lw	s2,0(s1)
+   1fe10:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   1fe14:	afc60010 	sw	a2,16(s8)
+   1fe18:	0293001b 	divu	zero,s4,s3
+   1fe1c:	026001f4 	teq	s3,zero,0x7
+   1fe20:	8c470000 	lw	a3,0(v0)
+   1fe24:	8fc60010 	lw	a2,16(s8)
+   1fe28:	02402821 	addu	a1,s2,zero
+   1fe2c:	00002012 	mflo	a0
+   1fe30:	0c007f5b 	jal	1fd6c <__ppn_refcount_down_main>
+   1fe34:	3084ffff 	andi	a0,a0,0xffff
+   1fe38:	02202021 	addu	a0,s1,zero
+   1fe3c:	02002821 	addu	a1,s0,zero
+   1fe40:	2406002c 	addiu	a2,zero,44
+   1fe44:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   1fe48:	24070001 	addiu	a3,zero,1
+   1fe4c:	03c0e821 	addu	sp,s8,zero
+   1fe50:	8fbf0034 	lw	ra,52(sp)
+   1fe54:	8fbe0030 	lw	s8,48(sp)
+   1fe58:	8fb4002c 	lw	s4,44(sp)
+   1fe5c:	8fb30028 	lw	s3,40(sp)
+   1fe60:	8fb20024 	lw	s2,36(sp)
+   1fe64:	8fb10020 	lw	s1,32(sp)
+   1fe68:	8fb0001c 	lw	s0,28(sp)
+   1fe6c:	03e00008 	jr	ra
+   1fe70:	27bd0038 	addiu	sp,sp,56
+
+0001fe74 <__ppn_refcount_down_local>:
+   1fe74:	00803021 	addu	a2,a0,zero
+   1fe78:	00a01021 	addu	v0,a1,zero
+   1fe7c:	40077801 	mfc0	a3,$15,1
+   1fe80:	3c030004 	lui	v1,0x4
+   1fe84:	2464c960 	addiu	a0,v1,-13984
+   1fe88:	88840003 	lwl	a0,3(a0)
+   1fe8c:	30e70003 	andi	a3,a3,0x3
+   1fe90:	3c050004 	lui	a1,0x4
+   1fe94:	00073880 	sll	a3,a3,0x2
+   1fe98:	24a5c950 	addiu	a1,a1,-14000
+   1fe9c:	9864c960 	lwr	a0,-13984(v1)
+   1fea0:	00e51821 	addu	v1,a3,a1
+   1fea4:	8c650000 	lw	a1,0(v1)
+   1fea8:	8c470000 	lw	a3,0(v0)
+   1feac:	08007f5b 	j	1fd6c <__ppn_refcount_down_main>
+   1feb0:	3084ffff 	andi	a0,a0,0xffff
+
+0001feb4 <ppn_is_local>:
+   1feb4:	27bdffe8 	addiu	sp,sp,-24
+   1feb8:	afbf0014 	sw	ra,20(sp)
+   1febc:	0c000a22 	jal	2888 <pmm_ppn2cid>
+   1fec0:	00000000 	sll	zero,zero,0x0
+   1fec4:	3c030004 	lui	v1,0x4
+   1fec8:	2464c960 	addiu	a0,v1,-13984
+   1fecc:	88840003 	lwl	a0,3(a0)
+   1fed0:	8fbf0014 	lw	ra,20(sp)
+   1fed4:	9864c960 	lwr	a0,-13984(v1)
+   1fed8:	27bd0018 	addiu	sp,sp,24
+   1fedc:	3084ffff 	andi	a0,a0,0xffff
+   1fee0:	00441026 	xor	v0,v0,a0
+   1fee4:	03e00008 	jr	ra
+   1fee8:	2c420001 	sltiu	v0,v0,1
+
+0001feec <ppn_ppn2cid>:
+   1feec:	08000a22 	j	2888 <pmm_ppn2cid>
+   1fef0:	00000000 	sll	zero,zero,0x0
+
+0001fef4 <ppn_refcount_up>:
+   1fef4:	27bdffb0 	addiu	sp,sp,-80
+   1fef8:	24020004 	addiu	v0,zero,4
+   1fefc:	afb00044 	sw	s0,68(sp)
+   1ff00:	afa20038 	sw	v0,56(sp)
+   1ff04:	afa20030 	sw	v0,48(sp)
+   1ff08:	27b00028 	addiu	s0,sp,40
+   1ff0c:	27a20050 	addiu	v0,sp,80
+   1ff10:	afa40050 	sw	a0,80(sp)
+   1ff14:	afbf004c 	sw	ra,76(sp)
+   1ff18:	afb10048 	sw	s1,72(sp)
+   1ff1c:	afb0002c 	sw	s0,44(sp)
+   1ff20:	0c007fbb 	jal	1feec <ppn_ppn2cid>
+   1ff24:	afa20034 	sw	v0,52(sp)
+   1ff28:	3c030004 	lui	v1,0x4
+   1ff2c:	2464c960 	addiu	a0,v1,-13984
+   1ff30:	88840003 	lwl	a0,3(a0)
+   1ff34:	9864c960 	lwr	a0,-13984(v1)
+   1ff38:	3084ffff 	andi	a0,a0,0xffff
+   1ff3c:	1044001e 	beq	v0,a0,1ffb8 <ppn_refcount_up+0xc4>
+   1ff40:	02002021 	addu	a0,s0,zero
+   1ff44:	0c007fbb 	jal	1feec <ppn_ppn2cid>
+   1ff48:	8fa40050 	lw	a0,80(sp)
+   1ff4c:	00408021 	addu	s0,v0,zero
+   1ff50:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   1ff54:	40117801 	mfc0	s1,$15,1
+   1ff58:	72021802 	mul	v1,s0,v0
+   1ff5c:	32240003 	andi	a0,s1,0x3
+   1ff60:	00642021 	addu	a0,v1,a0
+   1ff64:	27a3002c 	addiu	v1,sp,44
+   1ff68:	afa30018 	sw	v1,24(sp)
+   1ff6c:	27a30030 	addiu	v1,sp,48
+   1ff70:	afa3001c 	sw	v1,28(sp)
+   1ff74:	3c070002 	lui	a3,0x2
+   1ff78:	27a30034 	addiu	v1,sp,52
+   1ff7c:	24020001 	addiu	v0,zero,1
+   1ff80:	afa30020 	sw	v1,32(sp)
+   1ff84:	24e7fc9c 	addiu	a3,a3,-868
+   1ff88:	27a30038 	addiu	v1,sp,56
+   1ff8c:	24050001 	addiu	a1,zero,1
+   1ff90:	00003021 	addu	a2,zero,zero
+   1ff94:	afa20014 	sw	v0,20(sp)
+   1ff98:	afa30024 	sw	v1,36(sp)
+   1ff9c:	0c003de8 	jal	f7a0 <rppc_generic>
+   1ffa0:	afa20010 	sw	v0,16(sp)
+   1ffa4:	8fbf004c 	lw	ra,76(sp)
+   1ffa8:	8fb10048 	lw	s1,72(sp)
+   1ffac:	8fb00044 	lw	s0,68(sp)
+   1ffb0:	03e00008 	jr	ra
+   1ffb4:	27bd0050 	addiu	sp,sp,80
+   1ffb8:	0c007f17 	jal	1fc5c <__ppn_refcount_up_local>
+   1ffbc:	27a50050 	addiu	a1,sp,80
+   1ffc0:	8fbf004c 	lw	ra,76(sp)
+   1ffc4:	8fb10048 	lw	s1,72(sp)
+   1ffc8:	8fb00044 	lw	s0,68(sp)
+   1ffcc:	03e00008 	jr	ra
+   1ffd0:	27bd0050 	addiu	sp,sp,80
+
+0001ffd4 <ppn_refcount_down>:
+   1ffd4:	27bdffb0 	addiu	sp,sp,-80
+   1ffd8:	24020004 	addiu	v0,zero,4
+   1ffdc:	afb00044 	sw	s0,68(sp)
+   1ffe0:	afa20038 	sw	v0,56(sp)
+   1ffe4:	afa20030 	sw	v0,48(sp)
+   1ffe8:	27b00028 	addiu	s0,sp,40
+   1ffec:	27a20050 	addiu	v0,sp,80
+   1fff0:	afa40050 	sw	a0,80(sp)
+   1fff4:	afbf004c 	sw	ra,76(sp)
+   1fff8:	afb10048 	sw	s1,72(sp)
+   1fffc:	afb0002c 	sw	s0,44(sp)
+   20000:	0c007fbb 	jal	1feec <ppn_ppn2cid>
+   20004:	afa20034 	sw	v0,52(sp)
+   20008:	3c030004 	lui	v1,0x4
+   2000c:	2464c960 	addiu	a0,v1,-13984
+   20010:	88840003 	lwl	a0,3(a0)
+   20014:	9864c960 	lwr	a0,-13984(v1)
+   20018:	3084ffff 	andi	a0,a0,0xffff
+   2001c:	1044001e 	beq	v0,a0,20098 <ppn_refcount_down+0xc4>
+   20020:	02002021 	addu	a0,s0,zero
+   20024:	0c007fbb 	jal	1feec <ppn_ppn2cid>
+   20028:	8fa40050 	lw	a0,80(sp)
+   2002c:	00408021 	addu	s0,v0,zero
+   20030:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   20034:	40117801 	mfc0	s1,$15,1
+   20038:	72021802 	mul	v1,s0,v0
+   2003c:	32240003 	andi	a0,s1,0x3
+   20040:	00642021 	addu	a0,v1,a0
+   20044:	27a3002c 	addiu	v1,sp,44
+   20048:	afa30018 	sw	v1,24(sp)
+   2004c:	27a30030 	addiu	v1,sp,48
+   20050:	afa3001c 	sw	v1,28(sp)
+   20054:	3c070002 	lui	a3,0x2
+   20058:	27a30034 	addiu	v1,sp,52
+   2005c:	24020001 	addiu	v0,zero,1
+   20060:	afa30020 	sw	v1,32(sp)
+   20064:	24e7fda4 	addiu	a3,a3,-604
+   20068:	27a30038 	addiu	v1,sp,56
+   2006c:	24050001 	addiu	a1,zero,1
+   20070:	00003021 	addu	a2,zero,zero
+   20074:	afa20014 	sw	v0,20(sp)
+   20078:	afa30024 	sw	v1,36(sp)
+   2007c:	0c003de8 	jal	f7a0 <rppc_generic>
+   20080:	afa20010 	sw	v0,16(sp)
+   20084:	8fbf004c 	lw	ra,76(sp)
+   20088:	8fb10048 	lw	s1,72(sp)
+   2008c:	8fb00044 	lw	s0,68(sp)
+   20090:	03e00008 	jr	ra
+   20094:	27bd0050 	addiu	sp,sp,80
+   20098:	0c007f9d 	jal	1fe74 <__ppn_refcount_down_local>
+   2009c:	27a50050 	addiu	a1,sp,80
+   200a0:	8fbf004c 	lw	ra,76(sp)
+   200a4:	8fb10048 	lw	s1,72(sp)
+   200a8:	8fb00044 	lw	s0,68(sp)
+   200ac:	03e00008 	jr	ra
+   200b0:	27bd0050 	addiu	sp,sp,80
+
+000200b4 <ppn_ppn2vma>:
+   200b4:	08000a20 	j	2880 <pmm_ppn2vma>
+   200b8:	00000000 	sll	zero,zero,0x0
+
+000200bc <ppn_copy>:
+   200bc:	27bdffd8 	addiu	sp,sp,-40
+   200c0:	afbf0024 	sw	ra,36(sp)
+   200c4:	afb20020 	sw	s2,32(sp)
+   200c8:	afb1001c 	sw	s1,28(sp)
+   200cc:	afb00018 	sw	s0,24(sp)
+   200d0:	afa50010 	sw	a1,16(sp)
+   200d4:	0c000a22 	jal	2888 <pmm_ppn2cid>
+   200d8:	00808021 	addu	s0,a0,zero
+   200dc:	8fa50010 	lw	a1,16(sp)
+   200e0:	00408821 	addu	s1,v0,zero
+   200e4:	0c000a22 	jal	2888 <pmm_ppn2cid>
+   200e8:	00a02021 	addu	a0,a1,zero
+   200ec:	02002021 	addu	a0,s0,zero
+   200f0:	0c000a20 	jal	2880 <pmm_ppn2vma>
+   200f4:	00409021 	addu	s2,v0,zero
+   200f8:	8fa50010 	lw	a1,16(sp)
+   200fc:	00408021 	addu	s0,v0,zero
+   20100:	0c000a20 	jal	2880 <pmm_ppn2vma>
+   20104:	00a02021 	addu	a0,a1,zero
+   20108:	3c030004 	lui	v1,0x4
+   2010c:	2464c960 	addiu	a0,v1,-13984
+   20110:	88840003 	lwl	a0,3(a0)
+   20114:	9864c960 	lwr	a0,-13984(v1)
+   20118:	3084ffff 	andi	a0,a0,0xffff
+   2011c:	1224003f 	beq	s1,a0,2021c <ppn_copy+0x160>
+   20120:	2e430101 	sltiu	v1,s2,257
+   20124:	14600003 	bnez	v1,20134 <ppn_copy+0x78>
+   20128:	00121900 	sll	v1,s2,0x4
+   2012c:	0800804b 	j	2012c <ppn_copy+0x70>
+   20130:	00000000 	sll	zero,zero,0x0
+   20134:	3c040004 	lui	a0,0x4
+   20138:	00129080 	sll	s2,s2,0x2
+   2013c:	00721823 	subu	v1,v1,s2
+   20140:	2484c9a0 	addiu	a0,a0,-13920
+   20144:	00831821 	addu	v1,a0,v1
+   20148:	8c650000 	lw	a1,0(v1)
+   2014c:	3c035555 	lui	v1,0x5555
+   20150:	34635555 	ori	v1,v1,0x5555
+   20154:	10a3fff5 	beq	a1,v1,2012c <ppn_copy+0x70>
+   20158:	2e260101 	sltiu	a2,s1,257
+   2015c:	10c0003a 	beqz	a2,20248 <ppn_copy+0x18c>
+   20160:	00113100 	sll	a2,s1,0x4
+   20164:	00118880 	sll	s1,s1,0x2
+   20168:	00d18823 	subu	s1,a2,s1
+   2016c:	00912021 	addu	a0,a0,s1
+   20170:	8c860000 	lw	a2,0(a0)
+   20174:	10c30034 	beq	a2,v1,20248 <ppn_copy+0x18c>
+   20178:	32030003 	andi	v1,s0,0x3
+   2017c:	14600035 	bnez	v1,20254 <ppn_copy+0x198>
+   20180:	00001821 	addu	v1,zero,zero
+   20184:	30430003 	andi	v1,v0,0x3
+   20188:	14600031 	bnez	v1,20250 <ppn_copy+0x194>
+   2018c:	00000000 	sll	zero,zero,0x0
+   20190:	24031000 	addiu	v1,zero,4096
+   20194:	24070400 	addiu	a3,zero,1024
+   20198:	08008071 	j	201c4 <ppn_copy+0x108>
+   2019c:	00002021 	addu	a0,zero,zero
+   201a0:	020a5821 	addu	t3,s0,t2
+   201a4:	004a5021 	addu	t2,v0,t2
+   201a8:	4808c000 	mfc2	t0,$24
+   201ac:	4885c000 	mtc2	a1,$24
+   201b0:	8d490000 	lw	t1,0(t2)
+   201b4:	4886c000 	mtc2	a2,$24
+   201b8:	ad690000 	sw	t1,0(t3)
+   201bc:	4888c000 	mtc2	t0,$24
+   201c0:	24840001 	addiu	a0,a0,1
+   201c4:	1487fff6 	bne	a0,a3,201a0 <ppn_copy+0xe4>
+   201c8:	00045080 	sll	t2,a0,0x2
+   201cc:	24041000 	addiu	a0,zero,4096
+   201d0:	00621021 	addu	v0,v1,v0
+   201d4:	1064000b 	beq	v1,a0,20204 <ppn_copy+0x148>
+   201d8:	02038021 	addu	s0,s0,v1
+   201dc:	4808c000 	mfc2	t0,$24
+   201e0:	4885c000 	mtc2	a1,$24
+   201e4:	80490000 	lb	t1,0(v0)
+   201e8:	4886c000 	mtc2	a2,$24
+   201ec:	a2090000 	sb	t1,0(s0)
+   201f0:	4888c000 	mtc2	t0,$24
+   201f4:	24630001 	addiu	v1,v1,1
+   201f8:	24420001 	addiu	v0,v0,1
+   201fc:	1464fff7 	bne	v1,a0,201dc <ppn_copy+0x120>
+   20200:	26100001 	addiu	s0,s0,1
+   20204:	8fbf0024 	lw	ra,36(sp)
+   20208:	8fb20020 	lw	s2,32(sp)
+   2020c:	8fb1001c 	lw	s1,28(sp)
+   20210:	8fb00018 	lw	s0,24(sp)
+   20214:	03e00008 	jr	ra
+   20218:	27bd0028 	addiu	sp,sp,40
+   2021c:	1632ffc1 	bne	s1,s2,20124 <ppn_copy+0x68>
+   20220:	00000000 	sll	zero,zero,0x0
+   20224:	02002021 	addu	a0,s0,zero
+   20228:	8fbf0024 	lw	ra,36(sp)
+   2022c:	8fb20020 	lw	s2,32(sp)
+   20230:	8fb1001c 	lw	s1,28(sp)
+   20234:	8fb00018 	lw	s0,24(sp)
+   20238:	00402821 	addu	a1,v0,zero
+   2023c:	24061000 	addiu	a2,zero,4096
+   20240:	0800c12b 	j	304ac <memcpy>
+   20244:	27bd0028 	addiu	sp,sp,40
+   20248:	08008092 	j	20248 <ppn_copy+0x18c>
+   2024c:	00000000 	sll	zero,zero,0x0
+   20250:	00001821 	addu	v1,zero,zero
+   20254:	08008066 	j	20198 <ppn_copy+0xdc>
+   20258:	00003821 	addu	a3,zero,zero
+
+0002025c <vmm_madvise_willneed>:
+   2025c:	03e00008 	jr	ra
+   20260:	24020026 	addiu	v0,zero,38
+
+00020264 <vmm_check_address>:
+   20264:	8ca302bc 	lw	v1,700(a1)
+   20268:	27bdffc8 	addiu	sp,sp,-56
+   2026c:	00c01021 	addu	v0,a2,zero
+   20270:	00c3302b 	sltu	a2,a2,v1
+   20274:	afbf0034 	sw	ra,52(sp)
+   20278:	00805021 	addu	t2,a0,zero
+   2027c:	14c0001c 	bnez	a2,202f0 <vmm_check_address+0x8c>
+   20280:	00e04021 	addu	t0,a3,zero
+   20284:	8ca90290 	lw	t1,656(a1)
+   20288:	00e22021 	addu	a0,a3,v0
+   2028c:	0089202b 	sltu	a0,a0,t1
+   20290:	14800019 	bnez	a0,202f8 <vmm_check_address+0x94>
+   20294:	8fbf0034 	lw	ra,52(sp)
+   20298:	400b4800 	mfc0	t3,c0_count
+   2029c:	00000000 	sll	zero,zero,0x0
+   202a0:	3c040004 	lui	a0,0x4
+   202a4:	8cac05c4 	lw	t4,1476(a1)
+   202a8:	8c849100 	lw	a0,-28416(a0)
+   202ac:	3c060003 	lui	a2,0x3
+   202b0:	3c070003 	lui	a3,0x3
+   202b4:	24c67184 	addiu	a2,a2,29060
+   202b8:	24e77298 	addiu	a3,a3,29336
+   202bc:	00002821 	addu	a1,zero,zero
+   202c0:	afac0010 	sw	t4,16(sp)
+   202c4:	afaa0014 	sw	t2,20(sp)
+   202c8:	afa20018 	sw	v0,24(sp)
+   202cc:	afa3001c 	sw	v1,28(sp)
+   202d0:	afa80020 	sw	t0,32(sp)
+   202d4:	afa90024 	sw	t1,36(sp)
+   202d8:	0c0009b0 	jal	26c0 <__fprintk>
+   202dc:	afab0028 	sw	t3,40(sp)
+   202e0:	8fbf0034 	lw	ra,52(sp)
+   202e4:	24020016 	addiu	v0,zero,22
+   202e8:	03e00008 	jr	ra
+   202ec:	27bd0038 	addiu	sp,sp,56
+   202f0:	080080a6 	j	20298 <vmm_check_address+0x34>
+   202f4:	8ca90290 	lw	t1,656(a1)
+   202f8:	00001021 	addu	v0,zero,zero
+   202fc:	03e00008 	jr	ra
+   20300:	27bd0038 	addiu	sp,sp,56
+
+00020304 <vmm_keysdb_update>:
+   20304:	00a03821 	addu	a3,a1,zero
+   20308:	8ce600f0 	lw	a2,240(a3)
+   2030c:	8ca500ec 	lw	a1,236(a1)
+   20310:	248400f4 	addiu	a0,a0,244
+   20314:	00c53023 	subu	a2,a2,a1
+   20318:	00063402 	srl	a2,a2,0x10
+   2031c:	08002d0c 	j	b430 <keysdb_bind>
+   20320:	00052c02 	srl	a1,a1,0x10
+
+00020324 <__vmm_fault_handler>:
+   20324:	27bdffb8 	addiu	sp,sp,-72
+   20328:	afb20034 	sw	s2,52(sp)
+   2032c:	afb10030 	sw	s1,48(sp)
+   20330:	afbf0044 	sw	ra,68(sp)
+   20334:	afb50040 	sw	s5,64(sp)
+   20338:	afb4003c 	sw	s4,60(sp)
+   2033c:	afb30038 	sw	s3,56(sp)
+   20340:	afb0002c 	sw	s0,44(sp)
+   20344:	00808821 	addu	s1,a0,zero
+   20348:	00a09021 	addu	s2,a1,zero
+   2034c:	40102002 	mfc0	s0,$4,2
+   20350:	3c027fff 	lui	v0,0x7fff
+   20354:	8e0301f8 	lw	v1,504(s0)
+   20358:	2484c000 	addiu	a0,a0,-16384
+   2035c:	3442c000 	ori	v0,v0,0xc000
+   20360:	24630001 	addiu	v1,v1,1
+   20364:	0082102b 	sltu	v0,a0,v0
+   20368:	14400025 	bnez	v0,20400 <__vmm_fault_handler+0xdc>
+   2036c:	ae0301f8 	sw	v1,504(s0)
+   20370:	30b20100 	andi	s2,a1,0x100
+   20374:	16400027 	bnez	s2,20414 <__vmm_fault_handler+0xf0>
+   20378:	24020001 	addiu	v0,zero,1
+   2037c:	3c140004 	lui	s4,0x4
+   20380:	2694c950 	addiu	s4,s4,-14000
+   20384:	3c130004 	lui	s3,0x4
+   20388:	3c120003 	lui	s2,0x3
+   2038c:	40047801 	mfc0	a0,$15,1
+   20390:	40024800 	mfc0	v0,c0_count
+   20394:	00000000 	sll	zero,zero,0x0
+   20398:	30840003 	andi	a0,a0,0x3
+   2039c:	8e030180 	lw	v1,384(s0)
+   203a0:	00042080 	sll	a0,a0,0x2
+   203a4:	0284a021 	addu	s4,s4,a0
+   203a8:	8c6805c4 	lw	t0,1476(v1)
+   203ac:	8e649100 	lw	a0,-28416(s3)
+   203b0:	8e830000 	lw	v1,0(s4)
+   203b4:	3c060003 	lui	a2,0x3
+   203b8:	2647726c 	addiu	a3,s2,29292
+   203bc:	24c67220 	addiu	a2,a2,29216
+   203c0:	00002821 	addu	a1,zero,zero
+   203c4:	afb00014 	sw	s0,20(sp)
+   203c8:	afa80010 	sw	t0,16(sp)
+   203cc:	afa30018 	sw	v1,24(sp)
+   203d0:	0c0009b0 	jal	26c0 <__fprintk>
+   203d4:	afa2001c 	sw	v0,28(sp)
+   203d8:	8fbf0044 	lw	ra,68(sp)
+   203dc:	24020003 	addiu	v0,zero,3
+   203e0:	8fb50040 	lw	s5,64(sp)
+   203e4:	8fb4003c 	lw	s4,60(sp)
+   203e8:	8fb30038 	lw	s3,56(sp)
+   203ec:	8fb20034 	lw	s2,52(sp)
+   203f0:	8fb10030 	lw	s1,48(sp)
+   203f4:	8fb0002c 	lw	s0,44(sp)
+   203f8:	03e00008 	jr	ra
+   203fc:	27bd0048 	addiu	sp,sp,72
+   20400:	8e020184 	lw	v0,388(s0)
+   20404:	30420001 	andi	v0,v0,0x1
+   20408:	1040000b 	beqz	v0,20438 <__vmm_fault_handler+0x114>
+   2040c:	8e130180 	lw	s3,384(s0)
+   20410:	24020001 	addiu	v0,zero,1
+   20414:	8fbf0044 	lw	ra,68(sp)
+   20418:	8fb50040 	lw	s5,64(sp)
+   2041c:	8fb4003c 	lw	s4,60(sp)
+   20420:	8fb30038 	lw	s3,56(sp)
+   20424:	8fb20034 	lw	s2,52(sp)
+   20428:	8fb10030 	lw	s1,48(sp)
+   2042c:	8fb0002c 	lw	s0,44(sp)
+   20430:	03e00008 	jr	ra
+   20434:	27bd0048 	addiu	sp,sp,72
+   20438:	26640274 	addiu	a0,s3,628
+   2043c:	0c002c3a 	jal	b0e8 <keysdb_lookup>
+   20440:	00112c02 	srl	a1,s1,0x10
+   20444:	0040a821 	addu	s5,v0,zero
+   20448:	10400030 	beqz	v0,2050c <__vmm_fault_handler+0x1e8>
+   2044c:	26740180 	addiu	s4,s3,384
+   20450:	00001821 	addu	v1,zero,zero
+   20454:	8ea200f8 	lw	v0,248(s5)
+   20458:	0051102b 	sltu	v0,v0,s1
+   2045c:	14400005 	bnez	v0,20474 <__vmm_fault_handler+0x150>
+   20460:	00000000 	sll	zero,zero,0x0
+   20464:	8ea200f4 	lw	v0,244(s5)
+   20468:	0222102b 	sltu	v0,s1,v0
+   2046c:	1040001d 	beqz	v0,204e4 <__vmm_fault_handler+0x1c0>
+   20470:	00000000 	sll	zero,zero,0x0
+   20474:	32520100 	andi	s2,s2,0x100
+   20478:	1640ffe6 	bnez	s2,20414 <__vmm_fault_handler+0xf0>
+   2047c:	24020001 	addiu	v0,zero,1
+   20480:	40027801 	mfc0	v0,$15,1
+   20484:	3c140004 	lui	s4,0x4
+   20488:	30420003 	andi	v0,v0,0x3
+   2048c:	2694c950 	addiu	s4,s4,-14000
+   20490:	00021080 	sll	v0,v0,0x2
+   20494:	02821021 	addu	v0,s4,v0
+   20498:	8c420000 	lw	v0,0(v0)
+   2049c:	3c130004 	lui	s3,0x4
+   204a0:	afa20010 	sw	v0,16(sp)
+   204a4:	8e020180 	lw	v0,384(s0)
+   204a8:	3c120003 	lui	s2,0x3
+   204ac:	8c4205c4 	lw	v0,1476(v0)
+   204b0:	8e649100 	lw	a0,-28416(s3)
+   204b4:	afa20014 	sw	v0,20(sp)
+   204b8:	8e0202f8 	lw	v0,760(s0)
+   204bc:	3c060003 	lui	a2,0x3
+   204c0:	24c671dc 	addiu	a2,a2,29148
+   204c4:	00002821 	addu	a1,zero,zero
+   204c8:	2647726c 	addiu	a3,s2,29292
+   204cc:	afa20018 	sw	v0,24(sp)
+   204d0:	afb1001c 	sw	s1,28(sp)
+   204d4:	0c0009b0 	jal	26c0 <__fprintk>
+   204d8:	afb50020 	sw	s5,32(sp)
+   204dc:	080080e3 	j	2038c <__vmm_fault_handler+0x68>
+   204e0:	00000000 	sll	zero,zero,0x0
+   204e4:	14600016 	bnez	v1,20540 <__vmm_fault_handler+0x21c>
+   204e8:	02802021 	addu	a0,s4,zero
+   204ec:	02a02021 	addu	a0,s5,zero
+   204f0:	02202821 	addu	a1,s1,zero
+   204f4:	0c0086a7 	jal	21a9c <vm_region_update>
+   204f8:	02403021 	addu	a2,s2,zero
+   204fc:	1440ffa0 	bnez	v0,20380 <__vmm_fault_handler+0x5c>
+   20500:	3c140004 	lui	s4,0x4
+   20504:	08008106 	j	20418 <__vmm_fault_handler+0xf4>
+   20508:	8fbf0044 	lw	ra,68(sp)
+   2050c:	26730190 	addiu	s3,s3,400
+   20510:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   20514:	02602021 	addu	a0,s3,zero
+   20518:	02802021 	addu	a0,s4,zero
+   2051c:	0c00868b 	jal	21a2c <vm_region_find>
+   20520:	02202821 	addu	a1,s1,zero
+   20524:	0040a821 	addu	s5,v0,zero
+   20528:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   2052c:	02602021 	addu	a0,s3,zero
+   20530:	12a0ffd0 	beqz	s5,20474 <__vmm_fault_handler+0x150>
+   20534:	00000000 	sll	zero,zero,0x0
+   20538:	08008115 	j	20454 <__vmm_fault_handler+0x130>
+   2053c:	24030001 	addiu	v1,zero,1
+   20540:	02a02821 	addu	a1,s5,zero
+   20544:	0c0080c1 	jal	20304 <vmm_keysdb_update>
+   20548:	02203021 	addu	a2,s1,zero
+   2054c:	0800813c 	j	204f0 <__vmm_fault_handler+0x1cc>
+   20550:	02a02021 	addu	a0,s5,zero
+
+00020554 <vmm_fault_handler>:
+   20554:	27bdffd8 	addiu	sp,sp,-40
+   20558:	afb20020 	sw	s2,32(sp)
+   2055c:	afbf0024 	sw	ra,36(sp)
+   20560:	afb1001c 	sw	s1,28(sp)
+   20564:	afb00018 	sw	s0,24(sp)
+   20568:	00809021 	addu	s2,a0,zero
+   2056c:	40112002 	mfc0	s1,$4,2
+   20570:	8e300130 	lw	s0,304(s1)
+   20574:	24020001 	addiu	v0,zero,1
+   20578:	1202002c 	beq	s0,v0,2062c <vmm_fault_handler+0xd8>
+   2057c:	24020002 	addiu	v0,zero,2
+   20580:	40016000 	mfc0	at,c0_status
+   20584:	00000000 	sll	zero,zero,0x0
+   20588:	00011025 	or	v0,zero,at
+   2058c:	34210001 	ori	at,at,0x1
+   20590:	40816000 	mtc0	at,c0_status
+   20594:	00000000 	sll	zero,zero,0x0
+   20598:	0c0080c9 	jal	20324 <__vmm_fault_handler>
+   2059c:	02402021 	addu	a0,s2,zero
+   205a0:	00409021 	addu	s2,v0,zero
+   205a4:	40016000 	mfc0	at,c0_status
+   205a8:	00000000 	sll	zero,zero,0x0
+   205ac:	00011025 	or	v0,zero,at
+   205b0:	00010842 	srl	at,at,0x1
+   205b4:	00010840 	sll	at,at,0x1
+   205b8:	40816000 	mtc0	at,c0_status
+   205bc:	24020001 	addiu	v0,zero,1
+   205c0:	12020007 	beq	s0,v0,205e0 <vmm_fault_handler+0x8c>
+   205c4:	8fbf0024 	lw	ra,36(sp)
+   205c8:	02401021 	addu	v0,s2,zero
+   205cc:	8fb20020 	lw	s2,32(sp)
+   205d0:	8fb1001c 	lw	s1,28(sp)
+   205d4:	8fb00018 	lw	s0,24(sp)
+   205d8:	03e00008 	jr	ra
+   205dc:	27bd0028 	addiu	sp,sp,40
+   205e0:	8e220134 	lw	v0,308(s1)
+   205e4:	34420080 	ori	v0,v0,0x80
+   205e8:	0c0021a3 	jal	868c <cpu_yield>
+   205ec:	ae220134 	sw	v0,308(s1)
+   205f0:	40112002 	mfc0	s1,$4,2
+   205f4:	8e230134 	lw	v1,308(s1)
+   205f8:	2402ff7f 	addiu	v0,zero,-129
+   205fc:	00621024 	and	v0,v1,v0
+   20600:	ae220134 	sw	v0,308(s1)
+   20604:	0c006ca8 	jal	1b2a0 <tm_sys_compute>
+   20608:	02202021 	addu	a0,s1,zero
+   2060c:	8fbf0024 	lw	ra,36(sp)
+   20610:	ae300130 	sw	s0,304(s1)
+   20614:	02401021 	addu	v0,s2,zero
+   20618:	8fb20020 	lw	s2,32(sp)
+   2061c:	8fb1001c 	lw	s1,28(sp)
+   20620:	8fb00018 	lw	s0,24(sp)
+   20624:	03e00008 	jr	ra
+   20628:	27bd0028 	addiu	sp,sp,40
+   2062c:	ae220130 	sw	v0,304(s1)
+   20630:	02202021 	addu	a0,s1,zero
+   20634:	0c006cbd 	jal	1b2f4 <tm_usr_compute>
+   20638:	afa50010 	sw	a1,16(sp)
+   2063c:	08008160 	j	20580 <vmm_fault_handler+0x2c>
+   20640:	8fa50010 	lw	a1,16(sp)
+
+00020644 <vmm_update_shared_page>:
+   20644:	27bdffc0 	addiu	sp,sp,-64
+   20648:	afb0002c 	sw	s0,44(sp)
+   2064c:	00808021 	addu	s0,a0,zero
+   20650:	8c8400e8 	lw	a0,232(a0)
+   20654:	afb10030 	sw	s1,48(sp)
+   20658:	27b10010 	addiu	s1,sp,16
+   2065c:	afb20034 	sw	s2,52(sp)
+   20660:	248400d0 	addiu	a0,a0,208
+   20664:	00c09021 	addu	s2,a2,zero
+   20668:	02203021 	addu	a2,s1,zero
+   2066c:	afb30038 	sw	s3,56(sp)
+   20670:	afbf003c 	sw	ra,60(sp)
+   20674:	0c000a56 	jal	2958 <pmm_get_page>
+   20678:	00a09821 	addu	s3,a1,zero
+   2067c:	14400003 	bnez	v0,2068c <vmm_update_shared_page+0x48>
+   20680:	8fa30010 	lw	v1,16(sp)
+   20684:	10600008 	beqz	v1,206a8 <vmm_update_shared_page+0x64>
+   20688:	02602821 	addu	a1,s3,zero
+   2068c:	8fbf003c 	lw	ra,60(sp)
+   20690:	8fb30038 	lw	s3,56(sp)
+   20694:	8fb20034 	lw	s2,52(sp)
+   20698:	8fb10030 	lw	s1,48(sp)
+   2069c:	8fb0002c 	lw	s0,44(sp)
+   206a0:	03e00008 	jr	ra
+   206a4:	27bd0040 	addiu	sp,sp,64
+   206a8:	8e0400e8 	lw	a0,232(s0)
+   206ac:	8e020100 	lw	v0,256(s0)
+   206b0:	02203021 	addu	a2,s1,zero
+   206b4:	248400d0 	addiu	a0,a0,208
+   206b8:	afb20014 	sw	s2,20(sp)
+   206bc:	afa20010 	sw	v0,16(sp)
+   206c0:	0c000c15 	jal	3054 <pmm_set_page>
+   206c4:	afa00018 	sw	zero,24(sp)
+   206c8:	8fbf003c 	lw	ra,60(sp)
+   206cc:	8fb30038 	lw	s3,56(sp)
+   206d0:	8fb20034 	lw	s2,52(sp)
+   206d4:	8fb10030 	lw	s1,48(sp)
+   206d8:	8fb0002c 	lw	s0,44(sp)
+   206dc:	03e00008 	jr	ra
+   206e0:	27bd0040 	addiu	sp,sp,64
+
+000206e4 <vmm_inval_shared_page>:
+   206e4:	27bdffc0 	addiu	sp,sp,-64
+   206e8:	afb10030 	sw	s1,48(sp)
+   206ec:	00808821 	addu	s1,a0,zero
+   206f0:	8c8400e8 	lw	a0,232(a0)
+   206f4:	afb0002c 	sw	s0,44(sp)
+   206f8:	27b00010 	addiu	s0,sp,16
+   206fc:	afb20034 	sw	s2,52(sp)
+   20700:	248400d0 	addiu	a0,a0,208
+   20704:	00c09021 	addu	s2,a2,zero
+   20708:	02003021 	addu	a2,s0,zero
+   2070c:	afb30038 	sw	s3,56(sp)
+   20710:	afbf003c 	sw	ra,60(sp)
+   20714:	0c000a56 	jal	2958 <pmm_get_page>
+   20718:	00a09821 	addu	s3,a1,zero
+   2071c:	14400003 	bnez	v0,2072c <vmm_inval_shared_page+0x48>
+   20720:	8fa30014 	lw	v1,20(sp)
+   20724:	10720008 	beq	v1,s2,20748 <vmm_inval_shared_page+0x64>
+   20728:	02602821 	addu	a1,s3,zero
+   2072c:	8fbf003c 	lw	ra,60(sp)
+   20730:	8fb30038 	lw	s3,56(sp)
+   20734:	8fb20034 	lw	s2,52(sp)
+   20738:	8fb10030 	lw	s1,48(sp)
+   2073c:	8fb0002c 	lw	s0,44(sp)
+   20740:	03e00008 	jr	ra
+   20744:	27bd0040 	addiu	sp,sp,64
+   20748:	8e2400e8 	lw	a0,232(s1)
+   2074c:	02003021 	addu	a2,s0,zero
+   20750:	248400d0 	addiu	a0,a0,208
+   20754:	afa00014 	sw	zero,20(sp)
+   20758:	afa00010 	sw	zero,16(sp)
+   2075c:	0c000c15 	jal	3054 <pmm_set_page>
+   20760:	afa00018 	sw	zero,24(sp)
+   20764:	8fbf003c 	lw	ra,60(sp)
+   20768:	8fb30038 	lw	s3,56(sp)
+   2076c:	8fb20034 	lw	s2,52(sp)
+   20770:	8fb10030 	lw	s1,48(sp)
+   20774:	8fb0002c 	lw	s0,44(sp)
+   20778:	03e00008 	jr	ra
+   2077c:	27bd0040 	addiu	sp,sp,64
+
+00020780 <vmm_madvise_migrate>:
+   20780:	27bdffc0 	addiu	sp,sp,-64
+   20784:	30c20fff 	andi	v0,a2,0xfff
+   20788:	afbf003c 	sw	ra,60(sp)
+   2078c:	afb40038 	sw	s4,56(sp)
+   20790:	afb30034 	sw	s3,52(sp)
+   20794:	afb20030 	sw	s2,48(sp)
+   20798:	afb1002c 	sw	s1,44(sp)
+   2079c:	10400004 	beqz	v0,207b0 <vmm_madvise_migrate+0x30>
+   207a0:	afb00028 	sw	s0,40(sp)
+   207a4:	2410f000 	addiu	s0,zero,-4096
+   207a8:	00d03024 	and	a2,a2,s0
+   207ac:	24c61000 	addiu	a2,a2,4096
+   207b0:	00068302 	srl	s0,a2,0xc
+   207b4:	1200001b 	beqz	s0,20824 <vmm_madvise_migrate+0xa4>
+   207b8:	249200d0 	addiu	s2,a0,208
+   207bc:	3c147fff 	lui	s4,0x7fff
+   207c0:	00a08821 	addu	s1,a1,zero
+   207c4:	3694ffff 	ori	s4,s4,0xffff
+   207c8:	27b30010 	addiu	s3,sp,16
+   207cc:	02202821 	addu	a1,s1,zero
+   207d0:	02402021 	addu	a0,s2,zero
+   207d4:	0c000a56 	jal	2958 <pmm_get_page>
+   207d8:	02603021 	addu	a2,s3,zero
+   207dc:	14400004 	bnez	v0,207f0 <vmm_madvise_migrate+0x70>
+   207e0:	2610ffff 	addiu	s0,s0,-1
+   207e4:	8fa20010 	lw	v0,16(sp)
+   207e8:	04400005 	bltz	v0,20800 <vmm_madvise_migrate+0x80>
+   207ec:	00541024 	and	v0,v0,s4
+   207f0:	1200000d 	beqz	s0,20828 <vmm_madvise_migrate+0xa8>
+   207f4:	8fbf003c 	lw	ra,60(sp)
+   207f8:	080081f3 	j	207cc <vmm_madvise_migrate+0x4c>
+   207fc:	26311000 	addiu	s1,s1,4096
+   20800:	34420002 	ori	v0,v0,0x2
+   20804:	02202821 	addu	a1,s1,zero
+   20808:	02402021 	addu	a0,s2,zero
+   2080c:	02603021 	addu	a2,s3,zero
+   20810:	afa20010 	sw	v0,16(sp)
+   20814:	0c000c15 	jal	3054 <pmm_set_page>
+   20818:	afa00018 	sw	zero,24(sp)
+   2081c:	1600ffeb 	bnez	s0,207cc <vmm_madvise_migrate+0x4c>
+   20820:	26311000 	addiu	s1,s1,4096
+   20824:	8fbf003c 	lw	ra,60(sp)
+   20828:	00001021 	addu	v0,zero,zero
+   2082c:	8fb40038 	lw	s4,56(sp)
+   20830:	8fb30034 	lw	s3,52(sp)
+   20834:	8fb20030 	lw	s2,48(sp)
+   20838:	8fb1002c 	lw	s1,44(sp)
+   2083c:	8fb00028 	lw	s0,40(sp)
+   20840:	03e00008 	jr	ra
+   20844:	27bd0040 	addiu	sp,sp,64
+
+00020848 <vmm_set_auto_migrate>:
+   20848:	27bdffd0 	addiu	sp,sp,-48
+   2084c:	afb1001c 	sw	s1,28(sp)
+   20850:	24910010 	addiu	s1,a0,16
+   20854:	afb30024 	sw	s3,36(sp)
+   20858:	afb20020 	sw	s2,32(sp)
+   2085c:	00809821 	addu	s3,a0,zero
+   20860:	00a09021 	addu	s2,a1,zero
+   20864:	02202021 	addu	a0,s1,zero
+   20868:	afa60010 	sw	a2,16(sp)
+   2086c:	afbf002c 	sw	ra,44(sp)
+   20870:	afb00018 	sw	s0,24(sp)
+   20874:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   20878:	afb40028 	sw	s4,40(sp)
+   2087c:	02602021 	addu	a0,s3,zero
+   20880:	0c00868b 	jal	21a2c <vm_region_find>
+   20884:	02402821 	addu	a1,s2,zero
+   20888:	00408021 	addu	s0,v0,zero
+   2088c:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   20890:	02202021 	addu	a0,s1,zero
+   20894:	12000035 	beqz	s0,2096c <vmm_set_auto_migrate+0x124>
+   20898:	8fa60010 	lw	a2,16(sp)
+   2089c:	8e0200f4 	lw	v0,244(s0)
+   208a0:	0052902b 	sltu	s2,v0,s2
+   208a4:	16400031 	bnez	s2,2096c <vmm_set_auto_migrate+0x124>
+   208a8:	261000e0 	addiu	s0,s0,224
+   208ac:	30d40001 	andi	s4,a2,0x1
+   208b0:	267200ec 	addiu	s2,s3,236
+   208b4:	2603ff20 	addiu	v1,s0,-224
+   208b8:	8c620104 	lw	v0,260(v1)
+   208bc:	30440008 	andi	a0,v0,0x8
+   208c0:	30420400 	andi	v0,v0,0x400
+   208c4:	14400009 	bnez	v0,208ec <vmm_set_auto_migrate+0xa4>
+   208c8:	00000000 	sll	zero,zero,0x0
+   208cc:	10800003 	beqz	a0,208dc <vmm_set_auto_migrate+0x94>
+   208d0:	00000000 	sll	zero,zero,0x0
+   208d4:	12800005 	beqz	s4,208ec <vmm_set_auto_migrate+0xa4>
+   208d8:	00000000 	sll	zero,zero,0x0
+   208dc:	8c620104 	lw	v0,260(v1)
+   208e0:	30420081 	andi	v0,v0,0x81
+   208e4:	1040001a 	beqz	v0,20950 <vmm_set_auto_migrate+0x108>
+   208e8:	00000000 	sll	zero,zero,0x0
+   208ec:	0c0043e8 	jal	10fa0 <rwlock_rdlock>
+   208f0:	02202021 	addu	a0,s1,zero
+   208f4:	8e6200ec 	lw	v0,236(s3)
+   208f8:	12420011 	beq	s2,v0,20940 <vmm_set_auto_migrate+0xf8>
+   208fc:	02202021 	addu	a0,s1,zero
+   20900:	8e100000 	lw	s0,0(s0)
+   20904:	1250000e 	beq	s2,s0,20940 <vmm_set_auto_migrate+0xf8>
+   20908:	00000000 	sll	zero,zero,0x0
+   2090c:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   20910:	00000000 	sll	zero,zero,0x0
+   20914:	1600ffe8 	bnez	s0,208b8 <vmm_set_auto_migrate+0x70>
+   20918:	2603ff20 	addiu	v1,s0,-224
+   2091c:	00001021 	addu	v0,zero,zero
+   20920:	8fbf002c 	lw	ra,44(sp)
+   20924:	8fb40028 	lw	s4,40(sp)
+   20928:	8fb30024 	lw	s3,36(sp)
+   2092c:	8fb20020 	lw	s2,32(sp)
+   20930:	8fb1001c 	lw	s1,28(sp)
+   20934:	8fb00018 	lw	s0,24(sp)
+   20938:	03e00008 	jr	ra
+   2093c:	27bd0030 	addiu	sp,sp,48
+   20940:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   20944:	02202021 	addu	a0,s1,zero
+   20948:	08008248 	j	20920 <vmm_set_auto_migrate+0xd8>
+   2094c:	00001021 	addu	v0,zero,zero
+   20950:	8c6500f4 	lw	a1,244(v1)
+   20954:	8c6600f8 	lw	a2,248(v1)
+   20958:	02602021 	addu	a0,s3,zero
+   2095c:	0c0081e0 	jal	20780 <vmm_madvise_migrate>
+   20960:	00c53023 	subu	a2,a2,a1
+   20964:	0800823b 	j	208ec <vmm_set_auto_migrate+0xa4>
+   20968:	00000000 	sll	zero,zero,0x0
+   2096c:	08008248 	j	20920 <vmm_set_auto_migrate+0xd8>
+   20970:	24020003 	addiu	v0,zero,3
+
+00020974 <vmm_do_cow>:
+   20974:	27bdff98 	addiu	sp,sp,-104
+   20978:	afb20050 	sw	s2,80(sp)
+   2097c:	afb00048 	sw	s0,72(sp)
+   20980:	afbf0064 	sw	ra,100(sp)
+   20984:	afb60060 	sw	s6,96(sp)
+   20988:	afb5005c 	sw	s5,92(sp)
+   2098c:	afb40058 	sw	s4,88(sp)
+   20990:	afb30054 	sw	s3,84(sp)
+   20994:	afb1004c 	sw	s1,76(sp)
+   20998:	00809021 	addu	s2,a0,zero
+   2099c:	00c08021 	addu	s0,a2,zero
+   209a0:	40142002 	mfc0	s4,$4,2
+   209a4:	8c8400e8 	lw	a0,232(a0)
+   209a8:	27b30020 	addiu	s3,sp,32
+   209ac:	00c02821 	addu	a1,a2,zero
+   209b0:	248400d0 	addiu	a0,a0,208
+   209b4:	02603021 	addu	a2,s3,zero
+   209b8:	0c000b14 	jal	2c50 <pmm_lock_page>
+   209bc:	afa00020 	sw	zero,32(sp)
+   209c0:	14400007 	bnez	v0,209e0 <vmm_do_cow+0x6c>
+   209c4:	00408821 	addu	s1,v0,zero
+   209c8:	8fa2002c 	lw	v0,44(sp)
+   209cc:	10400004 	beqz	v0,209e0 <vmm_do_cow+0x6c>
+   209d0:	8fa20020 	lw	v0,32(sp)
+   209d4:	30420001 	andi	v0,v0,0x1
+   209d8:	14400017 	bnez	v0,20a38 <vmm_do_cow+0xc4>
+   209dc:	00000000 	sll	zero,zero,0x0
+   209e0:	8e820200 	lw	v0,512(s4)
+   209e4:	02002021 	addu	a0,s0,zero
+   209e8:	24420001 	addiu	v0,v0,1
+   209ec:	24050002 	addiu	a1,zero,2
+   209f0:	0c000a82 	jal	2a08 <pmm_tlb_flush_vaddr>
+   209f4:	ae820200 	sw	v0,512(s4)
+   209f8:	8e4400e8 	lw	a0,232(s2)
+   209fc:	02002821 	addu	a1,s0,zero
+   20a00:	248400d0 	addiu	a0,a0,208
+   20a04:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20a08:	02603021 	addu	a2,s3,zero
+   20a0c:	8fbf0064 	lw	ra,100(sp)
+   20a10:	02201021 	addu	v0,s1,zero
+   20a14:	8fb60060 	lw	s6,96(sp)
+   20a18:	8fb5005c 	lw	s5,92(sp)
+   20a1c:	8fb40058 	lw	s4,88(sp)
+   20a20:	8fb30054 	lw	s3,84(sp)
+   20a24:	8fb20050 	lw	s2,80(sp)
+   20a28:	8fb1004c 	lw	s1,76(sp)
+   20a2c:	8fb00048 	lw	s0,72(sp)
+   20a30:	03e00008 	jr	ra
+   20a34:	27bd0068 	addiu	sp,sp,104
+   20a38:	0c007fad 	jal	1feb4 <ppn_is_local>
+   20a3c:	8fa40024 	lw	a0,36(sp)
+   20a40:	14400033 	bnez	v0,20b10 <vmm_do_cow+0x19c>
+   20a44:	8fa50024 	lw	a1,36(sp)
+   20a48:	3c020082 	lui	v0,0x82
+   20a4c:	34420040 	ori	v0,v0,0x40
+   20a50:	27a40010 	addiu	a0,sp,16
+   20a54:	afa20018 	sw	v0,24(sp)
+   20a58:	afa00010 	sw	zero,16(sp)
+   20a5c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   20a60:	afa00014 	sw	zero,20(sp)
+   20a64:	10400042 	beqz	v0,20b70 <vmm_do_cow+0x1fc>
+   20a68:	0040a821 	addu	s5,v0,zero
+   20a6c:	02a02021 	addu	a0,s5,zero
+   20a70:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   20a74:	aea00018 	sw	zero,24(s5)
+   20a78:	8fa50024 	lw	a1,36(sp)
+   20a7c:	0c00802f 	jal	200bc <ppn_copy>
+   20a80:	00402021 	addu	a0,v0,zero
+   20a84:	3c020004 	lui	v0,0x4
+   20a88:	2443c960 	addiu	v1,v0,-13984
+   20a8c:	88630003 	lwl	v1,3(v1)
+   20a90:	96a40002 	lhu	a0,2(s5)
+   20a94:	9843c960 	lwr	v1,-13984(v0)
+   20a98:	30820fff 	andi	v0,a0,0xfff
+   20a9c:	3063ffff 	andi	v1,v1,0xffff
+   20aa0:	10430004 	beq	v0,v1,20ab4 <vmm_do_cow+0x140>
+   20aa4:	24160001 	addiu	s6,zero,1
+   20aa8:	8e8201fc 	lw	v0,508(s4)
+   20aac:	24420001 	addiu	v0,v0,1
+   20ab0:	ae8201fc 	sw	v0,508(s4)
+   20ab4:	8e430100 	lw	v1,256(s2)
+   20ab8:	3c020400 	lui	v0,0x400
+   20abc:	00621025 	or	v0,v1,v0
+   20ac0:	2403fffc 	addiu	v1,zero,-4
+   20ac4:	00431024 	and	v0,v0,v1
+   20ac8:	02a02021 	addu	a0,s5,zero
+   20acc:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   20ad0:	afa20034 	sw	v0,52(sp)
+   20ad4:	8e4400e8 	lw	a0,232(s2)
+   20ad8:	02002821 	addu	a1,s0,zero
+   20adc:	248400d0 	addiu	a0,a0,208
+   20ae0:	27a60034 	addiu	a2,sp,52
+   20ae4:	afa20038 	sw	v0,56(sp)
+   20ae8:	0c000c15 	jal	3054 <pmm_set_page>
+   20aec:	afa0003c 	sw	zero,60(sp)
+   20af0:	14400015 	bnez	v0,20b48 <vmm_do_cow+0x1d4>
+   20af4:	00408821 	addu	s1,v0,zero
+   20af8:	12c0ffc4 	beqz	s6,20a0c <vmm_do_cow+0x98>
+   20afc:	00000000 	sll	zero,zero,0x0
+   20b00:	0c007ff5 	jal	1ffd4 <ppn_refcount_down>
+   20b04:	8fa40024 	lw	a0,36(sp)
+   20b08:	08008284 	j	20a10 <vmm_do_cow+0x9c>
+   20b0c:	8fbf0064 	lw	ra,100(sp)
+   20b10:	3c040004 	lui	a0,0x4
+   20b14:	0c007c41 	jal	1f104 <ppm_ppn2page>
+   20b18:	24846e60 	addiu	a0,a0,28256
+   20b1c:	0040a821 	addu	s5,v0,zero
+   20b20:	8c420018 	lw	v0,24(v0)
+   20b24:	1440ffc9 	bnez	v0,20a4c <vmm_do_cow+0xd8>
+   20b28:	3c020082 	lui	v0,0x82
+   20b2c:	0c001a17 	jal	685c <refcount_get>
+   20b30:	26a40030 	addiu	a0,s5,48
+   20b34:	24030001 	addiu	v1,zero,1
+   20b38:	1443ffc4 	bne	v0,v1,20a4c <vmm_do_cow+0xd8>
+   20b3c:	3c020082 	lui	v0,0x82
+   20b40:	080082ad 	j	20ab4 <vmm_do_cow+0x140>
+   20b44:	0000b021 	addu	s6,zero,zero
+   20b48:	8e4400e8 	lw	a0,232(s2)
+   20b4c:	02002821 	addu	a1,s0,zero
+   20b50:	248400d0 	addiu	a0,a0,208
+   20b54:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20b58:	02603021 	addu	a2,s3,zero
+   20b5c:	27a40010 	addiu	a0,sp,16
+   20b60:	0c007134 	jal	1c4d0 <kmem_free>
+   20b64:	afb5001c 	sw	s5,28(sp)
+   20b68:	08008284 	j	20a10 <vmm_do_cow+0x9c>
+   20b6c:	8fbf0064 	lw	ra,100(sp)
+   20b70:	8e4400e8 	lw	a0,232(s2)
+   20b74:	02002821 	addu	a1,s0,zero
+   20b78:	248400d0 	addiu	a0,a0,208
+   20b7c:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20b80:	02603021 	addu	a2,s3,zero
+   20b84:	08008283 	j	20a0c <vmm_do_cow+0x98>
+   20b88:	2411000c 	addiu	s1,zero,12
+
+00020b8c <vmm_default_pagefault>:
+   20b8c:	27bdff80 	addiu	sp,sp,-128
+   20b90:	afb10064 	sw	s1,100(sp)
+   20b94:	00808821 	addu	s1,a0,zero
+   20b98:	8c8400e8 	lw	a0,232(a0)
+   20b9c:	afb3006c 	sw	s3,108(sp)
+   20ba0:	27b30020 	addiu	s3,sp,32
+   20ba4:	afb40070 	sw	s4,112(sp)
+   20ba8:	248400d0 	addiu	a0,a0,208
+   20bac:	00c0a021 	addu	s4,a2,zero
+   20bb0:	02603021 	addu	a2,s3,zero
+   20bb4:	afb20068 	sw	s2,104(sp)
+   20bb8:	afb00060 	sw	s0,96(sp)
+   20bbc:	afbf007c 	sw	ra,124(sp)
+   20bc0:	afb60078 	sw	s6,120(sp)
+   20bc4:	afb50074 	sw	s5,116(sp)
+   20bc8:	0c000a56 	jal	2958 <pmm_get_page>
+   20bcc:	00a09021 	addu	s2,a1,zero
+   20bd0:	14400029 	bnez	v0,20c78 <vmm_default_pagefault+0xec>
+   20bd4:	00408021 	addu	s0,v0,zero
+   20bd8:	8fa20020 	lw	v0,32(sp)
+   20bdc:	14400031 	bnez	v0,20ca4 <vmm_default_pagefault+0x118>
+   20be0:	8fb50024 	lw	s5,36(sp)
+   20be4:	8e220110 	lw	v0,272(s1)
+   20be8:	10400053 	beqz	v0,20d38 <vmm_default_pagefault+0x1ac>
+   20bec:	00000000 	sll	zero,zero,0x0
+   20bf0:	40142002 	mfc0	s4,$4,2
+   20bf4:	8e2400e8 	lw	a0,232(s1)
+   20bf8:	27b30034 	addiu	s3,sp,52
+   20bfc:	24020001 	addiu	v0,zero,1
+   20c00:	248400d0 	addiu	a0,a0,208
+   20c04:	02402821 	addu	a1,s2,zero
+   20c08:	02603021 	addu	a2,s3,zero
+   20c0c:	afa20038 	sw	v0,56(sp)
+   20c10:	0c000b14 	jal	2c50 <pmm_lock_page>
+   20c14:	afa20034 	sw	v0,52(sp)
+   20c18:	14400017 	bnez	v0,20c78 <vmm_default_pagefault+0xec>
+   20c1c:	00408021 	addu	s0,v0,zero
+   20c20:	8fa20040 	lw	v0,64(sp)
+   20c24:	10400033 	beqz	v0,20cf4 <vmm_default_pagefault+0x168>
+   20c28:	8fa20034 	lw	v0,52(sp)
+   20c2c:	14400031 	bnez	v0,20cf4 <vmm_default_pagefault+0x168>
+   20c30:	26240110 	addiu	a0,s1,272
+   20c34:	8e250108 	lw	a1,264(s1)
+   20c38:	8e2200f4 	lw	v0,244(s1)
+   20c3c:	00a22823 	subu	a1,a1,v0
+   20c40:	00b22821 	addu	a1,a1,s2
+   20c44:	00052b02 	srl	a1,a1,0xc
+   20c48:	0c0078c0 	jal	1e300 <mapper_get_ppn>
+   20c4c:	24060001 	addiu	a2,zero,1
+   20c50:	1440006a 	bnez	v0,20dfc <vmm_default_pagefault+0x270>
+   20c54:	02402821 	addu	a1,s2,zero
+   20c58:	8e2400e8 	lw	a0,232(s1)
+   20c5c:	248400d0 	addiu	a0,a0,208
+   20c60:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20c64:	02603021 	addu	a2,s3,zero
+   20c68:	8e230140 	lw	v1,320(s1)
+   20c6c:	2410000c 	addiu	s0,zero,12
+   20c70:	24020005 	addiu	v0,zero,5
+   20c74:	0043800a 	movz	s0,v0,v1
+   20c78:	8fbf007c 	lw	ra,124(sp)
+   20c7c:	02001021 	addu	v0,s0,zero
+   20c80:	8fb60078 	lw	s6,120(sp)
+   20c84:	8fb50074 	lw	s5,116(sp)
+   20c88:	8fb40070 	lw	s4,112(sp)
+   20c8c:	8fb3006c 	lw	s3,108(sp)
+   20c90:	8fb20068 	lw	s2,104(sp)
+   20c94:	8fb10064 	lw	s1,100(sp)
+   20c98:	8fb00060 	lw	s0,96(sp)
+   20c9c:	03e00008 	jr	ra
+   20ca0:	27bd0080 	addiu	sp,sp,128
+   20ca4:	12a0ffcf 	beqz	s5,20be4 <vmm_default_pagefault+0x58>
+   20ca8:	30430001 	andi	v1,v0,0x1
+   20cac:	10600004 	beqz	v1,20cc0 <vmm_default_pagefault+0x134>
+   20cb0:	30430002 	andi	v1,v0,0x2
+   20cb4:	32941000 	andi	s4,s4,0x1000
+   20cb8:	12800079 	beqz	s4,20ea0 <vmm_default_pagefault+0x314>
+   20cbc:	02202021 	addu	a0,s1,zero
+   20cc0:	14600058 	bnez	v1,20e24 <vmm_default_pagefault+0x298>
+   20cc4:	00000000 	sll	zero,zero,0x0
+   20cc8:	04400072 	bltz	v0,20e94 <vmm_default_pagefault+0x308>
+   20ccc:	00000000 	sll	zero,zero,0x0
+   20cd0:	40022002 	mfc0	v0,$4,2
+   20cd4:	8c430200 	lw	v1,512(v0)
+   20cd8:	02402021 	addu	a0,s2,zero
+   20cdc:	24630001 	addiu	v1,v1,1
+   20ce0:	ac430200 	sw	v1,512(v0)
+   20ce4:	0c000a82 	jal	2a08 <pmm_tlb_flush_vaddr>
+   20ce8:	24050003 	addiu	a1,zero,3
+   20cec:	0800831f 	j	20c7c <vmm_default_pagefault+0xf0>
+   20cf0:	8fbf007c 	lw	ra,124(sp)
+   20cf4:	8e820200 	lw	v0,512(s4)
+   20cf8:	02402021 	addu	a0,s2,zero
+   20cfc:	24420001 	addiu	v0,v0,1
+   20d00:	ae820200 	sw	v0,512(s4)
+   20d04:	0c000a82 	jal	2a08 <pmm_tlb_flush_vaddr>
+   20d08:	24050002 	addiu	a1,zero,2
+   20d0c:	8fbf007c 	lw	ra,124(sp)
+   20d10:	02001021 	addu	v0,s0,zero
+   20d14:	8fb60078 	lw	s6,120(sp)
+   20d18:	8fb50074 	lw	s5,116(sp)
+   20d1c:	8fb40070 	lw	s4,112(sp)
+   20d20:	8fb3006c 	lw	s3,108(sp)
+   20d24:	8fb20068 	lw	s2,104(sp)
+   20d28:	8fb10064 	lw	s1,100(sp)
+   20d2c:	8fb00060 	lw	s0,96(sp)
+   20d30:	03e00008 	jr	ra
+   20d34:	27bd0080 	addiu	sp,sp,128
+   20d38:	8e220114 	lw	v0,276(s1)
+   20d3c:	1440ffac 	bnez	v0,20bf0 <vmm_default_pagefault+0x64>
+   20d40:	00000000 	sll	zero,zero,0x0
+   20d44:	afa00034 	sw	zero,52(sp)
+   20d48:	40142002 	mfc0	s4,$4,2
+   20d4c:	8e2400e8 	lw	a0,232(s1)
+   20d50:	27b30034 	addiu	s3,sp,52
+   20d54:	248400d0 	addiu	a0,a0,208
+   20d58:	02402821 	addu	a1,s2,zero
+   20d5c:	0c000b14 	jal	2c50 <pmm_lock_page>
+   20d60:	02603021 	addu	a2,s3,zero
+   20d64:	1440ffc4 	bnez	v0,20c78 <vmm_default_pagefault+0xec>
+   20d68:	00408021 	addu	s0,v0,zero
+   20d6c:	8fa20040 	lw	v0,64(sp)
+   20d70:	1040ffe0 	beqz	v0,20cf4 <vmm_default_pagefault+0x168>
+   20d74:	27b60010 	addiu	s6,sp,16
+   20d78:	3c020086 	lui	v0,0x86
+   20d7c:	34420040 	ori	v0,v0,0x40
+   20d80:	02c02021 	addu	a0,s6,zero
+   20d84:	afa20018 	sw	v0,24(sp)
+   20d88:	afa00010 	sw	zero,16(sp)
+   20d8c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   20d90:	afa00014 	sw	zero,20(sp)
+   20d94:	1040006f 	beqz	v0,20f54 <vmm_default_pagefault+0x3c8>
+   20d98:	0040a821 	addu	s5,v0,zero
+   20d9c:	8e220100 	lw	v0,256(s1)
+   20da0:	02a02021 	addu	a0,s5,zero
+   20da4:	aea00018 	sw	zero,24(s5)
+   20da8:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   20dac:	afa20048 	sw	v0,72(sp)
+   20db0:	8e2400e8 	lw	a0,232(s1)
+   20db4:	02402821 	addu	a1,s2,zero
+   20db8:	248400d0 	addiu	a0,a0,208
+   20dbc:	27a60048 	addiu	a2,sp,72
+   20dc0:	afa2004c 	sw	v0,76(sp)
+   20dc4:	0c000c15 	jal	3054 <pmm_set_page>
+   20dc8:	afa00050 	sw	zero,80(sp)
+   20dcc:	14400057 	bnez	v0,20f2c <vmm_default_pagefault+0x3a0>
+   20dd0:	00408021 	addu	s0,v0,zero
+   20dd4:	96a30002 	lhu	v1,2(s5)
+   20dd8:	3c020004 	lui	v0,0x4
+   20ddc:	8c4271b0 	lw	v0,29104(v0)
+   20de0:	30630fff 	andi	v1,v1,0xfff
+   20de4:	1062ffa5 	beq	v1,v0,20c7c <vmm_default_pagefault+0xf0>
+   20de8:	8fbf007c 	lw	ra,124(sp)
+   20dec:	8e8201fc 	lw	v0,508(s4)
+   20df0:	24420001 	addiu	v0,v0,1
+   20df4:	0800831e 	j	20c78 <vmm_default_pagefault+0xec>
+   20df8:	ae8201fc 	sw	v0,508(s4)
+   20dfc:	8e2400e8 	lw	a0,232(s1)
+   20e00:	8e230100 	lw	v1,256(s1)
+   20e04:	248400d0 	addiu	a0,a0,208
+   20e08:	27a60048 	addiu	a2,sp,72
+   20e0c:	afa30048 	sw	v1,72(sp)
+   20e10:	afa2004c 	sw	v0,76(sp)
+   20e14:	0c000c15 	jal	3054 <pmm_set_page>
+   20e18:	afa00050 	sw	zero,80(sp)
+   20e1c:	0800831e 	j	20c78 <vmm_default_pagefault+0xec>
+   20e20:	00408021 	addu	s0,v0,zero
+   20e24:	40142002 	mfc0	s4,$4,2
+   20e28:	8e2400e8 	lw	a0,232(s1)
+   20e2c:	27b30048 	addiu	s3,sp,72
+   20e30:	248400d0 	addiu	a0,a0,208
+   20e34:	02402821 	addu	a1,s2,zero
+   20e38:	02603021 	addu	a2,s3,zero
+   20e3c:	afa00048 	sw	zero,72(sp)
+   20e40:	0c000b14 	jal	2c50 <pmm_lock_page>
+   20e44:	afa0004c 	sw	zero,76(sp)
+   20e48:	14400005 	bnez	v0,20e60 <vmm_default_pagefault+0x2d4>
+   20e4c:	8fa20054 	lw	v0,84(sp)
+   20e50:	10400003 	beqz	v0,20e60 <vmm_default_pagefault+0x2d4>
+   20e54:	8fa2004c 	lw	v0,76(sp)
+   20e58:	12a20016 	beq	s5,v0,20eb4 <vmm_default_pagefault+0x328>
+   20e5c:	8fa20048 	lw	v0,72(sp)
+   20e60:	8e820200 	lw	v0,512(s4)
+   20e64:	8e2400e8 	lw	a0,232(s1)
+   20e68:	24420001 	addiu	v0,v0,1
+   20e6c:	02402821 	addu	a1,s2,zero
+   20e70:	ae820200 	sw	v0,512(s4)
+   20e74:	248400d0 	addiu	a0,a0,208
+   20e78:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20e7c:	02603021 	addu	a2,s3,zero
+   20e80:	02402021 	addu	a0,s2,zero
+   20e84:	0c000a82 	jal	2a08 <pmm_tlb_flush_vaddr>
+   20e88:	24050002 	addiu	a1,zero,2
+   20e8c:	0800831f 	j	20c7c <vmm_default_pagefault+0xf0>
+   20e90:	8fbf007c 	lw	ra,124(sp)
+   20e94:	40022002 	mfc0	v0,$4,2
+   20e98:	08008334 	j	20cd0 <vmm_default_pagefault+0x144>
+   20e9c:	00000000 	sll	zero,zero,0x0
+   20ea0:	02602821 	addu	a1,s3,zero
+   20ea4:	0c00825d 	jal	20974 <vmm_do_cow>
+   20ea8:	02403021 	addu	a2,s2,zero
+   20eac:	0800831e 	j	20c78 <vmm_default_pagefault+0xec>
+   20eb0:	00408021 	addu	s0,v0,zero
+   20eb4:	30420002 	andi	v0,v0,0x2
+   20eb8:	1040ffe9 	beqz	v0,20e60 <vmm_default_pagefault+0x2d4>
+   20ebc:	00000000 	sll	zero,zero,0x0
+   20ec0:	0c007fad 	jal	1feb4 <ppn_is_local>
+   20ec4:	02a02021 	addu	a0,s5,zero
+   20ec8:	10400033 	beqz	v0,20f98 <vmm_default_pagefault+0x40c>
+   20ecc:	0000a021 	addu	s4,zero,zero
+   20ed0:	8fa30048 	lw	v1,72(sp)
+   20ed4:	8e2400e8 	lw	a0,232(s1)
+   20ed8:	3c028000 	lui	v0,0x8000
+   20edc:	00621825 	or	v1,v1,v0
+   20ee0:	2402fff5 	addiu	v0,zero,-11
+   20ee4:	00621024 	and	v0,v1,v0
+   20ee8:	248400d0 	addiu	a0,a0,208
+   20eec:	02402821 	addu	a1,s2,zero
+   20ef0:	02603021 	addu	a2,s3,zero
+   20ef4:	afa20048 	sw	v0,72(sp)
+   20ef8:	0c000c15 	jal	3054 <pmm_set_page>
+   20efc:	afa00050 	sw	zero,80(sp)
+   20f00:	1440001b 	bnez	v0,20f70 <vmm_default_pagefault+0x3e4>
+   20f04:	00408021 	addu	s0,v0,zero
+   20f08:	1280ff5c 	beqz	s4,20c7c <vmm_default_pagefault+0xf0>
+   20f0c:	8fbf007c 	lw	ra,124(sp)
+   20f10:	0c007ff5 	jal	1ffd4 <ppn_refcount_down>
+   20f14:	02a02021 	addu	a0,s5,zero
+   20f18:	40022002 	mfc0	v0,$4,2
+   20f1c:	8c4301fc 	lw	v1,508(v0)
+   20f20:	24630001 	addiu	v1,v1,1
+   20f24:	0800831e 	j	20c78 <vmm_default_pagefault+0xec>
+   20f28:	ac4301fc 	sw	v1,508(v0)
+   20f2c:	8e2400e8 	lw	a0,232(s1)
+   20f30:	02402821 	addu	a1,s2,zero
+   20f34:	248400d0 	addiu	a0,a0,208
+   20f38:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20f3c:	02603021 	addu	a2,s3,zero
+   20f40:	02c02021 	addu	a0,s6,zero
+   20f44:	0c007134 	jal	1c4d0 <kmem_free>
+   20f48:	afb5001c 	sw	s5,28(sp)
+   20f4c:	0800831f 	j	20c7c <vmm_default_pagefault+0xf0>
+   20f50:	8fbf007c 	lw	ra,124(sp)
+   20f54:	8e2400e8 	lw	a0,232(s1)
+   20f58:	02402821 	addu	a1,s2,zero
+   20f5c:	248400d0 	addiu	a0,a0,208
+   20f60:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20f64:	02603021 	addu	a2,s3,zero
+   20f68:	0800831e 	j	20c78 <vmm_default_pagefault+0xec>
+   20f6c:	2410000c 	addiu	s0,zero,12
+   20f70:	8e2400e8 	lw	a0,232(s1)
+   20f74:	02402821 	addu	a1,s2,zero
+   20f78:	248400d0 	addiu	a0,a0,208
+   20f7c:	0c000a58 	jal	2960 <pmm_unlock_page>
+   20f80:	02603021 	addu	a2,s3,zero
+   20f84:	27a40010 	addiu	a0,sp,16
+   20f88:	0c007134 	jal	1c4d0 <kmem_free>
+   20f8c:	afb4001c 	sw	s4,28(sp)
+   20f90:	0800831f 	j	20c7c <vmm_default_pagefault+0xf0>
+   20f94:	8fbf007c 	lw	ra,124(sp)
+   20f98:	3c020082 	lui	v0,0x82
+   20f9c:	34420040 	ori	v0,v0,0x40
+   20fa0:	27a40010 	addiu	a0,sp,16
+   20fa4:	afa20018 	sw	v0,24(sp)
+   20fa8:	afa00010 	sw	zero,16(sp)
+   20fac:	0c00713f 	jal	1c4fc <kmem_alloc>
+   20fb0:	afa00014 	sw	zero,20(sp)
+   20fb4:	1040ffc6 	beqz	v0,20ed0 <vmm_default_pagefault+0x344>
+   20fb8:	0040a021 	addu	s4,v0,zero
+   20fbc:	00402021 	addu	a0,v0,zero
+   20fc0:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   20fc4:	ac400018 	sw	zero,24(v0)
+   20fc8:	00402021 	addu	a0,v0,zero
+   20fcc:	0c00802f 	jal	200bc <ppn_copy>
+   20fd0:	02a02821 	addu	a1,s5,zero
+   20fd4:	8fa20048 	lw	v0,72(sp)
+   20fd8:	30430001 	andi	v1,v0,0x1
+   20fdc:	10600005 	beqz	v1,20ff4 <vmm_default_pagefault+0x468>
+   20fe0:	3c030400 	lui	v1,0x400
+   20fe4:	00431025 	or	v0,v0,v1
+   20fe8:	2403fffe 	addiu	v1,zero,-2
+   20fec:	00431024 	and	v0,v0,v1
+   20ff0:	afa20048 	sw	v0,72(sp)
+   20ff4:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   20ff8:	02802021 	addu	a0,s4,zero
+   20ffc:	080083b4 	j	20ed0 <vmm_default_pagefault+0x344>
+   21000:	afa2004c 	sw	v0,76(sp)
+
+00021004 <vmm_migrate_shared_page_seq>:
+   21004:	27bdffb8 	addiu	sp,sp,-72
+   21008:	afbe0040 	sw	s8,64(sp)
+   2100c:	afb7003c 	sw	s7,60(sp)
+   21010:	afb60038 	sw	s6,56(sp)
+   21014:	afb3002c 	sw	s3,44(sp)
+   21018:	afb20028 	sw	s2,40(sp)
+   2101c:	afbf0044 	sw	ra,68(sp)
+   21020:	afb50034 	sw	s5,52(sp)
+   21024:	afb40030 	sw	s4,48(sp)
+   21028:	afb10024 	sw	s1,36(sp)
+   2102c:	afb00020 	sw	s0,32(sp)
+   21030:	8c930108 	lw	s3,264(a0)
+   21034:	8c8300f4 	lw	v1,244(a0)
+   21038:	8ca20014 	lw	v0,20(a1)
+   2103c:	02639821 	addu	s3,s3,v1
+   21040:	00021300 	sll	v0,v0,0xc
+   21044:	00809021 	addu	s2,a0,zero
+   21048:	00a02021 	addu	a0,a1,zero
+   2104c:	00a0b821 	addu	s7,a1,zero
+   21050:	00c0f021 	addu	s8,a2,zero
+   21054:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   21058:	02629821 	addu	s3,s3,v0
+   2105c:	13c00068 	beqz	s8,21200 <vmm_migrate_shared_page_seq+0x1fc>
+   21060:	0040b021 	addu	s6,v0,zero
+   21064:	40022002 	mfc0	v0,$4,2
+   21068:	8c540180 	lw	s4,384(v0)
+   2106c:	26510158 	addiu	s1,s2,344
+   21070:	02208021 	addu	s0,s1,zero
+   21074:	24150085 	addiu	s5,zero,133
+   21078:	2604fea8 	addiu	a0,s0,-344
+   2107c:	8c8200e8 	lw	v0,232(a0)
+   21080:	02602821 	addu	a1,s3,zero
+   21084:	2442fe80 	addiu	v0,v0,-384
+   21088:	12820005 	beq	s4,v0,210a0 <vmm_migrate_shared_page_seq+0x9c>
+   2108c:	02c03021 	addu	a2,s6,zero
+   21090:	0c0081b9 	jal	206e4 <vmm_inval_shared_page>
+   21094:	00000000 	sll	zero,zero,0x0
+   21098:	1440003a 	bnez	v0,21184 <vmm_migrate_shared_page_seq+0x180>
+   2109c:	0040a821 	addu	s5,v0,zero
+   210a0:	8e420110 	lw	v0,272(s2)
+   210a4:	8c4301c0 	lw	v1,448(v0)
+   210a8:	244201c0 	addiu	v0,v0,448
+   210ac:	10430006 	beq	v0,v1,210c8 <vmm_migrate_shared_page_seq+0xc4>
+   210b0:	00000000 	sll	zero,zero,0x0
+   210b4:	8e100000 	lw	s0,0(s0)
+   210b8:	10500004 	beq	v0,s0,210cc <vmm_migrate_shared_page_seq+0xc8>
+   210bc:	3c020022 	lui	v0,0x22
+   210c0:	1600ffee 	bnez	s0,2107c <vmm_migrate_shared_page_seq+0x78>
+   210c4:	2604fea8 	addiu	a0,s0,-344
+   210c8:	3c020022 	lui	v0,0x22
+   210cc:	34420040 	ori	v0,v0,0x40
+   210d0:	27a40010 	addiu	a0,sp,16
+   210d4:	afa20018 	sw	v0,24(sp)
+   210d8:	afa00010 	sw	zero,16(sp)
+   210dc:	0c00713f 	jal	1c4fc <kmem_alloc>
+   210e0:	afa00014 	sw	zero,20(sp)
+   210e4:	00408021 	addu	s0,v0,zero
+   210e8:	10400037 	beqz	v0,211c8 <vmm_migrate_shared_page_seq+0x1c4>
+   210ec:	afc20000 	sw	v0,0(s8)
+   210f0:	00402021 	addu	a0,v0,zero
+   210f4:	0c007a47 	jal	1e91c <page_copy>
+   210f8:	02e02821 	addu	a1,s7,zero
+   210fc:	0c007a7a 	jal	1e9e8 <page_lock>
+   21100:	02002021 	addu	a0,s0,zero
+   21104:	8ee20014 	lw	v0,20(s7)
+   21108:	8ee30018 	lw	v1,24(s7)
+   2110c:	ae020014 	sw	v0,20(s0)
+   21110:	ae030018 	sw	v1,24(s0)
+   21114:	8ee20000 	lw	v0,0(s7)
+   21118:	00021102 	srl	v0,v0,0x4
+   2111c:	30420080 	andi	v0,v0,0x80
+   21120:	14400025 	bnez	v0,211b8 <vmm_migrate_shared_page_seq+0x1b4>
+   21124:	00000000 	sll	zero,zero,0x0
+   21128:	0c007c2a 	jal	1f0a8 <ppm_page2ppn>
+   2112c:	02002021 	addu	a0,s0,zero
+   21130:	0040b021 	addu	s6,v0,zero
+   21134:	2624fea8 	addiu	a0,s1,-344
+   21138:	8c8200e8 	lw	v0,232(a0)
+   2113c:	02602821 	addu	a1,s3,zero
+   21140:	2442fe80 	addiu	v0,v0,-384
+   21144:	12820003 	beq	s4,v0,21154 <vmm_migrate_shared_page_seq+0x150>
+   21148:	02c03021 	addu	a2,s6,zero
+   2114c:	0c008191 	jal	20644 <vmm_update_shared_page>
+   21150:	00000000 	sll	zero,zero,0x0
+   21154:	8e420110 	lw	v0,272(s2)
+   21158:	8c4301c0 	lw	v1,448(v0)
+   2115c:	244201c0 	addiu	v0,v0,448
+   21160:	10430006 	beq	v0,v1,2117c <vmm_migrate_shared_page_seq+0x178>
+   21164:	00000000 	sll	zero,zero,0x0
+   21168:	8e310000 	lw	s1,0(s1)
+   2116c:	10510003 	beq	v0,s1,2117c <vmm_migrate_shared_page_seq+0x178>
+   21170:	00000000 	sll	zero,zero,0x0
+   21174:	1620fff0 	bnez	s1,21138 <vmm_migrate_shared_page_seq+0x134>
+   21178:	2624fea8 	addiu	a0,s1,-344
+   2117c:	0c007a5c 	jal	1e970 <page_unlock>
+   21180:	02002021 	addu	a0,s0,zero
+   21184:	8fbf0044 	lw	ra,68(sp)
+   21188:	02a01021 	addu	v0,s5,zero
+   2118c:	8fbe0040 	lw	s8,64(sp)
+   21190:	8fb7003c 	lw	s7,60(sp)
+   21194:	8fb60038 	lw	s6,56(sp)
+   21198:	8fb50034 	lw	s5,52(sp)
+   2119c:	8fb40030 	lw	s4,48(sp)
+   211a0:	8fb3002c 	lw	s3,44(sp)
+   211a4:	8fb20028 	lw	s2,40(sp)
+   211a8:	8fb10024 	lw	s1,36(sp)
+   211ac:	8fb00020 	lw	s0,32(sp)
+   211b0:	03e00008 	jr	ra
+   211b4:	27bd0048 	addiu	sp,sp,72
+   211b8:	8e020000 	lw	v0,0(s0)
+   211bc:	34420800 	ori	v0,v0,0x800
+   211c0:	0800844a 	j	21128 <vmm_migrate_shared_page_seq+0x124>
+   211c4:	ae020000 	sw	v0,0(s0)
+   211c8:	8fbf0044 	lw	ra,68(sp)
+   211cc:	2415000c 	addiu	s5,zero,12
+   211d0:	02a01021 	addu	v0,s5,zero
+   211d4:	8fbe0040 	lw	s8,64(sp)
+   211d8:	8fb7003c 	lw	s7,60(sp)
+   211dc:	8fb60038 	lw	s6,56(sp)
+   211e0:	8fb50034 	lw	s5,52(sp)
+   211e4:	8fb40030 	lw	s4,48(sp)
+   211e8:	8fb3002c 	lw	s3,44(sp)
+   211ec:	8fb20028 	lw	s2,40(sp)
+   211f0:	8fb10024 	lw	s1,36(sp)
+   211f4:	8fb00020 	lw	s0,32(sp)
+   211f8:	03e00008 	jr	ra
+   211fc:	27bd0048 	addiu	sp,sp,72
+   21200:	0800841b 	j	2106c <vmm_migrate_shared_page_seq+0x68>
+   21204:	0000a021 	addu	s4,zero,zero
+
+00021208 <vmm_sbrk>:
+   21208:	8c820150 	lw	v0,336(a0)
+   2120c:	27bdffc8 	addiu	sp,sp,-56
+   21210:	00a2282b 	sltu	a1,a1,v0
+   21214:	afb00024 	sw	s0,36(sp)
+   21218:	afbf0034 	sw	ra,52(sp)
+   2121c:	afb30030 	sw	s3,48(sp)
+   21220:	afb2002c 	sw	s2,44(sp)
+   21224:	afb10028 	sw	s1,40(sp)
+   21228:	14a0002a 	bnez	a1,212d4 <vmm_sbrk+0xcc>
+   2122c:	00808021 	addu	s0,a0,zero
+   21230:	3c113000 	lui	s1,0x3000
+   21234:	00c21021 	addu	v0,a2,v0
+   21238:	36310001 	ori	s1,s1,0x1
+   2123c:	0051102b 	sltu	v0,v0,s1
+   21240:	14400008 	bnez	v0,21264 <vmm_sbrk+0x5c>
+   21244:	8fbf0034 	lw	ra,52(sp)
+   21248:	2402000c 	addiu	v0,zero,12
+   2124c:	8fb30030 	lw	s3,48(sp)
+   21250:	8fb2002c 	lw	s2,44(sp)
+   21254:	8fb10028 	lw	s1,40(sp)
+   21258:	8fb00024 	lw	s0,36(sp)
+   2125c:	03e00008 	jr	ra
+   21260:	27bd0038 	addiu	sp,sp,56
+   21264:	8c930158 	lw	s3,344(a0)
+   21268:	27a50010 	addiu	a1,sp,16
+   2126c:	26720010 	addiu	s2,s3,16
+   21270:	02402021 	addu	a0,s2,zero
+   21274:	0c0030a1 	jal	c284 <mcs_lock>
+   21278:	afa60018 	sw	a2,24(sp)
+   2127c:	8e020150 	lw	v0,336(s0)
+   21280:	8fa60018 	lw	a2,24(sp)
+   21284:	00c21021 	addu	v0,a2,v0
+   21288:	0051882b 	sltu	s1,v0,s1
+   2128c:	12200005 	beqz	s1,212a4 <vmm_sbrk+0x9c>
+   21290:	2402000c 	addiu	v0,zero,12
+   21294:	8e6300f8 	lw	v1,248(s3)
+   21298:	00001021 	addu	v0,zero,zero
+   2129c:	00c33021 	addu	a2,a2,v1
+   212a0:	ae6600f8 	sw	a2,248(s3)
+   212a4:	8fa50010 	lw	a1,16(sp)
+   212a8:	02402021 	addu	a0,s2,zero
+   212ac:	0c003130 	jal	c4c0 <mcs_unlock>
+   212b0:	afa20018 	sw	v0,24(sp)
+   212b4:	8fbf0034 	lw	ra,52(sp)
+   212b8:	8fa20018 	lw	v0,24(sp)
+   212bc:	8fb30030 	lw	s3,48(sp)
+   212c0:	8fb2002c 	lw	s2,44(sp)
+   212c4:	8fb10028 	lw	s1,40(sp)
+   212c8:	8fb00024 	lw	s0,36(sp)
+   212cc:	03e00008 	jr	ra
+   212d0:	27bd0038 	addiu	sp,sp,56
+   212d4:	8fbf0034 	lw	ra,52(sp)
+   212d8:	2402000b 	addiu	v0,zero,11
+   212dc:	8fb30030 	lw	s3,48(sp)
+   212e0:	8fb2002c 	lw	s2,44(sp)
+   212e4:	8fb10028 	lw	s1,40(sp)
+   212e8:	8fb00024 	lw	s0,36(sp)
+   212ec:	03e00008 	jr	ra
+   212f0:	27bd0038 	addiu	sp,sp,56
+
+000212f4 <vmm_do_shared_anon_mapping>:
+   212f4:	27bdffd0 	addiu	sp,sp,-48
+   212f8:	afb10024 	sw	s1,36(sp)
+   212fc:	3c050003 	lui	a1,0x3
+   21300:	24910110 	addiu	s1,a0,272
+   21304:	afb00020 	sw	s0,32(sp)
+   21308:	24a57280 	addiu	a1,a1,29312
+   2130c:	00808021 	addu	s0,a0,zero
+   21310:	00003021 	addu	a2,zero,zero
+   21314:	02202021 	addu	a0,s1,zero
+   21318:	afb20028 	sw	s2,40(sp)
+   2131c:	afbf002c 	sw	ra,44(sp)
+   21320:	0c0073aa 	jal	1cea8 <mapper_init>
+   21324:	00003821 	addu	a3,zero,zero
+   21328:	1040000b 	beqz	v0,21358 <vmm_do_shared_anon_mapping+0x64>
+   2132c:	00409021 	addu	s2,v0,zero
+   21330:	27a40010 	addiu	a0,sp,16
+   21334:	0c007134 	jal	1c4d0 <kmem_free>
+   21338:	afb1001c 	sw	s1,28(sp)
+   2133c:	8fbf002c 	lw	ra,44(sp)
+   21340:	02401021 	addu	v0,s2,zero
+   21344:	8fb20028 	lw	s2,40(sp)
+   21348:	8fb10024 	lw	s1,36(sp)
+   2134c:	8fb00020 	lw	s0,32(sp)
+   21350:	03e00008 	jr	ra
+   21354:	27bd0030 	addiu	sp,sp,48
+   21358:	2604011c 	addiu	a0,s0,284
+   2135c:	00002821 	addu	a1,zero,zero
+   21360:	0c00c182 	jal	30608 <memset>
+   21364:	2406003c 	addiu	a2,zero,60
+   21368:	8e040110 	lw	a0,272(s0)
+   2136c:	0c004408 	jal	11020 <rwlock_wrlock>
+   21370:	24840100 	addiu	a0,a0,256
+   21374:	8e040110 	lw	a0,272(s0)
+   21378:	26030158 	addiu	v1,s0,344
+   2137c:	8c8201c4 	lw	v0,452(a0)
+   21380:	24840100 	addiu	a0,a0,256
+   21384:	8c450000 	lw	a1,0(v0)
+   21388:	ae02015c 	sw	v0,348(s0)
+   2138c:	ae050158 	sw	a1,344(s0)
+   21390:	aca30004 	sw	v1,4(a1)
+   21394:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   21398:	ac430000 	sw	v1,0(v0)
+   2139c:	8fbf002c 	lw	ra,44(sp)
+   213a0:	02401021 	addu	v0,s2,zero
+   213a4:	8fb20028 	lw	s2,40(sp)
+   213a8:	8fb10024 	lw	s1,36(sp)
+   213ac:	8fb00020 	lw	s0,32(sp)
+   213b0:	03e00008 	jr	ra
+   213b4:	27bd0030 	addiu	sp,sp,48
+
+000213b8 <vmm_mmap>:
+   213b8:	27bdffa8 	addiu	sp,sp,-88
+   213bc:	24020012 	addiu	v0,zero,18
+   213c0:	afa20018 	sw	v0,24(sp)
+   213c4:	24020170 	addiu	v0,zero,368
+   213c8:	afa2001c 	sw	v0,28(sp)
+   213cc:	3c020011 	lui	v0,0x11
+   213d0:	34420020 	ori	v0,v0,0x20
+   213d4:	afb40044 	sw	s4,68(sp)
+   213d8:	afb2003c 	sw	s2,60(sp)
+   213dc:	afbf0054 	sw	ra,84(sp)
+   213e0:	afb70050 	sw	s7,80(sp)
+   213e4:	afb6004c 	sw	s6,76(sp)
+   213e8:	afb50048 	sw	s5,72(sp)
+   213ec:	afb30040 	sw	s3,64(sp)
+   213f0:	afb10038 	sw	s1,56(sp)
+   213f4:	afb00034 	sw	s0,52(sp)
+   213f8:	afa20020 	sw	v0,32(sp)
+   213fc:	00809021 	addu	s2,a0,zero
+   21400:	00a0a021 	addu	s4,a1,zero
+   21404:	40022002 	mfc0	v0,$4,2
+   21408:	27b10018 	addiu	s1,sp,24
+   2140c:	02202021 	addu	a0,s1,zero
+   21410:	afa60028 	sw	a2,40(sp)
+   21414:	0c00713f 	jal	1c4fc <kmem_alloc>
+   21418:	afa7002c 	sw	a3,44(sp)
+   2141c:	00408021 	addu	s0,v0,zero
+   21420:	8fa60028 	lw	a2,40(sp)
+   21424:	10400041 	beqz	v0,2152c <vmm_mmap+0x174>
+   21428:	8fa7002c 	lw	a3,44(sp)
+   2142c:	8fb3006c 	lw	s3,108(sp)
+   21430:	00c02821 	addu	a1,a2,zero
+   21434:	00402021 	addu	a0,v0,zero
+   21438:	00c73021 	addu	a2,a2,a3
+   2143c:	8fa20070 	lw	v0,112(sp)
+   21440:	8fa70068 	lw	a3,104(sp)
+   21444:	36730400 	ori	s3,s3,0x400
+   21448:	afa20010 	sw	v0,16(sp)
+   2144c:	0c00871b 	jal	21c6c <vm_region_init>
+   21450:	afb30014 	sw	s3,20(sp)
+   21454:	10400012 	beqz	v0,214a0 <vmm_mmap+0xe8>
+   21458:	0040a821 	addu	s5,v0,zero
+   2145c:	02202021 	addu	a0,s1,zero
+   21460:	0c007134 	jal	1c4d0 <kmem_free>
+   21464:	afb00024 	sw	s0,36(sp)
+   21468:	40022002 	mfc0	v0,$4,2
+   2146c:	ac550258 	sw	s5,600(v0)
+   21470:	2402ffff 	addiu	v0,zero,-1
+   21474:	8fbf0054 	lw	ra,84(sp)
+   21478:	8fb70050 	lw	s7,80(sp)
+   2147c:	8fb6004c 	lw	s6,76(sp)
+   21480:	8fb50048 	lw	s5,72(sp)
+   21484:	8fb40044 	lw	s4,68(sp)
+   21488:	8fb30040 	lw	s3,64(sp)
+   2148c:	8fb2003c 	lw	s2,60(sp)
+   21490:	8fb10038 	lw	s1,56(sp)
+   21494:	8fb00034 	lw	s0,52(sp)
+   21498:	03e00008 	jr	ra
+   2149c:	27bd0058 	addiu	sp,sp,88
+   214a0:	26560190 	addiu	s6,s2,400
+   214a4:	02c02021 	addu	a0,s6,zero
+   214a8:	0c004408 	jal	11020 <rwlock_wrlock>
+   214ac:	26570180 	addiu	s7,s2,384
+   214b0:	02e02021 	addu	a0,s7,zero
+   214b4:	0c008842 	jal	22108 <vm_region_attach>
+   214b8:	02002821 	addu	a1,s0,zero
+   214bc:	0040a821 	addu	s5,v0,zero
+   214c0:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   214c4:	02c02021 	addu	a0,s6,zero
+   214c8:	16a0ffe4 	bnez	s5,2145c <vmm_mmap+0xa4>
+   214cc:	3c020003 	lui	v0,0x3
+   214d0:	2442725c 	addiu	v0,v0,29276
+   214d4:	ae02010c 	sw	v0,268(s0)
+   214d8:	32630005 	andi	v1,s3,0x5
+   214dc:	24020005 	addiu	v0,zero,5
+   214e0:	1062002a 	beq	v1,v0,2158c <vmm_mmap+0x1d4>
+   214e4:	00000000 	sll	zero,zero,0x0
+   214e8:	12800012 	beqz	s4,21534 <vmm_mmap+0x17c>
+   214ec:	02802021 	addu	a0,s4,zero
+   214f0:	8e820028 	lw	v0,40(s4)
+   214f4:	8c42001c 	lw	v0,28(v0)
+   214f8:	0040f809 	jalr	v0
+   214fc:	02002821 	addu	a1,s0,zero
+   21500:	1040000f 	beqz	v0,21540 <vmm_mmap+0x188>
+   21504:	0040a821 	addu	s5,v0,zero
+   21508:	0c004408 	jal	11020 <rwlock_wrlock>
+   2150c:	02c02021 	addu	a0,s6,zero
+   21510:	02e02021 	addu	a0,s7,zero
+   21514:	0c00891e 	jal	22478 <vm_region_detach>
+   21518:	02002821 	addu	a1,s0,zero
+   2151c:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   21520:	02c02021 	addu	a0,s6,zero
+   21524:	08008518 	j	21460 <vmm_mmap+0xa8>
+   21528:	02202021 	addu	a0,s1,zero
+   2152c:	0800851a 	j	21468 <vmm_mmap+0xb0>
+   21530:	2415000c 	addiu	s5,zero,12
+   21534:	32620001 	andi	v0,s3,0x1
+   21538:	1440fff3 	bnez	v0,21508 <vmm_mmap+0x150>
+   2153c:	00000000 	sll	zero,zero,0x0
+   21540:	8e030104 	lw	v1,260(s0)
+   21544:	2402fbff 	addiu	v0,zero,-1025
+   21548:	00621024 	and	v0,v1,v0
+   2154c:	ae020104 	sw	v0,260(s0)
+   21550:	0000000f 	sync
+   21554:	32730800 	andi	s3,s3,0x800
+   21558:	12600002 	beqz	s3,21564 <vmm_mmap+0x1ac>
+   2155c:	00000000 	sll	zero,zero,0x0
+   21560:	ae5002d8 	sw	s0,728(s2)
+   21564:	8e0500ec 	lw	a1,236(s0)
+   21568:	8e0600f0 	lw	a2,240(s0)
+   2156c:	26440274 	addiu	a0,s2,628
+   21570:	00c53023 	subu	a2,a2,a1
+   21574:	00063402 	srl	a2,a2,0x10
+   21578:	00052c02 	srl	a1,a1,0x10
+   2157c:	0c002d0c 	jal	b430 <keysdb_bind>
+   21580:	02003821 	addu	a3,s0,zero
+   21584:	0800851d 	j	21474 <vmm_mmap+0xbc>
+   21588:	8e0200f4 	lw	v0,244(s0)
+   2158c:	0c0084bd 	jal	212f4 <vmm_do_shared_anon_mapping>
+   21590:	02002021 	addu	a0,s0,zero
+   21594:	1440ffdc 	bnez	v0,21508 <vmm_mmap+0x150>
+   21598:	0040a821 	addu	s5,v0,zero
+   2159c:	08008551 	j	21544 <vmm_mmap+0x18c>
+   215a0:	8e030104 	lw	v1,260(s0)
+
+000215a4 <vmm_do_munmap>:
+   215a4:	8ca300f4 	lw	v1,244(a1)
+   215a8:	00a01021 	addu	v0,a1,zero
+   215ac:	00804821 	addu	t1,a0,zero
+   215b0:	1066000c 	beq	v1,a2,215e4 <vmm_do_munmap+0x40>
+   215b4:	00e64021 	addu	t0,a3,a2
+   215b8:	00c3202b 	sltu	a0,a2,v1
+   215bc:	1080000c 	beqz	a0,215f0 <vmm_do_munmap+0x4c>
+   215c0:	00000000 	sll	zero,zero,0x0
+   215c4:	8c4400f8 	lw	a0,248(v0)
+   215c8:	0088202b 	sltu	a0,a0,t0
+   215cc:	1480000e 	bnez	a0,21608 <vmm_do_munmap+0x64>
+   215d0:	01202021 	addu	a0,t1,zero
+   215d4:	00402821 	addu	a1,v0,zero
+   215d8:	00603021 	addu	a2,v1,zero
+   215dc:	080086a3 	j	21a8c <vm_region_resize>
+   215e0:	01003821 	addu	a3,t0,zero
+   215e4:	8caa00f8 	lw	t2,248(a1)
+   215e8:	1148000b 	beq	t2,t0,21618 <vmm_do_munmap+0x74>
+   215ec:	00000000 	sll	zero,zero,0x0
+   215f0:	8c4400f8 	lw	a0,248(v0)
+   215f4:	0104202b 	sltu	a0,t0,a0
+   215f8:	1080fff2 	beqz	a0,215c4 <vmm_do_munmap+0x20>
+   215fc:	01202021 	addu	a0,t1,zero
+   21600:	080086a5 	j	21a94 <vm_region_split>
+   21604:	00402821 	addu	a1,v0,zero
+   21608:	8c4700f8 	lw	a3,248(v0)
+   2160c:	01202021 	addu	a0,t1,zero
+   21610:	080086a3 	j	21a8c <vm_region_resize>
+   21614:	00402821 	addu	a1,v0,zero
+   21618:	0800891e 	j	22478 <vm_region_detach>
+   2161c:	00000000 	sll	zero,zero,0x0
+
+00021620 <vmm_munmap>:
+   21620:	27bdffd0 	addiu	sp,sp,-48
+   21624:	afb20024 	sw	s2,36(sp)
+   21628:	afb10020 	sw	s1,32(sp)
+   2162c:	00809021 	addu	s2,a0,zero
+   21630:	00a08821 	addu	s1,a1,zero
+   21634:	248400f4 	addiu	a0,a0,244
+   21638:	00052c02 	srl	a1,a1,0x10
+   2163c:	afb30028 	sw	s3,40(sp)
+   21640:	afbf002c 	sw	ra,44(sp)
+   21644:	afb0001c 	sw	s0,28(sp)
+   21648:	0c002c3a 	jal	b0e8 <keysdb_lookup>
+   2164c:	00c09821 	addu	s3,a2,zero
+   21650:	10400009 	beqz	v0,21678 <vmm_munmap+0x58>
+   21654:	00402821 	addu	a1,v0,zero
+   21658:	8c4200f8 	lw	v0,248(v0)
+   2165c:	0051102b 	sltu	v0,v0,s1
+   21660:	14400006 	bnez	v0,2167c <vmm_munmap+0x5c>
+   21664:	8fbf002c 	lw	ra,44(sp)
+   21668:	8ca200f4 	lw	v0,244(a1)
+   2166c:	0222102b 	sltu	v0,s1,v0
+   21670:	1040000a 	beqz	v0,2169c <vmm_munmap+0x7c>
+   21674:	26500010 	addiu	s0,s2,16
+   21678:	8fbf002c 	lw	ra,44(sp)
+   2167c:	24110016 	addiu	s1,zero,22
+   21680:	02201021 	addu	v0,s1,zero
+   21684:	8fb30028 	lw	s3,40(sp)
+   21688:	8fb20024 	lw	s2,36(sp)
+   2168c:	8fb10020 	lw	s1,32(sp)
+   21690:	8fb0001c 	lw	s0,28(sp)
+   21694:	03e00008 	jr	ra
+   21698:	27bd0030 	addiu	sp,sp,48
+   2169c:	02002021 	addu	a0,s0,zero
+   216a0:	0c004408 	jal	11020 <rwlock_wrlock>
+   216a4:	afa50010 	sw	a1,16(sp)
+   216a8:	8fa50010 	lw	a1,16(sp)
+   216ac:	02402021 	addu	a0,s2,zero
+   216b0:	02203021 	addu	a2,s1,zero
+   216b4:	0c008569 	jal	215a4 <vmm_do_munmap>
+   216b8:	02603821 	addu	a3,s3,zero
+   216bc:	02002021 	addu	a0,s0,zero
+   216c0:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   216c4:	00408821 	addu	s1,v0,zero
+   216c8:	8fbf002c 	lw	ra,44(sp)
+   216cc:	02201021 	addu	v0,s1,zero
+   216d0:	8fb30028 	lw	s3,40(sp)
+   216d4:	8fb20024 	lw	s2,36(sp)
+   216d8:	8fb10020 	lw	s1,32(sp)
+   216dc:	8fb0001c 	lw	s0,28(sp)
+   216e0:	03e00008 	jr	ra
+   216e4:	27bd0030 	addiu	sp,sp,48
+
+000216e8 <vmm_destroy>:
+   216e8:	27bdffe0 	addiu	sp,sp,-32
+   216ec:	afb20018 	sw	s2,24(sp)
+   216f0:	24920010 	addiu	s2,a0,16
+   216f4:	afb00010 	sw	s0,16(sp)
+   216f8:	00808021 	addu	s0,a0,zero
+   216fc:	afb10014 	sw	s1,20(sp)
+   21700:	afbf001c 	sw	ra,28(sp)
+   21704:	0c004408 	jal	11020 <rwlock_wrlock>
+   21708:	02402021 	addu	a0,s2,zero
+   2170c:	8e0200ec 	lw	v0,236(s0)
+   21710:	261100ec 	addiu	s1,s0,236
+   21714:	1222000c 	beq	s1,v0,21748 <vmm_destroy+0x60>
+   21718:	260400f4 	addiu	a0,s0,244
+   2171c:	2442ff20 	addiu	v0,v0,-224
+   21720:	8c430104 	lw	v1,260(v0)
+   21724:	00402821 	addu	a1,v0,zero
+   21728:	34630200 	ori	v1,v1,0x200
+   2172c:	ac430104 	sw	v1,260(v0)
+   21730:	0c00891e 	jal	22478 <vm_region_detach>
+   21734:	02002021 	addu	a0,s0,zero
+   21738:	8e0200ec 	lw	v0,236(s0)
+   2173c:	1451fff8 	bne	v0,s1,21720 <vmm_destroy+0x38>
+   21740:	2442ff20 	addiu	v0,v0,-224
+   21744:	260400f4 	addiu	a0,s0,244
+   21748:	0c002d49 	jal	b524 <keysdb_destroy>
+   2174c:	ae0000e4 	sw	zero,228(s0)
+   21750:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   21754:	02402021 	addu	a0,s2,zero
+   21758:	0c004354 	jal	10d50 <rwlock_destroy>
+   2175c:	02402021 	addu	a0,s2,zero
+   21760:	8fbf001c 	lw	ra,28(sp)
+   21764:	00001021 	addu	v0,zero,zero
+   21768:	8fb20018 	lw	s2,24(sp)
+   2176c:	8fb10014 	lw	s1,20(sp)
+   21770:	8fb00010 	lw	s0,16(sp)
+   21774:	03e00008 	jr	ra
+   21778:	27bd0020 	addiu	sp,sp,32
+
+0002177c <vmm_init>:
+   2177c:	27bdffe8 	addiu	sp,sp,-24
+   21780:	afb00010 	sw	s0,16(sp)
+   21784:	00808021 	addu	s0,a0,zero
+   21788:	afbf0014 	sw	ra,20(sp)
+   2178c:	0c004428 	jal	110a0 <rwlock_init>
+   21790:	24840010 	addiu	a0,a0,16
+   21794:	260200ec 	addiu	v0,s0,236
+   21798:	ae0200f0 	sw	v0,240(s0)
+   2179c:	ae0200ec 	sw	v0,236(s0)
+   217a0:	ae0000e8 	sw	zero,232(s0)
+   217a4:	ae00010c 	sw	zero,268(s0)
+   217a8:	ae000118 	sw	zero,280(s0)
+   217ac:	ae00011c 	sw	zero,284(s0)
+   217b0:	ae000120 	sw	zero,288(s0)
+   217b4:	ae000124 	sw	zero,292(s0)
+   217b8:	ae000128 	sw	zero,296(s0)
+   217bc:	ae000134 	sw	zero,308(s0)
+   217c0:	ae000138 	sw	zero,312(s0)
+   217c4:	260400f4 	addiu	a0,s0,244
+   217c8:	8fbf0014 	lw	ra,20(sp)
+   217cc:	8fb00010 	lw	s0,16(sp)
+   217d0:	24050010 	addiu	a1,zero,16
+   217d4:	08002dc0 	j	b700 <keysdb_init>
+   217d8:	27bd0018 	addiu	sp,sp,24
+
+000217dc <vmm_dup>:
+   217dc:	27bdffb8 	addiu	sp,sp,-72
+   217e0:	afb10028 	sw	s1,40(sp)
+   217e4:	24070012 	addiu	a3,zero,18
+   217e8:	2491fe80 	addiu	s1,a0,-384
+   217ec:	8e2602e0 	lw	a2,736(s1)
+   217f0:	afa70010 	sw	a3,16(sp)
+   217f4:	24070170 	addiu	a3,zero,368
+   217f8:	8e2302e8 	lw	v1,744(s1)
+   217fc:	afa70014 	sw	a3,20(sp)
+   21800:	3c020002 	lui	v0,0x2
+   21804:	3c070051 	lui	a3,0x51
+   21808:	00c21021 	addu	v0,a2,v0
+   2180c:	34e70020 	ori	a3,a3,0x20
+   21810:	afb00024 	sw	s0,36(sp)
+   21814:	24060160 	addiu	a2,zero,352
+   21818:	00808021 	addu	s0,a0,zero
+   2181c:	afbf0044 	sw	ra,68(sp)
+   21820:	afb70040 	sw	s7,64(sp)
+   21824:	afb30030 	sw	s3,48(sp)
+   21828:	afb2002c 	sw	s2,44(sp)
+   2182c:	afa70018 	sw	a3,24(sp)
+   21830:	afa3001c 	sw	v1,28(sp)
+   21834:	00a09021 	addu	s2,a1,zero
+   21838:	afb6003c 	sw	s6,60(sp)
+   2183c:	afb50038 	sw	s5,56(sp)
+   21840:	afb40034 	sw	s4,52(sp)
+   21844:	0c00c12b 	jal	304ac <memcpy>
+   21848:	8c531340 	lw	s3,4928(v0)
+   2184c:	0c0085df 	jal	2177c <vmm_init>
+   21850:	02002021 	addu	a0,s0,zero
+   21854:	1040000d 	beqz	v0,2188c <vmm_dup+0xb0>
+   21858:	0040b821 	addu	s7,v0,zero
+   2185c:	8fbf0044 	lw	ra,68(sp)
+   21860:	02e01021 	addu	v0,s7,zero
+   21864:	8fb70040 	lw	s7,64(sp)
+   21868:	8fb6003c 	lw	s6,60(sp)
+   2186c:	8fb50038 	lw	s5,56(sp)
+   21870:	8fb40034 	lw	s4,52(sp)
+   21874:	8fb30030 	lw	s3,48(sp)
+   21878:	8fb2002c 	lw	s2,44(sp)
+   2187c:	8fb10028 	lw	s1,40(sp)
+   21880:	8fb00024 	lw	s0,36(sp)
+   21884:	03e00008 	jr	ra
+   21888:	27bd0048 	addiu	sp,sp,72
+   2188c:	8e2502e8 	lw	a1,744(s1)
+   21890:	261100d0 	addiu	s1,s0,208
+   21894:	0c000d37 	jal	34dc <pmm_init>
+   21898:	02202021 	addu	a0,s1,zero
+   2189c:	1440ffef 	bnez	v0,2185c <vmm_dup+0x80>
+   218a0:	0040b821 	addu	s7,v0,zero
+   218a4:	02202021 	addu	a0,s1,zero
+   218a8:	0c000ce6 	jal	3398 <pmm_dup>
+   218ac:	26650250 	addiu	a1,s3,592
+   218b0:	1440ffea 	bnez	v0,2185c <vmm_dup+0x80>
+   218b4:	0040b821 	addu	s7,v0,zero
+   218b8:	26560010 	addiu	s6,s2,16
+   218bc:	0c004408 	jal	11020 <rwlock_wrlock>
+   218c0:	02c02021 	addu	a0,s6,zero
+   218c4:	8e5700ec 	lw	s7,236(s2)
+   218c8:	265200ec 	addiu	s2,s2,236
+   218cc:	12f20020 	beq	s7,s2,21950 <vmm_dup+0x174>
+   218d0:	8ef30000 	lw	s3,0(s7)
+   218d4:	08008646 	j	21918 <vmm_dup+0x13c>
+   218d8:	27b40010 	addiu	s4,sp,16
+   218dc:	0c00876b 	jal	21dac <vm_region_dup>
+   218e0:	ac5000e8 	sw	s0,232(v0)
+   218e4:	0040b821 	addu	s7,v0,zero
+   218e8:	1440001f 	bnez	v0,21968 <vmm_dup+0x18c>
+   218ec:	262300e0 	addiu	v1,s1,224
+   218f0:	8e0200f0 	lw	v0,240(s0)
+   218f4:	0260b821 	addu	s7,s3,zero
+   218f8:	8c440000 	lw	a0,0(v0)
+   218fc:	ae2200e4 	sw	v0,228(s1)
+   21900:	ae2400e0 	sw	a0,224(s1)
+   21904:	ac430000 	sw	v1,0(v0)
+   21908:	ac830004 	sw	v1,4(a0)
+   2190c:	12720011 	beq	s3,s2,21954 <vmm_dup+0x178>
+   21910:	8e620000 	lw	v0,0(s3)
+   21914:	00409821 	addu	s3,v0,zero
+   21918:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2191c:	02802021 	addu	a0,s4,zero
+   21920:	00408821 	addu	s1,v0,zero
+   21924:	26e5ff20 	addiu	a1,s7,-224
+   21928:	00402021 	addu	a0,v0,zero
+   2192c:	1440ffeb 	bnez	v0,218dc <vmm_dup+0x100>
+   21930:	0040a821 	addu	s5,v0,zero
+   21934:	0000b821 	addu	s7,zero,zero
+   21938:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   2193c:	02c02021 	addu	a0,s6,zero
+   21940:	0c0085ba 	jal	216e8 <vmm_destroy>
+   21944:	02002021 	addu	a0,s0,zero
+   21948:	08008618 	j	21860 <vmm_dup+0x84>
+   2194c:	8fbf0044 	lw	ra,68(sp)
+   21950:	0000a821 	addu	s5,zero,zero
+   21954:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   21958:	02c02021 	addu	a0,s6,zero
+   2195c:	0000b821 	addu	s7,zero,zero
+   21960:	08008617 	j	2185c <vmm_dup+0x80>
+   21964:	ae1500e4 	sw	s5,228(s0)
+   21968:	02802021 	addu	a0,s4,zero
+   2196c:	0c007134 	jal	1c4d0 <kmem_free>
+   21970:	afb1001c 	sw	s1,28(sp)
+   21974:	0800864e 	j	21938 <vmm_dup+0x15c>
+   21978:	00000000 	sll	zero,zero,0x0
+
+0002197c <vm_region_kmem_init>:
+   2197c:	24020012 	addiu	v0,zero,18
+   21980:	ac820000 	sw	v0,0(a0)
+   21984:	3c020003 	lui	v0,0x3
+   21988:	244272ac 	addiu	v0,v0,29356
+   2198c:	ac820004 	sw	v0,4(a0)
+   21990:	24020170 	addiu	v0,zero,368
+   21994:	ac820008 	sw	v0,8(a0)
+   21998:	24020001 	addiu	v0,zero,1
+   2199c:	ac82000c 	sw	v0,12(a0)
+   219a0:	24020002 	addiu	v0,zero,2
+   219a4:	ac820010 	sw	v0,16(a0)
+   219a8:	3c020002 	lui	v0,0x2
+   219ac:	24422644 	addiu	v0,v0,9796
+   219b0:	ac820018 	sw	v0,24(a0)
+   219b4:	ac80001c 	sw	zero,28(a0)
+   219b8:	ac800014 	sw	zero,20(a0)
+   219bc:	03e00008 	jr	ra
+   219c0:	00001021 	addu	v0,zero,zero
+
+000219c4 <vm_region_destroy>:
+   219c4:	03e00008 	jr	ra
+   219c8:	00001021 	addu	v0,zero,zero
+
+000219cc <vm_region_find_list>:
+   219cc:	8c8200ec 	lw	v0,236(a0)
+   219d0:	248300ec 	addiu	v1,a0,236
+   219d4:	10430010 	beq	v0,v1,21a18 <vm_region_find_list+0x4c>
+   219d8:	8c460000 	lw	a2,0(v0)
+   219dc:	2442ff20 	addiu	v0,v0,-224
+   219e0:	8c4700f0 	lw	a3,240(v0)
+   219e4:	00a7382b 	sltu	a3,a1,a3
+   219e8:	10e00008 	beqz	a3,21a0c <vm_region_find_list+0x40>
+   219ec:	00000000 	sll	zero,zero,0x0
+   219f0:	03e00008 	jr	ra
+   219f4:	ac8200e4 	sw	v0,228(a0)
+   219f8:	8c4800f0 	lw	t0,240(v0)
+   219fc:	00e03021 	addu	a2,a3,zero
+   21a00:	00a8382b 	sltu	a3,a1,t0
+   21a04:	14e00006 	bnez	a3,21a20 <vm_region_find_list+0x54>
+   21a08:	00000000 	sll	zero,zero,0x0
+   21a0c:	24c2ff20 	addiu	v0,a2,-224
+   21a10:	1466fff9 	bne	v1,a2,219f8 <vm_region_find_list+0x2c>
+   21a14:	8cc70000 	lw	a3,0(a2)
+   21a18:	03e00008 	jr	ra
+   21a1c:	00001021 	addu	v0,zero,zero
+   21a20:	ac8200e4 	sw	v0,228(a0)
+   21a24:	03e00008 	jr	ra
+   21a28:	00000000 	sll	zero,zero,0x0
+
+00021a2c <vm_region_find>:
+   21a2c:	8c8300e8 	lw	v1,232(a0)
+   21a30:	10600014 	beqz	v1,21a84 <vm_region_find+0x58>
+   21a34:	00000000 	sll	zero,zero,0x0
+   21a38:	00001021 	addu	v0,zero,zero
+   21a3c:	8c6400f0 	lw	a0,240(v1)
+   21a40:	00a4202b 	sltu	a0,a1,a0
+   21a44:	1080000a 	beqz	a0,21a70 <vm_region_find+0x44>
+   21a48:	00000000 	sll	zero,zero,0x0
+   21a4c:	8c6400ec 	lw	a0,236(v1)
+   21a50:	00a4202b 	sltu	a0,a1,a0
+   21a54:	10800004 	beqz	a0,21a68 <vm_region_find+0x3c>
+   21a58:	00601021 	addu	v0,v1,zero
+   21a5c:	8c630008 	lw	v1,8(v1)
+   21a60:	1460fff6 	bnez	v1,21a3c <vm_region_find+0x10>
+   21a64:	00000000 	sll	zero,zero,0x0
+   21a68:	03e00008 	jr	ra
+   21a6c:	00000000 	sll	zero,zero,0x0
+   21a70:	8c630004 	lw	v1,4(v1)
+   21a74:	1460fff1 	bnez	v1,21a3c <vm_region_find+0x10>
+   21a78:	00000000 	sll	zero,zero,0x0
+   21a7c:	0800869a 	j	21a68 <vm_region_find+0x3c>
+   21a80:	00000000 	sll	zero,zero,0x0
+   21a84:	03e00008 	jr	ra
+   21a88:	00001021 	addu	v0,zero,zero
+
+00021a8c <vm_region_resize>:
+   21a8c:	03e00008 	jr	ra
+   21a90:	00001021 	addu	v0,zero,zero
+
+00021a94 <vm_region_split>:
+   21a94:	03e00008 	jr	ra
+   21a98:	24020026 	addiu	v0,zero,38
+
+00021a9c <vm_region_update>:
+   21a9c:	27bdffc0 	addiu	sp,sp,-64
+   21aa0:	30c20004 	andi	v0,a2,0x4
+   21aa4:	afb30038 	sw	s3,56(sp)
+   21aa8:	afb20034 	sw	s2,52(sp)
+   21aac:	afb0002c 	sw	s0,44(sp)
+   21ab0:	afbf003c 	sw	ra,60(sp)
+   21ab4:	afb10030 	sw	s1,48(sp)
+   21ab8:	00c08021 	addu	s0,a2,zero
+   21abc:	00809021 	addu	s2,a0,zero
+   21ac0:	14400010 	bnez	v0,21b04 <vm_region_update+0x68>
+   21ac4:	00a09821 	addu	s3,a1,zero
+   21ac8:	30c20003 	andi	v0,a2,0x3
+   21acc:	14400040 	bnez	v0,21bd0 <vm_region_update+0x134>
+   21ad0:	00000000 	sll	zero,zero,0x0
+   21ad4:	32021000 	andi	v0,s0,0x1000
+   21ad8:	1040005e 	beqz	v0,21c54 <vm_region_update+0x1b8>
+   21adc:	00000000 	sll	zero,zero,0x0
+   21ae0:	32020010 	andi	v0,s0,0x10
+   21ae4:	10400025 	beqz	v0,21b7c <vm_region_update+0xe0>
+   21ae8:	00000000 	sll	zero,zero,0x0
+   21aec:	8e4200fc 	lw	v0,252(s2)
+   21af0:	30430004 	andi	v1,v0,0x4
+   21af4:	14600021 	bnez	v1,21b7c <vm_region_update+0xe0>
+   21af8:	2411fc14 	addiu	s1,zero,-1004
+   21afc:	080086c3 	j	21b0c <vm_region_update+0x70>
+   21b00:	00000000 	sll	zero,zero,0x0
+   21b04:	8c8200fc 	lw	v0,252(a0)
+   21b08:	2411fc17 	addiu	s1,zero,-1001
+   21b0c:	40047801 	mfc0	a0,$15,1
+   21b10:	3c030004 	lui	v1,0x4
+   21b14:	30840003 	andi	a0,a0,0x3
+   21b18:	00042080 	sll	a0,a0,0x2
+   21b1c:	2463c950 	addiu	v1,v1,-14000
+   21b20:	00831821 	addu	v1,a0,v1
+   21b24:	3c040004 	lui	a0,0x4
+   21b28:	8c630000 	lw	v1,0(v1)
+   21b2c:	3c060003 	lui	a2,0x3
+   21b30:	3c070003 	lui	a3,0x3
+   21b34:	8c849100 	lw	a0,-28416(a0)
+   21b38:	24c672fc 	addiu	a2,a2,29436
+   21b3c:	24e77394 	addiu	a3,a3,29588
+   21b40:	00002821 	addu	a1,zero,zero
+   21b44:	afa30010 	sw	v1,16(sp)
+   21b48:	afb30014 	sw	s3,20(sp)
+   21b4c:	afb00018 	sw	s0,24(sp)
+   21b50:	afa2001c 	sw	v0,28(sp)
+   21b54:	0c0009b0 	jal	26c0 <__fprintk>
+   21b58:	afb10020 	sw	s1,32(sp)
+   21b5c:	8fbf003c 	lw	ra,60(sp)
+   21b60:	02201021 	addu	v0,s1,zero
+   21b64:	8fb30038 	lw	s3,56(sp)
+   21b68:	8fb20034 	lw	s2,52(sp)
+   21b6c:	8fb10030 	lw	s1,48(sp)
+   21b70:	8fb0002c 	lw	s0,44(sp)
+   21b74:	03e00008 	jr	ra
+   21b78:	27bd0040 	addiu	sp,sp,64
+   21b7c:	8e420104 	lw	v0,260(s2)
+   21b80:	30420400 	andi	v0,v0,0x400
+   21b84:	1440000f 	bnez	v0,21bc4 <vm_region_update+0x128>
+   21b88:	00000000 	sll	zero,zero,0x0
+   21b8c:	40022002 	mfc0	v0,$4,2
+   21b90:	8c430214 	lw	v1,532(v0)
+   21b94:	14600014 	bnez	v1,21be8 <vm_region_update+0x14c>
+   21b98:	00000000 	sll	zero,zero,0x0
+   21b9c:	8e42010c 	lw	v0,268(s2)
+   21ba0:	02402021 	addu	a0,s2,zero
+   21ba4:	8c42000c 	lw	v0,12(v0)
+   21ba8:	02602821 	addu	a1,s3,zero
+   21bac:	0040f809 	jalr	v0
+   21bb0:	02003021 	addu	a2,s0,zero
+   21bb4:	1040ffe9 	beqz	v0,21b5c <vm_region_update+0xc0>
+   21bb8:	00408821 	addu	s1,v0,zero
+   21bbc:	080086c3 	j	21b0c <vm_region_update+0x70>
+   21bc0:	8e4200fc 	lw	v0,252(s2)
+   21bc4:	8e4200fc 	lw	v0,252(s2)
+   21bc8:	080086c3 	j	21b0c <vm_region_update+0x70>
+   21bcc:	2411fc13 	addiu	s1,zero,-1005
+   21bd0:	8c8200fc 	lw	v0,252(a0)
+   21bd4:	30430001 	andi	v1,v0,0x1
+   21bd8:	1460ffbe 	bnez	v1,21ad4 <vm_region_update+0x38>
+   21bdc:	2411fc16 	addiu	s1,zero,-1002
+   21be0:	080086c3 	j	21b0c <vm_region_update+0x70>
+   21be4:	00000000 	sll	zero,zero,0x0
+   21be8:	40047801 	mfc0	a0,$15,1
+   21bec:	3c030004 	lui	v1,0x4
+   21bf0:	30840003 	andi	a0,a0,0x3
+   21bf4:	00042080 	sll	a0,a0,0x2
+   21bf8:	2463c950 	addiu	v1,v1,-14000
+   21bfc:	00831821 	addu	v1,a0,v1
+   21c00:	8c630000 	lw	v1,0(v1)
+   21c04:	3c060003 	lui	a2,0x3
+   21c08:	afa30010 	sw	v1,16(sp)
+   21c0c:	8c420180 	lw	v0,384(v0)
+   21c10:	3c030004 	lui	v1,0x4
+   21c14:	8c4805c4 	lw	t0,1476(v0)
+   21c18:	8c649100 	lw	a0,-28416(v1)
+   21c1c:	8e4200f8 	lw	v0,248(s2)
+   21c20:	8e4300f4 	lw	v1,244(s2)
+   21c24:	3c070003 	lui	a3,0x3
+   21c28:	24c672bc 	addiu	a2,a2,29372
+   21c2c:	24e77394 	addiu	a3,a3,29588
+   21c30:	00002821 	addu	a1,zero,zero
+   21c34:	afa80014 	sw	t0,20(sp)
+   21c38:	afa30020 	sw	v1,32(sp)
+   21c3c:	afa20024 	sw	v0,36(sp)
+   21c40:	afb30018 	sw	s3,24(sp)
+   21c44:	0c0009b0 	jal	26c0 <__fprintk>
+   21c48:	afb0001c 	sw	s0,28(sp)
+   21c4c:	080086e8 	j	21ba0 <vm_region_update+0x104>
+   21c50:	8e42010c 	lw	v0,268(s2)
+   21c54:	8e4200fc 	lw	v0,252(s2)
+   21c58:	30430002 	andi	v1,v0,0x2
+   21c5c:	1460ffa0 	bnez	v1,21ae0 <vm_region_update+0x44>
+   21c60:	2411fc15 	addiu	s1,zero,-1003
+   21c64:	080086c3 	j	21b0c <vm_region_update+0x70>
+   21c68:	00000000 	sll	zero,zero,0x0
+
+00021c6c <vm_region_init>:
+   21c6c:	27bdffd0 	addiu	sp,sp,-48
+   21c70:	afb40028 	sw	s4,40(sp)
+   21c74:	afb30024 	sw	s3,36(sp)
+   21c78:	00a0a021 	addu	s4,a1,zero
+   21c7c:	afb00018 	sw	s0,24(sp)
+   21c80:	24050001 	addiu	a1,zero,1
+   21c84:	00808021 	addu	s0,a0,zero
+   21c88:	3c13ffff 	lui	s3,0xffff
+   21c8c:	248400a0 	addiu	a0,a0,160
+   21c90:	afa70010 	sw	a3,16(sp)
+   21c94:	afbf002c 	sw	ra,44(sp)
+   21c98:	afb20020 	sw	s2,32(sp)
+   21c9c:	afb1001c 	sw	s1,28(sp)
+   21ca0:	00c09021 	addu	s2,a2,zero
+   21ca4:	0c00199f 	jal	667c <atomic_init>
+   21ca8:	8fb10044 	lw	s1,68(sp)
+   21cac:	02931024 	and	v0,s4,s3
+   21cb0:	ae0200ec 	sw	v0,236(s0)
+   21cb4:	ae1400f4 	sw	s4,244(s0)
+   21cb8:	8fa20040 	lw	v0,64(sp)
+   21cbc:	ae00010c 	sw	zero,268(s0)
+   21cc0:	ae020108 	sw	v0,264(s0)
+   21cc4:	ae1200f8 	sw	s2,248(s0)
+   21cc8:	ae110104 	sw	s1,260(s0)
+   21ccc:	ae000110 	sw	zero,272(s0)
+   21cd0:	ae000114 	sw	zero,276(s0)
+   21cd4:	ae000118 	sw	zero,280(s0)
+   21cd8:	2604011c 	addiu	a0,s0,284
+   21cdc:	00002821 	addu	a1,zero,zero
+   21ce0:	0c00c182 	jal	30608 <memset>
+   21ce4:	2406003c 	addiu	a2,zero,60
+   21ce8:	32220800 	andi	v0,s1,0x800
+   21cec:	10400028 	beqz	v0,21d90 <vm_region_init+0x124>
+   21cf0:	8fa70010 	lw	a3,16(sp)
+   21cf4:	3c023000 	lui	v0,0x3000
+   21cf8:	ae0200f0 	sw	v0,240(s0)
+   21cfc:	30e20002 	andi	v0,a3,0x2
+   21d00:	14400020 	bnez	v0,21d84 <vm_region_init+0x118>
+   21d04:	00000000 	sll	zero,zero,0x0
+   21d08:	3c023940 	lui	v0,0x3940
+   21d0c:	30e30001 	andi	v1,a3,0x1
+   21d10:	10600004 	beqz	v1,21d24 <vm_region_init+0xb8>
+   21d14:	30e30004 	andi	v1,a3,0x4
+   21d18:	3c038000 	lui	v1,0x8000
+   21d1c:	00431025 	or	v0,v0,v1
+   21d20:	30e30004 	andi	v1,a3,0x4
+   21d24:	10600013 	beqz	v1,21d74 <vm_region_init+0x108>
+   21d28:	3c030200 	lui	v1,0x200
+   21d2c:	00431025 	or	v0,v0,v1
+   21d30:	3c038000 	lui	v1,0x8000
+   21d34:	00431025 	or	v0,v0,v1
+   21d38:	32310020 	andi	s1,s1,0x20
+   21d3c:	12200002 	beqz	s1,21d48 <vm_region_init+0xdc>
+   21d40:	3c034000 	lui	v1,0x4000
+   21d44:	00431025 	or	v0,v0,v1
+   21d48:	8fbf002c 	lw	ra,44(sp)
+   21d4c:	ae020100 	sw	v0,256(s0)
+   21d50:	ae0700fc 	sw	a3,252(s0)
+   21d54:	00001021 	addu	v0,zero,zero
+   21d58:	8fb40028 	lw	s4,40(sp)
+   21d5c:	8fb30024 	lw	s3,36(sp)
+   21d60:	8fb20020 	lw	s2,32(sp)
+   21d64:	8fb1001c 	lw	s1,28(sp)
+   21d68:	8fb00018 	lw	s0,24(sp)
+   21d6c:	03e00008 	jr	ra
+   21d70:	27bd0030 	addiu	sp,sp,48
+   21d74:	10e0fff0 	beqz	a3,21d38 <vm_region_init+0xcc>
+   21d78:	3c038000 	lui	v1,0x8000
+   21d7c:	0800874e 	j	21d38 <vm_region_init+0xcc>
+   21d80:	00431025 	or	v0,v0,v1
+   21d84:	34e70001 	ori	a3,a3,0x1
+   21d88:	08008743 	j	21d0c <vm_region_init+0xa0>
+   21d8c:	3c023d40 	lui	v0,0x3d40
+   21d90:	3242ffff 	andi	v0,s2,0xffff
+   21d94:	10400003 	beqz	v0,21da4 <vm_region_init+0x138>
+   21d98:	3c020001 	lui	v0,0x1
+   21d9c:	02539024 	and	s2,s2,s3
+   21da0:	02429021 	addu	s2,s2,v0
+   21da4:	0800873f 	j	21cfc <vm_region_init+0x90>
+   21da8:	ae1200f0 	sw	s2,240(s0)
+
+00021dac <vm_region_dup>:
+   21dac:	27bdffa0 	addiu	sp,sp,-96
+   21db0:	afb10040 	sw	s1,64(sp)
+   21db4:	afb0003c 	sw	s0,60(sp)
+   21db8:	00a08821 	addu	s1,a1,zero
+   21dbc:	00808021 	addu	s0,a0,zero
+   21dc0:	24050001 	addiu	a1,zero,1
+   21dc4:	248400a0 	addiu	a0,a0,160
+   21dc8:	afb30048 	sw	s3,72(sp)
+   21dcc:	afbf005c 	sw	ra,92(sp)
+   21dd0:	afb70058 	sw	s7,88(sp)
+   21dd4:	afb60054 	sw	s6,84(sp)
+   21dd8:	afb50050 	sw	s5,80(sp)
+   21ddc:	afb4004c 	sw	s4,76(sp)
+   21de0:	0c00199f 	jal	667c <atomic_init>
+   21de4:	afb20044 	sw	s2,68(sp)
+   21de8:	8e240110 	lw	a0,272(s1)
+   21dec:	8e230114 	lw	v1,276(s1)
+   21df0:	8e220118 	lw	v0,280(s1)
+   21df4:	8e2600ec 	lw	a2,236(s1)
+   21df8:	8e2d00f0 	lw	t5,240(s1)
+   21dfc:	8e2c00f4 	lw	t4,244(s1)
+   21e00:	8e2b00f8 	lw	t3,248(s1)
+   21e04:	8e2a00fc 	lw	t2,252(s1)
+   21e08:	8e290100 	lw	t1,256(s1)
+   21e0c:	8e280104 	lw	t0,260(s1)
+   21e10:	8e270108 	lw	a3,264(s1)
+   21e14:	8e25010c 	lw	a1,268(s1)
+   21e18:	2633011c 	addiu	s3,s1,284
+   21e1c:	ae040110 	sw	a0,272(s0)
+   21e20:	ae030114 	sw	v1,276(s0)
+   21e24:	ae020118 	sw	v0,280(s0)
+   21e28:	ae0d00f0 	sw	t5,240(s0)
+   21e2c:	ae0c00f4 	sw	t4,244(s0)
+   21e30:	ae0b00f8 	sw	t3,248(s0)
+   21e34:	ae0a00fc 	sw	t2,252(s0)
+   21e38:	ae090100 	sw	t1,256(s0)
+   21e3c:	ae080104 	sw	t0,260(s0)
+   21e40:	ae070108 	sw	a3,264(s0)
+   21e44:	ae05010c 	sw	a1,268(s0)
+   21e48:	ae0600ec 	sw	a2,236(s0)
+   21e4c:	02601021 	addu	v0,s3,zero
+   21e50:	2603011c 	addiu	v1,s0,284
+   21e54:	2624014c 	addiu	a0,s1,332
+   21e58:	8c490000 	lw	t1,0(v0)
+   21e5c:	8c480004 	lw	t0,4(v0)
+   21e60:	8c470008 	lw	a3,8(v0)
+   21e64:	8c45000c 	lw	a1,12(v0)
+   21e68:	24420010 	addiu	v0,v0,16
+   21e6c:	ac690000 	sw	t1,0(v1)
+   21e70:	ac680004 	sw	t0,4(v1)
+   21e74:	ac670008 	sw	a3,8(v1)
+   21e78:	ac65000c 	sw	a1,12(v1)
+   21e7c:	1444fff6 	bne	v0,a0,21e58 <vm_region_dup+0xac>
+   21e80:	24630010 	addiu	v1,v1,16
+   21e84:	8c450008 	lw	a1,8(v0)
+   21e88:	8c440000 	lw	a0,0(v0)
+   21e8c:	8c420004 	lw	v0,4(v0)
+   21e90:	8e1200e8 	lw	s2,232(s0)
+   21e94:	ac650008 	sw	a1,8(v1)
+   21e98:	ac640000 	sw	a0,0(v1)
+   21e9c:	ac620004 	sw	v0,4(v1)
+   21ea0:	8e220160 	lw	v0,352(s1)
+   21ea4:	264500e8 	addiu	a1,s2,232
+   21ea8:	00a01821 	addu	v1,a1,zero
+   21eac:	ae020160 	sw	v0,352(s0)
+   21eb0:	8c620000 	lw	v0,0(v1)
+   21eb4:	1040000d 	beqz	v0,21eec <vm_region_dup+0x140>
+   21eb8:	00002021 	addu	a0,zero,zero
+   21ebc:	8c4400f0 	lw	a0,240(v0)
+   21ec0:	00c4202b 	sltu	a0,a2,a0
+   21ec4:	10800040 	beqz	a0,21fc8 <vm_region_dup+0x21c>
+   21ec8:	00000000 	sll	zero,zero,0x0
+   21ecc:	8c4400ec 	lw	a0,236(v0)
+   21ed0:	00c4202b 	sltu	a0,a2,a0
+   21ed4:	10800006 	beqz	a0,21ef0 <vm_region_dup+0x144>
+   21ed8:	00402021 	addu	a0,v0,zero
+   21edc:	24430008 	addiu	v1,v0,8
+   21ee0:	8c620000 	lw	v0,0(v1)
+   21ee4:	1440fff5 	bnez	v0,21ebc <vm_region_dup+0x110>
+   21ee8:	00000000 	sll	zero,zero,0x0
+   21eec:	00801021 	addu	v0,a0,zero
+   21ef0:	ae020000 	sw	v0,0(s0)
+   21ef4:	ae000004 	sw	zero,4(s0)
+   21ef8:	ae000008 	sw	zero,8(s0)
+   21efc:	02002021 	addu	a0,s0,zero
+   21f00:	0c00c231 	jal	308c4 <rb_insert_color>
+   21f04:	ac700000 	sw	s0,0(v1)
+   21f08:	8e220140 	lw	v0,320(s1)
+   21f0c:	10400045 	beqz	v0,22024 <vm_region_dup+0x278>
+   21f10:	00000000 	sll	zero,zero,0x0
+   21f14:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+   21f18:	02602021 	addu	a0,s3,zero
+   21f1c:	8e2200f8 	lw	v0,248(s1)
+   21f20:	8e3200f4 	lw	s2,244(s1)
+   21f24:	8e1600e8 	lw	s6,232(s0)
+   21f28:	8e3400e8 	lw	s4,232(s1)
+   21f2c:	00528023 	subu	s0,v0,s2
+   21f30:	00108302 	srl	s0,s0,0xc
+   21f34:	269400d0 	addiu	s4,s4,208
+   21f38:	12000071 	beqz	s0,22100 <vm_region_dup+0x354>
+   21f3c:	26d600d0 	addiu	s6,s6,208
+   21f40:	27b30020 	addiu	s3,sp,32
+   21f44:	02402821 	addu	a1,s2,zero
+   21f48:	02802021 	addu	a0,s4,zero
+   21f4c:	02603021 	addu	a2,s3,zero
+   21f50:	0c000a56 	jal	2958 <pmm_get_page>
+   21f54:	3c17fbff 	lui	s7,0xfbff
+   21f58:	36f7ffff 	ori	s7,s7,0xffff
+   21f5c:	00408821 	addu	s1,v0,zero
+   21f60:	1440000d 	bnez	v0,21f98 <vm_region_dup+0x1ec>
+   21f64:	2610ffff 	addiu	s0,s0,-1
+   21f68:	8fa20020 	lw	v0,32(sp)
+   21f6c:	04400019 	bltz	v0,21fd4 <vm_region_dup+0x228>
+   21f70:	8fb50024 	lw	s5,36(sp)
+   21f74:	12000008 	beqz	s0,21f98 <vm_region_dup+0x1ec>
+   21f78:	26521000 	addiu	s2,s2,4096
+   21f7c:	02402821 	addu	a1,s2,zero
+   21f80:	02802021 	addu	a0,s4,zero
+   21f84:	0c000a56 	jal	2958 <pmm_get_page>
+   21f88:	02603021 	addu	a2,s3,zero
+   21f8c:	00408821 	addu	s1,v0,zero
+   21f90:	1040fff5 	beqz	v0,21f68 <vm_region_dup+0x1bc>
+   21f94:	2610ffff 	addiu	s0,s0,-1
+   21f98:	02201021 	addu	v0,s1,zero
+   21f9c:	8fbf005c 	lw	ra,92(sp)
+   21fa0:	8fb70058 	lw	s7,88(sp)
+   21fa4:	8fb60054 	lw	s6,84(sp)
+   21fa8:	8fb50050 	lw	s5,80(sp)
+   21fac:	8fb4004c 	lw	s4,76(sp)
+   21fb0:	8fb30048 	lw	s3,72(sp)
+   21fb4:	8fb20044 	lw	s2,68(sp)
+   21fb8:	8fb10040 	lw	s1,64(sp)
+   21fbc:	8fb0003c 	lw	s0,60(sp)
+   21fc0:	03e00008 	jr	ra
+   21fc4:	27bd0060 	addiu	sp,sp,96
+   21fc8:	24430004 	addiu	v1,v0,4
+   21fcc:	080087b8 	j	21ee0 <vm_region_dup+0x134>
+   21fd0:	00402021 	addu	a0,v0,zero
+   21fd4:	34420001 	ori	v0,v0,0x1
+   21fd8:	00571024 	and	v0,v0,s7
+   21fdc:	02c02021 	addu	a0,s6,zero
+   21fe0:	02402821 	addu	a1,s2,zero
+   21fe4:	02603021 	addu	a2,s3,zero
+   21fe8:	afa20020 	sw	v0,32(sp)
+   21fec:	0c000c15 	jal	3054 <pmm_set_page>
+   21ff0:	afa00028 	sw	zero,40(sp)
+   21ff4:	02402821 	addu	a1,s2,zero
+   21ff8:	02802021 	addu	a0,s4,zero
+   21ffc:	1440ffe7 	bnez	v0,21f9c <vm_region_dup+0x1f0>
+   22000:	02603021 	addu	a2,s3,zero
+   22004:	0c000c15 	jal	3054 <pmm_set_page>
+   22008:	00000000 	sll	zero,zero,0x0
+   2200c:	1440ffe3 	bnez	v0,21f9c <vm_region_dup+0x1f0>
+   22010:	02a02021 	addu	a0,s5,zero
+   22014:	0c007fbd 	jal	1fef4 <ppn_refcount_up>
+   22018:	00000000 	sll	zero,zero,0x0
+   2201c:	080087dd 	j	21f74 <vm_region_dup+0x1c8>
+   22020:	00000000 	sll	zero,zero,0x0
+   22024:	8e020104 	lw	v0,260(s0)
+   22028:	30420001 	andi	v0,v0,0x1
+   2202c:	1040ffbb 	beqz	v0,21f1c <vm_region_dup+0x170>
+   22030:	00000000 	sll	zero,zero,0x0
+   22034:	8e040110 	lw	a0,272(s0)
+   22038:	0c004408 	jal	11020 <rwlock_wrlock>
+   2203c:	24840100 	addiu	a0,a0,256
+   22040:	8e040110 	lw	a0,272(s0)
+   22044:	26030158 	addiu	v1,s0,344
+   22048:	8c8201c4 	lw	v0,452(a0)
+   2204c:	24840100 	addiu	a0,a0,256
+   22050:	8c450000 	lw	a1,0(v0)
+   22054:	ae02015c 	sw	v0,348(s0)
+   22058:	ae050158 	sw	a1,344(s0)
+   2205c:	aca30004 	sw	v1,4(a1)
+   22060:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   22064:	ac430000 	sw	v1,0(v0)
+   22068:	8e040110 	lw	a0,272(s0)
+   2206c:	24050001 	addiu	a1,zero,1
+   22070:	0c0019b9 	jal	66e4 <atomic_add>
+   22074:	248400a8 	addiu	a0,a0,168
+   22078:	0c00056f 	jal	15bc <arch_onln_cluster_nr>
+   2207c:	00409821 	addu	s3,v0,zero
+   22080:	8e030104 	lw	v1,260(s0)
+   22084:	30630004 	andi	v1,v1,0x4
+   22088:	1060ffa4 	beqz	v1,21f1c <vm_region_dup+0x170>
+   2208c:	24030001 	addiu	v1,zero,1
+   22090:	1663ffa2 	bne	s3,v1,21f1c <vm_region_dup+0x170>
+   22094:	2c420002 	sltiu	v0,v0,2
+   22098:	1440ffa0 	bnez	v0,21f1c <vm_region_dup+0x170>
+   2209c:	00000000 	sll	zero,zero,0x0
+   220a0:	0c007336 	jal	1ccd8 <mapper_set_auto_migrate>
+   220a4:	26040110 	addiu	a0,s0,272
+   220a8:	40047801 	mfc0	a0,$15,1
+   220ac:	3c030004 	lui	v1,0x4
+   220b0:	30840003 	andi	a0,a0,0x3
+   220b4:	00042080 	sll	a0,a0,0x2
+   220b8:	2463c950 	addiu	v1,v1,-14000
+   220bc:	00831821 	addu	v1,a0,v1
+   220c0:	3c040004 	lui	a0,0x4
+   220c4:	8c670000 	lw	a3,0(v1)
+   220c8:	8e490444 	lw	t1,1092(s2)
+   220cc:	8e0300f8 	lw	v1,248(s0)
+   220d0:	8e0800f4 	lw	t0,244(s0)
+   220d4:	8c849100 	lw	a0,-28416(a0)
+   220d8:	3c060003 	lui	a2,0x3
+   220dc:	24c67344 	addiu	a2,a2,29508
+   220e0:	00002821 	addu	a1,zero,zero
+   220e4:	afa90010 	sw	t1,16(sp)
+   220e8:	afa80014 	sw	t0,20(sp)
+   220ec:	afa30018 	sw	v1,24(sp)
+   220f0:	0c0009b0 	jal	26c0 <__fprintk>
+   220f4:	afa2001c 	sw	v0,28(sp)
+   220f8:	080087c7 	j	21f1c <vm_region_dup+0x170>
+   220fc:	00000000 	sll	zero,zero,0x0
+   22100:	080087e7 	j	21f9c <vm_region_dup+0x1f0>
+   22104:	00001021 	addu	v0,zero,zero
+
+00022108 <vm_region_attach>:
+   22108:	8ca20104 	lw	v0,260(a1)
+   2210c:	27bdffe0 	addiu	sp,sp,-32
+   22110:	afb10014 	sw	s1,20(sp)
+   22114:	30420040 	andi	v0,v0,0x40
+   22118:	00a08821 	addu	s1,a1,zero
+   2211c:	afb20018 	sw	s2,24(sp)
+   22120:	afbf001c 	sw	ra,28(sp)
+   22124:	afb00010 	sw	s0,16(sp)
+   22128:	00809021 	addu	s2,a0,zero
+   2212c:	10400038 	beqz	v0,22210 <vm_region_attach+0x108>
+   22130:	ae2400e8 	sw	a0,232(s1)
+   22134:	248500e8 	addiu	a1,a0,232
+   22138:	00a02021 	addu	a0,a1,zero
+   2213c:	8c820000 	lw	v0,0(a0)
+   22140:	8e2700ec 	lw	a3,236(s1)
+   22144:	00003021 	addu	a2,zero,zero
+   22148:	1040000e 	beqz	v0,22184 <vm_region_attach+0x7c>
+   2214c:	00004021 	addu	t0,zero,zero
+   22150:	8c4600f0 	lw	a2,240(v0)
+   22154:	00e6302b 	sltu	a2,a3,a2
+   22158:	10c00028 	beqz	a2,221fc <vm_region_attach+0xf4>
+   2215c:	00401821 	addu	v1,v0,zero
+   22160:	8c4600ec 	lw	a2,236(v0)
+   22164:	00e6302b 	sltu	a2,a3,a2
+   22168:	10c00008 	beqz	a2,2218c <vm_region_attach+0x84>
+   2216c:	00403021 	addu	a2,v0,zero
+   22170:	24440008 	addiu	a0,v0,8
+   22174:	00604021 	addu	t0,v1,zero
+   22178:	8c820000 	lw	v0,0(a0)
+   2217c:	1440fff4 	bnez	v0,22150 <vm_region_attach+0x48>
+   22180:	00000000 	sll	zero,zero,0x0
+   22184:	00c01021 	addu	v0,a2,zero
+   22188:	01001821 	addu	v1,t0,zero
+   2218c:	1060006f 	beqz	v1,2234c <vm_region_attach+0x244>
+   22190:	00000000 	sll	zero,zero,0x0
+   22194:	8c6600ec 	lw	a2,236(v1)
+   22198:	00e6382b 	sltu	a3,a3,a2
+   2219c:	10e0006d 	beqz	a3,22354 <vm_region_attach+0x24c>
+   221a0:	8fbf001c 	lw	ra,28(sp)
+   221a4:	8c6300e4 	lw	v1,228(v1)
+   221a8:	8c670000 	lw	a3,0(v1)
+   221ac:	262600e0 	addiu	a2,s1,224
+   221b0:	ae2300e4 	sw	v1,228(s1)
+   221b4:	ae2700e0 	sw	a3,224(s1)
+   221b8:	ae220000 	sw	v0,0(s1)
+   221bc:	ae200004 	sw	zero,4(s1)
+   221c0:	ae200008 	sw	zero,8(s1)
+   221c4:	ace60004 	sw	a2,4(a3)
+   221c8:	ac910000 	sw	s1,0(a0)
+   221cc:	ac660000 	sw	a2,0(v1)
+   221d0:	0c00c231 	jal	308c4 <rb_insert_color>
+   221d4:	02202021 	addu	a0,s1,zero
+   221d8:	8e2200ec 	lw	v0,236(s1)
+   221dc:	ae42010c 	sw	v0,268(s2)
+   221e0:	00001021 	addu	v0,zero,zero
+   221e4:	8fbf001c 	lw	ra,28(sp)
+   221e8:	8fb20018 	lw	s2,24(sp)
+   221ec:	8fb10014 	lw	s1,20(sp)
+   221f0:	8fb00010 	lw	s0,16(sp)
+   221f4:	03e00008 	jr	ra
+   221f8:	27bd0020 	addiu	sp,sp,32
+   221fc:	01001821 	addu	v1,t0,zero
+   22200:	24440004 	addiu	a0,v0,4
+   22204:	00403021 	addu	a2,v0,zero
+   22208:	0800885e 	j	22178 <vm_region_attach+0x70>
+   2220c:	00604021 	addu	t0,v1,zero
+   22210:	8ca800f0 	lw	t0,240(a1)
+   22214:	8c86010c 	lw	a2,268(a0)
+   22218:	3c098000 	lui	t1,0x8000
+   2221c:	01284823 	subu	t1,t1,t0
+   22220:	0126102b 	sltu	v0,t1,a2
+   22224:	1440ffef 	bnez	v0,221e4 <vm_region_attach+0xdc>
+   22228:	2402000c 	addiu	v0,zero,12
+   2222c:	248500e8 	addiu	a1,a0,232
+   22230:	00a01821 	addu	v1,a1,zero
+   22234:	8ca20000 	lw	v0,0(a1)
+   22238:	00002021 	addu	a0,zero,zero
+   2223c:	1040000e 	beqz	v0,22278 <vm_region_attach+0x170>
+   22240:	00003821 	addu	a3,zero,zero
+   22244:	8c4400f0 	lw	a0,240(v0)
+   22248:	00c4202b 	sltu	a0,a2,a0
+   2224c:	10800018 	beqz	a0,222b0 <vm_region_attach+0x1a8>
+   22250:	00408021 	addu	s0,v0,zero
+   22254:	8c4400ec 	lw	a0,236(v0)
+   22258:	00c4202b 	sltu	a0,a2,a0
+   2225c:	10800008 	beqz	a0,22280 <vm_region_attach+0x178>
+   22260:	00402021 	addu	a0,v0,zero
+   22264:	24430008 	addiu	v1,v0,8
+   22268:	02003821 	addu	a3,s0,zero
+   2226c:	8c620000 	lw	v0,0(v1)
+   22270:	1440fff4 	bnez	v0,22244 <vm_region_attach+0x13c>
+   22274:	00000000 	sll	zero,zero,0x0
+   22278:	00801021 	addu	v0,a0,zero
+   2227c:	00e08021 	addu	s0,a3,zero
+   22280:	12000010 	beqz	s0,222c4 <vm_region_attach+0x1bc>
+   22284:	00c82021 	addu	a0,a2,t0
+   22288:	8e0700ec 	lw	a3,236(s0)
+   2228c:	0087382b 	sltu	a3,a0,a3
+   22290:	14e0000c 	bnez	a3,222c4 <vm_region_attach+0x1bc>
+   22294:	00000000 	sll	zero,zero,0x0
+   22298:	8e0600f0 	lw	a2,240(s0)
+   2229c:	0126102b 	sltu	v0,t1,a2
+   222a0:	1040ffe3 	beqz	v0,22230 <vm_region_attach+0x128>
+   222a4:	2402000c 	addiu	v0,zero,12
+   222a8:	0800887a 	j	221e8 <vm_region_attach+0xe0>
+   222ac:	8fbf001c 	lw	ra,28(sp)
+   222b0:	00e08021 	addu	s0,a3,zero
+   222b4:	24430004 	addiu	v1,v0,4
+   222b8:	00402021 	addu	a0,v0,zero
+   222bc:	0800889b 	j	2226c <vm_region_attach+0x164>
+   222c0:	02003821 	addu	a3,s0,zero
+   222c4:	8e2700f8 	lw	a3,248(s1)
+   222c8:	ae2400f0 	sw	a0,240(s1)
+   222cc:	00c72021 	addu	a0,a2,a3
+   222d0:	ae2400f8 	sw	a0,248(s1)
+   222d4:	ae200004 	sw	zero,4(s1)
+   222d8:	ae200008 	sw	zero,8(s1)
+   222dc:	ae220000 	sw	v0,0(s1)
+   222e0:	ac710000 	sw	s1,0(v1)
+   222e4:	ae2600ec 	sw	a2,236(s1)
+   222e8:	ae2600f4 	sw	a2,244(s1)
+   222ec:	0c00c231 	jal	308c4 <rb_insert_color>
+   222f0:	02202021 	addu	a0,s1,zero
+   222f4:	1200001d 	beqz	s0,2236c <vm_region_attach+0x264>
+   222f8:	262300e0 	addiu	v1,s1,224
+   222fc:	8e2200ec 	lw	v0,236(s1)
+   22300:	8e0300ec 	lw	v1,236(s0)
+   22304:	0043182b 	sltu	v1,v0,v1
+   22308:	10600009 	beqz	v1,22330 <vm_region_attach+0x228>
+   2230c:	262300e0 	addiu	v1,s1,224
+   22310:	8e0300e4 	lw	v1,228(s0)
+   22314:	262400e0 	addiu	a0,s1,224
+   22318:	8c650000 	lw	a1,0(v1)
+   2231c:	ae2300e4 	sw	v1,228(s1)
+   22320:	ae2500e0 	sw	a1,224(s1)
+   22324:	aca40004 	sw	a0,4(a1)
+   22328:	08008877 	j	221dc <vm_region_attach+0xd4>
+   2232c:	ac640000 	sw	a0,0(v1)
+   22330:	8e0400e0 	lw	a0,224(s0)
+   22334:	260500e0 	addiu	a1,s0,224
+   22338:	ae2500e4 	sw	a1,228(s1)
+   2233c:	ae2400e0 	sw	a0,224(s1)
+   22340:	ac830004 	sw	v1,4(a0)
+   22344:	08008877 	j	221dc <vm_region_attach+0xd4>
+   22348:	ae0300e0 	sw	v1,224(s0)
+   2234c:	0800886a 	j	221a8 <vm_region_attach+0xa0>
+   22350:	8e4300f0 	lw	v1,240(s2)
+   22354:	24020011 	addiu	v0,zero,17
+   22358:	8fb20018 	lw	s2,24(sp)
+   2235c:	8fb10014 	lw	s1,20(sp)
+   22360:	8fb00010 	lw	s0,16(sp)
+   22364:	03e00008 	jr	ra
+   22368:	27bd0020 	addiu	sp,sp,32
+   2236c:	8e4200f0 	lw	v0,240(s2)
+   22370:	8c440000 	lw	a0,0(v0)
+   22374:	ae2200e4 	sw	v0,228(s1)
+   22378:	ae2400e0 	sw	a0,224(s1)
+   2237c:	ac830004 	sw	v1,4(a0)
+   22380:	ac430000 	sw	v1,0(v0)
+   22384:	08008877 	j	221dc <vm_region_attach+0xd4>
+   22388:	8e2200ec 	lw	v0,236(s1)
+
+0002238c <vm_region_unmap>:
+   2238c:	27bdffb8 	addiu	sp,sp,-72
+   22390:	afb10030 	sw	s1,48(sp)
+   22394:	afb0002c 	sw	s0,44(sp)
+   22398:	8c9100f4 	lw	s1,244(a0)
+   2239c:	8c9000f8 	lw	s0,248(a0)
+   223a0:	afb50040 	sw	s5,64(sp)
+   223a4:	afb20034 	sw	s2,52(sp)
+   223a8:	8c950104 	lw	s5,260(a0)
+   223ac:	02118023 	subu	s0,s0,s1
+   223b0:	8c9200e8 	lw	s2,232(a0)
+   223b4:	00108302 	srl	s0,s0,0xc
+   223b8:	afbf0044 	sw	ra,68(sp)
+   223bc:	afb4003c 	sw	s4,60(sp)
+   223c0:	afb30038 	sw	s3,56(sp)
+   223c4:	265200d0 	addiu	s2,s2,208
+   223c8:	12000019 	beqz	s0,22430 <vm_region_unmap+0xa4>
+   223cc:	32b50200 	andi	s5,s5,0x200
+   223d0:	27b30010 	addiu	s3,sp,16
+   223d4:	02202821 	addu	a1,s1,zero
+   223d8:	02603021 	addu	a2,s3,zero
+   223dc:	0c000a56 	jal	2958 <pmm_get_page>
+   223e0:	02402021 	addu	a0,s2,zero
+   223e4:	14400004 	bnez	v0,223f8 <vm_region_unmap+0x6c>
+   223e8:	2610ffff 	addiu	s0,s0,-1
+   223ec:	8fa20010 	lw	v0,16(sp)
+   223f0:	04400005 	bltz	v0,22408 <vm_region_unmap+0x7c>
+   223f4:	8fb40014 	lw	s4,20(sp)
+   223f8:	1200000e 	beqz	s0,22434 <vm_region_unmap+0xa8>
+   223fc:	8fbf0044 	lw	ra,68(sp)
+   22400:	080088f5 	j	223d4 <vm_region_unmap+0x48>
+   22404:	26311000 	addiu	s1,s1,4096
+   22408:	0c000a1d 	jal	2874 <pmm_ppn2ppm>
+   2240c:	02802021 	addu	a0,s4,zero
+   22410:	afa00010 	sw	zero,16(sp)
+   22414:	afa00014 	sw	zero,20(sp)
+   22418:	12a0000f 	beqz	s5,22458 <vm_region_unmap+0xcc>
+   2241c:	afa00018 	sw	zero,24(sp)
+   22420:	0c007ff5 	jal	1ffd4 <ppn_refcount_down>
+   22424:	02802021 	addu	a0,s4,zero
+   22428:	1600ffea 	bnez	s0,223d4 <vm_region_unmap+0x48>
+   2242c:	26311000 	addiu	s1,s1,4096
+   22430:	8fbf0044 	lw	ra,68(sp)
+   22434:	00001021 	addu	v0,zero,zero
+   22438:	8fb50040 	lw	s5,64(sp)
+   2243c:	8fb4003c 	lw	s4,60(sp)
+   22440:	8fb30038 	lw	s3,56(sp)
+   22444:	8fb20034 	lw	s2,52(sp)
+   22448:	8fb10030 	lw	s1,48(sp)
+   2244c:	8fb0002c 	lw	s0,44(sp)
+   22450:	03e00008 	jr	ra
+   22454:	27bd0048 	addiu	sp,sp,72
+   22458:	02402021 	addu	a0,s2,zero
+   2245c:	02202821 	addu	a1,s1,zero
+   22460:	0c000c15 	jal	3054 <pmm_set_page>
+   22464:	02603021 	addu	a2,s3,zero
+   22468:	0c007ff5 	jal	1ffd4 <ppn_refcount_down>
+   2246c:	02802021 	addu	a0,s4,zero
+   22470:	0800890a 	j	22428 <vm_region_unmap+0x9c>
+   22474:	00000000 	sll	zero,zero,0x0
+
+00022478 <vm_region_detach>:
+   22478:	27bdffc8 	addiu	sp,sp,-56
+   2247c:	8ca200e4 	lw	v0,228(a1)
+   22480:	8ca300e0 	lw	v1,224(a1)
+   22484:	afb10024 	sw	s1,36(sp)
+   22488:	00808821 	addu	s1,a0,zero
+   2248c:	afb00020 	sw	s0,32(sp)
+   22490:	ac620004 	sw	v0,4(v1)
+   22494:	ac430000 	sw	v1,0(v0)
+   22498:	00a02021 	addu	a0,a1,zero
+   2249c:	00a08021 	addu	s0,a1,zero
+   224a0:	262500e8 	addiu	a1,s1,232
+   224a4:	afbf0034 	sw	ra,52(sp)
+   224a8:	afb40030 	sw	s4,48(sp)
+   224ac:	afb3002c 	sw	s3,44(sp)
+   224b0:	0c00c2a5 	jal	30a94 <rb_erase>
+   224b4:	afb20028 	sw	s2,40(sp)
+   224b8:	8e2200e4 	lw	v0,228(s1)
+   224bc:	1050005f 	beq	v0,s0,2263c <vm_region_detach+0x1c4>
+   224c0:	00000000 	sll	zero,zero,0x0
+   224c4:	8e0300f0 	lw	v1,240(s0)
+   224c8:	8e22010c 	lw	v0,268(s1)
+   224cc:	0062102b 	sltu	v0,v1,v0
+   224d0:	10400003 	beqz	v0,224e0 <vm_region_detach+0x68>
+   224d4:	00000000 	sll	zero,zero,0x0
+   224d8:	8e0200ec 	lw	v0,236(s0)
+   224dc:	ae22010c 	sw	v0,268(s1)
+   224e0:	8e020104 	lw	v0,260(s0)
+   224e4:	30420200 	andi	v0,v0,0x200
+   224e8:	10400046 	beqz	v0,22604 <vm_region_detach+0x18c>
+   224ec:	00000000 	sll	zero,zero,0x0
+   224f0:	26310010 	addiu	s1,s1,16
+   224f4:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   224f8:	02202021 	addu	a0,s1,zero
+   224fc:	8e120104 	lw	s2,260(s0)
+   22500:	32520005 	andi	s2,s2,0x5
+   22504:	3a520005 	xori	s2,s2,0x5
+   22508:	2e520001 	sltiu	s2,s2,1
+   2250c:	1640002d 	bnez	s2,225c4 <vm_region_detach+0x14c>
+   22510:	2405ffff 	addiu	a1,zero,-1
+   22514:	0000a021 	addu	s4,zero,zero
+   22518:	0800894b 	j	2252c <vm_region_detach+0xb4>
+   2251c:	261300a0 	addiu	s3,s0,160
+   22520:	40042002 	mfc0	a0,$4,2
+   22524:	0c004636 	jal	118d8 <sched_yield>
+   22528:	00000000 	sll	zero,zero,0x0
+   2252c:	0c0019d5 	jal	6754 <atomic_get>
+   22530:	02602021 	addu	a0,s3,zero
+   22534:	2c420002 	sltiu	v0,v0,2
+   22538:	1040fff9 	beqz	v0,22520 <vm_region_detach+0xa8>
+   2253c:	00000000 	sll	zero,zero,0x0
+   22540:	8e020140 	lw	v0,320(s0)
+   22544:	10400009 	beqz	v0,2256c <vm_region_detach+0xf4>
+   22548:	2613011c 	addiu	s3,s0,284
+   2254c:	8e020144 	lw	v0,324(s0)
+   22550:	8c420020 	lw	v0,32(v0)
+   22554:	02002821 	addu	a1,s0,zero
+   22558:	0040f809 	jalr	v0
+   2255c:	02602021 	addu	a0,s3,zero
+   22560:	02602021 	addu	a0,s3,zero
+   22564:	0c009f67 	jal	27d9c <vfs_close>
+   22568:	00002821 	addu	a1,zero,zero
+   2256c:	0c0088e3 	jal	2238c <vm_region_unmap>
+   22570:	02002021 	addu	a0,s0,zero
+   22574:	12400003 	beqz	s2,22584 <vm_region_detach+0x10c>
+   22578:	24020001 	addiu	v0,zero,1
+   2257c:	1282002a 	beq	s4,v0,22628 <vm_region_detach+0x1b0>
+   22580:	00000000 	sll	zero,zero,0x0
+   22584:	27a40010 	addiu	a0,sp,16
+   22588:	24020012 	addiu	v0,zero,18
+   2258c:	afa20010 	sw	v0,16(sp)
+   22590:	0c007134 	jal	1c4d0 <kmem_free>
+   22594:	afb0001c 	sw	s0,28(sp)
+   22598:	0c004408 	jal	11020 <rwlock_wrlock>
+   2259c:	02202021 	addu	a0,s1,zero
+   225a0:	8fbf0034 	lw	ra,52(sp)
+   225a4:	00001021 	addu	v0,zero,zero
+   225a8:	8fb40030 	lw	s4,48(sp)
+   225ac:	8fb3002c 	lw	s3,44(sp)
+   225b0:	8fb20028 	lw	s2,40(sp)
+   225b4:	8fb10024 	lw	s1,36(sp)
+   225b8:	8fb00020 	lw	s0,32(sp)
+   225bc:	03e00008 	jr	ra
+   225c0:	27bd0038 	addiu	sp,sp,56
+   225c4:	8e040110 	lw	a0,272(s0)
+   225c8:	0c0019b9 	jal	66e4 <atomic_add>
+   225cc:	248400a8 	addiu	a0,a0,168
+   225d0:	8e040110 	lw	a0,272(s0)
+   225d4:	0040a021 	addu	s4,v0,zero
+   225d8:	0c004408 	jal	11020 <rwlock_wrlock>
+   225dc:	24840100 	addiu	a0,a0,256
+   225e0:	8e030158 	lw	v1,344(s0)
+   225e4:	8e02015c 	lw	v0,348(s0)
+   225e8:	8e040110 	lw	a0,272(s0)
+   225ec:	ac620004 	sw	v0,4(v1)
+   225f0:	ac430000 	sw	v1,0(v0)
+   225f4:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   225f8:	24840100 	addiu	a0,a0,256
+   225fc:	0800894b 	j	2252c <vm_region_detach+0xb4>
+   22600:	261300a0 	addiu	s3,s0,160
+   22604:	8e0200ec 	lw	v0,236(s0)
+   22608:	8e0300f0 	lw	v1,240(s0)
+   2260c:	00022c02 	srl	a1,v0,0x10
+   22610:	00621023 	subu	v0,v1,v0
+   22614:	00023402 	srl	a2,v0,0x10
+   22618:	0c002c0a 	jal	b028 <keysdb_unbind>
+   2261c:	262400f4 	addiu	a0,s1,244
+   22620:	0800893d 	j	224f4 <vm_region_detach+0x7c>
+   22624:	26310010 	addiu	s1,s1,16
+   22628:	26040110 	addiu	a0,s0,272
+   2262c:	0c007901 	jal	1e404 <mapper_destroy>
+   22630:	00002821 	addu	a1,zero,zero
+   22634:	08008962 	j	22588 <vm_region_detach+0x110>
+   22638:	27a40010 	addiu	a0,sp,16
+   2263c:	08008931 	j	224c4 <vm_region_detach+0x4c>
+   22640:	ae2000e4 	sw	zero,228(s1)
+   22644:	24a40010 	addiu	a0,a1,16
+   22648:	3c050003 	lui	a1,0x3
+   2264c:	08003096 	j	c258 <mcs_lock_init>
+   22650:	24a57388 	addiu	a1,a1,29576
+
+00022654 <devfs_create_context>:
+   22654:	8c820004 	lw	v0,4(a0)
+   22658:	3c030008 	lui	v1,0x8
+   2265c:	34420001 	ori	v0,v0,0x1
+   22660:	ac820004 	sw	v0,4(a0)
+   22664:	24020001 	addiu	v0,zero,1
+   22668:	ac820000 	sw	v0,0(a0)
+   2266c:	3c020003 	lui	v0,0x3
+   22670:	244273c8 	addiu	v0,v0,29640
+   22674:	ac820090 	sw	v0,144(a0)
+   22678:	3c020003 	lui	v0,0x3
+   2267c:	24427454 	addiu	v0,v0,29780
+   22680:	ac820094 	sw	v0,148(a0)
+   22684:	3c020003 	lui	v0,0x3
+   22688:	24630330 	addiu	v1,v1,816
+   2268c:	244273ec 	addiu	v0,v0,29676
+   22690:	ac820098 	sw	v0,152(a0)
+   22694:	ac8300b0 	sw	v1,176(a0)
+   22698:	03e00008 	jr	ra
+   2269c:	00001021 	addu	v0,zero,zero
+
+000226a0 <devfs_destroy_context>:
+   226a0:	03e00008 	jr	ra
+   226a4:	00001021 	addu	v0,zero,zero
+
+000226a8 <devfs_write_root>:
+   226a8:	03e00008 	jr	ra
+   226ac:	00001021 	addu	v0,zero,zero
+
+000226b0 <devfs_kmem_context_init>:
+   226b0:	24030008 	addiu	v1,zero,8
+   226b4:	ac830000 	sw	v1,0(a0)
+   226b8:	3c030003 	lui	v1,0x3
+   226bc:	246373a8 	addiu	v1,v1,29608
+   226c0:	24020001 	addiu	v0,zero,1
+   226c4:	ac830004 	sw	v1,4(a0)
+   226c8:	24030004 	addiu	v1,zero,4
+   226cc:	ac820010 	sw	v0,16(a0)
+   226d0:	ac82000c 	sw	v0,12(a0)
+   226d4:	ac830008 	sw	v1,8(a0)
+   226d8:	ac80001c 	sw	zero,28(a0)
+   226dc:	ac800014 	sw	zero,20(a0)
+   226e0:	ac800018 	sw	zero,24(a0)
+   226e4:	03e00008 	jr	ra
+   226e8:	00001021 	addu	v0,zero,zero
+
+000226ec <devfs_read_root>:
+   226ec:	24020001 	addiu	v0,zero,1
+   226f0:	aca20008 	sw	v0,8(a1)
+   226f4:	aca20020 	sw	v0,32(a1)
+   226f8:	00001821 	addu	v1,zero,zero
+   226fc:	00001021 	addu	v0,zero,zero
+   22700:	27bdffe0 	addiu	sp,sp,-32
+   22704:	aca20018 	sw	v0,24(a1)
+   22708:	aca3001c 	sw	v1,28(a1)
+   2270c:	afbf001c 	sw	ra,28(sp)
+   22710:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   22714:	afa50010 	sw	a1,16(sp)
+   22718:	8fa50010 	lw	a1,16(sp)
+   2271c:	8fbf001c 	lw	ra,28(sp)
+   22720:	aca20000 	sw	v0,0(a1)
+   22724:	27bd0020 	addiu	sp,sp,32
+   22728:	03e00008 	jr	ra
+   2272c:	00001021 	addu	v0,zero,zero
+
+00022730 <devfs_register>:
+   22730:	27bdffe0 	addiu	sp,sp,-32
+   22734:	afb10018 	sw	s1,24(sp)
+   22738:	3c110008 	lui	s1,0x8
+   2273c:	afb00014 	sw	s0,20(sp)
+   22740:	00808021 	addu	s0,a0,zero
+   22744:	afbf001c 	sw	ra,28(sp)
+   22748:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2274c:	26240320 	addiu	a0,s1,800
+   22750:	26240320 	addiu	a0,s1,800
+   22754:	8c820014 	lw	v0,20(a0)
+   22758:	8e03008c 	lw	v1,140(s0)
+   2275c:	24420001 	addiu	v0,v0,1
+   22760:	ac820014 	sw	v0,20(a0)
+   22764:	80650000 	lb	a1,0(v1)
+   22768:	10a0001e 	beqz	a1,227e4 <devfs_register+0xb4>
+   2276c:	00001021 	addu	v0,zero,zero
+   22770:	24630001 	addiu	v1,v1,1
+   22774:	00a23026 	xor	a2,a1,v0
+   22778:	80650000 	lb	a1,0(v1)
+   2277c:	14a0fffc 	bnez	a1,22770 <devfs_register+0x40>
+   22780:	00461021 	addu	v0,v0,a2
+   22784:	3c03cccc 	lui	v1,0xcccc
+   22788:	3463cccd 	ori	v1,v1,0xcccd
+   2278c:	00430019 	multu	v0,v1
+   22790:	00001810 	mfhi	v1
+   22794:	000318c2 	srl	v1,v1,0x3
+   22798:	000328c0 	sll	a1,v1,0x3
+   2279c:	00031840 	sll	v1,v1,0x1
+   227a0:	00651821 	addu	v1,v1,a1
+   227a4:	00431823 	subu	v1,v0,v1
+   227a8:	24630004 	addiu	v1,v1,4
+   227ac:	000318c0 	sll	v1,v1,0x3
+   227b0:	00831821 	addu	v1,a0,v1
+   227b4:	8c620004 	lw	v0,4(v1)
+   227b8:	26030094 	addiu	v1,s0,148
+   227bc:	8c450000 	lw	a1,0(v0)
+   227c0:	ae020098 	sw	v0,152(s0)
+   227c4:	ae050094 	sw	a1,148(s0)
+   227c8:	8fbf001c 	lw	ra,28(sp)
+   227cc:	8fb10018 	lw	s1,24(sp)
+   227d0:	8fb00014 	lw	s0,20(sp)
+   227d4:	aca30004 	sw	v1,4(a1)
+   227d8:	ac430000 	sw	v1,0(v0)
+   227dc:	08004b0b 	j	12c2c <spinlock_unlock>
+   227e0:	27bd0020 	addiu	sp,sp,32
+   227e4:	080089ea 	j	227a8 <devfs_register+0x78>
+   227e8:	00001821 	addu	v1,zero,zero
+
+000227ec <devfs_root_init>:
+   227ec:	27bdffe8 	addiu	sp,sp,-24
+   227f0:	afb00010 	sw	s0,16(sp)
+   227f4:	3c050003 	lui	a1,0x3
+   227f8:	3c100008 	lui	s0,0x8
+   227fc:	24a573b8 	addiu	a1,a1,29624
+   22800:	afbf0014 	sw	ra,20(sp)
+   22804:	0c004a24 	jal	12890 <spinlock_init>
+   22808:	26040320 	addiu	a0,s0,800
+   2280c:	3c020003 	lui	v0,0x3
+   22810:	26100320 	addiu	s0,s0,800
+   22814:	244273c4 	addiu	v0,v0,29636
+   22818:	3c030008 	lui	v1,0x8
+   2281c:	ae020010 	sw	v0,16(s0)
+   22820:	ae000014 	sw	zero,20(s0)
+   22824:	24630340 	addiu	v1,v1,832
+   22828:	00001021 	addu	v0,zero,zero
+   2282c:	2405000a 	addiu	a1,zero,10
+   22830:	24440004 	addiu	a0,v0,4
+   22834:	000420c0 	sll	a0,a0,0x3
+   22838:	02042021 	addu	a0,s0,a0
+   2283c:	24420001 	addiu	v0,v0,1
+   22840:	ac640004 	sw	a0,4(v1)
+   22844:	ac640000 	sw	a0,0(v1)
+   22848:	1445fff9 	bne	v0,a1,22830 <devfs_root_init+0x44>
+   2284c:	24630008 	addiu	v1,v1,8
+   22850:	8fbf0014 	lw	ra,20(sp)
+   22854:	8fb00010 	lw	s0,16(sp)
+   22858:	03e00008 	jr	ra
+   2285c:	27bd0018 	addiu	sp,sp,24
+
+00022860 <devfs_kmem_file_init>:
+   22860:	24020009 	addiu	v0,zero,9
+   22864:	ac820000 	sw	v0,0(a0)
+   22868:	3c020003 	lui	v0,0x3
+   2286c:	244273dc 	addiu	v0,v0,29660
+   22870:	ac820004 	sw	v0,4(a0)
+   22874:	24020010 	addiu	v0,zero,16
+   22878:	ac820008 	sw	v0,8(a0)
+   2287c:	24020002 	addiu	v0,zero,2
+   22880:	ac82000c 	sw	v0,12(a0)
+   22884:	24020003 	addiu	v0,zero,3
+   22888:	ac820010 	sw	v0,16(a0)
+   2288c:	ac80001c 	sw	zero,28(a0)
+   22890:	ac800014 	sw	zero,20(a0)
+   22894:	ac800018 	sw	zero,24(a0)
+   22898:	03e00008 	jr	ra
+   2289c:	00001021 	addu	v0,zero,zero
+
+000228a0 <devfs_read>:
+   228a0:	27bdfd80 	addiu	sp,sp,-640
+   228a4:	afbf027c 	sw	ra,636(sp)
+   228a8:	afb20278 	sw	s2,632(sp)
+   228ac:	afb10274 	sw	s1,628(sp)
+   228b0:	afb00270 	sw	s0,624(sp)
+   228b4:	8c830038 	lw	v1,56(a0)
+   228b8:	27b1006c 	addiu	s1,sp,108
+   228bc:	24020200 	addiu	v0,zero,512
+   228c0:	afa40020 	sw	a0,32(sp)
+   228c4:	afb10014 	sw	s1,20(sp)
+   228c8:	afa20018 	sw	v0,24(sp)
+   228cc:	afa0001c 	sw	zero,28(sp)
+   228d0:	8c620034 	lw	v0,52(v1)
+   228d4:	00a09021 	addu	s2,a1,zero
+   228d8:	00602021 	addu	a0,v1,zero
+   228dc:	0040f809 	jalr	v0
+   228e0:	27a50010 	addiu	a1,sp,16
+   228e4:	00408021 	addu	s0,v0,zero
+   228e8:	8e420008 	lw	v0,8(s2)
+   228ec:	02402021 	addu	a0,s2,zero
+   228f0:	02202821 	addu	a1,s1,zero
+   228f4:	0040f809 	jalr	v0
+   228f8:	02003021 	addu	a2,s0,zero
+   228fc:	8fbf027c 	lw	ra,636(sp)
+   22900:	02001021 	addu	v0,s0,zero
+   22904:	8fb20278 	lw	s2,632(sp)
+   22908:	8fb10274 	lw	s1,628(sp)
+   2290c:	8fb00270 	lw	s0,624(sp)
+   22910:	03e00008 	jr	ra
+   22914:	27bd0280 	addiu	sp,sp,640
+
+00022918 <devfs_write>:
+   22918:	27bdfd78 	addiu	sp,sp,-648
+   2291c:	afbf0284 	sw	ra,644(sp)
+   22920:	afb30280 	sw	s3,640(sp)
+   22924:	afb2027c 	sw	s2,636(sp)
+   22928:	afb00274 	sw	s0,628(sp)
+   2292c:	afb10278 	sw	s1,632(sp)
+   22930:	00a08021 	addu	s0,a1,zero
+   22934:	27b3006c 	addiu	s3,sp,108
+   22938:	8ca2000c 	lw	v0,12(a1)
+   2293c:	00809021 	addu	s2,a0,zero
+   22940:	02602821 	addu	a1,s3,zero
+   22944:	02002021 	addu	a0,s0,zero
+   22948:	24060200 	addiu	a2,zero,512
+   2294c:	0040f809 	jalr	v0
+   22950:	8e510038 	lw	s1,56(s2)
+   22954:	8e020004 	lw	v0,4(s0)
+   22958:	afb30010 	sw	s3,16(sp)
+   2295c:	afb20020 	sw	s2,32(sp)
+   22960:	afa20018 	sw	v0,24(sp)
+   22964:	afa0001c 	sw	zero,28(sp)
+   22968:	8e220038 	lw	v0,56(s1)
+   2296c:	02202021 	addu	a0,s1,zero
+   22970:	0040f809 	jalr	v0
+   22974:	27a50010 	addiu	a1,sp,16
+   22978:	8fbf0284 	lw	ra,644(sp)
+   2297c:	8fb30280 	lw	s3,640(sp)
+   22980:	8fb2027c 	lw	s2,636(sp)
+   22984:	8fb10278 	lw	s1,632(sp)
+   22988:	8fb00274 	lw	s0,628(sp)
+   2298c:	03e00008 	jr	ra
+   22990:	27bd0288 	addiu	sp,sp,648
+
+00022994 <devfs_lseek>:
+   22994:	8c820110 	lw	v0,272(a0)
+   22998:	27bdff88 	addiu	sp,sp,-120
+   2299c:	8c430210 	lw	v1,528(v0)
+   229a0:	afbf0074 	sw	ra,116(sp)
+   229a4:	8c620040 	lw	v0,64(v1)
+   229a8:	10400007 	beqz	v0,229c8 <devfs_lseek+0x34>
+   229ac:	27a50010 	addiu	a1,sp,16
+   229b0:	afa40020 	sw	a0,32(sp)
+   229b4:	0040f809 	jalr	v0
+   229b8:	00602021 	addu	a0,v1,zero
+   229bc:	8fbf0074 	lw	ra,116(sp)
+   229c0:	03e00008 	jr	ra
+   229c4:	27bd0078 	addiu	sp,sp,120
+   229c8:	8fbf0074 	lw	ra,116(sp)
+   229cc:	2402007e 	addiu	v0,zero,126
+   229d0:	03e00008 	jr	ra
+   229d4:	27bd0078 	addiu	sp,sp,120
+
+000229d8 <devfs_close>:
+   229d8:	8c820110 	lw	v0,272(a0)
+   229dc:	27bdff88 	addiu	sp,sp,-120
+   229e0:	8c430008 	lw	v1,8(v0)
+   229e4:	30630001 	andi	v1,v1,0x1
+   229e8:	1460000b 	bnez	v1,22a18 <devfs_close+0x40>
+   229ec:	afbf0074 	sw	ra,116(sp)
+   229f0:	8c430210 	lw	v1,528(v0)
+   229f4:	8c62003c 	lw	v0,60(v1)
+   229f8:	10400007 	beqz	v0,22a18 <devfs_close+0x40>
+   229fc:	27a50010 	addiu	a1,sp,16
+   22a00:	afa40020 	sw	a0,32(sp)
+   22a04:	0040f809 	jalr	v0
+   22a08:	00602021 	addu	a0,v1,zero
+   22a0c:	8fbf0074 	lw	ra,116(sp)
+   22a10:	03e00008 	jr	ra
+   22a14:	27bd0078 	addiu	sp,sp,120
+   22a18:	8fbf0074 	lw	ra,116(sp)
+   22a1c:	00001021 	addu	v0,zero,zero
+   22a20:	03e00008 	jr	ra
+   22a24:	27bd0078 	addiu	sp,sp,120
+
+00022a28 <devfs_mmap>:
+   22a28:	27bdff88 	addiu	sp,sp,-120
+   22a2c:	afbf0074 	sw	ra,116(sp)
+   22a30:	8c830038 	lw	v1,56(a0)
+   22a34:	8c620044 	lw	v0,68(v1)
+   22a38:	1040000a 	beqz	v0,22a64 <devfs_mmap+0x3c>
+   22a3c:	8fbf0074 	lw	ra,116(sp)
+   22a40:	afa40020 	sw	a0,32(sp)
+   22a44:	afa50024 	sw	a1,36(sp)
+   22a48:	afa0001c 	sw	zero,28(sp)
+   22a4c:	27a50010 	addiu	a1,sp,16
+   22a50:	0040f809 	jalr	v0
+   22a54:	00602021 	addu	a0,v1,zero
+   22a58:	8fbf0074 	lw	ra,116(sp)
+   22a5c:	03e00008 	jr	ra
+   22a60:	27bd0078 	addiu	sp,sp,120
+   22a64:	24020013 	addiu	v0,zero,19
+   22a68:	03e00008 	jr	ra
+   22a6c:	27bd0078 	addiu	sp,sp,120
+
+00022a70 <devfs_munmap>:
+   22a70:	27bdff88 	addiu	sp,sp,-120
+   22a74:	afbf0074 	sw	ra,116(sp)
+   22a78:	8c830038 	lw	v1,56(a0)
+   22a7c:	8c620048 	lw	v0,72(v1)
+   22a80:	1040000a 	beqz	v0,22aac <devfs_munmap+0x3c>
+   22a84:	8fbf0074 	lw	ra,116(sp)
+   22a88:	afa40020 	sw	a0,32(sp)
+   22a8c:	afa50024 	sw	a1,36(sp)
+   22a90:	afa0001c 	sw	zero,28(sp)
+   22a94:	27a50010 	addiu	a1,sp,16
+   22a98:	0040f809 	jalr	v0
+   22a9c:	00602021 	addu	a0,v1,zero
+   22aa0:	8fbf0074 	lw	ra,116(sp)
+   22aa4:	03e00008 	jr	ra
+   22aa8:	27bd0078 	addiu	sp,sp,120
+   22aac:	24020013 	addiu	v0,zero,19
+   22ab0:	03e00008 	jr	ra
+   22ab4:	27bd0078 	addiu	sp,sp,120
+
+00022ab8 <devfs_readdir>:
+   22ab8:	8c820118 	lw	v0,280(a0)
+   22abc:	27bdffe0 	addiu	sp,sp,-32
+   22ac0:	afb00014 	sw	s0,20(sp)
+   22ac4:	afbf001c 	sw	ra,28(sp)
+   22ac8:	afb10018 	sw	s1,24(sp)
+   22acc:	10400041 	beqz	v0,22bd4 <devfs_readdir+0x11c>
+   22ad0:	00a08021 	addu	s0,a1,zero
+   22ad4:	8c430004 	lw	v1,4(v0)
+   22ad8:	10600021 	beqz	v1,22b60 <devfs_readdir+0xa8>
+   22adc:	3c060008 	lui	a2,0x8
+   22ae0:	8c450000 	lw	a1,0(v0)
+   22ae4:	24a40004 	addiu	a0,a1,4
+   22ae8:	000420c0 	sll	a0,a0,0x3
+   22aec:	24c60320 	addiu	a2,a2,800
+   22af0:	00c42021 	addu	a0,a2,a0
+   22af4:	8c870000 	lw	a3,0(a0)
+   22af8:	1087001f 	beq	a0,a3,22b78 <devfs_readdir+0xc0>
+   22afc:	00000000 	sll	zero,zero,0x0
+   22b00:	8c670008 	lw	a3,8(v1)
+   22b04:	1087001c 	beq	a0,a3,22b78 <devfs_readdir+0xc0>
+   22b08:	00000000 	sll	zero,zero,0x0
+   22b0c:	10e0001a 	beqz	a3,22b78 <devfs_readdir+0xc0>
+   22b10:	24e7fff8 	addiu	a3,a3,-8
+   22b14:	ac470004 	sw	a3,4(v0)
+   22b18:	2471ff74 	addiu	s1,v1,-140
+   22b1c:	8e250014 	lw	a1,20(s1)
+   22b20:	24040004 	addiu	a0,zero,4
+   22b24:	38a50001 	xori	a1,a1,0x1
+   22b28:	24020008 	addiu	v0,zero,8
+   22b2c:	0085100b 	movn	v0,a0,a1
+   22b30:	8c650000 	lw	a1,0(v1)
+   22b34:	ae020004 	sw	v0,4(s0)
+   22b38:	0c00c4a9 	jal	312a4 <strcpy>
+   22b3c:	26040008 	addiu	a0,s0,8
+   22b40:	8e230070 	lw	v1,112(s1)
+   22b44:	00001021 	addu	v0,zero,zero
+   22b48:	ae030000 	sw	v1,0(s0)
+   22b4c:	8fbf001c 	lw	ra,28(sp)
+   22b50:	8fb10018 	lw	s1,24(sp)
+   22b54:	8fb00014 	lw	s0,20(sp)
+   22b58:	03e00008 	jr	ra
+   22b5c:	27bd0020 	addiu	sp,sp,32
+   22b60:	8fbf001c 	lw	ra,28(sp)
+   22b64:	2402007d 	addiu	v0,zero,125
+   22b68:	8fb10018 	lw	s1,24(sp)
+   22b6c:	8fb00014 	lw	s0,20(sp)
+   22b70:	03e00008 	jr	ra
+   22b74:	27bd0020 	addiu	sp,sp,32
+   22b78:	24a40001 	addiu	a0,a1,1
+   22b7c:	2c87000a 	sltiu	a3,a0,10
+   22b80:	10e00012 	beqz	a3,22bcc <devfs_readdir+0x114>
+   22b84:	24a80005 	addiu	t0,a1,5
+   22b88:	000840c0 	sll	t0,t0,0x3
+   22b8c:	00c84021 	addu	t0,a2,t0
+   22b90:	8d070000 	lw	a3,0(t0)
+   22b94:	14e80011 	bne	a3,t0,22bdc <devfs_readdir+0x124>
+   22b98:	24a50006 	addiu	a1,a1,6
+   22b9c:	000528c0 	sll	a1,a1,0x3
+   22ba0:	00c52821 	addu	a1,a2,a1
+   22ba4:	08008aee 	j	22bb8 <devfs_readdir+0x100>
+   22ba8:	2409000a 	addiu	t1,zero,10
+   22bac:	8ca70000 	lw	a3,0(a1)
+   22bb0:	14e8000a 	bne	a3,t0,22bdc <devfs_readdir+0x124>
+   22bb4:	24a50008 	addiu	a1,a1,8
+   22bb8:	24840001 	addiu	a0,a0,1
+   22bbc:	24870004 	addiu	a3,a0,4
+   22bc0:	000738c0 	sll	a3,a3,0x3
+   22bc4:	1489fff9 	bne	a0,t1,22bac <devfs_readdir+0xf4>
+   22bc8:	00c74021 	addu	t0,a2,a3
+   22bcc:	08008ac6 	j	22b18 <devfs_readdir+0x60>
+   22bd0:	ac400004 	sw	zero,4(v0)
+   22bd4:	08008ad3 	j	22b4c <devfs_readdir+0x94>
+   22bd8:	24020014 	addiu	v0,zero,20
+   22bdc:	24e7fff8 	addiu	a3,a3,-8
+   22be0:	ac470004 	sw	a3,4(v0)
+   22be4:	08008ac6 	j	22b18 <devfs_readdir+0x60>
+   22be8:	ac440000 	sw	a0,0(v0)
+
+00022bec <devfs_release>:
+   22bec:	8c820118 	lw	v0,280(a0)
+   22bf0:	27bdffd8 	addiu	sp,sp,-40
+   22bf4:	afb00020 	sw	s0,32(sp)
+   22bf8:	afbf0024 	sw	ra,36(sp)
+   22bfc:	10400007 	beqz	v0,22c1c <devfs_release+0x30>
+   22c00:	00808021 	addu	s0,a0,zero
+   22c04:	24030009 	addiu	v1,zero,9
+   22c08:	27a40010 	addiu	a0,sp,16
+   22c0c:	afa30010 	sw	v1,16(sp)
+   22c10:	0c007134 	jal	1c4d0 <kmem_free>
+   22c14:	afa2001c 	sw	v0,28(sp)
+   22c18:	ae000118 	sw	zero,280(s0)
+   22c1c:	8fbf0024 	lw	ra,36(sp)
+   22c20:	00001021 	addu	v0,zero,zero
+   22c24:	8fb00020 	lw	s0,32(sp)
+   22c28:	03e00008 	jr	ra
+   22c2c:	27bd0028 	addiu	sp,sp,40
+
+00022c30 <devfs_open>:
+   22c30:	8c820110 	lw	v0,272(a0)
+   22c34:	27bdff70 	addiu	sp,sp,-144
+   22c38:	afb00080 	sw	s0,128(sp)
+   22c3c:	00808021 	addu	s0,a0,zero
+   22c40:	8c440008 	lw	a0,8(v0)
+   22c44:	afb20088 	sw	s2,136(sp)
+   22c48:	00a09021 	addu	s2,a1,zero
+   22c4c:	30850001 	andi	a1,a0,0x1
+   22c50:	afb10084 	sw	s1,132(sp)
+   22c54:	afbf008c 	sw	ra,140(sp)
+   22c58:	8e030118 	lw	v1,280(s0)
+   22c5c:	10a0001d 	beqz	a1,22cd4 <devfs_open+0xa4>
+   22c60:	8c5101c0 	lw	s1,448(v0)
+   22c64:	1060003e 	beqz	v1,22d60 <devfs_open+0x130>
+   22c68:	00601021 	addu	v0,v1,zero
+   22c6c:	3c040008 	lui	a0,0x8
+   22c70:	3c070008 	lui	a3,0x8
+   22c74:	24840340 	addiu	a0,a0,832
+   22c78:	24e70320 	addiu	a3,a3,800
+   22c7c:	00001821 	addu	v1,zero,zero
+   22c80:	2408000a 	addiu	t0,zero,10
+   22c84:	24660004 	addiu	a2,v1,4
+   22c88:	000630c0 	sll	a2,a2,0x3
+   22c8c:	8c850000 	lw	a1,0(a0)
+   22c90:	00e63021 	addu	a2,a3,a2
+   22c94:	14a6002c 	bne	a1,a2,22d48 <devfs_open+0x118>
+   22c98:	00000000 	sll	zero,zero,0x0
+   22c9c:	24630001 	addiu	v1,v1,1
+   22ca0:	1468fff8 	bne	v1,t0,22c84 <devfs_open+0x54>
+   22ca4:	24840008 	addiu	a0,a0,8
+   22ca8:	ac400004 	sw	zero,4(v0)
+   22cac:	263100b0 	addiu	s1,s1,176
+   22cb0:	ae020118 	sw	v0,280(s0)
+   22cb4:	ac51000c 	sw	s1,12(v0)
+   22cb8:	00001021 	addu	v0,zero,zero
+   22cbc:	8fbf008c 	lw	ra,140(sp)
+   22cc0:	8fb20088 	lw	s2,136(sp)
+   22cc4:	8fb10084 	lw	s1,132(sp)
+   22cc8:	8fb00080 	lw	s0,128(sp)
+   22ccc:	03e00008 	jr	ra
+   22cd0:	27bd0090 	addiu	sp,sp,144
+   22cd4:	8c510210 	lw	s1,528(v0)
+   22cd8:	24050002 	addiu	a1,zero,2
+   22cdc:	8e230014 	lw	v1,20(s1)
+   22ce0:	1065001d 	beq	v1,a1,22d58 <devfs_open+0x128>
+   22ce4:	00000000 	sll	zero,zero,0x0
+   22ce8:	24050001 	addiu	a1,zero,1
+   22cec:	10650013 	beq	v1,a1,22d3c <devfs_open+0x10c>
+   22cf0:	00000000 	sll	zero,zero,0x0
+   22cf4:	34840004 	ori	a0,a0,0x4
+   22cf8:	ac440008 	sw	a0,8(v0)
+   22cfc:	8e220030 	lw	v0,48(s1)
+   22d00:	10400006 	beqz	v0,22d1c <devfs_open+0xec>
+   22d04:	02202021 	addu	a0,s1,zero
+   22d08:	afb00030 	sw	s0,48(sp)
+   22d0c:	0040f809 	jalr	v0
+   22d10:	27a50020 	addiu	a1,sp,32
+   22d14:	1440ffea 	bnez	v0,22cc0 <devfs_open+0x90>
+   22d18:	8fbf008c 	lw	ra,140(sp)
+   22d1c:	ae510000 	sw	s1,0(s2)
+   22d20:	8fbf008c 	lw	ra,140(sp)
+   22d24:	00001021 	addu	v0,zero,zero
+   22d28:	8fb20088 	lw	s2,136(sp)
+   22d2c:	8fb10084 	lw	s1,132(sp)
+   22d30:	8fb00080 	lw	s0,128(sp)
+   22d34:	03e00008 	jr	ra
+   22d38:	27bd0090 	addiu	sp,sp,144
+   22d3c:	34840008 	ori	a0,a0,0x8
+   22d40:	08008b3f 	j	22cfc <devfs_open+0xcc>
+   22d44:	ac440008 	sw	a0,8(v0)
+   22d48:	24a5fff8 	addiu	a1,a1,-8
+   22d4c:	ac430000 	sw	v1,0(v0)
+   22d50:	08008b2b 	j	22cac <devfs_open+0x7c>
+   22d54:	ac450004 	sw	a1,4(v0)
+   22d58:	08008b2f 	j	22cbc <devfs_open+0x8c>
+   22d5c:	24020001 	addiu	v0,zero,1
+   22d60:	24020009 	addiu	v0,zero,9
+   22d64:	afa20010 	sw	v0,16(sp)
+   22d68:	24020010 	addiu	v0,zero,16
+   22d6c:	afa20014 	sw	v0,20(sp)
+   22d70:	3c020011 	lui	v0,0x11
+   22d74:	34420020 	ori	v0,v0,0x20
+   22d78:	27a40010 	addiu	a0,sp,16
+   22d7c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   22d80:	afa20018 	sw	v0,24(sp)
+   22d84:	1440ffb9 	bnez	v0,22c6c <devfs_open+0x3c>
+   22d88:	00000000 	sll	zero,zero,0x0
+   22d8c:	08008b2f 	j	22cbc <devfs_open+0x8c>
+   22d90:	2402000c 	addiu	v0,zero,12
+
+00022d94 <devfs_init_node>:
+   22d94:	ac800210 	sw	zero,528(a0)
+   22d98:	03e00008 	jr	ra
+   22d9c:	00001021 	addu	v0,zero,zero
+
+00022da0 <devfs_release_node>:
+   22da0:	ac800210 	sw	zero,528(a0)
+   22da4:	03e00008 	jr	ra
+   22da8:	00001021 	addu	v0,zero,zero
+
+00022dac <devfs_create_node>:
+   22dac:	03e00008 	jr	ra
+   22db0:	2402007e 	addiu	v0,zero,126
+
+00022db4 <devfs_stat_node>:
+   22db4:	8c880020 	lw	t0,32(a0)
+   22db8:	8c830008 	lw	v1,8(a0)
+   22dbc:	8c820210 	lw	v0,528(a0)
+   22dc0:	8c860018 	lw	a2,24(a0)
+   22dc4:	8c87001c 	lw	a3,28(a0)
+   22dc8:	ac8801dc 	sw	t0,476(a0)
+   22dcc:	30650001 	andi	a1,v1,0x1
+   22dd0:	24080001 	addiu	t0,zero,1
+   22dd4:	ac8201d4 	sw	v0,468(a0)
+   22dd8:	ac8801e8 	sw	t0,488(a0)
+   22ddc:	ac8601f0 	sw	a2,496(a0)
+   22de0:	ac8701f4 	sw	a3,500(a0)
+   22de4:	ac8201d0 	sw	v0,464(a0)
+   22de8:	ac8001e0 	sw	zero,480(a0)
+   22dec:	ac8001e4 	sw	zero,484(a0)
+   22df0:	ac8001f8 	sw	zero,504(a0)
+   22df4:	ac8001fc 	sw	zero,508(a0)
+   22df8:	ac800200 	sw	zero,512(a0)
+   22dfc:	ac800204 	sw	zero,516(a0)
+   22e00:	14a00012 	bnez	a1,22e4c <devfs_stat_node+0x98>
+   22e04:	ac800208 	sw	zero,520(a0)
+   22e08:	30620202 	andi	v0,v1,0x202
+   22e0c:	1440000b 	bnez	v0,22e3c <devfs_stat_node+0x88>
+   22e10:	00000000 	sll	zero,zero,0x0
+   22e14:	30620004 	andi	v0,v1,0x4
+   22e18:	14400010 	bnez	v0,22e5c <devfs_stat_node+0xa8>
+   22e1c:	00000000 	sll	zero,zero,0x0
+   22e20:	30630008 	andi	v1,v1,0x8
+   22e24:	3c020006 	lui	v0,0x6
+   22e28:	0003100a 	movz	v0,zero,v1
+   22e2c:	00401821 	addu	v1,v0,zero
+   22e30:	ac8201d8 	sw	v0,472(a0)
+   22e34:	03e00008 	jr	ra
+   22e38:	00001021 	addu	v0,zero,zero
+   22e3c:	3c030001 	lui	v1,0x1
+   22e40:	ac8301d8 	sw	v1,472(a0)
+   22e44:	03e00008 	jr	ra
+   22e48:	00001021 	addu	v0,zero,zero
+   22e4c:	3c030004 	lui	v1,0x4
+   22e50:	ac8301d8 	sw	v1,472(a0)
+   22e54:	03e00008 	jr	ra
+   22e58:	00001021 	addu	v0,zero,zero
+   22e5c:	08008b90 	j	22e40 <devfs_stat_node+0x8c>
+   22e60:	3c030002 	lui	v1,0x2
+
+00022e64 <devfs_write_node>:
+   22e64:	03e00008 	jr	ra
+   22e68:	00001021 	addu	v0,zero,zero
+
+00022e6c <devfs_unlink_node>:
+   22e6c:	03e00008 	jr	ra
+   22e70:	2402007e 	addiu	v0,zero,126
+
+00022e74 <devfs_inode_create>:
+   22e74:	27bdffc8 	addiu	sp,sp,-56
+   22e78:	afb00024 	sw	s0,36(sp)
+   22e7c:	00808021 	addu	s0,a0,zero
+   22e80:	8c84011c 	lw	a0,284(a0)
+   22e84:	afb10028 	sw	s1,40(sp)
+   22e88:	afa50010 	sw	a1,16(sp)
+   22e8c:	afa60014 	sw	a2,20(sp)
+   22e90:	afa70018 	sw	a3,24(sp)
+   22e94:	afbf0034 	sw	ra,52(sp)
+   22e98:	afb30030 	sw	s3,48(sp)
+   22e9c:	0c00aad6 	jal	2ab58 <vfs_inode_new>
+   22ea0:	afb2002c 	sw	s2,44(sp)
+   22ea4:	00408821 	addu	s1,v0,zero
+   22ea8:	8fa50010 	lw	a1,16(sp)
+   22eac:	8fa60014 	lw	a2,20(sp)
+   22eb0:	10400023 	beqz	v0,22f40 <devfs_inode_create+0xcc>
+   22eb4:	8fa70018 	lw	a3,24(sp)
+   22eb8:	24020001 	addiu	v0,zero,1
+   22ebc:	ae220020 	sw	v0,32(s1)
+   22ec0:	8e020100 	lw	v0,256(s0)
+   22ec4:	3c120004 	lui	s2,0x4
+   22ec8:	ae260210 	sw	a2,528(s1)
+   22ecc:	ae270018 	sw	a3,24(s1)
+   22ed0:	ae250068 	sw	a1,104(s1)
+   22ed4:	ae220008 	sw	v0,8(s1)
+   22ed8:	ae20001c 	sw	zero,28(s1)
+   22edc:	2653c960 	addiu	s3,s2,-13984
+   22ee0:	8a620003 	lwl	v0,3(s3)
+   22ee4:	8ca30034 	lw	v1,52(a1)
+   22ee8:	9a42c960 	lwr	v0,-13984(s2)
+   22eec:	8e04011c 	lw	a0,284(s0)
+   22ef0:	ae230070 	sw	v1,112(s1)
+   22ef4:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   22ef8:	a622006c 	sh	v0,108(s1)
+   22efc:	ae220000 	sw	v0,0(s1)
+   22f00:	0c00ac3b 	jal	2b0ec <vfs_icache_add>
+   22f04:	02202021 	addu	a0,s1,zero
+   22f08:	ae110110 	sw	s1,272(s0)
+   22f0c:	8a620003 	lwl	v0,3(s3)
+   22f10:	8e230034 	lw	v1,52(s1)
+   22f14:	9a42c960 	lwr	v0,-13984(s2)
+   22f18:	8fbf0034 	lw	ra,52(sp)
+   22f1c:	a6020114 	sh	v0,276(s0)
+   22f20:	ae030118 	sw	v1,280(s0)
+   22f24:	00001021 	addu	v0,zero,zero
+   22f28:	8fb30030 	lw	s3,48(sp)
+   22f2c:	8fb2002c 	lw	s2,44(sp)
+   22f30:	8fb10028 	lw	s1,40(sp)
+   22f34:	8fb00024 	lw	s0,36(sp)
+   22f38:	03e00008 	jr	ra
+   22f3c:	27bd0038 	addiu	sp,sp,56
+   22f40:	8fbf0034 	lw	ra,52(sp)
+   22f44:	2402000c 	addiu	v0,zero,12
+   22f48:	8fb30030 	lw	s3,48(sp)
+   22f4c:	8fb2002c 	lw	s2,44(sp)
+   22f50:	8fb10028 	lw	s1,40(sp)
+   22f54:	8fb00024 	lw	s0,36(sp)
+   22f58:	03e00008 	jr	ra
+   22f5c:	27bd0038 	addiu	sp,sp,56
+
+00022f60 <devfs_lookup_node>:
+   22f60:	8c820008 	lw	v0,8(a0)
+   22f64:	27bdffb0 	addiu	sp,sp,-80
+   22f68:	30420001 	andi	v0,v0,0x1
+   22f6c:	afb20040 	sw	s2,64(sp)
+   22f70:	afb1003c 	sw	s1,60(sp)
+   22f74:	afbf004c 	sw	ra,76(sp)
+   22f78:	afb40048 	sw	s4,72(sp)
+   22f7c:	afb30044 	sw	s3,68(sp)
+   22f80:	afb00038 	sw	s0,56(sp)
+   22f84:	00809021 	addu	s2,a0,zero
+   22f88:	10400041 	beqz	v0,23090 <devfs_lookup_node+0x130>
+   22f8c:	00a08821 	addu	s1,a1,zero
+   22f90:	80a30000 	lb	v1,0(a1)
+   22f94:	10600010 	beqz	v1,22fd8 <devfs_lookup_node+0x78>
+   22f98:	00a02021 	addu	a0,a1,zero
+   22f9c:	00001021 	addu	v0,zero,zero
+   22fa0:	24840001 	addiu	a0,a0,1
+   22fa4:	00622826 	xor	a1,v1,v0
+   22fa8:	80830000 	lb	v1,0(a0)
+   22fac:	1460fffc 	bnez	v1,22fa0 <devfs_lookup_node+0x40>
+   22fb0:	00451021 	addu	v0,v0,a1
+   22fb4:	3c03cccc 	lui	v1,0xcccc
+   22fb8:	3463cccd 	ori	v1,v1,0xcccd
+   22fbc:	00430019 	multu	v0,v1
+   22fc0:	00001810 	mfhi	v1
+   22fc4:	000318c2 	srl	v1,v1,0x3
+   22fc8:	000320c0 	sll	a0,v1,0x3
+   22fcc:	00031840 	sll	v1,v1,0x1
+   22fd0:	00641821 	addu	v1,v1,a0
+   22fd4:	00431823 	subu	v1,v0,v1
+   22fd8:	24630004 	addiu	v1,v1,4
+   22fdc:	3c020008 	lui	v0,0x8
+   22fe0:	0003a0c0 	sll	s4,v1,0x3
+   22fe4:	24420320 	addiu	v0,v0,800
+   22fe8:	0282a021 	addu	s4,s4,v0
+   22fec:	8e930000 	lw	s3,0(s4)
+   22ff0:	16740007 	bne	s3,s4,23010 <devfs_lookup_node+0xb0>
+   22ff4:	8e700000 	lw	s0,0(s3)
+   22ff8:	08008c39 	j	230e4 <devfs_lookup_node+0x184>
+   22ffc:	8fbf004c 	lw	ra,76(sp)
+   23000:	02009821 	addu	s3,s0,zero
+   23004:	12140036 	beq	s0,s4,230e0 <devfs_lookup_node+0x180>
+   23008:	8e020000 	lw	v0,0(s0)
+   2300c:	00408021 	addu	s0,v0,zero
+   23010:	8e64fff8 	lw	a0,-8(s3)
+   23014:	0c00c445 	jal	31114 <strcmp>
+   23018:	02202821 	addu	a1,s1,zero
+   2301c:	1440fff8 	bnez	v0,23000 <devfs_lookup_node+0xa0>
+   23020:	2666ff6c 	addiu	a2,s3,-148
+   23024:	8cc20050 	lw	v0,80(a2)
+   23028:	00c02021 	addu	a0,a2,zero
+   2302c:	afa60030 	sw	a2,48(sp)
+   23030:	0040f809 	jalr	v0
+   23034:	27a50010 	addiu	a1,sp,16
+   23038:	00408021 	addu	s0,v0,zero
+   2303c:	14400032 	bnez	v0,23108 <devfs_lookup_node+0x1a8>
+   23040:	8fa60030 	lw	a2,48(sp)
+   23044:	8cc20014 	lw	v0,20(a2)
+   23048:	1440001b 	bnez	v0,230b8 <devfs_lookup_node+0x158>
+   2304c:	24030001 	addiu	v1,zero,1
+   23050:	8e220100 	lw	v0,256(s1)
+   23054:	34420004 	ori	v0,v0,0x4
+   23058:	ae220100 	sw	v0,256(s1)
+   2305c:	8fa70014 	lw	a3,20(sp)
+   23060:	02202021 	addu	a0,s1,zero
+   23064:	0c008b9d 	jal	22e74 <devfs_inode_create>
+   23068:	02402821 	addu	a1,s2,zero
+   2306c:	8fbf004c 	lw	ra,76(sp)
+   23070:	02001021 	addu	v0,s0,zero
+   23074:	8fb40048 	lw	s4,72(sp)
+   23078:	8fb30044 	lw	s3,68(sp)
+   2307c:	8fb20040 	lw	s2,64(sp)
+   23080:	8fb1003c 	lw	s1,60(sp)
+   23084:	8fb00038 	lw	s0,56(sp)
+   23088:	03e00008 	jr	ra
+   2308c:	27bd0050 	addiu	sp,sp,80
+   23090:	8fbf004c 	lw	ra,76(sp)
+   23094:	24100014 	addiu	s0,zero,20
+   23098:	02001021 	addu	v0,s0,zero
+   2309c:	8fb40048 	lw	s4,72(sp)
+   230a0:	8fb30044 	lw	s3,68(sp)
+   230a4:	8fb20040 	lw	s2,64(sp)
+   230a8:	8fb1003c 	lw	s1,60(sp)
+   230ac:	8fb00038 	lw	s0,56(sp)
+   230b0:	03e00008 	jr	ra
+   230b4:	27bd0050 	addiu	sp,sp,80
+   230b8:	10430005 	beq	v0,v1,230d0 <devfs_lookup_node+0x170>
+   230bc:	00000000 	sll	zero,zero,0x0
+   230c0:	8e220100 	lw	v0,256(s1)
+   230c4:	3442000c 	ori	v0,v0,0xc
+   230c8:	08008c17 	j	2305c <devfs_lookup_node+0xfc>
+   230cc:	ae220100 	sw	v0,256(s1)
+   230d0:	8e220100 	lw	v0,256(s1)
+   230d4:	34420008 	ori	v0,v0,0x8
+   230d8:	08008c17 	j	2305c <devfs_lookup_node+0xfc>
+   230dc:	ae220100 	sw	v0,256(s1)
+   230e0:	8fbf004c 	lw	ra,76(sp)
+   230e4:	24100002 	addiu	s0,zero,2
+   230e8:	02001021 	addu	v0,s0,zero
+   230ec:	8fb40048 	lw	s4,72(sp)
+   230f0:	8fb30044 	lw	s3,68(sp)
+   230f4:	8fb20040 	lw	s2,64(sp)
+   230f8:	8fb1003c 	lw	s1,60(sp)
+   230fc:	8fb00038 	lw	s0,56(sp)
+   23100:	03e00008 	jr	ra
+   23104:	27bd0050 	addiu	sp,sp,80
+   23108:	3c020004 	lui	v0,0x4
+   2310c:	8c449100 	lw	a0,-28416(v0)
+   23110:	3c060003 	lui	a2,0x3
+   23114:	02003821 	addu	a3,s0,zero
+   23118:	24c67410 	addiu	a2,a2,29712
+   2311c:	0c0009b0 	jal	26c0 <__fprintk>
+   23120:	00002821 	addu	a1,zero,zero
+   23124:	8fbf004c 	lw	ra,76(sp)
+   23128:	02001021 	addu	v0,s0,zero
+   2312c:	8fb40048 	lw	s4,72(sp)
+   23130:	8fb30044 	lw	s3,68(sp)
+   23134:	8fb20040 	lw	s2,64(sp)
+   23138:	8fb1003c 	lw	s1,60(sp)
+   2313c:	8fb00038 	lw	s0,56(sp)
+   23140:	03e00008 	jr	ra
+   23144:	27bd0050 	addiu	sp,sp,80
+
+00023148 <sysfs_create_context>:
+   23148:	8c820004 	lw	v0,4(a0)
+   2314c:	3c030003 	lui	v1,0x3
+   23150:	34420001 	ori	v0,v0,0x1
+   23154:	ac820004 	sw	v0,4(a0)
+   23158:	3c020003 	lui	v0,0x3
+   2315c:	2442747c 	addiu	v0,v0,29820
+   23160:	ac820090 	sw	v0,144(a0)
+   23164:	3c020003 	lui	v0,0x3
+   23168:	246374bc 	addiu	v1,v1,29884
+   2316c:	244274f0 	addiu	v0,v0,29936
+   23170:	ac820094 	sw	v0,148(a0)
+   23174:	ac830098 	sw	v1,152(a0)
+   23178:	ac800000 	sw	zero,0(a0)
+   2317c:	03e00008 	jr	ra
+   23180:	00001021 	addu	v0,zero,zero
+
+00023184 <sysfs_destroy_context>:
+   23184:	03e00008 	jr	ra
+   23188:	00001021 	addu	v0,zero,zero
+
+0002318c <sysfs_repli_root>:
+   2318c:	8ca20210 	lw	v0,528(a1)
+   23190:	3c030008 	lui	v1,0x8
+   23194:	246303a0 	addiu	v1,v1,928
+   23198:	ac430000 	sw	v1,0(v0)
+   2319c:	03e00008 	jr	ra
+   231a0:	00001021 	addu	v0,zero,zero
+
+000231a4 <sysfs_write_root>:
+   231a4:	03e00008 	jr	ra
+   231a8:	00001021 	addu	v0,zero,zero
+
+000231ac <sysfs_read_root>:
+   231ac:	24020001 	addiu	v0,zero,1
+   231b0:	aca20008 	sw	v0,8(a1)
+   231b4:	aca20020 	sw	v0,32(a1)
+   231b8:	00001821 	addu	v1,zero,zero
+   231bc:	00001021 	addu	v0,zero,zero
+   231c0:	27bdffe0 	addiu	sp,sp,-32
+   231c4:	aca3001c 	sw	v1,28(a1)
+   231c8:	aca20018 	sw	v0,24(a1)
+   231cc:	afbf001c 	sw	ra,28(sp)
+   231d0:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   231d4:	afa50010 	sw	a1,16(sp)
+   231d8:	8fa50010 	lw	a1,16(sp)
+   231dc:	3c040008 	lui	a0,0x8
+   231e0:	8ca30210 	lw	v1,528(a1)
+   231e4:	8fbf001c 	lw	ra,28(sp)
+   231e8:	248403a0 	addiu	a0,a0,928
+   231ec:	aca20000 	sw	v0,0(a1)
+   231f0:	ac640000 	sw	a0,0(v1)
+   231f4:	00001021 	addu	v0,zero,zero
+   231f8:	03e00008 	jr	ra
+   231fc:	27bd0020 	addiu	sp,sp,32
+
+00023200 <sysfs_kmem_file_init>:
+   23200:	2402000d 	addiu	v0,zero,13
+   23204:	ac820000 	sw	v0,0(a0)
+   23208:	3c020003 	lui	v0,0x3
+   2320c:	24427490 	addiu	v0,v0,29840
+   23210:	ac820004 	sw	v0,4(a0)
+   23214:	2402011c 	addiu	v0,zero,284
+   23218:	ac820008 	sw	v0,8(a0)
+   2321c:	24020001 	addiu	v0,zero,1
+   23220:	ac82000c 	sw	v0,12(a0)
+   23224:	24020002 	addiu	v0,zero,2
+   23228:	ac820010 	sw	v0,16(a0)
+   2322c:	ac80001c 	sw	zero,28(a0)
+   23230:	ac800014 	sw	zero,20(a0)
+   23234:	ac800018 	sw	zero,24(a0)
+   23238:	03e00008 	jr	ra
+   2323c:	00001021 	addu	v0,zero,zero
+
+00023240 <sysfs_write>:
+   23240:	03e00008 	jr	ra
+   23244:	2402007e 	addiu	v0,zero,126
+
+00023248 <sysfs_lseek>:
+   23248:	03e00008 	jr	ra
+   2324c:	2402007e 	addiu	v0,zero,126
+
+00023250 <sysfs_close>:
+   23250:	03e00008 	jr	ra
+   23254:	00001021 	addu	v0,zero,zero
+
+00023258 <sysfs_readdir>:
+   23258:	8c820118 	lw	v0,280(a0)
+   2325c:	27bdffe0 	addiu	sp,sp,-32
+   23260:	afb00014 	sw	s0,20(sp)
+   23264:	8c500004 	lw	s0,4(v0)
+   23268:	afb10018 	sw	s1,24(sp)
+   2326c:	afbf001c 	sw	ra,28(sp)
+   23270:	00a08821 	addu	s1,a1,zero
+   23274:	1200001b 	beqz	s0,232e4 <sysfs_readdir+0x8c>
+   23278:	8c430008 	lw	v1,8(v0)
+   2327c:	8c450000 	lw	a1,0(v0)
+   23280:	24a40002 	addiu	a0,a1,2
+   23284:	000420c0 	sll	a0,a0,0x3
+   23288:	00642021 	addu	a0,v1,a0
+   2328c:	8c860000 	lw	a2,0(a0)
+   23290:	1086001a 	beq	a0,a2,232fc <sysfs_readdir+0xa4>
+   23294:	00000000 	sll	zero,zero,0x0
+   23298:	8e060008 	lw	a2,8(s0)
+   2329c:	10860018 	beq	a0,a2,23300 <sysfs_readdir+0xa8>
+   232a0:	24a40001 	addiu	a0,a1,1
+   232a4:	10c00016 	beqz	a2,23300 <sysfs_readdir+0xa8>
+   232a8:	24c6fff8 	addiu	a2,a2,-8
+   232ac:	ac460004 	sw	a2,4(v0)
+   232b0:	8e020004 	lw	v0,4(s0)
+   232b4:	8e050000 	lw	a1,0(s0)
+   232b8:	0002102b 	sltu	v0,zero,v0
+   232bc:	ae220004 	sw	v0,4(s1)
+   232c0:	0c00c4a9 	jal	312a4 <strcpy>
+   232c4:	26240008 	addiu	a0,s1,8
+   232c8:	8fbf001c 	lw	ra,28(sp)
+   232cc:	ae300000 	sw	s0,0(s1)
+   232d0:	00001021 	addu	v0,zero,zero
+   232d4:	8fb10018 	lw	s1,24(sp)
+   232d8:	8fb00014 	lw	s0,20(sp)
+   232dc:	03e00008 	jr	ra
+   232e0:	27bd0020 	addiu	sp,sp,32
+   232e4:	8fbf001c 	lw	ra,28(sp)
+   232e8:	2402007d 	addiu	v0,zero,125
+   232ec:	8fb10018 	lw	s1,24(sp)
+   232f0:	8fb00014 	lw	s0,20(sp)
+   232f4:	03e00008 	jr	ra
+   232f8:	27bd0020 	addiu	sp,sp,32
+   232fc:	24a40001 	addiu	a0,a1,1
+   23300:	2c86000a 	sltiu	a2,a0,10
+   23304:	10c00012 	beqz	a2,23350 <sysfs_readdir+0xf8>
+   23308:	24a60003 	addiu	a2,a1,3
+   2330c:	000630c0 	sll	a2,a2,0x3
+   23310:	00663021 	addu	a2,v1,a2
+   23314:	8cc70000 	lw	a3,0(a2)
+   23318:	14e6000f 	bne	a3,a2,23358 <sysfs_readdir+0x100>
+   2331c:	2409000a 	addiu	t1,zero,10
+   23320:	24a50004 	addiu	a1,a1,4
+   23324:	000528c0 	sll	a1,a1,0x3
+   23328:	08008ccf 	j	2333c <sysfs_readdir+0xe4>
+   2332c:	00652821 	addu	a1,v1,a1
+   23330:	8ca80000 	lw	t0,0(a1)
+   23334:	15070009 	bne	t0,a3,2335c <sysfs_readdir+0x104>
+   23338:	24a50008 	addiu	a1,a1,8
+   2333c:	24840001 	addiu	a0,a0,1
+   23340:	24860002 	addiu	a2,a0,2
+   23344:	000638c0 	sll	a3,a2,0x3
+   23348:	1489fff9 	bne	a0,t1,23330 <sysfs_readdir+0xd8>
+   2334c:	00673821 	addu	a3,v1,a3
+   23350:	08008cac 	j	232b0 <sysfs_readdir+0x58>
+   23354:	ac400004 	sw	zero,4(v0)
+   23358:	24a60003 	addiu	a2,a1,3
+   2335c:	000630c0 	sll	a2,a2,0x3
+   23360:	00661821 	addu	v1,v1,a2
+   23364:	8c630000 	lw	v1,0(v1)
+   23368:	ac440000 	sw	a0,0(v0)
+   2336c:	2463fff8 	addiu	v1,v1,-8
+   23370:	08008cac 	j	232b0 <sysfs_readdir+0x58>
+   23374:	ac430004 	sw	v1,4(v0)
+
+00023378 <sysfs_release>:
+   23378:	8c820118 	lw	v0,280(a0)
+   2337c:	27bdffd8 	addiu	sp,sp,-40
+   23380:	afb00020 	sw	s0,32(sp)
+   23384:	afbf0024 	sw	ra,36(sp)
+   23388:	10400007 	beqz	v0,233a8 <sysfs_release+0x30>
+   2338c:	00808021 	addu	s0,a0,zero
+   23390:	2403000d 	addiu	v1,zero,13
+   23394:	27a40010 	addiu	a0,sp,16
+   23398:	afa30010 	sw	v1,16(sp)
+   2339c:	0c007134 	jal	1c4d0 <kmem_free>
+   233a0:	afa2001c 	sw	v0,28(sp)
+   233a4:	ae000118 	sw	zero,280(s0)
+   233a8:	8fbf0024 	lw	ra,36(sp)
+   233ac:	00001021 	addu	v0,zero,zero
+   233b0:	8fb00020 	lw	s0,32(sp)
+   233b4:	03e00008 	jr	ra
+   233b8:	27bd0028 	addiu	sp,sp,40
+
+000233bc <sysfs_read>:
+   233bc:	8c860014 	lw	a2,20(a0)
+   233c0:	27bdffe0 	addiu	sp,sp,-32
+   233c4:	afb10014 	sw	s1,20(sp)
+   233c8:	8cd10118 	lw	s1,280(a2)
+   233cc:	afb20018 	sw	s2,24(sp)
+   233d0:	8e24000c 	lw	a0,12(s1)
+   233d4:	afbf001c 	sw	ra,28(sp)
+   233d8:	8c820004 	lw	v0,4(a0)
+   233dc:	afb00010 	sw	s0,16(sp)
+   233e0:	10400024 	beqz	v0,23474 <sysfs_read+0xb8>
+   233e4:	00a09021 	addu	s2,a1,zero
+   233e8:	8e230010 	lw	v1,16(s1)
+   233ec:	1060001b 	beqz	v1,2345c <sysfs_read+0xa0>
+   233f0:	24c60004 	addiu	a2,a2,4
+   233f4:	8e240018 	lw	a0,24(s1)
+   233f8:	8e420004 	lw	v0,4(s2)
+   233fc:	2625001c 	addiu	a1,s1,28
+   23400:	0044802b 	sltu	s0,v0,a0
+   23404:	0090100a 	movz	v0,a0,s0
+   23408:	00408021 	addu	s0,v0,zero
+   2340c:	8e420008 	lw	v0,8(s2)
+   23410:	00a32821 	addu	a1,a1,v1
+   23414:	02402021 	addu	a0,s2,zero
+   23418:	0040f809 	jalr	v0
+   2341c:	02003021 	addu	a2,s0,zero
+   23420:	8e220018 	lw	v0,24(s1)
+   23424:	00501023 	subu	v0,v0,s0
+   23428:	14400009 	bnez	v0,23450 <sysfs_read+0x94>
+   2342c:	ae220018 	sw	v0,24(s1)
+   23430:	ae220010 	sw	v0,16(s1)
+   23434:	8fbf001c 	lw	ra,28(sp)
+   23438:	02001021 	addu	v0,s0,zero
+   2343c:	8fb20018 	lw	s2,24(sp)
+   23440:	8fb10014 	lw	s1,20(sp)
+   23444:	8fb00010 	lw	s0,16(sp)
+   23448:	03e00008 	jr	ra
+   2344c:	27bd0020 	addiu	sp,sp,32
+   23450:	8e220010 	lw	v0,16(s1)
+   23454:	08008d0c 	j	23430 <sysfs_read+0x74>
+   23458:	02021021 	addu	v0,s0,v0
+   2345c:	0040f809 	jalr	v0
+   23460:	26250014 	addiu	a1,s1,20
+   23464:	1440000b 	bnez	v0,23494 <sysfs_read+0xd8>
+   23468:	00408021 	addu	s0,v0,zero
+   2346c:	08008cfd 	j	233f4 <sysfs_read+0x38>
+   23470:	8e230010 	lw	v1,16(s1)
+   23474:	8fbf001c 	lw	ra,28(sp)
+   23478:	24100026 	addiu	s0,zero,38
+   2347c:	02001021 	addu	v0,s0,zero
+   23480:	8fb20018 	lw	s2,24(sp)
+   23484:	8fb10014 	lw	s1,20(sp)
+   23488:	8fb00010 	lw	s0,16(sp)
+   2348c:	03e00008 	jr	ra
+   23490:	27bd0020 	addiu	sp,sp,32
+   23494:	3c020004 	lui	v0,0x4
+   23498:	8c449100 	lw	a0,-28416(v0)
+   2349c:	3c060003 	lui	a2,0x3
+   234a0:	24c674a0 	addiu	a2,a2,29856
+   234a4:	00002821 	addu	a1,zero,zero
+   234a8:	0c0009b0 	jal	26c0 <__fprintk>
+   234ac:	02003821 	addu	a3,s0,zero
+   234b0:	08008d0e 	j	23438 <sysfs_read+0x7c>
+   234b4:	8fbf001c 	lw	ra,28(sp)
+
+000234b8 <sysfs_open>:
+   234b8:	8c830110 	lw	v1,272(a0)
+   234bc:	8c820118 	lw	v0,280(a0)
+   234c0:	27bdffd0 	addiu	sp,sp,-48
+   234c4:	afb10028 	sw	s1,40(sp)
+   234c8:	afb00024 	sw	s0,36(sp)
+   234cc:	afbf002c 	sw	ra,44(sp)
+   234d0:	00808021 	addu	s0,a0,zero
+   234d4:	1040002a 	beqz	v0,23580 <sysfs_open+0xc8>
+   234d8:	8c710210 	lw	s1,528(v1)
+   234dc:	10400033 	beqz	v0,235ac <sysfs_open+0xf4>
+   234e0:	8fbf002c 	lw	ra,44(sp)
+   234e4:	8e030110 	lw	v1,272(s0)
+   234e8:	ac400010 	sw	zero,16(v0)
+   234ec:	8e250000 	lw	a1,0(s1)
+   234f0:	8c630008 	lw	v1,8(v1)
+   234f4:	24a4fff0 	addiu	a0,a1,-16
+   234f8:	30630001 	andi	v1,v1,0x1
+   234fc:	ac450008 	sw	a1,8(v0)
+   23500:	ac44000c 	sw	a0,12(v0)
+   23504:	10600014 	beqz	v1,23558 <sysfs_open+0xa0>
+   23508:	ae020118 	sw	v0,280(s0)
+   2350c:	00a02021 	addu	a0,a1,zero
+   23510:	00001821 	addu	v1,zero,zero
+   23514:	2408000a 	addiu	t0,zero,10
+   23518:	24660002 	addiu	a2,v1,2
+   2351c:	000630c0 	sll	a2,a2,0x3
+   23520:	8c870010 	lw	a3,16(a0)
+   23524:	00a63021 	addu	a2,a1,a2
+   23528:	14e60025 	bne	a3,a2,235c0 <sysfs_open+0x108>
+   2352c:	8fbf002c 	lw	ra,44(sp)
+   23530:	24630001 	addiu	v1,v1,1
+   23534:	1468fff8 	bne	v1,t0,23518 <sysfs_open+0x60>
+   23538:	24840008 	addiu	a0,a0,8
+   2353c:	8fbf002c 	lw	ra,44(sp)
+   23540:	ac400004 	sw	zero,4(v0)
+   23544:	8fb10028 	lw	s1,40(sp)
+   23548:	00001021 	addu	v0,zero,zero
+   2354c:	8fb00024 	lw	s0,36(sp)
+   23550:	03e00008 	jr	ra
+   23554:	27bd0030 	addiu	sp,sp,48
+   23558:	8ca3fff0 	lw	v1,-16(a1)
+   2355c:	10600021 	beqz	v1,235e4 <sysfs_open+0x12c>
+   23560:	24450014 	addiu	a1,v0,20
+   23564:	0060f809 	jalr	v1
+   23568:	26060004 	addiu	a2,s0,4
+   2356c:	8fbf002c 	lw	ra,44(sp)
+   23570:	8fb10028 	lw	s1,40(sp)
+   23574:	8fb00024 	lw	s0,36(sp)
+   23578:	03e00008 	jr	ra
+   2357c:	27bd0030 	addiu	sp,sp,48
+   23580:	2402000d 	addiu	v0,zero,13
+   23584:	afa20010 	sw	v0,16(sp)
+   23588:	2402011c 	addiu	v0,zero,284
+   2358c:	afa20014 	sw	v0,20(sp)
+   23590:	3c020011 	lui	v0,0x11
+   23594:	34420020 	ori	v0,v0,0x20
+   23598:	27a40010 	addiu	a0,sp,16
+   2359c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   235a0:	afa20018 	sw	v0,24(sp)
+   235a4:	1440ffcf 	bnez	v0,234e4 <sysfs_open+0x2c>
+   235a8:	8fbf002c 	lw	ra,44(sp)
+   235ac:	2402000c 	addiu	v0,zero,12
+   235b0:	8fb10028 	lw	s1,40(sp)
+   235b4:	8fb00024 	lw	s0,36(sp)
+   235b8:	03e00008 	jr	ra
+   235bc:	27bd0030 	addiu	sp,sp,48
+   235c0:	8cc40000 	lw	a0,0(a2)
+   235c4:	ac430000 	sw	v1,0(v0)
+   235c8:	2483fff8 	addiu	v1,a0,-8
+   235cc:	ac430004 	sw	v1,4(v0)
+   235d0:	8fb10028 	lw	s1,40(sp)
+   235d4:	00001021 	addu	v0,zero,zero
+   235d8:	8fb00024 	lw	s0,36(sp)
+   235dc:	03e00008 	jr	ra
+   235e0:	27bd0030 	addiu	sp,sp,48
+   235e4:	08008d5b 	j	2356c <sysfs_open+0xb4>
+   235e8:	00001021 	addu	v0,zero,zero
+
+000235ec <sysfs_kmem_node_init>:
+   235ec:	2402000c 	addiu	v0,zero,12
+   235f0:	ac820000 	sw	v0,0(a0)
+   235f4:	3c020003 	lui	v0,0x3
+   235f8:	244274e0 	addiu	v0,v0,29920
+   235fc:	ac820004 	sw	v0,4(a0)
+   23600:	24020004 	addiu	v0,zero,4
+   23604:	ac820008 	sw	v0,8(a0)
+   23608:	24020001 	addiu	v0,zero,1
+   2360c:	ac82000c 	sw	v0,12(a0)
+   23610:	24020002 	addiu	v0,zero,2
+   23614:	ac820010 	sw	v0,16(a0)
+   23618:	ac80001c 	sw	zero,28(a0)
+   2361c:	ac800014 	sw	zero,20(a0)
+   23620:	ac800018 	sw	zero,24(a0)
+   23624:	03e00008 	jr	ra
+   23628:	00001021 	addu	v0,zero,zero
+
+0002362c <sysfs_create_node>:
+   2362c:	03e00008 	jr	ra
+   23630:	2402007e 	addiu	v0,zero,126
+
+00023634 <sysfs_write_node>:
+   23634:	03e00008 	jr	ra
+   23638:	00001021 	addu	v0,zero,zero
+
+0002363c <sysfs_unlink_node>:
+   2363c:	03e00008 	jr	ra
+   23640:	2402007e 	addiu	v0,zero,126
+
+00023644 <sysfs_inode_create>:
+   23644:	27bdffc8 	addiu	sp,sp,-56
+   23648:	afb00024 	sw	s0,36(sp)
+   2364c:	00808021 	addu	s0,a0,zero
+   23650:	8c84011c 	lw	a0,284(a0)
+   23654:	afb10028 	sw	s1,40(sp)
+   23658:	afa50010 	sw	a1,16(sp)
+   2365c:	afa60014 	sw	a2,20(sp)
+   23660:	afa70018 	sw	a3,24(sp)
+   23664:	afbf0034 	sw	ra,52(sp)
+   23668:	afb30030 	sw	s3,48(sp)
+   2366c:	0c00aad6 	jal	2ab58 <vfs_inode_new>
+   23670:	afb2002c 	sw	s2,44(sp)
+   23674:	00408821 	addu	s1,v0,zero
+   23678:	8fa50010 	lw	a1,16(sp)
+   2367c:	8fa60014 	lw	a2,20(sp)
+   23680:	10400022 	beqz	v0,2370c <sysfs_inode_create+0xc8>
+   23684:	8fa70018 	lw	a3,24(sp)
+   23688:	24020001 	addiu	v0,zero,1
+   2368c:	ae220020 	sw	v0,32(s1)
+   23690:	8e020100 	lw	v0,256(s0)
+   23694:	8e230210 	lw	v1,528(s1)
+   23698:	3c120004 	lui	s2,0x4
+   2369c:	ac660000 	sw	a2,0(v1)
+   236a0:	ae270018 	sw	a3,24(s1)
+   236a4:	ae250068 	sw	a1,104(s1)
+   236a8:	ae220008 	sw	v0,8(s1)
+   236ac:	ae20001c 	sw	zero,28(s1)
+   236b0:	2653c960 	addiu	s3,s2,-13984
+   236b4:	8a620003 	lwl	v0,3(s3)
+   236b8:	8ca30034 	lw	v1,52(a1)
+   236bc:	9a42c960 	lwr	v0,-13984(s2)
+   236c0:	8e04011c 	lw	a0,284(s0)
+   236c4:	ae230070 	sw	v1,112(s1)
+   236c8:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   236cc:	a622006c 	sh	v0,108(s1)
+   236d0:	ae220000 	sw	v0,0(s1)
+   236d4:	0c00ac3b 	jal	2b0ec <vfs_icache_add>
+   236d8:	02202021 	addu	a0,s1,zero
+   236dc:	8a630003 	lwl	v1,3(s3)
+   236e0:	8fbf0034 	lw	ra,52(sp)
+   236e4:	9a43c960 	lwr	v1,-13984(s2)
+   236e8:	00001021 	addu	v0,zero,zero
+   236ec:	ae110110 	sw	s1,272(s0)
+   236f0:	a6030114 	sh	v1,276(s0)
+   236f4:	8fb30030 	lw	s3,48(sp)
+   236f8:	8fb2002c 	lw	s2,44(sp)
+   236fc:	8fb10028 	lw	s1,40(sp)
+   23700:	8fb00024 	lw	s0,36(sp)
+   23704:	03e00008 	jr	ra
+   23708:	27bd0038 	addiu	sp,sp,56
+   2370c:	8fbf0034 	lw	ra,52(sp)
+   23710:	2402000c 	addiu	v0,zero,12
+   23714:	8fb30030 	lw	s3,48(sp)
+   23718:	8fb2002c 	lw	s2,44(sp)
+   2371c:	8fb10028 	lw	s1,40(sp)
+   23720:	8fb00024 	lw	s0,36(sp)
+   23724:	03e00008 	jr	ra
+   23728:	27bd0038 	addiu	sp,sp,56
+
+0002372c <sysfs_lookup_node>:
+   2372c:	27bdffd8 	addiu	sp,sp,-40
+   23730:	afb40020 	sw	s4,32(sp)
+   23734:	afb10014 	sw	s1,20(sp)
+   23738:	afbf0024 	sw	ra,36(sp)
+   2373c:	afb3001c 	sw	s3,28(sp)
+   23740:	afb20018 	sw	s2,24(sp)
+   23744:	afb00010 	sw	s0,16(sp)
+   23748:	8c820210 	lw	v0,528(a0)
+   2374c:	0080a021 	addu	s4,a0,zero
+   23750:	80a40000 	lb	a0,0(a1)
+   23754:	00a08821 	addu	s1,a1,zero
+   23758:	10800010 	beqz	a0,2379c <sysfs_lookup_node+0x70>
+   2375c:	8c430000 	lw	v1,0(v0)
+   23760:	00001021 	addu	v0,zero,zero
+   23764:	24a50001 	addiu	a1,a1,1
+   23768:	00823026 	xor	a2,a0,v0
+   2376c:	80a40000 	lb	a0,0(a1)
+   23770:	1480fffc 	bnez	a0,23764 <sysfs_lookup_node+0x38>
+   23774:	00461021 	addu	v0,v0,a2
+   23778:	3c04cccc 	lui	a0,0xcccc
+   2377c:	3484cccd 	ori	a0,a0,0xcccd
+   23780:	00440019 	multu	v0,a0
+   23784:	00002010 	mfhi	a0
+   23788:	000420c2 	srl	a0,a0,0x3
+   2378c:	000428c0 	sll	a1,a0,0x3
+   23790:	00042040 	sll	a0,a0,0x1
+   23794:	00852021 	addu	a0,a0,a1
+   23798:	00442023 	subu	a0,v0,a0
+   2379c:	24840002 	addiu	a0,a0,2
+   237a0:	000490c0 	sll	s2,a0,0x3
+   237a4:	00729021 	addu	s2,v1,s2
+   237a8:	8e530000 	lw	s3,0(s2)
+   237ac:	16720007 	bne	s3,s2,237cc <sysfs_lookup_node+0xa0>
+   237b0:	8e700000 	lw	s0,0(s3)
+   237b4:	08008e28 	j	238a0 <sysfs_lookup_node+0x174>
+   237b8:	8fbf0024 	lw	ra,36(sp)
+   237bc:	02009821 	addu	s3,s0,zero
+   237c0:	12120036 	beq	s0,s2,2389c <sysfs_lookup_node+0x170>
+   237c4:	8e020000 	lw	v0,0(s0)
+   237c8:	00408021 	addu	s0,v0,zero
+   237cc:	8e64fff8 	lw	a0,-8(s3)
+   237d0:	02202821 	addu	a1,s1,zero
+   237d4:	0c00c445 	jal	31114 <strcmp>
+   237d8:	2673fff8 	addiu	s3,s3,-8
+   237dc:	1440fff7 	bnez	v0,237bc <sysfs_lookup_node+0x90>
+   237e0:	00000000 	sll	zero,zero,0x0
+   237e4:	8e620004 	lw	v0,4(s3)
+   237e8:	10400014 	beqz	v0,2383c <sysfs_lookup_node+0x110>
+   237ec:	00000000 	sll	zero,zero,0x0
+   237f0:	8e220100 	lw	v0,256(s1)
+   237f4:	30430001 	andi	v1,v0,0x1
+   237f8:	10600016 	beqz	v1,23854 <sysfs_lookup_node+0x128>
+   237fc:	34420001 	ori	v0,v0,0x1
+   23800:	ae220100 	sw	v0,256(s1)
+   23804:	00003821 	addu	a3,zero,zero
+   23808:	02202021 	addu	a0,s1,zero
+   2380c:	02802821 	addu	a1,s4,zero
+   23810:	0c008d91 	jal	23644 <sysfs_inode_create>
+   23814:	02603021 	addu	a2,s3,zero
+   23818:	8fbf0024 	lw	ra,36(sp)
+   2381c:	00001021 	addu	v0,zero,zero
+   23820:	8fb40020 	lw	s4,32(sp)
+   23824:	8fb3001c 	lw	s3,28(sp)
+   23828:	8fb20018 	lw	s2,24(sp)
+   2382c:	8fb10014 	lw	s1,20(sp)
+   23830:	8fb00010 	lw	s0,16(sp)
+   23834:	03e00008 	jr	ra
+   23838:	27bd0028 	addiu	sp,sp,40
+   2383c:	8e220100 	lw	v0,256(s1)
+   23840:	30420001 	andi	v0,v0,0x1
+   23844:	1440000c 	bnez	v0,23878 <sysfs_lookup_node+0x14c>
+   23848:	24070100 	addiu	a3,zero,256
+   2384c:	08008e03 	j	2380c <sysfs_lookup_node+0xe0>
+   23850:	02202021 	addu	a0,s1,zero
+   23854:	8fbf0024 	lw	ra,36(sp)
+   23858:	24020015 	addiu	v0,zero,21
+   2385c:	8fb40020 	lw	s4,32(sp)
+   23860:	8fb3001c 	lw	s3,28(sp)
+   23864:	8fb20018 	lw	s2,24(sp)
+   23868:	8fb10014 	lw	s1,20(sp)
+   2386c:	8fb00010 	lw	s0,16(sp)
+   23870:	03e00008 	jr	ra
+   23874:	27bd0028 	addiu	sp,sp,40
+   23878:	8fbf0024 	lw	ra,36(sp)
+   2387c:	24020014 	addiu	v0,zero,20
+   23880:	8fb40020 	lw	s4,32(sp)
+   23884:	8fb3001c 	lw	s3,28(sp)
+   23888:	8fb20018 	lw	s2,24(sp)
+   2388c:	8fb10014 	lw	s1,20(sp)
+   23890:	8fb00010 	lw	s0,16(sp)
+   23894:	03e00008 	jr	ra
+   23898:	27bd0028 	addiu	sp,sp,40
+   2389c:	8fbf0024 	lw	ra,36(sp)
+   238a0:	24020002 	addiu	v0,zero,2
+   238a4:	8fb40020 	lw	s4,32(sp)
+   238a8:	8fb3001c 	lw	s3,28(sp)
+   238ac:	8fb20018 	lw	s2,24(sp)
+   238b0:	8fb10014 	lw	s1,20(sp)
+   238b4:	8fb00010 	lw	s0,16(sp)
+   238b8:	03e00008 	jr	ra
+   238bc:	27bd0028 	addiu	sp,sp,40
+
+000238c0 <sysfs_release_node>:
+   238c0:	27bdffd8 	addiu	sp,sp,-40
+   238c4:	8c820210 	lw	v0,528(a0)
+   238c8:	afb00020 	sw	s0,32(sp)
+   238cc:	2403000c 	addiu	v1,zero,12
+   238d0:	00808021 	addu	s0,a0,zero
+   238d4:	27a40010 	addiu	a0,sp,16
+   238d8:	afbf0024 	sw	ra,36(sp)
+   238dc:	afa2001c 	sw	v0,28(sp)
+   238e0:	0c007134 	jal	1c4d0 <kmem_free>
+   238e4:	afa30010 	sw	v1,16(sp)
+   238e8:	8fbf0024 	lw	ra,36(sp)
+   238ec:	ae000210 	sw	zero,528(s0)
+   238f0:	00001021 	addu	v0,zero,zero
+   238f4:	8fb00020 	lw	s0,32(sp)
+   238f8:	03e00008 	jr	ra
+   238fc:	27bd0028 	addiu	sp,sp,40
+
+00023900 <sysfs_init_node>:
+   23900:	8c820210 	lw	v0,528(a0)
+   23904:	27bdffd8 	addiu	sp,sp,-40
+   23908:	afb00020 	sw	s0,32(sp)
+   2390c:	afbf0024 	sw	ra,36(sp)
+   23910:	10400008 	beqz	v0,23934 <sysfs_init_node+0x34>
+   23914:	00808021 	addu	s0,a0,zero
+   23918:	10400011 	beqz	v0,23960 <sysfs_init_node+0x60>
+   2391c:	8fbf0024 	lw	ra,36(sp)
+   23920:	ae020210 	sw	v0,528(s0)
+   23924:	00001021 	addu	v0,zero,zero
+   23928:	8fb00020 	lw	s0,32(sp)
+   2392c:	03e00008 	jr	ra
+   23930:	27bd0028 	addiu	sp,sp,40
+   23934:	2402000c 	addiu	v0,zero,12
+   23938:	afa20010 	sw	v0,16(sp)
+   2393c:	24020004 	addiu	v0,zero,4
+   23940:	afa20014 	sw	v0,20(sp)
+   23944:	3c020011 	lui	v0,0x11
+   23948:	34420020 	ori	v0,v0,0x20
+   2394c:	27a40010 	addiu	a0,sp,16
+   23950:	0c00713f 	jal	1c4fc <kmem_alloc>
+   23954:	afa20018 	sw	v0,24(sp)
+   23958:	1440fff1 	bnez	v0,23920 <sysfs_init_node+0x20>
+   2395c:	8fbf0024 	lw	ra,36(sp)
+   23960:	2402000c 	addiu	v0,zero,12
+   23964:	8fb00020 	lw	s0,32(sp)
+   23968:	03e00008 	jr	ra
+   2396c:	27bd0028 	addiu	sp,sp,40
+   23970:	27bdffe0 	addiu	sp,sp,-32
+   23974:	afbf001c 	sw	ra,28(sp)
+   23978:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2397c:	afa40010 	sw	a0,16(sp)
+   23980:	8fa40010 	lw	a0,16(sp)
+   23984:	8fbf001c 	lw	ra,28(sp)
+   23988:	0082001b 	divu	zero,a0,v0
+   2398c:	004001f4 	teq	v0,zero,0x7
+   23990:	27bd0020 	addiu	sp,sp,32
+   23994:	03e00008 	jr	ra
+   23998:	00001012 	mflo	v0
+
+0002399c <__vfat_query_fat_main>:
+   2399c:	27bdffe0 	addiu	sp,sp,-32
+   239a0:	8fa20030 	lw	v0,48(sp)
+   239a4:	afb00010 	sw	s0,16(sp)
+   239a8:	8c4400d0 	lw	a0,208(v0)
+   239ac:	8c5000d8 	lw	s0,216(v0)
+   239b0:	8fa30034 	lw	v1,52(sp)
+   239b4:	72042802 	mul	a1,s0,a0
+   239b8:	00031880 	sll	v1,v1,0x2
+   239bc:	00a38021 	addu	s0,a1,v1
+   239c0:	8c4400f4 	lw	a0,244(v0)
+   239c4:	afb10014 	sw	s1,20(sp)
+   239c8:	00102b02 	srl	a1,s0,0xc
+   239cc:	00c08821 	addu	s1,a2,zero
+   239d0:	24060001 	addiu	a2,zero,1
+   239d4:	afb20018 	sw	s2,24(sp)
+   239d8:	afbf001c 	sw	ra,28(sp)
+   239dc:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   239e0:	00e09021 	addu	s2,a3,zero
+   239e4:	10400011 	beqz	v0,23a2c <__vfat_query_fat_main+0x90>
+   239e8:	8fbf001c 	lw	ra,28(sp)
+   239ec:	0c007c15 	jal	1f054 <ppm_page2addr>
+   239f0:	00402021 	addu	a0,v0,zero
+   239f4:	32100fff 	andi	s0,s0,0xfff
+   239f8:	00508021 	addu	s0,v0,s0
+   239fc:	8e030000 	lw	v1,0(s0)
+   23a00:	3c020fff 	lui	v0,0xfff
+   23a04:	3442ffff 	ori	v0,v0,0xffff
+   23a08:	8fbf001c 	lw	ra,28(sp)
+   23a0c:	00621024 	and	v0,v1,v0
+   23a10:	ae420000 	sw	v0,0(s2)
+   23a14:	ae200000 	sw	zero,0(s1)
+   23a18:	8fb20018 	lw	s2,24(sp)
+   23a1c:	8fb10014 	lw	s1,20(sp)
+   23a20:	8fb00010 	lw	s0,16(sp)
+   23a24:	03e00008 	jr	ra
+   23a28:	27bd0020 	addiu	sp,sp,32
+   23a2c:	2402ffff 	addiu	v0,zero,-1
+   23a30:	ae220000 	sw	v0,0(s1)
+   23a34:	8fb20018 	lw	s2,24(sp)
+   23a38:	8fb10014 	lw	s1,20(sp)
+   23a3c:	8fb00010 	lw	s0,16(sp)
+   23a40:	03e00008 	jr	ra
+   23a44:	27bd0020 	addiu	sp,sp,32
+
+00023a48 <__vfat_query_fat_local>:
+   23a48:	27bdffe0 	addiu	sp,sp,-32
+   23a4c:	afbf001c 	sw	ra,28(sp)
+   23a50:	00804821 	addu	t1,a0,zero
+   23a54:	00a04021 	addu	t0,a1,zero
+   23a58:	40037801 	mfc0	v1,$15,1
+   23a5c:	3c020004 	lui	v0,0x4
+   23a60:	2444c960 	addiu	a0,v0,-13984
+   23a64:	88840003 	lwl	a0,3(a0)
+   23a68:	30630003 	andi	v1,v1,0x3
+   23a6c:	3c050004 	lui	a1,0x4
+   23a70:	24a5c950 	addiu	a1,a1,-14000
+   23a74:	00031880 	sll	v1,v1,0x2
+   23a78:	9844c960 	lwr	a0,-13984(v0)
+   23a7c:	00651821 	addu	v1,v1,a1
+   23a80:	8c650000 	lw	a1,0(v1)
+   23a84:	8ce20000 	lw	v0,0(a3)
+   23a88:	8cc30000 	lw	v1,0(a2)
+   23a8c:	3084ffff 	andi	a0,a0,0xffff
+   23a90:	01203021 	addu	a2,t1,zero
+   23a94:	01003821 	addu	a3,t0,zero
+   23a98:	afa30010 	sw	v1,16(sp)
+   23a9c:	0c008e67 	jal	2399c <__vfat_query_fat_main>
+   23aa0:	afa20014 	sw	v0,20(sp)
+   23aa4:	8fbf001c 	lw	ra,28(sp)
+   23aa8:	03e00008 	jr	ra
+   23aac:	27bd0020 	addiu	sp,sp,32
+
+00023ab0 <__vfat_query_fat_demarshall>:
+   23ab0:	27bdffc0 	addiu	sp,sp,-64
+   23ab4:	afbf003c 	sw	ra,60(sp)
+   23ab8:	afbe0038 	sw	s8,56(sp)
+   23abc:	afb40034 	sw	s4,52(sp)
+   23ac0:	03a0f021 	addu	s8,sp,zero
+   23ac4:	afb30030 	sw	s3,48(sp)
+   23ac8:	afb2002c 	sw	s2,44(sp)
+   23acc:	afb10028 	sw	s1,40(sp)
+   23ad0:	afb00024 	sw	s0,36(sp)
+   23ad4:	27bdfff0 	addiu	sp,sp,-16
+   23ad8:	27b40018 	addiu	s4,sp,24
+   23adc:	27bdffc0 	addiu	sp,sp,-64
+   23ae0:	27b00018 	addiu	s0,sp,24
+   23ae4:	26030030 	addiu	v1,s0,48
+   23ae8:	00808821 	addu	s1,a0,zero
+   23aec:	2605002c 	addiu	a1,s0,44
+   23af0:	8c840000 	lw	a0,0(a0)
+   23af4:	ae830004 	sw	v1,4(s4)
+   23af8:	24020004 	addiu	v0,zero,4
+   23afc:	24060034 	addiu	a2,zero,52
+   23b00:	ae850000 	sw	a1,0(s4)
+   23b04:	ae060008 	sw	a2,8(s0)
+   23b08:	ae020028 	sw	v0,40(s0)
+   23b0c:	0c008e5c 	jal	23970 <sysfs_init_node+0x70>
+   23b10:	ae020024 	sw	v0,36(s0)
+   23b14:	8e870004 	lw	a3,4(s4)
+   23b18:	8e860000 	lw	a2,0(s4)
+   23b1c:	02202021 	addu	a0,s1,zero
+   23b20:	00002821 	addu	a1,zero,zero
+   23b24:	8e320000 	lw	s2,0(s1)
+   23b28:	afc6001c 	sw	a2,28(s8)
+   23b2c:	afc70018 	sw	a3,24(s8)
+   23b30:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   23b34:	00409821 	addu	s3,v0,zero
+   23b38:	8c540000 	lw	s4,0(v0)
+   23b3c:	02202021 	addu	a0,s1,zero
+   23b40:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   23b44:	24050001 	addiu	a1,zero,1
+   23b48:	afb40010 	sw	s4,16(sp)
+   23b4c:	8c420000 	lw	v0,0(v0)
+   23b50:	8fc6001c 	lw	a2,28(s8)
+   23b54:	8fc70018 	lw	a3,24(s8)
+   23b58:	3264ffff 	andi	a0,s3,0xffff
+   23b5c:	02402821 	addu	a1,s2,zero
+   23b60:	0c008e67 	jal	2399c <__vfat_query_fat_main>
+   23b64:	afa20014 	sw	v0,20(sp)
+   23b68:	02202021 	addu	a0,s1,zero
+   23b6c:	02002821 	addu	a1,s0,zero
+   23b70:	24060034 	addiu	a2,zero,52
+   23b74:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   23b78:	24070002 	addiu	a3,zero,2
+   23b7c:	03c0e821 	addu	sp,s8,zero
+   23b80:	8fbf003c 	lw	ra,60(sp)
+   23b84:	8fbe0038 	lw	s8,56(sp)
+   23b88:	8fb40034 	lw	s4,52(sp)
+   23b8c:	8fb30030 	lw	s3,48(sp)
+   23b90:	8fb2002c 	lw	s2,44(sp)
+   23b94:	8fb10028 	lw	s1,40(sp)
+   23b98:	8fb00024 	lw	s0,36(sp)
+   23b9c:	03e00008 	jr	ra
+   23ba0:	27bd0040 	addiu	sp,sp,64
+
+00023ba4 <__vfat_free_fat_entry_main>:
+   23ba4:	27bdffc0 	addiu	sp,sp,-64
+   23ba8:	afb1001c 	sw	s1,28(sp)
+   23bac:	8cf100d8 	lw	s1,216(a3)
+   23bb0:	afb20020 	sw	s2,32(sp)
+   23bb4:	24121000 	addiu	s2,zero,4096
+   23bb8:	0251001b 	divu	zero,s2,s1
+   23bbc:	022001f4 	teq	s1,zero,0x7
+   23bc0:	afb00018 	sw	s0,24(sp)
+   23bc4:	8fb00050 	lw	s0,80(sp)
+   23bc8:	3c020fff 	lui	v0,0xfff
+   23bcc:	afbe0038 	sw	s8,56(sp)
+   23bd0:	2603ffff 	addiu	v1,s0,-1
+   23bd4:	345efff6 	ori	s8,v0,0xfff6
+   23bd8:	007e182b 	sltu	v1,v1,s8
+   23bdc:	afb60030 	sw	s6,48(sp)
+   23be0:	afb40028 	sw	s4,40(sp)
+   23be4:	afbf003c 	sw	ra,60(sp)
+   23be8:	afb70034 	sw	s7,52(sp)
+   23bec:	afb5002c 	sw	s5,44(sp)
+   23bf0:	afb30024 	sw	s3,36(sp)
+   23bf4:	00e0b021 	addu	s6,a3,zero
+   23bf8:	afa60048 	sw	a2,72(sp)
+   23bfc:	8cf400f4 	lw	s4,244(a3)
+   23c00:	10600042 	beqz	v1,23d0c <__vfat_free_fat_entry_main+0x168>
+   23c04:	00009012 	mflo	s2
+   23c08:	00119882 	srl	s3,s1,0x2
+   23c0c:	08008f25 	j	23c94 <__vfat_free_fat_entry_main+0xf0>
+   23c10:	0013b880 	sll	s7,s3,0x2
+   23c14:	0c007c15 	jal	1f054 <ppm_page2addr>
+   23c18:	afa20014 	sw	v0,20(sp)
+   23c1c:	8fa30014 	lw	v1,20(sp)
+   23c20:	afa20010 	sw	v0,16(sp)
+   23c24:	0c007a7a 	jal	1e9e8 <page_lock>
+   23c28:	00602021 	addu	a0,v1,zero
+   23c2c:	0213001b 	divu	zero,s0,s3
+   23c30:	026001f4 	teq	s3,zero,0x7
+   23c34:	8fa20010 	lw	v0,16(sp)
+   23c38:	8e850000 	lw	a1,0(s4)
+   23c3c:	8fa30014 	lw	v1,20(sp)
+   23c40:	8ca500a4 	lw	a1,164(a1)
+   23c44:	00602021 	addu	a0,v1,zero
+   23c48:	8ca5000c 	lw	a1,12(a1)
+   23c4c:	00008010 	mfhi	s0
+   23c50:	72b73002 	mul	a2,s5,s7
+   23c54:	00108080 	sll	s0,s0,0x2
+   23c58:	00c2a821 	addu	s5,a2,v0
+   23c5c:	02b0a821 	addu	s5,s5,s0
+   23c60:	8eb00000 	lw	s0,0(s5)
+   23c64:	3c020fff 	lui	v0,0xfff
+   23c68:	3442ffff 	ori	v0,v0,0xffff
+   23c6c:	aea00000 	sw	zero,0(s5)
+   23c70:	00a0f809 	jalr	a1
+   23c74:	02028024 	and	s0,s0,v0
+   23c78:	8fa30014 	lw	v1,20(sp)
+   23c7c:	0c007a5c 	jal	1e970 <page_unlock>
+   23c80:	00602021 	addu	a0,v1,zero
+   23c84:	2602ffff 	addiu	v0,s0,-1
+   23c88:	005e102b 	sltu	v0,v0,s8
+   23c8c:	10400020 	beqz	v0,23d10 <__vfat_free_fat_entry_main+0x16c>
+   23c90:	8fa30048 	lw	v1,72(sp)
+   23c94:	0010a880 	sll	s5,s0,0x2
+   23c98:	02b1001b 	divu	zero,s5,s1
+   23c9c:	022001f4 	teq	s1,zero,0x7
+   23ca0:	8ec200d0 	lw	v0,208(s6)
+   23ca4:	02802021 	addu	a0,s4,zero
+   23ca8:	24060001 	addiu	a2,zero,1
+   23cac:	0000a812 	mflo	s5
+   23cb0:	02a2a821 	addu	s5,s5,v0
+   23cb4:	02b2001b 	divu	zero,s5,s2
+   23cb8:	024001f4 	teq	s2,zero,0x7
+   23cbc:	00002812 	mflo	a1
+   23cc0:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   23cc4:	0000a810 	mfhi	s5
+   23cc8:	1440ffd2 	bnez	v0,23c14 <__vfat_free_fat_entry_main+0x70>
+   23ccc:	00402021 	addu	a0,v0,zero
+   23cd0:	8fa30048 	lw	v1,72(sp)
+   23cd4:	8fbf003c 	lw	ra,60(sp)
+   23cd8:	24020005 	addiu	v0,zero,5
+   23cdc:	8fbe0038 	lw	s8,56(sp)
+   23ce0:	8fb70034 	lw	s7,52(sp)
+   23ce4:	8fb60030 	lw	s6,48(sp)
+   23ce8:	8fb5002c 	lw	s5,44(sp)
+   23cec:	8fb40028 	lw	s4,40(sp)
+   23cf0:	8fb30024 	lw	s3,36(sp)
+   23cf4:	8fb20020 	lw	s2,32(sp)
+   23cf8:	8fb1001c 	lw	s1,28(sp)
+   23cfc:	8fb00018 	lw	s0,24(sp)
+   23d00:	ac620000 	sw	v0,0(v1)
+   23d04:	03e00008 	jr	ra
+   23d08:	27bd0040 	addiu	sp,sp,64
+   23d0c:	8fa30048 	lw	v1,72(sp)
+   23d10:	8fbf003c 	lw	ra,60(sp)
+   23d14:	8fbe0038 	lw	s8,56(sp)
+   23d18:	8fb70034 	lw	s7,52(sp)
+   23d1c:	8fb60030 	lw	s6,48(sp)
+   23d20:	8fb5002c 	lw	s5,44(sp)
+   23d24:	8fb40028 	lw	s4,40(sp)
+   23d28:	8fb30024 	lw	s3,36(sp)
+   23d2c:	8fb20020 	lw	s2,32(sp)
+   23d30:	8fb1001c 	lw	s1,28(sp)
+   23d34:	8fb00018 	lw	s0,24(sp)
+   23d38:	ac600000 	sw	zero,0(v1)
+   23d3c:	03e00008 	jr	ra
+   23d40:	27bd0040 	addiu	sp,sp,64
+
+00023d44 <__vfat_free_fat_entry_demarshall>:
+   23d44:	27bdffc8 	addiu	sp,sp,-56
+   23d48:	afbf0034 	sw	ra,52(sp)
+   23d4c:	afbe0030 	sw	s8,48(sp)
+   23d50:	afb3002c 	sw	s3,44(sp)
+   23d54:	03a0f021 	addu	s8,sp,zero
+   23d58:	afb20028 	sw	s2,40(sp)
+   23d5c:	afb10024 	sw	s1,36(sp)
+   23d60:	afb00020 	sw	s0,32(sp)
+   23d64:	27bdfff0 	addiu	sp,sp,-16
+   23d68:	27b20018 	addiu	s2,sp,24
+   23d6c:	27bdffc8 	addiu	sp,sp,-56
+   23d70:	27b10018 	addiu	s1,sp,24
+   23d74:	00808021 	addu	s0,a0,zero
+   23d78:	26220028 	addiu	v0,s1,40
+   23d7c:	8c840000 	lw	a0,0(a0)
+   23d80:	2403002c 	addiu	v1,zero,44
+   23d84:	ae230008 	sw	v1,8(s1)
+   23d88:	ae420000 	sw	v0,0(s2)
+   23d8c:	24030004 	addiu	v1,zero,4
+   23d90:	0c008e5c 	jal	23970 <sysfs_init_node+0x70>
+   23d94:	ae230024 	sw	v1,36(s1)
+   23d98:	8e460000 	lw	a2,0(s2)
+   23d9c:	02002021 	addu	a0,s0,zero
+   23da0:	00002821 	addu	a1,zero,zero
+   23da4:	8e120000 	lw	s2,0(s0)
+   23da8:	afc6001c 	sw	a2,28(s8)
+   23dac:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   23db0:	00409821 	addu	s3,v0,zero
+   23db4:	8c470000 	lw	a3,0(v0)
+   23db8:	02002021 	addu	a0,s0,zero
+   23dbc:	24050001 	addiu	a1,zero,1
+   23dc0:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   23dc4:	afc70018 	sw	a3,24(s8)
+   23dc8:	8c420000 	lw	v0,0(v0)
+   23dcc:	8fc6001c 	lw	a2,28(s8)
+   23dd0:	8fc70018 	lw	a3,24(s8)
+   23dd4:	3264ffff 	andi	a0,s3,0xffff
+   23dd8:	02402821 	addu	a1,s2,zero
+   23ddc:	0c008ee9 	jal	23ba4 <__vfat_free_fat_entry_main>
+   23de0:	afa20010 	sw	v0,16(sp)
+   23de4:	02002021 	addu	a0,s0,zero
+   23de8:	02202821 	addu	a1,s1,zero
+   23dec:	2406002c 	addiu	a2,zero,44
+   23df0:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   23df4:	24070001 	addiu	a3,zero,1
+   23df8:	03c0e821 	addu	sp,s8,zero
+   23dfc:	8fbf0034 	lw	ra,52(sp)
+   23e00:	8fbe0030 	lw	s8,48(sp)
+   23e04:	8fb3002c 	lw	s3,44(sp)
+   23e08:	8fb20028 	lw	s2,40(sp)
+   23e0c:	8fb10024 	lw	s1,36(sp)
+   23e10:	8fb00020 	lw	s0,32(sp)
+   23e14:	03e00008 	jr	ra
+   23e18:	27bd0038 	addiu	sp,sp,56
+
+00023e1c <__vfat_free_fat_entry_local>:
+   23e1c:	27bdffe0 	addiu	sp,sp,-32
+   23e20:	afbf001c 	sw	ra,28(sp)
+   23e24:	00801821 	addu	v1,a0,zero
+   23e28:	00a01021 	addu	v0,a1,zero
+   23e2c:	40077801 	mfc0	a3,$15,1
+   23e30:	3c050004 	lui	a1,0x4
+   23e34:	24a4c960 	addiu	a0,a1,-13984
+   23e38:	88840003 	lwl	a0,3(a0)
+   23e3c:	30e70003 	andi	a3,a3,0x3
+   23e40:	3c080004 	lui	t0,0x4
+   23e44:	2508c950 	addiu	t0,t0,-14000
+   23e48:	00073880 	sll	a3,a3,0x2
+   23e4c:	00e83821 	addu	a3,a3,t0
+   23e50:	98a4c960 	lwr	a0,-13984(a1)
+   23e54:	8ce50000 	lw	a1,0(a3)
+   23e58:	8c470000 	lw	a3,0(v0)
+   23e5c:	8cc20000 	lw	v0,0(a2)
+   23e60:	3084ffff 	andi	a0,a0,0xffff
+   23e64:	00603021 	addu	a2,v1,zero
+   23e68:	0c008ee9 	jal	23ba4 <__vfat_free_fat_entry_main>
+   23e6c:	afa20010 	sw	v0,16(sp)
+   23e70:	8fbf001c 	lw	ra,28(sp)
+   23e74:	03e00008 	jr	ra
+   23e78:	27bd0020 	addiu	sp,sp,32
+
+00023e7c <vfat_locate_entry>:
+   23e7c:	8c820008 	lw	v0,8(a0)
+   23e80:	27bdfec0 	addiu	sp,sp,-320
+   23e84:	8c4201c4 	lw	v0,452(v0)
+   23e88:	afbe0138 	sw	s8,312(sp)
+   23e8c:	afb60130 	sw	s6,304(sp)
+   23e90:	afb5012c 	sw	s5,300(sp)
+   23e94:	afb40128 	sw	s4,296(sp)
+   23e98:	afb30124 	sw	s3,292(sp)
+   23e9c:	afb20120 	sw	s2,288(sp)
+   23ea0:	afb1011c 	sw	s1,284(sp)
+   23ea4:	afbf013c 	sw	ra,316(sp)
+   23ea8:	afb70134 	sw	s7,308(sp)
+   23eac:	afb00118 	sw	s0,280(sp)
+   23eb0:	00809821 	addu	s3,a0,zero
+   23eb4:	0000f021 	addu	s8,zero,zero
+   23eb8:	afa20110 	sw	v0,272(sp)
+   23ebc:	241100e5 	addiu	s1,zero,229
+   23ec0:	2415002e 	addiu	s5,zero,46
+   23ec4:	2416000f 	addiu	s6,zero,15
+   23ec8:	27b40010 	addiu	s4,sp,16
+   23ecc:	24120080 	addiu	s2,zero,128
+   23ed0:	8fa40110 	lw	a0,272(sp)
+   23ed4:	03c02821 	addu	a1,s8,zero
+   23ed8:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   23edc:	24060001 	addiu	a2,zero,1
+   23ee0:	1040005b 	beqz	v0,24050 <vfat_locate_entry+0x1d4>
+   23ee4:	0040b821 	addu	s7,v0,zero
+   23ee8:	0c007a7a 	jal	1e9e8 <page_lock>
+   23eec:	00402021 	addu	a0,v0,zero
+   23ef0:	0c007c15 	jal	1f054 <ppm_page2addr>
+   23ef4:	02e02021 	addu	a0,s7,zero
+   23ef8:	00401821 	addu	v1,v0,zero
+   23efc:	08008fd6 	j	23f58 <vfat_locate_entry+0xdc>
+   23f00:	00008021 	addu	s0,zero,zero
+   23f04:	10510011 	beq	v0,s1,23f4c <vfat_locate_entry+0xd0>
+   23f08:	00000000 	sll	zero,zero,0x0
+   23f0c:	1055000f 	beq	v0,s5,23f4c <vfat_locate_entry+0xd0>
+   23f10:	00000000 	sll	zero,zero,0x0
+   23f14:	8e62000c 	lw	v0,12(s3)
+   23f18:	00602021 	addu	a0,v1,zero
+   23f1c:	10400020 	beqz	v0,23fa0 <vfat_locate_entry+0x124>
+   23f20:	02802821 	addu	a1,s4,zero
+   23f24:	9062000b 	lbu	v0,11(v1)
+   23f28:	10560008 	beq	v0,s6,23f4c <vfat_locate_entry+0xd0>
+   23f2c:	00000000 	sll	zero,zero,0x0
+   23f30:	0c009857 	jal	2615c <vfat_getshortname>
+   23f34:	afa30114 	sw	v1,276(sp)
+   23f38:	8e65000c 	lw	a1,12(s3)
+   23f3c:	0c00c445 	jal	31114 <strcmp>
+   23f40:	02802021 	addu	a0,s4,zero
+   23f44:	1040002a 	beqz	v0,23ff0 <vfat_locate_entry+0x174>
+   23f48:	8fa30114 	lw	v1,276(sp)
+   23f4c:	26100001 	addiu	s0,s0,1
+   23f50:	12120022 	beq	s0,s2,23fdc <vfat_locate_entry+0x160>
+   23f54:	24630020 	addiu	v1,v1,32
+   23f58:	90620000 	lbu	v0,0(v1)
+   23f5c:	1440ffe9 	bnez	v0,23f04 <vfat_locate_entry+0x88>
+   23f60:	00000000 	sll	zero,zero,0x0
+   23f64:	0c007a5c 	jal	1e970 <page_unlock>
+   23f68:	02e02021 	addu	a0,s7,zero
+   23f6c:	24020002 	addiu	v0,zero,2
+   23f70:	8fbf013c 	lw	ra,316(sp)
+   23f74:	8fbe0138 	lw	s8,312(sp)
+   23f78:	8fb70134 	lw	s7,308(sp)
+   23f7c:	8fb60130 	lw	s6,304(sp)
+   23f80:	8fb5012c 	lw	s5,300(sp)
+   23f84:	8fb40128 	lw	s4,296(sp)
+   23f88:	8fb30124 	lw	s3,292(sp)
+   23f8c:	8fb20120 	lw	s2,288(sp)
+   23f90:	8fb1011c 	lw	s1,284(sp)
+   23f94:	8fb00118 	lw	s0,280(sp)
+   23f98:	03e00008 	jr	ra
+   23f9c:	27bd0140 	addiu	sp,sp,320
+   23fa0:	0c007a5c 	jal	1e970 <page_unlock>
+   23fa4:	02e02021 	addu	a0,s7,zero
+   23fa8:	8fbf013c 	lw	ra,316(sp)
+   23fac:	24020027 	addiu	v0,zero,39
+   23fb0:	8fbe0138 	lw	s8,312(sp)
+   23fb4:	8fb70134 	lw	s7,308(sp)
+   23fb8:	8fb60130 	lw	s6,304(sp)
+   23fbc:	8fb5012c 	lw	s5,300(sp)
+   23fc0:	8fb40128 	lw	s4,296(sp)
+   23fc4:	8fb30124 	lw	s3,292(sp)
+   23fc8:	8fb20120 	lw	s2,288(sp)
+   23fcc:	8fb1011c 	lw	s1,284(sp)
+   23fd0:	8fb00118 	lw	s0,280(sp)
+   23fd4:	03e00008 	jr	ra
+   23fd8:	27bd0140 	addiu	sp,sp,320
+   23fdc:	02e02021 	addu	a0,s7,zero
+   23fe0:	0c007a5c 	jal	1e970 <page_unlock>
+   23fe4:	27de0001 	addiu	s8,s8,1
+   23fe8:	08008fb5 	j	23ed4 <vfat_locate_entry+0x58>
+   23fec:	8fa40110 	lw	a0,272(sp)
+   23ff0:	8e640000 	lw	a0,0(s3)
+   23ff4:	10800003 	beqz	a0,24004 <vfat_locate_entry+0x188>
+   23ff8:	00602821 	addu	a1,v1,zero
+   23ffc:	0c00c12b 	jal	304ac <memcpy>
+   24000:	24060020 	addiu	a2,zero,32
+   24004:	8e620010 	lw	v0,16(s3)
+   24008:	001ef1c0 	sll	s8,s8,0x7
+   2400c:	03d08021 	addu	s0,s8,s0
+   24010:	ac500000 	sw	s0,0(v0)
+   24014:	0c007a5c 	jal	1e970 <page_unlock>
+   24018:	02e02021 	addu	a0,s7,zero
+   2401c:	8fbf013c 	lw	ra,316(sp)
+   24020:	00001021 	addu	v0,zero,zero
+   24024:	8fbe0138 	lw	s8,312(sp)
+   24028:	8fb70134 	lw	s7,308(sp)
+   2402c:	8fb60130 	lw	s6,304(sp)
+   24030:	8fb5012c 	lw	s5,300(sp)
+   24034:	8fb40128 	lw	s4,296(sp)
+   24038:	8fb30124 	lw	s3,292(sp)
+   2403c:	8fb20120 	lw	s2,288(sp)
+   24040:	8fb1011c 	lw	s1,284(sp)
+   24044:	8fb00118 	lw	s0,280(sp)
+   24048:	03e00008 	jr	ra
+   2404c:	27bd0140 	addiu	sp,sp,320
+   24050:	08008fdc 	j	23f70 <vfat_locate_entry+0xf4>
+   24054:	24020005 	addiu	v0,zero,5
+
+00024058 <__vfat_alloc_fat_entry_main>:
+   24058:	27bdffa8 	addiu	sp,sp,-88
+   2405c:	afb00030 	sw	s0,48(sp)
+   24060:	8fb00068 	lw	s0,104(sp)
+   24064:	afb10034 	sw	s1,52(sp)
+   24068:	26020010 	addiu	v0,s0,16
+   2406c:	8e1100d8 	lw	s1,216(s0)
+   24070:	afa20024 	sw	v0,36(sp)
+   24074:	24021000 	addiu	v0,zero,4096
+   24078:	0051001b 	divu	zero,v0,s1
+   2407c:	022001f4 	teq	s1,zero,0x7
+   24080:	8e0300d0 	lw	v1,208(s0)
+   24084:	afbe0050 	sw	s8,80(sp)
+   24088:	8e0200f4 	lw	v0,244(s0)
+   2408c:	8e1e00d4 	lw	s8,212(s0)
+   24090:	8fa40024 	lw	a0,36(sp)
+   24094:	ace00000 	sw	zero,0(a3)
+   24098:	acc00000 	sw	zero,0(a2)
+   2409c:	afb60048 	sw	s6,72(sp)
+   240a0:	afb50044 	sw	s5,68(sp)
+   240a4:	afb40040 	sw	s4,64(sp)
+   240a8:	03c3f021 	addu	s8,s8,v1
+   240ac:	afbf0054 	sw	ra,84(sp)
+   240b0:	afb7004c 	sw	s7,76(sp)
+   240b4:	afb3003c 	sw	s3,60(sp)
+   240b8:	afb20038 	sw	s2,56(sp)
+   240bc:	afa60028 	sw	a2,40(sp)
+   240c0:	afa7001c 	sw	a3,28(sp)
+   240c4:	afa20014 	sw	v0,20(sp)
+   240c8:	0c004408 	jal	11020 <rwlock_wrlock>
+   240cc:	0000b012 	mflo	s6
+   240d0:	8e1500ec 	lw	s5,236(s0)
+   240d4:	02be102b 	sltu	v0,s5,s8
+   240d8:	10400038 	beqz	v0,241bc <__vfat_alloc_fat_entry_main+0x164>
+   240dc:	8e1400f0 	lw	s4,240(s0)
+   240e0:	00118882 	srl	s1,s1,0x2
+   240e4:	3c120fff 	lui	s2,0xfff
+   240e8:	00111880 	sll	v1,s1,0x2
+   240ec:	2624ffff 	addiu	a0,s1,-1
+   240f0:	26b50001 	addiu	s5,s5,1
+   240f4:	afa30018 	sw	v1,24(sp)
+   240f8:	afa40020 	sw	a0,32(sp)
+   240fc:	afa00010 	sw	zero,16(sp)
+   24100:	2402ffff 	addiu	v0,zero,-1
+   24104:	3652ffff 	ori	s2,s2,0xffff
+   24108:	26b3ffff 	addiu	s3,s5,-1
+   2410c:	0276001b 	divu	zero,s3,s6
+   24110:	02c001f4 	teq	s6,zero,0x7
+   24114:	0000b812 	mflo	s7
+   24118:	12e20006 	beq	s7,v0,24134 <__vfat_alloc_fat_entry_main+0xdc>
+   2411c:	8fa40014 	lw	a0,20(sp)
+   24120:	00002812 	mflo	a1
+   24124:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   24128:	24060001 	addiu	a2,zero,1
+   2412c:	1040005c 	beqz	v0,242a0 <__vfat_alloc_fat_entry_main+0x248>
+   24130:	afa20010 	sw	v0,16(sp)
+   24134:	0c007c15 	jal	1f054 <ppm_page2addr>
+   24138:	8fa40010 	lw	a0,16(sp)
+   2413c:	0291182b 	sltu	v1,s4,s1
+   24140:	10600017 	beqz	v1,241a0 <__vfat_alloc_fat_entry_main+0x148>
+   24144:	8fa50018 	lw	a1,24(sp)
+   24148:	0276001b 	divu	zero,s3,s6
+   2414c:	02c001f4 	teq	s6,zero,0x7
+   24150:	00141880 	sll	v1,s4,0x2
+   24154:	00002010 	mfhi	a0
+   24158:	70853002 	mul	a2,a0,a1
+   2415c:	00c22021 	addu	a0,a2,v0
+   24160:	00831821 	addu	v1,a0,v1
+   24164:	8c620000 	lw	v0,0(v1)
+   24168:	00521024 	and	v0,v0,s2
+   2416c:	10400020 	beqz	v0,241f0 <__vfat_alloc_fat_entry_main+0x198>
+   24170:	26820001 	addiu	v0,s4,1
+   24174:	00021080 	sll	v0,v0,0x2
+   24178:	08009064 	j	24190 <__vfat_alloc_fat_entry_main+0x138>
+   2417c:	00821021 	addu	v0,a0,v0
+   24180:	8c440000 	lw	a0,0(v0)
+   24184:	00922024 	and	a0,a0,s2
+   24188:	10800019 	beqz	a0,241f0 <__vfat_alloc_fat_entry_main+0x198>
+   2418c:	24420004 	addiu	v0,v0,4
+   24190:	26940001 	addiu	s4,s4,1
+   24194:	0291182b 	sltu	v1,s4,s1
+   24198:	1460fff9 	bnez	v1,24180 <__vfat_alloc_fat_entry_main+0x128>
+   2419c:	00401821 	addu	v1,v0,zero
+   241a0:	00001821 	addu	v1,zero,zero
+   241a4:	02be102b 	sltu	v0,s5,s8
+   241a8:	10400004 	beqz	v0,241bc <__vfat_alloc_fat_entry_main+0x164>
+   241ac:	26b50001 	addiu	s5,s5,1
+   241b0:	02e01021 	addu	v0,s7,zero
+   241b4:	1060ffd4 	beqz	v1,24108 <__vfat_alloc_fat_entry_main+0xb0>
+   241b8:	0000a021 	addu	s4,zero,zero
+   241bc:	8fa40024 	lw	a0,36(sp)
+   241c0:	8fbf0054 	lw	ra,84(sp)
+   241c4:	8fbe0050 	lw	s8,80(sp)
+   241c8:	8fb7004c 	lw	s7,76(sp)
+   241cc:	8fb60048 	lw	s6,72(sp)
+   241d0:	8fb50044 	lw	s5,68(sp)
+   241d4:	8fb40040 	lw	s4,64(sp)
+   241d8:	8fb3003c 	lw	s3,60(sp)
+   241dc:	8fb20038 	lw	s2,56(sp)
+   241e0:	8fb10034 	lw	s1,52(sp)
+   241e4:	8fb00030 	lw	s0,48(sp)
+   241e8:	080043a5 	j	10e94 <rwlock_unlock>
+   241ec:	27bd0058 	addiu	sp,sp,88
+   241f0:	8fa40010 	lw	a0,16(sp)
+   241f4:	0c007a7a 	jal	1e9e8 <page_lock>
+   241f8:	afa3002c 	sw	v1,44(sp)
+   241fc:	8fa40014 	lw	a0,20(sp)
+   24200:	8fa3002c 	lw	v1,44(sp)
+   24204:	8c820000 	lw	v0,0(a0)
+   24208:	3c050fff 	lui	a1,0xfff
+   2420c:	8c4200a4 	lw	v0,164(v0)
+   24210:	34a5fff8 	ori	a1,a1,0xfff8
+   24214:	8fa40010 	lw	a0,16(sp)
+   24218:	8c42000c 	lw	v0,12(v0)
+   2421c:	0040f809 	jalr	v0
+   24220:	ac650000 	sw	a1,0(v1)
+   24224:	0c007a5c 	jal	1e970 <page_unlock>
+   24228:	8fa40010 	lw	a0,16(sp)
+   2422c:	8fa60020 	lw	a2,32(sp)
+   24230:	10d4000e 	beq	a2,s4,2426c <__vfat_alloc_fat_entry_main+0x214>
+   24234:	26820001 	addiu	v0,s4,1
+   24238:	0051001b 	divu	zero,v0,s1
+   2423c:	022001f4 	teq	s1,zero,0x7
+   24240:	8e0300d0 	lw	v1,208(s0)
+   24244:	ae1300ec 	sw	s3,236(s0)
+   24248:	00001010 	mfhi	v0
+   2424c:	ae0200f0 	sw	v0,240(s0)
+   24250:	02639823 	subu	s3,s3,v1
+   24254:	72711002 	mul	v0,s3,s1
+   24258:	8fa4001c 	lw	a0,28(sp)
+   2425c:	0054a021 	addu	s4,v0,s4
+   24260:	24030001 	addiu	v1,zero,1
+   24264:	08009069 	j	241a4 <__vfat_alloc_fat_entry_main+0x14c>
+   24268:	ac940000 	sw	s4,0(a0)
+   2426c:	12be0008 	beq	s5,s8,24290 <__vfat_alloc_fat_entry_main+0x238>
+   24270:	24020002 	addiu	v0,zero,2
+   24274:	0231001b 	divu	zero,s1,s1
+   24278:	022001f4 	teq	s1,zero,0x7
+   2427c:	8e0300d0 	lw	v1,208(s0)
+   24280:	ae1500ec 	sw	s5,236(s0)
+   24284:	00001010 	mfhi	v0
+   24288:	08009094 	j	24250 <__vfat_alloc_fat_entry_main+0x1f8>
+   2428c:	ae0200f0 	sw	v0,240(s0)
+   24290:	8e0300d0 	lw	v1,208(s0)
+   24294:	ae0200f0 	sw	v0,240(s0)
+   24298:	08009094 	j	24250 <__vfat_alloc_fat_entry_main+0x1f8>
+   2429c:	ae0300ec 	sw	v1,236(s0)
+   242a0:	3c020004 	lui	v0,0x4
+   242a4:	8c449100 	lw	a0,-28416(v0)
+   242a8:	3c060003 	lui	a2,0x3
+   242ac:	02603821 	addu	a3,s3,zero
+   242b0:	24c67518 	addiu	a2,a2,29976
+   242b4:	0c0009b0 	jal	26c0 <__fprintk>
+   242b8:	00002821 	addu	a1,zero,zero
+   242bc:	8fa30028 	lw	v1,40(sp)
+   242c0:	24020005 	addiu	v0,zero,5
+   242c4:	8fa40024 	lw	a0,36(sp)
+   242c8:	8fbf0054 	lw	ra,84(sp)
+   242cc:	8fbe0050 	lw	s8,80(sp)
+   242d0:	8fb7004c 	lw	s7,76(sp)
+   242d4:	8fb60048 	lw	s6,72(sp)
+   242d8:	8fb50044 	lw	s5,68(sp)
+   242dc:	8fb40040 	lw	s4,64(sp)
+   242e0:	8fb3003c 	lw	s3,60(sp)
+   242e4:	8fb20038 	lw	s2,56(sp)
+   242e8:	8fb10034 	lw	s1,52(sp)
+   242ec:	8fb00030 	lw	s0,48(sp)
+   242f0:	ac620000 	sw	v0,0(v1)
+   242f4:	080043a5 	j	10e94 <rwlock_unlock>
+   242f8:	27bd0058 	addiu	sp,sp,88
+
+000242fc <__vfat_alloc_fat_entry_demarshall>:
+   242fc:	27bdffc0 	addiu	sp,sp,-64
+   24300:	afbf003c 	sw	ra,60(sp)
+   24304:	afbe0038 	sw	s8,56(sp)
+   24308:	afb40034 	sw	s4,52(sp)
+   2430c:	03a0f021 	addu	s8,sp,zero
+   24310:	afb30030 	sw	s3,48(sp)
+   24314:	afb2002c 	sw	s2,44(sp)
+   24318:	afb10028 	sw	s1,40(sp)
+   2431c:	afb00024 	sw	s0,36(sp)
+   24320:	27bdfff0 	addiu	sp,sp,-16
+   24324:	27b40018 	addiu	s4,sp,24
+   24328:	27bdffc0 	addiu	sp,sp,-64
+   2432c:	27b00018 	addiu	s0,sp,24
+   24330:	00808821 	addu	s1,a0,zero
+   24334:	8c840000 	lw	a0,0(a0)
+   24338:	26030030 	addiu	v1,s0,48
+   2433c:	2605002c 	addiu	a1,s0,44
+   24340:	24020004 	addiu	v0,zero,4
+   24344:	24060034 	addiu	a2,zero,52
+   24348:	ae830004 	sw	v1,4(s4)
+   2434c:	ae060008 	sw	a2,8(s0)
+   24350:	ae850000 	sw	a1,0(s4)
+   24354:	ae020028 	sw	v0,40(s0)
+   24358:	0c008e5c 	jal	23970 <sysfs_init_node+0x70>
+   2435c:	ae020024 	sw	v0,36(s0)
+   24360:	8e870004 	lw	a3,4(s4)
+   24364:	8e860000 	lw	a2,0(s4)
+   24368:	02202021 	addu	a0,s1,zero
+   2436c:	00002821 	addu	a1,zero,zero
+   24370:	8e320000 	lw	s2,0(s1)
+   24374:	00409821 	addu	s3,v0,zero
+   24378:	afc6001c 	sw	a2,28(s8)
+   2437c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   24380:	afc70018 	sw	a3,24(s8)
+   24384:	8c420000 	lw	v0,0(v0)
+   24388:	8fc6001c 	lw	a2,28(s8)
+   2438c:	8fc70018 	lw	a3,24(s8)
+   24390:	3264ffff 	andi	a0,s3,0xffff
+   24394:	02402821 	addu	a1,s2,zero
+   24398:	0c009016 	jal	24058 <__vfat_alloc_fat_entry_main>
+   2439c:	afa20010 	sw	v0,16(sp)
+   243a0:	02202021 	addu	a0,s1,zero
+   243a4:	02002821 	addu	a1,s0,zero
+   243a8:	24060034 	addiu	a2,zero,52
+   243ac:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   243b0:	24070002 	addiu	a3,zero,2
+   243b4:	03c0e821 	addu	sp,s8,zero
+   243b8:	8fbf003c 	lw	ra,60(sp)
+   243bc:	8fbe0038 	lw	s8,56(sp)
+   243c0:	8fb40034 	lw	s4,52(sp)
+   243c4:	8fb30030 	lw	s3,48(sp)
+   243c8:	8fb2002c 	lw	s2,44(sp)
+   243cc:	8fb10028 	lw	s1,40(sp)
+   243d0:	8fb00024 	lw	s0,36(sp)
+   243d4:	03e00008 	jr	ra
+   243d8:	27bd0040 	addiu	sp,sp,64
+
+000243dc <__vfat_alloc_fat_entry_local>:
+   243dc:	27bdffe0 	addiu	sp,sp,-32
+   243e0:	afbf001c 	sw	ra,28(sp)
+   243e4:	00801821 	addu	v1,a0,zero
+   243e8:	00a03821 	addu	a3,a1,zero
+   243ec:	40057801 	mfc0	a1,$15,1
+   243f0:	3c020004 	lui	v0,0x4
+   243f4:	2444c960 	addiu	a0,v0,-13984
+   243f8:	88840003 	lwl	a0,3(a0)
+   243fc:	30a50003 	andi	a1,a1,0x3
+   24400:	3c080004 	lui	t0,0x4
+   24404:	2508c950 	addiu	t0,t0,-14000
+   24408:	00052880 	sll	a1,a1,0x2
+   2440c:	9844c960 	lwr	a0,-13984(v0)
+   24410:	00a82821 	addu	a1,a1,t0
+   24414:	8cc20000 	lw	v0,0(a2)
+   24418:	8ca50000 	lw	a1,0(a1)
+   2441c:	3084ffff 	andi	a0,a0,0xffff
+   24420:	00603021 	addu	a2,v1,zero
+   24424:	0c009016 	jal	24058 <__vfat_alloc_fat_entry_main>
+   24428:	afa20010 	sw	v0,16(sp)
+   2442c:	8fbf001c 	lw	ra,28(sp)
+   24430:	03e00008 	jr	ra
+   24434:	27bd0020 	addiu	sp,sp,32
+
+00024438 <vfat_query_fat>:
+   24438:	27bdffa0 	addiu	sp,sp,-96
+   2443c:	3c020004 	lui	v0,0x4
+   24440:	afb10054 	sw	s1,84(sp)
+   24444:	afb00050 	sw	s0,80(sp)
+   24448:	2443c960 	addiu	v1,v0,-13984
+   2444c:	afbf005c 	sw	ra,92(sp)
+   24450:	afb20058 	sw	s2,88(sp)
+   24454:	88630003 	lwl	v1,3(v1)
+   24458:	94910000 	lhu	s1,0(a0)
+   2445c:	9843c960 	lwr	v1,-13984(v0)
+   24460:	27a90028 	addiu	t1,sp,40
+   24464:	24020004 	addiu	v0,zero,4
+   24468:	27a8002c 	addiu	t0,sp,44
+   2446c:	27a70064 	addiu	a3,sp,100
+   24470:	afa40060 	sw	a0,96(sp)
+   24474:	3063ffff 	andi	v1,v1,0xffff
+   24478:	27a40060 	addiu	a0,sp,96
+   2447c:	afa50064 	sw	a1,100(sp)
+   24480:	afa2004c 	sw	v0,76(sp)
+   24484:	00c08021 	addu	s0,a2,zero
+   24488:	afa90030 	sw	t1,48(sp)
+   2448c:	afa80034 	sw	t0,52(sp)
+   24490:	afa20038 	sw	v0,56(sp)
+   24494:	afa2003c 	sw	v0,60(sp)
+   24498:	afa40040 	sw	a0,64(sp)
+   2449c:	afa70044 	sw	a3,68(sp)
+   244a0:	12230020 	beq	s1,v1,24524 <vfat_query_fat+0xec>
+   244a4:	afa20048 	sw	v0,72(sp)
+   244a8:	40127801 	mfc0	s2,$15,1
+   244ac:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   244b0:	00000000 	sll	zero,zero,0x0
+   244b4:	70511802 	mul	v1,v0,s1
+   244b8:	32440003 	andi	a0,s2,0x3
+   244bc:	00642021 	addu	a0,v1,a0
+   244c0:	27a30030 	addiu	v1,sp,48
+   244c4:	afa30018 	sw	v1,24(sp)
+   244c8:	27a30038 	addiu	v1,sp,56
+   244cc:	afa3001c 	sw	v1,28(sp)
+   244d0:	3c070002 	lui	a3,0x2
+   244d4:	27a30040 	addiu	v1,sp,64
+   244d8:	24020002 	addiu	v0,zero,2
+   244dc:	afa30020 	sw	v1,32(sp)
+   244e0:	24e73ab0 	addiu	a3,a3,15024
+   244e4:	27a30048 	addiu	v1,sp,72
+   244e8:	24050001 	addiu	a1,zero,1
+   244ec:	00003021 	addu	a2,zero,zero
+   244f0:	afa30024 	sw	v1,36(sp)
+   244f4:	afa20014 	sw	v0,20(sp)
+   244f8:	0c003de8 	jal	f7a0 <rppc_generic>
+   244fc:	afa20010 	sw	v0,16(sp)
+   24500:	8fa3002c 	lw	v1,44(sp)
+   24504:	8fbf005c 	lw	ra,92(sp)
+   24508:	8fa20028 	lw	v0,40(sp)
+   2450c:	ae030000 	sw	v1,0(s0)
+   24510:	8fb20058 	lw	s2,88(sp)
+   24514:	8fb10054 	lw	s1,84(sp)
+   24518:	8fb00050 	lw	s0,80(sp)
+   2451c:	03e00008 	jr	ra
+   24520:	27bd0060 	addiu	sp,sp,96
+   24524:	27a60060 	addiu	a2,sp,96
+   24528:	01202021 	addu	a0,t1,zero
+   2452c:	0c008e92 	jal	23a48 <__vfat_query_fat_local>
+   24530:	01002821 	addu	a1,t0,zero
+   24534:	8fa3002c 	lw	v1,44(sp)
+   24538:	8fbf005c 	lw	ra,92(sp)
+   2453c:	8fa20028 	lw	v0,40(sp)
+   24540:	ae030000 	sw	v1,0(s0)
+   24544:	8fb20058 	lw	s2,88(sp)
+   24548:	8fb10054 	lw	s1,84(sp)
+   2454c:	8fb00050 	lw	s0,80(sp)
+   24550:	03e00008 	jr	ra
+   24554:	27bd0060 	addiu	sp,sp,96
+
+00024558 <__vfat_cluster_count_main>:
+   24558:	27bdffd0 	addiu	sp,sp,-48
+   2455c:	afb30024 	sw	s3,36(sp)
+   24560:	8fa50040 	lw	a1,64(sp)
+   24564:	3c130fff 	lui	s3,0xfff
+   24568:	afb40028 	sw	s4,40(sp)
+   2456c:	afb20020 	sw	s2,32(sp)
+   24570:	afb1001c 	sw	s1,28(sp)
+   24574:	afb00018 	sw	s0,24(sp)
+   24578:	afbf002c 	sw	ra,44(sp)
+   2457c:	00c08021 	addu	s0,a2,zero
+   24580:	00e0a021 	addu	s4,a3,zero
+   24584:	afa00010 	sw	zero,16(sp)
+   24588:	3673fff8 	ori	s3,s3,0xfff8
+   2458c:	00008821 	addu	s1,zero,zero
+   24590:	27b20010 	addiu	s2,sp,16
+   24594:	02802021 	addu	a0,s4,zero
+   24598:	0c00910e 	jal	24438 <vfat_query_fat>
+   2459c:	02403021 	addu	a2,s2,zero
+   245a0:	8fa50010 	lw	a1,16(sp)
+   245a4:	00b3102b 	sltu	v0,a1,s3
+   245a8:	1440fffa 	bnez	v0,24594 <__vfat_cluster_count_main+0x3c>
+   245ac:	26310001 	addiu	s1,s1,1
+   245b0:	8fbf002c 	lw	ra,44(sp)
+   245b4:	ae110000 	sw	s1,0(s0)
+   245b8:	8fb40028 	lw	s4,40(sp)
+   245bc:	8fb30024 	lw	s3,36(sp)
+   245c0:	8fb20020 	lw	s2,32(sp)
+   245c4:	8fb1001c 	lw	s1,28(sp)
+   245c8:	8fb00018 	lw	s0,24(sp)
+   245cc:	03e00008 	jr	ra
+   245d0:	27bd0030 	addiu	sp,sp,48
+
+000245d4 <__vfat_cluster_count_local>:
+   245d4:	27bdffe0 	addiu	sp,sp,-32
+   245d8:	afbf001c 	sw	ra,28(sp)
+   245dc:	00801821 	addu	v1,a0,zero
+   245e0:	00a01021 	addu	v0,a1,zero
+   245e4:	40077801 	mfc0	a3,$15,1
+   245e8:	3c050004 	lui	a1,0x4
+   245ec:	24a4c960 	addiu	a0,a1,-13984
+   245f0:	88840003 	lwl	a0,3(a0)
+   245f4:	30e70003 	andi	a3,a3,0x3
+   245f8:	3c080004 	lui	t0,0x4
+   245fc:	2508c950 	addiu	t0,t0,-14000
+   24600:	00073880 	sll	a3,a3,0x2
+   24604:	00e83821 	addu	a3,a3,t0
+   24608:	98a4c960 	lwr	a0,-13984(a1)
+   2460c:	8ce50000 	lw	a1,0(a3)
+   24610:	8c470000 	lw	a3,0(v0)
+   24614:	8cc20000 	lw	v0,0(a2)
+   24618:	3084ffff 	andi	a0,a0,0xffff
+   2461c:	00603021 	addu	a2,v1,zero
+   24620:	0c009156 	jal	24558 <__vfat_cluster_count_main>
+   24624:	afa20010 	sw	v0,16(sp)
+   24628:	8fbf001c 	lw	ra,28(sp)
+   2462c:	03e00008 	jr	ra
+   24630:	27bd0020 	addiu	sp,sp,32
+
+00024634 <__vfat_cluster_count_demarshall>:
+   24634:	27bdffc8 	addiu	sp,sp,-56
+   24638:	afbf0034 	sw	ra,52(sp)
+   2463c:	afbe0030 	sw	s8,48(sp)
+   24640:	afb3002c 	sw	s3,44(sp)
+   24644:	03a0f021 	addu	s8,sp,zero
+   24648:	afb20028 	sw	s2,40(sp)
+   2464c:	afb10024 	sw	s1,36(sp)
+   24650:	afb00020 	sw	s0,32(sp)
+   24654:	27bdfff0 	addiu	sp,sp,-16
+   24658:	27b20018 	addiu	s2,sp,24
+   2465c:	27bdffc8 	addiu	sp,sp,-56
+   24660:	27b10018 	addiu	s1,sp,24
+   24664:	00808021 	addu	s0,a0,zero
+   24668:	26220028 	addiu	v0,s1,40
+   2466c:	8c840000 	lw	a0,0(a0)
+   24670:	2403002c 	addiu	v1,zero,44
+   24674:	ae230008 	sw	v1,8(s1)
+   24678:	ae420000 	sw	v0,0(s2)
+   2467c:	24030004 	addiu	v1,zero,4
+   24680:	0c008e5c 	jal	23970 <sysfs_init_node+0x70>
+   24684:	ae230024 	sw	v1,36(s1)
+   24688:	8e460000 	lw	a2,0(s2)
+   2468c:	02002021 	addu	a0,s0,zero
+   24690:	00002821 	addu	a1,zero,zero
+   24694:	8e120000 	lw	s2,0(s0)
+   24698:	afc6001c 	sw	a2,28(s8)
+   2469c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   246a0:	00409821 	addu	s3,v0,zero
+   246a4:	8c470000 	lw	a3,0(v0)
+   246a8:	02002021 	addu	a0,s0,zero
+   246ac:	24050001 	addiu	a1,zero,1
+   246b0:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   246b4:	afc70018 	sw	a3,24(s8)
+   246b8:	8c420000 	lw	v0,0(v0)
+   246bc:	8fc6001c 	lw	a2,28(s8)
+   246c0:	8fc70018 	lw	a3,24(s8)
+   246c4:	3264ffff 	andi	a0,s3,0xffff
+   246c8:	02402821 	addu	a1,s2,zero
+   246cc:	0c009156 	jal	24558 <__vfat_cluster_count_main>
+   246d0:	afa20010 	sw	v0,16(sp)
+   246d4:	02002021 	addu	a0,s0,zero
+   246d8:	02202821 	addu	a1,s1,zero
+   246dc:	2406002c 	addiu	a2,zero,44
+   246e0:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   246e4:	24070001 	addiu	a3,zero,1
+   246e8:	03c0e821 	addu	sp,s8,zero
+   246ec:	8fbf0034 	lw	ra,52(sp)
+   246f0:	8fbe0030 	lw	s8,48(sp)
+   246f4:	8fb3002c 	lw	s3,44(sp)
+   246f8:	8fb20028 	lw	s2,40(sp)
+   246fc:	8fb10024 	lw	s1,36(sp)
+   24700:	8fb00020 	lw	s0,32(sp)
+   24704:	03e00008 	jr	ra
+   24708:	27bd0038 	addiu	sp,sp,56
+
+0002470c <vfat_cluster_count>:
+   2470c:	27bdffa8 	addiu	sp,sp,-88
+   24710:	3c020004 	lui	v0,0x4
+   24714:	afb0004c 	sw	s0,76(sp)
+   24718:	2443c960 	addiu	v1,v0,-13984
+   2471c:	afbf0054 	sw	ra,84(sp)
+   24720:	afb10050 	sw	s1,80(sp)
+   24724:	88630003 	lwl	v1,3(v1)
+   24728:	94900000 	lhu	s0,0(a0)
+   2472c:	9843c960 	lwr	v1,-13984(v0)
+   24730:	27a70028 	addiu	a3,sp,40
+   24734:	24020004 	addiu	v0,zero,4
+   24738:	27a6005c 	addiu	a2,sp,92
+   2473c:	afa40058 	sw	a0,88(sp)
+   24740:	3063ffff 	andi	v1,v1,0xffff
+   24744:	27a40058 	addiu	a0,sp,88
+   24748:	afa5005c 	sw	a1,92(sp)
+   2474c:	afa20040 	sw	v0,64(sp)
+   24750:	afa7002c 	sw	a3,44(sp)
+   24754:	afa20030 	sw	v0,48(sp)
+   24758:	afa40034 	sw	a0,52(sp)
+   2475c:	afa60038 	sw	a2,56(sp)
+   24760:	1203001e 	beq	s0,v1,247dc <vfat_cluster_count+0xd0>
+   24764:	afa2003c 	sw	v0,60(sp)
+   24768:	40117801 	mfc0	s1,$15,1
+   2476c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   24770:	00000000 	sll	zero,zero,0x0
+   24774:	70501802 	mul	v1,v0,s0
+   24778:	24020001 	addiu	v0,zero,1
+   2477c:	afa20010 	sw	v0,16(sp)
+   24780:	24020002 	addiu	v0,zero,2
+   24784:	afa20014 	sw	v0,20(sp)
+   24788:	27a2002c 	addiu	v0,sp,44
+   2478c:	afa20018 	sw	v0,24(sp)
+   24790:	27a20030 	addiu	v0,sp,48
+   24794:	afa2001c 	sw	v0,28(sp)
+   24798:	32240003 	andi	a0,s1,0x3
+   2479c:	27a20034 	addiu	v0,sp,52
+   247a0:	3c070002 	lui	a3,0x2
+   247a4:	afa20020 	sw	v0,32(sp)
+   247a8:	00642021 	addu	a0,v1,a0
+   247ac:	27a2003c 	addiu	v0,sp,60
+   247b0:	24e74634 	addiu	a3,a3,17972
+   247b4:	24050001 	addiu	a1,zero,1
+   247b8:	00003021 	addu	a2,zero,zero
+   247bc:	0c003de8 	jal	f7a0 <rppc_generic>
+   247c0:	afa20024 	sw	v0,36(sp)
+   247c4:	8fbf0054 	lw	ra,84(sp)
+   247c8:	8fa20028 	lw	v0,40(sp)
+   247cc:	8fb10050 	lw	s1,80(sp)
+   247d0:	8fb0004c 	lw	s0,76(sp)
+   247d4:	03e00008 	jr	ra
+   247d8:	27bd0058 	addiu	sp,sp,88
+   247dc:	27a50058 	addiu	a1,sp,88
+   247e0:	0c009175 	jal	245d4 <__vfat_cluster_count_local>
+   247e4:	00e02021 	addu	a0,a3,zero
+   247e8:	8fbf0054 	lw	ra,84(sp)
+   247ec:	8fa20028 	lw	v0,40(sp)
+   247f0:	8fb10050 	lw	s1,80(sp)
+   247f4:	8fb0004c 	lw	s0,76(sp)
+   247f8:	03e00008 	jr	ra
+   247fc:	27bd0058 	addiu	sp,sp,88
+
+00024800 <vfat_free_fat_entry>:
+   24800:	27bdffa8 	addiu	sp,sp,-88
+   24804:	3c020004 	lui	v0,0x4
+   24808:	afb0004c 	sw	s0,76(sp)
+   2480c:	2443c960 	addiu	v1,v0,-13984
+   24810:	afbf0054 	sw	ra,84(sp)
+   24814:	afb10050 	sw	s1,80(sp)
+   24818:	88630003 	lwl	v1,3(v1)
+   2481c:	94900000 	lhu	s0,0(a0)
+   24820:	9843c960 	lwr	v1,-13984(v0)
+   24824:	27a70028 	addiu	a3,sp,40
+   24828:	24020004 	addiu	v0,zero,4
+   2482c:	27a6005c 	addiu	a2,sp,92
+   24830:	afa40058 	sw	a0,88(sp)
+   24834:	3063ffff 	andi	v1,v1,0xffff
+   24838:	27a40058 	addiu	a0,sp,88
+   2483c:	afa5005c 	sw	a1,92(sp)
+   24840:	afa20040 	sw	v0,64(sp)
+   24844:	afa7002c 	sw	a3,44(sp)
+   24848:	afa20030 	sw	v0,48(sp)
+   2484c:	afa40034 	sw	a0,52(sp)
+   24850:	afa60038 	sw	a2,56(sp)
+   24854:	1203001e 	beq	s0,v1,248d0 <vfat_free_fat_entry+0xd0>
+   24858:	afa2003c 	sw	v0,60(sp)
+   2485c:	40117801 	mfc0	s1,$15,1
+   24860:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   24864:	00000000 	sll	zero,zero,0x0
+   24868:	70501802 	mul	v1,v0,s0
+   2486c:	24020001 	addiu	v0,zero,1
+   24870:	afa20010 	sw	v0,16(sp)
+   24874:	24020002 	addiu	v0,zero,2
+   24878:	afa20014 	sw	v0,20(sp)
+   2487c:	27a2002c 	addiu	v0,sp,44
+   24880:	afa20018 	sw	v0,24(sp)
+   24884:	27a20030 	addiu	v0,sp,48
+   24888:	afa2001c 	sw	v0,28(sp)
+   2488c:	32240003 	andi	a0,s1,0x3
+   24890:	27a20034 	addiu	v0,sp,52
+   24894:	3c070002 	lui	a3,0x2
+   24898:	afa20020 	sw	v0,32(sp)
+   2489c:	00642021 	addu	a0,v1,a0
+   248a0:	27a2003c 	addiu	v0,sp,60
+   248a4:	24e73d44 	addiu	a3,a3,15684
+   248a8:	24050001 	addiu	a1,zero,1
+   248ac:	00003021 	addu	a2,zero,zero
+   248b0:	0c003de8 	jal	f7a0 <rppc_generic>
+   248b4:	afa20024 	sw	v0,36(sp)
+   248b8:	8fbf0054 	lw	ra,84(sp)
+   248bc:	8fa20028 	lw	v0,40(sp)
+   248c0:	8fb10050 	lw	s1,80(sp)
+   248c4:	8fb0004c 	lw	s0,76(sp)
+   248c8:	03e00008 	jr	ra
+   248cc:	27bd0058 	addiu	sp,sp,88
+   248d0:	27a50058 	addiu	a1,sp,88
+   248d4:	0c008f87 	jal	23e1c <__vfat_free_fat_entry_local>
+   248d8:	00e02021 	addu	a0,a3,zero
+   248dc:	8fbf0054 	lw	ra,84(sp)
+   248e0:	8fa20028 	lw	v0,40(sp)
+   248e4:	8fb10050 	lw	s1,80(sp)
+   248e8:	8fb0004c 	lw	s0,76(sp)
+   248ec:	03e00008 	jr	ra
+   248f0:	27bd0058 	addiu	sp,sp,88
+
+000248f4 <vfat_alloc_fat_entry>:
+   248f4:	27bdffa8 	addiu	sp,sp,-88
+   248f8:	3c020004 	lui	v0,0x4
+   248fc:	afb1004c 	sw	s1,76(sp)
+   24900:	afb00048 	sw	s0,72(sp)
+   24904:	2443c960 	addiu	v1,v0,-13984
+   24908:	afbf0054 	sw	ra,84(sp)
+   2490c:	afb20050 	sw	s2,80(sp)
+   24910:	88630003 	lwl	v1,3(v1)
+   24914:	94910000 	lhu	s1,0(a0)
+   24918:	9843c960 	lwr	v1,-13984(v0)
+   2491c:	24020004 	addiu	v0,zero,4
+   24920:	27a70028 	addiu	a3,sp,40
+   24924:	27a6002c 	addiu	a2,sp,44
+   24928:	afa20034 	sw	v0,52(sp)
+   2492c:	afa20040 	sw	v0,64(sp)
+   24930:	afa20044 	sw	v0,68(sp)
+   24934:	3063ffff 	andi	v1,v1,0xffff
+   24938:	27a20058 	addiu	v0,sp,88
+   2493c:	afa40058 	sw	a0,88(sp)
+   24940:	00a08021 	addu	s0,a1,zero
+   24944:	afa70038 	sw	a3,56(sp)
+   24948:	afa6003c 	sw	a2,60(sp)
+   2494c:	12230021 	beq	s1,v1,249d4 <vfat_alloc_fat_entry+0xe0>
+   24950:	afa20030 	sw	v0,48(sp)
+   24954:	40127801 	mfc0	s2,$15,1
+   24958:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2495c:	00000000 	sll	zero,zero,0x0
+   24960:	70511802 	mul	v1,v0,s1
+   24964:	24020002 	addiu	v0,zero,2
+   24968:	afa20010 	sw	v0,16(sp)
+   2496c:	24020001 	addiu	v0,zero,1
+   24970:	afa20014 	sw	v0,20(sp)
+   24974:	27a20038 	addiu	v0,sp,56
+   24978:	afa20018 	sw	v0,24(sp)
+   2497c:	27a20040 	addiu	v0,sp,64
+   24980:	afa2001c 	sw	v0,28(sp)
+   24984:	32440003 	andi	a0,s2,0x3
+   24988:	27a20030 	addiu	v0,sp,48
+   2498c:	3c070002 	lui	a3,0x2
+   24990:	afa20020 	sw	v0,32(sp)
+   24994:	00642021 	addu	a0,v1,a0
+   24998:	27a20034 	addiu	v0,sp,52
+   2499c:	24e742fc 	addiu	a3,a3,17148
+   249a0:	24050001 	addiu	a1,zero,1
+   249a4:	00003021 	addu	a2,zero,zero
+   249a8:	0c003de8 	jal	f7a0 <rppc_generic>
+   249ac:	afa20024 	sw	v0,36(sp)
+   249b0:	8fa3002c 	lw	v1,44(sp)
+   249b4:	8fbf0054 	lw	ra,84(sp)
+   249b8:	8fa20028 	lw	v0,40(sp)
+   249bc:	ae030000 	sw	v1,0(s0)
+   249c0:	8fb20050 	lw	s2,80(sp)
+   249c4:	8fb1004c 	lw	s1,76(sp)
+   249c8:	8fb00048 	lw	s0,72(sp)
+   249cc:	03e00008 	jr	ra
+   249d0:	27bd0058 	addiu	sp,sp,88
+   249d4:	00c02821 	addu	a1,a2,zero
+   249d8:	00e02021 	addu	a0,a3,zero
+   249dc:	0c0090f7 	jal	243dc <__vfat_alloc_fat_entry_local>
+   249e0:	00403021 	addu	a2,v0,zero
+   249e4:	8fa3002c 	lw	v1,44(sp)
+   249e8:	8fbf0054 	lw	ra,84(sp)
+   249ec:	8fa20028 	lw	v0,40(sp)
+   249f0:	ae030000 	sw	v1,0(s0)
+   249f4:	8fb20050 	lw	s2,80(sp)
+   249f8:	8fb1004c 	lw	s1,76(sp)
+   249fc:	8fb00048 	lw	s0,72(sp)
+   24a00:	03e00008 	jr	ra
+   24a04:	27bd0058 	addiu	sp,sp,88
+
+00024a08 <__vfat_extend_cluster_main>:
+   24a08:	27bdffb8 	addiu	sp,sp,-72
+   24a0c:	afb00020 	sw	s0,32(sp)
+   24a10:	8fb00058 	lw	s0,88(sp)
+   24a14:	00e02821 	addu	a1,a3,zero
+   24a18:	02002021 	addu	a0,s0,zero
+   24a1c:	afb60038 	sw	s6,56(sp)
+   24a20:	afb40030 	sw	s4,48(sp)
+   24a24:	afb3002c 	sw	s3,44(sp)
+   24a28:	afb20028 	sw	s2,40(sp)
+   24a2c:	afb10024 	sw	s1,36(sp)
+   24a30:	00c09021 	addu	s2,a2,zero
+   24a34:	afbf0044 	sw	ra,68(sp)
+   24a38:	afbe0040 	sw	s8,64(sp)
+   24a3c:	afb7003c 	sw	s7,60(sp)
+   24a40:	afb50034 	sw	s5,52(sp)
+   24a44:	00e09821 	addu	s3,a3,zero
+   24a48:	8fb4005c 	lw	s4,92(sp)
+   24a4c:	8e1100d8 	lw	s1,216(s0)
+   24a50:	0c00923d 	jal	248f4 <vfat_alloc_fat_entry>
+   24a54:	8e1600f4 	lw	s6,244(s0)
+   24a58:	1440003b 	bnez	v0,24b48 <__vfat_extend_cluster_main+0x140>
+   24a5c:	ae420000 	sw	v0,0(s2)
+   24a60:	00141080 	sll	v0,s4,0x2
+   24a64:	0051001b 	divu	zero,v0,s1
+   24a68:	022001f4 	teq	s1,zero,0x7
+   24a6c:	24171000 	addiu	s7,zero,4096
+   24a70:	8e0200d0 	lw	v0,208(s0)
+   24a74:	ae400000 	sw	zero,0(s2)
+   24a78:	02c02021 	addu	a0,s6,zero
+   24a7c:	24060001 	addiu	a2,zero,1
+   24a80:	00002812 	mflo	a1
+   24a84:	02f1001b 	divu	zero,s7,s1
+   24a88:	022001f4 	teq	s1,zero,0x7
+   24a8c:	00a22821 	addu	a1,a1,v0
+   24a90:	0000b812 	mflo	s7
+   24a94:	00b7001b 	divu	zero,a1,s7
+   24a98:	02e001f4 	teq	s7,zero,0x7
+   24a9c:	00001010 	mfhi	v0
+   24aa0:	00002812 	mflo	a1
+   24aa4:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   24aa8:	afa20010 	sw	v0,16(sp)
+   24aac:	10400056 	beqz	v0,24c08 <__vfat_extend_cluster_main+0x200>
+   24ab0:	00402021 	addu	a0,v0,zero
+   24ab4:	0c007c15 	jal	1f054 <ppm_page2addr>
+   24ab8:	afa20018 	sw	v0,24(sp)
+   24abc:	8fa30018 	lw	v1,24(sp)
+   24ac0:	0011a882 	srl	s5,s1,0x2
+   24ac4:	00602021 	addu	a0,v1,zero
+   24ac8:	0c007a7a 	jal	1e9e8 <page_lock>
+   24acc:	afa20014 	sw	v0,20(sp)
+   24ad0:	0295001b 	divu	zero,s4,s5
+   24ad4:	02a001f4 	teq	s5,zero,0x7
+   24ad8:	8fa60010 	lw	a2,16(sp)
+   24adc:	0015f080 	sll	s8,s5,0x2
+   24ae0:	8fa20014 	lw	v0,20(sp)
+   24ae4:	3c040fff 	lui	a0,0xfff
+   24ae8:	3485ffff 	ori	a1,a0,0xffff
+   24aec:	3484fff8 	ori	a0,a0,0xfff8
+   24af0:	0000a010 	mfhi	s4
+   24af4:	70de3802 	mul	a3,a2,s8
+   24af8:	0014a080 	sll	s4,s4,0x2
+   24afc:	00e21021 	addu	v0,a3,v0
+   24b00:	0054a021 	addu	s4,v0,s4
+   24b04:	8e820000 	lw	v0,0(s4)
+   24b08:	00451024 	and	v0,v0,a1
+   24b0c:	0044202b 	sltu	a0,v0,a0
+   24b10:	14800019 	bnez	a0,24b78 <__vfat_extend_cluster_main+0x170>
+   24b14:	8fa30018 	lw	v1,24(sp)
+   24b18:	8e620000 	lw	v0,0(s3)
+   24b1c:	ae820000 	sw	v0,0(s4)
+   24b20:	8ec20000 	lw	v0,0(s6)
+   24b24:	8c4200a4 	lw	v0,164(v0)
+   24b28:	afa30018 	sw	v1,24(sp)
+   24b2c:	8c42000c 	lw	v0,12(v0)
+   24b30:	0040f809 	jalr	v0
+   24b34:	00602021 	addu	a0,v1,zero
+   24b38:	8fa30018 	lw	v1,24(sp)
+   24b3c:	0c007a5c 	jal	1e970 <page_unlock>
+   24b40:	00602021 	addu	a0,v1,zero
+   24b44:	ae400000 	sw	zero,0(s2)
+   24b48:	8fbf0044 	lw	ra,68(sp)
+   24b4c:	8fbe0040 	lw	s8,64(sp)
+   24b50:	8fb7003c 	lw	s7,60(sp)
+   24b54:	8fb60038 	lw	s6,56(sp)
+   24b58:	8fb50034 	lw	s5,52(sp)
+   24b5c:	8fb40030 	lw	s4,48(sp)
+   24b60:	8fb3002c 	lw	s3,44(sp)
+   24b64:	8fb20028 	lw	s2,40(sp)
+   24b68:	8fb10024 	lw	s1,36(sp)
+   24b6c:	8fb00020 	lw	s0,32(sp)
+   24b70:	03e00008 	jr	ra
+   24b74:	27bd0048 	addiu	sp,sp,72
+   24b78:	0c007a5c 	jal	1e970 <page_unlock>
+   24b7c:	00602021 	addu	a0,v1,zero
+   24b80:	8e630000 	lw	v1,0(s3)
+   24b84:	8e0200d0 	lw	v0,208(s0)
+   24b88:	00031880 	sll	v1,v1,0x2
+   24b8c:	0071001b 	divu	zero,v1,s1
+   24b90:	022001f4 	teq	s1,zero,0x7
+   24b94:	02c02021 	addu	a0,s6,zero
+   24b98:	24060001 	addiu	a2,zero,1
+   24b9c:	00008812 	mflo	s1
+   24ba0:	02228821 	addu	s1,s1,v0
+   24ba4:	0237001b 	divu	zero,s1,s7
+   24ba8:	02e001f4 	teq	s7,zero,0x7
+   24bac:	00002812 	mflo	a1
+   24bb0:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   24bb4:	00008810 	mfhi	s1
+   24bb8:	10400013 	beqz	v0,24c08 <__vfat_extend_cluster_main+0x200>
+   24bbc:	00402021 	addu	a0,v0,zero
+   24bc0:	0c007c15 	jal	1f054 <ppm_page2addr>
+   24bc4:	afa20018 	sw	v0,24(sp)
+   24bc8:	8fa30018 	lw	v1,24(sp)
+   24bcc:	afa20014 	sw	v0,20(sp)
+   24bd0:	0c007a7a 	jal	1e9e8 <page_lock>
+   24bd4:	00602021 	addu	a0,v1,zero
+   24bd8:	8e640000 	lw	a0,0(s3)
+   24bdc:	8fa20014 	lw	v0,20(sp)
+   24be0:	0095001b 	divu	zero,a0,s5
+   24be4:	02a001f4 	teq	s5,zero,0x7
+   24be8:	8fa30018 	lw	v1,24(sp)
+   24bec:	0000a810 	mfhi	s5
+   24bf0:	723e2002 	mul	a0,s1,s8
+   24bf4:	0015a880 	sll	s5,s5,0x2
+   24bf8:	00551021 	addu	v0,v0,s5
+   24bfc:	0082f021 	addu	s8,a0,v0
+   24c00:	080092c8 	j	24b20 <__vfat_extend_cluster_main+0x118>
+   24c04:	afc00000 	sw	zero,0(s8)
+   24c08:	8e650000 	lw	a1,0(s3)
+   24c0c:	0c009200 	jal	24800 <vfat_free_fat_entry>
+   24c10:	02002021 	addu	a0,s0,zero
+   24c14:	8fbf0044 	lw	ra,68(sp)
+   24c18:	2402ffff 	addiu	v0,zero,-1
+   24c1c:	ae420000 	sw	v0,0(s2)
+   24c20:	ae600000 	sw	zero,0(s3)
+   24c24:	8fbe0040 	lw	s8,64(sp)
+   24c28:	8fb7003c 	lw	s7,60(sp)
+   24c2c:	8fb60038 	lw	s6,56(sp)
+   24c30:	8fb50034 	lw	s5,52(sp)
+   24c34:	8fb40030 	lw	s4,48(sp)
+   24c38:	8fb3002c 	lw	s3,44(sp)
+   24c3c:	8fb20028 	lw	s2,40(sp)
+   24c40:	8fb10024 	lw	s1,36(sp)
+   24c44:	8fb00020 	lw	s0,32(sp)
+   24c48:	03e00008 	jr	ra
+   24c4c:	27bd0048 	addiu	sp,sp,72
+
+00024c50 <__vfat_extend_cluster_demarshall>:
+   24c50:	27bdffc0 	addiu	sp,sp,-64
+   24c54:	afbf003c 	sw	ra,60(sp)
+   24c58:	afbe0038 	sw	s8,56(sp)
+   24c5c:	afb40034 	sw	s4,52(sp)
+   24c60:	03a0f021 	addu	s8,sp,zero
+   24c64:	afb30030 	sw	s3,48(sp)
+   24c68:	afb2002c 	sw	s2,44(sp)
+   24c6c:	afb10028 	sw	s1,40(sp)
+   24c70:	afb00024 	sw	s0,36(sp)
+   24c74:	27bdfff0 	addiu	sp,sp,-16
+   24c78:	27b40018 	addiu	s4,sp,24
+   24c7c:	27bdffc0 	addiu	sp,sp,-64
+   24c80:	27b00018 	addiu	s0,sp,24
+   24c84:	26030030 	addiu	v1,s0,48
+   24c88:	00808821 	addu	s1,a0,zero
+   24c8c:	2605002c 	addiu	a1,s0,44
+   24c90:	8c840000 	lw	a0,0(a0)
+   24c94:	ae830004 	sw	v1,4(s4)
+   24c98:	24020004 	addiu	v0,zero,4
+   24c9c:	24060034 	addiu	a2,zero,52
+   24ca0:	ae850000 	sw	a1,0(s4)
+   24ca4:	ae060008 	sw	a2,8(s0)
+   24ca8:	ae020028 	sw	v0,40(s0)
+   24cac:	0c008e5c 	jal	23970 <sysfs_init_node+0x70>
+   24cb0:	ae020024 	sw	v0,36(s0)
+   24cb4:	8e870004 	lw	a3,4(s4)
+   24cb8:	8e860000 	lw	a2,0(s4)
+   24cbc:	02202021 	addu	a0,s1,zero
+   24cc0:	00002821 	addu	a1,zero,zero
+   24cc4:	8e320000 	lw	s2,0(s1)
+   24cc8:	afc6001c 	sw	a2,28(s8)
+   24ccc:	afc70018 	sw	a3,24(s8)
+   24cd0:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   24cd4:	00409821 	addu	s3,v0,zero
+   24cd8:	8c540000 	lw	s4,0(v0)
+   24cdc:	02202021 	addu	a0,s1,zero
+   24ce0:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   24ce4:	24050001 	addiu	a1,zero,1
+   24ce8:	afb40010 	sw	s4,16(sp)
+   24cec:	8c420000 	lw	v0,0(v0)
+   24cf0:	8fc6001c 	lw	a2,28(s8)
+   24cf4:	8fc70018 	lw	a3,24(s8)
+   24cf8:	3264ffff 	andi	a0,s3,0xffff
+   24cfc:	02402821 	addu	a1,s2,zero
+   24d00:	0c009282 	jal	24a08 <__vfat_extend_cluster_main>
+   24d04:	afa20014 	sw	v0,20(sp)
+   24d08:	02202021 	addu	a0,s1,zero
+   24d0c:	02002821 	addu	a1,s0,zero
+   24d10:	24060034 	addiu	a2,zero,52
+   24d14:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   24d18:	24070002 	addiu	a3,zero,2
+   24d1c:	03c0e821 	addu	sp,s8,zero
+   24d20:	8fbf003c 	lw	ra,60(sp)
+   24d24:	8fbe0038 	lw	s8,56(sp)
+   24d28:	8fb40034 	lw	s4,52(sp)
+   24d2c:	8fb30030 	lw	s3,48(sp)
+   24d30:	8fb2002c 	lw	s2,44(sp)
+   24d34:	8fb10028 	lw	s1,40(sp)
+   24d38:	8fb00024 	lw	s0,36(sp)
+   24d3c:	03e00008 	jr	ra
+   24d40:	27bd0040 	addiu	sp,sp,64
+
+00024d44 <__vfat_extend_cluster_local>:
+   24d44:	27bdffe0 	addiu	sp,sp,-32
+   24d48:	afbf001c 	sw	ra,28(sp)
+   24d4c:	00804821 	addu	t1,a0,zero
+   24d50:	00a04021 	addu	t0,a1,zero
+   24d54:	40037801 	mfc0	v1,$15,1
+   24d58:	3c020004 	lui	v0,0x4
+   24d5c:	2444c960 	addiu	a0,v0,-13984
+   24d60:	88840003 	lwl	a0,3(a0)
+   24d64:	30630003 	andi	v1,v1,0x3
+   24d68:	3c050004 	lui	a1,0x4
+   24d6c:	24a5c950 	addiu	a1,a1,-14000
+   24d70:	00031880 	sll	v1,v1,0x2
+   24d74:	9844c960 	lwr	a0,-13984(v0)
+   24d78:	00651821 	addu	v1,v1,a1
+   24d7c:	8c650000 	lw	a1,0(v1)
+   24d80:	8ce20000 	lw	v0,0(a3)
+   24d84:	8cc30000 	lw	v1,0(a2)
+   24d88:	3084ffff 	andi	a0,a0,0xffff
+   24d8c:	01203021 	addu	a2,t1,zero
+   24d90:	01003821 	addu	a3,t0,zero
+   24d94:	afa30010 	sw	v1,16(sp)
+   24d98:	0c009282 	jal	24a08 <__vfat_extend_cluster_main>
+   24d9c:	afa20014 	sw	v0,20(sp)
+   24da0:	8fbf001c 	lw	ra,28(sp)
+   24da4:	03e00008 	jr	ra
+   24da8:	27bd0020 	addiu	sp,sp,32
+
+00024dac <vfat_extend_cluster>:
+   24dac:	27bdffa0 	addiu	sp,sp,-96
+   24db0:	3c020004 	lui	v0,0x4
+   24db4:	afb10054 	sw	s1,84(sp)
+   24db8:	afb00050 	sw	s0,80(sp)
+   24dbc:	2443c960 	addiu	v1,v0,-13984
+   24dc0:	afbf005c 	sw	ra,92(sp)
+   24dc4:	afb20058 	sw	s2,88(sp)
+   24dc8:	88630003 	lwl	v1,3(v1)
+   24dcc:	94910000 	lhu	s1,0(a0)
+   24dd0:	9843c960 	lwr	v1,-13984(v0)
+   24dd4:	27a90028 	addiu	t1,sp,40
+   24dd8:	24020004 	addiu	v0,zero,4
+   24ddc:	27a8002c 	addiu	t0,sp,44
+   24de0:	27a70064 	addiu	a3,sp,100
+   24de4:	afa40060 	sw	a0,96(sp)
+   24de8:	3063ffff 	andi	v1,v1,0xffff
+   24dec:	27a40060 	addiu	a0,sp,96
+   24df0:	afa50064 	sw	a1,100(sp)
+   24df4:	afa2004c 	sw	v0,76(sp)
+   24df8:	00c08021 	addu	s0,a2,zero
+   24dfc:	afa90030 	sw	t1,48(sp)
+   24e00:	afa80034 	sw	t0,52(sp)
+   24e04:	afa20038 	sw	v0,56(sp)
+   24e08:	afa2003c 	sw	v0,60(sp)
+   24e0c:	afa40040 	sw	a0,64(sp)
+   24e10:	afa70044 	sw	a3,68(sp)
+   24e14:	12230020 	beq	s1,v1,24e98 <vfat_extend_cluster+0xec>
+   24e18:	afa20048 	sw	v0,72(sp)
+   24e1c:	40127801 	mfc0	s2,$15,1
+   24e20:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   24e24:	00000000 	sll	zero,zero,0x0
+   24e28:	70511802 	mul	v1,v0,s1
+   24e2c:	32440003 	andi	a0,s2,0x3
+   24e30:	00642021 	addu	a0,v1,a0
+   24e34:	27a30030 	addiu	v1,sp,48
+   24e38:	afa30018 	sw	v1,24(sp)
+   24e3c:	27a30038 	addiu	v1,sp,56
+   24e40:	afa3001c 	sw	v1,28(sp)
+   24e44:	3c070002 	lui	a3,0x2
+   24e48:	27a30040 	addiu	v1,sp,64
+   24e4c:	24020002 	addiu	v0,zero,2
+   24e50:	afa30020 	sw	v1,32(sp)
+   24e54:	24e74c50 	addiu	a3,a3,19536
+   24e58:	27a30048 	addiu	v1,sp,72
+   24e5c:	24050001 	addiu	a1,zero,1
+   24e60:	00003021 	addu	a2,zero,zero
+   24e64:	afa30024 	sw	v1,36(sp)
+   24e68:	afa20014 	sw	v0,20(sp)
+   24e6c:	0c003de8 	jal	f7a0 <rppc_generic>
+   24e70:	afa20010 	sw	v0,16(sp)
+   24e74:	8fa3002c 	lw	v1,44(sp)
+   24e78:	8fbf005c 	lw	ra,92(sp)
+   24e7c:	8fa20028 	lw	v0,40(sp)
+   24e80:	ae030000 	sw	v1,0(s0)
+   24e84:	8fb20058 	lw	s2,88(sp)
+   24e88:	8fb10054 	lw	s1,84(sp)
+   24e8c:	8fb00050 	lw	s0,80(sp)
+   24e90:	03e00008 	jr	ra
+   24e94:	27bd0060 	addiu	sp,sp,96
+   24e98:	27a60060 	addiu	a2,sp,96
+   24e9c:	01202021 	addu	a0,t1,zero
+   24ea0:	0c009351 	jal	24d44 <__vfat_extend_cluster_local>
+   24ea4:	01002821 	addu	a1,t0,zero
+   24ea8:	8fa3002c 	lw	v1,44(sp)
+   24eac:	8fbf005c 	lw	ra,92(sp)
+   24eb0:	8fa20028 	lw	v0,40(sp)
+   24eb4:	ae030000 	sw	v1,0(s0)
+   24eb8:	8fb20058 	lw	s2,88(sp)
+   24ebc:	8fb10054 	lw	s1,84(sp)
+   24ec0:	8fb00050 	lw	s0,80(sp)
+   24ec4:	03e00008 	jr	ra
+   24ec8:	27bd0060 	addiu	sp,sp,96
+
+00024ecc <__vfat_cluster_lookup_main>:
+   24ecc:	27bdffc0 	addiu	sp,sp,-64
+   24ed0:	afb00018 	sw	s0,24(sp)
+   24ed4:	8fb00054 	lw	s0,84(sp)
+   24ed8:	afb40028 	sw	s4,40(sp)
+   24edc:	8e1400d8 	lw	s4,216(s0)
+   24ee0:	8e0200d0 	lw	v0,208(s0)
+   24ee4:	0014a082 	srl	s4,s4,0x2
+   24ee8:	72821802 	mul	v1,s4,v0
+   24eec:	afb70034 	sw	s7,52(sp)
+   24ef0:	8fb70058 	lw	s7,88(sp)
+   24ef4:	afb30024 	sw	s3,36(sp)
+   24ef8:	afb20020 	sw	s2,32(sp)
+   24efc:	0077a021 	addu	s4,v1,s7
+   24f00:	8fb30050 	lw	s3,80(sp)
+   24f04:	8e1200f4 	lw	s2,244(s0)
+   24f08:	afb1001c 	sw	s1,28(sp)
+   24f0c:	00148a82 	srl	s1,s4,0xa
+   24f10:	afa60048 	sw	a2,72(sp)
+   24f14:	ae600000 	sw	zero,0(s3)
+   24f18:	02402021 	addu	a0,s2,zero
+   24f1c:	02202821 	addu	a1,s1,zero
+   24f20:	24060001 	addiu	a2,zero,1
+   24f24:	afbf003c 	sw	ra,60(sp)
+   24f28:	afbe0038 	sw	s8,56(sp)
+   24f2c:	afb60030 	sw	s6,48(sp)
+   24f30:	afb5002c 	sw	s5,44(sp)
+   24f34:	afa7004c 	sw	a3,76(sp)
+   24f38:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   24f3c:	afa00010 	sw	zero,16(sp)
+   24f40:	10400042 	beqz	v0,2504c <__vfat_cluster_lookup_main+0x180>
+   24f44:	8fa30048 	lw	v1,72(sp)
+   24f48:	0c007c15 	jal	1f054 <ppm_page2addr>
+   24f4c:	00402021 	addu	a0,v0,zero
+   24f50:	8fa3005c 	lw	v1,92(sp)
+   24f54:	1060004b 	beqz	v1,25084 <__vfat_cluster_lookup_main+0x1b8>
+   24f58:	329403ff 	andi	s4,s4,0x3ff
+   24f5c:	0014a080 	sll	s4,s4,0x2
+   24f60:	0054a021 	addu	s4,v0,s4
+   24f64:	3c030fff 	lui	v1,0xfff
+   24f68:	0040f021 	addu	s8,v0,zero
+   24f6c:	8e820000 	lw	v0,0(s4)
+   24f70:	3465ffff 	ori	a1,v1,0xffff
+   24f74:	00451024 	and	v0,v0,a1
+   24f78:	3464fff7 	ori	a0,v1,0xfff7
+   24f7c:	10440051 	beq	v0,a0,250c4 <__vfat_cluster_lookup_main+0x1f8>
+   24f80:	0000a821 	addu	s5,zero,zero
+   24f84:	08009405 	j	25014 <__vfat_cluster_lookup_main+0x148>
+   24f88:	afa20010 	sw	v0,16(sp)
+   24f8c:	8fb70010 	lw	s7,16(sp)
+   24f90:	8e1600d8 	lw	s6,216(s0)
+   24f94:	8e0200d0 	lw	v0,208(s0)
+   24f98:	0016b082 	srl	s6,s6,0x2
+   24f9c:	72c21802 	mul	v1,s6,v0
+   24fa0:	0077b021 	addu	s6,v1,s7
+   24fa4:	0016a282 	srl	s4,s6,0xa
+   24fa8:	12910009 	beq	s4,s1,24fd0 <__vfat_cluster_lookup_main+0x104>
+   24fac:	02802821 	addu	a1,s4,zero
+   24fb0:	02402021 	addu	a0,s2,zero
+   24fb4:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   24fb8:	24060001 	addiu	a2,zero,1
+   24fbc:	10400023 	beqz	v0,2504c <__vfat_cluster_lookup_main+0x180>
+   24fc0:	8fa30048 	lw	v1,72(sp)
+   24fc4:	0c007c15 	jal	1f054 <ppm_page2addr>
+   24fc8:	00402021 	addu	a0,v0,zero
+   24fcc:	0040f021 	addu	s8,v0,zero
+   24fd0:	8fa3005c 	lw	v1,92(sp)
+   24fd4:	26b50001 	addiu	s5,s5,1
+   24fd8:	02a3102b 	sltu	v0,s5,v1
+   24fdc:	10400029 	beqz	v0,25084 <__vfat_cluster_lookup_main+0x1b8>
+   24fe0:	32d603ff 	andi	s6,s6,0x3ff
+   24fe4:	0016b080 	sll	s6,s6,0x2
+   24fe8:	03d6b021 	addu	s6,s8,s6
+   24fec:	8ec20000 	lw	v0,0(s6)
+   24ff0:	3c030fff 	lui	v1,0xfff
+   24ff4:	3463ffff 	ori	v1,v1,0xffff
+   24ff8:	00431024 	and	v0,v0,v1
+   24ffc:	3c030fff 	lui	v1,0xfff
+   25000:	3463fff7 	ori	v1,v1,0xfff7
+   25004:	1043002f 	beq	v0,v1,250c4 <__vfat_cluster_lookup_main+0x1f8>
+   25008:	02808821 	addu	s1,s4,zero
+   2500c:	afa20010 	sw	v0,16(sp)
+   25010:	3c030fff 	lui	v1,0xfff
+   25014:	3463fff8 	ori	v1,v1,0xfff8
+   25018:	0043102b 	sltu	v0,v0,v1
+   2501c:	1440ffdb 	bnez	v0,24f8c <__vfat_cluster_lookup_main+0xc0>
+   25020:	02e02821 	addu	a1,s7,zero
+   25024:	02002021 	addu	a0,s0,zero
+   25028:	0c00936b 	jal	24dac <vfat_extend_cluster>
+   2502c:	27a60010 	addiu	a2,sp,16
+   25030:	14400005 	bnez	v0,25048 <__vfat_cluster_lookup_main+0x17c>
+   25034:	8fb70010 	lw	s7,16(sp)
+   25038:	12e00031 	beqz	s7,25100 <__vfat_cluster_lookup_main+0x234>
+   2503c:	24020001 	addiu	v0,zero,1
+   25040:	080093e4 	j	24f90 <__vfat_cluster_lookup_main+0xc4>
+   25044:	ae620000 	sw	v0,0(s3)
+   25048:	8fa30048 	lw	v1,72(sp)
+   2504c:	24020005 	addiu	v0,zero,5
+   25050:	ac620000 	sw	v0,0(v1)
+   25054:	8fbf003c 	lw	ra,60(sp)
+   25058:	8fbe0038 	lw	s8,56(sp)
+   2505c:	8fb70034 	lw	s7,52(sp)
+   25060:	8fb60030 	lw	s6,48(sp)
+   25064:	8fb5002c 	lw	s5,44(sp)
+   25068:	8fb40028 	lw	s4,40(sp)
+   2506c:	8fb30024 	lw	s3,36(sp)
+   25070:	8fb20020 	lw	s2,32(sp)
+   25074:	8fb1001c 	lw	s1,28(sp)
+   25078:	8fb00018 	lw	s0,24(sp)
+   2507c:	03e00008 	jr	ra
+   25080:	27bd0040 	addiu	sp,sp,64
+   25084:	8fa2004c 	lw	v0,76(sp)
+   25088:	8fa30048 	lw	v1,72(sp)
+   2508c:	8fbf003c 	lw	ra,60(sp)
+   25090:	ac570000 	sw	s7,0(v0)
+   25094:	8fbe0038 	lw	s8,56(sp)
+   25098:	8fb70034 	lw	s7,52(sp)
+   2509c:	8fb60030 	lw	s6,48(sp)
+   250a0:	8fb5002c 	lw	s5,44(sp)
+   250a4:	8fb40028 	lw	s4,40(sp)
+   250a8:	8fb30024 	lw	s3,36(sp)
+   250ac:	8fb20020 	lw	s2,32(sp)
+   250b0:	8fb1001c 	lw	s1,28(sp)
+   250b4:	8fb00018 	lw	s0,24(sp)
+   250b8:	ac600000 	sw	zero,0(v1)
+   250bc:	03e00008 	jr	ra
+   250c0:	27bd0040 	addiu	sp,sp,64
+   250c4:	8fa30048 	lw	v1,72(sp)
+   250c8:	8fbf003c 	lw	ra,60(sp)
+   250cc:	2402007c 	addiu	v0,zero,124
+   250d0:	8fbe0038 	lw	s8,56(sp)
+   250d4:	8fb70034 	lw	s7,52(sp)
+   250d8:	8fb60030 	lw	s6,48(sp)
+   250dc:	8fb5002c 	lw	s5,44(sp)
+   250e0:	8fb40028 	lw	s4,40(sp)
+   250e4:	8fb30024 	lw	s3,36(sp)
+   250e8:	8fb20020 	lw	s2,32(sp)
+   250ec:	8fb1001c 	lw	s1,28(sp)
+   250f0:	8fb00018 	lw	s0,24(sp)
+   250f4:	ac620000 	sw	v0,0(v1)
+   250f8:	03e00008 	jr	ra
+   250fc:	27bd0040 	addiu	sp,sp,64
+   25100:	8fa30048 	lw	v1,72(sp)
+   25104:	2402001c 	addiu	v0,zero,28
+   25108:	08009415 	j	25054 <__vfat_cluster_lookup_main+0x188>
+   2510c:	ac620000 	sw	v0,0(v1)
+
+00025110 <__vfat_cluster_lookup_demarshall>:
+   25110:	27bdffa0 	addiu	sp,sp,-96
+   25114:	24020004 	addiu	v0,zero,4
+   25118:	afbe0058 	sw	s8,88(sp)
+   2511c:	afb5004c 	sw	s5,76(sp)
+   25120:	03a0f021 	addu	s8,sp,zero
+   25124:	afb1003c 	sw	s1,60(sp)
+   25128:	afb00038 	sw	s0,56(sp)
+   2512c:	afbf005c 	sw	ra,92(sp)
+   25130:	afb70054 	sw	s7,84(sp)
+   25134:	afb60050 	sw	s6,80(sp)
+   25138:	afb40048 	sw	s4,72(sp)
+   2513c:	afb30044 	sw	s3,68(sp)
+   25140:	afb20040 	sw	s2,64(sp)
+   25144:	27bdffe8 	addiu	sp,sp,-24
+   25148:	00808821 	addu	s1,a0,zero
+   2514c:	afc20028 	sw	v0,40(s8)
+   25150:	afc20020 	sw	v0,32(s8)
+   25154:	afc20024 	sw	v0,36(s8)
+   25158:	27b50020 	addiu	s5,sp,32
+   2515c:	27c30024 	addiu	v1,s8,36
+   25160:	27c5002c 	addiu	a1,s8,44
+   25164:	24100024 	addiu	s0,zero,36
+   25168:	2404fffc 	addiu	a0,zero,-4
+   2516c:	30470003 	andi	a3,v0,0x3
+   25170:	10e00007 	beqz	a3,25190 <__vfat_cluster_lookup_demarshall+0x80>
+   25174:	00443024 	and	a2,v0,a0
+   25178:	24c20008 	addiu	v0,a2,8
+   2517c:	10650006 	beq	v1,a1,25198 <__vfat_cluster_lookup_demarshall+0x88>
+   25180:	02028021 	addu	s0,s0,v0
+   25184:	8c620000 	lw	v0,0(v1)
+   25188:	0800945b 	j	2516c <__vfat_cluster_lookup_demarshall+0x5c>
+   2518c:	24630004 	addiu	v1,v1,4
+   25190:	0800945f 	j	2517c <__vfat_cluster_lookup_demarshall+0x6c>
+   25194:	24420004 	addiu	v0,v0,4
+   25198:	2e020801 	sltiu	v0,s0,2049
+   2519c:	1440000a 	bnez	v0,251c8 <__vfat_cluster_lookup_demarshall+0xb8>
+   251a0:	26020012 	addiu	v0,s0,18
+   251a4:	3c110003 	lui	s1,0x3
+   251a8:	26315a60 	addiu	s1,s1,23136
+   251ac:	3c100004 	lui	s0,0x4
+   251b0:	8e049100 	lw	a0,-28416(s0)
+   251b4:	00002821 	addu	a1,zero,zero
+   251b8:	0c0009b0 	jal	26c0 <__fprintk>
+   251bc:	02203021 	addu	a2,s1,zero
+   251c0:	0800946d 	j	251b4 <__vfat_cluster_lookup_demarshall+0xa4>
+   251c4:	8e049100 	lw	a0,-28416(s0)
+   251c8:	000210c2 	srl	v0,v0,0x3
+   251cc:	000210c0 	sll	v0,v0,0x3
+   251d0:	03a2e823 	subu	sp,sp,v0
+   251d4:	27b20020 	addiu	s2,sp,32
+   251d8:	26420024 	addiu	v0,s2,36
+   251dc:	24030004 	addiu	v1,zero,4
+   251e0:	ae430024 	sw	v1,36(s2)
+   251e4:	ac430008 	sw	v1,8(v0)
+   251e8:	8fc30024 	lw	v1,36(s8)
+   251ec:	ae500008 	sw	s0,8(s2)
+   251f0:	ac430004 	sw	v1,4(v0)
+   251f4:	26440030 	addiu	a0,s2,48
+   251f8:	00001821 	addu	v1,zero,zero
+   251fc:	24020004 	addiu	v0,zero,4
+   25200:	2407fffc 	addiu	a3,zero,-4
+   25204:	2406000c 	addiu	a2,zero,12
+   25208:	08009485 	j	25214 <__vfat_cluster_lookup_demarshall+0x104>
+   2520c:	27c50020 	addiu	a1,s8,32
+   25210:	8d020000 	lw	v0,0(t0)
+   25214:	02a35821 	addu	t3,s5,v1
+   25218:	304a0003 	andi	t2,v0,0x3
+   2521c:	24630004 	addiu	v1,v1,4
+   25220:	00474824 	and	t1,v0,a3
+   25224:	00a34021 	addu	t0,a1,v1
+   25228:	11400002 	beqz	t2,25234 <__vfat_cluster_lookup_demarshall+0x124>
+   2522c:	ad640000 	sw	a0,0(t3)
+   25230:	25220004 	addiu	v0,t1,4
+   25234:	1466fff6 	bne	v1,a2,25210 <__vfat_cluster_lookup_demarshall+0x100>
+   25238:	00822021 	addu	a0,a0,v0
+   2523c:	0c008e5c 	jal	23970 <sysfs_init_node+0x70>
+   25240:	8e240000 	lw	a0,0(s1)
+   25244:	8ea60000 	lw	a2,0(s5)
+   25248:	8ea70004 	lw	a3,4(s5)
+   2524c:	02202021 	addu	a0,s1,zero
+   25250:	00002821 	addu	a1,zero,zero
+   25254:	afc60034 	sw	a2,52(s8)
+   25258:	afc70030 	sw	a3,48(s8)
+   2525c:	8eb70008 	lw	s7,8(s5)
+   25260:	8e330000 	lw	s3,0(s1)
+   25264:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   25268:	0040a021 	addu	s4,v0,zero
+   2526c:	02202021 	addu	a0,s1,zero
+   25270:	24050001 	addiu	a1,zero,1
+   25274:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   25278:	8c560000 	lw	s6,0(v0)
+   2527c:	8c550000 	lw	s5,0(v0)
+   25280:	02202021 	addu	a0,s1,zero
+   25284:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   25288:	24050002 	addiu	a1,zero,2
+   2528c:	afb70010 	sw	s7,16(sp)
+   25290:	afb60014 	sw	s6,20(sp)
+   25294:	afb50018 	sw	s5,24(sp)
+   25298:	8c420000 	lw	v0,0(v0)
+   2529c:	8fc70030 	lw	a3,48(s8)
+   252a0:	8fc60034 	lw	a2,52(s8)
+   252a4:	3284ffff 	andi	a0,s4,0xffff
+   252a8:	02602821 	addu	a1,s3,zero
+   252ac:	0c0093b3 	jal	24ecc <__vfat_cluster_lookup_main>
+   252b0:	afa2001c 	sw	v0,28(sp)
+   252b4:	02202021 	addu	a0,s1,zero
+   252b8:	02402821 	addu	a1,s2,zero
+   252bc:	02003021 	addu	a2,s0,zero
+   252c0:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   252c4:	24070003 	addiu	a3,zero,3
+   252c8:	03c0e821 	addu	sp,s8,zero
+   252cc:	8fbf005c 	lw	ra,92(sp)
+   252d0:	8fbe0058 	lw	s8,88(sp)
+   252d4:	8fb70054 	lw	s7,84(sp)
+   252d8:	8fb60050 	lw	s6,80(sp)
+   252dc:	8fb5004c 	lw	s5,76(sp)
+   252e0:	8fb40048 	lw	s4,72(sp)
+   252e4:	8fb30044 	lw	s3,68(sp)
+   252e8:	8fb20040 	lw	s2,64(sp)
+   252ec:	8fb1003c 	lw	s1,60(sp)
+   252f0:	8fb00038 	lw	s0,56(sp)
+   252f4:	03e00008 	jr	ra
+   252f8:	27bd0060 	addiu	sp,sp,96
+
+000252fc <__vfat_cluster_lookup_local>:
+   252fc:	27bdffd8 	addiu	sp,sp,-40
+   25300:	afbf0024 	sw	ra,36(sp)
+   25304:	00805821 	addu	t3,a0,zero
+   25308:	00a05021 	addu	t2,a1,zero
+   2530c:	00c04821 	addu	t1,a2,zero
+   25310:	40037801 	mfc0	v1,$15,1
+   25314:	3c020004 	lui	v0,0x4
+   25318:	2444c960 	addiu	a0,v0,-13984
+   2531c:	88840003 	lwl	a0,3(a0)
+   25320:	30630003 	andi	v1,v1,0x3
+   25324:	3c050004 	lui	a1,0x4
+   25328:	9844c960 	lwr	a0,-13984(v0)
+   2532c:	24a5c950 	addiu	a1,a1,-14000
+   25330:	8fa20038 	lw	v0,56(sp)
+   25334:	00031880 	sll	v1,v1,0x2
+   25338:	00651821 	addu	v1,v1,a1
+   2533c:	8c650000 	lw	a1,0(v1)
+   25340:	8c430000 	lw	v1,0(v0)
+   25344:	8fa2003c 	lw	v0,60(sp)
+   25348:	8ce80000 	lw	t0,0(a3)
+   2534c:	8c420000 	lw	v0,0(v0)
+   25350:	3084ffff 	andi	a0,a0,0xffff
+   25354:	01603021 	addu	a2,t3,zero
+   25358:	01403821 	addu	a3,t2,zero
+   2535c:	afa90010 	sw	t1,16(sp)
+   25360:	afa80014 	sw	t0,20(sp)
+   25364:	afa30018 	sw	v1,24(sp)
+   25368:	0c0093b3 	jal	24ecc <__vfat_cluster_lookup_main>
+   2536c:	afa2001c 	sw	v0,28(sp)
+   25370:	8fbf0024 	lw	ra,36(sp)
+   25374:	03e00008 	jr	ra
+   25378:	27bd0028 	addiu	sp,sp,40
+
+0002537c <vfat_cluster_lookup>:
+   2537c:	27bdff88 	addiu	sp,sp,-120
+   25380:	3c020004 	lui	v0,0x4
+   25384:	afb1006c 	sw	s1,108(sp)
+   25388:	afb00068 	sw	s0,104(sp)
+   2538c:	2443c960 	addiu	v1,v0,-13984
+   25390:	afbf0074 	sw	ra,116(sp)
+   25394:	afb20070 	sw	s2,112(sp)
+   25398:	88630003 	lwl	v1,3(v1)
+   2539c:	94900000 	lhu	s0,0(a0)
+   253a0:	9843c960 	lwr	v1,-13984(v0)
+   253a4:	27ac0028 	addiu	t4,sp,40
+   253a8:	24020004 	addiu	v0,zero,4
+   253ac:	27ab002c 	addiu	t3,sp,44
+   253b0:	27aa0030 	addiu	t2,sp,48
+   253b4:	27a9007c 	addiu	t1,sp,124
+   253b8:	27a80080 	addiu	t0,sp,128
+   253bc:	afa40078 	sw	a0,120(sp)
+   253c0:	3063ffff 	andi	v1,v1,0xffff
+   253c4:	27a40078 	addiu	a0,sp,120
+   253c8:	afa5007c 	sw	a1,124(sp)
+   253cc:	afa60080 	sw	a2,128(sp)
+   253d0:	afa20060 	sw	v0,96(sp)
+   253d4:	00e08821 	addu	s1,a3,zero
+   253d8:	afac0034 	sw	t4,52(sp)
+   253dc:	afab0038 	sw	t3,56(sp)
+   253e0:	afaa003c 	sw	t2,60(sp)
+   253e4:	afa20040 	sw	v0,64(sp)
+   253e8:	afa20044 	sw	v0,68(sp)
+   253ec:	afa20048 	sw	v0,72(sp)
+   253f0:	afa4004c 	sw	a0,76(sp)
+   253f4:	afa90050 	sw	t1,80(sp)
+   253f8:	afa80054 	sw	t0,84(sp)
+   253fc:	afa20058 	sw	v0,88(sp)
+   25400:	12030023 	beq	s0,v1,25490 <vfat_cluster_lookup+0x114>
+   25404:	afa2005c 	sw	v0,92(sp)
+   25408:	40127801 	mfc0	s2,$15,1
+   2540c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   25410:	00000000 	sll	zero,zero,0x0
+   25414:	70501802 	mul	v1,v0,s0
+   25418:	32440003 	andi	a0,s2,0x3
+   2541c:	00642021 	addu	a0,v1,a0
+   25420:	27a30034 	addiu	v1,sp,52
+   25424:	afa30018 	sw	v1,24(sp)
+   25428:	27a30040 	addiu	v1,sp,64
+   2542c:	afa3001c 	sw	v1,28(sp)
+   25430:	3c070002 	lui	a3,0x2
+   25434:	27a3004c 	addiu	v1,sp,76
+   25438:	24020003 	addiu	v0,zero,3
+   2543c:	afa30020 	sw	v1,32(sp)
+   25440:	24e75110 	addiu	a3,a3,20752
+   25444:	27a30058 	addiu	v1,sp,88
+   25448:	24050001 	addiu	a1,zero,1
+   2544c:	00003021 	addu	a2,zero,zero
+   25450:	afa30024 	sw	v1,36(sp)
+   25454:	afa20014 	sw	v0,20(sp)
+   25458:	0c003de8 	jal	f7a0 <rppc_generic>
+   2545c:	afa20010 	sw	v0,16(sp)
+   25460:	8fa20088 	lw	v0,136(sp)
+   25464:	8fa30030 	lw	v1,48(sp)
+   25468:	8fbf0074 	lw	ra,116(sp)
+   2546c:	ac430000 	sw	v1,0(v0)
+   25470:	8fa2002c 	lw	v0,44(sp)
+   25474:	8fb20070 	lw	s2,112(sp)
+   25478:	ae220000 	sw	v0,0(s1)
+   2547c:	8fb00068 	lw	s0,104(sp)
+   25480:	8fa20028 	lw	v0,40(sp)
+   25484:	8fb1006c 	lw	s1,108(sp)
+   25488:	03e00008 	jr	ra
+   2548c:	27bd0078 	addiu	sp,sp,120
+   25490:	27a70078 	addiu	a3,sp,120
+   25494:	01802021 	addu	a0,t4,zero
+   25498:	01602821 	addu	a1,t3,zero
+   2549c:	01403021 	addu	a2,t2,zero
+   254a0:	afa90010 	sw	t1,16(sp)
+   254a4:	0c0094bf 	jal	252fc <__vfat_cluster_lookup_local>
+   254a8:	afa80014 	sw	t0,20(sp)
+   254ac:	8fa20088 	lw	v0,136(sp)
+   254b0:	8fa30030 	lw	v1,48(sp)
+   254b4:	8fbf0074 	lw	ra,116(sp)
+   254b8:	ac430000 	sw	v1,0(v0)
+   254bc:	8fa2002c 	lw	v0,44(sp)
+   254c0:	8fb20070 	lw	s2,112(sp)
+   254c4:	ae220000 	sw	v0,0(s1)
+   254c8:	8fb00068 	lw	s0,104(sp)
+   254cc:	8fa20028 	lw	v0,40(sp)
+   254d0:	8fb1006c 	lw	s1,108(sp)
+   254d4:	03e00008 	jr	ra
+   254d8:	27bd0078 	addiu	sp,sp,120
+
+000254dc <vfat_write_root>:
+   254dc:	03e00008 	jr	ra
+   254e0:	00001021 	addu	v0,zero,zero
+
+000254e4 <vfat_kmem_context_init>:
+   254e4:	2403000a 	addiu	v1,zero,10
+   254e8:	ac830000 	sw	v1,0(a0)
+   254ec:	3c030003 	lui	v1,0x3
+   254f0:	24637548 	addiu	v1,v1,30024
+   254f4:	24020001 	addiu	v0,zero,1
+   254f8:	ac830004 	sw	v1,4(a0)
+   254fc:	24030100 	addiu	v1,zero,256
+   25500:	ac820010 	sw	v0,16(a0)
+   25504:	ac82000c 	sw	v0,12(a0)
+   25508:	ac830008 	sw	v1,8(a0)
+   2550c:	ac80001c 	sw	zero,28(a0)
+   25510:	ac800014 	sw	zero,20(a0)
+   25514:	ac800018 	sw	zero,24(a0)
+   25518:	03e00008 	jr	ra
+   2551c:	00001021 	addu	v0,zero,zero
+
+00025520 <vfat_read_root>:
+   25520:	8ca30024 	lw	v1,36(a1)
+   25524:	8ca20008 	lw	v0,8(a1)
+   25528:	34630001 	ori	v1,v1,0x1
+   2552c:	27bdffe0 	addiu	sp,sp,-32
+   25530:	aca30024 	sw	v1,36(a1)
+   25534:	34420001 	ori	v0,v0,0x1
+   25538:	24030001 	addiu	v1,zero,1
+   2553c:	afbf001c 	sw	ra,28(sp)
+   25540:	afb10018 	sw	s1,24(sp)
+   25544:	afb00014 	sw	s0,20(sp)
+   25548:	aca30020 	sw	v1,32(a1)
+   2554c:	aca20008 	sw	v0,8(a1)
+   25550:	00a08021 	addu	s0,a1,zero
+   25554:	8c850198 	lw	a1,408(a0)
+   25558:	00808821 	addu	s1,a0,zero
+   2555c:	0c0091c3 	jal	2470c <vfat_cluster_count>
+   25560:	248400b0 	addiu	a0,a0,176
+   25564:	8e0301c4 	lw	v1,452(s0)
+   25568:	3c050003 	lui	a1,0x3
+   2556c:	8c630000 	lw	v1,0(v1)
+   25570:	000227c3 	sra	a0,v0,0x1f
+   25574:	24a576fc 	addiu	a1,a1,30460
+   25578:	ae04001c 	sw	a0,28(s0)
+   2557c:	ac7000a0 	sw	s0,160(v1)
+   25580:	02202021 	addu	a0,s1,zero
+   25584:	ac6500a4 	sw	a1,164(v1)
+   25588:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   2558c:	ae020018 	sw	v0,24(s0)
+   25590:	8e030210 	lw	v1,528(s0)
+   25594:	ae020000 	sw	v0,0(s0)
+   25598:	24020010 	addiu	v0,zero,16
+   2559c:	ac620000 	sw	v0,0(v1)
+   255a0:	8e240198 	lw	a0,408(s1)
+   255a4:	8fbf001c 	lw	ra,28(sp)
+   255a8:	00001021 	addu	v0,zero,zero
+   255ac:	8fb10018 	lw	s1,24(sp)
+   255b0:	8fb00014 	lw	s0,20(sp)
+   255b4:	ac640004 	sw	a0,4(v1)
+   255b8:	03e00008 	jr	ra
+   255bc:	27bd0020 	addiu	sp,sp,32
+
+000255c0 <vfat_destroy_context>:
+   255c0:	27bdffe8 	addiu	sp,sp,-24
+   255c4:	afbf0014 	sw	ra,20(sp)
+   255c8:	afb00010 	sw	s0,16(sp)
+   255cc:	00808021 	addu	s0,a0,zero
+   255d0:	8c8401a4 	lw	a0,420(a0)
+   255d4:	0c007901 	jal	1e404 <mapper_destroy>
+   255d8:	24050001 	addiu	a1,zero,1
+   255dc:	0c004354 	jal	10d50 <rwlock_destroy>
+   255e0:	260400c0 	addiu	a0,s0,192
+   255e4:	8fbf0014 	lw	ra,20(sp)
+   255e8:	00001021 	addu	v0,zero,zero
+   255ec:	8fb00010 	lw	s0,16(sp)
+   255f0:	03e00008 	jr	ra
+   255f4:	27bd0018 	addiu	sp,sp,24
+
+000255f8 <vfat_create_context>:
+   255f8:	27bdff98 	addiu	sp,sp,-104
+   255fc:	8c82008c 	lw	v0,140(a0)
+   25600:	afb5005c 	sw	s5,92(sp)
+   25604:	249500c0 	addiu	s5,a0,192
+   25608:	afbf0064 	sw	ra,100(sp)
+   2560c:	afb60060 	sw	s6,96(sp)
+   25610:	afb40058 	sw	s4,88(sp)
+   25614:	afb20050 	sw	s2,80(sp)
+   25618:	afb00048 	sw	s0,72(sp)
+   2561c:	afb30054 	sw	s3,84(sp)
+   25620:	afb1004c 	sw	s1,76(sp)
+   25624:	00808021 	addu	s0,a0,zero
+   25628:	ac8200b4 	sw	v0,180(a0)
+   2562c:	0c004428 	jal	110a0 <rwlock_init>
+   25630:	02a02021 	addu	a0,s5,zero
+   25634:	27b40018 	addiu	s4,sp,24
+   25638:	24020005 	addiu	v0,zero,5
+   2563c:	afa20018 	sw	v0,24(sp)
+   25640:	02802021 	addu	a0,s4,zero
+   25644:	2402000c 	addiu	v0,zero,12
+   25648:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2564c:	afa2001c 	sw	v0,28(sp)
+   25650:	00409021 	addu	s2,v0,zero
+   25654:	10400043 	beqz	v0,25764 <vfat_create_context+0x16c>
+   25658:	261600b0 	addiu	s6,s0,176
+   2565c:	3c050003 	lui	a1,0x3
+   25660:	24a576fc 	addiu	a1,a1,30460
+   25664:	00402021 	addu	a0,v0,zero
+   25668:	00003021 	addu	a2,zero,zero
+   2566c:	0c0073aa 	jal	1cea8 <mapper_init>
+   25670:	02c03821 	addu	a3,s6,zero
+   25674:	14400030 	bnez	v0,25738 <vfat_create_context+0x140>
+   25678:	00408821 	addu	s1,v0,zero
+   2567c:	3c040004 	lui	a0,0x4
+   25680:	ae1201a4 	sw	s2,420(s0)
+   25684:	2482c960 	addiu	v0,a0,-13984
+   25688:	88420003 	lwl	v0,3(v0)
+   2568c:	8e0300b4 	lw	v1,180(s0)
+   25690:	9882c960 	lwr	v0,-13984(a0)
+   25694:	27a50028 	addiu	a1,sp,40
+   25698:	a60200b0 	sh	v0,176(s0)
+   2569c:	8c620050 	lw	v0,80(v1)
+   256a0:	0040f809 	jalr	v0
+   256a4:	00602021 	addu	a0,v1,zero
+   256a8:	10400030 	beqz	v0,2576c <vfat_create_context+0x174>
+   256ac:	8fb30040 	lw	s3,64(sp)
+   256b0:	3c100004 	lui	s0,0x4
+   256b4:	8e049100 	lw	a0,-28416(s0)
+   256b8:	3c060003 	lui	a2,0x3
+   256bc:	24c67658 	addiu	a2,a2,30296
+   256c0:	00002821 	addu	a1,zero,zero
+   256c4:	0c0009b0 	jal	26c0 <__fprintk>
+   256c8:	2407ffff 	addiu	a3,zero,-1
+   256cc:	2411ffff 	addiu	s1,zero,-1
+   256d0:	02402021 	addu	a0,s2,zero
+   256d4:	0c007901 	jal	1e404 <mapper_destroy>
+   256d8:	00002821 	addu	a1,zero,zero
+   256dc:	24020005 	addiu	v0,zero,5
+   256e0:	02802021 	addu	a0,s4,zero
+   256e4:	afa20018 	sw	v0,24(sp)
+   256e8:	0c007134 	jal	1c4d0 <kmem_free>
+   256ec:	afb20024 	sw	s2,36(sp)
+   256f0:	02802021 	addu	a0,s4,zero
+   256f4:	2402000a 	addiu	v0,zero,10
+   256f8:	afa20018 	sw	v0,24(sp)
+   256fc:	0c007134 	jal	1c4d0 <kmem_free>
+   25700:	afb60024 	sw	s6,36(sp)
+   25704:	0c004354 	jal	10d50 <rwlock_destroy>
+   25708:	02a02021 	addu	a0,s5,zero
+   2570c:	8fbf0064 	lw	ra,100(sp)
+   25710:	02201021 	addu	v0,s1,zero
+   25714:	8fb60060 	lw	s6,96(sp)
+   25718:	8fb5005c 	lw	s5,92(sp)
+   2571c:	8fb40058 	lw	s4,88(sp)
+   25720:	8fb30054 	lw	s3,84(sp)
+   25724:	8fb20050 	lw	s2,80(sp)
+   25728:	8fb1004c 	lw	s1,76(sp)
+   2572c:	8fb00048 	lw	s0,72(sp)
+   25730:	03e00008 	jr	ra
+   25734:	27bd0068 	addiu	sp,sp,104
+   25738:	3c020004 	lui	v0,0x4
+   2573c:	8c449100 	lw	a0,-28416(v0)
+   25740:	3c060003 	lui	a2,0x3
+   25744:	3c070003 	lui	a3,0x3
+   25748:	24c67558 	addiu	a2,a2,30040
+   2574c:	24e776ac 	addiu	a3,a3,30380
+   25750:	00002821 	addu	a1,zero,zero
+   25754:	0c0009b0 	jal	26c0 <__fprintk>
+   25758:	afb10010 	sw	s1,16(sp)
+   2575c:	080095b5 	j	256d4 <vfat_create_context+0xdc>
+   25760:	02402021 	addu	a0,s2,zero
+   25764:	080095bc 	j	256f0 <vfat_create_context+0xf8>
+   25768:	2411000c 	addiu	s1,zero,12
+   2576c:	8e0401a4 	lw	a0,420(s0)
+   25770:	ae130188 	sw	s3,392(s0)
+   25774:	00002821 	addu	a1,zero,zero
+   25778:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   2577c:	24060001 	addiu	a2,zero,1
+   25780:	1040003e 	beqz	v0,2587c <vfat_create_context+0x284>
+   25784:	3c060003 	lui	a2,0x3
+   25788:	0c007c15 	jal	1f054 <ppm_page2addr>
+   2578c:	00402021 	addu	a0,v0,zero
+   25790:	9043000c 	lbu	v1,12(v0)
+   25794:	9044000b 	lbu	a0,11(v0)
+   25798:	00031a00 	sll	v1,v1,0x8
+   2579c:	00641825 	or	v1,v1,a0
+   257a0:	1263000c 	beq	s3,v1,257d4 <vfat_create_context+0x1dc>
+   257a4:	ae030188 	sw	v1,392(s0)
+   257a8:	3c050003 	lui	a1,0x3
+   257ac:	3c070003 	lui	a3,0x3
+   257b0:	24a575d0 	addiu	a1,a1,30160
+   257b4:	24e7763c 	addiu	a3,a3,30268
+   257b8:	24040001 	addiu	a0,zero,1
+   257bc:	24060044 	addiu	a2,zero,68
+   257c0:	afa30010 	sw	v1,16(sp)
+   257c4:	0c00097d 	jal	25f4 <__perror>
+   257c8:	afb30014 	sw	s3,20(sp)
+   257cc:	080095f3 	j	257cc <vfat_create_context+0x1d4>
+   257d0:	00000000 	sll	zero,zero,0x0
+   257d4:	9043000f 	lbu	v1,15(v0)
+   257d8:	9044000e 	lbu	a0,14(v0)
+   257dc:	00031a00 	sll	v1,v1,0x8
+   257e0:	00641825 	or	v1,v1,a0
+   257e4:	ae030180 	sw	v1,384(s0)
+   257e8:	88440027 	lwl	a0,39(v0)
+   257ec:	8e050004 	lw	a1,4(s0)
+   257f0:	98440024 	lwr	a0,36(v0)
+   257f4:	34a50002 	ori	a1,a1,0x2
+   257f8:	ae040184 	sw	a0,388(s0)
+   257fc:	88440027 	lwl	a0,39(v0)
+   25800:	90460010 	lbu	a2,16(v0)
+   25804:	98440024 	lwr	a0,36(v0)
+   25808:	70c43802 	mul	a3,a2,a0
+   2580c:	00e32021 	addu	a0,a3,v1
+   25810:	ae040190 	sw	a0,400(s0)
+   25814:	9044000d 	lbu	a0,13(v0)
+   25818:	3c070003 	lui	a3,0x3
+   2581c:	ae040194 	sw	a0,404(s0)
+   25820:	70933002 	mul	a2,a0,s3
+   25824:	8844002f 	lwl	a0,47(v0)
+   25828:	24e776c0 	addiu	a3,a3,30400
+   2582c:	9844002c 	lwr	a0,44(v0)
+   25830:	ae03019c 	sw	v1,412(s0)
+   25834:	3c030003 	lui	v1,0x3
+   25838:	24637698 	addiu	v1,v1,30360
+   2583c:	ae030090 	sw	v1,144(s0)
+   25840:	3c030003 	lui	v1,0x3
+   25844:	24637764 	addiu	v1,v1,30564
+   25848:	ae030094 	sw	v1,148(s0)
+   2584c:	3c030003 	lui	v1,0x3
+   25850:	24020002 	addiu	v0,zero,2
+   25854:	2463778c 	addiu	v1,v1,30604
+   25858:	ae070098 	sw	a3,152(s0)
+   2585c:	ae040198 	sw	a0,408(s0)
+   25860:	ae06018c 	sw	a2,396(s0)
+   25864:	ae050004 	sw	a1,4(s0)
+   25868:	ae020000 	sw	v0,0(s0)
+   2586c:	ae130048 	sw	s3,72(s0)
+   25870:	ae03009c 	sw	v1,156(s0)
+   25874:	080095c3 	j	2570c <vfat_create_context+0x114>
+   25878:	ae0201a0 	sw	v0,416(s0)
+   2587c:	3c100004 	lui	s0,0x4
+   25880:	8e049100 	lw	a0,-28416(s0)
+   25884:	24c67584 	addiu	a2,a2,30084
+   25888:	0c0009b0 	jal	26c0 <__fprintk>
+   2588c:	00002821 	addu	a1,zero,zero
+   25890:	080095ae 	j	256b8 <vfat_create_context+0xc0>
+   25894:	8e049100 	lw	a0,-28416(s0)
+
+00025898 <vfat_open>:
+   25898:	03e00008 	jr	ra
+   2589c:	00001021 	addu	v0,zero,zero
+
+000258a0 <vfat_lseek>:
+   258a0:	03e00008 	jr	ra
+   258a4:	00001021 	addu	v0,zero,zero
+
+000258a8 <vfat_close>:
+   258a8:	03e00008 	jr	ra
+   258ac:	00001021 	addu	v0,zero,zero
+
+000258b0 <vfat_release>:
+   258b0:	03e00008 	jr	ra
+   258b4:	00001021 	addu	v0,zero,zero
+
+000258b8 <vfat_readdir>:
+   258b8:	8c820110 	lw	v0,272(a0)
+   258bc:	27bdffa8 	addiu	sp,sp,-88
+   258c0:	afb30040 	sw	s3,64(sp)
+   258c4:	afb10038 	sw	s1,56(sp)
+   258c8:	8c5301c4 	lw	s3,452(v0)
+   258cc:	00a08821 	addu	s1,a1,zero
+   258d0:	8c850004 	lw	a1,4(a0)
+   258d4:	afb00034 	sw	s0,52(sp)
+   258d8:	00052b02 	srl	a1,a1,0xc
+   258dc:	00808021 	addu	s0,a0,zero
+   258e0:	24060001 	addiu	a2,zero,1
+   258e4:	afb70050 	sw	s7,80(sp)
+   258e8:	afb6004c 	sw	s6,76(sp)
+   258ec:	afb50048 	sw	s5,72(sp)
+   258f0:	afb40044 	sw	s4,68(sp)
+   258f4:	afb2003c 	sw	s2,60(sp)
+   258f8:	afbf0054 	sw	ra,84(sp)
+   258fc:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   25900:	02602021 	addu	a0,s3,zero
+   25904:	26370008 	addiu	s7,s1,8
+   25908:	27b20010 	addiu	s2,sp,16
+   2590c:	241400e5 	addiu	s4,zero,229
+   25910:	2415000f 	addiu	s5,zero,15
+   25914:	2416002e 	addiu	s6,zero,46
+   25918:	1040001b 	beqz	v0,25988 <vfat_readdir+0xd0>
+   2591c:	00402021 	addu	a0,v0,zero
+   25920:	0c007c15 	jal	1f054 <ppm_page2addr>
+   25924:	00000000 	sll	zero,zero,0x0
+   25928:	8e050004 	lw	a1,4(s0)
+   2592c:	02402021 	addu	a0,s2,zero
+   25930:	30a50fff 	andi	a1,a1,0xfff
+   25934:	00452821 	addu	a1,v0,a1
+   25938:	0c00c12b 	jal	304ac <memcpy>
+   2593c:	24060020 	addiu	a2,zero,32
+   25940:	93a20010 	lbu	v0,16(sp)
+   25944:	1040005f 	beqz	v0,25ac4 <vfat_readdir+0x20c>
+   25948:	8fbf0054 	lw	ra,84(sp)
+   2594c:	1054004f 	beq	v0,s4,25a8c <vfat_readdir+0x1d4>
+   25950:	93a3001b 	lbu	v1,27(sp)
+   25954:	1075004e 	beq	v1,s5,25a90 <vfat_readdir+0x1d8>
+   25958:	02402021 	addu	a0,s2,zero
+   2595c:	14560016 	bne	v0,s6,259b8 <vfat_readdir+0x100>
+   25960:	00000000 	sll	zero,zero,0x0
+   25964:	8e050004 	lw	a1,4(s0)
+   25968:	02602021 	addu	a0,s3,zero
+   2596c:	24a50020 	addiu	a1,a1,32
+   25970:	ae050004 	sw	a1,4(s0)
+   25974:	24060001 	addiu	a2,zero,1
+   25978:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   2597c:	00052b02 	srl	a1,a1,0xc
+   25980:	1440ffe7 	bnez	v0,25920 <vfat_readdir+0x68>
+   25984:	00402021 	addu	a0,v0,zero
+   25988:	8fbf0054 	lw	ra,84(sp)
+   2598c:	24020005 	addiu	v0,zero,5
+   25990:	8fb70050 	lw	s7,80(sp)
+   25994:	8fb6004c 	lw	s6,76(sp)
+   25998:	8fb50048 	lw	s5,72(sp)
+   2599c:	8fb40044 	lw	s4,68(sp)
+   259a0:	8fb30040 	lw	s3,64(sp)
+   259a4:	8fb2003c 	lw	s2,60(sp)
+   259a8:	8fb10038 	lw	s1,56(sp)
+   259ac:	8fb00034 	lw	s0,52(sp)
+   259b0:	03e00008 	jr	ra
+   259b4:	27bd0058 	addiu	sp,sp,88
+   259b8:	0c009857 	jal	2615c <vfat_getshortname>
+   259bc:	02e02821 	addu	a1,s7,zero
+   259c0:	93a2001b 	lbu	v0,27(sp)
+   259c4:	30430010 	andi	v1,v0,0x10
+   259c8:	10600003 	beqz	v1,259d8 <vfat_readdir+0x120>
+   259cc:	ae200004 	sw	zero,4(s1)
+   259d0:	24030001 	addiu	v1,zero,1
+   259d4:	ae230004 	sw	v1,4(s1)
+   259d8:	30430004 	andi	v1,v0,0x4
+   259dc:	10600005 	beqz	v1,259f4 <vfat_readdir+0x13c>
+   259e0:	30430020 	andi	v1,v0,0x20
+   259e4:	8e230004 	lw	v1,4(s1)
+   259e8:	34630080 	ori	v1,v1,0x80
+   259ec:	ae230004 	sw	v1,4(s1)
+   259f0:	30430020 	andi	v1,v0,0x20
+   259f4:	10600004 	beqz	v1,25a08 <vfat_readdir+0x150>
+   259f8:	00000000 	sll	zero,zero,0x0
+   259fc:	8e230004 	lw	v1,4(s1)
+   25a00:	34630100 	ori	v1,v1,0x100
+   25a04:	ae230004 	sw	v1,4(s1)
+   25a08:	30420001 	andi	v0,v0,0x1
+   25a0c:	10400005 	beqz	v0,25a24 <vfat_readdir+0x16c>
+   25a10:	97a20024 	lhu	v0,36(sp)
+   25a14:	8e220004 	lw	v0,4(s1)
+   25a18:	34420040 	ori	v0,v0,0x40
+   25a1c:	ae220004 	sw	v0,4(s1)
+   25a20:	97a20024 	lhu	v0,36(sp)
+   25a24:	1440000a 	bnez	v0,25a50 <vfat_readdir+0x198>
+   25a28:	97a2002a 	lhu	v0,42(sp)
+   25a2c:	14400008 	bnez	v0,25a50 <vfat_readdir+0x198>
+   25a30:	240300c1 	addiu	v1,zero,193
+   25a34:	8e220004 	lw	v0,4(s1)
+   25a38:	304400c1 	andi	a0,v0,0xc1
+   25a3c:	10830018 	beq	a0,v1,25aa0 <vfat_readdir+0x1e8>
+   25a40:	304400c0 	andi	a0,v0,0xc0
+   25a44:	240300c0 	addiu	v1,zero,192
+   25a48:	1083001a 	beq	a0,v1,25ab4 <vfat_readdir+0x1fc>
+   25a4c:	34420002 	ori	v0,v0,0x2
+   25a50:	8e030004 	lw	v1,4(s0)
+   25a54:	8fbf0054 	lw	ra,84(sp)
+   25a58:	24630020 	addiu	v1,v1,32
+   25a5c:	00001021 	addu	v0,zero,zero
+   25a60:	ae030004 	sw	v1,4(s0)
+   25a64:	8fb70050 	lw	s7,80(sp)
+   25a68:	8fb6004c 	lw	s6,76(sp)
+   25a6c:	8fb50048 	lw	s5,72(sp)
+   25a70:	8fb40044 	lw	s4,68(sp)
+   25a74:	8fb30040 	lw	s3,64(sp)
+   25a78:	8fb2003c 	lw	s2,60(sp)
+   25a7c:	8fb10038 	lw	s1,56(sp)
+   25a80:	8fb00034 	lw	s0,52(sp)
+   25a84:	03e00008 	jr	ra
+   25a88:	27bd0058 	addiu	sp,sp,88
+   25a8c:	02402021 	addu	a0,s2,zero
+   25a90:	0c009857 	jal	2615c <vfat_getshortname>
+   25a94:	02e02821 	addu	a1,s7,zero
+   25a98:	0800965a 	j	25968 <vfat_readdir+0xb0>
+   25a9c:	8e050004 	lw	a1,4(s0)
+   25aa0:	3442000c 	ori	v0,v0,0xc
+   25aa4:	2403ff3e 	addiu	v1,zero,-194
+   25aa8:	00431024 	and	v0,v0,v1
+   25aac:	08009694 	j	25a50 <vfat_readdir+0x198>
+   25ab0:	ae220004 	sw	v0,4(s1)
+   25ab4:	2403ff3f 	addiu	v1,zero,-193
+   25ab8:	00431024 	and	v0,v0,v1
+   25abc:	08009694 	j	25a50 <vfat_readdir+0x198>
+   25ac0:	ae220004 	sw	v0,4(s1)
+   25ac4:	2402007d 	addiu	v0,zero,125
+   25ac8:	8fb70050 	lw	s7,80(sp)
+   25acc:	8fb6004c 	lw	s6,76(sp)
+   25ad0:	8fb50048 	lw	s5,72(sp)
+   25ad4:	8fb40044 	lw	s4,68(sp)
+   25ad8:	8fb30040 	lw	s3,64(sp)
+   25adc:	8fb2003c 	lw	s2,60(sp)
+   25ae0:	8fb10038 	lw	s1,56(sp)
+   25ae4:	8fb00034 	lw	s0,52(sp)
+   25ae8:	03e00008 	jr	ra
+   25aec:	27bd0058 	addiu	sp,sp,88
+   25af0:	27bdffb0 	addiu	sp,sp,-80
+   25af4:	afb5003c 	sw	s5,60(sp)
+   25af8:	8c950000 	lw	s5,0(a0)
+   25afc:	afbe0048 	sw	s8,72(sp)
+   25b00:	8ea200dc 	lw	v0,220(s5)
+   25b04:	03a0f021 	addu	s8,sp,zero
+   25b08:	2c431001 	sltiu	v1,v0,4097
+   25b0c:	afb70044 	sw	s7,68(sp)
+   25b10:	afbf004c 	sw	ra,76(sp)
+   25b14:	afb60040 	sw	s6,64(sp)
+   25b18:	afb40038 	sw	s4,56(sp)
+   25b1c:	afb30034 	sw	s3,52(sp)
+   25b20:	afb20030 	sw	s2,48(sp)
+   25b24:	afb1002c 	sw	s1,44(sp)
+   25b28:	afb00028 	sw	s0,40(sp)
+   25b2c:	0080b821 	addu	s7,a0,zero
+   25b30:	afc50054 	sw	a1,84(s8)
+   25b34:	1460004f 	bnez	v1,25c74 <vfat_readdir+0x3bc>
+   25b38:	afc60058 	sw	a2,88(s8)
+   25b3c:	24030004 	addiu	v1,zero,4
+   25b40:	24140001 	addiu	s4,zero,1
+   25b44:	8fc50054 	lw	a1,84(s8)
+   25b48:	2463000e 	addiu	v1,v1,14
+   25b4c:	8ca40014 	lw	a0,20(a1)
+   25b50:	3063fff8 	andi	v1,v1,0xfff8
+   25b54:	00042300 	sll	a0,a0,0xc
+   25b58:	0082001b 	divu	zero,a0,v0
+   25b5c:	004001f4 	teq	v0,zero,0x7
+   25b60:	03a3e823 	subu	sp,sp,v1
+   25b64:	27b60018 	addiu	s6,sp,24
+   25b68:	8ee6000c 	lw	a2,12(s7)
+   25b6c:	03a3e823 	subu	sp,sp,v1
+   25b70:	27a90018 	addiu	t1,sp,24
+   25b74:	afc9001c 	sw	t1,28(s8)
+   25b78:	ad200000 	sw	zero,0(t1)
+   25b7c:	00002812 	mflo	a1
+   25b80:	00001012 	mflo	v0
+   25b84:	afc50018 	sw	a1,24(s8)
+   25b88:	8ee50008 	lw	a1,8(s7)
+   25b8c:	10c20010 	beq	a2,v0,25bd0 <vfat_readdir+0x318>
+   25b90:	aec50000 	sw	a1,0(s6)
+   25b94:	00c2102b 	sltu	v0,a2,v0
+   25b98:	1040003c 	beqz	v0,25c8c <vfat_readdir+0x3d4>
+   25b9c:	00001812 	mflo	v1
+   25ba0:	00a01021 	addu	v0,a1,zero
+   25ba4:	00663023 	subu	a2,v1,a2
+   25ba8:	10c00009 	beqz	a2,25bd0 <vfat_readdir+0x318>
+   25bac:	8fc9001c 	lw	t1,28(s8)
+   25bb0:	00402821 	addu	a1,v0,zero
+   25bb4:	02a02021 	addu	a0,s5,zero
+   25bb8:	02c03821 	addu	a3,s6,zero
+   25bbc:	0c0094df 	jal	2537c <vfat_cluster_lookup>
+   25bc0:	afa90010 	sw	t1,16(sp)
+   25bc4:	1440001d 	bnez	v0,25c3c <vfat_readdir+0x384>
+   25bc8:	00409821 	addu	s3,v0,zero
+   25bcc:	8ec50000 	lw	a1,0(s6)
+   25bd0:	2e820002 	sltiu	v0,s4,2
+   25bd4:	14400030 	bnez	v0,25c98 <vfat_readdir+0x3e0>
+   25bd8:	afc20020 	sw	v0,32(s8)
+   25bdc:	8fc3001c 	lw	v1,28(s8)
+   25be0:	26d10004 	addiu	s1,s6,4
+   25be4:	24700004 	addiu	s0,v1,4
+   25be8:	02c09821 	addu	s3,s6,zero
+   25bec:	08009703 	j	25c0c <vfat_readdir+0x354>
+   25bf0:	24120001 	addiu	s2,zero,1
+   25bf4:	0254102b 	sltu	v0,s2,s4
+   25bf8:	8e650004 	lw	a1,4(s3)
+   25bfc:	26310004 	addiu	s1,s1,4
+   25c00:	26100004 	addiu	s0,s0,4
+   25c04:	10400024 	beqz	v0,25c98 <vfat_readdir+0x3e0>
+   25c08:	26730004 	addiu	s3,s3,4
+   25c0c:	02203821 	addu	a3,s1,zero
+   25c10:	02a02021 	addu	a0,s5,zero
+   25c14:	24060001 	addiu	a2,zero,1
+   25c18:	0c0094df 	jal	2537c <vfat_cluster_lookup>
+   25c1c:	afb00010 	sw	s0,16(sp)
+   25c20:	1040fff4 	beqz	v0,25bf4 <vfat_readdir+0x33c>
+   25c24:	26520001 	addiu	s2,s2,1
+   25c28:	2652ffff 	addiu	s2,s2,-1
+   25c2c:	00409821 	addu	s3,v0,zero
+   25c30:	2402001c 	addiu	v0,zero,28
+   25c34:	12620095 	beq	s3,v0,25e8c <vfat_readdir+0x5d4>
+   25c38:	8fc40058 	lw	a0,88(s8)
+   25c3c:	03c0e821 	addu	sp,s8,zero
+   25c40:	8fbf004c 	lw	ra,76(sp)
+   25c44:	02601021 	addu	v0,s3,zero
+   25c48:	8fbe0048 	lw	s8,72(sp)
+   25c4c:	8fb70044 	lw	s7,68(sp)
+   25c50:	8fb60040 	lw	s6,64(sp)
+   25c54:	8fb5003c 	lw	s5,60(sp)
+   25c58:	8fb40038 	lw	s4,56(sp)
+   25c5c:	8fb30034 	lw	s3,52(sp)
+   25c60:	8fb20030 	lw	s2,48(sp)
+   25c64:	8fb1002c 	lw	s1,44(sp)
+   25c68:	8fb00028 	lw	s0,40(sp)
+   25c6c:	03e00008 	jr	ra
+   25c70:	27bd0050 	addiu	sp,sp,80
+   25c74:	24141000 	addiu	s4,zero,4096
+   25c78:	0282001b 	divu	zero,s4,v0
+   25c7c:	004001f4 	teq	v0,zero,0x7
+   25c80:	0000a012 	mflo	s4
+   25c84:	080096d1 	j	25b44 <vfat_readdir+0x28c>
+   25c88:	00141880 	sll	v1,s4,0x2
+   25c8c:	8ee20004 	lw	v0,4(s7)
+   25c90:	080096ea 	j	25ba8 <vfat_readdir+0x2f0>
+   25c94:	8fc60018 	lw	a2,24(s8)
+   25c98:	8fc60058 	lw	a2,88(s8)
+   25c9c:	30c20001 	andi	v0,a2,0x1
+   25ca0:	14400067 	bnez	v0,25e40 <vfat_readdir+0x588>
+   25ca4:	00000000 	sll	zero,zero,0x0
+   25ca8:	8ed20000 	lw	s2,0(s6)
+   25cac:	8ea200e0 	lw	v0,224(s5)
+   25cb0:	16800010 	bnez	s4,25cf4 <vfat_readdir+0x43c>
+   25cb4:	8eb000e4 	lw	s0,228(s5)
+   25cb8:	03c0e821 	addu	sp,s8,zero
+   25cbc:	8fdf004c 	lw	ra,76(s8)
+   25cc0:	00009821 	addu	s3,zero,zero
+   25cc4:	02601021 	addu	v0,s3,zero
+   25cc8:	8fbe0048 	lw	s8,72(sp)
+   25ccc:	8fb70044 	lw	s7,68(sp)
+   25cd0:	8fb60040 	lw	s6,64(sp)
+   25cd4:	8fb5003c 	lw	s5,60(sp)
+   25cd8:	8fb40038 	lw	s4,56(sp)
+   25cdc:	8fb30034 	lw	s3,52(sp)
+   25ce0:	8fb20030 	lw	s2,48(sp)
+   25ce4:	8fb1002c 	lw	s1,44(sp)
+   25ce8:	8fb00028 	lw	s0,40(sp)
+   25cec:	03e00008 	jr	ra
+   25cf0:	27bd0050 	addiu	sp,sp,80
+   25cf4:	02803021 	addu	a2,s4,zero
+   25cf8:	2651fffe 	addiu	s1,s2,-2
+   25cfc:	72302002 	mul	a0,s1,s0
+   25d00:	8ea500dc 	lw	a1,220(s5)
+   25d04:	2ca31001 	sltiu	v1,a1,4097
+   25d08:	1460000e 	bnez	v1,25d44 <vfat_readdir+0x48c>
+   25d0c:	00828821 	addu	s1,a0,v0
+   25d10:	8ea400d8 	lw	a0,216(s5)
+   25d14:	24101000 	addiu	s0,zero,4096
+   25d18:	0204001b 	divu	zero,s0,a0
+   25d1c:	008001f4 	teq	a0,zero,0x7
+   25d20:	8fc90054 	lw	t1,84(s8)
+   25d24:	00051302 	srl	v0,a1,0xc
+   25d28:	8d230014 	lw	v1,20(t1)
+   25d2c:	00008012 	mflo	s0
+   25d30:	0062001b 	divu	zero,v1,v0
+   25d34:	004001f4 	teq	v0,zero,0x7
+   25d38:	00001010 	mfhi	v0
+   25d3c:	70501802 	mul	v1,v0,s0
+   25d40:	00718821 	addu	s1,v1,s1
+   25d44:	8ea40004 	lw	a0,4(s5)
+   25d48:	0c001c37 	jal	70dc <blkio_init>
+   25d4c:	8fc50054 	lw	a1,84(s8)
+   25d50:	1440ffba 	bnez	v0,25c3c <vfat_readdir+0x384>
+   25d54:	00409821 	addu	s3,v0,zero
+   25d58:	0c007c15 	jal	1f054 <ppm_page2addr>
+   25d5c:	8fc40054 	lw	a0,84(s8)
+   25d60:	8fc40054 	lw	a0,84(s8)
+   25d64:	8c83001c 	lw	v1,28(a0)
+   25d68:	2487001c 	addiu	a3,a0,28
+   25d6c:	1067001d 	beq	v1,a3,25de4 <vfat_readdir+0x52c>
+   25d70:	8c640000 	lw	a0,0(v1)
+   25d74:	08009760 	j	25d80 <vfat_readdir+0x4c8>
+   25d78:	00002821 	addu	a1,zero,zero
+   25d7c:	00c02021 	addu	a0,a2,zero
+   25d80:	8fc60020 	lw	a2,32(s8)
+   25d84:	2463ff5c 	addiu	v1,v1,-164
+   25d88:	24a50001 	addiu	a1,a1,1
+   25d8c:	ac700048 	sw	s0,72(v1)
+   25d90:	ac710040 	sw	s1,64(v1)
+   25d94:	ac620044 	sw	v0,68(v1)
+   25d98:	14c0000e 	bnez	a2,25dd4 <vfat_readdir+0x51c>
+   25d9c:	00b4182b 	sltu	v1,a1,s4
+   25da0:	1060000c 	beqz	v1,25dd4 <vfat_readdir+0x51c>
+   25da4:	00000000 	sll	zero,zero,0x0
+   25da8:	8ed20004 	lw	s2,4(s6)
+   25dac:	8ea800e4 	lw	t0,228(s5)
+   25db0:	2651fffe 	addiu	s1,s2,-2
+   25db4:	8ea300dc 	lw	v1,220(s5)
+   25db8:	72284802 	mul	t1,s1,t0
+   25dbc:	00431021 	addu	v0,v0,v1
+   25dc0:	8fc30018 	lw	v1,24(s8)
+   25dc4:	8ea600e0 	lw	a2,224(s5)
+   25dc8:	24630001 	addiu	v1,v1,1
+   25dcc:	01268821 	addu	s1,t1,a2
+   25dd0:	afc30018 	sw	v1,24(s8)
+   25dd4:	26d60004 	addiu	s6,s6,4
+   25dd8:	00801821 	addu	v1,a0,zero
+   25ddc:	1487ffe7 	bne	a0,a3,25d7c <vfat_readdir+0x4c4>
+   25de0:	8c860000 	lw	a2,0(a0)
+   25de4:	8fc50058 	lw	a1,88(s8)
+   25de8:	0c001bcd 	jal	6f34 <blkio_sync>
+   25dec:	8fc40054 	lw	a0,84(s8)
+   25df0:	8fc40054 	lw	a0,84(s8)
+   25df4:	0c001bab 	jal	6eac <blkio_destroy>
+   25df8:	00409821 	addu	s3,v0,zero
+   25dfc:	03c0e821 	addu	sp,s8,zero
+   25e00:	8fc40018 	lw	a0,24(s8)
+   25e04:	8fbf004c 	lw	ra,76(sp)
+   25e08:	aef20008 	sw	s2,8(s7)
+   25e0c:	02601021 	addu	v0,s3,zero
+   25e10:	aee4000c 	sw	a0,12(s7)
+   25e14:	8fbe0048 	lw	s8,72(sp)
+   25e18:	8fb70044 	lw	s7,68(sp)
+   25e1c:	8fb60040 	lw	s6,64(sp)
+   25e20:	8fb5003c 	lw	s5,60(sp)
+   25e24:	8fb40038 	lw	s4,56(sp)
+   25e28:	8fb30034 	lw	s3,52(sp)
+   25e2c:	8fb20030 	lw	s2,48(sp)
+   25e30:	8fb1002c 	lw	s1,44(sp)
+   25e34:	8fb00028 	lw	s0,40(sp)
+   25e38:	03e00008 	jr	ra
+   25e3c:	27bd0050 	addiu	sp,sp,80
+   25e40:	1280ff9d 	beqz	s4,25cb8 <vfat_readdir+0x400>
+   25e44:	00000000 	sll	zero,zero,0x0
+   25e48:	8fc9001c 	lw	t1,28(s8)
+   25e4c:	8d220000 	lw	v0,0(t1)
+   25e50:	1440ff99 	bnez	v0,25cb8 <vfat_readdir+0x400>
+   25e54:	01201021 	addu	v0,t1,zero
+   25e58:	0800979b 	j	25e6c <vfat_readdir+0x5b4>
+   25e5c:	00003021 	addu	a2,zero,zero
+   25e60:	8c430004 	lw	v1,4(v0)
+   25e64:	14600005 	bnez	v1,25e7c <vfat_readdir+0x5c4>
+   25e68:	24420004 	addiu	v0,v0,4
+   25e6c:	24c60001 	addiu	a2,a2,1
+   25e70:	00d4182b 	sltu	v1,a2,s4
+   25e74:	1460fffa 	bnez	v1,25e60 <vfat_readdir+0x5a8>
+   25e78:	00000000 	sll	zero,zero,0x0
+   25e7c:	8ed20000 	lw	s2,0(s6)
+   25e80:	8ea200e0 	lw	v0,224(s5)
+   25e84:	0800973e 	j	25cf8 <vfat_readdir+0x440>
+   25e88:	8eb000e4 	lw	s0,228(s5)
+   25e8c:	30820001 	andi	v0,a0,0x1
+   25e90:	1040ff6a 	beqz	v0,25c3c <vfat_readdir+0x384>
+   25e94:	8fc5001c 	lw	a1,28(s8)
+   25e98:	00129080 	sll	s2,s2,0x2
+   25e9c:	00b29021 	addu	s2,a1,s2
+   25ea0:	24020001 	addiu	v0,zero,1
+   25ea4:	08009792 	j	25e48 <vfat_readdir+0x590>
+   25ea8:	ae420000 	sw	v0,0(s2)
+
+00025eac <vfat_file_read_page>:
+   25eac:	8c820018 	lw	v0,24(a0)
+   25eb0:	30a50001 	andi	a1,a1,0x1
+   25eb4:	8c420000 	lw	v0,0(v0)
+   25eb8:	24060001 	addiu	a2,zero,1
+   25ebc:	8c4200a0 	lw	v0,160(v0)
+   25ec0:	27bdffd8 	addiu	sp,sp,-40
+   25ec4:	8c470210 	lw	a3,528(v0)
+   25ec8:	8c4301c0 	lw	v1,448(v0)
+   25ecc:	24020003 	addiu	v0,zero,3
+   25ed0:	0045300b 	movn	a2,v0,a1
+   25ed4:	8ce20004 	lw	v0,4(a3)
+   25ed8:	246300b0 	addiu	v1,v1,176
+   25edc:	00802821 	addu	a1,a0,zero
+   25ee0:	27a40010 	addiu	a0,sp,16
+   25ee4:	afbf0024 	sw	ra,36(sp)
+   25ee8:	afa30010 	sw	v1,16(sp)
+   25eec:	afa20018 	sw	v0,24(sp)
+   25ef0:	afa20014 	sw	v0,20(sp)
+   25ef4:	0c0096bc 	jal	25af0 <vfat_readdir+0x238>
+   25ef8:	afa0001c 	sw	zero,28(sp)
+   25efc:	8fbf0024 	lw	ra,36(sp)
+   25f00:	03e00008 	jr	ra
+   25f04:	27bd0028 	addiu	sp,sp,40
+
+00025f08 <vfat_node_write_page>:
+   25f08:	8c820018 	lw	v0,24(a0)
+   25f0c:	27bdffc8 	addiu	sp,sp,-56
+   25f10:	8c430000 	lw	v1,0(v0)
+   25f14:	afb10024 	sw	s1,36(sp)
+   25f18:	8c6200a0 	lw	v0,160(v1)
+   25f1c:	afb00020 	sw	s0,32(sp)
+   25f20:	30a50001 	andi	a1,a1,0x1
+   25f24:	00808021 	addu	s0,a0,zero
+   25f28:	00008821 	addu	s1,zero,zero
+   25f2c:	24040002 	addiu	a0,zero,2
+   25f30:	afbf0034 	sw	ra,52(sp)
+   25f34:	afb40030 	sw	s4,48(sp)
+   25f38:	afb3002c 	sw	s3,44(sp)
+   25f3c:	afb20028 	sw	s2,40(sp)
+   25f40:	10400017 	beqz	v0,25fa0 <vfat_node_write_page+0x98>
+   25f44:	0085880b 	movn	s1,a0,a1
+   25f48:	8c440210 	lw	a0,528(v0)
+   25f4c:	8c4301c0 	lw	v1,448(v0)
+   25f50:	8c820004 	lw	v0,4(a0)
+   25f54:	246300b0 	addiu	v1,v1,176
+   25f58:	02002821 	addu	a1,s0,zero
+   25f5c:	02203021 	addu	a2,s1,zero
+   25f60:	27a40010 	addiu	a0,sp,16
+   25f64:	afa30010 	sw	v1,16(sp)
+   25f68:	afa20018 	sw	v0,24(sp)
+   25f6c:	afa20014 	sw	v0,20(sp)
+   25f70:	0c0096bc 	jal	25af0 <vfat_readdir+0x238>
+   25f74:	afa0001c 	sw	zero,28(sp)
+   25f78:	0040a021 	addu	s4,v0,zero
+   25f7c:	8fbf0034 	lw	ra,52(sp)
+   25f80:	02801021 	addu	v0,s4,zero
+   25f84:	8fb40030 	lw	s4,48(sp)
+   25f88:	8fb3002c 	lw	s3,44(sp)
+   25f8c:	8fb20028 	lw	s2,40(sp)
+   25f90:	8fb10024 	lw	s1,36(sp)
+   25f94:	8fb00020 	lw	s0,32(sp)
+   25f98:	03e00008 	jr	ra
+   25f9c:	27bd0038 	addiu	sp,sp,56
+   25fa0:	8c6201c8 	lw	v0,456(v1)
+   25fa4:	02002821 	addu	a1,s0,zero
+   25fa8:	8c440004 	lw	a0,4(v0)
+   25fac:	24060001 	addiu	a2,zero,1
+   25fb0:	8c5200d8 	lw	s2,216(v0)
+   25fb4:	0c001c37 	jal	70dc <blkio_init>
+   25fb8:	8e130014 	lw	s3,20(s0)
+   25fbc:	1440ffef 	bnez	v0,25f7c <vfat_node_write_page+0x74>
+   25fc0:	0040a021 	addu	s4,v0,zero
+   25fc4:	24021000 	addiu	v0,zero,4096
+   25fc8:	0052001b 	divu	zero,v0,s2
+   25fcc:	024001f4 	teq	s2,zero,0x7
+   25fd0:	02002021 	addu	a0,s0,zero
+   25fd4:	0c007c15 	jal	1f054 <ppm_page2addr>
+   25fd8:	00009012 	mflo	s2
+   25fdc:	72539802 	mul	s3,s2,s3
+   25fe0:	8e03001c 	lw	v1,28(s0)
+   25fe4:	02002021 	addu	a0,s0,zero
+   25fe8:	2463ff5c 	addiu	v1,v1,-164
+   25fec:	02202821 	addu	a1,s1,zero
+   25ff0:	ac620044 	sw	v0,68(v1)
+   25ff4:	ac720048 	sw	s2,72(v1)
+   25ff8:	0c001bcd 	jal	6f34 <blkio_sync>
+   25ffc:	ac730040 	sw	s3,64(v1)
+   26000:	02002021 	addu	a0,s0,zero
+   26004:	0c001bab 	jal	6eac <blkio_destroy>
+   26008:	0040a021 	addu	s4,v0,zero
+   2600c:	080097e0 	j	25f80 <vfat_node_write_page+0x78>
+   26010:	8fbf0034 	lw	ra,52(sp)
+
+00026014 <vfat_node_read_page>:
+   26014:	8c820018 	lw	v0,24(a0)
+   26018:	27bdffc8 	addiu	sp,sp,-56
+   2601c:	8c430000 	lw	v1,0(v0)
+   26020:	afb10024 	sw	s1,36(sp)
+   26024:	8c6200a0 	lw	v0,160(v1)
+   26028:	afb00020 	sw	s0,32(sp)
+   2602c:	00808821 	addu	s1,a0,zero
+   26030:	30a50001 	andi	a1,a1,0x1
+   26034:	24100001 	addiu	s0,zero,1
+   26038:	24040003 	addiu	a0,zero,3
+   2603c:	afbf0034 	sw	ra,52(sp)
+   26040:	afb40030 	sw	s4,48(sp)
+   26044:	afb3002c 	sw	s3,44(sp)
+   26048:	afb20028 	sw	s2,40(sp)
+   2604c:	10400017 	beqz	v0,260ac <vfat_node_read_page+0x98>
+   26050:	0085800b 	movn	s0,a0,a1
+   26054:	8c440210 	lw	a0,528(v0)
+   26058:	8c4301c0 	lw	v1,448(v0)
+   2605c:	8c820004 	lw	v0,4(a0)
+   26060:	246300b0 	addiu	v1,v1,176
+   26064:	02202821 	addu	a1,s1,zero
+   26068:	02003021 	addu	a2,s0,zero
+   2606c:	27a40010 	addiu	a0,sp,16
+   26070:	afa30010 	sw	v1,16(sp)
+   26074:	afa20018 	sw	v0,24(sp)
+   26078:	afa20014 	sw	v0,20(sp)
+   2607c:	0c0096bc 	jal	25af0 <vfat_readdir+0x238>
+   26080:	afa0001c 	sw	zero,28(sp)
+   26084:	0040a021 	addu	s4,v0,zero
+   26088:	8fbf0034 	lw	ra,52(sp)
+   2608c:	02801021 	addu	v0,s4,zero
+   26090:	8fb40030 	lw	s4,48(sp)
+   26094:	8fb3002c 	lw	s3,44(sp)
+   26098:	8fb20028 	lw	s2,40(sp)
+   2609c:	8fb10024 	lw	s1,36(sp)
+   260a0:	8fb00020 	lw	s0,32(sp)
+   260a4:	03e00008 	jr	ra
+   260a8:	27bd0038 	addiu	sp,sp,56
+   260ac:	8c6201c8 	lw	v0,456(v1)
+   260b0:	02202821 	addu	a1,s1,zero
+   260b4:	8c440004 	lw	a0,4(v0)
+   260b8:	24060001 	addiu	a2,zero,1
+   260bc:	8c5200d8 	lw	s2,216(v0)
+   260c0:	0c001c37 	jal	70dc <blkio_init>
+   260c4:	8e330014 	lw	s3,20(s1)
+   260c8:	1440ffef 	bnez	v0,26088 <vfat_node_read_page+0x74>
+   260cc:	0040a021 	addu	s4,v0,zero
+   260d0:	24021000 	addiu	v0,zero,4096
+   260d4:	0052001b 	divu	zero,v0,s2
+   260d8:	024001f4 	teq	s2,zero,0x7
+   260dc:	02202021 	addu	a0,s1,zero
+   260e0:	0c007c15 	jal	1f054 <ppm_page2addr>
+   260e4:	00009012 	mflo	s2
+   260e8:	72539802 	mul	s3,s2,s3
+   260ec:	8e23001c 	lw	v1,28(s1)
+   260f0:	02202021 	addu	a0,s1,zero
+   260f4:	2463ff5c 	addiu	v1,v1,-164
+   260f8:	02002821 	addu	a1,s0,zero
+   260fc:	ac620044 	sw	v0,68(v1)
+   26100:	ac720048 	sw	s2,72(v1)
+   26104:	0c001bcd 	jal	6f34 <blkio_sync>
+   26108:	ac730040 	sw	s3,64(v1)
+   2610c:	02202021 	addu	a0,s1,zero
+   26110:	0c001bab 	jal	6eac <blkio_destroy>
+   26114:	0040a021 	addu	s4,v0,zero
+   26118:	08009823 	j	2608c <vfat_node_read_page+0x78>
+   2611c:	8fbf0034 	lw	ra,52(sp)
+
+00026120 <vfat_kmem_inode_init>:
+   26120:	2403000b 	addiu	v1,zero,11
+   26124:	ac830000 	sw	v1,0(a0)
+   26128:	3c030003 	lui	v1,0x3
+   2612c:	24637714 	addiu	v1,v1,30484
+   26130:	24020002 	addiu	v0,zero,2
+   26134:	ac830004 	sw	v1,4(a0)
+   26138:	24030008 	addiu	v1,zero,8
+   2613c:	ac820010 	sw	v0,16(a0)
+   26140:	ac82000c 	sw	v0,12(a0)
+   26144:	ac830008 	sw	v1,8(a0)
+   26148:	ac80001c 	sw	zero,28(a0)
+   2614c:	ac800014 	sw	zero,20(a0)
+   26150:	ac800018 	sw	zero,24(a0)
+   26154:	03e00008 	jr	ra
+   26158:	00001021 	addu	v0,zero,zero
+
+0002615c <vfat_getshortname>:
+   2615c:	00803021 	addu	a2,a0,zero
+   26160:	00001021 	addu	v0,zero,zero
+   26164:	24070020 	addiu	a3,zero,32
+   26168:	0800985d 	j	26174 <vfat_getshortname+0x18>
+   2616c:	24080008 	addiu	t0,zero,8
+   26170:	24c60001 	addiu	a2,a2,1
+   26174:	80c30000 	lb	v1,0(a2)
+   26178:	10670004 	beq	v1,a3,2618c <vfat_getshortname+0x30>
+   2617c:	24420001 	addiu	v0,v0,1
+   26180:	a0a30000 	sb	v1,0(a1)
+   26184:	1448fffa 	bne	v0,t0,26170 <vfat_getshortname+0x14>
+   26188:	24a50001 	addiu	a1,a1,1
+   2618c:	80830008 	lb	v1,8(a0)
+   26190:	24020020 	addiu	v0,zero,32
+   26194:	10620010 	beq	v1,v0,261d8 <vfat_getshortname+0x7c>
+   26198:	2403002e 	addiu	v1,zero,46
+   2619c:	a0a30000 	sb	v1,0(a1)
+   261a0:	80830008 	lb	v1,8(a0)
+   261a4:	1062000c 	beq	v1,v0,261d8 <vfat_getshortname+0x7c>
+   261a8:	24a50001 	addiu	a1,a1,1
+   261ac:	a0a30000 	sb	v1,0(a1)
+   261b0:	80830009 	lb	v1,9(a0)
+   261b4:	24a50001 	addiu	a1,a1,1
+   261b8:	10620007 	beq	v1,v0,261d8 <vfat_getshortname+0x7c>
+   261bc:	24840009 	addiu	a0,a0,9
+   261c0:	a0a30000 	sb	v1,0(a1)
+   261c4:	80830001 	lb	v1,1(a0)
+   261c8:	10620003 	beq	v1,v0,261d8 <vfat_getshortname+0x7c>
+   261cc:	24a50001 	addiu	a1,a1,1
+   261d0:	a0a30000 	sb	v1,0(a1)
+   261d4:	24a50001 	addiu	a1,a1,1
+   261d8:	03e00008 	jr	ra
+   261dc:	a0a00000 	sb	zero,0(a1)
+
+000261e0 <vfat_compare>:
+   261e0:	0800c484 	j	31210 <strcasecmp>
+   261e4:	00000000 	sll	zero,zero,0x0
+
+000261e8 <__vfat_write_inode_main>:
+   261e8:	27bdffd0 	addiu	sp,sp,-48
+   261ec:	afb00018 	sw	s0,24(sp)
+   261f0:	8fb00044 	lw	s0,68(sp)
+   261f4:	afb30024 	sw	s3,36(sp)
+   261f8:	afb20020 	sw	s2,32(sp)
+   261fc:	afb1001c 	sw	s1,28(sp)
+   26200:	8ce2011c 	lw	v0,284(a3)
+   26204:	24030016 	addiu	v1,zero,22
+   26208:	afbf002c 	sw	ra,44(sp)
+   2620c:	afb40028 	sw	s4,40(sp)
+   26210:	acf00100 	sw	s0,256(a3)
+   26214:	8ce50194 	lw	a1,404(a3)
+   26218:	acc30000 	sw	v1,0(a2)
+   2621c:	8c430000 	lw	v1,0(v0)
+   26220:	8ce20180 	lw	v0,384(a3)
+   26224:	00c08821 	addu	s1,a2,zero
+   26228:	8c5201c4 	lw	s2,452(v0)
+   2622c:	24020002 	addiu	v0,zero,2
+   26230:	10620009 	beq	v1,v0,26258 <__vfat_write_inode_main+0x70>
+   26234:	8fb30040 	lw	s3,64(sp)
+   26238:	8fbf002c 	lw	ra,44(sp)
+   2623c:	8fb40028 	lw	s4,40(sp)
+   26240:	8fb30024 	lw	s3,36(sp)
+   26244:	8fb20020 	lw	s2,32(sp)
+   26248:	8fb1001c 	lw	s1,28(sp)
+   2624c:	8fb00018 	lw	s0,24(sp)
+   26250:	03e00008 	jr	ra
+   26254:	27bd0030 	addiu	sp,sp,48
+   26258:	24020005 	addiu	v0,zero,5
+   2625c:	00052880 	sll	a1,a1,0x2
+   26260:	acc20000 	sw	v0,0(a2)
+   26264:	00052b02 	srl	a1,a1,0xc
+   26268:	02402021 	addu	a0,s2,zero
+   2626c:	24060001 	addiu	a2,zero,1
+   26270:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   26274:	afa70010 	sw	a3,16(sp)
+   26278:	1040ffef 	beqz	v0,26238 <__vfat_write_inode_main+0x50>
+   2627c:	0040a021 	addu	s4,v0,zero
+   26280:	0c007a7a 	jal	1e9e8 <page_lock>
+   26284:	00402021 	addu	a0,v0,zero
+   26288:	0c007c15 	jal	1f054 <ppm_page2addr>
+   2628c:	02802021 	addu	a0,s4,zero
+   26290:	8fa70010 	lw	a3,16(sp)
+   26294:	32030001 	andi	v1,s0,0x1
+   26298:	8ce40194 	lw	a0,404(a3)
+   2629c:	00042140 	sll	a0,a0,0x5
+   262a0:	10600004 	beqz	v1,262b4 <__vfat_write_inode_main+0xcc>
+   262a4:	00441021 	addu	v0,v0,a0
+   262a8:	9043000b 	lbu	v1,11(v0)
+   262ac:	34630010 	ori	v1,v1,0x10
+   262b0:	a043000b 	sb	v1,11(v0)
+   262b4:	32030080 	andi	v1,s0,0x80
+   262b8:	10600005 	beqz	v1,262d0 <__vfat_write_inode_main+0xe8>
+   262bc:	32030100 	andi	v1,s0,0x100
+   262c0:	9043000b 	lbu	v1,11(v0)
+   262c4:	34630004 	ori	v1,v1,0x4
+   262c8:	a043000b 	sb	v1,11(v0)
+   262cc:	32030100 	andi	v1,s0,0x100
+   262d0:	10600004 	beqz	v1,262e4 <__vfat_write_inode_main+0xfc>
+   262d4:	00000000 	sll	zero,zero,0x0
+   262d8:	9043000b 	lbu	v1,11(v0)
+   262dc:	34630020 	ori	v1,v1,0x20
+   262e0:	a043000b 	sb	v1,11(v0)
+   262e4:	32100040 	andi	s0,s0,0x40
+   262e8:	12000004 	beqz	s0,262fc <__vfat_write_inode_main+0x114>
+   262ec:	00000000 	sll	zero,zero,0x0
+   262f0:	9043000b 	lbu	v1,11(v0)
+   262f4:	34630001 	ori	v1,v1,0x1
+   262f8:	a043000b 	sb	v1,11(v0)
+   262fc:	a853001f 	swl	s3,31(v0)
+   26300:	b853001c 	swr	s3,28(v0)
+   26304:	8e420000 	lw	v0,0(s2)
+   26308:	8c4200a4 	lw	v0,164(v0)
+   2630c:	8c42000c 	lw	v0,12(v0)
+   26310:	0040f809 	jalr	v0
+   26314:	02802021 	addu	a0,s4,zero
+   26318:	0c007a5c 	jal	1e970 <page_unlock>
+   2631c:	02802021 	addu	a0,s4,zero
+   26320:	8fbf002c 	lw	ra,44(sp)
+   26324:	ae200000 	sw	zero,0(s1)
+   26328:	8fb40028 	lw	s4,40(sp)
+   2632c:	8fb30024 	lw	s3,36(sp)
+   26330:	8fb20020 	lw	s2,32(sp)
+   26334:	8fb1001c 	lw	s1,28(sp)
+   26338:	8fb00018 	lw	s0,24(sp)
+   2633c:	03e00008 	jr	ra
+   26340:	27bd0030 	addiu	sp,sp,48
+
+00026344 <__vfat_write_inode_local>:
+   26344:	27bdffe0 	addiu	sp,sp,-32
+   26348:	afbf001c 	sw	ra,28(sp)
+   2634c:	00804021 	addu	t0,a0,zero
+   26350:	00a01021 	addu	v0,a1,zero
+   26354:	00e04821 	addu	t1,a3,zero
+   26358:	40057801 	mfc0	a1,$15,1
+   2635c:	3c030004 	lui	v1,0x4
+   26360:	2464c960 	addiu	a0,v1,-13984
+   26364:	88840003 	lwl	a0,3(a0)
+   26368:	30a50003 	andi	a1,a1,0x3
+   2636c:	3c070004 	lui	a3,0x4
+   26370:	24e7c950 	addiu	a3,a3,-14000
+   26374:	00052880 	sll	a1,a1,0x2
+   26378:	9864c960 	lwr	a0,-13984(v1)
+   2637c:	00a72821 	addu	a1,a1,a3
+   26380:	8cc30000 	lw	v1,0(a2)
+   26384:	8c470000 	lw	a3,0(v0)
+   26388:	8ca50000 	lw	a1,0(a1)
+   2638c:	8d220000 	lw	v0,0(t1)
+   26390:	3084ffff 	andi	a0,a0,0xffff
+   26394:	01003021 	addu	a2,t0,zero
+   26398:	afa30010 	sw	v1,16(sp)
+   2639c:	0c00987a 	jal	261e8 <__vfat_write_inode_main>
+   263a0:	afa20014 	sw	v0,20(sp)
+   263a4:	8fbf001c 	lw	ra,28(sp)
+   263a8:	03e00008 	jr	ra
+   263ac:	27bd0020 	addiu	sp,sp,32
+
+000263b0 <vfat_unlink_node>:
+   263b0:	8ca20100 	lw	v0,256(a1)
+   263b4:	27bdffa0 	addiu	sp,sp,-96
+   263b8:	30420002 	andi	v0,v0,0x2
+   263bc:	afb4004c 	sw	s4,76(sp)
+   263c0:	afb30048 	sw	s3,72(sp)
+   263c4:	afb0003c 	sw	s0,60(sp)
+   263c8:	afbf005c 	sw	ra,92(sp)
+   263cc:	afb70058 	sw	s7,88(sp)
+   263d0:	afb60054 	sw	s6,84(sp)
+   263d4:	afb50050 	sw	s5,80(sp)
+   263d8:	afb20044 	sw	s2,68(sp)
+   263dc:	afb10040 	sw	s1,64(sp)
+   263e0:	00a08021 	addu	s0,a1,zero
+   263e4:	00809821 	addu	s3,a0,zero
+   263e8:	8ca3011c 	lw	v1,284(a1)
+   263ec:	10400032 	beqz	v0,264b8 <vfat_unlink_node+0x108>
+   263f0:	8c9401c4 	lw	s4,452(a0)
+   263f4:	3c020003 	lui	v0,0x3
+   263f8:	8ca40190 	lw	a0,400(a1)
+   263fc:	2442778c 	addiu	v0,v0,30604
+   26400:	1082002d 	beq	a0,v0,264b8 <vfat_unlink_node+0x108>
+   26404:	246200b0 	addiu	v0,v1,176
+   26408:	afa20028 	sw	v0,40(sp)
+   2640c:	27a40024 	addiu	a0,sp,36
+   26410:	27a20020 	addiu	v0,sp,32
+   26414:	afa20034 	sw	v0,52(sp)
+   26418:	afa00024 	sw	zero,36(sp)
+   2641c:	afb3002c 	sw	s3,44(sp)
+   26420:	0c008f9f 	jal	23e7c <vfat_locate_entry>
+   26424:	afa50030 	sw	a1,48(sp)
+   26428:	1440005f 	bnez	v0,265a8 <vfat_unlink_node+0x1f8>
+   2642c:	00408821 	addu	s1,v0,zero
+   26430:	8fb10020 	lw	s1,32(sp)
+   26434:	02802021 	addu	a0,s4,zero
+   26438:	00118940 	sll	s1,s1,0x5
+   2643c:	00118b02 	srl	s1,s1,0xc
+   26440:	02202821 	addu	a1,s1,zero
+   26444:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   26448:	24060001 	addiu	a2,zero,1
+   2644c:	14400024 	bnez	v0,264e0 <vfat_unlink_node+0x130>
+   26450:	00409021 	addu	s2,v0,zero
+   26454:	3c020004 	lui	v0,0x4
+   26458:	8c449100 	lw	a0,-28416(v0)
+   2645c:	3c060003 	lui	a2,0x3
+   26460:	8e620000 	lw	v0,0(s3)
+   26464:	3c070003 	lui	a3,0x3
+   26468:	24c67724 	addiu	a2,a2,30500
+   2646c:	24e77790 	addiu	a3,a3,30608
+   26470:	00002821 	addu	a1,zero,zero
+   26474:	afb10010 	sw	s1,16(sp)
+   26478:	afb00018 	sw	s0,24(sp)
+   2647c:	0c0009b0 	jal	26c0 <__fprintk>
+   26480:	afa20014 	sw	v0,20(sp)
+   26484:	8fbf005c 	lw	ra,92(sp)
+   26488:	24110005 	addiu	s1,zero,5
+   2648c:	02201021 	addu	v0,s1,zero
+   26490:	8fb70058 	lw	s7,88(sp)
+   26494:	8fb60054 	lw	s6,84(sp)
+   26498:	8fb50050 	lw	s5,80(sp)
+   2649c:	8fb4004c 	lw	s4,76(sp)
+   264a0:	8fb30048 	lw	s3,72(sp)
+   264a4:	8fb20044 	lw	s2,68(sp)
+   264a8:	8fb10040 	lw	s1,64(sp)
+   264ac:	8fb0003c 	lw	s0,60(sp)
+   264b0:	03e00008 	jr	ra
+   264b4:	27bd0060 	addiu	sp,sp,96
+   264b8:	8e110194 	lw	s1,404(s0)
+   264bc:	02802021 	addu	a0,s4,zero
+   264c0:	afb10020 	sw	s1,32(sp)
+   264c4:	00118940 	sll	s1,s1,0x5
+   264c8:	00118b02 	srl	s1,s1,0xc
+   264cc:	02202821 	addu	a1,s1,zero
+   264d0:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   264d4:	24060001 	addiu	a2,zero,1
+   264d8:	1040ffde 	beqz	v0,26454 <vfat_unlink_node+0xa4>
+   264dc:	00409021 	addu	s2,v0,zero
+   264e0:	0c007c15 	jal	1f054 <ppm_page2addr>
+   264e4:	00402021 	addu	a0,v0,zero
+   264e8:	8fa30020 	lw	v1,32(sp)
+   264ec:	3075007f 	andi	s5,v1,0x7f
+   264f0:	0015a940 	sll	s5,s5,0x5
+   264f4:	0055a821 	addu	s5,v0,s5
+   264f8:	2402007f 	addiu	v0,zero,127
+   264fc:	10620038 	beq	v1,v0,265e0 <vfat_unlink_node+0x230>
+   26500:	26b70020 	addiu	s7,s5,32
+   26504:	0000b021 	addu	s6,zero,zero
+   26508:	0c00ac04 	jal	2b010 <vfs_unlink_inode>
+   2650c:	26040110 	addiu	a0,s0,272
+   26510:	14400022 	bnez	v0,2659c <vfat_unlink_node+0x1ec>
+   26514:	00408821 	addu	s1,v0,zero
+   26518:	12c00003 	beqz	s6,26528 <vfat_unlink_node+0x178>
+   2651c:	00000000 	sll	zero,zero,0x0
+   26520:	0c007a7a 	jal	1e9e8 <page_lock>
+   26524:	02c02021 	addu	a0,s6,zero
+   26528:	0c007a7a 	jal	1e9e8 <page_lock>
+   2652c:	02402021 	addu	a0,s2,zero
+   26530:	92e20000 	lbu	v0,0(s7)
+   26534:	10400028 	beqz	v0,265d8 <vfat_unlink_node+0x228>
+   26538:	2402ffe5 	addiu	v0,zero,-27
+   2653c:	a2a20000 	sb	v0,0(s5)
+   26540:	8e820000 	lw	v0,0(s4)
+   26544:	8c4200a4 	lw	v0,164(v0)
+   26548:	8c42000c 	lw	v0,12(v0)
+   2654c:	0040f809 	jalr	v0
+   26550:	02402021 	addu	a0,s2,zero
+   26554:	0c007a5c 	jal	1e970 <page_unlock>
+   26558:	02402021 	addu	a0,s2,zero
+   2655c:	12c00013 	beqz	s6,265ac <vfat_unlink_node+0x1fc>
+   26560:	8fbf005c 	lw	ra,92(sp)
+   26564:	0c007a5c 	jal	1e970 <page_unlock>
+   26568:	02c02021 	addu	a0,s6,zero
+   2656c:	8fbf005c 	lw	ra,92(sp)
+   26570:	02201021 	addu	v0,s1,zero
+   26574:	8fb70058 	lw	s7,88(sp)
+   26578:	8fb60054 	lw	s6,84(sp)
+   2657c:	8fb50050 	lw	s5,80(sp)
+   26580:	8fb4004c 	lw	s4,76(sp)
+   26584:	8fb30048 	lw	s3,72(sp)
+   26588:	8fb20044 	lw	s2,68(sp)
+   2658c:	8fb10040 	lw	s1,64(sp)
+   26590:	8fb0003c 	lw	s0,60(sp)
+   26594:	03e00008 	jr	ra
+   26598:	27bd0060 	addiu	sp,sp,96
+   2659c:	24020005 	addiu	v0,zero,5
+   265a0:	1222001a 	beq	s1,v0,2660c <vfat_unlink_node+0x25c>
+   265a4:	00000000 	sll	zero,zero,0x0
+   265a8:	8fbf005c 	lw	ra,92(sp)
+   265ac:	02201021 	addu	v0,s1,zero
+   265b0:	8fb70058 	lw	s7,88(sp)
+   265b4:	8fb60054 	lw	s6,84(sp)
+   265b8:	8fb50050 	lw	s5,80(sp)
+   265bc:	8fb4004c 	lw	s4,76(sp)
+   265c0:	8fb30048 	lw	s3,72(sp)
+   265c4:	8fb20044 	lw	s2,68(sp)
+   265c8:	8fb10040 	lw	s1,64(sp)
+   265cc:	8fb0003c 	lw	s0,60(sp)
+   265d0:	03e00008 	jr	ra
+   265d4:	27bd0060 	addiu	sp,sp,96
+   265d8:	08009950 	j	26540 <vfat_unlink_node+0x190>
+   265dc:	a2a00000 	sb	zero,0(s5)
+   265e0:	26310001 	addiu	s1,s1,1
+   265e4:	02802021 	addu	a0,s4,zero
+   265e8:	02202821 	addu	a1,s1,zero
+   265ec:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   265f0:	24060001 	addiu	a2,zero,1
+   265f4:	1040ff97 	beqz	v0,26454 <vfat_unlink_node+0xa4>
+   265f8:	0040b021 	addu	s6,v0,zero
+   265fc:	0c007c15 	jal	1f054 <ppm_page2addr>
+   26600:	00402021 	addu	a0,v0,zero
+   26604:	08009942 	j	26508 <vfat_unlink_node+0x158>
+   26608:	0040b821 	addu	s7,v0,zero
+   2660c:	08009915 	j	26454 <vfat_unlink_node+0xa4>
+   26610:	00008821 	addu	s1,zero,zero
+
+00026614 <vfat_delete>:
+   26614:	8c8301c0 	lw	v1,448(a0)
+   26618:	8c820008 	lw	v0,8(a0)
+   2661c:	27bdffa0 	addiu	sp,sp,-96
+   26620:	afa30030 	sw	v1,48(sp)
+   26624:	30430001 	andi	v1,v0,0x1
+   26628:	afbe0058 	sw	s8,88(sp)
+   2662c:	afb30044 	sw	s3,68(sp)
+   26630:	afb20040 	sw	s2,64(sp)
+   26634:	afbf005c 	sw	ra,92(sp)
+   26638:	afb70054 	sw	s7,84(sp)
+   2663c:	afb60050 	sw	s6,80(sp)
+   26640:	afb5004c 	sw	s5,76(sp)
+   26644:	afb40048 	sw	s4,72(sp)
+   26648:	afb1003c 	sw	s1,60(sp)
+   2664c:	afb00038 	sw	s0,56(sp)
+   26650:	00809021 	addu	s2,a0,zero
+   26654:	8c9e0210 	lw	s8,528(a0)
+   26658:	1060004b 	beqz	v1,26788 <vfat_delete+0x174>
+   2665c:	8c9301c4 	lw	s3,452(a0)
+   26660:	00008821 	addu	s1,zero,zero
+   26664:	02602021 	addu	a0,s3,zero
+   26668:	00112b02 	srl	a1,s1,0xc
+   2666c:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   26670:	24060001 	addiu	a2,zero,1
+   26674:	27b40010 	addiu	s4,sp,16
+   26678:	241500e5 	addiu	s5,zero,229
+   2667c:	2416000f 	addiu	s6,zero,15
+   26680:	2417002e 	addiu	s7,zero,46
+   26684:	00408021 	addu	s0,v0,zero
+   26688:	10400032 	beqz	v0,26754 <vfat_delete+0x140>
+   2668c:	00402021 	addu	a0,v0,zero
+   26690:	0c007a7a 	jal	1e9e8 <page_lock>
+   26694:	00000000 	sll	zero,zero,0x0
+   26698:	0c007c15 	jal	1f054 <ppm_page2addr>
+   2669c:	02002021 	addu	a0,s0,zero
+   266a0:	32250fff 	andi	a1,s1,0xfff
+   266a4:	00452821 	addu	a1,v0,a1
+   266a8:	02802021 	addu	a0,s4,zero
+   266ac:	0c00c12b 	jal	304ac <memcpy>
+   266b0:	24060020 	addiu	a2,zero,32
+   266b4:	93a20010 	lbu	v0,16(sp)
+   266b8:	1040003c 	beqz	v0,267ac <vfat_delete+0x198>
+   266bc:	00000000 	sll	zero,zero,0x0
+   266c0:	1055001a 	beq	v0,s5,2672c <vfat_delete+0x118>
+   266c4:	93a3001b 	lbu	v1,27(sp)
+   266c8:	10760038 	beq	v1,s6,267ac <vfat_delete+0x198>
+   266cc:	00000000 	sll	zero,zero,0x0
+   266d0:	10570017 	beq	v0,s7,26730 <vfat_delete+0x11c>
+   266d4:	02002021 	addu	a0,s0,zero
+   266d8:	0c007a5c 	jal	1e970 <page_unlock>
+   266dc:	02002021 	addu	a0,s0,zero
+   266e0:	8e420008 	lw	v0,8(s2)
+   266e4:	24100001 	addiu	s0,zero,1
+   266e8:	30420002 	andi	v0,v0,0x2
+   266ec:	1040002a 	beqz	v0,26798 <vfat_delete+0x184>
+   266f0:	8fa20030 	lw	v0,48(sp)
+   266f4:	8fbf005c 	lw	ra,92(sp)
+   266f8:	24020027 	addiu	v0,zero,39
+   266fc:	0010100a 	movz	v0,zero,s0
+   26700:	8fbe0058 	lw	s8,88(sp)
+   26704:	8fb70054 	lw	s7,84(sp)
+   26708:	8fb60050 	lw	s6,80(sp)
+   2670c:	8fb5004c 	lw	s5,76(sp)
+   26710:	8fb40048 	lw	s4,72(sp)
+   26714:	8fb30044 	lw	s3,68(sp)
+   26718:	8fb20040 	lw	s2,64(sp)
+   2671c:	8fb1003c 	lw	s1,60(sp)
+   26720:	8fb00038 	lw	s0,56(sp)
+   26724:	03e00008 	jr	ra
+   26728:	27bd0060 	addiu	sp,sp,96
+   2672c:	02002021 	addu	a0,s0,zero
+   26730:	0c007a5c 	jal	1e970 <page_unlock>
+   26734:	26310020 	addiu	s1,s1,32
+   26738:	02602021 	addu	a0,s3,zero
+   2673c:	00112b02 	srl	a1,s1,0xc
+   26740:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   26744:	24060001 	addiu	a2,zero,1
+   26748:	00408021 	addu	s0,v0,zero
+   2674c:	1440ffd0 	bnez	v0,26690 <vfat_delete+0x7c>
+   26750:	00402021 	addu	a0,v0,zero
+   26754:	8fbf005c 	lw	ra,92(sp)
+   26758:	24020005 	addiu	v0,zero,5
+   2675c:	8fbe0058 	lw	s8,88(sp)
+   26760:	8fb70054 	lw	s7,84(sp)
+   26764:	8fb60050 	lw	s6,80(sp)
+   26768:	8fb5004c 	lw	s5,76(sp)
+   2676c:	8fb40048 	lw	s4,72(sp)
+   26770:	8fb30044 	lw	s3,68(sp)
+   26774:	8fb20040 	lw	s2,64(sp)
+   26778:	8fb1003c 	lw	s1,60(sp)
+   2677c:	8fb00038 	lw	s0,56(sp)
+   26780:	03e00008 	jr	ra
+   26784:	27bd0060 	addiu	sp,sp,96
+   26788:	30420002 	andi	v0,v0,0x2
+   2678c:	1440ffd9 	bnez	v0,266f4 <vfat_delete+0xe0>
+   26790:	00008021 	addu	s0,zero,zero
+   26794:	8fa20030 	lw	v0,48(sp)
+   26798:	8fc50004 	lw	a1,4(s8)
+   2679c:	0c009200 	jal	24800 <vfat_free_fat_entry>
+   267a0:	244400b0 	addiu	a0,v0,176
+   267a4:	080099be 	j	266f8 <vfat_delete+0xe4>
+   267a8:	8fbf005c 	lw	ra,92(sp)
+   267ac:	0c007a5c 	jal	1e970 <page_unlock>
+   267b0:	02002021 	addu	a0,s0,zero
+   267b4:	00008021 	addu	s0,zero,zero
+   267b8:	080099ba 	j	266e8 <vfat_delete+0xd4>
+   267bc:	8e420008 	lw	v0,8(s2)
+
+000267c0 <vfat_write_node>:
+   267c0:	27bdff98 	addiu	sp,sp,-104
+   267c4:	3c020004 	lui	v0,0x4
+   267c8:	afb0005c 	sw	s0,92(sp)
+   267cc:	2443c960 	addiu	v1,v0,-13984
+   267d0:	afbf0064 	sw	ra,100(sp)
+   267d4:	afb10060 	sw	s1,96(sp)
+   267d8:	88630003 	lwl	v1,3(v1)
+   267dc:	8c880008 	lw	t0,8(a0)
+   267e0:	9843c960 	lwr	v1,-13984(v0)
+   267e4:	8c8a0060 	lw	t2,96(a0)
+   267e8:	8c890018 	lw	t1,24(a0)
+   267ec:	9490006c 	lhu	s0,108(a0)
+   267f0:	24020004 	addiu	v0,zero,4
+   267f4:	27a4002c 	addiu	a0,sp,44
+   267f8:	27a50028 	addiu	a1,sp,40
+   267fc:	27a60034 	addiu	a2,sp,52
+   26800:	27a70030 	addiu	a3,sp,48
+   26804:	3063ffff 	andi	v1,v1,0xffff
+   26808:	afaa0028 	sw	t2,40(sp)
+   2680c:	afa90034 	sw	t1,52(sp)
+   26810:	afa80030 	sw	t0,48(sp)
+   26814:	afa20054 	sw	v0,84(sp)
+   26818:	afa40038 	sw	a0,56(sp)
+   2681c:	afa2003c 	sw	v0,60(sp)
+   26820:	afa50040 	sw	a1,64(sp)
+   26824:	afa60044 	sw	a2,68(sp)
+   26828:	afa70048 	sw	a3,72(sp)
+   2682c:	afa2004c 	sw	v0,76(sp)
+   26830:	1203001e 	beq	s0,v1,268ac <vfat_write_node+0xec>
+   26834:	afa20050 	sw	v0,80(sp)
+   26838:	40117801 	mfc0	s1,$15,1
+   2683c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   26840:	00000000 	sll	zero,zero,0x0
+   26844:	70501802 	mul	v1,v0,s0
+   26848:	24020001 	addiu	v0,zero,1
+   2684c:	afa20010 	sw	v0,16(sp)
+   26850:	24020003 	addiu	v0,zero,3
+   26854:	afa20014 	sw	v0,20(sp)
+   26858:	27a20038 	addiu	v0,sp,56
+   2685c:	afa20018 	sw	v0,24(sp)
+   26860:	27a2003c 	addiu	v0,sp,60
+   26864:	afa2001c 	sw	v0,28(sp)
+   26868:	32240003 	andi	a0,s1,0x3
+   2686c:	27a20040 	addiu	v0,sp,64
+   26870:	3c070002 	lui	a3,0x2
+   26874:	afa20020 	sw	v0,32(sp)
+   26878:	00642021 	addu	a0,v1,a0
+   2687c:	27a2004c 	addiu	v0,sp,76
+   26880:	24e768cc 	addiu	a3,a3,26828
+   26884:	24050001 	addiu	a1,zero,1
+   26888:	00003021 	addu	a2,zero,zero
+   2688c:	0c003de8 	jal	f7a0 <rppc_generic>
+   26890:	afa20024 	sw	v0,36(sp)
+   26894:	8fbf0064 	lw	ra,100(sp)
+   26898:	8fa2002c 	lw	v0,44(sp)
+   2689c:	8fb10060 	lw	s1,96(sp)
+   268a0:	8fb0005c 	lw	s0,92(sp)
+   268a4:	03e00008 	jr	ra
+   268a8:	27bd0068 	addiu	sp,sp,104
+   268ac:	0c0098d1 	jal	26344 <__vfat_write_inode_local>
+   268b0:	00000000 	sll	zero,zero,0x0
+   268b4:	8fbf0064 	lw	ra,100(sp)
+   268b8:	8fa2002c 	lw	v0,44(sp)
+   268bc:	8fb10060 	lw	s1,96(sp)
+   268c0:	8fb0005c 	lw	s0,92(sp)
+   268c4:	03e00008 	jr	ra
+   268c8:	27bd0068 	addiu	sp,sp,104
+
+000268cc <__vfat_write_inode_demarshall>:
+   268cc:	27bdffc0 	addiu	sp,sp,-64
+   268d0:	afbf003c 	sw	ra,60(sp)
+   268d4:	afbe0038 	sw	s8,56(sp)
+   268d8:	afb50034 	sw	s5,52(sp)
+   268dc:	03a0f021 	addu	s8,sp,zero
+   268e0:	afb40030 	sw	s4,48(sp)
+   268e4:	afb3002c 	sw	s3,44(sp)
+   268e8:	afb20028 	sw	s2,40(sp)
+   268ec:	afb10024 	sw	s1,36(sp)
+   268f0:	afb00020 	sw	s0,32(sp)
+   268f4:	27bdfff0 	addiu	sp,sp,-16
+   268f8:	27b20018 	addiu	s2,sp,24
+   268fc:	27bdffc8 	addiu	sp,sp,-56
+   26900:	27b10018 	addiu	s1,sp,24
+   26904:	26220028 	addiu	v0,s1,40
+   26908:	2403002c 	addiu	v1,zero,44
+   2690c:	ae230008 	sw	v1,8(s1)
+   26910:	ae420000 	sw	v0,0(s2)
+   26914:	24030004 	addiu	v1,zero,4
+   26918:	00808021 	addu	s0,a0,zero
+   2691c:	ae230024 	sw	v1,36(s1)
+   26920:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   26924:	8c940000 	lw	s4,0(a0)
+   26928:	8e460000 	lw	a2,0(s2)
+   2692c:	02002021 	addu	a0,s0,zero
+   26930:	00002821 	addu	a1,zero,zero
+   26934:	afc6001c 	sw	a2,28(s8)
+   26938:	8e120000 	lw	s2,0(s0)
+   2693c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   26940:	00409821 	addu	s3,v0,zero
+   26944:	8c470000 	lw	a3,0(v0)
+   26948:	02002021 	addu	a0,s0,zero
+   2694c:	24050001 	addiu	a1,zero,1
+   26950:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   26954:	afc70018 	sw	a3,24(s8)
+   26958:	02002021 	addu	a0,s0,zero
+   2695c:	24050002 	addiu	a1,zero,2
+   26960:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   26964:	8c550000 	lw	s5,0(v0)
+   26968:	0293001b 	divu	zero,s4,s3
+   2696c:	026001f4 	teq	s3,zero,0x7
+   26970:	afb50010 	sw	s5,16(sp)
+   26974:	8c420000 	lw	v0,0(v0)
+   26978:	8fc6001c 	lw	a2,28(s8)
+   2697c:	8fc70018 	lw	a3,24(s8)
+   26980:	02402821 	addu	a1,s2,zero
+   26984:	afa20014 	sw	v0,20(sp)
+   26988:	00002012 	mflo	a0
+   2698c:	0c00987a 	jal	261e8 <__vfat_write_inode_main>
+   26990:	3084ffff 	andi	a0,a0,0xffff
+   26994:	02002021 	addu	a0,s0,zero
+   26998:	02202821 	addu	a1,s1,zero
+   2699c:	2406002c 	addiu	a2,zero,44
+   269a0:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   269a4:	24070001 	addiu	a3,zero,1
+   269a8:	03c0e821 	addu	sp,s8,zero
+   269ac:	8fbf003c 	lw	ra,60(sp)
+   269b0:	8fbe0038 	lw	s8,56(sp)
+   269b4:	8fb50034 	lw	s5,52(sp)
+   269b8:	8fb40030 	lw	s4,48(sp)
+   269bc:	8fb3002c 	lw	s3,44(sp)
+   269c0:	8fb20028 	lw	s2,40(sp)
+   269c4:	8fb10024 	lw	s1,36(sp)
+   269c8:	8fb00020 	lw	s0,32(sp)
+   269cc:	03e00008 	jr	ra
+   269d0:	27bd0040 	addiu	sp,sp,64
+
+000269d4 <vfat_stat_node>:
+   269d4:	8c820210 	lw	v0,528(a0)
+   269d8:	0800a809 	j	2a024 <vfs_stat_inode>
+   269dc:	8c450004 	lw	a1,4(v0)
+
+000269e0 <vfat_lookup>:
+   269e0:	8c820210 	lw	v0,528(a0)
+   269e4:	27bdff68 	addiu	sp,sp,-152
+   269e8:	8c420000 	lw	v0,0(v0)
+   269ec:	afb20084 	sw	s2,132(sp)
+   269f0:	30420010 	andi	v0,v0,0x10
+   269f4:	afb10080 	sw	s1,128(sp)
+   269f8:	afb0007c 	sw	s0,124(sp)
+   269fc:	afbf0094 	sw	ra,148(sp)
+   26a00:	afb50090 	sw	s5,144(sp)
+   26a04:	afb4008c 	sw	s4,140(sp)
+   26a08:	afb30088 	sw	s3,136(sp)
+   26a0c:	00808021 	addu	s0,a0,zero
+   26a10:	00a08821 	addu	s1,a1,zero
+   26a14:	1440000b 	bnez	v0,26a44 <vfat_lookup+0x64>
+   26a18:	8c9201c0 	lw	s2,448(a0)
+   26a1c:	24020014 	addiu	v0,zero,20
+   26a20:	8fbf0094 	lw	ra,148(sp)
+   26a24:	8fb50090 	lw	s5,144(sp)
+   26a28:	8fb4008c 	lw	s4,140(sp)
+   26a2c:	8fb30088 	lw	s3,136(sp)
+   26a30:	8fb20084 	lw	s2,132(sp)
+   26a34:	8fb10080 	lw	s1,128(sp)
+   26a38:	8fb0007c 	lw	s0,124(sp)
+   26a3c:	03e00008 	jr	ra
+   26a40:	27bd0098 	addiu	sp,sp,152
+   26a44:	27a20028 	addiu	v0,sp,40
+   26a48:	265400b0 	addiu	s4,s2,176
+   26a4c:	afa20014 	sw	v0,20(sp)
+   26a50:	27a40014 	addiu	a0,sp,20
+   26a54:	27a20010 	addiu	v0,sp,16
+   26a58:	afa20024 	sw	v0,36(sp)
+   26a5c:	afb40018 	sw	s4,24(sp)
+   26a60:	afb0001c 	sw	s0,28(sp)
+   26a64:	0c008f9f 	jal	23e7c <vfat_locate_entry>
+   26a68:	afa50020 	sw	a1,32(sp)
+   26a6c:	1440ffed 	bnez	v0,26a24 <vfat_lookup+0x44>
+   26a70:	8fbf0094 	lw	ra,148(sp)
+   26a74:	8e230100 	lw	v1,256(s1)
+   26a78:	30620001 	andi	v0,v1,0x1
+   26a7c:	10400047 	beqz	v0,26b9c <vfat_lookup+0x1bc>
+   26a80:	93a20033 	lbu	v0,51(sp)
+   26a84:	30440010 	andi	a0,v0,0x10
+   26a88:	1080ffe4 	beqz	a0,26a1c <vfat_lookup+0x3c>
+   26a8c:	00000000 	sll	zero,zero,0x0
+   26a90:	34630001 	ori	v1,v1,0x1
+   26a94:	ae230100 	sw	v1,256(s1)
+   26a98:	0000a821 	addu	s5,zero,zero
+   26a9c:	30430004 	andi	v1,v0,0x4
+   26aa0:	10600005 	beqz	v1,26ab8 <vfat_lookup+0xd8>
+   26aa4:	30430020 	andi	v1,v0,0x20
+   26aa8:	8e230100 	lw	v1,256(s1)
+   26aac:	34630080 	ori	v1,v1,0x80
+   26ab0:	ae230100 	sw	v1,256(s1)
+   26ab4:	30430020 	andi	v1,v0,0x20
+   26ab8:	10600004 	beqz	v1,26acc <vfat_lookup+0xec>
+   26abc:	00000000 	sll	zero,zero,0x0
+   26ac0:	8e230100 	lw	v1,256(s1)
+   26ac4:	34630100 	ori	v1,v1,0x100
+   26ac8:	ae230100 	sw	v1,256(s1)
+   26acc:	30420001 	andi	v0,v0,0x1
+   26ad0:	10400005 	beqz	v0,26ae8 <vfat_lookup+0x108>
+   26ad4:	97b3003c 	lhu	s3,60(sp)
+   26ad8:	8e220100 	lw	v0,256(s1)
+   26adc:	34420040 	ori	v0,v0,0x40
+   26ae0:	ae220100 	sw	v0,256(s1)
+   26ae4:	97b3003c 	lhu	s3,60(sp)
+   26ae8:	97a20042 	lhu	v0,66(sp)
+   26aec:	00139c00 	sll	s3,s3,0x10
+   26af0:	02629825 	or	s3,s3,v0
+   26af4:	1260002e 	beqz	s3,26bb0 <vfat_lookup+0x1d0>
+   26af8:	240300c1 	addiu	v1,zero,193
+   26afc:	8e220100 	lw	v0,256(s1)
+   26b00:	30420001 	andi	v0,v0,0x1
+   26b04:	14400035 	bnez	v0,26bdc <vfat_lookup+0x1fc>
+   26b08:	02802021 	addu	a0,s4,zero
+   26b0c:	8fa20010 	lw	v0,16(sp)
+   26b10:	ae330198 	sw	s3,408(s1)
+   26b14:	ae220194 	sw	v0,404(s1)
+   26b18:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   26b1c:	8e0401c0 	lw	a0,448(s0)
+   26b20:	3c040004 	lui	a0,0x4
+   26b24:	2483c960 	addiu	v1,a0,-13984
+   26b28:	88630003 	lwl	v1,3(v1)
+   26b2c:	8e080034 	lw	t0,52(s0)
+   26b30:	8e260100 	lw	a2,256(s1)
+   26b34:	8e0701c0 	lw	a3,448(s0)
+   26b38:	9883c960 	lwr	v1,-13984(a0)
+   26b3c:	93a50033 	lbu	a1,51(sp)
+   26b40:	27a40048 	addiu	a0,sp,72
+   26b44:	afb00048 	sw	s0,72(sp)
+   26b48:	afb10058 	sw	s1,88(sp)
+   26b4c:	afb50064 	sw	s5,100(sp)
+   26b50:	afb3006c 	sw	s3,108(sp)
+   26b54:	afa0004c 	sw	zero,76(sp)
+   26b58:	afa80050 	sw	t0,80(sp)
+   26b5c:	afa70054 	sw	a3,84(sp)
+   26b60:	afa6005c 	sw	a2,92(sp)
+   26b64:	afa20060 	sw	v0,96(sp)
+   26b68:	afa50070 	sw	a1,112(sp)
+   26b6c:	a7a3004c 	sh	v1,76(sp)
+   26b70:	0c00acff 	jal	2b3fc <vfs_create_inode>
+   26b74:	afa00068 	sw	zero,104(sp)
+   26b78:	8fbf0094 	lw	ra,148(sp)
+   26b7c:	8fb50090 	lw	s5,144(sp)
+   26b80:	8fb4008c 	lw	s4,140(sp)
+   26b84:	8fb30088 	lw	s3,136(sp)
+   26b88:	8fb20084 	lw	s2,132(sp)
+   26b8c:	8fb10080 	lw	s1,128(sp)
+   26b90:	8fb0007c 	lw	s0,124(sp)
+   26b94:	03e00008 	jr	ra
+   26b98:	27bd0098 	addiu	sp,sp,152
+   26b9c:	30440010 	andi	a0,v0,0x10
+   26ba0:	1480ffbb 	bnez	a0,26a90 <vfat_lookup+0xb0>
+   26ba4:	8fb50044 	lw	s5,68(sp)
+   26ba8:	08009aa8 	j	26aa0 <vfat_lookup+0xc0>
+   26bac:	30430004 	andi	v1,v0,0x4
+   26bb0:	8e220100 	lw	v0,256(s1)
+   26bb4:	304400c1 	andi	a0,v0,0xc1
+   26bb8:	1083000d 	beq	a0,v1,26bf0 <vfat_lookup+0x210>
+   26bbc:	304400c0 	andi	a0,v0,0xc0
+   26bc0:	240300c0 	addiu	v1,zero,192
+   26bc4:	1483ffd1 	bne	a0,v1,26b0c <vfat_lookup+0x12c>
+   26bc8:	34420002 	ori	v0,v0,0x2
+   26bcc:	2403ff3f 	addiu	v1,zero,-193
+   26bd0:	00431024 	and	v0,v0,v1
+   26bd4:	08009ac3 	j	26b0c <vfat_lookup+0x12c>
+   26bd8:	ae220100 	sw	v0,256(s1)
+   26bdc:	0c0091c3 	jal	2470c <vfat_cluster_count>
+   26be0:	02602821 	addu	a1,s3,zero
+   26be4:	8e55018c 	lw	s5,396(s2)
+   26be8:	08009ac3 	j	26b0c <vfat_lookup+0x12c>
+   26bec:	7055a802 	mul	s5,v0,s5
+   26bf0:	3442000c 	ori	v0,v0,0xc
+   26bf4:	2403ff3e 	addiu	v1,zero,-194
+   26bf8:	00431024 	and	v0,v0,v1
+   26bfc:	08009ac3 	j	26b0c <vfat_lookup+0x12c>
+   26c00:	ae220100 	sw	v0,256(s1)
+
+00026c04 <vfat_icreate>:
+   26c04:	8c8201c4 	lw	v0,452(a0)
+   26c08:	3c030003 	lui	v1,0x3
+   26c0c:	8c420000 	lw	v0,0(v0)
+   26c10:	27bdffc8 	addiu	sp,sp,-56
+   26c14:	246376e4 	addiu	v1,v1,30436
+   26c18:	afb20030 	sw	s2,48(sp)
+   26c1c:	ac4300a4 	sw	v1,164(v0)
+   26c20:	afbf0034 	sw	ra,52(sp)
+   26c24:	afb1002c 	sw	s1,44(sp)
+   26c28:	afb00028 	sw	s0,40(sp)
+   26c2c:	8c830210 	lw	v1,528(a0)
+   26c30:	00809021 	addu	s2,a0,zero
+   26c34:	8ca40028 	lw	a0,40(a1)
+   26c38:	ac640000 	sw	a0,0(v1)
+   26c3c:	8ca40024 	lw	a0,36(a1)
+   26c40:	ac640004 	sw	a0,4(v1)
+   26c44:	8ca30014 	lw	v1,20(a1)
+   26c48:	30630001 	andi	v1,v1,0x1
+   26c4c:	10600006 	beqz	v1,26c68 <vfat_icreate+0x64>
+   26c50:	00000000 	sll	zero,zero,0x0
+   26c54:	3c040003 	lui	a0,0x3
+   26c58:	8ca30020 	lw	v1,32(a1)
+   26c5c:	248476fc 	addiu	a0,a0,30460
+   26c60:	14600008 	bnez	v1,26c84 <vfat_icreate+0x80>
+   26c64:	ac4400a4 	sw	a0,164(v0)
+   26c68:	00001021 	addu	v0,zero,zero
+   26c6c:	8fbf0034 	lw	ra,52(sp)
+   26c70:	8fb20030 	lw	s2,48(sp)
+   26c74:	8fb1002c 	lw	s1,44(sp)
+   26c78:	8fb00028 	lw	s0,40(sp)
+   26c7c:	03e00008 	jr	ra
+   26c80:	27bd0038 	addiu	sp,sp,56
+   26c84:	27b10010 	addiu	s1,sp,16
+   26c88:	3c020026 	lui	v0,0x26
+   26c8c:	34420040 	ori	v0,v0,0x40
+   26c90:	02202021 	addu	a0,s1,zero
+   26c94:	afa20018 	sw	v0,24(sp)
+   26c98:	afa00010 	sw	zero,16(sp)
+   26c9c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   26ca0:	afa00014 	sw	zero,20(sp)
+   26ca4:	1040000d 	beqz	v0,26cdc <vfat_icreate+0xd8>
+   26ca8:	00408021 	addu	s0,v0,zero
+   26cac:	8e4401c4 	lw	a0,452(s2)
+   26cb0:	00402821 	addu	a1,v0,zero
+   26cb4:	0c00729c 	jal	1ca70 <mapper_add_page>
+   26cb8:	00003021 	addu	a2,zero,zero
+   26cbc:	1040ffec 	beqz	v0,26c70 <vfat_icreate+0x6c>
+   26cc0:	8fbf0034 	lw	ra,52(sp)
+   26cc4:	02202021 	addu	a0,s1,zero
+   26cc8:	afa20020 	sw	v0,32(sp)
+   26ccc:	0c007134 	jal	1c4d0 <kmem_free>
+   26cd0:	afb0001c 	sw	s0,28(sp)
+   26cd4:	08009b1b 	j	26c6c <vfat_icreate+0x68>
+   26cd8:	8fa20020 	lw	v0,32(sp)
+   26cdc:	08009b1b 	j	26c6c <vfat_icreate+0x68>
+   26ce0:	2402000c 	addiu	v0,zero,12
+
+00026ce4 <vfat_release_node>:
+   26ce4:	8c820210 	lw	v0,528(a0)
+   26ce8:	27bdffd8 	addiu	sp,sp,-40
+   26cec:	afb00020 	sw	s0,32(sp)
+   26cf0:	afbf0024 	sw	ra,36(sp)
+   26cf4:	10400007 	beqz	v0,26d14 <vfat_release_node+0x30>
+   26cf8:	00808021 	addu	s0,a0,zero
+   26cfc:	2403000b 	addiu	v1,zero,11
+   26d00:	27a40010 	addiu	a0,sp,16
+   26d04:	afa30010 	sw	v1,16(sp)
+   26d08:	0c007134 	jal	1c4d0 <kmem_free>
+   26d0c:	afa2001c 	sw	v0,28(sp)
+   26d10:	ae000210 	sw	zero,528(s0)
+   26d14:	8fbf0024 	lw	ra,36(sp)
+   26d18:	00001021 	addu	v0,zero,zero
+   26d1c:	8fb00020 	lw	s0,32(sp)
+   26d20:	03e00008 	jr	ra
+   26d24:	27bd0028 	addiu	sp,sp,40
+
+00026d28 <vfat_create>:
+   26d28:	8ca2011c 	lw	v0,284(a1)
+   26d2c:	27bdff70 	addiu	sp,sp,-144
+   26d30:	8c430000 	lw	v1,0(v0)
+   26d34:	8c8201c4 	lw	v0,452(a0)
+   26d38:	afb70084 	sw	s7,132(sp)
+   26d3c:	afa20050 	sw	v0,80(sp)
+   26d40:	24020002 	addiu	v0,zero,2
+   26d44:	afb40078 	sw	s4,120(sp)
+   26d48:	afb30074 	sw	s3,116(sp)
+   26d4c:	afbf008c 	sw	ra,140(sp)
+   26d50:	afbe0088 	sw	s8,136(sp)
+   26d54:	afb60080 	sw	s6,128(sp)
+   26d58:	afb5007c 	sw	s5,124(sp)
+   26d5c:	afb20070 	sw	s2,112(sp)
+   26d60:	afb1006c 	sw	s1,108(sp)
+   26d64:	afb00068 	sw	s0,104(sp)
+   26d68:	00a09821 	addu	s3,a1,zero
+   26d6c:	0080a021 	addu	s4,a0,zero
+   26d70:	1062000f 	beq	v1,v0,26db0 <vfat_create+0x88>
+   26d74:	8c9701c0 	lw	s7,448(a0)
+   26d78:	24030016 	addiu	v1,zero,22
+   26d7c:	8fbf008c 	lw	ra,140(sp)
+   26d80:	00601021 	addu	v0,v1,zero
+   26d84:	8fbe0088 	lw	s8,136(sp)
+   26d88:	8fb70084 	lw	s7,132(sp)
+   26d8c:	8fb60080 	lw	s6,128(sp)
+   26d90:	8fb5007c 	lw	s5,124(sp)
+   26d94:	8fb40078 	lw	s4,120(sp)
+   26d98:	8fb30074 	lw	s3,116(sp)
+   26d9c:	8fb20070 	lw	s2,112(sp)
+   26da0:	8fb1006c 	lw	s1,108(sp)
+   26da4:	8fb00068 	lw	s0,104(sp)
+   26da8:	03e00008 	jr	ra
+   26dac:	27bd0090 	addiu	sp,sp,144
+   26db0:	8ca20100 	lw	v0,256(a1)
+   26db4:	26e300b0 	addiu	v1,s7,176
+   26db8:	3042000e 	andi	v0,v0,0xe
+   26dbc:	afa00010 	sw	zero,16(sp)
+   26dc0:	1040009a 	beqz	v0,2702c <vfat_create+0x304>
+   26dc4:	afa3005c 	sw	v1,92(sp)
+   26dc8:	00009021 	addu	s2,zero,zero
+   26dcc:	afa00054 	sw	zero,84(sp)
+   26dd0:	241500e5 	addiu	s5,zero,229
+   26dd4:	24160080 	addiu	s6,zero,128
+   26dd8:	8fa40050 	lw	a0,80(sp)
+   26ddc:	8fa50054 	lw	a1,84(sp)
+   26de0:	0c0073e7 	jal	1cf9c <mapper_get_page>
+   26de4:	24060001 	addiu	a2,zero,1
+   26de8:	104000d8 	beqz	v0,2714c <vfat_create+0x424>
+   26dec:	0040f021 	addu	s8,v0,zero
+   26df0:	0c007c15 	jal	1f054 <ppm_page2addr>
+   26df4:	00402021 	addu	a0,v0,zero
+   26df8:	03c02021 	addu	a0,s8,zero
+   26dfc:	afa20058 	sw	v0,88(sp)
+   26e00:	0c007a7a 	jal	1e9e8 <page_lock>
+   26e04:	00008821 	addu	s1,zero,zero
+   26e08:	08009b8a 	j	26e28 <vfat_create+0x100>
+   26e0c:	8fb00058 	lw	s0,88(sp)
+   26e10:	10550010 	beq	v0,s5,26e54 <vfat_create+0x12c>
+   26e14:	8fa30010 	lw	v1,16(sp)
+   26e18:	26310001 	addiu	s1,s1,1
+   26e1c:	26520020 	addiu	s2,s2,32
+   26e20:	123600a1 	beq	s1,s6,270a8 <vfat_create+0x380>
+   26e24:	26100020 	addiu	s0,s0,32
+   26e28:	92020000 	lbu	v0,0(s0)
+   26e2c:	1440fff8 	bnez	v0,26e10 <vfat_create+0xe8>
+   26e30:	00000000 	sll	zero,zero,0x0
+   26e34:	2402007f 	addiu	v0,zero,127
+   26e38:	122200a1 	beq	s1,v0,270c0 <vfat_create+0x398>
+   26e3c:	8fa40058 	lw	a0,88(sp)
+   26e40:	26220001 	addiu	v0,s1,1
+   26e44:	00021140 	sll	v0,v0,0x5
+   26e48:	00821021 	addu	v0,a0,v0
+   26e4c:	a0400000 	sb	zero,0(v0)
+   26e50:	8fa30010 	lw	v1,16(sp)
+   26e54:	3062ffff 	andi	v0,v1,0xffff
+   26e58:	00031c02 	srl	v1,v1,0x10
+   26e5c:	00032a02 	srl	a1,v1,0x8
+   26e60:	00022202 	srl	a0,v0,0x8
+   26e64:	a2030014 	sb	v1,20(s0)
+   26e68:	a2050015 	sb	a1,21(s0)
+   26e6c:	a204001b 	sb	a0,27(s0)
+   26e70:	a202001a 	sb	v0,26(s0)
+   26e74:	aa00001f 	swl	zero,31(s0)
+   26e78:	ba00001c 	swr	zero,28(s0)
+   26e7c:	a200000b 	sb	zero,11(s0)
+   26e80:	8e620100 	lw	v0,256(s3)
+   26e84:	3043008e 	andi	v1,v0,0x8e
+   26e88:	10600005 	beqz	v1,26ea0 <vfat_create+0x178>
+   26e8c:	30430100 	andi	v1,v0,0x100
+   26e90:	24020004 	addiu	v0,zero,4
+   26e94:	a202000b 	sb	v0,11(s0)
+   26e98:	8e620100 	lw	v0,256(s3)
+   26e9c:	30430100 	andi	v1,v0,0x100
+   26ea0:	10600006 	beqz	v1,26ebc <vfat_create+0x194>
+   26ea4:	3043004e 	andi	v1,v0,0x4e
+   26ea8:	9202000b 	lbu	v0,11(s0)
+   26eac:	34420020 	ori	v0,v0,0x20
+   26eb0:	a202000b 	sb	v0,11(s0)
+   26eb4:	8e620100 	lw	v0,256(s3)
+   26eb8:	3043004e 	andi	v1,v0,0x4e
+   26ebc:	10600006 	beqz	v1,26ed8 <vfat_create+0x1b0>
+   26ec0:	30420001 	andi	v0,v0,0x1
+   26ec4:	9202000b 	lbu	v0,11(s0)
+   26ec8:	34420001 	ori	v0,v0,0x1
+   26ecc:	a202000b 	sb	v0,11(s0)
+   26ed0:	8e620100 	lw	v0,256(s3)
+   26ed4:	30420001 	andi	v0,v0,0x1
+   26ed8:	10400004 	beqz	v0,26eec <vfat_create+0x1c4>
+   26edc:	00000000 	sll	zero,zero,0x0
+   26ee0:	9202000b 	lbu	v0,11(s0)
+   26ee4:	34420010 	ori	v0,v0,0x10
+   26ee8:	a202000b 	sb	v0,11(s0)
+   26eec:	24050020 	addiu	a1,zero,32
+   26ef0:	02002021 	addu	a0,s0,zero
+   26ef4:	0c00c182 	jal	30608 <memset>
+   26ef8:	2406000b 	addiu	a2,zero,11
+   26efc:	82620000 	lb	v0,0(s3)
+   26f00:	1040005f 	beqz	v0,27080 <vfat_create+0x358>
+   26f04:	02602821 	addu	a1,s3,zero
+   26f08:	2403002e 	addiu	v1,zero,46
+   26f0c:	1043005c 	beq	v0,v1,27080 <vfat_create+0x358>
+   26f10:	00001821 	addu	v1,zero,zero
+   26f14:	2406002e 	addiu	a2,zero,46
+   26f18:	2407000b 	addiu	a3,zero,11
+   26f1c:	02032021 	addu	a0,s0,v1
+   26f20:	a0820000 	sb	v0,0(a0)
+   26f24:	24a50001 	addiu	a1,a1,1
+   26f28:	80a20000 	lb	v0,0(a1)
+   26f2c:	10400051 	beqz	v0,27074 <vfat_create+0x34c>
+   26f30:	24630001 	addiu	v1,v1,1
+   26f34:	1046004f 	beq	v0,a2,27074 <vfat_create+0x34c>
+   26f38:	00000000 	sll	zero,zero,0x0
+   26f3c:	1467fff7 	bne	v1,a3,26f1c <vfat_create+0x1f4>
+   26f40:	00000000 	sll	zero,zero,0x0
+   26f44:	8fa20054 	lw	v0,84(sp)
+   26f48:	03c02021 	addu	a0,s8,zero
+   26f4c:	000219c0 	sll	v1,v0,0x7
+   26f50:	8fa20010 	lw	v0,16(sp)
+   26f54:	00718821 	addu	s1,v1,s1
+   26f58:	ae620198 	sw	v0,408(s3)
+   26f5c:	0c007a5c 	jal	1e970 <page_unlock>
+   26f60:	ae710194 	sw	s1,404(s3)
+   26f64:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   26f68:	8e8401c0 	lw	a0,448(s4)
+   26f6c:	8e650100 	lw	a1,256(s3)
+   26f70:	30a30001 	andi	v1,a1,0x1
+   26f74:	1460004a 	bnez	v1,270a0 <vfat_create+0x378>
+   26f78:	00000000 	sll	zero,zero,0x0
+   26f7c:	00003021 	addu	a2,zero,zero
+   26f80:	3c030004 	lui	v1,0x4
+   26f84:	2464c960 	addiu	a0,v1,-13984
+   26f88:	88840003 	lwl	a0,3(a0)
+   26f8c:	8e870034 	lw	a3,52(s4)
+   26f90:	9864c960 	lwr	a0,-13984(v1)
+   26f94:	afa2003c 	sw	v0,60(sp)
+   26f98:	8e8301c0 	lw	v1,448(s4)
+   26f9c:	8fa20010 	lw	v0,16(sp)
+   26fa0:	afa30030 	sw	v1,48(sp)
+   26fa4:	afa00028 	sw	zero,40(sp)
+   26fa8:	afa0004c 	sw	zero,76(sp)
+   26fac:	a7a40028 	sh	a0,40(sp)
+   26fb0:	afb40024 	sw	s4,36(sp)
+   26fb4:	afa7002c 	sw	a3,44(sp)
+   26fb8:	afb30034 	sw	s3,52(sp)
+   26fbc:	afa50038 	sw	a1,56(sp)
+   26fc0:	afa60040 	sw	a2,64(sp)
+   26fc4:	afa20048 	sw	v0,72(sp)
+   26fc8:	afa00044 	sw	zero,68(sp)
+   26fcc:	9202000b 	lbu	v0,11(s0)
+   26fd0:	27a40024 	addiu	a0,sp,36
+   26fd4:	0c00acff 	jal	2b3fc <vfs_create_inode>
+   26fd8:	afa2004c 	sw	v0,76(sp)
+   26fdc:	1040ff67 	beqz	v0,26d7c <vfat_create+0x54>
+   26fe0:	00401821 	addu	v1,v0,zero
+   26fe4:	03c02021 	addu	a0,s8,zero
+   26fe8:	0c007a7a 	jal	1e9e8 <page_lock>
+   26fec:	afa20060 	sw	v0,96(sp)
+   26ff0:	8fa20058 	lw	v0,88(sp)
+   26ff4:	90440020 	lbu	a0,32(v0)
+   26ff8:	240200e5 	addiu	v0,zero,229
+   26ffc:	0004100a 	movz	v0,zero,a0
+   27000:	8fa40058 	lw	a0,88(sp)
+   27004:	a0820000 	sb	v0,0(a0)
+   27008:	0c007a5c 	jal	1e970 <page_unlock>
+   2700c:	03c02021 	addu	a0,s8,zero
+   27010:	8fa30060 	lw	v1,96(sp)
+   27014:	8fa50010 	lw	a1,16(sp)
+   27018:	8fa4005c 	lw	a0,92(sp)
+   2701c:	0c009200 	jal	24800 <vfat_free_fat_entry>
+   27020:	afa30060 	sw	v1,96(sp)
+   27024:	08009b5f 	j	26d7c <vfat_create+0x54>
+   27028:	8fa30060 	lw	v1,96(sp)
+   2702c:	8fa4005c 	lw	a0,92(sp)
+   27030:	0c00923d 	jal	248f4 <vfat_alloc_fat_entry>
+   27034:	27a50010 	addiu	a1,sp,16
+   27038:	10400046 	beqz	v0,27154 <vfat_create+0x42c>
+   2703c:	8fbf008c 	lw	ra,140(sp)
+   27040:	24030005 	addiu	v1,zero,5
+   27044:	00601021 	addu	v0,v1,zero
+   27048:	8fbe0088 	lw	s8,136(sp)
+   2704c:	8fb70084 	lw	s7,132(sp)
+   27050:	8fb60080 	lw	s6,128(sp)
+   27054:	8fb5007c 	lw	s5,124(sp)
+   27058:	8fb40078 	lw	s4,120(sp)
+   2705c:	8fb30074 	lw	s3,116(sp)
+   27060:	8fb20070 	lw	s2,112(sp)
+   27064:	8fb1006c 	lw	s1,108(sp)
+   27068:	8fb00068 	lw	s0,104(sp)
+   2706c:	03e00008 	jr	ra
+   27070:	27bd0090 	addiu	sp,sp,144
+   27074:	2c630009 	sltiu	v1,v1,9
+   27078:	1060ffb2 	beqz	v1,26f44 <vfat_create+0x21c>
+   2707c:	00000000 	sll	zero,zero,0x0
+   27080:	2403002e 	addiu	v1,zero,46
+   27084:	1443ffaf 	bne	v0,v1,26f44 <vfat_create+0x21c>
+   27088:	24a50001 	addiu	a1,a1,1
+   2708c:	26040008 	addiu	a0,s0,8
+   27090:	0c00c12b 	jal	304ac <memcpy>
+   27094:	24060003 	addiu	a2,zero,3
+   27098:	08009bd2 	j	26f48 <vfat_create+0x220>
+   2709c:	8fa20054 	lw	v0,84(sp)
+   270a0:	08009be0 	j	26f80 <vfat_create+0x258>
+   270a4:	8ee6018c 	lw	a2,396(s7)
+   270a8:	0c007a5c 	jal	1e970 <page_unlock>
+   270ac:	03c02021 	addu	a0,s8,zero
+   270b0:	8fa40054 	lw	a0,84(sp)
+   270b4:	24840001 	addiu	a0,a0,1
+   270b8:	08009b76 	j	26dd8 <vfat_create+0xb0>
+   270bc:	afa40054 	sw	a0,84(sp)
+   270c0:	27b60014 	addiu	s6,sp,20
+   270c4:	3c020026 	lui	v0,0x26
+   270c8:	34420040 	ori	v0,v0,0x40
+   270cc:	02c02021 	addu	a0,s6,zero
+   270d0:	afa2001c 	sw	v0,28(sp)
+   270d4:	afa00014 	sw	zero,20(sp)
+   270d8:	0c00713f 	jal	1c4fc <kmem_alloc>
+   270dc:	afa00018 	sw	zero,24(sp)
+   270e0:	10400021 	beqz	v0,27168 <vfat_create+0x440>
+   270e4:	0040a821 	addu	s5,v0,zero
+   270e8:	00402821 	addu	a1,v0,zero
+   270ec:	8fa20054 	lw	v0,84(sp)
+   270f0:	8fa40050 	lw	a0,80(sp)
+   270f4:	0c00729c 	jal	1ca70 <mapper_add_page>
+   270f8:	24460001 	addiu	a2,v0,1
+   270fc:	1440001e 	bnez	v0,27178 <vfat_create+0x450>
+   27100:	02a02021 	addu	a0,s5,zero
+   27104:	8fa30050 	lw	v1,80(sp)
+   27108:	8c620000 	lw	v0,0(v1)
+   2710c:	8c4200a4 	lw	v0,164(v0)
+   27110:	8c42000c 	lw	v0,12(v0)
+   27114:	0040f809 	jalr	v0
+   27118:	26520020 	addiu	s2,s2,32
+   2711c:	8e820018 	lw	v0,24(s4)
+   27120:	1452ff4c 	bne	v0,s2,26e54 <vfat_create+0x12c>
+   27124:	8fa30010 	lw	v1,16(sp)
+   27128:	8e83001c 	lw	v1,28(s4)
+   2712c:	1460ff49 	bnez	v1,26e54 <vfat_create+0x12c>
+   27130:	8fa30010 	lw	v1,16(sp)
+   27134:	8ee3018c 	lw	v1,396(s7)
+   27138:	00431821 	addu	v1,v0,v1
+   2713c:	0062102b 	sltu	v0,v1,v0
+   27140:	ae830018 	sw	v1,24(s4)
+   27144:	08009b94 	j	26e50 <vfat_create+0x128>
+   27148:	ae82001c 	sw	v0,28(s4)
+   2714c:	08009c05 	j	27014 <vfat_create+0x2ec>
+   27150:	24030005 	addiu	v1,zero,5
+   27154:	8fa20010 	lw	v0,16(sp)
+   27158:	1440ff1c 	bnez	v0,26dcc <vfat_create+0xa4>
+   2715c:	00009021 	addu	s2,zero,zero
+   27160:	08009b5f 	j	26d7c <vfat_create+0x54>
+   27164:	2403ffe4 	addiu	v1,zero,-28
+   27168:	0c007a5c 	jal	1e970 <page_unlock>
+   2716c:	03c02021 	addu	a0,s8,zero
+   27170:	08009c05 	j	27014 <vfat_create+0x2ec>
+   27174:	2403000c 	addiu	v1,zero,12
+   27178:	03c02021 	addu	a0,s8,zero
+   2717c:	0c007a5c 	jal	1e970 <page_unlock>
+   27180:	afa20060 	sw	v0,96(sp)
+   27184:	02c02021 	addu	a0,s6,zero
+   27188:	0c007134 	jal	1c4d0 <kmem_free>
+   2718c:	afb50020 	sw	s5,32(sp)
+   27190:	08009c05 	j	27014 <vfat_create+0x2ec>
+   27194:	8fa30060 	lw	v1,96(sp)
+
+00027198 <vfat_init_node>:
+   27198:	8c830024 	lw	v1,36(a0)
+   2719c:	27bdffd8 	addiu	sp,sp,-40
+   271a0:	24020002 	addiu	v0,zero,2
+   271a4:	afb00020 	sw	s0,32(sp)
+   271a8:	afbf0024 	sw	ra,36(sp)
+   271ac:	10620006 	beq	v1,v0,271c8 <vfat_init_node+0x30>
+   271b0:	00808021 	addu	s0,a0,zero
+   271b4:	24020016 	addiu	v0,zero,22
+   271b8:	8fbf0024 	lw	ra,36(sp)
+   271bc:	8fb00020 	lw	s0,32(sp)
+   271c0:	03e00008 	jr	ra
+   271c4:	27bd0028 	addiu	sp,sp,40
+   271c8:	8c840210 	lw	a0,528(a0)
+   271cc:	10800009 	beqz	a0,271f4 <vfat_init_node+0x5c>
+   271d0:	3c020022 	lui	v0,0x22
+   271d4:	00002821 	addu	a1,zero,zero
+   271d8:	0c00c182 	jal	30608 <memset>
+   271dc:	24060008 	addiu	a2,zero,8
+   271e0:	8fbf0024 	lw	ra,36(sp)
+   271e4:	00001021 	addu	v0,zero,zero
+   271e8:	8fb00020 	lw	s0,32(sp)
+   271ec:	03e00008 	jr	ra
+   271f0:	27bd0028 	addiu	sp,sp,40
+   271f4:	34420040 	ori	v0,v0,0x40
+   271f8:	afa20018 	sw	v0,24(sp)
+   271fc:	2402000b 	addiu	v0,zero,11
+   27200:	27a40010 	addiu	a0,sp,16
+   27204:	afa20010 	sw	v0,16(sp)
+   27208:	24020008 	addiu	v0,zero,8
+   2720c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   27210:	afa20014 	sw	v0,20(sp)
+   27214:	10400003 	beqz	v0,27224 <vfat_init_node+0x8c>
+   27218:	00402021 	addu	a0,v0,zero
+   2721c:	08009c75 	j	271d4 <vfat_init_node+0x3c>
+   27220:	ae020210 	sw	v0,528(s0)
+   27224:	08009c6e 	j	271b8 <vfat_init_node+0x20>
+   27228:	2402000c 	addiu	v0,zero,12
+
+0002722c <ramfs_destroy_context>:
+   2722c:	03e00008 	jr	ra
+   27230:	00001021 	addu	v0,zero,zero
+
+00027234 <ramfs_write_root>:
+   27234:	03e00008 	jr	ra
+   27238:	00001021 	addu	v0,zero,zero
+
+0002723c <ramfs_read_root>:
+   2723c:	8ca60024 	lw	a2,36(a1)
+   27240:	8ca201c4 	lw	v0,452(a1)
+   27244:	8ca30008 	lw	v1,8(a1)
+   27248:	34c60001 	ori	a2,a2,0x1
+   2724c:	8c420000 	lw	v0,0(v0)
+   27250:	aca60024 	sw	a2,36(a1)
+   27254:	24060001 	addiu	a2,zero,1
+   27258:	aca60020 	sw	a2,32(a1)
+   2725c:	34630001 	ori	v1,v1,0x1
+   27260:	00003021 	addu	a2,zero,zero
+   27264:	00003821 	addu	a3,zero,zero
+   27268:	27bdffe0 	addiu	sp,sp,-32
+   2726c:	aca30008 	sw	v1,8(a1)
+   27270:	aca60018 	sw	a2,24(a1)
+   27274:	aca7001c 	sw	a3,28(a1)
+   27278:	ac4500a0 	sw	a1,160(v0)
+   2727c:	ac4000a4 	sw	zero,164(v0)
+   27280:	afbf001c 	sw	ra,28(sp)
+   27284:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   27288:	afa50010 	sw	a1,16(sp)
+   2728c:	8fa50010 	lw	a1,16(sp)
+   27290:	8fbf001c 	lw	ra,28(sp)
+   27294:	aca20000 	sw	v0,0(a1)
+   27298:	27bd0020 	addiu	sp,sp,32
+   2729c:	03e00008 	jr	ra
+   272a0:	00001021 	addu	v0,zero,zero
+
+000272a4 <ramfs_create_context>:
+   272a4:	8c820004 	lw	v0,4(a0)
+   272a8:	3c030003 	lui	v1,0x3
+   272ac:	34420002 	ori	v0,v0,0x2
+   272b0:	ac820004 	sw	v0,4(a0)
+   272b4:	24021000 	addiu	v0,zero,4096
+   272b8:	ac820048 	sw	v0,72(a0)
+   272bc:	3c020003 	lui	v0,0x3
+   272c0:	244277b0 	addiu	v0,v0,30640
+   272c4:	ac820090 	sw	v0,144(a0)
+   272c8:	3c020003 	lui	v0,0x3
+   272cc:	24427810 	addiu	v0,v0,30736
+   272d0:	ac820094 	sw	v0,148(a0)
+   272d4:	246377ec 	addiu	v1,v1,30700
+   272d8:	3c020003 	lui	v0,0x3
+   272dc:	ac830098 	sw	v1,152(a0)
+   272e0:	24427838 	addiu	v0,v0,30776
+   272e4:	24030003 	addiu	v1,zero,3
+   272e8:	ac82009c 	sw	v0,156(a0)
+   272ec:	ac830000 	sw	v1,0(a0)
+   272f0:	3c020004 	lui	v0,0x4
+   272f4:	8c449100 	lw	a0,-28416(v0)
+   272f8:	3c060003 	lui	a2,0x3
+   272fc:	3c070003 	lui	a3,0x3
+   27300:	27bdffe8 	addiu	sp,sp,-24
+   27304:	24c677a4 	addiu	a2,a2,30628
+   27308:	24e777c4 	addiu	a3,a3,30660
+   2730c:	afbf0014 	sw	ra,20(sp)
+   27310:	0c0009b0 	jal	26c0 <__fprintk>
+   27314:	00002821 	addu	a1,zero,zero
+   27318:	8fbf0014 	lw	ra,20(sp)
+   2731c:	00001021 	addu	v0,zero,zero
+   27320:	03e00008 	jr	ra
+   27324:	27bd0018 	addiu	sp,sp,24
+
+00027328 <ramfs_kmem_file_init>:
+   27328:	24030019 	addiu	v1,zero,25
+   2732c:	ac830000 	sw	v1,0(a0)
+   27330:	3c030003 	lui	v1,0x3
+   27334:	246377dc 	addiu	v1,v1,30684
+   27338:	24020003 	addiu	v0,zero,3
+   2733c:	ac830004 	sw	v1,4(a0)
+   27340:	24030008 	addiu	v1,zero,8
+   27344:	ac820010 	sw	v0,16(a0)
+   27348:	ac82000c 	sw	v0,12(a0)
+   2734c:	ac830008 	sw	v1,8(a0)
+   27350:	ac80001c 	sw	zero,28(a0)
+   27354:	ac800014 	sw	zero,20(a0)
+   27358:	ac800018 	sw	zero,24(a0)
+   2735c:	03e00008 	jr	ra
+   27360:	00001021 	addu	v0,zero,zero
+
+00027364 <ramfs_lseek>:
+   27364:	03e00008 	jr	ra
+   27368:	00001021 	addu	v0,zero,zero
+
+0002736c <ramfs_close>:
+   2736c:	03e00008 	jr	ra
+   27370:	00001021 	addu	v0,zero,zero
+
+00027374 <ramfs_readdir>:
+   27374:	8c820118 	lw	v0,280(a0)
+   27378:	27bdffe0 	addiu	sp,sp,-32
+   2737c:	afb00014 	sw	s0,20(sp)
+   27380:	afbf001c 	sw	ra,28(sp)
+   27384:	afb10018 	sw	s1,24(sp)
+   27388:	10400040 	beqz	v0,2748c <ramfs_readdir+0x118>
+   2738c:	00a08021 	addu	s0,a1,zero
+   27390:	8c510004 	lw	s1,4(v0)
+   27394:	1220001d 	beqz	s1,2740c <ramfs_readdir+0x98>
+   27398:	8c830110 	lw	v1,272(a0)
+   2739c:	8c460000 	lw	a2,0(v0)
+   273a0:	24c40010 	addiu	a0,a2,16
+   273a4:	000420c0 	sll	a0,a0,0x3
+   273a8:	00642021 	addu	a0,v1,a0
+   273ac:	8c870004 	lw	a3,4(a0)
+   273b0:	24850004 	addiu	a1,a0,4
+   273b4:	10a7001c 	beq	a1,a3,27428 <ramfs_readdir+0xb4>
+   273b8:	24c40001 	addiu	a0,a2,1
+   273bc:	8e240008 	lw	a0,8(s1)
+   273c0:	10a40018 	beq	a1,a0,27424 <ramfs_readdir+0xb0>
+   273c4:	00000000 	sll	zero,zero,0x0
+   273c8:	10800016 	beqz	a0,27424 <ramfs_readdir+0xb0>
+   273cc:	2484fff8 	addiu	a0,a0,-8
+   273d0:	ac440004 	sw	a0,4(v0)
+   273d4:	2631fee0 	addiu	s1,s1,-288
+   273d8:	8e220100 	lw	v0,256(s1)
+   273dc:	26040008 	addiu	a0,s0,8
+   273e0:	ae020004 	sw	v0,4(s0)
+   273e4:	0c00c4a9 	jal	312a4 <strcpy>
+   273e8:	02202821 	addu	a1,s1,zero
+   273ec:	8e23010c 	lw	v1,268(s1)
+   273f0:	00001021 	addu	v0,zero,zero
+   273f4:	ae030000 	sw	v1,0(s0)
+   273f8:	8fbf001c 	lw	ra,28(sp)
+   273fc:	8fb10018 	lw	s1,24(sp)
+   27400:	8fb00014 	lw	s0,20(sp)
+   27404:	03e00008 	jr	ra
+   27408:	27bd0020 	addiu	sp,sp,32
+   2740c:	8fbf001c 	lw	ra,28(sp)
+   27410:	2402007d 	addiu	v0,zero,125
+   27414:	8fb10018 	lw	s1,24(sp)
+   27418:	8fb00014 	lw	s0,20(sp)
+   2741c:	03e00008 	jr	ra
+   27420:	27bd0020 	addiu	sp,sp,32
+   27424:	24c40001 	addiu	a0,a2,1
+   27428:	2c85000a 	sltiu	a1,a0,10
+   2742c:	10a00015 	beqz	a1,27484 <ramfs_readdir+0x110>
+   27430:	24c50011 	addiu	a1,a2,17
+   27434:	000528c0 	sll	a1,a1,0x3
+   27438:	00652821 	addu	a1,v1,a1
+   2743c:	8ca70004 	lw	a3,4(a1)
+   27440:	24a50004 	addiu	a1,a1,4
+   27444:	14e50013 	bne	a3,a1,27494 <ramfs_readdir+0x120>
+   27448:	24c50012 	addiu	a1,a2,18
+   2744c:	000528c0 	sll	a1,a1,0x3
+   27450:	00652821 	addu	a1,v1,a1
+   27454:	24a50004 	addiu	a1,a1,4
+   27458:	08009d1b 	j	2746c <ramfs_readdir+0xf8>
+   2745c:	2409000a 	addiu	t1,zero,10
+   27460:	8ca80000 	lw	t0,0(a1)
+   27464:	1507000c 	bne	t0,a3,27498 <ramfs_readdir+0x124>
+   27468:	24a50008 	addiu	a1,a1,8
+   2746c:	24840001 	addiu	a0,a0,1
+   27470:	24860010 	addiu	a2,a0,16
+   27474:	000638c0 	sll	a3,a2,0x3
+   27478:	00673821 	addu	a3,v1,a3
+   2747c:	1489fff8 	bne	a0,t1,27460 <ramfs_readdir+0xec>
+   27480:	24e70004 	addiu	a3,a3,4
+   27484:	08009cf5 	j	273d4 <ramfs_readdir+0x60>
+   27488:	ac400004 	sw	zero,4(v0)
+   2748c:	08009cfe 	j	273f8 <ramfs_readdir+0x84>
+   27490:	24020014 	addiu	v0,zero,20
+   27494:	24c60011 	addiu	a2,a2,17
+   27498:	000630c0 	sll	a2,a2,0x3
+   2749c:	00661821 	addu	v1,v1,a2
+   274a0:	8c630004 	lw	v1,4(v1)
+   274a4:	ac440000 	sw	a0,0(v0)
+   274a8:	2463fff8 	addiu	v1,v1,-8
+   274ac:	08009cf5 	j	273d4 <ramfs_readdir+0x60>
+   274b0:	ac430004 	sw	v1,4(v0)
+
+000274b4 <ramfs_release>:
+   274b4:	8c820118 	lw	v0,280(a0)
+   274b8:	27bdffd8 	addiu	sp,sp,-40
+   274bc:	afb00020 	sw	s0,32(sp)
+   274c0:	afbf0024 	sw	ra,36(sp)
+   274c4:	10400007 	beqz	v0,274e4 <ramfs_release+0x30>
+   274c8:	00808021 	addu	s0,a0,zero
+   274cc:	24030019 	addiu	v1,zero,25
+   274d0:	27a40010 	addiu	a0,sp,16
+   274d4:	afa30010 	sw	v1,16(sp)
+   274d8:	0c007134 	jal	1c4d0 <kmem_free>
+   274dc:	afa2001c 	sw	v0,28(sp)
+   274e0:	ae000118 	sw	zero,280(s0)
+   274e4:	8fbf0024 	lw	ra,36(sp)
+   274e8:	00001021 	addu	v0,zero,zero
+   274ec:	8fb00020 	lw	s0,32(sp)
+   274f0:	03e00008 	jr	ra
+   274f4:	27bd0028 	addiu	sp,sp,40
+
+000274f8 <ramfs_open>:
+   274f8:	27bdffd0 	addiu	sp,sp,-48
+   274fc:	afb00024 	sw	s0,36(sp)
+   27500:	8c900110 	lw	s0,272(a0)
+   27504:	afb10028 	sw	s1,40(sp)
+   27508:	8e020008 	lw	v0,8(s0)
+   2750c:	afbf002c 	sw	ra,44(sp)
+   27510:	30420001 	andi	v0,v0,0x1
+   27514:	14400006 	bnez	v0,27530 <ramfs_open+0x38>
+   27518:	00808821 	addu	s1,a0,zero
+   2751c:	8fbf002c 	lw	ra,44(sp)
+   27520:	8fb10028 	lw	s1,40(sp)
+   27524:	8fb00024 	lw	s0,36(sp)
+   27528:	03e00008 	jr	ra
+   2752c:	27bd0030 	addiu	sp,sp,48
+   27530:	24020019 	addiu	v0,zero,25
+   27534:	afa20010 	sw	v0,16(sp)
+   27538:	24020008 	addiu	v0,zero,8
+   2753c:	afa20014 	sw	v0,20(sp)
+   27540:	3c020011 	lui	v0,0x11
+   27544:	34420020 	ori	v0,v0,0x20
+   27548:	27a40010 	addiu	a0,sp,16
+   2754c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   27550:	afa20018 	sw	v0,24(sp)
+   27554:	1040001b 	beqz	v0,275c4 <ramfs_open+0xcc>
+   27558:	02002021 	addu	a0,s0,zero
+   2755c:	00001821 	addu	v1,zero,zero
+   27560:	2407000a 	addiu	a3,zero,10
+   27564:	24660010 	addiu	a2,v1,16
+   27568:	000630c0 	sll	a2,a2,0x3
+   2756c:	02063021 	addu	a2,s0,a2
+   27570:	8c850084 	lw	a1,132(a0)
+   27574:	24c60004 	addiu	a2,a2,4
+   27578:	14a6000c 	bne	a1,a2,275ac <ramfs_open+0xb4>
+   2757c:	00000000 	sll	zero,zero,0x0
+   27580:	24630001 	addiu	v1,v1,1
+   27584:	1467fff7 	bne	v1,a3,27564 <ramfs_open+0x6c>
+   27588:	24840008 	addiu	a0,a0,8
+   2758c:	ac400004 	sw	zero,4(v0)
+   27590:	ae220118 	sw	v0,280(s1)
+   27594:	00001021 	addu	v0,zero,zero
+   27598:	8fbf002c 	lw	ra,44(sp)
+   2759c:	8fb10028 	lw	s1,40(sp)
+   275a0:	8fb00024 	lw	s0,36(sp)
+   275a4:	03e00008 	jr	ra
+   275a8:	27bd0030 	addiu	sp,sp,48
+   275ac:	24a5fff8 	addiu	a1,a1,-8
+   275b0:	ac430000 	sw	v1,0(v0)
+   275b4:	ac450004 	sw	a1,4(v0)
+   275b8:	ae220118 	sw	v0,280(s1)
+   275bc:	08009d66 	j	27598 <ramfs_open+0xa0>
+   275c0:	00001021 	addu	v0,zero,zero
+   275c4:	08009d47 	j	2751c <ramfs_open+0x24>
+   275c8:	2402000c 	addiu	v0,zero,12
+
+000275cc <ramfs_init_inode>:
+   275cc:	8c820024 	lw	v0,36(a0)
+   275d0:	24030016 	addiu	v1,zero,22
+   275d4:	38420003 	xori	v0,v0,0x3
+   275d8:	0002180a 	movz	v1,zero,v0
+   275dc:	03e00008 	jr	ra
+   275e0:	00601021 	addu	v0,v1,zero
+
+000275e4 <ramfs_icreate>:
+   275e4:	8c820004 	lw	v0,4(a0)
+   275e8:	30420001 	andi	v0,v0,0x1
+   275ec:	14400007 	bnez	v0,2760c <ramfs_icreate+0x28>
+   275f0:	3c030003 	lui	v1,0x3
+   275f4:	8c8201c4 	lw	v0,452(a0)
+   275f8:	8c420000 	lw	v0,0(v0)
+   275fc:	2463783c 	addiu	v1,v1,30780
+   27600:	ac4300a4 	sw	v1,164(v0)
+   27604:	03e00008 	jr	ra
+   27608:	00001021 	addu	v0,zero,zero
+   2760c:	8c8201c4 	lw	v0,452(a0)
+   27610:	8c420000 	lw	v0,0(v0)
+   27614:	ac4000a4 	sw	zero,164(v0)
+   27618:	03e00008 	jr	ra
+   2761c:	00001021 	addu	v0,zero,zero
+
+00027620 <ramfs_write_inode>:
+   27620:	03e00008 	jr	ra
+   27624:	00001021 	addu	v0,zero,zero
+
+00027628 <ramfs_release_inode>:
+   27628:	03e00008 	jr	ra
+   2762c:	00001021 	addu	v0,zero,zero
+
+00027630 <ramfs_lookup>:
+   27630:	03e00008 	jr	ra
+   27634:	24020002 	addiu	v0,zero,2
+
+00027638 <ramfs_delete>:
+   27638:	03e00008 	jr	ra
+   2763c:	00001021 	addu	v0,zero,zero
+
+00027640 <ramfs_compare>:
+   27640:	0800c445 	j	31114 <strcmp>
+   27644:	00000000 	sll	zero,zero,0x0
+
+00027648 <ramfs_unlink_inode>:
+   27648:	94a30114 	lhu	v1,276(a1)
+   2764c:	3402ffff 	ori	v0,zero,0xffff
+   27650:	10620003 	beq	v1,v0,27660 <ramfs_unlink_inode+0x18>
+   27654:	00000000 	sll	zero,zero,0x0
+   27658:	0800ac04 	j	2b010 <vfs_unlink_inode>
+   2765c:	24a40110 	addiu	a0,a1,272
+   27660:	03e00008 	jr	ra
+   27664:	00001021 	addu	v0,zero,zero
+
+00027668 <ramfs_stat_inode>:
+   27668:	0800a809 	j	2a024 <vfs_stat_inode>
+   2766c:	8c850000 	lw	a1,0(a0)
+
+00027670 <ramfs_create>:
+   27670:	27bdffb0 	addiu	sp,sp,-80
+   27674:	afb00048 	sw	s0,72(sp)
+   27678:	00808021 	addu	s0,a0,zero
+   2767c:	8c8401c0 	lw	a0,448(a0)
+   27680:	afbf004c 	sw	ra,76(sp)
+   27684:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   27688:	afa50040 	sw	a1,64(sp)
+   2768c:	3c040004 	lui	a0,0x4
+   27690:	2483c960 	addiu	v1,a0,-13984
+   27694:	88630003 	lwl	v1,3(v1)
+   27698:	8fa50040 	lw	a1,64(sp)
+   2769c:	8e080034 	lw	t0,52(s0)
+   276a0:	8e0701c0 	lw	a3,448(s0)
+   276a4:	8ca60100 	lw	a2,256(a1)
+   276a8:	9883c960 	lwr	v1,-13984(a0)
+   276ac:	27a40010 	addiu	a0,sp,16
+   276b0:	afb00010 	sw	s0,16(sp)
+   276b4:	afa00014 	sw	zero,20(sp)
+   276b8:	afa80018 	sw	t0,24(sp)
+   276bc:	afa7001c 	sw	a3,28(sp)
+   276c0:	afa50020 	sw	a1,32(sp)
+   276c4:	afa60024 	sw	a2,36(sp)
+   276c8:	afa20028 	sw	v0,40(sp)
+   276cc:	a7a30014 	sh	v1,20(sp)
+   276d0:	afa0002c 	sw	zero,44(sp)
+   276d4:	afa00030 	sw	zero,48(sp)
+   276d8:	afa00034 	sw	zero,52(sp)
+   276dc:	0c00acff 	jal	2b3fc <vfs_create_inode>
+   276e0:	afa00038 	sw	zero,56(sp)
+   276e4:	8fbf004c 	lw	ra,76(sp)
+   276e8:	8fb00048 	lw	s0,72(sp)
+   276ec:	03e00008 	jr	ra
+   276f0:	27bd0050 	addiu	sp,sp,80
+
+000276f4 <ramfs_file_read_page>:
+   276f4:	27bdffe8 	addiu	sp,sp,-24
+   276f8:	afbf0014 	sw	ra,20(sp)
+   276fc:	0c007a39 	jal	1e8e4 <page_zero>
+   27700:	00000000 	sll	zero,zero,0x0
+   27704:	8fbf0014 	lw	ra,20(sp)
+   27708:	00001021 	addu	v0,zero,zero
+   2770c:	03e00008 	jr	ra
+   27710:	27bd0018 	addiu	sp,sp,24
+
+00027714 <ramfs_file_write_page>:
+   27714:	27bdffe8 	addiu	sp,sp,-24
+   27718:	afbf0014 	sw	ra,20(sp)
+   2771c:	0c007a39 	jal	1e8e4 <page_zero>
+   27720:	00000000 	sll	zero,zero,0x0
+   27724:	8fbf0014 	lw	ra,20(sp)
+   27728:	00001021 	addu	v0,zero,zero
+   2772c:	03e00008 	jr	ra
+   27730:	27bd0018 	addiu	sp,sp,24
+
+00027734 <kvfsd>:
+   27734:	27bdff70 	addiu	sp,sp,-144
+   27738:	afbf008c 	sw	ra,140(sp)
+   2773c:	afbe0088 	sw	s8,136(sp)
+   27740:	afb70084 	sw	s7,132(sp)
+   27744:	afb60080 	sw	s6,128(sp)
+   27748:	afb5007c 	sw	s5,124(sp)
+   2774c:	afb40078 	sw	s4,120(sp)
+   27750:	afb30074 	sw	s3,116(sp)
+   27754:	afb20070 	sw	s2,112(sp)
+   27758:	afb1006c 	sw	s1,108(sp)
+   2775c:	afb00068 	sw	s0,104(sp)
+   27760:	40016000 	mfc0	at,c0_status
+   27764:	00000000 	sll	zero,zero,0x0
+   27768:	00011025 	or	v0,zero,at
+   2776c:	34210001 	ori	at,at,0x1
+   27770:	40816000 	mtc0	at,c0_status
+   27774:	00000000 	sll	zero,zero,0x0
+   27778:	40047801 	mfc0	a0,$15,1
+   2777c:	40024800 	mfc0	v0,c0_count
+   27780:	00000000 	sll	zero,zero,0x0
+   27784:	3c030004 	lui	v1,0x4
+   27788:	30840003 	andi	a0,a0,0x3
+   2778c:	00042080 	sll	a0,a0,0x2
+   27790:	2463c950 	addiu	v1,v1,-14000
+   27794:	00831821 	addu	v1,a0,v1
+   27798:	3c160004 	lui	s6,0x4
+   2779c:	8c670000 	lw	a3,0(v1)
+   277a0:	8ec49100 	lw	a0,-28416(s6)
+   277a4:	3c060003 	lui	a2,0x3
+   277a8:	24c67854 	addiu	a2,a2,30804
+   277ac:	00002821 	addu	a1,zero,zero
+   277b0:	0c0009b0 	jal	26c0 <__fprintk>
+   277b4:	afa20010 	sw	v0,16(sp)
+   277b8:	40022002 	mfc0	v0,$4,2
+   277bc:	8c500180 	lw	s0,384(v0)
+   277c0:	3c020008 	lui	v0,0x8
+   277c4:	8c4426e4 	lw	a0,9956(v0)
+   277c8:	24050002 	addiu	a1,zero,2
+   277cc:	0c00b373 	jal	2cdcc <vfs_mount_fs_root>
+   277d0:	02003021 	addu	a2,s0,zero
+   277d4:	3c060003 	lui	a2,0x3
+   277d8:	8ec49100 	lw	a0,-28416(s6)
+   277dc:	00408821 	addu	s1,v0,zero
+   277e0:	24c6787c 	addiu	a2,a2,30844
+   277e4:	0c0009b0 	jal	26c0 <__fprintk>
+   277e8:	00002821 	addu	a1,zero,zero
+   277ec:	1220004b 	beqz	s1,2791c <kvfsd+0x1e8>
+   277f0:	8ec49100 	lw	a0,-28416(s6)
+   277f4:	3c060003 	lui	a2,0x3
+   277f8:	24c678dc 	addiu	a2,a2,30940
+   277fc:	0c0009b0 	jal	26c0 <__fprintk>
+   27800:	00002821 	addu	a1,zero,zero
+   27804:	40022002 	mfc0	v0,$4,2
+   27808:	8c420174 	lw	v0,372(v0)
+   2780c:	3c050003 	lui	a1,0x3
+   27810:	8c470000 	lw	a3,0(v0)
+   27814:	24a52404 	addiu	a1,a1,9220
+   27818:	02002021 	addu	a0,s0,zero
+   2781c:	0c002eaf 	jal	babc <kthread_create>
+   27820:	00003021 	addu	a2,zero,zero
+   27824:	00408821 	addu	s1,v0,zero
+   27828:	8e020748 	lw	v0,1864(s0)
+   2782c:	262301f0 	addiu	v1,s1,496
+   27830:	8c440000 	lw	a0,0(v0)
+   27834:	ae2201f4 	sw	v0,500(s1)
+   27838:	ae2401f0 	sw	a0,496(s1)
+   2783c:	ac830004 	sw	v1,4(a0)
+   27840:	ac430000 	sw	v1,0(v0)
+   27844:	02202021 	addu	a0,s1,zero
+   27848:	0c004715 	jal	11c54 <sched_register>
+   2784c:	ae300180 	sw	s0,384(s1)
+   27850:	0c0046cb 	jal	11b2c <sched_add_created>
+   27854:	02202021 	addu	a0,s1,zero
+   27858:	40122002 	mfc0	s2,$4,2
+   2785c:	40022002 	mfc0	v0,$4,2
+   27860:	24020008 	addiu	v0,zero,8
+   27864:	afa2002c 	sw	v0,44(sp)
+   27868:	3c020002 	lui	v0,0x2
+   2786c:	24427958 	addiu	v0,v0,31064
+   27870:	3c100004 	lui	s0,0x4
+   27874:	afa20030 	sw	v0,48(sp)
+   27878:	3c170003 	lui	s7,0x3
+   2787c:	27a2002c 	addiu	v0,sp,44
+   27880:	afa2001c 	sw	v0,28(sp)
+   27884:	afb20038 	sw	s2,56(sp)
+   27888:	26f77904 	addiu	s7,s7,30980
+   2788c:	00008821 	addu	s1,zero,zero
+   27890:	27b40018 	addiu	s4,sp,24
+   27894:	2613c960 	addiu	s3,s0,-13984
+   27898:	3c150008 	lui	s5,0x8
+   2789c:	24050004 	addiu	a1,zero,4
+   278a0:	0c006c2b 	jal	1b0ac <alarm_wait>
+   278a4:	02802021 	addu	a0,s4,zero
+   278a8:	0c004634 	jal	118d0 <sched_sleep>
+   278ac:	02402021 	addu	a0,s2,zero
+   278b0:	401e4800 	mfc0	s8,c0_count
+   278b4:	00000000 	sll	zero,zero,0x0
+   278b8:	8a630003 	lwl	v1,3(s3)
+   278bc:	9a03c960 	lwr	v1,-13984(s0)
+   278c0:	3063ffff 	andi	v1,v1,0xffff
+   278c4:	0c000575 	jal	15d4 <arch_boot_cid>
+   278c8:	afa30060 	sw	v1,96(sp)
+   278cc:	8fa30060 	lw	v1,96(sp)
+   278d0:	1043000c 	beq	v0,v1,27904 <kvfsd+0x1d0>
+   278d4:	8ec49100 	lw	a0,-28416(s6)
+   278d8:	0c007b59 	jal	1ed64 <sync_all_pages>
+   278dc:	00000000 	sll	zero,zero,0x0
+   278e0:	32220003 	andi	v0,s1,0x3
+   278e4:	10400003 	beqz	v0,278f4 <kvfsd+0x1c0>
+   278e8:	8ea426ec 	lw	a0,9964(s5)
+   278ec:	08009e27 	j	2789c <kvfsd+0x168>
+   278f0:	26310001 	addiu	s1,s1,1
+   278f4:	0c002935 	jal	a4d4 <dqdt_print_summary>
+   278f8:	26310001 	addiu	s1,s1,1
+   278fc:	08009e28 	j	278a0 <kvfsd+0x16c>
+   27900:	24050004 	addiu	a1,zero,4
+   27904:	03c03821 	addu	a3,s8,zero
+   27908:	00002821 	addu	a1,zero,zero
+   2790c:	0c0009b0 	jal	26c0 <__fprintk>
+   27910:	02e03021 	addu	a2,s7,zero
+   27914:	08009e36 	j	278d8 <kvfsd+0x1a4>
+   27918:	00000000 	sll	zero,zero,0x0
+   2791c:	0c00264e 	jal	9938 <task_load_init>
+   27920:	02002021 	addu	a0,s0,zero
+   27924:	1040ffcc 	beqz	v0,27858 <kvfsd+0x124>
+   27928:	00000000 	sll	zero,zero,0x0
+   2792c:	40034800 	mfc0	v1,c0_count
+   27930:	00000000 	sll	zero,zero,0x0
+   27934:	3c060003 	lui	a2,0x3
+   27938:	8ec49100 	lw	a0,-28416(s6)
+   2793c:	24c678a8 	addiu	a2,a2,30888
+   27940:	00403821 	addu	a3,v0,zero
+   27944:	00002821 	addu	a1,zero,zero
+   27948:	0c0009b0 	jal	26c0 <__fprintk>
+   2794c:	afa30010 	sw	v1,16(sp)
+   27950:	08009dfd 	j	277f4 <kvfsd+0xc0>
+   27954:	8ec49100 	lw	a0,-28416(s6)
+   27958:	8c84000c 	lw	a0,12(a0)
+   2795c:	27bdffe8 	addiu	sp,sp,-24
+   27960:	afbf0014 	sw	ra,20(sp)
+   27964:	0c0044a3 	jal	1128c <sched_wakeup>
+   27968:	00000000 	sll	zero,zero,0x0
+   2796c:	8fbf0014 	lw	ra,20(sp)
+   27970:	00001021 	addu	v0,zero,zero
+   27974:	03e00008 	jr	ra
+   27978:	27bd0018 	addiu	sp,sp,24
+
+0002797c <vfs_pipe>:
+   2797c:	03e00008 	jr	ra
+   27980:	2402007e 	addiu	v0,zero,126
+
+00027984 <vfs_mkfifo>:
+   27984:	03e00008 	jr	ra
+   27988:	2402007e 	addiu	v0,zero,126
+
+0002798c <vfs_read>:
+   2798c:	8c820000 	lw	v0,0(a0)
+   27990:	3c060004 	lui	a2,0x4
+   27994:	00463024 	and	a2,v0,a2
+   27998:	14c0000d 	bnez	a2,279d0 <vfs_read+0x44>
+   2799c:	3c060010 	lui	a2,0x10
+   279a0:	00461024 	and	v0,v0,a2
+   279a4:	10400005 	beqz	v0,279bc <vfs_read+0x30>
+   279a8:	00000000 	sll	zero,zero,0x0
+   279ac:	8c820028 	lw	v0,40(a0)
+   279b0:	8c590004 	lw	t9,4(v0)
+   279b4:	03200008 	jr	t9
+   279b8:	00000000 	sll	zero,zero,0x0
+   279bc:	40022002 	mfc0	v0,$4,2
+   279c0:	24030009 	addiu	v1,zero,9
+   279c4:	ac430258 	sw	v1,600(v0)
+   279c8:	03e00008 	jr	ra
+   279cc:	2402ffff 	addiu	v0,zero,-1
+   279d0:	40022002 	mfc0	v0,$4,2
+   279d4:	24030015 	addiu	v1,zero,21
+   279d8:	08009e72 	j	279c8 <vfs_read+0x3c>
+   279dc:	ac430258 	sw	v1,600(v0)
+
+000279e0 <vfs_write>:
+   279e0:	8c820000 	lw	v0,0(a0)
+   279e4:	3c060004 	lui	a2,0x4
+   279e8:	00463024 	and	a2,v0,a2
+   279ec:	14c0000d 	bnez	a2,27a24 <vfs_write+0x44>
+   279f0:	3c060020 	lui	a2,0x20
+   279f4:	00461024 	and	v0,v0,a2
+   279f8:	10400005 	beqz	v0,27a10 <vfs_write+0x30>
+   279fc:	00000000 	sll	zero,zero,0x0
+   27a00:	8c820028 	lw	v0,40(a0)
+   27a04:	8c590008 	lw	t9,8(v0)
+   27a08:	03200008 	jr	t9
+   27a0c:	00000000 	sll	zero,zero,0x0
+   27a10:	40022002 	mfc0	v0,$4,2
+   27a14:	24030009 	addiu	v1,zero,9
+   27a18:	ac430258 	sw	v1,600(v0)
+   27a1c:	03e00008 	jr	ra
+   27a20:	2402ffff 	addiu	v0,zero,-1
+   27a24:	40022002 	mfc0	v0,$4,2
+   27a28:	24030015 	addiu	v1,zero,21
+   27a2c:	08009e87 	j	27a1c <vfs_write+0x3c>
+   27a30:	ac430258 	sw	v1,600(v0)
+
+00027a34 <__vfs_lseek_>:
+   27a34:	24020001 	addiu	v0,zero,1
+   27a38:	10a20004 	beq	a1,v0,27a4c <__vfs_lseek_+0x18>
+   27a3c:	2402ffff 	addiu	v0,zero,-1
+   27a40:	14a00009 	bnez	a1,27a68 <__vfs_lseek_+0x34>
+   27a44:	24020002 	addiu	v0,zero,2
+   27a48:	2402ffff 	addiu	v0,zero,-1
+   27a4c:	1082000a 	beq	a0,v0,27a78 <__vfs_lseek_+0x44>
+   27a50:	00000000 	sll	zero,zero,0x0
+   27a54:	10e0000c 	beqz	a3,27a88 <__vfs_lseek_+0x54>
+   27a58:	00000000 	sll	zero,zero,0x0
+   27a5c:	ace40000 	sw	a0,0(a3)
+   27a60:	03e00008 	jr	ra
+   27a64:	00001021 	addu	v0,zero,zero
+   27a68:	10a20005 	beq	a1,v0,27a80 <__vfs_lseek_+0x4c>
+   27a6c:	24020016 	addiu	v0,zero,22
+   27a70:	03e00008 	jr	ra
+   27a74:	00000000 	sll	zero,zero,0x0
+   27a78:	03e00008 	jr	ra
+   27a7c:	2402004b 	addiu	v0,zero,75
+   27a80:	08009e92 	j	27a48 <__vfs_lseek_+0x14>
+   27a84:	00c42021 	addu	a0,a2,a0
+   27a88:	03e00008 	jr	ra
+   27a8c:	00001021 	addu	v0,zero,zero
+   27a90:	27bdffe0 	addiu	sp,sp,-32
+   27a94:	afbf001c 	sw	ra,28(sp)
+   27a98:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   27a9c:	afa40010 	sw	a0,16(sp)
+   27aa0:	8fa40010 	lw	a0,16(sp)
+   27aa4:	8fbf001c 	lw	ra,28(sp)
+   27aa8:	0082001b 	divu	zero,a0,v0
+   27aac:	004001f4 	teq	v0,zero,0x7
+   27ab0:	27bd0020 	addiu	sp,sp,32
+   27ab4:	03e00008 	jr	ra
+   27ab8:	00001012 	mflo	v0
+
+00027abc <__vfs_lseek>:
+   27abc:	27bdffd0 	addiu	sp,sp,-48
+   27ac0:	afb10024 	sw	s1,36(sp)
+   27ac4:	24910050 	addiu	s1,a0,80
+   27ac8:	afb00020 	sw	s0,32(sp)
+   27acc:	00808021 	addu	s0,a0,zero
+   27ad0:	02202021 	addu	a0,s1,zero
+   27ad4:	afa50010 	sw	a1,16(sp)
+   27ad8:	afa60014 	sw	a2,20(sp)
+   27adc:	afa70018 	sw	a3,24(sp)
+   27ae0:	afbf002c 	sw	ra,44(sp)
+   27ae4:	0c004408 	jal	11020 <rwlock_wrlock>
+   27ae8:	afb20028 	sw	s2,40(sp)
+   27aec:	8e040110 	lw	a0,272(s0)
+   27af0:	0c00a7f2 	jal	29fc8 <vfs_inode_size_get>
+   27af4:	8e120004 	lw	s2,4(s0)
+   27af8:	8fa60014 	lw	a2,20(sp)
+   27afc:	24030001 	addiu	v1,zero,1
+   27b00:	8fa50010 	lw	a1,16(sp)
+   27b04:	10c3000f 	beq	a2,v1,27b44 <__vfs_lseek+0x88>
+   27b08:	8fa70018 	lw	a3,24(sp)
+   27b0c:	10c0000d 	beqz	a2,27b44 <__vfs_lseek+0x88>
+   27b10:	24030002 	addiu	v1,zero,2
+   27b14:	10c3000b 	beq	a2,v1,27b44 <__vfs_lseek+0x88>
+   27b18:	00452821 	addu	a1,v0,a1
+   27b1c:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   27b20:	02202021 	addu	a0,s1,zero
+   27b24:	8fbf002c 	lw	ra,44(sp)
+   27b28:	24100016 	addiu	s0,zero,22
+   27b2c:	02001021 	addu	v0,s0,zero
+   27b30:	8fb20028 	lw	s2,40(sp)
+   27b34:	8fb10024 	lw	s1,36(sp)
+   27b38:	8fb00020 	lw	s0,32(sp)
+   27b3c:	03e00008 	jr	ra
+   27b40:	27bd0030 	addiu	sp,sp,48
+   27b44:	2402ffff 	addiu	v0,zero,-1
+   27b48:	10a20021 	beq	a1,v0,27bd0 <__vfs_lseek+0x114>
+   27b4c:	00000000 	sll	zero,zero,0x0
+   27b50:	10e00029 	beqz	a3,27bf8 <__vfs_lseek+0x13c>
+   27b54:	00000000 	sll	zero,zero,0x0
+   27b58:	ace50000 	sw	a1,0(a3)
+   27b5c:	8e020114 	lw	v0,276(s0)
+   27b60:	ae050004 	sw	a1,4(s0)
+   27b64:	8c42000c 	lw	v0,12(v0)
+   27b68:	1040000f 	beqz	v0,27ba8 <__vfs_lseek+0xec>
+   27b6c:	00000000 	sll	zero,zero,0x0
+   27b70:	0040f809 	jalr	v0
+   27b74:	02002021 	addu	a0,s0,zero
+   27b78:	1040000b 	beqz	v0,27ba8 <__vfs_lseek+0xec>
+   27b7c:	02202021 	addu	a0,s1,zero
+   27b80:	ae120004 	sw	s2,4(s0)
+   27b84:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   27b88:	00028023 	negu	s0,v0
+   27b8c:	8fbf002c 	lw	ra,44(sp)
+   27b90:	02001021 	addu	v0,s0,zero
+   27b94:	8fb20028 	lw	s2,40(sp)
+   27b98:	8fb10024 	lw	s1,36(sp)
+   27b9c:	8fb00020 	lw	s0,32(sp)
+   27ba0:	03e00008 	jr	ra
+   27ba4:	27bd0030 	addiu	sp,sp,48
+   27ba8:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   27bac:	02202021 	addu	a0,s1,zero
+   27bb0:	8fbf002c 	lw	ra,44(sp)
+   27bb4:	00008021 	addu	s0,zero,zero
+   27bb8:	02001021 	addu	v0,s0,zero
+   27bbc:	8fb20028 	lw	s2,40(sp)
+   27bc0:	8fb10024 	lw	s1,36(sp)
+   27bc4:	8fb00020 	lw	s0,32(sp)
+   27bc8:	03e00008 	jr	ra
+   27bcc:	27bd0030 	addiu	sp,sp,48
+   27bd0:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   27bd4:	02202021 	addu	a0,s1,zero
+   27bd8:	8fbf002c 	lw	ra,44(sp)
+   27bdc:	2410004b 	addiu	s0,zero,75
+   27be0:	02001021 	addu	v0,s0,zero
+   27be4:	8fb20028 	lw	s2,40(sp)
+   27be8:	8fb10024 	lw	s1,36(sp)
+   27bec:	8fb00020 	lw	s0,32(sp)
+   27bf0:	03e00008 	jr	ra
+   27bf4:	27bd0030 	addiu	sp,sp,48
+   27bf8:	08009ed7 	j	27b5c <__vfs_lseek+0xa0>
+   27bfc:	8ce50000 	lw	a1,0(a3)
+
+00027c00 <_vfs_lseek_main>:
+   27c00:	27bdffe8 	addiu	sp,sp,-24
+   27c04:	afb00010 	sw	s0,16(sp)
+   27c08:	8fa40028 	lw	a0,40(sp)
+   27c0c:	00c08021 	addu	s0,a2,zero
+   27c10:	8fa5002c 	lw	a1,44(sp)
+   27c14:	8fa60030 	lw	a2,48(sp)
+   27c18:	afbf0014 	sw	ra,20(sp)
+   27c1c:	0c009eaf 	jal	27abc <__vfs_lseek>
+   27c20:	00000000 	sll	zero,zero,0x0
+   27c24:	8fbf0014 	lw	ra,20(sp)
+   27c28:	ae020000 	sw	v0,0(s0)
+   27c2c:	8fb00010 	lw	s0,16(sp)
+   27c30:	03e00008 	jr	ra
+   27c34:	27bd0018 	addiu	sp,sp,24
+
+00027c38 <_vfs_lseek_demarshall>:
+   27c38:	27bdffc8 	addiu	sp,sp,-56
+   27c3c:	afbf0034 	sw	ra,52(sp)
+   27c40:	afbe0030 	sw	s8,48(sp)
+   27c44:	afb4002c 	sw	s4,44(sp)
+   27c48:	03a0f021 	addu	s8,sp,zero
+   27c4c:	afb30028 	sw	s3,40(sp)
+   27c50:	afb20024 	sw	s2,36(sp)
+   27c54:	afb10020 	sw	s1,32(sp)
+   27c58:	afb0001c 	sw	s0,28(sp)
+   27c5c:	27bdfff0 	addiu	sp,sp,-16
+   27c60:	27b20010 	addiu	s2,sp,16
+   27c64:	27bdffc0 	addiu	sp,sp,-64
+   27c68:	27b00010 	addiu	s0,sp,16
+   27c6c:	26030030 	addiu	v1,s0,48
+   27c70:	00808821 	addu	s1,a0,zero
+   27c74:	2605002c 	addiu	a1,s0,44
+   27c78:	8c840000 	lw	a0,0(a0)
+   27c7c:	ae430004 	sw	v1,4(s2)
+   27c80:	24060034 	addiu	a2,zero,52
+   27c84:	24020004 	addiu	v0,zero,4
+   27c88:	ae450000 	sw	a1,0(s2)
+   27c8c:	ae060008 	sw	a2,8(s0)
+   27c90:	ae020028 	sw	v0,40(s0)
+   27c94:	0c009ea4 	jal	27a90 <__vfs_lseek_+0x5c>
+   27c98:	ae020024 	sw	v0,36(s0)
+   27c9c:	8e470004 	lw	a3,4(s2)
+   27ca0:	02202021 	addu	a0,s1,zero
+   27ca4:	00002821 	addu	a1,zero,zero
+   27ca8:	afc70010 	sw	a3,16(s8)
+   27cac:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   27cb0:	8e520000 	lw	s2,0(s2)
+   27cb4:	02202021 	addu	a0,s1,zero
+   27cb8:	24050001 	addiu	a1,zero,1
+   27cbc:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   27cc0:	8c540000 	lw	s4,0(v0)
+   27cc4:	02202021 	addu	a0,s1,zero
+   27cc8:	24050002 	addiu	a1,zero,2
+   27ccc:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   27cd0:	8c530000 	lw	s3,0(v0)
+   27cd4:	8c460000 	lw	a2,0(v0)
+   27cd8:	8fc70010 	lw	a3,16(s8)
+   27cdc:	02802021 	addu	a0,s4,zero
+   27ce0:	0c009eaf 	jal	27abc <__vfs_lseek>
+   27ce4:	02602821 	addu	a1,s3,zero
+   27ce8:	ae420000 	sw	v0,0(s2)
+   27cec:	02202021 	addu	a0,s1,zero
+   27cf0:	02002821 	addu	a1,s0,zero
+   27cf4:	24060034 	addiu	a2,zero,52
+   27cf8:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   27cfc:	24070002 	addiu	a3,zero,2
+   27d00:	03c0e821 	addu	sp,s8,zero
+   27d04:	8fbf0034 	lw	ra,52(sp)
+   27d08:	8fbe0030 	lw	s8,48(sp)
+   27d0c:	8fb4002c 	lw	s4,44(sp)
+   27d10:	8fb30028 	lw	s3,40(sp)
+   27d14:	8fb20024 	lw	s2,36(sp)
+   27d18:	8fb10020 	lw	s1,32(sp)
+   27d1c:	8fb0001c 	lw	s0,28(sp)
+   27d20:	03e00008 	jr	ra
+   27d24:	27bd0038 	addiu	sp,sp,56
+
+00027d28 <_vfs_lseek_local>:
+   27d28:	27bdffe8 	addiu	sp,sp,-24
+   27d2c:	afb00010 	sw	s0,16(sp)
+   27d30:	afbf0014 	sw	ra,20(sp)
+   27d34:	00808021 	addu	s0,a0,zero
+   27d38:	00a01021 	addu	v0,a1,zero
+   27d3c:	40037801 	mfc0	v1,$15,1
+   27d40:	8fa30028 	lw	v1,40(sp)
+   27d44:	8cc40000 	lw	a0,0(a2)
+   27d48:	8ce50000 	lw	a1,0(a3)
+   27d4c:	8c660000 	lw	a2,0(v1)
+   27d50:	0c009eaf 	jal	27abc <__vfs_lseek>
+   27d54:	00403821 	addu	a3,v0,zero
+   27d58:	8fbf0014 	lw	ra,20(sp)
+   27d5c:	ae020000 	sw	v0,0(s0)
+   27d60:	8fb00010 	lw	s0,16(sp)
+   27d64:	03e00008 	jr	ra
+   27d68:	27bd0018 	addiu	sp,sp,24
+
+00027d6c <vfs_mkdir>:
+   27d6c:	27bdffc8 	addiu	sp,sp,-56
+   27d70:	00c03821 	addu	a3,a2,zero
+   27d74:	3c0600c4 	lui	a2,0xc4
+   27d78:	27a20018 	addiu	v0,sp,24
+   27d7c:	34c60001 	ori	a2,a2,0x1
+   27d80:	afbf0034 	sw	ra,52(sp)
+   27d84:	afa20014 	sw	v0,20(sp)
+   27d88:	0c00b85a 	jal	2e168 <vfs_lookup>
+   27d8c:	afa00010 	sw	zero,16(sp)
+   27d90:	8fbf0034 	lw	ra,52(sp)
+   27d94:	03e00008 	jr	ra
+   27d98:	27bd0038 	addiu	sp,sp,56
+
+00027d9c <vfs_close>:
+   27d9c:	27bdffe0 	addiu	sp,sp,-32
+   27da0:	afa50010 	sw	a1,16(sp)
+   27da4:	afbf001c 	sw	ra,28(sp)
+   27da8:	0c00aff6 	jal	2bfd8 <vfs_file_down>
+   27dac:	00000000 	sll	zero,zero,0x0
+   27db0:	8fa50010 	lw	a1,16(sp)
+   27db4:	10a00003 	beqz	a1,27dc4 <vfs_close+0x28>
+   27db8:	8fbf001c 	lw	ra,28(sp)
+   27dbc:	aca20000 	sw	v0,0(a1)
+   27dc0:	8fbf001c 	lw	ra,28(sp)
+   27dc4:	00001021 	addu	v0,zero,zero
+   27dc8:	03e00008 	jr	ra
+   27dcc:	27bd0020 	addiu	sp,sp,32
+
+00027dd0 <vfs_closedir>:
+   27dd0:	8c830000 	lw	v1,0(a0)
+   27dd4:	3c020004 	lui	v0,0x4
+   27dd8:	00621024 	and	v0,v1,v0
+   27ddc:	14400003 	bnez	v0,27dec <vfs_closedir+0x1c>
+   27de0:	24020009 	addiu	v0,zero,9
+   27de4:	03e00008 	jr	ra
+   27de8:	00000000 	sll	zero,zero,0x0
+   27dec:	08009f67 	j	27d9c <vfs_close>
+   27df0:	00000000 	sll	zero,zero,0x0
+
+00027df4 <__vfs_get_name_main>:
+   27df4:	27bdffc0 	addiu	sp,sp,-64
+   27df8:	afb00024 	sw	s0,36(sp)
+   27dfc:	8fb00058 	lw	s0,88(sp)
+   27e00:	afb50038 	sw	s5,56(sp)
+   27e04:	afb40034 	sw	s4,52(sp)
+   27e08:	afb30030 	sw	s3,48(sp)
+   27e0c:	afb10028 	sw	s1,40(sp)
+   27e10:	afbf003c 	sw	ra,60(sp)
+   27e14:	afb2002c 	sw	s2,44(sp)
+   27e18:	00c08821 	addu	s1,a2,zero
+   27e1c:	3093ffff 	andi	s3,a0,0xffff
+   27e20:	ace00000 	sw	zero,0(a3)
+   27e24:	8fa20054 	lw	v0,84(sp)
+   27e28:	8fb5005c 	lw	s5,92(sp)
+   27e2c:	12000054 	beqz	s0,27f80 <__vfs_get_name_main+0x18c>
+   27e30:	8fb40060 	lw	s4,96(sp)
+   27e34:	02002021 	addu	a0,s0,zero
+   27e38:	0c00c4d1 	jal	31344 <strlen>
+   27e3c:	afa70018 	sw	a3,24(sp)
+   27e40:	00409021 	addu	s2,v0,zero
+   27e44:	24420001 	addiu	v0,v0,1
+   27e48:	0282102b 	sltu	v0,s4,v0
+   27e4c:	1440005c 	bnez	v0,27fc0 <__vfs_get_name_main+0x1cc>
+   27e50:	8fa70018 	lw	a3,24(sp)
+   27e54:	3c030004 	lui	v1,0x4
+   27e58:	2462c960 	addiu	v0,v1,-13984
+   27e5c:	88420003 	lwl	v0,3(v0)
+   27e60:	9862c960 	lwr	v0,-13984(v1)
+   27e64:	3042ffff 	andi	v0,v0,0xffff
+   27e68:	1662000a 	bne	s3,v0,27e94 <__vfs_get_name_main+0xa0>
+   27e6c:	2c430101 	sltiu	v1,v0,257
+   27e70:	02922023 	subu	a0,s4,s2
+   27e74:	02a42021 	addu	a0,s5,a0
+   27e78:	02002821 	addu	a1,s0,zero
+   27e7c:	02403021 	addu	a2,s2,zero
+   27e80:	0c00c12b 	jal	304ac <memcpy>
+   27e84:	afa70018 	sw	a3,24(sp)
+   27e88:	8fa70018 	lw	a3,24(sp)
+   27e8c:	08009fe1 	j	27f84 <__vfs_get_name_main+0x190>
+   27e90:	8e020180 	lw	v0,384(s0)
+   27e94:	14600003 	bnez	v1,27ea4 <__vfs_get_name_main+0xb0>
+   27e98:	00021900 	sll	v1,v0,0x4
+   27e9c:	08009fa7 	j	27e9c <__vfs_get_name_main+0xa8>
+   27ea0:	00000000 	sll	zero,zero,0x0
+   27ea4:	00021080 	sll	v0,v0,0x2
+   27ea8:	00621023 	subu	v0,v1,v0
+   27eac:	3c030004 	lui	v1,0x4
+   27eb0:	2463c9a0 	addiu	v1,v1,-13920
+   27eb4:	00621021 	addu	v0,v1,v0
+   27eb8:	8c440000 	lw	a0,0(v0)
+   27ebc:	3c025555 	lui	v0,0x5555
+   27ec0:	34425555 	ori	v0,v0,0x5555
+   27ec4:	1082fff5 	beq	a0,v0,27e9c <__vfs_get_name_main+0xa8>
+   27ec8:	2e650101 	sltiu	a1,s3,257
+   27ecc:	10a00047 	beqz	a1,27fec <__vfs_get_name_main+0x1f8>
+   27ed0:	00132900 	sll	a1,s3,0x4
+   27ed4:	00139880 	sll	s3,s3,0x2
+   27ed8:	00b39823 	subu	s3,a1,s3
+   27edc:	00731821 	addu	v1,v1,s3
+   27ee0:	8c650000 	lw	a1,0(v1)
+   27ee4:	10a20041 	beq	a1,v0,27fec <__vfs_get_name_main+0x1f8>
+   27ee8:	0292a023 	subu	s4,s4,s2
+   27eec:	02b4a821 	addu	s5,s5,s4
+   27ef0:	02b01025 	or	v0,s5,s0
+   27ef4:	30420003 	andi	v0,v0,0x3
+   27ef8:	1040003e 	beqz	v0,27ff4 <__vfs_get_name_main+0x200>
+   27efc:	00000000 	sll	zero,zero,0x0
+   27f00:	00001021 	addu	v0,zero,zero
+   27f04:	00003021 	addu	a2,zero,zero
+   27f08:	08009fcd 	j	27f34 <__vfs_get_name_main+0x140>
+   27f0c:	00001821 	addu	v1,zero,zero
+   27f10:	02aa5821 	addu	t3,s5,t2
+   27f14:	020a5021 	addu	t2,s0,t2
+   27f18:	4808c000 	mfc2	t0,$24
+   27f1c:	4884c000 	mtc2	a0,$24
+   27f20:	8d490000 	lw	t1,0(t2)
+   27f24:	4885c000 	mtc2	a1,$24
+   27f28:	ad690000 	sw	t1,0(t3)
+   27f2c:	4888c000 	mtc2	t0,$24
+   27f30:	24630001 	addiu	v1,v1,1
+   27f34:	1466fff6 	bne	v1,a2,27f10 <__vfs_get_name_main+0x11c>
+   27f38:	00035080 	sll	t2,v1,0x2
+   27f3c:	02a2a821 	addu	s5,s5,v0
+   27f40:	08009fdb 	j	27f6c <__vfs_get_name_main+0x178>
+   27f44:	02021821 	addu	v1,s0,v0
+   27f48:	4808c000 	mfc2	t0,$24
+   27f4c:	4884c000 	mtc2	a0,$24
+   27f50:	80690000 	lb	t1,0(v1)
+   27f54:	4885c000 	mtc2	a1,$24
+   27f58:	a2a90000 	sb	t1,0(s5)
+   27f5c:	4888c000 	mtc2	t0,$24
+   27f60:	24420001 	addiu	v0,v0,1
+   27f64:	24630001 	addiu	v1,v1,1
+   27f68:	26b50001 	addiu	s5,s5,1
+   27f6c:	0052302b 	sltu	a2,v0,s2
+   27f70:	14c0fff5 	bnez	a2,27f48 <__vfs_get_name_main+0x154>
+   27f74:	00000000 	sll	zero,zero,0x0
+   27f78:	08009fe1 	j	27f84 <__vfs_get_name_main+0x190>
+   27f7c:	8e020180 	lw	v0,384(s0)
+   27f80:	00009021 	addu	s2,zero,zero
+   27f84:	9444006c 	lhu	a0,108(v0)
+   27f88:	8fa30050 	lw	v1,80(sp)
+   27f8c:	8c420060 	lw	v0,96(v0)
+   27f90:	a4640000 	sh	a0,0(v1)
+   27f94:	ace20000 	sw	v0,0(a3)
+   27f98:	ae320000 	sw	s2,0(s1)
+   27f9c:	8fbf003c 	lw	ra,60(sp)
+   27fa0:	8fb50038 	lw	s5,56(sp)
+   27fa4:	8fb40034 	lw	s4,52(sp)
+   27fa8:	8fb30030 	lw	s3,48(sp)
+   27fac:	8fb2002c 	lw	s2,44(sp)
+   27fb0:	8fb10028 	lw	s1,40(sp)
+   27fb4:	8fb00024 	lw	s0,36(sp)
+   27fb8:	03e00008 	jr	ra
+   27fbc:	27bd0040 	addiu	sp,sp,64
+   27fc0:	3c020004 	lui	v0,0x4
+   27fc4:	8c449100 	lw	a0,-28416(v0)
+   27fc8:	3c060003 	lui	a2,0x3
+   27fcc:	24c67928 	addiu	a2,a2,31016
+   27fd0:	02403821 	addu	a3,s2,zero
+   27fd4:	00002821 	addu	a1,zero,zero
+   27fd8:	afb00014 	sw	s0,20(sp)
+   27fdc:	0c0009b0 	jal	26c0 <__fprintk>
+   27fe0:	afb00010 	sw	s0,16(sp)
+   27fe4:	08009fe7 	j	27f9c <__vfs_get_name_main+0x1a8>
+   27fe8:	ae200000 	sw	zero,0(s1)
+   27fec:	08009ffb 	j	27fec <__vfs_get_name_main+0x1f8>
+   27ff0:	00000000 	sll	zero,zero,0x0
+   27ff4:	00123082 	srl	a2,s2,0x2
+   27ff8:	08009fc2 	j	27f08 <__vfs_get_name_main+0x114>
+   27ffc:	00061080 	sll	v0,a2,0x2
+
+00028000 <__vfs_get_name_demarshall>:
+   28000:	27bdff90 	addiu	sp,sp,-112
+   28004:	afbe0068 	sw	s8,104(sp)
+   28008:	afb5005c 	sw	s5,92(sp)
+   2800c:	03a0f021 	addu	s8,sp,zero
+   28010:	afb1004c 	sw	s1,76(sp)
+   28014:	afb00048 	sw	s0,72(sp)
+   28018:	24020004 	addiu	v0,zero,4
+   2801c:	24030002 	addiu	v1,zero,2
+   28020:	afbf006c 	sw	ra,108(sp)
+   28024:	afb70064 	sw	s7,100(sp)
+   28028:	afb60060 	sw	s6,96(sp)
+   2802c:	afb40058 	sw	s4,88(sp)
+   28030:	afb30054 	sw	s3,84(sp)
+   28034:	afb20050 	sw	s2,80(sp)
+   28038:	27bdffe8 	addiu	sp,sp,-24
+   2803c:	afc30030 	sw	v1,48(s8)
+   28040:	00808021 	addu	s0,a0,zero
+   28044:	afc2002c 	sw	v0,44(s8)
+   28048:	afc20028 	sw	v0,40(s8)
+   2804c:	27b50028 	addiu	s5,sp,40
+   28050:	27c3002c 	addiu	v1,s8,44
+   28054:	27c50034 	addiu	a1,s8,52
+   28058:	24110024 	addiu	s1,zero,36
+   2805c:	2404fffc 	addiu	a0,zero,-4
+   28060:	30470003 	andi	a3,v0,0x3
+   28064:	10e00007 	beqz	a3,28084 <__vfs_get_name_demarshall+0x84>
+   28068:	00443024 	and	a2,v0,a0
+   2806c:	24c20008 	addiu	v0,a2,8
+   28070:	10650006 	beq	v1,a1,2808c <__vfs_get_name_demarshall+0x8c>
+   28074:	02228821 	addu	s1,s1,v0
+   28078:	8c620000 	lw	v0,0(v1)
+   2807c:	0800a018 	j	28060 <__vfs_get_name_demarshall+0x60>
+   28080:	24630004 	addiu	v1,v1,4
+   28084:	0800a01c 	j	28070 <__vfs_get_name_demarshall+0x70>
+   28088:	24420004 	addiu	v0,v0,4
+   2808c:	2e220801 	sltiu	v0,s1,2049
+   28090:	1440000a 	bnez	v0,280bc <__vfs_get_name_demarshall+0xbc>
+   28094:	26220012 	addiu	v0,s1,18
+   28098:	3c110003 	lui	s1,0x3
+   2809c:	26315a60 	addiu	s1,s1,23136
+   280a0:	3c100004 	lui	s0,0x4
+   280a4:	8e049100 	lw	a0,-28416(s0)
+   280a8:	00002821 	addu	a1,zero,zero
+   280ac:	0c0009b0 	jal	26c0 <__fprintk>
+   280b0:	02203021 	addu	a2,s1,zero
+   280b4:	0800a02a 	j	280a8 <__vfs_get_name_demarshall+0xa8>
+   280b8:	8e049100 	lw	a0,-28416(s0)
+   280bc:	000210c2 	srl	v0,v0,0x3
+   280c0:	000210c0 	sll	v0,v0,0x3
+   280c4:	03a2e823 	subu	sp,sp,v0
+   280c8:	27b20028 	addiu	s2,sp,40
+   280cc:	24030004 	addiu	v1,zero,4
+   280d0:	26420024 	addiu	v0,s2,36
+   280d4:	ae430024 	sw	v1,36(s2)
+   280d8:	24030002 	addiu	v1,zero,2
+   280dc:	ac430008 	sw	v1,8(v0)
+   280e0:	8fc3002c 	lw	v1,44(s8)
+   280e4:	ae510008 	sw	s1,8(s2)
+   280e8:	ac430004 	sw	v1,4(v0)
+   280ec:	26440030 	addiu	a0,s2,48
+   280f0:	00001821 	addu	v1,zero,zero
+   280f4:	24020004 	addiu	v0,zero,4
+   280f8:	2407fffc 	addiu	a3,zero,-4
+   280fc:	2406000c 	addiu	a2,zero,12
+   28100:	0800a043 	j	2810c <__vfs_get_name_demarshall+0x10c>
+   28104:	27c50028 	addiu	a1,s8,40
+   28108:	8d020000 	lw	v0,0(t0)
+   2810c:	02a35821 	addu	t3,s5,v1
+   28110:	304a0003 	andi	t2,v0,0x3
+   28114:	24630004 	addiu	v1,v1,4
+   28118:	00474824 	and	t1,v0,a3
+   2811c:	00a34021 	addu	t0,a1,v1
+   28120:	11400002 	beqz	t2,2812c <__vfs_get_name_demarshall+0x12c>
+   28124:	ad640000 	sw	a0,0(t3)
+   28128:	25220004 	addiu	v0,t1,4
+   2812c:	1466fff6 	bne	v1,a2,28108 <__vfs_get_name_demarshall+0x108>
+   28130:	00822021 	addu	a0,a0,v0
+   28134:	0c009ea4 	jal	27a90 <__vfs_lseek_+0x5c>
+   28138:	8e040000 	lw	a0,0(s0)
+   2813c:	8ea30008 	lw	v1,8(s5)
+   28140:	8ea60000 	lw	a2,0(s5)
+   28144:	8ea70004 	lw	a3,4(s5)
+   28148:	02002021 	addu	a0,s0,zero
+   2814c:	00002821 	addu	a1,zero,zero
+   28150:	afc30038 	sw	v1,56(s8)
+   28154:	afc60040 	sw	a2,64(s8)
+   28158:	afc7003c 	sw	a3,60(s8)
+   2815c:	8e130000 	lw	s3,0(s0)
+   28160:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28164:	0040a021 	addu	s4,v0,zero
+   28168:	02002021 	addu	a0,s0,zero
+   2816c:	24050001 	addiu	a1,zero,1
+   28170:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28174:	8c570000 	lw	s7,0(v0)
+   28178:	02002021 	addu	a0,s0,zero
+   2817c:	24050002 	addiu	a1,zero,2
+   28180:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28184:	8c560000 	lw	s6,0(v0)
+   28188:	02002021 	addu	a0,s0,zero
+   2818c:	24050003 	addiu	a1,zero,3
+   28190:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28194:	8c550000 	lw	s5,0(v0)
+   28198:	8fc30038 	lw	v1,56(s8)
+   2819c:	afb70014 	sw	s7,20(sp)
+   281a0:	afa30010 	sw	v1,16(sp)
+   281a4:	afb60018 	sw	s6,24(sp)
+   281a8:	afb5001c 	sw	s5,28(sp)
+   281ac:	8c420000 	lw	v0,0(v0)
+   281b0:	8fc7003c 	lw	a3,60(s8)
+   281b4:	8fc60040 	lw	a2,64(s8)
+   281b8:	3284ffff 	andi	a0,s4,0xffff
+   281bc:	02602821 	addu	a1,s3,zero
+   281c0:	0c009f7d 	jal	27df4 <__vfs_get_name_main>
+   281c4:	afa20020 	sw	v0,32(sp)
+   281c8:	02002021 	addu	a0,s0,zero
+   281cc:	02402821 	addu	a1,s2,zero
+   281d0:	02203021 	addu	a2,s1,zero
+   281d4:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   281d8:	24070003 	addiu	a3,zero,3
+   281dc:	03c0e821 	addu	sp,s8,zero
+   281e0:	8fbf006c 	lw	ra,108(sp)
+   281e4:	8fbe0068 	lw	s8,104(sp)
+   281e8:	8fb70064 	lw	s7,100(sp)
+   281ec:	8fb60060 	lw	s6,96(sp)
+   281f0:	8fb5005c 	lw	s5,92(sp)
+   281f4:	8fb40058 	lw	s4,88(sp)
+   281f8:	8fb30054 	lw	s3,84(sp)
+   281fc:	8fb20050 	lw	s2,80(sp)
+   28200:	8fb1004c 	lw	s1,76(sp)
+   28204:	8fb00048 	lw	s0,72(sp)
+   28208:	03e00008 	jr	ra
+   2820c:	27bd0070 	addiu	sp,sp,112
+
+00028210 <__vfs_get_name_local>:
+   28210:	27bdffd0 	addiu	sp,sp,-48
+   28214:	afbf002c 	sw	ra,44(sp)
+   28218:	00806021 	addu	t4,a0,zero
+   2821c:	00a05821 	addu	t3,a1,zero
+   28220:	00c05021 	addu	t2,a2,zero
+   28224:	40037801 	mfc0	v1,$15,1
+   28228:	3c020004 	lui	v0,0x4
+   2822c:	2444c960 	addiu	a0,v0,-13984
+   28230:	88840003 	lwl	a0,3(a0)
+   28234:	30630003 	andi	v1,v1,0x3
+   28238:	9844c960 	lwr	a0,-13984(v0)
+   2823c:	8fa20040 	lw	v0,64(sp)
+   28240:	3c050004 	lui	a1,0x4
+   28244:	8c480000 	lw	t0,0(v0)
+   28248:	24a5c950 	addiu	a1,a1,-14000
+   2824c:	8fa20044 	lw	v0,68(sp)
+   28250:	00031880 	sll	v1,v1,0x2
+   28254:	00651821 	addu	v1,v1,a1
+   28258:	8c650000 	lw	a1,0(v1)
+   2825c:	8c430000 	lw	v1,0(v0)
+   28260:	8fa20048 	lw	v0,72(sp)
+   28264:	8ce90000 	lw	t1,0(a3)
+   28268:	8c420000 	lw	v0,0(v0)
+   2826c:	3084ffff 	andi	a0,a0,0xffff
+   28270:	01803021 	addu	a2,t4,zero
+   28274:	01603821 	addu	a3,t3,zero
+   28278:	afaa0010 	sw	t2,16(sp)
+   2827c:	afa90014 	sw	t1,20(sp)
+   28280:	afa80018 	sw	t0,24(sp)
+   28284:	afa3001c 	sw	v1,28(sp)
+   28288:	0c009f7d 	jal	27df4 <__vfs_get_name_main>
+   2828c:	afa20020 	sw	v0,32(sp)
+   28290:	8fbf002c 	lw	ra,44(sp)
+   28294:	03e00008 	jr	ra
+   28298:	27bd0030 	addiu	sp,sp,48
+
+0002829c <__vfs_chmod_main>:
+   2829c:	27bdffd8 	addiu	sp,sp,-40
+   282a0:	8fa20038 	lw	v0,56(sp)
+   282a4:	afb0001c 	sw	s0,28(sp)
+   282a8:	8c500000 	lw	s0,0(v0)
+   282ac:	8c450008 	lw	a1,8(v0)
+   282b0:	ace00000 	sw	zero,0(a3)
+   282b4:	02002021 	addu	a0,s0,zero
+   282b8:	acc00000 	sw	zero,0(a2)
+   282bc:	afb10020 	sw	s1,32(sp)
+   282c0:	afa70010 	sw	a3,16(sp)
+   282c4:	afbf0024 	sw	ra,36(sp)
+   282c8:	0c00a8df 	jal	2a37c <vfs_inode_hold>
+   282cc:	8fb1003c 	lw	s1,60(sp)
+   282d0:	10400009 	beqz	v0,282f8 <__vfs_chmod_main+0x5c>
+   282d4:	8fa70010 	lw	a3,16(sp)
+   282d8:	8ce20000 	lw	v0,0(a3)
+   282dc:	8fbf0024 	lw	ra,36(sp)
+   282e0:	34420008 	ori	v0,v0,0x8
+   282e4:	8fb10020 	lw	s1,32(sp)
+   282e8:	8fb0001c 	lw	s0,28(sp)
+   282ec:	ace20000 	sw	v0,0(a3)
+   282f0:	03e00008 	jr	ra
+   282f4:	27bd0028 	addiu	sp,sp,40
+   282f8:	0c00a864 	jal	2a190 <vfs_inode_lock>
+   282fc:	02002021 	addu	a0,s0,zero
+   28300:	ae11000c 	sw	s1,12(s0)
+   28304:	02002021 	addu	a0,s0,zero
+   28308:	8fbf0024 	lw	ra,36(sp)
+   2830c:	8fb10020 	lw	s1,32(sp)
+   28310:	8fb0001c 	lw	s0,28(sp)
+   28314:	0800a8b2 	j	2a2c8 <vfs_inode_unlock>
+   28318:	27bd0028 	addiu	sp,sp,40
+
+0002831c <__vfs_chmod_demarshall>:
+   2831c:	27bdffc0 	addiu	sp,sp,-64
+   28320:	afbf003c 	sw	ra,60(sp)
+   28324:	afbe0038 	sw	s8,56(sp)
+   28328:	afb40034 	sw	s4,52(sp)
+   2832c:	03a0f021 	addu	s8,sp,zero
+   28330:	afb30030 	sw	s3,48(sp)
+   28334:	afb2002c 	sw	s2,44(sp)
+   28338:	afb10028 	sw	s1,40(sp)
+   2833c:	afb00024 	sw	s0,36(sp)
+   28340:	27bdfff0 	addiu	sp,sp,-16
+   28344:	27b40018 	addiu	s4,sp,24
+   28348:	27bdffc0 	addiu	sp,sp,-64
+   2834c:	27b00018 	addiu	s0,sp,24
+   28350:	26030030 	addiu	v1,s0,48
+   28354:	00808821 	addu	s1,a0,zero
+   28358:	2605002c 	addiu	a1,s0,44
+   2835c:	8c840000 	lw	a0,0(a0)
+   28360:	ae830004 	sw	v1,4(s4)
+   28364:	24020004 	addiu	v0,zero,4
+   28368:	24060034 	addiu	a2,zero,52
+   2836c:	ae850000 	sw	a1,0(s4)
+   28370:	ae060008 	sw	a2,8(s0)
+   28374:	ae020028 	sw	v0,40(s0)
+   28378:	0c009ea4 	jal	27a90 <__vfs_lseek_+0x5c>
+   2837c:	ae020024 	sw	v0,36(s0)
+   28380:	8e870004 	lw	a3,4(s4)
+   28384:	8e860000 	lw	a2,0(s4)
+   28388:	02202021 	addu	a0,s1,zero
+   2838c:	00002821 	addu	a1,zero,zero
+   28390:	8e320000 	lw	s2,0(s1)
+   28394:	afc6001c 	sw	a2,28(s8)
+   28398:	afc70018 	sw	a3,24(s8)
+   2839c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   283a0:	00409821 	addu	s3,v0,zero
+   283a4:	0040a021 	addu	s4,v0,zero
+   283a8:	02202021 	addu	a0,s1,zero
+   283ac:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   283b0:	24050001 	addiu	a1,zero,1
+   283b4:	afb40010 	sw	s4,16(sp)
+   283b8:	8c420000 	lw	v0,0(v0)
+   283bc:	8fc6001c 	lw	a2,28(s8)
+   283c0:	8fc70018 	lw	a3,24(s8)
+   283c4:	3264ffff 	andi	a0,s3,0xffff
+   283c8:	02402821 	addu	a1,s2,zero
+   283cc:	0c00a0a7 	jal	2829c <__vfs_chmod_main>
+   283d0:	afa20014 	sw	v0,20(sp)
+   283d4:	02202021 	addu	a0,s1,zero
+   283d8:	02002821 	addu	a1,s0,zero
+   283dc:	24060034 	addiu	a2,zero,52
+   283e0:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   283e4:	24070002 	addiu	a3,zero,2
+   283e8:	03c0e821 	addu	sp,s8,zero
+   283ec:	8fbf003c 	lw	ra,60(sp)
+   283f0:	8fbe0038 	lw	s8,56(sp)
+   283f4:	8fb40034 	lw	s4,52(sp)
+   283f8:	8fb30030 	lw	s3,48(sp)
+   283fc:	8fb2002c 	lw	s2,44(sp)
+   28400:	8fb10028 	lw	s1,40(sp)
+   28404:	8fb00024 	lw	s0,36(sp)
+   28408:	03e00008 	jr	ra
+   2840c:	27bd0040 	addiu	sp,sp,64
+
+00028410 <__vfs_chmod_local>:
+   28410:	27bdffe0 	addiu	sp,sp,-32
+   28414:	afbf001c 	sw	ra,28(sp)
+   28418:	00804821 	addu	t1,a0,zero
+   2841c:	00a04021 	addu	t0,a1,zero
+   28420:	00c01821 	addu	v1,a2,zero
+   28424:	40057801 	mfc0	a1,$15,1
+   28428:	3c020004 	lui	v0,0x4
+   2842c:	2444c960 	addiu	a0,v0,-13984
+   28430:	88840003 	lwl	a0,3(a0)
+   28434:	30a50003 	andi	a1,a1,0x3
+   28438:	3c060004 	lui	a2,0x4
+   2843c:	24c6c950 	addiu	a2,a2,-14000
+   28440:	00052880 	sll	a1,a1,0x2
+   28444:	9844c960 	lwr	a0,-13984(v0)
+   28448:	00a62821 	addu	a1,a1,a2
+   2844c:	8ce20000 	lw	v0,0(a3)
+   28450:	8ca50000 	lw	a1,0(a1)
+   28454:	3084ffff 	andi	a0,a0,0xffff
+   28458:	01203021 	addu	a2,t1,zero
+   2845c:	01003821 	addu	a3,t0,zero
+   28460:	afa30010 	sw	v1,16(sp)
+   28464:	0c00a0a7 	jal	2829c <__vfs_chmod_main>
+   28468:	afa20014 	sw	v0,20(sp)
+   2846c:	8fbf001c 	lw	ra,28(sp)
+   28470:	03e00008 	jr	ra
+   28474:	27bd0020 	addiu	sp,sp,32
+
+00028478 <__vfs_delete_dirent_main>:
+   28478:	27bdffc8 	addiu	sp,sp,-56
+   2847c:	8fa20048 	lw	v0,72(sp)
+   28480:	afb00028 	sw	s0,40(sp)
+   28484:	8c500000 	lw	s0,0(v0)
+   28488:	8c450008 	lw	a1,8(v0)
+   2848c:	02002021 	addu	a0,s0,zero
+   28490:	afb20030 	sw	s2,48(sp)
+   28494:	afb1002c 	sw	s1,44(sp)
+   28498:	afbf0034 	sw	ra,52(sp)
+   2849c:	00c09021 	addu	s2,a2,zero
+   284a0:	0c00a8df 	jal	2a37c <vfs_inode_hold>
+   284a4:	00e08821 	addu	s1,a3,zero
+   284a8:	1040000c 	beqz	v0,284dc <__vfs_delete_dirent_main+0x64>
+   284ac:	24020001 	addiu	v0,zero,1
+   284b0:	8e220000 	lw	v0,0(s1)
+   284b4:	34420008 	ori	v0,v0,0x8
+   284b8:	ae220000 	sw	v0,0(s1)
+   284bc:	0c00aa79 	jal	2a9e4 <vfs_inode_down>
+   284c0:	02002021 	addu	a0,s0,zero
+   284c4:	8fbf0034 	lw	ra,52(sp)
+   284c8:	8fb20030 	lw	s2,48(sp)
+   284cc:	8fb1002c 	lw	s1,44(sp)
+   284d0:	8fb00028 	lw	s0,40(sp)
+   284d4:	03e00008 	jr	ra
+   284d8:	27bd0038 	addiu	sp,sp,56
+   284dc:	8fa5004c 	lw	a1,76(sp)
+   284e0:	afa20010 	sw	v0,16(sp)
+   284e4:	02002021 	addu	a0,s0,zero
+   284e8:	27a20020 	addiu	v0,sp,32
+   284ec:	00003021 	addu	a2,zero,zero
+   284f0:	24070001 	addiu	a3,zero,1
+   284f4:	afa20014 	sw	v0,20(sp)
+   284f8:	0c00b527 	jal	2d49c <vfs_load_dirent>
+   284fc:	afb10018 	sw	s1,24(sp)
+   28500:	1440ffee 	bnez	v0,284bc <__vfs_delete_dirent_main+0x44>
+   28504:	ae420000 	sw	v0,0(s2)
+   28508:	8fa40020 	lw	a0,32(sp)
+   2850c:	8c820184 	lw	v0,388(a0)
+   28510:	1040000b 	beqz	v0,28540 <__vfs_delete_dirent_main+0xc8>
+   28514:	24020010 	addiu	v0,zero,16
+   28518:	0c00a86f 	jal	2a1bc <vfs_dirent_down>
+   2851c:	ae420000 	sw	v0,0(s2)
+   28520:	0c00aa79 	jal	2a9e4 <vfs_inode_down>
+   28524:	02002021 	addu	a0,s0,zero
+   28528:	8fbf0034 	lw	ra,52(sp)
+   2852c:	8fb20030 	lw	s2,48(sp)
+   28530:	8fb1002c 	lw	s1,44(sp)
+   28534:	8fb00028 	lw	s0,40(sp)
+   28538:	03e00008 	jr	ra
+   2853c:	27bd0038 	addiu	sp,sp,56
+   28540:	8e0201bc 	lw	v0,444(s0)
+   28544:	8fa60050 	lw	a2,80(sp)
+   28548:	8c420018 	lw	v0,24(v0)
+   2854c:	00802821 	addu	a1,a0,zero
+   28550:	0040f809 	jalr	v0
+   28554:	02002021 	addu	a0,s0,zero
+   28558:	10400008 	beqz	v0,2857c <__vfs_delete_dirent_main+0x104>
+   2855c:	ae420000 	sw	v0,0(s2)
+   28560:	0c00a85f 	jal	2a17c <vfs_dirent_clear_inload>
+   28564:	8fa40020 	lw	a0,32(sp)
+   28568:	0000000f 	sync
+   2856c:	0c00a86f 	jal	2a1bc <vfs_dirent_down>
+   28570:	8fa40020 	lw	a0,32(sp)
+   28574:	0800a148 	j	28520 <__vfs_delete_dirent_main+0xa8>
+   28578:	00000000 	sll	zero,zero,0x0
+   2857c:	0c00a864 	jal	2a190 <vfs_inode_lock>
+   28580:	02002021 	addu	a0,s0,zero
+   28584:	8fa30020 	lw	v1,32(sp)
+   28588:	8e040078 	lw	a0,120(s0)
+   2858c:	8c62012c 	lw	v0,300(v1)
+   28590:	8c630128 	lw	v1,296(v1)
+   28594:	2484ffff 	addiu	a0,a0,-1
+   28598:	ae040078 	sw	a0,120(s0)
+   2859c:	ac620004 	sw	v0,4(v1)
+   285a0:	02002021 	addu	a0,s0,zero
+   285a4:	0c00a8b2 	jal	2a2c8 <vfs_inode_unlock>
+   285a8:	ac430000 	sw	v1,0(v0)
+   285ac:	0c00a86f 	jal	2a1bc <vfs_dirent_down>
+   285b0:	8fa40020 	lw	a0,32(sp)
+   285b4:	0800a148 	j	28520 <__vfs_delete_dirent_main+0xa8>
+   285b8:	00000000 	sll	zero,zero,0x0
+
+000285bc <__vfs_delete_dirent_demarshall>:
+   285bc:	27bdffb8 	addiu	sp,sp,-72
+   285c0:	afbf0044 	sw	ra,68(sp)
+   285c4:	afbe0040 	sw	s8,64(sp)
+   285c8:	afb5003c 	sw	s5,60(sp)
+   285cc:	03a0f021 	addu	s8,sp,zero
+   285d0:	afb40038 	sw	s4,56(sp)
+   285d4:	afb30034 	sw	s3,52(sp)
+   285d8:	afb20030 	sw	s2,48(sp)
+   285dc:	afb1002c 	sw	s1,44(sp)
+   285e0:	afb00028 	sw	s0,40(sp)
+   285e4:	27bdfff0 	addiu	sp,sp,-16
+   285e8:	27b40020 	addiu	s4,sp,32
+   285ec:	27bdffc0 	addiu	sp,sp,-64
+   285f0:	27b00020 	addiu	s0,sp,32
+   285f4:	26030030 	addiu	v1,s0,48
+   285f8:	00808821 	addu	s1,a0,zero
+   285fc:	2605002c 	addiu	a1,s0,44
+   28600:	8c840000 	lw	a0,0(a0)
+   28604:	ae830004 	sw	v1,4(s4)
+   28608:	24020004 	addiu	v0,zero,4
+   2860c:	24060034 	addiu	a2,zero,52
+   28610:	ae850000 	sw	a1,0(s4)
+   28614:	ae060008 	sw	a2,8(s0)
+   28618:	ae020028 	sw	v0,40(s0)
+   2861c:	0c009ea4 	jal	27a90 <__vfs_lseek_+0x5c>
+   28620:	ae020024 	sw	v0,36(s0)
+   28624:	8e870004 	lw	a3,4(s4)
+   28628:	8e860000 	lw	a2,0(s4)
+   2862c:	02202021 	addu	a0,s1,zero
+   28630:	00002821 	addu	a1,zero,zero
+   28634:	afc60024 	sw	a2,36(s8)
+   28638:	afc70020 	sw	a3,32(s8)
+   2863c:	8e320000 	lw	s2,0(s1)
+   28640:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28644:	00409821 	addu	s3,v0,zero
+   28648:	02202021 	addu	a0,s1,zero
+   2864c:	24050001 	addiu	a1,zero,1
+   28650:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28654:	0040a821 	addu	s5,v0,zero
+   28658:	0040a021 	addu	s4,v0,zero
+   2865c:	02202021 	addu	a0,s1,zero
+   28660:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28664:	24050002 	addiu	a1,zero,2
+   28668:	afb50010 	sw	s5,16(sp)
+   2866c:	afb40014 	sw	s4,20(sp)
+   28670:	8c420000 	lw	v0,0(v0)
+   28674:	8fc60024 	lw	a2,36(s8)
+   28678:	8fc70020 	lw	a3,32(s8)
+   2867c:	3264ffff 	andi	a0,s3,0xffff
+   28680:	02402821 	addu	a1,s2,zero
+   28684:	0c00a11e 	jal	28478 <__vfs_delete_dirent_main>
+   28688:	afa20018 	sw	v0,24(sp)
+   2868c:	02202021 	addu	a0,s1,zero
+   28690:	02002821 	addu	a1,s0,zero
+   28694:	24060034 	addiu	a2,zero,52
+   28698:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2869c:	24070002 	addiu	a3,zero,2
+   286a0:	03c0e821 	addu	sp,s8,zero
+   286a4:	8fbf0044 	lw	ra,68(sp)
+   286a8:	8fbe0040 	lw	s8,64(sp)
+   286ac:	8fb5003c 	lw	s5,60(sp)
+   286b0:	8fb40038 	lw	s4,56(sp)
+   286b4:	8fb30034 	lw	s3,52(sp)
+   286b8:	8fb20030 	lw	s2,48(sp)
+   286bc:	8fb1002c 	lw	s1,44(sp)
+   286c0:	8fb00028 	lw	s0,40(sp)
+   286c4:	03e00008 	jr	ra
+   286c8:	27bd0048 	addiu	sp,sp,72
+
+000286cc <__vfs_delete_dirent_local>:
+   286cc:	27bdffd8 	addiu	sp,sp,-40
+   286d0:	afbf0024 	sw	ra,36(sp)
+   286d4:	00805021 	addu	t2,a0,zero
+   286d8:	00a04821 	addu	t1,a1,zero
+   286dc:	00c04021 	addu	t0,a2,zero
+   286e0:	00e01821 	addu	v1,a3,zero
+   286e4:	40057801 	mfc0	a1,$15,1
+   286e8:	3c020004 	lui	v0,0x4
+   286ec:	2444c960 	addiu	a0,v0,-13984
+   286f0:	88840003 	lwl	a0,3(a0)
+   286f4:	30a50003 	andi	a1,a1,0x3
+   286f8:	3c060004 	lui	a2,0x4
+   286fc:	9844c960 	lwr	a0,-13984(v0)
+   28700:	24c6c950 	addiu	a2,a2,-14000
+   28704:	8fa20038 	lw	v0,56(sp)
+   28708:	00052880 	sll	a1,a1,0x2
+   2870c:	00a62821 	addu	a1,a1,a2
+   28710:	8ca50000 	lw	a1,0(a1)
+   28714:	8c420000 	lw	v0,0(v0)
+   28718:	3084ffff 	andi	a0,a0,0xffff
+   2871c:	01403021 	addu	a2,t2,zero
+   28720:	01203821 	addu	a3,t1,zero
+   28724:	afa80010 	sw	t0,16(sp)
+   28728:	afa30014 	sw	v1,20(sp)
+   2872c:	0c00a11e 	jal	28478 <__vfs_delete_dirent_main>
+   28730:	afa20018 	sw	v0,24(sp)
+   28734:	8fbf0024 	lw	ra,36(sp)
+   28738:	03e00008 	jr	ra
+   2873c:	27bd0028 	addiu	sp,sp,40
+
+00028740 <__vfs_stat_main>:
+   28740:	27bdffe0 	addiu	sp,sp,-32
+   28744:	8fa20030 	lw	v0,48(sp)
+   28748:	ace00040 	sw	zero,64(a3)
+   2874c:	afb00018 	sw	s0,24(sp)
+   28750:	8c500000 	lw	s0,0(v0)
+   28754:	8c450008 	lw	a1,8(v0)
+   28758:	acc00000 	sw	zero,0(a2)
+   2875c:	afa60010 	sw	a2,16(sp)
+   28760:	afa70014 	sw	a3,20(sp)
+   28764:	afbf001c 	sw	ra,28(sp)
+   28768:	0c00a8df 	jal	2a37c <vfs_inode_hold>
+   2876c:	02002021 	addu	a0,s0,zero
+   28770:	8fa60010 	lw	a2,16(sp)
+   28774:	14400012 	bnez	v0,287c0 <__vfs_stat_main+0x80>
+   28778:	8fa70014 	lw	a3,20(sp)
+   2877c:	8e0201bc 	lw	v0,444(s0)
+   28780:	8c420020 	lw	v0,32(v0)
+   28784:	10400015 	beqz	v0,287dc <__vfs_stat_main+0x9c>
+   28788:	02002021 	addu	a0,s0,zero
+   2878c:	afa60010 	sw	a2,16(sp)
+   28790:	afa70014 	sw	a3,20(sp)
+   28794:	0040f809 	jalr	v0
+   28798:	02002021 	addu	a0,s0,zero
+   2879c:	8fa60010 	lw	a2,16(sp)
+   287a0:	8fa70014 	lw	a3,20(sp)
+   287a4:	10400013 	beqz	v0,287f4 <__vfs_stat_main+0xb4>
+   287a8:	acc20000 	sw	v0,0(a2)
+   287ac:	02002021 	addu	a0,s0,zero
+   287b0:	8fbf001c 	lw	ra,28(sp)
+   287b4:	8fb00018 	lw	s0,24(sp)
+   287b8:	0800aa79 	j	2a9e4 <vfs_inode_down>
+   287bc:	27bd0020 	addiu	sp,sp,32
+   287c0:	8ce20040 	lw	v0,64(a3)
+   287c4:	8fbf001c 	lw	ra,28(sp)
+   287c8:	34420008 	ori	v0,v0,0x8
+   287cc:	8fb00018 	lw	s0,24(sp)
+   287d0:	ace20040 	sw	v0,64(a3)
+   287d4:	03e00008 	jr	ra
+   287d8:	27bd0020 	addiu	sp,sp,32
+   287dc:	24020026 	addiu	v0,zero,38
+   287e0:	8fbf001c 	lw	ra,28(sp)
+   287e4:	8fb00018 	lw	s0,24(sp)
+   287e8:	acc20000 	sw	v0,0(a2)
+   287ec:	0800aa79 	j	2a9e4 <vfs_inode_down>
+   287f0:	27bd0020 	addiu	sp,sp,32
+   287f4:	00e02021 	addu	a0,a3,zero
+   287f8:	260501d0 	addiu	a1,s0,464
+   287fc:	0c00c12b 	jal	304ac <memcpy>
+   28800:	24060040 	addiu	a2,zero,64
+   28804:	02002021 	addu	a0,s0,zero
+   28808:	8fbf001c 	lw	ra,28(sp)
+   2880c:	8fb00018 	lw	s0,24(sp)
+   28810:	0800aa79 	j	2a9e4 <vfs_inode_down>
+   28814:	27bd0020 	addiu	sp,sp,32
+
+00028818 <__vfs_stat_demarshall>:
+   28818:	27bdffc0 	addiu	sp,sp,-64
+   2881c:	afbf003c 	sw	ra,60(sp)
+   28820:	afbe0038 	sw	s8,56(sp)
+   28824:	afb40034 	sw	s4,52(sp)
+   28828:	03a0f021 	addu	s8,sp,zero
+   2882c:	afb30030 	sw	s3,48(sp)
+   28830:	afb2002c 	sw	s2,44(sp)
+   28834:	afb10028 	sw	s1,40(sp)
+   28838:	afb00024 	sw	s0,36(sp)
+   2883c:	27bdfff0 	addiu	sp,sp,-16
+   28840:	27b40018 	addiu	s4,sp,24
+   28844:	27bdff78 	addiu	sp,sp,-136
+   28848:	27b00018 	addiu	s0,sp,24
+   2884c:	24050078 	addiu	a1,zero,120
+   28850:	00808821 	addu	s1,a0,zero
+   28854:	ae050008 	sw	a1,8(s0)
+   28858:	8c840000 	lw	a0,0(a0)
+   2885c:	24050004 	addiu	a1,zero,4
+   28860:	2603002c 	addiu	v1,s0,44
+   28864:	26020030 	addiu	v0,s0,48
+   28868:	ae050024 	sw	a1,36(s0)
+   2886c:	24050048 	addiu	a1,zero,72
+   28870:	ae830000 	sw	v1,0(s4)
+   28874:	ae050028 	sw	a1,40(s0)
+   28878:	0c009ea4 	jal	27a90 <__vfs_lseek_+0x5c>
+   2887c:	ae820004 	sw	v0,4(s4)
+   28880:	8e870004 	lw	a3,4(s4)
+   28884:	8e860000 	lw	a2,0(s4)
+   28888:	8e320000 	lw	s2,0(s1)
+   2888c:	02202021 	addu	a0,s1,zero
+   28890:	00002821 	addu	a1,zero,zero
+   28894:	00409821 	addu	s3,v0,zero
+   28898:	afc6001c 	sw	a2,28(s8)
+   2889c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   288a0:	afc70018 	sw	a3,24(s8)
+   288a4:	8fc6001c 	lw	a2,28(s8)
+   288a8:	8fc70018 	lw	a3,24(s8)
+   288ac:	3264ffff 	andi	a0,s3,0xffff
+   288b0:	02402821 	addu	a1,s2,zero
+   288b4:	0c00a1d0 	jal	28740 <__vfs_stat_main>
+   288b8:	afa20010 	sw	v0,16(sp)
+   288bc:	02202021 	addu	a0,s1,zero
+   288c0:	02002821 	addu	a1,s0,zero
+   288c4:	24060078 	addiu	a2,zero,120
+   288c8:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   288cc:	24070002 	addiu	a3,zero,2
+   288d0:	03c0e821 	addu	sp,s8,zero
+   288d4:	8fbf003c 	lw	ra,60(sp)
+   288d8:	8fbe0038 	lw	s8,56(sp)
+   288dc:	8fb40034 	lw	s4,52(sp)
+   288e0:	8fb30030 	lw	s3,48(sp)
+   288e4:	8fb2002c 	lw	s2,44(sp)
+   288e8:	8fb10028 	lw	s1,40(sp)
+   288ec:	8fb00024 	lw	s0,36(sp)
+   288f0:	03e00008 	jr	ra
+   288f4:	27bd0040 	addiu	sp,sp,64
+
+000288f8 <__vfs_stat_local>:
+   288f8:	27bdffe0 	addiu	sp,sp,-32
+   288fc:	afbf001c 	sw	ra,28(sp)
+   28900:	00801821 	addu	v1,a0,zero
+   28904:	00a03821 	addu	a3,a1,zero
+   28908:	00c01021 	addu	v0,a2,zero
+   2890c:	40067801 	mfc0	a2,$15,1
+   28910:	3c050004 	lui	a1,0x4
+   28914:	24a4c960 	addiu	a0,a1,-13984
+   28918:	88840003 	lwl	a0,3(a0)
+   2891c:	30c60003 	andi	a2,a2,0x3
+   28920:	3c080004 	lui	t0,0x4
+   28924:	2508c950 	addiu	t0,t0,-14000
+   28928:	00063080 	sll	a2,a2,0x2
+   2892c:	00c83021 	addu	a2,a2,t0
+   28930:	98a4c960 	lwr	a0,-13984(a1)
+   28934:	8cc50000 	lw	a1,0(a2)
+   28938:	3084ffff 	andi	a0,a0,0xffff
+   2893c:	00603021 	addu	a2,v1,zero
+   28940:	0c00a1d0 	jal	28740 <__vfs_stat_main>
+   28944:	afa20010 	sw	v0,16(sp)
+   28948:	8fbf001c 	lw	ra,28(sp)
+   2894c:	03e00008 	jr	ra
+   28950:	27bd0020 	addiu	sp,sp,32
+
+00028954 <__vfs_open_main>:
+   28954:	27bdffd0 	addiu	sp,sp,-48
+   28958:	afb20018 	sw	s2,24(sp)
+   2895c:	8fb20040 	lw	s2,64(sp)
+   28960:	afb10014 	sw	s1,20(sp)
+   28964:	8e510000 	lw	s1,0(s2)
+   28968:	8e450008 	lw	a1,8(s2)
+   2896c:	ace00008 	sw	zero,8(a3)
+   28970:	02202021 	addu	a0,s1,zero
+   28974:	acc00000 	sw	zero,0(a2)
+   28978:	afb50024 	sw	s5,36(sp)
+   2897c:	afb3001c 	sw	s3,28(sp)
+   28980:	afb00010 	sw	s0,16(sp)
+   28984:	afbf002c 	sw	ra,44(sp)
+   28988:	afb60028 	sw	s6,40(sp)
+   2898c:	afb40020 	sw	s4,32(sp)
+   28990:	00c09821 	addu	s3,a2,zero
+   28994:	00e08021 	addu	s0,a3,zero
+   28998:	0c00a8df 	jal	2a37c <vfs_inode_hold>
+   2899c:	8fb50044 	lw	s5,68(sp)
+   289a0:	14400041 	bnez	v0,28aa8 <__vfs_open_main+0x154>
+   289a4:	32b60001 	andi	s6,s5,0x1
+   289a8:	12c00011 	beqz	s6,289f0 <__vfs_open_main+0x9c>
+   289ac:	00000000 	sll	zero,zero,0x0
+   289b0:	8e220008 	lw	v0,8(s1)
+   289b4:	30420001 	andi	v0,v0,0x1
+   289b8:	1440000d 	bnez	v0,289f0 <__vfs_open_main+0x9c>
+   289bc:	24020014 	addiu	v0,zero,20
+   289c0:	ae620000 	sw	v0,0(s3)
+   289c4:	02202021 	addu	a0,s1,zero
+   289c8:	8fbf002c 	lw	ra,44(sp)
+   289cc:	8fb60028 	lw	s6,40(sp)
+   289d0:	8fb50024 	lw	s5,36(sp)
+   289d4:	8fb40020 	lw	s4,32(sp)
+   289d8:	8fb3001c 	lw	s3,28(sp)
+   289dc:	8fb20018 	lw	s2,24(sp)
+   289e0:	8fb10014 	lw	s1,20(sp)
+   289e4:	8fb00010 	lw	s0,16(sp)
+   289e8:	0800aa79 	j	2a9e4 <vfs_inode_down>
+   289ec:	27bd0030 	addiu	sp,sp,48
+   289f0:	0c00af23 	jal	2bc8c <vfs_file_remote_get>
+   289f4:	02202021 	addu	a0,s1,zero
+   289f8:	10400052 	beqz	v0,28b44 <__vfs_open_main+0x1f0>
+   289fc:	0040a021 	addu	s4,v0,zero
+   28a00:	8c420114 	lw	v0,276(v0)
+   28a04:	02802021 	addu	a0,s4,zero
+   28a08:	8c420000 	lw	v0,0(v0)
+   28a0c:	0040f809 	jalr	v0
+   28a10:	26050024 	addiu	a1,s0,36
+   28a14:	14400035 	bnez	v0,28aec <__vfs_open_main+0x198>
+   28a18:	ae620000 	sw	v0,0(s3)
+   28a1c:	3c020008 	lui	v0,0x8
+   28a20:	02a21024 	and	v0,s5,v0
+   28a24:	1440003f 	bnez	v0,28b24 <__vfs_open_main+0x1d0>
+   28a28:	02802021 	addu	a0,s4,zero
+   28a2c:	12c00002 	beqz	s6,28a38 <__vfs_open_main+0xe4>
+   28a30:	3c020100 	lui	v0,0x100
+   28a34:	ae800004 	sw	zero,4(s4)
+   28a38:	02a2a824 	and	s5,s5,v0
+   28a3c:	16a00027 	bnez	s5,28adc <__vfs_open_main+0x188>
+   28a40:	00000000 	sll	zero,zero,0x0
+   28a44:	8e220008 	lw	v0,8(s1)
+   28a48:	8e440008 	lw	a0,8(s2)
+   28a4c:	ae020000 	sw	v0,0(s0)
+   28a50:	8e460000 	lw	a2,0(s2)
+   28a54:	8e450004 	lw	a1,4(s2)
+   28a58:	8e2201c4 	lw	v0,452(s1)
+   28a5c:	8e870004 	lw	a3,4(s4)
+   28a60:	8e2301c0 	lw	v1,448(s1)
+   28a64:	8fbf002c 	lw	ra,44(sp)
+   28a68:	ae140020 	sw	s4,32(s0)
+   28a6c:	ae070004 	sw	a3,4(s0)
+   28a70:	ae060014 	sw	a2,20(s0)
+   28a74:	ae050018 	sw	a1,24(s0)
+   28a78:	ae04001c 	sw	a0,28(s0)
+   28a7c:	ae030010 	sw	v1,16(s0)
+   28a80:	ae02000c 	sw	v0,12(s0)
+   28a84:	8fb60028 	lw	s6,40(sp)
+   28a88:	8fb50024 	lw	s5,36(sp)
+   28a8c:	8fb40020 	lw	s4,32(sp)
+   28a90:	8fb3001c 	lw	s3,28(sp)
+   28a94:	8fb20018 	lw	s2,24(sp)
+   28a98:	8fb10014 	lw	s1,20(sp)
+   28a9c:	8fb00010 	lw	s0,16(sp)
+   28aa0:	03e00008 	jr	ra
+   28aa4:	27bd0030 	addiu	sp,sp,48
+   28aa8:	8e020008 	lw	v0,8(s0)
+   28aac:	8fbf002c 	lw	ra,44(sp)
+   28ab0:	34420008 	ori	v0,v0,0x8
+   28ab4:	ae020008 	sw	v0,8(s0)
+   28ab8:	8fb60028 	lw	s6,40(sp)
+   28abc:	8fb50024 	lw	s5,36(sp)
+   28ac0:	8fb40020 	lw	s4,32(sp)
+   28ac4:	8fb3001c 	lw	s3,28(sp)
+   28ac8:	8fb20018 	lw	s2,24(sp)
+   28acc:	8fb10014 	lw	s1,20(sp)
+   28ad0:	8fb00010 	lw	s0,16(sp)
+   28ad4:	03e00008 	jr	ra
+   28ad8:	27bd0030 	addiu	sp,sp,48
+   28adc:	0c00aa06 	jal	2a818 <vfs_inode_trunc>
+   28ae0:	02202021 	addu	a0,s1,zero
+   28ae4:	1040ffd7 	beqz	v0,28a44 <__vfs_open_main+0xf0>
+   28ae8:	ae620000 	sw	v0,0(s3)
+   28aec:	02802021 	addu	a0,s4,zero
+   28af0:	0c00af92 	jal	2be48 <vfs_file_remote_down>
+   28af4:	ae800110 	sw	zero,272(s4)
+   28af8:	02202021 	addu	a0,s1,zero
+   28afc:	8fbf002c 	lw	ra,44(sp)
+   28b00:	8fb60028 	lw	s6,40(sp)
+   28b04:	8fb50024 	lw	s5,36(sp)
+   28b08:	8fb40020 	lw	s4,32(sp)
+   28b0c:	8fb3001c 	lw	s3,28(sp)
+   28b10:	8fb20018 	lw	s2,24(sp)
+   28b14:	8fb10014 	lw	s1,20(sp)
+   28b18:	8fb00010 	lw	s0,16(sp)
+   28b1c:	0800aa79 	j	2a9e4 <vfs_inode_down>
+   28b20:	27bd0030 	addiu	sp,sp,48
+   28b24:	00002821 	addu	a1,zero,zero
+   28b28:	24060002 	addiu	a2,zero,2
+   28b2c:	0c009eaf 	jal	27abc <__vfs_lseek>
+   28b30:	00003821 	addu	a3,zero,zero
+   28b34:	1440ffed 	bnez	v0,28aec <__vfs_open_main+0x198>
+   28b38:	ae620000 	sw	v0,0(s3)
+   28b3c:	0800a28b 	j	28a2c <__vfs_open_main+0xd8>
+   28b40:	00000000 	sll	zero,zero,0x0
+   28b44:	2402000c 	addiu	v0,zero,12
+   28b48:	ae620000 	sw	v0,0(s3)
+   28b4c:	02202021 	addu	a0,s1,zero
+   28b50:	8fbf002c 	lw	ra,44(sp)
+   28b54:	8fb60028 	lw	s6,40(sp)
+   28b58:	8fb50024 	lw	s5,36(sp)
+   28b5c:	8fb40020 	lw	s4,32(sp)
+   28b60:	8fb3001c 	lw	s3,28(sp)
+   28b64:	8fb20018 	lw	s2,24(sp)
+   28b68:	8fb10014 	lw	s1,20(sp)
+   28b6c:	8fb00010 	lw	s0,16(sp)
+   28b70:	0800aa79 	j	2a9e4 <vfs_inode_down>
+   28b74:	27bd0030 	addiu	sp,sp,48
+
+00028b78 <__vfs_open_demarshall>:
+   28b78:	27bdffc0 	addiu	sp,sp,-64
+   28b7c:	afbf003c 	sw	ra,60(sp)
+   28b80:	afbe0038 	sw	s8,56(sp)
+   28b84:	afb40034 	sw	s4,52(sp)
+   28b88:	03a0f021 	addu	s8,sp,zero
+   28b8c:	afb30030 	sw	s3,48(sp)
+   28b90:	afb2002c 	sw	s2,44(sp)
+   28b94:	afb10028 	sw	s1,40(sp)
+   28b98:	afb00024 	sw	s0,36(sp)
+   28b9c:	27bdfff0 	addiu	sp,sp,-16
+   28ba0:	27b40018 	addiu	s4,sp,24
+   28ba4:	27bdff98 	addiu	sp,sp,-104
+   28ba8:	27b00018 	addiu	s0,sp,24
+   28bac:	24050058 	addiu	a1,zero,88
+   28bb0:	2603002c 	addiu	v1,s0,44
+   28bb4:	00808821 	addu	s1,a0,zero
+   28bb8:	26020030 	addiu	v0,s0,48
+   28bbc:	ae050008 	sw	a1,8(s0)
+   28bc0:	8c840000 	lw	a0,0(a0)
+   28bc4:	24050004 	addiu	a1,zero,4
+   28bc8:	ae830000 	sw	v1,0(s4)
+   28bcc:	ae050024 	sw	a1,36(s0)
+   28bd0:	ae820004 	sw	v0,4(s4)
+   28bd4:	24050028 	addiu	a1,zero,40
+   28bd8:	0c009ea4 	jal	27a90 <__vfs_lseek_+0x5c>
+   28bdc:	ae050028 	sw	a1,40(s0)
+   28be0:	8e870004 	lw	a3,4(s4)
+   28be4:	8e860000 	lw	a2,0(s4)
+   28be8:	02202021 	addu	a0,s1,zero
+   28bec:	00002821 	addu	a1,zero,zero
+   28bf0:	8e320000 	lw	s2,0(s1)
+   28bf4:	afc6001c 	sw	a2,28(s8)
+   28bf8:	afc70018 	sw	a3,24(s8)
+   28bfc:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28c00:	00409821 	addu	s3,v0,zero
+   28c04:	0040a021 	addu	s4,v0,zero
+   28c08:	02202021 	addu	a0,s1,zero
+   28c0c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   28c10:	24050001 	addiu	a1,zero,1
+   28c14:	afb40010 	sw	s4,16(sp)
+   28c18:	8c420000 	lw	v0,0(v0)
+   28c1c:	8fc6001c 	lw	a2,28(s8)
+   28c20:	8fc70018 	lw	a3,24(s8)
+   28c24:	3264ffff 	andi	a0,s3,0xffff
+   28c28:	02402821 	addu	a1,s2,zero
+   28c2c:	0c00a255 	jal	28954 <__vfs_open_main>
+   28c30:	afa20014 	sw	v0,20(sp)
+   28c34:	02202021 	addu	a0,s1,zero
+   28c38:	02002821 	addu	a1,s0,zero
+   28c3c:	24060058 	addiu	a2,zero,88
+   28c40:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   28c44:	24070002 	addiu	a3,zero,2
+   28c48:	03c0e821 	addu	sp,s8,zero
+   28c4c:	8fbf003c 	lw	ra,60(sp)
+   28c50:	8fbe0038 	lw	s8,56(sp)
+   28c54:	8fb40034 	lw	s4,52(sp)
+   28c58:	8fb30030 	lw	s3,48(sp)
+   28c5c:	8fb2002c 	lw	s2,44(sp)
+   28c60:	8fb10028 	lw	s1,40(sp)
+   28c64:	8fb00024 	lw	s0,36(sp)
+   28c68:	03e00008 	jr	ra
+   28c6c:	27bd0040 	addiu	sp,sp,64
+
+00028c70 <__vfs_open_local>:
+   28c70:	27bdffe0 	addiu	sp,sp,-32
+   28c74:	afbf001c 	sw	ra,28(sp)
+   28c78:	00804821 	addu	t1,a0,zero
+   28c7c:	00a04021 	addu	t0,a1,zero
+   28c80:	00c01821 	addu	v1,a2,zero
+   28c84:	40057801 	mfc0	a1,$15,1
+   28c88:	3c020004 	lui	v0,0x4
+   28c8c:	2444c960 	addiu	a0,v0,-13984
+   28c90:	88840003 	lwl	a0,3(a0)
+   28c94:	30a50003 	andi	a1,a1,0x3
+   28c98:	3c060004 	lui	a2,0x4
+   28c9c:	24c6c950 	addiu	a2,a2,-14000
+   28ca0:	00052880 	sll	a1,a1,0x2
+   28ca4:	9844c960 	lwr	a0,-13984(v0)
+   28ca8:	00a62821 	addu	a1,a1,a2
+   28cac:	8ce20000 	lw	v0,0(a3)
+   28cb0:	8ca50000 	lw	a1,0(a1)
+   28cb4:	3084ffff 	andi	a0,a0,0xffff
+   28cb8:	01203021 	addu	a2,t1,zero
+   28cbc:	01003821 	addu	a3,t0,zero
+   28cc0:	afa30010 	sw	v1,16(sp)
+   28cc4:	0c00a255 	jal	28954 <__vfs_open_main>
+   28cc8:	afa20014 	sw	v0,20(sp)
+   28ccc:	8fbf001c 	lw	ra,28(sp)
+   28cd0:	03e00008 	jr	ra
+   28cd4:	27bd0020 	addiu	sp,sp,32
+
+00028cd8 <vfs_chmod>:
+   28cd8:	27bdff68 	addiu	sp,sp,-152
+   28cdc:	afbe0090 	sw	s8,144(sp)
+   28ce0:	afb7008c 	sw	s7,140(sp)
+   28ce4:	afb60088 	sw	s6,136(sp)
+   28ce8:	afb50084 	sw	s5,132(sp)
+   28cec:	afb40080 	sw	s4,128(sp)
+   28cf0:	afb3007c 	sw	s3,124(sp)
+   28cf4:	afb20078 	sw	s2,120(sp)
+   28cf8:	afb10074 	sw	s1,116(sp)
+   28cfc:	afb00070 	sw	s0,112(sp)
+   28d00:	afbf0094 	sw	ra,148(sp)
+   28d04:	3c110004 	lui	s1,0x4
+   28d08:	afa600a0 	sw	a2,160(sp)
+   28d0c:	0080f021 	addu	s8,a0,zero
+   28d10:	00a0b821 	addu	s7,a1,zero
+   28d14:	27b20050 	addiu	s2,sp,80
+   28d18:	24100004 	addiu	s0,zero,4
+   28d1c:	27b6002c 	addiu	s6,sp,44
+   28d20:	27b50028 	addiu	s5,sp,40
+   28d24:	27b400a0 	addiu	s4,sp,160
+   28d28:	0800a36e 	j	28db8 <vfs_chmod+0xe0>
+   28d2c:	24130002 	addiu	s3,zero,2
+   28d30:	40047801 	mfc0	a0,$15,1
+   28d34:	afa3006c 	sw	v1,108(sp)
+   28d38:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   28d3c:	afa40068 	sw	a0,104(sp)
+   28d40:	8fa3006c 	lw	v1,108(sp)
+   28d44:	8fa40068 	lw	a0,104(sp)
+   28d48:	70432802 	mul	a1,v0,v1
+   28d4c:	30840003 	andi	a0,a0,0x3
+   28d50:	27a20030 	addiu	v0,sp,48
+   28d54:	27a30038 	addiu	v1,sp,56
+   28d58:	3c070003 	lui	a3,0x3
+   28d5c:	00a42021 	addu	a0,a1,a0
+   28d60:	afa20018 	sw	v0,24(sp)
+   28d64:	afa3001c 	sw	v1,28(sp)
+   28d68:	27a20040 	addiu	v0,sp,64
+   28d6c:	27a30048 	addiu	v1,sp,72
+   28d70:	24050001 	addiu	a1,zero,1
+   28d74:	00003021 	addu	a2,zero,zero
+   28d78:	24e7831c 	addiu	a3,a3,-31972
+   28d7c:	afa30024 	sw	v1,36(sp)
+   28d80:	afb30010 	sw	s3,16(sp)
+   28d84:	afb30014 	sw	s3,20(sp)
+   28d88:	0c003de8 	jal	f7a0 <rppc_generic>
+   28d8c:	afa20020 	sw	v0,32(sp)
+   28d90:	00401821 	addu	v1,v0,zero
+   28d94:	8fa2002c 	lw	v0,44(sp)
+   28d98:	1440002a 	bnez	v0,28e44 <vfs_chmod+0x16c>
+   28d9c:	8fbf0094 	lw	ra,148(sp)
+   28da0:	14600033 	bnez	v1,28e70 <vfs_chmod+0x198>
+   28da4:	8fbf0094 	lw	ra,148(sp)
+   28da8:	8fa30028 	lw	v1,40(sp)
+   28dac:	30630008 	andi	v1,v1,0x8
+   28db0:	10600024 	beqz	v1,28e44 <vfs_chmod+0x16c>
+   28db4:	00000000 	sll	zero,zero,0x0
+   28db8:	8fa700a0 	lw	a3,160(sp)
+   28dbc:	02e02021 	addu	a0,s7,zero
+   28dc0:	03c02821 	addu	a1,s8,zero
+   28dc4:	00003021 	addu	a2,zero,zero
+   28dc8:	afa00028 	sw	zero,40(sp)
+   28dcc:	afb00010 	sw	s0,16(sp)
+   28dd0:	0c00b85a 	jal	2e168 <vfs_lookup>
+   28dd4:	afb20014 	sw	s2,20(sp)
+   28dd8:	14400019 	bnez	v0,28e40 <vfs_chmod+0x168>
+   28ddc:	2404000c 	addiu	a0,zero,12
+   28de0:	3c030004 	lui	v1,0x4
+   28de4:	2463c960 	addiu	v1,v1,-13984
+   28de8:	88620003 	lwl	v0,3(v1)
+   28dec:	97a30054 	lhu	v1,84(sp)
+   28df0:	9a22c960 	lwr	v0,-13984(s1)
+   28df4:	3042ffff 	andi	v0,v0,0xffff
+   28df8:	afa0002c 	sw	zero,44(sp)
+   28dfc:	afb60030 	sw	s6,48(sp)
+   28e00:	afb50034 	sw	s5,52(sp)
+   28e04:	afb00038 	sw	s0,56(sp)
+   28e08:	afb0003c 	sw	s0,60(sp)
+   28e0c:	afb20040 	sw	s2,64(sp)
+   28e10:	afb40044 	sw	s4,68(sp)
+   28e14:	afa40048 	sw	a0,72(sp)
+   28e18:	1462ffc5 	bne	v1,v0,28d30 <vfs_chmod+0x58>
+   28e1c:	afb0004c 	sw	s0,76(sp)
+   28e20:	02c02021 	addu	a0,s6,zero
+   28e24:	02a02821 	addu	a1,s5,zero
+   28e28:	02403021 	addu	a2,s2,zero
+   28e2c:	0c00a104 	jal	28410 <__vfs_chmod_local>
+   28e30:	02803821 	addu	a3,s4,zero
+   28e34:	8fa2002c 	lw	v0,44(sp)
+   28e38:	1040ffd9 	beqz	v0,28da0 <vfs_chmod+0xc8>
+   28e3c:	00001821 	addu	v1,zero,zero
+   28e40:	8fbf0094 	lw	ra,148(sp)
+   28e44:	8fbe0090 	lw	s8,144(sp)
+   28e48:	8fb7008c 	lw	s7,140(sp)
+   28e4c:	8fb60088 	lw	s6,136(sp)
+   28e50:	8fb50084 	lw	s5,132(sp)
+   28e54:	8fb40080 	lw	s4,128(sp)
+   28e58:	8fb3007c 	lw	s3,124(sp)
+   28e5c:	8fb20078 	lw	s2,120(sp)
+   28e60:	8fb10074 	lw	s1,116(sp)
+   28e64:	8fb00070 	lw	s0,112(sp)
+   28e68:	03e00008 	jr	ra
+   28e6c:	27bd0098 	addiu	sp,sp,152
+   28e70:	00601021 	addu	v0,v1,zero
+   28e74:	8fbe0090 	lw	s8,144(sp)
+   28e78:	8fb7008c 	lw	s7,140(sp)
+   28e7c:	8fb60088 	lw	s6,136(sp)
+   28e80:	8fb50084 	lw	s5,132(sp)
+   28e84:	8fb40080 	lw	s4,128(sp)
+   28e88:	8fb3007c 	lw	s3,124(sp)
+   28e8c:	8fb20078 	lw	s2,120(sp)
+   28e90:	8fb10074 	lw	s1,116(sp)
+   28e94:	8fb00070 	lw	s0,112(sp)
+   28e98:	03e00008 	jr	ra
+   28e9c:	27bd0098 	addiu	sp,sp,152
+
+00028ea0 <__vfs_unlink>:
+   28ea0:	27bdff10 	addiu	sp,sp,-240
+   28ea4:	afa400f0 	sw	a0,240(sp)
+   28ea8:	27a2002c 	addiu	v0,sp,44
+   28eac:	27a40074 	addiu	a0,sp,116
+   28eb0:	00003821 	addu	a3,zero,zero
+   28eb4:	afbf00ec 	sw	ra,236(sp)
+   28eb8:	afbe00e8 	sw	s8,232(sp)
+   28ebc:	afb700e4 	sw	s7,228(sp)
+   28ec0:	afb600e0 	sw	s6,224(sp)
+   28ec4:	afb500dc 	sw	s5,220(sp)
+   28ec8:	afb400d8 	sw	s4,216(sp)
+   28ecc:	afb300d4 	sw	s3,212(sp)
+   28ed0:	afb200d0 	sw	s2,208(sp)
+   28ed4:	afb100cc 	sw	s1,204(sp)
+   28ed8:	afb000c8 	sw	s0,200(sp)
+   28edc:	afa20010 	sw	v0,16(sp)
+   28ee0:	0c00b7ef 	jal	2dfbc <vfs_lookup_path_init>
+   28ee4:	afa600f8 	sw	a2,248(sp)
+   28ee8:	8fa4002c 	lw	a0,44(sp)
+   28eec:	8fa30084 	lw	v1,132(sp)
+   28ef0:	00042080 	sll	a0,a0,0x2
+   28ef4:	00642021 	addu	a0,v1,a0
+   28ef8:	8c840000 	lw	a0,0(a0)
+   28efc:	afa20030 	sw	v0,48(sp)
+   28f00:	80820000 	lb	v0,0(a0)
+   28f04:	2405002e 	addiu	a1,zero,46
+   28f08:	10450063 	beq	v0,a1,29098 <__vfs_unlink+0x1f8>
+   28f0c:	00000000 	sll	zero,zero,0x0
+   28f10:	8c620000 	lw	v0,0(v1)
+   28f14:	2403002f 	addiu	v1,zero,47
+   28f18:	80440000 	lb	a0,0(v0)
+   28f1c:	10830064 	beq	a0,v1,290b0 <__vfs_unlink+0x210>
+   28f20:	3c100004 	lui	s0,0x4
+   28f24:	27b3005c 	addiu	s3,sp,92
+   28f28:	27b60030 	addiu	s6,sp,48
+   28f2c:	27b50028 	addiu	s5,sp,40
+   28f30:	27b400f8 	addiu	s4,sp,248
+   28f34:	261ec960 	addiu	s8,s0,-13984
+   28f38:	24110004 	addiu	s1,zero,4
+   28f3c:	2417000c 	addiu	s7,zero,12
+   28f40:	8fa400f0 	lw	a0,240(sp)
+   28f44:	27a50074 	addiu	a1,sp,116
+   28f48:	24060020 	addiu	a2,zero,32
+   28f4c:	0c00b794 	jal	2de50 <vfs_lookup_path>
+   28f50:	02603821 	addu	a3,s3,zero
+   28f54:	14400041 	bnez	v0,2905c <__vfs_unlink+0x1bc>
+   28f58:	afa20030 	sw	v0,48(sp)
+   28f5c:	8fa20078 	lw	v0,120(sp)
+   28f60:	0800a3f8 	j	28fe0 <__vfs_unlink+0x140>
+   28f64:	8c520000 	lw	s2,0(v0)
+   28f68:	40047801 	mfc0	a0,$15,1
+   28f6c:	afa300c4 	sw	v1,196(sp)
+   28f70:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   28f74:	afa400c0 	sw	a0,192(sp)
+   28f78:	8fa300c4 	lw	v1,196(sp)
+   28f7c:	8fa400c0 	lw	a0,192(sp)
+   28f80:	70432802 	mul	a1,v0,v1
+   28f84:	24020002 	addiu	v0,zero,2
+   28f88:	afa20010 	sw	v0,16(sp)
+   28f8c:	24020003 	addiu	v0,zero,3
+   28f90:	afa20014 	sw	v0,20(sp)
+   28f94:	27a20034 	addiu	v0,sp,52
+   28f98:	afa20018 	sw	v0,24(sp)
+   28f9c:	27a2003c 	addiu	v0,sp,60
+   28fa0:	afa2001c 	sw	v0,28(sp)
+   28fa4:	30840003 	andi	a0,a0,0x3
+   28fa8:	27a20044 	addiu	v0,sp,68
+   28fac:	3c070003 	lui	a3,0x3
+   28fb0:	00a42021 	addu	a0,a1,a0
+   28fb4:	afa20020 	sw	v0,32(sp)
+   28fb8:	24050001 	addiu	a1,zero,1
+   28fbc:	27a20050 	addiu	v0,sp,80
+   28fc0:	00003021 	addu	a2,zero,zero
+   28fc4:	24e785bc 	addiu	a3,a3,-31300
+   28fc8:	0c003de8 	jal	f7a0 <rppc_generic>
+   28fcc:	afa20024 	sw	v0,36(sp)
+   28fd0:	8fa20028 	lw	v0,40(sp)
+   28fd4:	30430010 	andi	v1,v0,0x10
+   28fd8:	1060001e 	beqz	v1,29054 <__vfs_unlink+0x1b4>
+   28fdc:	30420008 	andi	v0,v0,0x8
+   28fe0:	02402021 	addu	a0,s2,zero
+   28fe4:	afb60034 	sw	s6,52(sp)
+   28fe8:	afb50038 	sw	s5,56(sp)
+   28fec:	afb1003c 	sw	s1,60(sp)
+   28ff0:	afb10040 	sw	s1,64(sp)
+   28ff4:	afb30044 	sw	s3,68(sp)
+   28ff8:	afb20048 	sw	s2,72(sp)
+   28ffc:	0c00c4d1 	jal	31344 <strlen>
+   29000:	afb4004c 	sw	s4,76(sp)
+   29004:	8bc40003 	lwl	a0,3(s8)
+   29008:	97a30060 	lhu	v1,96(sp)
+   2900c:	9a04c960 	lwr	a0,-13984(s0)
+   29010:	24420001 	addiu	v0,v0,1
+   29014:	3084ffff 	andi	a0,a0,0xffff
+   29018:	afa20054 	sw	v0,84(sp)
+   2901c:	afb70050 	sw	s7,80(sp)
+   29020:	1464ffd1 	bne	v1,a0,28f68 <__vfs_unlink+0xc8>
+   29024:	afb10058 	sw	s1,88(sp)
+   29028:	02c02021 	addu	a0,s6,zero
+   2902c:	02a02821 	addu	a1,s5,zero
+   29030:	02603021 	addu	a2,s3,zero
+   29034:	02403821 	addu	a3,s2,zero
+   29038:	0c00a1b3 	jal	286cc <__vfs_delete_dirent_local>
+   2903c:	afb40010 	sw	s4,16(sp)
+   29040:	8fa20028 	lw	v0,40(sp)
+   29044:	30430010 	andi	v1,v0,0x10
+   29048:	1460ffe6 	bnez	v1,28fe4 <__vfs_unlink+0x144>
+   2904c:	02402021 	addu	a0,s2,zero
+   29050:	30420008 	andi	v0,v0,0x8
+   29054:	1440ffbb 	bnez	v0,28f44 <__vfs_unlink+0xa4>
+   29058:	8fa400f0 	lw	a0,240(sp)
+   2905c:	0c00b430 	jal	2d0c0 <vfs_lookup_path_put>
+   29060:	27a40074 	addiu	a0,sp,116
+   29064:	8fbf00ec 	lw	ra,236(sp)
+   29068:	8fa20030 	lw	v0,48(sp)
+   2906c:	8fbe00e8 	lw	s8,232(sp)
+   29070:	8fb700e4 	lw	s7,228(sp)
+   29074:	8fb600e0 	lw	s6,224(sp)
+   29078:	8fb500dc 	lw	s5,220(sp)
+   2907c:	8fb400d8 	lw	s4,216(sp)
+   29080:	8fb300d4 	lw	s3,212(sp)
+   29084:	8fb200d0 	lw	s2,208(sp)
+   29088:	8fb100cc 	lw	s1,204(sp)
+   2908c:	8fb000c8 	lw	s0,200(sp)
+   29090:	03e00008 	jr	ra
+   29094:	27bd00f0 	addiu	sp,sp,240
+   29098:	80840001 	lb	a0,1(a0)
+   2909c:	1480000a 	bnez	a0,290c8 <__vfs_unlink+0x228>
+   290a0:	00000000 	sll	zero,zero,0x0
+   290a4:	24020016 	addiu	v0,zero,22
+   290a8:	0800a417 	j	2905c <__vfs_unlink+0x1bc>
+   290ac:	afa20030 	sw	v0,48(sp)
+   290b0:	80420001 	lb	v0,1(v0)
+   290b4:	1440ff9b 	bnez	v0,28f24 <__vfs_unlink+0x84>
+   290b8:	00000000 	sll	zero,zero,0x0
+   290bc:	24020010 	addiu	v0,zero,16
+   290c0:	0800a417 	j	2905c <__vfs_unlink+0x1bc>
+   290c4:	afa20030 	sw	v0,48(sp)
+   290c8:	1482ff91 	bne	a0,v0,28f10 <__vfs_unlink+0x70>
+   290cc:	24020027 	addiu	v0,zero,39
+   290d0:	0800a417 	j	2905c <__vfs_unlink+0x1bc>
+   290d4:	afa20030 	sw	v0,48(sp)
+
+000290d8 <vfs_rmdir>:
+   290d8:	0800a3a8 	j	28ea0 <__vfs_unlink>
+   290dc:	24060001 	addiu	a2,zero,1
+
+000290e0 <vfs_unlink>:
+   290e0:	0800a3a8 	j	28ea0 <__vfs_unlink>
+   290e4:	00003021 	addu	a2,zero,zero
+
+000290e8 <vfs_get_path>:
+   290e8:	27bdff40 	addiu	sp,sp,-192
+   290ec:	3c020022 	lui	v0,0x22
+   290f0:	afb00098 	sw	s0,152(sp)
+   290f4:	34420040 	ori	v0,v0,0x40
+   290f8:	00808021 	addu	s0,a0,zero
+   290fc:	27a40058 	addiu	a0,sp,88
+   29100:	afbf00bc 	sw	ra,188(sp)
+   29104:	afbe00b8 	sw	s8,184(sp)
+   29108:	afb700b4 	sw	s7,180(sp)
+   2910c:	afb600b0 	sw	s6,176(sp)
+   29110:	afb500ac 	sw	s5,172(sp)
+   29114:	afb400a8 	sw	s4,168(sp)
+   29118:	afb300a4 	sw	s3,164(sp)
+   2911c:	afb200a0 	sw	s2,160(sp)
+   29120:	afb1009c 	sw	s1,156(sp)
+   29124:	afa20060 	sw	v0,96(sp)
+   29128:	afa500c4 	sw	a1,196(sp)
+   2912c:	afa00058 	sw	zero,88(sp)
+   29130:	0c00713f 	jal	1c4fc <kmem_alloc>
+   29134:	afa0005c 	sw	zero,92(sp)
+   29138:	10400094 	beqz	v0,2938c <vfs_get_path+0x2a4>
+   2913c:	afa20088 	sw	v0,136(sp)
+   29140:	8fa40088 	lw	a0,136(sp)
+   29144:	0c007c15 	jal	1f054 <ppm_page2addr>
+   29148:	3c110004 	lui	s1,0x4
+   2914c:	24030fff 	addiu	v1,zero,4095
+   29150:	afa30038 	sw	v1,56(sp)
+   29154:	afa20034 	sw	v0,52(sp)
+   29158:	a0400fff 	sb	zero,4095(v0)
+   2915c:	8e020018 	lw	v0,24(s0)
+   29160:	9603001c 	lhu	v1,28(s0)
+   29164:	afa2002c 	sw	v0,44(sp)
+   29168:	afa0003c 	sw	zero,60(sp)
+   2916c:	afa00030 	sw	zero,48(sp)
+   29170:	a7a30028 	sh	v1,40(sp)
+   29174:	24130001 	addiu	s3,zero,1
+   29178:	27be003c 	addiu	s8,sp,60
+   2917c:	27b20030 	addiu	s2,sp,48
+   29180:	27b70028 	addiu	s7,sp,40
+   29184:	27b6002c 	addiu	s6,sp,44
+   29188:	27b50034 	addiu	s5,sp,52
+   2918c:	27b40038 	addiu	s4,sp,56
+   29190:	0800a492 	j	29248 <vfs_get_path+0x160>
+   29194:	24100004 	addiu	s0,zero,4
+   29198:	40047801 	mfc0	a0,$15,1
+   2919c:	afa30090 	sw	v1,144(sp)
+   291a0:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   291a4:	afa4008c 	sw	a0,140(sp)
+   291a8:	8fa30090 	lw	v1,144(sp)
+   291ac:	8fa4008c 	lw	a0,140(sp)
+   291b0:	70432802 	mul	a1,v0,v1
+   291b4:	24020003 	addiu	v0,zero,3
+   291b8:	afa20010 	sw	v0,16(sp)
+   291bc:	27a30040 	addiu	v1,sp,64
+   291c0:	27a2004c 	addiu	v0,sp,76
+   291c4:	30840003 	andi	a0,a0,0x3
+   291c8:	3c070003 	lui	a3,0x3
+   291cc:	00a42021 	addu	a0,a1,a0
+   291d0:	afa30018 	sw	v1,24(sp)
+   291d4:	24050001 	addiu	a1,zero,1
+   291d8:	27a30068 	addiu	v1,sp,104
+   291dc:	afa2001c 	sw	v0,28(sp)
+   291e0:	00003021 	addu	a2,zero,zero
+   291e4:	27a20078 	addiu	v0,sp,120
+   291e8:	24e78000 	addiu	a3,a3,-32768
+   291ec:	afa30020 	sw	v1,32(sp)
+   291f0:	afb00014 	sw	s0,20(sp)
+   291f4:	0c003de8 	jal	f7a0 <rppc_generic>
+   291f8:	afa20024 	sw	v0,36(sp)
+   291fc:	00401821 	addu	v1,v0,zero
+   29200:	8fa2003c 	lw	v0,60(sp)
+   29204:	8fa40038 	lw	a0,56(sp)
+   29208:	24420001 	addiu	v0,v0,1
+   2920c:	8fa50034 	lw	a1,52(sp)
+   29210:	00822023 	subu	a0,a0,v0
+   29214:	00a42821 	addu	a1,a1,a0
+   29218:	afa40038 	sw	a0,56(sp)
+   2921c:	2404002f 	addiu	a0,zero,47
+   29220:	afa2003c 	sw	v0,60(sp)
+   29224:	afa0002c 	sw	zero,44(sp)
+   29228:	a0a40000 	sb	a0,0(a1)
+   2922c:	02629821 	addu	s3,s3,v0
+   29230:	8fa20030 	lw	v0,48(sp)
+   29234:	10400031 	beqz	v0,292fc <vfs_get_path+0x214>
+   29238:	8fa500c4 	lw	a1,196(sp)
+   2923c:	1460002f 	bnez	v1,292fc <vfs_get_path+0x214>
+   29240:	8fa500c4 	lw	a1,196(sp)
+   29244:	97a30028 	lhu	v1,40(sp)
+   29248:	3c040004 	lui	a0,0x4
+   2924c:	2484c960 	addiu	a0,a0,-13984
+   29250:	88820003 	lwl	v0,3(a0)
+   29254:	24050002 	addiu	a1,zero,2
+   29258:	9a22c960 	lwr	v0,-13984(s1)
+   2925c:	afbe0040 	sw	s8,64(sp)
+   29260:	3042ffff 	andi	v0,v0,0xffff
+   29264:	afb20044 	sw	s2,68(sp)
+   29268:	afb70048 	sw	s7,72(sp)
+   2926c:	afb0004c 	sw	s0,76(sp)
+   29270:	afb00050 	sw	s0,80(sp)
+   29274:	afa50054 	sw	a1,84(sp)
+   29278:	afb60068 	sw	s6,104(sp)
+   2927c:	afb2006c 	sw	s2,108(sp)
+   29280:	afb50070 	sw	s5,112(sp)
+   29284:	afb40074 	sw	s4,116(sp)
+   29288:	afb00078 	sw	s0,120(sp)
+   2928c:	afb0007c 	sw	s0,124(sp)
+   29290:	afb00080 	sw	s0,128(sp)
+   29294:	1443ffc0 	bne	v0,v1,29198 <vfs_get_path+0xb0>
+   29298:	afb00084 	sw	s0,132(sp)
+   2929c:	03c02021 	addu	a0,s8,zero
+   292a0:	02402821 	addu	a1,s2,zero
+   292a4:	02e03021 	addu	a2,s7,zero
+   292a8:	02c03821 	addu	a3,s6,zero
+   292ac:	afb20010 	sw	s2,16(sp)
+   292b0:	afb50014 	sw	s5,20(sp)
+   292b4:	0c00a084 	jal	28210 <__vfs_get_name_local>
+   292b8:	afb40018 	sw	s4,24(sp)
+   292bc:	8fa2003c 	lw	v0,60(sp)
+   292c0:	8fa40038 	lw	a0,56(sp)
+   292c4:	24420001 	addiu	v0,v0,1
+   292c8:	8fa50034 	lw	a1,52(sp)
+   292cc:	00822023 	subu	a0,a0,v0
+   292d0:	00a42821 	addu	a1,a1,a0
+   292d4:	afa40038 	sw	a0,56(sp)
+   292d8:	2404002f 	addiu	a0,zero,47
+   292dc:	afa2003c 	sw	v0,60(sp)
+   292e0:	afa0002c 	sw	zero,44(sp)
+   292e4:	a0a40000 	sb	a0,0(a1)
+   292e8:	02629821 	addu	s3,s3,v0
+   292ec:	8fa20030 	lw	v0,48(sp)
+   292f0:	1440ffd2 	bnez	v0,2923c <vfs_get_path+0x154>
+   292f4:	00001821 	addu	v1,zero,zero
+   292f8:	8fa500c4 	lw	a1,196(sp)
+   292fc:	afa30090 	sw	v1,144(sp)
+   29300:	8ca20018 	lw	v0,24(a1)
+   29304:	0040f809 	jalr	v0
+   29308:	00a02021 	addu	a0,a1,zero
+   2930c:	0053102b 	sltu	v0,v0,s3
+   29310:	1440001c 	bnez	v0,29384 <vfs_get_path+0x29c>
+   29314:	8fa30090 	lw	v1,144(sp)
+   29318:	14600029 	bnez	v1,293c0 <vfs_get_path+0x2d8>
+   2931c:	8fa50034 	lw	a1,52(sp)
+   29320:	8fa300c4 	lw	v1,196(sp)
+   29324:	8c620008 	lw	v0,8(v1)
+   29328:	8fa30038 	lw	v1,56(sp)
+   2932c:	8fa400c4 	lw	a0,196(sp)
+   29330:	00a32821 	addu	a1,a1,v1
+   29334:	0040f809 	jalr	v0
+   29338:	02603021 	addu	a2,s3,zero
+   2933c:	8fa50088 	lw	a1,136(sp)
+   29340:	27a40058 	addiu	a0,sp,88
+   29344:	afa2008c 	sw	v0,140(sp)
+   29348:	0c007134 	jal	1c4d0 <kmem_free>
+   2934c:	afa50064 	sw	a1,100(sp)
+   29350:	8fbf00bc 	lw	ra,188(sp)
+   29354:	8fa2008c 	lw	v0,140(sp)
+   29358:	8fbe00b8 	lw	s8,184(sp)
+   2935c:	8fb700b4 	lw	s7,180(sp)
+   29360:	8fb600b0 	lw	s6,176(sp)
+   29364:	8fb500ac 	lw	s5,172(sp)
+   29368:	8fb400a8 	lw	s4,168(sp)
+   2936c:	8fb300a4 	lw	s3,164(sp)
+   29370:	8fb200a0 	lw	s2,160(sp)
+   29374:	8fb1009c 	lw	s1,156(sp)
+   29378:	8fb00098 	lw	s0,152(sp)
+   2937c:	03e00008 	jr	ra
+   29380:	27bd00c0 	addiu	sp,sp,192
+   29384:	0800a4cf 	j	2933c <vfs_get_path+0x254>
+   29388:	24020022 	addiu	v0,zero,34
+   2938c:	8fbf00bc 	lw	ra,188(sp)
+   29390:	2402000c 	addiu	v0,zero,12
+   29394:	8fbe00b8 	lw	s8,184(sp)
+   29398:	8fb700b4 	lw	s7,180(sp)
+   2939c:	8fb600b0 	lw	s6,176(sp)
+   293a0:	8fb500ac 	lw	s5,172(sp)
+   293a4:	8fb400a8 	lw	s4,168(sp)
+   293a8:	8fb300a4 	lw	s3,164(sp)
+   293ac:	8fb200a0 	lw	s2,160(sp)
+   293b0:	8fb1009c 	lw	s1,156(sp)
+   293b4:	8fb00098 	lw	s0,152(sp)
+   293b8:	03e00008 	jr	ra
+   293bc:	27bd00c0 	addiu	sp,sp,192
+   293c0:	0800a4cf 	j	2933c <vfs_get_path+0x254>
+   293c4:	00601021 	addu	v0,v1,zero
+
+000293c8 <vfs_open>:
+   293c8:	27bdff48 	addiu	sp,sp,-184
+   293cc:	afbe00b0 	sw	s8,176(sp)
+   293d0:	afb700ac 	sw	s7,172(sp)
+   293d4:	afb600a8 	sw	s6,168(sp)
+   293d8:	afb500a4 	sw	s5,164(sp)
+   293dc:	afb400a0 	sw	s4,160(sp)
+   293e0:	afb20098 	sw	s2,152(sp)
+   293e4:	afb10094 	sw	s1,148(sp)
+   293e8:	afbf00b4 	sw	ra,180(sp)
+   293ec:	afb3009c 	sw	s3,156(sp)
+   293f0:	afb00090 	sw	s0,144(sp)
+   293f4:	3c110004 	lui	s1,0x4
+   293f8:	afa600c0 	sw	a2,192(sp)
+   293fc:	afa400b8 	sw	a0,184(sp)
+   29400:	afa500bc 	sw	a1,188(sp)
+   29404:	afa700c4 	sw	a3,196(sp)
+   29408:	27b4004c 	addiu	s4,sp,76
+   2940c:	24120004 	addiu	s2,zero,4
+   29410:	27be0028 	addiu	s8,sp,40
+   29414:	27b70064 	addiu	s7,sp,100
+   29418:	27b600c0 	addiu	s6,sp,192
+   2941c:	0800a527 	j	2949c <vfs_open+0xd4>
+   29420:	24150002 	addiu	s5,zero,2
+   29424:	40107801 	mfc0	s0,$15,1
+   29428:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2942c:	00000000 	sll	zero,zero,0x0
+   29430:	70531802 	mul	v1,v0,s3
+   29434:	32040003 	andi	a0,s0,0x3
+   29438:	00642021 	addu	a0,v1,a0
+   2943c:	27a2002c 	addiu	v0,sp,44
+   29440:	27a30034 	addiu	v1,sp,52
+   29444:	3c070003 	lui	a3,0x3
+   29448:	afa20018 	sw	v0,24(sp)
+   2944c:	afa3001c 	sw	v1,28(sp)
+   29450:	27a2003c 	addiu	v0,sp,60
+   29454:	27a30044 	addiu	v1,sp,68
+   29458:	24050001 	addiu	a1,zero,1
+   2945c:	00003021 	addu	a2,zero,zero
+   29460:	24e78b78 	addiu	a3,a3,-29832
+   29464:	afb50010 	sw	s5,16(sp)
+   29468:	afb50014 	sw	s5,20(sp)
+   2946c:	afa20020 	sw	v0,32(sp)
+   29470:	0c003de8 	jal	f7a0 <rppc_generic>
+   29474:	afa30024 	sw	v1,36(sp)
+   29478:	8fb00028 	lw	s0,40(sp)
+   2947c:	1600002b 	bnez	s0,2952c <vfs_open+0x164>
+   29480:	8fbf00b4 	lw	ra,180(sp)
+   29484:	14400060 	bnez	v0,29608 <vfs_open+0x240>
+   29488:	8fbf00b4 	lw	ra,180(sp)
+   2948c:	8fa2006c 	lw	v0,108(sp)
+   29490:	30420008 	andi	v0,v0,0x8
+   29494:	10400031 	beqz	v0,2955c <vfs_open+0x194>
+   29498:	8fa40074 	lw	a0,116(sp)
+   2949c:	8fa400b8 	lw	a0,184(sp)
+   294a0:	8fa600c0 	lw	a2,192(sp)
+   294a4:	8fa500bc 	lw	a1,188(sp)
+   294a8:	8fa700c4 	lw	a3,196(sp)
+   294ac:	afb20010 	sw	s2,16(sp)
+   294b0:	0c00b85a 	jal	2e168 <vfs_lookup>
+   294b4:	afb40014 	sw	s4,20(sp)
+   294b8:	1440001b 	bnez	v0,29528 <vfs_open+0x160>
+   294bc:	00408021 	addu	s0,v0,zero
+   294c0:	3c030004 	lui	v1,0x4
+   294c4:	2463c960 	addiu	v1,v1,-13984
+   294c8:	88620003 	lwl	v0,3(v1)
+   294cc:	97b30050 	lhu	s3,80(sp)
+   294d0:	9a22c960 	lwr	v0,-13984(s1)
+   294d4:	24060028 	addiu	a2,zero,40
+   294d8:	2403000c 	addiu	v1,zero,12
+   294dc:	3042ffff 	andi	v0,v0,0xffff
+   294e0:	afa00028 	sw	zero,40(sp)
+   294e4:	afbe002c 	sw	s8,44(sp)
+   294e8:	afb70030 	sw	s7,48(sp)
+   294ec:	afb20034 	sw	s2,52(sp)
+   294f0:	afa60038 	sw	a2,56(sp)
+   294f4:	afb4003c 	sw	s4,60(sp)
+   294f8:	afb60040 	sw	s6,64(sp)
+   294fc:	afa30044 	sw	v1,68(sp)
+   29500:	1662ffc8 	bne	s3,v0,29424 <vfs_open+0x5c>
+   29504:	afb20048 	sw	s2,72(sp)
+   29508:	03c02021 	addu	a0,s8,zero
+   2950c:	02e02821 	addu	a1,s7,zero
+   29510:	02803021 	addu	a2,s4,zero
+   29514:	0c00a31c 	jal	28c70 <__vfs_open_local>
+   29518:	02c03821 	addu	a3,s6,zero
+   2951c:	8fb00028 	lw	s0,40(sp)
+   29520:	1200ffd8 	beqz	s0,29484 <vfs_open+0xbc>
+   29524:	00001021 	addu	v0,zero,zero
+   29528:	8fbf00b4 	lw	ra,180(sp)
+   2952c:	02001021 	addu	v0,s0,zero
+   29530:	8fbe00b0 	lw	s8,176(sp)
+   29534:	8fb700ac 	lw	s7,172(sp)
+   29538:	8fb600a8 	lw	s6,168(sp)
+   2953c:	8fb500a4 	lw	s5,164(sp)
+   29540:	8fb400a0 	lw	s4,160(sp)
+   29544:	8fb3009c 	lw	s3,156(sp)
+   29548:	8fb20098 	lw	s2,152(sp)
+   2954c:	8fb10094 	lw	s1,148(sp)
+   29550:	8fb00090 	lw	s0,144(sp)
+   29554:	03e00008 	jr	ra
+   29558:	27bd00b8 	addiu	sp,sp,184
+   2955c:	8fa500c8 	lw	a1,200(sp)
+   29560:	8fa60084 	lw	a2,132(sp)
+   29564:	27a20078 	addiu	v0,sp,120
+   29568:	8fa70070 	lw	a3,112(sp)
+   2956c:	afa20010 	sw	v0,16(sp)
+   29570:	27a20088 	addiu	v0,sp,136
+   29574:	8fb10064 	lw	s1,100(sp)
+   29578:	afa20014 	sw	v0,20(sp)
+   2957c:	0c00af42 	jal	2bd08 <vfs_file_get>
+   29580:	afb30018 	sw	s3,24(sp)
+   29584:	8fa300c0 	lw	v1,192(sp)
+   29588:	3c04ffff 	lui	a0,0xffff
+   2958c:	00642024 	and	a0,v1,a0
+   29590:	ac440000 	sw	a0,0(v0)
+   29594:	8fa60068 	lw	a2,104(sp)
+   29598:	3225000c 	andi	a1,s1,0xc
+   2959c:	ac460010 	sw	a2,16(v0)
+   295a0:	8fa600c4 	lw	a2,196(sp)
+   295a4:	ac510008 	sw	s1,8(v0)
+   295a8:	10a00004 	beqz	a1,295bc <vfs_open+0x1f4>
+   295ac:	ac460004 	sw	a2,4(v0)
+   295b0:	3c050400 	lui	a1,0x400
+   295b4:	00852025 	or	a0,a0,a1
+   295b8:	ac440000 	sw	a0,0(v0)
+   295bc:	30630001 	andi	v1,v1,0x1
+   295c0:	1060ffda 	beqz	v1,2952c <vfs_open+0x164>
+   295c4:	8fbf00b4 	lw	ra,180(sp)
+   295c8:	8c440000 	lw	a0,0(v0)
+   295cc:	3c030004 	lui	v1,0x4
+   295d0:	00831825 	or	v1,a0,v1
+   295d4:	ac430000 	sw	v1,0(v0)
+   295d8:	8fbe00b0 	lw	s8,176(sp)
+   295dc:	02001021 	addu	v0,s0,zero
+   295e0:	8fb700ac 	lw	s7,172(sp)
+   295e4:	8fb600a8 	lw	s6,168(sp)
+   295e8:	8fb500a4 	lw	s5,164(sp)
+   295ec:	8fb400a0 	lw	s4,160(sp)
+   295f0:	8fb3009c 	lw	s3,156(sp)
+   295f4:	8fb20098 	lw	s2,152(sp)
+   295f8:	8fb10094 	lw	s1,148(sp)
+   295fc:	8fb00090 	lw	s0,144(sp)
+   29600:	03e00008 	jr	ra
+   29604:	27bd00b8 	addiu	sp,sp,184
+   29608:	00408021 	addu	s0,v0,zero
+   2960c:	02001021 	addu	v0,s0,zero
+   29610:	8fbe00b0 	lw	s8,176(sp)
+   29614:	8fb700ac 	lw	s7,172(sp)
+   29618:	8fb600a8 	lw	s6,168(sp)
+   2961c:	8fb500a4 	lw	s5,164(sp)
+   29620:	8fb400a0 	lw	s4,160(sp)
+   29624:	8fb3009c 	lw	s3,156(sp)
+   29628:	8fb20098 	lw	s2,152(sp)
+   2962c:	8fb10094 	lw	s1,148(sp)
+   29630:	8fb00090 	lw	s0,144(sp)
+   29634:	03e00008 	jr	ra
+   29638:	27bd00b8 	addiu	sp,sp,184
+
+0002963c <vfs_opendir>:
+   2963c:	27bdffe0 	addiu	sp,sp,-32
+   29640:	afb00018 	sw	s0,24(sp)
+   29644:	00e08021 	addu	s0,a3,zero
+   29648:	00c03821 	addu	a3,a2,zero
+   2964c:	24060001 	addiu	a2,zero,1
+   29650:	afbf001c 	sw	ra,28(sp)
+   29654:	0c00a4f2 	jal	293c8 <vfs_open>
+   29658:	afb00010 	sw	s0,16(sp)
+   2965c:	14400004 	bnez	v0,29670 <vfs_opendir+0x34>
+   29660:	3c030004 	lui	v1,0x4
+   29664:	8e040000 	lw	a0,0(s0)
+   29668:	00831825 	or	v1,a0,v1
+   2966c:	ae030000 	sw	v1,0(s0)
+   29670:	8fbf001c 	lw	ra,28(sp)
+   29674:	8fb00018 	lw	s0,24(sp)
+   29678:	03e00008 	jr	ra
+   2967c:	27bd0020 	addiu	sp,sp,32
+
+00029680 <vfs_create>:
+   29680:	3c02fff8 	lui	v0,0xfff8
+   29684:	00c23024 	and	a2,a2,v0
+   29688:	3c030160 	lui	v1,0x160
+   2968c:	0800a4f2 	j	293c8 <vfs_open>
+   29690:	00c33025 	or	a2,a2,v1
+
+00029694 <vfs_chdir>:
+   29694:	27bdff98 	addiu	sp,sp,-104
+   29698:	afb00058 	sw	s0,88(sp)
+   2969c:	00a08021 	addu	s0,a1,zero
+   296a0:	afb1005c 	sw	s1,92(sp)
+   296a4:	00802821 	addu	a1,a0,zero
+   296a8:	27b10018 	addiu	s1,sp,24
+   296ac:	02002021 	addu	a0,s0,zero
+   296b0:	24060001 	addiu	a2,zero,1
+   296b4:	00003821 	addu	a3,zero,zero
+   296b8:	afb20060 	sw	s2,96(sp)
+   296bc:	afbf0064 	sw	ra,100(sp)
+   296c0:	0c00a4f2 	jal	293c8 <vfs_open>
+   296c4:	afb10010 	sw	s1,16(sp)
+   296c8:	10400008 	beqz	v0,296ec <vfs_chdir+0x58>
+   296cc:	00409021 	addu	s2,v0,zero
+   296d0:	8fbf0064 	lw	ra,100(sp)
+   296d4:	02401021 	addu	v0,s2,zero
+   296d8:	8fb20060 	lw	s2,96(sp)
+   296dc:	8fb1005c 	lw	s1,92(sp)
+   296e0:	8fb00058 	lw	s0,88(sp)
+   296e4:	03e00008 	jr	ra
+   296e8:	27bd0068 	addiu	sp,sp,104
+   296ec:	02002021 	addu	a0,s0,zero
+   296f0:	0c009f67 	jal	27d9c <vfs_close>
+   296f4:	00002821 	addu	a1,zero,zero
+   296f8:	27a20048 	addiu	v0,sp,72
+   296fc:	8e260000 	lw	a2,0(s1)
+   29700:	8e250004 	lw	a1,4(s1)
+   29704:	8e240008 	lw	a0,8(s1)
+   29708:	8e23000c 	lw	v1,12(s1)
+   2970c:	26310010 	addiu	s1,s1,16
+   29710:	ae060000 	sw	a2,0(s0)
+   29714:	ae050004 	sw	a1,4(s0)
+   29718:	ae040008 	sw	a0,8(s0)
+   2971c:	ae03000c 	sw	v1,12(s0)
+   29720:	1622fff6 	bne	s1,v0,296fc <vfs_chdir+0x68>
+   29724:	26100010 	addiu	s0,s0,16
+   29728:	8e220004 	lw	v0,4(s1)
+   2972c:	8e240008 	lw	a0,8(s1)
+   29730:	8e230000 	lw	v1,0(s1)
+   29734:	8fbf0064 	lw	ra,100(sp)
+   29738:	ae020004 	sw	v0,4(s0)
+   2973c:	ae040008 	sw	a0,8(s0)
+   29740:	02401021 	addu	v0,s2,zero
+   29744:	ae030000 	sw	v1,0(s0)
+   29748:	8fb20060 	lw	s2,96(sp)
+   2974c:	8fb1005c 	lw	s1,92(sp)
+   29750:	8fb00058 	lw	s0,88(sp)
+   29754:	03e00008 	jr	ra
+   29758:	27bd0068 	addiu	sp,sp,104
+
+0002975c <vfs_stat>:
+   2975c:	27bdff28 	addiu	sp,sp,-216
+   29760:	afb100b4 	sw	s1,180(sp)
+   29764:	3c110004 	lui	s1,0x4
+   29768:	afbe00d0 	sw	s8,208(sp)
+   2976c:	afb700cc 	sw	s7,204(sp)
+   29770:	afb600c8 	sw	s6,200(sp)
+   29774:	afb500c4 	sw	s5,196(sp)
+   29778:	afb400c0 	sw	s4,192(sp)
+   2977c:	afb300bc 	sw	s3,188(sp)
+   29780:	afb200b8 	sw	s2,184(sp)
+   29784:	afb000b0 	sw	s0,176(sp)
+   29788:	afbf00d4 	sw	ra,212(sp)
+   2978c:	afa400d8 	sw	a0,216(sp)
+   29790:	afa500dc 	sw	a1,220(sp)
+   29794:	afa600e0 	sw	a2,224(sp)
+   29798:	00e08021 	addu	s0,a3,zero
+   2979c:	27b30044 	addiu	s3,sp,68
+   297a0:	27b40028 	addiu	s4,sp,40
+   297a4:	27b20060 	addiu	s2,sp,96
+   297a8:	241e0004 	addiu	s8,zero,4
+   297ac:	24170048 	addiu	s7,zero,72
+   297b0:	2416000c 	addiu	s6,zero,12
+   297b4:	2635c960 	addiu	s5,s1,-13984
+   297b8:	12000047 	beqz	s0,298d8 <vfs_stat+0x17c>
+   297bc:	8fa400d8 	lw	a0,216(sp)
+   297c0:	8e050018 	lw	a1,24(s0)
+   297c4:	8e04001c 	lw	a0,28(s0)
+   297c8:	8e020020 	lw	v0,32(s0)
+   297cc:	9603001c 	lhu	v1,28(s0)
+   297d0:	afa50044 	sw	a1,68(sp)
+   297d4:	afa40048 	sw	a0,72(sp)
+   297d8:	afa2004c 	sw	v0,76(sp)
+   297dc:	8aa20003 	lwl	v0,3(s5)
+   297e0:	afb40034 	sw	s4,52(sp)
+   297e4:	9a22c960 	lwr	v0,-13984(s1)
+   297e8:	afb20038 	sw	s2,56(sp)
+   297ec:	3042ffff 	andi	v0,v0,0xffff
+   297f0:	afbe003c 	sw	s8,60(sp)
+   297f4:	afb70040 	sw	s7,64(sp)
+   297f8:	afb3002c 	sw	s3,44(sp)
+   297fc:	10620030 	beq	v1,v0,298c0 <vfs_stat+0x164>
+   29800:	afb60030 	sw	s6,48(sp)
+   29804:	40047801 	mfc0	a0,$15,1
+   29808:	afa300ac 	sw	v1,172(sp)
+   2980c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   29810:	afa400a8 	sw	a0,168(sp)
+   29814:	8fa300ac 	lw	v1,172(sp)
+   29818:	8fa400a8 	lw	a0,168(sp)
+   2981c:	70432802 	mul	a1,v0,v1
+   29820:	24020002 	addiu	v0,zero,2
+   29824:	afa20010 	sw	v0,16(sp)
+   29828:	27a20034 	addiu	v0,sp,52
+   2982c:	afa20018 	sw	v0,24(sp)
+   29830:	27a2003c 	addiu	v0,sp,60
+   29834:	30840003 	andi	a0,a0,0x3
+   29838:	3c070003 	lui	a3,0x3
+   2983c:	afa2001c 	sw	v0,28(sp)
+   29840:	27a2002c 	addiu	v0,sp,44
+   29844:	00a42021 	addu	a0,a1,a0
+   29848:	afa20020 	sw	v0,32(sp)
+   2984c:	24050001 	addiu	a1,zero,1
+   29850:	27a20030 	addiu	v0,sp,48
+   29854:	00003021 	addu	a2,zero,zero
+   29858:	24e78818 	addiu	a3,a3,-30696
+   2985c:	afa50014 	sw	a1,20(sp)
+   29860:	0c003de8 	jal	f7a0 <rppc_generic>
+   29864:	afa20024 	sw	v0,36(sp)
+   29868:	8fa20028 	lw	v0,40(sp)
+   2986c:	14400009 	bnez	v0,29894 <vfs_stat+0x138>
+   29870:	8fbf00d4 	lw	ra,212(sp)
+   29874:	8fa200a0 	lw	v0,160(sp)
+   29878:	30420008 	andi	v0,v0,0x8
+   2987c:	1440ffce 	bnez	v0,297b8 <vfs_stat+0x5c>
+   29880:	8fa400e0 	lw	a0,224(sp)
+   29884:	02402821 	addu	a1,s2,zero
+   29888:	0c00013a 	jal	4e8 <cpu_copy_to_uspace>
+   2988c:	24060040 	addiu	a2,zero,64
+   29890:	8fbf00d4 	lw	ra,212(sp)
+   29894:	8fbe00d0 	lw	s8,208(sp)
+   29898:	8fb700cc 	lw	s7,204(sp)
+   2989c:	8fb600c8 	lw	s6,200(sp)
+   298a0:	8fb500c4 	lw	s5,196(sp)
+   298a4:	8fb400c0 	lw	s4,192(sp)
+   298a8:	8fb300bc 	lw	s3,188(sp)
+   298ac:	8fb200b8 	lw	s2,184(sp)
+   298b0:	8fb100b4 	lw	s1,180(sp)
+   298b4:	8fb000b0 	lw	s0,176(sp)
+   298b8:	03e00008 	jr	ra
+   298bc:	27bd00d8 	addiu	sp,sp,216
+   298c0:	02802021 	addu	a0,s4,zero
+   298c4:	02402821 	addu	a1,s2,zero
+   298c8:	0c00a23e 	jal	288f8 <__vfs_stat_local>
+   298cc:	02603021 	addu	a2,s3,zero
+   298d0:	0800a61b 	j	2986c <vfs_stat+0x110>
+   298d4:	8fa20028 	lw	v0,40(sp)
+   298d8:	8fa500dc 	lw	a1,220(sp)
+   298dc:	00003021 	addu	a2,zero,zero
+   298e0:	00003821 	addu	a3,zero,zero
+   298e4:	afa00010 	sw	zero,16(sp)
+   298e8:	0c00b85a 	jal	2e168 <vfs_lookup>
+   298ec:	afb30014 	sw	s3,20(sp)
+   298f0:	1440ffe8 	bnez	v0,29894 <vfs_stat+0x138>
+   298f4:	8fbf00d4 	lw	ra,212(sp)
+   298f8:	afa00028 	sw	zero,40(sp)
+   298fc:	0800a5f7 	j	297dc <vfs_stat+0x80>
+   29900:	97a30048 	lhu	v1,72(sp)
+
+00029904 <vfs_lseek_remote>:
+   29904:	27bdff98 	addiu	sp,sp,-104
+   29908:	3c020004 	lui	v0,0x4
+   2990c:	afb1005c 	sw	s1,92(sp)
+   29910:	afb00058 	sw	s0,88(sp)
+   29914:	2443c960 	addiu	v1,v0,-13984
+   29918:	afbf0064 	sw	ra,100(sp)
+   2991c:	afb20060 	sw	s2,96(sp)
+   29920:	88630003 	lwl	v1,3(v1)
+   29924:	9491001c 	lhu	s1,28(a0)
+   29928:	9843c960 	lwr	v1,-13984(v0)
+   2992c:	240b0004 	addiu	t3,zero,4
+   29930:	27ac0028 	addiu	t4,sp,40
+   29934:	27aa002c 	addiu	t2,sp,44
+   29938:	24890014 	addiu	t1,a0,20
+   2993c:	27a8006c 	addiu	t0,sp,108
+   29940:	27a20070 	addiu	v0,sp,112
+   29944:	3063ffff 	andi	v1,v1,0xffff
+   29948:	afa5006c 	sw	a1,108(sp)
+   2994c:	afa60070 	sw	a2,112(sp)
+   29950:	afab0054 	sw	t3,84(sp)
+   29954:	00e08021 	addu	s0,a3,zero
+   29958:	afac0030 	sw	t4,48(sp)
+   2995c:	afaa0034 	sw	t2,52(sp)
+   29960:	afab0038 	sw	t3,56(sp)
+   29964:	afab003c 	sw	t3,60(sp)
+   29968:	afa90040 	sw	t1,64(sp)
+   2996c:	afa80044 	sw	t0,68(sp)
+   29970:	afa20048 	sw	v0,72(sp)
+   29974:	afab004c 	sw	t3,76(sp)
+   29978:	12230022 	beq	s1,v1,29a04 <vfs_lseek_remote+0x100>
+   2997c:	afab0050 	sw	t3,80(sp)
+   29980:	40127801 	mfc0	s2,$15,1
+   29984:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   29988:	00000000 	sll	zero,zero,0x0
+   2998c:	70511802 	mul	v1,v0,s1
+   29990:	24020002 	addiu	v0,zero,2
+   29994:	afa20010 	sw	v0,16(sp)
+   29998:	24020003 	addiu	v0,zero,3
+   2999c:	afa20014 	sw	v0,20(sp)
+   299a0:	27a20030 	addiu	v0,sp,48
+   299a4:	afa20018 	sw	v0,24(sp)
+   299a8:	27a20038 	addiu	v0,sp,56
+   299ac:	32440003 	andi	a0,s2,0x3
+   299b0:	3c070002 	lui	a3,0x2
+   299b4:	afa2001c 	sw	v0,28(sp)
+   299b8:	27a20040 	addiu	v0,sp,64
+   299bc:	afa20020 	sw	v0,32(sp)
+   299c0:	00642021 	addu	a0,v1,a0
+   299c4:	27a2004c 	addiu	v0,sp,76
+   299c8:	24e77c38 	addiu	a3,a3,31800
+   299cc:	24050001 	addiu	a1,zero,1
+   299d0:	00003021 	addu	a2,zero,zero
+   299d4:	0c003de8 	jal	f7a0 <rppc_generic>
+   299d8:	afa20024 	sw	v0,36(sp)
+   299dc:	12000002 	beqz	s0,299e8 <vfs_lseek_remote+0xe4>
+   299e0:	8fa2002c 	lw	v0,44(sp)
+   299e4:	ae020000 	sw	v0,0(s0)
+   299e8:	8fbf0064 	lw	ra,100(sp)
+   299ec:	8fa20028 	lw	v0,40(sp)
+   299f0:	8fb20060 	lw	s2,96(sp)
+   299f4:	8fb1005c 	lw	s1,92(sp)
+   299f8:	8fb00058 	lw	s0,88(sp)
+   299fc:	03e00008 	jr	ra
+   29a00:	27bd0068 	addiu	sp,sp,104
+   29a04:	01802021 	addu	a0,t4,zero
+   29a08:	01402821 	addu	a1,t2,zero
+   29a0c:	01203021 	addu	a2,t1,zero
+   29a10:	01003821 	addu	a3,t0,zero
+   29a14:	0c009f4a 	jal	27d28 <_vfs_lseek_local>
+   29a18:	afa20010 	sw	v0,16(sp)
+   29a1c:	0800a677 	j	299dc <vfs_lseek_remote+0xd8>
+   29a20:	00000000 	sll	zero,zero,0x0
+
+00029a24 <vfs_lseek>:
+   29a24:	8c820000 	lw	v0,0(a0)
+   29a28:	3c030004 	lui	v1,0x4
+   29a2c:	27bdffd8 	addiu	sp,sp,-40
+   29a30:	00431824 	and	v1,v0,v1
+   29a34:	afb10020 	sw	s1,32(sp)
+   29a38:	afb0001c 	sw	s0,28(sp)
+   29a3c:	afbf0024 	sw	ra,36(sp)
+   29a40:	00808021 	addu	s0,a0,zero
+   29a44:	14600013 	bnez	v1,29a94 <vfs_lseek+0x70>
+   29a48:	00e08821 	addu	s1,a3,zero
+   29a4c:	8c830028 	lw	v1,40(a0)
+   29a50:	8c63000c 	lw	v1,12(v1)
+   29a54:	10600015 	beqz	v1,29aac <vfs_lseek+0x88>
+   29a58:	3c031400 	lui	v1,0x1400
+   29a5c:	02002021 	addu	a0,s0,zero
+   29a60:	0c00a641 	jal	29904 <vfs_lseek_remote>
+   29a64:	27a70010 	addiu	a3,sp,16
+   29a68:	14400005 	bnez	v0,29a80 <vfs_lseek+0x5c>
+   29a6c:	8fa50010 	lw	a1,16(sp)
+   29a70:	12200002 	beqz	s1,29a7c <vfs_lseek+0x58>
+   29a74:	ae050010 	sw	a1,16(s0)
+   29a78:	ae250000 	sw	a1,0(s1)
+   29a7c:	00001021 	addu	v0,zero,zero
+   29a80:	8fbf0024 	lw	ra,36(sp)
+   29a84:	8fb10020 	lw	s1,32(sp)
+   29a88:	8fb0001c 	lw	s0,28(sp)
+   29a8c:	03e00008 	jr	ra
+   29a90:	27bd0028 	addiu	sp,sp,40
+   29a94:	8fbf0024 	lw	ra,36(sp)
+   29a98:	24020009 	addiu	v0,zero,9
+   29a9c:	8fb10020 	lw	s1,32(sp)
+   29aa0:	8fb0001c 	lw	s0,28(sp)
+   29aa4:	03e00008 	jr	ra
+   29aa8:	27bd0028 	addiu	sp,sp,40
+   29aac:	00431024 	and	v0,v0,v1
+   29ab0:	1440ffeb 	bnez	v0,29a60 <vfs_lseek+0x3c>
+   29ab4:	02002021 	addu	a0,s0,zero
+   29ab8:	24020002 	addiu	v0,zero,2
+   29abc:	10c2ffe8 	beq	a2,v0,29a60 <vfs_lseek+0x3c>
+   29ac0:	24030001 	addiu	v1,zero,1
+   29ac4:	10c30005 	beq	a2,v1,29adc <vfs_lseek+0xb8>
+   29ac8:	00000000 	sll	zero,zero,0x0
+   29acc:	10c00003 	beqz	a2,29adc <vfs_lseek+0xb8>
+   29ad0:	00000000 	sll	zero,zero,0x0
+   29ad4:	14c2ffea 	bne	a2,v0,29a80 <vfs_lseek+0x5c>
+   29ad8:	24020016 	addiu	v0,zero,22
+   29adc:	2402ffff 	addiu	v0,zero,-1
+   29ae0:	14a2ffe3 	bne	a1,v0,29a70 <vfs_lseek+0x4c>
+   29ae4:	2402004b 	addiu	v0,zero,75
+   29ae8:	0800a6a1 	j	29a84 <vfs_lseek+0x60>
+   29aec:	8fbf0024 	lw	ra,36(sp)
+
+00029af0 <__vfs_readdir_main>:
+   29af0:	8ce20114 	lw	v0,276(a3)
+   29af4:	27bdfed0 	addiu	sp,sp,-304
+   29af8:	afb00120 	sw	s0,288(sp)
+   29afc:	8c420010 	lw	v0,16(v0)
+   29b00:	27b00010 	addiu	s0,sp,16
+   29b04:	afb20128 	sw	s2,296(sp)
+   29b08:	afb10124 	sw	s1,292(sp)
+   29b0c:	afa60118 	sw	a2,280(sp)
+   29b10:	afbf012c 	sw	ra,300(sp)
+   29b14:	3092ffff 	andi	s2,a0,0xffff
+   29b18:	02002821 	addu	a1,s0,zero
+   29b1c:	00e02021 	addu	a0,a3,zero
+   29b20:	0040f809 	jalr	v0
+   29b24:	8fb10140 	lw	s1,320(sp)
+   29b28:	8fa60118 	lw	a2,280(sp)
+   29b2c:	1440000b 	bnez	v0,29b5c <__vfs_readdir_main+0x6c>
+   29b30:	acc20000 	sw	v0,0(a2)
+   29b34:	3c030004 	lui	v1,0x4
+   29b38:	2462c960 	addiu	v0,v1,-13984
+   29b3c:	88420003 	lwl	v0,3(v0)
+   29b40:	9862c960 	lwr	v0,-13984(v1)
+   29b44:	3042ffff 	andi	v0,v0,0xffff
+   29b48:	1642000a 	bne	s2,v0,29b74 <__vfs_readdir_main+0x84>
+   29b4c:	02202021 	addu	a0,s1,zero
+   29b50:	02002821 	addu	a1,s0,zero
+   29b54:	0c00c12b 	jal	304ac <memcpy>
+   29b58:	24060108 	addiu	a2,zero,264
+   29b5c:	8fbf012c 	lw	ra,300(sp)
+   29b60:	8fb20128 	lw	s2,296(sp)
+   29b64:	8fb10124 	lw	s1,292(sp)
+   29b68:	8fb00120 	lw	s0,288(sp)
+   29b6c:	03e00008 	jr	ra
+   29b70:	27bd0130 	addiu	sp,sp,304
+   29b74:	2c430101 	sltiu	v1,v0,257
+   29b78:	14600003 	bnez	v1,29b88 <__vfs_readdir_main+0x98>
+   29b7c:	00021900 	sll	v1,v0,0x4
+   29b80:	0800a6e0 	j	29b80 <__vfs_readdir_main+0x90>
+   29b84:	00000000 	sll	zero,zero,0x0
+   29b88:	00021080 	sll	v0,v0,0x2
+   29b8c:	00621023 	subu	v0,v1,v0
+   29b90:	3c030004 	lui	v1,0x4
+   29b94:	2463c9a0 	addiu	v1,v1,-13920
+   29b98:	00621021 	addu	v0,v1,v0
+   29b9c:	8c440000 	lw	a0,0(v0)
+   29ba0:	3c025555 	lui	v0,0x5555
+   29ba4:	34425555 	ori	v0,v0,0x5555
+   29ba8:	1082fff5 	beq	a0,v0,29b80 <__vfs_readdir_main+0x90>
+   29bac:	2e450101 	sltiu	a1,s2,257
+   29bb0:	10a00027 	beqz	a1,29c50 <__vfs_readdir_main+0x160>
+   29bb4:	00122900 	sll	a1,s2,0x4
+   29bb8:	00129080 	sll	s2,s2,0x2
+   29bbc:	00b29023 	subu	s2,a1,s2
+   29bc0:	00721821 	addu	v1,v1,s2
+   29bc4:	8c650000 	lw	a1,0(v1)
+   29bc8:	10a20021 	beq	a1,v0,29c50 <__vfs_readdir_main+0x160>
+   29bcc:	32230003 	andi	v1,s1,0x3
+   29bd0:	24020108 	addiu	v0,zero,264
+   29bd4:	24060042 	addiu	a2,zero,66
+   29bd8:	0003300b 	movn	a2,zero,v1
+   29bdc:	0003100b 	movn	v0,zero,v1
+   29be0:	0800a703 	j	29c0c <__vfs_readdir_main+0x11c>
+   29be4:	00001821 	addu	v1,zero,zero
+   29be8:	02275021 	addu	t2,s1,a3
+   29bec:	02073821 	addu	a3,s0,a3
+   29bf0:	4808c000 	mfc2	t0,$24
+   29bf4:	4884c000 	mtc2	a0,$24
+   29bf8:	8ce90000 	lw	t1,0(a3)
+   29bfc:	4885c000 	mtc2	a1,$24
+   29c00:	ad490000 	sw	t1,0(t2)
+   29c04:	4888c000 	mtc2	t0,$24
+   29c08:	24630001 	addiu	v1,v1,1
+   29c0c:	1466fff6 	bne	v1,a2,29be8 <__vfs_readdir_main+0xf8>
+   29c10:	00033880 	sll	a3,v1,0x2
+   29c14:	02028021 	addu	s0,s0,v0
+   29c18:	02228821 	addu	s1,s1,v0
+   29c1c:	24030108 	addiu	v1,zero,264
+   29c20:	1043ffcf 	beq	v0,v1,29b60 <__vfs_readdir_main+0x70>
+   29c24:	8fbf012c 	lw	ra,300(sp)
+   29c28:	4808c000 	mfc2	t0,$24
+   29c2c:	4884c000 	mtc2	a0,$24
+   29c30:	82090000 	lb	t1,0(s0)
+   29c34:	4885c000 	mtc2	a1,$24
+   29c38:	a2290000 	sb	t1,0(s1)
+   29c3c:	4888c000 	mtc2	t0,$24
+   29c40:	24420001 	addiu	v0,v0,1
+   29c44:	26100001 	addiu	s0,s0,1
+   29c48:	0800a708 	j	29c20 <__vfs_readdir_main+0x130>
+   29c4c:	26310001 	addiu	s1,s1,1
+   29c50:	0800a714 	j	29c50 <__vfs_readdir_main+0x160>
+   29c54:	00000000 	sll	zero,zero,0x0
+
+00029c58 <__vfs_readdir_demarshall>:
+   29c58:	27bdffc8 	addiu	sp,sp,-56
+   29c5c:	afbf0034 	sw	ra,52(sp)
+   29c60:	afbe0030 	sw	s8,48(sp)
+   29c64:	afb3002c 	sw	s3,44(sp)
+   29c68:	03a0f021 	addu	s8,sp,zero
+   29c6c:	afb20028 	sw	s2,40(sp)
+   29c70:	afb10024 	sw	s1,36(sp)
+   29c74:	afb00020 	sw	s0,32(sp)
+   29c78:	27bdfff0 	addiu	sp,sp,-16
+   29c7c:	27b20018 	addiu	s2,sp,24
+   29c80:	27bdffc8 	addiu	sp,sp,-56
+   29c84:	27b10018 	addiu	s1,sp,24
+   29c88:	00808021 	addu	s0,a0,zero
+   29c8c:	26220028 	addiu	v0,s1,40
+   29c90:	8c840000 	lw	a0,0(a0)
+   29c94:	2403002c 	addiu	v1,zero,44
+   29c98:	ae230008 	sw	v1,8(s1)
+   29c9c:	ae420000 	sw	v0,0(s2)
+   29ca0:	24030004 	addiu	v1,zero,4
+   29ca4:	0c009ea4 	jal	27a90 <__vfs_lseek_+0x5c>
+   29ca8:	ae230024 	sw	v1,36(s1)
+   29cac:	8e460000 	lw	a2,0(s2)
+   29cb0:	02002021 	addu	a0,s0,zero
+   29cb4:	00002821 	addu	a1,zero,zero
+   29cb8:	8e120000 	lw	s2,0(s0)
+   29cbc:	afc6001c 	sw	a2,28(s8)
+   29cc0:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   29cc4:	00409821 	addu	s3,v0,zero
+   29cc8:	8c470000 	lw	a3,0(v0)
+   29ccc:	02002021 	addu	a0,s0,zero
+   29cd0:	24050001 	addiu	a1,zero,1
+   29cd4:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   29cd8:	afc70018 	sw	a3,24(s8)
+   29cdc:	8c420000 	lw	v0,0(v0)
+   29ce0:	8fc6001c 	lw	a2,28(s8)
+   29ce4:	8fc70018 	lw	a3,24(s8)
+   29ce8:	3264ffff 	andi	a0,s3,0xffff
+   29cec:	02402821 	addu	a1,s2,zero
+   29cf0:	0c00a6bc 	jal	29af0 <__vfs_readdir_main>
+   29cf4:	afa20010 	sw	v0,16(sp)
+   29cf8:	02002021 	addu	a0,s0,zero
+   29cfc:	02202821 	addu	a1,s1,zero
+   29d00:	2406002c 	addiu	a2,zero,44
+   29d04:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   29d08:	24070001 	addiu	a3,zero,1
+   29d0c:	03c0e821 	addu	sp,s8,zero
+   29d10:	8fbf0034 	lw	ra,52(sp)
+   29d14:	8fbe0030 	lw	s8,48(sp)
+   29d18:	8fb3002c 	lw	s3,44(sp)
+   29d1c:	8fb20028 	lw	s2,40(sp)
+   29d20:	8fb10024 	lw	s1,36(sp)
+   29d24:	8fb00020 	lw	s0,32(sp)
+   29d28:	03e00008 	jr	ra
+   29d2c:	27bd0038 	addiu	sp,sp,56
+
+00029d30 <__vfs_readdir_local>:
+   29d30:	27bdffe0 	addiu	sp,sp,-32
+   29d34:	afbf001c 	sw	ra,28(sp)
+   29d38:	00801821 	addu	v1,a0,zero
+   29d3c:	00a01021 	addu	v0,a1,zero
+   29d40:	40077801 	mfc0	a3,$15,1
+   29d44:	3c050004 	lui	a1,0x4
+   29d48:	24a4c960 	addiu	a0,a1,-13984
+   29d4c:	88840003 	lwl	a0,3(a0)
+   29d50:	30e70003 	andi	a3,a3,0x3
+   29d54:	3c080004 	lui	t0,0x4
+   29d58:	2508c950 	addiu	t0,t0,-14000
+   29d5c:	00073880 	sll	a3,a3,0x2
+   29d60:	00e83821 	addu	a3,a3,t0
+   29d64:	98a4c960 	lwr	a0,-13984(a1)
+   29d68:	8ce50000 	lw	a1,0(a3)
+   29d6c:	8c470000 	lw	a3,0(v0)
+   29d70:	8cc20000 	lw	v0,0(a2)
+   29d74:	3084ffff 	andi	a0,a0,0xffff
+   29d78:	00603021 	addu	a2,v1,zero
+   29d7c:	0c00a6bc 	jal	29af0 <__vfs_readdir_main>
+   29d80:	afa20010 	sw	v0,16(sp)
+   29d84:	8fbf001c 	lw	ra,28(sp)
+   29d88:	03e00008 	jr	ra
+   29d8c:	27bd0020 	addiu	sp,sp,32
+
+00029d90 <_vfs_readdir>:
+   29d90:	27bdffa8 	addiu	sp,sp,-88
+   29d94:	3c020004 	lui	v0,0x4
+   29d98:	afb0004c 	sw	s0,76(sp)
+   29d9c:	afbf0054 	sw	ra,84(sp)
+   29da0:	afb10050 	sw	s1,80(sp)
+   29da4:	2443c960 	addiu	v1,v0,-13984
+   29da8:	88630003 	lwl	v1,3(v1)
+   29dac:	9490001c 	lhu	s0,28(a0)
+   29db0:	9843c960 	lwr	v1,-13984(v0)
+   29db4:	3063ffff 	andi	v1,v1,0xffff
+   29db8:	12030027 	beq	s0,v1,29e58 <_vfs_readdir+0xc8>
+   29dbc:	afa5005c 	sw	a1,92(sp)
+   29dc0:	27a30028 	addiu	v1,sp,40
+   29dc4:	24020004 	addiu	v0,zero,4
+   29dc8:	afa3002c 	sw	v1,44(sp)
+   29dcc:	24840014 	addiu	a0,a0,20
+   29dd0:	27a3005c 	addiu	v1,sp,92
+   29dd4:	afa40034 	sw	a0,52(sp)
+   29dd8:	afa30038 	sw	v1,56(sp)
+   29ddc:	afa20040 	sw	v0,64(sp)
+   29de0:	afa20030 	sw	v0,48(sp)
+   29de4:	afa2003c 	sw	v0,60(sp)
+   29de8:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   29dec:	40117801 	mfc0	s1,$15,1
+   29df0:	70501802 	mul	v1,v0,s0
+   29df4:	24020001 	addiu	v0,zero,1
+   29df8:	afa20010 	sw	v0,16(sp)
+   29dfc:	24020002 	addiu	v0,zero,2
+   29e00:	afa20014 	sw	v0,20(sp)
+   29e04:	27a2002c 	addiu	v0,sp,44
+   29e08:	afa20018 	sw	v0,24(sp)
+   29e0c:	27a20030 	addiu	v0,sp,48
+   29e10:	afa2001c 	sw	v0,28(sp)
+   29e14:	32240003 	andi	a0,s1,0x3
+   29e18:	27a20034 	addiu	v0,sp,52
+   29e1c:	3c070003 	lui	a3,0x3
+   29e20:	afa20020 	sw	v0,32(sp)
+   29e24:	00642021 	addu	a0,v1,a0
+   29e28:	27a2003c 	addiu	v0,sp,60
+   29e2c:	24e79c58 	addiu	a3,a3,-25512
+   29e30:	24050001 	addiu	a1,zero,1
+   29e34:	00003021 	addu	a2,zero,zero
+   29e38:	0c003de8 	jal	f7a0 <rppc_generic>
+   29e3c:	afa20024 	sw	v0,36(sp)
+   29e40:	8fa20028 	lw	v0,40(sp)
+   29e44:	8fbf0054 	lw	ra,84(sp)
+   29e48:	8fb10050 	lw	s1,80(sp)
+   29e4c:	8fb0004c 	lw	s0,76(sp)
+   29e50:	03e00008 	jr	ra
+   29e54:	27bd0058 	addiu	sp,sp,88
+   29e58:	8c820028 	lw	v0,40(a0)
+   29e5c:	8c420010 	lw	v0,16(v0)
+   29e60:	0040f809 	jalr	v0
+   29e64:	8c840014 	lw	a0,20(a0)
+   29e68:	0800a792 	j	29e48 <_vfs_readdir+0xb8>
+   29e6c:	8fbf0054 	lw	ra,84(sp)
+
+00029e70 <vfs_readdir>:
+   29e70:	8c830000 	lw	v1,0(a0)
+   29e74:	3c020004 	lui	v0,0x4
+   29e78:	27bdfed8 	addiu	sp,sp,-296
+   29e7c:	00621024 	and	v0,v1,v0
+   29e80:	afb1011c 	sw	s1,284(sp)
+   29e84:	afbf0124 	sw	ra,292(sp)
+   29e88:	afb20120 	sw	s2,288(sp)
+   29e8c:	afb00118 	sw	s0,280(sp)
+   29e90:	14400009 	bnez	v0,29eb8 <vfs_readdir+0x48>
+   29e94:	00a08821 	addu	s1,a1,zero
+   29e98:	24100009 	addiu	s0,zero,9
+   29e9c:	8fbf0124 	lw	ra,292(sp)
+   29ea0:	02001021 	addu	v0,s0,zero
+   29ea4:	8fb20120 	lw	s2,288(sp)
+   29ea8:	8fb1011c 	lw	s1,284(sp)
+   29eac:	8fb00118 	lw	s0,280(sp)
+   29eb0:	03e00008 	jr	ra
+   29eb4:	27bd0128 	addiu	sp,sp,296
+   29eb8:	27b20010 	addiu	s2,sp,16
+   29ebc:	0c00a764 	jal	29d90 <_vfs_readdir>
+   29ec0:	02402821 	addu	a1,s2,zero
+   29ec4:	1440fff5 	bnez	v0,29e9c <vfs_readdir+0x2c>
+   29ec8:	00408021 	addu	s0,v0,zero
+   29ecc:	8e220008 	lw	v0,8(s1)
+   29ed0:	02202021 	addu	a0,s1,zero
+   29ed4:	0040f809 	jalr	v0
+   29ed8:	02402821 	addu	a1,s2,zero
+   29edc:	8fbf0124 	lw	ra,292(sp)
+   29ee0:	02001021 	addu	v0,s0,zero
+   29ee4:	8fb20120 	lw	s2,288(sp)
+   29ee8:	8fb1011c 	lw	s1,284(sp)
+   29eec:	8fb00118 	lw	s0,280(sp)
+   29ef0:	03e00008 	jr	ra
+   29ef4:	27bd0128 	addiu	sp,sp,296
+
+00029ef8 <inode_hhash>:
+   29ef8:	8c830000 	lw	v1,0(a0)
+   29efc:	3c0241c6 	lui	v0,0x41c6
+   29f00:	34424e6d 	ori	v0,v0,0x4e6d
+   29f04:	70621002 	mul	v0,v1,v0
+   29f08:	8c830004 	lw	v1,4(a0)
+   29f0c:	70621002 	mul	v0,v1,v0
+   29f10:	24423039 	addiu	v0,v0,12345
+   29f14:	00021402 	srl	v0,v0,0x10
+   29f18:	03e00008 	jr	ra
+   29f1c:	30427fff 	andi	v0,v0,0x7fff
+
+00029f20 <inode_hcompare>:
+   29f20:	8c83fe60 	lw	v1,-416(a0)
+   29f24:	8ca20000 	lw	v0,0(a1)
+   29f28:	10620003 	beq	v1,v0,29f38 <inode_hcompare+0x18>
+   29f2c:	2484fe60 	addiu	a0,a0,-416
+   29f30:	03e00008 	jr	ra
+   29f34:	00001021 	addu	v0,zero,zero
+   29f38:	8c8301c0 	lw	v1,448(a0)
+   29f3c:	8ca20004 	lw	v0,4(a1)
+   29f40:	00621026 	xor	v0,v1,v0
+   29f44:	03e00008 	jr	ra
+   29f48:	2c420001 	sltiu	v0,v0,1
+
+00029f4c <vfs_inumber_free>:
+   29f4c:	03e00008 	jr	ra
+   29f50:	00000000 	sll	zero,zero,0x0
+
+00029f54 <vfs_kmem_inode_init>:
+   29f54:	2402000f 	addiu	v0,zero,15
+   29f58:	ac820000 	sw	v0,0(a0)
+   29f5c:	3c020003 	lui	v0,0x3
+   29f60:	24427950 	addiu	v0,v0,31056
+   29f64:	ac820004 	sw	v0,4(a0)
+   29f68:	24020220 	addiu	v0,zero,544
+   29f6c:	ac820008 	sw	v0,8(a0)
+   29f70:	24020003 	addiu	v0,zero,3
+   29f74:	ac82000c 	sw	v0,12(a0)
+   29f78:	24020006 	addiu	v0,zero,6
+   29f7c:	ac820010 	sw	v0,16(a0)
+   29f80:	3c020003 	lui	v0,0x3
+   29f84:	2442a8e0 	addiu	v0,v0,-22304
+   29f88:	ac820018 	sw	v0,24(a0)
+   29f8c:	ac80001c 	sw	zero,28(a0)
+   29f90:	ac800014 	sw	zero,20(a0)
+   29f94:	03e00008 	jr	ra
+   29f98:	00001021 	addu	v0,zero,zero
+
+00029f9c <__inode_can_access>:
+   29f9c:	8c820034 	lw	v0,52(a0)
+   29fa0:	10450003 	beq	v0,a1,29fb0 <__inode_can_access+0x14>
+   29fa4:	00000000 	sll	zero,zero,0x0
+   29fa8:	03e00008 	jr	ra
+   29fac:	24020055 	addiu	v0,zero,85
+   29fb0:	8c820010 	lw	v0,16(a0)
+   29fb4:	30420002 	andi	v0,v0,0x2
+   29fb8:	1440fffb 	bnez	v0,29fa8 <__inode_can_access+0xc>
+   29fbc:	00000000 	sll	zero,zero,0x0
+   29fc0:	03e00008 	jr	ra
+   29fc4:	00000000 	sll	zero,zero,0x0
+
+00029fc8 <vfs_inode_size_get>:
+   29fc8:	24840018 	addiu	a0,a0,24
+   29fcc:	0000000f 	sync
+   29fd0:	00041025 	or	v0,zero,a0
+   29fd4:	8c430000 	lw	v1,0(v0)
+   29fd8:	03e00008 	jr	ra
+   29fdc:	00601021 	addu	v0,v1,zero
+
+00029fe0 <__inode_size_get_local>:
+   29fe0:	40027801 	mfc0	v0,$15,1
+   29fe4:	8ca50000 	lw	a1,0(a1)
+   29fe8:	24a50018 	addiu	a1,a1,24
+   29fec:	0000000f 	sync
+   29ff0:	00051025 	or	v0,zero,a1
+   29ff4:	8c430000 	lw	v1,0(v0)
+   29ff8:	03e00008 	jr	ra
+   29ffc:	ac830000 	sw	v1,0(a0)
+
+0002a000 <__inode_size_get_main>:
+   2a000:	24e70018 	addiu	a3,a3,24
+   2a004:	0000000f 	sync
+   2a008:	00071025 	or	v0,zero,a3
+   2a00c:	8c430000 	lw	v1,0(v0)
+   2a010:	03e00008 	jr	ra
+   2a014:	acc30000 	sw	v1,0(a2)
+
+0002a018 <vfs_inode_get_cid>:
+   2a018:	40022002 	mfc0	v0,$4,2
+   2a01c:	03e00008 	jr	ra
+   2a020:	94420150 	lhu	v0,336(v0)
+
+0002a024 <vfs_stat_inode>:
+   2a024:	8c8201c0 	lw	v0,448(a0)
+   2a028:	8c830020 	lw	v1,32(a0)
+   2a02c:	8c46008c 	lw	a2,140(v0)
+   2a030:	ac8301dc 	sw	v1,476(a0)
+   2a034:	ac8601d0 	sw	a2,464(a0)
+   2a038:	ac8501d4 	sw	a1,468(a0)
+   2a03c:	ac8001e0 	sw	zero,480(a0)
+   2a040:	ac8001e4 	sw	zero,484(a0)
+   2a044:	8c430048 	lw	v1,72(v0)
+   2a048:	8c860018 	lw	a2,24(a0)
+   2a04c:	8c420000 	lw	v0,0(v0)
+   2a050:	8c87001c 	lw	a3,28(a0)
+   2a054:	ac8201e8 	sw	v0,488(a0)
+   2a058:	ac8601f0 	sw	a2,496(a0)
+   2a05c:	ac8701f4 	sw	a3,500(a0)
+   2a060:	10600018 	beqz	v1,2a0c4 <vfs_stat_inode+0xa0>
+   2a064:	ac8301f8 	sw	v1,504(a0)
+   2a068:	8c820018 	lw	v0,24(a0)
+   2a06c:	ac800200 	sw	zero,512(a0)
+   2a070:	0043001b 	divu	zero,v0,v1
+   2a074:	006001f4 	teq	v1,zero,0x7
+   2a078:	8c820008 	lw	v0,8(a0)
+   2a07c:	ac800204 	sw	zero,516(a0)
+   2a080:	ac800208 	sw	zero,520(a0)
+   2a084:	00001812 	mflo	v1
+   2a088:	ac8301fc 	sw	v1,508(a0)
+   2a08c:	30430001 	andi	v1,v0,0x1
+   2a090:	14600014 	bnez	v1,2a0e4 <vfs_stat_inode+0xc0>
+   2a094:	3c030004 	lui	v1,0x4
+   2a098:	30430202 	andi	v1,v0,0x202
+   2a09c:	14600014 	bnez	v1,2a0f0 <vfs_stat_inode+0xcc>
+   2a0a0:	30430004 	andi	v1,v0,0x4
+   2a0a4:	14600016 	bnez	v1,2a100 <vfs_stat_inode+0xdc>
+   2a0a8:	3c050006 	lui	a1,0x6
+   2a0ac:	30420008 	andi	v0,v0,0x8
+   2a0b0:	3c030010 	lui	v1,0x10
+   2a0b4:	00a2180b 	movn	v1,a1,v0
+   2a0b8:	ac8301d8 	sw	v1,472(a0)
+   2a0bc:	03e00008 	jr	ra
+   2a0c0:	00001021 	addu	v0,zero,zero
+   2a0c4:	8c820008 	lw	v0,8(a0)
+   2a0c8:	ac8001fc 	sw	zero,508(a0)
+   2a0cc:	30430001 	andi	v1,v0,0x1
+   2a0d0:	ac800200 	sw	zero,512(a0)
+   2a0d4:	ac800204 	sw	zero,516(a0)
+   2a0d8:	1060ffef 	beqz	v1,2a098 <vfs_stat_inode+0x74>
+   2a0dc:	ac800208 	sw	zero,520(a0)
+   2a0e0:	3c030004 	lui	v1,0x4
+   2a0e4:	ac8301d8 	sw	v1,472(a0)
+   2a0e8:	03e00008 	jr	ra
+   2a0ec:	00001021 	addu	v0,zero,zero
+   2a0f0:	3c030001 	lui	v1,0x1
+   2a0f4:	ac8301d8 	sw	v1,472(a0)
+   2a0f8:	03e00008 	jr	ra
+   2a0fc:	00001021 	addu	v0,zero,zero
+   2a100:	0800a83d 	j	2a0f4 <vfs_stat_inode+0xd0>
+   2a104:	3c030002 	lui	v1,0x2
+
+0002a108 <vfs_dirent_free>:
+   2a108:	03e00008 	jr	ra
+   2a10c:	00000000 	sll	zero,zero,0x0
+   2a110:	03e00008 	jr	ra
+   2a114:	00000000 	sll	zero,zero,0x0
+
+0002a118 <vfs_kmem_dirent_init>:
+   2a118:	24020010 	addiu	v0,zero,16
+   2a11c:	ac820000 	sw	v0,0(a0)
+   2a120:	3c020003 	lui	v0,0x3
+   2a124:	24427960 	addiu	v0,v0,31072
+   2a128:	ac820004 	sw	v0,4(a0)
+   2a12c:	2402019c 	addiu	v0,zero,412
+   2a130:	ac820008 	sw	v0,8(a0)
+   2a134:	24020003 	addiu	v0,zero,3
+   2a138:	ac82000c 	sw	v0,12(a0)
+   2a13c:	24020006 	addiu	v0,zero,6
+   2a140:	ac820010 	sw	v0,16(a0)
+   2a144:	3c020003 	lui	v0,0x3
+   2a148:	2442a110 	addiu	v0,v0,-24304
+   2a14c:	ac820018 	sw	v0,24(a0)
+   2a150:	ac80001c 	sw	zero,28(a0)
+   2a154:	ac800014 	sw	zero,20(a0)
+   2a158:	03e00008 	jr	ra
+   2a15c:	00001021 	addu	v0,zero,zero
+
+0002a160 <vfs_dirent_set_inload>:
+   2a160:	8c820104 	lw	v0,260(a0)
+   2a164:	34420002 	ori	v0,v0,0x2
+   2a168:	03e00008 	jr	ra
+   2a16c:	ac820104 	sw	v0,260(a0)
+
+0002a170 <vfs_dirent_is_inload>:
+   2a170:	8c820104 	lw	v0,260(a0)
+   2a174:	03e00008 	jr	ra
+   2a178:	30420002 	andi	v0,v0,0x2
+
+0002a17c <vfs_dirent_clear_inload>:
+   2a17c:	8c830104 	lw	v1,260(a0)
+   2a180:	2402fffd 	addiu	v0,zero,-3
+   2a184:	00621024 	and	v0,v1,v0
+   2a188:	03e00008 	jr	ra
+   2a18c:	ac820104 	sw	v0,260(a0)
+
+0002a190 <vfs_inode_lock>:
+   2a190:	27bdffe8 	addiu	sp,sp,-24
+   2a194:	afbf0014 	sw	ra,20(sp)
+   2a198:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a19c:	24840050 	addiu	a0,a0,80
+   2a1a0:	8fbf0014 	lw	ra,20(sp)
+   2a1a4:	00001021 	addu	v0,zero,zero
+   2a1a8:	03e00008 	jr	ra
+   2a1ac:	27bd0018 	addiu	sp,sp,24
+
+0002a1b0 <vfs_icache_lock>:
+   2a1b0:	3c040008 	lui	a0,0x8
+   2a1b4:	08004bc3 	j	12f0c <spinlock_lock>
+   2a1b8:	24840400 	addiu	a0,a0,1024
+
+0002a1bc <vfs_dirent_down>:
+   2a1bc:	27bdffe0 	addiu	sp,sp,-32
+   2a1c0:	afb00014 	sw	s0,20(sp)
+   2a1c4:	afbf001c 	sw	ra,28(sp)
+   2a1c8:	afb10018 	sw	s1,24(sp)
+   2a1cc:	10800016 	beqz	a0,2a228 <vfs_dirent_down+0x6c>
+   2a1d0:	00808021 	addu	s0,a0,zero
+   2a1d4:	3c110008 	lui	s1,0x8
+   2a1d8:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a1dc:	26240420 	addiu	a0,s1,1056
+   2a1e0:	8e020108 	lw	v0,264(s0)
+   2a1e4:	2442ffff 	addiu	v0,v0,-1
+   2a1e8:	14400009 	bnez	v0,2a210 <vfs_dirent_down+0x54>
+   2a1ec:	ae020108 	sw	v0,264(s0)
+   2a1f0:	26220420 	addiu	v0,s1,1056
+   2a1f4:	8c420014 	lw	v0,20(v0)
+   2a1f8:	26030188 	addiu	v1,s0,392
+   2a1fc:	8c440000 	lw	a0,0(v0)
+   2a200:	ae02018c 	sw	v0,396(s0)
+   2a204:	ae040188 	sw	a0,392(s0)
+   2a208:	ac830004 	sw	v1,4(a0)
+   2a20c:	ac430000 	sw	v1,0(v0)
+   2a210:	26240420 	addiu	a0,s1,1056
+   2a214:	8fbf001c 	lw	ra,28(sp)
+   2a218:	8fb10018 	lw	s1,24(sp)
+   2a21c:	8fb00014 	lw	s0,20(sp)
+   2a220:	08004b0b 	j	12c2c <spinlock_unlock>
+   2a224:	27bd0020 	addiu	sp,sp,32
+   2a228:	8fbf001c 	lw	ra,28(sp)
+   2a22c:	8fb10018 	lw	s1,24(sp)
+   2a230:	8fb00014 	lw	s0,20(sp)
+   2a234:	03e00008 	jr	ra
+   2a238:	27bd0020 	addiu	sp,sp,32
+
+0002a23c <vfs_dirent_up>:
+   2a23c:	27bdffe0 	addiu	sp,sp,-32
+   2a240:	afb00014 	sw	s0,20(sp)
+   2a244:	afbf001c 	sw	ra,28(sp)
+   2a248:	afb10018 	sw	s1,24(sp)
+   2a24c:	10800019 	beqz	a0,2a2b4 <vfs_dirent_up+0x78>
+   2a250:	00808021 	addu	s0,a0,zero
+   2a254:	3c110008 	lui	s1,0x8
+   2a258:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a25c:	26240420 	addiu	a0,s1,1056
+   2a260:	8e020108 	lw	v0,264(s0)
+   2a264:	24030001 	addiu	v1,zero,1
+   2a268:	24420001 	addiu	v0,v0,1
+   2a26c:	10430007 	beq	v0,v1,2a28c <vfs_dirent_up+0x50>
+   2a270:	ae020108 	sw	v0,264(s0)
+   2a274:	26240420 	addiu	a0,s1,1056
+   2a278:	8fbf001c 	lw	ra,28(sp)
+   2a27c:	8fb10018 	lw	s1,24(sp)
+   2a280:	8fb00014 	lw	s0,20(sp)
+   2a284:	08004b0b 	j	12c2c <spinlock_unlock>
+   2a288:	27bd0020 	addiu	sp,sp,32
+   2a28c:	8e02018c 	lw	v0,396(s0)
+   2a290:	8e030188 	lw	v1,392(s0)
+   2a294:	26240420 	addiu	a0,s1,1056
+   2a298:	8fbf001c 	lw	ra,28(sp)
+   2a29c:	8fb10018 	lw	s1,24(sp)
+   2a2a0:	8fb00014 	lw	s0,20(sp)
+   2a2a4:	ac620004 	sw	v0,4(v1)
+   2a2a8:	ac430000 	sw	v1,0(v0)
+   2a2ac:	08004b0b 	j	12c2c <spinlock_unlock>
+   2a2b0:	27bd0020 	addiu	sp,sp,32
+   2a2b4:	8fbf001c 	lw	ra,28(sp)
+   2a2b8:	8fb10018 	lw	s1,24(sp)
+   2a2bc:	8fb00014 	lw	s0,20(sp)
+   2a2c0:	03e00008 	jr	ra
+   2a2c4:	27bd0020 	addiu	sp,sp,32
+
+0002a2c8 <vfs_inode_unlock>:
+   2a2c8:	27bdffe8 	addiu	sp,sp,-24
+   2a2cc:	afbf0014 	sw	ra,20(sp)
+   2a2d0:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2a2d4:	24840050 	addiu	a0,a0,80
+   2a2d8:	8fbf0014 	lw	ra,20(sp)
+   2a2dc:	00001021 	addu	v0,zero,zero
+   2a2e0:	03e00008 	jr	ra
+   2a2e4:	27bd0018 	addiu	sp,sp,24
+
+0002a2e8 <vfs_inode_link>:
+   2a2e8:	27bdffd8 	addiu	sp,sp,-40
+   2a2ec:	afb0001c 	sw	s0,28(sp)
+   2a2f0:	afbf0024 	sw	ra,36(sp)
+   2a2f4:	afb10020 	sw	s1,32(sp)
+   2a2f8:	1080001a 	beqz	a0,2a364 <vfs_inode_link+0x7c>
+   2a2fc:	00808021 	addu	s0,a0,zero
+   2a300:	24910050 	addiu	s1,a0,80
+   2a304:	02202021 	addu	a0,s1,zero
+   2a308:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a30c:	afa50010 	sw	a1,16(sp)
+   2a310:	8e020034 	lw	v0,52(s0)
+   2a314:	8fa50010 	lw	a1,16(sp)
+   2a318:	10a2000c 	beq	a1,v0,2a34c <vfs_inode_link+0x64>
+   2a31c:	00000000 	sll	zero,zero,0x0
+   2a320:	8e020020 	lw	v0,32(s0)
+   2a324:	24420001 	addiu	v0,v0,1
+   2a328:	ae020020 	sw	v0,32(s0)
+   2a32c:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2a330:	02202021 	addu	a0,s1,zero
+   2a334:	8fbf0024 	lw	ra,36(sp)
+   2a338:	00001021 	addu	v0,zero,zero
+   2a33c:	8fb10020 	lw	s1,32(sp)
+   2a340:	8fb0001c 	lw	s0,28(sp)
+   2a344:	03e00008 	jr	ra
+   2a348:	27bd0028 	addiu	sp,sp,40
+   2a34c:	8e020010 	lw	v0,16(s0)
+   2a350:	30420002 	andi	v0,v0,0x2
+   2a354:	1040fff5 	beqz	v0,2a32c <vfs_inode_link+0x44>
+   2a358:	00000000 	sll	zero,zero,0x0
+   2a35c:	0800a8c9 	j	2a324 <vfs_inode_link+0x3c>
+   2a360:	8e020020 	lw	v0,32(s0)
+   2a364:	8fbf0024 	lw	ra,36(sp)
+   2a368:	2402ffff 	addiu	v0,zero,-1
+   2a36c:	8fb10020 	lw	s1,32(sp)
+   2a370:	8fb0001c 	lw	s0,28(sp)
+   2a374:	03e00008 	jr	ra
+   2a378:	27bd0028 	addiu	sp,sp,40
+
+0002a37c <vfs_inode_hold>:
+   2a37c:	27bdffd8 	addiu	sp,sp,-40
+   2a380:	afb0001c 	sw	s0,28(sp)
+   2a384:	afbf0024 	sw	ra,36(sp)
+   2a388:	afb10020 	sw	s1,32(sp)
+   2a38c:	1080001b 	beqz	a0,2a3fc <vfs_inode_hold+0x80>
+   2a390:	00808021 	addu	s0,a0,zero
+   2a394:	24910050 	addiu	s1,a0,80
+   2a398:	02202021 	addu	a0,s1,zero
+   2a39c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a3a0:	afa50010 	sw	a1,16(sp)
+   2a3a4:	8e020034 	lw	v0,52(s0)
+   2a3a8:	8fa50010 	lw	a1,16(sp)
+   2a3ac:	10a2000b 	beq	a1,v0,2a3dc <vfs_inode_hold+0x60>
+   2a3b0:	00000000 	sll	zero,zero,0x0
+   2a3b4:	24020055 	addiu	v0,zero,85
+   2a3b8:	02202021 	addu	a0,s1,zero
+   2a3bc:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2a3c0:	afa20010 	sw	v0,16(sp)
+   2a3c4:	8fbf0024 	lw	ra,36(sp)
+   2a3c8:	8fa20010 	lw	v0,16(sp)
+   2a3cc:	8fb10020 	lw	s1,32(sp)
+   2a3d0:	8fb0001c 	lw	s0,28(sp)
+   2a3d4:	03e00008 	jr	ra
+   2a3d8:	27bd0028 	addiu	sp,sp,40
+   2a3dc:	8e020010 	lw	v0,16(s0)
+   2a3e0:	30420002 	andi	v0,v0,0x2
+   2a3e4:	1440fff3 	bnez	v0,2a3b4 <vfs_inode_hold+0x38>
+   2a3e8:	00001021 	addu	v0,zero,zero
+   2a3ec:	8e030040 	lw	v1,64(s0)
+   2a3f0:	24630001 	addiu	v1,v1,1
+   2a3f4:	0800a8ee 	j	2a3b8 <vfs_inode_hold+0x3c>
+   2a3f8:	ae030040 	sw	v1,64(s0)
+   2a3fc:	8fbf0024 	lw	ra,36(sp)
+   2a400:	2402ffff 	addiu	v0,zero,-1
+   2a404:	8fb10020 	lw	s1,32(sp)
+   2a408:	8fb0001c 	lw	s0,28(sp)
+   2a40c:	03e00008 	jr	ra
+   2a410:	27bd0028 	addiu	sp,sp,40
+
+0002a414 <vfs_inode_up>:
+   2a414:	27bdffe0 	addiu	sp,sp,-32
+   2a418:	afb10018 	sw	s1,24(sp)
+   2a41c:	24910050 	addiu	s1,a0,80
+   2a420:	afb00014 	sw	s0,20(sp)
+   2a424:	00808021 	addu	s0,a0,zero
+   2a428:	afbf001c 	sw	ra,28(sp)
+   2a42c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a430:	02202021 	addu	a0,s1,zero
+   2a434:	8e020040 	lw	v0,64(s0)
+   2a438:	02202021 	addu	a0,s1,zero
+   2a43c:	24420001 	addiu	v0,v0,1
+   2a440:	ae020040 	sw	v0,64(s0)
+   2a444:	8fbf001c 	lw	ra,28(sp)
+   2a448:	8fb10018 	lw	s1,24(sp)
+   2a44c:	8fb00014 	lw	s0,20(sp)
+   2a450:	08004b0b 	j	12c2c <spinlock_unlock>
+   2a454:	27bd0020 	addiu	sp,sp,32
+
+0002a458 <ifreelist_get>:
+   2a458:	27bdffe0 	addiu	sp,sp,-32
+   2a45c:	afb00018 	sw	s0,24(sp)
+   2a460:	3c100008 	lui	s0,0x8
+   2a464:	afbf001c 	sw	ra,28(sp)
+   2a468:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a46c:	26040410 	addiu	a0,s0,1040
+   2a470:	3c030008 	lui	v1,0x8
+   2a474:	8c6226f8 	lw	v0,9976(v1)
+   2a478:	246426f8 	addiu	a0,v1,9976
+   2a47c:	1044000c 	beq	v0,a0,2a4b0 <ifreelist_get+0x58>
+   2a480:	26040410 	addiu	a0,s0,1040
+   2a484:	8c440000 	lw	a0,0(v0)
+   2a488:	2442fe38 	addiu	v0,v0,-456
+   2a48c:	ac6426f8 	sw	a0,9976(v1)
+   2a490:	26040410 	addiu	a0,s0,1040
+   2a494:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2a498:	afa20010 	sw	v0,16(sp)
+   2a49c:	8fbf001c 	lw	ra,28(sp)
+   2a4a0:	8fa20010 	lw	v0,16(sp)
+   2a4a4:	8fb00018 	lw	s0,24(sp)
+   2a4a8:	03e00008 	jr	ra
+   2a4ac:	27bd0020 	addiu	sp,sp,32
+   2a4b0:	00001021 	addu	v0,zero,zero
+   2a4b4:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2a4b8:	afa20010 	sw	v0,16(sp)
+   2a4bc:	8fbf001c 	lw	ra,28(sp)
+   2a4c0:	8fa20010 	lw	v0,16(sp)
+   2a4c4:	8fb00018 	lw	s0,24(sp)
+   2a4c8:	03e00008 	jr	ra
+   2a4cc:	27bd0020 	addiu	sp,sp,32
+
+0002a4d0 <ifreelist_add>:
+   2a4d0:	27bdffe0 	addiu	sp,sp,-32
+   2a4d4:	afb00014 	sw	s0,20(sp)
+   2a4d8:	3c100008 	lui	s0,0x8
+   2a4dc:	afb10018 	sw	s1,24(sp)
+   2a4e0:	00808821 	addu	s1,a0,zero
+   2a4e4:	afbf001c 	sw	ra,28(sp)
+   2a4e8:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2a4ec:	26040410 	addiu	a0,s0,1040
+   2a4f0:	3c020008 	lui	v0,0x8
+   2a4f4:	8c4426f8 	lw	a0,9976(v0)
+   2a4f8:	262301c8 	addiu	v1,s1,456
+   2a4fc:	ae2401c8 	sw	a0,456(s1)
+   2a500:	8fbf001c 	lw	ra,28(sp)
+   2a504:	26040410 	addiu	a0,s0,1040
+   2a508:	8fb10018 	lw	s1,24(sp)
+   2a50c:	8fb00014 	lw	s0,20(sp)
+   2a510:	27bd0020 	addiu	sp,sp,32
+   2a514:	08004b0b 	j	12c2c <spinlock_unlock>
+   2a518:	ac4326f8 	sw	v1,9976(v0)
+
+0002a51c <vfs_icache_unlock>:
+   2a51c:	3c040008 	lui	a0,0x8
+   2a520:	08004b0b 	j	12c2c <spinlock_unlock>
+   2a524:	24840400 	addiu	a0,a0,1024
+
+0002a528 <vfs_dirent_init>:
+   2a528:	8ca2009c 	lw	v0,156(a1)
+   2a52c:	27bdffe8 	addiu	sp,sp,-24
+   2a530:	afb00010 	sw	s0,16(sp)
+   2a534:	ac85011c 	sw	a1,284(a0)
+   2a538:	00808021 	addu	s0,a0,zero
+   2a53c:	ac820190 	sw	v0,400(a0)
+   2a540:	ac800180 	sw	zero,384(a0)
+   2a544:	ac800110 	sw	zero,272(a0)
+   2a548:	ac800114 	sw	zero,276(a0)
+   2a54c:	ac800118 	sw	zero,280(a0)
+   2a550:	ac800184 	sw	zero,388(a0)
+   2a554:	ac80010c 	sw	zero,268(a0)
+   2a558:	ac800100 	sw	zero,256(a0)
+   2a55c:	ac800108 	sw	zero,264(a0)
+   2a560:	ac800188 	sw	zero,392(a0)
+   2a564:	ac80018c 	sw	zero,396(a0)
+   2a568:	afbf0014 	sw	ra,20(sp)
+   2a56c:	0c00c4a9 	jal	312a4 <strcpy>
+   2a570:	00c02821 	addu	a1,a2,zero
+   2a574:	ae100120 	sw	s0,288(s0)
+   2a578:	ae000124 	sw	zero,292(s0)
+   2a57c:	02001821 	addu	v1,s0,zero
+   2a580:	00001021 	addu	v0,zero,zero
+   2a584:	2405000a 	addiu	a1,zero,10
+   2a588:	24440026 	addiu	a0,v0,38
+   2a58c:	000420c0 	sll	a0,a0,0x3
+   2a590:	02042021 	addu	a0,s0,a0
+   2a594:	24420001 	addiu	v0,v0,1
+   2a598:	ac640134 	sw	a0,308(v1)
+   2a59c:	ac640130 	sw	a0,304(v1)
+   2a5a0:	1445fff9 	bne	v0,a1,2a588 <vfs_dirent_init+0x60>
+   2a5a4:	24630008 	addiu	v1,v1,8
+   2a5a8:	8fbf0014 	lw	ra,20(sp)
+   2a5ac:	8fb00010 	lw	s0,16(sp)
+   2a5b0:	03e00008 	jr	ra
+   2a5b4:	27bd0018 	addiu	sp,sp,24
+
+0002a5b8 <vfs_dirent_new>:
+   2a5b8:	27bdffd0 	addiu	sp,sp,-48
+   2a5bc:	24020010 	addiu	v0,zero,16
+   2a5c0:	afa20010 	sw	v0,16(sp)
+   2a5c4:	2402019c 	addiu	v0,zero,412
+   2a5c8:	afb00028 	sw	s0,40(sp)
+   2a5cc:	afa20014 	sw	v0,20(sp)
+   2a5d0:	00808021 	addu	s0,a0,zero
+   2a5d4:	3c020002 	lui	v0,0x2
+   2a5d8:	27a40010 	addiu	a0,sp,16
+   2a5dc:	afbf002c 	sw	ra,44(sp)
+   2a5e0:	afa20018 	sw	v0,24(sp)
+   2a5e4:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2a5e8:	afa50020 	sw	a1,32(sp)
+   2a5ec:	10400006 	beqz	v0,2a608 <vfs_dirent_new+0x50>
+   2a5f0:	8fa60020 	lw	a2,32(sp)
+   2a5f4:	00402021 	addu	a0,v0,zero
+   2a5f8:	02002821 	addu	a1,s0,zero
+   2a5fc:	0c00a94a 	jal	2a528 <vfs_dirent_init>
+   2a600:	afa20020 	sw	v0,32(sp)
+   2a604:	8fa20020 	lw	v0,32(sp)
+   2a608:	8fbf002c 	lw	ra,44(sp)
+   2a60c:	8fb00028 	lw	s0,40(sp)
+   2a610:	03e00008 	jr	ra
+   2a614:	27bd0030 	addiu	sp,sp,48
+
+0002a618 <vfs_freelist_init>:
+   2a618:	24830010 	addiu	v1,a0,16
+   2a61c:	3c050003 	lui	a1,0x3
+   2a620:	27bdffe8 	addiu	sp,sp,-24
+   2a624:	ac830014 	sw	v1,20(a0)
+   2a628:	ac830010 	sw	v1,16(a0)
+   2a62c:	afbf0014 	sw	ra,20(sp)
+   2a630:	0c004a24 	jal	12890 <spinlock_init>
+   2a634:	24a57970 	addiu	a1,a1,31088
+   2a638:	8fbf0014 	lw	ra,20(sp)
+   2a63c:	00001021 	addu	v0,zero,zero
+   2a640:	03e00008 	jr	ra
+   2a644:	27bd0018 	addiu	sp,sp,24
+
+0002a648 <vfs_dcache_init>:
+   2a648:	00802821 	addu	a1,a0,zero
+   2a64c:	3c040008 	lui	a0,0x8
+   2a650:	0800a986 	j	2a618 <vfs_freelist_init>
+   2a654:	24840420 	addiu	a0,a0,1056
+
+0002a658 <vfs_inode_size_get_remote>:
+   2a658:	27bdffb0 	addiu	sp,sp,-80
+   2a65c:	3c020004 	lui	v0,0x4
+   2a660:	afb00044 	sw	s0,68(sp)
+   2a664:	afbf004c 	sw	ra,76(sp)
+   2a668:	afb10048 	sw	s1,72(sp)
+   2a66c:	2443c960 	addiu	v1,v0,-13984
+   2a670:	88630003 	lwl	v1,3(v1)
+   2a674:	30b0ffff 	andi	s0,a1,0xffff
+   2a678:	9843c960 	lwr	v1,-13984(v0)
+   2a67c:	3063ffff 	andi	v1,v1,0xffff
+   2a680:	12030024 	beq	s0,v1,2a714 <vfs_inode_size_get_remote+0xbc>
+   2a684:	afa40050 	sw	a0,80(sp)
+   2a688:	40117801 	mfc0	s1,$15,1
+   2a68c:	24020004 	addiu	v0,zero,4
+   2a690:	27a30028 	addiu	v1,sp,40
+   2a694:	afa20030 	sw	v0,48(sp)
+   2a698:	afa20038 	sw	v0,56(sp)
+   2a69c:	27a20050 	addiu	v0,sp,80
+   2a6a0:	afa3002c 	sw	v1,44(sp)
+   2a6a4:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2a6a8:	afa20034 	sw	v0,52(sp)
+   2a6ac:	70501802 	mul	v1,v0,s0
+   2a6b0:	32240003 	andi	a0,s1,0x3
+   2a6b4:	00642021 	addu	a0,v1,a0
+   2a6b8:	27a3002c 	addiu	v1,sp,44
+   2a6bc:	afa30018 	sw	v1,24(sp)
+   2a6c0:	27a30030 	addiu	v1,sp,48
+   2a6c4:	afa3001c 	sw	v1,28(sp)
+   2a6c8:	3c070003 	lui	a3,0x3
+   2a6cc:	27a30034 	addiu	v1,sp,52
+   2a6d0:	24020001 	addiu	v0,zero,1
+   2a6d4:	afa30020 	sw	v1,32(sp)
+   2a6d8:	24e7a76c 	addiu	a3,a3,-22676
+   2a6dc:	27a30038 	addiu	v1,sp,56
+   2a6e0:	24050001 	addiu	a1,zero,1
+   2a6e4:	00003021 	addu	a2,zero,zero
+   2a6e8:	afa30024 	sw	v1,36(sp)
+   2a6ec:	afa20014 	sw	v0,20(sp)
+   2a6f0:	0c003de8 	jal	f7a0 <rppc_generic>
+   2a6f4:	afa20010 	sw	v0,16(sp)
+   2a6f8:	8fa30028 	lw	v1,40(sp)
+   2a6fc:	8fbf004c 	lw	ra,76(sp)
+   2a700:	00601021 	addu	v0,v1,zero
+   2a704:	8fb10048 	lw	s1,72(sp)
+   2a708:	8fb00044 	lw	s0,68(sp)
+   2a70c:	03e00008 	jr	ra
+   2a710:	27bd0050 	addiu	sp,sp,80
+   2a714:	40027801 	mfc0	v0,$15,1
+   2a718:	24840018 	addiu	a0,a0,24
+   2a71c:	0000000f 	sync
+   2a720:	00041025 	or	v0,zero,a0
+   2a724:	8c430000 	lw	v1,0(v0)
+   2a728:	8fbf004c 	lw	ra,76(sp)
+   2a72c:	00601021 	addu	v0,v1,zero
+   2a730:	8fb10048 	lw	s1,72(sp)
+   2a734:	8fb00044 	lw	s0,68(sp)
+   2a738:	03e00008 	jr	ra
+   2a73c:	27bd0050 	addiu	sp,sp,80
+   2a740:	27bdffe0 	addiu	sp,sp,-32
+   2a744:	afbf001c 	sw	ra,28(sp)
+   2a748:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2a74c:	afa40010 	sw	a0,16(sp)
+   2a750:	8fa40010 	lw	a0,16(sp)
+   2a754:	8fbf001c 	lw	ra,28(sp)
+   2a758:	0082001b 	divu	zero,a0,v0
+   2a75c:	004001f4 	teq	v0,zero,0x7
+   2a760:	27bd0020 	addiu	sp,sp,32
+   2a764:	03e00008 	jr	ra
+   2a768:	00001012 	mflo	v0
+
+0002a76c <__inode_size_get_demarshall>:
+   2a76c:	27bdffd8 	addiu	sp,sp,-40
+   2a770:	afbf0024 	sw	ra,36(sp)
+   2a774:	afbe0020 	sw	s8,32(sp)
+   2a778:	afb2001c 	sw	s2,28(sp)
+   2a77c:	03a0f021 	addu	s8,sp,zero
+   2a780:	afb10018 	sw	s1,24(sp)
+   2a784:	afb00014 	sw	s0,20(sp)
+   2a788:	27bdfff0 	addiu	sp,sp,-16
+   2a78c:	27b20010 	addiu	s2,sp,16
+   2a790:	27bdffc8 	addiu	sp,sp,-56
+   2a794:	27b00010 	addiu	s0,sp,16
+   2a798:	00808821 	addu	s1,a0,zero
+   2a79c:	26020028 	addiu	v0,s0,40
+   2a7a0:	8c840000 	lw	a0,0(a0)
+   2a7a4:	2403002c 	addiu	v1,zero,44
+   2a7a8:	ae030008 	sw	v1,8(s0)
+   2a7ac:	ae420000 	sw	v0,0(s2)
+   2a7b0:	24030004 	addiu	v1,zero,4
+   2a7b4:	0c00a9d0 	jal	2a740 <vfs_inode_size_get_remote+0xe8>
+   2a7b8:	ae030024 	sw	v1,36(s0)
+   2a7bc:	02202021 	addu	a0,s1,zero
+   2a7c0:	00002821 	addu	a1,zero,zero
+   2a7c4:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2a7c8:	8e520000 	lw	s2,0(s2)
+   2a7cc:	8c440000 	lw	a0,0(v0)
+   2a7d0:	24840018 	addiu	a0,a0,24
+   2a7d4:	0000000f 	sync
+   2a7d8:	00041025 	or	v0,zero,a0
+   2a7dc:	8c430000 	lw	v1,0(v0)
+   2a7e0:	2406002c 	addiu	a2,zero,44
+   2a7e4:	ae430000 	sw	v1,0(s2)
+   2a7e8:	02202021 	addu	a0,s1,zero
+   2a7ec:	02002821 	addu	a1,s0,zero
+   2a7f0:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2a7f4:	24070001 	addiu	a3,zero,1
+   2a7f8:	03c0e821 	addu	sp,s8,zero
+   2a7fc:	8fbf0024 	lw	ra,36(sp)
+   2a800:	8fbe0020 	lw	s8,32(sp)
+   2a804:	8fb2001c 	lw	s2,28(sp)
+   2a808:	8fb10018 	lw	s1,24(sp)
+   2a80c:	8fb00014 	lw	s0,20(sp)
+   2a810:	03e00008 	jr	ra
+   2a814:	27bd0028 	addiu	sp,sp,40
+
+0002a818 <vfs_inode_trunc>:
+   2a818:	27bdffe0 	addiu	sp,sp,-32
+   2a81c:	afb00010 	sw	s0,16(sp)
+   2a820:	afbf001c 	sw	ra,28(sp)
+   2a824:	00808021 	addu	s0,a0,zero
+   2a828:	afb20018 	sw	s2,24(sp)
+   2a82c:	afb10014 	sw	s1,20(sp)
+   2a830:	24840018 	addiu	a0,a0,24
+   2a834:	0000000f 	sync
+   2a838:	00041025 	or	v0,zero,a0
+   2a83c:	8c430000 	lw	v1,0(v0)
+   2a840:	10600005 	beqz	v1,2a858 <vfs_inode_trunc+0x40>
+   2a844:	8fbf001c 	lw	ra,28(sp)
+   2a848:	8e020008 	lw	v0,8(s0)
+   2a84c:	3042000f 	andi	v0,v0,0xf
+   2a850:	10400008 	beqz	v0,2a874 <vfs_inode_trunc+0x5c>
+   2a854:	261200e0 	addiu	s2,s0,224
+   2a858:	00008821 	addu	s1,zero,zero
+   2a85c:	02201021 	addu	v0,s1,zero
+   2a860:	8fb20018 	lw	s2,24(sp)
+   2a864:	8fb10014 	lw	s1,20(sp)
+   2a868:	8fb00010 	lw	s0,16(sp)
+   2a86c:	03e00008 	jr	ra
+   2a870:	27bd0020 	addiu	sp,sp,32
+   2a874:	0c004408 	jal	11020 <rwlock_wrlock>
+   2a878:	02402021 	addu	a0,s2,zero
+   2a87c:	8e0201bc 	lw	v0,444(s0)
+   2a880:	00002021 	addu	a0,zero,zero
+   2a884:	8c420024 	lw	v0,36(v0)
+   2a888:	00002821 	addu	a1,zero,zero
+   2a88c:	ae040018 	sw	a0,24(s0)
+   2a890:	10400011 	beqz	v0,2a8d8 <vfs_inode_trunc+0xc0>
+   2a894:	ae05001c 	sw	a1,28(s0)
+   2a898:	0040f809 	jalr	v0
+   2a89c:	02002021 	addu	a0,s0,zero
+   2a8a0:	00408821 	addu	s1,v0,zero
+   2a8a4:	8e020014 	lw	v0,20(s0)
+   2a8a8:	34420004 	ori	v0,v0,0x4
+   2a8ac:	ae020014 	sw	v0,20(s0)
+   2a8b0:	0000000f 	sync
+   2a8b4:	0c0043a5 	jal	10e94 <rwlock_unlock>
+   2a8b8:	02402021 	addu	a0,s2,zero
+   2a8bc:	8fbf001c 	lw	ra,28(sp)
+   2a8c0:	02201021 	addu	v0,s1,zero
+   2a8c4:	8fb20018 	lw	s2,24(sp)
+   2a8c8:	8fb10014 	lw	s1,20(sp)
+   2a8cc:	8fb00010 	lw	s0,16(sp)
+   2a8d0:	03e00008 	jr	ra
+   2a8d4:	27bd0020 	addiu	sp,sp,32
+   2a8d8:	0800aa29 	j	2a8a4 <vfs_inode_trunc+0x8c>
+   2a8dc:	00008821 	addu	s1,zero,zero
+   2a8e0:	27bdffe8 	addiu	sp,sp,-24
+   2a8e4:	24a401a0 	addiu	a0,a1,416
+   2a8e8:	aca00034 	sw	zero,52(a1)
+   2a8ec:	aca00040 	sw	zero,64(a1)
+   2a8f0:	aca001c4 	sw	zero,452(a1)
+   2a8f4:	afb00010 	sw	s0,16(sp)
+   2a8f8:	afbf0014 	sw	ra,20(sp)
+   2a8fc:	0c002a41 	jal	a904 <hninit>
+   2a900:	00a08021 	addu	s0,a1,zero
+   2a904:	0c004428 	jal	110a0 <rwlock_init>
+   2a908:	260400e0 	addiu	a0,s0,224
+   2a90c:	3c030003 	lui	v1,0x3
+   2a910:	260201b4 	addiu	v0,s0,436
+   2a914:	24637954 	addiu	v1,v1,31060
+   2a918:	3c050003 	lui	a1,0x3
+   2a91c:	ae0301ac 	sw	v1,428(s0)
+   2a920:	ae0201b8 	sw	v0,440(s0)
+   2a924:	ae0201b4 	sw	v0,436(s0)
+   2a928:	24a57984 	addiu	a1,a1,31108
+   2a92c:	ae0001b0 	sw	zero,432(s0)
+   2a930:	0c004a24 	jal	12890 <spinlock_init>
+   2a934:	26040050 	addiu	a0,s0,80
+   2a938:	3c020003 	lui	v0,0x3
+   2a93c:	24427990 	addiu	v0,v0,31120
+   2a940:	ae020074 	sw	v0,116(s0)
+   2a944:	ae000078 	sw	zero,120(s0)
+   2a948:	02001821 	addu	v1,s0,zero
+   2a94c:	00001021 	addu	v0,zero,zero
+   2a950:	2405000a 	addiu	a1,zero,10
+   2a954:	24440010 	addiu	a0,v0,16
+   2a958:	000420c0 	sll	a0,a0,0x3
+   2a95c:	02042021 	addu	a0,s0,a0
+   2a960:	24840004 	addiu	a0,a0,4
+   2a964:	24420001 	addiu	v0,v0,1
+   2a968:	ac640088 	sw	a0,136(v1)
+   2a96c:	ac640084 	sw	a0,132(v1)
+   2a970:	1445fff8 	bne	v0,a1,2a954 <vfs_inode_trunc+0x13c>
+   2a974:	24630008 	addiu	v1,v1,8
+   2a978:	8fbf0014 	lw	ra,20(sp)
+   2a97c:	8fb00010 	lw	s0,16(sp)
+   2a980:	03e00008 	jr	ra
+   2a984:	27bd0018 	addiu	sp,sp,24
+
+0002a988 <vfs_inode_free>:
+   2a988:	27bdffd8 	addiu	sp,sp,-40
+   2a98c:	afb00020 	sw	s0,32(sp)
+   2a990:	00808021 	addu	s0,a0,zero
+   2a994:	8c8401c4 	lw	a0,452(a0)
+   2a998:	1080000c 	beqz	a0,2a9cc <vfs_inode_free+0x44>
+   2a99c:	afbf0024 	sw	ra,36(sp)
+   2a9a0:	0c007901 	jal	1e404 <mapper_destroy>
+   2a9a4:	00000000 	sll	zero,zero,0x0
+   2a9a8:	8e0201c4 	lw	v0,452(s0)
+   2a9ac:	24030005 	addiu	v1,zero,5
+   2a9b0:	afa2001c 	sw	v0,28(sp)
+   2a9b4:	27a40010 	addiu	a0,sp,16
+   2a9b8:	3c020002 	lui	v0,0x2
+   2a9bc:	afa30010 	sw	v1,16(sp)
+   2a9c0:	0c007134 	jal	1c4d0 <kmem_free>
+   2a9c4:	afa20018 	sw	v0,24(sp)
+   2a9c8:	ae0001c4 	sw	zero,452(s0)
+   2a9cc:	0c00a934 	jal	2a4d0 <ifreelist_add>
+   2a9d0:	02002021 	addu	a0,s0,zero
+   2a9d4:	8fbf0024 	lw	ra,36(sp)
+   2a9d8:	8fb00020 	lw	s0,32(sp)
+   2a9dc:	03e00008 	jr	ra
+   2a9e0:	27bd0028 	addiu	sp,sp,40
+
+0002a9e4 <vfs_inode_down>:
+   2a9e4:	27bdffe0 	addiu	sp,sp,-32
+   2a9e8:	afb00014 	sw	s0,20(sp)
+   2a9ec:	afbf001c 	sw	ra,28(sp)
+   2a9f0:	afb10018 	sw	s1,24(sp)
+   2a9f4:	1080000d 	beqz	a0,2aa2c <vfs_inode_down+0x48>
+   2a9f8:	00808021 	addu	s0,a0,zero
+   2a9fc:	24910050 	addiu	s1,a0,80
+   2aa00:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2aa04:	02202021 	addu	a0,s1,zero
+   2aa08:	8e020040 	lw	v0,64(s0)
+   2aa0c:	2442ffff 	addiu	v0,v0,-1
+   2aa10:	14400004 	bnez	v0,2aa24 <vfs_inode_down+0x40>
+   2aa14:	ae020040 	sw	v0,64(s0)
+   2aa18:	8e020020 	lw	v0,32(s0)
+   2aa1c:	10400009 	beqz	v0,2aa44 <vfs_inode_down+0x60>
+   2aa20:	00000000 	sll	zero,zero,0x0
+   2aa24:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2aa28:	02202021 	addu	a0,s1,zero
+   2aa2c:	00001021 	addu	v0,zero,zero
+   2aa30:	8fbf001c 	lw	ra,28(sp)
+   2aa34:	8fb10018 	lw	s1,24(sp)
+   2aa38:	8fb00014 	lw	s0,20(sp)
+   2aa3c:	03e00008 	jr	ra
+   2aa40:	27bd0020 	addiu	sp,sp,32
+   2aa44:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2aa48:	02202021 	addu	a0,s1,zero
+   2aa4c:	8e0201bc 	lw	v0,444(s0)
+   2aa50:	8c42001c 	lw	v0,28(v0)
+   2aa54:	10400006 	beqz	v0,2aa70 <vfs_inode_down+0x8c>
+   2aa58:	260401d0 	addiu	a0,s0,464
+   2aa5c:	0040f809 	jalr	v0
+   2aa60:	02002021 	addu	a0,s0,zero
+   2aa64:	1440fff3 	bnez	v0,2aa34 <vfs_inode_down+0x50>
+   2aa68:	8fbf001c 	lw	ra,28(sp)
+   2aa6c:	260401d0 	addiu	a0,s0,464
+   2aa70:	0000000f 	sync
+   2aa74:	00041025 	or	v0,zero,a0
+   2aa78:	8c430000 	lw	v1,0(v0)
+   2aa7c:	30630002 	andi	v1,v1,0x2
+   2aa80:	1460fffb 	bnez	v1,2aa70 <vfs_inode_down+0x8c>
+   2aa84:	00000000 	sll	zero,zero,0x0
+   2aa88:	02002021 	addu	a0,s0,zero
+   2aa8c:	0c00aa62 	jal	2a988 <vfs_inode_free>
+   2aa90:	00002821 	addu	a1,zero,zero
+   2aa94:	8fbf001c 	lw	ra,28(sp)
+   2aa98:	00001021 	addu	v0,zero,zero
+   2aa9c:	8fb10018 	lw	s1,24(sp)
+   2aaa0:	8fb00014 	lw	s0,20(sp)
+   2aaa4:	03e00008 	jr	ra
+   2aaa8:	27bd0020 	addiu	sp,sp,32
+
+0002aaac <vfs_inode_init>:
+   2aaac:	27bdffe8 	addiu	sp,sp,-24
+   2aab0:	ac800004 	sw	zero,4(a0)
+   2aab4:	ac800008 	sw	zero,8(a0)
+   2aab8:	ac800010 	sw	zero,16(a0)
+   2aabc:	ac800020 	sw	zero,32(a0)
+   2aac0:	ac800038 	sw	zero,56(a0)
+   2aac4:	ac80003c 	sw	zero,60(a0)
+   2aac8:	afb00010 	sw	s0,16(sp)
+   2aacc:	8ca30000 	lw	v1,0(a1)
+   2aad0:	00808021 	addu	s0,a0,zero
+   2aad4:	8ca20094 	lw	v0,148(a1)
+   2aad8:	8c8401c4 	lw	a0,452(a0)
+   2aadc:	00003021 	addu	a2,zero,zero
+   2aae0:	00003821 	addu	a3,zero,zero
+   2aae4:	afbf0014 	sw	ra,20(sp)
+   2aae8:	ae030024 	sw	v1,36(s0)
+   2aaec:	ae060018 	sw	a2,24(s0)
+   2aaf0:	ae07001c 	sw	a3,28(s0)
+   2aaf4:	ae0201bc 	sw	v0,444(s0)
+   2aaf8:	ae0501c0 	sw	a1,448(s0)
+   2aafc:	ae000060 	sw	zero,96(s0)
+   2ab00:	ae000068 	sw	zero,104(s0)
+   2ab04:	ae00006c 	sw	zero,108(s0)
+   2ab08:	ae000070 	sw	zero,112(s0)
+   2ab0c:	ae000210 	sw	zero,528(s0)
+   2ab10:	10800008 	beqz	a0,2ab34 <vfs_inode_init+0x88>
+   2ab14:	ae000064 	sw	zero,100(s0)
+   2ab18:	00002821 	addu	a1,zero,zero
+   2ab1c:	02003021 	addu	a2,s0,zero
+   2ab20:	0c0073aa 	jal	1cea8 <mapper_init>
+   2ab24:	00003821 	addu	a3,zero,zero
+   2ab28:	14400008 	bnez	v0,2ab4c <vfs_inode_init+0xa0>
+   2ab2c:	8fbf0014 	lw	ra,20(sp)
+   2ab30:	8e0201bc 	lw	v0,444(s0)
+   2ab34:	8c590000 	lw	t9,0(v0)
+   2ab38:	02002021 	addu	a0,s0,zero
+   2ab3c:	8fbf0014 	lw	ra,20(sp)
+   2ab40:	8fb00010 	lw	s0,16(sp)
+   2ab44:	03200008 	jr	t9
+   2ab48:	27bd0018 	addiu	sp,sp,24
+   2ab4c:	8fb00010 	lw	s0,16(sp)
+   2ab50:	03e00008 	jr	ra
+   2ab54:	27bd0018 	addiu	sp,sp,24
+
+0002ab58 <vfs_inode_new>:
+   2ab58:	27bdffc0 	addiu	sp,sp,-64
+   2ab5c:	afb20038 	sw	s2,56(sp)
+   2ab60:	afb00030 	sw	s0,48(sp)
+   2ab64:	afbf003c 	sw	ra,60(sp)
+   2ab68:	afb10034 	sw	s1,52(sp)
+   2ab6c:	0c00a916 	jal	2a458 <ifreelist_get>
+   2ab70:	00809021 	addu	s2,a0,zero
+   2ab74:	1040003f 	beqz	v0,2ac74 <vfs_inode_new+0x11c>
+   2ab78:	00408021 	addu	s0,v0,zero
+   2ab7c:	24110001 	addiu	s1,zero,1
+   2ab80:	8e420004 	lw	v0,4(s2)
+   2ab84:	30420002 	andi	v0,v0,0x2
+   2ab88:	1440000d 	bnez	v0,2abc0 <vfs_inode_new+0x68>
+   2ab8c:	24020005 	addiu	v0,zero,5
+   2ab90:	02402821 	addu	a1,s2,zero
+   2ab94:	0c00aaab 	jal	2aaac <vfs_inode_init>
+   2ab98:	02002021 	addu	a0,s0,zero
+   2ab9c:	1440001d 	bnez	v0,2ac14 <vfs_inode_new+0xbc>
+   2aba0:	24030005 	addiu	v1,zero,5
+   2aba4:	8fbf003c 	lw	ra,60(sp)
+   2aba8:	02001021 	addu	v0,s0,zero
+   2abac:	8fb20038 	lw	s2,56(sp)
+   2abb0:	8fb10034 	lw	s1,52(sp)
+   2abb4:	8fb00030 	lw	s0,48(sp)
+   2abb8:	03e00008 	jr	ra
+   2abbc:	27bd0040 	addiu	sp,sp,64
+   2abc0:	afa20010 	sw	v0,16(sp)
+   2abc4:	2402000c 	addiu	v0,zero,12
+   2abc8:	afa20014 	sw	v0,20(sp)
+   2abcc:	27a40010 	addiu	a0,sp,16
+   2abd0:	3c020002 	lui	v0,0x2
+   2abd4:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2abd8:	afa20018 	sw	v0,24(sp)
+   2abdc:	1440ffec 	bnez	v0,2ab90 <vfs_inode_new+0x38>
+   2abe0:	ae0201c4 	sw	v0,452(s0)
+   2abe4:	12200015 	beqz	s1,2ac3c <vfs_inode_new+0xe4>
+   2abe8:	2402000f 	addiu	v0,zero,15
+   2abec:	0c00a934 	jal	2a4d0 <ifreelist_add>
+   2abf0:	02002021 	addu	a0,s0,zero
+   2abf4:	8fbf003c 	lw	ra,60(sp)
+   2abf8:	00008021 	addu	s0,zero,zero
+   2abfc:	02001021 	addu	v0,s0,zero
+   2ac00:	8fb20038 	lw	s2,56(sp)
+   2ac04:	8fb10034 	lw	s1,52(sp)
+   2ac08:	8fb00030 	lw	s0,48(sp)
+   2ac0c:	03e00008 	jr	ra
+   2ac10:	27bd0040 	addiu	sp,sp,64
+   2ac14:	8e0201c4 	lw	v0,452(s0)
+   2ac18:	afa2002c 	sw	v0,44(sp)
+   2ac1c:	27a40020 	addiu	a0,sp,32
+   2ac20:	3c020002 	lui	v0,0x2
+   2ac24:	afa30020 	sw	v1,32(sp)
+   2ac28:	0c007134 	jal	1c4d0 <kmem_free>
+   2ac2c:	afa20028 	sw	v0,40(sp)
+   2ac30:	1620ffee 	bnez	s1,2abec <vfs_inode_new+0x94>
+   2ac34:	ae0001c4 	sw	zero,452(s0)
+   2ac38:	2402000f 	addiu	v0,zero,15
+   2ac3c:	afa20020 	sw	v0,32(sp)
+   2ac40:	27a40020 	addiu	a0,sp,32
+   2ac44:	24020220 	addiu	v0,zero,544
+   2ac48:	afb0002c 	sw	s0,44(sp)
+   2ac4c:	0c007134 	jal	1c4d0 <kmem_free>
+   2ac50:	afa20024 	sw	v0,36(sp)
+   2ac54:	8fbf003c 	lw	ra,60(sp)
+   2ac58:	00008021 	addu	s0,zero,zero
+   2ac5c:	02001021 	addu	v0,s0,zero
+   2ac60:	8fb20038 	lw	s2,56(sp)
+   2ac64:	8fb10034 	lw	s1,52(sp)
+   2ac68:	8fb00030 	lw	s0,48(sp)
+   2ac6c:	03e00008 	jr	ra
+   2ac70:	27bd0040 	addiu	sp,sp,64
+   2ac74:	2402000f 	addiu	v0,zero,15
+   2ac78:	afa20010 	sw	v0,16(sp)
+   2ac7c:	24020220 	addiu	v0,zero,544
+   2ac80:	afa20014 	sw	v0,20(sp)
+   2ac84:	27a40010 	addiu	a0,sp,16
+   2ac88:	3c020002 	lui	v0,0x2
+   2ac8c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2ac90:	afa20018 	sw	v0,24(sp)
+   2ac94:	1040ffc3 	beqz	v0,2aba4 <vfs_inode_new+0x4c>
+   2ac98:	00408021 	addu	s0,v0,zero
+   2ac9c:	0800aae0 	j	2ab80 <vfs_inode_new+0x28>
+   2aca0:	00008821 	addu	s1,zero,zero
+
+0002aca4 <vfs_inum_new>:
+   2aca4:	27bdffe8 	addiu	sp,sp,-24
+   2aca8:	2484004c 	addiu	a0,a0,76
+   2acac:	afbf0014 	sw	ra,20(sp)
+   2acb0:	0c0019b9 	jal	66e4 <atomic_add>
+   2acb4:	24050001 	addiu	a1,zero,1
+   2acb8:	3c030004 	lui	v1,0x4
+   2acbc:	2464c960 	addiu	a0,v1,-13984
+   2acc0:	88840003 	lwl	a0,3(a0)
+   2acc4:	8fbf0014 	lw	ra,20(sp)
+   2acc8:	9864c960 	lwr	a0,-13984(v1)
+   2accc:	27bd0018 	addiu	sp,sp,24
+   2acd0:	00042400 	sll	a0,a0,0x10
+   2acd4:	03e00008 	jr	ra
+   2acd8:	00441025 	or	v0,v0,a0
+
+0002acdc <__vfs_icache_del>:
+   2acdc:	27bdffe0 	addiu	sp,sp,-32
+   2ace0:	8c8301c0 	lw	v1,448(a0)
+   2ace4:	afb00018 	sw	s0,24(sp)
+   2ace8:	8c820000 	lw	v0,0(a0)
+   2acec:	00808021 	addu	s0,a0,zero
+   2acf0:	3c040008 	lui	a0,0x8
+   2acf4:	24840440 	addiu	a0,a0,1088
+   2acf8:	27a50010 	addiu	a1,sp,16
+   2acfc:	afa30014 	sw	v1,20(sp)
+   2ad00:	afbf001c 	sw	ra,28(sp)
+   2ad04:	0c002ab2 	jal	aac8 <hremove>
+   2ad08:	afa20010 	sw	v0,16(sp)
+   2ad0c:	8e030034 	lw	v1,52(s0)
+   2ad10:	24630001 	addiu	v1,v1,1
+   2ad14:	ae030034 	sw	v1,52(s0)
+   2ad18:	24030002 	addiu	v1,zero,2
+   2ad1c:	0002180a 	movz	v1,zero,v0
+   2ad20:	00601021 	addu	v0,v1,zero
+   2ad24:	0000000f 	sync
+   2ad28:	8fbf001c 	lw	ra,28(sp)
+   2ad2c:	8fb00018 	lw	s0,24(sp)
+   2ad30:	03e00008 	jr	ra
+   2ad34:	27bd0020 	addiu	sp,sp,32
+
+0002ad38 <vfs_icache_del>:
+   2ad38:	27bdffe0 	addiu	sp,sp,-32
+   2ad3c:	afbf001c 	sw	ra,28(sp)
+   2ad40:	0c00a86c 	jal	2a1b0 <vfs_icache_lock>
+   2ad44:	afa40010 	sw	a0,16(sp)
+   2ad48:	0c00ab37 	jal	2acdc <__vfs_icache_del>
+   2ad4c:	8fa40010 	lw	a0,16(sp)
+   2ad50:	0c00a947 	jal	2a51c <vfs_icache_unlock>
+   2ad54:	afa20010 	sw	v0,16(sp)
+   2ad58:	8fbf001c 	lw	ra,28(sp)
+   2ad5c:	8fa20010 	lw	v0,16(sp)
+   2ad60:	03e00008 	jr	ra
+   2ad64:	27bd0020 	addiu	sp,sp,32
+
+0002ad68 <__vfs_unlink_inode_main>:
+   2ad68:	27bdffd8 	addiu	sp,sp,-40
+   2ad6c:	afb0001c 	sw	s0,28(sp)
+   2ad70:	8cf00000 	lw	s0,0(a3)
+   2ad74:	afb10020 	sw	s1,32(sp)
+   2ad78:	26110050 	addiu	s1,s0,80
+   2ad7c:	acc00000 	sw	zero,0(a2)
+   2ad80:	afa60010 	sw	a2,16(sp)
+   2ad84:	afbf0024 	sw	ra,36(sp)
+   2ad88:	0c004bc3 	jal	12f0c <spinlock_lock>
+   2ad8c:	02202021 	addu	a0,s1,zero
+   2ad90:	8e020008 	lw	v0,8(s0)
+   2ad94:	30420001 	andi	v0,v0,0x1
+   2ad98:	1040000c 	beqz	v0,2adcc <__vfs_unlink_inode_main+0x64>
+   2ad9c:	8fa60010 	lw	a2,16(sp)
+   2ada0:	8e020078 	lw	v0,120(s0)
+   2ada4:	10400009 	beqz	v0,2adcc <__vfs_unlink_inode_main+0x64>
+   2ada8:	00000000 	sll	zero,zero,0x0
+   2adac:	24020010 	addiu	v0,zero,16
+   2adb0:	02202021 	addu	a0,s1,zero
+   2adb4:	8fbf0024 	lw	ra,36(sp)
+   2adb8:	8fb10020 	lw	s1,32(sp)
+   2adbc:	8fb0001c 	lw	s0,28(sp)
+   2adc0:	acc20000 	sw	v0,0(a2)
+   2adc4:	08004b0b 	j	12c2c <spinlock_unlock>
+   2adc8:	27bd0028 	addiu	sp,sp,40
+   2adcc:	8e020040 	lw	v0,64(s0)
+   2add0:	2c430002 	sltiu	v1,v0,2
+   2add4:	1060fff5 	beqz	v1,2adac <__vfs_unlink_inode_main+0x44>
+   2add8:	00000000 	sll	zero,zero,0x0
+   2addc:	8e030020 	lw	v1,32(s0)
+   2ade0:	2c640002 	sltiu	a0,v1,2
+   2ade4:	1480000a 	bnez	a0,2ae10 <__vfs_unlink_inode_main+0xa8>
+   2ade8:	02202021 	addu	a0,s1,zero
+   2adec:	2463ffff 	addiu	v1,v1,-1
+   2adf0:	2442ffff 	addiu	v0,v0,-1
+   2adf4:	ae020040 	sw	v0,64(s0)
+   2adf8:	ae030020 	sw	v1,32(s0)
+   2adfc:	8fbf0024 	lw	ra,36(sp)
+   2ae00:	8fb10020 	lw	s1,32(sp)
+   2ae04:	8fb0001c 	lw	s0,28(sp)
+   2ae08:	08004b0b 	j	12c2c <spinlock_unlock>
+   2ae0c:	27bd0028 	addiu	sp,sp,40
+   2ae10:	24040001 	addiu	a0,zero,1
+   2ae14:	10440018 	beq	v0,a0,2ae78 <__vfs_unlink_inode_main+0x110>
+   2ae18:	2463ffff 	addiu	v1,v1,-1
+   2ae1c:	8e040010 	lw	a0,16(s0)
+   2ae20:	2442ffff 	addiu	v0,v0,-1
+   2ae24:	34840002 	ori	a0,a0,0x2
+   2ae28:	ae030020 	sw	v1,32(s0)
+   2ae2c:	ae020040 	sw	v0,64(s0)
+   2ae30:	ae040010 	sw	a0,16(s0)
+   2ae34:	02202021 	addu	a0,s1,zero
+   2ae38:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2ae3c:	afa60010 	sw	a2,16(sp)
+   2ae40:	0c00ab4e 	jal	2ad38 <vfs_icache_del>
+   2ae44:	02002021 	addu	a0,s0,zero
+   2ae48:	8fa60010 	lw	a2,16(sp)
+   2ae4c:	acc20000 	sw	v0,0(a2)
+   2ae50:	8e030010 	lw	v1,16(s0)
+   2ae54:	2402fffd 	addiu	v0,zero,-3
+   2ae58:	00621024 	and	v0,v1,v0
+   2ae5c:	ae020010 	sw	v0,16(s0)
+   2ae60:	0000000f 	sync
+   2ae64:	8fbf0024 	lw	ra,36(sp)
+   2ae68:	8fb10020 	lw	s1,32(sp)
+   2ae6c:	8fb0001c 	lw	s0,28(sp)
+   2ae70:	03e00008 	jr	ra
+   2ae74:	27bd0028 	addiu	sp,sp,40
+   2ae78:	8e020010 	lw	v0,16(s0)
+   2ae7c:	02202021 	addu	a0,s1,zero
+   2ae80:	34420002 	ori	v0,v0,0x2
+   2ae84:	ae020010 	sw	v0,16(s0)
+   2ae88:	0c004b0b 	jal	12c2c <spinlock_unlock>
+   2ae8c:	afa60010 	sw	a2,16(sp)
+   2ae90:	8e0201bc 	lw	v0,444(s0)
+   2ae94:	8c42001c 	lw	v0,28(v0)
+   2ae98:	10400010 	beqz	v0,2aedc <__vfs_unlink_inode_main+0x174>
+   2ae9c:	8fa60010 	lw	a2,16(sp)
+   2aea0:	afa60010 	sw	a2,16(sp)
+   2aea4:	0040f809 	jalr	v0
+   2aea8:	02002021 	addu	a0,s0,zero
+   2aeac:	8fa60010 	lw	a2,16(sp)
+   2aeb0:	acc20000 	sw	v0,0(a2)
+   2aeb4:	1440ffe6 	bnez	v0,2ae50 <__vfs_unlink_inode_main+0xe8>
+   2aeb8:	00000000 	sll	zero,zero,0x0
+   2aebc:	02002021 	addu	a0,s0,zero
+   2aec0:	0c00ab4e 	jal	2ad38 <vfs_icache_del>
+   2aec4:	afa60010 	sw	a2,16(sp)
+   2aec8:	8fa60010 	lw	a2,16(sp)
+   2aecc:	10400005 	beqz	v0,2aee4 <__vfs_unlink_inode_main+0x17c>
+   2aed0:	acc20000 	sw	v0,0(a2)
+   2aed4:	0800abb5 	j	2aed4 <__vfs_unlink_inode_main+0x16c>
+   2aed8:	00000000 	sll	zero,zero,0x0
+   2aedc:	0800abad 	j	2aeb4 <__vfs_unlink_inode_main+0x14c>
+   2aee0:	8cc20000 	lw	v0,0(a2)
+   2aee4:	8e030020 	lw	v1,32(s0)
+   2aee8:	8e020040 	lw	v0,64(s0)
+   2aeec:	2463ffff 	addiu	v1,v1,-1
+   2aef0:	2442ffff 	addiu	v0,v0,-1
+   2aef4:	ae030020 	sw	v1,32(s0)
+   2aef8:	ae020040 	sw	v0,64(s0)
+   2aefc:	02002021 	addu	a0,s0,zero
+   2af00:	8fbf0024 	lw	ra,36(sp)
+   2af04:	8fb10020 	lw	s1,32(sp)
+   2af08:	8fb0001c 	lw	s0,28(sp)
+   2af0c:	00002821 	addu	a1,zero,zero
+   2af10:	0800aa62 	j	2a988 <vfs_inode_free>
+   2af14:	27bd0028 	addiu	sp,sp,40
+
+0002af18 <__vfs_unlink_inode_demarshall>:
+   2af18:	27bdffd0 	addiu	sp,sp,-48
+   2af1c:	afbf002c 	sw	ra,44(sp)
+   2af20:	afbe0028 	sw	s8,40(sp)
+   2af24:	afb30024 	sw	s3,36(sp)
+   2af28:	03a0f021 	addu	s8,sp,zero
+   2af2c:	afb20020 	sw	s2,32(sp)
+   2af30:	afb1001c 	sw	s1,28(sp)
+   2af34:	afb00018 	sw	s0,24(sp)
+   2af38:	27bdfff0 	addiu	sp,sp,-16
+   2af3c:	27b20010 	addiu	s2,sp,16
+   2af40:	27bdffc8 	addiu	sp,sp,-56
+   2af44:	27b00010 	addiu	s0,sp,16
+   2af48:	00808821 	addu	s1,a0,zero
+   2af4c:	26020028 	addiu	v0,s0,40
+   2af50:	8c840000 	lw	a0,0(a0)
+   2af54:	2403002c 	addiu	v1,zero,44
+   2af58:	ae030008 	sw	v1,8(s0)
+   2af5c:	ae420000 	sw	v0,0(s2)
+   2af60:	24030004 	addiu	v1,zero,4
+   2af64:	0c00a9d0 	jal	2a740 <vfs_inode_size_get_remote+0xe8>
+   2af68:	ae030024 	sw	v1,36(s0)
+   2af6c:	8e460000 	lw	a2,0(s2)
+   2af70:	02202021 	addu	a0,s1,zero
+   2af74:	8e320000 	lw	s2,0(s1)
+   2af78:	00002821 	addu	a1,zero,zero
+   2af7c:	00409821 	addu	s3,v0,zero
+   2af80:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2af84:	afc60010 	sw	a2,16(s8)
+   2af88:	8fc60010 	lw	a2,16(s8)
+   2af8c:	00403821 	addu	a3,v0,zero
+   2af90:	3264ffff 	andi	a0,s3,0xffff
+   2af94:	0c00ab5a 	jal	2ad68 <__vfs_unlink_inode_main>
+   2af98:	02402821 	addu	a1,s2,zero
+   2af9c:	02202021 	addu	a0,s1,zero
+   2afa0:	02002821 	addu	a1,s0,zero
+   2afa4:	2406002c 	addiu	a2,zero,44
+   2afa8:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2afac:	24070001 	addiu	a3,zero,1
+   2afb0:	03c0e821 	addu	sp,s8,zero
+   2afb4:	8fbf002c 	lw	ra,44(sp)
+   2afb8:	8fbe0028 	lw	s8,40(sp)
+   2afbc:	8fb30024 	lw	s3,36(sp)
+   2afc0:	8fb20020 	lw	s2,32(sp)
+   2afc4:	8fb1001c 	lw	s1,28(sp)
+   2afc8:	8fb00018 	lw	s0,24(sp)
+   2afcc:	03e00008 	jr	ra
+   2afd0:	27bd0030 	addiu	sp,sp,48
+
+0002afd4 <__vfs_unlink_inode_local>:
+   2afd4:	00803021 	addu	a2,a0,zero
+   2afd8:	00a03821 	addu	a3,a1,zero
+   2afdc:	40057801 	mfc0	a1,$15,1
+   2afe0:	3c020004 	lui	v0,0x4
+   2afe4:	2443c960 	addiu	v1,v0,-13984
+   2afe8:	88640003 	lwl	a0,3(v1)
+   2afec:	30a50003 	andi	a1,a1,0x3
+   2aff0:	3c030004 	lui	v1,0x4
+   2aff4:	00052880 	sll	a1,a1,0x2
+   2aff8:	2463c950 	addiu	v1,v1,-14000
+   2affc:	9844c960 	lwr	a0,-13984(v0)
+   2b000:	00a31021 	addu	v0,a1,v1
+   2b004:	8c450000 	lw	a1,0(v0)
+   2b008:	0800ab5a 	j	2ad68 <__vfs_unlink_inode_main>
+   2b00c:	3084ffff 	andi	a0,a0,0xffff
+
+0002b010 <vfs_unlink_inode>:
+   2b010:	27bdffb0 	addiu	sp,sp,-80
+   2b014:	3c020004 	lui	v0,0x4
+   2b018:	afb00044 	sw	s0,68(sp)
+   2b01c:	2443c960 	addiu	v1,v0,-13984
+   2b020:	afbf004c 	sw	ra,76(sp)
+   2b024:	afb10048 	sw	s1,72(sp)
+   2b028:	88630003 	lwl	v1,3(v1)
+   2b02c:	94900004 	lhu	s0,4(a0)
+   2b030:	9843c960 	lwr	v1,-13984(v0)
+   2b034:	24020004 	addiu	v0,zero,4
+   2b038:	00802821 	addu	a1,a0,zero
+   2b03c:	afa20030 	sw	v0,48(sp)
+   2b040:	27a40028 	addiu	a0,sp,40
+   2b044:	2402000c 	addiu	v0,zero,12
+   2b048:	3063ffff 	andi	v1,v1,0xffff
+   2b04c:	afa20038 	sw	v0,56(sp)
+   2b050:	afa4002c 	sw	a0,44(sp)
+   2b054:	1203001d 	beq	s0,v1,2b0cc <vfs_unlink_inode+0xbc>
+   2b058:	afa50034 	sw	a1,52(sp)
+   2b05c:	40117801 	mfc0	s1,$15,1
+   2b060:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2b064:	00000000 	sll	zero,zero,0x0
+   2b068:	70501802 	mul	v1,v0,s0
+   2b06c:	32240003 	andi	a0,s1,0x3
+   2b070:	00642021 	addu	a0,v1,a0
+   2b074:	27a3002c 	addiu	v1,sp,44
+   2b078:	afa30018 	sw	v1,24(sp)
+   2b07c:	27a30030 	addiu	v1,sp,48
+   2b080:	afa3001c 	sw	v1,28(sp)
+   2b084:	3c070003 	lui	a3,0x3
+   2b088:	27a30034 	addiu	v1,sp,52
+   2b08c:	24020001 	addiu	v0,zero,1
+   2b090:	afa30020 	sw	v1,32(sp)
+   2b094:	24e7af18 	addiu	a3,a3,-20712
+   2b098:	27a30038 	addiu	v1,sp,56
+   2b09c:	24050001 	addiu	a1,zero,1
+   2b0a0:	00003021 	addu	a2,zero,zero
+   2b0a4:	afa20014 	sw	v0,20(sp)
+   2b0a8:	afa30024 	sw	v1,36(sp)
+   2b0ac:	0c003de8 	jal	f7a0 <rppc_generic>
+   2b0b0:	afa20010 	sw	v0,16(sp)
+   2b0b4:	8fbf004c 	lw	ra,76(sp)
+   2b0b8:	8fa20028 	lw	v0,40(sp)
+   2b0bc:	8fb10048 	lw	s1,72(sp)
+   2b0c0:	8fb00044 	lw	s0,68(sp)
+   2b0c4:	03e00008 	jr	ra
+   2b0c8:	27bd0050 	addiu	sp,sp,80
+   2b0cc:	0c00abf5 	jal	2afd4 <__vfs_unlink_inode_local>
+   2b0d0:	00000000 	sll	zero,zero,0x0
+   2b0d4:	8fbf004c 	lw	ra,76(sp)
+   2b0d8:	8fa20028 	lw	v0,40(sp)
+   2b0dc:	8fb10048 	lw	s1,72(sp)
+   2b0e0:	8fb00044 	lw	s0,68(sp)
+   2b0e4:	03e00008 	jr	ra
+   2b0e8:	27bd0050 	addiu	sp,sp,80
+
+0002b0ec <vfs_icache_add>:
+   2b0ec:	8c830000 	lw	v1,0(a0)
+   2b0f0:	8c8201c0 	lw	v0,448(a0)
+   2b0f4:	27bdffd0 	addiu	sp,sp,-48
+   2b0f8:	afbf002c 	sw	ra,44(sp)
+   2b0fc:	afb10028 	sw	s1,40(sp)
+   2b100:	afb00024 	sw	s0,36(sp)
+   2b104:	00808821 	addu	s1,a0,zero
+   2b108:	afa30018 	sw	v1,24(sp)
+   2b10c:	0c00a86c 	jal	2a1b0 <vfs_icache_lock>
+   2b110:	afa2001c 	sw	v0,28(sp)
+   2b114:	3c040008 	lui	a0,0x8
+   2b118:	24840440 	addiu	a0,a0,1088
+   2b11c:	262501a0 	addiu	a1,s1,416
+   2b120:	0c002a86 	jal	aa18 <hinsert>
+   2b124:	27a60018 	addiu	a2,sp,24
+   2b128:	1040000d 	beqz	v0,2b160 <vfs_icache_add+0x74>
+   2b12c:	00408021 	addu	s0,v0,zero
+   2b130:	3c020004 	lui	v0,0x4
+   2b134:	8e230000 	lw	v1,0(s1)
+   2b138:	8c449100 	lw	a0,-28416(v0)
+   2b13c:	3c060003 	lui	a2,0x3
+   2b140:	8e2201c0 	lw	v0,448(s1)
+   2b144:	3c070003 	lui	a3,0x3
+   2b148:	24c679a4 	addiu	a2,a2,31140
+   2b14c:	24e779e4 	addiu	a3,a3,31204
+   2b150:	00002821 	addu	a1,zero,zero
+   2b154:	afa30010 	sw	v1,16(sp)
+   2b158:	0c0009b0 	jal	26c0 <__fprintk>
+   2b15c:	afa20014 	sw	v0,20(sp)
+   2b160:	0c00a947 	jal	2a51c <vfs_icache_unlock>
+   2b164:	00000000 	sll	zero,zero,0x0
+   2b168:	8fbf002c 	lw	ra,44(sp)
+   2b16c:	02001021 	addu	v0,s0,zero
+   2b170:	8fb10028 	lw	s1,40(sp)
+   2b174:	8fb00024 	lw	s0,36(sp)
+   2b178:	03e00008 	jr	ra
+   2b17c:	27bd0030 	addiu	sp,sp,48
+
+0002b180 <__vfs_create_inode_main>:
+   2b180:	27bdffc8 	addiu	sp,sp,-56
+   2b184:	8fa50048 	lw	a1,72(sp)
+   2b188:	acc00000 	sw	zero,0(a2)
+   2b18c:	8ca4000c 	lw	a0,12(a1)
+   2b190:	afb20030 	sw	s2,48(sp)
+   2b194:	afb1002c 	sw	s1,44(sp)
+   2b198:	afb00028 	sw	s0,40(sp)
+   2b19c:	afa50020 	sw	a1,32(sp)
+   2b1a0:	afbf0034 	sw	ra,52(sp)
+   2b1a4:	00c08021 	addu	s0,a2,zero
+   2b1a8:	0c00aad6 	jal	2ab58 <vfs_inode_new>
+   2b1ac:	00e09021 	addu	s2,a3,zero
+   2b1b0:	00408821 	addu	s1,v0,zero
+   2b1b4:	1040003a 	beqz	v0,2b2a0 <__vfs_create_inode_main+0x120>
+   2b1b8:	8fa50020 	lw	a1,32(sp)
+   2b1bc:	8c4201bc 	lw	v0,444(v0)
+   2b1c0:	8ca30008 	lw	v1,8(a1)
+   2b1c4:	8caa001c 	lw	t2,28(a1)
+   2b1c8:	8ca90014 	lw	t1,20(a1)
+   2b1cc:	8ca80018 	lw	t0,24(a1)
+   2b1d0:	8ca60000 	lw	a2,0(a1)
+   2b1d4:	8ca40004 	lw	a0,4(a1)
+   2b1d8:	8ca70010 	lw	a3,16(a1)
+   2b1dc:	8c420008 	lw	v0,8(v0)
+   2b1e0:	ae230070 	sw	v1,112(s1)
+   2b1e4:	24030001 	addiu	v1,zero,1
+   2b1e8:	ae2a0018 	sw	t2,24(s1)
+   2b1ec:	ae290008 	sw	t1,8(s1)
+   2b1f0:	ae280000 	sw	t0,0(s1)
+   2b1f4:	ae270060 	sw	a3,96(s1)
+   2b1f8:	ae260068 	sw	a2,104(s1)
+   2b1fc:	ae24006c 	sw	a0,108(s1)
+   2b200:	ae230020 	sw	v1,32(s1)
+   2b204:	10400005 	beqz	v0,2b21c <__vfs_create_inode_main+0x9c>
+   2b208:	ae20001c 	sw	zero,28(s1)
+   2b20c:	0040f809 	jalr	v0
+   2b210:	02202021 	addu	a0,s1,zero
+   2b214:	14400015 	bnez	v0,2b26c <__vfs_create_inode_main+0xec>
+   2b218:	ae020000 	sw	v0,0(s0)
+   2b21c:	8e230034 	lw	v1,52(s1)
+   2b220:	3c020004 	lui	v0,0x4
+   2b224:	ae430008 	sw	v1,8(s2)
+   2b228:	ae510000 	sw	s1,0(s2)
+   2b22c:	2443c960 	addiu	v1,v0,-13984
+   2b230:	88630003 	lwl	v1,3(v1)
+   2b234:	8e240040 	lw	a0,64(s1)
+   2b238:	9843c960 	lwr	v1,-13984(v0)
+   2b23c:	24820001 	addiu	v0,a0,1
+   2b240:	a6430004 	sh	v1,4(s2)
+   2b244:	ae220040 	sw	v0,64(s1)
+   2b248:	0c00ac3b 	jal	2b0ec <vfs_icache_add>
+   2b24c:	02202021 	addu	a0,s1,zero
+   2b250:	8fbf0034 	lw	ra,52(sp)
+   2b254:	ae020000 	sw	v0,0(s0)
+   2b258:	8fb20030 	lw	s2,48(sp)
+   2b25c:	8fb1002c 	lw	s1,44(sp)
+   2b260:	8fb00028 	lw	s0,40(sp)
+   2b264:	03e00008 	jr	ra
+   2b268:	27bd0038 	addiu	sp,sp,56
+   2b26c:	2402000f 	addiu	v0,zero,15
+   2b270:	afa20010 	sw	v0,16(sp)
+   2b274:	27a40010 	addiu	a0,sp,16
+   2b278:	24020220 	addiu	v0,zero,544
+   2b27c:	afb1001c 	sw	s1,28(sp)
+   2b280:	0c007134 	jal	1c4d0 <kmem_free>
+   2b284:	afa20014 	sw	v0,20(sp)
+   2b288:	8fbf0034 	lw	ra,52(sp)
+   2b28c:	8fb20030 	lw	s2,48(sp)
+   2b290:	8fb1002c 	lw	s1,44(sp)
+   2b294:	8fb00028 	lw	s0,40(sp)
+   2b298:	03e00008 	jr	ra
+   2b29c:	27bd0038 	addiu	sp,sp,56
+   2b2a0:	8fbf0034 	lw	ra,52(sp)
+   2b2a4:	2402000c 	addiu	v0,zero,12
+   2b2a8:	ae020000 	sw	v0,0(s0)
+   2b2ac:	8fb20030 	lw	s2,48(sp)
+   2b2b0:	8fb1002c 	lw	s1,44(sp)
+   2b2b4:	8fb00028 	lw	s0,40(sp)
+   2b2b8:	03e00008 	jr	ra
+   2b2bc:	27bd0038 	addiu	sp,sp,56
+
+0002b2c0 <__vfs_create_inode_demarshall>:
+   2b2c0:	27bdffc0 	addiu	sp,sp,-64
+   2b2c4:	afbf003c 	sw	ra,60(sp)
+   2b2c8:	afbe0038 	sw	s8,56(sp)
+   2b2cc:	afb40034 	sw	s4,52(sp)
+   2b2d0:	03a0f021 	addu	s8,sp,zero
+   2b2d4:	afb30030 	sw	s3,48(sp)
+   2b2d8:	afb2002c 	sw	s2,44(sp)
+   2b2dc:	afb10028 	sw	s1,40(sp)
+   2b2e0:	afb00024 	sw	s0,36(sp)
+   2b2e4:	27bdfff0 	addiu	sp,sp,-16
+   2b2e8:	27b40018 	addiu	s4,sp,24
+   2b2ec:	27bdffb8 	addiu	sp,sp,-72
+   2b2f0:	27b00018 	addiu	s0,sp,24
+   2b2f4:	2405003c 	addiu	a1,zero,60
+   2b2f8:	00808821 	addu	s1,a0,zero
+   2b2fc:	ae050008 	sw	a1,8(s0)
+   2b300:	8c840000 	lw	a0,0(a0)
+   2b304:	24050004 	addiu	a1,zero,4
+   2b308:	2603002c 	addiu	v1,s0,44
+   2b30c:	26020030 	addiu	v0,s0,48
+   2b310:	ae050024 	sw	a1,36(s0)
+   2b314:	2405000c 	addiu	a1,zero,12
+   2b318:	ae830000 	sw	v1,0(s4)
+   2b31c:	ae050028 	sw	a1,40(s0)
+   2b320:	0c00a9d0 	jal	2a740 <vfs_inode_size_get_remote+0xe8>
+   2b324:	ae820004 	sw	v0,4(s4)
+   2b328:	8e870004 	lw	a3,4(s4)
+   2b32c:	8e860000 	lw	a2,0(s4)
+   2b330:	8e320000 	lw	s2,0(s1)
+   2b334:	02202021 	addu	a0,s1,zero
+   2b338:	00002821 	addu	a1,zero,zero
+   2b33c:	00409821 	addu	s3,v0,zero
+   2b340:	afc6001c 	sw	a2,28(s8)
+   2b344:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2b348:	afc70018 	sw	a3,24(s8)
+   2b34c:	8fc6001c 	lw	a2,28(s8)
+   2b350:	8fc70018 	lw	a3,24(s8)
+   2b354:	3264ffff 	andi	a0,s3,0xffff
+   2b358:	02402821 	addu	a1,s2,zero
+   2b35c:	0c00ac60 	jal	2b180 <__vfs_create_inode_main>
+   2b360:	afa20010 	sw	v0,16(sp)
+   2b364:	02202021 	addu	a0,s1,zero
+   2b368:	02002821 	addu	a1,s0,zero
+   2b36c:	2406003c 	addiu	a2,zero,60
+   2b370:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2b374:	24070002 	addiu	a3,zero,2
+   2b378:	03c0e821 	addu	sp,s8,zero
+   2b37c:	8fbf003c 	lw	ra,60(sp)
+   2b380:	8fbe0038 	lw	s8,56(sp)
+   2b384:	8fb40034 	lw	s4,52(sp)
+   2b388:	8fb30030 	lw	s3,48(sp)
+   2b38c:	8fb2002c 	lw	s2,44(sp)
+   2b390:	8fb10028 	lw	s1,40(sp)
+   2b394:	8fb00024 	lw	s0,36(sp)
+   2b398:	03e00008 	jr	ra
+   2b39c:	27bd0040 	addiu	sp,sp,64
+
+0002b3a0 <__vfs_create_inode_local>:
+   2b3a0:	27bdffe0 	addiu	sp,sp,-32
+   2b3a4:	afbf001c 	sw	ra,28(sp)
+   2b3a8:	00801821 	addu	v1,a0,zero
+   2b3ac:	00a03821 	addu	a3,a1,zero
+   2b3b0:	00c01021 	addu	v0,a2,zero
+   2b3b4:	40067801 	mfc0	a2,$15,1
+   2b3b8:	3c050004 	lui	a1,0x4
+   2b3bc:	24a4c960 	addiu	a0,a1,-13984
+   2b3c0:	88840003 	lwl	a0,3(a0)
+   2b3c4:	30c60003 	andi	a2,a2,0x3
+   2b3c8:	3c080004 	lui	t0,0x4
+   2b3cc:	2508c950 	addiu	t0,t0,-14000
+   2b3d0:	00063080 	sll	a2,a2,0x2
+   2b3d4:	00c83021 	addu	a2,a2,t0
+   2b3d8:	98a4c960 	lwr	a0,-13984(a1)
+   2b3dc:	8cc50000 	lw	a1,0(a2)
+   2b3e0:	3084ffff 	andi	a0,a0,0xffff
+   2b3e4:	00603021 	addu	a2,v1,zero
+   2b3e8:	0c00ac60 	jal	2b180 <__vfs_create_inode_main>
+   2b3ec:	afa20010 	sw	v0,16(sp)
+   2b3f0:	8fbf001c 	lw	ra,28(sp)
+   2b3f4:	03e00008 	jr	ra
+   2b3f8:	27bd0020 	addiu	sp,sp,32
+
+0002b3fc <vfs_create_inode>:
+   2b3fc:	27bdff98 	addiu	sp,sp,-104
+   2b400:	afb10058 	sw	s1,88(sp)
+   2b404:	afb00054 	sw	s0,84(sp)
+   2b408:	afbf0064 	sw	ra,100(sp)
+   2b40c:	afb30060 	sw	s3,96(sp)
+   2b410:	afb2005c 	sw	s2,92(sp)
+   2b414:	00808821 	addu	s1,a0,zero
+   2b418:	8c900010 	lw	s0,16(a0)
+   2b41c:	40042002 	mfc0	a0,$4,2
+   2b420:	3c020004 	lui	v0,0x4
+   2b424:	2443c960 	addiu	v1,v0,-13984
+   2b428:	88630003 	lwl	v1,3(v1)
+   2b42c:	94920150 	lhu	s2,336(a0)
+   2b430:	9843c960 	lwr	v1,-13984(v0)
+   2b434:	24020004 	addiu	v0,zero,4
+   2b438:	afa2003c 	sw	v0,60(sp)
+   2b43c:	2402000c 	addiu	v0,zero,12
+   2b440:	27a40028 	addiu	a0,sp,40
+   2b444:	27a50044 	addiu	a1,sp,68
+   2b448:	afa20040 	sw	v0,64(sp)
+   2b44c:	3063ffff 	andi	v1,v1,0xffff
+   2b450:	2402002c 	addiu	v0,zero,44
+   2b454:	afa20030 	sw	v0,48(sp)
+   2b458:	afa40034 	sw	a0,52(sp)
+   2b45c:	afa50038 	sw	a1,56(sp)
+   2b460:	12430029 	beq	s2,v1,2b508 <vfs_create_inode+0x10c>
+   2b464:	afb1002c 	sw	s1,44(sp)
+   2b468:	40137801 	mfc0	s3,$15,1
+   2b46c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2b470:	00000000 	sll	zero,zero,0x0
+   2b474:	70521802 	mul	v1,v0,s2
+   2b478:	24020002 	addiu	v0,zero,2
+   2b47c:	afa20010 	sw	v0,16(sp)
+   2b480:	24020001 	addiu	v0,zero,1
+   2b484:	afa20014 	sw	v0,20(sp)
+   2b488:	27a20034 	addiu	v0,sp,52
+   2b48c:	afa20018 	sw	v0,24(sp)
+   2b490:	27a2003c 	addiu	v0,sp,60
+   2b494:	32640003 	andi	a0,s3,0x3
+   2b498:	3c070003 	lui	a3,0x3
+   2b49c:	afa2001c 	sw	v0,28(sp)
+   2b4a0:	27a2002c 	addiu	v0,sp,44
+   2b4a4:	afa20020 	sw	v0,32(sp)
+   2b4a8:	00642021 	addu	a0,v1,a0
+   2b4ac:	27a20030 	addiu	v0,sp,48
+   2b4b0:	24e7b2c0 	addiu	a3,a3,-19776
+   2b4b4:	24050001 	addiu	a1,zero,1
+   2b4b8:	00003021 	addu	a2,zero,zero
+   2b4bc:	0c003de8 	jal	f7a0 <rppc_generic>
+   2b4c0:	afa20024 	sw	v0,36(sp)
+   2b4c4:	8fa3004c 	lw	v1,76(sp)
+   2b4c8:	8fa40048 	lw	a0,72(sp)
+   2b4cc:	8fa50044 	lw	a1,68(sp)
+   2b4d0:	ae040114 	sw	a0,276(s0)
+   2b4d4:	ae050110 	sw	a1,272(s0)
+   2b4d8:	ae030118 	sw	v1,280(s0)
+   2b4dc:	8e230018 	lw	v1,24(s1)
+   2b4e0:	8fbf0064 	lw	ra,100(sp)
+   2b4e4:	ae03010c 	sw	v1,268(s0)
+   2b4e8:	8fa30028 	lw	v1,40(sp)
+   2b4ec:	8fb30060 	lw	s3,96(sp)
+   2b4f0:	00431025 	or	v0,v0,v1
+   2b4f4:	8fb2005c 	lw	s2,92(sp)
+   2b4f8:	8fb10058 	lw	s1,88(sp)
+   2b4fc:	8fb00054 	lw	s0,84(sp)
+   2b500:	03e00008 	jr	ra
+   2b504:	27bd0068 	addiu	sp,sp,104
+   2b508:	0c00ace8 	jal	2b3a0 <__vfs_create_inode_local>
+   2b50c:	02203021 	addu	a2,s1,zero
+   2b510:	0800ad31 	j	2b4c4 <vfs_create_inode+0xc8>
+   2b514:	00001021 	addu	v0,zero,zero
+
+0002b518 <vfs_icache_init>:
+   2b518:	27bdffe0 	addiu	sp,sp,-32
+   2b51c:	afb00018 	sw	s0,24(sp)
+   2b520:	3c100008 	lui	s0,0x8
+   2b524:	26040440 	addiu	a0,s0,1088
+   2b528:	afbf001c 	sw	ra,28(sp)
+   2b52c:	0c002ad4 	jal	ab50 <hhalloc>
+   2b530:	3c050009 	lui	a1,0x9
+   2b534:	10400005 	beqz	v0,2b54c <vfs_icache_init+0x34>
+   2b538:	3c060003 	lui	a2,0x3
+   2b53c:	8fbf001c 	lw	ra,28(sp)
+   2b540:	8fb00018 	lw	s0,24(sp)
+   2b544:	03e00008 	jr	ra
+   2b548:	27bd0020 	addiu	sp,sp,32
+   2b54c:	3c050003 	lui	a1,0x3
+   2b550:	26040440 	addiu	a0,s0,1088
+   2b554:	24a59ef8 	addiu	a1,a1,-24840
+   2b558:	0c002a3d 	jal	a8f4 <hhinit>
+   2b55c:	24c69f20 	addiu	a2,a2,-24800
+   2b560:	1440fff7 	bnez	v0,2b540 <vfs_icache_init+0x28>
+   2b564:	8fbf001c 	lw	ra,28(sp)
+   2b568:	3c040008 	lui	a0,0x8
+   2b56c:	3c050003 	lui	a1,0x3
+   2b570:	24840400 	addiu	a0,a0,1024
+   2b574:	24a579d0 	addiu	a1,a1,31184
+   2b578:	0c004a24 	jal	12890 <spinlock_init>
+   2b57c:	afa20010 	sw	v0,16(sp)
+   2b580:	3c040008 	lui	a0,0x8
+   2b584:	3c050003 	lui	a1,0x3
+   2b588:	24840410 	addiu	a0,a0,1040
+   2b58c:	0c004a24 	jal	12890 <spinlock_init>
+   2b590:	24a579d8 	addiu	a1,a1,31192
+   2b594:	3c030008 	lui	v1,0x8
+   2b598:	8fbf001c 	lw	ra,28(sp)
+   2b59c:	246426f8 	addiu	a0,v1,9976
+   2b5a0:	8fa20010 	lw	v0,16(sp)
+   2b5a4:	8fb00018 	lw	s0,24(sp)
+   2b5a8:	ac6426f8 	sw	a0,9976(v1)
+   2b5ac:	03e00008 	jr	ra
+   2b5b0:	27bd0020 	addiu	sp,sp,32
+
+0002b5b4 <vfs_cache_init>:
+   2b5b4:	27bdffe8 	addiu	sp,sp,-24
+   2b5b8:	afbf0014 	sw	ra,20(sp)
+   2b5bc:	0c00a992 	jal	2a648 <vfs_dcache_init>
+   2b5c0:	24040028 	addiu	a0,zero,40
+   2b5c4:	10400003 	beqz	v0,2b5d4 <vfs_cache_init+0x20>
+   2b5c8:	8fbf0014 	lw	ra,20(sp)
+   2b5cc:	03e00008 	jr	ra
+   2b5d0:	27bd0018 	addiu	sp,sp,24
+   2b5d4:	24040028 	addiu	a0,zero,40
+   2b5d8:	0800ad46 	j	2b518 <vfs_icache_init>
+   2b5dc:	27bd0018 	addiu	sp,sp,24
+
+0002b5e0 <vfs_kmem_file_remote_init>:
+   2b5e0:	24020011 	addiu	v0,zero,17
+   2b5e4:	ac820000 	sw	v0,0(a0)
+   2b5e8:	3c020003 	lui	v0,0x3
+   2b5ec:	244279f4 	addiu	v0,v0,31220
+   2b5f0:	ac820004 	sw	v0,4(a0)
+   2b5f4:	24020120 	addiu	v0,zero,288
+   2b5f8:	ac820008 	sw	v0,8(a0)
+   2b5fc:	24020003 	addiu	v0,zero,3
+   2b600:	ac82000c 	sw	v0,12(a0)
+   2b604:	24020005 	addiu	v0,zero,5
+   2b608:	ac820010 	sw	v0,16(a0)
+   2b60c:	3c020003 	lui	v0,0x3
+   2b610:	2442c0b0 	addiu	v0,v0,-16208
+   2b614:	ac820018 	sw	v0,24(a0)
+   2b618:	ac80001c 	sw	zero,28(a0)
+   2b61c:	ac800014 	sw	zero,20(a0)
+   2b620:	03e00008 	jr	ra
+   2b624:	00001021 	addu	v0,zero,zero
+
+0002b628 <vfs_default_munmap_file>:
+   2b628:	03e00008 	jr	ra
+   2b62c:	00001021 	addu	v0,zero,zero
+
+0002b630 <vfs_default_write>:
+   2b630:	8c820008 	lw	v0,8(a0)
+   2b634:	27bdffa8 	addiu	sp,sp,-88
+   2b638:	30420002 	andi	v0,v0,0x2
+   2b63c:	afbe0050 	sw	s8,80(sp)
+   2b640:	afb00044 	sw	s0,68(sp)
+   2b644:	afbf0054 	sw	ra,84(sp)
+   2b648:	afb2004c 	sw	s2,76(sp)
+   2b64c:	afb10048 	sw	s1,72(sp)
+   2b650:	03a0f021 	addu	s8,sp,zero
+   2b654:	14400029 	bnez	v0,2b6fc <vfs_default_write+0xcc>
+   2b658:	00808021 	addu	s0,a0,zero
+   2b65c:	8ca20018 	lw	v0,24(a1)
+   2b660:	00a02021 	addu	a0,a1,zero
+   2b664:	0040f809 	jalr	v0
+   2b668:	afc50038 	sw	a1,56(s8)
+   2b66c:	8fc50038 	lw	a1,56(s8)
+   2b670:	8ca30004 	lw	v1,4(a1)
+   2b674:	1460000a 	bnez	v1,2b6a0 <vfs_default_write+0x70>
+   2b678:	afc20018 	sw	v0,24(s8)
+   2b67c:	00001021 	addu	v0,zero,zero
+   2b680:	03c0e821 	addu	sp,s8,zero
+   2b684:	8fbf0054 	lw	ra,84(sp)
+   2b688:	8fbe0050 	lw	s8,80(sp)
+   2b68c:	8fb2004c 	lw	s2,76(sp)
+   2b690:	8fb10048 	lw	s1,72(sp)
+   2b694:	8fb00044 	lw	s0,68(sp)
+   2b698:	03e00008 	jr	ra
+   2b69c:	27bd0058 	addiu	sp,sp,88
+   2b6a0:	8ca20010 	lw	v0,16(a1)
+   2b6a4:	00a02021 	addu	a0,a1,zero
+   2b6a8:	0040f809 	jalr	v0
+   2b6ac:	afc50038 	sw	a1,56(s8)
+   2b6b0:	00408821 	addu	s1,v0,zero
+   2b6b4:	2c420041 	sltiu	v0,v0,65
+   2b6b8:	14400012 	bnez	v0,2b704 <vfs_default_write+0xd4>
+   2b6bc:	8fc50038 	lw	a1,56(s8)
+   2b6c0:	3c020004 	lui	v0,0x4
+   2b6c4:	8c449100 	lw	a0,-28416(v0)
+   2b6c8:	3c020003 	lui	v0,0x3
+   2b6cc:	24427a40 	addiu	v0,v0,31296
+   2b6d0:	3c060003 	lui	a2,0x3
+   2b6d4:	3c070003 	lui	a3,0x3
+   2b6d8:	afa20010 	sw	v0,16(sp)
+   2b6dc:	24c67a08 	addiu	a2,a2,31240
+   2b6e0:	24020155 	addiu	v0,zero,341
+   2b6e4:	24e77a30 	addiu	a3,a3,31280
+   2b6e8:	00002821 	addu	a1,zero,zero
+   2b6ec:	0c0009b0 	jal	26c0 <__fprintk>
+   2b6f0:	afa20014 	sw	v0,20(sp)
+   2b6f4:	0800adbd 	j	2b6f4 <vfs_default_write+0xc4>
+   2b6f8:	00000000 	sll	zero,zero,0x0
+   2b6fc:	0800ada0 	j	2b680 <vfs_default_write+0x50>
+   2b700:	2402ffea 	addiu	v0,zero,-22
+   2b704:	00111080 	sll	v0,s1,0x2
+   2b708:	24420012 	addiu	v0,v0,18
+   2b70c:	000210c2 	srl	v0,v0,0x3
+   2b710:	000210c0 	sll	v0,v0,0x3
+   2b714:	03a2e823 	subu	sp,sp,v0
+   2b718:	27b20018 	addiu	s2,sp,24
+   2b71c:	8ca20014 	lw	v0,20(a1)
+   2b720:	00a02021 	addu	a0,a1,zero
+   2b724:	24070001 	addiu	a3,zero,1
+   2b728:	02402821 	addu	a1,s2,zero
+   2b72c:	0040f809 	jalr	v0
+   2b730:	02203021 	addu	a2,s1,zero
+   2b734:	8e070000 	lw	a3,0(s0)
+   2b738:	00112080 	sll	a0,s1,0x2
+   2b73c:	3c031000 	lui	v1,0x1000
+   2b740:	02442021 	addu	a0,s2,a0
+   2b744:	00e31824 	and	v1,a3,v1
+   2b748:	1060001f 	beqz	v1,2b7c8 <vfs_default_write+0x198>
+   2b74c:	ac800000 	sw	zero,0(a0)
+   2b750:	8e030014 	lw	v1,20(s0)
+   2b754:	afc00024 	sw	zero,36(s8)
+   2b758:	afc3001c 	sw	v1,28(s8)
+   2b75c:	afc20028 	sw	v0,40(s8)
+   2b760:	8fc20018 	lw	v0,24(s8)
+   2b764:	2604002c 	addiu	a0,s0,44
+   2b768:	afc20020 	sw	v0,32(s8)
+   2b76c:	27c5001c 	addiu	a1,s8,28
+   2b770:	27c20018 	addiu	v0,s8,24
+   2b774:	24060001 	addiu	a2,zero,1
+   2b778:	afd20030 	sw	s2,48(s8)
+   2b77c:	afd1002c 	sw	s1,44(s8)
+   2b780:	0c00783b 	jal	1e0ec <mapper_write>
+   2b784:	afa20010 	sw	v0,16(sp)
+   2b788:	10400003 	beqz	v0,2b798 <vfs_default_write+0x168>
+   2b78c:	00000000 	sll	zero,zero,0x0
+   2b790:	40032002 	mfc0	v1,$4,2
+   2b794:	ac620258 	sw	v0,600(v1)
+   2b798:	8e030000 	lw	v1,0(s0)
+   2b79c:	3c021000 	lui	v0,0x1000
+   2b7a0:	00621024 	and	v0,v1,v0
+   2b7a4:	14400006 	bnez	v0,2b7c0 <vfs_default_write+0x190>
+   2b7a8:	00000000 	sll	zero,zero,0x0
+   2b7ac:	8e030010 	lw	v1,16(s0)
+   2b7b0:	8fc20018 	lw	v0,24(s8)
+   2b7b4:	00621821 	addu	v1,v1,v0
+   2b7b8:	0800ada0 	j	2b680 <vfs_default_write+0x50>
+   2b7bc:	ae030010 	sw	v1,16(s0)
+   2b7c0:	0800ada0 	j	2b680 <vfs_default_write+0x50>
+   2b7c4:	8fc20018 	lw	v0,24(s8)
+   2b7c8:	8e030010 	lw	v1,16(s0)
+   2b7cc:	afc0001c 	sw	zero,28(s8)
+   2b7d0:	0800add7 	j	2b75c <vfs_default_write+0x12c>
+   2b7d4:	afc30024 	sw	v1,36(s8)
+
+0002b7d8 <vfs_default_read>:
+   2b7d8:	8c820008 	lw	v0,8(a0)
+   2b7dc:	27bdffa8 	addiu	sp,sp,-88
+   2b7e0:	30420002 	andi	v0,v0,0x2
+   2b7e4:	afbe0050 	sw	s8,80(sp)
+   2b7e8:	afb00044 	sw	s0,68(sp)
+   2b7ec:	afbf0054 	sw	ra,84(sp)
+   2b7f0:	afb2004c 	sw	s2,76(sp)
+   2b7f4:	afb10048 	sw	s1,72(sp)
+   2b7f8:	03a0f021 	addu	s8,sp,zero
+   2b7fc:	14400029 	bnez	v0,2b8a4 <vfs_default_read+0xcc>
+   2b800:	00808021 	addu	s0,a0,zero
+   2b804:	8ca20018 	lw	v0,24(a1)
+   2b808:	00a02021 	addu	a0,a1,zero
+   2b80c:	0040f809 	jalr	v0
+   2b810:	afc50038 	sw	a1,56(s8)
+   2b814:	8fc50038 	lw	a1,56(s8)
+   2b818:	8ca30004 	lw	v1,4(a1)
+   2b81c:	1460000a 	bnez	v1,2b848 <vfs_default_read+0x70>
+   2b820:	afc20018 	sw	v0,24(s8)
+   2b824:	00001021 	addu	v0,zero,zero
+   2b828:	03c0e821 	addu	sp,s8,zero
+   2b82c:	8fbf0054 	lw	ra,84(sp)
+   2b830:	8fbe0050 	lw	s8,80(sp)
+   2b834:	8fb2004c 	lw	s2,76(sp)
+   2b838:	8fb10048 	lw	s1,72(sp)
+   2b83c:	8fb00044 	lw	s0,68(sp)
+   2b840:	03e00008 	jr	ra
+   2b844:	27bd0058 	addiu	sp,sp,88
+   2b848:	8ca20010 	lw	v0,16(a1)
+   2b84c:	00a02021 	addu	a0,a1,zero
+   2b850:	0040f809 	jalr	v0
+   2b854:	afc50038 	sw	a1,56(s8)
+   2b858:	00408821 	addu	s1,v0,zero
+   2b85c:	2c420041 	sltiu	v0,v0,65
+   2b860:	14400012 	bnez	v0,2b8ac <vfs_default_read+0xd4>
+   2b864:	8fc50038 	lw	a1,56(s8)
+   2b868:	3c020004 	lui	v0,0x4
+   2b86c:	8c449100 	lw	a0,-28416(v0)
+   2b870:	3c020003 	lui	v0,0x3
+   2b874:	24427a54 	addiu	v0,v0,31316
+   2b878:	3c060003 	lui	a2,0x3
+   2b87c:	3c070003 	lui	a3,0x3
+   2b880:	afa20010 	sw	v0,16(sp)
+   2b884:	24c67a08 	addiu	a2,a2,31240
+   2b888:	2402011e 	addiu	v0,zero,286
+   2b88c:	24e77a30 	addiu	a3,a3,31280
+   2b890:	00002821 	addu	a1,zero,zero
+   2b894:	0c0009b0 	jal	26c0 <__fprintk>
+   2b898:	afa20014 	sw	v0,20(sp)
+   2b89c:	0800ae27 	j	2b89c <vfs_default_read+0xc4>
+   2b8a0:	00000000 	sll	zero,zero,0x0
+   2b8a4:	0800ae0a 	j	2b828 <vfs_default_read+0x50>
+   2b8a8:	2402ffea 	addiu	v0,zero,-22
+   2b8ac:	00111080 	sll	v0,s1,0x2
+   2b8b0:	2442000e 	addiu	v0,v0,14
+   2b8b4:	000210c2 	srl	v0,v0,0x3
+   2b8b8:	000210c0 	sll	v0,v0,0x3
+   2b8bc:	03a2e823 	subu	sp,sp,v0
+   2b8c0:	27b20018 	addiu	s2,sp,24
+   2b8c4:	8ca20014 	lw	v0,20(a1)
+   2b8c8:	00a02021 	addu	a0,a1,zero
+   2b8cc:	00003821 	addu	a3,zero,zero
+   2b8d0:	02402821 	addu	a1,s2,zero
+   2b8d4:	0040f809 	jalr	v0
+   2b8d8:	02203021 	addu	a2,s1,zero
+   2b8dc:	8e070000 	lw	a3,0(s0)
+   2b8e0:	3c031000 	lui	v1,0x1000
+   2b8e4:	00e31824 	and	v1,a3,v1
+   2b8e8:	1060001f 	beqz	v1,2b968 <vfs_default_read+0x190>
+   2b8ec:	00000000 	sll	zero,zero,0x0
+   2b8f0:	8e030014 	lw	v1,20(s0)
+   2b8f4:	afc00024 	sw	zero,36(s8)
+   2b8f8:	afc3001c 	sw	v1,28(s8)
+   2b8fc:	afc20028 	sw	v0,40(s8)
+   2b900:	8fc20018 	lw	v0,24(s8)
+   2b904:	2604002c 	addiu	a0,s0,44
+   2b908:	afc20020 	sw	v0,32(s8)
+   2b90c:	27c5001c 	addiu	a1,s8,28
+   2b910:	27c20018 	addiu	v0,s8,24
+   2b914:	24060001 	addiu	a2,zero,1
+   2b918:	afd20030 	sw	s2,48(s8)
+   2b91c:	afd1002c 	sw	s1,44(s8)
+   2b920:	0c007845 	jal	1e114 <mapper_read>
+   2b924:	afa20010 	sw	v0,16(sp)
+   2b928:	10400003 	beqz	v0,2b938 <vfs_default_read+0x160>
+   2b92c:	00000000 	sll	zero,zero,0x0
+   2b930:	40032002 	mfc0	v1,$4,2
+   2b934:	ac620258 	sw	v0,600(v1)
+   2b938:	8e030000 	lw	v1,0(s0)
+   2b93c:	3c021000 	lui	v0,0x1000
+   2b940:	00621024 	and	v0,v1,v0
+   2b944:	14400006 	bnez	v0,2b960 <vfs_default_read+0x188>
+   2b948:	00000000 	sll	zero,zero,0x0
+   2b94c:	8e030010 	lw	v1,16(s0)
+   2b950:	8fc20018 	lw	v0,24(s8)
+   2b954:	00621821 	addu	v1,v1,v0
+   2b958:	0800ae0a 	j	2b828 <vfs_default_read+0x50>
+   2b95c:	ae030010 	sw	v1,16(s0)
+   2b960:	0800ae0a 	j	2b828 <vfs_default_read+0x50>
+   2b964:	8fc20018 	lw	v0,24(s8)
+   2b968:	8e030010 	lw	v1,16(s0)
+   2b96c:	afc0001c 	sw	zero,28(s8)
+   2b970:	0800ae3f 	j	2b8fc <vfs_default_read+0x124>
+   2b974:	afc30024 	sw	v1,36(s8)
+
+0002b978 <vfs_default_mmap_file>:
+   2b978:	8c830030 	lw	v1,48(a0)
+   2b97c:	8c820034 	lw	v0,52(a0)
+   2b980:	8c86002c 	lw	a2,44(a0)
+   2b984:	27bdffe0 	addiu	sp,sp,-32
+   2b988:	aca30114 	sw	v1,276(a1)
+   2b98c:	aca20118 	sw	v0,280(a1)
+   2b990:	afbf001c 	sw	ra,28(sp)
+   2b994:	aca60110 	sw	a2,272(a1)
+   2b998:	24a2011c 	addiu	v0,a1,284
+   2b99c:	24830030 	addiu	v1,a0,48
+   2b9a0:	8c890000 	lw	t1,0(a0)
+   2b9a4:	8c880004 	lw	t0,4(a0)
+   2b9a8:	8c870008 	lw	a3,8(a0)
+   2b9ac:	8c86000c 	lw	a2,12(a0)
+   2b9b0:	24840010 	addiu	a0,a0,16
+   2b9b4:	ac490000 	sw	t1,0(v0)
+   2b9b8:	ac480004 	sw	t0,4(v0)
+   2b9bc:	ac470008 	sw	a3,8(v0)
+   2b9c0:	ac46000c 	sw	a2,12(v0)
+   2b9c4:	1483fff6 	bne	a0,v1,2b9a0 <vfs_default_mmap_file+0x28>
+   2b9c8:	24420010 	addiu	v0,v0,16
+   2b9cc:	8c870008 	lw	a3,8(a0)
+   2b9d0:	8c860000 	lw	a2,0(a0)
+   2b9d4:	8c830004 	lw	v1,4(a0)
+   2b9d8:	ac470008 	sw	a3,8(v0)
+   2b9dc:	ac460000 	sw	a2,0(v0)
+   2b9e0:	ac430004 	sw	v1,4(v0)
+   2b9e4:	8ca20104 	lw	v0,260(a1)
+   2b9e8:	30420002 	andi	v0,v0,0x2
+   2b9ec:	14400010 	bnez	v0,2ba30 <vfs_default_mmap_file+0xb8>
+   2b9f0:	3c02fbff 	lui	v0,0xfbff
+   2b9f4:	0c00056f 	jal	15bc <arch_onln_cluster_nr>
+   2b9f8:	afa50010 	sw	a1,16(sp)
+   2b9fc:	8fa50010 	lw	a1,16(sp)
+   2ba00:	24031001 	addiu	v1,zero,4097
+   2ba04:	8ca40104 	lw	a0,260(a1)
+   2ba08:	30841001 	andi	a0,a0,0x1001
+   2ba0c:	10830015 	beq	a0,v1,2ba64 <vfs_default_mmap_file+0xec>
+   2ba10:	2c420002 	sltiu	v0,v0,2
+   2ba14:	8ca30104 	lw	v1,260(a1)
+   2ba18:	8fbf001c 	lw	ra,28(sp)
+   2ba1c:	34630100 	ori	v1,v1,0x100
+   2ba20:	00001021 	addu	v0,zero,zero
+   2ba24:	aca30104 	sw	v1,260(a1)
+   2ba28:	03e00008 	jr	ra
+   2ba2c:	27bd0020 	addiu	sp,sp,32
+   2ba30:	8ca30100 	lw	v1,256(a1)
+   2ba34:	3442ffff 	ori	v0,v0,0xffff
+   2ba38:	00621024 	and	v0,v1,v0
+   2ba3c:	34420001 	ori	v0,v0,0x1
+   2ba40:	aca20100 	sw	v0,256(a1)
+   2ba44:	0c00056f 	jal	15bc <arch_onln_cluster_nr>
+   2ba48:	afa50010 	sw	a1,16(sp)
+   2ba4c:	8fa50010 	lw	a1,16(sp)
+   2ba50:	24031001 	addiu	v1,zero,4097
+   2ba54:	8ca40104 	lw	a0,260(a1)
+   2ba58:	30841001 	andi	a0,a0,0x1001
+   2ba5c:	1483ffed 	bne	a0,v1,2ba14 <vfs_default_mmap_file+0x9c>
+   2ba60:	2c420002 	sltiu	v0,v0,2
+   2ba64:	1440ffeb 	bnez	v0,2ba14 <vfs_default_mmap_file+0x9c>
+   2ba68:	3c027fff 	lui	v0,0x7fff
+   2ba6c:	8ca30100 	lw	v1,256(a1)
+   2ba70:	3442ffff 	ori	v0,v0,0xffff
+   2ba74:	00621024 	and	v0,v1,v0
+   2ba78:	8ca30104 	lw	v1,260(a1)
+   2ba7c:	8fbf001c 	lw	ra,28(sp)
+   2ba80:	34420002 	ori	v0,v0,0x2
+   2ba84:	34630100 	ori	v1,v1,0x100
+   2ba88:	aca20100 	sw	v0,256(a1)
+   2ba8c:	aca30104 	sw	v1,260(a1)
+   2ba90:	00001021 	addu	v0,zero,zero
+   2ba94:	03e00008 	jr	ra
+   2ba98:	27bd0020 	addiu	sp,sp,32
+
+0002ba9c <__vfs_file_up_main>:
+   2ba9c:	080019b0 	j	66c0 <atomic_inc>
+   2baa0:	24e4000c 	addiu	a0,a3,12
+
+0002baa4 <__vfs_file_up_demarshall>:
+   2baa4:	27bdffc8 	addiu	sp,sp,-56
+   2baa8:	afbf0034 	sw	ra,52(sp)
+   2baac:	afbe0030 	sw	s8,48(sp)
+   2bab0:	afb4002c 	sw	s4,44(sp)
+   2bab4:	03a0f021 	addu	s8,sp,zero
+   2bab8:	afb30028 	sw	s3,40(sp)
+   2babc:	afb20024 	sw	s2,36(sp)
+   2bac0:	afb10020 	sw	s1,32(sp)
+   2bac4:	afb0001c 	sw	s0,28(sp)
+   2bac8:	27bdfff0 	addiu	sp,sp,-16
+   2bacc:	27b20010 	addiu	s2,sp,16
+   2bad0:	27bdffc8 	addiu	sp,sp,-56
+   2bad4:	27b00010 	addiu	s0,sp,16
+   2bad8:	26020028 	addiu	v0,s0,40
+   2badc:	2403002c 	addiu	v1,zero,44
+   2bae0:	ae030008 	sw	v1,8(s0)
+   2bae4:	ae420000 	sw	v0,0(s2)
+   2bae8:	24030004 	addiu	v1,zero,4
+   2baec:	00808821 	addu	s1,a0,zero
+   2baf0:	ae030024 	sw	v1,36(s0)
+   2baf4:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2baf8:	8c940000 	lw	s4,0(a0)
+   2bafc:	8e460000 	lw	a2,0(s2)
+   2bb00:	00409821 	addu	s3,v0,zero
+   2bb04:	02202021 	addu	a0,s1,zero
+   2bb08:	00002821 	addu	a1,zero,zero
+   2bb0c:	8e320000 	lw	s2,0(s1)
+   2bb10:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2bb14:	afc60010 	sw	a2,16(s8)
+   2bb18:	0293001b 	divu	zero,s4,s3
+   2bb1c:	026001f4 	teq	s3,zero,0x7
+   2bb20:	8c470000 	lw	a3,0(v0)
+   2bb24:	8fc60010 	lw	a2,16(s8)
+   2bb28:	02402821 	addu	a1,s2,zero
+   2bb2c:	00002012 	mflo	a0
+   2bb30:	0c00aea7 	jal	2ba9c <__vfs_file_up_main>
+   2bb34:	3084ffff 	andi	a0,a0,0xffff
+   2bb38:	02202021 	addu	a0,s1,zero
+   2bb3c:	02002821 	addu	a1,s0,zero
+   2bb40:	2406002c 	addiu	a2,zero,44
+   2bb44:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2bb48:	24070001 	addiu	a3,zero,1
+   2bb4c:	03c0e821 	addu	sp,s8,zero
+   2bb50:	8fbf0034 	lw	ra,52(sp)
+   2bb54:	8fbe0030 	lw	s8,48(sp)
+   2bb58:	8fb4002c 	lw	s4,44(sp)
+   2bb5c:	8fb30028 	lw	s3,40(sp)
+   2bb60:	8fb20024 	lw	s2,36(sp)
+   2bb64:	8fb10020 	lw	s1,32(sp)
+   2bb68:	8fb0001c 	lw	s0,28(sp)
+   2bb6c:	03e00008 	jr	ra
+   2bb70:	27bd0038 	addiu	sp,sp,56
+
+0002bb74 <__vfs_file_up_local>:
+   2bb74:	00803021 	addu	a2,a0,zero
+   2bb78:	00a01021 	addu	v0,a1,zero
+   2bb7c:	40077801 	mfc0	a3,$15,1
+   2bb80:	3c030004 	lui	v1,0x4
+   2bb84:	2464c960 	addiu	a0,v1,-13984
+   2bb88:	88840003 	lwl	a0,3(a0)
+   2bb8c:	30e70003 	andi	a3,a3,0x3
+   2bb90:	3c050004 	lui	a1,0x4
+   2bb94:	00073880 	sll	a3,a3,0x2
+   2bb98:	24a5c950 	addiu	a1,a1,-14000
+   2bb9c:	9864c960 	lwr	a0,-13984(v1)
+   2bba0:	00e51821 	addu	v1,a3,a1
+   2bba4:	8c650000 	lw	a1,0(v1)
+   2bba8:	8c470000 	lw	a3,0(v0)
+   2bbac:	0800aea7 	j	2ba9c <__vfs_file_up_main>
+   2bbb0:	3084ffff 	andi	a0,a0,0xffff
+
+0002bbb4 <vfs_file_up>:
+   2bbb4:	27bdffb0 	addiu	sp,sp,-80
+   2bbb8:	3c020004 	lui	v0,0x4
+   2bbbc:	afb00044 	sw	s0,68(sp)
+   2bbc0:	2443c960 	addiu	v1,v0,-13984
+   2bbc4:	afbf004c 	sw	ra,76(sp)
+   2bbc8:	afb10048 	sw	s1,72(sp)
+   2bbcc:	88630003 	lwl	v1,3(v1)
+   2bbd0:	9490001c 	lhu	s0,28(a0)
+   2bbd4:	9843c960 	lwr	v1,-13984(v0)
+   2bbd8:	27a60028 	addiu	a2,sp,40
+   2bbdc:	24020004 	addiu	v0,zero,4
+   2bbe0:	24850014 	addiu	a1,a0,20
+   2bbe4:	3063ffff 	andi	v1,v1,0xffff
+   2bbe8:	afa20038 	sw	v0,56(sp)
+   2bbec:	afa6002c 	sw	a2,44(sp)
+   2bbf0:	afa20030 	sw	v0,48(sp)
+   2bbf4:	1203001d 	beq	s0,v1,2bc6c <vfs_file_up+0xb8>
+   2bbf8:	afa50034 	sw	a1,52(sp)
+   2bbfc:	40117801 	mfc0	s1,$15,1
+   2bc00:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2bc04:	00000000 	sll	zero,zero,0x0
+   2bc08:	70501802 	mul	v1,v0,s0
+   2bc0c:	32240003 	andi	a0,s1,0x3
+   2bc10:	00642021 	addu	a0,v1,a0
+   2bc14:	27a3002c 	addiu	v1,sp,44
+   2bc18:	afa30018 	sw	v1,24(sp)
+   2bc1c:	27a30030 	addiu	v1,sp,48
+   2bc20:	afa3001c 	sw	v1,28(sp)
+   2bc24:	3c070003 	lui	a3,0x3
+   2bc28:	27a30034 	addiu	v1,sp,52
+   2bc2c:	24020001 	addiu	v0,zero,1
+   2bc30:	afa30020 	sw	v1,32(sp)
+   2bc34:	24e7baa4 	addiu	a3,a3,-17756
+   2bc38:	27a30038 	addiu	v1,sp,56
+   2bc3c:	24050001 	addiu	a1,zero,1
+   2bc40:	00003021 	addu	a2,zero,zero
+   2bc44:	afa20014 	sw	v0,20(sp)
+   2bc48:	afa30024 	sw	v1,36(sp)
+   2bc4c:	0c003de8 	jal	f7a0 <rppc_generic>
+   2bc50:	afa20010 	sw	v0,16(sp)
+   2bc54:	8fbf004c 	lw	ra,76(sp)
+   2bc58:	8fa20028 	lw	v0,40(sp)
+   2bc5c:	8fb10048 	lw	s1,72(sp)
+   2bc60:	8fb00044 	lw	s0,68(sp)
+   2bc64:	03e00008 	jr	ra
+   2bc68:	27bd0050 	addiu	sp,sp,80
+   2bc6c:	0c00aedd 	jal	2bb74 <__vfs_file_up_local>
+   2bc70:	00c02021 	addu	a0,a2,zero
+   2bc74:	8fbf004c 	lw	ra,76(sp)
+   2bc78:	8fa20028 	lw	v0,40(sp)
+   2bc7c:	8fb10048 	lw	s1,72(sp)
+   2bc80:	8fb00044 	lw	s0,68(sp)
+   2bc84:	03e00008 	jr	ra
+   2bc88:	27bd0050 	addiu	sp,sp,80
+
+0002bc8c <vfs_file_remote_get>:
+   2bc8c:	27bdffd0 	addiu	sp,sp,-48
+   2bc90:	24020011 	addiu	v0,zero,17
+   2bc94:	afa20010 	sw	v0,16(sp)
+   2bc98:	24020120 	addiu	v0,zero,288
+   2bc9c:	afb00028 	sw	s0,40(sp)
+   2bca0:	afa20014 	sw	v0,20(sp)
+   2bca4:	00808021 	addu	s0,a0,zero
+   2bca8:	3c020002 	lui	v0,0x2
+   2bcac:	27a40010 	addiu	a0,sp,16
+   2bcb0:	afbf002c 	sw	ra,44(sp)
+   2bcb4:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2bcb8:	afa20018 	sw	v0,24(sp)
+   2bcbc:	1040000e 	beqz	v0,2bcf8 <vfs_file_remote_get+0x6c>
+   2bcc0:	2444000c 	addiu	a0,v0,12
+   2bcc4:	24050001 	addiu	a1,zero,1
+   2bcc8:	0c00199f 	jal	667c <atomic_init>
+   2bccc:	afa20020 	sw	v0,32(sp)
+   2bcd0:	8e0301c0 	lw	v1,448(s0)
+   2bcd4:	8fa20020 	lw	v0,32(sp)
+   2bcd8:	8e040034 	lw	a0,52(s0)
+   2bcdc:	8c630098 	lw	v1,152(v1)
+   2bce0:	ac440000 	sw	a0,0(v0)
+   2bce4:	ac430114 	sw	v1,276(v0)
+   2bce8:	ac400004 	sw	zero,4(v0)
+   2bcec:	ac400008 	sw	zero,8(v0)
+   2bcf0:	ac400118 	sw	zero,280(v0)
+   2bcf4:	ac500110 	sw	s0,272(v0)
+   2bcf8:	8fbf002c 	lw	ra,44(sp)
+   2bcfc:	8fb00028 	lw	s0,40(sp)
+   2bd00:	03e00008 	jr	ra
+   2bd04:	27bd0030 	addiu	sp,sp,48
+
+0002bd08 <vfs_file_get>:
+   2bd08:	27bdffd0 	addiu	sp,sp,-48
+   2bd0c:	afb30020 	sw	s3,32(sp)
+   2bd10:	97b30048 	lhu	s3,72(sp)
+   2bd14:	afb00014 	sw	s0,20(sp)
+   2bd18:	00a08021 	addu	s0,a1,zero
+   2bd1c:	afb2001c 	sw	s2,28(sp)
+   2bd20:	afb10018 	sw	s1,24(sp)
+   2bd24:	00809021 	addu	s2,a0,zero
+   2bd28:	00c08821 	addu	s1,a2,zero
+   2bd2c:	00e02821 	addu	a1,a3,zero
+   2bd30:	2604002c 	addiu	a0,s0,44
+   2bd34:	02603021 	addu	a2,s3,zero
+   2bd38:	afb50028 	sw	s5,40(sp)
+   2bd3c:	afb40024 	sw	s4,36(sp)
+   2bd40:	afbf002c 	sw	ra,44(sp)
+   2bd44:	8fb40040 	lw	s4,64(sp)
+   2bd48:	0c00720f 	jal	1c83c <mapper_replicate>
+   2bd4c:	8fb50044 	lw	s5,68(sp)
+   2bd50:	14400027 	bnez	v0,2bdf0 <vfs_file_get+0xe8>
+   2bd54:	8fbf002c 	lw	ra,44(sp)
+   2bd58:	1220001a 	beqz	s1,2bdc4 <vfs_file_get+0xbc>
+   2bd5c:	3c020004 	lui	v0,0x4
+   2bd60:	8e820008 	lw	v0,8(s4)
+   2bd64:	8e840000 	lw	a0,0(s4)
+   2bd68:	8e830004 	lw	v1,4(s4)
+   2bd6c:	8e450098 	lw	a1,152(s2)
+   2bd70:	ae110014 	sw	s1,20(s0)
+   2bd74:	ae050028 	sw	a1,40(s0)
+   2bd78:	ae040018 	sw	a0,24(s0)
+   2bd7c:	ae03001c 	sw	v1,28(s0)
+   2bd80:	ae020020 	sw	v0,32(s0)
+   2bd84:	ae000010 	sw	zero,16(s0)
+   2bd88:	ae00000c 	sw	zero,12(s0)
+   2bd8c:	12a00003 	beqz	s5,2bd9c <vfs_file_get+0x94>
+   2bd90:	ae120024 	sw	s2,36(s0)
+   2bd94:	8ea20000 	lw	v0,0(s5)
+   2bd98:	ae020038 	sw	v0,56(s0)
+   2bd9c:	8fbf002c 	lw	ra,44(sp)
+   2bda0:	02001021 	addu	v0,s0,zero
+   2bda4:	8fb50028 	lw	s5,40(sp)
+   2bda8:	8fb40024 	lw	s4,36(sp)
+   2bdac:	8fb30020 	lw	s3,32(sp)
+   2bdb0:	8fb2001c 	lw	s2,28(sp)
+   2bdb4:	8fb10018 	lw	s1,24(sp)
+   2bdb8:	8fb00014 	lw	s0,20(sp)
+   2bdbc:	03e00008 	jr	ra
+   2bdc0:	27bd0030 	addiu	sp,sp,48
+   2bdc4:	2443c960 	addiu	v1,v0,-13984
+   2bdc8:	88630003 	lwl	v1,3(v1)
+   2bdcc:	9843c960 	lwr	v1,-13984(v0)
+   2bdd0:	3063ffff 	andi	v1,v1,0xffff
+   2bdd4:	16630006 	bne	s3,v1,2bdf0 <vfs_file_get+0xe8>
+   2bdd8:	8fbf002c 	lw	ra,44(sp)
+   2bddc:	0c00af23 	jal	2bc8c <vfs_file_remote_get>
+   2bde0:	8e840000 	lw	a0,0(s4)
+   2bde4:	1440ffde 	bnez	v0,2bd60 <vfs_file_get+0x58>
+   2bde8:	00408821 	addu	s1,v0,zero
+   2bdec:	8fbf002c 	lw	ra,44(sp)
+   2bdf0:	00008021 	addu	s0,zero,zero
+   2bdf4:	02001021 	addu	v0,s0,zero
+   2bdf8:	8fb50028 	lw	s5,40(sp)
+   2bdfc:	8fb40024 	lw	s4,36(sp)
+   2be00:	8fb30020 	lw	s3,32(sp)
+   2be04:	8fb2001c 	lw	s2,28(sp)
+   2be08:	8fb10018 	lw	s1,24(sp)
+   2be0c:	8fb00014 	lw	s0,20(sp)
+   2be10:	03e00008 	jr	ra
+   2be14:	27bd0030 	addiu	sp,sp,48
+
+0002be18 <vfs_file_remote_put>:
+   2be18:	27bdffd8 	addiu	sp,sp,-40
+   2be1c:	24020011 	addiu	v0,zero,17
+   2be20:	afa4001c 	sw	a0,28(sp)
+   2be24:	afa20010 	sw	v0,16(sp)
+   2be28:	27a40010 	addiu	a0,sp,16
+   2be2c:	24020120 	addiu	v0,zero,288
+   2be30:	afbf0024 	sw	ra,36(sp)
+   2be34:	0c007134 	jal	1c4d0 <kmem_free>
+   2be38:	afa20014 	sw	v0,20(sp)
+   2be3c:	8fbf0024 	lw	ra,36(sp)
+   2be40:	03e00008 	jr	ra
+   2be44:	27bd0028 	addiu	sp,sp,40
+
+0002be48 <vfs_file_remote_down>:
+   2be48:	27bdffe0 	addiu	sp,sp,-32
+   2be4c:	afb00014 	sw	s0,20(sp)
+   2be50:	00808021 	addu	s0,a0,zero
+   2be54:	afb10018 	sw	s1,24(sp)
+   2be58:	afbf001c 	sw	ra,28(sp)
+   2be5c:	0c0019c1 	jal	6704 <atomic_dec>
+   2be60:	2484000c 	addiu	a0,a0,12
+   2be64:	00408821 	addu	s1,v0,zero
+   2be68:	28420002 	slti	v0,v0,2
+   2be6c:	14400006 	bnez	v0,2be88 <vfs_file_remote_down+0x40>
+   2be70:	00001021 	addu	v0,zero,zero
+   2be74:	8fbf001c 	lw	ra,28(sp)
+   2be78:	8fb10018 	lw	s1,24(sp)
+   2be7c:	8fb00014 	lw	s0,20(sp)
+   2be80:	03e00008 	jr	ra
+   2be84:	27bd0020 	addiu	sp,sp,32
+   2be88:	8e040110 	lw	a0,272(s0)
+   2be8c:	10800003 	beqz	a0,2be9c <vfs_file_remote_down+0x54>
+   2be90:	00000000 	sll	zero,zero,0x0
+   2be94:	0c00aa79 	jal	2a9e4 <vfs_inode_down>
+   2be98:	00000000 	sll	zero,zero,0x0
+   2be9c:	8e020114 	lw	v0,276(s0)
+   2bea0:	8c420014 	lw	v0,20(v0)
+   2bea4:	0040f809 	jalr	v0
+   2bea8:	02002021 	addu	a0,s0,zero
+   2beac:	1440fff2 	bnez	v0,2be78 <vfs_file_remote_down+0x30>
+   2beb0:	8fbf001c 	lw	ra,28(sp)
+   2beb4:	8e020114 	lw	v0,276(s0)
+   2beb8:	8c420018 	lw	v0,24(v0)
+   2bebc:	0040f809 	jalr	v0
+   2bec0:	02002021 	addu	a0,s0,zero
+   2bec4:	0c00af86 	jal	2be18 <vfs_file_remote_put>
+   2bec8:	02002021 	addu	a0,s0,zero
+   2becc:	8fbf001c 	lw	ra,28(sp)
+   2bed0:	02201021 	addu	v0,s1,zero
+   2bed4:	8fb10018 	lw	s1,24(sp)
+   2bed8:	8fb00014 	lw	s0,20(sp)
+   2bedc:	03e00008 	jr	ra
+   2bee0:	27bd0020 	addiu	sp,sp,32
+
+0002bee4 <__vfs_file_down_main>:
+   2bee4:	27bdffe0 	addiu	sp,sp,-32
+   2bee8:	00e02021 	addu	a0,a3,zero
+   2beec:	afbf001c 	sw	ra,28(sp)
+   2bef0:	0c00af92 	jal	2be48 <vfs_file_remote_down>
+   2bef4:	afa60010 	sw	a2,16(sp)
+   2bef8:	8fa60010 	lw	a2,16(sp)
+   2befc:	8fbf001c 	lw	ra,28(sp)
+   2bf00:	acc20000 	sw	v0,0(a2)
+   2bf04:	03e00008 	jr	ra
+   2bf08:	27bd0020 	addiu	sp,sp,32
+
+0002bf0c <__vfs_file_down_demarshall>:
+   2bf0c:	27bdffd8 	addiu	sp,sp,-40
+   2bf10:	afbf0024 	sw	ra,36(sp)
+   2bf14:	afbe0020 	sw	s8,32(sp)
+   2bf18:	afb2001c 	sw	s2,28(sp)
+   2bf1c:	03a0f021 	addu	s8,sp,zero
+   2bf20:	afb10018 	sw	s1,24(sp)
+   2bf24:	afb00014 	sw	s0,20(sp)
+   2bf28:	27bdfff0 	addiu	sp,sp,-16
+   2bf2c:	27b20010 	addiu	s2,sp,16
+   2bf30:	27bdffc8 	addiu	sp,sp,-56
+   2bf34:	27b00010 	addiu	s0,sp,16
+   2bf38:	26020028 	addiu	v0,s0,40
+   2bf3c:	2403002c 	addiu	v1,zero,44
+   2bf40:	00808821 	addu	s1,a0,zero
+   2bf44:	ae030008 	sw	v1,8(s0)
+   2bf48:	ae420000 	sw	v0,0(s2)
+   2bf4c:	24030004 	addiu	v1,zero,4
+   2bf50:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2bf54:	ae030024 	sw	v1,36(s0)
+   2bf58:	00002821 	addu	a1,zero,zero
+   2bf5c:	02202021 	addu	a0,s1,zero
+   2bf60:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2bf64:	8e520000 	lw	s2,0(s2)
+   2bf68:	0c00af92 	jal	2be48 <vfs_file_remote_down>
+   2bf6c:	8c440000 	lw	a0,0(v0)
+   2bf70:	ae420000 	sw	v0,0(s2)
+   2bf74:	02202021 	addu	a0,s1,zero
+   2bf78:	02002821 	addu	a1,s0,zero
+   2bf7c:	2406002c 	addiu	a2,zero,44
+   2bf80:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2bf84:	24070001 	addiu	a3,zero,1
+   2bf88:	03c0e821 	addu	sp,s8,zero
+   2bf8c:	8fbf0024 	lw	ra,36(sp)
+   2bf90:	8fbe0020 	lw	s8,32(sp)
+   2bf94:	8fb2001c 	lw	s2,28(sp)
+   2bf98:	8fb10018 	lw	s1,24(sp)
+   2bf9c:	8fb00014 	lw	s0,20(sp)
+   2bfa0:	03e00008 	jr	ra
+   2bfa4:	27bd0028 	addiu	sp,sp,40
+
+0002bfa8 <__vfs_file_down_local>:
+   2bfa8:	27bdffe8 	addiu	sp,sp,-24
+   2bfac:	afb00010 	sw	s0,16(sp)
+   2bfb0:	afbf0014 	sw	ra,20(sp)
+   2bfb4:	00808021 	addu	s0,a0,zero
+   2bfb8:	40027801 	mfc0	v0,$15,1
+   2bfbc:	0c00af92 	jal	2be48 <vfs_file_remote_down>
+   2bfc0:	8ca40000 	lw	a0,0(a1)
+   2bfc4:	8fbf0014 	lw	ra,20(sp)
+   2bfc8:	ae020000 	sw	v0,0(s0)
+   2bfcc:	8fb00010 	lw	s0,16(sp)
+   2bfd0:	03e00008 	jr	ra
+   2bfd4:	27bd0018 	addiu	sp,sp,24
+
+0002bfd8 <vfs_file_down>:
+   2bfd8:	27bdffb0 	addiu	sp,sp,-80
+   2bfdc:	3c020004 	lui	v0,0x4
+   2bfe0:	afb00044 	sw	s0,68(sp)
+   2bfe4:	2443c960 	addiu	v1,v0,-13984
+   2bfe8:	afbf004c 	sw	ra,76(sp)
+   2bfec:	afb10048 	sw	s1,72(sp)
+   2bff0:	88630003 	lwl	v1,3(v1)
+   2bff4:	9490001c 	lhu	s0,28(a0)
+   2bff8:	9843c960 	lwr	v1,-13984(v0)
+   2bffc:	27a60028 	addiu	a2,sp,40
+   2c000:	24020004 	addiu	v0,zero,4
+   2c004:	24850014 	addiu	a1,a0,20
+   2c008:	3063ffff 	andi	v1,v1,0xffff
+   2c00c:	afa20038 	sw	v0,56(sp)
+   2c010:	afa6002c 	sw	a2,44(sp)
+   2c014:	afa20030 	sw	v0,48(sp)
+   2c018:	1203001d 	beq	s0,v1,2c090 <vfs_file_down+0xb8>
+   2c01c:	afa50034 	sw	a1,52(sp)
+   2c020:	40117801 	mfc0	s1,$15,1
+   2c024:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2c028:	00000000 	sll	zero,zero,0x0
+   2c02c:	70501802 	mul	v1,v0,s0
+   2c030:	32240003 	andi	a0,s1,0x3
+   2c034:	00642021 	addu	a0,v1,a0
+   2c038:	27a3002c 	addiu	v1,sp,44
+   2c03c:	afa30018 	sw	v1,24(sp)
+   2c040:	27a30030 	addiu	v1,sp,48
+   2c044:	afa3001c 	sw	v1,28(sp)
+   2c048:	3c070003 	lui	a3,0x3
+   2c04c:	27a30034 	addiu	v1,sp,52
+   2c050:	24020001 	addiu	v0,zero,1
+   2c054:	afa30020 	sw	v1,32(sp)
+   2c058:	24e7bf0c 	addiu	a3,a3,-16628
+   2c05c:	27a30038 	addiu	v1,sp,56
+   2c060:	24050001 	addiu	a1,zero,1
+   2c064:	00003021 	addu	a2,zero,zero
+   2c068:	afa20014 	sw	v0,20(sp)
+   2c06c:	afa30024 	sw	v1,36(sp)
+   2c070:	0c003de8 	jal	f7a0 <rppc_generic>
+   2c074:	afa20010 	sw	v0,16(sp)
+   2c078:	8fbf004c 	lw	ra,76(sp)
+   2c07c:	8fa20028 	lw	v0,40(sp)
+   2c080:	8fb10048 	lw	s1,72(sp)
+   2c084:	8fb00044 	lw	s0,68(sp)
+   2c088:	03e00008 	jr	ra
+   2c08c:	27bd0050 	addiu	sp,sp,80
+   2c090:	0c00afea 	jal	2bfa8 <__vfs_file_down_local>
+   2c094:	00c02021 	addu	a0,a2,zero
+   2c098:	8fbf004c 	lw	ra,76(sp)
+   2c09c:	8fa20028 	lw	v0,40(sp)
+   2c0a0:	8fb10048 	lw	s1,72(sp)
+   2c0a4:	8fb00044 	lw	s0,68(sp)
+   2c0a8:	03e00008 	jr	ra
+   2c0ac:	27bd0050 	addiu	sp,sp,80
+   2c0b0:	08004428 	j	110a0 <rwlock_init>
+   2c0b4:	24a40050 	addiu	a0,a1,80
+
+0002c0b8 <vfs_kmem_context_init>:
+   2c0b8:	2403000e 	addiu	v1,zero,14
+   2c0bc:	ac830000 	sw	v1,0(a0)
+   2c0c0:	3c030003 	lui	v1,0x3
+   2c0c4:	24637a68 	addiu	v1,v1,31336
+   2c0c8:	24020001 	addiu	v0,zero,1
+   2c0cc:	ac830004 	sw	v1,4(a0)
+   2c0d0:	240301b0 	addiu	v1,zero,432
+   2c0d4:	ac820010 	sw	v0,16(a0)
+   2c0d8:	ac82000c 	sw	v0,12(a0)
+   2c0dc:	ac830008 	sw	v1,8(a0)
+   2c0e0:	ac80001c 	sw	zero,28(a0)
+   2c0e4:	ac800014 	sw	zero,20(a0)
+   2c0e8:	ac800018 	sw	zero,24(a0)
+   2c0ec:	03e00008 	jr	ra
+   2c0f0:	00001021 	addu	v0,zero,zero
+
+0002c0f4 <vfs_mount_link>:
+   2c0f4:	27bdffe0 	addiu	sp,sp,-32
+   2c0f8:	afb10018 	sw	s1,24(sp)
+   2c0fc:	00808821 	addu	s1,a0,zero
+   2c100:	8c8401c0 	lw	a0,448(a0)
+   2c104:	afb00014 	sw	s0,20(sp)
+   2c108:	00a08021 	addu	s0,a1,zero
+   2c10c:	afbf001c 	sw	ra,28(sp)
+   2c110:	0c00a96e 	jal	2a5b8 <vfs_dirent_new>
+   2c114:	00c02821 	addu	a1,a2,zero
+   2c118:	8e050000 	lw	a1,0(s0)
+   2c11c:	8e040034 	lw	a0,52(s0)
+   2c120:	3c030004 	lui	v1,0x4
+   2c124:	ac45010c 	sw	a1,268(v0)
+   2c128:	ac440118 	sw	a0,280(v0)
+   2c12c:	ac500110 	sw	s0,272(v0)
+   2c130:	2464c960 	addiu	a0,v1,-13984
+   2c134:	88840003 	lwl	a0,3(a0)
+   2c138:	8c460108 	lw	a2,264(v0)
+   2c13c:	9864c960 	lwr	a0,-13984(v1)
+   2c140:	24c60001 	addiu	a2,a2,1
+   2c144:	8e0501c0 	lw	a1,448(s0)
+   2c148:	24030001 	addiu	v1,zero,1
+   2c14c:	ac430100 	sw	v1,256(v0)
+   2c150:	ac460108 	sw	a2,264(v0)
+   2c154:	ac450184 	sw	a1,388(v0)
+   2c158:	8e080040 	lw	t0,64(s0)
+   2c15c:	8e250078 	lw	a1,120(s1)
+   2c160:	8e270034 	lw	a3,52(s1)
+   2c164:	8e2601c0 	lw	a2,448(s1)
+   2c168:	3083ffff 	andi	v1,a0,0xffff
+   2c16c:	24a50001 	addiu	a1,a1,1
+   2c170:	25080001 	addiu	t0,t0,1
+   2c174:	8c440120 	lw	a0,288(v0)
+   2c178:	a4430114 	sh	v1,276(v0)
+   2c17c:	ac510180 	sw	s1,384(v0)
+   2c180:	ae080040 	sw	t0,64(s0)
+   2c184:	ae070070 	sw	a3,112(s0)
+   2c188:	ae060064 	sw	a2,100(s0)
+   2c18c:	ae250078 	sw	a1,120(s1)
+   2c190:	a603006c 	sh	v1,108(s0)
+   2c194:	ae020060 	sw	v0,96(s0)
+   2c198:	ae110068 	sw	s1,104(s0)
+   2c19c:	80850000 	lb	a1,0(a0)
+   2c1a0:	10a0001e 	beqz	a1,2c21c <vfs_mount_link+0x128>
+   2c1a4:	00001821 	addu	v1,zero,zero
+   2c1a8:	24840001 	addiu	a0,a0,1
+   2c1ac:	00a33026 	xor	a2,a1,v1
+   2c1b0:	80850000 	lb	a1,0(a0)
+   2c1b4:	14a0fffc 	bnez	a1,2c1a8 <vfs_mount_link+0xb4>
+   2c1b8:	00661821 	addu	v1,v1,a2
+   2c1bc:	3c04cccc 	lui	a0,0xcccc
+   2c1c0:	3484cccd 	ori	a0,a0,0xcccd
+   2c1c4:	00640019 	multu	v1,a0
+   2c1c8:	00002010 	mfhi	a0
+   2c1cc:	000420c2 	srl	a0,a0,0x3
+   2c1d0:	000428c0 	sll	a1,a0,0x3
+   2c1d4:	00042040 	sll	a0,a0,0x1
+   2c1d8:	00852021 	addu	a0,a0,a1
+   2c1dc:	00642023 	subu	a0,v1,a0
+   2c1e0:	24840010 	addiu	a0,a0,16
+   2c1e4:	000420c0 	sll	a0,a0,0x3
+   2c1e8:	02248821 	addu	s1,s1,a0
+   2c1ec:	8e230008 	lw	v1,8(s1)
+   2c1f0:	8fbf001c 	lw	ra,28(sp)
+   2c1f4:	8c650000 	lw	a1,0(v1)
+   2c1f8:	24440128 	addiu	a0,v0,296
+   2c1fc:	ac43012c 	sw	v1,300(v0)
+   2c200:	ac450128 	sw	a1,296(v0)
+   2c204:	8fb10018 	lw	s1,24(sp)
+   2c208:	8fb00014 	lw	s0,20(sp)
+   2c20c:	aca40004 	sw	a0,4(a1)
+   2c210:	ac640000 	sw	a0,0(v1)
+   2c214:	03e00008 	jr	ra
+   2c218:	27bd0020 	addiu	sp,sp,32
+   2c21c:	0800b078 	j	2c1e0 <vfs_mount_link+0xec>
+   2c220:	00002021 	addu	a0,zero,zero
+
+0002c224 <vfs_context_init>:
+   2c224:	ac800004 	sw	zero,4(a0)
+   2c228:	ac800048 	sw	zero,72(a0)
+   2c22c:	00002821 	addu	a1,zero,zero
+   2c230:	0800199f 	j	667c <atomic_init>
+   2c234:	24840008 	addiu	a0,a0,8
+
+0002c238 <replicate_root_main>:
+   2c238:	27bdffd8 	addiu	sp,sp,-40
+   2c23c:	afb00014 	sw	s0,20(sp)
+   2c240:	8cf00010 	lw	s0,16(a3)
+   2c244:	acc00000 	sw	zero,0(a2)
+   2c248:	02002021 	addu	a0,s0,zero
+   2c24c:	afb30020 	sw	s3,32(sp)
+   2c250:	afb2001c 	sw	s2,28(sp)
+   2c254:	afb10018 	sw	s1,24(sp)
+   2c258:	afbf0024 	sw	ra,36(sp)
+   2c25c:	00e09021 	addu	s2,a3,zero
+   2c260:	0c00aad6 	jal	2ab58 <vfs_inode_new>
+   2c264:	00c09821 	addu	s3,a2,zero
+   2c268:	10400030 	beqz	v0,2c32c <replicate_root_main+0xf4>
+   2c26c:	00408821 	addu	s1,v0,zero
+   2c270:	24020001 	addiu	v0,zero,1
+   2c274:	00001821 	addu	v1,zero,zero
+   2c278:	8e440014 	lw	a0,20(s2)
+   2c27c:	ae220008 	sw	v0,8(s1)
+   2c280:	ae220020 	sw	v0,32(s1)
+   2c284:	00001021 	addu	v0,zero,zero
+   2c288:	ae23001c 	sw	v1,28(s1)
+   2c28c:	0c00ab29 	jal	2aca4 <vfs_inum_new>
+   2c290:	ae220018 	sw	v0,24(s1)
+   2c294:	8e440014 	lw	a0,20(s2)
+   2c298:	8e030090 	lw	v1,144(s0)
+   2c29c:	ae240064 	sw	a0,100(s1)
+   2c2a0:	8e470004 	lw	a3,4(s2)
+   2c2a4:	8e460008 	lw	a2,8(s2)
+   2c2a8:	8e45000c 	lw	a1,12(s2)
+   2c2ac:	8e440010 	lw	a0,16(s2)
+   2c2b0:	8e480000 	lw	t0,0(s2)
+   2c2b4:	8c63000c 	lw	v1,12(v1)
+   2c2b8:	ae220000 	sw	v0,0(s1)
+   2c2bc:	ae280060 	sw	t0,96(s1)
+   2c2c0:	ae270068 	sw	a3,104(s1)
+   2c2c4:	ae26006c 	sw	a2,108(s1)
+   2c2c8:	ae250070 	sw	a1,112(s1)
+   2c2cc:	10600006 	beqz	v1,2c2e8 <replicate_root_main+0xb0>
+   2c2d0:	ae2401c0 	sw	a0,448(s1)
+   2c2d4:	02002021 	addu	a0,s0,zero
+   2c2d8:	0060f809 	jalr	v1
+   2c2dc:	02202821 	addu	a1,s1,zero
+   2c2e0:	1440000b 	bnez	v0,2c310 <replicate_root_main+0xd8>
+   2c2e4:	ae620000 	sw	v0,0(s3)
+   2c2e8:	0c00ac3b 	jal	2b0ec <vfs_icache_add>
+   2c2ec:	02202021 	addu	a0,s1,zero
+   2c2f0:	3c020004 	lui	v0,0x4
+   2c2f4:	ae1100a0 	sw	s1,160(s0)
+   2c2f8:	2443c960 	addiu	v1,v0,-13984
+   2c2fc:	88630003 	lwl	v1,3(v1)
+   2c300:	8e240034 	lw	a0,52(s1)
+   2c304:	9843c960 	lwr	v1,-13984(v0)
+   2c308:	ae0400a8 	sw	a0,168(s0)
+   2c30c:	a60300a4 	sh	v1,164(s0)
+   2c310:	8fbf0024 	lw	ra,36(sp)
+   2c314:	8fb30020 	lw	s3,32(sp)
+   2c318:	8fb2001c 	lw	s2,28(sp)
+   2c31c:	8fb10018 	lw	s1,24(sp)
+   2c320:	8fb00014 	lw	s0,20(sp)
+   2c324:	03e00008 	jr	ra
+   2c328:	27bd0028 	addiu	sp,sp,40
+   2c32c:	8fbf0024 	lw	ra,36(sp)
+   2c330:	2402000c 	addiu	v0,zero,12
+   2c334:	ae620000 	sw	v0,0(s3)
+   2c338:	8fb2001c 	lw	s2,28(sp)
+   2c33c:	8fb30020 	lw	s3,32(sp)
+   2c340:	8fb10018 	lw	s1,24(sp)
+   2c344:	8fb00014 	lw	s0,20(sp)
+   2c348:	03e00008 	jr	ra
+   2c34c:	27bd0028 	addiu	sp,sp,40
+
+0002c350 <replicate_root_local>:
+   2c350:	00803021 	addu	a2,a0,zero
+   2c354:	00a03821 	addu	a3,a1,zero
+   2c358:	40057801 	mfc0	a1,$15,1
+   2c35c:	3c020004 	lui	v0,0x4
+   2c360:	2443c960 	addiu	v1,v0,-13984
+   2c364:	88640003 	lwl	a0,3(v1)
+   2c368:	30a50003 	andi	a1,a1,0x3
+   2c36c:	3c030004 	lui	v1,0x4
+   2c370:	00052880 	sll	a1,a1,0x2
+   2c374:	2463c950 	addiu	v1,v1,-14000
+   2c378:	9844c960 	lwr	a0,-13984(v0)
+   2c37c:	00a31021 	addu	v0,a1,v1
+   2c380:	8c450000 	lw	a1,0(v0)
+   2c384:	0800b08e 	j	2c238 <replicate_root_main>
+   2c388:	3084ffff 	andi	a0,a0,0xffff
+
+0002c38c <update_remote_contexts>:
+   2c38c:	27bdff68 	addiu	sp,sp,-152
+   2c390:	afb00070 	sw	s0,112(sp)
+   2c394:	3c100004 	lui	s0,0x4
+   2c398:	afb50084 	sw	s5,132(sp)
+   2c39c:	2615c960 	addiu	s5,s0,-13984
+   2c3a0:	afb3007c 	sw	s3,124(sp)
+   2c3a4:	8ab30003 	lwl	s3,3(s5)
+   2c3a8:	afb20078 	sw	s2,120(sp)
+   2c3ac:	9a13c960 	lwr	s3,-13984(s0)
+   2c3b0:	8c9201c0 	lw	s2,448(a0)
+   2c3b4:	3273ffff 	andi	s3,s3,0xffff
+   2c3b8:	00134900 	sll	t1,s3,0x4
+   2c3bc:	afb7008c 	sw	s7,140(sp)
+   2c3c0:	00131880 	sll	v1,s3,0x2
+   2c3c4:	241701b0 	addiu	s7,zero,432
+   2c3c8:	32420003 	andi	v0,s2,0x3
+   2c3cc:	01231823 	subu	v1,t1,v1
+   2c3d0:	afb40080 	sw	s4,128(sp)
+   2c3d4:	02e04821 	addu	t1,s7,zero
+   2c3d8:	2414006c 	addiu	s4,zero,108
+   2c3dc:	0002480b 	movn	t1,zero,v0
+   2c3e0:	afb60088 	sw	s6,136(sp)
+   2c3e4:	0002a00b 	movn	s4,zero,v0
+   2c3e8:	3c160004 	lui	s6,0x4
+   2c3ec:	3c020004 	lui	v0,0x4
+   2c3f0:	8c4271c0 	lw	v0,29120(v0)
+   2c3f4:	26d6c9a0 	addiu	s6,s6,-13920
+   2c3f8:	8c850070 	lw	a1,112(a0)
+   2c3fc:	8c860068 	lw	a2,104(a0)
+   2c400:	8c880064 	lw	t0,100(a0)
+   2c404:	8c870060 	lw	a3,96(a0)
+   2c408:	02c31821 	addu	v1,s6,v1
+   2c40c:	8c84006c 	lw	a0,108(a0)
+   2c410:	afbe0090 	sw	s8,144(sp)
+   2c414:	afa20060 	sw	v0,96(sp)
+   2c418:	afa3005c 	sw	v1,92(sp)
+   2c41c:	3c1e5555 	lui	s8,0x5555
+   2c420:	2e620101 	sltiu	v0,s3,257
+   2c424:	02491821 	addu	v1,s2,t1
+   2c428:	afb10074 	sw	s1,116(sp)
+   2c42c:	afbf0094 	sw	ra,148(sp)
+   2c430:	afa90058 	sw	t1,88(sp)
+   2c434:	afa80050 	sw	t0,80(sp)
+   2c438:	afa7003c 	sw	a3,60(sp)
+   2c43c:	afa60040 	sw	a2,64(sp)
+   2c440:	afa40044 	sw	a0,68(sp)
+   2c444:	afa50048 	sw	a1,72(sp)
+   2c448:	afa00028 	sw	zero,40(sp)
+   2c44c:	afb2004c 	sw	s2,76(sp)
+   2c450:	37de5555 	ori	s8,s8,0x5555
+   2c454:	00008821 	addu	s1,zero,zero
+   2c458:	afa20064 	sw	v0,100(sp)
+   2c45c:	afa30068 	sw	v1,104(sp)
+   2c460:	8fa30060 	lw	v1,96(sp)
+   2c464:	0223102b 	sltu	v0,s1,v1
+   2c468:	1040005d 	beqz	v0,2c5e0 <update_remote_contexts+0x254>
+   2c46c:	8fa20028 	lw	v0,40(sp)
+   2c470:	12330057 	beq	s1,s3,2c5d0 <update_remote_contexts+0x244>
+   2c474:	00000000 	sll	zero,zero,0x0
+   2c478:	8aa20003 	lwl	v0,3(s5)
+   2c47c:	9a02c960 	lwr	v0,-13984(s0)
+   2c480:	3042ffff 	andi	v0,v0,0xffff
+   2c484:	14510003 	bne	v0,s1,2c494 <update_remote_contexts+0x108>
+   2c488:	8fa50064 	lw	a1,100(sp)
+   2c48c:	12710060 	beq	s3,s1,2c610 <update_remote_contexts+0x284>
+   2c490:	02402021 	addu	a0,s2,zero
+   2c494:	14a00003 	bnez	a1,2c4a4 <update_remote_contexts+0x118>
+   2c498:	8fa9005c 	lw	t1,92(sp)
+   2c49c:	0800b127 	j	2c49c <update_remote_contexts+0x110>
+   2c4a0:	00000000 	sll	zero,zero,0x0
+   2c4a4:	8d240000 	lw	a0,0(t1)
+   2c4a8:	109efffc 	beq	a0,s8,2c49c <update_remote_contexts+0x110>
+   2c4ac:	3222ffff 	andi	v0,s1,0xffff
+   2c4b0:	2c430101 	sltiu	v1,v0,257
+   2c4b4:	10600048 	beqz	v1,2c5d8 <update_remote_contexts+0x24c>
+   2c4b8:	00021900 	sll	v1,v0,0x4
+   2c4bc:	00021080 	sll	v0,v0,0x2
+   2c4c0:	00621023 	subu	v0,v1,v0
+   2c4c4:	02c21021 	addu	v0,s6,v0
+   2c4c8:	8c450000 	lw	a1,0(v0)
+   2c4cc:	10be0042 	beq	a1,s8,2c5d8 <update_remote_contexts+0x24c>
+   2c4d0:	8fa30058 	lw	v1,88(sp)
+   2c4d4:	0800b13f 	j	2c4fc <update_remote_contexts+0x170>
+   2c4d8:	00001021 	addu	v0,zero,zero
+   2c4dc:	02463021 	addu	a2,s2,a2
+   2c4e0:	4808c000 	mfc2	t0,$24
+   2c4e4:	4884c000 	mtc2	a0,$24
+   2c4e8:	8cc90000 	lw	t1,0(a2)
+   2c4ec:	4885c000 	mtc2	a1,$24
+   2c4f0:	acc90000 	sw	t1,0(a2)
+   2c4f4:	4888c000 	mtc2	t0,$24
+   2c4f8:	24420001 	addiu	v0,v0,1
+   2c4fc:	1454fff7 	bne	v0,s4,2c4dc <update_remote_contexts+0x150>
+   2c500:	00023080 	sll	a2,v0,0x2
+   2c504:	1077000a 	beq	v1,s7,2c530 <update_remote_contexts+0x1a4>
+   2c508:	8fa20068 	lw	v0,104(sp)
+   2c50c:	4808c000 	mfc2	t0,$24
+   2c510:	4884c000 	mtc2	a0,$24
+   2c514:	80490000 	lb	t1,0(v0)
+   2c518:	4885c000 	mtc2	a1,$24
+   2c51c:	a0490000 	sb	t1,0(v0)
+   2c520:	4888c000 	mtc2	t0,$24
+   2c524:	24630001 	addiu	v1,v1,1
+   2c528:	1477fff8 	bne	v1,s7,2c50c <update_remote_contexts+0x180>
+   2c52c:	24420001 	addiu	v0,v0,1
+   2c530:	8e420004 	lw	v0,4(s2)
+   2c534:	30420001 	andi	v0,v0,0x1
+   2c538:	10400025 	beqz	v0,2c5d0 <update_remote_contexts+0x244>
+   2c53c:	27a30028 	addiu	v1,sp,40
+   2c540:	8aa20003 	lwl	v0,3(s5)
+   2c544:	9a02c960 	lwr	v0,-13984(s0)
+   2c548:	afa3002c 	sw	v1,44(sp)
+   2c54c:	24050004 	addiu	a1,zero,4
+   2c550:	27a9003c 	addiu	t1,sp,60
+   2c554:	24030018 	addiu	v1,zero,24
+   2c558:	3042ffff 	andi	v0,v0,0xffff
+   2c55c:	afa50030 	sw	a1,48(sp)
+   2c560:	afa90034 	sw	t1,52(sp)
+   2c564:	1051002f 	beq	v0,s1,2c624 <update_remote_contexts+0x298>
+   2c568:	afa30038 	sw	v1,56(sp)
+   2c56c:	40037801 	mfc0	v1,$15,1
+   2c570:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2c574:	afa3006c 	sw	v1,108(sp)
+   2c578:	70512802 	mul	a1,v0,s1
+   2c57c:	8fa3006c 	lw	v1,108(sp)
+   2c580:	27a9002c 	addiu	t1,sp,44
+   2c584:	30630003 	andi	v1,v1,0x3
+   2c588:	3c070003 	lui	a3,0x3
+   2c58c:	00a32021 	addu	a0,a1,v1
+   2c590:	afa90018 	sw	t1,24(sp)
+   2c594:	24050001 	addiu	a1,zero,1
+   2c598:	27a20030 	addiu	v0,sp,48
+   2c59c:	27a30034 	addiu	v1,sp,52
+   2c5a0:	27a90038 	addiu	t1,sp,56
+   2c5a4:	00003021 	addu	a2,zero,zero
+   2c5a8:	24e7c638 	addiu	a3,a3,-14792
+   2c5ac:	afa50010 	sw	a1,16(sp)
+   2c5b0:	afa50014 	sw	a1,20(sp)
+   2c5b4:	afa2001c 	sw	v0,28(sp)
+   2c5b8:	afa30020 	sw	v1,32(sp)
+   2c5bc:	0c003de8 	jal	f7a0 <rppc_generic>
+   2c5c0:	afa90024 	sw	t1,36(sp)
+   2c5c4:	8fa20028 	lw	v0,40(sp)
+   2c5c8:	14400006 	bnez	v0,2c5e4 <update_remote_contexts+0x258>
+   2c5cc:	8fbf0094 	lw	ra,148(sp)
+   2c5d0:	0800b118 	j	2c460 <update_remote_contexts+0xd4>
+   2c5d4:	26310001 	addiu	s1,s1,1
+   2c5d8:	0800b176 	j	2c5d8 <update_remote_contexts+0x24c>
+   2c5dc:	00000000 	sll	zero,zero,0x0
+   2c5e0:	8fbf0094 	lw	ra,148(sp)
+   2c5e4:	8fbe0090 	lw	s8,144(sp)
+   2c5e8:	8fb7008c 	lw	s7,140(sp)
+   2c5ec:	8fb60088 	lw	s6,136(sp)
+   2c5f0:	8fb50084 	lw	s5,132(sp)
+   2c5f4:	8fb40080 	lw	s4,128(sp)
+   2c5f8:	8fb3007c 	lw	s3,124(sp)
+   2c5fc:	8fb20078 	lw	s2,120(sp)
+   2c600:	8fb10074 	lw	s1,116(sp)
+   2c604:	8fb00070 	lw	s0,112(sp)
+   2c608:	03e00008 	jr	ra
+   2c60c:	27bd0098 	addiu	sp,sp,152
+   2c610:	02402821 	addu	a1,s2,zero
+   2c614:	0c00c12b 	jal	304ac <memcpy>
+   2c618:	240601b0 	addiu	a2,zero,432
+   2c61c:	0800b14d 	j	2c534 <update_remote_contexts+0x1a8>
+   2c620:	8e420004 	lw	v0,4(s2)
+   2c624:	27a40028 	addiu	a0,sp,40
+   2c628:	0c00b0d4 	jal	2c350 <replicate_root_local>
+   2c62c:	01202821 	addu	a1,t1,zero
+   2c630:	0800b172 	j	2c5c8 <update_remote_contexts+0x23c>
+   2c634:	8fa20028 	lw	v0,40(sp)
+
+0002c638 <replicate_root_demarshall>:
+   2c638:	27bdffc8 	addiu	sp,sp,-56
+   2c63c:	afbf0034 	sw	ra,52(sp)
+   2c640:	afbe0030 	sw	s8,48(sp)
+   2c644:	afb4002c 	sw	s4,44(sp)
+   2c648:	03a0f021 	addu	s8,sp,zero
+   2c64c:	afb30028 	sw	s3,40(sp)
+   2c650:	afb20024 	sw	s2,36(sp)
+   2c654:	afb10020 	sw	s1,32(sp)
+   2c658:	afb0001c 	sw	s0,28(sp)
+   2c65c:	27bdfff0 	addiu	sp,sp,-16
+   2c660:	27b20010 	addiu	s2,sp,16
+   2c664:	27bdffc8 	addiu	sp,sp,-56
+   2c668:	27b00010 	addiu	s0,sp,16
+   2c66c:	26020028 	addiu	v0,s0,40
+   2c670:	2403002c 	addiu	v1,zero,44
+   2c674:	ae030008 	sw	v1,8(s0)
+   2c678:	ae420000 	sw	v0,0(s2)
+   2c67c:	24030004 	addiu	v1,zero,4
+   2c680:	00808821 	addu	s1,a0,zero
+   2c684:	ae030024 	sw	v1,36(s0)
+   2c688:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2c68c:	8c940000 	lw	s4,0(a0)
+   2c690:	8e460000 	lw	a2,0(s2)
+   2c694:	00409821 	addu	s3,v0,zero
+   2c698:	02202021 	addu	a0,s1,zero
+   2c69c:	00002821 	addu	a1,zero,zero
+   2c6a0:	8e320000 	lw	s2,0(s1)
+   2c6a4:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2c6a8:	afc60010 	sw	a2,16(s8)
+   2c6ac:	0293001b 	divu	zero,s4,s3
+   2c6b0:	026001f4 	teq	s3,zero,0x7
+   2c6b4:	8fc60010 	lw	a2,16(s8)
+   2c6b8:	00403821 	addu	a3,v0,zero
+   2c6bc:	02402821 	addu	a1,s2,zero
+   2c6c0:	00002012 	mflo	a0
+   2c6c4:	0c00b08e 	jal	2c238 <replicate_root_main>
+   2c6c8:	3084ffff 	andi	a0,a0,0xffff
+   2c6cc:	02202021 	addu	a0,s1,zero
+   2c6d0:	02002821 	addu	a1,s0,zero
+   2c6d4:	2406002c 	addiu	a2,zero,44
+   2c6d8:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2c6dc:	24070001 	addiu	a3,zero,1
+   2c6e0:	03c0e821 	addu	sp,s8,zero
+   2c6e4:	8fbf0034 	lw	ra,52(sp)
+   2c6e8:	8fbe0030 	lw	s8,48(sp)
+   2c6ec:	8fb4002c 	lw	s4,44(sp)
+   2c6f0:	8fb30028 	lw	s3,40(sp)
+   2c6f4:	8fb20024 	lw	s2,36(sp)
+   2c6f8:	8fb10020 	lw	s1,32(sp)
+   2c6fc:	8fb0001c 	lw	s0,28(sp)
+   2c700:	03e00008 	jr	ra
+   2c704:	27bd0038 	addiu	sp,sp,56
+
+0002c708 <alloc_context_main>:
+   2c708:	27bdffd8 	addiu	sp,sp,-40
+   2c70c:	afb10014 	sw	s1,20(sp)
+   2c710:	3c110008 	lui	s1,0x8
+   2c714:	26310450 	addiu	s1,s1,1104
+   2c718:	afb40020 	sw	s4,32(sp)
+   2c71c:	afb3001c 	sw	s3,28(sp)
+   2c720:	afb20018 	sw	s2,24(sp)
+   2c724:	afb00010 	sw	s0,16(sp)
+   2c728:	afbf0024 	sw	ra,36(sp)
+   2c72c:	00c09821 	addu	s3,a2,zero
+   2c730:	acc00000 	sw	zero,0(a2)
+   2c734:	00008021 	addu	s0,zero,zero
+   2c738:	0220a021 	addu	s4,s1,zero
+   2c73c:	24120008 	addiu	s2,zero,8
+   2c740:	00101040 	sll	v0,s0,0x1
+   2c744:	001018c0 	sll	v1,s0,0x3
+   2c748:	00621023 	subu	v0,v1,v0
+   2c74c:	000220c0 	sll	a0,v0,0x3
+   2c750:	00442021 	addu	a0,v0,a0
+   2c754:	24840001 	addiu	a0,a0,1
+   2c758:	000420c0 	sll	a0,a0,0x3
+   2c75c:	02242021 	addu	a0,s1,a0
+   2c760:	0c0019ea 	jal	67a8 <atomic_test_set>
+   2c764:	24050001 	addiu	a1,zero,1
+   2c768:	1440000b 	bnez	v0,2c798 <alloc_context_main+0x90>
+   2c76c:	8fbf0024 	lw	ra,36(sp)
+   2c770:	26100001 	addiu	s0,s0,1
+   2c774:	1612fff2 	bne	s0,s2,2c740 <alloc_context_main+0x38>
+   2c778:	00000000 	sll	zero,zero,0x0
+   2c77c:	8fb40020 	lw	s4,32(sp)
+   2c780:	8fb3001c 	lw	s3,28(sp)
+   2c784:	8fb20018 	lw	s2,24(sp)
+   2c788:	8fb10014 	lw	s1,20(sp)
+   2c78c:	8fb00010 	lw	s0,16(sp)
+   2c790:	03e00008 	jr	ra
+   2c794:	27bd0028 	addiu	sp,sp,40
+   2c798:	00101180 	sll	v0,s0,0x6
+   2c79c:	00108100 	sll	s0,s0,0x4
+   2c7a0:	00508023 	subu	s0,v0,s0
+   2c7a4:	001010c0 	sll	v0,s0,0x3
+   2c7a8:	02028021 	addu	s0,s0,v0
+   2c7ac:	0290a021 	addu	s4,s4,s0
+   2c7b0:	ae740000 	sw	s4,0(s3)
+   2c7b4:	8fb20018 	lw	s2,24(sp)
+   2c7b8:	8fb40020 	lw	s4,32(sp)
+   2c7bc:	8fb3001c 	lw	s3,28(sp)
+   2c7c0:	8fb10014 	lw	s1,20(sp)
+   2c7c4:	8fb00010 	lw	s0,16(sp)
+   2c7c8:	03e00008 	jr	ra
+   2c7cc:	27bd0028 	addiu	sp,sp,40
+
+0002c7d0 <alloc_context_demarshall>:
+   2c7d0:	27bdffd8 	addiu	sp,sp,-40
+   2c7d4:	afbf0024 	sw	ra,36(sp)
+   2c7d8:	afbe0020 	sw	s8,32(sp)
+   2c7dc:	afb3001c 	sw	s3,28(sp)
+   2c7e0:	03a0f021 	addu	s8,sp,zero
+   2c7e4:	afb20018 	sw	s2,24(sp)
+   2c7e8:	afb10014 	sw	s1,20(sp)
+   2c7ec:	afb00010 	sw	s0,16(sp)
+   2c7f0:	27bdfff0 	addiu	sp,sp,-16
+   2c7f4:	27b20010 	addiu	s2,sp,16
+   2c7f8:	27bdffc8 	addiu	sp,sp,-56
+   2c7fc:	27b00010 	addiu	s0,sp,16
+   2c800:	2403002c 	addiu	v1,zero,44
+   2c804:	8c930000 	lw	s3,0(a0)
+   2c808:	26020028 	addiu	v0,s0,40
+   2c80c:	ae030008 	sw	v1,8(s0)
+   2c810:	24030004 	addiu	v1,zero,4
+   2c814:	00808821 	addu	s1,a0,zero
+   2c818:	ae030024 	sw	v1,36(s0)
+   2c81c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2c820:	ae420000 	sw	v0,0(s2)
+   2c824:	0262001b 	divu	zero,s3,v0
+   2c828:	004001f4 	teq	v0,zero,0x7
+   2c82c:	8e460000 	lw	a2,0(s2)
+   2c830:	8e250000 	lw	a1,0(s1)
+   2c834:	00002012 	mflo	a0
+   2c838:	0c00b1c2 	jal	2c708 <alloc_context_main>
+   2c83c:	3084ffff 	andi	a0,a0,0xffff
+   2c840:	02202021 	addu	a0,s1,zero
+   2c844:	02002821 	addu	a1,s0,zero
+   2c848:	2406002c 	addiu	a2,zero,44
+   2c84c:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2c850:	24070001 	addiu	a3,zero,1
+   2c854:	03c0e821 	addu	sp,s8,zero
+   2c858:	8fbf0024 	lw	ra,36(sp)
+   2c85c:	8fbe0020 	lw	s8,32(sp)
+   2c860:	8fb3001c 	lw	s3,28(sp)
+   2c864:	8fb20018 	lw	s2,24(sp)
+   2c868:	8fb10014 	lw	s1,20(sp)
+   2c86c:	8fb00010 	lw	s0,16(sp)
+   2c870:	03e00008 	jr	ra
+   2c874:	27bd0028 	addiu	sp,sp,40
+
+0002c878 <alloc_context_local>:
+   2c878:	00803021 	addu	a2,a0,zero
+   2c87c:	40057801 	mfc0	a1,$15,1
+   2c880:	3c020004 	lui	v0,0x4
+   2c884:	2443c960 	addiu	v1,v0,-13984
+   2c888:	88640003 	lwl	a0,3(v1)
+   2c88c:	30a50003 	andi	a1,a1,0x3
+   2c890:	3c030004 	lui	v1,0x4
+   2c894:	00052880 	sll	a1,a1,0x2
+   2c898:	2463c950 	addiu	v1,v1,-14000
+   2c89c:	9844c960 	lwr	a0,-13984(v0)
+   2c8a0:	00a31021 	addu	v0,a1,v1
+   2c8a4:	8c450000 	lw	a1,0(v0)
+   2c8a8:	0800b1c2 	j	2c708 <alloc_context_main>
+   2c8ac:	3084ffff 	andi	a0,a0,0xffff
+
+0002c8b0 <vfs_mount_prepare>:
+   2c8b0:	27bdffb0 	addiu	sp,sp,-80
+   2c8b4:	27a20028 	addiu	v0,sp,40
+   2c8b8:	24030004 	addiu	v1,zero,4
+   2c8bc:	afb30044 	sw	s3,68(sp)
+   2c8c0:	afb20040 	sw	s2,64(sp)
+   2c8c4:	afb1003c 	sw	s1,60(sp)
+   2c8c8:	afb00038 	sw	s0,56(sp)
+   2c8cc:	afa30030 	sw	v1,48(sp)
+   2c8d0:	afbf004c 	sw	ra,76(sp)
+   2c8d4:	afb40048 	sw	s4,72(sp)
+   2c8d8:	00809021 	addu	s2,a0,zero
+   2c8dc:	00a08821 	addu	s1,a1,zero
+   2c8e0:	00c08021 	addu	s0,a2,zero
+   2c8e4:	00e09821 	addu	s3,a3,zero
+   2c8e8:	afa00028 	sw	zero,40(sp)
+   2c8ec:	afa2002c 	sw	v0,44(sp)
+   2c8f0:	40032002 	mfc0	v1,$4,2
+   2c8f4:	8c630174 	lw	v1,372(v1)
+   2c8f8:	8c630004 	lw	v1,4(v1)
+   2c8fc:	14600014 	bnez	v1,2c950 <vfs_mount_prepare+0xa0>
+   2c900:	24030001 	addiu	v1,zero,1
+   2c904:	0c00b21e 	jal	2c878 <alloc_context_local>
+   2c908:	00402021 	addu	a0,v0,zero
+   2c90c:	8fa40028 	lw	a0,40(sp)
+   2c910:	10800029 	beqz	a0,2c9b8 <vfs_mount_prepare+0x108>
+   2c914:	00002821 	addu	a1,zero,zero
+   2c918:	ac92008c 	sw	s2,140(a0)
+   2c91c:	0c00199f 	jal	667c <atomic_init>
+   2c920:	2484004c 	addiu	a0,a0,76
+   2c924:	8e220000 	lw	v0,0(s1)
+   2c928:	0040f809 	jalr	v0
+   2c92c:	8fa40028 	lw	a0,40(sp)
+   2c930:	14400018 	bnez	v0,2c994 <vfs_mount_prepare+0xe4>
+   2c934:	00409021 	addu	s2,v0,zero
+   2c938:	16600029 	bnez	s3,2c9e0 <vfs_mount_prepare+0x130>
+   2c93c:	00000000 	sll	zero,zero,0x0
+   2c940:	12000014 	beqz	s0,2c994 <vfs_mount_prepare+0xe4>
+   2c944:	8fa20028 	lw	v0,40(sp)
+   2c948:	0800b265 	j	2c994 <vfs_mount_prepare+0xe4>
+   2c94c:	ae020000 	sw	v0,0(s0)
+   2c950:	3c070003 	lui	a3,0x3
+   2c954:	afa30010 	sw	v1,16(sp)
+   2c958:	27a3002c 	addiu	v1,sp,44
+   2c95c:	afa30018 	sw	v1,24(sp)
+   2c960:	24e7c7d0 	addiu	a3,a3,-14384
+   2c964:	27a30030 	addiu	v1,sp,48
+   2c968:	00002021 	addu	a0,zero,zero
+   2c96c:	00002821 	addu	a1,zero,zero
+   2c970:	00003021 	addu	a2,zero,zero
+   2c974:	afa3001c 	sw	v1,28(sp)
+   2c978:	afa20024 	sw	v0,36(sp)
+   2c97c:	afa00014 	sw	zero,20(sp)
+   2c980:	0c003de8 	jal	f7a0 <rppc_generic>
+   2c984:	afa20020 	sw	v0,32(sp)
+   2c988:	1040ffe1 	beqz	v0,2c910 <vfs_mount_prepare+0x60>
+   2c98c:	8fa40028 	lw	a0,40(sp)
+   2c990:	00409021 	addu	s2,v0,zero
+   2c994:	8fbf004c 	lw	ra,76(sp)
+   2c998:	02401021 	addu	v0,s2,zero
+   2c99c:	8fb40048 	lw	s4,72(sp)
+   2c9a0:	8fb30044 	lw	s3,68(sp)
+   2c9a4:	8fb20040 	lw	s2,64(sp)
+   2c9a8:	8fb1003c 	lw	s1,60(sp)
+   2c9ac:	8fb00038 	lw	s0,56(sp)
+   2c9b0:	03e00008 	jr	ra
+   2c9b4:	27bd0050 	addiu	sp,sp,80
+   2c9b8:	8fbf004c 	lw	ra,76(sp)
+   2c9bc:	2412fff4 	addiu	s2,zero,-12
+   2c9c0:	02401021 	addu	v0,s2,zero
+   2c9c4:	8fb40048 	lw	s4,72(sp)
+   2c9c8:	8fb30044 	lw	s3,68(sp)
+   2c9cc:	8fb20040 	lw	s2,64(sp)
+   2c9d0:	8fb1003c 	lw	s1,60(sp)
+   2c9d4:	8fb00038 	lw	s0,56(sp)
+   2c9d8:	03e00008 	jr	ra
+   2c9dc:	27bd0050 	addiu	sp,sp,80
+   2c9e0:	0c00aad6 	jal	2ab58 <vfs_inode_new>
+   2c9e4:	8fa40028 	lw	a0,40(sp)
+   2c9e8:	1040fff3 	beqz	v0,2c9b8 <vfs_mount_prepare+0x108>
+   2c9ec:	0040a021 	addu	s4,v0,zero
+   2c9f0:	8e220008 	lw	v0,8(s1)
+   2c9f4:	8fa40028 	lw	a0,40(sp)
+   2c9f8:	0040f809 	jalr	v0
+   2c9fc:	02802821 	addu	a1,s4,zero
+   2ca00:	1440ffe3 	bnez	v0,2c990 <vfs_mount_prepare+0xe0>
+   2ca04:	00000000 	sll	zero,zero,0x0
+   2ca08:	0c00ac3b 	jal	2b0ec <vfs_icache_add>
+   2ca0c:	02802021 	addu	a0,s4,zero
+   2ca10:	8fa30028 	lw	v1,40(sp)
+   2ca14:	3c020004 	lui	v0,0x4
+   2ca18:	ac7400a0 	sw	s4,160(v1)
+   2ca1c:	2444c960 	addiu	a0,v0,-13984
+   2ca20:	88840003 	lwl	a0,3(a0)
+   2ca24:	8e850034 	lw	a1,52(s4)
+   2ca28:	9844c960 	lwr	a0,-13984(v0)
+   2ca2c:	ac6500a8 	sw	a1,168(v1)
+   2ca30:	ae740000 	sw	s4,0(s3)
+   2ca34:	0800b250 	j	2c940 <vfs_mount_prepare+0x90>
+   2ca38:	a46400a4 	sh	a0,164(v1)
+
+0002ca3c <vfs_init>:
+   2ca3c:	27bdffd8 	addiu	sp,sp,-40
+   2ca40:	afb0001c 	sw	s0,28(sp)
+   2ca44:	3c100008 	lui	s0,0x8
+   2ca48:	26100450 	addiu	s0,s0,1104
+   2ca4c:	afb10020 	sw	s1,32(sp)
+   2ca50:	afbf0024 	sw	ra,36(sp)
+   2ca54:	26110d80 	addiu	s1,s0,3456
+   2ca58:	02002021 	addu	a0,s0,zero
+   2ca5c:	0c00b089 	jal	2c224 <vfs_context_init>
+   2ca60:	261001b0 	addiu	s0,s0,432
+   2ca64:	1611fffd 	bne	s0,s1,2ca5c <vfs_init+0x20>
+   2ca68:	02002021 	addu	a0,s0,zero
+   2ca6c:	0c007c0c 	jal	1f030 <dirty_pages_init>
+   2ca70:	00000000 	sll	zero,zero,0x0
+   2ca74:	0c00ad6d 	jal	2b5b4 <vfs_cache_init>
+   2ca78:	00000000 	sll	zero,zero,0x0
+   2ca7c:	14400005 	bnez	v0,2ca94 <vfs_init+0x58>
+   2ca80:	8fbf0024 	lw	ra,36(sp)
+   2ca84:	8fb10020 	lw	s1,32(sp)
+   2ca88:	8fb0001c 	lw	s0,28(sp)
+   2ca8c:	03e00008 	jr	ra
+   2ca90:	27bd0028 	addiu	sp,sp,40
+   2ca94:	3c050003 	lui	a1,0x3
+   2ca98:	3c070003 	lui	a3,0x3
+   2ca9c:	24a57a74 	addiu	a1,a1,31348
+   2caa0:	24e77ac4 	addiu	a3,a3,31428
+   2caa4:	24040001 	addiu	a0,zero,1
+   2caa8:	24060067 	addiu	a2,zero,103
+   2caac:	0c00097d 	jal	25f4 <__perror>
+   2cab0:	afa20010 	sw	v0,16(sp)
+   2cab4:	0800b2ad 	j	2cab4 <vfs_init+0x78>
+   2cab8:	00000000 	sll	zero,zero,0x0
+
+0002cabc <update_task0_root_cwd>:
+   2cabc:	27bdffa8 	addiu	sp,sp,-88
+   2cac0:	afb20038 	sw	s2,56(sp)
+   2cac4:	3c120004 	lui	s2,0x4
+   2cac8:	afb40040 	sw	s4,64(sp)
+   2cacc:	afb00030 	sw	s0,48(sp)
+   2cad0:	afbf0054 	sw	ra,84(sp)
+   2cad4:	afbe0050 	sw	s8,80(sp)
+   2cad8:	afb7004c 	sw	s7,76(sp)
+   2cadc:	afb60048 	sw	s6,72(sp)
+   2cae0:	afb50044 	sw	s5,68(sp)
+   2cae4:	afb3003c 	sw	s3,60(sp)
+   2cae8:	afb10034 	sw	s1,52(sp)
+   2caec:	2647c960 	addiu	a3,s2,-13984
+   2caf0:	88f30003 	lwl	s3,3(a3)
+   2caf4:	3c020004 	lui	v0,0x4
+   2caf8:	9a53c960 	lwr	s3,-13984(s2)
+   2cafc:	24900510 	addiu	s0,a0,1296
+   2cb00:	2494054c 	addiu	s4,a0,1356
+   2cb04:	8c4d71c0 	lw	t5,29120(v0)
+   2cb08:	24830540 	addiu	v1,a0,1344
+   2cb0c:	3273ffff 	andi	s3,s3,0xffff
+   2cb10:	02001021 	addu	v0,s0,zero
+   2cb14:	02802021 	addu	a0,s4,zero
+   2cb18:	8c490000 	lw	t1,0(v0)
+   2cb1c:	8c480004 	lw	t0,4(v0)
+   2cb20:	8c460008 	lw	a2,8(v0)
+   2cb24:	8c45000c 	lw	a1,12(v0)
+   2cb28:	24420010 	addiu	v0,v0,16
+   2cb2c:	ac890000 	sw	t1,0(a0)
+   2cb30:	ac880004 	sw	t0,4(a0)
+   2cb34:	ac860008 	sw	a2,8(a0)
+   2cb38:	ac85000c 	sw	a1,12(a0)
+   2cb3c:	1443fff6 	bne	v0,v1,2cb18 <update_task0_root_cwd+0x5c>
+   2cb40:	24840010 	addiu	a0,a0,16
+   2cb44:	2403003c 	addiu	v1,zero,60
+   2cb48:	8c460008 	lw	a2,8(v0)
+   2cb4c:	8c450000 	lw	a1,0(v0)
+   2cb50:	32170003 	andi	s7,s0,0x3
+   2cb54:	8c420004 	lw	v0,4(v0)
+   2cb58:	00606021 	addu	t4,v1,zero
+   2cb5c:	00134080 	sll	t0,s3,0x2
+   2cb60:	00135100 	sll	t2,s3,0x4
+   2cb64:	3c1e0004 	lui	s8,0x4
+   2cb68:	0017600b 	movn	t4,zero,s7
+   2cb6c:	01485023 	subu	t2,t2,t0
+   2cb70:	27dec9a0 	addiu	s8,s8,-13920
+   2cb74:	2416000f 	addiu	s6,zero,15
+   2cb78:	ac820004 	sw	v0,4(a0)
+   2cb7c:	3c155555 	lui	s5,0x5555
+   2cb80:	020c1021 	addu	v0,s0,t4
+   2cb84:	ac860008 	sw	a2,8(a0)
+   2cb88:	ac850000 	sw	a1,0(a0)
+   2cb8c:	03ca5021 	addu	t2,s8,t2
+   2cb90:	36b55555 	ori	s5,s5,0x5555
+   2cb94:	0017b00b 	movn	s6,zero,s7
+   2cb98:	32990003 	andi	t9,s4,0x3
+   2cb9c:	00008821 	addu	s1,zero,zero
+   2cba0:	2e6b0101 	sltiu	t3,s3,257
+   2cba4:	afa20010 	sw	v0,16(sp)
+   2cba8:	022d102b 	sltu	v0,s1,t5
+   2cbac:	10400034 	beqz	v0,2cc80 <update_task0_root_cwd+0x1c4>
+   2cbb0:	8fbf0054 	lw	ra,84(sp)
+   2cbb4:	12330030 	beq	s1,s3,2cc78 <update_task0_root_cwd+0x1bc>
+   2cbb8:	00000000 	sll	zero,zero,0x0
+   2cbbc:	88e20003 	lwl	v0,3(a3)
+   2cbc0:	9a42c960 	lwr	v0,-13984(s2)
+   2cbc4:	3042ffff 	andi	v0,v0,0xffff
+   2cbc8:	14510003 	bne	v0,s1,2cbd8 <update_task0_root_cwd+0x11c>
+   2cbcc:	00000000 	sll	zero,zero,0x0
+   2cbd0:	12710038 	beq	s3,s1,2ccb4 <update_task0_root_cwd+0x1f8>
+   2cbd4:	02002021 	addu	a0,s0,zero
+   2cbd8:	15600003 	bnez	t3,2cbe8 <update_task0_root_cwd+0x12c>
+   2cbdc:	00000000 	sll	zero,zero,0x0
+   2cbe0:	0800b2f8 	j	2cbe0 <update_task0_root_cwd+0x124>
+   2cbe4:	00000000 	sll	zero,zero,0x0
+   2cbe8:	8d420000 	lw	v0,0(t2)
+   2cbec:	1055fffc 	beq	v0,s5,2cbe0 <update_task0_root_cwd+0x124>
+   2cbf0:	3224ffff 	andi	a0,s1,0xffff
+   2cbf4:	2c850101 	sltiu	a1,a0,257
+   2cbf8:	10a0002c 	beqz	a1,2ccac <update_task0_root_cwd+0x1f0>
+   2cbfc:	00042880 	sll	a1,a0,0x2
+   2cc00:	00043100 	sll	a2,a0,0x4
+   2cc04:	00c52823 	subu	a1,a2,a1
+   2cc08:	03c52821 	addu	a1,s8,a1
+   2cc0c:	8cae0000 	lw	t6,0(a1)
+   2cc10:	11d50026 	beq	t6,s5,2ccac <update_task0_root_cwd+0x1f0>
+   2cc14:	01803021 	addu	a2,t4,zero
+   2cc18:	0800b310 	j	2cc40 <update_task0_root_cwd+0x184>
+   2cc1c:	00002821 	addu	a1,zero,zero
+   2cc20:	020f7821 	addu	t7,s0,t7
+   2cc24:	4808c000 	mfc2	t0,$24
+   2cc28:	4882c000 	mtc2	v0,$24
+   2cc2c:	8de90000 	lw	t1,0(t7)
+   2cc30:	488ec000 	mtc2	t6,$24
+   2cc34:	ade90000 	sw	t1,0(t7)
+   2cc38:	4888c000 	mtc2	t0,$24
+   2cc3c:	24a50001 	addiu	a1,a1,1
+   2cc40:	14b6fff7 	bne	a1,s6,2cc20 <update_task0_root_cwd+0x164>
+   2cc44:	00057880 	sll	t7,a1,0x2
+   2cc48:	8fa50010 	lw	a1,16(sp)
+   2cc4c:	10c3002c 	beq	a2,v1,2cd00 <update_task0_root_cwd+0x244>
+   2cc50:	00000000 	sll	zero,zero,0x0
+   2cc54:	4808c000 	mfc2	t0,$24
+   2cc58:	4882c000 	mtc2	v0,$24
+   2cc5c:	80a90000 	lb	t1,0(a1)
+   2cc60:	488ec000 	mtc2	t6,$24
+   2cc64:	a0a90000 	sb	t1,0(a1)
+   2cc68:	4888c000 	mtc2	t0,$24
+   2cc6c:	24c60001 	addiu	a2,a2,1
+   2cc70:	0800b313 	j	2cc4c <update_task0_root_cwd+0x190>
+   2cc74:	24a50001 	addiu	a1,a1,1
+   2cc78:	0800b2ea 	j	2cba8 <update_task0_root_cwd+0xec>
+   2cc7c:	26310001 	addiu	s1,s1,1
+   2cc80:	8fbe0050 	lw	s8,80(sp)
+   2cc84:	8fb7004c 	lw	s7,76(sp)
+   2cc88:	8fb60048 	lw	s6,72(sp)
+   2cc8c:	8fb50044 	lw	s5,68(sp)
+   2cc90:	8fb40040 	lw	s4,64(sp)
+   2cc94:	8fb3003c 	lw	s3,60(sp)
+   2cc98:	8fb20038 	lw	s2,56(sp)
+   2cc9c:	8fb10034 	lw	s1,52(sp)
+   2cca0:	8fb00030 	lw	s0,48(sp)
+   2cca4:	03e00008 	jr	ra
+   2cca8:	27bd0058 	addiu	sp,sp,88
+   2ccac:	0800b32b 	j	2ccac <update_task0_root_cwd+0x1f0>
+   2ccb0:	00000000 	sll	zero,zero,0x0
+   2ccb4:	02002821 	addu	a1,s0,zero
+   2ccb8:	2406003c 	addiu	a2,zero,60
+   2ccbc:	afa30024 	sw	v1,36(sp)
+   2ccc0:	afa70020 	sw	a3,32(sp)
+   2ccc4:	afaa0018 	sw	t2,24(sp)
+   2ccc8:	afab0028 	sw	t3,40(sp)
+   2cccc:	afac002c 	sw	t4,44(sp)
+   2ccd0:	afad001c 	sw	t5,28(sp)
+   2ccd4:	0c00c12b 	jal	304ac <memcpy>
+   2ccd8:	afb90014 	sw	t9,20(sp)
+   2ccdc:	8faa0018 	lw	t2,24(sp)
+   2cce0:	8fb90014 	lw	t9,20(sp)
+   2cce4:	8d420000 	lw	v0,0(t2)
+   2cce8:	8fad001c 	lw	t5,28(sp)
+   2ccec:	8fac002c 	lw	t4,44(sp)
+   2ccf0:	8fab0028 	lw	t3,40(sp)
+   2ccf4:	8fa70020 	lw	a3,32(sp)
+   2ccf8:	8fa30024 	lw	v1,36(sp)
+   2ccfc:	3264ffff 	andi	a0,s3,0xffff
+   2cd00:	11600030 	beqz	t3,2cdc4 <update_task0_root_cwd+0x308>
+   2cd04:	00000000 	sll	zero,zero,0x0
+   2cd08:	1055002e 	beq	v0,s5,2cdc4 <update_task0_root_cwd+0x308>
+   2cd0c:	2c850101 	sltiu	a1,a0,257
+   2cd10:	10a0002a 	beqz	a1,2cdbc <update_task0_root_cwd+0x300>
+   2cd14:	00042900 	sll	a1,a0,0x4
+   2cd18:	00042080 	sll	a0,a0,0x2
+   2cd1c:	00a42023 	subu	a0,a1,a0
+   2cd20:	03c42021 	addu	a0,s8,a0
+   2cd24:	8c860000 	lw	a2,0(a0)
+   2cd28:	10d50024 	beq	a2,s5,2cdbc <update_task0_root_cwd+0x300>
+   2cd2c:	00000000 	sll	zero,zero,0x0
+   2cd30:	17200020 	bnez	t9,2cdb4 <update_task0_root_cwd+0x2f8>
+   2cd34:	00002021 	addu	a0,zero,zero
+   2cd38:	16e00003 	bnez	s7,2cd48 <update_task0_root_cwd+0x28c>
+   2cd3c:	00007021 	addu	t6,zero,zero
+   2cd40:	2404003c 	addiu	a0,zero,60
+   2cd44:	240e000f 	addiu	t6,zero,15
+   2cd48:	00002821 	addu	a1,zero,zero
+   2cd4c:	10ae000b 	beq	a1,t6,2cd7c <update_task0_root_cwd+0x2c0>
+   2cd50:	00057880 	sll	t7,a1,0x2
+   2cd54:	028fc021 	addu	t8,s4,t7
+   2cd58:	020f7821 	addu	t7,s0,t7
+   2cd5c:	4808c000 	mfc2	t0,$24
+   2cd60:	4882c000 	mtc2	v0,$24
+   2cd64:	8de90000 	lw	t1,0(t7)
+   2cd68:	4886c000 	mtc2	a2,$24
+   2cd6c:	af090000 	sw	t1,0(t8)
+   2cd70:	4888c000 	mtc2	t0,$24
+   2cd74:	0800b353 	j	2cd4c <update_task0_root_cwd+0x290>
+   2cd78:	24a50001 	addiu	a1,a1,1
+   2cd7c:	02047021 	addu	t6,s0,a0
+   2cd80:	02842821 	addu	a1,s4,a0
+   2cd84:	1083ffbc 	beq	a0,v1,2cc78 <update_task0_root_cwd+0x1bc>
+   2cd88:	00000000 	sll	zero,zero,0x0
+   2cd8c:	4808c000 	mfc2	t0,$24
+   2cd90:	4882c000 	mtc2	v0,$24
+   2cd94:	81c90000 	lb	t1,0(t6)
+   2cd98:	4886c000 	mtc2	a2,$24
+   2cd9c:	a0a90000 	sb	t1,0(a1)
+   2cda0:	4888c000 	mtc2	t0,$24
+   2cda4:	24840001 	addiu	a0,a0,1
+   2cda8:	25ce0001 	addiu	t6,t6,1
+   2cdac:	0800b361 	j	2cd84 <update_task0_root_cwd+0x2c8>
+   2cdb0:	24a50001 	addiu	a1,a1,1
+   2cdb4:	0800b352 	j	2cd48 <update_task0_root_cwd+0x28c>
+   2cdb8:	00007021 	addu	t6,zero,zero
+   2cdbc:	0800b36f 	j	2cdbc <update_task0_root_cwd+0x300>
+   2cdc0:	00000000 	sll	zero,zero,0x0
+   2cdc4:	0800b371 	j	2cdc4 <update_task0_root_cwd+0x308>
+   2cdc8:	00000000 	sll	zero,zero,0x0
+
+0002cdcc <vfs_mount_fs_root>:
+   2cdcc:	27bdffb0 	addiu	sp,sp,-80
+   2cdd0:	2ca30005 	sltiu	v1,a1,5
+   2cdd4:	afb10048 	sw	s1,72(sp)
+   2cdd8:	afbf004c 	sw	ra,76(sp)
+   2cddc:	afb00044 	sw	s0,68(sp)
+   2cde0:	00a01021 	addu	v0,a1,zero
+   2cde4:	10600019 	beqz	v1,2ce4c <vfs_mount_fs_root+0x80>
+   2cde8:	00c08821 	addu	s1,a2,zero
+   2cdec:	3c030003 	lui	v1,0x3
+   2cdf0:	24637b68 	addiu	v1,v1,31592
+   2cdf4:	00052900 	sll	a1,a1,0x4
+   2cdf8:	00652821 	addu	a1,v1,a1
+   2cdfc:	8ca50004 	lw	a1,4(a1)
+   2ce00:	14a00022 	bnez	a1,2ce8c <vfs_mount_fs_root+0xc0>
+   2ce04:	3c060003 	lui	a2,0x3
+   2ce08:	00021100 	sll	v0,v0,0x4
+   2ce0c:	00621821 	addu	v1,v1,v0
+   2ce10:	3c020004 	lui	v0,0x4
+   2ce14:	8c449100 	lw	a0,-28416(v0)
+   2ce18:	8c620008 	lw	v0,8(v1)
+   2ce1c:	3c070003 	lui	a3,0x3
+   2ce20:	24c67afc 	addiu	a2,a2,31484
+   2ce24:	24e77bb8 	addiu	a3,a3,31672
+   2ce28:	afa20010 	sw	v0,16(sp)
+   2ce2c:	0c0009b0 	jal	26c0 <__fprintk>
+   2ce30:	24100016 	addiu	s0,zero,22
+   2ce34:	8fbf004c 	lw	ra,76(sp)
+   2ce38:	02001021 	addu	v0,s0,zero
+   2ce3c:	8fb10048 	lw	s1,72(sp)
+   2ce40:	8fb00044 	lw	s0,68(sp)
+   2ce44:	03e00008 	jr	ra
+   2ce48:	27bd0050 	addiu	sp,sp,80
+   2ce4c:	3c030004 	lui	v1,0x4
+   2ce50:	8c649100 	lw	a0,-28416(v1)
+   2ce54:	3c060003 	lui	a2,0x3
+   2ce58:	3c070003 	lui	a3,0x3
+   2ce5c:	24c67ad4 	addiu	a2,a2,31444
+   2ce60:	24e77bb8 	addiu	a3,a3,31672
+   2ce64:	00002821 	addu	a1,zero,zero
+   2ce68:	0c0009b0 	jal	26c0 <__fprintk>
+   2ce6c:	afa20010 	sw	v0,16(sp)
+   2ce70:	8fbf004c 	lw	ra,76(sp)
+   2ce74:	24100016 	addiu	s0,zero,22
+   2ce78:	02001021 	addu	v0,s0,zero
+   2ce7c:	8fb10048 	lw	s1,72(sp)
+   2ce80:	8fb00044 	lw	s0,68(sp)
+   2ce84:	03e00008 	jr	ra
+   2ce88:	27bd0050 	addiu	sp,sp,80
+   2ce8c:	00021100 	sll	v0,v0,0x4
+   2ce90:	00621821 	addu	v1,v1,v0
+   2ce94:	8c65000c 	lw	a1,12(v1)
+   2ce98:	00003021 	addu	a2,zero,zero
+   2ce9c:	0c00b22c 	jal	2c8b0 <vfs_mount_prepare>
+   2cea0:	27a70020 	addiu	a3,sp,32
+   2cea4:	1440ffe3 	bnez	v0,2ce34 <vfs_mount_fs_root+0x68>
+   2cea8:	00408021 	addu	s0,v0,zero
+   2ceac:	3c050003 	lui	a1,0x3
+   2ceb0:	24a573c8 	addiu	a1,a1,29640
+   2ceb4:	00002021 	addu	a0,zero,zero
+   2ceb8:	00003021 	addu	a2,zero,zero
+   2cebc:	0c00b22c 	jal	2c8b0 <vfs_mount_prepare>
+   2cec0:	27a70024 	addiu	a3,sp,36
+   2cec4:	1440ffdb 	bnez	v0,2ce34 <vfs_mount_fs_root+0x68>
+   2cec8:	00408021 	addu	s0,v0,zero
+   2cecc:	3c050003 	lui	a1,0x3
+   2ced0:	24a5747c 	addiu	a1,a1,29820
+   2ced4:	00002021 	addu	a0,zero,zero
+   2ced8:	00003021 	addu	a2,zero,zero
+   2cedc:	0c00b22c 	jal	2c8b0 <vfs_mount_prepare>
+   2cee0:	27a70028 	addiu	a3,sp,40
+   2cee4:	1440ffd3 	bnez	v0,2ce34 <vfs_mount_fs_root+0x68>
+   2cee8:	00408021 	addu	s0,v0,zero
+   2ceec:	3c050003 	lui	a1,0x3
+   2cef0:	24a577b0 	addiu	a1,a1,30640
+   2cef4:	00002021 	addu	a0,zero,zero
+   2cef8:	00003021 	addu	a2,zero,zero
+   2cefc:	0c00b22c 	jal	2c8b0 <vfs_mount_prepare>
+   2cf00:	27a7002c 	addiu	a3,sp,44
+   2cf04:	1440ffcb 	bnez	v0,2ce34 <vfs_mount_fs_root+0x68>
+   2cf08:	00408021 	addu	s0,v0,zero
+   2cf0c:	8fa40020 	lw	a0,32(sp)
+   2cf10:	8fa50024 	lw	a1,36(sp)
+   2cf14:	8c820040 	lw	v0,64(a0)
+   2cf18:	3c060003 	lui	a2,0x3
+   2cf1c:	24420001 	addiu	v0,v0,1
+   2cf20:	ac820040 	sw	v0,64(a0)
+   2cf24:	0c00b03d 	jal	2c0f4 <vfs_mount_link>
+   2cf28:	24c673c4 	addiu	a2,a2,29636
+   2cf2c:	8fa40020 	lw	a0,32(sp)
+   2cf30:	8fa50028 	lw	a1,40(sp)
+   2cf34:	3c060003 	lui	a2,0x3
+   2cf38:	0c00b03d 	jal	2c0f4 <vfs_mount_link>
+   2cf3c:	24c651ec 	addiu	a2,a2,20972
+   2cf40:	8fa5002c 	lw	a1,44(sp)
+   2cf44:	8fa40020 	lw	a0,32(sp)
+   2cf48:	3c060003 	lui	a2,0x3
+   2cf4c:	0c00b03d 	jal	2c0f4 <vfs_mount_link>
+   2cf50:	24c67b3c 	addiu	a2,a2,31548
+   2cf54:	0c00b0e3 	jal	2c38c <update_remote_contexts>
+   2cf58:	8fa40020 	lw	a0,32(sp)
+   2cf5c:	0c00b0e3 	jal	2c38c <update_remote_contexts>
+   2cf60:	8fa40024 	lw	a0,36(sp)
+   2cf64:	0c00b0e3 	jal	2c38c <update_remote_contexts>
+   2cf68:	8fa40028 	lw	a0,40(sp)
+   2cf6c:	0c00b0e3 	jal	2c38c <update_remote_contexts>
+   2cf70:	8fa4002c 	lw	a0,44(sp)
+   2cf74:	3c040004 	lui	a0,0x4
+   2cf78:	00408021 	addu	s0,v0,zero
+   2cf7c:	2482c960 	addiu	v0,a0,-13984
+   2cf80:	88430003 	lwl	v1,3(v0)
+   2cf84:	8fa20020 	lw	v0,32(sp)
+   2cf88:	9883c960 	lwr	v1,-13984(a0)
+   2cf8c:	8c480034 	lw	t0,52(v0)
+   2cf90:	8c4701c4 	lw	a3,452(v0)
+   2cf94:	8c4401c0 	lw	a0,448(v0)
+   2cf98:	3063ffff 	andi	v1,v1,0xffff
+   2cf9c:	26250510 	addiu	a1,s1,1296
+   2cfa0:	00003021 	addu	a2,zero,zero
+   2cfa4:	afa80038 	sw	t0,56(sp)
+   2cfa8:	27a80030 	addiu	t0,sp,48
+   2cfac:	afa80010 	sw	t0,16(sp)
+   2cfb0:	afa30018 	sw	v1,24(sp)
+   2cfb4:	a7a30034 	sh	v1,52(sp)
+   2cfb8:	afa20030 	sw	v0,48(sp)
+   2cfbc:	0c00af42 	jal	2bd08 <vfs_file_get>
+   2cfc0:	afa00014 	sw	zero,20(sp)
+   2cfc4:	3c020004 	lui	v0,0x4
+   2cfc8:	8c4571c0 	lw	a1,29120(v0)
+   2cfcc:	8e240524 	lw	a0,1316(s1)
+   2cfd0:	00052840 	sll	a1,a1,0x1
+   2cfd4:	2484000c 	addiu	a0,a0,12
+   2cfd8:	0c0019b9 	jal	66e4 <atomic_add>
+   2cfdc:	24a5ffff 	addiu	a1,a1,-1
+   2cfe0:	0c00b2af 	jal	2cabc <update_task0_root_cwd>
+   2cfe4:	02202021 	addu	a0,s1,zero
+   2cfe8:	0800b38e 	j	2ce38 <vfs_mount_fs_root+0x6c>
+   2cfec:	8fbf004c 	lw	ra,76(sp)
+
+0002cff0 <vfs_real_lookup>:
+   2cff0:	27bdffd8 	addiu	sp,sp,-40
+   2cff4:	afb10020 	sw	s1,32(sp)
+   2cff8:	afb0001c 	sw	s0,28(sp)
+   2cffc:	afbf0024 	sw	ra,36(sp)
+   2d000:	00a08021 	addu	s0,a1,zero
+   2d004:	00808821 	addu	s1,a0,zero
+   2d008:	40022002 	mfc0	v0,$4,2
+   2d00c:	8c8201bc 	lw	v0,444(a0)
+   2d010:	00e02821 	addu	a1,a3,zero
+   2d014:	8c42000c 	lw	v0,12(v0)
+   2d018:	afa60010 	sw	a2,16(sp)
+   2d01c:	0040f809 	jalr	v0
+   2d020:	afa70014 	sw	a3,20(sp)
+   2d024:	24030002 	addiu	v1,zero,2
+   2d028:	8fa60010 	lw	a2,16(sp)
+   2d02c:	1043000b 	beq	v0,v1,2d05c <vfs_real_lookup+0x6c>
+   2d030:	8fa70014 	lw	a3,20(sp)
+   2d034:	14400004 	bnez	v0,2d048 <vfs_real_lookup+0x58>
+   2d038:	3c0300c0 	lui	v1,0xc0
+   2d03c:	02038024 	and	s0,s0,v1
+   2d040:	12030014 	beq	s0,v1,2d094 <vfs_real_lookup+0xa4>
+   2d044:	8fbf0024 	lw	ra,36(sp)
+   2d048:	8fbf0024 	lw	ra,36(sp)
+   2d04c:	8fb10020 	lw	s1,32(sp)
+   2d050:	8fb0001c 	lw	s0,28(sp)
+   2d054:	03e00008 	jr	ra
+   2d058:	27bd0028 	addiu	sp,sp,40
+   2d05c:	3c030040 	lui	v1,0x40
+   2d060:	02038024 	and	s0,s0,v1
+   2d064:	1200fff9 	beqz	s0,2d04c <vfs_real_lookup+0x5c>
+   2d068:	8fbf0024 	lw	ra,36(sp)
+   2d06c:	10c0fff7 	beqz	a2,2d04c <vfs_real_lookup+0x5c>
+   2d070:	02202021 	addu	a0,s1,zero
+   2d074:	8e2201bc 	lw	v0,444(s1)
+   2d078:	8c590004 	lw	t9,4(v0)
+   2d07c:	8fbf0024 	lw	ra,36(sp)
+   2d080:	8fb10020 	lw	s1,32(sp)
+   2d084:	8fb0001c 	lw	s0,28(sp)
+   2d088:	00e02821 	addu	a1,a3,zero
+   2d08c:	03200008 	jr	t9
+   2d090:	27bd0028 	addiu	sp,sp,40
+   2d094:	24020011 	addiu	v0,zero,17
+   2d098:	0006100a 	movz	v0,zero,a2
+   2d09c:	8fb10020 	lw	s1,32(sp)
+   2d0a0:	8fb0001c 	lw	s0,28(sp)
+   2d0a4:	03e00008 	jr	ra
+   2d0a8:	27bd0028 	addiu	sp,sp,40
+
+0002d0ac <vfs_lookup_next>:
+   2d0ac:	8c830004 	lw	v1,4(a0)
+   2d0b0:	00001021 	addu	v0,zero,zero
+   2d0b4:	24630004 	addiu	v1,v1,4
+   2d0b8:	03e00008 	jr	ra
+   2d0bc:	ac830004 	sw	v1,4(a0)
+
+0002d0c0 <vfs_lookup_path_put>:
+   2d0c0:	27bdffd8 	addiu	sp,sp,-40
+   2d0c4:	8c820048 	lw	v0,72(a0)
+   2d0c8:	27a40010 	addiu	a0,sp,16
+   2d0cc:	afbf0024 	sw	ra,36(sp)
+   2d0d0:	afa2001c 	sw	v0,28(sp)
+   2d0d4:	afa00014 	sw	zero,20(sp)
+   2d0d8:	0c007134 	jal	1c4d0 <kmem_free>
+   2d0dc:	afa00010 	sw	zero,16(sp)
+   2d0e0:	8fbf0024 	lw	ra,36(sp)
+   2d0e4:	03e00008 	jr	ra
+   2d0e8:	27bd0028 	addiu	sp,sp,40
+
+0002d0ec <__vfs_lookup_parent_main>:
+   2d0ec:	acc00010 	sw	zero,16(a2)
+   2d0f0:	8ce2000c 	lw	v0,12(a3)
+   2d0f4:	27bdffe0 	addiu	sp,sp,-32
+   2d0f8:	30420040 	andi	v0,v0,0x40
+   2d0fc:	afbf001c 	sw	ra,28(sp)
+   2d100:	1040000c 	beqz	v0,2d134 <__vfs_lookup_parent_main+0x48>
+   2d104:	acc0000c 	sw	zero,12(a2)
+   2d108:	8ce20000 	lw	v0,0(a3)
+   2d10c:	8fbf001c 	lw	ra,28(sp)
+   2d110:	8c430070 	lw	v1,112(v0)
+   2d114:	8c440068 	lw	a0,104(v0)
+   2d118:	8c42006c 	lw	v0,108(v0)
+   2d11c:	acc00014 	sw	zero,20(a2)
+   2d120:	acc40000 	sw	a0,0(a2)
+   2d124:	acc20004 	sw	v0,4(a2)
+   2d128:	acc30008 	sw	v1,8(a2)
+   2d12c:	03e00008 	jr	ra
+   2d130:	27bd0020 	addiu	sp,sp,32
+   2d134:	8ce40000 	lw	a0,0(a3)
+   2d138:	8ce50008 	lw	a1,8(a3)
+   2d13c:	afa60014 	sw	a2,20(sp)
+   2d140:	0c00a8df 	jal	2a37c <vfs_inode_hold>
+   2d144:	afa70010 	sw	a3,16(sp)
+   2d148:	8fa60014 	lw	a2,20(sp)
+   2d14c:	1440000f 	bnez	v0,2d18c <__vfs_lookup_parent_main+0xa0>
+   2d150:	8fa70010 	lw	a3,16(sp)
+   2d154:	8ce40000 	lw	a0,0(a3)
+   2d158:	afa60014 	sw	a2,20(sp)
+   2d15c:	8c850068 	lw	a1,104(a0)
+   2d160:	8c83006c 	lw	v1,108(a0)
+   2d164:	8c820070 	lw	v0,112(a0)
+   2d168:	acc50000 	sw	a1,0(a2)
+   2d16c:	acc30004 	sw	v1,4(a2)
+   2d170:	0c00aa79 	jal	2a9e4 <vfs_inode_down>
+   2d174:	acc20008 	sw	v0,8(a2)
+   2d178:	8fa60014 	lw	a2,20(sp)
+   2d17c:	8fbf001c 	lw	ra,28(sp)
+   2d180:	acc00014 	sw	zero,20(a2)
+   2d184:	03e00008 	jr	ra
+   2d188:	27bd0020 	addiu	sp,sp,32
+   2d18c:	8cc20010 	lw	v0,16(a2)
+   2d190:	8fbf001c 	lw	ra,28(sp)
+   2d194:	34420008 	ori	v0,v0,0x8
+   2d198:	acc20010 	sw	v0,16(a2)
+   2d19c:	acc00014 	sw	zero,20(a2)
+   2d1a0:	03e00008 	jr	ra
+   2d1a4:	27bd0020 	addiu	sp,sp,32
+
+0002d1a8 <__vfs_lookup_parent_local>:
+   2d1a8:	00803021 	addu	a2,a0,zero
+   2d1ac:	00a03821 	addu	a3,a1,zero
+   2d1b0:	40057801 	mfc0	a1,$15,1
+   2d1b4:	3c020004 	lui	v0,0x4
+   2d1b8:	2443c960 	addiu	v1,v0,-13984
+   2d1bc:	88640003 	lwl	a0,3(v1)
+   2d1c0:	30a50003 	andi	a1,a1,0x3
+   2d1c4:	3c030004 	lui	v1,0x4
+   2d1c8:	00052880 	sll	a1,a1,0x2
+   2d1cc:	2463c950 	addiu	v1,v1,-14000
+   2d1d0:	9844c960 	lwr	a0,-13984(v0)
+   2d1d4:	00a31021 	addu	v0,a1,v1
+   2d1d8:	8c450000 	lw	a1,0(v0)
+   2d1dc:	0800b43b 	j	2d0ec <__vfs_lookup_parent_main>
+   2d1e0:	3084ffff 	andi	a0,a0,0xffff
+
+0002d1e4 <vfs_lookup_parent>:
+   2d1e4:	27bdffb8 	addiu	sp,sp,-72
+   2d1e8:	3c020004 	lui	v0,0x4
+   2d1ec:	afb0003c 	sw	s0,60(sp)
+   2d1f0:	2443c960 	addiu	v1,v0,-13984
+   2d1f4:	afbf0044 	sw	ra,68(sp)
+   2d1f8:	afb10040 	sw	s1,64(sp)
+   2d1fc:	88630003 	lwl	v1,3(v1)
+   2d200:	94b00004 	lhu	s0,4(a1)
+   2d204:	9843c960 	lwr	v1,-13984(v0)
+   2d208:	24020018 	addiu	v0,zero,24
+   2d20c:	afa2002c 	sw	v0,44(sp)
+   2d210:	3063ffff 	andi	v1,v1,0xffff
+   2d214:	24020020 	addiu	v0,zero,32
+   2d218:	afa20034 	sw	v0,52(sp)
+   2d21c:	afa40028 	sw	a0,40(sp)
+   2d220:	1203001c 	beq	s0,v1,2d294 <vfs_lookup_parent+0xb0>
+   2d224:	afa50030 	sw	a1,48(sp)
+   2d228:	40117801 	mfc0	s1,$15,1
+   2d22c:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2d230:	00000000 	sll	zero,zero,0x0
+   2d234:	70501802 	mul	v1,v0,s0
+   2d238:	32240003 	andi	a0,s1,0x3
+   2d23c:	00642021 	addu	a0,v1,a0
+   2d240:	27a30028 	addiu	v1,sp,40
+   2d244:	afa30018 	sw	v1,24(sp)
+   2d248:	27a3002c 	addiu	v1,sp,44
+   2d24c:	afa3001c 	sw	v1,28(sp)
+   2d250:	3c070003 	lui	a3,0x3
+   2d254:	27a30030 	addiu	v1,sp,48
+   2d258:	24020001 	addiu	v0,zero,1
+   2d25c:	afa30020 	sw	v1,32(sp)
+   2d260:	24e7d2b0 	addiu	a3,a3,-11600
+   2d264:	27a30034 	addiu	v1,sp,52
+   2d268:	24050001 	addiu	a1,zero,1
+   2d26c:	00003021 	addu	a2,zero,zero
+   2d270:	afa20014 	sw	v0,20(sp)
+   2d274:	afa30024 	sw	v1,36(sp)
+   2d278:	0c003de8 	jal	f7a0 <rppc_generic>
+   2d27c:	afa20010 	sw	v0,16(sp)
+   2d280:	8fbf0044 	lw	ra,68(sp)
+   2d284:	8fb10040 	lw	s1,64(sp)
+   2d288:	8fb0003c 	lw	s0,60(sp)
+   2d28c:	03e00008 	jr	ra
+   2d290:	27bd0048 	addiu	sp,sp,72
+   2d294:	0c00b46a 	jal	2d1a8 <__vfs_lookup_parent_local>
+   2d298:	00000000 	sll	zero,zero,0x0
+   2d29c:	8fbf0044 	lw	ra,68(sp)
+   2d2a0:	8fb10040 	lw	s1,64(sp)
+   2d2a4:	8fb0003c 	lw	s0,60(sp)
+   2d2a8:	03e00008 	jr	ra
+   2d2ac:	27bd0048 	addiu	sp,sp,72
+
+0002d2b0 <__vfs_lookup_parent_demarshall>:
+   2d2b0:	27bdffc8 	addiu	sp,sp,-56
+   2d2b4:	afbf0034 	sw	ra,52(sp)
+   2d2b8:	afbe0030 	sw	s8,48(sp)
+   2d2bc:	afb4002c 	sw	s4,44(sp)
+   2d2c0:	03a0f021 	addu	s8,sp,zero
+   2d2c4:	afb30028 	sw	s3,40(sp)
+   2d2c8:	afb20024 	sw	s2,36(sp)
+   2d2cc:	afb10020 	sw	s1,32(sp)
+   2d2d0:	afb0001c 	sw	s0,28(sp)
+   2d2d4:	27bdfff0 	addiu	sp,sp,-16
+   2d2d8:	27b20010 	addiu	s2,sp,16
+   2d2dc:	27bdffb0 	addiu	sp,sp,-80
+   2d2e0:	27b00010 	addiu	s0,sp,16
+   2d2e4:	26020028 	addiu	v0,s0,40
+   2d2e8:	24030040 	addiu	v1,zero,64
+   2d2ec:	ae030008 	sw	v1,8(s0)
+   2d2f0:	ae420000 	sw	v0,0(s2)
+   2d2f4:	24030018 	addiu	v1,zero,24
+   2d2f8:	00808821 	addu	s1,a0,zero
+   2d2fc:	ae030024 	sw	v1,36(s0)
+   2d300:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2d304:	8c940000 	lw	s4,0(a0)
+   2d308:	8e460000 	lw	a2,0(s2)
+   2d30c:	00409821 	addu	s3,v0,zero
+   2d310:	02202021 	addu	a0,s1,zero
+   2d314:	00002821 	addu	a1,zero,zero
+   2d318:	8e320000 	lw	s2,0(s1)
+   2d31c:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2d320:	afc60010 	sw	a2,16(s8)
+   2d324:	0293001b 	divu	zero,s4,s3
+   2d328:	026001f4 	teq	s3,zero,0x7
+   2d32c:	8fc60010 	lw	a2,16(s8)
+   2d330:	00403821 	addu	a3,v0,zero
+   2d334:	02402821 	addu	a1,s2,zero
+   2d338:	00002012 	mflo	a0
+   2d33c:	0c00b43b 	jal	2d0ec <__vfs_lookup_parent_main>
+   2d340:	3084ffff 	andi	a0,a0,0xffff
+   2d344:	02202021 	addu	a0,s1,zero
+   2d348:	02002821 	addu	a1,s0,zero
+   2d34c:	24060040 	addiu	a2,zero,64
+   2d350:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2d354:	24070001 	addiu	a3,zero,1
+   2d358:	03c0e821 	addu	sp,s8,zero
+   2d35c:	8fbf0034 	lw	ra,52(sp)
+   2d360:	8fbe0030 	lw	s8,48(sp)
+   2d364:	8fb4002c 	lw	s4,44(sp)
+   2d368:	8fb30028 	lw	s3,40(sp)
+   2d36c:	8fb20024 	lw	s2,36(sp)
+   2d370:	8fb10020 	lw	s1,32(sp)
+   2d374:	8fb0001c 	lw	s0,28(sp)
+   2d378:	03e00008 	jr	ra
+   2d37c:	27bd0038 	addiu	sp,sp,56
+
+0002d380 <vfs_inode_lookup>:
+   2d380:	27bdffd8 	addiu	sp,sp,-40
+   2d384:	afb10018 	sw	s1,24(sp)
+   2d388:	afbf0024 	sw	ra,36(sp)
+   2d38c:	afb30020 	sw	s3,32(sp)
+   2d390:	afb2001c 	sw	s2,28(sp)
+   2d394:	afb00014 	sw	s0,20(sp)
+   2d398:	80a20000 	lb	v0,0(a1)
+   2d39c:	2443ffd2 	addiu	v1,v0,-46
+   2d3a0:	306300ff 	andi	v1,v1,0xff
+   2d3a4:	2c630002 	sltiu	v1,v1,2
+   2d3a8:	14600029 	bnez	v1,2d450 <vfs_inode_lookup+0xd0>
+   2d3ac:	00a08821 	addu	s1,a1,zero
+   2d3b0:	02202821 	addu	a1,s1,zero
+   2d3b4:	0800b4f1 	j	2d3c4 <vfs_inode_lookup+0x44>
+   2d3b8:	00001821 	addu	v1,zero,zero
+   2d3bc:	80a20000 	lb	v0,0(a1)
+   2d3c0:	00661821 	addu	v1,v1,a2
+   2d3c4:	24a50001 	addiu	a1,a1,1
+   2d3c8:	1440fffc 	bnez	v0,2d3bc <vfs_inode_lookup+0x3c>
+   2d3cc:	00433026 	xor	a2,v0,v1
+   2d3d0:	3c02cccc 	lui	v0,0xcccc
+   2d3d4:	3442cccd 	ori	v0,v0,0xcccd
+   2d3d8:	00620019 	multu	v1,v0
+   2d3dc:	00001010 	mfhi	v0
+   2d3e0:	000210c2 	srl	v0,v0,0x3
+   2d3e4:	000228c0 	sll	a1,v0,0x3
+   2d3e8:	00021040 	sll	v0,v0,0x1
+   2d3ec:	00451021 	addu	v0,v0,a1
+   2d3f0:	00621023 	subu	v0,v1,v0
+   2d3f4:	24420010 	addiu	v0,v0,16
+   2d3f8:	000210c0 	sll	v0,v0,0x3
+   2d3fc:	00822021 	addu	a0,a0,v0
+   2d400:	8c900004 	lw	s0,4(a0)
+   2d404:	24930004 	addiu	s3,a0,4
+   2d408:	0800b50a 	j	2d428 <vfs_inode_lookup+0xa8>
+   2d40c:	8e120000 	lw	s2,0(s0)
+   2d410:	0c00c445 	jal	31114 <strcmp>
+   2d414:	8e04fff8 	lw	a0,-8(s0)
+   2d418:	10400006 	beqz	v0,2d434 <vfs_inode_lookup+0xb4>
+   2d41c:	2602fed8 	addiu	v0,s0,-296
+   2d420:	02408021 	addu	s0,s2,zero
+   2d424:	8e520000 	lw	s2,0(s2)
+   2d428:	1613fff9 	bne	s0,s3,2d410 <vfs_inode_lookup+0x90>
+   2d42c:	02202821 	addu	a1,s1,zero
+   2d430:	00001021 	addu	v0,zero,zero
+   2d434:	8fbf0024 	lw	ra,36(sp)
+   2d438:	8fb30020 	lw	s3,32(sp)
+   2d43c:	8fb2001c 	lw	s2,28(sp)
+   2d440:	8fb10018 	lw	s1,24(sp)
+   2d444:	8fb00014 	lw	s0,20(sp)
+   2d448:	03e00008 	jr	ra
+   2d44c:	27bd0028 	addiu	sp,sp,40
+   2d450:	80a30001 	lb	v1,1(a1)
+   2d454:	10600005 	beqz	v1,2d46c <vfs_inode_lookup+0xec>
+   2d458:	2405002e 	addiu	a1,zero,46
+   2d45c:	1445000d 	bne	v0,a1,2d494 <vfs_inode_lookup+0x114>
+   2d460:	00000000 	sll	zero,zero,0x0
+   2d464:	1462ffd3 	bne	v1,v0,2d3b4 <vfs_inode_lookup+0x34>
+   2d468:	02202821 	addu	a1,s1,zero
+   2d46c:	3c020004 	lui	v0,0x4
+   2d470:	3c060003 	lui	a2,0x3
+   2d474:	3c070003 	lui	a3,0x3
+   2d478:	8c449100 	lw	a0,-28416(v0)
+   2d47c:	24c67bcc 	addiu	a2,a2,31692
+   2d480:	24e77be8 	addiu	a3,a3,31720
+   2d484:	0c0009b0 	jal	26c0 <__fprintk>
+   2d488:	00002821 	addu	a1,zero,zero
+   2d48c:	0800b523 	j	2d48c <vfs_inode_lookup+0x10c>
+   2d490:	00000000 	sll	zero,zero,0x0
+   2d494:	0800b4ec 	j	2d3b0 <vfs_inode_lookup+0x30>
+   2d498:	2402002f 	addiu	v0,zero,47
+
+0002d49c <vfs_load_dirent>:
+   2d49c:	27bdffc8 	addiu	sp,sp,-56
+   2d4a0:	afb60028 	sw	s6,40(sp)
+   2d4a4:	afb40020 	sw	s4,32(sp)
+   2d4a8:	8fb60050 	lw	s6,80(sp)
+   2d4ac:	8fb4004c 	lw	s4,76(sp)
+   2d4b0:	afb20018 	sw	s2,24(sp)
+   2d4b4:	afb00010 	sw	s0,16(sp)
+   2d4b8:	00a09021 	addu	s2,a1,zero
+   2d4bc:	aec00000 	sw	zero,0(s6)
+   2d4c0:	ae800000 	sw	zero,0(s4)
+   2d4c4:	00808021 	addu	s0,a0,zero
+   2d4c8:	afbf0034 	sw	ra,52(sp)
+   2d4cc:	afbe0030 	sw	s8,48(sp)
+   2d4d0:	afb7002c 	sw	s7,44(sp)
+   2d4d4:	afb50024 	sw	s5,36(sp)
+   2d4d8:	afb3001c 	sw	s3,28(sp)
+   2d4dc:	00c0a821 	addu	s5,a2,zero
+   2d4e0:	00079e00 	sll	s3,a3,0x18
+   2d4e4:	afb10014 	sw	s1,20(sp)
+   2d4e8:	0c00a864 	jal	2a190 <vfs_inode_lock>
+   2d4ec:	83b70048 	lb	s7,72(sp)
+   2d4f0:	02002021 	addu	a0,s0,zero
+   2d4f4:	0c00b4e0 	jal	2d380 <vfs_inode_lookup>
+   2d4f8:	02402821 	addu	a1,s2,zero
+   2d4fc:	0040f021 	addu	s8,v0,zero
+   2d500:	00402021 	addu	a0,v0,zero
+   2d504:	0c00a88f 	jal	2a23c <vfs_dirent_up>
+   2d508:	00139e03 	sra	s3,s3,0x18
+   2d50c:	17c00013 	bnez	s8,2d55c <vfs_load_dirent+0xc0>
+   2d510:	00000000 	sll	zero,zero,0x0
+   2d514:	0c00a8b2 	jal	2a2c8 <vfs_inode_unlock>
+   2d518:	02002021 	addu	a0,s0,zero
+   2d51c:	8e0401c0 	lw	a0,448(s0)
+   2d520:	0c00a96e 	jal	2a5b8 <vfs_dirent_new>
+   2d524:	02402821 	addu	a1,s2,zero
+   2d528:	10400081 	beqz	v0,2d730 <vfs_load_dirent+0x294>
+   2d52c:	00408821 	addu	s1,v0,zero
+   2d530:	24020001 	addiu	v0,zero,1
+   2d534:	02002021 	addu	a0,s0,zero
+   2d538:	0c00a864 	jal	2a190 <vfs_inode_lock>
+   2d53c:	ae220108 	sw	v0,264(s1)
+   2d540:	02002021 	addu	a0,s0,zero
+   2d544:	0c00b4e0 	jal	2d380 <vfs_inode_lookup>
+   2d548:	02402821 	addu	a1,s2,zero
+   2d54c:	1040001e 	beqz	v0,2d5c8 <vfs_load_dirent+0x12c>
+   2d550:	0040f021 	addu	s8,v0,zero
+   2d554:	0c00a88f 	jal	2a23c <vfs_dirent_up>
+   2d558:	00402021 	addu	a0,v0,zero
+   2d55c:	0c00a85c 	jal	2a170 <vfs_dirent_is_inload>
+   2d560:	03c02021 	addu	a0,s8,zero
+   2d564:	14400082 	bnez	v0,2d770 <vfs_load_dirent+0x2d4>
+   2d568:	00000000 	sll	zero,zero,0x0
+   2d56c:	16e00087 	bnez	s7,2d78c <vfs_load_dirent+0x2f0>
+   2d570:	00000000 	sll	zero,zero,0x0
+   2d574:	ae9e0000 	sw	s8,0(s4)
+   2d578:	12600003 	beqz	s3,2d588 <vfs_load_dirent+0xec>
+   2d57c:	32b50001 	andi	s5,s5,0x1
+   2d580:	16a00065 	bnez	s5,2d718 <vfs_load_dirent+0x27c>
+   2d584:	00000000 	sll	zero,zero,0x0
+   2d588:	00009021 	addu	s2,zero,zero
+   2d58c:	0c00a8b2 	jal	2a2c8 <vfs_inode_unlock>
+   2d590:	02002021 	addu	a0,s0,zero
+   2d594:	8fbf0034 	lw	ra,52(sp)
+   2d598:	02401021 	addu	v0,s2,zero
+   2d59c:	8fbe0030 	lw	s8,48(sp)
+   2d5a0:	8fb7002c 	lw	s7,44(sp)
+   2d5a4:	8fb60028 	lw	s6,40(sp)
+   2d5a8:	8fb50024 	lw	s5,36(sp)
+   2d5ac:	8fb40020 	lw	s4,32(sp)
+   2d5b0:	8fb3001c 	lw	s3,28(sp)
+   2d5b4:	8fb20018 	lw	s2,24(sp)
+   2d5b8:	8fb10014 	lw	s1,20(sp)
+   2d5bc:	8fb00010 	lw	s0,16(sp)
+   2d5c0:	03e00008 	jr	ra
+   2d5c4:	27bd0038 	addiu	sp,sp,56
+   2d5c8:	16600033 	bnez	s3,2d698 <vfs_load_dirent+0x1fc>
+   2d5cc:	ae300180 	sw	s0,384(s1)
+   2d5d0:	24020001 	addiu	v0,zero,1
+   2d5d4:	ae220100 	sw	v0,256(s1)
+   2d5d8:	0c00a858 	jal	2a160 <vfs_dirent_set_inload>
+   2d5dc:	02202021 	addu	a0,s1,zero
+   2d5e0:	8e020078 	lw	v0,120(s0)
+   2d5e4:	8e230120 	lw	v1,288(s1)
+   2d5e8:	24420001 	addiu	v0,v0,1
+   2d5ec:	ae020078 	sw	v0,120(s0)
+   2d5f0:	80640000 	lb	a0,0(v1)
+   2d5f4:	1080005c 	beqz	a0,2d768 <vfs_load_dirent+0x2cc>
+   2d5f8:	00001021 	addu	v0,zero,zero
+   2d5fc:	24630001 	addiu	v1,v1,1
+   2d600:	00822826 	xor	a1,a0,v0
+   2d604:	80640000 	lb	a0,0(v1)
+   2d608:	1480fffc 	bnez	a0,2d5fc <vfs_load_dirent+0x160>
+   2d60c:	00451021 	addu	v0,v0,a1
+   2d610:	3c03cccc 	lui	v1,0xcccc
+   2d614:	3463cccd 	ori	v1,v1,0xcccd
+   2d618:	00430019 	multu	v0,v1
+   2d61c:	00001810 	mfhi	v1
+   2d620:	000318c2 	srl	v1,v1,0x3
+   2d624:	000320c0 	sll	a0,v1,0x3
+   2d628:	00031840 	sll	v1,v1,0x1
+   2d62c:	00641821 	addu	v1,v1,a0
+   2d630:	00431823 	subu	v1,v0,v1
+   2d634:	24630010 	addiu	v1,v1,16
+   2d638:	000318c0 	sll	v1,v1,0x3
+   2d63c:	02031821 	addu	v1,s0,v1
+   2d640:	8c620008 	lw	v0,8(v1)
+   2d644:	26230128 	addiu	v1,s1,296
+   2d648:	8c440000 	lw	a0,0(v0)
+   2d64c:	ae22012c 	sw	v0,300(s1)
+   2d650:	ae240128 	sw	a0,296(s1)
+   2d654:	ac830004 	sw	v1,4(a0)
+   2d658:	ac430000 	sw	v1,0(v0)
+   2d65c:	0c00a8b2 	jal	2a2c8 <vfs_inode_unlock>
+   2d660:	02002021 	addu	a0,s0,zero
+   2d664:	02002021 	addu	a0,s0,zero
+   2d668:	02a02821 	addu	a1,s5,zero
+   2d66c:	02603021 	addu	a2,s3,zero
+   2d670:	0c00b3fc 	jal	2cff0 <vfs_real_lookup>
+   2d674:	02203821 	addu	a3,s1,zero
+   2d678:	14400009 	bnez	v0,2d6a0 <vfs_load_dirent+0x204>
+   2d67c:	00409021 	addu	s2,v0,zero
+   2d680:	0c00a864 	jal	2a190 <vfs_inode_lock>
+   2d684:	02002021 	addu	a0,s0,zero
+   2d688:	12e0001f 	beqz	s7,2d708 <vfs_load_dirent+0x26c>
+   2d68c:	ae910000 	sw	s1,0(s4)
+   2d690:	0800b55e 	j	2d578 <vfs_load_dirent+0xdc>
+   2d694:	0220f021 	addu	s8,s1,zero
+   2d698:	0800b575 	j	2d5d4 <vfs_load_dirent+0x138>
+   2d69c:	32a2ffff 	andi	v0,s5,0xffff
+   2d6a0:	0c00a864 	jal	2a190 <vfs_inode_lock>
+   2d6a4:	02002021 	addu	a0,s0,zero
+   2d6a8:	8e040078 	lw	a0,120(s0)
+   2d6ac:	8e230128 	lw	v1,296(s1)
+   2d6b0:	8e22012c 	lw	v0,300(s1)
+   2d6b4:	2484ffff 	addiu	a0,a0,-1
+   2d6b8:	ae040078 	sw	a0,120(s0)
+   2d6bc:	ac620004 	sw	v0,4(v1)
+   2d6c0:	02002021 	addu	a0,s0,zero
+   2d6c4:	0c00a8b2 	jal	2a2c8 <vfs_inode_unlock>
+   2d6c8:	ac430000 	sw	v1,0(v0)
+   2d6cc:	0c00a86f 	jal	2a1bc <vfs_dirent_down>
+   2d6d0:	02202021 	addu	a0,s1,zero
+   2d6d4:	8fbf0034 	lw	ra,52(sp)
+   2d6d8:	02401021 	addu	v0,s2,zero
+   2d6dc:	8fbe0030 	lw	s8,48(sp)
+   2d6e0:	8fb7002c 	lw	s7,44(sp)
+   2d6e4:	8fb60028 	lw	s6,40(sp)
+   2d6e8:	8fb50024 	lw	s5,36(sp)
+   2d6ec:	8fb40020 	lw	s4,32(sp)
+   2d6f0:	8fb3001c 	lw	s3,28(sp)
+   2d6f4:	8fb20018 	lw	s2,24(sp)
+   2d6f8:	8fb10014 	lw	s1,20(sp)
+   2d6fc:	8fb00010 	lw	s0,16(sp)
+   2d700:	03e00008 	jr	ra
+   2d704:	27bd0038 	addiu	sp,sp,56
+   2d708:	0c00a85f 	jal	2a17c <vfs_dirent_clear_inload>
+   2d70c:	02202021 	addu	a0,s1,zero
+   2d710:	0800b55e 	j	2d578 <vfs_load_dirent+0xdc>
+   2d714:	0220f021 	addu	s8,s1,zero
+   2d718:	8fc20100 	lw	v0,256(s8)
+   2d71c:	30420001 	andi	v0,v0,0x1
+   2d720:	1440ff99 	bnez	v0,2d588 <vfs_load_dirent+0xec>
+   2d724:	24120014 	addiu	s2,zero,20
+   2d728:	0800b563 	j	2d58c <vfs_load_dirent+0xf0>
+   2d72c:	00000000 	sll	zero,zero,0x0
+   2d730:	8fbf0034 	lw	ra,52(sp)
+   2d734:	2412000c 	addiu	s2,zero,12
+   2d738:	02401021 	addu	v0,s2,zero
+   2d73c:	8fbe0030 	lw	s8,48(sp)
+   2d740:	8fb7002c 	lw	s7,44(sp)
+   2d744:	8fb60028 	lw	s6,40(sp)
+   2d748:	8fb50024 	lw	s5,36(sp)
+   2d74c:	8fb40020 	lw	s4,32(sp)
+   2d750:	8fb3001c 	lw	s3,28(sp)
+   2d754:	8fb20018 	lw	s2,24(sp)
+   2d758:	8fb10014 	lw	s1,20(sp)
+   2d75c:	8fb00010 	lw	s0,16(sp)
+   2d760:	03e00008 	jr	ra
+   2d764:	27bd0038 	addiu	sp,sp,56
+   2d768:	0800b58d 	j	2d634 <vfs_load_dirent+0x198>
+   2d76c:	00001821 	addu	v1,zero,zero
+   2d770:	8ec20000 	lw	v0,0(s6)
+   2d774:	03c02021 	addu	a0,s8,zero
+   2d778:	34420010 	ori	v0,v0,0x10
+   2d77c:	0c00a86f 	jal	2a1bc <vfs_dirent_down>
+   2d780:	aec20000 	sw	v0,0(s6)
+   2d784:	0800b563 	j	2d58c <vfs_load_dirent+0xf0>
+   2d788:	00009021 	addu	s2,zero,zero
+   2d78c:	0c00a858 	jal	2a160 <vfs_dirent_set_inload>
+   2d790:	03c02021 	addu	a0,s8,zero
+   2d794:	0800b55e 	j	2d578 <vfs_load_dirent+0xdc>
+   2d798:	ae9e0000 	sw	s8,0(s4)
+
+0002d79c <__vfs_lookup_child_main>:
+   2d79c:	27bdffb8 	addiu	sp,sp,-72
+   2d7a0:	afb10038 	sw	s1,56(sp)
+   2d7a4:	8fb10058 	lw	s1,88(sp)
+   2d7a8:	acc00010 	sw	zero,16(a2)
+   2d7ac:	afb30040 	sw	s3,64(sp)
+   2d7b0:	8233000c 	lb	s3,12(s1)
+   2d7b4:	afb2003c 	sw	s2,60(sp)
+   2d7b8:	32720040 	andi	s2,s3,0x40
+   2d7bc:	afb00034 	sw	s0,52(sp)
+   2d7c0:	afbf0044 	sw	ra,68(sp)
+   2d7c4:	00c08021 	addu	s0,a2,zero
+   2d7c8:	16400007 	bnez	s2,2d7e8 <__vfs_lookup_child_main+0x4c>
+   2d7cc:	afa00020 	sw	zero,32(sp)
+   2d7d0:	8e240000 	lw	a0,0(s1)
+   2d7d4:	8e250008 	lw	a1,8(s1)
+   2d7d8:	0c00a8df 	jal	2a37c <vfs_inode_hold>
+   2d7dc:	afa70028 	sw	a3,40(sp)
+   2d7e0:	1440002b 	bnez	v0,2d890 <__vfs_lookup_child_main+0xf4>
+   2d7e4:	8fa70028 	lw	a3,40(sp)
+   2d7e8:	8e240000 	lw	a0,0(s1)
+   2d7ec:	8e260014 	lw	a2,20(s1)
+   2d7f0:	00e02821 	addu	a1,a3,zero
+   2d7f4:	26020010 	addiu	v0,s0,16
+   2d7f8:	32670002 	andi	a3,s3,0x2
+   2d7fc:	27a30020 	addiu	v1,sp,32
+   2d800:	afa30014 	sw	v1,20(sp)
+   2d804:	afa20018 	sw	v0,24(sp)
+   2d808:	0c00b527 	jal	2d49c <vfs_load_dirent>
+   2d80c:	afa00010 	sw	zero,16(sp)
+   2d810:	1440000c 	bnez	v0,2d844 <__vfs_lookup_child_main+0xa8>
+   2d814:	00409821 	addu	s3,v0,zero
+   2d818:	8fa40020 	lw	a0,32(sp)
+   2d81c:	10800009 	beqz	a0,2d844 <__vfs_lookup_child_main+0xa8>
+   2d820:	00000000 	sll	zero,zero,0x0
+   2d824:	8c820184 	lw	v0,388(a0)
+   2d828:	10400025 	beqz	v0,2d8c0 <__vfs_lookup_child_main+0x124>
+   2d82c:	00000000 	sll	zero,zero,0x0
+   2d830:	ae02000c 	sw	v0,12(s0)
+   2d834:	ae000000 	sw	zero,0(s0)
+   2d838:	ae000004 	sw	zero,4(s0)
+   2d83c:	0c00a86f 	jal	2a1bc <vfs_dirent_down>
+   2d840:	ae000008 	sw	zero,8(s0)
+   2d844:	12400008 	beqz	s2,2d868 <__vfs_lookup_child_main+0xcc>
+   2d848:	8fbf0044 	lw	ra,68(sp)
+   2d84c:	ae130014 	sw	s3,20(s0)
+   2d850:	8fb2003c 	lw	s2,60(sp)
+   2d854:	8fb30040 	lw	s3,64(sp)
+   2d858:	8fb10038 	lw	s1,56(sp)
+   2d85c:	8fb00034 	lw	s0,52(sp)
+   2d860:	03e00008 	jr	ra
+   2d864:	27bd0048 	addiu	sp,sp,72
+   2d868:	0c00aa79 	jal	2a9e4 <vfs_inode_down>
+   2d86c:	8e240000 	lw	a0,0(s1)
+   2d870:	8fbf0044 	lw	ra,68(sp)
+   2d874:	ae130014 	sw	s3,20(s0)
+   2d878:	8fb2003c 	lw	s2,60(sp)
+   2d87c:	8fb30040 	lw	s3,64(sp)
+   2d880:	8fb10038 	lw	s1,56(sp)
+   2d884:	8fb00034 	lw	s0,52(sp)
+   2d888:	03e00008 	jr	ra
+   2d88c:	27bd0048 	addiu	sp,sp,72
+   2d890:	8e020010 	lw	v0,16(s0)
+   2d894:	8fbf0044 	lw	ra,68(sp)
+   2d898:	00009821 	addu	s3,zero,zero
+   2d89c:	34420008 	ori	v0,v0,0x8
+   2d8a0:	ae130014 	sw	s3,20(s0)
+   2d8a4:	ae020010 	sw	v0,16(s0)
+   2d8a8:	8fb30040 	lw	s3,64(sp)
+   2d8ac:	8fb2003c 	lw	s2,60(sp)
+   2d8b0:	8fb10038 	lw	s1,56(sp)
+   2d8b4:	8fb00034 	lw	s0,52(sp)
+   2d8b8:	03e00008 	jr	ra
+   2d8bc:	27bd0048 	addiu	sp,sp,72
+   2d8c0:	8c850110 	lw	a1,272(a0)
+   2d8c4:	8c830114 	lw	v1,276(a0)
+   2d8c8:	8c820118 	lw	v0,280(a0)
+   2d8cc:	ae00000c 	sw	zero,12(s0)
+   2d8d0:	ae050000 	sw	a1,0(s0)
+   2d8d4:	ae030004 	sw	v1,4(s0)
+   2d8d8:	0c00a86f 	jal	2a1bc <vfs_dirent_down>
+   2d8dc:	ae020008 	sw	v0,8(s0)
+   2d8e0:	0800b611 	j	2d844 <__vfs_lookup_child_main+0xa8>
+   2d8e4:	00000000 	sll	zero,zero,0x0
+
+0002d8e8 <__vfs_lookup_child_demarshall>:
+   2d8e8:	27bdffc0 	addiu	sp,sp,-64
+   2d8ec:	afbf003c 	sw	ra,60(sp)
+   2d8f0:	afbe0038 	sw	s8,56(sp)
+   2d8f4:	afb40034 	sw	s4,52(sp)
+   2d8f8:	03a0f021 	addu	s8,sp,zero
+   2d8fc:	afb30030 	sw	s3,48(sp)
+   2d900:	afb2002c 	sw	s2,44(sp)
+   2d904:	afb10028 	sw	s1,40(sp)
+   2d908:	afb00024 	sw	s0,36(sp)
+   2d90c:	27bdfff0 	addiu	sp,sp,-16
+   2d910:	27b20018 	addiu	s2,sp,24
+   2d914:	27bdffb0 	addiu	sp,sp,-80
+   2d918:	27b10018 	addiu	s1,sp,24
+   2d91c:	26220028 	addiu	v0,s1,40
+   2d920:	24030040 	addiu	v1,zero,64
+   2d924:	ae230008 	sw	v1,8(s1)
+   2d928:	ae420000 	sw	v0,0(s2)
+   2d92c:	24030018 	addiu	v1,zero,24
+   2d930:	00808021 	addu	s0,a0,zero
+   2d934:	ae230024 	sw	v1,36(s1)
+   2d938:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2d93c:	8c940000 	lw	s4,0(a0)
+   2d940:	8e460000 	lw	a2,0(s2)
+   2d944:	02002021 	addu	a0,s0,zero
+   2d948:	00002821 	addu	a1,zero,zero
+   2d94c:	8e120000 	lw	s2,0(s0)
+   2d950:	afc6001c 	sw	a2,28(s8)
+   2d954:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2d958:	00409821 	addu	s3,v0,zero
+   2d95c:	02002021 	addu	a0,s0,zero
+   2d960:	24050001 	addiu	a1,zero,1
+   2d964:	0c0039e9 	jal	e7a4 <rpc_get_arg>
+   2d968:	afc20018 	sw	v0,24(s8)
+   2d96c:	0293001b 	divu	zero,s4,s3
+   2d970:	026001f4 	teq	s3,zero,0x7
+   2d974:	8fc6001c 	lw	a2,28(s8)
+   2d978:	8fc70018 	lw	a3,24(s8)
+   2d97c:	02402821 	addu	a1,s2,zero
+   2d980:	afa20010 	sw	v0,16(sp)
+   2d984:	00002012 	mflo	a0
+   2d988:	0c00b5e7 	jal	2d79c <__vfs_lookup_child_main>
+   2d98c:	3084ffff 	andi	a0,a0,0xffff
+   2d990:	02002021 	addu	a0,s0,zero
+   2d994:	02202821 	addu	a1,s1,zero
+   2d998:	24060040 	addiu	a2,zero,64
+   2d99c:	0c003f63 	jal	fd8c <rpc_send_rsp>
+   2d9a0:	24070001 	addiu	a3,zero,1
+   2d9a4:	03c0e821 	addu	sp,s8,zero
+   2d9a8:	8fbf003c 	lw	ra,60(sp)
+   2d9ac:	8fbe0038 	lw	s8,56(sp)
+   2d9b0:	8fb40034 	lw	s4,52(sp)
+   2d9b4:	8fb30030 	lw	s3,48(sp)
+   2d9b8:	8fb2002c 	lw	s2,44(sp)
+   2d9bc:	8fb10028 	lw	s1,40(sp)
+   2d9c0:	8fb00024 	lw	s0,36(sp)
+   2d9c4:	03e00008 	jr	ra
+   2d9c8:	27bd0040 	addiu	sp,sp,64
+
+0002d9cc <__vfs_lookup_child_local>:
+   2d9cc:	27bdffe0 	addiu	sp,sp,-32
+   2d9d0:	afbf001c 	sw	ra,28(sp)
+   2d9d4:	00801821 	addu	v1,a0,zero
+   2d9d8:	00a03821 	addu	a3,a1,zero
+   2d9dc:	00c01021 	addu	v0,a2,zero
+   2d9e0:	40067801 	mfc0	a2,$15,1
+   2d9e4:	3c050004 	lui	a1,0x4
+   2d9e8:	24a4c960 	addiu	a0,a1,-13984
+   2d9ec:	88840003 	lwl	a0,3(a0)
+   2d9f0:	30c60003 	andi	a2,a2,0x3
+   2d9f4:	3c080004 	lui	t0,0x4
+   2d9f8:	2508c950 	addiu	t0,t0,-14000
+   2d9fc:	00063080 	sll	a2,a2,0x2
+   2da00:	00c83021 	addu	a2,a2,t0
+   2da04:	98a4c960 	lwr	a0,-13984(a1)
+   2da08:	8cc50000 	lw	a1,0(a2)
+   2da0c:	3084ffff 	andi	a0,a0,0xffff
+   2da10:	00603021 	addu	a2,v1,zero
+   2da14:	0c00b5e7 	jal	2d79c <__vfs_lookup_child_main>
+   2da18:	afa20010 	sw	v0,16(sp)
+   2da1c:	8fbf001c 	lw	ra,28(sp)
+   2da20:	03e00008 	jr	ra
+   2da24:	27bd0020 	addiu	sp,sp,32
+
+0002da28 <vfs_lookup_child>:
+   2da28:	27bdffa8 	addiu	sp,sp,-88
+   2da2c:	afb1004c 	sw	s1,76(sp)
+   2da30:	24020018 	addiu	v0,zero,24
+   2da34:	00808821 	addu	s1,a0,zero
+   2da38:	00c02021 	addu	a0,a2,zero
+   2da3c:	afb20050 	sw	s2,80(sp)
+   2da40:	afb00048 	sw	s0,72(sp)
+   2da44:	afa60030 	sw	a2,48(sp)
+   2da48:	00a08021 	addu	s0,a1,zero
+   2da4c:	afa60040 	sw	a2,64(sp)
+   2da50:	afbf0054 	sw	ra,84(sp)
+   2da54:	afa2002c 	sw	v0,44(sp)
+   2da58:	afb10028 	sw	s1,40(sp)
+   2da5c:	0c00c4d1 	jal	31344 <strlen>
+   2da60:	afa50034 	sw	a1,52(sp)
+   2da64:	3c030004 	lui	v1,0x4
+   2da68:	2464c960 	addiu	a0,v1,-13984
+   2da6c:	88840003 	lwl	a0,3(a0)
+   2da70:	24420001 	addiu	v0,v0,1
+   2da74:	9864c960 	lwr	a0,-13984(v1)
+   2da78:	96120004 	lhu	s2,4(s0)
+   2da7c:	afa20038 	sw	v0,56(sp)
+   2da80:	3084ffff 	andi	a0,a0,0xffff
+   2da84:	24020020 	addiu	v0,zero,32
+   2da88:	afa2003c 	sw	v0,60(sp)
+   2da8c:	1244001e 	beq	s2,a0,2db08 <vfs_lookup_child+0xe0>
+   2da90:	8fa60040 	lw	a2,64(sp)
+   2da94:	40107801 	mfc0	s0,$15,1
+   2da98:	0c000572 	jal	15c8 <arch_cpu_per_cluster>
+   2da9c:	00000000 	sll	zero,zero,0x0
+   2daa0:	70521802 	mul	v1,v0,s2
+   2daa4:	24020001 	addiu	v0,zero,1
+   2daa8:	afa20010 	sw	v0,16(sp)
+   2daac:	24020002 	addiu	v0,zero,2
+   2dab0:	afa20014 	sw	v0,20(sp)
+   2dab4:	27a20028 	addiu	v0,sp,40
+   2dab8:	afa20018 	sw	v0,24(sp)
+   2dabc:	27a2002c 	addiu	v0,sp,44
+   2dac0:	afa2001c 	sw	v0,28(sp)
+   2dac4:	32040003 	andi	a0,s0,0x3
+   2dac8:	27a20030 	addiu	v0,sp,48
+   2dacc:	3c070003 	lui	a3,0x3
+   2dad0:	afa20020 	sw	v0,32(sp)
+   2dad4:	00642021 	addu	a0,v1,a0
+   2dad8:	27a20038 	addiu	v0,sp,56
+   2dadc:	24e7d8e8 	addiu	a3,a3,-10008
+   2dae0:	24050001 	addiu	a1,zero,1
+   2dae4:	00003021 	addu	a2,zero,zero
+   2dae8:	0c003de8 	jal	f7a0 <rppc_generic>
+   2daec:	afa20024 	sw	v0,36(sp)
+   2daf0:	8fbf0054 	lw	ra,84(sp)
+   2daf4:	8fb20050 	lw	s2,80(sp)
+   2daf8:	8fb1004c 	lw	s1,76(sp)
+   2dafc:	8fb00048 	lw	s0,72(sp)
+   2db00:	03e00008 	jr	ra
+   2db04:	27bd0058 	addiu	sp,sp,88
+   2db08:	02202021 	addu	a0,s1,zero
+   2db0c:	00c02821 	addu	a1,a2,zero
+   2db10:	0c00b673 	jal	2d9cc <__vfs_lookup_child_local>
+   2db14:	02003021 	addu	a2,s0,zero
+   2db18:	8fbf0054 	lw	ra,84(sp)
+   2db1c:	8fb20050 	lw	s2,80(sp)
+   2db20:	8fb1004c 	lw	s1,76(sp)
+   2db24:	8fb00048 	lw	s0,72(sp)
+   2db28:	03e00008 	jr	ra
+   2db2c:	27bd0058 	addiu	sp,sp,88
+
+0002db30 <vfs_lookup_elem>:
+   2db30:	27bdffe8 	addiu	sp,sp,-24
+   2db34:	afbf0014 	sw	ra,20(sp)
+   2db38:	00801021 	addu	v0,a0,zero
+   2db3c:	40042002 	mfc0	a0,$4,2
+   2db40:	80c30000 	lb	v1,0(a2)
+   2db44:	2407002f 	addiu	a3,zero,47
+   2db48:	1067002c 	beq	v1,a3,2dbfc <vfs_lookup_elem+0xcc>
+   2db4c:	8c840180 	lw	a0,384(a0)
+   2db50:	2407002e 	addiu	a3,zero,46
+   2db54:	1067000e 	beq	v1,a3,2db90 <vfs_lookup_elem+0x60>
+   2db58:	00000000 	sll	zero,zero,0x0
+   2db5c:	00001821 	addu	v1,zero,zero
+   2db60:	00003821 	addu	a3,zero,zero
+   2db64:	aca0000c 	sw	zero,12(a1)
+   2db68:	1460001a 	bnez	v1,2dbd4 <vfs_lookup_elem+0xa4>
+   2db6c:	aca00014 	sw	zero,20(a1)
+   2db70:	14e0002d 	bnez	a3,2dc28 <vfs_lookup_elem+0xf8>
+   2db74:	00a02021 	addu	a0,a1,zero
+   2db78:	0c00b68a 	jal	2da28 <vfs_lookup_child>
+   2db7c:	00402821 	addu	a1,v0,zero
+   2db80:	8fbf0014 	lw	ra,20(sp)
+   2db84:	00001021 	addu	v0,zero,zero
+   2db88:	03e00008 	jr	ra
+   2db8c:	27bd0018 	addiu	sp,sp,24
+   2db90:	80c70001 	lb	a3,1(a2)
+   2db94:	10e0002e 	beqz	a3,2dc50 <vfs_lookup_elem+0x120>
+   2db98:	00000000 	sll	zero,zero,0x0
+   2db9c:	14e3002f 	bne	a3,v1,2dc5c <vfs_lookup_elem+0x12c>
+   2dba0:	00003821 	addu	a3,zero,zero
+   2dba4:	8c460000 	lw	a2,0(v0)
+   2dba8:	8c830528 	lw	v1,1320(a0)
+   2dbac:	aca0000c 	sw	zero,12(a1)
+   2dbb0:	10c30015 	beq	a2,v1,2dc08 <vfs_lookup_elem+0xd8>
+   2dbb4:	aca00014 	sw	zero,20(a1)
+   2dbb8:	00a02021 	addu	a0,a1,zero
+   2dbbc:	0c00b479 	jal	2d1e4 <vfs_lookup_parent>
+   2dbc0:	00402821 	addu	a1,v0,zero
+   2dbc4:	8fbf0014 	lw	ra,20(sp)
+   2dbc8:	00001021 	addu	v0,zero,zero
+   2dbcc:	03e00008 	jr	ra
+   2dbd0:	27bd0018 	addiu	sp,sp,24
+   2dbd4:	8c82052c 	lw	v0,1324(a0)
+   2dbd8:	8c860530 	lw	a2,1328(a0)
+   2dbdc:	8c830528 	lw	v1,1320(a0)
+   2dbe0:	8fbf0014 	lw	ra,20(sp)
+   2dbe4:	aca20004 	sw	v0,4(a1)
+   2dbe8:	aca60008 	sw	a2,8(a1)
+   2dbec:	00001021 	addu	v0,zero,zero
+   2dbf0:	aca30000 	sw	v1,0(a1)
+   2dbf4:	03e00008 	jr	ra
+   2dbf8:	27bd0018 	addiu	sp,sp,24
+   2dbfc:	80c30001 	lb	v1,1(a2)
+   2dc00:	0800b6d8 	j	2db60 <vfs_lookup_elem+0x30>
+   2dc04:	2c630001 	sltiu	v1,v1,1
+   2dc08:	94460004 	lhu	a2,4(v0)
+   2dc0c:	9483052c 	lhu	v1,1324(a0)
+   2dc10:	14c3ffe9 	bne	a2,v1,2dbb8 <vfs_lookup_elem+0x88>
+   2dc14:	00000000 	sll	zero,zero,0x0
+   2dc18:	8c830530 	lw	v1,1328(a0)
+   2dc1c:	8c440008 	lw	a0,8(v0)
+   2dc20:	1483ffe6 	bne	a0,v1,2dbbc <vfs_lookup_elem+0x8c>
+   2dc24:	00a02021 	addu	a0,a1,zero
+   2dc28:	8c440008 	lw	a0,8(v0)
+   2dc2c:	8c430000 	lw	v1,0(v0)
+   2dc30:	8fbf0014 	lw	ra,20(sp)
+   2dc34:	8c420004 	lw	v0,4(v0)
+   2dc38:	27bd0018 	addiu	sp,sp,24
+   2dc3c:	aca20004 	sw	v0,4(a1)
+   2dc40:	aca40008 	sw	a0,8(a1)
+   2dc44:	00001021 	addu	v0,zero,zero
+   2dc48:	03e00008 	jr	ra
+   2dc4c:	aca30000 	sw	v1,0(a1)
+   2dc50:	24070001 	addiu	a3,zero,1
+   2dc54:	0800b6d9 	j	2db64 <vfs_lookup_elem+0x34>
+   2dc58:	00001821 	addu	v1,zero,zero
+   2dc5c:	0800b6d9 	j	2db64 <vfs_lookup_elem+0x34>
+   2dc60:	00001821 	addu	v1,zero,zero
+
+0002dc64 <__vfs_lookup>:
+   2dc64:	27bdffa8 	addiu	sp,sp,-88
+   2dc68:	afb70050 	sw	s7,80(sp)
+   2dc6c:	afb6004c 	sw	s6,76(sp)
+   2dc70:	afb50048 	sw	s5,72(sp)
+   2dc74:	afb40044 	sw	s4,68(sp)
+   2dc78:	afb30040 	sw	s3,64(sp)
+   2dc7c:	afb2003c 	sw	s2,60(sp)
+   2dc80:	afb10038 	sw	s1,56(sp)
+   2dc84:	afb00034 	sw	s0,52(sp)
+   2dc88:	afbf0054 	sw	ra,84(sp)
+   2dc8c:	00a08021 	addu	s0,a1,zero
+   2dc90:	00e08821 	addu	s1,a3,zero
+   2dc94:	34d50040 	ori	s5,a2,0x40
+   2dc98:	24960018 	addiu	s6,a0,24
+   2dc9c:	2414ffff 	addiu	s4,zero,-1
+   2dca0:	24130040 	addiu	s3,zero,64
+   2dca4:	27b20010 	addiu	s2,sp,16
+   2dca8:	2417ffbf 	addiu	s7,zero,-65
+   2dcac:	8e020014 	lw	v0,20(s0)
+   2dcb0:	14400063 	bnez	v0,2de40 <__vfs_lookup+0x1dc>
+   2dcb4:	00000000 	sll	zero,zero,0x0
+   2dcb8:	02c01021 	addu	v0,s6,zero
+   2dcbc:	8c430008 	lw	v1,8(v0)
+   2dcc0:	8c440000 	lw	a0,0(v0)
+   2dcc4:	8e06000c 	lw	a2,12(s0)
+   2dcc8:	8e050008 	lw	a1,8(s0)
+   2dccc:	8c420004 	lw	v0,4(v0)
+   2dcd0:	afa60024 	sw	a2,36(sp)
+   2dcd4:	afa50020 	sw	a1,32(sp)
+   2dcd8:	afb5001c 	sw	s5,28(sp)
+   2dcdc:	afa40010 	sw	a0,16(sp)
+   2dce0:	afa20014 	sw	v0,20(sp)
+   2dce4:	afa30018 	sw	v1,24(sp)
+   2dce8:	40022002 	mfc0	v0,$4,2
+   2dcec:	8c420180 	lw	v0,384(v0)
+   2dcf0:	8c4205c8 	lw	v0,1480(v0)
+   2dcf4:	afa20028 	sw	v0,40(sp)
+   2dcf8:	40022002 	mfc0	v0,$4,2
+   2dcfc:	8c420180 	lw	v0,384(v0)
+   2dd00:	a6340004 	sh	s4,4(s1)
+   2dd04:	8c4205cc 	lw	v0,1484(v0)
+   2dd08:	ae200000 	sw	zero,0(s1)
+   2dd0c:	afa2002c 	sw	v0,44(sp)
+   2dd10:	8e020004 	lw	v0,4(s0)
+   2dd14:	ae200008 	sw	zero,8(s1)
+   2dd18:	ae20000c 	sw	zero,12(s1)
+   2dd1c:	ae200014 	sw	zero,20(s1)
+   2dd20:	ae330010 	sw	s3,16(s1)
+   2dd24:	8c430000 	lw	v1,0(v0)
+   2dd28:	02402021 	addu	a0,s2,zero
+   2dd2c:	02202821 	addu	a1,s1,zero
+   2dd30:	10600013 	beqz	v1,2dd80 <__vfs_lookup+0x11c>
+   2dd34:	00603021 	addu	a2,v1,zero
+   2dd38:	8c420004 	lw	v0,4(v0)
+   2dd3c:	10400032 	beqz	v0,2de08 <__vfs_lookup+0x1a4>
+   2dd40:	8fa2001c 	lw	v0,28(sp)
+   2dd44:	0c00b6cc 	jal	2db30 <vfs_lookup_elem>
+   2dd48:	00000000 	sll	zero,zero,0x0
+   2dd4c:	8e220014 	lw	v0,20(s1)
+   2dd50:	1440000d 	bnez	v0,2dd88 <__vfs_lookup+0x124>
+   2dd54:	8fbf0054 	lw	ra,84(sp)
+   2dd58:	8e220010 	lw	v0,16(s1)
+   2dd5c:	30430008 	andi	v1,v0,0x8
+   2dd60:	30420010 	andi	v0,v0,0x10
+   2dd64:	10400012 	beqz	v0,2ddb0 <__vfs_lookup+0x14c>
+   2dd68:	02402021 	addu	a0,s2,zero
+   2dd6c:	8e020004 	lw	v0,4(s0)
+   2dd70:	8c430000 	lw	v1,0(v0)
+   2dd74:	02202821 	addu	a1,s1,zero
+   2dd78:	1460ffef 	bnez	v1,2dd38 <__vfs_lookup+0xd4>
+   2dd7c:	00603021 	addu	a2,v1,zero
+   2dd80:	00001021 	addu	v0,zero,zero
+   2dd84:	8fbf0054 	lw	ra,84(sp)
+   2dd88:	8fb70050 	lw	s7,80(sp)
+   2dd8c:	8fb6004c 	lw	s6,76(sp)
+   2dd90:	8fb50048 	lw	s5,72(sp)
+   2dd94:	8fb40044 	lw	s4,68(sp)
+   2dd98:	8fb30040 	lw	s3,64(sp)
+   2dd9c:	8fb2003c 	lw	s2,60(sp)
+   2dda0:	8fb10038 	lw	s1,56(sp)
+   2dda4:	8fb00034 	lw	s0,52(sp)
+   2dda8:	03e00008 	jr	ra
+   2ddac:	27bd0058 	addiu	sp,sp,88
+   2ddb0:	1460ffbe 	bnez	v1,2dcac <__vfs_lookup+0x48>
+   2ddb4:	8fa3001c 	lw	v1,28(sp)
+   2ddb8:	8e22000c 	lw	v0,12(s1)
+   2ddbc:	10400007 	beqz	v0,2dddc <__vfs_lookup+0x178>
+   2ddc0:	00771824 	and	v1,v1,s7
+   2ddc4:	8c4400a8 	lw	a0,168(v0)
+   2ddc8:	8c4500a0 	lw	a1,160(v0)
+   2ddcc:	8c4200a4 	lw	v0,164(v0)
+   2ddd0:	ae250000 	sw	a1,0(s1)
+   2ddd4:	ae220004 	sw	v0,4(s1)
+   2ddd8:	ae240008 	sw	a0,8(s1)
+   2dddc:	8e020004 	lw	v0,4(s0)
+   2dde0:	8e260000 	lw	a2,0(s1)
+   2dde4:	8e250004 	lw	a1,4(s1)
+   2dde8:	8e240008 	lw	a0,8(s1)
+   2ddec:	24420004 	addiu	v0,v0,4
+   2ddf0:	afa60010 	sw	a2,16(sp)
+   2ddf4:	afa50014 	sw	a1,20(sp)
+   2ddf8:	afa40018 	sw	a0,24(sp)
+   2ddfc:	afa3001c 	sw	v1,28(sp)
+   2de00:	0800b749 	j	2dd24 <__vfs_lookup+0xc0>
+   2de04:	ae020004 	sw	v0,4(s0)
+   2de08:	34420002 	ori	v0,v0,0x2
+   2de0c:	30430020 	andi	v1,v0,0x20
+   2de10:	1060ffcc 	beqz	v1,2dd44 <__vfs_lookup+0xe0>
+   2de14:	afa2001c 	sw	v0,28(sp)
+   2de18:	8e220000 	lw	v0,0(s1)
+   2de1c:	1440ffd8 	bnez	v0,2dd80 <__vfs_lookup+0x11c>
+   2de20:	8fa20014 	lw	v0,20(sp)
+   2de24:	8fa30018 	lw	v1,24(sp)
+   2de28:	8fa40010 	lw	a0,16(sp)
+   2de2c:	ae220004 	sw	v0,4(s1)
+   2de30:	ae240000 	sw	a0,0(s1)
+   2de34:	ae230008 	sw	v1,8(s1)
+   2de38:	0800b761 	j	2dd84 <__vfs_lookup+0x120>
+   2de3c:	00001021 	addu	v0,zero,zero
+   2de40:	40022002 	mfc0	v0,$4,2
+   2de44:	8c420180 	lw	v0,384(v0)
+   2de48:	0800b72f 	j	2dcbc <__vfs_lookup+0x58>
+   2de4c:	24420528 	addiu	v0,v0,1320
+
+0002de50 <vfs_lookup_path>:
+   2de50:	0800b719 	j	2dc64 <__vfs_lookup>
+   2de54:	00000000 	sll	zero,zero,0x0
+
+0002de58 <__vfs_get_upath>:
+   2de58:	27bdffb0 	addiu	sp,sp,-80
+   2de5c:	afb10030 	sw	s1,48(sp)
+   2de60:	3c020011 	lui	v0,0x11
+   2de64:	27b10010 	addiu	s1,sp,16
+   2de68:	afb0002c 	sw	s0,44(sp)
+   2de6c:	34420020 	ori	v0,v0,0x20
+   2de70:	00808021 	addu	s0,a0,zero
+   2de74:	02202021 	addu	a0,s1,zero
+   2de78:	afb60044 	sw	s6,68(sp)
+   2de7c:	afb4003c 	sw	s4,60(sp)
+   2de80:	afb30038 	sw	s3,56(sp)
+   2de84:	afb20034 	sw	s2,52(sp)
+   2de88:	afbf004c 	sw	ra,76(sp)
+   2de8c:	afb70048 	sw	s7,72(sp)
+   2de90:	afb50040 	sw	s5,64(sp)
+   2de94:	afa20018 	sw	v0,24(sp)
+   2de98:	00a09821 	addu	s3,a1,zero
+   2de9c:	00c09021 	addu	s2,a2,zero
+   2dea0:	00e0b021 	addu	s6,a3,zero
+   2dea4:	afa00010 	sw	zero,16(sp)
+   2dea8:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2deac:	afa00014 	sw	zero,20(sp)
+   2deb0:	10400025 	beqz	v0,2df48 <__vfs_get_upath+0xf0>
+   2deb4:	0040a021 	addu	s4,v0,zero
+   2deb8:	0c007c15 	jal	1f054 <ppm_page2addr>
+   2debc:	00402021 	addu	a0,v0,zero
+   2dec0:	0040b821 	addu	s7,v0,zero
+   2dec4:	8e020018 	lw	v0,24(s0)
+   2dec8:	0040f809 	jalr	v0
+   2decc:	02002021 	addu	a0,s0,zero
+   2ded0:	1040001b 	beqz	v0,2df40 <__vfs_get_upath+0xe8>
+   2ded4:	0040a821 	addu	s5,v0,zero
+   2ded8:	2c420bf6 	sltiu	v0,v0,3062
+   2dedc:	14400011 	bnez	v0,2df24 <__vfs_get_upath+0xcc>
+   2dee0:	24020022 	addiu	v0,zero,34
+   2dee4:	02202021 	addu	a0,s1,zero
+   2dee8:	afa20020 	sw	v0,32(sp)
+   2deec:	0c007134 	jal	1c4d0 <kmem_free>
+   2def0:	afb4001c 	sw	s4,28(sp)
+   2def4:	8fa20020 	lw	v0,32(sp)
+   2def8:	8fbf004c 	lw	ra,76(sp)
+   2defc:	8fb70048 	lw	s7,72(sp)
+   2df00:	8fb60044 	lw	s6,68(sp)
+   2df04:	8fb50040 	lw	s5,64(sp)
+   2df08:	8fb4003c 	lw	s4,60(sp)
+   2df0c:	8fb30038 	lw	s3,56(sp)
+   2df10:	8fb20034 	lw	s2,52(sp)
+   2df14:	8fb10030 	lw	s1,48(sp)
+   2df18:	8fb0002c 	lw	s0,44(sp)
+   2df1c:	03e00008 	jr	ra
+   2df20:	27bd0050 	addiu	sp,sp,80
+   2df24:	8e02000c 	lw	v0,12(s0)
+   2df28:	02002021 	addu	a0,s0,zero
+   2df2c:	02e02821 	addu	a1,s7,zero
+   2df30:	0040f809 	jalr	v0
+   2df34:	02a03021 	addu	a2,s5,zero
+   2df38:	12a2000f 	beq	s5,v0,2df78 <__vfs_get_upath+0x120>
+   2df3c:	00000000 	sll	zero,zero,0x0
+   2df40:	0800b7b9 	j	2dee4 <__vfs_get_upath+0x8c>
+   2df44:	24020016 	addiu	v0,zero,22
+   2df48:	8fbf004c 	lw	ra,76(sp)
+   2df4c:	2402000c 	addiu	v0,zero,12
+   2df50:	8fb70048 	lw	s7,72(sp)
+   2df54:	8fb60044 	lw	s6,68(sp)
+   2df58:	8fb50040 	lw	s5,64(sp)
+   2df5c:	8fb4003c 	lw	s4,60(sp)
+   2df60:	8fb30038 	lw	s3,56(sp)
+   2df64:	8fb20034 	lw	s2,52(sp)
+   2df68:	8fb10030 	lw	s1,48(sp)
+   2df6c:	8fb0002c 	lw	s0,44(sp)
+   2df70:	03e00008 	jr	ra
+   2df74:	27bd0050 	addiu	sp,sp,80
+   2df78:	02f51021 	addu	v0,s7,s5
+   2df7c:	12c00002 	beqz	s6,2df88 <__vfs_get_upath+0x130>
+   2df80:	a0400000 	sb	zero,0(v0)
+   2df84:	aed50000 	sw	s5,0(s6)
+   2df88:	02e08021 	addu	s0,s7,zero
+   2df8c:	00008821 	addu	s1,zero,zero
+   2df90:	82040000 	lb	a0,0(s0)
+   2df94:	0c00b964 	jal	2e590 <toupper>
+   2df98:	26310001 	addiu	s1,s1,1
+   2df9c:	0235182b 	sltu	v1,s1,s5
+   2dfa0:	a2020000 	sb	v0,0(s0)
+   2dfa4:	1460fffa 	bnez	v1,2df90 <__vfs_get_upath+0x138>
+   2dfa8:	26100001 	addiu	s0,s0,1
+   2dfac:	ae740000 	sw	s4,0(s3)
+   2dfb0:	ae570000 	sw	s7,0(s2)
+   2dfb4:	0800b7be 	j	2def8 <__vfs_get_upath+0xa0>
+   2dfb8:	00001021 	addu	v0,zero,zero
+
+0002dfbc <vfs_lookup_path_init>:
+   2dfbc:	27bdffd0 	addiu	sp,sp,-48
+   2dfc0:	afb00010 	sw	s0,16(sp)
+   2dfc4:	00808021 	addu	s0,a0,zero
+   2dfc8:	afb3001c 	sw	s3,28(sp)
+   2dfcc:	afb20018 	sw	s2,24(sp)
+   2dfd0:	00a02021 	addu	a0,a1,zero
+   2dfd4:	00c09021 	addu	s2,a2,zero
+   2dfd8:	00e09821 	addu	s3,a3,zero
+   2dfdc:	26050048 	addiu	a1,s0,72
+   2dfe0:	02003021 	addu	a2,s0,zero
+   2dfe4:	00003821 	addu	a3,zero,zero
+   2dfe8:	afb60028 	sw	s6,40(sp)
+   2dfec:	afb10014 	sw	s1,20(sp)
+   2dff0:	afbf002c 	sw	ra,44(sp)
+   2dff4:	afb50024 	sw	s5,36(sp)
+   2dff8:	afb40020 	sw	s4,32(sp)
+   2dffc:	0c00b796 	jal	2de58 <__vfs_get_upath>
+   2e000:	8fb10040 	lw	s1,64(sp)
+   2e004:	14400010 	bnez	v0,2e048 <vfs_lookup_path_init+0x8c>
+   2e008:	0040b021 	addu	s6,v0,zero
+   2e00c:	8e040000 	lw	a0,0(s0)
+   2e010:	0800b807 	j	2e01c <vfs_lookup_path_init+0x60>
+   2e014:	0000a021 	addu	s4,zero,zero
+   2e018:	26940001 	addiu	s4,s4,1
+   2e01c:	0c00c42c 	jal	310b0 <strchr>
+   2e020:	2405002f 	addiu	a1,zero,47
+   2e024:	1440fffc 	bnez	v0,2e018 <vfs_lookup_path_init+0x5c>
+   2e028:	24440001 	addiu	a0,v0,1
+   2e02c:	12800011 	beqz	s4,2e074 <vfs_lookup_path_init+0xb8>
+   2e030:	2e94000d 	sltiu	s4,s4,13
+   2e034:	1680000f 	bnez	s4,2e074 <vfs_lookup_path_init+0xb8>
+   2e038:	00000000 	sll	zero,zero,0x0
+   2e03c:	0c00b430 	jal	2d0c0 <vfs_lookup_path_put>
+   2e040:	02002021 	addu	a0,s0,zero
+   2e044:	24160024 	addiu	s6,zero,36
+   2e048:	8fbf002c 	lw	ra,44(sp)
+   2e04c:	02c01021 	addu	v0,s6,zero
+   2e050:	8fb60028 	lw	s6,40(sp)
+   2e054:	8fb50024 	lw	s5,36(sp)
+   2e058:	8fb40020 	lw	s4,32(sp)
+   2e05c:	8fb3001c 	lw	s3,28(sp)
+   2e060:	8fb20018 	lw	s2,24(sp)
+   2e064:	8fb10014 	lw	s1,20(sp)
+   2e068:	8fb00010 	lw	s0,16(sp)
+   2e06c:	03e00008 	jr	ra
+   2e070:	27bd0030 	addiu	sp,sp,48
+   2e074:	8e040000 	lw	a0,0(s0)
+   2e078:	26150018 	addiu	s5,s0,24
+   2e07c:	ae040018 	sw	a0,24(s0)
+   2e080:	ae150010 	sw	s5,16(s0)
+   2e084:	aea00004 	sw	zero,4(s5)
+   2e088:	80830000 	lb	v1,0(a0)
+   2e08c:	2402002f 	addiu	v0,zero,47
+   2e090:	1062002f 	beq	v1,v0,2e150 <vfs_lookup_path_init+0x194>
+   2e094:	00000000 	sll	zero,zero,0x0
+   2e098:	ae040018 	sw	a0,24(s0)
+   2e09c:	24140001 	addiu	s4,zero,1
+   2e0a0:	0c00c42c 	jal	310b0 <strchr>
+   2e0a4:	2405002f 	addiu	a1,zero,47
+   2e0a8:	00141880 	sll	v1,s4,0x2
+   2e0ac:	1040000c 	beqz	v0,2e0e0 <vfs_lookup_path_init+0x124>
+   2e0b0:	02a31821 	addu	v1,s5,v1
+   2e0b4:	80450001 	lb	a1,1(v0)
+   2e0b8:	a0400000 	sb	zero,0(v0)
+   2e0bc:	10a0fff8 	beqz	a1,2e0a0 <vfs_lookup_path_init+0xe4>
+   2e0c0:	24440001 	addiu	a0,v0,1
+   2e0c4:	ac640000 	sw	a0,0(v1)
+   2e0c8:	26940001 	addiu	s4,s4,1
+   2e0cc:	0c00c42c 	jal	310b0 <strchr>
+   2e0d0:	2405002f 	addiu	a1,zero,47
+   2e0d4:	00141880 	sll	v1,s4,0x2
+   2e0d8:	1440fff6 	bnez	v0,2e0b4 <vfs_lookup_path_init+0xf8>
+   2e0dc:	02a31821 	addu	v1,s5,v1
+   2e0e0:	26820006 	addiu	v0,s4,6
+   2e0e4:	00021080 	sll	v0,v0,0x2
+   2e0e8:	02021021 	addu	v0,s0,v0
+   2e0ec:	ac400000 	sw	zero,0(v0)
+   2e0f0:	2694ffff 	addiu	s4,s4,-1
+   2e0f4:	12200002 	beqz	s1,2e100 <vfs_lookup_path_init+0x144>
+   2e0f8:	00000000 	sll	zero,zero,0x0
+   2e0fc:	ae340000 	sw	s4,0(s1)
+   2e100:	8e030000 	lw	v1,0(s0)
+   2e104:	8e020010 	lw	v0,16(s0)
+   2e108:	80630000 	lb	v1,0(v1)
+   2e10c:	8fbf002c 	lw	ra,44(sp)
+   2e110:	3863002f 	xori	v1,v1,0x2f
+   2e114:	2c630001 	sltiu	v1,v1,1
+   2e118:	ae130008 	sw	s3,8(s0)
+   2e11c:	ae020004 	sw	v0,4(s0)
+   2e120:	ae12000c 	sw	s2,12(s0)
+   2e124:	02c01021 	addu	v0,s6,zero
+   2e128:	ae030014 	sw	v1,20(s0)
+   2e12c:	8fb60028 	lw	s6,40(sp)
+   2e130:	8fb50024 	lw	s5,36(sp)
+   2e134:	8fb40020 	lw	s4,32(sp)
+   2e138:	8fb3001c 	lw	s3,28(sp)
+   2e13c:	8fb20018 	lw	s2,24(sp)
+   2e140:	8fb10014 	lw	s1,20(sp)
+   2e144:	8fb00010 	lw	s0,16(sp)
+   2e148:	03e00008 	jr	ra
+   2e14c:	27bd0030 	addiu	sp,sp,48
+   2e150:	24840001 	addiu	a0,a0,1
+   2e154:	80820000 	lb	v0,0(a0)
+   2e158:	1440ffcf 	bnez	v0,2e098 <vfs_lookup_path_init+0xdc>
+   2e15c:	0000a021 	addu	s4,zero,zero
+   2e160:	0800b83d 	j	2e0f4 <vfs_lookup_path_init+0x138>
+   2e164:	00000000 	sll	zero,zero,0x0
+
+0002e168 <vfs_lookup>:
+   2e168:	27bdff80 	addiu	sp,sp,-128
+   2e16c:	afb00074 	sw	s0,116(sp)
+   2e170:	27b00018 	addiu	s0,sp,24
+   2e174:	afb10078 	sw	s1,120(sp)
+   2e178:	00808821 	addu	s1,a0,zero
+   2e17c:	02002021 	addu	a0,s0,zero
+   2e180:	afbf007c 	sw	ra,124(sp)
+   2e184:	0c00b7ef 	jal	2dfbc <vfs_lookup_path_init>
+   2e188:	afa00010 	sw	zero,16(sp)
+   2e18c:	1440000b 	bnez	v0,2e1bc <vfs_lookup+0x54>
+   2e190:	8fbf007c 	lw	ra,124(sp)
+   2e194:	8fa60090 	lw	a2,144(sp)
+   2e198:	8fa70094 	lw	a3,148(sp)
+   2e19c:	02202021 	addu	a0,s1,zero
+   2e1a0:	0c00b719 	jal	2dc64 <__vfs_lookup>
+   2e1a4:	02002821 	addu	a1,s0,zero
+   2e1a8:	02002021 	addu	a0,s0,zero
+   2e1ac:	0c00b430 	jal	2d0c0 <vfs_lookup_path_put>
+   2e1b0:	afa20068 	sw	v0,104(sp)
+   2e1b4:	8fa20068 	lw	v0,104(sp)
+   2e1b8:	8fbf007c 	lw	ra,124(sp)
+   2e1bc:	8fb10078 	lw	s1,120(sp)
+   2e1c0:	8fb00074 	lw	s0,116(sp)
+   2e1c4:	03e00008 	jr	ra
+   2e1c8:	27bd0080 	addiu	sp,sp,128
+
+0002e1cc <atoi>:
+   2e1cc:	27bdffe8 	addiu	sp,sp,-24
+   2e1d0:	afb00010 	sw	s0,16(sp)
+   2e1d4:	afbf0014 	sw	ra,20(sp)
+   2e1d8:	00808021 	addu	s0,a0,zero
+   2e1dc:	0c00b95d 	jal	2e574 <isspace>
+   2e1e0:	82040000 	lb	a0,0(s0)
+   2e1e4:	1440fffd 	bnez	v0,2e1dc <atoi+0x10>
+   2e1e8:	2402002d 	addiu	v0,zero,45
+   2e1ec:	82030000 	lb	v1,0(s0)
+   2e1f0:	10620003 	beq	v1,v0,2e200 <atoi+0x34>
+   2e1f4:	2407ffff 	addiu	a3,zero,-1
+   2e1f8:	10600014 	beqz	v1,2e24c <atoi+0x80>
+   2e1fc:	24070001 	addiu	a3,zero,1
+   2e200:	00001021 	addu	v0,zero,zero
+   2e204:	2464ffd0 	addiu	a0,v1,-48
+   2e208:	000228c0 	sll	a1,v0,0x3
+   2e20c:	00023040 	sll	a2,v0,0x1
+   2e210:	308400ff 	andi	a0,a0,0xff
+   2e214:	00c52821 	addu	a1,a2,a1
+   2e218:	2c84000a 	sltiu	a0,a0,10
+   2e21c:	26100001 	addiu	s0,s0,1
+   2e220:	10800002 	beqz	a0,2e22c <atoi+0x60>
+   2e224:	00a31821 	addu	v1,a1,v1
+   2e228:	2462ffd0 	addiu	v0,v1,-48
+   2e22c:	82030000 	lb	v1,0(s0)
+   2e230:	1460fff5 	bnez	v1,2e208 <atoi+0x3c>
+   2e234:	2464ffd0 	addiu	a0,v1,-48
+   2e238:	70471002 	mul	v0,v0,a3
+   2e23c:	8fbf0014 	lw	ra,20(sp)
+   2e240:	8fb00010 	lw	s0,16(sp)
+   2e244:	03e00008 	jr	ra
+   2e248:	27bd0018 	addiu	sp,sp,24
+   2e24c:	0800b88f 	j	2e23c <atoi+0x70>
+   2e250:	00001021 	addu	v0,zero,zero
+
+0002e254 <bitmap_ffs2>:
+   2e254:	30a3001f 	andi	v1,a1,0x1f
+   2e258:	1060000d 	beqz	v1,2e290 <bitmap_ffs2+0x3c>
+   2e25c:	00052942 	srl	a1,a1,0x5
+   2e260:	00051080 	sll	v0,a1,0x2
+   2e264:	00821021 	addu	v0,a0,v0
+   2e268:	8c480000 	lw	t0,0(v0)
+   2e26c:	24090020 	addiu	t1,zero,32
+   2e270:	00683806 	srlv	a3,t0,v1
+   2e274:	30e70001 	andi	a3,a3,0x1
+   2e278:	14e0001a 	bnez	a3,2e2e4 <bitmap_ffs2+0x90>
+   2e27c:	00000000 	sll	zero,zero,0x0
+   2e280:	24630001 	addiu	v1,v1,1
+   2e284:	1469fffb 	bne	v1,t1,2e274 <bitmap_ffs2+0x20>
+   2e288:	00683806 	srlv	a3,t0,v1
+   2e28c:	24a50001 	addiu	a1,a1,1
+   2e290:	000630c0 	sll	a2,a2,0x3
+   2e294:	00063142 	srl	a2,a2,0x5
+   2e298:	00a6102b 	sltu	v0,a1,a2
+   2e29c:	10400018 	beqz	v0,2e300 <bitmap_ffs2+0xac>
+   2e2a0:	24090020 	addiu	t1,zero,32
+   2e2a4:	00051080 	sll	v0,a1,0x2
+   2e2a8:	00822021 	addu	a0,a0,v0
+   2e2ac:	8c880000 	lw	t0,0(a0)
+   2e2b0:	1100000f 	beqz	t0,2e2f0 <bitmap_ffs2+0x9c>
+   2e2b4:	00001021 	addu	v0,zero,zero
+   2e2b8:	0800b8b2 	j	2e2c8 <bitmap_ffs2+0x74>
+   2e2bc:	00483806 	srlv	a3,t0,v0
+   2e2c0:	1049000b 	beq	v0,t1,2e2f0 <bitmap_ffs2+0x9c>
+   2e2c4:	00483806 	srlv	a3,t0,v0
+   2e2c8:	30e70001 	andi	a3,a3,0x1
+   2e2cc:	10e0fffc 	beqz	a3,2e2c0 <bitmap_ffs2+0x6c>
+   2e2d0:	24420001 	addiu	v0,v0,1
+   2e2d4:	2442ffff 	addiu	v0,v0,-1
+   2e2d8:	00052940 	sll	a1,a1,0x5
+   2e2dc:	03e00008 	jr	ra
+   2e2e0:	00a21021 	addu	v0,a1,v0
+   2e2e4:	00052940 	sll	a1,a1,0x5
+   2e2e8:	03e00008 	jr	ra
+   2e2ec:	00651021 	addu	v0,v1,a1
+   2e2f0:	24a50001 	addiu	a1,a1,1
+   2e2f4:	00a6102b 	sltu	v0,a1,a2
+   2e2f8:	1440ffec 	bnez	v0,2e2ac <bitmap_ffs2+0x58>
+   2e2fc:	24840004 	addiu	a0,a0,4
+   2e300:	03e00008 	jr	ra
+   2e304:	2402ffff 	addiu	v0,zero,-1
+
+0002e308 <bitmap_ffc2>:
+   2e308:	30a3001f 	andi	v1,a1,0x1f
+   2e30c:	1060000d 	beqz	v1,2e344 <bitmap_ffc2+0x3c>
+   2e310:	00052942 	srl	a1,a1,0x5
+   2e314:	00051080 	sll	v0,a1,0x2
+   2e318:	00821021 	addu	v0,a0,v0
+   2e31c:	8c480000 	lw	t0,0(v0)
+   2e320:	24090020 	addiu	t1,zero,32
+   2e324:	00683806 	srlv	a3,t0,v1
+   2e328:	30e70001 	andi	a3,a3,0x1
+   2e32c:	10e0001b 	beqz	a3,2e39c <bitmap_ffc2+0x94>
+   2e330:	00000000 	sll	zero,zero,0x0
+   2e334:	24630001 	addiu	v1,v1,1
+   2e338:	1469fffb 	bne	v1,t1,2e328 <bitmap_ffc2+0x20>
+   2e33c:	00683806 	srlv	a3,t0,v1
+   2e340:	24a50001 	addiu	a1,a1,1
+   2e344:	000630c0 	sll	a2,a2,0x3
+   2e348:	00063142 	srl	a2,a2,0x5
+   2e34c:	00a6102b 	sltu	v0,a1,a2
+   2e350:	10400019 	beqz	v0,2e3b8 <bitmap_ffc2+0xb0>
+   2e354:	2403ffff 	addiu	v1,zero,-1
+   2e358:	00051080 	sll	v0,a1,0x2
+   2e35c:	00822021 	addu	a0,a0,v0
+   2e360:	24090020 	addiu	t1,zero,32
+   2e364:	8c880000 	lw	t0,0(a0)
+   2e368:	1103000f 	beq	t0,v1,2e3a8 <bitmap_ffc2+0xa0>
+   2e36c:	00001021 	addu	v0,zero,zero
+   2e370:	0800b8e0 	j	2e380 <bitmap_ffc2+0x78>
+   2e374:	00483806 	srlv	a3,t0,v0
+   2e378:	1049000b 	beq	v0,t1,2e3a8 <bitmap_ffc2+0xa0>
+   2e37c:	00483806 	srlv	a3,t0,v0
+   2e380:	30e70001 	andi	a3,a3,0x1
+   2e384:	14e0fffc 	bnez	a3,2e378 <bitmap_ffc2+0x70>
+   2e388:	24420001 	addiu	v0,v0,1
+   2e38c:	2442ffff 	addiu	v0,v0,-1
+   2e390:	00052940 	sll	a1,a1,0x5
+   2e394:	03e00008 	jr	ra
+   2e398:	00a21021 	addu	v0,a1,v0
+   2e39c:	00052940 	sll	a1,a1,0x5
+   2e3a0:	03e00008 	jr	ra
+   2e3a4:	00651021 	addu	v0,v1,a1
+   2e3a8:	24a50001 	addiu	a1,a1,1
+   2e3ac:	00a6102b 	sltu	v0,a1,a2
+   2e3b0:	1440ffec 	bnez	v0,2e364 <bitmap_ffc2+0x5c>
+   2e3b4:	24840004 	addiu	a0,a0,4
+   2e3b8:	03e00008 	jr	ra
+   2e3bc:	2402ffff 	addiu	v0,zero,-1
+
+0002e3c0 <bitmap_set_range>:
+   2e3c0:	18c00021 	blez	a2,2e448 <bitmap_set_range+0x88>
+   2e3c4:	30a7001f 	andi	a3,a1,0x1f
+   2e3c8:	00c74021 	addu	t0,a2,a3
+   2e3cc:	2d020020 	sltiu	v0,t0,32
+   2e3d0:	14400020 	bnez	v0,2e454 <bitmap_set_range+0x94>
+   2e3d4:	00052942 	srl	a1,a1,0x5
+   2e3d8:	10e00028 	beqz	a3,2e47c <bitmap_set_range+0xbc>
+   2e3dc:	00000000 	sll	zero,zero,0x0
+   2e3e0:	00071023 	negu	v0,a3
+   2e3e4:	24060001 	addiu	a2,zero,1
+   2e3e8:	00463004 	sllv	a2,a2,v0
+   2e3ec:	24c6ffff 	addiu	a2,a2,-1
+   2e3f0:	00054880 	sll	t1,a1,0x2
+   2e3f4:	24a30001 	addiu	v1,a1,1
+   2e3f8:	00894821 	addu	t1,a0,t1
+   2e3fc:	00031880 	sll	v1,v1,0x2
+   2e400:	01201021 	addu	v0,t1,zero
+   2e404:	00831821 	addu	v1,a0,v1
+   2e408:	0800b90c 	j	2e430 <bitmap_set_range+0x70>
+   2e40c:	8d290000 	lw	t1,0(t1)
+   2e410:	24a50001 	addiu	a1,a1,1
+   2e414:	1500000e 	bnez	t0,2e450 <bitmap_set_range+0x90>
+   2e418:	24420004 	addiu	v0,v0,4
+   2e41c:	00c04021 	addu	t0,a2,zero
+   2e420:	8c690000 	lw	t1,0(v1)
+   2e424:	2406ffff 	addiu	a2,zero,-1
+   2e428:	24630004 	addiu	v1,v1,4
+   2e42c:	00003821 	addu	a3,zero,zero
+   2e430:	00e63804 	sllv	a3,a2,a3
+   2e434:	00e93825 	or	a3,a3,t1
+   2e438:	2506ffe0 	addiu	a2,t0,-32
+   2e43c:	2cc80020 	sltiu	t0,a2,32
+   2e440:	1cc0fff3 	bgtz	a2,2e410 <bitmap_set_range+0x50>
+   2e444:	ac470000 	sw	a3,0(v0)
+   2e448:	03e00008 	jr	ra
+   2e44c:	00000000 	sll	zero,zero,0x0
+   2e450:	00003821 	addu	a3,zero,zero
+   2e454:	24020001 	addiu	v0,zero,1
+   2e458:	00052880 	sll	a1,a1,0x2
+   2e45c:	00852021 	addu	a0,a0,a1
+   2e460:	00c23004 	sllv	a2,v0,a2
+   2e464:	24c6ffff 	addiu	a2,a2,-1
+   2e468:	8c820000 	lw	v0,0(a0)
+   2e46c:	00e63804 	sllv	a3,a2,a3
+   2e470:	00473825 	or	a3,v0,a3
+   2e474:	03e00008 	jr	ra
+   2e478:	ac870000 	sw	a3,0(a0)
+   2e47c:	0800b8fc 	j	2e3f0 <bitmap_set_range+0x30>
+   2e480:	2406ffff 	addiu	a2,zero,-1
+
+0002e484 <bitmap_clear_range>:
+   2e484:	18c0002e 	blez	a2,2e540 <bitmap_clear_range+0xbc>
+   2e488:	30a3001f 	andi	v1,a1,0x1f
+   2e48c:	00c34021 	addu	t0,a2,v1
+   2e490:	2d020020 	sltiu	v0,t0,32
+   2e494:	1440001f 	bnez	v0,2e514 <bitmap_clear_range+0x90>
+   2e498:	00052942 	srl	a1,a1,0x5
+   2e49c:	1060002a 	beqz	v1,2e548 <bitmap_clear_range+0xc4>
+   2e4a0:	00000000 	sll	zero,zero,0x0
+   2e4a4:	00031023 	negu	v0,v1
+   2e4a8:	24060001 	addiu	a2,zero,1
+   2e4ac:	00463004 	sllv	a2,a2,v0
+   2e4b0:	24c6ffff 	addiu	a2,a2,-1
+   2e4b4:	00054880 	sll	t1,a1,0x2
+   2e4b8:	24a70001 	addiu	a3,a1,1
+   2e4bc:	00894821 	addu	t1,a0,t1
+   2e4c0:	00073880 	sll	a3,a3,0x2
+   2e4c4:	01201021 	addu	v0,t1,zero
+   2e4c8:	00873821 	addu	a3,a0,a3
+   2e4cc:	0800b93a 	j	2e4e8 <bitmap_clear_range+0x64>
+   2e4d0:	8d290000 	lw	t1,0(t1)
+   2e4d4:	00c04021 	addu	t0,a2,zero
+   2e4d8:	8ce90000 	lw	t1,0(a3)
+   2e4dc:	2406ffff 	addiu	a2,zero,-1
+   2e4e0:	24e70004 	addiu	a3,a3,4
+   2e4e4:	00001821 	addu	v1,zero,zero
+   2e4e8:	00661804 	sllv	v1,a2,v1
+   2e4ec:	00031827 	nor	v1,zero,v1
+   2e4f0:	00694824 	and	t1,v1,t1
+   2e4f4:	2506ffe0 	addiu	a2,t0,-32
+   2e4f8:	2cc80020 	sltiu	t0,a2,32
+   2e4fc:	18c00010 	blez	a2,2e540 <bitmap_clear_range+0xbc>
+   2e500:	ac490000 	sw	t1,0(v0)
+   2e504:	24a50001 	addiu	a1,a1,1
+   2e508:	1100fff2 	beqz	t0,2e4d4 <bitmap_clear_range+0x50>
+   2e50c:	24420004 	addiu	v0,v0,4
+   2e510:	00001821 	addu	v1,zero,zero
+   2e514:	24020001 	addiu	v0,zero,1
+   2e518:	00c23004 	sllv	a2,v0,a2
+   2e51c:	00052880 	sll	a1,a1,0x2
+   2e520:	00852021 	addu	a0,a0,a1
+   2e524:	24c6ffff 	addiu	a2,a2,-1
+   2e528:	8c820000 	lw	v0,0(a0)
+   2e52c:	00661804 	sllv	v1,a2,v1
+   2e530:	00031827 	nor	v1,zero,v1
+   2e534:	00431024 	and	v0,v0,v1
+   2e538:	03e00008 	jr	ra
+   2e53c:	ac820000 	sw	v0,0(a0)
+   2e540:	03e00008 	jr	ra
+   2e544:	00000000 	sll	zero,zero,0x0
+   2e548:	0800b92d 	j	2e4b4 <bitmap_clear_range+0x30>
+   2e54c:	2406ffff 	addiu	a2,zero,-1
+
+0002e550 <isprint>:
+   2e550:	2482ffe0 	addiu	v0,a0,-32
+   2e554:	304200ff 	andi	v0,v0,0xff
+   2e558:	03e00008 	jr	ra
+   2e55c:	2c42005f 	sltiu	v0,v0,95
+
+0002e560 <isalpha>:
+   2e560:	34820020 	ori	v0,a0,0x20
+   2e564:	2442ff9f 	addiu	v0,v0,-97
+   2e568:	304200ff 	andi	v0,v0,0xff
+   2e56c:	03e00008 	jr	ra
+   2e570:	2c42001a 	sltiu	v0,v0,26
+
+0002e574 <isspace>:
+   2e574:	24020020 	addiu	v0,zero,32
+   2e578:	10820003 	beq	a0,v0,2e588 <isspace+0x14>
+   2e57c:	00000000 	sll	zero,zero,0x0
+   2e580:	03e00008 	jr	ra
+   2e584:	2882000e 	slti	v0,a0,14
+   2e588:	03e00008 	jr	ra
+   2e58c:	24020001 	addiu	v0,zero,1
+
+0002e590 <toupper>:
+   2e590:	34830020 	ori	v1,a0,0x20
+   2e594:	2463ff9f 	addiu	v1,v1,-97
+   2e598:	306300ff 	andi	v1,v1,0xff
+   2e59c:	2c63001a 	sltiu	v1,v1,26
+   2e5a0:	10600003 	beqz	v1,2e5b0 <toupper+0x20>
+   2e5a4:	00801021 	addu	v0,a0,zero
+   2e5a8:	2403ffdf 	addiu	v1,zero,-33
+   2e5ac:	00831024 	and	v0,a0,v1
+   2e5b0:	03e00008 	jr	ra
+   2e5b4:	00000000 	sll	zero,zero,0x0
+
+0002e5b8 <elf_load_task>:
+   2e5b8:	27bdff10 	addiu	sp,sp,-240
+   2e5bc:	afb300d4 	sw	s3,212(sp)
+   2e5c0:	27b30080 	addiu	s3,sp,128
+   2e5c4:	afb700e4 	sw	s7,228(sp)
+   2e5c8:	afb500dc 	sw	s5,220(sp)
+   2e5cc:	afb200d0 	sw	s2,208(sp)
+   2e5d0:	0080b821 	addu	s7,a0,zero
+   2e5d4:	00a09021 	addu	s2,a1,zero
+   2e5d8:	24150001 	addiu	s5,zero,1
+   2e5dc:	02602021 	addu	a0,s3,zero
+   2e5e0:	00002821 	addu	a1,zero,zero
+   2e5e4:	2406003c 	addiu	a2,zero,60
+   2e5e8:	afb100cc 	sw	s1,204(sp)
+   2e5ec:	afb000c8 	sw	s0,200(sp)
+   2e5f0:	afbf00ec 	sw	ra,236(sp)
+   2e5f4:	afbe00e8 	sw	s8,232(sp)
+   2e5f8:	afb600e0 	sw	s6,224(sp)
+   2e5fc:	afb400d8 	sw	s4,216(sp)
+   2e600:	0c00c182 	jal	30608 <memset>
+   2e604:	afb50028 	sw	s5,40(sp)
+   2e608:	3c020001 	lui	v0,0x1
+   2e60c:	2442c048 	addiu	v0,v0,-16312
+   2e610:	afa20050 	sw	v0,80(sp)
+   2e614:	3c020001 	lui	v0,0x1
+   2e618:	2442bff8 	addiu	v0,v0,-16392
+   2e61c:	afa20054 	sw	v0,84(sp)
+   2e620:	3c100001 	lui	s0,0x1
+   2e624:	3c110001 	lui	s1,0x1
+   2e628:	3c020001 	lui	v0,0x1
+   2e62c:	2610be08 	addiu	s0,s0,-16888
+   2e630:	2631bc88 	addiu	s1,s1,-17272
+   2e634:	2442bff0 	addiu	v0,v0,-16400
+   2e638:	ae4002bc 	sw	zero,700(s2)
+   2e63c:	ae4002c4 	sw	zero,708(s2)
+   2e640:	afa20060 	sw	v0,96(sp)
+   2e644:	afb70048 	sw	s7,72(sp)
+   2e648:	afb0005c 	sw	s0,92(sp)
+   2e64c:	afb10058 	sw	s1,88(sp)
+   2e650:	afa0004c 	sw	zero,76(sp)
+   2e654:	40022002 	mfc0	v0,$4,2
+   2e658:	8c440180 	lw	a0,384(v0)
+   2e65c:	27b60048 	addiu	s6,sp,72
+   2e660:	2484054c 	addiu	a0,a0,1356
+   2e664:	02c02821 	addu	a1,s6,zero
+   2e668:	3c060010 	lui	a2,0x10
+   2e66c:	00003821 	addu	a3,zero,zero
+   2e670:	0c00a4f2 	jal	293c8 <vfs_open>
+   2e674:	afb30010 	sw	s3,16(sp)
+   2e678:	1440003c 	bnez	v0,2e76c <elf_load_task+0x1b4>
+   2e67c:	0040a021 	addu	s4,v0,zero
+   2e680:	27b70038 	addiu	s7,sp,56
+   2e684:	3c020022 	lui	v0,0x22
+   2e688:	34420040 	ori	v0,v0,0x40
+   2e68c:	24140034 	addiu	s4,zero,52
+   2e690:	02e02021 	addu	a0,s7,zero
+   2e694:	afb50038 	sw	s5,56(sp)
+   2e698:	afa20040 	sw	v0,64(sp)
+   2e69c:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2e6a0:	afb4003c 	sw	s4,60(sp)
+   2e6a4:	1040015c 	beqz	v0,2ec18 <elf_load_task+0x660>
+   2e6a8:	0040a821 	addu	s5,v0,zero
+   2e6ac:	afa20048 	sw	v0,72(sp)
+   2e6b0:	3c020001 	lui	v0,0x1
+   2e6b4:	2442c094 	addiu	v0,v0,-16236
+   2e6b8:	3c1e0001 	lui	s8,0x1
+   2e6bc:	afa20054 	sw	v0,84(sp)
+   2e6c0:	3c020001 	lui	v0,0x1
+   2e6c4:	27dec0c8 	addiu	s8,s8,-16184
+   2e6c8:	2442bc80 	addiu	v0,v0,-17280
+   2e6cc:	02c02821 	addu	a1,s6,zero
+   2e6d0:	02602021 	addu	a0,s3,zero
+   2e6d4:	afbe0050 	sw	s8,80(sp)
+   2e6d8:	afb0005c 	sw	s0,92(sp)
+   2e6dc:	afb10058 	sw	s1,88(sp)
+   2e6e0:	afa20060 	sw	v0,96(sp)
+   2e6e4:	0c009e63 	jal	2798c <vfs_read>
+   2e6e8:	afb4004c 	sw	s4,76(sp)
+   2e6ec:	14540129 	bne	v0,s4,2eb94 <elf_load_task+0x5dc>
+   2e6f0:	3c030004 	lui	v1,0x4
+   2e6f4:	3c02464c 	lui	v0,0x464c
+   2e6f8:	8ea30000 	lw	v1,0(s5)
+   2e6fc:	3442457f 	ori	v0,v0,0x457f
+   2e700:	1062002f 	beq	v1,v0,2e7c0 <elf_load_task+0x208>
+   2e704:	3c020004 	lui	v0,0x4
+   2e708:	3c060003 	lui	a2,0x3
+   2e70c:	8c449100 	lw	a0,-28416(v0)
+   2e710:	24c67e58 	addiu	a2,a2,32344
+   2e714:	0c0009b0 	jal	26c0 <__fprintk>
+   2e718:	00002821 	addu	a1,zero,zero
+   2e71c:	02602021 	addu	a0,s3,zero
+   2e720:	0c009f67 	jal	27d9c <vfs_close>
+   2e724:	27a50024 	addiu	a1,sp,36
+   2e728:	02e02021 	addu	a0,s7,zero
+   2e72c:	afb50044 	sw	s5,68(sp)
+   2e730:	0c007134 	jal	1c4d0 <kmem_free>
+   2e734:	2414ffff 	addiu	s4,zero,-1
+   2e738:	8fbf00ec 	lw	ra,236(sp)
+   2e73c:	02801021 	addu	v0,s4,zero
+   2e740:	8fbe00e8 	lw	s8,232(sp)
+   2e744:	8fb700e4 	lw	s7,228(sp)
+   2e748:	8fb600e0 	lw	s6,224(sp)
+   2e74c:	8fb500dc 	lw	s5,220(sp)
+   2e750:	8fb400d8 	lw	s4,216(sp)
+   2e754:	8fb300d4 	lw	s3,212(sp)
+   2e758:	8fb200d0 	lw	s2,208(sp)
+   2e75c:	8fb100cc 	lw	s1,204(sp)
+   2e760:	8fb000c8 	lw	s0,200(sp)
+   2e764:	03e00008 	jr	ra
+   2e768:	27bd00f0 	addiu	sp,sp,240
+   2e76c:	3c020004 	lui	v0,0x4
+   2e770:	8c449100 	lw	a0,-28416(v0)
+   2e774:	3c060003 	lui	a2,0x3
+   2e778:	02803821 	addu	a3,s4,zero
+   2e77c:	24c67bfc 	addiu	a2,a2,31740
+   2e780:	00002821 	addu	a1,zero,zero
+   2e784:	0c0009b0 	jal	26c0 <__fprintk>
+   2e788:	afb70010 	sw	s7,16(sp)
+   2e78c:	8fbf00ec 	lw	ra,236(sp)
+   2e790:	02801021 	addu	v0,s4,zero
+   2e794:	8fbe00e8 	lw	s8,232(sp)
+   2e798:	8fb700e4 	lw	s7,228(sp)
+   2e79c:	8fb600e0 	lw	s6,224(sp)
+   2e7a0:	8fb500dc 	lw	s5,220(sp)
+   2e7a4:	8fb400d8 	lw	s4,216(sp)
+   2e7a8:	8fb300d4 	lw	s3,212(sp)
+   2e7ac:	8fb200d0 	lw	s2,208(sp)
+   2e7b0:	8fb100cc 	lw	s1,204(sp)
+   2e7b4:	8fb000c8 	lw	s0,200(sp)
+   2e7b8:	03e00008 	jr	ra
+   2e7bc:	27bd00f0 	addiu	sp,sp,240
+   2e7c0:	3c020001 	lui	v0,0x1
+   2e7c4:	8ea30004 	lw	v1,4(s5)
+   2e7c8:	34420101 	ori	v0,v0,0x101
+   2e7cc:	10620009 	beq	v1,v0,2e7f4 <elf_load_task+0x23c>
+   2e7d0:	24030008 	addiu	v1,zero,8
+   2e7d4:	3c020004 	lui	v0,0x4
+   2e7d8:	8c449100 	lw	a0,-28416(v0)
+   2e7dc:	3c060003 	lui	a2,0x3
+   2e7e0:	24c67e94 	addiu	a2,a2,32404
+   2e7e4:	0c0009b0 	jal	26c0 <__fprintk>
+   2e7e8:	00002821 	addu	a1,zero,zero
+   2e7ec:	0800b9c8 	j	2e720 <elf_load_task+0x168>
+   2e7f0:	02602021 	addu	a0,s3,zero
+   2e7f4:	96a20012 	lhu	v0,18(s5)
+   2e7f8:	10430005 	beq	v0,v1,2e810 <elf_load_task+0x258>
+   2e7fc:	2403000a 	addiu	v1,zero,10
+   2e800:	10430003 	beq	v0,v1,2e810 <elf_load_task+0x258>
+   2e804:	24030003 	addiu	v1,zero,3
+   2e808:	1443fff3 	bne	v0,v1,2e7d8 <elf_load_task+0x220>
+   2e80c:	3c020004 	lui	v0,0x4
+   2e810:	96a30010 	lhu	v1,16(s5)
+   2e814:	24020002 	addiu	v0,zero,2
+   2e818:	1462ffef 	bne	v1,v0,2e7d8 <elf_load_task+0x220>
+   2e81c:	3c020004 	lui	v0,0x4
+   2e820:	96b6002c 	lhu	s6,44(s5)
+   2e824:	8ea2001c 	lw	v0,28(s5)
+   2e828:	72c2b002 	mul	s6,s6,v0
+   2e82c:	16c0001c 	bnez	s6,2e8a0 <elf_load_task+0x2e8>
+   2e830:	24020001 	addiu	v0,zero,1
+   2e834:	3c020004 	lui	v0,0x4
+   2e838:	8c449100 	lw	a0,-28416(v0)
+   2e83c:	3c060003 	lui	a2,0x3
+   2e840:	24c67c9c 	addiu	a2,a2,31900
+   2e844:	0c0009b0 	jal	26c0 <__fprintk>
+   2e848:	00002821 	addu	a1,zero,zero
+   2e84c:	24140016 	addiu	s4,zero,22
+   2e850:	27b00028 	addiu	s0,sp,40
+   2e854:	02602021 	addu	a0,s3,zero
+   2e858:	0c009f67 	jal	27d9c <vfs_close>
+   2e85c:	27a50020 	addiu	a1,sp,32
+   2e860:	02002021 	addu	a0,s0,zero
+   2e864:	0c007134 	jal	1c4d0 <kmem_free>
+   2e868:	afb50034 	sw	s5,52(sp)
+   2e86c:	8fbf00ec 	lw	ra,236(sp)
+   2e870:	02801021 	addu	v0,s4,zero
+   2e874:	8fbe00e8 	lw	s8,232(sp)
+   2e878:	8fb700e4 	lw	s7,228(sp)
+   2e87c:	8fb600e0 	lw	s6,224(sp)
+   2e880:	8fb500dc 	lw	s5,220(sp)
+   2e884:	8fb400d8 	lw	s4,216(sp)
+   2e888:	8fb300d4 	lw	s3,212(sp)
+   2e88c:	8fb200d0 	lw	s2,208(sp)
+   2e890:	8fb100cc 	lw	s1,204(sp)
+   2e894:	8fb000c8 	lw	s0,200(sp)
+   2e898:	03e00008 	jr	ra
+   2e89c:	27bd00f0 	addiu	sp,sp,240
+   2e8a0:	afa20038 	sw	v0,56(sp)
+   2e8a4:	3c020022 	lui	v0,0x22
+   2e8a8:	34420040 	ori	v0,v0,0x40
+   2e8ac:	02e02021 	addu	a0,s7,zero
+   2e8b0:	afa20040 	sw	v0,64(sp)
+   2e8b4:	0c00713f 	jal	1c4fc <kmem_alloc>
+   2e8b8:	afb6003c 	sw	s6,60(sp)
+   2e8bc:	104000a6 	beqz	v0,2eb58 <elf_load_task+0x5a0>
+   2e8c0:	afa200c0 	sw	v0,192(sp)
+   2e8c4:	8ea5001c 	lw	a1,28(s5)
+   2e8c8:	02602021 	addu	a0,s3,zero
+   2e8cc:	00003021 	addu	a2,zero,zero
+   2e8d0:	0c00a689 	jal	29a24 <vfs_lseek>
+   2e8d4:	00003821 	addu	a3,zero,zero
+   2e8d8:	1040000e 	beqz	v0,2e914 <elf_load_task+0x35c>
+   2e8dc:	0040a021 	addu	s4,v0,zero
+   2e8e0:	3c020004 	lui	v0,0x4
+   2e8e4:	8c449100 	lw	a0,-28416(v0)
+   2e8e8:	3c060003 	lui	a2,0x3
+   2e8ec:	24c67cd8 	addiu	a2,a2,31960
+   2e8f0:	0c0009b0 	jal	26c0 <__fprintk>
+   2e8f4:	00002821 	addu	a1,zero,zero
+   2e8f8:	8fa200c0 	lw	v0,192(sp)
+   2e8fc:	02e02021 	addu	a0,s7,zero
+   2e900:	afa20044 	sw	v0,68(sp)
+   2e904:	0c007134 	jal	1c4d0 <kmem_free>
+   2e908:	27b00028 	addiu	s0,sp,40
+   2e90c:	0800ba16 	j	2e858 <elf_load_task+0x2a0>
+   2e910:	02602021 	addu	a0,s3,zero
+   2e914:	3c020001 	lui	v0,0x1
+   2e918:	2442c094 	addiu	v0,v0,-16236
+   2e91c:	afa20070 	sw	v0,112(sp)
+   2e920:	3c020001 	lui	v0,0x1
+   2e924:	2442bc80 	addiu	v0,v0,-17280
+   2e928:	afa2007c 	sw	v0,124(sp)
+   2e92c:	8fa200c0 	lw	v0,192(sp)
+   2e930:	02602021 	addu	a0,s3,zero
+   2e934:	27a50064 	addiu	a1,sp,100
+   2e938:	afbe006c 	sw	s8,108(sp)
+   2e93c:	afb00078 	sw	s0,120(sp)
+   2e940:	afb10074 	sw	s1,116(sp)
+   2e944:	afa20064 	sw	v0,100(sp)
+   2e948:	0c009e63 	jal	2798c <vfs_read>
+   2e94c:	afb60068 	sw	s6,104(sp)
+   2e950:	12c20048 	beq	s6,v0,2ea74 <elf_load_task+0x4bc>
+   2e954:	0040a021 	addu	s4,v0,zero
+   2e958:	3c020004 	lui	v0,0x4
+   2e95c:	8c449100 	lw	a0,-28416(v0)
+   2e960:	3c060003 	lui	a2,0x3
+   2e964:	24c67d18 	addiu	a2,a2,32024
+   2e968:	00002821 	addu	a1,zero,zero
+   2e96c:	02803821 	addu	a3,s4,zero
+   2e970:	0c0009b0 	jal	26c0 <__fprintk>
+   2e974:	afb60010 	sw	s6,16(sp)
+   2e978:	8fa200c0 	lw	v0,192(sp)
+   2e97c:	02e02021 	addu	a0,s7,zero
+   2e980:	0c007134 	jal	1c4d0 <kmem_free>
+   2e984:	afa20044 	sw	v0,68(sp)
+   2e988:	1680ffb2 	bnez	s4,2e854 <elf_load_task+0x29c>
+   2e98c:	27b00028 	addiu	s0,sp,40
+   2e990:	afa000c0 	sw	zero,192(sp)
+   2e994:	00008021 	addu	s0,zero,zero
+   2e998:	96a3002c 	lhu	v1,44(s5)
+   2e99c:	10600051 	beqz	v1,2eae4 <elf_load_task+0x52c>
+   2e9a0:	3c1e7fff 	lui	s8,0x7fff
+   2e9a4:	37dec000 	ori	s8,s8,0xc000
+   2e9a8:	00008821 	addu	s1,zero,zero
+   2e9ac:	0800ba71 	j	2e9c4 <elf_load_task+0x40c>
+   2e9b0:	24170001 	addiu	s7,zero,1
+   2e9b4:	26310001 	addiu	s1,s1,1
+   2e9b8:	0223102b 	sltu	v0,s1,v1
+   2e9bc:	10400049 	beqz	v0,2eae4 <elf_load_task+0x52c>
+   2e9c0:	26100020 	addiu	s0,s0,32
+   2e9c4:	8e020000 	lw	v0,0(s0)
+   2e9c8:	1457fffa 	bne	v0,s7,2e9b4 <elf_load_task+0x3fc>
+   2e9cc:	00000000 	sll	zero,zero,0x0
+   2e9d0:	8e020008 	lw	v0,8(s0)
+   2e9d4:	2443c000 	addiu	v1,v0,-16384
+   2e9d8:	007e182b 	sltu	v1,v1,s8
+   2e9dc:	10600076 	beqz	v1,2ebb8 <elf_load_task+0x600>
+   2e9e0:	02602021 	addu	a0,s3,zero
+   2e9e4:	8e050004 	lw	a1,4(s0)
+   2e9e8:	00003021 	addu	a2,zero,zero
+   2e9ec:	0c00a689 	jal	29a24 <vfs_lseek>
+   2e9f0:	00003821 	addu	a3,zero,zero
+   2e9f4:	1440007d 	bnez	v0,2ebec <elf_load_task+0x634>
+   2e9f8:	0040a021 	addu	s4,v0,zero
+   2e9fc:	8e140008 	lw	s4,8(s0)
+   2ea00:	8e160014 	lw	s6,20(s0)
+   2ea04:	0296b021 	addu	s6,s4,s6
+   2ea08:	02d41025 	or	v0,s6,s4
+   2ea0c:	30420fff 	andi	v0,v0,0xfff
+   2ea10:	14400054 	bnez	v0,2eb64 <elf_load_task+0x5ac>
+   2ea14:	3c020004 	lui	v0,0x4
+   2ea18:	8e4202bc 	lw	v0,700(s2)
+   2ea1c:	14400017 	bnez	v0,2ea7c <elf_load_task+0x4c4>
+   2ea20:	24021041 	addiu	v0,zero,4161
+   2ea24:	ae5402bc 	sw	s4,700(s2)
+   2ea28:	ae5602c0 	sw	s6,704(s2)
+   2ea2c:	24030005 	addiu	v1,zero,5
+   2ea30:	afa30010 	sw	v1,16(sp)
+   2ea34:	afa20014 	sw	v0,20(sp)
+   2ea38:	8e020004 	lw	v0,4(s0)
+   2ea3c:	02402021 	addu	a0,s2,zero
+   2ea40:	02602821 	addu	a1,s3,zero
+   2ea44:	02803021 	addu	a2,s4,zero
+   2ea48:	02d43823 	subu	a3,s6,s4
+   2ea4c:	afa300c4 	sw	v1,196(sp)
+   2ea50:	0c0084ee 	jal	213b8 <vmm_mmap>
+   2ea54:	afa20018 	sw	v0,24(sp)
+   2ea58:	2404ffff 	addiu	a0,zero,-1
+   2ea5c:	10440010 	beq	v0,a0,2eaa0 <elf_load_task+0x4e8>
+   2ea60:	8fa300c4 	lw	v1,196(sp)
+   2ea64:	0c00aeed 	jal	2bbb4 <vfs_file_up>
+   2ea68:	02602021 	addu	a0,s3,zero
+   2ea6c:	0800ba6d 	j	2e9b4 <elf_load_task+0x3fc>
+   2ea70:	96a3002c 	lhu	v1,44(s5)
+   2ea74:	0800ba66 	j	2e998 <elf_load_task+0x3e0>
+   2ea78:	8fb000c0 	lw	s0,192(sp)
+   2ea7c:	8e4202c4 	lw	v0,708(s2)
+   2ea80:	1440fffa 	bnez	v0,2ea6c <elf_load_task+0x4b4>
+   2ea84:	24020042 	addiu	v0,zero,66
+   2ea88:	ae5402c4 	sw	s4,708(s2)
+   2ea8c:	ae5602c8 	sw	s6,712(s2)
+   2ea90:	ae5602cc 	sw	s6,716(s2)
+   2ea94:	ae5602d0 	sw	s6,720(s2)
+   2ea98:	0800ba8c 	j	2ea30 <elf_load_task+0x478>
+   2ea9c:	24030003 	addiu	v1,zero,3
+   2eaa0:	3c020004 	lui	v0,0x4
+   2eaa4:	8c449100 	lw	a0,-28416(v0)
+   2eaa8:	3c060003 	lui	a2,0x3
+   2eaac:	8fa20098 	lw	v0,152(sp)
+   2eab0:	3c070003 	lui	a3,0x3
+   2eab4:	24c67e0c 	addiu	a2,a2,32268
+   2eab8:	24e77ec0 	addiu	a3,a3,32448
+   2eabc:	00002821 	addu	a1,zero,zero
+   2eac0:	afb40010 	sw	s4,16(sp)
+   2eac4:	afb60014 	sw	s6,20(sp)
+   2eac8:	afa30018 	sw	v1,24(sp)
+   2eacc:	0c0009b0 	jal	26c0 <__fprintk>
+   2ead0:	afa2001c 	sw	v0,28(sp)
+   2ead4:	40022002 	mfc0	v0,$4,2
+   2ead8:	8c540258 	lw	s4,600(v0)
+   2eadc:	16800005 	bnez	s4,2eaf4 <elf_load_task+0x53c>
+   2eae0:	27b00028 	addiu	s0,sp,40
+   2eae4:	8ea20018 	lw	v0,24(s5)
+   2eae8:	0000a021 	addu	s4,zero,zero
+   2eaec:	ae4202d4 	sw	v0,724(s2)
+   2eaf0:	27b00028 	addiu	s0,sp,40
+   2eaf4:	8fa200c0 	lw	v0,192(sp)
+   2eaf8:	02002021 	addu	a0,s0,zero
+   2eafc:	0c007134 	jal	1c4d0 <kmem_free>
+   2eb00:	afa20034 	sw	v0,52(sp)
+   2eb04:	1680ff53 	bnez	s4,2e854 <elf_load_task+0x29c>
+   2eb08:	26520588 	addiu	s2,s2,1416
+   2eb0c:	27a200b0 	addiu	v0,sp,176
+   2eb10:	8e660000 	lw	a2,0(s3)
+   2eb14:	8e650004 	lw	a1,4(s3)
+   2eb18:	8e640008 	lw	a0,8(s3)
+   2eb1c:	8e63000c 	lw	v1,12(s3)
+   2eb20:	26730010 	addiu	s3,s3,16
+   2eb24:	ae460000 	sw	a2,0(s2)
+   2eb28:	ae450004 	sw	a1,4(s2)
+   2eb2c:	ae440008 	sw	a0,8(s2)
+   2eb30:	ae43000c 	sw	v1,12(s2)
+   2eb34:	1662fff6 	bne	s3,v0,2eb10 <elf_load_task+0x558>
+   2eb38:	26520010 	addiu	s2,s2,16
+   2eb3c:	8e640008 	lw	a0,8(s3)
+   2eb40:	8e630000 	lw	v1,0(s3)
+   2eb44:	8e620004 	lw	v0,4(s3)
+   2eb48:	ae440008 	sw	a0,8(s2)
+   2eb4c:	ae430000 	sw	v1,0(s2)
+   2eb50:	0800ba18 	j	2e860 <elf_load_task+0x2a8>
+   2eb54:	ae420004 	sw	v0,4(s2)
+   2eb58:	2414000c 	addiu	s4,zero,12
+   2eb5c:	0800ba15 	j	2e854 <elf_load_task+0x29c>
+   2eb60:	27b00028 	addiu	s0,sp,40
+   2eb64:	8c449100 	lw	a0,-28416(v0)
+   2eb68:	3c060003 	lui	a2,0x3
+   2eb6c:	3c070003 	lui	a3,0x3
+   2eb70:	24c67ddc 	addiu	a2,a2,32220
+   2eb74:	24e77ec0 	addiu	a3,a3,32448
+   2eb78:	00002821 	addu	a1,zero,zero
+   2eb7c:	afb40010 	sw	s4,16(sp)
+   2eb80:	afb60014 	sw	s6,20(sp)
+   2eb84:	0c0009b0 	jal	26c0 <__fprintk>
+   2eb88:	2414000d 	addiu	s4,zero,13
+   2eb8c:	0800babd 	j	2eaf4 <elf_load_task+0x53c>
+   2eb90:	27b00028 	addiu	s0,sp,40
+   2eb94:	8c649100 	lw	a0,-28416(v1)
+   2eb98:	3c060003 	lui	a2,0x3
+   2eb9c:	24c67c48 	addiu	a2,a2,31816
+   2eba0:	00403821 	addu	a3,v0,zero
+   2eba4:	00002821 	addu	a1,zero,zero
+   2eba8:	0c0009b0 	jal	26c0 <__fprintk>
+   2ebac:	afb40010 	sw	s4,16(sp)
+   2ebb0:	0800b9c8 	j	2e720 <elf_load_task+0x168>
+   2ebb4:	02602021 	addu	a0,s3,zero
+   2ebb8:	3c030004 	lui	v1,0x4
+   2ebbc:	8c649100 	lw	a0,-28416(v1)
+   2ebc0:	3c060003 	lui	a2,0x3
+   2ebc4:	3c070003 	lui	a3,0x3
+   2ebc8:	24c67d7c 	addiu	a2,a2,32124
+   2ebcc:	24e77ec0 	addiu	a3,a3,32448
+   2ebd0:	00002821 	addu	a1,zero,zero
+   2ebd4:	afa20010 	sw	v0,16(sp)
+   2ebd8:	afb10014 	sw	s1,20(sp)
+   2ebdc:	0c0009b0 	jal	26c0 <__fprintk>
+   2ebe0:	24140001 	addiu	s4,zero,1
+   2ebe4:	0800babd 	j	2eaf4 <elf_load_task+0x53c>
+   2ebe8:	27b00028 	addiu	s0,sp,40
+   2ebec:	3c020004 	lui	v0,0x4
+   2ebf0:	8c449100 	lw	a0,-28416(v0)
+   2ebf4:	3c060003 	lui	a2,0x3
+   2ebf8:	3c070003 	lui	a3,0x3
+   2ebfc:	24c67da8 	addiu	a2,a2,32168
+   2ec00:	24e77ec0 	addiu	a3,a3,32448
+   2ec04:	00002821 	addu	a1,zero,zero
+   2ec08:	0c0009b0 	jal	26c0 <__fprintk>
+   2ec0c:	afb10010 	sw	s1,16(sp)
+   2ec10:	0800babd 	j	2eaf4 <elf_load_task+0x53c>
+   2ec14:	27b00028 	addiu	s0,sp,40
+   2ec18:	02602021 	addu	a0,s3,zero
+   2ec1c:	0c009f67 	jal	27d9c <vfs_close>
+   2ec20:	27a50024 	addiu	a1,sp,36
+   2ec24:	0800b9ce 	j	2e738 <elf_load_task+0x180>
+   2ec28:	2414fff4 	addiu	s4,zero,-12
+
+0002ec2c <compute_dec64>:
+   2ec2c:	8fa80020 	lw	t0,32(sp)
+   2ec30:	24020001 	addiu	v0,zero,1
+   2ec34:	8fa30018 	lw	v1,24(sp)
+   2ec38:	1102003c 	beq	t0,v0,2ed2c <compute_dec64+0x100>
+   2ec3c:	8fa9001c 	lw	t1,28(sp)
+   2ec40:	a0c00013 	sb	zero,19(a2)
+   2ec44:	15200006 	bnez	t1,2ec60 <compute_dec64+0x34>
+   2ec48:	24c20013 	addiu	v0,a2,19
+   2ec4c:	3c043b9a 	lui	a0,0x3b9a
+   2ec50:	3484ca00 	ori	a0,a0,0xca00
+   2ec54:	0064202b 	sltu	a0,v1,a0
+   2ec58:	14800010 	bnez	a0,2ec9c <compute_dec64+0x70>
+   2ec5c:	00003821 	addu	a3,zero,zero
+   2ec60:	3c053b9a 	lui	a1,0x3b9a
+   2ec64:	3c0ac465 	lui	t2,0xc465
+   2ec68:	34a5ca00 	ori	a1,a1,0xca00
+   2ec6c:	00003821 	addu	a3,zero,zero
+   2ec70:	354a3600 	ori	t2,t2,0x3600
+   2ec74:	006a2021 	addu	a0,v1,t2
+   2ec78:	0083182b 	sltu	v1,a0,v1
+   2ec7c:	2529ffff 	addiu	t1,t1,-1
+   2ec80:	00694821 	addu	t1,v1,t1
+   2ec84:	24e70001 	addiu	a3,a3,1
+   2ec88:	00801821 	addu	v1,a0,zero
+   2ec8c:	1520fff9 	bnez	t1,2ec74 <compute_dec64+0x48>
+   2ec90:	0085202b 	sltu	a0,a0,a1
+   2ec94:	1080fff8 	beqz	a0,2ec78 <compute_dec64+0x4c>
+   2ec98:	006a2021 	addu	a0,v1,t2
+   2ec9c:	3c06cccc 	lui	a2,0xcccc
+   2eca0:	34c6cccd 	ori	a2,a2,0xcccd
+   2eca4:	00002021 	addu	a0,zero,zero
+   2eca8:	00660019 	multu	v1,a2
+   2ecac:	2442ffff 	addiu	v0,v0,-1
+   2ecb0:	00002810 	mfhi	a1
+   2ecb4:	24840001 	addiu	a0,a0,1
+   2ecb8:	000528c2 	srl	a1,a1,0x3
+   2ecbc:	00054840 	sll	t1,a1,0x1
+   2ecc0:	000540c0 	sll	t0,a1,0x3
+   2ecc4:	01284021 	addu	t0,t1,t0
+   2ecc8:	00681823 	subu	v1,v1,t0
+   2eccc:	24680030 	addiu	t0,v1,48
+   2ecd0:	00a01821 	addu	v1,a1,zero
+   2ecd4:	a0480000 	sb	t0,0(v0)
+   2ecd8:	1460fff3 	bnez	v1,2eca8 <compute_dec64+0x7c>
+   2ecdc:	2c850009 	sltiu	a1,a0,9
+   2ece0:	14a0fff2 	bnez	a1,2ecac <compute_dec64+0x80>
+   2ece4:	00660019 	multu	v1,a2
+   2ece8:	3c05cccc 	lui	a1,0xcccc
+   2ecec:	00e01821 	addu	v1,a3,zero
+   2ecf0:	34a5cccd 	ori	a1,a1,0xcccd
+   2ecf4:	00650019 	multu	v1,a1
+   2ecf8:	2442ffff 	addiu	v0,v0,-1
+   2ecfc:	00002010 	mfhi	a0
+   2ed00:	000420c2 	srl	a0,a0,0x3
+   2ed04:	00043840 	sll	a3,a0,0x1
+   2ed08:	000430c0 	sll	a2,a0,0x3
+   2ed0c:	00e63021 	addu	a2,a3,a2
+   2ed10:	00661823 	subu	v1,v1,a2
+   2ed14:	24660030 	addiu	a2,v1,48
+   2ed18:	a0460000 	sb	a2,0(v0)
+   2ed1c:	1480fff5 	bnez	a0,2ecf4 <compute_dec64+0xc8>
+   2ed20:	00801821 	addu	v1,a0,zero
+   2ed24:	03e00008 	jr	ra
+   2ed28:	00000000 	sll	zero,zero,0x0
+   2ed2c:	0521ffc4 	bgez	t1,2ec40 <compute_dec64+0x14>
+   2ed30:	00000000 	sll	zero,zero,0x0
+   2ed34:	30a5ffff 	andi	a1,a1,0xffff
+   2ed38:	2ca80101 	sltiu	t0,a1,257
+   2ed3c:	15000003 	bnez	t0,2ed4c <compute_dec64+0x120>
+   2ed40:	8c820000 	lw	v0,0(a0)
+   2ed44:	0800bb51 	j	2ed44 <compute_dec64+0x118>
+   2ed48:	00000000 	sll	zero,zero,0x0
+   2ed4c:	00054100 	sll	t0,a1,0x4
+   2ed50:	00052880 	sll	a1,a1,0x2
+   2ed54:	01052823 	subu	a1,t0,a1
+   2ed58:	3c080004 	lui	t0,0x4
+   2ed5c:	2508c9a0 	addiu	t0,t0,-13920
+   2ed60:	01052821 	addu	a1,t0,a1
+   2ed64:	8ca50000 	lw	a1,0(a1)
+   2ed68:	3c085555 	lui	t0,0x5555
+   2ed6c:	35085555 	ori	t0,t0,0x5555
+   2ed70:	10a8fff4 	beq	a1,t0,2ed44 <compute_dec64+0x118>
+   2ed74:	240a002d 	addiu	t2,zero,45
+   2ed78:	00031823 	negu	v1,v1
+   2ed7c:	0003402b 	sltu	t0,zero,v1
+   2ed80:	00094823 	negu	t1,t1
+   2ed84:	01284823 	subu	t1,t1,t0
+   2ed88:	4808c000 	mfc2	t0,$24
+   2ed8c:	4885c000 	mtc2	a1,$24
+   2ed90:	a04a0000 	sb	t2,0(v0)
+   2ed94:	4888c000 	mtc2	t0,$24
+   2ed98:	8ce50000 	lw	a1,0(a3)
+   2ed9c:	8fa80010 	lw	t0,16(sp)
+   2eda0:	24a50001 	addiu	a1,a1,1
+   2eda4:	00481021 	addu	v0,v0,t0
+   2eda8:	ace50000 	sw	a1,0(a3)
+   2edac:	0800bb10 	j	2ec40 <compute_dec64+0x14>
+   2edb0:	ac820000 	sw	v0,0(a0)
+   2edb4:	8fa80018 	lw	t0,24(sp)
+   2edb8:	24020001 	addiu	v0,zero,1
+   2edbc:	11020013 	beq	t0,v0,2ee0c <compute_dec64+0x1e0>
+   2edc0:	8fa30014 	lw	v1,20(sp)
+   2edc4:	3c05cccc 	lui	a1,0xcccc
+   2edc8:	a0c00013 	sb	zero,19(a2)
+   2edcc:	34a5cccd 	ori	a1,a1,0xcccd
+   2edd0:	24c20013 	addiu	v0,a2,19
+   2edd4:	00650019 	multu	v1,a1
+   2edd8:	2442ffff 	addiu	v0,v0,-1
+   2eddc:	00002010 	mfhi	a0
+   2ede0:	000420c2 	srl	a0,a0,0x3
+   2ede4:	00043840 	sll	a3,a0,0x1
+   2ede8:	000430c0 	sll	a2,a0,0x3
+   2edec:	00e63021 	addu	a2,a3,a2
+   2edf0:	00661823 	subu	v1,v1,a2
+   2edf4:	24660030 	addiu	a2,v1,48
+   2edf8:	a0460000 	sb	a2,0(v0)
+   2edfc:	1480fff5 	bnez	a0,2edd4 <compute_dec64+0x1a8>
+   2ee00:	00801821 	addu	v1,a0,zero
+   2ee04:	03e00008 	jr	ra
+   2ee08:	00000000 	sll	zero,zero,0x0
+   2ee0c:	0461ffed 	bgez	v1,2edc4 <compute_dec64+0x198>
+   2ee10:	30a5ffff 	andi	a1,a1,0xffff
+   2ee14:	2ca80101 	sltiu	t0,a1,257
+   2ee18:	15000003 	bnez	t0,2ee28 <compute_dec64+0x1fc>
+   2ee1c:	8c820000 	lw	v0,0(a0)
+   2ee20:	0800bb88 	j	2ee20 <compute_dec64+0x1f4>
+   2ee24:	00000000 	sll	zero,zero,0x0
+   2ee28:	00054100 	sll	t0,a1,0x4
+   2ee2c:	00052880 	sll	a1,a1,0x2
+   2ee30:	01052823 	subu	a1,t0,a1
+   2ee34:	3c080004 	lui	t0,0x4
+   2ee38:	2508c9a0 	addiu	t0,t0,-13920
+   2ee3c:	01052821 	addu	a1,t0,a1
+   2ee40:	8ca50000 	lw	a1,0(a1)
+   2ee44:	3c085555 	lui	t0,0x5555
+   2ee48:	35085555 	ori	t0,t0,0x5555
+   2ee4c:	10a8fff4 	beq	a1,t0,2ee20 <compute_dec64+0x1f4>
+   2ee50:	2409002d 	addiu	t1,zero,45
+   2ee54:	00031823 	negu	v1,v1
+   2ee58:	4808c000 	mfc2	t0,$24
+   2ee5c:	4885c000 	mtc2	a1,$24
+   2ee60:	a0490000 	sb	t1,0(v0)
+   2ee64:	4888c000 	mtc2	t0,$24
+   2ee68:	8ce50000 	lw	a1,0(a3)
+   2ee6c:	8fa80010 	lw	t0,16(sp)
+   2ee70:	24a50001 	addiu	a1,a1,1
+   2ee74:	00481021 	addu	v0,v0,t0
+   2ee78:	ace50000 	sw	a1,0(a3)
+   2ee7c:	0800bb71 	j	2edc4 <compute_dec64+0x198>
+   2ee80:	ac820000 	sw	v0,0(a0)
+   2ee84:	3c050003 	lui	a1,0x3
+   2ee88:	a0c00013 	sb	zero,19(a2)
+   2ee8c:	24a57ed4 	addiu	a1,a1,32468
+   2ee90:	24c20013 	addiu	v0,a2,19
+   2ee94:	00001821 	addu	v1,zero,zero
+   2ee98:	30e4000f 	andi	a0,a3,0xf
+   2ee9c:	00a42021 	addu	a0,a1,a0
+   2eea0:	90840000 	lbu	a0,0(a0)
+   2eea4:	2442ffff 	addiu	v0,v0,-1
+   2eea8:	00073902 	srl	a3,a3,0x4
+   2eeac:	a0440000 	sb	a0,0(v0)
+   2eeb0:	14e0fff9 	bnez	a3,2ee98 <compute_dec64+0x26c>
+   2eeb4:	24630001 	addiu	v1,v1,1
+   2eeb8:	8fa40010 	lw	a0,16(sp)
+   2eebc:	00603021 	addu	a2,v1,zero
+   2eec0:	1080000b 	beqz	a0,2eef0 <compute_dec64+0x2c4>
+   2eec4:	00403821 	addu	a3,v0,zero
+   2eec8:	2c640008 	sltiu	a0,v1,8
+   2eecc:	10800008 	beqz	a0,2eef0 <compute_dec64+0x2c4>
+   2eed0:	24050030 	addiu	a1,zero,48
+   2eed4:	24040008 	addiu	a0,zero,8
+   2eed8:	2442ffff 	addiu	v0,v0,-1
+   2eedc:	24630001 	addiu	v1,v1,1
+   2eee0:	1464fffd 	bne	v1,a0,2eed8 <compute_dec64+0x2ac>
+   2eee4:	a0450000 	sb	a1,0(v0)
+   2eee8:	24c6fff8 	addiu	a2,a2,-8
+   2eeec:	00e61021 	addu	v0,a3,a2
+   2eef0:	03e00008 	jr	ra
+   2eef4:	00000000 	sll	zero,zero,0x0
+
+0002eef8 <iprintk>:
+   2eef8:	27bdff90 	addiu	sp,sp,-112
+   2eefc:	afb5005c 	sw	s5,92(sp)
+   2ef00:	30b5ffff 	andi	s5,a1,0xffff
+   2ef04:	00151080 	sll	v0,s5,0x2
+   2ef08:	afb60060 	sw	s6,96(sp)
+   2ef0c:	0015b100 	sll	s6,s5,0x4
+   2ef10:	02c21023 	subu	v0,s6,v0
+   2ef14:	3c160004 	lui	s6,0x4
+   2ef18:	afb40058 	sw	s4,88(sp)
+   2ef1c:	afb00048 	sw	s0,72(sp)
+   2ef20:	26d6c9a0 	addiu	s6,s6,-13920
+   2ef24:	3c145555 	lui	s4,0x5555
+   2ef28:	8fb00080 	lw	s0,128(sp)
+   2ef2c:	afbe0068 	sw	s8,104(sp)
+   2ef30:	afb70064 	sw	s7,100(sp)
+   2ef34:	afb30054 	sw	s3,84(sp)
+   2ef38:	afb20050 	sw	s2,80(sp)
+   2ef3c:	afb1004c 	sw	s1,76(sp)
+   2ef40:	afbf006c 	sw	ra,108(sp)
+   2ef44:	00a09021 	addu	s2,a1,zero
+   2ef48:	afa40070 	sw	a0,112(sp)
+   2ef4c:	02c2b021 	addu	s6,s6,v0
+   2ef50:	00c08821 	addu	s1,a2,zero
+   2ef54:	afa00028 	sw	zero,40(sp)
+   2ef58:	2eb50101 	sltiu	s5,s5,257
+   2ef5c:	36945555 	ori	s4,s4,0x5555
+   2ef60:	241e0025 	addiu	s8,zero,37
+   2ef64:	27b3002c 	addiu	s3,sp,44
+   2ef68:	27b70028 	addiu	s7,sp,40
+   2ef6c:	80e20000 	lb	v0,0(a3)
+   2ef70:	104000bb 	beqz	v0,2f260 <iprintk+0x368>
+   2ef74:	8fbf006c 	lw	ra,108(sp)
+   2ef78:	105e0016 	beq	v0,s8,2efd4 <iprintk+0xdc>
+   2ef7c:	00000000 	sll	zero,zero,0x0
+   2ef80:	12a000a3 	beqz	s5,2f210 <iprintk+0x318>
+   2ef84:	8fa30070 	lw	v1,112(sp)
+   2ef88:	8ec50000 	lw	a1,0(s6)
+   2ef8c:	10b400a0 	beq	a1,s4,2f210 <iprintk+0x318>
+   2ef90:	8fa40028 	lw	a0,40(sp)
+   2ef94:	0800bbea 	j	2efa8 <iprintk+0xb0>
+   2ef98:	24e70001 	addiu	a3,a3,1
+   2ef9c:	104000b0 	beqz	v0,2f260 <iprintk+0x368>
+   2efa0:	8fbf006c 	lw	ra,108(sp)
+   2efa4:	24e70001 	addiu	a3,a3,1
+   2efa8:	4808c000 	mfc2	t0,$24
+   2efac:	4885c000 	mtc2	a1,$24
+   2efb0:	a0620000 	sb	v0,0(v1)
+   2efb4:	4888c000 	mtc2	t0,$24
+   2efb8:	00711821 	addu	v1,v1,s1
+   2efbc:	24840001 	addiu	a0,a0,1
+   2efc0:	afa30070 	sw	v1,112(sp)
+   2efc4:	afa40028 	sw	a0,40(sp)
+   2efc8:	80e20000 	lb	v0,0(a3)
+   2efcc:	145efff3 	bne	v0,s8,2ef9c <iprintk+0xa4>
+   2efd0:	00000000 	sll	zero,zero,0x0
+   2efd4:	80e20001 	lb	v0,1(a3)
+   2efd8:	24030064 	addiu	v1,zero,100
+   2efdc:	24e70001 	addiu	a3,a3,1
+   2efe0:	10430040 	beq	v0,v1,2f0e4 <iprintk+0x1ec>
+   2efe4:	afa70040 	sw	a3,64(sp)
+   2efe8:	28430065 	slti	v1,v0,101
+   2efec:	1060001a 	beqz	v1,2f058 <iprintk+0x160>
+   2eff0:	24030073 	addiu	v1,zero,115
+   2eff4:	24030055 	addiu	v1,zero,85
+   2eff8:	10430089 	beq	v0,v1,2f220 <iprintk+0x328>
+   2effc:	2403fff8 	addiu	v1,zero,-8
+   2f000:	28430056 	slti	v1,v0,86
+   2f004:	10600026 	beqz	v1,2f0a0 <iprintk+0x1a8>
+   2f008:	24030063 	addiu	v1,zero,99
+   2f00c:	105e0071 	beq	v0,s8,2f1d4 <iprintk+0x2dc>
+   2f010:	24030044 	addiu	v1,zero,68
+   2f014:	1043005e 	beq	v0,v1,2f190 <iprintk+0x298>
+   2f018:	2403fff8 	addiu	v1,zero,-8
+   2f01c:	12a0009c 	beqz	s5,2f290 <iprintk+0x398>
+   2f020:	8fa40070 	lw	a0,112(sp)
+   2f024:	8ec30000 	lw	v1,0(s6)
+   2f028:	10740099 	beq	v1,s4,2f290 <iprintk+0x398>
+   2f02c:	00000000 	sll	zero,zero,0x0
+   2f030:	4808c000 	mfc2	t0,$24
+   2f034:	4883c000 	mtc2	v1,$24
+   2f038:	a0820000 	sb	v0,0(a0)
+   2f03c:	4888c000 	mtc2	t0,$24
+   2f040:	8fa20028 	lw	v0,40(sp)
+   2f044:	24420001 	addiu	v0,v0,1
+   2f048:	afa20028 	sw	v0,40(sp)
+   2f04c:	8fa20040 	lw	v0,64(sp)
+   2f050:	0800bbdb 	j	2ef6c <iprintk+0x74>
+   2f054:	24470001 	addiu	a3,v0,1
+   2f058:	1043008f 	beq	v0,v1,2f298 <iprintk+0x3a0>
+   2f05c:	28430074 	slti	v1,v0,116
+   2f060:	10600019 	beqz	v1,2f0c8 <iprintk+0x1d0>
+   2f064:	24030075 	addiu	v1,zero,117
+   2f068:	24030070 	addiu	v1,zero,112
+   2f06c:	1443ffeb 	bne	v0,v1,2f01c <iprintk+0x124>
+   2f070:	00000000 	sll	zero,zero,0x0
+   2f074:	8e070000 	lw	a3,0(s0)
+   2f078:	38420070 	xori	v0,v0,0x70
+   2f07c:	2c420001 	sltiu	v0,v0,1
+   2f080:	27a40070 	addiu	a0,sp,112
+   2f084:	02402821 	addu	a1,s2,zero
+   2f088:	02603021 	addu	a2,s3,zero
+   2f08c:	26100004 	addiu	s0,s0,4
+   2f090:	0c00bba1 	jal	2ee84 <compute_dec64+0x258>
+   2f094:	afa20010 	sw	v0,16(sp)
+   2f098:	0800bc53 	j	2f14c <iprintk+0x254>
+   2f09c:	80430000 	lb	v1,0(v0)
+   2f0a0:	1443ffde 	bne	v0,v1,2f01c <iprintk+0x124>
+   2f0a4:	00000000 	sll	zero,zero,0x0
+   2f0a8:	8fa20070 	lw	v0,112(sp)
+   2f0ac:	12a00080 	beqz	s5,2f2b0 <iprintk+0x3b8>
+   2f0b0:	8e040000 	lw	a0,0(s0)
+   2f0b4:	8ec30000 	lw	v1,0(s6)
+   2f0b8:	1074007d 	beq	v1,s4,2f2b0 <iprintk+0x3b8>
+   2f0bc:	26100004 	addiu	s0,s0,4
+   2f0c0:	0800bc7a 	j	2f1e8 <iprintk+0x2f0>
+   2f0c4:	00000000 	sll	zero,zero,0x0
+   2f0c8:	10430026 	beq	v0,v1,2f164 <iprintk+0x26c>
+   2f0cc:	27a40070 	addiu	a0,sp,112
+   2f0d0:	24030078 	addiu	v1,zero,120
+   2f0d4:	1443ffd1 	bne	v0,v1,2f01c <iprintk+0x124>
+   2f0d8:	00000000 	sll	zero,zero,0x0
+   2f0dc:	0800bc1e 	j	2f078 <iprintk+0x180>
+   2f0e0:	8e070000 	lw	a3,0(s0)
+   2f0e4:	afb10010 	sw	s1,16(sp)
+   2f0e8:	8e020000 	lw	v0,0(s0)
+   2f0ec:	27a40070 	addiu	a0,sp,112
+   2f0f0:	afa20014 	sw	v0,20(sp)
+   2f0f4:	02402821 	addu	a1,s2,zero
+   2f0f8:	02603021 	addu	a2,s3,zero
+   2f0fc:	02e03821 	addu	a3,s7,zero
+   2f100:	24020001 	addiu	v0,zero,1
+   2f104:	26100004 	addiu	s0,s0,4
+   2f108:	0c00bb6d 	jal	2edb4 <compute_dec64+0x188>
+   2f10c:	afa20018 	sw	v0,24(sp)
+   2f110:	0800bc53 	j	2f14c <iprintk+0x254>
+   2f114:	80430000 	lb	v1,0(v0)
+   2f118:	8ec50000 	lw	a1,0(s6)
+   2f11c:	10b4000f 	beq	a1,s4,2f15c <iprintk+0x264>
+   2f120:	00000000 	sll	zero,zero,0x0
+   2f124:	4808c000 	mfc2	t0,$24
+   2f128:	4885c000 	mtc2	a1,$24
+   2f12c:	a0830000 	sb	v1,0(a0)
+   2f130:	4888c000 	mtc2	t0,$24
+   2f134:	8fa30028 	lw	v1,40(sp)
+   2f138:	00912021 	addu	a0,a0,s1
+   2f13c:	24630001 	addiu	v1,v1,1
+   2f140:	afa40070 	sw	a0,112(sp)
+   2f144:	afa30028 	sw	v1,40(sp)
+   2f148:	80430000 	lb	v1,0(v0)
+   2f14c:	1060ffbf 	beqz	v1,2f04c <iprintk+0x154>
+   2f150:	24420001 	addiu	v0,v0,1
+   2f154:	16a0fff0 	bnez	s5,2f118 <iprintk+0x220>
+   2f158:	8fa40070 	lw	a0,112(sp)
+   2f15c:	0800bc57 	j	2f15c <iprintk+0x264>
+   2f160:	00000000 	sll	zero,zero,0x0
+   2f164:	afb10010 	sw	s1,16(sp)
+   2f168:	8e020000 	lw	v0,0(s0)
+   2f16c:	02402821 	addu	a1,s2,zero
+   2f170:	02603021 	addu	a2,s3,zero
+   2f174:	02e03821 	addu	a3,s7,zero
+   2f178:	26100004 	addiu	s0,s0,4
+   2f17c:	afa20014 	sw	v0,20(sp)
+   2f180:	0c00bb6d 	jal	2edb4 <compute_dec64+0x188>
+   2f184:	afa00018 	sw	zero,24(sp)
+   2f188:	0800bc53 	j	2f14c <iprintk+0x254>
+   2f18c:	80430000 	lb	v1,0(v0)
+   2f190:	26100007 	addiu	s0,s0,7
+   2f194:	02038024 	and	s0,s0,v1
+   2f198:	afb10010 	sw	s1,16(sp)
+   2f19c:	8e020000 	lw	v0,0(s0)
+   2f1a0:	8e030004 	lw	v1,4(s0)
+   2f1a4:	27a40070 	addiu	a0,sp,112
+   2f1a8:	afa20018 	sw	v0,24(sp)
+   2f1ac:	02402821 	addu	a1,s2,zero
+   2f1b0:	02603021 	addu	a2,s3,zero
+   2f1b4:	02e03821 	addu	a3,s7,zero
+   2f1b8:	24020001 	addiu	v0,zero,1
+   2f1bc:	afa3001c 	sw	v1,28(sp)
+   2f1c0:	afa20020 	sw	v0,32(sp)
+   2f1c4:	0c00bb0b 	jal	2ec2c <compute_dec64>
+   2f1c8:	26100008 	addiu	s0,s0,8
+   2f1cc:	0800bc53 	j	2f14c <iprintk+0x254>
+   2f1d0:	80430000 	lb	v1,0(v0)
+   2f1d4:	12a00010 	beqz	s5,2f218 <iprintk+0x320>
+   2f1d8:	8fa20070 	lw	v0,112(sp)
+   2f1dc:	8ec30000 	lw	v1,0(s6)
+   2f1e0:	1074000d 	beq	v1,s4,2f218 <iprintk+0x320>
+   2f1e4:	24040025 	addiu	a0,zero,37
+   2f1e8:	4808c000 	mfc2	t0,$24
+   2f1ec:	4883c000 	mtc2	v1,$24
+   2f1f0:	a0440000 	sb	a0,0(v0)
+   2f1f4:	4888c000 	mtc2	t0,$24
+   2f1f8:	8fa30028 	lw	v1,40(sp)
+   2f1fc:	00511021 	addu	v0,v0,s1
+   2f200:	24630001 	addiu	v1,v1,1
+   2f204:	afa20070 	sw	v0,112(sp)
+   2f208:	0800bc13 	j	2f04c <iprintk+0x154>
+   2f20c:	afa30028 	sw	v1,40(sp)
+   2f210:	0800bc84 	j	2f210 <iprintk+0x318>
+   2f214:	00000000 	sll	zero,zero,0x0
+   2f218:	0800bc86 	j	2f218 <iprintk+0x320>
+   2f21c:	00000000 	sll	zero,zero,0x0
+   2f220:	26100007 	addiu	s0,s0,7
+   2f224:	02038024 	and	s0,s0,v1
+   2f228:	afb10010 	sw	s1,16(sp)
+   2f22c:	8e030004 	lw	v1,4(s0)
+   2f230:	8e020000 	lw	v0,0(s0)
+   2f234:	27a40070 	addiu	a0,sp,112
+   2f238:	02402821 	addu	a1,s2,zero
+   2f23c:	02603021 	addu	a2,s3,zero
+   2f240:	02e03821 	addu	a3,s7,zero
+   2f244:	afa20018 	sw	v0,24(sp)
+   2f248:	afa3001c 	sw	v1,28(sp)
+   2f24c:	afa00020 	sw	zero,32(sp)
+   2f250:	0c00bb0b 	jal	2ec2c <compute_dec64>
+   2f254:	26100008 	addiu	s0,s0,8
+   2f258:	0800bc53 	j	2f14c <iprintk+0x254>
+   2f25c:	80430000 	lb	v1,0(v0)
+   2f260:	8fa20028 	lw	v0,40(sp)
+   2f264:	8fbe0068 	lw	s8,104(sp)
+   2f268:	8fb70064 	lw	s7,100(sp)
+   2f26c:	8fb60060 	lw	s6,96(sp)
+   2f270:	8fb5005c 	lw	s5,92(sp)
+   2f274:	8fb40058 	lw	s4,88(sp)
+   2f278:	8fb30054 	lw	s3,84(sp)
+   2f27c:	8fb20050 	lw	s2,80(sp)
+   2f280:	8fb1004c 	lw	s1,76(sp)
+   2f284:	8fb00048 	lw	s0,72(sp)
+   2f288:	03e00008 	jr	ra
+   2f28c:	27bd0070 	addiu	sp,sp,112
+   2f290:	0800bca4 	j	2f290 <iprintk+0x398>
+   2f294:	00000000 	sll	zero,zero,0x0
+   2f298:	8e020000 	lw	v0,0(s0)
+   2f29c:	1440ffaa 	bnez	v0,2f148 <iprintk+0x250>
+   2f2a0:	26100004 	addiu	s0,s0,4
+   2f2a4:	3c020003 	lui	v0,0x3
+   2f2a8:	0800bc52 	j	2f148 <iprintk+0x250>
+   2f2ac:	24427ee8 	addiu	v0,v0,32488
+   2f2b0:	0800bcac 	j	2f2b0 <iprintk+0x3b8>
+   2f2b4:	00000000 	sll	zero,zero,0x0
+
+0002f2b8 <MD5Init>:
+   2f2b8:	3c021032 	lui	v0,0x1032
+   2f2bc:	34425476 	ori	v0,v0,0x5476
+   2f2c0:	ac82000c 	sw	v0,12(a0)
+   2f2c4:	3c026745 	lui	v0,0x6745
+   2f2c8:	34422301 	ori	v0,v0,0x2301
+   2f2cc:	ac820000 	sw	v0,0(a0)
+   2f2d0:	3c02efcd 	lui	v0,0xefcd
+   2f2d4:	3442ab89 	ori	v0,v0,0xab89
+   2f2d8:	ac820004 	sw	v0,4(a0)
+   2f2dc:	3c0298ba 	lui	v0,0x98ba
+   2f2e0:	3442dcfe 	ori	v0,v0,0xdcfe
+   2f2e4:	ac820008 	sw	v0,8(a0)
+   2f2e8:	ac800010 	sw	zero,16(a0)
+   2f2ec:	03e00008 	jr	ra
+   2f2f0:	ac800014 	sw	zero,20(a0)
+   2f2f4:	27bdff68 	addiu	sp,sp,-152
+   2f2f8:	24820008 	addiu	v0,a0,8
+   2f2fc:	2483000c 	addiu	v1,a0,12
+   2f300:	afb7008c 	sw	s7,140(sp)
+   2f304:	afb60088 	sw	s6,136(sp)
+   2f308:	afb50084 	sw	s5,132(sp)
+   2f30c:	afb40080 	sw	s4,128(sp)
+   2f310:	afb3007c 	sw	s3,124(sp)
+   2f314:	afb20078 	sw	s2,120(sp)
+   2f318:	afb10074 	sw	s1,116(sp)
+   2f31c:	afb00070 	sw	s0,112(sp)
+   2f320:	afbf0094 	sw	ra,148(sp)
+   2f324:	afbe0090 	sw	s8,144(sp)
+   2f328:	00809021 	addu	s2,a0,zero
+   2f32c:	00c08821 	addu	s1,a2,zero
+   2f330:	00a08021 	addu	s0,a1,zero
+   2f334:	8c960000 	lw	s6,0(a0)
+   2f338:	24930004 	addiu	s3,a0,4
+   2f33c:	8c940004 	lw	s4,4(a0)
+   2f340:	afa20058 	sw	v0,88(sp)
+   2f344:	8c950008 	lw	s5,8(a0)
+   2f348:	afa30054 	sw	v1,84(sp)
+   2f34c:	14c003a0 	bnez	a2,301d0 <MD5Init+0xf18>
+   2f350:	8c97000c 	lw	s7,12(a0)
+   2f354:	0800c07e 	j	301f8 <MD5Init+0xf40>
+   2f358:	8fbf0094 	lw	ra,148(sp)
+   2f35c:	02002021 	addu	a0,s0,zero
+   2f360:	02f51026 	xor	v0,s7,s5
+   2f364:	3c05d76a 	lui	a1,0xd76a
+   2f368:	00541024 	and	v0,v0,s4
+   2f36c:	34a5a478 	ori	a1,a1,0xa478
+   2f370:	8c9e0000 	lw	s8,0(a0)
+   2f374:	00571026 	xor	v0,v0,s7
+   2f378:	02c5b021 	addu	s6,s6,a1
+   2f37c:	02c2b021 	addu	s6,s6,v0
+   2f380:	02deb021 	addu	s6,s6,s8
+   2f384:	001611c0 	sll	v0,s6,0x7
+   2f388:	0016b642 	srl	s6,s6,0x19
+   2f38c:	00561025 	or	v0,v0,s6
+   2f390:	3c08e8c7 	lui	t0,0xe8c7
+   2f394:	00541021 	addu	v0,v0,s4
+   2f398:	8c8d0004 	lw	t5,4(a0)
+   2f39c:	02b41826 	xor	v1,s5,s4
+   2f3a0:	3508b756 	ori	t0,t0,0xb756
+   2f3a4:	02e8b821 	addu	s7,s7,t0
+   2f3a8:	00431824 	and	v1,v0,v1
+   2f3ac:	00751826 	xor	v1,v1,s5
+   2f3b0:	02edb821 	addu	s7,s7,t5
+   2f3b4:	02e3b821 	addu	s7,s7,v1
+   2f3b8:	00173b00 	sll	a3,s7,0xc
+   2f3bc:	0017bd02 	srl	s7,s7,0x14
+   2f3c0:	00f73825 	or	a3,a3,s7
+   2f3c4:	3c0b2420 	lui	t3,0x2420
+   2f3c8:	00e23821 	addu	a3,a3,v0
+   2f3cc:	8c860008 	lw	a2,8(a0)
+   2f3d0:	00541826 	xor	v1,v0,s4
+   2f3d4:	356b70db 	ori	t3,t3,0x70db
+   2f3d8:	02aba821 	addu	s5,s5,t3
+   2f3dc:	00e31824 	and	v1,a3,v1
+   2f3e0:	00741826 	xor	v1,v1,s4
+   2f3e4:	02a6a821 	addu	s5,s5,a2
+   2f3e8:	02a3a821 	addu	s5,s5,v1
+   2f3ec:	00152c40 	sll	a1,s5,0x11
+   2f3f0:	0015abc2 	srl	s5,s5,0xf
+   2f3f4:	00b52825 	or	a1,a1,s5
+   2f3f8:	3c0cc1bd 	lui	t4,0xc1bd
+   2f3fc:	00a72821 	addu	a1,a1,a3
+   2f400:	8c8f000c 	lw	t7,12(a0)
+   2f404:	00e21826 	xor	v1,a3,v0
+   2f408:	358cceee 	ori	t4,t4,0xceee
+   2f40c:	028ca021 	addu	s4,s4,t4
+   2f410:	00a31824 	and	v1,a1,v1
+   2f414:	00621826 	xor	v1,v1,v0
+   2f418:	028fa021 	addu	s4,s4,t7
+   2f41c:	0283a021 	addu	s4,s4,v1
+   2f420:	00141d80 	sll	v1,s4,0x16
+   2f424:	0014a282 	srl	s4,s4,0xa
+   2f428:	8c880010 	lw	t0,16(a0)
+   2f42c:	00741825 	or	v1,v1,s4
+   2f430:	3c0ef57c 	lui	t6,0xf57c
+   2f434:	00651821 	addu	v1,v1,a1
+   2f438:	00a74826 	xor	t1,a1,a3
+   2f43c:	35ce0faf 	ori	t6,t6,0xfaf
+   2f440:	010e5021 	addu	t2,t0,t6
+   2f444:	00694824 	and	t1,v1,t1
+   2f448:	01421021 	addu	v0,t2,v0
+   2f44c:	01274826 	xor	t1,t1,a3
+   2f450:	00494821 	addu	t1,v0,t1
+   2f454:	000911c0 	sll	v0,t1,0x7
+   2f458:	00094e42 	srl	t1,t1,0x19
+   2f45c:	8c990014 	lw	t9,20(a0)
+   2f460:	00491025 	or	v0,v0,t1
+   2f464:	3c164787 	lui	s6,0x4787
+   2f468:	00431021 	addu	v0,v0,v1
+   2f46c:	00654826 	xor	t1,v1,a1
+   2f470:	36d6c62a 	ori	s6,s6,0xc62a
+   2f474:	03365021 	addu	t2,t9,s6
+   2f478:	00494824 	and	t1,v0,t1
+   2f47c:	01254826 	xor	t1,t1,a1
+   2f480:	01473821 	addu	a3,t2,a3
+   2f484:	00e93821 	addu	a3,a3,t1
+   2f488:	00074b00 	sll	t1,a3,0xc
+   2f48c:	00073d02 	srl	a3,a3,0x14
+   2f490:	8c8a0018 	lw	t2,24(a0)
+   2f494:	01274825 	or	t1,t1,a3
+   2f498:	3c17a830 	lui	s7,0xa830
+   2f49c:	01224821 	addu	t1,t1,v0
+   2f4a0:	00433826 	xor	a3,v0,v1
+   2f4a4:	36f74613 	ori	s7,s7,0x4613
+   2f4a8:	01575821 	addu	t3,t2,s7
+   2f4ac:	01273824 	and	a3,t1,a3
+   2f4b0:	00e33826 	xor	a3,a3,v1
+   2f4b4:	01652821 	addu	a1,t3,a1
+   2f4b8:	00a72821 	addu	a1,a1,a3
+   2f4bc:	00053c40 	sll	a3,a1,0x11
+   2f4c0:	00052bc2 	srl	a1,a1,0xf
+   2f4c4:	8c95001c 	lw	s5,28(a0)
+   2f4c8:	00e53825 	or	a3,a3,a1
+   2f4cc:	3c18fd46 	lui	t8,0xfd46
+   2f4d0:	00e93821 	addu	a3,a3,t1
+   2f4d4:	01222826 	xor	a1,t1,v0
+   2f4d8:	37189501 	ori	t8,t8,0x9501
+   2f4dc:	02b85821 	addu	t3,s5,t8
+   2f4e0:	00e52824 	and	a1,a3,a1
+   2f4e4:	01631821 	addu	v1,t3,v1
+   2f4e8:	00a22826 	xor	a1,a1,v0
+   2f4ec:	00652821 	addu	a1,v1,a1
+   2f4f0:	00051d80 	sll	v1,a1,0x16
+   2f4f4:	00052a82 	srl	a1,a1,0xa
+   2f4f8:	8c8c0020 	lw	t4,32(a0)
+   2f4fc:	00651825 	or	v1,v1,a1
+   2f500:	3c0e6980 	lui	t6,0x6980
+   2f504:	00671821 	addu	v1,v1,a3
+   2f508:	00e92826 	xor	a1,a3,t1
+   2f50c:	35ce98d8 	ori	t6,t6,0x98d8
+   2f510:	018e5821 	addu	t3,t4,t6
+   2f514:	00652824 	and	a1,v1,a1
+   2f518:	01621021 	addu	v0,t3,v0
+   2f51c:	00a92826 	xor	a1,a1,t1
+   2f520:	00452821 	addu	a1,v0,a1
+   2f524:	000511c0 	sll	v0,a1,0x7
+   2f528:	00052e42 	srl	a1,a1,0x19
+   2f52c:	00451025 	or	v0,v0,a1
+   2f530:	3c168b44 	lui	s6,0x8b44
+   2f534:	8c850024 	lw	a1,36(a0)
+   2f538:	00431021 	addu	v0,v0,v1
+   2f53c:	00675826 	xor	t3,v1,a3
+   2f540:	36d6f7af 	ori	s6,s6,0xf7af
+   2f544:	00b67021 	addu	t6,a1,s6
+   2f548:	004b5824 	and	t3,v0,t3
+   2f54c:	01675826 	xor	t3,t3,a3
+   2f550:	01c94821 	addu	t1,t6,t1
+   2f554:	012b4821 	addu	t1,t1,t3
+   2f558:	0009a300 	sll	s4,t1,0xc
+   2f55c:	00094d02 	srl	t1,t1,0x14
+   2f560:	8c8e0028 	lw	t6,40(a0)
+   2f564:	0289a025 	or	s4,s4,t1
+   2f568:	3c17ffff 	lui	s7,0xffff
+   2f56c:	0282a021 	addu	s4,s4,v0
+   2f570:	00434826 	xor	t1,v0,v1
+   2f574:	36f75bb1 	ori	s7,s7,0x5bb1
+   2f578:	01d75821 	addu	t3,t6,s7
+   2f57c:	02894824 	and	t1,s4,t1
+   2f580:	01234826 	xor	t1,t1,v1
+   2f584:	01673821 	addu	a3,t3,a3
+   2f588:	00e93821 	addu	a3,a3,t1
+   2f58c:	00075c40 	sll	t3,a3,0x11
+   2f590:	00073bc2 	srl	a3,a3,0xf
+   2f594:	01675825 	or	t3,t3,a3
+   2f598:	3c16895c 	lui	s6,0x895c
+   2f59c:	8c87002c 	lw	a3,44(a0)
+   2f5a0:	01745821 	addu	t3,t3,s4
+   2f5a4:	02824826 	xor	t1,s4,v0
+   2f5a8:	36d6d7be 	ori	s6,s6,0xd7be
+   2f5ac:	00f6c021 	addu	t8,a3,s6
+   2f5b0:	01694824 	and	t1,t3,t1
+   2f5b4:	03031821 	addu	v1,t8,v1
+   2f5b8:	01224826 	xor	t1,t1,v0
+   2f5bc:	00694821 	addu	t1,v1,t1
+   2f5c0:	00091d80 	sll	v1,t1,0x16
+   2f5c4:	00094a82 	srl	t1,t1,0xa
+   2f5c8:	8c980030 	lw	t8,48(a0)
+   2f5cc:	00691825 	or	v1,v1,t1
+   2f5d0:	3c176b90 	lui	s7,0x6b90
+   2f5d4:	006b1821 	addu	v1,v1,t3
+   2f5d8:	01744826 	xor	t1,t3,s4
+   2f5dc:	36f71122 	ori	s7,s7,0x1122
+   2f5e0:	0317b021 	addu	s6,t8,s7
+   2f5e4:	00694824 	and	t1,v1,t1
+   2f5e8:	02c21021 	addu	v0,s6,v0
+   2f5ec:	01344826 	xor	t1,t1,s4
+   2f5f0:	00494821 	addu	t1,v0,t1
+   2f5f4:	000911c0 	sll	v0,t1,0x7
+   2f5f8:	00094e42 	srl	t1,t1,0x19
+   2f5fc:	00491025 	or	v0,v0,t1
+   2f600:	00431021 	addu	v0,v0,v1
+   2f604:	006bb026 	xor	s6,v1,t3
+   2f608:	0056b024 	and	s6,v0,s6
+   2f60c:	afb60050 	sw	s6,80(sp)
+   2f610:	8c890034 	lw	t1,52(a0)
+   2f614:	3c16fd98 	lui	s6,0xfd98
+   2f618:	36d67193 	ori	s6,s6,0x7193
+   2f61c:	0136b821 	addu	s7,t1,s6
+   2f620:	02f4a021 	addu	s4,s7,s4
+   2f624:	8fb70050 	lw	s7,80(sp)
+   2f628:	2631ffff 	addiu	s1,s1,-1
+   2f62c:	02ebb026 	xor	s6,s7,t3
+   2f630:	0296a021 	addu	s4,s4,s6
+   2f634:	0014bb00 	sll	s7,s4,0xc
+   2f638:	0014a502 	srl	s4,s4,0x14
+   2f63c:	02f4b825 	or	s7,s7,s4
+   2f640:	02e2b821 	addu	s7,s7,v0
+   2f644:	0043b026 	xor	s6,v0,v1
+   2f648:	02f6b024 	and	s6,s7,s6
+   2f64c:	afb6005c 	sw	s6,92(sp)
+   2f650:	8c940038 	lw	s4,56(a0)
+   2f654:	3c16a679 	lui	s6,0xa679
+   2f658:	36d6438e 	ori	s6,s6,0x438e
+   2f65c:	0296b021 	addu	s6,s4,s6
+   2f660:	02cb5821 	addu	t3,s6,t3
+   2f664:	afab0050 	sw	t3,80(sp)
+   2f668:	8fab005c 	lw	t3,92(sp)
+   2f66c:	8fb60050 	lw	s6,80(sp)
+   2f670:	01635826 	xor	t3,t3,v1
+   2f674:	02cbb021 	addu	s6,s6,t3
+   2f678:	afb60050 	sw	s6,80(sp)
+   2f67c:	8fab0050 	lw	t3,80(sp)
+   2f680:	0016b440 	sll	s6,s6,0x11
+   2f684:	000b5bc2 	srl	t3,t3,0xf
+   2f688:	02cbb025 	or	s6,s6,t3
+   2f68c:	02d7b021 	addu	s6,s6,s7
+   2f690:	8c8b003c 	lw	t3,60(a0)
+   2f694:	02e22026 	xor	a0,s7,v0
+   2f698:	02c42024 	and	a0,s6,a0
+   2f69c:	afa4005c 	sw	a0,92(sp)
+   2f6a0:	3c0449b4 	lui	a0,0x49b4
+   2f6a4:	34840821 	ori	a0,a0,0x821
+   2f6a8:	01642021 	addu	a0,t3,a0
+   2f6ac:	00831821 	addu	v1,a0,v1
+   2f6b0:	afa30050 	sw	v1,80(sp)
+   2f6b4:	8fa3005c 	lw	v1,92(sp)
+   2f6b8:	00622026 	xor	a0,v1,v0
+   2f6bc:	8fa30050 	lw	v1,80(sp)
+   2f6c0:	00642021 	addu	a0,v1,a0
+   2f6c4:	00041d80 	sll	v1,a0,0x16
+   2f6c8:	00042282 	srl	a0,a0,0xa
+   2f6cc:	00641825 	or	v1,v1,a0
+   2f6d0:	00761821 	addu	v1,v1,s6
+   2f6d4:	00762026 	xor	a0,v1,s6
+   2f6d8:	00972024 	and	a0,a0,s7
+   2f6dc:	afa4005c 	sw	a0,92(sp)
+   2f6e0:	3c04f61e 	lui	a0,0xf61e
+   2f6e4:	34842562 	ori	a0,a0,0x2562
+   2f6e8:	01a42021 	addu	a0,t5,a0
+   2f6ec:	00821021 	addu	v0,a0,v0
+   2f6f0:	afa20050 	sw	v0,80(sp)
+   2f6f4:	8fa2005c 	lw	v0,92(sp)
+   2f6f8:	00562026 	xor	a0,v0,s6
+   2f6fc:	8fa20050 	lw	v0,80(sp)
+   2f700:	00442021 	addu	a0,v0,a0
+   2f704:	00041140 	sll	v0,a0,0x5
+   2f708:	000426c2 	srl	a0,a0,0x1b
+   2f70c:	00441025 	or	v0,v0,a0
+   2f710:	00431021 	addu	v0,v0,v1
+   2f714:	00432026 	xor	a0,v0,v1
+   2f718:	00962024 	and	a0,a0,s6
+   2f71c:	afa4005c 	sw	a0,92(sp)
+   2f720:	3c04c040 	lui	a0,0xc040
+   2f724:	3484b340 	ori	a0,a0,0xb340
+   2f728:	01442021 	addu	a0,t2,a0
+   2f72c:	0097b821 	addu	s7,a0,s7
+   2f730:	afb70050 	sw	s7,80(sp)
+   2f734:	8fb7005c 	lw	s7,92(sp)
+   2f738:	8fa40050 	lw	a0,80(sp)
+   2f73c:	02e3b826 	xor	s7,s7,v1
+   2f740:	00972021 	addu	a0,a0,s7
+   2f744:	afa40050 	sw	a0,80(sp)
+   2f748:	8fb70050 	lw	s7,80(sp)
+   2f74c:	00042240 	sll	a0,a0,0x9
+   2f750:	0017bdc2 	srl	s7,s7,0x17
+   2f754:	00972025 	or	a0,a0,s7
+   2f758:	00822021 	addu	a0,a0,v0
+   2f75c:	0082b826 	xor	s7,a0,v0
+   2f760:	afa40060 	sw	a0,96(sp)
+   2f764:	02e32024 	and	a0,s7,v1
+   2f768:	3c17265e 	lui	s7,0x265e
+   2f76c:	36f75a51 	ori	s7,s7,0x5a51
+   2f770:	00f7b821 	addu	s7,a3,s7
+   2f774:	02f6b021 	addu	s6,s7,s6
+   2f778:	0082b826 	xor	s7,a0,v0
+   2f77c:	02d7b821 	addu	s7,s6,s7
+   2f780:	8fa40060 	lw	a0,96(sp)
+   2f784:	0017b380 	sll	s6,s7,0xe
+   2f788:	0017bc82 	srl	s7,s7,0x12
+   2f78c:	02d7b025 	or	s6,s6,s7
+   2f790:	02c4b021 	addu	s6,s6,a0
+   2f794:	02c4b826 	xor	s7,s6,a0
+   2f798:	02e22024 	and	a0,s7,v0
+   2f79c:	3c17e9b6 	lui	s7,0xe9b6
+   2f7a0:	36f7c7aa 	ori	s7,s7,0xc7aa
+   2f7a4:	afb6005c 	sw	s6,92(sp)
+   2f7a8:	03d7b021 	addu	s6,s8,s7
+   2f7ac:	02c31821 	addu	v1,s6,v1
+   2f7b0:	8fb60060 	lw	s6,96(sp)
+   2f7b4:	0096b826 	xor	s7,a0,s6
+   2f7b8:	0077b821 	addu	s7,v1,s7
+   2f7bc:	00171d00 	sll	v1,s7,0x14
+   2f7c0:	0017bb02 	srl	s7,s7,0xc
+   2f7c4:	00771825 	or	v1,v1,s7
+   2f7c8:	8fb7005c 	lw	s7,92(sp)
+   2f7cc:	00771821 	addu	v1,v1,s7
+   2f7d0:	0077b826 	xor	s7,v1,s7
+   2f7d4:	afa30068 	sw	v1,104(sp)
+   2f7d8:	02f61824 	and	v1,s7,s6
+   2f7dc:	3c16d62f 	lui	s6,0xd62f
+   2f7e0:	36d6105d 	ori	s6,s6,0x105d
+   2f7e4:	03362021 	addu	a0,t9,s6
+   2f7e8:	00821021 	addu	v0,a0,v0
+   2f7ec:	8fa4005c 	lw	a0,92(sp)
+   2f7f0:	8fb60068 	lw	s6,104(sp)
+   2f7f4:	0064b826 	xor	s7,v1,a0
+   2f7f8:	0057b821 	addu	s7,v0,s7
+   2f7fc:	00171140 	sll	v0,s7,0x5
+   2f800:	0017bec2 	srl	s7,s7,0x1b
+   2f804:	00571025 	or	v0,v0,s7
+   2f808:	00561021 	addu	v0,v0,s6
+   2f80c:	afa20064 	sw	v0,100(sp)
+   2f810:	3c030244 	lui	v1,0x244
+   2f814:	00561026 	xor	v0,v0,s6
+   2f818:	0044b824 	and	s7,v0,a0
+   2f81c:	34631453 	ori	v1,v1,0x1453
+   2f820:	8fa40060 	lw	a0,96(sp)
+   2f824:	01c31821 	addu	v1,t6,v1
+   2f828:	00641021 	addu	v0,v1,a0
+   2f82c:	02f6b826 	xor	s7,s7,s6
+   2f830:	0057b821 	addu	s7,v0,s7
+   2f834:	8fb60064 	lw	s6,100(sp)
+   2f838:	00172240 	sll	a0,s7,0x9
+   2f83c:	0017bdc2 	srl	s7,s7,0x17
+   2f840:	00972025 	or	a0,a0,s7
+   2f844:	00962021 	addu	a0,a0,s6
+   2f848:	3c03d8a1 	lui	v1,0xd8a1
+   2f84c:	afa40060 	sw	a0,96(sp)
+   2f850:	00961026 	xor	v0,a0,s6
+   2f854:	3463e681 	ori	v1,v1,0xe681
+   2f858:	8fa40068 	lw	a0,104(sp)
+   2f85c:	8fb6005c 	lw	s6,92(sp)
+   2f860:	01631821 	addu	v1,t3,v1
+   2f864:	0044b824 	and	s7,v0,a0
+   2f868:	00761021 	addu	v0,v1,s6
+   2f86c:	8fa30064 	lw	v1,100(sp)
+   2f870:	8fa40060 	lw	a0,96(sp)
+   2f874:	02e3b826 	xor	s7,s7,v1
+   2f878:	0057b821 	addu	s7,v0,s7
+   2f87c:	0017b380 	sll	s6,s7,0xe
+   2f880:	0017bc82 	srl	s7,s7,0x12
+   2f884:	02d7b025 	or	s6,s6,s7
+   2f888:	3c03e7d3 	lui	v1,0xe7d3
+   2f88c:	02c4b021 	addu	s6,s6,a0
+   2f890:	3463fbc8 	ori	v1,v1,0xfbc8
+   2f894:	afb6005c 	sw	s6,92(sp)
+   2f898:	02c41026 	xor	v0,s6,a0
+   2f89c:	01032021 	addu	a0,t0,v1
+   2f8a0:	8fb60064 	lw	s6,100(sp)
+   2f8a4:	8fa30068 	lw	v1,104(sp)
+   2f8a8:	0056b824 	and	s7,v0,s6
+   2f8ac:	00831021 	addu	v0,a0,v1
+   2f8b0:	8fa40060 	lw	a0,96(sp)
+   2f8b4:	8fb6005c 	lw	s6,92(sp)
+   2f8b8:	02e4b826 	xor	s7,s7,a0
+   2f8bc:	0057b821 	addu	s7,v0,s7
+   2f8c0:	00171d00 	sll	v1,s7,0x14
+   2f8c4:	0017bb02 	srl	s7,s7,0xc
+   2f8c8:	00771825 	or	v1,v1,s7
+   2f8cc:	00761821 	addu	v1,v1,s6
+   2f8d0:	afa30068 	sw	v1,104(sp)
+   2f8d4:	00761026 	xor	v0,v1,s6
+   2f8d8:	3c0321e1 	lui	v1,0x21e1
+   2f8dc:	0044b824 	and	s7,v0,a0
+   2f8e0:	3463cde6 	ori	v1,v1,0xcde6
+   2f8e4:	8fa20064 	lw	v0,100(sp)
+   2f8e8:	00a31821 	addu	v1,a1,v1
+   2f8ec:	00621821 	addu	v1,v1,v0
+   2f8f0:	02f6b826 	xor	s7,s7,s6
+   2f8f4:	0077b821 	addu	s7,v1,s7
+   2f8f8:	00171140 	sll	v0,s7,0x5
+   2f8fc:	8fa30068 	lw	v1,104(sp)
+   2f900:	0017bec2 	srl	s7,s7,0x1b
+   2f904:	00571025 	or	v0,v0,s7
+   2f908:	00431021 	addu	v0,v0,v1
+   2f90c:	afa20064 	sw	v0,100(sp)
+   2f910:	00431026 	xor	v0,v0,v1
+   2f914:	3c03c337 	lui	v1,0xc337
+   2f918:	346307d6 	ori	v1,v1,0x7d6
+   2f91c:	02831821 	addu	v1,s4,v1
+   2f920:	0056b824 	and	s7,v0,s6
+   2f924:	00641021 	addu	v0,v1,a0
+   2f928:	8fa40068 	lw	a0,104(sp)
+   2f92c:	8fb60064 	lw	s6,100(sp)
+   2f930:	02e4b826 	xor	s7,s7,a0
+   2f934:	0057b821 	addu	s7,v0,s7
+   2f938:	00172240 	sll	a0,s7,0x9
+   2f93c:	0017bdc2 	srl	s7,s7,0x17
+   2f940:	00972025 	or	a0,a0,s7
+   2f944:	00962021 	addu	a0,a0,s6
+   2f948:	3c03f4d5 	lui	v1,0xf4d5
+   2f94c:	00961026 	xor	v0,a0,s6
+   2f950:	afa40060 	sw	a0,96(sp)
+   2f954:	8fb6005c 	lw	s6,92(sp)
+   2f958:	8fa40068 	lw	a0,104(sp)
+   2f95c:	34630d87 	ori	v1,v1,0xd87
+   2f960:	01e31821 	addu	v1,t7,v1
+   2f964:	0044b824 	and	s7,v0,a0
+   2f968:	00761021 	addu	v0,v1,s6
+   2f96c:	8fa30064 	lw	v1,100(sp)
+   2f970:	8fa40060 	lw	a0,96(sp)
+   2f974:	02e3b826 	xor	s7,s7,v1
+   2f978:	0057b821 	addu	s7,v0,s7
+   2f97c:	0017b380 	sll	s6,s7,0xe
+   2f980:	0017bc82 	srl	s7,s7,0x12
+   2f984:	02d7b025 	or	s6,s6,s7
+   2f988:	3c03455a 	lui	v1,0x455a
+   2f98c:	02c4b021 	addu	s6,s6,a0
+   2f990:	346314ed 	ori	v1,v1,0x14ed
+   2f994:	afb6005c 	sw	s6,92(sp)
+   2f998:	02c41026 	xor	v0,s6,a0
+   2f99c:	01832021 	addu	a0,t4,v1
+   2f9a0:	8fb60064 	lw	s6,100(sp)
+   2f9a4:	8fa30068 	lw	v1,104(sp)
+   2f9a8:	0056b824 	and	s7,v0,s6
+   2f9ac:	00831021 	addu	v0,a0,v1
+   2f9b0:	8fa40060 	lw	a0,96(sp)
+   2f9b4:	8fb6005c 	lw	s6,92(sp)
+   2f9b8:	02e4b826 	xor	s7,s7,a0
+   2f9bc:	0057b821 	addu	s7,v0,s7
+   2f9c0:	00171d00 	sll	v1,s7,0x14
+   2f9c4:	0017bb02 	srl	s7,s7,0xc
+   2f9c8:	00771825 	or	v1,v1,s7
+   2f9cc:	00761821 	addu	v1,v1,s6
+   2f9d0:	00761026 	xor	v0,v1,s6
+   2f9d4:	8fb60060 	lw	s6,96(sp)
+   2f9d8:	3c04a9e3 	lui	a0,0xa9e3
+   2f9dc:	0056b824 	and	s7,v0,s6
+   2f9e0:	3484e905 	ori	a0,a0,0xe905
+   2f9e4:	8fb6005c 	lw	s6,92(sp)
+   2f9e8:	8fa20064 	lw	v0,100(sp)
+   2f9ec:	01242021 	addu	a0,t1,a0
+   2f9f0:	00822021 	addu	a0,a0,v0
+   2f9f4:	02f6b826 	xor	s7,s7,s6
+   2f9f8:	0097b821 	addu	s7,a0,s7
+   2f9fc:	00171140 	sll	v0,s7,0x5
+   2fa00:	0017bec2 	srl	s7,s7,0x1b
+   2fa04:	00571025 	or	v0,v0,s7
+   2fa08:	00431021 	addu	v0,v0,v1
+   2fa0c:	8fa4005c 	lw	a0,92(sp)
+   2fa10:	0043b826 	xor	s7,v0,v1
+   2fa14:	3c16fcef 	lui	s6,0xfcef
+   2fa18:	02e4b824 	and	s7,s7,a0
+   2fa1c:	36d6a3f8 	ori	s6,s6,0xa3f8
+   2fa20:	8fa40060 	lw	a0,96(sp)
+   2fa24:	00d6b021 	addu	s6,a2,s6
+   2fa28:	02c4b021 	addu	s6,s6,a0
+   2fa2c:	02e3b826 	xor	s7,s7,v1
+   2fa30:	02d7b821 	addu	s7,s6,s7
+   2fa34:	00172240 	sll	a0,s7,0x9
+   2fa38:	0017bdc2 	srl	s7,s7,0x17
+   2fa3c:	00972025 	or	a0,a0,s7
+   2fa40:	00822021 	addu	a0,a0,v0
+   2fa44:	0082b026 	xor	s6,a0,v0
+   2fa48:	02c3b024 	and	s6,s6,v1
+   2fa4c:	3c17676f 	lui	s7,0x676f
+   2fa50:	afb60060 	sw	s6,96(sp)
+   2fa54:	36f702d9 	ori	s7,s7,0x2d9
+   2fa58:	8fb6005c 	lw	s6,92(sp)
+   2fa5c:	02b7b821 	addu	s7,s5,s7
+   2fa60:	02f6b021 	addu	s6,s7,s6
+   2fa64:	afb60050 	sw	s6,80(sp)
+   2fa68:	8fb60060 	lw	s6,96(sp)
+   2fa6c:	02c2b826 	xor	s7,s6,v0
+   2fa70:	8fb60050 	lw	s6,80(sp)
+   2fa74:	02d7b821 	addu	s7,s6,s7
+   2fa78:	0017b380 	sll	s6,s7,0xe
+   2fa7c:	0017bc82 	srl	s7,s7,0x12
+   2fa80:	02d7b025 	or	s6,s6,s7
+   2fa84:	02c4b021 	addu	s6,s6,a0
+   2fa88:	02c4b826 	xor	s7,s6,a0
+   2fa8c:	afb70060 	sw	s7,96(sp)
+   2fa90:	3c178d2a 	lui	s7,0x8d2a
+   2fa94:	36f74c8a 	ori	s7,s7,0x4c8a
+   2fa98:	0317b821 	addu	s7,t8,s7
+   2fa9c:	afb70050 	sw	s7,80(sp)
+   2faa0:	8fb70060 	lw	s7,96(sp)
+   2faa4:	02e2b824 	and	s7,s7,v0
+   2faa8:	afb7005c 	sw	s7,92(sp)
+   2faac:	8fb70050 	lw	s7,80(sp)
+   2fab0:	02e31821 	addu	v1,s7,v1
+   2fab4:	8fb7005c 	lw	s7,92(sp)
+   2fab8:	02e4b826 	xor	s7,s7,a0
+   2fabc:	00771821 	addu	v1,v1,s7
+   2fac0:	afa30050 	sw	v1,80(sp)
+   2fac4:	8fb70050 	lw	s7,80(sp)
+   2fac8:	00031d00 	sll	v1,v1,0x14
+   2facc:	0017bb02 	srl	s7,s7,0xc
+   2fad0:	00771825 	or	v1,v1,s7
+   2fad4:	3c17fffa 	lui	s7,0xfffa
+   2fad8:	36f73942 	ori	s7,s7,0x3942
+   2fadc:	0337b821 	addu	s7,t9,s7
+   2fae0:	02e21021 	addu	v0,s7,v0
+   2fae4:	afa20050 	sw	v0,80(sp)
+   2fae8:	8fa20060 	lw	v0,96(sp)
+   2faec:	00761821 	addu	v1,v1,s6
+   2faf0:	8fb70050 	lw	s7,80(sp)
+   2faf4:	00621026 	xor	v0,v1,v0
+   2faf8:	02e2b821 	addu	s7,s7,v0
+   2fafc:	afb70050 	sw	s7,80(sp)
+   2fb00:	8fa20050 	lw	v0,80(sp)
+   2fb04:	0017b900 	sll	s7,s7,0x4
+   2fb08:	00021702 	srl	v0,v0,0x1c
+   2fb0c:	02e2b825 	or	s7,s7,v0
+   2fb10:	3c028771 	lui	v0,0x8771
+   2fb14:	3442f681 	ori	v0,v0,0xf681
+   2fb18:	01821021 	addu	v0,t4,v0
+   2fb1c:	afa20050 	sw	v0,80(sp)
+   2fb20:	00761026 	xor	v0,v1,s6
+   2fb24:	afa2005c 	sw	v0,92(sp)
+   2fb28:	8fa20050 	lw	v0,80(sp)
+   2fb2c:	02e3b821 	addu	s7,s7,v1
+   2fb30:	00442021 	addu	a0,v0,a0
+   2fb34:	afa40050 	sw	a0,80(sp)
+   2fb38:	8fa4005c 	lw	a0,92(sp)
+   2fb3c:	8fa20050 	lw	v0,80(sp)
+   2fb40:	00972026 	xor	a0,a0,s7
+   2fb44:	00441021 	addu	v0,v0,a0
+   2fb48:	afa20050 	sw	v0,80(sp)
+   2fb4c:	8fa40050 	lw	a0,80(sp)
+   2fb50:	000212c0 	sll	v0,v0,0xb
+   2fb54:	00042542 	srl	a0,a0,0x15
+   2fb58:	00441025 	or	v0,v0,a0
+   2fb5c:	3c046d9d 	lui	a0,0x6d9d
+   2fb60:	00571021 	addu	v0,v0,s7
+   2fb64:	34846122 	ori	a0,a0,0x6122
+   2fb68:	afa20050 	sw	v0,80(sp)
+   2fb6c:	00e42021 	addu	a0,a3,a0
+   2fb70:	0096b021 	addu	s6,a0,s6
+   2fb74:	8fa40050 	lw	a0,80(sp)
+   2fb78:	02e31026 	xor	v0,s7,v1
+   2fb7c:	00441026 	xor	v0,v0,a0
+   2fb80:	02c22021 	addu	a0,s6,v0
+   2fb84:	00041400 	sll	v0,a0,0x10
+   2fb88:	8fb60050 	lw	s6,80(sp)
+   2fb8c:	00042402 	srl	a0,a0,0x10
+   2fb90:	00441025 	or	v0,v0,a0
+   2fb94:	00561021 	addu	v0,v0,s6
+   2fb98:	3c16fde5 	lui	s6,0xfde5
+   2fb9c:	36d6380c 	ori	s6,s6,0x380c
+   2fba0:	afa2005c 	sw	v0,92(sp)
+   2fba4:	0296b021 	addu	s6,s4,s6
+   2fba8:	8fa40050 	lw	a0,80(sp)
+   2fbac:	02c31821 	addu	v1,s6,v1
+   2fbb0:	8fb6005c 	lw	s6,92(sp)
+   2fbb4:	00971026 	xor	v0,a0,s7
+   2fbb8:	00562026 	xor	a0,v0,s6
+   2fbbc:	00641821 	addu	v1,v1,a0
+   2fbc0:	000325c0 	sll	a0,v1,0x17
+   2fbc4:	00031a42 	srl	v1,v1,0x9
+   2fbc8:	00832025 	or	a0,a0,v1
+   2fbcc:	00962021 	addu	a0,a0,s6
+   2fbd0:	3c16a4be 	lui	s6,0xa4be
+   2fbd4:	36d6ea44 	ori	s6,s6,0xea44
+   2fbd8:	afa40064 	sw	a0,100(sp)
+   2fbdc:	8fa3005c 	lw	v1,92(sp)
+   2fbe0:	01b6b021 	addu	s6,t5,s6
+   2fbe4:	8fa40050 	lw	a0,80(sp)
+   2fbe8:	02d7b821 	addu	s7,s6,s7
+   2fbec:	8fb60064 	lw	s6,100(sp)
+   2fbf0:	00641026 	xor	v0,v1,a0
+   2fbf4:	00561826 	xor	v1,v0,s6
+   2fbf8:	02e31821 	addu	v1,s7,v1
+   2fbfc:	0003b100 	sll	s6,v1,0x4
+   2fc00:	8fb70064 	lw	s7,100(sp)
+   2fc04:	00031f02 	srl	v1,v1,0x1c
+   2fc08:	8fa4005c 	lw	a0,92(sp)
+   2fc0c:	02c3b025 	or	s6,s6,v1
+   2fc10:	8fa30064 	lw	v1,100(sp)
+   2fc14:	02d7b021 	addu	s6,s6,s7
+   2fc18:	3c174bde 	lui	s7,0x4bde
+   2fc1c:	00641026 	xor	v0,v1,a0
+   2fc20:	36f7cfa9 	ori	s7,s7,0xcfa9
+   2fc24:	8fa30050 	lw	v1,80(sp)
+   2fc28:	0117b821 	addu	s7,t0,s7
+   2fc2c:	02e3b821 	addu	s7,s7,v1
+   2fc30:	00561826 	xor	v1,v0,s6
+   2fc34:	02e3b821 	addu	s7,s7,v1
+   2fc38:	00171ac0 	sll	v1,s7,0xb
+   2fc3c:	0017bd42 	srl	s7,s7,0x15
+   2fc40:	00771825 	or	v1,v1,s7
+   2fc44:	8fa40064 	lw	a0,100(sp)
+   2fc48:	00761821 	addu	v1,v1,s6
+   2fc4c:	3c17f6bb 	lui	s7,0xf6bb
+   2fc50:	afa30060 	sw	v1,96(sp)
+   2fc54:	36f74b60 	ori	s7,s7,0x4b60
+   2fc58:	8fa2005c 	lw	v0,92(sp)
+   2fc5c:	02b71821 	addu	v1,s5,s7
+   2fc60:	02c4b826 	xor	s7,s6,a0
+   2fc64:	8fa40060 	lw	a0,96(sp)
+   2fc68:	00621821 	addu	v1,v1,v0
+   2fc6c:	02e4b826 	xor	s7,s7,a0
+   2fc70:	0077b821 	addu	s7,v1,s7
+   2fc74:	00171400 	sll	v0,s7,0x10
+   2fc78:	0017bc02 	srl	s7,s7,0x10
+   2fc7c:	00571025 	or	v0,v0,s7
+   2fc80:	00441021 	addu	v0,v0,a0
+   2fc84:	3c17bebf 	lui	s7,0xbebf
+   2fc88:	afa2005c 	sw	v0,92(sp)
+   2fc8c:	36f7bc70 	ori	s7,s7,0xbc70
+   2fc90:	8fa30064 	lw	v1,100(sp)
+   2fc94:	01d71021 	addu	v0,t6,s7
+   2fc98:	0096b826 	xor	s7,a0,s6
+   2fc9c:	8fa4005c 	lw	a0,92(sp)
+   2fca0:	00431021 	addu	v0,v0,v1
+   2fca4:	02e4b826 	xor	s7,s7,a0
+   2fca8:	00572021 	addu	a0,v0,s7
+   2fcac:	0004bdc0 	sll	s7,a0,0x17
+   2fcb0:	00042242 	srl	a0,a0,0x9
+   2fcb4:	02e4b825 	or	s7,s7,a0
+   2fcb8:	3c04289b 	lui	a0,0x289b
+   2fcbc:	34847ec6 	ori	a0,a0,0x7ec6
+   2fcc0:	8fa2005c 	lw	v0,92(sp)
+   2fcc4:	01241821 	addu	v1,t1,a0
+   2fcc8:	8fa40060 	lw	a0,96(sp)
+   2fccc:	02e2b821 	addu	s7,s7,v0
+   2fcd0:	00442026 	xor	a0,v0,a0
+   2fcd4:	00972026 	xor	a0,a0,s7
+   2fcd8:	0076b021 	addu	s6,v1,s6
+   2fcdc:	02c4b021 	addu	s6,s6,a0
+   2fce0:	00162100 	sll	a0,s6,0x4
+   2fce4:	0016b702 	srl	s6,s6,0x1c
+   2fce8:	00962025 	or	a0,a0,s6
+   2fcec:	00972021 	addu	a0,a0,s7
+   2fcf0:	8fa3005c 	lw	v1,92(sp)
+   2fcf4:	3c16eaa1 	lui	s6,0xeaa1
+   2fcf8:	afa40064 	sw	a0,100(sp)
+   2fcfc:	36d627fa 	ori	s6,s6,0x27fa
+   2fd00:	8fa40060 	lw	a0,96(sp)
+   2fd04:	03d61021 	addu	v0,s8,s6
+   2fd08:	02e3b026 	xor	s6,s7,v1
+   2fd0c:	8fa30064 	lw	v1,100(sp)
+   2fd10:	00441021 	addu	v0,v0,a0
+   2fd14:	02c3b026 	xor	s6,s6,v1
+   2fd18:	0056b021 	addu	s6,v0,s6
+   2fd1c:	8fa40064 	lw	a0,100(sp)
+   2fd20:	00161ac0 	sll	v1,s6,0xb
+   2fd24:	0016b542 	srl	s6,s6,0x15
+   2fd28:	00761825 	or	v1,v1,s6
+   2fd2c:	00641821 	addu	v1,v1,a0
+   2fd30:	3c16d4ef 	lui	s6,0xd4ef
+   2fd34:	afa30060 	sw	v1,96(sp)
+   2fd38:	36d63085 	ori	s6,s6,0x3085
+   2fd3c:	01f61821 	addu	v1,t7,s6
+   2fd40:	8fa2005c 	lw	v0,92(sp)
+   2fd44:	0097b026 	xor	s6,a0,s7
+   2fd48:	8fa40060 	lw	a0,96(sp)
+   2fd4c:	00621821 	addu	v1,v1,v0
+   2fd50:	02c4b026 	xor	s6,s6,a0
+   2fd54:	00761021 	addu	v0,v1,s6
+   2fd58:	0002b400 	sll	s6,v0,0x10
+   2fd5c:	00021402 	srl	v0,v0,0x10
+   2fd60:	02c2b025 	or	s6,s6,v0
+   2fd64:	3c020488 	lui	v0,0x488
+   2fd68:	34421d05 	ori	v0,v0,0x1d05
+   2fd6c:	02c4b021 	addu	s6,s6,a0
+   2fd70:	8fa30064 	lw	v1,100(sp)
+   2fd74:	01422021 	addu	a0,t2,v0
+   2fd78:	8fa20060 	lw	v0,96(sp)
+   2fd7c:	0097b821 	addu	s7,a0,s7
+   2fd80:	00431026 	xor	v0,v0,v1
+   2fd84:	00561026 	xor	v0,v0,s6
+   2fd88:	02e2b821 	addu	s7,s7,v0
+   2fd8c:	001715c0 	sll	v0,s7,0x17
+   2fd90:	0017ba42 	srl	s7,s7,0x9
+   2fd94:	00571025 	or	v0,v0,s7
+   2fd98:	3c17d9d4 	lui	s7,0xd9d4
+   2fd9c:	00561021 	addu	v0,v0,s6
+   2fda0:	36f7d039 	ori	s7,s7,0xd039
+   2fda4:	afa2005c 	sw	v0,92(sp)
+   2fda8:	00b71021 	addu	v0,a1,s7
+   2fdac:	8fa40060 	lw	a0,96(sp)
+   2fdb0:	00431021 	addu	v0,v0,v1
+   2fdb4:	8fa3005c 	lw	v1,92(sp)
+   2fdb8:	02c4b826 	xor	s7,s6,a0
+   2fdbc:	02e3b826 	xor	s7,s7,v1
+   2fdc0:	0057b821 	addu	s7,v0,s7
+   2fdc4:	00172100 	sll	a0,s7,0x4
+   2fdc8:	0017bf02 	srl	s7,s7,0x1c
+   2fdcc:	00972025 	or	a0,a0,s7
+   2fdd0:	3c17e6db 	lui	s7,0xe6db
+   2fdd4:	36f799e5 	ori	s7,s7,0x99e5
+   2fdd8:	00832021 	addu	a0,a0,v1
+   2fddc:	03171021 	addu	v0,t8,s7
+   2fde0:	0076b826 	xor	s7,v1,s6
+   2fde4:	8fa30060 	lw	v1,96(sp)
+   2fde8:	02e4b826 	xor	s7,s7,a0
+   2fdec:	00431021 	addu	v0,v0,v1
+   2fdf0:	00571821 	addu	v1,v0,s7
+   2fdf4:	0003bac0 	sll	s7,v1,0xb
+   2fdf8:	00031d42 	srl	v1,v1,0x15
+   2fdfc:	02e3b825 	or	s7,s7,v1
+   2fe00:	3c031fa2 	lui	v1,0x1fa2
+   2fe04:	34637cf8 	ori	v1,v1,0x7cf8
+   2fe08:	01631821 	addu	v1,t3,v1
+   2fe0c:	afa30050 	sw	v1,80(sp)
+   2fe10:	8fa3005c 	lw	v1,92(sp)
+   2fe14:	02e4b821 	addu	s7,s7,a0
+   2fe18:	00831026 	xor	v0,a0,v1
+   2fe1c:	8fa30050 	lw	v1,80(sp)
+   2fe20:	0076b021 	addu	s6,v1,s6
+   2fe24:	00571826 	xor	v1,v0,s7
+   2fe28:	02c3b021 	addu	s6,s6,v1
+   2fe2c:	00161c00 	sll	v1,s6,0x10
+   2fe30:	0016b402 	srl	s6,s6,0x10
+   2fe34:	00761825 	or	v1,v1,s6
+   2fe38:	3c16c4ac 	lui	s6,0xc4ac
+   2fe3c:	36d65665 	ori	s6,s6,0x5665
+   2fe40:	00d6b021 	addu	s6,a2,s6
+   2fe44:	afb60050 	sw	s6,80(sp)
+   2fe48:	02e4b026 	xor	s6,s7,a0
+   2fe4c:	8fa20050 	lw	v0,80(sp)
+   2fe50:	afb60060 	sw	s6,96(sp)
+   2fe54:	8fb6005c 	lw	s6,92(sp)
+   2fe58:	00771821 	addu	v1,v1,s7
+   2fe5c:	00561021 	addu	v0,v0,s6
+   2fe60:	afa20050 	sw	v0,80(sp)
+   2fe64:	8fa20060 	lw	v0,96(sp)
+   2fe68:	0043b026 	xor	s6,v0,v1
+   2fe6c:	8fa20050 	lw	v0,80(sp)
+   2fe70:	0056b021 	addu	s6,v0,s6
+   2fe74:	001615c0 	sll	v0,s6,0x17
+   2fe78:	0016b242 	srl	s6,s6,0x9
+   2fe7c:	00561025 	or	v0,v0,s6
+   2fe80:	0017b027 	nor	s6,zero,s7
+   2fe84:	afb60050 	sw	s6,80(sp)
+   2fe88:	3c16f429 	lui	s6,0xf429
+   2fe8c:	36d62244 	ori	s6,s6,0x2244
+   2fe90:	03d6f021 	addu	s8,s8,s6
+   2fe94:	8fb60050 	lw	s6,80(sp)
+   2fe98:	00431021 	addu	v0,v0,v1
+   2fe9c:	0056b025 	or	s6,v0,s6
+   2fea0:	03c4f021 	addu	s8,s8,a0
+   2fea4:	afb60050 	sw	s6,80(sp)
+   2fea8:	02c3b026 	xor	s6,s6,v1
+   2feac:	03d6f021 	addu	s8,s8,s6
+   2feb0:	001e2180 	sll	a0,s8,0x6
+   2feb4:	001ef682 	srl	s8,s8,0x1a
+   2feb8:	009e2025 	or	a0,a0,s8
+   2febc:	3c1e432a 	lui	s8,0x432a
+   2fec0:	00822021 	addu	a0,a0,v0
+   2fec4:	0003b027 	nor	s6,zero,v1
+   2fec8:	37deff97 	ori	s8,s8,0xff97
+   2fecc:	02bea821 	addu	s5,s5,s8
+   2fed0:	0096b025 	or	s6,a0,s6
+   2fed4:	02c2b026 	xor	s6,s6,v0
+   2fed8:	02b7b821 	addu	s7,s5,s7
+   2fedc:	02f6b821 	addu	s7,s7,s6
+   2fee0:	0017aa80 	sll	s5,s7,0xa
+   2fee4:	0017bd82 	srl	s7,s7,0x16
+   2fee8:	02b7a825 	or	s5,s5,s7
+   2feec:	3c17ab94 	lui	s7,0xab94
+   2fef0:	02a4a821 	addu	s5,s5,a0
+   2fef4:	0002b027 	nor	s6,zero,v0
+   2fef8:	36f723a7 	ori	s7,s7,0x23a7
+   2fefc:	0297a021 	addu	s4,s4,s7
+   2ff00:	02b6b025 	or	s6,s5,s6
+   2ff04:	02c4b026 	xor	s6,s6,a0
+   2ff08:	02831821 	addu	v1,s4,v1
+   2ff0c:	0076a021 	addu	s4,v1,s6
+   2ff10:	00141bc0 	sll	v1,s4,0xf
+   2ff14:	0014a442 	srl	s4,s4,0x11
+   2ff18:	00741825 	or	v1,v1,s4
+   2ff1c:	3c16fc93 	lui	s6,0xfc93
+   2ff20:	00751821 	addu	v1,v1,s5
+   2ff24:	0004a027 	nor	s4,zero,a0
+   2ff28:	36d6a039 	ori	s6,s6,0xa039
+   2ff2c:	0336c821 	addu	t9,t9,s6
+   2ff30:	0074a025 	or	s4,v1,s4
+   2ff34:	0295a026 	xor	s4,s4,s5
+   2ff38:	03221021 	addu	v0,t9,v0
+   2ff3c:	0054c821 	addu	t9,v0,s4
+   2ff40:	00191540 	sll	v0,t9,0x15
+   2ff44:	0019cac2 	srl	t9,t9,0xb
+   2ff48:	00591025 	or	v0,v0,t9
+   2ff4c:	3c14655b 	lui	s4,0x655b
+   2ff50:	00431021 	addu	v0,v0,v1
+   2ff54:	0015c827 	nor	t9,zero,s5
+   2ff58:	369459c3 	ori	s4,s4,0x59c3
+   2ff5c:	0314c021 	addu	t8,t8,s4
+   2ff60:	0059c825 	or	t9,v0,t9
+   2ff64:	0323c826 	xor	t9,t9,v1
+   2ff68:	03042021 	addu	a0,t8,a0
+   2ff6c:	00992021 	addu	a0,a0,t9
+   2ff70:	0004c180 	sll	t8,a0,0x6
+   2ff74:	00042682 	srl	a0,a0,0x1a
+   2ff78:	0304c025 	or	t8,t8,a0
+   2ff7c:	3c198f0c 	lui	t9,0x8f0c
+   2ff80:	0302c021 	addu	t8,t8,v0
+   2ff84:	00032027 	nor	a0,zero,v1
+   2ff88:	3739cc92 	ori	t9,t9,0xcc92
+   2ff8c:	01f97821 	addu	t7,t7,t9
+   2ff90:	03042025 	or	a0,t8,a0
+   2ff94:	00822026 	xor	a0,a0,v0
+   2ff98:	01f5a821 	addu	s5,t7,s5
+   2ff9c:	02a4a821 	addu	s5,s5,a0
+   2ffa0:	00152280 	sll	a0,s5,0xa
+   2ffa4:	0015ad82 	srl	s5,s5,0x16
+   2ffa8:	00952025 	or	a0,a0,s5
+   2ffac:	3c19ffef 	lui	t9,0xffef
+   2ffb0:	00982021 	addu	a0,a0,t8
+   2ffb4:	00027827 	nor	t7,zero,v0
+   2ffb8:	3739f47d 	ori	t9,t9,0xf47d
+   2ffbc:	01d97021 	addu	t6,t6,t9
+   2ffc0:	008f7825 	or	t7,a0,t7
+   2ffc4:	01f87826 	xor	t7,t7,t8
+   2ffc8:	01c31821 	addu	v1,t6,v1
+   2ffcc:	006f7021 	addu	t6,v1,t7
+   2ffd0:	000e1bc0 	sll	v1,t6,0xf
+   2ffd4:	000e7442 	srl	t6,t6,0x11
+   2ffd8:	006e1825 	or	v1,v1,t6
+   2ffdc:	3c0f8584 	lui	t7,0x8584
+   2ffe0:	00641821 	addu	v1,v1,a0
+   2ffe4:	00187027 	nor	t6,zero,t8
+   2ffe8:	35ef5dd1 	ori	t7,t7,0x5dd1
+   2ffec:	01af6821 	addu	t5,t5,t7
+   2fff0:	006e7025 	or	t6,v1,t6
+   2fff4:	01c47026 	xor	t6,t6,a0
+   2fff8:	01a21021 	addu	v0,t5,v0
+   2fffc:	004e6821 	addu	t5,v0,t6
+   30000:	000d1540 	sll	v0,t5,0x15
+   30004:	000d6ac2 	srl	t5,t5,0xb
+   30008:	004d1025 	or	v0,v0,t5
+   3000c:	3c0e6fa8 	lui	t6,0x6fa8
+   30010:	00431021 	addu	v0,v0,v1
+   30014:	00046827 	nor	t5,zero,a0
+   30018:	35ce7e4f 	ori	t6,t6,0x7e4f
+   3001c:	018e6021 	addu	t4,t4,t6
+   30020:	004d6825 	or	t5,v0,t5
+   30024:	01a36826 	xor	t5,t5,v1
+   30028:	0198c021 	addu	t8,t4,t8
+   3002c:	030dc021 	addu	t8,t8,t5
+   30030:	00186180 	sll	t4,t8,0x6
+   30034:	0018c682 	srl	t8,t8,0x1a
+   30038:	01986025 	or	t4,t4,t8
+   3003c:	3c0efe2c 	lui	t6,0xfe2c
+   30040:	01826021 	addu	t4,t4,v0
+   30044:	00036827 	nor	t5,zero,v1
+   30048:	35cee6e0 	ori	t6,t6,0xe6e0
+   3004c:	016e5821 	addu	t3,t3,t6
+   30050:	018d6825 	or	t5,t4,t5
+   30054:	01a26826 	xor	t5,t5,v0
+   30058:	01642021 	addu	a0,t3,a0
+   3005c:	008d5821 	addu	t3,a0,t5
+   30060:	000b2280 	sll	a0,t3,0xa
+   30064:	000b5d82 	srl	t3,t3,0x16
+   30068:	008b2025 	or	a0,a0,t3
+   3006c:	3c0da301 	lui	t5,0xa301
+   30070:	008c2021 	addu	a0,a0,t4
+   30074:	00025827 	nor	t3,zero,v0
+   30078:	35ad4314 	ori	t5,t5,0x4314
+   3007c:	014d5021 	addu	t2,t2,t5
+   30080:	008b5825 	or	t3,a0,t3
+   30084:	016c5826 	xor	t3,t3,t4
+   30088:	01431821 	addu	v1,t2,v1
+   3008c:	006b5021 	addu	t2,v1,t3
+   30090:	000a1bc0 	sll	v1,t2,0xf
+   30094:	000a5442 	srl	t2,t2,0x11
+   30098:	006a1825 	or	v1,v1,t2
+   3009c:	3c0b4e08 	lui	t3,0x4e08
+   300a0:	00641821 	addu	v1,v1,a0
+   300a4:	000c5027 	nor	t2,zero,t4
+   300a8:	356b11a1 	ori	t3,t3,0x11a1
+   300ac:	012b4821 	addu	t1,t1,t3
+   300b0:	006a5025 	or	t2,v1,t2
+   300b4:	01445026 	xor	t2,t2,a0
+   300b8:	01221021 	addu	v0,t1,v0
+   300bc:	004a4821 	addu	t1,v0,t2
+   300c0:	00091540 	sll	v0,t1,0x15
+   300c4:	00094ac2 	srl	t1,t1,0xb
+   300c8:	00491025 	or	v0,v0,t1
+   300cc:	3c0af753 	lui	t2,0xf753
+   300d0:	00431021 	addu	v0,v0,v1
+   300d4:	00044827 	nor	t1,zero,a0
+   300d8:	354a7e82 	ori	t2,t2,0x7e82
+   300dc:	010a4021 	addu	t0,t0,t2
+   300e0:	00494825 	or	t1,v0,t1
+   300e4:	01234826 	xor	t1,t1,v1
+   300e8:	010c6021 	addu	t4,t0,t4
+   300ec:	01896021 	addu	t4,t4,t1
+   300f0:	000cb180 	sll	s6,t4,0x6
+   300f4:	000c6682 	srl	t4,t4,0x1a
+   300f8:	02ccb025 	or	s6,s6,t4
+   300fc:	3c09bd3a 	lui	t1,0xbd3a
+   30100:	02c2b021 	addu	s6,s6,v0
+   30104:	00034027 	nor	t0,zero,v1
+   30108:	3529f235 	ori	t1,t1,0xf235
+   3010c:	00e93821 	addu	a3,a3,t1
+   30110:	02c84025 	or	t0,s6,t0
+   30114:	00e42021 	addu	a0,a3,a0
+   30118:	01024026 	xor	t0,t0,v0
+   3011c:	00882021 	addu	a0,a0,t0
+   30120:	0004ba80 	sll	s7,a0,0xa
+   30124:	00042582 	srl	a0,a0,0x16
+   30128:	02e4b825 	or	s7,s7,a0
+   3012c:	3c072ad7 	lui	a3,0x2ad7
+   30130:	02f6b821 	addu	s7,s7,s6
+   30134:	00022027 	nor	a0,zero,v0
+   30138:	34e7d2bb 	ori	a3,a3,0xd2bb
+   3013c:	00c73021 	addu	a2,a2,a3
+   30140:	02e42025 	or	a0,s7,a0
+   30144:	00962026 	xor	a0,a0,s6
+   30148:	00c31821 	addu	v1,a2,v1
+   3014c:	00641821 	addu	v1,v1,a0
+   30150:	0003abc0 	sll	s5,v1,0xf
+   30154:	00031c42 	srl	v1,v1,0x11
+   30158:	8e440000 	lw	a0,0(s2)
+   3015c:	02a3a825 	or	s5,s5,v1
+   30160:	3c06eb86 	lui	a2,0xeb86
+   30164:	02b7a821 	addu	s5,s5,s7
+   30168:	00161827 	nor	v1,zero,s6
+   3016c:	34c6d391 	ori	a2,a2,0xd391
+   30170:	02a31825 	or	v1,s5,v1
+   30174:	00a62821 	addu	a1,a1,a2
+   30178:	02c4b021 	addu	s6,s6,a0
+   3017c:	ae560000 	sw	s6,0(s2)
+   30180:	00771826 	xor	v1,v1,s7
+   30184:	00a21021 	addu	v0,a1,v0
+   30188:	8e740000 	lw	s4,0(s3)
+   3018c:	00431021 	addu	v0,v0,v1
+   30190:	00021d40 	sll	v1,v0,0x15
+   30194:	000212c2 	srl	v0,v0,0xb
+   30198:	00621825 	or	v1,v1,v0
+   3019c:	02b4a021 	addu	s4,s5,s4
+   301a0:	0283a021 	addu	s4,s4,v1
+   301a4:	8fb80058 	lw	t8,88(sp)
+   301a8:	ae740000 	sw	s4,0(s3)
+   301ac:	8f020000 	lw	v0,0(t8)
+   301b0:	8fa30054 	lw	v1,84(sp)
+   301b4:	02a2a821 	addu	s5,s5,v0
+   301b8:	af150000 	sw	s5,0(t8)
+   301bc:	8c620000 	lw	v0,0(v1)
+   301c0:	02e2b821 	addu	s7,s7,v0
+   301c4:	1220000b 	beqz	s1,301f4 <MD5Init+0xf3c>
+   301c8:	ac770000 	sw	s7,0(v1)
+   301cc:	26100040 	addiu	s0,s0,64
+   301d0:	32020003 	andi	v0,s0,0x3
+   301d4:	1040fc61 	beqz	v0,2f35c <MD5Init+0xa4>
+   301d8:	27be0010 	addiu	s8,sp,16
+   301dc:	03c02021 	addu	a0,s8,zero
+   301e0:	02002821 	addu	a1,s0,zero
+   301e4:	0c00c12b 	jal	304ac <memcpy>
+   301e8:	24060040 	addiu	a2,zero,64
+   301ec:	0800bcd8 	j	2f360 <MD5Init+0xa8>
+   301f0:	03c02021 	addu	a0,s8,zero
+   301f4:	8fbf0094 	lw	ra,148(sp)
+   301f8:	8fbe0090 	lw	s8,144(sp)
+   301fc:	8fb7008c 	lw	s7,140(sp)
+   30200:	8fb60088 	lw	s6,136(sp)
+   30204:	8fb50084 	lw	s5,132(sp)
+   30208:	8fb40080 	lw	s4,128(sp)
+   3020c:	8fb3007c 	lw	s3,124(sp)
+   30210:	8fb20078 	lw	s2,120(sp)
+   30214:	8fb10074 	lw	s1,116(sp)
+   30218:	8fb00070 	lw	s0,112(sp)
+   3021c:	03e00008 	jr	ra
+   30220:	27bd0098 	addiu	sp,sp,152
+
+00030224 <MD5Update>:
+   30224:	27bdffd0 	addiu	sp,sp,-48
+   30228:	8c830010 	lw	v1,16(a0)
+   3022c:	afb00014 	sw	s0,20(sp)
+   30230:	00808021 	addu	s0,a0,zero
+   30234:	000620c0 	sll	a0,a2,0x3
+   30238:	00831021 	addu	v0,a0,v1
+   3023c:	0044202b 	sltu	a0,v0,a0
+   30240:	000318c2 	srl	v1,v1,0x3
+   30244:	afb30020 	sw	s3,32(sp)
+   30248:	afb10018 	sw	s1,24(sp)
+   3024c:	afbf002c 	sw	ra,44(sp)
+   30250:	afb50028 	sw	s5,40(sp)
+   30254:	afb40024 	sw	s4,36(sp)
+   30258:	afb2001c 	sw	s2,28(sp)
+   3025c:	00c08821 	addu	s1,a2,zero
+   30260:	00a09821 	addu	s3,a1,zero
+   30264:	3063003f 	andi	v1,v1,0x3f
+   30268:	14800017 	bnez	a0,302c8 <MD5Update+0xa4>
+   3026c:	ae020010 	sw	v0,16(s0)
+   30270:	8e020014 	lw	v0,20(s0)
+   30274:	24120040 	addiu	s2,zero,64
+   30278:	00112742 	srl	a0,s1,0x1d
+   3027c:	02439023 	subu	s2,s2,v1
+   30280:	00441021 	addu	v0,v0,a0
+   30284:	0232202b 	sltu	a0,s1,s2
+   30288:	10800019 	beqz	a0,302f0 <MD5Update+0xcc>
+   3028c:	ae020014 	sw	v0,20(s0)
+   30290:	26140018 	addiu	s4,s0,24
+   30294:	00002821 	addu	a1,zero,zero
+   30298:	02253023 	subu	a2,s1,a1
+   3029c:	02832021 	addu	a0,s4,v1
+   302a0:	02652821 	addu	a1,s3,a1
+   302a4:	8fbf002c 	lw	ra,44(sp)
+   302a8:	8fb50028 	lw	s5,40(sp)
+   302ac:	8fb40024 	lw	s4,36(sp)
+   302b0:	8fb30020 	lw	s3,32(sp)
+   302b4:	8fb2001c 	lw	s2,28(sp)
+   302b8:	8fb10018 	lw	s1,24(sp)
+   302bc:	8fb00014 	lw	s0,20(sp)
+   302c0:	0800c12b 	j	304ac <memcpy>
+   302c4:	27bd0030 	addiu	sp,sp,48
+   302c8:	8e020014 	lw	v0,20(s0)
+   302cc:	24120040 	addiu	s2,zero,64
+   302d0:	24420001 	addiu	v0,v0,1
+   302d4:	00112742 	srl	a0,s1,0x1d
+   302d8:	02439023 	subu	s2,s2,v1
+   302dc:	ae020014 	sw	v0,20(s0)
+   302e0:	00441021 	addu	v0,v0,a0
+   302e4:	0232202b 	sltu	a0,s1,s2
+   302e8:	1480ffe9 	bnez	a0,30290 <MD5Update+0x6c>
+   302ec:	ae020014 	sw	v0,20(s0)
+   302f0:	26140018 	addiu	s4,s0,24
+   302f4:	02832021 	addu	a0,s4,v1
+   302f8:	02403021 	addu	a2,s2,zero
+   302fc:	02602821 	addu	a1,s3,zero
+   30300:	0c00c12b 	jal	304ac <memcpy>
+   30304:	0232a823 	subu	s5,s1,s2
+   30308:	0015a982 	srl	s5,s5,0x6
+   3030c:	02002021 	addu	a0,s0,zero
+   30310:	02802821 	addu	a1,s4,zero
+   30314:	0c00bcbd 	jal	2f2f4 <MD5Init+0x3c>
+   30318:	24060001 	addiu	a2,zero,1
+   3031c:	02722821 	addu	a1,s3,s2
+   30320:	02002021 	addu	a0,s0,zero
+   30324:	02a03021 	addu	a2,s5,zero
+   30328:	0c00bcbd 	jal	2f2f4 <MD5Init+0x3c>
+   3032c:	0015a980 	sll	s5,s5,0x6
+   30330:	02b22821 	addu	a1,s5,s2
+   30334:	00001821 	addu	v1,zero,zero
+   30338:	02253023 	subu	a2,s1,a1
+   3033c:	02832021 	addu	a0,s4,v1
+   30340:	02652821 	addu	a1,s3,a1
+   30344:	8fbf002c 	lw	ra,44(sp)
+   30348:	8fb50028 	lw	s5,40(sp)
+   3034c:	8fb40024 	lw	s4,36(sp)
+   30350:	8fb30020 	lw	s3,32(sp)
+   30354:	8fb2001c 	lw	s2,28(sp)
+   30358:	8fb10018 	lw	s1,24(sp)
+   3035c:	8fb00014 	lw	s0,20(sp)
+   30360:	0800c12b 	j	304ac <memcpy>
+   30364:	27bd0030 	addiu	sp,sp,48
+
+00030368 <MD5Final>:
+   30368:	27bdffc8 	addiu	sp,sp,-56
+   3036c:	afb4002c 	sw	s4,44(sp)
+   30370:	8cb40010 	lw	s4,16(a1)
+   30374:	afb20024 	sw	s2,36(sp)
+   30378:	0014a0c2 	srl	s4,s4,0x3
+   3037c:	3294003f 	andi	s4,s4,0x3f
+   30380:	2a830038 	slti	v1,s4,56
+   30384:	27b20010 	addiu	s2,sp,16
+   30388:	afb10020 	sw	s1,32(sp)
+   3038c:	24020038 	addiu	v0,zero,56
+   30390:	24110078 	addiu	s1,zero,120
+   30394:	0043880b 	movn	s1,v0,v1
+   30398:	afb50030 	sw	s5,48(sp)
+   3039c:	afb30028 	sw	s3,40(sp)
+   303a0:	afb0001c 	sw	s0,28(sp)
+   303a4:	0080a821 	addu	s5,a0,zero
+   303a8:	00a08021 	addu	s0,a1,zero
+   303ac:	3c130004 	lui	s3,0x4
+   303b0:	02402021 	addu	a0,s2,zero
+   303b4:	24a50010 	addiu	a1,a1,16
+   303b8:	24060008 	addiu	a2,zero,8
+   303bc:	2402ff80 	addiu	v0,zero,-128
+   303c0:	afbf0034 	sw	ra,52(sp)
+   303c4:	0c00c12b 	jal	304ac <memcpy>
+   303c8:	a262c530 	sb	v0,-15056(s3)
+   303cc:	02343023 	subu	a2,s1,s4
+   303d0:	02002021 	addu	a0,s0,zero
+   303d4:	0c00c089 	jal	30224 <MD5Update>
+   303d8:	2665c530 	addiu	a1,s3,-15056
+   303dc:	02002021 	addu	a0,s0,zero
+   303e0:	02402821 	addu	a1,s2,zero
+   303e4:	0c00c089 	jal	30224 <MD5Update>
+   303e8:	24060008 	addiu	a2,zero,8
+   303ec:	02a02021 	addu	a0,s5,zero
+   303f0:	02002821 	addu	a1,s0,zero
+   303f4:	0c00c12b 	jal	304ac <memcpy>
+   303f8:	24060010 	addiu	a2,zero,16
+   303fc:	02002021 	addu	a0,s0,zero
+   30400:	00002821 	addu	a1,zero,zero
+   30404:	0c00c182 	jal	30608 <memset>
+   30408:	24060058 	addiu	a2,zero,88
+   3040c:	8fbf0034 	lw	ra,52(sp)
+   30410:	8fb50030 	lw	s5,48(sp)
+   30414:	8fb4002c 	lw	s4,44(sp)
+   30418:	8fb30028 	lw	s3,40(sp)
+   3041c:	8fb20024 	lw	s2,36(sp)
+   30420:	8fb10020 	lw	s1,32(sp)
+   30424:	8fb0001c 	lw	s0,28(sp)
+   30428:	03e00008 	jr	ra
+   3042c:	27bd0038 	addiu	sp,sp,56
+
+00030430 <do_memcpy_8>:
+   30430:	10c0001c 	beqz	a2,304a4 <do_memcpy_8+0x74>
+   30434:	00001021 	addu	v0,zero,zero
+   30438:	0800c112 	j	30448 <do_memcpy_8+0x18>
+   3043c:	8cad0004 	lw	t5,4(a1)
+   30440:	24840020 	addiu	a0,a0,32
+   30444:	8cad0004 	lw	t5,4(a1)
+   30448:	8cac0008 	lw	t4,8(a1)
+   3044c:	8cab000c 	lw	t3,12(a1)
+   30450:	8caa0010 	lw	t2,16(a1)
+   30454:	8ca90014 	lw	t1,20(a1)
+   30458:	8ca80018 	lw	t0,24(a1)
+   3045c:	8ca7001c 	lw	a3,28(a1)
+   30460:	8cae0000 	lw	t6,0(a1)
+   30464:	30430001 	andi	v1,v0,0x1
+   30468:	ac8e0000 	sw	t6,0(a0)
+   3046c:	ac8d0004 	sw	t5,4(a0)
+   30470:	ac8c0008 	sw	t4,8(a0)
+   30474:	ac8b000c 	sw	t3,12(a0)
+   30478:	ac8a0010 	sw	t2,16(a0)
+   3047c:	ac890014 	sw	t1,20(a0)
+   30480:	ac880018 	sw	t0,24(a0)
+   30484:	10600003 	beqz	v1,30494 <do_memcpy_8+0x64>
+   30488:	ac87001c 	sw	a3,28(a0)
+   3048c:	bcb10000 	cache	0x11,0(a1)
+   30490:	0000000f 	sync
+   30494:	24420001 	addiu	v0,v0,1
+   30498:	0046182b 	sltu	v1,v0,a2
+   3049c:	1460ffe8 	bnez	v1,30440 <do_memcpy_8+0x10>
+   304a0:	24a50020 	addiu	a1,a1,32
+   304a4:	03e00008 	jr	ra
+   304a8:	00000000 	sll	zero,zero,0x0
+
+000304ac <memcpy>:
+   304ac:	00a41825 	or	v1,a1,a0
+   304b0:	27bdffd8 	addiu	sp,sp,-40
+   304b4:	30630003 	andi	v1,v1,0x3
+   304b8:	afb1001c 	sw	s1,28(sp)
+   304bc:	afb00018 	sw	s0,24(sp)
+   304c0:	afbf0024 	sw	ra,36(sp)
+   304c4:	afb20020 	sw	s2,32(sp)
+   304c8:	00801021 	addu	v0,a0,zero
+   304cc:	00a08821 	addu	s1,a1,zero
+   304d0:	14600028 	bnez	v1,30574 <memcpy+0xc8>
+   304d4:	00c08021 	addu	s0,a2,zero
+   304d8:	00069142 	srl	s2,a2,0x5
+   304dc:	16400035 	bnez	s2,305b4 <memcpy+0x108>
+   304e0:	02403021 	addu	a2,s2,zero
+   304e4:	00129140 	sll	s2,s2,0x5
+   304e8:	02128023 	subu	s0,s0,s2
+   304ec:	1200001b 	beqz	s0,3055c <memcpy+0xb0>
+   304f0:	02328821 	addu	s1,s1,s2
+   304f4:	00101882 	srl	v1,s0,0x2
+   304f8:	1060000f 	beqz	v1,30538 <memcpy+0x8c>
+   304fc:	00521021 	addu	v0,v0,s2
+   30500:	02203021 	addu	a2,s1,zero
+   30504:	00402821 	addu	a1,v0,zero
+   30508:	00002021 	addu	a0,zero,zero
+   3050c:	8cc80000 	lw	t0,0(a2)
+   30510:	24840001 	addiu	a0,a0,1
+   30514:	0083382b 	sltu	a3,a0,v1
+   30518:	aca80000 	sw	t0,0(a1)
+   3051c:	24c60004 	addiu	a2,a2,4
+   30520:	14e0fffa 	bnez	a3,3050c <memcpy+0x60>
+   30524:	24a50004 	addiu	a1,a1,4
+   30528:	00031880 	sll	v1,v1,0x2
+   3052c:	0070202b 	sltu	a0,v1,s0
+   30530:	1080000b 	beqz	a0,30560 <memcpy+0xb4>
+   30534:	8fbf0024 	lw	ra,36(sp)
+   30538:	02238821 	addu	s1,s1,v1
+   3053c:	00432021 	addu	a0,v0,v1
+   30540:	92260000 	lbu	a2,0(s1)
+   30544:	24630001 	addiu	v1,v1,1
+   30548:	0070282b 	sltu	a1,v1,s0
+   3054c:	a0860000 	sb	a2,0(a0)
+   30550:	26310001 	addiu	s1,s1,1
+   30554:	14a0fffa 	bnez	a1,30540 <memcpy+0x94>
+   30558:	24840001 	addiu	a0,a0,1
+   3055c:	8fbf0024 	lw	ra,36(sp)
+   30560:	8fb20020 	lw	s2,32(sp)
+   30564:	8fb1001c 	lw	s1,28(sp)
+   30568:	8fb00018 	lw	s0,24(sp)
+   3056c:	03e00008 	jr	ra
+   30570:	27bd0028 	addiu	sp,sp,40
+   30574:	10c0fffa 	beqz	a2,30560 <memcpy+0xb4>
+   30578:	8fbf0024 	lw	ra,36(sp)
+   3057c:	00001821 	addu	v1,zero,zero
+   30580:	02232021 	addu	a0,s1,v1
+   30584:	90860000 	lbu	a2,0(a0)
+   30588:	00432821 	addu	a1,v0,v1
+   3058c:	24630001 	addiu	v1,v1,1
+   30590:	0070202b 	sltu	a0,v1,s0
+   30594:	1480fffa 	bnez	a0,30580 <memcpy+0xd4>
+   30598:	a0a60000 	sb	a2,0(a1)
+   3059c:	8fbf0024 	lw	ra,36(sp)
+   305a0:	8fb20020 	lw	s2,32(sp)
+   305a4:	8fb1001c 	lw	s1,28(sp)
+   305a8:	8fb00018 	lw	s0,24(sp)
+   305ac:	03e00008 	jr	ra
+   305b0:	27bd0028 	addiu	sp,sp,40
+   305b4:	0c00c10c 	jal	30430 <do_memcpy_8>
+   305b8:	afa40010 	sw	a0,16(sp)
+   305bc:	0800c139 	j	304e4 <memcpy+0x38>
+   305c0:	8fa20010 	lw	v0,16(sp)
+
+000305c4 <do_memset_8>:
+   305c4:	00063140 	sll	a2,a2,0x5
+   305c8:	00863021 	addu	a2,a0,a2
+   305cc:	1086000c 	beq	a0,a2,30600 <do_memset_8+0x3c>
+   305d0:	00000000 	sll	zero,zero,0x0
+   305d4:	ac850000 	sw	a1,0(a0)
+   305d8:	ac850004 	sw	a1,4(a0)
+   305dc:	ac850008 	sw	a1,8(a0)
+   305e0:	ac85000c 	sw	a1,12(a0)
+   305e4:	ac850010 	sw	a1,16(a0)
+   305e8:	ac850014 	sw	a1,20(a0)
+   305ec:	ac850018 	sw	a1,24(a0)
+   305f0:	ac85001c 	sw	a1,28(a0)
+   305f4:	24840020 	addiu	a0,a0,32
+   305f8:	1486fff6 	bne	a0,a2,305d4 <do_memset_8+0x10>
+   305fc:	00000000 	sll	zero,zero,0x0
+   30600:	03e00008 	jr	ra
+   30604:	00000000 	sll	zero,zero,0x0
+
+00030608 <memset>:
+   30608:	27bdffd0 	addiu	sp,sp,-48
+   3060c:	30830003 	andi	v1,a0,0x3
+   30610:	afb20020 	sw	s2,32(sp)
+   30614:	afb1001c 	sw	s1,28(sp)
+   30618:	afb00018 	sw	s0,24(sp)
+   3061c:	afbf002c 	sw	ra,44(sp)
+   30620:	afb40028 	sw	s4,40(sp)
+   30624:	afb30024 	sw	s3,36(sp)
+   30628:	00801021 	addu	v0,a0,zero
+   3062c:	00c08821 	addu	s1,a2,zero
+   30630:	30b200ff 	andi	s2,a1,0xff
+   30634:	1060000c 	beqz	v1,30668 <memset+0x60>
+   30638:	00808021 	addu	s0,a0,zero
+   3063c:	10c00028 	beqz	a2,306e0 <memset+0xd8>
+   30640:	8fbf002c 	lw	ra,44(sp)
+   30644:	0800c195 	j	30654 <memset+0x4c>
+   30648:	324400ff 	andi	a0,s2,0xff
+   3064c:	12200024 	beqz	s1,306e0 <memset+0xd8>
+   30650:	8fbf002c 	lw	ra,44(sp)
+   30654:	a2040000 	sb	a0,0(s0)
+   30658:	26100001 	addiu	s0,s0,1
+   3065c:	32030003 	andi	v1,s0,0x3
+   30660:	1460fffa 	bnez	v1,3064c <memset+0x44>
+   30664:	2631ffff 	addiu	s1,s1,-1
+   30668:	1220001c 	beqz	s1,306dc <memset+0xd4>
+   3066c:	00129c00 	sll	s3,s2,0x10
+   30670:	00121e00 	sll	v1,s2,0x18
+   30674:	02639825 	or	s3,s3,v1
+   30678:	00121a00 	sll	v1,s2,0x8
+   3067c:	02639825 	or	s3,s3,v1
+   30680:	0011a142 	srl	s4,s1,0x5
+   30684:	1680001d 	bnez	s4,306fc <memset+0xf4>
+   30688:	02729825 	or	s3,s3,s2
+   3068c:	00112882 	srl	a1,s1,0x2
+   30690:	10a0000b 	beqz	a1,306c0 <memset+0xb8>
+   30694:	02148021 	addu	s0,s0,s4
+   30698:	00a02021 	addu	a0,a1,zero
+   3069c:	02001821 	addu	v1,s0,zero
+   306a0:	2484ffff 	addiu	a0,a0,-1
+   306a4:	ac730000 	sw	s3,0(v1)
+   306a8:	1480fffd 	bnez	a0,306a0 <memset+0x98>
+   306ac:	24630004 	addiu	v1,v1,4
+   306b0:	00052880 	sll	a1,a1,0x2
+   306b4:	02258823 	subu	s1,s1,a1
+   306b8:	12200008 	beqz	s1,306dc <memset+0xd4>
+   306bc:	02058021 	addu	s0,s0,a1
+   306c0:	2631ffff 	addiu	s1,s1,-1
+   306c4:	325200ff 	andi	s2,s2,0xff
+   306c8:	2403ffff 	addiu	v1,zero,-1
+   306cc:	2631ffff 	addiu	s1,s1,-1
+   306d0:	a2120000 	sb	s2,0(s0)
+   306d4:	1623fffd 	bne	s1,v1,306cc <memset+0xc4>
+   306d8:	26100001 	addiu	s0,s0,1
+   306dc:	8fbf002c 	lw	ra,44(sp)
+   306e0:	8fb40028 	lw	s4,40(sp)
+   306e4:	8fb30024 	lw	s3,36(sp)
+   306e8:	8fb20020 	lw	s2,32(sp)
+   306ec:	8fb1001c 	lw	s1,28(sp)
+   306f0:	8fb00018 	lw	s0,24(sp)
+   306f4:	03e00008 	jr	ra
+   306f8:	27bd0030 	addiu	sp,sp,48
+   306fc:	02803021 	addu	a2,s4,zero
+   30700:	0014a140 	sll	s4,s4,0x5
+   30704:	02002021 	addu	a0,s0,zero
+   30708:	02602821 	addu	a1,s3,zero
+   3070c:	02348823 	subu	s1,s1,s4
+   30710:	0c00c171 	jal	305c4 <do_memset_8>
+   30714:	afa20010 	sw	v0,16(sp)
+   30718:	1620ffdc 	bnez	s1,3068c <memset+0x84>
+   3071c:	8fa20010 	lw	v0,16(sp)
+   30720:	8fbf002c 	lw	ra,44(sp)
+   30724:	8fb40028 	lw	s4,40(sp)
+   30728:	8fb30024 	lw	s3,36(sp)
+   3072c:	8fb20020 	lw	s2,32(sp)
+   30730:	8fb1001c 	lw	s1,28(sp)
+   30734:	8fb00018 	lw	s0,24(sp)
+   30738:	03e00008 	jr	ra
+   3073c:	27bd0030 	addiu	sp,sp,48
+
+00030740 <srand>:
+   30740:	40022002 	mfc0	v0,$4,2
+   30744:	8c430174 	lw	v1,372(v0)
+   30748:	3c020001 	lui	v0,0x1
+   3074c:	00621021 	addu	v0,v1,v0
+   30750:	03e00008 	jr	ra
+   30754:	ac448334 	sw	a0,-31948(v0)
+
+00030758 <rand>:
+   30758:	40022002 	mfc0	v0,$4,2
+   3075c:	8c430174 	lw	v1,372(v0)
+   30760:	40044800 	mfc0	a0,c0_count
+   30764:	00000000 	sll	zero,zero,0x0
+   30768:	3c020001 	lui	v0,0x1
+   3076c:	00621821 	addu	v1,v1,v0
+   30770:	8c668334 	lw	a2,-31948(v1)
+   30774:	8c62832c 	lw	v0,-31956(v1)
+   30778:	8c658330 	lw	a1,-31952(v1)
+   3077c:	70463802 	mul	a3,v0,a2
+   30780:	30840fff 	andi	a0,a0,0xfff
+   30784:	00e51021 	addu	v0,a3,a1
+   30788:	00821026 	xor	v0,a0,v0
+   3078c:	03e00008 	jr	ra
+   30790:	ac628334 	sw	v0,-31948(v1)
+   30794:	8c820004 	lw	v0,4(a0)
+   30798:	8c870000 	lw	a3,0(a0)
+   3079c:	8c430008 	lw	v1,8(v0)
+   307a0:	2406fffc 	addiu	a2,zero,-4
+   307a4:	00e63024 	and	a2,a3,a2
+   307a8:	10600005 	beqz	v1,307c0 <rand+0x68>
+   307ac:	ac830004 	sw	v1,4(a0)
+   307b0:	8c670000 	lw	a3,0(v1)
+   307b4:	30e70003 	andi	a3,a3,0x3
+   307b8:	00873825 	or	a3,a0,a3
+   307bc:	ac670000 	sw	a3,0(v1)
+   307c0:	8c430000 	lw	v1,0(v0)
+   307c4:	ac440008 	sw	a0,8(v0)
+   307c8:	30630003 	andi	v1,v1,0x3
+   307cc:	00661825 	or	v1,v1,a2
+   307d0:	10c0000a 	beqz	a2,307fc <rand+0xa4>
+   307d4:	ac430000 	sw	v1,0(v0)
+   307d8:	8cc30008 	lw	v1,8(a2)
+   307dc:	1064000d 	beq	v1,a0,30814 <rand+0xbc>
+   307e0:	00000000 	sll	zero,zero,0x0
+   307e4:	8c830000 	lw	v1,0(a0)
+   307e8:	acc20004 	sw	v0,4(a2)
+   307ec:	30630003 	andi	v1,v1,0x3
+   307f0:	00431025 	or	v0,v0,v1
+   307f4:	03e00008 	jr	ra
+   307f8:	ac820000 	sw	v0,0(a0)
+   307fc:	8c830000 	lw	v1,0(a0)
+   30800:	aca20000 	sw	v0,0(a1)
+   30804:	30630003 	andi	v1,v1,0x3
+   30808:	00431025 	or	v0,v0,v1
+   3080c:	03e00008 	jr	ra
+   30810:	ac820000 	sw	v0,0(a0)
+   30814:	8c830000 	lw	v1,0(a0)
+   30818:	acc20008 	sw	v0,8(a2)
+   3081c:	30630003 	andi	v1,v1,0x3
+   30820:	00431025 	or	v0,v0,v1
+   30824:	03e00008 	jr	ra
+   30828:	ac820000 	sw	v0,0(a0)
+   3082c:	8c820008 	lw	v0,8(a0)
+   30830:	8c870000 	lw	a3,0(a0)
+   30834:	8c430004 	lw	v1,4(v0)
+   30838:	2406fffc 	addiu	a2,zero,-4
+   3083c:	00e63024 	and	a2,a3,a2
+   30840:	10600005 	beqz	v1,30858 <rand+0x100>
+   30844:	ac830008 	sw	v1,8(a0)
+   30848:	8c670000 	lw	a3,0(v1)
+   3084c:	30e70003 	andi	a3,a3,0x3
+   30850:	00873825 	or	a3,a0,a3
+   30854:	ac670000 	sw	a3,0(v1)
+   30858:	8c430000 	lw	v1,0(v0)
+   3085c:	ac440004 	sw	a0,4(v0)
+   30860:	30630003 	andi	v1,v1,0x3
+   30864:	00661825 	or	v1,v1,a2
+   30868:	10c0000a 	beqz	a2,30894 <rand+0x13c>
+   3086c:	ac430000 	sw	v1,0(v0)
+   30870:	8cc30004 	lw	v1,4(a2)
+   30874:	1064000d 	beq	v1,a0,308ac <rand+0x154>
+   30878:	00000000 	sll	zero,zero,0x0
+   3087c:	8c830000 	lw	v1,0(a0)
+   30880:	acc20008 	sw	v0,8(a2)
+   30884:	30630003 	andi	v1,v1,0x3
+   30888:	00431025 	or	v0,v0,v1
+   3088c:	03e00008 	jr	ra
+   30890:	ac820000 	sw	v0,0(a0)
+   30894:	8c830000 	lw	v1,0(a0)
+   30898:	aca20000 	sw	v0,0(a1)
+   3089c:	30630003 	andi	v1,v1,0x3
+   308a0:	00431025 	or	v0,v0,v1
+   308a4:	03e00008 	jr	ra
+   308a8:	ac820000 	sw	v0,0(a0)
+   308ac:	8c830000 	lw	v1,0(a0)
+   308b0:	acc20004 	sw	v0,4(a2)
+   308b4:	30630003 	andi	v1,v1,0x3
+   308b8:	00431025 	or	v0,v0,v1
+   308bc:	03e00008 	jr	ra
+   308c0:	ac820000 	sw	v0,0(a0)
+
+000308c4 <rb_insert_color>:
+   308c4:	27bdffc8 	addiu	sp,sp,-56
+   308c8:	afb10018 	sw	s1,24(sp)
+   308cc:	8c910000 	lw	s1,0(a0)
+   308d0:	afb40024 	sw	s4,36(sp)
+   308d4:	2414fffc 	addiu	s4,zero,-4
+   308d8:	02348824 	and	s1,s1,s4
+   308dc:	afb70030 	sw	s7,48(sp)
+   308e0:	afb6002c 	sw	s6,44(sp)
+   308e4:	afb30020 	sw	s3,32(sp)
+   308e8:	afbf0034 	sw	ra,52(sp)
+   308ec:	afb50028 	sw	s5,40(sp)
+   308f0:	afb2001c 	sw	s2,28(sp)
+   308f4:	afb00014 	sw	s0,20(sp)
+   308f8:	00809821 	addu	s3,a0,zero
+   308fc:	00a0b821 	addu	s7,a1,zero
+   30900:	1220001a 	beqz	s1,3096c <rb_insert_color+0xa8>
+   30904:	2416fffe 	addiu	s6,zero,-2
+   30908:	8e220000 	lw	v0,0(s1)
+   3090c:	30430001 	andi	v1,v0,0x1
+   30910:	14600016 	bnez	v1,3096c <rb_insert_color+0xa8>
+   30914:	00549024 	and	s2,v0,s4
+   30918:	8e500008 	lw	s0,8(s2)
+   3091c:	12110032 	beq	s0,s1,309e8 <rb_insert_color+0x124>
+   30920:	00000000 	sll	zero,zero,0x0
+   30924:	12000020 	beqz	s0,309a8 <rb_insert_color+0xe4>
+   30928:	00000000 	sll	zero,zero,0x0
+   3092c:	8e030000 	lw	v1,0(s0)
+   30930:	30640001 	andi	a0,v1,0x1
+   30934:	1480001c 	bnez	a0,309a8 <rb_insert_color+0xe4>
+   30938:	34630001 	ori	v1,v1,0x1
+   3093c:	ae030000 	sw	v1,0(s0)
+   30940:	8e220000 	lw	v0,0(s1)
+   30944:	02408021 	addu	s0,s2,zero
+   30948:	34420001 	ori	v0,v0,0x1
+   3094c:	ae220000 	sw	v0,0(s1)
+   30950:	8e510000 	lw	s1,0(s2)
+   30954:	02009821 	addu	s3,s0,zero
+   30958:	02368824 	and	s1,s1,s6
+   3095c:	ae510000 	sw	s1,0(s2)
+   30960:	02348824 	and	s1,s1,s4
+   30964:	1620ffe8 	bnez	s1,30908 <rb_insert_color+0x44>
+   30968:	00000000 	sll	zero,zero,0x0
+   3096c:	8ee20000 	lw	v0,0(s7)
+   30970:	8fbf0034 	lw	ra,52(sp)
+   30974:	8c430000 	lw	v1,0(v0)
+   30978:	8fb70030 	lw	s7,48(sp)
+   3097c:	34630001 	ori	v1,v1,0x1
+   30980:	8fb6002c 	lw	s6,44(sp)
+   30984:	8fb50028 	lw	s5,40(sp)
+   30988:	8fb40024 	lw	s4,36(sp)
+   3098c:	8fb30020 	lw	s3,32(sp)
+   30990:	8fb2001c 	lw	s2,28(sp)
+   30994:	8fb10018 	lw	s1,24(sp)
+   30998:	8fb00014 	lw	s0,20(sp)
+   3099c:	ac430000 	sw	v1,0(v0)
+   309a0:	03e00008 	jr	ra
+   309a4:	27bd0038 	addiu	sp,sp,56
+   309a8:	8e350008 	lw	s5,8(s1)
+   309ac:	12b30030 	beq	s5,s3,30a70 <rb_insert_color+0x1ac>
+   309b0:	02202021 	addu	a0,s1,zero
+   309b4:	0220a821 	addu	s5,s1,zero
+   309b8:	02608021 	addu	s0,s3,zero
+   309bc:	34420001 	ori	v0,v0,0x1
+   309c0:	aea20000 	sw	v0,0(s5)
+   309c4:	8e420000 	lw	v0,0(s2)
+   309c8:	02402021 	addu	a0,s2,zero
+   309cc:	00561024 	and	v0,v0,s6
+   309d0:	ae420000 	sw	v0,0(s2)
+   309d4:	0c00c1e5 	jal	30794 <rand+0x3c>
+   309d8:	02e02821 	addu	a1,s7,zero
+   309dc:	02009821 	addu	s3,s0,zero
+   309e0:	0800c258 	j	30960 <rb_insert_color+0x9c>
+   309e4:	8e110000 	lw	s1,0(s0)
+   309e8:	8e420004 	lw	v0,4(s2)
+   309ec:	1040000f 	beqz	v0,30a2c <rb_insert_color+0x168>
+   309f0:	00000000 	sll	zero,zero,0x0
+   309f4:	8c430000 	lw	v1,0(v0)
+   309f8:	30640001 	andi	a0,v1,0x1
+   309fc:	1480000b 	bnez	a0,30a2c <rb_insert_color+0x168>
+   30a00:	34630001 	ori	v1,v1,0x1
+   30a04:	ac430000 	sw	v1,0(v0)
+   30a08:	8e020000 	lw	v0,0(s0)
+   30a0c:	34420001 	ori	v0,v0,0x1
+   30a10:	ae020000 	sw	v0,0(s0)
+   30a14:	8e510000 	lw	s1,0(s2)
+   30a18:	02408021 	addu	s0,s2,zero
+   30a1c:	02368824 	and	s1,s1,s6
+   30a20:	ae510000 	sw	s1,0(s2)
+   30a24:	0800c258 	j	30960 <rb_insert_color+0x9c>
+   30a28:	02009821 	addu	s3,s0,zero
+   30a2c:	8e110004 	lw	s1,4(s0)
+   30a30:	12330014 	beq	s1,s3,30a84 <rb_insert_color+0x1c0>
+   30a34:	02002021 	addu	a0,s0,zero
+   30a38:	02008821 	addu	s1,s0,zero
+   30a3c:	02608021 	addu	s0,s3,zero
+   30a40:	8e220000 	lw	v0,0(s1)
+   30a44:	02402021 	addu	a0,s2,zero
+   30a48:	34420001 	ori	v0,v0,0x1
+   30a4c:	ae220000 	sw	v0,0(s1)
+   30a50:	8e420000 	lw	v0,0(s2)
+   30a54:	02e02821 	addu	a1,s7,zero
+   30a58:	00561024 	and	v0,v0,s6
+   30a5c:	0c00c20b 	jal	3082c <rand+0xd4>
+   30a60:	ae420000 	sw	v0,0(s2)
+   30a64:	02009821 	addu	s3,s0,zero
+   30a68:	0800c258 	j	30960 <rb_insert_color+0x9c>
+   30a6c:	8e110000 	lw	s1,0(s0)
+   30a70:	0c00c20b 	jal	3082c <rand+0xd4>
+   30a74:	02e02821 	addu	a1,s7,zero
+   30a78:	02208021 	addu	s0,s1,zero
+   30a7c:	0800c26f 	j	309bc <rb_insert_color+0xf8>
+   30a80:	8e620000 	lw	v0,0(s3)
+   30a84:	0c00c1e5 	jal	30794 <rand+0x3c>
+   30a88:	02e02821 	addu	a1,s7,zero
+   30a8c:	0800c291 	j	30a44 <rb_insert_color+0x180>
+   30a90:	8e220000 	lw	v0,0(s1)
+
+00030a94 <rb_erase>:
+   30a94:	8c820008 	lw	v0,8(a0)
+   30a98:	27bdffd8 	addiu	sp,sp,-40
+   30a9c:	afb10018 	sw	s1,24(sp)
+   30aa0:	afbf0024 	sw	ra,36(sp)
+   30aa4:	afb30020 	sw	s3,32(sp)
+   30aa8:	afb2001c 	sw	s2,28(sp)
+   30aac:	afb00014 	sw	s0,20(sp)
+   30ab0:	1040009f 	beqz	v0,30d30 <rb_erase+0x29c>
+   30ab4:	00a08821 	addu	s1,a1,zero
+   30ab8:	8c830004 	lw	v1,4(a0)
+   30abc:	14600004 	bnez	v1,30ad0 <rb_erase+0x3c>
+   30ac0:	00000000 	sll	zero,zero,0x0
+   30ac4:	0800c35e 	j	30d78 <rb_erase+0x2e4>
+   30ac8:	8c860000 	lw	a2,0(a0)
+   30acc:	00401821 	addu	v1,v0,zero
+   30ad0:	8c620008 	lw	v0,8(v1)
+   30ad4:	1440fffd 	bnez	v0,30acc <rb_erase+0x38>
+   30ad8:	00000000 	sll	zero,zero,0x0
+   30adc:	8c850000 	lw	a1,0(a0)
+   30ae0:	2402fffc 	addiu	v0,zero,-4
+   30ae4:	00a21024 	and	v0,a1,v0
+   30ae8:	14400028 	bnez	v0,30b8c <rb_erase+0xf8>
+   30aec:	00000000 	sll	zero,zero,0x0
+   30af0:	ae230000 	sw	v1,0(s1)
+   30af4:	8c660000 	lw	a2,0(v1)
+   30af8:	2410fffc 	addiu	s0,zero,-4
+   30afc:	00d08024 	and	s0,a2,s0
+   30b00:	1090002a 	beq	a0,s0,30bac <rb_erase+0x118>
+   30b04:	8c620004 	lw	v0,4(v1)
+   30b08:	10400005 	beqz	v0,30b20 <rb_erase+0x8c>
+   30b0c:	00000000 	sll	zero,zero,0x0
+   30b10:	8c450000 	lw	a1,0(v0)
+   30b14:	30a50003 	andi	a1,a1,0x3
+   30b18:	00b02825 	or	a1,a1,s0
+   30b1c:	ac450000 	sw	a1,0(v0)
+   30b20:	8c850004 	lw	a1,4(a0)
+   30b24:	ae020008 	sw	v0,8(s0)
+   30b28:	ac650004 	sw	a1,4(v1)
+   30b2c:	8c850004 	lw	a1,4(a0)
+   30b30:	8ca70000 	lw	a3,0(a1)
+   30b34:	30e70003 	andi	a3,a3,0x3
+   30b38:	00673825 	or	a3,v1,a3
+   30b3c:	aca70000 	sw	a3,0(a1)
+   30b40:	8c850000 	lw	a1,0(a0)
+   30b44:	8c870008 	lw	a3,8(a0)
+   30b48:	ac650000 	sw	a1,0(v1)
+   30b4c:	ac670008 	sw	a3,8(v1)
+   30b50:	8c840008 	lw	a0,8(a0)
+   30b54:	30c60001 	andi	a2,a2,0x1
+   30b58:	8c850000 	lw	a1,0(a0)
+   30b5c:	30a50003 	andi	a1,a1,0x3
+   30b60:	00651825 	or	v1,v1,a1
+   30b64:	ac830000 	sw	v1,0(a0)
+   30b68:	14c00012 	bnez	a2,30bb4 <rb_erase+0x120>
+   30b6c:	2412fffe 	addiu	s2,zero,-2
+   30b70:	8fbf0024 	lw	ra,36(sp)
+   30b74:	8fb30020 	lw	s3,32(sp)
+   30b78:	8fb2001c 	lw	s2,28(sp)
+   30b7c:	8fb10018 	lw	s1,24(sp)
+   30b80:	8fb00014 	lw	s0,20(sp)
+   30b84:	03e00008 	jr	ra
+   30b88:	27bd0028 	addiu	sp,sp,40
+   30b8c:	8c460008 	lw	a2,8(v0)
+   30b90:	108600a9 	beq	a0,a2,30e38 <rb_erase+0x3a4>
+   30b94:	2410fffc 	addiu	s0,zero,-4
+   30b98:	8c660000 	lw	a2,0(v1)
+   30b9c:	ac430004 	sw	v1,4(v0)
+   30ba0:	00d08024 	and	s0,a2,s0
+   30ba4:	1490ffd8 	bne	a0,s0,30b08 <rb_erase+0x74>
+   30ba8:	8c620004 	lw	v0,4(v1)
+   30bac:	0800c2d1 	j	30b44 <rb_erase+0xb0>
+   30bb0:	00608021 	addu	s0,v1,zero
+   30bb4:	2413fffc 	addiu	s3,zero,-4
+   30bb8:	10400005 	beqz	v0,30bd0 <rb_erase+0x13c>
+   30bbc:	00000000 	sll	zero,zero,0x0
+   30bc0:	8c430000 	lw	v1,0(v0)
+   30bc4:	30640001 	andi	a0,v1,0x1
+   30bc8:	10800051 	beqz	a0,30d10 <rb_erase+0x27c>
+   30bcc:	8fbf0024 	lw	ra,36(sp)
+   30bd0:	8e230000 	lw	v1,0(s1)
+   30bd4:	1043004b 	beq	v0,v1,30d04 <rb_erase+0x270>
+   30bd8:	00000000 	sll	zero,zero,0x0
+   30bdc:	8e040008 	lw	a0,8(s0)
+   30be0:	10820024 	beq	a0,v0,30c74 <rb_erase+0x1e0>
+   30be4:	00000000 	sll	zero,zero,0x0
+   30be8:	8c820000 	lw	v0,0(a0)
+   30bec:	30430001 	andi	v1,v0,0x1
+   30bf0:	10600017 	beqz	v1,30c50 <rb_erase+0x1bc>
+   30bf4:	34420001 	ori	v0,v0,0x1
+   30bf8:	8c820008 	lw	v0,8(a0)
+   30bfc:	10400005 	beqz	v0,30c14 <rb_erase+0x180>
+   30c00:	00000000 	sll	zero,zero,0x0
+   30c04:	8c430000 	lw	v1,0(v0)
+   30c08:	30630001 	andi	v1,v1,0x1
+   30c0c:	10600078 	beqz	v1,30df0 <rb_erase+0x35c>
+   30c10:	00000000 	sll	zero,zero,0x0
+   30c14:	8c830004 	lw	v1,4(a0)
+   30c18:	10600005 	beqz	v1,30c30 <rb_erase+0x19c>
+   30c1c:	00000000 	sll	zero,zero,0x0
+   30c20:	8c650000 	lw	a1,0(v1)
+   30c24:	30a60001 	andi	a2,a1,0x1
+   30c28:	10c00061 	beqz	a2,30db0 <rb_erase+0x31c>
+   30c2c:	00000000 	sll	zero,zero,0x0
+   30c30:	8c820000 	lw	v0,0(a0)
+   30c34:	00521024 	and	v0,v0,s2
+   30c38:	ac820000 	sw	v0,0(a0)
+   30c3c:	8e030000 	lw	v1,0(s0)
+   30c40:	02001021 	addu	v0,s0,zero
+   30c44:	00731824 	and	v1,v1,s3
+   30c48:	0800c2ee 	j	30bb8 <rb_erase+0x124>
+   30c4c:	00608021 	addu	s0,v1,zero
+   30c50:	ac820000 	sw	v0,0(a0)
+   30c54:	8e020000 	lw	v0,0(s0)
+   30c58:	02002021 	addu	a0,s0,zero
+   30c5c:	00521024 	and	v0,v0,s2
+   30c60:	ae020000 	sw	v0,0(s0)
+   30c64:	0c00c20b 	jal	3082c <rand+0xd4>
+   30c68:	02202821 	addu	a1,s1,zero
+   30c6c:	0800c2fe 	j	30bf8 <rb_erase+0x164>
+   30c70:	8e040008 	lw	a0,8(s0)
+   30c74:	8e040004 	lw	a0,4(s0)
+   30c78:	8c820000 	lw	v0,0(a0)
+   30c7c:	30430001 	andi	v1,v0,0x1
+   30c80:	10600042 	beqz	v1,30d8c <rb_erase+0x2f8>
+   30c84:	34420001 	ori	v0,v0,0x1
+   30c88:	8c830008 	lw	v1,8(a0)
+   30c8c:	10600005 	beqz	v1,30ca4 <rb_erase+0x210>
+   30c90:	00000000 	sll	zero,zero,0x0
+   30c94:	8c650000 	lw	a1,0(v1)
+   30c98:	30a20001 	andi	v0,a1,0x1
+   30c9c:	1040006c 	beqz	v0,30e50 <rb_erase+0x3bc>
+   30ca0:	00000000 	sll	zero,zero,0x0
+   30ca4:	8c820004 	lw	v0,4(a0)
+   30ca8:	1040ffe1 	beqz	v0,30c30 <rb_erase+0x19c>
+   30cac:	00000000 	sll	zero,zero,0x0
+   30cb0:	8c430000 	lw	v1,0(v0)
+   30cb4:	30630001 	andi	v1,v1,0x1
+   30cb8:	1460ffdd 	bnez	v1,30c30 <rb_erase+0x19c>
+   30cbc:	00000000 	sll	zero,zero,0x0
+   30cc0:	8c860000 	lw	a2,0(a0)
+   30cc4:	8e030000 	lw	v1,0(s0)
+   30cc8:	2405fffe 	addiu	a1,zero,-2
+   30ccc:	00c52824 	and	a1,a2,a1
+   30cd0:	30630001 	andi	v1,v1,0x1
+   30cd4:	00651825 	or	v1,v1,a1
+   30cd8:	ac830000 	sw	v1,0(a0)
+   30cdc:	8e030000 	lw	v1,0(s0)
+   30ce0:	02002021 	addu	a0,s0,zero
+   30ce4:	34630001 	ori	v1,v1,0x1
+   30ce8:	ae030000 	sw	v1,0(s0)
+   30cec:	8c430000 	lw	v1,0(v0)
+   30cf0:	02202821 	addu	a1,s1,zero
+   30cf4:	34630001 	ori	v1,v1,0x1
+   30cf8:	0c00c1e5 	jal	30794 <rand+0x3c>
+   30cfc:	ac430000 	sw	v1,0(v0)
+   30d00:	8e220000 	lw	v0,0(s1)
+   30d04:	1040ff9a 	beqz	v0,30b70 <rb_erase+0xdc>
+   30d08:	8fbf0024 	lw	ra,36(sp)
+   30d0c:	8c430000 	lw	v1,0(v0)
+   30d10:	34630001 	ori	v1,v1,0x1
+   30d14:	8fb30020 	lw	s3,32(sp)
+   30d18:	8fb2001c 	lw	s2,28(sp)
+   30d1c:	8fb10018 	lw	s1,24(sp)
+   30d20:	8fb00014 	lw	s0,20(sp)
+   30d24:	ac430000 	sw	v1,0(v0)
+   30d28:	03e00008 	jr	ra
+   30d2c:	27bd0028 	addiu	sp,sp,40
+   30d30:	8c860000 	lw	a2,0(a0)
+   30d34:	2403fffc 	addiu	v1,zero,-4
+   30d38:	8c820004 	lw	v0,4(a0)
+   30d3c:	00c31824 	and	v1,a2,v1
+   30d40:	00608021 	addu	s0,v1,zero
+   30d44:	10400005 	beqz	v0,30d5c <rb_erase+0x2c8>
+   30d48:	30c60001 	andi	a2,a2,0x1
+   30d4c:	8c450000 	lw	a1,0(v0)
+   30d50:	30a50003 	andi	a1,a1,0x3
+   30d54:	00652825 	or	a1,v1,a1
+   30d58:	ac450000 	sw	a1,0(v0)
+   30d5c:	10600038 	beqz	v1,30e40 <rb_erase+0x3ac>
+   30d60:	00000000 	sll	zero,zero,0x0
+   30d64:	8c650008 	lw	a1,8(v1)
+   30d68:	10a40037 	beq	a1,a0,30e48 <rb_erase+0x3b4>
+   30d6c:	00000000 	sll	zero,zero,0x0
+   30d70:	0800c2da 	j	30b68 <rb_erase+0xd4>
+   30d74:	ac620004 	sw	v0,4(v1)
+   30d78:	2403fffc 	addiu	v1,zero,-4
+   30d7c:	00c31824 	and	v1,a2,v1
+   30d80:	00608021 	addu	s0,v1,zero
+   30d84:	0800c353 	j	30d4c <rb_erase+0x2b8>
+   30d88:	30c60001 	andi	a2,a2,0x1
+   30d8c:	ac820000 	sw	v0,0(a0)
+   30d90:	8e020000 	lw	v0,0(s0)
+   30d94:	02002021 	addu	a0,s0,zero
+   30d98:	00521024 	and	v0,v0,s2
+   30d9c:	ae020000 	sw	v0,0(s0)
+   30da0:	0c00c1e5 	jal	30794 <rand+0x3c>
+   30da4:	02202821 	addu	a1,s1,zero
+   30da8:	0800c322 	j	30c88 <rb_erase+0x1f4>
+   30dac:	8e040004 	lw	a0,4(s0)
+   30db0:	10400005 	beqz	v0,30dc8 <rb_erase+0x334>
+   30db4:	00000000 	sll	zero,zero,0x0
+   30db8:	8c460000 	lw	a2,0(v0)
+   30dbc:	30c60001 	andi	a2,a2,0x1
+   30dc0:	10c0000b 	beqz	a2,30df0 <rb_erase+0x35c>
+   30dc4:	00000000 	sll	zero,zero,0x0
+   30dc8:	34a50001 	ori	a1,a1,0x1
+   30dcc:	ac650000 	sw	a1,0(v1)
+   30dd0:	8c830000 	lw	v1,0(a0)
+   30dd4:	2402fffe 	addiu	v0,zero,-2
+   30dd8:	00621024 	and	v0,v1,v0
+   30ddc:	ac820000 	sw	v0,0(a0)
+   30de0:	0c00c1e5 	jal	30794 <rand+0x3c>
+   30de4:	02202821 	addu	a1,s1,zero
+   30de8:	8e040008 	lw	a0,8(s0)
+   30dec:	8c820008 	lw	v0,8(a0)
+   30df0:	8c860000 	lw	a2,0(a0)
+   30df4:	8e030000 	lw	v1,0(s0)
+   30df8:	2405fffe 	addiu	a1,zero,-2
+   30dfc:	00c52824 	and	a1,a2,a1
+   30e00:	30630001 	andi	v1,v1,0x1
+   30e04:	00651825 	or	v1,v1,a1
+   30e08:	ac830000 	sw	v1,0(a0)
+   30e0c:	8e030000 	lw	v1,0(s0)
+   30e10:	02002021 	addu	a0,s0,zero
+   30e14:	34630001 	ori	v1,v1,0x1
+   30e18:	ae030000 	sw	v1,0(s0)
+   30e1c:	8c430000 	lw	v1,0(v0)
+   30e20:	02202821 	addu	a1,s1,zero
+   30e24:	34630001 	ori	v1,v1,0x1
+   30e28:	0c00c20b 	jal	3082c <rand+0xd4>
+   30e2c:	ac430000 	sw	v1,0(v0)
+   30e30:	0800c341 	j	30d04 <rb_erase+0x270>
+   30e34:	8e220000 	lw	v0,0(s1)
+   30e38:	0800c2bd 	j	30af4 <rb_erase+0x60>
+   30e3c:	ac430008 	sw	v1,8(v0)
+   30e40:	0800c2da 	j	30b68 <rb_erase+0xd4>
+   30e44:	ae220000 	sw	v0,0(s1)
+   30e48:	0800c2da 	j	30b68 <rb_erase+0xd4>
+   30e4c:	ac620008 	sw	v0,8(v1)
+   30e50:	8c820004 	lw	v0,4(a0)
+   30e54:	10400005 	beqz	v0,30e6c <rb_erase+0x3d8>
+   30e58:	00000000 	sll	zero,zero,0x0
+   30e5c:	8c460000 	lw	a2,0(v0)
+   30e60:	30c60001 	andi	a2,a2,0x1
+   30e64:	10c0ff96 	beqz	a2,30cc0 <rb_erase+0x22c>
+   30e68:	00000000 	sll	zero,zero,0x0
+   30e6c:	34a50001 	ori	a1,a1,0x1
+   30e70:	ac650000 	sw	a1,0(v1)
+   30e74:	8c830000 	lw	v1,0(a0)
+   30e78:	2402fffe 	addiu	v0,zero,-2
+   30e7c:	00621024 	and	v0,v1,v0
+   30e80:	ac820000 	sw	v0,0(a0)
+   30e84:	0c00c20b 	jal	3082c <rand+0xd4>
+   30e88:	02202821 	addu	a1,s1,zero
+   30e8c:	8e040004 	lw	a0,4(s0)
+   30e90:	0800c330 	j	30cc0 <rb_erase+0x22c>
+   30e94:	8c820004 	lw	v0,4(a0)
+
+00030e98 <rb_first>:
+   30e98:	8c820000 	lw	v0,0(a0)
+   30e9c:	14400004 	bnez	v0,30eb0 <rb_first+0x18>
+   30ea0:	00000000 	sll	zero,zero,0x0
+   30ea4:	0800c3af 	j	30ebc <rb_first+0x24>
+   30ea8:	00000000 	sll	zero,zero,0x0
+   30eac:	00601021 	addu	v0,v1,zero
+   30eb0:	8c430008 	lw	v1,8(v0)
+   30eb4:	1460fffd 	bnez	v1,30eac <rb_first+0x14>
+   30eb8:	00000000 	sll	zero,zero,0x0
+   30ebc:	03e00008 	jr	ra
+   30ec0:	00000000 	sll	zero,zero,0x0
+
+00030ec4 <rb_last>:
+   30ec4:	8c820000 	lw	v0,0(a0)
+   30ec8:	14400004 	bnez	v0,30edc <rb_last+0x18>
+   30ecc:	00000000 	sll	zero,zero,0x0
+   30ed0:	0800c3ba 	j	30ee8 <rb_last+0x24>
+   30ed4:	00000000 	sll	zero,zero,0x0
+   30ed8:	00601021 	addu	v0,v1,zero
+   30edc:	8c430004 	lw	v1,4(v0)
+   30ee0:	1460fffd 	bnez	v1,30ed8 <rb_last+0x14>
+   30ee4:	00000000 	sll	zero,zero,0x0
+   30ee8:	03e00008 	jr	ra
+   30eec:	00000000 	sll	zero,zero,0x0
+
+00030ef0 <rb_next>:
+   30ef0:	8c830000 	lw	v1,0(a0)
+   30ef4:	2402fffc 	addiu	v0,zero,-4
+   30ef8:	00621024 	and	v0,v1,v0
+   30efc:	10820015 	beq	a0,v0,30f54 <rb_next+0x64>
+   30f00:	00000000 	sll	zero,zero,0x0
+   30f04:	8c820004 	lw	v0,4(a0)
+   30f08:	14400004 	bnez	v0,30f1c <rb_next+0x2c>
+   30f0c:	2406fffc 	addiu	a2,zero,-4
+   30f10:	0800c3ce 	j	30f38 <rb_next+0x48>
+   30f14:	00661824 	and	v1,v1,a2
+   30f18:	00601021 	addu	v0,v1,zero
+   30f1c:	8c430008 	lw	v1,8(v0)
+   30f20:	1460fffd 	bnez	v1,30f18 <rb_next+0x28>
+   30f24:	00000000 	sll	zero,zero,0x0
+   30f28:	03e00008 	jr	ra
+   30f2c:	00000000 	sll	zero,zero,0x0
+   30f30:	8c630000 	lw	v1,0(v1)
+   30f34:	00661824 	and	v1,v1,a2
+   30f38:	1060fffb 	beqz	v1,30f28 <rb_next+0x38>
+   30f3c:	00000000 	sll	zero,zero,0x0
+   30f40:	8c650004 	lw	a1,4(v1)
+   30f44:	10a4fffa 	beq	a1,a0,30f30 <rb_next+0x40>
+   30f48:	00602021 	addu	a0,v1,zero
+   30f4c:	03e00008 	jr	ra
+   30f50:	00601021 	addu	v0,v1,zero
+   30f54:	03e00008 	jr	ra
+   30f58:	00001021 	addu	v0,zero,zero
+
+00030f5c <rb_prev>:
+   30f5c:	8c830000 	lw	v1,0(a0)
+   30f60:	2402fffc 	addiu	v0,zero,-4
+   30f64:	00621024 	and	v0,v1,v0
+   30f68:	10820015 	beq	a0,v0,30fc0 <rb_prev+0x64>
+   30f6c:	00000000 	sll	zero,zero,0x0
+   30f70:	8c820008 	lw	v0,8(a0)
+   30f74:	14400004 	bnez	v0,30f88 <rb_prev+0x2c>
+   30f78:	2406fffc 	addiu	a2,zero,-4
+   30f7c:	0800c3e9 	j	30fa4 <rb_prev+0x48>
+   30f80:	00661824 	and	v1,v1,a2
+   30f84:	00601021 	addu	v0,v1,zero
+   30f88:	8c430004 	lw	v1,4(v0)
+   30f8c:	1460fffd 	bnez	v1,30f84 <rb_prev+0x28>
+   30f90:	00000000 	sll	zero,zero,0x0
+   30f94:	03e00008 	jr	ra
+   30f98:	00000000 	sll	zero,zero,0x0
+   30f9c:	8c630000 	lw	v1,0(v1)
+   30fa0:	00661824 	and	v1,v1,a2
+   30fa4:	1060fffb 	beqz	v1,30f94 <rb_prev+0x38>
+   30fa8:	00000000 	sll	zero,zero,0x0
+   30fac:	8c650008 	lw	a1,8(v1)
+   30fb0:	10a4fffa 	beq	a1,a0,30f9c <rb_prev+0x40>
+   30fb4:	00602021 	addu	a0,v1,zero
+   30fb8:	03e00008 	jr	ra
+   30fbc:	00601021 	addu	v0,v1,zero
+   30fc0:	03e00008 	jr	ra
+   30fc4:	00001021 	addu	v0,zero,zero
+
+00030fc8 <rb_replace_node>:
+   30fc8:	8c830000 	lw	v1,0(a0)
+   30fcc:	2402fffc 	addiu	v0,zero,-4
+   30fd0:	00621024 	and	v0,v1,v0
+   30fd4:	1040001a 	beqz	v0,31040 <rb_replace_node+0x78>
+   30fd8:	00000000 	sll	zero,zero,0x0
+   30fdc:	8c430008 	lw	v1,8(v0)
+   30fe0:	10640019 	beq	v1,a0,31048 <rb_replace_node+0x80>
+   30fe4:	00000000 	sll	zero,zero,0x0
+   30fe8:	ac450004 	sw	a1,4(v0)
+   30fec:	8c820008 	lw	v0,8(a0)
+   30ff0:	10400005 	beqz	v0,31008 <rb_replace_node+0x40>
+   30ff4:	00000000 	sll	zero,zero,0x0
+   30ff8:	8c430000 	lw	v1,0(v0)
+   30ffc:	30630003 	andi	v1,v1,0x3
+   31000:	00a31825 	or	v1,a1,v1
+   31004:	ac430000 	sw	v1,0(v0)
+   31008:	8c820004 	lw	v0,4(a0)
+   3100c:	10400005 	beqz	v0,31024 <rb_replace_node+0x5c>
+   31010:	00000000 	sll	zero,zero,0x0
+   31014:	8c430000 	lw	v1,0(v0)
+   31018:	30630003 	andi	v1,v1,0x3
+   3101c:	00a31825 	or	v1,a1,v1
+   31020:	ac430000 	sw	v1,0(v0)
+   31024:	8c860008 	lw	a2,8(a0)
+   31028:	8c830000 	lw	v1,0(a0)
+   3102c:	8c820004 	lw	v0,4(a0)
+   31030:	aca60008 	sw	a2,8(a1)
+   31034:	aca30000 	sw	v1,0(a1)
+   31038:	03e00008 	jr	ra
+   3103c:	aca20004 	sw	v0,4(a1)
+   31040:	0800c3fb 	j	30fec <rb_replace_node+0x24>
+   31044:	acc50000 	sw	a1,0(a2)
+   31048:	0800c3fb 	j	30fec <rb_replace_node+0x24>
+   3104c:	ac450008 	sw	a1,8(v0)
+
+00031050 <sprintk>:
+   31050:	27bdffd8 	addiu	sp,sp,-40
+   31054:	3c020004 	lui	v0,0x4
+   31058:	afbf0024 	sw	ra,36(sp)
+   3105c:	afb00020 	sw	s0,32(sp)
+   31060:	2443c960 	addiu	v1,v0,-13984
+   31064:	88630003 	lwl	v1,3(v1)
+   31068:	00a04021 	addu	t0,a1,zero
+   3106c:	9843c960 	lwr	v1,-13984(v0)
+   31070:	afa60030 	sw	a2,48(sp)
+   31074:	27a20030 	addiu	v0,sp,48
+   31078:	afa70034 	sw	a3,52(sp)
+   3107c:	3065ffff 	andi	a1,v1,0xffff
+   31080:	01003821 	addu	a3,t0,zero
+   31084:	24060001 	addiu	a2,zero,1
+   31088:	afa20010 	sw	v0,16(sp)
+   3108c:	afa20018 	sw	v0,24(sp)
+   31090:	0c00bbbe 	jal	2eef8 <iprintk>
+   31094:	00808021 	addu	s0,a0,zero
+   31098:	02028021 	addu	s0,s0,v0
+   3109c:	a2000000 	sb	zero,0(s0)
+   310a0:	8fbf0024 	lw	ra,36(sp)
+   310a4:	8fb00020 	lw	s0,32(sp)
+   310a8:	03e00008 	jr	ra
+   310ac:	27bd0028 	addiu	sp,sp,40
+
+000310b0 <strchr>:
+   310b0:	10800012 	beqz	a0,310fc <strchr+0x4c>
+   310b4:	00801021 	addu	v0,a0,zero
+   310b8:	80830000 	lb	v1,0(a0)
+   310bc:	10600011 	beqz	v1,31104 <strchr+0x54>
+   310c0:	00000000 	sll	zero,zero,0x0
+   310c4:	00052e00 	sll	a1,a1,0x18
+   310c8:	00052e03 	sra	a1,a1,0x18
+   310cc:	14650006 	bne	v1,a1,310e8 <strchr+0x38>
+   310d0:	24420001 	addiu	v0,v0,1
+   310d4:	03e00008 	jr	ra
+   310d8:	2442ffff 	addiu	v0,v0,-1
+   310dc:	10650007 	beq	v1,a1,310fc <strchr+0x4c>
+   310e0:	00000000 	sll	zero,zero,0x0
+   310e4:	24420001 	addiu	v0,v0,1
+   310e8:	80430000 	lb	v1,0(v0)
+   310ec:	1460fffb 	bnez	v1,310dc <strchr+0x2c>
+   310f0:	00000000 	sll	zero,zero,0x0
+   310f4:	03e00008 	jr	ra
+   310f8:	0005100b 	movn	v0,zero,a1
+   310fc:	03e00008 	jr	ra
+   31100:	00000000 	sll	zero,zero,0x0
+   31104:	00052e00 	sll	a1,a1,0x18
+   31108:	00052e03 	sra	a1,a1,0x18
+   3110c:	03e00008 	jr	ra
+   31110:	0005100b 	movn	v0,zero,a1
+
+00031114 <strcmp>:
+   31114:	10800013 	beqz	a0,31164 <strcmp+0x50>
+   31118:	00000000 	sll	zero,zero,0x0
+   3111c:	10a00011 	beqz	a1,31164 <strcmp+0x50>
+   31120:	00000000 	sll	zero,zero,0x0
+   31124:	80830000 	lb	v1,0(a0)
+   31128:	14600006 	bnez	v1,31144 <strcmp+0x30>
+   3112c:	00000000 	sll	zero,zero,0x0
+   31130:	0800c457 	j	3115c <strcmp+0x48>
+   31134:	80a20000 	lb	v0,0(a1)
+   31138:	80830000 	lb	v1,0(a0)
+   3113c:	10600006 	beqz	v1,31158 <strcmp+0x44>
+   31140:	24a50001 	addiu	a1,a1,1
+   31144:	80a20000 	lb	v0,0(a1)
+   31148:	1062fffb 	beq	v1,v0,31138 <strcmp+0x24>
+   3114c:	24840001 	addiu	a0,a0,1
+   31150:	03e00008 	jr	ra
+   31154:	00621023 	subu	v0,v1,v0
+   31158:	80a20000 	lb	v0,0(a1)
+   3115c:	03e00008 	jr	ra
+   31160:	00621023 	subu	v0,v1,v0
+   31164:	03e00008 	jr	ra
+   31168:	00851023 	subu	v0,a0,a1
+
+0003116c <strncmp>:
+   3116c:	1080001f 	beqz	a0,311ec <strncmp+0x80>
+   31170:	00000000 	sll	zero,zero,0x0
+   31174:	10a0001d 	beqz	a1,311ec <strncmp+0x80>
+   31178:	00000000 	sll	zero,zero,0x0
+   3117c:	10c0001b 	beqz	a2,311ec <strncmp+0x80>
+   31180:	00000000 	sll	zero,zero,0x0
+   31184:	80820000 	lb	v0,0(a0)
+   31188:	10400014 	beqz	v0,311dc <strncmp+0x70>
+   3118c:	00000000 	sll	zero,zero,0x0
+   31190:	80a30000 	lb	v1,0(a1)
+   31194:	14430017 	bne	v0,v1,311f4 <strncmp+0x88>
+   31198:	00000000 	sll	zero,zero,0x0
+   3119c:	2cc30002 	sltiu	v1,a2,2
+   311a0:	10600009 	beqz	v1,311c8 <strncmp+0x5c>
+   311a4:	24840001 	addiu	a0,a0,1
+   311a8:	2484ffff 	addiu	a0,a0,-1
+   311ac:	0800c482 	j	31208 <strncmp+0x9c>
+   311b0:	00402021 	addu	a0,v0,zero
+   311b4:	80a30000 	lb	v1,0(a1)
+   311b8:	1443000e 	bne	v0,v1,311f4 <strncmp+0x88>
+   311bc:	00000000 	sll	zero,zero,0x0
+   311c0:	14e00010 	bnez	a3,31204 <strncmp+0x98>
+   311c4:	24840001 	addiu	a0,a0,1
+   311c8:	80820000 	lb	v0,0(a0)
+   311cc:	24c6ffff 	addiu	a2,a2,-1
+   311d0:	2cc70002 	sltiu	a3,a2,2
+   311d4:	1440fff7 	bnez	v0,311b4 <strncmp+0x48>
+   311d8:	24a50001 	addiu	a1,a1,1
+   311dc:	80a20000 	lb	v0,0(a1)
+   311e0:	00002021 	addu	a0,zero,zero
+   311e4:	03e00008 	jr	ra
+   311e8:	00821023 	subu	v0,a0,v0
+   311ec:	03e00008 	jr	ra
+   311f0:	00851023 	subu	v0,a0,a1
+   311f4:	00402021 	addu	a0,v0,zero
+   311f8:	00601021 	addu	v0,v1,zero
+   311fc:	03e00008 	jr	ra
+   31200:	00821023 	subu	v0,a0,v0
+   31204:	00402021 	addu	a0,v0,zero
+   31208:	03e00008 	jr	ra
+   3120c:	00821023 	subu	v0,a0,v0
+
+00031210 <strcasecmp>:
+   31210:	27bdffe0 	addiu	sp,sp,-32
+   31214:	afb10014 	sw	s1,20(sp)
+   31218:	afb00010 	sw	s0,16(sp)
+   3121c:	afbf001c 	sw	ra,28(sp)
+   31220:	afb20018 	sw	s2,24(sp)
+   31224:	00808021 	addu	s0,a0,zero
+   31228:	10800017 	beqz	a0,31288 <strcasecmp+0x78>
+   3122c:	00a08821 	addu	s1,a1,zero
+   31230:	10a00016 	beqz	a1,3128c <strcasecmp+0x7c>
+   31234:	8fbf001c 	lw	ra,28(sp)
+   31238:	26100001 	addiu	s0,s0,1
+   3123c:	82040000 	lb	a0,0(s0)
+   31240:	0c00b964 	jal	2e590 <toupper>
+   31244:	26310001 	addiu	s1,s1,1
+   31248:	82240000 	lb	a0,0(s1)
+   3124c:	0c00b964 	jal	2e590 <toupper>
+   31250:	00029600 	sll	s2,v0,0x18
+   31254:	00021600 	sll	v0,v0,0x18
+   31258:	00129603 	sra	s2,s2,0x18
+   3125c:	12400003 	beqz	s2,3126c <strcasecmp+0x5c>
+   31260:	00021603 	sra	v0,v0,0x18
+   31264:	1242fff5 	beq	s2,v0,3123c <strcasecmp+0x2c>
+   31268:	26100001 	addiu	s0,s0,1
+   3126c:	8fbf001c 	lw	ra,28(sp)
+   31270:	02421023 	subu	v0,s2,v0
+   31274:	8fb20018 	lw	s2,24(sp)
+   31278:	8fb10014 	lw	s1,20(sp)
+   3127c:	8fb00010 	lw	s0,16(sp)
+   31280:	03e00008 	jr	ra
+   31284:	27bd0020 	addiu	sp,sp,32
+   31288:	8fbf001c 	lw	ra,28(sp)
+   3128c:	02111023 	subu	v0,s0,s1
+   31290:	8fb20018 	lw	s2,24(sp)
+   31294:	8fb10014 	lw	s1,20(sp)
+   31298:	8fb00010 	lw	s0,16(sp)
+   3129c:	03e00008 	jr	ra
+   312a0:	27bd0020 	addiu	sp,sp,32
+
+000312a4 <strcpy>:
+   312a4:	1080000c 	beqz	a0,312d8 <strcpy+0x34>
+   312a8:	00801021 	addu	v0,a0,zero
+   312ac:	10a0000a 	beqz	a1,312d8 <strcpy+0x34>
+   312b0:	00000000 	sll	zero,zero,0x0
+   312b4:	80a30000 	lb	v1,0(a1)
+   312b8:	10600006 	beqz	v1,312d4 <strcpy+0x30>
+   312bc:	00000000 	sll	zero,zero,0x0
+   312c0:	a0830000 	sb	v1,0(a0)
+   312c4:	24a50001 	addiu	a1,a1,1
+   312c8:	80a30000 	lb	v1,0(a1)
+   312cc:	1460fffc 	bnez	v1,312c0 <strcpy+0x1c>
+   312d0:	24840001 	addiu	a0,a0,1
+   312d4:	a0800000 	sb	zero,0(a0)
+   312d8:	03e00008 	jr	ra
+   312dc:	00000000 	sll	zero,zero,0x0
+
+000312e0 <strncpy>:
+   312e0:	10c0000e 	beqz	a2,3131c <strncpy+0x3c>
+   312e4:	00801021 	addu	v0,a0,zero
+   312e8:	80a40000 	lb	a0,0(a1)
+   312ec:	1080000d 	beqz	a0,31324 <strncpy+0x44>
+   312f0:	00001821 	addu	v1,zero,zero
+   312f4:	0800c4c2 	j	31308 <strncpy+0x28>
+   312f8:	00434021 	addu	t0,v0,v1
+   312fc:	81240000 	lb	a0,0(t1)
+   31300:	10800008 	beqz	a0,31324 <strncpy+0x44>
+   31304:	00434021 	addu	t0,v0,v1
+   31308:	24630001 	addiu	v1,v1,1
+   3130c:	0066382b 	sltu	a3,v1,a2
+   31310:	00a34821 	addu	t1,a1,v1
+   31314:	14e0fff9 	bnez	a3,312fc <strncpy+0x1c>
+   31318:	a1040000 	sb	a0,0(t0)
+   3131c:	03e00008 	jr	ra
+   31320:	00000000 	sll	zero,zero,0x0
+   31324:	00432021 	addu	a0,v0,v1
+   31328:	24630001 	addiu	v1,v1,1
+   3132c:	0066282b 	sltu	a1,v1,a2
+   31330:	a0800000 	sb	zero,0(a0)
+   31334:	14a0fffc 	bnez	a1,31328 <strncpy+0x48>
+   31338:	24840001 	addiu	a0,a0,1
+   3133c:	03e00008 	jr	ra
+   31340:	00000000 	sll	zero,zero,0x0
+
+00031344 <strlen>:
+   31344:	1080000d 	beqz	a0,3137c <strlen+0x38>
+   31348:	00000000 	sll	zero,zero,0x0
+   3134c:	80820000 	lb	v0,0(a0)
+   31350:	10400008 	beqz	v0,31374 <strlen+0x30>
+   31354:	00000000 	sll	zero,zero,0x0
+   31358:	00801021 	addu	v0,a0,zero
+   3135c:	24420001 	addiu	v0,v0,1
+   31360:	80430000 	lb	v1,0(v0)
+   31364:	1460fffe 	bnez	v1,31360 <strlen+0x1c>
+   31368:	24420001 	addiu	v0,v0,1
+   3136c:	2442ffff 	addiu	v0,v0,-1
+   31370:	00441023 	subu	v0,v0,a0
+   31374:	03e00008 	jr	ra
+   31378:	00000000 	sll	zero,zero,0x0
+   3137c:	03e00008 	jr	ra
+   31380:	00001021 	addu	v0,zero,zero
+
+00031384 <strnlen>:
+   31384:	10800010 	beqz	a0,313c8 <strnlen+0x44>
+   31388:	00000000 	sll	zero,zero,0x0
+   3138c:	80820000 	lb	v0,0(a0)
+   31390:	1040000f 	beqz	v0,313d0 <strnlen+0x4c>
+   31394:	00000000 	sll	zero,zero,0x0
+   31398:	18a0000d 	blez	a1,313d0 <strnlen+0x4c>
+   3139c:	24a5ffff 	addiu	a1,a1,-1
+   313a0:	0800c4ec 	j	313b0 <strnlen+0x2c>
+   313a4:	00801021 	addu	v0,a0,zero
+   313a8:	10a00005 	beqz	a1,313c0 <strnlen+0x3c>
+   313ac:	24a5ffff 	addiu	a1,a1,-1
+   313b0:	24420001 	addiu	v0,v0,1
+   313b4:	80430000 	lb	v1,0(v0)
+   313b8:	1460fffb 	bnez	v1,313a8 <strnlen+0x24>
+   313bc:	00000000 	sll	zero,zero,0x0
+   313c0:	03e00008 	jr	ra
+   313c4:	00441023 	subu	v0,v0,a0
+   313c8:	03e00008 	jr	ra
+   313cc:	00001021 	addu	v0,zero,zero
+   313d0:	03e00008 	jr	ra
+   313d4:	00001021 	addu	v0,zero,zero
+
+000313d8 <strrchr>:
+   313d8:	00052e00 	sll	a1,a1,0x18
+   313dc:	00052e03 	sra	a1,a1,0x18
+   313e0:	0800c4fb 	j	313ec <strrchr+0x14>
+   313e4:	00001021 	addu	v0,zero,zero
+   313e8:	24840001 	addiu	a0,a0,1
+   313ec:	80830000 	lb	v1,0(a0)
+   313f0:	00653026 	xor	a2,v1,a1
+   313f4:	1460fffc 	bnez	v1,313e8 <strrchr+0x10>
+   313f8:	0086100a 	movz	v0,a0,a2
+   313fc:	03e00008 	jr	ra
+   31400:	00000000 	sll	zero,zero,0x0
+
+00031404 <cat_func>:
+   31404:	8c820000 	lw	v0,0(a0)
+   31408:	27bdff58 	addiu	sp,sp,-168
+   3140c:	afa20078 	sw	v0,120(sp)
+   31410:	2c420002 	sltiu	v0,v0,2
+   31414:	afbf00a4 	sw	ra,164(sp)
+   31418:	afbe00a0 	sw	s8,160(sp)
+   3141c:	afb7009c 	sw	s7,156(sp)
+   31420:	afb60098 	sw	s6,152(sp)
+   31424:	afb50094 	sw	s5,148(sp)
+   31428:	afb40090 	sw	s4,144(sp)
+   3142c:	afb3008c 	sw	s3,140(sp)
+   31430:	afb20088 	sw	s2,136(sp)
+   31434:	afb10084 	sw	s1,132(sp)
+   31438:	1440006b 	bnez	v0,315e8 <cat_func+0x1e4>
+   3143c:	afb00080 	sw	s0,128(sp)
+   31440:	3c1e0001 	lui	s8,0x1
+   31444:	3c170001 	lui	s7,0x1
+   31448:	3c130008 	lui	s3,0x8
+   3144c:	24950044 	addiu	s5,a0,68
+   31450:	27debe08 	addiu	s8,s8,-16888
+   31454:	26f7bc88 	addiu	s7,s7,-17272
+   31458:	267316d4 	addiu	s3,s3,5844
+   3145c:	24140001 	addiu	s4,zero,1
+   31460:	27b2001c 	addiu	s2,sp,28
+   31464:	27b10038 	addiu	s1,sp,56
+   31468:	3c020001 	lui	v0,0x1
+   3146c:	3c030008 	lui	v1,0x8
+   31470:	2442c048 	addiu	v0,v0,-16312
+   31474:	8c642704 	lw	a0,9988(v1)
+   31478:	afa20024 	sw	v0,36(sp)
+   3147c:	3c030001 	lui	v1,0x1
+   31480:	3c020001 	lui	v0,0x1
+   31484:	2463bff8 	addiu	v1,v1,-16392
+   31488:	2442bff0 	addiu	v0,v0,-16400
+   3148c:	02402821 	addu	a1,s2,zero
+   31490:	3c060010 	lui	a2,0x10
+   31494:	00003821 	addu	a3,zero,zero
+   31498:	afb5001c 	sw	s5,28(sp)
+   3149c:	afa30028 	sw	v1,40(sp)
+   314a0:	afbe0030 	sw	s8,48(sp)
+   314a4:	afb7002c 	sw	s7,44(sp)
+   314a8:	afa20034 	sw	v0,52(sp)
+   314ac:	afa00020 	sw	zero,32(sp)
+   314b0:	0c00a4f2 	jal	293c8 <vfs_open>
+   314b4:	afb10010 	sw	s1,16(sp)
+   314b8:	14400025 	bnez	v0,31550 <cat_func+0x14c>
+   314bc:	0040b021 	addu	s6,v0,zero
+   314c0:	3c030001 	lui	v1,0x1
+   314c4:	2463c0c8 	addiu	v1,v1,-16184
+   314c8:	3c020001 	lui	v0,0x1
+   314cc:	2442c094 	addiu	v0,v0,-16236
+   314d0:	afa30024 	sw	v1,36(sp)
+   314d4:	3c030001 	lui	v1,0x1
+   314d8:	afa20028 	sw	v0,40(sp)
+   314dc:	2463bc80 	addiu	v1,v1,-17280
+   314e0:	24021000 	addiu	v0,zero,4096
+   314e4:	afb3001c 	sw	s3,28(sp)
+   314e8:	afbe0030 	sw	s8,48(sp)
+   314ec:	afb7002c 	sw	s7,44(sp)
+   314f0:	afa30034 	sw	v1,52(sp)
+   314f4:	0800c541 	j	31504 <cat_func+0x100>
+   314f8:	afa20020 	sw	v0,32(sp)
+   314fc:	0c00c9ae 	jal	326b8 <ksh_write>
+   31500:	00000000 	sll	zero,zero,0x0
+   31504:	02202021 	addu	a0,s1,zero
+   31508:	0c009e63 	jal	2798c <vfs_read>
+   3150c:	02402821 	addu	a1,s2,zero
+   31510:	00408021 	addu	s0,v0,zero
+   31514:	00402821 	addu	a1,v0,zero
+   31518:	1c40fff8 	bgtz	v0,314fc <cat_func+0xf8>
+   3151c:	02602021 	addu	a0,s3,zero
+   31520:	02202021 	addu	a0,s1,zero
+   31524:	0c009f67 	jal	27d9c <vfs_close>
+   31528:	27a50018 	addiu	a1,sp,24
+   3152c:	14400015 	bnez	v0,31584 <cat_func+0x180>
+   31530:	3c030004 	lui	v1,0x4
+   31534:	1600001f 	bnez	s0,315b4 <cat_func+0x1b0>
+   31538:	8fbf00a4 	lw	ra,164(sp)
+   3153c:	8fa30078 	lw	v1,120(sp)
+   31540:	26940001 	addiu	s4,s4,1
+   31544:	0283102b 	sltu	v0,s4,v1
+   31548:	1440ffc7 	bnez	v0,31468 <cat_func+0x64>
+   3154c:	26b50040 	addiu	s5,s5,64
+   31550:	8fbf00a4 	lw	ra,164(sp)
+   31554:	02c01021 	addu	v0,s6,zero
+   31558:	8fbe00a0 	lw	s8,160(sp)
+   3155c:	8fb7009c 	lw	s7,156(sp)
+   31560:	8fb60098 	lw	s6,152(sp)
+   31564:	8fb50094 	lw	s5,148(sp)
+   31568:	8fb40090 	lw	s4,144(sp)
+   3156c:	8fb3008c 	lw	s3,140(sp)
+   31570:	8fb20088 	lw	s2,136(sp)
+   31574:	8fb10084 	lw	s1,132(sp)
+   31578:	8fb00080 	lw	s0,128(sp)
+   3157c:	03e00008 	jr	ra
+   31580:	27bd00a8 	addiu	sp,sp,168
+   31584:	3c060003 	lui	a2,0x3
+   31588:	3c070003 	lui	a3,0x3
+   3158c:	8c649100 	lw	a0,-28416(v1)
+   31590:	00002821 	addu	a1,zero,zero
+   31594:	24c67ef4 	addiu	a2,a2,32500
+   31598:	24e77f30 	addiu	a3,a3,32560
+   3159c:	afa20014 	sw	v0,20(sp)
+   315a0:	0c0009b0 	jal	26c0 <__fprintk>
+   315a4:	afb40010 	sw	s4,16(sp)
+   315a8:	1200ffe5 	beqz	s0,31540 <cat_func+0x13c>
+   315ac:	8fa30078 	lw	v1,120(sp)
+   315b0:	8fbf00a4 	lw	ra,164(sp)
+   315b4:	0200b021 	addu	s6,s0,zero
+   315b8:	02c01021 	addu	v0,s6,zero
+   315bc:	8fbe00a0 	lw	s8,160(sp)
+   315c0:	8fb7009c 	lw	s7,156(sp)
+   315c4:	8fb60098 	lw	s6,152(sp)
+   315c8:	8fb50094 	lw	s5,148(sp)
+   315cc:	8fb40090 	lw	s4,144(sp)
+   315d0:	8fb3008c 	lw	s3,140(sp)
+   315d4:	8fb20088 	lw	s2,136(sp)
+   315d8:	8fb10084 	lw	s1,132(sp)
+   315dc:	8fb00080 	lw	s0,128(sp)
+   315e0:	03e00008 	jr	ra
+   315e4:	27bd00a8 	addiu	sp,sp,168
+   315e8:	0800c554 	j	31550 <cat_func+0x14c>
+   315ec:	0000b021 	addu	s6,zero,zero
+
+000315f0 <cd_func>:
+   315f0:	8c830000 	lw	v1,0(a0)
+   315f4:	27bdffc8 	addiu	sp,sp,-56
+   315f8:	24020001 	addiu	v0,zero,1
+   315fc:	1062001a 	beq	v1,v0,31668 <cd_func+0x78>
+   31600:	afbf0034 	sw	ra,52(sp)
+   31604:	24820044 	addiu	v0,a0,68
+   31608:	afa20010 	sw	v0,16(sp)
+   3160c:	3c020001 	lui	v0,0x1
+   31610:	2442c048 	addiu	v0,v0,-16312
+   31614:	afa20018 	sw	v0,24(sp)
+   31618:	3c020001 	lui	v0,0x1
+   3161c:	2442bff8 	addiu	v0,v0,-16392
+   31620:	afa2001c 	sw	v0,28(sp)
+   31624:	3c020001 	lui	v0,0x1
+   31628:	2442be08 	addiu	v0,v0,-16888
+   3162c:	afa20024 	sw	v0,36(sp)
+   31630:	3c020001 	lui	v0,0x1
+   31634:	3c030008 	lui	v1,0x8
+   31638:	2442bc88 	addiu	v0,v0,-17272
+   3163c:	afa20020 	sw	v0,32(sp)
+   31640:	8c652704 	lw	a1,9988(v1)
+   31644:	3c020001 	lui	v0,0x1
+   31648:	27a40010 	addiu	a0,sp,16
+   3164c:	2442bff0 	addiu	v0,v0,-16400
+   31650:	afa20028 	sw	v0,40(sp)
+   31654:	0c00a5a5 	jal	29694 <vfs_chdir>
+   31658:	afa00014 	sw	zero,20(sp)
+   3165c:	8fbf0034 	lw	ra,52(sp)
+   31660:	03e00008 	jr	ra
+   31664:	27bd0038 	addiu	sp,sp,56
+   31668:	3c020003 	lui	v0,0x3
+   3166c:	0800c582 	j	31608 <cd_func+0x18>
+   31670:	24427f3c 	addiu	v0,v0,32572
+
+00031674 <clear_func>:
+   31674:	3c040003 	lui	a0,0x3
+   31678:	27bdffe0 	addiu	sp,sp,-32
+   3167c:	2402004a 	addiu	v0,zero,74
+   31680:	24847f40 	addiu	a0,a0,32576
+   31684:	2405001b 	addiu	a1,zero,27
+   31688:	2406005b 	addiu	a2,zero,91
+   3168c:	24070032 	addiu	a3,zero,50
+   31690:	afbf001c 	sw	ra,28(sp)
+   31694:	0c00ca4b 	jal	3292c <ksh_print>
+   31698:	afa20010 	sw	v0,16(sp)
+   3169c:	8fbf001c 	lw	ra,28(sp)
+   316a0:	00001021 	addu	v0,zero,zero
+   316a4:	03e00008 	jr	ra
+   316a8:	27bd0020 	addiu	sp,sp,32
+
+000316ac <cp_func>:
+   316ac:	27bdff18 	addiu	sp,sp,-232
+   316b0:	afb300cc 	sw	s3,204(sp)
+   316b4:	8c930000 	lw	s3,0(a0)
+   316b8:	afb400d0 	sw	s4,208(sp)
+   316bc:	afb200c8 	sw	s2,200(sp)
+   316c0:	3c140008 	lui	s4,0x8
+   316c4:	00809021 	addu	s2,a0,zero
+   316c8:	2673ffff 	addiu	s3,s3,-1
+   316cc:	afbe00e0 	sw	s8,224(sp)
+   316d0:	afb700dc 	sw	s7,220(sp)
+   316d4:	afb600d8 	sw	s6,216(sp)
+   316d8:	afb500d4 	sw	s5,212(sp)
+   316dc:	afb000c0 	sw	s0,192(sp)
+   316e0:	26430004 	addiu	v1,s2,4
+   316e4:	00131180 	sll	v0,s3,0x6
+   316e8:	27b0001c 	addiu	s0,sp,28
+   316ec:	3c170001 	lui	s7,0x1
+   316f0:	3c150001 	lui	s5,0x1
+   316f4:	3c080001 	lui	t0,0x1
+   316f8:	3c1e0001 	lui	s8,0x1
+   316fc:	3c160001 	lui	s6,0x1
+   31700:	8e842704 	lw	a0,9988(s4)
+   31704:	2508be08 	addiu	t0,t0,-16888
+   31708:	afb100c4 	sw	s1,196(sp)
+   3170c:	00621021 	addu	v0,v1,v0
+   31710:	26f7c048 	addiu	s7,s7,-16312
+   31714:	26b5bff8 	addiu	s5,s5,-16392
+   31718:	27debc88 	addiu	s8,s8,-17272
+   3171c:	26d6bff0 	addiu	s6,s6,-16400
+   31720:	27b10074 	addiu	s1,sp,116
+   31724:	02002821 	addu	a1,s0,zero
+   31728:	3c060060 	lui	a2,0x60
+   3172c:	00003821 	addu	a3,zero,zero
+   31730:	afbf00e4 	sw	ra,228(sp)
+   31734:	afa2001c 	sw	v0,28(sp)
+   31738:	afb70024 	sw	s7,36(sp)
+   3173c:	afb50028 	sw	s5,40(sp)
+   31740:	afa80030 	sw	t0,48(sp)
+   31744:	afbe002c 	sw	s8,44(sp)
+   31748:	afb60034 	sw	s6,52(sp)
+   3174c:	afa00020 	sw	zero,32(sp)
+   31750:	afb10010 	sw	s1,16(sp)
+   31754:	0c00a4f2 	jal	293c8 <vfs_open>
+   31758:	afa800bc 	sw	t0,188(sp)
+   3175c:	1440004e 	bnez	v0,31898 <cp_func+0x1ec>
+   31760:	8fbf00e4 	lw	ra,228(sp)
+   31764:	2e620002 	sltiu	v0,s3,2
+   31768:	14400073 	bnez	v0,31938 <cp_func+0x28c>
+   3176c:	26520044 	addiu	s2,s2,68
+   31770:	24030001 	addiu	v1,zero,1
+   31774:	27a20018 	addiu	v0,sp,24
+   31778:	afb200b4 	sw	s2,180(sp)
+   3177c:	afa300b8 	sw	v1,184(sp)
+   31780:	27b20038 	addiu	s2,sp,56
+   31784:	afa200b0 	sw	v0,176(sp)
+   31788:	8fa300b4 	lw	v1,180(sp)
+   3178c:	3c020001 	lui	v0,0x1
+   31790:	8e842704 	lw	a0,9988(s4)
+   31794:	2442be08 	addiu	v0,v0,-16888
+   31798:	02002821 	addu	a1,s0,zero
+   3179c:	3c060010 	lui	a2,0x10
+   317a0:	00003821 	addu	a3,zero,zero
+   317a4:	afa3001c 	sw	v1,28(sp)
+   317a8:	afb70024 	sw	s7,36(sp)
+   317ac:	afb50028 	sw	s5,40(sp)
+   317b0:	afa20030 	sw	v0,48(sp)
+   317b4:	afbe002c 	sw	s8,44(sp)
+   317b8:	afb60034 	sw	s6,52(sp)
+   317bc:	afa00020 	sw	zero,32(sp)
+   317c0:	0c00a4f2 	jal	293c8 <vfs_open>
+   317c4:	afb20010 	sw	s2,16(sp)
+   317c8:	14400052 	bnez	v0,31914 <cp_func+0x268>
+   317cc:	8fa500b0 	lw	a1,176(sp)
+   317d0:	3c030008 	lui	v1,0x8
+   317d4:	246316d4 	addiu	v1,v1,5844
+   317d8:	3c020001 	lui	v0,0x1
+   317dc:	2442c0c8 	addiu	v0,v0,-16184
+   317e0:	afa3001c 	sw	v1,28(sp)
+   317e4:	3c030001 	lui	v1,0x1
+   317e8:	2463c094 	addiu	v1,v1,-16236
+   317ec:	afa20024 	sw	v0,36(sp)
+   317f0:	3c020001 	lui	v0,0x1
+   317f4:	2442be08 	addiu	v0,v0,-16888
+   317f8:	afa30028 	sw	v1,40(sp)
+   317fc:	3c030001 	lui	v1,0x1
+   31800:	afa20030 	sw	v0,48(sp)
+   31804:	2463bc80 	addiu	v1,v1,-17280
+   31808:	24021000 	addiu	v0,zero,4096
+   3180c:	afbe002c 	sw	s8,44(sp)
+   31810:	afa30034 	sw	v1,52(sp)
+   31814:	afa20020 	sw	v0,32(sp)
+   31818:	02402021 	addu	a0,s2,zero
+   3181c:	0c009e63 	jal	2798c <vfs_read>
+   31820:	02002821 	addu	a1,s0,zero
+   31824:	00401821 	addu	v1,v0,zero
+   31828:	02202021 	addu	a0,s1,zero
+   3182c:	18400027 	blez	v0,318cc <cp_func+0x220>
+   31830:	02002821 	addu	a1,s0,zero
+   31834:	0c009e78 	jal	279e0 <vfs_write>
+   31838:	00000000 	sll	zero,zero,0x0
+   3183c:	0441fff6 	bgez	v0,31818 <cp_func+0x16c>
+   31840:	00401821 	addu	v1,v0,zero
+   31844:	8fa500b0 	lw	a1,176(sp)
+   31848:	02402021 	addu	a0,s2,zero
+   3184c:	0c009f67 	jal	27d9c <vfs_close>
+   31850:	afa300bc 	sw	v1,188(sp)
+   31854:	8fa500b0 	lw	a1,176(sp)
+   31858:	0c009f67 	jal	27d9c <vfs_close>
+   3185c:	02202021 	addu	a0,s1,zero
+   31860:	8fa300bc 	lw	v1,188(sp)
+   31864:	8fbf00e4 	lw	ra,228(sp)
+   31868:	00601021 	addu	v0,v1,zero
+   3186c:	8fbe00e0 	lw	s8,224(sp)
+   31870:	8fb700dc 	lw	s7,220(sp)
+   31874:	8fb600d8 	lw	s6,216(sp)
+   31878:	8fb500d4 	lw	s5,212(sp)
+   3187c:	8fb400d0 	lw	s4,208(sp)
+   31880:	8fb300cc 	lw	s3,204(sp)
+   31884:	8fb200c8 	lw	s2,200(sp)
+   31888:	8fb100c4 	lw	s1,196(sp)
+   3188c:	8fb000c0 	lw	s0,192(sp)
+   31890:	03e00008 	jr	ra
+   31894:	27bd00e8 	addiu	sp,sp,232
+   31898:	00401821 	addu	v1,v0,zero
+   3189c:	00601021 	addu	v0,v1,zero
+   318a0:	8fbe00e0 	lw	s8,224(sp)
+   318a4:	8fb700dc 	lw	s7,220(sp)
+   318a8:	8fb600d8 	lw	s6,216(sp)
+   318ac:	8fb500d4 	lw	s5,212(sp)
+   318b0:	8fb400d0 	lw	s4,208(sp)
+   318b4:	8fb300cc 	lw	s3,204(sp)
+   318b8:	8fb200c8 	lw	s2,200(sp)
+   318bc:	8fb100c4 	lw	s1,196(sp)
+   318c0:	8fb000c0 	lw	s0,192(sp)
+   318c4:	03e00008 	jr	ra
+   318c8:	27bd00e8 	addiu	sp,sp,232
+   318cc:	1440ffdd 	bnez	v0,31844 <cp_func+0x198>
+   318d0:	8fa500b0 	lw	a1,176(sp)
+   318d4:	8fa300b8 	lw	v1,184(sp)
+   318d8:	24630001 	addiu	v1,v1,1
+   318dc:	02402021 	addu	a0,s2,zero
+   318e0:	0c009f67 	jal	27d9c <vfs_close>
+   318e4:	afa300b8 	sw	v1,184(sp)
+   318e8:	8fa300b8 	lw	v1,184(sp)
+   318ec:	0073102b 	sltu	v0,v1,s3
+   318f0:	8fa300b4 	lw	v1,180(sp)
+   318f4:	24630040 	addiu	v1,v1,64
+   318f8:	1440ffa3 	bnez	v0,31788 <cp_func+0xdc>
+   318fc:	afa300b4 	sw	v1,180(sp)
+   31900:	8fa500b0 	lw	a1,176(sp)
+   31904:	0c009f67 	jal	27d9c <vfs_close>
+   31908:	02202021 	addu	a0,s1,zero
+   3190c:	0800c619 	j	31864 <cp_func+0x1b8>
+   31910:	00001821 	addu	v1,zero,zero
+   31914:	02202021 	addu	a0,s1,zero
+   31918:	0c009f67 	jal	27d9c <vfs_close>
+   3191c:	afa200bc 	sw	v0,188(sp)
+   31920:	3c040003 	lui	a0,0x3
+   31924:	8fa500b4 	lw	a1,180(sp)
+   31928:	0c00ca4b 	jal	3292c <ksh_print>
+   3192c:	24847f4c 	addiu	a0,a0,32588
+   31930:	0800c619 	j	31864 <cp_func+0x1b8>
+   31934:	8fa300bc 	lw	v1,188(sp)
+   31938:	27a20018 	addiu	v0,sp,24
+   3193c:	0800c640 	j	31900 <cp_func+0x254>
+   31940:	afa200b0 	sw	v0,176(sp)
+
+00031944 <eomtkp_func>:
+   31944:	27bdff98 	addiu	sp,sp,-104
+   31948:	afb40050 	sw	s4,80(sp)
+   3194c:	afb10044 	sw	s1,68(sp)
+   31950:	0080a021 	addu	s4,a0,zero
+   31954:	3c110008 	lui	s1,0x8
+   31958:	27a40028 	addiu	a0,sp,40
+   3195c:	afbf0064 	sw	ra,100(sp)
+   31960:	afb3004c 	sw	s3,76(sp)
+   31964:	afb20048 	sw	s2,72(sp)
+   31968:	afb00040 	sw	s0,64(sp)
+   3196c:	afbe0060 	sw	s8,96(sp)
+   31970:	afb7005c 	sw	s7,92(sp)
+   31974:	afb60058 	sw	s6,88(sp)
+   31978:	afb50054 	sw	s5,84(sp)
+   3197c:	0c004cfa 	jal	133e8 <sys_clock>
+   31980:	3c120003 	lui	s2,0x3
+   31984:	262416d4 	addiu	a0,s1,5844
+   31988:	00002821 	addu	a1,zero,zero
+   3198c:	0c00c182 	jal	30608 <memset>
+   31990:	24060200 	addiu	a2,zero,512
+   31994:	26447f64 	addiu	a0,s2,32612
+   31998:	3c050020 	lui	a1,0x20
+   3199c:	0c00575c 	jal	15d70 <sys_open>
+   319a0:	00003021 	addu	a2,zero,zero
+   319a4:	2410ffff 	addiu	s0,zero,-1
+   319a8:	1050001d 	beq	v0,s0,31a20 <eomtkp_func+0xdc>
+   319ac:	00409821 	addu	s3,v0,zero
+   319b0:	26950044 	addiu	s5,s4,68
+   319b4:	02a02021 	addu	a0,s5,zero
+   319b8:	3c050010 	lui	a1,0x10
+   319bc:	0c00575c 	jal	15d70 <sys_open>
+   319c0:	00003021 	addu	a2,zero,zero
+   319c4:	1050007a 	beq	v0,s0,31bb0 <eomtkp_func+0x26c>
+   319c8:	0040a021 	addu	s4,v0,zero
+   319cc:	00402021 	addu	a0,v0,zero
+   319d0:	262516d4 	addiu	a1,s1,5844
+   319d4:	0c00592b 	jal	164ac <sys_read>
+   319d8:	24060200 	addiu	a2,zero,512
+   319dc:	0440001d 	bltz	v0,31a54 <eomtkp_func+0x110>
+   319e0:	263116d4 	addiu	s1,s1,5844
+   319e4:	92350007 	lbu	s5,7(s1)
+   319e8:	92230009 	lbu	v1,9(s1)
+   319ec:	92270006 	lbu	a3,6(s1)
+   319f0:	92220008 	lbu	v0,8(s1)
+   319f4:	0015aa00 	sll	s5,s5,0x8
+   319f8:	00031a00 	sll	v1,v1,0x8
+   319fc:	26447f64 	addiu	a0,s2,32612
+   31a00:	3c050020 	lui	a1,0x20
+   31a04:	00003021 	addu	a2,zero,zero
+   31a08:	02a7a825 	or	s5,s5,a3
+   31a0c:	0c00575c 	jal	15d70 <sys_open>
+   31a10:	00629025 	or	s2,v1,v0
+   31a14:	14500021 	bne	v0,s0,31a9c <eomtkp_func+0x158>
+   31a18:	00151a02 	srl	v1,s5,0x8
+   31a1c:	2410ffff 	addiu	s0,zero,-1
+   31a20:	8fbf0064 	lw	ra,100(sp)
+   31a24:	02001021 	addu	v0,s0,zero
+   31a28:	8fbe0060 	lw	s8,96(sp)
+   31a2c:	8fb7005c 	lw	s7,92(sp)
+   31a30:	8fb60058 	lw	s6,88(sp)
+   31a34:	8fb50054 	lw	s5,84(sp)
+   31a38:	8fb40050 	lw	s4,80(sp)
+   31a3c:	8fb3004c 	lw	s3,76(sp)
+   31a40:	8fb20048 	lw	s2,72(sp)
+   31a44:	8fb10044 	lw	s1,68(sp)
+   31a48:	8fb00040 	lw	s0,64(sp)
+   31a4c:	03e00008 	jr	ra
+   31a50:	27bd0068 	addiu	sp,sp,104
+   31a54:	0c004d28 	jal	134a0 <sys_close>
+   31a58:	02602021 	addu	a0,s3,zero
+   31a5c:	0c004d28 	jal	134a0 <sys_close>
+   31a60:	02802021 	addu	a0,s4,zero
+   31a64:	8fbf0064 	lw	ra,100(sp)
+   31a68:	2410fffd 	addiu	s0,zero,-3
+   31a6c:	02001021 	addu	v0,s0,zero
+   31a70:	8fbe0060 	lw	s8,96(sp)
+   31a74:	8fb7005c 	lw	s7,92(sp)
+   31a78:	8fb60058 	lw	s6,88(sp)
+   31a7c:	8fb50054 	lw	s5,84(sp)
+   31a80:	8fb40050 	lw	s4,80(sp)
+   31a84:	8fb3004c 	lw	s3,76(sp)
+   31a88:	8fb20048 	lw	s2,72(sp)
+   31a8c:	8fb10044 	lw	s1,68(sp)
+   31a90:	8fb00040 	lw	s0,64(sp)
+   31a94:	03e00008 	jr	ra
+   31a98:	27bd0068 	addiu	sp,sp,104
+   31a9c:	00121202 	srl	v0,s2,0x8
+   31aa0:	00152a00 	sll	a1,s5,0x8
+   31aa4:	00123200 	sll	a2,s2,0x8
+   31aa8:	00a32825 	or	a1,a1,v1
+   31aac:	00c23025 	or	a2,a2,v0
+   31ab0:	3c040003 	lui	a0,0x3
+   31ab4:	30c6ffff 	andi	a2,a2,0xffff
+   31ab8:	24847f70 	addiu	a0,a0,32624
+   31abc:	0c00ca4b 	jal	3292c <ksh_print>
+   31ac0:	30a5ffff 	andi	a1,a1,0xffff
+   31ac4:	3c040003 	lui	a0,0x3
+   31ac8:	24847f8c 	addiu	a0,a0,32652
+   31acc:	0c00ca4b 	jal	3292c <ksh_print>
+   31ad0:	26250018 	addiu	a1,s1,24
+   31ad4:	02802021 	addu	a0,s4,zero
+   31ad8:	24050200 	addiu	a1,zero,512
+   31adc:	0c005533 	jal	154cc <sys_lseek>
+   31ae0:	00003021 	addu	a2,zero,zero
+   31ae4:	1050ffce 	beq	v0,s0,31a20 <eomtkp_func+0xdc>
+   31ae8:	2410fffc 	addiu	s0,zero,-4
+   31aec:	0c004cfa 	jal	133e8 <sys_clock>
+   31af0:	27a40038 	addiu	a0,sp,56
+   31af4:	8fb50038 	lw	s5,56(sp)
+   31af8:	8fb7003c 	lw	s7,60(sp)
+   31afc:	8fbe0028 	lw	s8,40(sp)
+   31b00:	8fb6002c 	lw	s6,44(sp)
+   31b04:	02209021 	addu	s2,s1,zero
+   31b08:	02802021 	addu	a0,s4,zero
+   31b0c:	02202821 	addu	a1,s1,zero
+   31b10:	0c00592b 	jal	164ac <sys_read>
+   31b14:	24060200 	addiu	a2,zero,512
+   31b18:	00408021 	addu	s0,v0,zero
+   31b1c:	00403021 	addu	a2,v0,zero
+   31b20:	02602021 	addu	a0,s3,zero
+   31b24:	18400005 	blez	v0,31b3c <eomtkp_func+0x1f8>
+   31b28:	02402821 	addu	a1,s2,zero
+   31b2c:	0c00610c 	jal	18430 <sys_write>
+   31b30:	00000000 	sll	zero,zero,0x0
+   31b34:	0441fff4 	bgez	v0,31b08 <eomtkp_func+0x1c4>
+   31b38:	00408021 	addu	s0,v0,zero
+   31b3c:	0c004d28 	jal	134a0 <sys_close>
+   31b40:	02802021 	addu	a0,s4,zero
+   31b44:	0c004d28 	jal	134a0 <sys_close>
+   31b48:	02602021 	addu	a0,s3,zero
+   31b4c:	0c004cfa 	jal	133e8 <sys_clock>
+   31b50:	27a40030 	addiu	a0,sp,48
+   31b54:	8fa20030 	lw	v0,48(sp)
+   31b58:	8fa60028 	lw	a2,40(sp)
+   31b5c:	8fa30034 	lw	v1,52(sp)
+   31b60:	8fa7002c 	lw	a3,44(sp)
+   31b64:	00462823 	subu	a1,v0,a2
+   31b68:	02bef023 	subu	s8,s5,s8
+   31b6c:	0045202b 	sltu	a0,v0,a1
+   31b70:	00674023 	subu	t0,v1,a3
+   31b74:	01044023 	subu	t0,t0,a0
+   31b78:	02f6b023 	subu	s6,s7,s6
+   31b7c:	02bea82b 	sltu	s5,s5,s8
+   31b80:	3c040003 	lui	a0,0x3
+   31b84:	02d5a823 	subu	s5,s6,s5
+   31b88:	24847f9c 	addiu	a0,a0,32668
+   31b8c:	afa50018 	sw	a1,24(sp)
+   31b90:	afa8001c 	sw	t0,28(sp)
+   31b94:	afbe0020 	sw	s8,32(sp)
+   31b98:	afb50024 	sw	s5,36(sp)
+   31b9c:	afa20010 	sw	v0,16(sp)
+   31ba0:	0c00ca4b 	jal	3292c <ksh_print>
+   31ba4:	afa30014 	sw	v1,20(sp)
+   31ba8:	0800c689 	j	31a24 <eomtkp_func+0xe0>
+   31bac:	8fbf0064 	lw	ra,100(sp)
+   31bb0:	0c004d28 	jal	134a0 <sys_close>
+   31bb4:	02602021 	addu	a0,s3,zero
+   31bb8:	3c040003 	lui	a0,0x3
+   31bbc:	24847f4c 	addiu	a0,a0,32588
+   31bc0:	0c00ca4b 	jal	3292c <ksh_print>
+   31bc4:	02a02821 	addu	a1,s5,zero
+   31bc8:	0800c688 	j	31a20 <eomtkp_func+0xdc>
+   31bcc:	2410fffe 	addiu	s0,zero,-2
+
+00031bd0 <print_error_msg>:
+   31bd0:	3c040003 	lui	a0,0x3
+   31bd4:	0800ca4b 	j	3292c <ksh_print>
+   31bd8:	24847ff4 	addiu	a0,a0,32756
+
+00031bdc <exec_func>:
+   31bdc:	8c820000 	lw	v0,0(a0)
+   31be0:	27bdffe8 	addiu	sp,sp,-24
+   31be4:	2c420002 	sltiu	v0,v0,2
+   31be8:	14400004 	bnez	v0,31bfc <exec_func+0x20>
+   31bec:	afbf0014 	sw	ra,20(sp)
+   31bf0:	8fbf0014 	lw	ra,20(sp)
+   31bf4:	03e00008 	jr	ra
+   31bf8:	27bd0018 	addiu	sp,sp,24
+   31bfc:	3c040004 	lui	a0,0x4
+   31c00:	0c00ca4b 	jal	3292c <ksh_print>
+   31c04:	24848008 	addiu	a0,a0,-32760
+   31c08:	8fbf0014 	lw	ra,20(sp)
+   31c0c:	24020016 	addiu	v0,zero,22
+   31c10:	03e00008 	jr	ra
+   31c14:	27bd0018 	addiu	sp,sp,24
+
+00031c18 <show_instrumentation>:
+   31c18:	3c040004 	lui	a0,0x4
+   31c1c:	27bdffe8 	addiu	sp,sp,-24
+   31c20:	afbf0014 	sw	ra,20(sp)
+   31c24:	0c00ca4b 	jal	3292c <ksh_print>
+   31c28:	24848034 	addiu	a0,a0,-32716
+   31c2c:	8fbf0014 	lw	ra,20(sp)
+   31c30:	00001021 	addu	v0,zero,zero
+   31c34:	03e00008 	jr	ra
+   31c38:	27bd0018 	addiu	sp,sp,24
+
+00031c3c <kill_func>:
+   31c3c:	8c830000 	lw	v1,0(a0)
+   31c40:	27bdffd8 	addiu	sp,sp,-40
+   31c44:	24020003 	addiu	v0,zero,3
+   31c48:	afb10020 	sw	s1,32(sp)
+   31c4c:	afbf0024 	sw	ra,36(sp)
+   31c50:	afb0001c 	sw	s0,28(sp)
+   31c54:	1062000a 	beq	v1,v0,31c80 <kill_func+0x44>
+   31c58:	00808821 	addu	s1,a0,zero
+   31c5c:	3c040004 	lui	a0,0x4
+   31c60:	0c00ca4b 	jal	3292c <ksh_print>
+   31c64:	24848090 	addiu	a0,a0,-32624
+   31c68:	24020016 	addiu	v0,zero,22
+   31c6c:	8fbf0024 	lw	ra,36(sp)
+   31c70:	8fb10020 	lw	s1,32(sp)
+   31c74:	8fb0001c 	lw	s0,28(sp)
+   31c78:	03e00008 	jr	ra
+   31c7c:	27bd0028 	addiu	sp,sp,40
+   31c80:	0c00b873 	jal	2e1cc <atoi>
+   31c84:	24840044 	addiu	a0,a0,68
+   31c88:	26240084 	addiu	a0,s1,132
+   31c8c:	0c00b873 	jal	2e1cc <atoi>
+   31c90:	00408021 	addu	s0,v0,zero
+   31c94:	00408821 	addu	s1,v0,zero
+   31c98:	2602ffff 	addiu	v0,s0,-1
+   31c9c:	2c42001f 	sltiu	v0,v0,31
+   31ca0:	1440000a 	bnez	v0,31ccc <kill_func+0x90>
+   31ca4:	3c040004 	lui	a0,0x4
+   31ca8:	02002821 	addu	a1,s0,zero
+   31cac:	0c00ca4b 	jal	3292c <ksh_print>
+   31cb0:	248480b8 	addiu	a0,a0,-32584
+   31cb4:	8fbf0024 	lw	ra,36(sp)
+   31cb8:	24020016 	addiu	v0,zero,22
+   31cbc:	8fb10020 	lw	s1,32(sp)
+   31cc0:	8fb0001c 	lw	s0,28(sp)
+   31cc4:	03e00008 	jr	ra
+   31cc8:	27bd0028 	addiu	sp,sp,40
+   31ccc:	0c006688 	jal	19a20 <task_whereis>
+   31cd0:	02202021 	addu	a0,s1,zero
+   31cd4:	00402821 	addu	a1,v0,zero
+   31cd8:	02202021 	addu	a0,s1,zero
+   31cdc:	0c00490f 	jal	1243c <signal_rise>
+   31ce0:	02003021 	addu	a2,s0,zero
+   31ce4:	1040ffe2 	beqz	v0,31c70 <kill_func+0x34>
+   31ce8:	8fbf0024 	lw	ra,36(sp)
+   31cec:	3c040004 	lui	a0,0x4
+   31cf0:	248480d4 	addiu	a0,a0,-32556
+   31cf4:	02002821 	addu	a1,s0,zero
+   31cf8:	02203021 	addu	a2,s1,zero
+   31cfc:	0c00ca4b 	jal	3292c <ksh_print>
+   31d00:	afa20010 	sw	v0,16(sp)
+   31d04:	0800c71b 	j	31c6c <kill_func+0x30>
+   31d08:	8fa20010 	lw	v0,16(sp)
+
+00031d0c <ksh_cpu_state_func>:
+   31d0c:	3c020004 	lui	v0,0x4
+   31d10:	27bdfac8 	addiu	sp,sp,-1336
+   31d14:	2443c960 	addiu	v1,v0,-13984
+   31d18:	afb20520 	sw	s2,1312(sp)
+   31d1c:	88720003 	lwl	s2,3(v1)
+   31d20:	afb1051c 	sw	s1,1308(sp)
+   31d24:	9852c960 	lwr	s2,-13984(v0)
+   31d28:	3c020004 	lui	v0,0x4
+   31d2c:	8c5171b4 	lw	s1,29108(v0)
+   31d30:	3252ffff 	andi	s2,s2,0xffff
+   31d34:	3c040004 	lui	a0,0x4
+   31d38:	248480fc 	addiu	a0,a0,-32516
+   31d3c:	02402821 	addu	a1,s2,zero
+   31d40:	afbf0534 	sw	ra,1332(sp)
+   31d44:	afb60530 	sw	s6,1328(sp)
+   31d48:	afb5052c 	sw	s5,1324(sp)
+   31d4c:	afb40528 	sw	s4,1320(sp)
+   31d50:	afb30524 	sw	s3,1316(sp)
+   31d54:	0c00ca4b 	jal	3292c <ksh_print>
+   31d58:	afb00518 	sw	s0,1304(sp)
+   31d5c:	12200012 	beqz	s1,31da8 <ksh_cpu_state_func+0x9c>
+   31d60:	3c160004 	lui	s6,0x4
+   31d64:	26d6810c 	addiu	s6,s6,-32500
+   31d68:	27b50054 	addiu	s5,sp,84
+   31d6c:	00008021 	addu	s0,zero,zero
+   31d70:	27b40010 	addiu	s4,sp,16
+   31d74:	24130002 	addiu	s3,zero,2
+   31d78:	02003821 	addu	a3,s0,zero
+   31d7c:	02c02821 	addu	a1,s6,zero
+   31d80:	02403021 	addu	a2,s2,zero
+   31d84:	02a02021 	addu	a0,s5,zero
+   31d88:	afb30010 	sw	s3,16(sp)
+   31d8c:	0c00c414 	jal	31050 <sprintk>
+   31d90:	26100001 	addiu	s0,s0,1
+   31d94:	0c00c501 	jal	31404 <cat_func>
+   31d98:	02802021 	addu	a0,s4,zero
+   31d9c:	0211102b 	sltu	v0,s0,s1
+   31da0:	1440fff6 	bnez	v0,31d7c <ksh_cpu_state_func+0x70>
+   31da4:	02003821 	addu	a3,s0,zero
+   31da8:	8fbf0534 	lw	ra,1332(sp)
+   31dac:	00001021 	addu	v0,zero,zero
+   31db0:	8fb60530 	lw	s6,1328(sp)
+   31db4:	8fb5052c 	lw	s5,1324(sp)
+   31db8:	8fb40528 	lw	s4,1320(sp)
+   31dbc:	8fb30524 	lw	s3,1316(sp)
+   31dc0:	8fb20520 	lw	s2,1312(sp)
+   31dc4:	8fb1051c 	lw	s1,1308(sp)
+   31dc8:	8fb00518 	lw	s0,1304(sp)
+   31dcc:	03e00008 	jr	ra
+   31dd0:	27bd0538 	addiu	sp,sp,1336
+
+00031dd4 <ksh_set_tty_func>:
+   31dd4:	8c830000 	lw	v1,0(a0)
+   31dd8:	27bdffe8 	addiu	sp,sp,-24
+   31ddc:	24020002 	addiu	v0,zero,2
+   31de0:	1062000a 	beq	v1,v0,31e0c <ksh_set_tty_func+0x38>
+   31de4:	afbf0014 	sw	ra,20(sp)
+   31de8:	3c040004 	lui	a0,0x4
+   31dec:	3c050004 	lui	a1,0x4
+   31df0:	24848124 	addiu	a0,a0,-32476
+   31df4:	0c00ca4b 	jal	3292c <ksh_print>
+   31df8:	24a58150 	addiu	a1,a1,-32432
+   31dfc:	8fbf0014 	lw	ra,20(sp)
+   31e00:	24020016 	addiu	v0,zero,22
+   31e04:	03e00008 	jr	ra
+   31e08:	27bd0018 	addiu	sp,sp,24
+   31e0c:	0c00b873 	jal	2e1cc <atoi>
+   31e10:	24840044 	addiu	a0,a0,68
+   31e14:	00403021 	addu	a2,v0,zero
+   31e18:	2402ffff 	addiu	v0,zero,-1
+   31e1c:	10c2fff2 	beq	a2,v0,31de8 <ksh_set_tty_func+0x14>
+   31e20:	28c20020 	slti	v0,a2,32
+   31e24:	1040000c 	beqz	v0,31e58 <ksh_set_tty_func+0x84>
+   31e28:	3c020004 	lui	v0,0x4
+   31e2c:	00061880 	sll	v1,a2,0x2
+   31e30:	2442bc18 	addiu	v0,v0,-17384
+   31e34:	00621021 	addu	v0,v1,v0
+   31e38:	8c420000 	lw	v0,0(v0)
+   31e3c:	10400006 	beqz	v0,31e58 <ksh_set_tty_func+0x84>
+   31e40:	8fbf0014 	lw	ra,20(sp)
+   31e44:	3c020004 	lui	v0,0x4
+   31e48:	ac46c70c 	sw	a2,-14580(v0)
+   31e4c:	27bd0018 	addiu	sp,sp,24
+   31e50:	03e00008 	jr	ra
+   31e54:	00001021 	addu	v0,zero,zero
+   31e58:	3c040004 	lui	a0,0x4
+   31e5c:	3c050004 	lui	a1,0x4
+   31e60:	24848138 	addiu	a0,a0,-32456
+   31e64:	0c00ca4b 	jal	3292c <ksh_print>
+   31e68:	24a58150 	addiu	a1,a1,-32432
+   31e6c:	8fbf0014 	lw	ra,20(sp)
+   31e70:	24020016 	addiu	v0,zero,22
+   31e74:	03e00008 	jr	ra
+   31e78:	27bd0018 	addiu	sp,sp,24
+
+00031e7c <show2>:
+   31e7c:	27bdffe0 	addiu	sp,sp,-32
+   31e80:	afb00014 	sw	s0,20(sp)
+   31e84:	3c100004 	lui	s0,0x4
+   31e88:	26048164 	addiu	a0,s0,-32412
+   31e8c:	afbf001c 	sw	ra,28(sp)
+   31e90:	0c00ca4b 	jal	3292c <ksh_print>
+   31e94:	afb10018 	sw	s1,24(sp)
+   31e98:	3c110004 	lui	s1,0x4
+   31e9c:	3c040004 	lui	a0,0x4
+   31ea0:	2625c570 	addiu	a1,s1,-14992
+   31ea4:	24848184 	addiu	a0,a0,-32380
+   31ea8:	0c00ca4b 	jal	3292c <ksh_print>
+   31eac:	2631c570 	addiu	s1,s1,-14992
+   31eb0:	8e220100 	lw	v0,256(s1)
+   31eb4:	30430001 	andi	v1,v0,0x1
+   31eb8:	14600017 	bnez	v1,31f18 <show2+0x9c>
+   31ebc:	30420002 	andi	v0,v0,0x2
+   31ec0:	1440000b 	bnez	v0,31ef0 <show2+0x74>
+   31ec4:	3c040004 	lui	a0,0x4
+   31ec8:	3c050004 	lui	a1,0x4
+   31ecc:	248481b8 	addiu	a0,a0,-32328
+   31ed0:	0c00ca4b 	jal	3292c <ksh_print>
+   31ed4:	24a581a0 	addiu	a1,a1,-32352
+   31ed8:	26048164 	addiu	a0,s0,-32412
+   31edc:	8fbf001c 	lw	ra,28(sp)
+   31ee0:	8fb10018 	lw	s1,24(sp)
+   31ee4:	8fb00014 	lw	s0,20(sp)
+   31ee8:	0800ca4b 	j	3292c <ksh_print>
+   31eec:	27bd0020 	addiu	sp,sp,32
+   31ef0:	3c050004 	lui	a1,0x4
+   31ef4:	248481b8 	addiu	a0,a0,-32328
+   31ef8:	0c00ca4b 	jal	3292c <ksh_print>
+   31efc:	24a581ac 	addiu	a1,a1,-32340
+   31f00:	26048164 	addiu	a0,s0,-32412
+   31f04:	8fbf001c 	lw	ra,28(sp)
+   31f08:	8fb10018 	lw	s1,24(sp)
+   31f0c:	8fb00014 	lw	s0,20(sp)
+   31f10:	0800ca4b 	j	3292c <ksh_print>
+   31f14:	27bd0020 	addiu	sp,sp,32
+   31f18:	3c050004 	lui	a1,0x4
+   31f1c:	3c040004 	lui	a0,0x4
+   31f20:	248481b8 	addiu	a0,a0,-32328
+   31f24:	0c00ca4b 	jal	3292c <ksh_print>
+   31f28:	24a58198 	addiu	a1,a1,-32360
+   31f2c:	26048164 	addiu	a0,s0,-32412
+   31f30:	8fbf001c 	lw	ra,28(sp)
+   31f34:	8fb10018 	lw	s1,24(sp)
+   31f38:	8fb00014 	lw	s0,20(sp)
+   31f3c:	0800ca4b 	j	3292c <ksh_print>
+   31f40:	27bd0020 	addiu	sp,sp,32
+
+00031f44 <show1>:
+   31f44:	27bdffe0 	addiu	sp,sp,-32
+   31f48:	afb00014 	sw	s0,20(sp)
+   31f4c:	3c100004 	lui	s0,0x4
+   31f50:	26048164 	addiu	a0,s0,-32412
+   31f54:	afbf001c 	sw	ra,28(sp)
+   31f58:	0c00ca4b 	jal	3292c <ksh_print>
+   31f5c:	afb10018 	sw	s1,24(sp)
+   31f60:	3c110004 	lui	s1,0x4
+   31f64:	3c040004 	lui	a0,0x4
+   31f68:	2625c570 	addiu	a1,s1,-14992
+   31f6c:	248481c4 	addiu	a0,a0,-32316
+   31f70:	0c00ca4b 	jal	3292c <ksh_print>
+   31f74:	2631c570 	addiu	s1,s1,-14992
+   31f78:	8e220100 	lw	v0,256(s1)
+   31f7c:	30430001 	andi	v1,v0,0x1
+   31f80:	14600017 	bnez	v1,31fe0 <show1+0x9c>
+   31f84:	30420002 	andi	v0,v0,0x2
+   31f88:	1440000b 	bnez	v0,31fb8 <show1+0x74>
+   31f8c:	3c040004 	lui	a0,0x4
+   31f90:	3c050004 	lui	a1,0x4
+   31f94:	248481d4 	addiu	a0,a0,-32300
+   31f98:	0c00ca4b 	jal	3292c <ksh_print>
+   31f9c:	24a581a0 	addiu	a1,a1,-32352
+   31fa0:	26048164 	addiu	a0,s0,-32412
+   31fa4:	8fbf001c 	lw	ra,28(sp)
+   31fa8:	8fb10018 	lw	s1,24(sp)
+   31fac:	8fb00014 	lw	s0,20(sp)
+   31fb0:	0800ca4b 	j	3292c <ksh_print>
+   31fb4:	27bd0020 	addiu	sp,sp,32
+   31fb8:	3c050004 	lui	a1,0x4
+   31fbc:	248481d4 	addiu	a0,a0,-32300
+   31fc0:	0c00ca4b 	jal	3292c <ksh_print>
+   31fc4:	24a581ac 	addiu	a1,a1,-32340
+   31fc8:	26048164 	addiu	a0,s0,-32412
+   31fcc:	8fbf001c 	lw	ra,28(sp)
+   31fd0:	8fb10018 	lw	s1,24(sp)
+   31fd4:	8fb00014 	lw	s0,20(sp)
+   31fd8:	0800ca4b 	j	3292c <ksh_print>
+   31fdc:	27bd0020 	addiu	sp,sp,32
+   31fe0:	3c050004 	lui	a1,0x4
+   31fe4:	3c040004 	lui	a0,0x4
+   31fe8:	248481d4 	addiu	a0,a0,-32300
+   31fec:	0c00ca4b 	jal	3292c <ksh_print>
+   31ff0:	24a58198 	addiu	a1,a1,-32360
+   31ff4:	26048164 	addiu	a0,s0,-32412
+   31ff8:	8fbf001c 	lw	ra,28(sp)
+   31ffc:	8fb10018 	lw	s1,24(sp)
+   32000:	8fb00014 	lw	s0,20(sp)
+   32004:	0800ca4b 	j	3292c <ksh_print>
+   32008:	27bd0020 	addiu	sp,sp,32
+
+0003200c <show3>:
+   3200c:	27bdffe8 	addiu	sp,sp,-24
+   32010:	afb00010 	sw	s0,16(sp)
+   32014:	3c040004 	lui	a0,0x4
+   32018:	3c100004 	lui	s0,0x4
+   3201c:	2605c570 	addiu	a1,s0,-14992
+   32020:	248481e0 	addiu	a0,a0,-32288
+   32024:	afbf0014 	sw	ra,20(sp)
+   32028:	0c00ca4b 	jal	3292c <ksh_print>
+   3202c:	2610c570 	addiu	s0,s0,-14992
+   32030:	8e020100 	lw	v0,256(s0)
+   32034:	24030002 	addiu	v1,zero,2
+   32038:	10430025 	beq	v0,v1,320d0 <show3+0xc4>
+   3203c:	2c430003 	sltiu	v1,v0,3
+   32040:	1060000d 	beqz	v1,32078 <show3+0x6c>
+   32044:	24030004 	addiu	v1,zero,4
+   32048:	24030001 	addiu	v1,zero,1
+   3204c:	10430029 	beq	v0,v1,320f4 <show3+0xe8>
+   32050:	00000000 	sll	zero,zero,0x0
+   32054:	3c040004 	lui	a0,0x4
+   32058:	0c00ca4b 	jal	3292c <ksh_print>
+   3205c:	24848208 	addiu	a0,a0,-32248
+   32060:	3c040003 	lui	a0,0x3
+   32064:	8fbf0014 	lw	ra,20(sp)
+   32068:	8fb00010 	lw	s0,16(sp)
+   3206c:	248451d4 	addiu	a0,a0,20948
+   32070:	0800ca4b 	j	3292c <ksh_print>
+   32074:	27bd0018 	addiu	sp,sp,24
+   32078:	1043000c 	beq	v0,v1,320ac <show3+0xa0>
+   3207c:	24030008 	addiu	v1,zero,8
+   32080:	1443fff4 	bne	v0,v1,32054 <show3+0x48>
+   32084:	00000000 	sll	zero,zero,0x0
+   32088:	3c040004 	lui	a0,0x4
+   3208c:	0c00ca4b 	jal	3292c <ksh_print>
+   32090:	248481f0 	addiu	a0,a0,-32272
+   32094:	3c040003 	lui	a0,0x3
+   32098:	8fbf0014 	lw	ra,20(sp)
+   3209c:	8fb00010 	lw	s0,16(sp)
+   320a0:	248451d4 	addiu	a0,a0,20948
+   320a4:	0800ca4b 	j	3292c <ksh_print>
+   320a8:	27bd0018 	addiu	sp,sp,24
+   320ac:	3c040004 	lui	a0,0x4
+   320b0:	0c00ca4b 	jal	3292c <ksh_print>
+   320b4:	248481fc 	addiu	a0,a0,-32260
+   320b8:	3c040003 	lui	a0,0x3
+   320bc:	8fbf0014 	lw	ra,20(sp)
+   320c0:	8fb00010 	lw	s0,16(sp)
+   320c4:	248451d4 	addiu	a0,a0,20948
+   320c8:	0800ca4b 	j	3292c <ksh_print>
+   320cc:	27bd0018 	addiu	sp,sp,24
+   320d0:	3c040004 	lui	a0,0x4
+   320d4:	0c00ca4b 	jal	3292c <ksh_print>
+   320d8:	248481e8 	addiu	a0,a0,-32280
+   320dc:	3c040003 	lui	a0,0x3
+   320e0:	8fbf0014 	lw	ra,20(sp)
+   320e4:	8fb00010 	lw	s0,16(sp)
+   320e8:	248451d4 	addiu	a0,a0,20948
+   320ec:	0800ca4b 	j	3292c <ksh_print>
+   320f0:	27bd0018 	addiu	sp,sp,24
+   320f4:	3c040004 	lui	a0,0x4
+   320f8:	0c00ca4b 	jal	3292c <ksh_print>
+   320fc:	24848198 	addiu	a0,a0,-32360
+   32100:	3c040003 	lui	a0,0x3
+   32104:	8fbf0014 	lw	ra,20(sp)
+   32108:	8fb00010 	lw	s0,16(sp)
+   3210c:	248451d4 	addiu	a0,a0,20948
+   32110:	0800ca4b 	j	3292c <ksh_print>
+   32114:	27bd0018 	addiu	sp,sp,24
+
+00032118 <ls_func>:
+   32118:	27bdff60 	addiu	sp,sp,-160
+   3211c:	afbe0098 	sw	s8,152(sp)
+   32120:	8c9e0000 	lw	s8,0(a0)
+   32124:	24020001 	addiu	v0,zero,1
+   32128:	afbf009c 	sw	ra,156(sp)
+   3212c:	afb70094 	sw	s7,148(sp)
+   32130:	afb60090 	sw	s6,144(sp)
+   32134:	afb5008c 	sw	s5,140(sp)
+   32138:	afb40088 	sw	s4,136(sp)
+   3213c:	afb30084 	sw	s3,132(sp)
+   32140:	afb20080 	sw	s2,128(sp)
+   32144:	afb1007c 	sw	s1,124(sp)
+   32148:	13c2005c 	beq	s8,v0,322bc <ls_func+0x1a4>
+   3214c:	afb00078 	sw	s0,120(sp)
+   32150:	2fc20002 	sltiu	v0,s8,2
+   32154:	1440004c 	bnez	v0,32288 <ls_func+0x170>
+   32158:	00001821 	addu	v1,zero,zero
+   3215c:	3c170001 	lui	s7,0x1
+   32160:	3c160001 	lui	s6,0x1
+   32164:	3c150001 	lui	s5,0x1
+   32168:	3c140001 	lui	s4,0x1
+   3216c:	24920044 	addiu	s2,a0,68
+   32170:	26f7c048 	addiu	s7,s7,-16312
+   32174:	26d6bff8 	addiu	s6,s6,-16392
+   32178:	26b5be08 	addiu	s5,s5,-16888
+   3217c:	2694bc88 	addiu	s4,s4,-17272
+   32180:	24130001 	addiu	s3,zero,1
+   32184:	27b10014 	addiu	s1,sp,20
+   32188:	27b00030 	addiu	s0,sp,48
+   3218c:	3c020008 	lui	v0,0x8
+   32190:	8c442704 	lw	a0,9988(v0)
+   32194:	3c020001 	lui	v0,0x1
+   32198:	2442bff0 	addiu	v0,v0,-16400
+   3219c:	02202821 	addu	a1,s1,zero
+   321a0:	00003021 	addu	a2,zero,zero
+   321a4:	02003821 	addu	a3,s0,zero
+   321a8:	afb20014 	sw	s2,20(sp)
+   321ac:	afb7001c 	sw	s7,28(sp)
+   321b0:	afb60020 	sw	s6,32(sp)
+   321b4:	afb50028 	sw	s5,40(sp)
+   321b8:	afb40024 	sw	s4,36(sp)
+   321bc:	afa2002c 	sw	v0,44(sp)
+   321c0:	0c00a58f 	jal	2963c <vfs_opendir>
+   321c4:	afa00018 	sw	zero,24(sp)
+   321c8:	1440002e 	bnez	v0,32284 <ls_func+0x16c>
+   321cc:	afa20070 	sw	v0,112(sp)
+   321d0:	3c040004 	lui	a0,0x4
+   321d4:	24848214 	addiu	a0,a0,-32236
+   321d8:	0c00ca4b 	jal	3292c <ksh_print>
+   321dc:	02402821 	addu	a1,s2,zero
+   321e0:	3c040004 	lui	a0,0x4
+   321e4:	24848228 	addiu	a0,a0,-32216
+   321e8:	0c00ca4b 	jal	3292c <ksh_print>
+   321ec:	02402821 	addu	a1,s2,zero
+   321f0:	3c020004 	lui	v0,0x4
+   321f4:	2442c570 	addiu	v0,v0,-14992
+   321f8:	afa20014 	sw	v0,20(sp)
+   321fc:	3c020001 	lui	v0,0x1
+   32200:	2442bc80 	addiu	v0,v0,-17280
+   32204:	afa2002c 	sw	v0,44(sp)
+   32208:	2402019c 	addiu	v0,zero,412
+   3220c:	afa00010 	sw	zero,16(sp)
+   32210:	afb7001c 	sw	s7,28(sp)
+   32214:	afb60020 	sw	s6,32(sp)
+   32218:	afb50028 	sw	s5,40(sp)
+   3221c:	afb40024 	sw	s4,36(sp)
+   32220:	0800c88e 	j	32238 <ls_func+0x120>
+   32224:	afa20018 	sw	v0,24(sp)
+   32228:	8fa20010 	lw	v0,16(sp)
+   3222c:	24420001 	addiu	v0,v0,1
+   32230:	0c00c803 	jal	3200c <show3>
+   32234:	afa20010 	sw	v0,16(sp)
+   32238:	02002021 	addu	a0,s0,zero
+   3223c:	0c00a79c 	jal	29e70 <vfs_readdir>
+   32240:	02202821 	addu	a1,s1,zero
+   32244:	1040fff8 	beqz	v0,32228 <ls_func+0x110>
+   32248:	8fa50010 	lw	a1,16(sp)
+   3224c:	3c040004 	lui	a0,0x4
+   32250:	2484823c 	addiu	a0,a0,-32196
+   32254:	0c00ca4b 	jal	3292c <ksh_print>
+   32258:	afa20074 	sw	v0,116(sp)
+   3225c:	02002021 	addu	a0,s0,zero
+   32260:	0c009f74 	jal	27dd0 <vfs_closedir>
+   32264:	27a50010 	addiu	a1,sp,16
+   32268:	8fa30074 	lw	v1,116(sp)
+   3226c:	2402007d 	addiu	v0,zero,125
+   32270:	14620005 	bne	v1,v0,32288 <ls_func+0x170>
+   32274:	26730001 	addiu	s3,s3,1
+   32278:	027e102b 	sltu	v0,s3,s8
+   3227c:	1440ffc3 	bnez	v0,3218c <ls_func+0x74>
+   32280:	26520040 	addiu	s2,s2,64
+   32284:	8fa30070 	lw	v1,112(sp)
+   32288:	8fbf009c 	lw	ra,156(sp)
+   3228c:	00601021 	addu	v0,v1,zero
+   32290:	8fbe0098 	lw	s8,152(sp)
+   32294:	8fb70094 	lw	s7,148(sp)
+   32298:	8fb60090 	lw	s6,144(sp)
+   3229c:	8fb5008c 	lw	s5,140(sp)
+   322a0:	8fb40088 	lw	s4,136(sp)
+   322a4:	8fb30084 	lw	s3,132(sp)
+   322a8:	8fb20080 	lw	s2,128(sp)
+   322ac:	8fb1007c 	lw	s1,124(sp)
+   322b0:	8fb00078 	lw	s0,120(sp)
+   322b4:	03e00008 	jr	ra
+   322b8:	27bd00a0 	addiu	sp,sp,160
+   322bc:	2402002e 	addiu	v0,zero,46
+   322c0:	a0820044 	sb	v0,68(a0)
+   322c4:	a0800045 	sb	zero,69(a0)
+   322c8:	0800c857 	j	3215c <ls_func+0x44>
+   322cc:	241e0002 	addiu	s8,zero,2
+   322d0:	3c040004 	lui	a0,0x4
+   322d4:	27bdffe0 	addiu	sp,sp,-32
+   322d8:	24848248 	addiu	a0,a0,-32184
+   322dc:	afbf001c 	sw	ra,28(sp)
+   322e0:	afb10018 	sw	s1,24(sp)
+   322e4:	0c00ca4b 	jal	3292c <ksh_print>
+   322e8:	afb00014 	sw	s0,20(sp)
+   322ec:	3c020004 	lui	v0,0x4
+   322f0:	8c458528 	lw	a1,-31448(v0)
+   322f4:	10a0000a 	beqz	a1,32320 <ls_func+0x208>
+   322f8:	3c100004 	lui	s0,0x4
+   322fc:	3c110004 	lui	s1,0x4
+   32300:	2610852c 	addiu	s0,s0,-31444
+   32304:	26318260 	addiu	s1,s1,-32160
+   32308:	8e060000 	lw	a2,0(s0)
+   3230c:	0c00ca4b 	jal	3292c <ksh_print>
+   32310:	02202021 	addu	a0,s1,zero
+   32314:	8e050008 	lw	a1,8(s0)
+   32318:	14a0fffb 	bnez	a1,32308 <ls_func+0x1f0>
+   3231c:	2610000c 	addiu	s0,s0,12
+   32320:	3c040004 	lui	a0,0x4
+   32324:	0c00ca4b 	jal	3292c <ksh_print>
+   32328:	24848268 	addiu	a0,a0,-32152
+   3232c:	8fbf001c 	lw	ra,28(sp)
+   32330:	00001021 	addu	v0,zero,zero
+   32334:	8fb10018 	lw	s1,24(sp)
+   32338:	8fb00014 	lw	s0,20(sp)
+   3233c:	03e00008 	jr	ra
+   32340:	27bd0020 	addiu	sp,sp,32
+
+00032344 <print_args>:
+   32344:	27bdffd0 	addiu	sp,sp,-48
+   32348:	afb50024 	sw	s5,36(sp)
+   3234c:	afb40020 	sw	s4,32(sp)
+   32350:	afb3001c 	sw	s3,28(sp)
+   32354:	3c140004 	lui	s4,0x4
+   32358:	3c150004 	lui	s5,0x4
+   3235c:	3c130004 	lui	s3,0x4
+   32360:	afb60028 	sw	s6,40(sp)
+   32364:	afb20018 	sw	s2,24(sp)
+   32368:	afb10014 	sw	s1,20(sp)
+   3236c:	afb00010 	sw	s0,16(sp)
+   32370:	afbf002c 	sw	ra,44(sp)
+   32374:	0080b021 	addu	s6,a0,zero
+   32378:	269482a0 	addiu	s4,s4,-32096
+   3237c:	26b582b0 	addiu	s5,s5,-32080
+   32380:	267382a8 	addiu	s3,s3,-32088
+   32384:	24910004 	addiu	s1,a0,4
+   32388:	00008021 	addu	s0,zero,zero
+   3238c:	0800c8e9 	j	323a4 <print_args+0x60>
+   32390:	24120014 	addiu	s2,zero,20
+   32394:	0c00ca4b 	jal	3292c <ksh_print>
+   32398:	26100001 	addiu	s0,s0,1
+   3239c:	1212000c 	beq	s0,s2,323d0 <print_args+0x8c>
+   323a0:	26310040 	addiu	s1,s1,64
+   323a4:	02002821 	addu	a1,s0,zero
+   323a8:	0c00ca4b 	jal	3292c <ksh_print>
+   323ac:	02802021 	addu	a0,s4,zero
+   323b0:	02602021 	addu	a0,s3,zero
+   323b4:	1620fff7 	bnez	s1,32394 <print_args+0x50>
+   323b8:	02202821 	addu	a1,s1,zero
+   323bc:	02a02021 	addu	a0,s5,zero
+   323c0:	0c00ca4b 	jal	3292c <ksh_print>
+   323c4:	26100001 	addiu	s0,s0,1
+   323c8:	1612fff6 	bne	s0,s2,323a4 <print_args+0x60>
+   323cc:	26310040 	addiu	s1,s1,64
+   323d0:	8ec50000 	lw	a1,0(s6)
+   323d4:	3c040004 	lui	a0,0x4
+   323d8:	8fbf002c 	lw	ra,44(sp)
+   323dc:	8fb60028 	lw	s6,40(sp)
+   323e0:	8fb50024 	lw	s5,36(sp)
+   323e4:	8fb40020 	lw	s4,32(sp)
+   323e8:	8fb3001c 	lw	s3,28(sp)
+   323ec:	8fb20018 	lw	s2,24(sp)
+   323f0:	8fb10014 	lw	s1,20(sp)
+   323f4:	8fb00010 	lw	s0,16(sp)
+   323f8:	248482b8 	addiu	a0,a0,-32072
+   323fc:	0800ca4b 	j	3292c <ksh_print>
+   32400:	27bd0030 	addiu	sp,sp,48
+
+00032404 <kMiniShelld>:
+   32404:	27bdffc8 	addiu	sp,sp,-56
+   32408:	afbf0034 	sw	ra,52(sp)
+   3240c:	afbe0030 	sw	s8,48(sp)
+   32410:	afb7002c 	sw	s7,44(sp)
+   32414:	afb60028 	sw	s6,40(sp)
+   32418:	afb50024 	sw	s5,36(sp)
+   3241c:	afb40020 	sw	s4,32(sp)
+   32420:	afb3001c 	sw	s3,28(sp)
+   32424:	afb20018 	sw	s2,24(sp)
+   32428:	afb10014 	sw	s1,20(sp)
+   3242c:	afb00010 	sw	s0,16(sp)
+   32430:	40022002 	mfc0	v0,$4,2
+   32434:	3c100008 	lui	s0,0x8
+   32438:	8c510180 	lw	s1,384(v0)
+   3243c:	260411d0 	addiu	a0,s0,4560
+   32440:	00002821 	addu	a1,zero,zero
+   32444:	0c00c182 	jal	30608 <memset>
+   32448:	24060504 	addiu	a2,zero,1284
+   3244c:	3c030004 	lui	v1,0x4
+   32450:	2634054c 	addiu	s4,s1,1356
+   32454:	3c020008 	lui	v0,0x8
+   32458:	26310510 	addiu	s1,s1,1296
+   3245c:	3c150008 	lui	s5,0x8
+   32460:	3c120008 	lui	s2,0x8
+   32464:	3c1e0004 	lui	s8,0x4
+   32468:	3c160004 	lui	s6,0x4
+   3246c:	8c738528 	lw	s3,-31448(v1)
+   32470:	ac512700 	sw	s1,9984(v0)
+   32474:	aeb42704 	sw	s4,9988(s5)
+   32478:	265211d4 	addiu	s2,s2,4564
+   3247c:	261711d0 	addiu	s7,s0,4560
+   32480:	27de82ec 	addiu	s8,s8,-32020
+   32484:	26d68534 	addiu	s6,s6,-31436
+   32488:	02801021 	addu	v0,s4,zero
+   3248c:	02801821 	addu	v1,s4,zero
+   32490:	24440030 	addiu	a0,v0,48
+   32494:	8c480000 	lw	t0,0(v0)
+   32498:	8c470004 	lw	a3,4(v0)
+   3249c:	8c460008 	lw	a2,8(v0)
+   324a0:	8c45000c 	lw	a1,12(v0)
+   324a4:	24420010 	addiu	v0,v0,16
+   324a8:	ac680000 	sw	t0,0(v1)
+   324ac:	ac670004 	sw	a3,4(v1)
+   324b0:	ac660008 	sw	a2,8(v1)
+   324b4:	ac65000c 	sw	a1,12(v1)
+   324b8:	1444fff6 	bne	v0,a0,32494 <kMiniShelld+0x90>
+   324bc:	24630010 	addiu	v1,v1,16
+   324c0:	8c450008 	lw	a1,8(v0)
+   324c4:	8c440000 	lw	a0,0(v0)
+   324c8:	8c420004 	lw	v0,4(v0)
+   324cc:	ac650008 	sw	a1,8(v1)
+   324d0:	ac640000 	sw	a0,0(v1)
+   324d4:	3c050004 	lui	a1,0x4
+   324d8:	3c040004 	lui	a0,0x4
+   324dc:	248482c4 	addiu	a0,a0,-32060
+   324e0:	ac620004 	sw	v0,4(v1)
+   324e4:	0c00ca4b 	jal	3292c <ksh_print>
+   324e8:	24a5851c 	addiu	a1,a1,-31460
+   324ec:	0c00ca0a 	jal	32828 <cmdLineAnalyser>
+   324f0:	02e02021 	addu	a0,s7,zero
+   324f4:	1260001c 	beqz	s3,32568 <kMiniShelld+0x164>
+   324f8:	02c08821 	addu	s1,s6,zero
+   324fc:	02602821 	addu	a1,s3,zero
+   32500:	0800c946 	j	32518 <kMiniShelld+0x114>
+   32504:	00008021 	addu	s0,zero,zero
+   32508:	8e250000 	lw	a1,0(s1)
+   3250c:	26100001 	addiu	s0,s0,1
+   32510:	10a00015 	beqz	a1,32568 <kMiniShelld+0x164>
+   32514:	2631000c 	addiu	s1,s1,12
+   32518:	0c00c445 	jal	31114 <strcmp>
+   3251c:	02402021 	addu	a0,s2,zero
+   32520:	1440fff9 	bnez	v0,32508 <kMiniShelld+0x104>
+   32524:	00101100 	sll	v0,s0,0x4
+   32528:	00108080 	sll	s0,s0,0x2
+   3252c:	00508023 	subu	s0,v0,s0
+   32530:	3c020004 	lui	v0,0x4
+   32534:	24428528 	addiu	v0,v0,-31448
+   32538:	02028021 	addu	s0,s0,v0
+   3253c:	8e020008 	lw	v0,8(s0)
+   32540:	0040f809 	jalr	v0
+   32544:	02e02021 	addu	a0,s7,zero
+   32548:	14400003 	bnez	v0,32558 <kMiniShelld+0x154>
+   3254c:	00000000 	sll	zero,zero,0x0
+   32550:	0800c923 	j	3248c <kMiniShelld+0x88>
+   32554:	8ea22704 	lw	v0,9988(s5)
+   32558:	0c00c6f4 	jal	31bd0 <print_error_msg>
+   3255c:	00402021 	addu	a0,v0,zero
+   32560:	0800c923 	j	3248c <kMiniShelld+0x88>
+   32564:	8ea22704 	lw	v0,9988(s5)
+   32568:	02402021 	addu	a0,s2,zero
+   3256c:	0c00c445 	jal	31114 <strcmp>
+   32570:	03c02821 	addu	a1,s8,zero
+   32574:	10400007 	beqz	v0,32594 <kMiniShelld+0x190>
+   32578:	3c040004 	lui	a0,0x4
+   3257c:	3c040004 	lui	a0,0x4
+   32580:	248482cc 	addiu	a0,a0,-32052
+   32584:	0c00ca4b 	jal	3292c <ksh_print>
+   32588:	02402821 	addu	a1,s2,zero
+   3258c:	0800c923 	j	3248c <kMiniShelld+0x88>
+   32590:	8ea22704 	lw	v0,9988(s5)
+   32594:	0c00ca4b 	jal	3292c <ksh_print>
+   32598:	248482e0 	addiu	a0,a0,-32032
+   3259c:	8fbf0034 	lw	ra,52(sp)
+   325a0:	00001021 	addu	v0,zero,zero
+   325a4:	8fbe0030 	lw	s8,48(sp)
+   325a8:	8fb7002c 	lw	s7,44(sp)
+   325ac:	8fb60028 	lw	s6,40(sp)
+   325b0:	8fb50024 	lw	s5,36(sp)
+   325b4:	8fb40020 	lw	s4,32(sp)
+   325b8:	8fb3001c 	lw	s3,28(sp)
+   325bc:	8fb20018 	lw	s2,24(sp)
+   325c0:	8fb10014 	lw	s1,20(sp)
+   325c4:	8fb00010 	lw	s0,16(sp)
+   325c8:	03e00008 	jr	ra
+   325cc:	27bd0038 	addiu	sp,sp,56
+
+000325d0 <getChar>:
+   325d0:	3c020004 	lui	v0,0x4
+   325d4:	8c43c70c 	lw	v1,-14580(v0)
+   325d8:	3c020004 	lui	v0,0x4
+   325dc:	00031880 	sll	v1,v1,0x2
+   325e0:	2442bc18 	addiu	v0,v0,-17384
+   325e4:	27bdff78 	addiu	sp,sp,-136
+   325e8:	00621021 	addu	v0,v1,v0
+   325ec:	afb40080 	sw	s4,128(sp)
+   325f0:	afb3007c 	sw	s3,124(sp)
+   325f4:	afb20078 	sw	s2,120(sp)
+   325f8:	afb10074 	sw	s1,116(sp)
+   325fc:	afb00070 	sw	s0,112(sp)
+   32600:	afbf0084 	sw	ra,132(sp)
+   32604:	8c510000 	lw	s1,0(v0)
+   32608:	a3a00010 	sb	zero,16(sp)
+   3260c:	27b30010 	addiu	s3,sp,16
+   32610:	27b20014 	addiu	s2,sp,20
+   32614:	24100001 	addiu	s0,zero,1
+   32618:	0800c98a 	j	32628 <getChar+0x58>
+   3261c:	2414ffff 	addiu	s4,zero,-1
+   32620:	1054000b 	beq	v0,s4,32650 <getChar+0x80>
+   32624:	83a20010 	lb	v0,16(sp)
+   32628:	afb30018 	sw	s3,24(sp)
+   3262c:	afb0001c 	sw	s0,28(sp)
+   32630:	afa00020 	sw	zero,32(sp)
+   32634:	8e220034 	lw	v0,52(s1)
+   32638:	02202021 	addu	a0,s1,zero
+   3263c:	0040f809 	jalr	v0
+   32640:	02402821 	addu	a1,s2,zero
+   32644:	1450fff6 	bne	v0,s0,32620 <getChar+0x50>
+   32648:	8fbf0084 	lw	ra,132(sp)
+   3264c:	83a20010 	lb	v0,16(sp)
+   32650:	8fb40080 	lw	s4,128(sp)
+   32654:	8fb3007c 	lw	s3,124(sp)
+   32658:	8fb20078 	lw	s2,120(sp)
+   3265c:	8fb10074 	lw	s1,116(sp)
+   32660:	8fb00070 	lw	s0,112(sp)
+   32664:	03e00008 	jr	ra
+   32668:	27bd0088 	addiu	sp,sp,136
+
+0003266c <ksh_getLine>:
+   3266c:	3c020004 	lui	v0,0x4
+   32670:	8c43c70c 	lw	v1,-14580(v0)
+   32674:	3c020004 	lui	v0,0x4
+   32678:	00031880 	sll	v1,v1,0x2
+   3267c:	2442bc18 	addiu	v0,v0,-17384
+   32680:	00621021 	addu	v0,v1,v0
+   32684:	27bdff88 	addiu	sp,sp,-120
+   32688:	8c430000 	lw	v1,0(v0)
+   3268c:	afbf0074 	sw	ra,116(sp)
+   32690:	afa40014 	sw	a0,20(sp)
+   32694:	afa50018 	sw	a1,24(sp)
+   32698:	afa0001c 	sw	zero,28(sp)
+   3269c:	8c620034 	lw	v0,52(v1)
+   326a0:	27a50010 	addiu	a1,sp,16
+   326a4:	0040f809 	jalr	v0
+   326a8:	00602021 	addu	a0,v1,zero
+   326ac:	8fbf0074 	lw	ra,116(sp)
+   326b0:	03e00008 	jr	ra
+   326b4:	27bd0078 	addiu	sp,sp,120
+
+000326b8 <ksh_write>:
+   326b8:	3c020004 	lui	v0,0x4
+   326bc:	8c43c70c 	lw	v1,-14580(v0)
+   326c0:	3c020004 	lui	v0,0x4
+   326c4:	00031880 	sll	v1,v1,0x2
+   326c8:	2442bc18 	addiu	v0,v0,-17384
+   326cc:	00621021 	addu	v0,v1,v0
+   326d0:	27bdff88 	addiu	sp,sp,-120
+   326d4:	8c430000 	lw	v1,0(v0)
+   326d8:	afbf0074 	sw	ra,116(sp)
+   326dc:	afa40010 	sw	a0,16(sp)
+   326e0:	afa50018 	sw	a1,24(sp)
+   326e4:	afa0001c 	sw	zero,28(sp)
+   326e8:	8c620038 	lw	v0,56(v1)
+   326ec:	27a50010 	addiu	a1,sp,16
+   326f0:	0040f809 	jalr	v0
+   326f4:	00602021 	addu	a0,v1,zero
+   326f8:	8fbf0074 	lw	ra,116(sp)
+   326fc:	03e00008 	jr	ra
+   32700:	27bd0078 	addiu	sp,sp,120
+
+00032704 <getString>:
+   32704:	27bdff40 	addiu	sp,sp,-192
+   32708:	afb00098 	sw	s0,152(sp)
+   3270c:	afbf00bc 	sw	ra,188(sp)
+   32710:	afbe00b8 	sw	s8,184(sp)
+   32714:	afb700b4 	sw	s7,180(sp)
+   32718:	afb600b0 	sw	s6,176(sp)
+   3271c:	afb500ac 	sw	s5,172(sp)
+   32720:	afb400a8 	sw	s4,168(sp)
+   32724:	afb300a4 	sw	s3,164(sp)
+   32728:	afb200a0 	sw	s2,160(sp)
+   3272c:	afb1009c 	sw	s1,156(sp)
+   32730:	10a0003b 	beqz	a1,32820 <getString+0x11c>
+   32734:	00a08021 	addu	s0,a1,zero
+   32738:	00808821 	addu	s1,a0,zero
+   3273c:	27b60010 	addiu	s6,sp,16
+   32740:	2412000d 	addiu	s2,zero,13
+   32744:	2413000a 	addiu	s3,zero,10
+   32748:	2414007f 	addiu	s4,zero,127
+   3274c:	24150008 	addiu	s5,zero,8
+   32750:	02c02021 	addu	a0,s6,zero
+   32754:	0c00c99b 	jal	3266c <ksh_getLine>
+   32758:	24050080 	addiu	a1,zero,128
+   3275c:	1840002c 	blez	v0,32810 <getString+0x10c>
+   32760:	00401821 	addu	v1,v0,zero
+   32764:	12000014 	beqz	s0,327b8 <getString+0xb4>
+   32768:	02c0f021 	addu	s8,s6,zero
+   3276c:	83d70000 	lb	s7,0(s8)
+   32770:	12f2000d 	beq	s7,s2,327a8 <getString+0xa4>
+   32774:	02e02021 	addu	a0,s7,zero
+   32778:	12f3000f 	beq	s7,s3,327b8 <getString+0xb4>
+   3277c:	00000000 	sll	zero,zero,0x0
+   32780:	0c00b954 	jal	2e550 <isprint>
+   32784:	afa30090 	sw	v1,144(sp)
+   32788:	1440001c 	bnez	v0,327fc <getString+0xf8>
+   3278c:	8fa30090 	lw	v1,144(sp)
+   32790:	12f40016 	beq	s7,s4,327ec <getString+0xe8>
+   32794:	00000000 	sll	zero,zero,0x0
+   32798:	12f50014 	beq	s7,s5,327ec <getString+0xe8>
+   3279c:	00000000 	sll	zero,zero,0x0
+   327a0:	24630001 	addiu	v1,v1,1
+   327a4:	26100001 	addiu	s0,s0,1
+   327a8:	18600019 	blez	v1,32810 <getString+0x10c>
+   327ac:	00000000 	sll	zero,zero,0x0
+   327b0:	1600ffee 	bnez	s0,3276c <getString+0x68>
+   327b4:	27de0001 	addiu	s8,s8,1
+   327b8:	a2200000 	sb	zero,0(s1)
+   327bc:	8fbf00bc 	lw	ra,188(sp)
+   327c0:	8fbe00b8 	lw	s8,184(sp)
+   327c4:	8fb700b4 	lw	s7,180(sp)
+   327c8:	8fb600b0 	lw	s6,176(sp)
+   327cc:	8fb500ac 	lw	s5,172(sp)
+   327d0:	8fb400a8 	lw	s4,168(sp)
+   327d4:	8fb300a4 	lw	s3,164(sp)
+   327d8:	8fb200a0 	lw	s2,160(sp)
+   327dc:	8fb1009c 	lw	s1,156(sp)
+   327e0:	8fb00098 	lw	s0,152(sp)
+   327e4:	03e00008 	jr	ra
+   327e8:	27bd00c0 	addiu	sp,sp,192
+   327ec:	2631ffff 	addiu	s1,s1,-1
+   327f0:	24630001 	addiu	v1,v1,1
+   327f4:	0800c9ea 	j	327a8 <getString+0xa4>
+   327f8:	26100001 	addiu	s0,s0,1
+   327fc:	2463ffff 	addiu	v1,v1,-1
+   32800:	a2370000 	sb	s7,0(s1)
+   32804:	2610ffff 	addiu	s0,s0,-1
+   32808:	1c60ffe9 	bgtz	v1,327b0 <getString+0xac>
+   3280c:	26310001 	addiu	s1,s1,1
+   32810:	1600ffd0 	bnez	s0,32754 <getString+0x50>
+   32814:	02c02021 	addu	a0,s6,zero
+   32818:	0800c9ef 	j	327bc <getString+0xb8>
+   3281c:	a2200000 	sb	zero,0(s1)
+   32820:	0800c9ee 	j	327b8 <getString+0xb4>
+   32824:	00808821 	addu	s1,a0,zero
+
+00032828 <cmdLineAnalyser>:
+   32828:	27bdff50 	addiu	sp,sp,-176
+   3282c:	afb10098 	sw	s1,152(sp)
+   32830:	27b10010 	addiu	s1,sp,16
+   32834:	afb00094 	sw	s0,148(sp)
+   32838:	24050080 	addiu	a1,zero,128
+   3283c:	00808021 	addu	s0,a0,zero
+   32840:	02202021 	addu	a0,s1,zero
+   32844:	afbf00ac 	sw	ra,172(sp)
+   32848:	afb500a8 	sw	s5,168(sp)
+   3284c:	afb400a4 	sw	s4,164(sp)
+   32850:	afb300a0 	sw	s3,160(sp)
+   32854:	0c00c9c1 	jal	32704 <getString>
+   32858:	afb2009c 	sw	s2,156(sp)
+   3285c:	83a40010 	lb	a0,16(sp)
+   32860:	10800030 	beqz	a0,32924 <cmdLineAnalyser+0xfc>
+   32864:	26140004 	addiu	s4,s0,4
+   32868:	00009821 	addu	s3,zero,zero
+   3286c:	0800ca20 	j	32880 <cmdLineAnalyser+0x58>
+   32870:	24150014 	addiu	s5,zero,20
+   32874:	82240000 	lb	a0,0(s1)
+   32878:	1080001e 	beqz	a0,328f4 <cmdLineAnalyser+0xcc>
+   3287c:	00131180 	sll	v0,s3,0x6
+   32880:	0c00b95d 	jal	2e574 <isspace>
+   32884:	00000000 	sll	zero,zero,0x0
+   32888:	1440fffa 	bnez	v0,32874 <cmdLineAnalyser+0x4c>
+   3288c:	26310001 	addiu	s1,s1,1
+   32890:	2631ffff 	addiu	s1,s1,-1
+   32894:	82240000 	lb	a0,0(s1)
+   32898:	10800015 	beqz	a0,328f0 <cmdLineAnalyser+0xc8>
+   3289c:	02809021 	addu	s2,s4,zero
+   328a0:	0800ca31 	j	328c4 <cmdLineAnalyser+0x9c>
+   328a4:	00000000 	sll	zero,zero,0x0
+   328a8:	92220000 	lbu	v0,0(s1)
+   328ac:	26310001 	addiu	s1,s1,1
+   328b0:	82240000 	lb	a0,0(s1)
+   328b4:	a2420000 	sb	v0,0(s2)
+   328b8:	26520001 	addiu	s2,s2,1
+   328bc:	10800006 	beqz	a0,328d8 <cmdLineAnalyser+0xb0>
+   328c0:	00801021 	addu	v0,a0,zero
+   328c4:	0c00b95d 	jal	2e574 <isspace>
+   328c8:	00000000 	sll	zero,zero,0x0
+   328cc:	1040fff6 	beqz	v0,328a8 <cmdLineAnalyser+0x80>
+   328d0:	00000000 	sll	zero,zero,0x0
+   328d4:	82220000 	lb	v0,0(s1)
+   328d8:	00402021 	addu	a0,v0,zero
+   328dc:	a2400000 	sb	zero,0(s2)
+   328e0:	10400003 	beqz	v0,328f0 <cmdLineAnalyser+0xc8>
+   328e4:	26730001 	addiu	s3,s3,1
+   328e8:	1675ffe5 	bne	s3,s5,32880 <cmdLineAnalyser+0x58>
+   328ec:	26940040 	addiu	s4,s4,64
+   328f0:	00131180 	sll	v0,s3,0x6
+   328f4:	02021021 	addu	v0,s0,v0
+   328f8:	a0400004 	sb	zero,4(v0)
+   328fc:	8fbf00ac 	lw	ra,172(sp)
+   32900:	ae130000 	sw	s3,0(s0)
+   32904:	8fb500a8 	lw	s5,168(sp)
+   32908:	8fb400a4 	lw	s4,164(sp)
+   3290c:	8fb300a0 	lw	s3,160(sp)
+   32910:	8fb2009c 	lw	s2,156(sp)
+   32914:	8fb10098 	lw	s1,152(sp)
+   32918:	8fb00094 	lw	s0,148(sp)
+   3291c:	03e00008 	jr	ra
+   32920:	27bd00b0 	addiu	sp,sp,176
+   32924:	0800ca3c 	j	328f0 <cmdLineAnalyser+0xc8>
+   32928:	00009821 	addu	s3,zero,zero
+
+0003292c <ksh_print>:
+   3292c:	27bdffd8 	addiu	sp,sp,-40
+   32930:	3c020004 	lui	v0,0x4
+   32934:	afbf0024 	sw	ra,36(sp)
+   32938:	afb00020 	sw	s0,32(sp)
+   3293c:	2443c960 	addiu	v1,v0,-13984
+   32940:	88630003 	lwl	v1,3(v1)
+   32944:	3c100004 	lui	s0,0x4
+   32948:	9843c960 	lwr	v1,-13984(v0)
+   3294c:	afa5002c 	sw	a1,44(sp)
+   32950:	27a2002c 	addiu	v0,sp,44
+   32954:	afa60030 	sw	a2,48(sp)
+   32958:	afa70034 	sw	a3,52(sp)
+   3295c:	3065ffff 	andi	a1,v1,0xffff
+   32960:	00803821 	addu	a3,a0,zero
+   32964:	24060001 	addiu	a2,zero,1
+   32968:	2604c74c 	addiu	a0,s0,-14516
+   3296c:	afa20010 	sw	v0,16(sp)
+   32970:	0c00bbbe 	jal	2eef8 <iprintk>
+   32974:	afa20018 	sw	v0,24(sp)
+   32978:	28440200 	slti	a0,v0,512
+   3297c:	240301ff 	addiu	v1,zero,511
+   32980:	0044180b 	movn	v1,v0,a0
+   32984:	2610c74c 	addiu	s0,s0,-14516
+   32988:	02002021 	addu	a0,s0,zero
+   3298c:	00708021 	addu	s0,v1,s0
+   32990:	a2000001 	sb	zero,1(s0)
+   32994:	0c00c9ae 	jal	326b8 <ksh_write>
+   32998:	00602821 	addu	a1,v1,zero
+   3299c:	8fbf0024 	lw	ra,36(sp)
+   329a0:	8fb00020 	lw	s0,32(sp)
+   329a4:	03e00008 	jr	ra
+   329a8:	27bd0028 	addiu	sp,sp,40
+
+000329ac <mkdir_func>:
+   329ac:	27bdffa8 	addiu	sp,sp,-88
+   329b0:	afb20038 	sw	s2,56(sp)
+   329b4:	8c920000 	lw	s2,0(a0)
+   329b8:	afbf0054 	sw	ra,84(sp)
+   329bc:	2e420002 	sltiu	v0,s2,2
+   329c0:	afbe0050 	sw	s8,80(sp)
+   329c4:	afb7004c 	sw	s7,76(sp)
+   329c8:	afb60048 	sw	s6,72(sp)
+   329cc:	afb50044 	sw	s5,68(sp)
+   329d0:	afb40040 	sw	s4,64(sp)
+   329d4:	afb3003c 	sw	s3,60(sp)
+   329d8:	afb10034 	sw	s1,52(sp)
+   329dc:	1440002c 	bnez	v0,32a90 <mkdir_func+0xe4>
+   329e0:	afb00030 	sw	s0,48(sp)
+   329e4:	3c1e0001 	lui	s8,0x1
+   329e8:	3c170001 	lui	s7,0x1
+   329ec:	3c160001 	lui	s6,0x1
+   329f0:	3c150001 	lui	s5,0x1
+   329f4:	24910044 	addiu	s1,a0,68
+   329f8:	27debff8 	addiu	s8,s8,-16392
+   329fc:	26f7be08 	addiu	s7,s7,-16888
+   32a00:	26d6bc88 	addiu	s6,s6,-17272
+   32a04:	26b5bff0 	addiu	s5,s5,-16400
+   32a08:	24100001 	addiu	s0,zero,1
+   32a0c:	3c140008 	lui	s4,0x8
+   32a10:	0800ca88 	j	32a20 <mkdir_func+0x74>
+   32a14:	27b30010 	addiu	s3,sp,16
+   32a18:	10600011 	beqz	v1,32a60 <mkdir_func+0xb4>
+   32a1c:	26310040 	addiu	s1,s1,64
+   32a20:	8e842704 	lw	a0,9988(s4)
+   32a24:	3c020001 	lui	v0,0x1
+   32a28:	2442c048 	addiu	v0,v0,-16312
+   32a2c:	02602821 	addu	a1,s3,zero
+   32a30:	00003021 	addu	a2,zero,zero
+   32a34:	26100001 	addiu	s0,s0,1
+   32a38:	afb10010 	sw	s1,16(sp)
+   32a3c:	afa20018 	sw	v0,24(sp)
+   32a40:	afbe001c 	sw	s8,28(sp)
+   32a44:	afb70024 	sw	s7,36(sp)
+   32a48:	afb60020 	sw	s6,32(sp)
+   32a4c:	afb50028 	sw	s5,40(sp)
+   32a50:	0c009f5b 	jal	27d6c <vfs_mkdir>
+   32a54:	afa00014 	sw	zero,20(sp)
+   32a58:	1040ffef 	beqz	v0,32a18 <mkdir_func+0x6c>
+   32a5c:	0212182b 	sltu	v1,s0,s2
+   32a60:	8fbf0054 	lw	ra,84(sp)
+   32a64:	8fbe0050 	lw	s8,80(sp)
+   32a68:	8fb7004c 	lw	s7,76(sp)
+   32a6c:	8fb60048 	lw	s6,72(sp)
+   32a70:	8fb50044 	lw	s5,68(sp)
+   32a74:	8fb40040 	lw	s4,64(sp)
+   32a78:	8fb3003c 	lw	s3,60(sp)
+   32a7c:	8fb20038 	lw	s2,56(sp)
+   32a80:	8fb10034 	lw	s1,52(sp)
+   32a84:	8fb00030 	lw	s0,48(sp)
+   32a88:	03e00008 	jr	ra
+   32a8c:	27bd0058 	addiu	sp,sp,88
+   32a90:	0800ca98 	j	32a60 <mkdir_func+0xb4>
+   32a94:	00001021 	addu	v0,zero,zero
+
+00032a98 <mkfifo_func>:
+   32a98:	03e00008 	jr	ra
+   32a9c:	24020026 	addiu	v0,zero,38
+
+00032aa0 <ppm_func>:
+   32aa0:	3c040004 	lui	a0,0x4
+   32aa4:	27bdffe8 	addiu	sp,sp,-24
+   32aa8:	afbf0014 	sw	ra,20(sp)
+   32aac:	0c007c87 	jal	1f21c <ppm_print>
+   32ab0:	24846e60 	addiu	a0,a0,28256
+   32ab4:	8fbf0014 	lw	ra,20(sp)
+   32ab8:	00001021 	addu	v0,zero,zero
+   32abc:	03e00008 	jr	ra
+   32ac0:	27bd0018 	addiu	sp,sp,24
+
+00032ac4 <ps_print_task>:
+   32ac4:	27bdff60 	addiu	sp,sp,-160
+   32ac8:	afb70094 	sw	s7,148(sp)
+   32acc:	afbf009c 	sw	ra,156(sp)
+   32ad0:	afbe0098 	sw	s8,152(sp)
+   32ad4:	afb60090 	sw	s6,144(sp)
+   32ad8:	afb5008c 	sw	s5,140(sp)
+   32adc:	afb40088 	sw	s4,136(sp)
+   32ae0:	afb30084 	sw	s3,132(sp)
+   32ae4:	afb20080 	sw	s2,128(sp)
+   32ae8:	afb1007c 	sw	s1,124(sp)
+   32aec:	afb00078 	sw	s0,120(sp)
+   32af0:	0080b821 	addu	s7,a0,zero
+   32af4:	afa5004c 	sw	a1,76(sp)
+   32af8:	afa60050 	sw	a2,80(sp)
+   32afc:	10800091 	beqz	a0,32d44 <ps_print_task+0x280>
+   32b00:	afa70054 	sw	a3,84(sp)
+   32b04:	3c020004 	lui	v0,0x4
+   32b08:	2443c960 	addiu	v1,v0,-13984
+   32b0c:	88700003 	lwl	s0,3(v1)
+   32b10:	8c8705c4 	lw	a3,1476(a0)
+   32b14:	9850c960 	lwr	s0,-13984(v0)
+   32b18:	3210ffff 	andi	s0,s0,0xffff
+   32b1c:	00108280 	sll	s0,s0,0xa
+   32b20:	12070002 	beq	s0,a3,32b2c <ps_print_task+0x68>
+   32b24:	00000000 	sll	zero,zero,0x0
+   32b28:	8c900618 	lw	s0,1560(a0)
+   32b2c:	8ee305d0 	lw	v1,1488(s7)
+   32b30:	24020001 	addiu	v0,zero,1
+   32b34:	1062008f 	beq	v1,v0,32d74 <ps_print_task+0x2b0>
+   32b38:	3c110004 	lui	s1,0x4
+   32b3c:	8ee205ac 	lw	v0,1452(s7)
+   32b40:	1040008e 	beqz	v0,32d7c <ps_print_task+0x2b8>
+   32b44:	3c110004 	lui	s1,0x4
+   32b48:	3c110004 	lui	s1,0x4
+   32b4c:	26318624 	addiu	s1,s1,-31196
+   32b50:	3c1e0004 	lui	s8,0x4
+   32b54:	8fd29100 	lw	s2,-28416(s8)
+   32b58:	26e405d4 	addiu	a0,s7,1492
+   32b5c:	0c0019d5 	jal	6754 <atomic_get>
+   32b60:	afa7005c 	sw	a3,92(sp)
+   32b64:	3c060004 	lui	a2,0x4
+   32b68:	8fa7005c 	lw	a3,92(sp)
+   32b6c:	02402021 	addu	a0,s2,zero
+   32b70:	24c68628 	addiu	a2,a2,-31192
+   32b74:	00002821 	addu	a1,zero,zero
+   32b78:	afb00010 	sw	s0,16(sp)
+   32b7c:	afa20014 	sw	v0,20(sp)
+   32b80:	0c0009b0 	jal	26c0 <__fprintk>
+   32b84:	afb10018 	sw	s1,24(sp)
+   32b88:	8ee305d0 	lw	v1,1488(s7)
+   32b8c:	24020001 	addiu	v0,zero,1
+   32b90:	1062006c 	beq	v1,v0,32d44 <ps_print_task+0x280>
+   32b94:	26e200a0 	addiu	v0,s7,160
+   32b98:	00402021 	addu	a0,v0,zero
+   32b9c:	0c004bc3 	jal	12f0c <spinlock_lock>
+   32ba0:	afa20058 	sw	v0,88(sp)
+   32ba4:	8ef00744 	lw	s0,1860(s7)
+   32ba8:	26e30744 	addiu	v1,s7,1860
+   32bac:	afa30048 	sw	v1,72(sp)
+   32bb0:	1470000b 	bne	v1,s0,32be0 <ps_print_task+0x11c>
+   32bb4:	8e110000 	lw	s1,0(s0)
+   32bb8:	0800cb42 	j	32d08 <ps_print_task+0x244>
+   32bbc:	8fa40058 	lw	a0,88(sp)
+   32bc0:	02208021 	addu	s0,s1,zero
+   32bc4:	8c620000 	lw	v0,0(v1)
+   32bc8:	24420001 	addiu	v0,v0,1
+   32bcc:	ac620000 	sw	v0,0(v1)
+   32bd0:	8fa30048 	lw	v1,72(sp)
+   32bd4:	10710043 	beq	v1,s1,32ce4 <ps_print_task+0x220>
+   32bd8:	8e220000 	lw	v0,0(s1)
+   32bdc:	00408821 	addu	s1,v0,zero
+   32be0:	2610fe10 	addiu	s0,s0,-496
+   32be4:	8fc39100 	lw	v1,-28416(s8)
+   32be8:	8e040184 	lw	a0,388(s0)
+   32bec:	afa30074 	sw	v1,116(sp)
+   32bf0:	0c006898 	jal	1a260 <thread_get_attr_name>
+   32bf4:	8e1602f8 	lw	s6,760(s0)
+   32bf8:	0040a821 	addu	s5,v0,zero
+   32bfc:	8e080250 	lw	t0,592(s0)
+   32c00:	8e090254 	lw	t1,596(s0)
+   32c04:	8e0a0248 	lw	t2,584(s0)
+   32c08:	8e0b024c 	lw	t3,588(s0)
+   32c0c:	8e0e0238 	lw	t6,568(s0)
+   32c10:	8e0f023c 	lw	t7,572(s0)
+   32c14:	8e020174 	lw	v0,372(s0)
+   32c18:	8e040130 	lw	a0,304(s0)
+   32c1c:	afa8006c 	sw	t0,108(sp)
+   32c20:	afa90070 	sw	t1,112(sp)
+   32c24:	afaa0064 	sw	t2,100(sp)
+   32c28:	afab0068 	sw	t3,104(sp)
+   32c2c:	afae005c 	sw	t6,92(sp)
+   32c30:	afaf0060 	sw	t7,96(sp)
+   32c34:	8c540004 	lw	s4,4(v0)
+   32c38:	8e130148 	lw	s3,328(s0)
+   32c3c:	0c00681c 	jal	1a070 <thread_get_state_name>
+   32c40:	8e120204 	lw	s2,516(s0)
+   32c44:	8e04028c 	lw	a0,652(s0)
+   32c48:	8fa30074 	lw	v1,116(sp)
+   32c4c:	8fa8006c 	lw	t0,108(sp)
+   32c50:	8fa90070 	lw	t1,112(sp)
+   32c54:	8faa0064 	lw	t2,100(sp)
+   32c58:	8fab0068 	lw	t3,104(sp)
+   32c5c:	8fae005c 	lw	t6,92(sp)
+   32c60:	10800035 	beqz	a0,32d38 <ps_print_task+0x274>
+   32c64:	8faf0060 	lw	t7,96(sp)
+   32c68:	8c8c0000 	lw	t4,0(a0)
+   32c6c:	3c060004 	lui	a2,0x4
+   32c70:	00602021 	addu	a0,v1,zero
+   32c74:	00002821 	addu	a1,zero,zero
+   32c78:	24c68658 	addiu	a2,a2,-31144
+   32c7c:	02003821 	addu	a3,s0,zero
+   32c80:	afb60010 	sw	s6,16(sp)
+   32c84:	afb50014 	sw	s5,20(sp)
+   32c88:	afb40018 	sw	s4,24(sp)
+   32c8c:	afb3001c 	sw	s3,28(sp)
+   32c90:	afb20020 	sw	s2,32(sp)
+   32c94:	afa80028 	sw	t0,40(sp)
+   32c98:	afa9002c 	sw	t1,44(sp)
+   32c9c:	afaa0030 	sw	t2,48(sp)
+   32ca0:	afab0034 	sw	t3,52(sp)
+   32ca4:	afae0038 	sw	t6,56(sp)
+   32ca8:	afaf003c 	sw	t7,60(sp)
+   32cac:	afa20040 	sw	v0,64(sp)
+   32cb0:	0c0009b0 	jal	26c0 <__fprintk>
+   32cb4:	afac0044 	sw	t4,68(sp)
+   32cb8:	8e020184 	lw	v0,388(s0)
+   32cbc:	1040ffc0 	beqz	v0,32bc0 <ps_print_task+0xfc>
+   32cc0:	8fa3004c 	lw	v1,76(sp)
+   32cc4:	8fa30050 	lw	v1,80(sp)
+   32cc8:	02208021 	addu	s0,s1,zero
+   32ccc:	8c620000 	lw	v0,0(v1)
+   32cd0:	24420001 	addiu	v0,v0,1
+   32cd4:	ac620000 	sw	v0,0(v1)
+   32cd8:	8fa30048 	lw	v1,72(sp)
+   32cdc:	1471ffbf 	bne	v1,s1,32bdc <ps_print_task+0x118>
+   32ce0:	8e220000 	lw	v0,0(s1)
+   32ce4:	8ee20744 	lw	v0,1860(s7)
+   32ce8:	8fa30048 	lw	v1,72(sp)
+   32cec:	10430006 	beq	v0,v1,32d08 <ps_print_task+0x244>
+   32cf0:	8fa40058 	lw	a0,88(sp)
+   32cf4:	8fa30054 	lw	v1,84(sp)
+   32cf8:	8c620000 	lw	v0,0(v1)
+   32cfc:	24420001 	addiu	v0,v0,1
+   32d00:	ac620000 	sw	v0,0(v1)
+   32d04:	8fa40058 	lw	a0,88(sp)
+   32d08:	8fbf009c 	lw	ra,156(sp)
+   32d0c:	8fbe0098 	lw	s8,152(sp)
+   32d10:	8fb70094 	lw	s7,148(sp)
+   32d14:	8fb60090 	lw	s6,144(sp)
+   32d18:	8fb5008c 	lw	s5,140(sp)
+   32d1c:	8fb40088 	lw	s4,136(sp)
+   32d20:	8fb30084 	lw	s3,132(sp)
+   32d24:	8fb20080 	lw	s2,128(sp)
+   32d28:	8fb1007c 	lw	s1,124(sp)
+   32d2c:	8fb00078 	lw	s0,120(sp)
+   32d30:	08004b0b 	j	12c2c <spinlock_unlock>
+   32d34:	27bd00a0 	addiu	sp,sp,160
+   32d38:	3c0c0004 	lui	t4,0x4
+   32d3c:	0800cb1b 	j	32c6c <ps_print_task+0x1a8>
+   32d40:	258c8624 	addiu	t4,t4,-31196
+   32d44:	8fbf009c 	lw	ra,156(sp)
+   32d48:	8fbe0098 	lw	s8,152(sp)
+   32d4c:	8fb70094 	lw	s7,148(sp)
+   32d50:	8fb60090 	lw	s6,144(sp)
+   32d54:	8fb5008c 	lw	s5,140(sp)
+   32d58:	8fb40088 	lw	s4,136(sp)
+   32d5c:	8fb30084 	lw	s3,132(sp)
+   32d60:	8fb20080 	lw	s2,128(sp)
+   32d64:	8fb1007c 	lw	s1,124(sp)
+   32d68:	8fb00078 	lw	s0,120(sp)
+   32d6c:	03e00008 	jr	ra
+   32d70:	27bd00a0 	addiu	sp,sp,160
+   32d74:	0800cad4 	j	32b50 <ps_print_task+0x8c>
+   32d78:	2631860c 	addiu	s1,s1,-31220
+   32d7c:	0800cad4 	j	32b50 <ps_print_task+0x8c>
+   32d80:	2631861c 	addiu	s1,s1,-31204
+
+00032d84 <ps_func>:
+   32d84:	27bdffb8 	addiu	sp,sp,-72
+   32d88:	afb10028 	sw	s1,40(sp)
+   32d8c:	3c110004 	lui	s1,0x4
+   32d90:	afb2002c 	sw	s2,44(sp)
+   32d94:	2632c960 	addiu	s2,s1,-13984
+   32d98:	8a470003 	lwl	a3,3(s2)
+   32d9c:	afb70040 	sw	s7,64(sp)
+   32da0:	9a27c960 	lwr	a3,-13984(s1)
+   32da4:	3c170004 	lui	s7,0x4
+   32da8:	8ee49100 	lw	a0,-28416(s7)
+   32dac:	3c060004 	lui	a2,0x4
+   32db0:	24c686c8 	addiu	a2,a2,-31032
+   32db4:	30e7ffff 	andi	a3,a3,0xffff
+   32db8:	00002821 	addu	a1,zero,zero
+   32dbc:	afbf0044 	sw	ra,68(sp)
+   32dc0:	afb00024 	sw	s0,36(sp)
+   32dc4:	afb6003c 	sw	s6,60(sp)
+   32dc8:	afb50038 	sw	s5,56(sp)
+   32dcc:	afb40034 	sw	s4,52(sp)
+   32dd0:	afb30030 	sw	s3,48(sp)
+   32dd4:	afa00010 	sw	zero,16(sp)
+   32dd8:	afa00014 	sw	zero,20(sp)
+   32ddc:	0c0009b0 	jal	26c0 <__fprintk>
+   32de0:	afa00018 	sw	zero,24(sp)
+   32de4:	0c0061d9 	jal	18764 <tasks_manager_lock>
+   32de8:	00000000 	sll	zero,zero,0x0
+   32dec:	8a500003 	lwl	s0,3(s2)
+   32df0:	9a30c960 	lwr	s0,-13984(s1)
+   32df4:	3210ffff 	andi	s0,s0,0xffff
+   32df8:	00101280 	sll	v0,s0,0xa
+   32dfc:	24500001 	addiu	s0,v0,1
+   32e00:	244203ff 	addiu	v0,v0,1023
+   32e04:	0050102b 	sltu	v0,v0,s0
+   32e08:	14400016 	bnez	v0,32e64 <ps_func+0xe0>
+   32e0c:	3416ffff 	ori	s6,zero,0xffff
+   32e10:	27b50014 	addiu	s5,sp,20
+   32e14:	27b40018 	addiu	s4,sp,24
+   32e18:	27b30010 	addiu	s3,sp,16
+   32e1c:	0c006220 	jal	18880 <task_lookup>
+   32e20:	02002021 	addu	a0,s0,zero
+   32e24:	94430000 	lhu	v1,0(v0)
+   32e28:	26100001 	addiu	s0,s0,1
+   32e2c:	02602821 	addu	a1,s3,zero
+   32e30:	02a03021 	addu	a2,s5,zero
+   32e34:	10760003 	beq	v1,s6,32e44 <ps_func+0xc0>
+   32e38:	02803821 	addu	a3,s4,zero
+   32e3c:	0c00cab1 	jal	32ac4 <ps_print_task>
+   32e40:	8c440004 	lw	a0,4(v0)
+   32e44:	8a420003 	lwl	v0,3(s2)
+   32e48:	9a22c960 	lwr	v0,-13984(s1)
+   32e4c:	3042ffff 	andi	v0,v0,0xffff
+   32e50:	00021280 	sll	v0,v0,0xa
+   32e54:	244203ff 	addiu	v0,v0,1023
+   32e58:	0050102b 	sltu	v0,v0,s0
+   32e5c:	1040ffef 	beqz	v0,32e1c <ps_func+0x98>
+   32e60:	00000000 	sll	zero,zero,0x0
+   32e64:	0c0061d6 	jal	18758 <tasks_manager_unlock>
+   32e68:	00000000 	sll	zero,zero,0x0
+   32e6c:	8ee49100 	lw	a0,-28416(s7)
+   32e70:	8fa70018 	lw	a3,24(sp)
+   32e74:	3c060004 	lui	a2,0x4
+   32e78:	24c686dc 	addiu	a2,a2,-31012
+   32e7c:	0c0009b0 	jal	26c0 <__fprintk>
+   32e80:	00002821 	addu	a1,zero,zero
+   32e84:	8ee49100 	lw	a0,-28416(s7)
+   32e88:	8fa70010 	lw	a3,16(sp)
+   32e8c:	3c060004 	lui	a2,0x4
+   32e90:	24c68700 	addiu	a2,a2,-30976
+   32e94:	0c0009b0 	jal	26c0 <__fprintk>
+   32e98:	00002821 	addu	a1,zero,zero
+   32e9c:	8ee49100 	lw	a0,-28416(s7)
+   32ea0:	3c060004 	lui	a2,0x4
+   32ea4:	24c68724 	addiu	a2,a2,-30940
+   32ea8:	00002821 	addu	a1,zero,zero
+   32eac:	0c0009b0 	jal	26c0 <__fprintk>
+   32eb0:	00003821 	addu	a3,zero,zero
+   32eb4:	8fbf0044 	lw	ra,68(sp)
+   32eb8:	00001021 	addu	v0,zero,zero
+   32ebc:	8fb70040 	lw	s7,64(sp)
+   32ec0:	8fb6003c 	lw	s6,60(sp)
+   32ec4:	8fb50038 	lw	s5,56(sp)
+   32ec8:	8fb40034 	lw	s4,52(sp)
+   32ecc:	8fb30030 	lw	s3,48(sp)
+   32ed0:	8fb2002c 	lw	s2,44(sp)
+   32ed4:	8fb10028 	lw	s1,40(sp)
+   32ed8:	8fb00024 	lw	s0,36(sp)
+   32edc:	03e00008 	jr	ra
+   32ee0:	27bd0048 	addiu	sp,sp,72
+
+00032ee4 <pwd_func>:
+   32ee4:	3c020008 	lui	v0,0x8
+   32ee8:	8c442704 	lw	a0,9988(v0)
+   32eec:	3c020001 	lui	v0,0x1
+   32ef0:	27bdff40 	addiu	sp,sp,-192
+   32ef4:	2442c0c8 	addiu	v0,v0,-16184
+   32ef8:	afa20018 	sw	v0,24(sp)
+   32efc:	3c020001 	lui	v0,0x1
+   32f00:	2442c094 	addiu	v0,v0,-16236
+   32f04:	afa2001c 	sw	v0,28(sp)
+   32f08:	3c020001 	lui	v0,0x1
+   32f0c:	2442be08 	addiu	v0,v0,-16888
+   32f10:	afa20024 	sw	v0,36(sp)
+   32f14:	3c020001 	lui	v0,0x1
+   32f18:	2442bc88 	addiu	v0,v0,-17272
+   32f1c:	afa20020 	sw	v0,32(sp)
+   32f20:	3c020001 	lui	v0,0x1
+   32f24:	2442bc80 	addiu	v0,v0,-17280
+   32f28:	afb000b8 	sw	s0,184(sp)
+   32f2c:	27a50010 	addiu	a1,sp,16
+   32f30:	27b0002c 	addiu	s0,sp,44
+   32f34:	afa20028 	sw	v0,40(sp)
+   32f38:	24020080 	addiu	v0,zero,128
+   32f3c:	afbf00bc 	sw	ra,188(sp)
+   32f40:	afb00010 	sw	s0,16(sp)
+   32f44:	0c00a43a 	jal	290e8 <vfs_get_path>
+   32f48:	afa20014 	sw	v0,20(sp)
+   32f4c:	3c040003 	lui	a0,0x3
+   32f50:	02002821 	addu	a1,s0,zero
+   32f54:	24847f98 	addiu	a0,a0,32664
+   32f58:	0c00ca4b 	jal	3292c <ksh_print>
+   32f5c:	afa200b0 	sw	v0,176(sp)
+   32f60:	8fbf00bc 	lw	ra,188(sp)
+   32f64:	8fa200b0 	lw	v0,176(sp)
+   32f68:	8fb000b8 	lw	s0,184(sp)
+   32f6c:	03e00008 	jr	ra
+   32f70:	27bd00c0 	addiu	sp,sp,192
+
+00032f74 <rm_func>:
+   32f74:	27bdffa8 	addiu	sp,sp,-88
+   32f78:	afb20038 	sw	s2,56(sp)
+   32f7c:	8c920000 	lw	s2,0(a0)
+   32f80:	afbf0054 	sw	ra,84(sp)
+   32f84:	2e420002 	sltiu	v0,s2,2
+   32f88:	afbe0050 	sw	s8,80(sp)
+   32f8c:	afb7004c 	sw	s7,76(sp)
+   32f90:	afb60048 	sw	s6,72(sp)
+   32f94:	afb50044 	sw	s5,68(sp)
+   32f98:	afb40040 	sw	s4,64(sp)
+   32f9c:	afb3003c 	sw	s3,60(sp)
+   32fa0:	afb10034 	sw	s1,52(sp)
+   32fa4:	1440002b 	bnez	v0,33054 <rm_func+0xe0>
+   32fa8:	afb00030 	sw	s0,48(sp)
+   32fac:	3c1e0001 	lui	s8,0x1
+   32fb0:	3c170001 	lui	s7,0x1
+   32fb4:	3c160001 	lui	s6,0x1
+   32fb8:	3c150001 	lui	s5,0x1
+   32fbc:	24910044 	addiu	s1,a0,68
+   32fc0:	27debff8 	addiu	s8,s8,-16392
+   32fc4:	26f7be08 	addiu	s7,s7,-16888
+   32fc8:	26d6bc88 	addiu	s6,s6,-17272
+   32fcc:	26b5bff0 	addiu	s5,s5,-16400
+   32fd0:	24100001 	addiu	s0,zero,1
+   32fd4:	3c140008 	lui	s4,0x8
+   32fd8:	0800cbfa 	j	32fe8 <rm_func+0x74>
+   32fdc:	27b30010 	addiu	s3,sp,16
+   32fe0:	10600010 	beqz	v1,33024 <rm_func+0xb0>
+   32fe4:	26310040 	addiu	s1,s1,64
+   32fe8:	8e842704 	lw	a0,9988(s4)
+   32fec:	3c020001 	lui	v0,0x1
+   32ff0:	2442c048 	addiu	v0,v0,-16312
+   32ff4:	02602821 	addu	a1,s3,zero
+   32ff8:	26100001 	addiu	s0,s0,1
+   32ffc:	afb10010 	sw	s1,16(sp)
+   33000:	afa20018 	sw	v0,24(sp)
+   33004:	afbe001c 	sw	s8,28(sp)
+   33008:	afb70024 	sw	s7,36(sp)
+   3300c:	afb60020 	sw	s6,32(sp)
+   33010:	afb50028 	sw	s5,40(sp)
+   33014:	0c00a438 	jal	290e0 <vfs_unlink>
+   33018:	afa00014 	sw	zero,20(sp)
+   3301c:	1040fff0 	beqz	v0,32fe0 <rm_func+0x6c>
+   33020:	0212182b 	sltu	v1,s0,s2
+   33024:	8fbf0054 	lw	ra,84(sp)
+   33028:	8fbe0050 	lw	s8,80(sp)
+   3302c:	8fb7004c 	lw	s7,76(sp)
+   33030:	8fb60048 	lw	s6,72(sp)
+   33034:	8fb50044 	lw	s5,68(sp)
+   33038:	8fb40040 	lw	s4,64(sp)
+   3303c:	8fb3003c 	lw	s3,60(sp)
+   33040:	8fb20038 	lw	s2,56(sp)
+   33044:	8fb10034 	lw	s1,52(sp)
+   33048:	8fb00030 	lw	s0,48(sp)
+   3304c:	03e00008 	jr	ra
+   33050:	27bd0058 	addiu	sp,sp,88
+   33054:	0800cc09 	j	33024 <rm_func+0xb0>
+   33058:	00001021 	addu	v0,zero,zero
+
+0003305c <cpu_context_load>:
+   3305c:	00808025 	or	s0,a0,zero
+   33060:	8c850030 	lw	a1,48(a0)
+   33064:	40047801 	mfc0	a0,$15,1
+   33068:	30840003 	andi	a0,a0,0x3
+   3306c:	0c00203d 	jal	80f4 <cpu_kexit>
+   33070:	27bdfff8 	addiu	sp,sp,-8
+   33074:	27bd0008 	addiu	sp,sp,8
+   33078:	02002025 	or	a0,s0,zero
+   3307c:	8c900020 	lw	s0,32(a0)
+   33080:	481a0000 	mfc2	k0,$0
+   33084:	8c8a0030 	lw	t2,48(a0)
+   33088:	8c9b0034 	lw	k1,52(a0)
+   3308c:	8d5d0000 	lw	sp,0(t2)
+   33090:	408a2002 	mtc0	t2,$4,2
+   33094:	ac800038 	sw	zero,56(a0)
+   33098:	135b0002 	beq	k0,k1,330a4 <cpu_context_load+0x48>
+   3309c:	8c9f003c 	lw	ra,60(a0)
+   330a0:	489b0000 	mtc2	k1,$0
+   330a4:	8d5d0000 	lw	sp,0(t2)
+   330a8:	8c9a005c 	lw	k0,92(a0)
+   330ac:	8c9b0024 	lw	k1,36(a0)
+   330b0:	8c890028 	lw	t1,40(a0)
+   330b4:	8c88002c 	lw	t0,44(a0)
+   330b8:	2610fff8 	addiu	s0,s0,-8
+   330bc:	8c850044 	lw	a1,68(a0)
+   330c0:	8c840040 	lw	a0,64(a0)
+   330c4:	ae050004 	sw	a1,4(s0)
+   330c8:	ae040000 	sw	a0,0(s0)
+   330cc:	35080002 	ori	t0,t0,0x2
+   330d0:	40886000 	mtc0	t0,c0_status
+	...
+   330dc:	40897000 	mtc0	t1,c0_epc
+   330e0:	0010e825 	or	sp,zero,s0
+   330e4:	08000117 	j	45c <kentry_load>
+   330e8:	00000000 	sll	zero,zero,0x0
+
+000330ec <cpu_context_save>:
+   330ec:	ac900000 	sw	s0,0(a0)
+   330f0:	ac910004 	sw	s1,4(a0)
+   330f4:	ac920008 	sw	s2,8(a0)
+   330f8:	ac93000c 	sw	s3,12(a0)
+   330fc:	ac940010 	sw	s4,16(a0)
+   33100:	ac950014 	sw	s5,20(a0)
+   33104:	ac960018 	sw	s6,24(a0)
+   33108:	ac97001c 	sw	s7,28(a0)
+   3310c:	401a2002 	mfc0	k0,$4,2
+   33110:	ac9d0020 	sw	sp,32(a0)
+   33114:	481b0000 	mfc2	k1,$0
+   33118:	ac9e0024 	sw	s8,36(a0)
+   3311c:	ac9f0028 	sw	ra,40(a0)
+   33120:	ac9a0030 	sw	k0,48(a0)
+   33124:	ac9b0034 	sw	k1,52(a0)
+   33128:	03e00008 	jr	ra
+   3312c:	00421026 	xor	v0,v0,v0
+
+00033130 <cpu_context_restore>:
+   33130:	48110000 	mfc2	s1,$0
+   33134:	8c9e0034 	lw	s8,52(a0)
+   33138:	8c900000 	lw	s0,0(a0)
+   3313c:	123e0002 	beq	s1,s8,33148 <cpu_context_restore+0x18>
+   33140:	8c9b0038 	lw	k1,56(a0)
+   33144:	489e0000 	mtc2	s8,$0
+   33148:	1760ffc4 	bnez	k1,3305c <cpu_context_load>
+   3314c:	8c910004 	lw	s1,4(a0)
+   33150:	8c920008 	lw	s2,8(a0)
+   33154:	8c93000c 	lw	s3,12(a0)
+   33158:	8c940010 	lw	s4,16(a0)
+   3315c:	8c950014 	lw	s5,20(a0)
+   33160:	8c960018 	lw	s6,24(a0)
+   33164:	8c97001c 	lw	s7,28(a0)
+   33168:	8c9a0030 	lw	k0,48(a0)
+   3316c:	8c9d0020 	lw	sp,32(a0)
+   33170:	409a2002 	mtc0	k0,$4,2
+   33174:	8c9f0028 	lw	ra,40(a0)
+   33178:	8c9e0024 	lw	s8,36(a0)
+   3317c:	03e00008 	jr	ra
+   33180:	00051025 	or	v0,zero,a1
+
+00033184 <cpu_fpu_context_save>:
+   33184:	e4800098 	swc1	$f0,152(a0)
+   33188:	e481009c 	swc1	$f1,156(a0)
+   3318c:	e48200a0 	swc1	$f2,160(a0)
+   33190:	e48300a4 	swc1	$f3,164(a0)
+   33194:	e48400a8 	swc1	$f4,168(a0)
+   33198:	e48500ac 	swc1	$f5,172(a0)
+   3319c:	e48600b0 	swc1	$f6,176(a0)
+   331a0:	e48700b4 	swc1	$f7,180(a0)
+   331a4:	e48800b8 	swc1	$f8,184(a0)
+   331a8:	e48900bc 	swc1	$f9,188(a0)
+   331ac:	e48a00c0 	swc1	$f10,192(a0)
+   331b0:	e48b00c4 	swc1	$f11,196(a0)
+   331b4:	e48c00c8 	swc1	$f12,200(a0)
+   331b8:	e48d00cc 	swc1	$f13,204(a0)
+   331bc:	e48e00d0 	swc1	$f14,208(a0)
+   331c0:	e48f00d4 	swc1	$f15,212(a0)
+   331c4:	e49000d8 	swc1	$f16,216(a0)
+   331c8:	e49100dc 	swc1	$f17,220(a0)
+   331cc:	e49200e0 	swc1	$f18,224(a0)
+   331d0:	e49300e4 	swc1	$f19,228(a0)
+   331d4:	e49400e8 	swc1	$f20,232(a0)
+   331d8:	e49500ec 	swc1	$f21,236(a0)
+   331dc:	e49600f0 	swc1	$f22,240(a0)
+   331e0:	e49700f4 	swc1	$f23,244(a0)
+   331e4:	e49800f8 	swc1	$f24,248(a0)
+   331e8:	e49900fc 	swc1	$f25,252(a0)
+   331ec:	e49a0100 	swc1	$f26,256(a0)
+   331f0:	e49b0104 	swc1	$f27,260(a0)
+   331f4:	e49c0108 	swc1	$f28,264(a0)
+   331f8:	e49d010c 	swc1	$f29,268(a0)
+   331fc:	e49e0110 	swc1	$f30,272(a0)
+   33200:	03e00008 	jr	ra
+   33204:	e49f0114 	swc1	$f31,276(a0)
+
+00033208 <cpu_fpu_context_restore>:
+   33208:	c4800098 	lwc1	$f0,152(a0)
+   3320c:	c481009c 	lwc1	$f1,156(a0)
+   33210:	c48200a0 	lwc1	$f2,160(a0)
+   33214:	c48300a4 	lwc1	$f3,164(a0)
+   33218:	c48400a8 	lwc1	$f4,168(a0)
+   3321c:	c48500ac 	lwc1	$f5,172(a0)
+   33220:	c48600b0 	lwc1	$f6,176(a0)
+   33224:	c48700b4 	lwc1	$f7,180(a0)
+   33228:	c48800b8 	lwc1	$f8,184(a0)
+   3322c:	c48900bc 	lwc1	$f9,188(a0)
+   33230:	c48a00c0 	lwc1	$f10,192(a0)
+   33234:	c48b00c4 	lwc1	$f11,196(a0)
+   33238:	c48c00c8 	lwc1	$f12,200(a0)
+   3323c:	c48d00cc 	lwc1	$f13,204(a0)
+   33240:	c48e00d0 	lwc1	$f14,208(a0)
+   33244:	c48f00d4 	lwc1	$f15,212(a0)
+   33248:	c49000d8 	lwc1	$f16,216(a0)
+   3324c:	c49100dc 	lwc1	$f17,220(a0)
+   33250:	c49200e0 	lwc1	$f18,224(a0)
+   33254:	c49300e4 	lwc1	$f19,228(a0)
+   33258:	c49400e8 	lwc1	$f20,232(a0)
+   3325c:	c49500ec 	lwc1	$f21,236(a0)
+   33260:	c49600f0 	lwc1	$f22,240(a0)
+   33264:	c49700f4 	lwc1	$f23,244(a0)
+   33268:	c49800f8 	lwc1	$f24,248(a0)
+   3326c:	c49900fc 	lwc1	$f25,252(a0)
+   33270:	c49a0100 	lwc1	$f26,256(a0)
+   33274:	c49b0104 	lwc1	$f27,260(a0)
+   33278:	c49c0108 	lwc1	$f28,264(a0)
+   3327c:	c49d010c 	lwc1	$f29,268(a0)
+   33280:	c49e0110 	lwc1	$f30,272(a0)
+   33284:	03e00008 	jr	ra
+   33288:	c49f0114 	lwc1	$f31,276(a0)
+   3328c:	3d3d3d3d 	0x3d3d3d3d
+   33290:	3d3d3d3d 	0x3d3d3d3d
+   33294:	3d3d3d3d 	0x3d3d3d3d
+   33298:	3d3d3d3d 	0x3d3d3d3d
+   3329c:	3d3d3d3d 	0x3d3d3d3d
+   332a0:	3d3d3d3d 	0x3d3d3d3d
+   332a4:	3d3d3d3d 	0x3d3d3d3d
+   332a8:	3d3d3d3d 	0x3d3d3d3d
+   332ac:	3d3d3d3d 	0x3d3d3d3d
+   332b0:	3d3d3d3d 	0x3d3d3d3d
+   332b4:	3d3d3d3d 	0x3d3d3d3d
+   332b8:	3d3d3d3d 	0x3d3d3d3d
+   332bc:	3d3d3d3d 	0x3d3d3d3d
+   332c0:	3d3d3d3d 	0x3d3d3d3d
+   332c4:	3d3d3d3d 	0x3d3d3d3d
+   332c8:	3d3d3d3d 	0x3d3d3d3d
+   332cc:	3d3d3d3d 	0x3d3d3d3d
+   332d0:	0000000a 	movz	zero,zero,zero
+   332d4:	65637845 	0x65637845
+   332d8:	6f697470 	0x6f697470
+   332dc:	6168206e 	0x6168206e
+   332e0:	636f2073 	0x636f2073
+   332e4:	65727563 	0x65727563
+   332e8:	74202c64 	jalx	80b190 <kheader+0x788190>
+   332ec:	61657268 	0x61657268
+   332f0:	78252064 	0x78252064
+   332f4:	7063202c 	0x7063202c
+   332f8:	64252075 	0x64252075
+   332fc:	7963202c 	0x7963202c
+   33300:	20656c63 	addi	a1,v1,27747
+   33304:	000a6425 	0xa6425
+   33308:	636f7250 	0x636f7250
+   3330c:	6f737365 	0x6f737365
+   33310:	74532072 	jalx	14c81c8 <kheader+0x14451c8>
+   33314:	3a657461 	xori	a1,s3,0x7461
+   33318:	0000000a 	movz	zero,zero,zero
+   3331c:	203a5243 	addi	k0,at,21059
+   33320:	78252020 	0x78252020
+   33324:	43504509 	c0	0x1504509
+   33328:	2520203a 	addiu	zero,t1,8250
+   3332c:	52530978 	beql	s2,s3,35910 <cpu_fpu_context_restore+0x2708>
+   33330:	2020203a 	addi	zero,at,8250
+   33334:	53097825 	beql	t8,t1,513cc <cluster_manager+0xa61c>
+   33338:	20203a50 	addi	zero,at,14928
+   3333c:	78252020 	0x78252020
+   33340:	52535509 	beql	s2,s3,48768 <cluster_manager+0x19b8>
+   33344:	20505320 	addi	s0,v0,21280
+   33348:	000a7825 	or	t7,zero,t2
+   3334c:	315f7461 	andi	ra,t2,0x7461
+   33350:	78252020 	0x78252020
+   33354:	5f307609 	0x5f307609
+   33358:	25202032 	addiu	zero,t1,8242
+   3335c:	76090978 	jalx	82425e0 <kheader+0x81bf5e0>
+   33360:	20335f31 	addi	s3,at,24369
+   33364:	09782520 	j	5e09480 <kheader+0x5d86480>
+   33368:	345f3061 	ori	ra,v0,0x3061
+   3336c:	25202020 	addiu	zero,t1,8224
+   33370:	31610978 	andi	at,t3,0x978
+   33374:	2020355f 	addi	zero,at,13663
+   33378:	0a782520 	j	9e09480 <kheader+0x9d86480>
+   3337c:	00000000 	sll	zero,zero,0x0
+   33380:	365f3261 	ori	ra,s2,0x3261
+   33384:	78252020 	0x78252020
+   33388:	33610909 	andi	at,k1,0x909
+   3338c:	2020375f 	addi	zero,at,14175
+   33390:	74097825 	jalx	25e094 <kheader+0x1db094>
+   33394:	20385f30 	addi	t8,at,24368
+   33398:	09782520 	j	5e09480 <kheader+0x5d86480>
+   3339c:	395f3174 	xori	ra,t2,0x3174
+   333a0:	25202020 	addiu	zero,t1,8224
+   333a4:	32740978 	andi	s4,s3,0x978
+   333a8:	2030315f 	addi	s0,at,12639
+   333ac:	0a782520 	j	9e09480 <kheader+0x9d86480>
+   333b0:	00000000 	sll	zero,zero,0x0
+   333b4:	315f3374 	andi	ra,t2,0x3374
+   333b8:	78252031 	0x78252031
+   333bc:	5f347409 	0x5f347409
+   333c0:	25203231 	addiu	zero,t1,12849
+   333c4:	74090978 	jalx	2425e0 <kheader+0x1bf5e0>
+   333c8:	33315f35 	andi	s1,t9,0x5f35
+   333cc:	09782520 	j	5e09480 <kheader+0x5d86480>
+   333d0:	315f3674 	andi	ra,t2,0x3674
+   333d4:	25202034 	addiu	zero,t1,8244
+   333d8:	37740978 	ori	s4,k1,0x978
+   333dc:	2035315f 	addi	s5,at,12639
+   333e0:	0a782520 	j	9e09480 <kheader+0x9d86480>
+   333e4:	00000000 	sll	zero,zero,0x0
+   333e8:	325f3874 	andi	ra,s2,0x3874
+   333ec:	78252034 	0x78252034
+   333f0:	39740909 	xori	s4,t3,0x909
+   333f4:	2035325f 	addi	s5,at,12895
+   333f8:	67097825 	0x67097825
+   333fc:	38325f70 	xori	s2,at,0x5f70
+   33400:	09782520 	j	5e09480 <kheader+0x5d86480>
+   33404:	685f3063 	0x685f3063
+   33408:	25202069 	addiu	zero,t1,8297
+   3340c:	30630978 	andi	v1,v1,0x978
+   33410:	206f6c5f 	addi	t7,v1,27743
+   33414:	0a782520 	j	9e09480 <kheader+0x9d86480>
+   33418:	00000000 	sll	zero,zero,0x0
+   3341c:	315f3073 	andi	ra,t2,0x3073
+   33420:	78252036 	0x78252036
+   33424:	5f317309 	0x5f317309
+   33428:	25203731 	addiu	zero,t1,14129
+   3342c:	32730978 	andi	s3,s3,0x978
+   33430:	2038315f 	addi	t8,at,12639
+   33434:	73097825 	0x73097825
+   33438:	39315f33 	xori	s1,t1,0x5f33
+   3343c:	78252020 	0x78252020
+   33440:	5f347309 	0x5f347309
+   33444:	20203032 	addi	zero,at,12338
+   33448:	000a7825 	or	t7,zero,t2
+   3344c:	325f3573 	andi	ra,s2,0x3573
+   33450:	78252031 	0x78252031
+   33454:	5f367309 	0x5f367309
+   33458:	25203232 	addiu	zero,t1,12850
+   3345c:	73090978 	0x73090978
+   33460:	33325f37 	andi	s2,t9,0x5f37
+   33464:	09782520 	j	5e09480 <kheader+0x5d86480>
+   33468:	335f3873 	andi	ra,k0,0x3873
+   3346c:	25202030 	addiu	zero,t1,8240
+   33470:	61720978 	0x61720978
+   33474:	2031335f 	addi	s1,at,13151
+   33478:	0a782520 	j	9e09480 <kheader+0x9d86480>
+   3347c:	0000000a 	movz	zero,zero,zero
+   33480:	65726854 	0x65726854
+   33484:	25206461 	addiu	zero,t1,25697
+   33488:	73090a78 	0x73090a78
+   3348c:	735f7379 	0x735f7379
+   33490:	6b636174 	0x6b636174
+   33494:	706f745f 	0x706f745f
+   33498:	0a782520 	j	9e09480 <kheader+0x9d86480>
+   3349c:	72737509 	0x72737509
+   334a0:	6174735f 	0x6174735f
+   334a4:	25206b63 	addiu	zero,t1,27491
+   334a8:	75090a78 	jalx	42429e0 <kheader+0x41bf9e0>
+   334ac:	20736c74 	addi	s3,v1,27764
+   334b0:	090a7825 	j	429e094 <kheader+0x421b094>
+   334b4:	74617473 	jalx	185d1cc <kheader+0x17da1cc>
+   334b8:	73252065 	0x73252065
+   334bc:	6f6c090a 	0x6f6c090a
+   334c0:	20736b63 	addi	s3,v1,27491
+   334c4:	000a6425 	0xa6425
+   334c8:	69786509 	0x69786509
+   334cc:	61765f74 	0x61765f74
+   334d0:	7825206c 	0x7825206c
+   334d4:	6f6a090a 	0x6f6a090a
+   334d8:	25206e69 	addiu	zero,t1,28265
+   334dc:	74090a78 	jalx	2429e0 <kheader+0x1bf9e0>
+   334e0:	20657079 	addi	a1,v1,28793
+   334e4:	090a7325 	j	429cc94 <kheader+0x4219c94>
+   334e8:	20555043 	addi	s5,v0,20547
+   334ec:	090a6425 	j	4299094 <kheader+0x4216094>
+   334f0:	656b6177 	0x656b6177
+   334f4:	645f7075 	0x645f7075
+   334f8:	20657461 	addi	a1,v1,29793
+   334fc:	090a6425 	j	4299094 <kheader+0x4216094>
+   33500:	7473696c 	jalx	1cda5b0 <kheader+0x1c575b0>
+   33504:	0a782520 	j	9e09480 <kheader+0x9d86480>
+   33508:	6e202009 	0x6e202009
+   3350c:	20747865 	addi	s4,v1,30821
+   33510:	090a7825 	j	429e094 <kheader+0x421b094>
+   33514:	72702020 	clz	a0 or s0,s3
+   33518:	25206465 	addiu	zero,t1,25701
+   3351c:	00000a78 	0xa78
+   33520:	2073490a 	addi	s3,v1,18698
+   33524:	6b206e69 	0x6b206e69
+   33528:	656e7265 	0x656e7265
+   3352c:	25203a6c 	addiu	zero,t1,14956
+   33530:	00000a73 	tltu	zero,zero,0x29
+   33534:	00534559 	0x534559
+   33538:	554d4d0a 	bnel	t2,t5,46964 <clusters_tbl+0x8fc4>
+   3353c:	63784520 	0x63784520
+   33540:	69747065 	0x69747065
+   33544:	53206e6f 	beqzl	t9,4ef04 <cluster_manager+0x8154>
+   33548:	65746174 	0x65746174
+   3354c:	4e090a3a 	c3	0x90a3a
+   33550:	3a656d61 	xori	a1,s3,0x6d61
+   33554:	0a732520 	j	9cc9480 <kheader+0x9c46480>
+   33558:	666e4909 	0x666e4909
+   3355c:	25203a6f 	addiu	zero,t1,14959
+   33560:	53090a73 	beql	t8,t1,35f30 <cpu_fpu_context_restore+0x2d28>
+   33564:	72657665 	0x72657665
+   33568:	203a7974 	addi	k0,at,31092
+   3356c:	090a7325 	j	429cc94 <kheader+0x4219c94>
+   33570:	69646441 	0x69646441
+   33574:	6e6f6974 	0x6e6f6974
+   33578:	203a6c61 	addi	k0,at,27745
+   3357c:	64614269 	0x64614269
+   33580:	64646156 	0x64646156
+   33584:	78302072 	0x78302072
+   33588:	202c7825 	addi	t4,at,30757
+   3358c:	64614264 	0x64614264
+   33590:	64646156 	0x64646156
+   33594:	78302072 	0x78302072
+   33598:	202c7825 	addi	t4,at,30757
+   3359c:	72724569 	0x72724569
+   335a0:	2c782520 	sltiu	t8,v1,9504
+   335a4:	72456420 	0x72456420
+   335a8:	78252072 	0x78252072
+   335ac:	00000a0a 	0xa0a
+   335b0:	20646950 	addi	a0,v1,26960
+   335b4:	202c6425 	addi	t4,at,25637
+   335b8:	20757043 	addi	s5,v1,28739
+   335bc:	202c6425 	addi	t4,at,25637
+   335c0:	74736e49 	jalx	1cdb924 <kheader+0x1c58924>
+   335c4:	7825202e 	0x7825202e
+   335c8:	7845202c 	0x7845202c
+   335cc:	74706563 	jalx	1c1958c <kheader+0x1b9658c>
+   335d0:	206e6f69 	addi	t6,v1,28521
+   335d4:	6f63203a 	0x6f63203a
+   335d8:	25206564 	addiu	zero,t1,25956
+   335dc:	6e202c64 	0x6e202c64
+   335e0:	20656d61 	addi	a1,v1,28001
+   335e4:	202c7325 	addi	t4,at,29477
+   335e8:	63736564 	0x63736564
+   335ec:	74706972 	jalx	1c1a5c8 <kheader+0x1b975c8>
+   335f0:	206e6f69 	addi	t6,v1,28521
+   335f4:	202c7325 	addi	t4,at,29477
+   335f8:	20646162 	addi	a0,v1,24930
+   335fc:	72646461 	0x72646461
+   33600:	20737365 	addi	s3,v1,29541
+   33604:	000a7825 	or	t7,zero,t2
+   33608:	00004f4e 	0x4f4e
+   3360c:	65637865 	0x65637865
+   33610:	6f697470 	0x6f697470
+   33614:	6f6c5f6e 	0x6f6c5f6e
+   33618:	00006b63 	0x6b63
+   3361c:	00544e49 	0x544e49
+   33620:	65746e49 	0x65746e49
+   33624:	70757272 	0x70757272
+   33628:	00000074 	teq	zero,zero,0x1
+   3362c:	3f534552 	0x3f534552
+   33630:	00000000 	sll	zero,zero,0x0
+   33634:	65736552 	0x65736552
+   33638:	64657672 	0x64657672
+   3363c:	726f6620 	0x726f6620
+   33640:	554d4d20 	bnel	t2,t5,46ac4 <clusters_tbl+0x9124>
+   33644:	63786520 	0x63786520
+   33648:	69747065 	0x69747065
+   3364c:	00006e6f 	0x6e6f
+   33650:	52444441 	beql	s2,a0,44758 <clusters_tbl+0x6db8>
+   33654:	0000004c 	syscall	0x1
+   33658:	64616f4c 	0x64616f4c
+   3365c:	6f726620 	0x6f726620
+   33660:	6e61206d 	0x6e61206d
+   33664:	6c6c6920 	0x6c6c6920
+   33668:	6c616765 	0x6c616765
+   3366c:	64646120 	0x64646120
+   33670:	73736572 	0x73736572
+   33674:	00000000 	sll	zero,zero,0x0
+   33678:	52444441 	beql	s2,a0,44780 <clusters_tbl+0x6de0>
+   3367c:	00000053 	mtlhx	zero
+   33680:	726f7453 	0x726f7453
+   33684:	6f742065 	0x6f742065
+   33688:	206e6120 	addi	t6,v1,24864
+   3368c:	656c6c69 	0x656c6c69
+   33690:	206c6167 	addi	t4,v1,24935
+   33694:	72646461 	0x72646461
+   33698:	00737365 	0x737365
+   3369c:	53554249 	beql	k0,s5,43fc4 <clusters_tbl+0x6624>
+   336a0:	00000000 	sll	zero,zero,0x0
+   336a4:	20737542 	addi	s3,v1,30018
+   336a8:	6f727265 	0x6f727265
+   336ac:	6e6f2072 	0x6e6f2072
+   336b0:	736e6920 	0x736e6920
+   336b4:	63757274 	0x63757274
+   336b8:	6e6f6974 	0x6e6f6974
+   336bc:	74656620 	jalx	1959880 <kheader+0x18d6880>
+   336c0:	00006863 	0x6863
+   336c4:	53554244 	beql	k0,s5,43fd8 <clusters_tbl+0x6638>
+   336c8:	00000000 	sll	zero,zero,0x0
+   336cc:	20737542 	addi	s3,v1,30018
+   336d0:	6f727265 	0x6f727265
+   336d4:	6e6f2072 	0x6e6f2072
+   336d8:	74616420 	jalx	1859080 <kheader+0x17d6080>
+   336dc:	65722061 	0x65722061
+   336e0:	65726566 	0x65726566
+   336e4:	0065636e 	0x65636e
+   336e8:	43535953 	c0	0x1535953
+   336ec:	004c4c41 	0x4c4c41
+   336f0:	63737973 	0x63737973
+   336f4:	206c6c61 	addi	t4,v1,27745
+   336f8:	74736e69 	jalx	1cdb9a4 <kheader+0x1c589a4>
+   336fc:	74637572 	jalx	18dd5c8 <kheader+0x185a5c8>
+   33700:	206e6f69 	addi	t6,v1,28521
+   33704:	63657865 	0x63657865
+   33708:	64657475 	0x64657475
+   3370c:	00000000 	sll	zero,zero,0x0
+   33710:	54504b42 	bnel	v0,s0,4641c <clusters_tbl+0x8a7c>
+   33714:	00000000 	sll	zero,zero,0x0
+   33718:	61657262 	0x61657262
+   3371c:	6e69206b 	0x6e69206b
+   33720:	75727473 	jalx	5c9d1cc <kheader+0x5c1a1cc>
+   33724:	6f697463 	0x6f697463
+   33728:	7865206e 	0x7865206e
+   3372c:	74756365 	jalx	1d58d94 <kheader+0x1cd5d94>
+   33730:	00006465 	0x6465
+   33734:	00004952 	0x4952
+   33738:	65736552 	0x65736552
+   3373c:	64657672 	0x64657672
+   33740:	736e6920 	0x736e6920
+   33744:	63757274 	0x63757274
+   33748:	6e6f6974 	0x6e6f6974
+   3374c:	00000000 	sll	zero,zero,0x0
+   33750:	3f50434d 	0x3f50434d
+   33754:	00000000 	sll	zero,zero,0x0
+   33758:	7373694d 	0x7373694d
+   3375c:	20676e69 	addi	a3,v1,28265
+   33760:	72706f63 	0x72706f63
+   33764:	7365636f 	0x7365636f
+   33768:	00726f73 	tltu	v1,s2,0x1bd
+   3376c:	0046564f 	0x46564f
+   33770:	74697241 	jalx	1a5c904 <kheader+0x19d9904>
+   33774:	74656d68 	jalx	195b5a0 <kheader+0x18d85a0>
+   33778:	6f206369 	0x6f206369
+   3377c:	66726576 	0x66726576
+   33780:	00776f6c 	0x776f6c
+   33784:	4e4b4e55 	c3	0x4b4e55
+   33788:	3f4e574f 	0x3f4e574f
+   3378c:	00000000 	sll	zero,zero,0x0
+   33790:	6e6b6e55 	0x6e6b6e55
+   33794:	6520776f 	0x6520776f
+   33798:	726f7272 	0x726f7272
+   3379c:	00000000 	sll	zero,zero,0x0
+   337a0:	20757063 	addi	s5,v1,28771
+   337a4:	202c6425 	addi	t4,at,25637
+   337a8:	20646974 	addi	a0,v1,26996
+   337ac:	202c7825 	addi	t4,at,30757
+   337b0:	20435045 	addi	v1,v0,20549
+   337b4:	202c7825 	addi	t4,at,30757
+   337b8:	25206172 	addiu	zero,t1,24946
+   337bc:	00000a78 	0xa78
+   337c0:	4e524157 	c3	0x524157
+   337c4:	3a474e49 	xori	a3,s2,0x4e49
+   337c8:	3a732520 	xori	s3,s3,0x2520
+   337cc:	55504320 	bnel	t2,s0,44450 <clusters_tbl+0x6ab0>
+   337d0:	2c642520 	sltiu	a0,v1,9504
+   337d4:	73615420 	0x73615420
+   337d8:	6425206b 	0x6425206b
+   337dc:	6854202c 	0x6854202c
+   337e0:	64616572 	0x64616572
+   337e4:	20642520 	addi	a0,v1,9504
+   337e8:	29782528 	slti	t8,t3,9512
+   337ec:	4b205b20 	c2	0x1205b20
+   337f0:	454c4c49 	0x454c4c49
+   337f4:	0a5d2044 	j	9748110 <kheader+0x96c5110>
+   337f8:	00000000 	sll	zero,zero,0x0
+   337fc:	5f737973 	0x5f737973
+   33800:	72676973 	0x72676973
+   33804:	72757465 	0x72757465
+   33808:	0000006e 	0x6e
+   3380c:	4e524157 	c3	0x524157
+   33810:	3a474e49 	xori	a3,s2,0x4e49
+   33814:	3a732520 	xori	s3,s3,0x2520
+   33818:	6e616320 	0x6e616320
+   3381c:	20746f6e 	addi	s4,v1,28526
+   33820:	656c6564 	0x656c6564
+   33824:	20726576 	addi	s2,v1,25974
+   33828:	6e676973 	0x6e676973
+   3382c:	25206c61 	addiu	zero,t1,27745
+   33830:	68202c64 	0x68202c64
+   33834:	6c646e61 	0x6c646e61
+   33838:	40207265 	0x40207265
+   3383c:	202c7825 	addi	t4,at,30757
+   33840:	63617473 	0x63617473
+   33844:	6f745f6b 	0x6f745f6b
+   33848:	78252070 	0x78252070
+   3384c:	0000000a 	movz	zero,zero,zero
+   33850:	5f757063 	0x5f757063
+   33854:	6e676973 	0x6e676973
+   33858:	6e5f6c61 	0x6e5f6c61
+   3385c:	6669746f 	0x6669746f
+   33860:	00000079 	0x79
+   33864:	4e524157 	c3	0x524157
+   33868:	3a474e49 	xori	a3,s2,0x4e49
+   3386c:	656e5520 	0x656e5520
+   33870:	63657078 	0x63657078
+   33874:	20646574 	addi	a0,v1,25972
+   33878:	65776f70 	0x65776f70
+   3387c:	74732072 	jalx	1cc81c8 <kheader+0x1c451c8>
+   33880:	20657461 	addi	a1,v1,29793
+   33884:	29642528 	slti	a0,t3,9512
+   33888:	73616820 	clz	t5 or at,k1
+   3388c:	65656220 	0x65656220
+   33890:	7361206e 	0x7361206e
+   33894:	2064656b 	addi	a0,v1,25963
+   33898:	20726f66 	addi	s2,v1,28518
+   3389c:	20555043 	addi	s5,v0,20547
+   338a0:	202c6425 	addi	t4,at,25637
+   338a4:	4320666f 	c0	0x120666f
+   338a8:	7473756c 	jalx	1cdd5b0 <kheader+0x1c5a5b0>
+   338ac:	25207265 	addiu	zero,t1,29285
+   338b0:	00000a64 	0xa64
+   338b4:	4f525245 	c3	0x1525245
+   338b8:	55203a52 	bnezl	t1,42204 <clusters_tbl+0x4864>
+   338bc:	6f6e6b6e 	0x6f6e6b6e
+   338c0:	70206e77 	0x70206e77
+   338c4:	7265776f 	0x7265776f
+   338c8:	61747320 	0x61747320
+   338cc:	28206574 	slti	zero,at,25972
+   338d0:	20296425 	addi	t1,at,25637
+   338d4:	20736168 	addi	s3,v1,24936
+   338d8:	6e656562 	0x6e656562
+   338dc:	6b736120 	0x6b736120
+   338e0:	66206465 	0x66206465
+   338e4:	4320726f 	c0	0x120726f
+   338e8:	25205550 	addiu	zero,t1,21840
+   338ec:	6f202c64 	0x6f202c64
+   338f0:	6c432066 	0x6c432066
+   338f4:	65747375 	0x65747375
+   338f8:	64252072 	0x64252072
+   338fc:	0000000a 	movz	zero,zero,zero
+   33900:	4e524157 	c3	0x524157
+   33904:	3a474e49 	xori	a3,s2,0x4e49
+   33908:	206f4e20 	addi	t7,v1,20000
+   3390c:	69676572 	0x69676572
+   33910:	72657473 	0x72657473
+   33914:	68206465 	0x68206465
+   33918:	6c646e61 	0x6c646e61
+   3391c:	66207265 	0x66207265
+   33920:	5249206f 	beql	s2,t1,3bae0 <soclib_xicu_driver+0x20e0>
+   33924:	64252051 	0x64252051
+   33928:	206e6f20 	addi	t6,v1,28448
+   3392c:	20555043 	addi	s5,v0,20547
+   33930:	000a6425 	0xa6425
+   33934:	4e524157 	c3	0x524157
+   33938:	3a474e49 	xori	a3,s2,0x4e49
+   3393c:	51524920 	beql	t2,s2,45dc0 <clusters_tbl+0x8420>
+   33940:	20642520 	addi	a0,v1,9504
+   33944:	43206e6f 	c0	0x1206e6f
+   33948:	25205550 	addiu	zero,t1,21840
+   3394c:	61682064 	0x61682064
+   33950:	65622073 	0x65622073
+   33954:	6d206e65 	0x6d206e65
+   33958:	656b7361 	0x656b7361
+   3395c:	00000a64 	0xa64
+   33960:	464e495b 	c1	0x4e495b
+   33964:	09095d4f 	j	425753c <kheader+0x41d453c>
+   33968:	49545720 	0x49545720
+   3396c:	20642520 	addi	a0,v1,9504
+   33970:	203e2d3c 	addi	s8,at,11580
+   33974:	20555043 	addi	s5,v0,20547
+   33978:	28206425 	slti	zero,at,25637
+   3397c:	6c69616d 	0x6c69616d
+   33980:	20786f62 	addi	t8,v1,28514
+   33984:	78257830 	0x78257830
+   33988:	09297825 	j	4a5e094 <kheader+0x49db094>
+   3398c:	205b0909 	addi	k1,v0,2313
+   33990:	5d206425 	bgtzl	t1,4ca28 <cluster_manager+0x5c78>
+   33994:	0000000a 	movz	zero,zero,zero
+   33998:	00495049 	0x495049
+   3399c:	5252455b 	beql	s2,s2,44f0c <clusters_tbl+0x756c>
+   339a0:	095d524f 	j	575493c <kheader+0x56d193c>
+   339a4:	6c696146 	0x6c696146
+   339a8:	74206465 	jalx	819194 <kheader+0x796194>
+   339ac:	6962206f 	0x6962206f
+   339b0:	2520646e 	addiu	zero,t1,25710
+   339b4:	69762073 	0x69762073
+   339b8:	74772061 	jalx	1dc8184 <kheader+0x1d45184>
+   339bc:	616d5f69 	0x616d5f69
+   339c0:	6f626c69 	0x6f626c69
+   339c4:	78302078 	0x78302078
+   339c8:	253a7825 	addiu	k0,t1,30757
+   339cc:	202c2078 	addi	t4,at,8312
+   339d0:	78206e6f 	0x78206e6f
+   339d4:	20756369 	addi	s5,v1,25449
+   339d8:	40207325 	0x40207325
+   339dc:	5b207825 	blezl	t9,51a74 <cluster_manager+0xacc4>
+   339e0:	72726520 	0x72726520
+   339e4:	20642520 	addi	a0,v1,9504
+   339e8:	00000a5d 	0xa5d
+   339ec:	5252455b 	beql	s2,s2,44f5c <clusters_tbl+0x75bc>
+   339f0:	095d524f 	j	575493c <kheader+0x56d193c>
+   339f4:	58206f4e 	blezl	at,4f730 <cluster_manager+0x8980>
+   339f8:	20554349 	addi	s5,v0,17225
+   339fc:	46207349 	c1	0x207349
+   33a00:	646e756f 	0x646e756f
+   33a04:	726f6620 	0x726f6620
+   33a08:	504f4920 	beql	v0,t7,45e8c <clusters_tbl+0x84ec>
+   33a0c:	63204349 	0x63204349
+   33a10:	7473756c 	jalx	1cdd5b0 <kheader+0x1c5a5b0>
+   33a14:	25207265 	addiu	zero,t1,29285
+   33a18:	00000a64 	0xa64
+   33a1c:	4e495b0a 	c3	0x495b0a
+   33a20:	095d4f46 	j	5753d18 <kheader+0x56d0d18>
+   33a24:	49504f49 	0x49504f49
+   33a28:	6c632043 	0x6c632043
+   33a2c:	65747375 	0x65747375
+   33a30:	6f632072 	0x6f632072
+   33a34:	6769666e 	0x6769666e
+   33a38:	74617275 	jalx	185c9d4 <kheader+0x17d99d4>
+   33a3c:	3a6e6f69 	xori	t6,s3,0x6f69
+   33a40:	64696320 	0x64696320
+   33a44:	20642520 	addi	a0,v1,9504
+   33a48:	2578303c 	addiu	t8,t3,12348
+   33a4c:	78302c78 	0x78302c78
+   33a50:	093e7825 	j	4f9e094 <kheader+0x4f1b094>
+   33a54:	6425205b 	0x6425205b
+   33a58:	000a5d20 	0xa5d20
+   33a5c:	5252455b 	beql	s2,s2,44fcc <clusters_tbl+0x762c>
+   33a60:	095d524f 	j	575493c <kheader+0x56d193c>
+   33a64:	65206f4e 	0x65206f4e
+   33a68:	67756f6e 	0x67756f6e
+   33a6c:	54572068 	bnel	v0,s7,3bc10 <envrion+0x11c>
+   33a70:	6e692049 	0x6e692049
+   33a74:	756c6320 	jalx	5b18c80 <kheader+0x5a95c80>
+   33a78:	72657473 	0x72657473
+   33a7c:	0a642520 	j	9909480 <kheader+0x9886480>
+   33a80:	00000000 	sll	zero,zero,0x0
+   33a84:	464e495b 	c1	0x4e495b
+   33a88:	4c095d4f 	0x4c095d4f
+   33a8c:	696b6e69 	0x696b6e69
+   33a90:	6420676e 	0x6420676e
+   33a94:	63697665 	0x63697665
+   33a98:	73252065 	0x73252065
+   33a9c:	206f7420 	addi	t7,v1,29728
+   33aa0:	55434958 	bnel	t2,v1,46004 <clusters_tbl+0x8664>
+   33aa4:	206e6f20 	addi	t6,v1,28448
+   33aa8:	73756c63 	0x73756c63
+   33aac:	20726574 	addi	s2,v1,25972
+   33ab0:	74206425 	jalx	819094 <kheader+0x796094>
+   33ab4:	756f7268 	jalx	5bdc9a0 <kheader+0x5b599a0>
+   33ab8:	49206867 	0x49206867
+   33abc:	4349504f 	c0	0x149504f
+   33ac0:	756c6320 	jalx	5b18c80 <kheader+0x5a95c80>
+   33ac4:	72657473 	0x72657473
+   33ac8:	25205b09 	addiu	zero,t1,23305
+   33acc:	0a5d2064 	j	9748190 <kheader+0x96c5190>
+   33ad0:	00000000 	sll	zero,zero,0x0
+   33ad4:	5252455b 	beql	s2,s2,45044 <clusters_tbl+0x76a4>
+   33ad8:	095d524f 	j	575493c <kheader+0x56d193c>
+   33adc:	58206f4e 	blezl	at,4f818 <cluster_manager+0x8a68>
+   33ae0:	20554349 	addi	s5,v0,17225
+   33ae4:	66207369 	0x66207369
+   33ae8:	646e756f 	0x646e756f
+   33aec:	726f6620 	0x726f6620
+   33af0:	756c6320 	jalx	5b18c80 <kheader+0x5a95c80>
+   33af4:	72657473 	0x72657473
+   33af8:	0a642520 	j	9909480 <kheader+0x9886480>
+   33afc:	00000000 	sll	zero,zero,0x0
+   33b00:	5252455b 	beql	s2,s2,45070 <clusters_tbl+0x76d0>
+   33b04:	095d524f 	j	575493c <kheader+0x56d193c>
+   33b08:	6c696146 	0x6c696146
+   33b0c:	74206465 	jalx	819194 <kheader+0x796194>
+   33b10:	6962206f 	0x6962206f
+   33b14:	6420646e 	0x6420646e
+   33b18:	63697665 	0x63697665
+   33b1c:	73252065 	0x73252065
+   33b20:	7269202c 	0x7269202c
+   33b24:	64252071 	0x64252071
+   33b28:	6e6f202c 	0x6e6f202c
+   33b2c:	63697820 	0x63697820
+   33b30:	73252075 	0x73252075
+   33b34:	78254020 	0x78254020
+   33b38:	65205b20 	0x65205b20
+   33b3c:	25207272 	addiu	zero,t1,29298
+   33b40:	0a5d2064 	j	9748190 <kheader+0x96c5190>
+   33b44:	00000000 	sll	zero,zero,0x0
+   33b48:	5241575b 	beql	s2,at,498b8 <cluster_manager+0x2b08>
+   33b4c:	474e494e 	c1	0x14e494e
+   33b50:	6e55095d 	0x6e55095d
+   33b54:	776f6e6b 	jalx	dbdb9ac <kheader+0xdb589ac>
+   33b58:	6544206e 	0x6544206e
+   33b5c:	65636976 	0x65636976
+   33b60:	69635b20 	0x69635b20
+   33b64:	64252064 	0x64252064
+   33b68:	6564202c 	0x6564202c
+   33b6c:	64252076 	0x64252076
+   33b70:	6162202c 	0x6162202c
+   33b74:	30206573 	andi	zero,at,0x6573
+   33b78:	2c782578 	sltiu	t8,v1,9592
+   33b7c:	76656420 	jalx	9959080 <kheader+0x98d6080>
+   33b80:	25206469 	addiu	zero,t1,25705
+   33b84:	202c5d64 	addi	t4,at,23908
+   33b88:	6f6e6749 	0x6f6e6749
+   33b8c:	0a646572 	j	99195c8 <kheader+0x98965c8>
+   33b90:	00000000 	sll	zero,zero,0x0
+   33b94:	5252455b 	beql	s2,s2,45104 <clusters_tbl+0x7764>
+   33b98:	095d524f 	j	575493c <kheader+0x56d193c>
+   33b9c:	6c696146 	0x6c696146
+   33ba0:	54206465 	bnezl	at,4cd38 <cluster_manager+0x5f88>
+   33ba4:	6c41206f 	0x6c41206f
+   33ba8:	61636f6c 	0x61636f6c
+   33bac:	44206574 	0x44206574
+   33bb0:	63697665 	0x63697665
+   33bb4:	435b2065 	c0	0x15b2065
+   33bb8:	7473756c 	jalx	1cdd5b0 <kheader+0x1c5a5b0>
+   33bbc:	25207265 	addiu	zero,t1,29285
+   33bc0:	44202c64 	0x44202c64
+   33bc4:	25207665 	addiu	zero,t1,30309
+   33bc8:	000a5d64 	0xa5d64
+   33bcc:	5252455b 	beql	s2,s2,4513c <clusters_tbl+0x779c>
+   33bd0:	095d524f 	j	575493c <kheader+0x56d193c>
+   33bd4:	6c696146 	0x6c696146
+   33bd8:	54206465 	bnezl	at,4cd70 <cluster_manager+0x5fc0>
+   33bdc:	6e49206f 	0x6e49206f
+   33be0:	61697469 	0x61697469
+   33be4:	657a696c 	0x657a696c
+   33be8:	76654420 	jalx	9951080 <kheader+0x98ce080>
+   33bec:	20656369 	addi	a1,v1,25449
+   33bf0:	5b207325 	blezl	t9,50888 <cluster_manager+0x9ad8>
+   33bf4:	73756c43 	0x73756c43
+   33bf8:	20726574 	addi	s2,v1,25972
+   33bfc:	202c6425 	addi	t4,at,25637
+   33c00:	20766544 	addi	s6,v1,25924
+   33c04:	202c6425 	addi	t4,at,25637
+   33c08:	20727245 	addi	s2,v1,29253
+   33c0c:	0a5d6425 	j	9759094 <kheader+0x96d6094>
+   33c10:	00000000 	sll	zero,zero,0x0
+   33c14:	464e495b 	c1	0x4e495b
+   33c18:	46095d4f 	c1	0x95d4f
+   33c1c:	646e756f 	0x646e756f
+   33c20:	76654420 	jalx	9951080 <kheader+0x98ce080>
+   33c24:	3a656369 	xori	a1,s3,0x6369
+   33c28:	09732520 	j	5cc9480 <kheader+0x5c46480>
+   33c2c:	09090909 	j	4242424 <kheader+0x41bf424>
+   33c30:	25205b09 	addiu	zero,t1,23305
+   33c34:	0a5d2064 	j	9748190 <kheader+0x96c5190>
+   33c38:	464e495b 	c1	0x4e495b
+   33c3c:	09095d4f 	j	425753c <kheader+0x41d453c>
+   33c40:	65736142 	0x65736142
+   33c44:	78303c20 	0x78303c20
+   33c48:	203e7825 	addi	s8,at,30757
+   33c4c:	20646963 	addi	a0,v1,26979
+   33c50:	53206425 	beqzl	t9,4cce8 <cluster_manager+0x5f38>
+   33c54:	20657a69 	addi	a1,v1,31337
+   33c58:	2578303c 	addiu	t8,t3,12348
+   33c5c:	49203e78 	0x49203e78
+   33c60:	3c207172 	0x3c207172
+   33c64:	093e6425 	j	4f99094 <kheader+0x4f16094>
+   33c68:	25205b09 	addiu	zero,t1,23305
+   33c6c:	0a5d2064 	j	9748190 <kheader+0x96c5190>
+   33c70:	00000000 	sll	zero,zero,0x0
+   33c74:	5252455b 	beql	s2,s2,451e4 <clusters_tbl+0x7844>
+   33c78:	095d524f 	j	575493c <kheader+0x56d193c>
+   33c7c:	203a7325 	addi	k0,at,29477
+   33c80:	78656e55 	0x78656e55
+   33c84:	74636570 	jalx	18d95c0 <kheader+0x18565c0>
+   33c88:	6d206465 	0x6d206465
+   33c8c:	726f6d65 	0x726f6d65
+   33c90:	69732079 	0x69732079
+   33c94:	6620657a 	0x6620657a
+   33c98:	6320726f 	0x6320726f
+   33c9c:	7473756c 	jalx	1cdd5b0 <kheader+0x1c5a5b0>
+   33ca0:	25207265 	addiu	zero,t1,29285
+   33ca4:	00000a75 	0xa75
+   33ca8:	52455b0a 	beql	s2,a1,4a8d4 <cluster_manager+0x3b24>
+   33cac:	5d524f52 	0x5d524f52
+   33cb0:	3a732509 	xori	s3,s3,0x2509
+   33cb4:	69685420 	0x69685420
+   33cb8:	654b2073 	0x654b2073
+   33cbc:	6c656e72 	0x6c656e72
+   33cc0:	72655620 	0x72655620
+   33cc4:	6e6f6973 	0x6e6f6973
+   33cc8:	206f4420 	addi	t7,v1,17440
+   33ccc:	20746f4e 	addi	s4,v1,28494
+   33cd0:	70707553 	0x70707553
+   33cd4:	2074726f 	addi	s4,v1,29295
+   33cd8:	2d555043 	sltiu	s5,t2,20547
+   33cdc:	796c6e4f 	0x796c6e4f
+   33ce0:	756c4320 	jalx	5b10c80 <kheader+0x5a8dc80>
+   33ce4:	72657473 	0x72657473
+   33ce8:	63202c73 	0x63202c73
+   33cec:	25206469 	addiu	zero,t1,25705
+   33cf0:	00000a64 	0xa64
+   33cf4:	464e495b 	c1	0x4e495b
+   33cf8:	48095d4f 	0x48095d4f
+   33cfc:	77647261 	jalx	d91c984 <kheader+0xd899984>
+   33d00:	20657261 	addi	a1,v1,29281
+   33d04:	74696e69 	jalx	1a5b9a4 <kheader+0x19d89a4>
+   33d08:	696c6169 	0x696c6169
+   33d0c:	6974617a 	0x6974617a
+   33d10:	6f206e6f 	0x6f206e6f
+   33d14:	6c632066 	0x6c632066
+   33d18:	65747375 	0x65747375
+   33d1c:	75252072 	jalx	49481c8 <kheader+0x48c51c8>
+   33d20:	09090909 	j	4242424 <kheader+0x41bf424>
+   33d24:	6425205b 	0x6425205b
+   33d28:	000a5d20 	0xa5d20
+   33d2c:	4c434f53 	0x4c434f53
+   33d30:	542d4249 	bnel	at,t5,44658 <clusters_tbl+0x6cb8>
+   33d34:	00524153 	0x524153
+   33d38:	4f525245 	c3	0x1525245
+   33d3c:	46203a52 	movz.d	$f9,$f7,zero
+   33d40:	656c6961 	0x656c6961
+   33d44:	6f542064 	0x6f542064
+   33d48:	696e4920 	0x696e4920
+   33d4c:	6c616974 	0x6c616974
+   33d50:	20657a69 	addi	a1,v1,31337
+   33d54:	73756c43 	0x73756c43
+   33d58:	20726574 	addi	s2,v1,25972
+   33d5c:	202c6425 	addi	t4,at,25637
+   33d60:	20727245 	addi	s2,v1,29253
+   33d64:	000a6425 	0xa6425
+   33d68:	4e495b0a 	c3	0x495b0a
+   33d6c:	095d4f46 	j	5753d18 <kheader+0x56d0d18>
+   33d70:	69766544 	0x69766544
+   33d74:	20736563 	addi	s3,v1,25955
+   33d78:	74696e69 	jalx	1a5b9a4 <kheader+0x19d89a4>
+   33d7c:	696c6169 	0x696c6169
+   33d80:	6974617a 	0x6974617a
+   33d84:	66206e6f 	0x66206e6f
+   33d88:	6320726f 	0x6320726f
+   33d8c:	7473756c 	jalx	1cdd5b0 <kheader+0x1c5a5b0>
+   33d90:	25207265 	addiu	zero,t1,29285
+   33d94:	09090964 	j	4242590 <kheader+0x41bf590>
+   33d98:	25205b09 	addiu	zero,t1,23305
+   33d9c:	0a5d2064 	j	9748190 <kheader+0x96c5190>
+   33da0:	00000000 	sll	zero,zero,0x0
+   33da4:	4d4c4140 	0x4d4c4140
+   33da8:	4120534f 	0x4120534f
+   33dac:	20484352 	addi	t0,v0,17234
+   33db0:	00424942 	0x424942
+   33db4:	68637261 	0x68637261
+   33db8:	6174735f 	0x6174735f
+   33dbc:	695f6574 	0x695f6574
+   33dc0:	0074696e 	0x74696e
+   33dc4:	6e697270 	0x6e697270
+   33dc8:	6c5f6b74 	0x6c5f6b74
+   33dcc:	006b636f 	0x6b636f
+   33dd0:	5f727369 	0x5f727369
+   33dd4:	6b636f6c 	0x6b636f6c
+   33dd8:	00000000 	sll	zero,zero,0x0
+   33ddc:	746f6f62 	jalx	1bdbd88 <kheader+0x1b58d88>
+   33de0:	636f6c5f 	0x636f6c5f
+   33de4:	0000006b 	0x6b
+   33de8:	000390d0 	0x390d0
+   33dec:	000390e0 	0x390e0
+   33df0:	5f554d4d 	0x5f554d4d
+   33df4:	54495257 	bnel	v0,t1,48754 <cluster_manager+0x19a4>
+   33df8:	54505f45 	bnel	v0,s0,4bb10 <cluster_manager+0x4d60>
+   33dfc:	4e555f31 	c3	0x555f31
+   33e00:	5050414d 	beql	v0,s0,44338 <clusters_tbl+0x6998>
+   33e04:	00004445 	0x4445
+   33e08:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   33e0c:	63612065 	0x63612065
+   33e10:	73736563 	0x73736563
+   33e14:	50203a20 	beqzl	at,42698 <clusters_tbl+0x4cf8>
+   33e18:	20656761 	addi	a1,v1,26465
+   33e1c:	6c756166 	0x6c756166
+   33e20:	6e6f2074 	0x6e6f2074
+   33e24:	62615420 	0x62615420
+   33e28:	3120656c 	andi	zero,t1,0x656c
+   33e2c:	6e692820 	0x6e692820
+   33e30:	696c6176 	0x696c6176
+   33e34:	54502064 	bnel	v0,s0,3bfc8 <ttys_tbl+0x3b0>
+   33e38:	00002945 	0x2945
+   33e3c:	206e6f4e 	addi	t6,v1,28494
+   33e40:	61746146 	0x61746146
+   33e44:	7245206c 	0x7245206c
+   33e48:	00726f72 	tlt	v1,s2,0x1bd
+   33e4c:	5f554d4d 	0x5f554d4d
+   33e50:	54495257 	bnel	v0,t1,487b0 <cluster_manager+0x1a00>
+   33e54:	54505f45 	bnel	v0,s0,4bb6c <cluster_manager+0x4dbc>
+   33e58:	4e555f32 	c3	0x555f32
+   33e5c:	5050414d 	beql	v0,s0,44394 <clusters_tbl+0x69f4>
+   33e60:	00004445 	0x4445
+   33e64:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   33e68:	63612065 	0x63612065
+   33e6c:	73736563 	0x73736563
+   33e70:	50203a20 	beqzl	at,426f4 <clusters_tbl+0x4d54>
+   33e74:	20656761 	addi	a1,v1,26465
+   33e78:	6c756166 	0x6c756166
+   33e7c:	6e6f2074 	0x6e6f2074
+   33e80:	62615420 	0x62615420
+   33e84:	3220656c 	andi	zero,s1,0x656c
+   33e88:	6e692820 	0x6e692820
+   33e8c:	696c6176 	0x696c6176
+   33e90:	54502064 	bnel	v0,s0,3c024 <ttys_tbl+0x40c>
+   33e94:	00002945 	0x2945
+   33e98:	5f554d4d 	0x5f554d4d
+   33e9c:	54495257 	bnel	v0,t1,487fc <cluster_manager+0x1a4c>
+   33ea0:	52505f45 	beql	s2,s0,4bbb8 <cluster_manager+0x4e08>
+   33ea4:	4c495649 	0x4c495649
+   33ea8:	5f454745 	0x5f454745
+   33eac:	4c4f4956 	0x4c4f4956
+   33eb0:	4f495441 	c3	0x1495441
+   33eb4:	0000004e 	0x4e
+   33eb8:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   33ebc:	63612065 	0x63612065
+   33ec0:	73736563 	0x73736563
+   33ec4:	50203a20 	beqzl	at,42748 <clusters_tbl+0x4da8>
+   33ec8:	65746f72 	0x65746f72
+   33ecc:	64657463 	0x64657463
+   33ed0:	63636120 	0x63636120
+   33ed4:	20737365 	addi	s3,v1,29541
+   33ed8:	75206e69 	jalx	481b9a4 <kheader+0x47989a4>
+   33edc:	20726573 	addi	s2,v1,25971
+   33ee0:	65646f6d 	0x65646f6d
+   33ee4:	00000000 	sll	zero,zero,0x0
+   33ee8:	72657355 	0x72657355
+   33eec:	72724520 	0x72724520
+   33ef0:	0000726f 	0x726f
+   33ef4:	5f554d4d 	0x5f554d4d
+   33ef8:	54495257 	bnel	v0,t1,48858 <cluster_manager+0x1aa8>
+   33efc:	43415f45 	c0	0x1415f45
+   33f00:	5f534543 	0x5f534543
+   33f04:	4c4f4956 	0x4c4f4956
+   33f08:	4f495441 	c3	0x1495441
+   33f0c:	0000004e 	0x4e
+   33f10:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   33f14:	63612065 	0x63612065
+   33f18:	73736563 	0x73736563
+   33f1c:	57203a20 	bnezl	t9,427a0 <clusters_tbl+0x4e00>
+   33f20:	65746972 	0x65746972
+   33f24:	206f7420 	addi	t7,v1,29728
+   33f28:	6f6e2061 	0x6f6e2061
+   33f2c:	7277206e 	0x7277206e
+   33f30:	62617469 	0x62617469
+   33f34:	7020656c 	0x7020656c
+   33f38:	00656761 	0x656761
+   33f3c:	72657355 	0x72657355
+   33f40:	72726520 	0x72726520
+   33f44:	0000726f 	0x726f
+   33f48:	5f554d4d 	0x5f554d4d
+   33f4c:	54495257 	bnel	v0,t1,488ac <cluster_manager+0x1afc>
+   33f50:	4e555f45 	c3	0x555f45
+   33f54:	49464544 	0x49464544
+   33f58:	5f44454e 	0x5f44454e
+   33f5c:	004e5458 	0x4e5458
+   33f60:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   33f64:	63612065 	0x63612065
+   33f68:	73736563 	0x73736563
+   33f6c:	55203a20 	bnezl	t1,427f0 <clusters_tbl+0x4e50>
+   33f70:	6665646e 	0x6665646e
+   33f74:	64656e69 	0x64656e69
+   33f78:	74786520 	jalx	1e19480 <kheader+0x1d96480>
+   33f7c:	616e7265 	0x616e7265
+   33f80:	6361206c 	0x6361206c
+   33f84:	73736563 	0x73736563
+   33f88:	64646120 	0x64646120
+   33f8c:	73736572 	0x73736572
+   33f90:	00000000 	sll	zero,zero,0x0
+   33f94:	5f554d4d 	0x5f554d4d
+   33f98:	54495257 	bnel	v0,t1,488f8 <cluster_manager+0x1b48>
+   33f9c:	54505f45 	bnel	v0,s0,4bcb4 <cluster_manager+0x4f04>
+   33fa0:	4c495f31 	0x4c495f31
+   33fa4:	4147454c 	0x4147454c
+   33fa8:	43415f4c 	c0	0x1415f4c
+   33fac:	53534543 	beql	k0,s3,454bc <clusters_tbl+0x7b1c>
+   33fb0:	00000000 	sll	zero,zero,0x0
+   33fb4:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   33fb8:	63612065 	0x63612065
+   33fbc:	73736563 	0x73736563
+   33fc0:	42203a20 	wait	0x80e8
+   33fc4:	45207375 	0x45207375
+   33fc8:	726f7272 	0x726f7272
+   33fcc:	206e6920 	addi	t6,v1,26912
+   33fd0:	6c626154 	0x6c626154
+   33fd4:	61203165 	0x61203165
+   33fd8:	73656363 	0x73656363
+   33fdc:	00000073 	tltu	zero,zero,0x1
+   33fe0:	6e72654b 	0x6e72654b
+   33fe4:	65206c65 	0x65206c65
+   33fe8:	726f7272 	0x726f7272
+   33fec:	00000000 	sll	zero,zero,0x0
+   33ff0:	5f554d4d 	0x5f554d4d
+   33ff4:	54495257 	bnel	v0,t1,48954 <cluster_manager+0x1ba4>
+   33ff8:	54505f45 	bnel	v0,s0,4bd10 <cluster_manager+0x4f60>
+   33ffc:	4c495f32 	0x4c495f32
+   34000:	4147454c 	0x4147454c
+   34004:	43415f4c 	c0	0x1415f4c
+   34008:	53534543 	beql	k0,s3,45518 <clusters_tbl+0x7b78>
+   3400c:	00000000 	sll	zero,zero,0x0
+   34010:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   34014:	63612065 	0x63612065
+   34018:	73736563 	0x73736563
+   3401c:	42203a20 	wait	0x80e8
+   34020:	45207375 	0x45207375
+   34024:	726f7272 	0x726f7272
+   34028:	206e6920 	addi	t6,v1,26912
+   3402c:	6c626154 	0x6c626154
+   34030:	61203265 	0x61203265
+   34034:	73656363 	0x73656363
+   34038:	00000073 	tltu	zero,zero,0x1
+   3403c:	5f554d4d 	0x5f554d4d
+   34040:	54495257 	bnel	v0,t1,489a0 <cluster_manager+0x1bf0>
+   34044:	41445f45 	0x41445f45
+   34048:	495f4154 	0x495f4154
+   3404c:	47454c4c 	c1	0x1454c4c
+   34050:	415f4c41 	0x415f4c41
+   34054:	53454343 	beql	k0,a1,44d64 <clusters_tbl+0x73c4>
+   34058:	00000053 	mtlhx	zero
+   3405c:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   34060:	63612065 	0x63612065
+   34064:	73736563 	0x73736563
+   34068:	42203a20 	wait	0x80e8
+   3406c:	45207375 	0x45207375
+   34070:	726f7272 	0x726f7272
+   34074:	72756420 	0x72756420
+   34078:	20676e69 	addi	a3,v1,28265
+   3407c:	20656874 	addi	a1,v1,26740
+   34080:	68636163 	0x68636163
+   34084:	63612065 	0x63612065
+   34088:	73736563 	0x73736563
+   3408c:	00000000 	sll	zero,zero,0x0
+   34090:	5f554d4d 	0x5f554d4d
+   34094:	44414552 	0x44414552
+   34098:	3154505f 	andi	s4,t2,0x505f
+   3409c:	4d4e555f 	0x4d4e555f
+   340a0:	45505041 	0x45505041
+   340a4:	00000044 	0x44
+   340a8:	64616552 	0x64616552
+   340ac:	63636120 	0x63636120
+   340b0:	20737365 	addi	s3,v1,29541
+   340b4:	6150203a 	0x6150203a
+   340b8:	66206567 	0x66206567
+   340bc:	746c7561 	jalx	1b1d584 <kheader+0x1a9a584>
+   340c0:	206e6f20 	addi	t6,v1,28448
+   340c4:	6c626154 	0x6c626154
+   340c8:	28203165 	slti	zero,at,12645
+   340cc:	61766e69 	0x61766e69
+   340d0:	2064696c 	addi	a0,v1,26988
+   340d4:	29455450 	slti	a1,t2,21584
+   340d8:	00000000 	sll	zero,zero,0x0
+   340dc:	206e6f6e 	addi	t6,v1,28526
+   340e0:	61746166 	0x61746166
+   340e4:	7265206c 	0x7265206c
+   340e8:	00726f72 	tlt	v1,s2,0x1bd
+   340ec:	5f554d4d 	0x5f554d4d
+   340f0:	44414552 	0x44414552
+   340f4:	3254505f 	andi	s4,s2,0x505f
+   340f8:	4d4e555f 	0x4d4e555f
+   340fc:	45505041 	0x45505041
+   34100:	00000044 	0x44
+   34104:	64616552 	0x64616552
+   34108:	63636120 	0x63636120
+   3410c:	20737365 	addi	s3,v1,29541
+   34110:	6150203a 	0x6150203a
+   34114:	66206567 	0x66206567
+   34118:	746c7561 	jalx	1b1d584 <kheader+0x1a9a584>
+   3411c:	206e6f20 	addi	t6,v1,28448
+   34120:	6c626154 	0x6c626154
+   34124:	20322065 	addi	s2,at,8293
+   34128:	766e6928 	jalx	9b9a4a0 <kheader+0x9b174a0>
+   3412c:	64696c61 	0x64696c61
+   34130:	45545020 	0x45545020
+   34134:	00000029 	0x29
+   34138:	5f554d4d 	0x5f554d4d
+   3413c:	44414552 	0x44414552
+   34140:	4952505f 	0x4952505f
+   34144:	454c4956 	0x454c4956
+   34148:	565f4547 	bnel	s2,ra,45668 <clusters_tbl+0x7cc8>
+   3414c:	414c4f49 	0x414c4f49
+   34150:	4e4f4954 	c3	0x4f4954
+   34154:	00000000 	sll	zero,zero,0x0
+   34158:	64616552 	0x64616552
+   3415c:	63636120 	0x63636120
+   34160:	20737365 	addi	s3,v1,29541
+   34164:	7250203a 	0x7250203a
+   34168:	6365746f 	0x6365746f
+   3416c:	20646574 	addi	a0,v1,25972
+   34170:	65636361 	0x65636361
+   34174:	69207373 	0x69207373
+   34178:	7375206e 	0x7375206e
+   3417c:	6d207265 	0x6d207265
+   34180:	0065646f 	0x65646f
+   34184:	5f554d4d 	0x5f554d4d
+   34188:	44414552 	0x44414552
+   3418c:	4558455f 	0x4558455f
+   34190:	49565f43 	0x49565f43
+   34194:	54414c4f 	bnel	v0,at,472d4 <cluster_manager+0x524>
+   34198:	004e4f49 	0x4e4f49
+   3419c:	64616552 	0x64616552
+   341a0:	63636120 	0x63636120
+   341a4:	20737365 	addi	s3,v1,29541
+   341a8:	7845203a 	0x7845203a
+   341ac:	61206365 	0x61206365
+   341b0:	73656363 	0x73656363
+   341b4:	6f742073 	0x6f742073
+   341b8:	6e206120 	0x6e206120
+   341bc:	65206e6f 	0x65206e6f
+   341c0:	20636578 	addi	v1,v1,25976
+   341c4:	65676170 	0x65676170
+   341c8:	00000000 	sll	zero,zero,0x0
+   341cc:	5f554d4d 	0x5f554d4d
+   341d0:	44414552 	0x44414552
+   341d4:	444e555f 	0x444e555f
+   341d8:	4e494645 	c3	0x494645
+   341dc:	585f4445 	0x585f4445
+   341e0:	00004e54 	0x4e54
+   341e4:	64616552 	0x64616552
+   341e8:	63636120 	0x63636120
+   341ec:	20737365 	addi	s3,v1,29541
+   341f0:	6e55203a 	0x6e55203a
+   341f4:	69666564 	0x69666564
+   341f8:	2064656e 	addi	a0,v1,25966
+   341fc:	65747865 	0x65747865
+   34200:	6c616e72 	0x6c616e72
+   34204:	63636120 	0x63636120
+   34208:	20737365 	addi	s3,v1,29541
+   3420c:	72646461 	0x72646461
+   34210:	00737365 	0x737365
+   34214:	5f554d4d 	0x5f554d4d
+   34218:	44414552 	0x44414552
+   3421c:	3154505f 	andi	s4,t2,0x505f
+   34220:	4c4c495f 	0x4c4c495f
+   34224:	4c414745 	0x4c414745
+   34228:	4343415f 	c0	0x143415f
+   3422c:	00535345 	0x535345
+   34230:	64616552 	0x64616552
+   34234:	63636120 	0x63636120
+   34238:	20737365 	addi	s3,v1,29541
+   3423c:	7542203a 	jalx	50880e8 <kheader+0x50050e8>
+   34240:	72452073 	0x72452073
+   34244:	20726f72 	addi	s2,v1,28530
+   34248:	54206e69 	bnezl	at,4fbf0 <cluster_manager+0x8e40>
+   3424c:	656c6261 	0x656c6261
+   34250:	63612031 	0x63612031
+   34254:	73736563 	0x73736563
+   34258:	00000000 	sll	zero,zero,0x0
+   3425c:	5f554d4d 	0x5f554d4d
+   34260:	44414552 	0x44414552
+   34264:	3254505f 	andi	s4,s2,0x505f
+   34268:	4c4c495f 	0x4c4c495f
+   3426c:	4c414745 	0x4c414745
+   34270:	4343415f 	c0	0x143415f
+   34274:	00535345 	0x535345
+   34278:	64616552 	0x64616552
+   3427c:	63636120 	0x63636120
+   34280:	20737365 	addi	s3,v1,29541
+   34284:	7542203a 	jalx	50880e8 <kheader+0x50050e8>
+   34288:	72452073 	0x72452073
+   3428c:	20726f72 	addi	s2,v1,28530
+   34290:	54206e69 	bnezl	at,4fc38 <cluster_manager+0x8e88>
+   34294:	656c6261 	0x656c6261
+   34298:	63612032 	0x63612032
+   3429c:	73736563 	0x73736563
+   342a0:	00000000 	sll	zero,zero,0x0
+   342a4:	5f554d4d 	0x5f554d4d
+   342a8:	44414552 	0x44414552
+   342ac:	5441445f 	bnel	v0,at,4542c <clusters_tbl+0x7a8c>
+   342b0:	4c495f41 	0x4c495f41
+   342b4:	4147454c 	0x4147454c
+   342b8:	43415f4c 	c0	0x1415f4c
+   342bc:	53534543 	beql	k0,s3,457cc <clusters_tbl+0x7e2c>
+   342c0:	00000000 	sll	zero,zero,0x0
+   342c4:	64616552 	0x64616552
+   342c8:	63636120 	0x63636120
+   342cc:	20737365 	addi	s3,v1,29541
+   342d0:	7542203a 	jalx	50880e8 <kheader+0x50050e8>
+   342d4:	72452073 	0x72452073
+   342d8:	20726f72 	addi	s2,v1,28530
+   342dc:	69727564 	0x69727564
+   342e0:	7420676e 	jalx	819db8 <kheader+0x796db8>
+   342e4:	63206568 	0x63206568
+   342e8:	65686361 	0x65686361
+   342ec:	63636120 	0x63636120
+   342f0:	00737365 	0x737365
+   342f4:	4e4b4e55 	c3	0x4b4e55
+   342f8:	004e574f 	0x4e574f
+   342fc:	65637845 	0x65637845
+   34300:	6f697470 	0x6f697470
+   34304:	6544206e 	0x6544206e
+   34308:	74636574 	jalx	18d95d0 <kheader+0x18565d0>
+   3430c:	62206465 	0x62206465
+   34310:	6e207475 	0x6e207475
+   34314:	4d4d206f 	0x4d4d206f
+   34318:	72452055 	0x72452055
+   3431c:	20726f72 	addi	s2,v1,28530
+   34320:	65646f63 	0x65646f63
+   34324:	73616820 	clz	t5 or at,k1
+   34328:	65656220 	0x65656220
+   3432c:	6f66206e 	0x6f66206e
+   34330:	00646e75 	0x646e75
+   34334:	66736944 	0x66736944
+   34338:	74636e75 	jalx	18db9d4 <kheader+0x18589d4>
+   3433c:	206e6f69 	addi	t6,v1,28521
+   34340:	4d20666f 	0x4d20666f
+   34344:	7327554d 	0x7327554d
+   34348:	72724520 	0x72724520
+   3434c:	5220726f 	beqzl	s1,50d0c <cluster_manager+0x9f5c>
+   34350:	726f7065 	0x726f7065
+   34354:	00000074 	teq	zero,zero,0x1
+   34358:	20757063 	addi	s5,v1,28771
+   3435c:	203a6425 	addi	k0,at,25637
+   34360:	69646770 	0x69646770
+   34364:	64255b72 	0x64255b72
+   34368:	203d205d 	addi	sp,at,8285
+   3436c:	000a7825 	or	t7,zero,t2
+   34370:	4f525245 	c3	0x1525245
+   34374:	25203a52 	addiu	zero,t1,14930
+   34378:	55203a73 	bnezl	t1,42d48 <clusters_tbl+0x53a8>
+   3437c:	7078656e 	0x7078656e
+   34380:	65746365 	0x65746365
+   34384:	64702064 	0x64702064
+   34388:	61765f65 	0x61765f65
+   3438c:	7825206c 	0x7825206c
+   34390:	0000000a 	movz	zero,zero,zero
+   34394:	6d705f5f 	0x6d705f5f
+   34398:	65735f6d 	0x65735f6d
+   3439c:	61705f74 	0x61705f74
+   343a0:	00006567 	0x6567
+   343a4:	004d4152 	0x4d4152
+   343a8:	6f6d654d 	0x6f6d654d
+   343ac:	4d207972 	0x4d207972
+   343b0:	6c75646f 	0x6c75646f
+   343b4:	00000065 	0x65
+   343b8:	55434958 	bnel	t2,v1,4691c <clusters_tbl+0x8f7c>
+   343bc:	00000000 	sll	zero,zero,0x0
+   343c0:	65746e49 	0x65746e49
+   343c4:	70757272 	0x70757272
+   343c8:	6f432074 	0x6f432074
+   343cc:	6f72746e 	0x6f72746e
+   343d0:	6e55206c 	0x6e55206c
+   343d4:	20657469 	addi	a1,v1,29801
+   343d8:	68746957 	0x68746957
+   343dc:	746e4920 	jalx	1b92480 <kheader+0x1b0f480>
+   343e0:	61726765 	0x61726765
+   343e4:	20646574 	addi	a0,v1,25972
+   343e8:	542d5452 	bnel	at,t5,49534 <cluster_manager+0x2784>
+   343ec:	72656d69 	0x72656d69
+   343f0:	00000073 	tltu	zero,zero,0x1
+   343f4:	00595454 	0x595454
+   343f8:	6c756d45 	0x6c756d45
+   343fc:	64657461 	0x64657461
+   34400:	72655420 	0x72655420
+   34404:	616e696d 	0x616e696d
+   34408:	6f43206c 	0x6f43206c
+   3440c:	6f72746e 	0x6f72746e
+   34410:	0072656c 	0x72656c
+   34414:	00414d44 	0x414d44
+   34418:	20414d44 	addi	at,v0,19780
+   3441c:	6e616843 	0x6e616843
+   34420:	006c656e 	0x6c656e
+   34424:	444b4c42 	0x444b4c42
+   34428:	00005645 	0x5645
+   3442c:	2e442e48 	sltiu	a0,s2,11848
+   34430:	6f432044 	0x6f432044
+   34434:	6f72746e 	0x6f72746e
+   34438:	0072656c 	0x72656c
+   3443c:	00004246 	0x4246
+   34440:	6d617246 	0x6d617246
+   34444:	75422065 	jalx	5088194 <kheader+0x5005194>
+   34448:	72656666 	0x72656666
+   3444c:	6e6f4320 	0x6e6f4320
+   34450:	6c6f7274 	0x6c6f7274
+   34454:	00007265 	0x7265
+   34458:	00554349 	0x554349
+   3445c:	65746e49 	0x65746e49
+   34460:	70757272 	0x70757272
+   34464:	6f432074 	0x6f432074
+   34468:	6f72746e 	0x6f72746e
+   3446c:	6e55206c 	0x6e55206c
+   34470:	00657469 	0x657469
+   34474:	454d4954 	0x454d4954
+   34478:	00000052 	mflhxu	zero
+   3447c:	6c616552 	0x6c616552
+   34480:	6d69542d 	0x6d69542d
+   34484:	69542065 	0x69542065
+   34488:	0072656d 	0x72656d
+   3448c:	49504f49 	0x49504f49
+   34490:	00000043 	sra	zero,zero,0x1
+   34494:	64726148 	0x64726148
+   34498:	65726177 	0x65726177
+   3449c:	746e4920 	jalx	1b92480 <kheader+0x1b0f480>
+   344a0:	75727265 	jalx	5c9c994 <kheader+0x5c19994>
+   344a4:	54207470 	bnezl	at,51668 <cluster_manager+0xa8b8>
+   344a8:	6f53206f 	0x6f53206f
+   344ac:	61777466 	0x61777466
+   344b0:	49206572 	0x49206572
+   344b4:	7265746e 	0x7265746e
+   344b8:	74707572 	jalx	1c1d5c8 <kheader+0x1b9a5c8>
+   344bc:	61725420 	0x61725420
+   344c0:	616c736e 	0x616c736e
+   344c4:	00726f74 	teq	v1,s2,0x1bd
+   344c8:	434d454d 	c0	0x14d454d
+   344cc:	00000000 	sll	zero,zero,0x0
+   344d0:	4320324c 	c0	0x120324c
+   344d4:	69666e6f 	0x69666e6f
+   344d8:	61727567 	0x61727567
+   344dc:	6e6f6974 	0x6e6f6974
+   344e0:	746e4920 	jalx	1b92480 <kheader+0x1b0f480>
+   344e4:	61667265 	0x61667265
+   344e8:	00006563 	0x6563
+   344ec:	43494e4d 	c0	0x1494e4d
+   344f0:	00000000 	sll	zero,zero,0x0
+   344f4:	746c754d 	jalx	1b1d534 <kheader+0x1a9a534>
+   344f8:	68432d69 	0x68432d69
+   344fc:	656e6e61 	0x656e6e61
+   34500:	4720736c 	c1	0x120736c
+   34504:	2d49494d 	sltiu	t1,t2,18765
+   34508:	706d6f43 	0x706d6f43
+   3450c:	6e61696c 	0x6e61696c
+   34510:	494e2074 	0x494e2074
+   34514:	6f432043 	0x6f432043
+   34518:	6f72746e 	0x6f72746e
+   3451c:	72656c6c 	0x72656c6c
+   34520:	00000000 	sll	zero,zero,0x0
+   34524:	4d444843 	0x4d444843
+   34528:	00000041 	0x41
+   3452c:	746c754d 	jalx	1b1d534 <kheader+0x1a9a534>
+   34530:	68432d69 	0x68432d69
+   34534:	656e6e61 	0x656e6e61
+   34538:	4420736c 	0x4420736c
+   3453c:	4320414d 	c0	0x120414d
+   34540:	72746e6f 	0x72746e6f
+   34544:	656c6c6f 	0x656c6c6f
+   34548:	75532072 	jalx	54c81c8 <kheader+0x54451c8>
+   3454c:	726f7070 	0x726f7070
+   34550:	676e6974 	0x676e6974
+   34554:	61684320 	0x61684320
+   34558:	64656e69 	0x64656e69
+   3455c:	66754220 	0x66754220
+   34560:	73726566 	0x73726566
+   34564:	00000000 	sll	zero,zero,0x0
+   34568:	42766544 	c0	0x766544
+   3456c:	28206b6c 	slti	zero,at,27500
+   34570:	4c436f53 	0x4c436f53
+   34574:	00296269 	0x296269
+   34578:	74737953 	jalx	1cde54c <kheader+0x1c5b54c>
+   3457c:	42206d65 	c0	0x206d65
+   34580:	20766564 	addi	s6,v1,25956
+   34584:	25207369 	addiu	zero,t1,29545
+   34588:	00000a64 	0xa64
+   3458c:	25414453 	addiu	at,t2,17491
+   34590:	00000064 	0x64
+   34594:	4e524157 	c3	0x524157
+   34598:	3a474e49 	xori	a3,s2,0x4e49
+   3459c:	63655220 	0x63655220
+   345a0:	64657669 	0x64657669
+   345a4:	71726920 	0x71726920
+   345a8:	206e6f20 	addi	t6,v1,28448
+   345ac:	42766544 	c0	0x766544
+   345b0:	62206b6c 	0x62206b6c
+   345b4:	6e207475 	0x6e207475
+   345b8:	6572206f 	0x6572206f
+   345bc:	73657571 	0x73657571
+   345c0:	73692074 	0x73692074
+   345c4:	6e657020 	0x6e657020
+   345c8:	676e6964 	0x676e6964
+   345cc:	50435b20 	beql	v0,v1,4b250 <cluster_manager+0x44a0>
+   345d0:	64252055 	0x64252055
+   345d4:	00000a5d 	0xa5d
+   345d8:	76656462 	jalx	9959188 <kheader+0x98d6188>
+   345dc:	636f6c5f 	0x636f6c5f
+   345e0:	0000736b 	0x736b
+   345e4:	44766544 	0x44766544
+   345e8:	2820414d 	slti	zero,at,16717
+   345ec:	4c436f53 	0x4c436f53
+   345f0:	00296269 	0x296269
+   345f4:	25414d44 	addiu	at,t2,19780
+   345f8:	00000064 	0x64
+   345fc:	64254246 	0x64254246
+   34600:	00000000 	sll	zero,zero,0x0
+   34604:	4f525245 	c3	0x1525245
+   34608:	25203a52 	addiu	zero,t1,14930
+   3460c:	61203a73 	0x61203a73
+   34610:	64656b73 	0x64656b73
+   34614:	7a697320 	0x7a697320
+   34618:	25282065 	addiu	t0,t1,8293
+   3461c:	65202964 	0x65202964
+   34620:	65656378 	0x65656378
+   34624:	65722064 	0x65722064
+   34628:	6f206c61 	0x6f206c61
+   3462c:	2820656e 	slti	zero,at,25966
+   34630:	0a296425 	j	8a59094 <kheader+0x89d6094>
+   34634:	00000000 	sll	zero,zero,0x0
+   34638:	4e524157 	c3	0x524157
+   3463c:	3a474e49 	xori	a3,s2,0x4e49
+   34640:	3a732520 	xori	s3,s3,0x2520
+   34644:	6b736120 	0x6b736120
+   34648:	73206465 	0x73206465
+   3464c:	20657a69 	addi	a1,v1,31337
+   34650:	29642528 	slti	a0,t3,9512
+   34654:	63786520 	0x63786520
+   34658:	20646565 	addi	a0,v1,25957
+   3465c:	6c616572 	0x6c616572
+   34660:	656e6f20 	0x656e6f20
+   34664:	64252820 	0x64252820
+   34668:	00000a29 	0xa29
+   3466c:	4f464e49 	c3	0x1464e49
+   34670:	7325203a 	0x7325203a
+   34674:	7473203a 	jalx	1cc80e8 <kheader+0x1c450e8>
+   34678:	65747261 	0x65747261
+   3467c:	66202c64 	0x66202c64
+   34680:	20656c69 	addi	a1,v1,27753
+   34684:	646f6e69 	0x646f6e69
+   34688:	70252065 	0x70252065
+   3468c:	6572202c 	0x6572202c
+   34690:	6e6f6967 	0x6e6f6967
+   34694:	78303c20 	0x78303c20
+   34698:	2d207825 	sltiu	zero,t1,30757
+   3469c:	25783020 	addiu	t8,t3,12320
+   346a0:	000a3e78 	0xa3e78
+   346a4:	6d5f6266 	0x6d5f6266
+   346a8:	616d6e75 	0x616d6e75
+   346ac:	00000070 	tge	zero,zero,0x1
+   346b0:	6d5f6266 	0x6d5f6266
+   346b4:	0070616d 	0x70616d
+   346b8:	25756369 	addiu	s5,t3,25449
+   346bc:	00000064 	0x64
+   346c0:	4e524157 	c3	0x524157
+   346c4:	3a474e49 	xori	a3,s2,0x4e49
+   346c8:	206f4e20 	addi	t7,v1,20000
+   346cc:	20554349 	addi	s5,v0,17225
+   346d0:	69676572 	0x69676572
+   346d4:	72657473 	0x72657473
+   346d8:	68206465 	0x68206465
+   346dc:	6c646e61 	0x6c646e61
+   346e0:	66207265 	0x66207265
+   346e4:	4920726f 	0x4920726f
+   346e8:	25205152 	addiu	zero,t1,20818
+   346ec:	6e6f2064 	0x6e6f2064
+   346f0:	55504320 	bnel	t2,s0,45374 <clusters_tbl+0x79d4>
+   346f4:	0a642520 	j	9909480 <kheader+0x9886480>
+   346f8:	00000000 	sll	zero,zero,0x0
+   346fc:	69706f69 	0x69706f69
+   34700:	00642563 	0x642563
+   34704:	434d454d 	c0	0x14d454d
+   34708:	00006425 	0x6425
+   3470c:	636d656d 	0x636d656d
+   34710:	6e756d5f 	0x6e756d5f
+   34714:	0070616d 	0x70616d
+   34718:	636d656d 	0x636d656d
+   3471c:	616d6d5f 	0x616d6d5f
+   34720:	00000070 	tge	zero,zero,0x1
+   34724:	02400200 	0x2400200
+   34728:	02080280 	0x2080280
+   3472c:	02880248 	0x2880248
+   34730:	02500210 	0x2500210
+   34734:	02180290 	0x2180290
+   34738:	02980258 	0x2980258
+   3473c:	02600220 	0x2600220
+   34740:	030002a0 	0x30002a0
+   34744:	03800340 	0x3800340
+   34748:	03480308 	0x3480308
+   3474c:	03100388 	0x3100388
+   34750:	03900350 	0x3900350
+   34754:	03a00398 	0x3a00398
+   34758:	000003a8 	0x3a8
+   3475c:	656d6974 	0x656d6974
+   34760:	00642572 	tlt	v1,a0,0x95
+   34764:	54766544 	bnel	v1,s6,4dc78 <cluster_manager+0x6ec8>
+   34768:	00005954 	0x5954
+   3476c:	25595454 	addiu	t9,t2,21588
+   34770:	00000064 	0x64
+   34774:	5f797474 	0x5f797474
+   34778:	6b636f6c 	0x6b636f6c
+   3477c:	00000073 	tltu	zero,zero,0x1
+   34780:	5f797474 	0x5f797474
+   34784:	6f6c6472 	0x6f6c6472
+   34788:	00736b63 	0x736b63
+   3478c:	75636978 	jalx	58da5e0 <kheader+0x58575e0>
+   34790:	00006425 	0x6425
+   34794:	58766544 	0x58766544
+   34798:	2e554349 	sltiu	s5,s2,17225
+   3479c:	00495748 	0x495748
+   347a0:	58766544 	0x58766544
+   347a4:	2e554349 	sltiu	s5,s2,17225
+   347a8:	00495450 	0x495450
+   347ac:	58766544 	0x58766544
+   347b0:	2e554349 	sltiu	s5,s2,17225
+   347b4:	52544e43 	beql	s2,s4,480c4 <cluster_manager+0x1314>
+   347b8:	00000000 	sll	zero,zero,0x0
+   347bc:	4e524157 	c3	0x524157
+   347c0:	3a474e49 	xori	a3,s2,0x4e49
+   347c4:	206f4e20 	addi	t7,v1,20000
+   347c8:	55434958 	bnel	t2,v1,46d2c <clusters_tbl+0x938c>
+   347cc:	57483a3a 	bnel	k0,t0,430b8 <clusters_tbl+0x5718>
+   347d0:	65722049 	0x65722049
+   347d4:	74736967 	jalx	1cda59c <kheader+0x1c5759c>
+   347d8:	64657265 	0x64657265
+   347dc:	6e616820 	0x6e616820
+   347e0:	72656c64 	0x72656c64
+   347e4:	206f6620 	addi	t7,v1,26144
+   347e8:	20515249 	addi	s1,v0,21065
+   347ec:	6f206425 	0x6f206425
+   347f0:	5043206e 	beql	v0,v1,3c9ac <arch_entrys+0xc>
+   347f4:	64252055 	0x64252055
+   347f8:	0000000a 	movz	zero,zero,zero
+   347fc:	4e524157 	c3	0x524157
+   34800:	3a474e49 	xori	a3,s2,0x4e49
+   34804:	43495820 	wait	0x52560
+   34808:	483a3a55 	0x483a3a55
+   3480c:	49204957 	0x49204957
+   34810:	25205152 	addiu	zero,t1,20818
+   34814:	6e6f2064 	0x6e6f2064
+   34818:	55504320 	bnel	t2,s0,4549c <clusters_tbl+0x7afc>
+   3481c:	20642520 	addi	a0,v1,9504
+   34820:	20736168 	addi	s3,v1,24936
+   34824:	6e656562 	0x6e656562
+   34828:	73616d20 	0x73616d20
+   3482c:	0a64656b 	j	99195ac <kheader+0x98965ac>
+   34830:	00000000 	sll	zero,zero,0x0
+   34834:	74696157 	jalx	1a5855c <kheader+0x19d555c>
+   34838:	75657551 	jalx	595d544 <kheader+0x58da544>
+   3483c:	42442065 	c0	0x442065
+   34840:	00000000 	sll	zero,zero,0x0
+   34844:	4f464e49 	c3	0x1464e49
+   34848:	7325203a 	0x7325203a
+   3484c:	6970203a 	0x6970203a
+   34850:	64252064 	0x64252064
+   34854:	7063202c 	0x7063202c
+   34858:	64252075 	0x64252075
+   3485c:	6174202c 	0x6174202c
+   34860:	74206b73 	jalx	81adcc <kheader+0x797dcc>
+   34864:	61657268 	0x61657268
+   34868:	6c207364 	0x6c207364
+   3486c:	74696d69 	jalx	1a5b5a4 <kheader+0x19d85a4>
+   34870:	63786520 	0x63786520
+   34874:	20646565 	addi	a0,v1,25957
+   34878:	72726162 	0x72726162
+   3487c:	20726569 	addi	s2,v1,25961
+   34880:	73736572 	0x73736572
+   34884:	6372756f 	0x6372756f
+   34888:	6f207365 	0x6f207365
+   3488c:	64252066 	0x64252066
+   34890:	0000000a 	movz	zero,zero,zero
+   34894:	72726162 	0x72726162
+   34898:	00726569 	0x726569
+   3489c:	72726142 	0x72726142
+   348a0:	2d726569 	sltiu	s2,t3,25961
+   348a4:	636e7953 	0x636e7953
+   348a8:	00000000 	sll	zero,zero,0x0
+   348ac:	4f464e49 	c3	0x1464e49
+   348b0:	7325203a 	0x7325203a
+   348b4:	7063203a 	0x7063203a
+   348b8:	64252075 	0x64252075
+   348bc:	3a465b20 	xori	a2,s2,0x5b20
+   348c0:	2c642520 	sltiu	a0,v1,9504
+   348c4:	203a4c20 	addi	k0,at,19488
+   348c8:	202c6425 	addi	t4,at,25637
+   348cc:	25203a42 	addiu	zero,t1,14914
+   348d0:	45202c64 	0x45202c64
+   348d4:	6425203a 	0x6425203a
+   348d8:	3a54202c 	xori	s4,s2,0x202c
+   348dc:	5d642520 	0x5d642520
+   348e0:	0000000a 	movz	zero,zero,zero
+   348e4:	72726162 	0x72726162
+   348e8:	5f726569 	0x5f726569
+   348ec:	74696e69 	jalx	1a5b9a4 <kheader+0x19d89a4>
+   348f0:	00000000 	sll	zero,zero,0x0
+   348f4:	72726162 	0x72726162
+   348f8:	5f726569 	0x5f726569
+   348fc:	625f6f64 	0x625f6f64
+   34900:	64616f72 	0x64616f72
+   34904:	74736163 	jalx	1cd858c <kheader+0x1c5558c>
+   34908:	00000000 	sll	zero,zero,0x0
+   3490c:	204d434b 	addi	t5,v0,17227
+   34910:	494b4c42 	0x494b4c42
+   34914:	0000004f 	sync	0x1
+   34918:	496b6c42 	0x496b6c42
+   3491c:	0000004f 	sync	0x1
+   34920:	494b4c42 	0x494b4c42
+   34924:	7953204f 	0x7953204f
+   34928:	0000636e 	0x636e
+   3492c:	4e524157 	c3	0x524157
+   34930:	3a474e49 	xori	a3,s2,0x4e49
+   34934:	3a732520 	xori	s3,s3,0x2520
+   34938:	71655220 	0x71655220
+   3493c:	74736575 	jalx	1cd95d4 <kheader+0x1c565d4>
+   34940:	49206465 	0x49206465
+   34944:	69204f2f 	0x69204f2f
+   34948:	61662073 	0x61662073
+   3494c:	64656c69 	0x64656c69
+   34950:	6c62202c 	0x6c62202c
+   34954:	6425206b 	0x6425206b
+   34958:	0000000a 	movz	zero,zero,zero
+   3495c:	696b6c62 	0x696b6c62
+   34960:	73615f6f 	0x73615f6f
+   34964:	00636e79 	0x636e79
+   34968:	4f464e49 	c3	0x1464e49
+   3496c:	7063203a 	0x7063203a
+   34970:	64252075 	0x64252075
+   34974:	5144202c 	beql	t2,a0,3ca28 <arch_entrys+0x88>
+   34978:	75205444 	jalx	4815110 <kheader+0x4792110>
+   3497c:	74616470 	jalx	18591c0 <kheader+0x17d61c0>
+   34980:	6e652065 	0x6e652065
+   34984:	20646564 	addi	a0,v1,25956
+   34988:	7525205b 	jalx	494816c <kheader+0x48c516c>
+   3498c:	25202d20 	addiu	zero,t1,11552
+   34990:	0a5d2075 	j	97481d4 <kheader+0x96c51d4>
+   34994:	00000000 	sll	zero,zero,0x0
+   34998:	73756c43 	0x73756c43
+   3499c:	00726574 	teq	v1,s2,0x195
+   349a0:	004d434b 	0x4d434b
+   349a4:	25444943 	addiu	a0,t2,18755
+   349a8:	00000064 	0x64
+   349ac:	4f525245 	c3	0x1525245
+   349b0:	63203a52 	0x63203a52
+   349b4:	61775f76 	0x61775f76
+   349b8:	203a7469 	addi	k0,at,29801
+   349bc:	20444954 	addi	a0,v0,18772
+   349c0:	202c7825 	addi	t4,at,30757
+   349c4:	206d6573 	addi	t5,v1,25971
+   349c8:	69207825 	0x69207825
+   349cc:	6f6e2073 	0x6f6e2073
+   349d0:	776f2074 	jalx	dbc81d0 <kheader+0xdb451d0>
+   349d4:	2064656e 	addi	a0,v1,25966
+   349d8:	6e20726f 	0x6e20726f
+   349dc:	6c20746f 	0x6c20746f
+   349e0:	656b636f 	0x656b636f
+   349e4:	205b2064 	addi	k1,v0,8292
+   349e8:	756c6176 	jalx	5b185d8 <kheader+0x5a955d8>
+   349ec:	64252065 	0x64252065
+   349f0:	000a5d20 	0xa5d20
+   349f4:	646e6f43 	0x646e6f43
+   349f8:	20726156 	addi	s2,v1,24918
+   349fc:	636e7953 	0x636e7953
+   34a00:	00000000 	sll	zero,zero,0x0
+   34a04:	646e6f43 	0x646e6f43
+   34a08:	6f697469 	0x6f697469
+   34a0c:	6156206e 	0x6156206e
+   34a10:	62616972 	0x62616972
+   34a14:	5320656c 	beqzl	t9,4dfc8 <cluster_manager+0x7218>
+   34a18:	00636e79 	0x636e79
+   34a1c:	494e4150 	0x494e4150
+   34a20:	74612043 	jalx	184810c <kheader+0x17c510c>
+   34a24:	6e696c20 	0x6e696c20
+   34a28:	25203a65 	addiu	zero,t1,14949
+   34a2c:	66202c64 	0x66202c64
+   34a30:	3a656c69 	xori	a1,s3,0x6c69
+   34a34:	20732520 	addi	s3,v1,9504
+   34a38:	534d202c 	beql	k0,t5,3caec <arch_entrys+0x14c>
+   34a3c:	46203a47 	neg.d	$f9,$f7
+   34a40:	646c6961 	0x646c6961
+   34a44:	206f7420 	addi	t7,v1,29728
+   34a48:	74696e69 	jalx	1a5b9a4 <kheader+0x19d89a4>
+   34a4c:	696c6169 	0x696c6169
+   34a50:	6120657a 	0x6120657a
+   34a54:	69686372 	0x69686372
+   34a58:	74636574 	jalx	18d95d0 <kheader+0x18565d0>
+   34a5c:	20657275 	addi	a1,v1,29301
+   34a60:	63657073 	0x63657073
+   34a64:	63696669 	0x63696669
+   34a68:	74616420 	jalx	1859080 <kheader+0x17d6080>
+   34a6c:	6f662061 	0x6f662061
+   34a70:	50432072 	beql	v0,v1,3cc3c <arch_entrys+0x29c>
+   34a74:	64252055 	0x64252055
+   34a78:	00000a0a 	0xa0a
+   34a7c:	6e72656b 	0x6e72656b
+   34a80:	7570632f 	jalx	5c18cbc <kheader+0x5b95cbc>
+   34a84:	0000632e 	0x632e
+   34a88:	25555043 	addiu	s5,t2,20547
+   34a8c:	00000064 	0x64
+   34a90:	090a7325 	j	429cc94 <kheader+0x4219c94>
+   34a94:	67617355 	0x67617355
+   34a98:	64252065 	0x64252065
+   34a9c:	0a252520 	j	8949480 <kheader+0x88c6480>
+   34aa0:	6d695409 	0x6d695409
+   34aa4:	492d7265 	0x492d7265
+   34aa8:	20735152 	addi	s3,v1,20818
+   34aac:	090a6425 	j	4299094 <kheader+0x4216094>
+   34ab0:	2d766544 	sltiu	s6,t3,25924
+   34ab4:	73515249 	0x73515249
+   34ab8:	0a642520 	j	9909480 <kheader+0x9886480>
+   34abc:	68635309 	0x68635309
+   34ac0:	6c756465 	0x6c756465
+   34ac4:	090a7265 	j	429c994 <kheader+0x4219994>
+   34ac8:	6e755209 	0x6e755209
+   34acc:	6c62616e 	0x6c62616e
+   34ad0:	64252065 	0x64252065
+   34ad4:	3a6b5b20 	xori	t3,s3,0x5b20
+   34ad8:	75206425 	jalx	4819094 <kheader+0x4796094>
+   34adc:	5d64253a 	0x5d64253a
+   34ae0:	5409090a 	bnel	zero,t1,36f0c <thread_attr_name+0x6a4>
+   34ae4:	6c61746f 	0x6c61746f
+   34ae8:	20642520 	addi	a0,v1,9504
+   34aec:	253a6b5b 	addiu	k0,t1,27483
+   34af0:	3a752064 	xori	s5,s3,0x2064
+   34af4:	0a5d6425 	j	9759094 <kheader+0x96d6094>
+   34af8:	00000000 	sll	zero,zero,0x0
+   34afc:	7825205b 	0x7825205b
+   34b00:	41205d20 	0x41205d20
+   34b04:	72657373 	0x72657373
+   34b08:	68742074 	0x68742074
+   34b0c:	3e2d7369 	0x3e2d7369
+   34b10:	74736964 	jalx	1cda590 <kheader+0x1c57590>
+   34b14:	6b636f6c 	0x6b636f6c
+   34b18:	6f635f73 	0x6f635f73
+   34b1c:	20746e75 	addi	s4,v1,28277
+   34b20:	2030203e 	addi	s0,at,8254
+   34b24:	6c696166 	0x6c696166
+   34b28:	6c202c64 	0x6c202c64
+   34b2c:	20656e69 	addi	a1,v1,28265
+   34b30:	202c6425 	addi	t4,at,25637
+   34b34:	656c6966 	0x656c6966
+   34b38:	2c732520 	sltiu	s3,v1,9504
+   34b3c:	72685420 	0x72685420
+   34b40:	20646165 	addi	a0,v1,24933
+   34b44:	5d78255b 	0x5d78255b
+   34b48:	206e6f20 	addi	t6,v1,28448
+   34b4c:	20555043 	addi	s5,v0,20547
+   34b50:	5d64255b 	0x5d64255b
+   34b54:	7543202c 	jalx	50c80b0 <kheader+0x50450b0>
+   34b58:	6e657272 	0x6e657272
+   34b5c:	68542074 	0x68542074
+   34b60:	64616572 	0x64616572
+   34b64:	78255b20 	0x78255b20
+   34b68:	6e6f205d 	0x6e6f205d
+   34b6c:	55504320 	bnel	t2,s0,457f0 <clusters_tbl+0x7e50>
+   34b70:	64255b20 	0x64255b20
+   34b74:	5b202c5d 	blezl	t9,3fcec <clusters_tbl+0x234c>
+   34b78:	0a5d7525 	j	975d494 <kheader+0x96da494>
+   34b7c:	00000000 	sll	zero,zero,0x0
+   34b80:	6e72656b 	0x6e72656b
+   34b84:	7369642f 	0x7369642f
+   34b88:	636f6c74 	0x636f6c74
+   34b8c:	00632e6b 	0x632e6b
+   34b90:	4f464e49 	c3	0x1464e49
+   34b94:	7325203a 	0x7325203a
+   34b98:	3a73253a 	xori	s3,s3,0x253a
+   34b9c:	41464520 	0x41464520
+   34ba0:	20544c55 	addi	s4,v0,19541
+   34ba4:	20736148 	addi	s3,v1,24904
+   34ba8:	6e656562 	0x6e656562
+   34bac:	74614320 	jalx	1850c80 <kheader+0x17cdc80>
+   34bb0:	64656863 	0x64656863
+   34bb4:	206e6f20 	addi	t6,v1,28448
+   34bb8:	74636576 	jalx	18d95d8 <kheader+0x18565d8>
+   34bbc:	6e63202c 	0x6e63202c
+   34bc0:	25207274 	addiu	zero,t1,29300
+   34bc4:	73202c64 	0x73202c64
+   34bc8:	656c7274 	0x656c7274
+   34bcc:	7626206e 	jalx	89881b8 <kheader+0x89051b8>
+   34bd0:	5b746365 	0x5b746365
+   34bd4:	205d7825 	addi	sp,v0,30757
+   34bd8:	7825203d 	0x7825203d
+   34bdc:	0000000a 	movz	zero,zero,zero
+   34be0:	4f464e49 	c3	0x1464e49
+   34be4:	7325203a 	0x7325203a
+   34be8:	3a73253a 	xori	s3,s3,0x253a
+   34bec:	41464520 	0x41464520
+   34bf0:	20544c55 	addi	s4,v0,19541
+   34bf4:	20736148 	addi	s3,v1,24904
+   34bf8:	6e656562 	0x6e656562
+   34bfc:	74614320 	jalx	1850c80 <kheader+0x17cdc80>
+   34c00:	64656863 	0x64656863
+   34c04:	6e63202c 	0x6e63202c
+   34c08:	25207274 	addiu	zero,t1,29300
+   34c0c:	73202c64 	0x73202c64
+   34c10:	656c7274 	0x656c7274
+   34c14:	7626206e 	jalx	89881b8 <kheader+0x89051b8>
+   34c18:	5b746365 	0x5b746365
+   34c1c:	205d7825 	addi	sp,v0,30757
+   34c20:	7825203d 	0x7825203d
+   34c24:	0000000a 	movz	zero,zero,zero
+   34c28:	4f464e49 	c3	0x1464e49
+   34c2c:	7325203a 	0x7325203a
+   34c30:	6166203a 	0x6166203a
+   34c34:	64656c69 	0x64656c69
+   34c38:	206f7420 	addi	t7,v1,29728
+   34c3c:	70616d6d 	0x70616d6d
+   34c40:	69616d20 	0x69616d20
+   34c44:	2073276e 	addi	s3,v1,10094
+   34c48:	63617473 	0x63617473
+   34c4c:	5b202c6b 	blezl	t9,3fdfc <clusters_tbl+0x245c>
+   34c50:	20646970 	addi	a0,v1,26992
+   34c54:	202c6425 	addi	t4,at,25637
+   34c58:	20727265 	addi	s2,v1,29285
+   34c5c:	0a5d6425 	j	9759094 <kheader+0x96d6094>
+   34c60:	00000000 	sll	zero,zero,0x0
+   34c64:	4f464e49 	c3	0x1464e49
+   34c68:	7325203a 	0x7325203a
+   34c6c:	656b203a 	0x656b203a
+   34c70:	6c656e72 	0x6c656e72
+   34c74:	73616820 	clz	t5 or at,k1
+   34c78:	636e6520 	0x636e6520
+   34c7c:	746e756f 	jalx	1b9d5bc <kheader+0x1b1a5bc>
+   34c80:	64657265 	0x64657265
+   34c84:	206e6120 	addi	t6,v1,24864
+   34c88:	6f727265 	0x6f727265
+   34c8c:	68772072 	0x68772072
+   34c90:	20656c69 	addi	a1,v1,27753
+   34c94:	64616f6c 	0x64616f6c
+   34c98:	20676e69 	addi	a3,v1,28265
+   34c9c:	6b736174 	0x6b736174
+   34ca0:	69705b20 	0x69705b20
+   34ca4:	64252064 	0x64252064
+   34ca8:	7265202c 	0x7265202c
+   34cac:	64252072 	0x64252072
+   34cb0:	00000a5d 	0xa5d
+   34cb4:	4f464e49 	c3	0x1464e49
+   34cb8:	7325203a 	0x7325203a
+   34cbc:	6166203a 	0x6166203a
+   34cc0:	64656c69 	0x64656c69
+   34cc4:	206f7420 	addi	t7,v1,29728
+   34cc8:	70616d6d 	0x70616d6d
+   34ccc:	69616d20 	0x69616d20
+   34cd0:	2073276e 	addi	s3,v1,10094
+   34cd4:	70616568 	0x70616568
+   34cd8:	705b202c 	0x705b202c
+   34cdc:	25206469 	addiu	zero,t1,25705
+   34ce0:	65202c64 	0x65202c64
+   34ce4:	25207272 	addiu	zero,t1,29298
+   34ce8:	000a5d64 	0xa5d64
+   34cec:	4f464e49 	c3	0x1464e49
+   34cf0:	7325203a 	0x7325203a
+   34cf4:	656b203a 	0x656b203a
+   34cf8:	6c656e72 	0x6c656e72
+   34cfc:	73616820 	clz	t5 or at,k1
+   34d00:	636e6520 	0x636e6520
+   34d04:	746e756f 	jalx	1b9d5bc <kheader+0x1b1a5bc>
+   34d08:	64657265 	0x64657265
+   34d0c:	206e6120 	addi	t6,v1,24864
+   34d10:	6f727265 	0x6f727265
+   34d14:	68772072 	0x68772072
+   34d18:	20656c69 	addi	a1,v1,27753
+   34d1c:	61657263 	0x61657263
+   34d20:	676e6974 	0x676e6974
+   34d24:	69616d20 	0x69616d20
+   34d28:	6874206e 	0x6874206e
+   34d2c:	64616572 	0x64616572
+   34d30:	20666f20 	addi	a2,v1,28448
+   34d34:	6b736174 	0x6b736174
+   34d38:	69705b20 	0x69705b20
+   34d3c:	64252064 	0x64252064
+   34d40:	7265202c 	0x7265202c
+   34d44:	64252072 	0x64252072
+   34d48:	00000a5d 	0xa5d
+   34d4c:	4f464e49 	c3	0x1464e49
+   34d50:	7325203a 	0x7325203a
+   34d54:	4645203a 	c1	0x45203a
+   34d58:	544c5541 	bnel	v0,t4,4a260 <cluster_manager+0x34b0>
+   34d5c:	73614820 	clz	t1 or at,k1
+   34d60:	65656220 	0x65656220
+   34d64:	6143206e 	0x6143206e
+   34d68:	65686374 	0x65686374
+   34d6c:	6e6f2064 	0x6e6f2064
+   34d70:	63657620 	0x63657620
+   34d74:	00000a74 	teq	zero,zero,0x29
+   34d78:	203a7325 	addi	k0,at,29477
+   34d7c:	655f6f64 	0x655f6f64
+   34d80:	20636578 	addi	v1,v1,25976
+   34d84:	6c696166 	0x6c696166
+   34d88:	00006465 	0x6465
+   34d8c:	4f4d4c41 	c3	0x14d4c41
+   34d90:	45565f53 	0x45565f53
+   34d94:	4f495352 	c3	0x1495352
+   34d98:	6c413d4e 	0x6c413d4e
+   34d9c:	20736f6d 	addi	s3,v1,28525
+   34da0:	6f6d6c61 	0x6f6d6c61
+   34da4:	6b6d2d73 	0x6b6d2d73
+   34da8:	2e30762d 	sltiu	s0,s1,30253
+   34dac:	30322031 	andi	s2,at,0x2031
+   34db0:	74203531 	jalx	80d4c4 <kheader+0x78a4c4>
+   34db4:	20726173 	addi	s2,v1,24947
+   34db8:	7370696d 	0x7370696d
+   34dbc:	6d206c65 	0x6d206c65
+   34dc0:	33737069 	andi	s3,k1,0x7069
+   34dc4:	00000032 	tlt	zero,zero
+   34dc8:	6e69622f 	0x6e69622f
+   34dcc:	696e692f 	0x696e692f
+   34dd0:	00000074 	teq	zero,zero,0x1
+   34dd4:	74696e69 	jalx	1a5b9a4 <kheader+0x19d89a4>
+   34dd8:	00000000 	sll	zero,zero,0x0
+   34ddc:	4f464e49 	c3	0x1464e49
+   34de0:	6f4c203a 	0x6f4c203a
+   34de4:	6e696461 	0x6e696461
+   34de8:	6e492067 	0x6e492067
+   34dec:	50207469 	beqzl	at,51f94 <cluster_manager+0xb1e4>
+   34df0:	65636f72 	0x65636f72
+   34df4:	5b207373 	blezl	t9,51bc4 <cluster_manager+0xae14>
+   34df8:	20732520 	addi	s3,v1,9504
+   34dfc:	00000a5d 	0xa5d
+   34e00:	7665642f 	jalx	99590bc <kheader+0x98d60bc>
+   34e04:	7974742f 	0x7974742f
+   34e08:	00000032 	tlt	zero,zero
+   34e0c:	7665642f 	jalx	99590bc <kheader+0x98d60bc>
+   34e10:	7974742f 	0x7974742f
+   34e14:	00000033 	tltu	zero,zero
+   34e18:	4f525245 	c3	0x1525245
+   34e1c:	64203a52 	0x64203a52
+   34e20:	78655f6f 	0x78655f6f
+   34e24:	203a6365 	addi	k0,at,25445
+   34e28:	6e6e6163 	0x6e6e6163
+   34e2c:	6f20746f 	0x6f20746f
+   34e30:	206e6570 	addi	t6,v1,25968
+   34e34:	20736466 	addi	s3,v1,25702
+   34e38:	2c64255b 	sltiu	a0,v1,9563
+   34e3c:	2c642520 	sltiu	a0,v1,9504
+   34e40:	5d642520 	0x5d642520
+   34e44:	0000000a 	movz	zero,zero,zero
+   34e48:	4f464e49 	c3	0x1464e49
+   34e4c:	6e49203a 	0x6e49203a
+   34e50:	50207469 	beqzl	at,51ff8 <cluster_manager+0xb248>
+   34e54:	65636f72 	0x65636f72
+   34e58:	4c207373 	0x4c207373
+   34e5c:	6564616f 	0x6564616f
+   34e60:	205b2064 	addi	k1,v0,8292
+   34e64:	5d207325 	bgtzl	t1,51afc <cluster_manager+0xad4c>
+   34e68:	0000000a 	movz	zero,zero,zero
+   34e6c:	6c6c7566 	0x6c6c7566
+   34e70:	5f6f645f 	0x5f6f645f
+   34e74:	63657865 	0x63657865
+   34e78:	00000000 	sll	zero,zero,0x0
+   34e7c:	655f6f64 	0x655f6f64
+   34e80:	00636578 	0x636578
+   34e84:	706d6f63 	0x706d6f63
+   34e88:	5f657475 	0x5f657475
+   34e8c:	73677261 	0x73677261
+   34e90:	00000000 	sll	zero,zero,0x0
+   34e94:	73677261 	0x73677261
+   34e98:	6e656c5f 	0x6e656c5f
+   34e9c:	00000000 	sll	zero,zero,0x0
+   34ea0:	203a7325 	addi	k0,at,29477
+   34ea4:	20757063 	addi	s5,v1,28771
+   34ea8:	202c6425 	addi	t4,at,25637
+   34eac:	7267696d 	0x7267696d
+   34eb0:	6f697461 	0x6f697461
+   34eb4:	6166206e 	0x6166206e
+   34eb8:	64656c69 	0x64656c69
+   34ebc:	726f6620 	0x726f6620
+   34ec0:	63697620 	0x63697620
+   34ec4:	206d6974 	addi	t5,v1,26996
+   34ec8:	20646970 	addi	a0,v1,26992
+   34ecc:	202c6425 	addi	t4,at,25637
+   34ed0:	20646974 	addi	a0,v1,26996
+   34ed4:	202c6425 	addi	t4,at,25637
+   34ed8:	20727265 	addi	s2,v1,29285
+   34edc:	000a6425 	0xa6425
+   34ee0:	695f6f64 	0x695f6f64
+   34ee4:	7265746e 	0x7265746e
+   34ee8:	74707572 	jalx	1c1d5c8 <kheader+0x1b9a5c8>
+   34eec:	00000000 	sll	zero,zero,0x0
+   34ef0:	4e524157 	c3	0x524157
+   34ef4:	3a474e49 	xori	a3,s2,0x4e49
+   34ef8:	65735520 	0x65735520
+   34efc:	73412072 	0x73412072
+   34f00:	2064656b 	addi	a0,v1,25963
+   34f04:	61762061 	0x61762061
+   34f08:	20646c69 	addi	a0,v1,27753
+   34f0c:	63737953 	0x63737953
+   34f10:	206c6c61 	addi	t4,v1,27745
+   34f14:	6220524e 	0x6220524e
+   34f18:	66207475 	0x66207475
+   34f1c:	646e756f 	0x646e756f
+   34f20:	206f6e20 	addi	t7,v1,28192
+   34f24:	72726f63 	0x72726f63
+   34f28:	6f707365 	0x6f707365
+   34f2c:	6e69646e 	0x6e69646e
+   34f30:	65732067 	0x65732067
+   34f34:	65636972 	0x65636972
+   34f38:	0000000a 	movz	zero,zero,zero
+   34f3c:	4f464e49 	c3	0x1464e49
+   34f40:	7325203a 	0x7325203a
+   34f44:	6e55203a 	0x6e55203a
+   34f48:	776f6e6b 	jalx	dbdb9ac <kheader+0xdb589ac>
+   34f4c:	71657220 	0x71657220
+   34f50:	74736575 	jalx	1cd95d4 <kheader+0x1c565d4>
+   34f54:	73206465 	0x73206465
+   34f58:	69767265 	0x69767265
+   34f5c:	25206563 	addiu	zero,t1,25955
+   34f60:	74202c64 	jalx	80b190 <kheader+0x788190>
+   34f64:	61657268 	0x61657268
+   34f68:	78252064 	0x78252064
+   34f6c:	7270202c 	0x7270202c
+   34f70:	2520636f 	addiu	zero,t1,25455
+   34f74:	00000a64 	0xa64
+   34f78:	55424544 	bnel	t2,v0,4648c <clusters_tbl+0x8aec>
+   34f7c:	25203a47 	addiu	zero,t1,14919
+   34f80:	50203a73 	beqzl	at,43950 <clusters_tbl+0x5fb0>
+   34f84:	25206469 	addiu	zero,t1,25705
+   34f88:	54202c64 	bnezl	at,4011c <clusters_tbl+0x277c>
+   34f8c:	25206469 	addiu	zero,t1,25705
+   34f90:	25282064 	addiu	t0,t1,8292
+   34f94:	202c2978 	addi	t4,at,10616
+   34f98:	20555043 	addi	s5,v0,20547
+   34f9c:	202c6425 	addi	t4,at,25637
+   34fa0:	76726553 	jalx	9c9954c <kheader+0x9c1654c>
+   34fa4:	20656369 	addi	a1,v1,25449
+   34fa8:	0a642523 	j	990948c <kheader+0x988648c>
+   34fac:	72412020 	clz	a0 or at,s2
+   34fb0:	25203067 	addiu	zero,t1,12391
+   34fb4:	41202c78 	0x41202c78
+   34fb8:	20316772 	addi	s1,at,26482
+   34fbc:	202c7825 	addi	t4,at,30757
+   34fc0:	32677241 	andi	a3,s3,0x7241
+   34fc4:	2c782520 	sltiu	t8,v1,9504
+   34fc8:	67724120 	0x67724120
+   34fcc:	78252033 	0x78252033
+   34fd0:	0000000a 	movz	zero,zero,zero
+   34fd4:	55424544 	bnel	t2,v0,464e8 <clusters_tbl+0x8b48>
+   34fd8:	25203a47 	addiu	zero,t1,14919
+   34fdc:	50203a73 	beqzl	at,439ac <clusters_tbl+0x600c>
+   34fe0:	25206469 	addiu	zero,t1,25705
+   34fe4:	54202c64 	bnezl	at,40178 <clusters_tbl+0x27d8>
+   34fe8:	25206469 	addiu	zero,t1,25705
+   34fec:	25282064 	addiu	t0,t1,8292
+   34ff0:	202c2978 	addi	t4,at,10616
+   34ff4:	20555043 	addi	s5,v0,20547
+   34ff8:	202c6425 	addi	t4,at,25637
+   34ffc:	76726553 	jalx	9c9954c <kheader+0x9c1654c>
+   35000:	20656369 	addi	a1,v1,25449
+   35004:	2c642523 	sltiu	a0,v1,9507
+   35008:	74655220 	jalx	1954880 <kheader+0x18d1880>
+   3500c:	206e7275 	addi	t6,v1,29301
+   35010:	202c7825 	addi	t4,at,30757
+   35014:	6f727245 	0x6f727245
+   35018:	64252072 	0x64252072
+   3501c:	0000000a 	movz	zero,zero,zero
+   35020:	00017924 	0x17924
+   35024:	000159d8 	0x159d8
+   35028:	000173c8 	0x173c8
+   3502c:	00017b04 	0x17b04
+   35030:	00017810 	0x17810
+   35034:	00018298 	0x18298
+   35038:	00016aa4 	0x16aa4
+   3503c:	000136c8 	0x136c8
+   35040:	00012fd8 	0x12fd8
+   35044:	00016838 	0x16838
+   35048:	00017e8c 	syscall	0x5fa
+   3504c:	00017fe8 	0x17fe8
+   35050:	00015d70 	tge	zero,at,0x175
+   35054:	00013ad0 	0x13ad0
+   35058:	000164ac 	0x164ac
+   3505c:	00018430 	tge	zero,at,0x210
+   35060:	000154cc 	syscall	0x553
+   35064:	000134a0 	0x134a0
+   35068:	00018350 	0x18350
+   3506c:	00016020 	add	t4,zero,at
+   35070:	000131e4 	0x131e4
+   35074:	000158ec 	0x158ec
+   35078:	000159c0 	sll	t3,at,0x7
+   3507c:	00015edc 	0x15edc
+   35080:	000165ac 	0x165ac
+   35084:	00013550 	0x13550
+   35088:	00015274 	teq	zero,at,0x149
+   3508c:	000133e8 	0x133e8
+   35090:	00012f1c 	0x12f1c
+   35094:	00013c58 	0x13c58
+   35098:	000183e8 	0x183e8
+   3509c:	00009fac 	0x9fac
+   350a0:	00016ea4 	0x16ea4
+   350a4:	00016f7c 	0x16f7c
+   350a8:	00016ef8 	0x16ef8
+   350ac:	000153b4 	teq	zero,at,0x14e
+   350b0:	00014e78 	0x14e78
+   350b4:	00014414 	0x14414
+   350b8:	00017a78 	0x17a78
+   350bc:	000161a0 	0x161a0
+   350c0:	00015590 	0x15590
+   350c4:	000156fc 	0x156fc
+   350c8:	00016fa8 	0x16fa8
+   350cc:	00017cc8 	0x17cc8
+   350d0:	00016a40 	sll	t5,at,0x9
+   350d4:	000166a0 	0x166a0
+   350d8:	000151b4 	teq	zero,at,0x146
+   350dc:	000132cc 	syscall	0x4cb
+   350e0:	000151ac 	0x151ac
+   350e4:	000153c4 	0x153c4
+   350e8:	000182a0 	0x182a0
+   350ec:	735f6f64 	0x735f6f64
+   350f0:	61637379 	0x61637379
+   350f4:	00006c6c 	0x6c6c
+   350f8:	203a7325 	addi	k0,at,29477
+   350fc:	20746f6e 	addi	s4,v1,28526
+   35100:	20746579 	addi	s4,v1,25977
+   35104:	6c706d69 	0x6c706d69
+   35108:	6e656d65 	0x6e656d65
+   3510c:	0a646574 	j	99195d0 <kheader+0x98965d0>
+   35110:	00000000 	sll	zero,zero,0x0
+   35114:	74647164 	jalx	191c590 <kheader+0x1899590>
+   35118:	6972705f 	0x6972705f
+   3511c:	735f746e 	0x735f746e
+   35120:	616d6d75 	0x616d6d75
+   35124:	00007972 	tlt	zero,zero,0x1e5
+   35128:	74647164 	jalx	191c590 <kheader+0x1899590>
+   3512c:	6972705f 	0x6972705f
+   35130:	0000746e 	0x746e
+   35134:	494e4150 	0x494e4150
+   35138:	74612043 	jalx	184810c <kheader+0x17c510c>
+   3513c:	6e696c20 	0x6e696c20
+   35140:	25203a65 	addiu	zero,t1,14949
+   35144:	66202c64 	0x66202c64
+   35148:	3a656c69 	xori	a1,s3,0x6c69
+   3514c:	20732520 	addi	s3,v1,9504
+   35150:	534d202c 	beql	k0,t5,3d204 <arch_entrys+0x864>
+   35154:	65203a47 	0x65203a47
+   35158:	746e6576 	jalx	1b995d8 <kheader+0x1b165d8>
+   3515c:	746f6e20 	jalx	1bdb880 <kheader+0x1b58880>
+   35160:	636f6c20 	0x636f6c20
+   35164:	63206c61 	0x63206c61
+   35168:	5b206469 	blezl	t9,4e310 <cluster_manager+0x7560>
+   3516c:	20757063 	addi	s5,v1,28771
+   35170:	202c6425 	addi	t4,at,25637
+   35174:	20646963 	addi	a0,v1,26979
+   35178:	202c6425 	addi	t4,at,25637
+   3517c:	6c637963 	0x6c637963
+   35180:	75252065 	jalx	4948194 <kheader+0x48c5194>
+   35184:	000a0a5d 	0xa0a5d
+   35188:	6e72656b 	0x6e72656b
+   3518c:	6576652f 	0x6576652f
+   35190:	632e746e 	0x632e746e
+   35194:	00000000 	sll	zero,zero,0x0
+   35198:	494e4150 	0x494e4150
+   3519c:	74612043 	jalx	184810c <kheader+0x17c510c>
+   351a0:	6e696c20 	0x6e696c20
+   351a4:	25203a65 	addiu	zero,t1,14949
+   351a8:	66202c64 	0x66202c64
+   351ac:	3a656c69 	xori	a1,s3,0x6c69
+   351b0:	20732520 	addi	s3,v1,9504
+   351b4:	534d202c 	beql	k0,t5,3d268 <arch_entrys+0x8c8>
+   351b8:	46203a47 	neg.d	$f9,$f7
+   351bc:	656c6961 	0x656c6961
+   351c0:	6f742064 	0x6f742064
+   351c4:	6f6f6c20 	0x6f6f6c20
+   351c8:	2070756b 	addi	s0,v1,30059
+   351cc:	6b736174 	0x6b736174
+   351d0:	0a212030 	j	88480c0 <kheader+0x87c50c0>
+   351d4:	0000000a 	movz	zero,zero,zero
+   351d8:	6e72656b 	0x6e72656b
+   351dc:	72656b2f 	0x72656b2f
+   351e0:	6e695f6e 	0x6e695f6e
+   351e4:	632e7469 	0x632e7469
+   351e8:	00000000 	sll	zero,zero,0x0
+   351ec:	00535953 	0x535953
+   351f0:	4f464e49 	c3	0x1464e49
+   351f4:	7243203a 	0x7243203a
+   351f8:	69746165 	0x69746165
+   351fc:	7420676e 	jalx	819db8 <kheader+0x796db8>
+   35200:	61657268 	0x61657268
+   35204:	64692064 	0x64692064
+   35208:	2520656c 	addiu	zero,t1,25964
+   3520c:	6e6f2078 	0x6e6f2078
+   35210:	75706320 	jalx	5c18c80 <kheader+0x5b95c80>
+   35214:	20642520 	addi	a0,v1,9504
+   35218:	6425205b 	0x6425205b
+   3521c:	000a5d20 	0xa5d20
+   35220:	206c6c41 	addi	t4,v1,27713
+   35224:	73756c63 	0x73756c63
+   35228:	73726574 	0x73726574
+   3522c:	76616820 	jalx	985a080 <kheader+0x97d7080>
+   35230:	65622065 	0x65622065
+   35234:	49206e65 	0x49206e65
+   35238:	6974696e 	0x6974696e
+   3523c:	7a696c61 	0x7a696c61
+   35240:	5b206465 	blezl	t9,4e3d8 <cluster_manager+0x7628>
+   35244:	20642520 	addi	a0,v1,9504
+   35248:	00000a5d 	0xa5d
+   3524c:	2020200a 	addi	zero,at,8202
+   35250:	20202020 	addi	zero,at,8224
+   35254:	20202020 	addi	zero,at,8224
+   35258:	5f5f5f5f 	0x5f5f5f5f
+   3525c:	20202020 	addi	zero,at,8224
+   35260:	20202020 	addi	zero,at,8224
+   35264:	205f5f5f 	addi	ra,v0,24415
+   35268:	20202020 	addi	zero,at,8224
+   3526c:	5f202020 	bgtzl	t9,3d2f0 <arch_entrys+0x950>
+   35270:	20205f5f 	addi	zero,at,24415
+   35274:	20202020 	addi	zero,at,8224
+   35278:	5f5f5f20 	0x5f5f5f20
+   3527c:	20202020 	addi	zero,at,8224
+   35280:	5f5f5f5f 	0x5f5f5f5f
+   35284:	205f5f5f 	addi	ra,v0,24415
+   35288:	5f202020 	bgtzl	t9,3d30c <arch_entrys+0x96c>
+   3528c:	5f5f5f5f 	0x5f5f5f5f
+   35290:	205f5f5f 	addi	ra,v0,24415
+   35294:	20202020 	addi	zero,at,8224
+   35298:	20202020 	addi	zero,at,8224
+   3529c:	205f5f5f 	addi	ra,v0,24415
+   352a0:	20202020 	addi	zero,at,8224
+   352a4:	5f5f2020 	0x5f5f2020
+   352a8:	2020205f 	addi	zero,at,8287
+   352ac:	205f5f5f 	addi	ra,v0,24415
+   352b0:	20202020 	addi	zero,at,8224
+   352b4:	205f5f5f 	addi	ra,v0,24415
+   352b8:	000a2020 	add	a0,zero,t2
+   352bc:	20202020 	addi	zero,at,8224
+   352c0:	20202020 	addi	zero,at,8224
+   352c4:	202f2020 	addi	t7,at,8224
+   352c8:	5c202020 	bgtzl	at,3d34c <arch_entrys+0x9ac>
+   352cc:	20202020 	addi	zero,at,8224
+   352d0:	207c2020 	addi	gp,v1,8224
+   352d4:	207c2020 	addi	gp,v1,8224
+   352d8:	20202020 	addi	zero,at,8224
+   352dc:	20207c20 	addi	zero,at,31776
+   352e0:	20205c20 	addi	zero,at,23584
+   352e4:	2f202020 	sltiu	zero,t9,8224
+   352e8:	7c202020 	0x7c202020
+   352ec:	202f2020 	addi	t7,at,8224
+   352f0:	5f5f5f20 	0x5f5f5f20
+   352f4:	205c2020 	addi	gp,v0,8224
+   352f8:	20202f20 	addi	zero,at,12064
+   352fc:	5f5f5f5f 	0x5f5f5f5f
+   35300:	207c2020 	addi	gp,v1,8224
+   35304:	20202020 	addi	zero,at,8224
+   35308:	207c2020 	addi	gp,v1,8224
+   3530c:	205c2020 	addi	gp,v0,8224
+   35310:	20202020 	addi	zero,at,8224
+   35314:	2020202f 	addi	zero,at,8239
+   35318:	207c207c 	addi	gp,v1,8316
+   3531c:	207c2020 	addi	gp,v1,8224
+   35320:	202f2020 	addi	t7,at,8224
+   35324:	0a202f20 	j	880bc80 <kheader+0x8788c80>
+   35328:	00000000 	sll	zero,zero,0x0
+   3532c:	20202020 	addi	zero,at,8224
+   35330:	20202020 	addi	zero,at,8224
+   35334:	20202f20 	addi	zero,at,12064
+   35338:	20205f5f 	addi	zero,at,24415
+   3533c:	2020205c 	addi	zero,at,8284
+   35340:	7c202020 	0x7c202020
+   35344:	20207c20 	addi	zero,at,31776
+   35348:	20202020 	addi	zero,at,8224
+   3534c:	207c2020 	addi	gp,v1,8224
+   35350:	5f5c2020 	0x5f5c2020
+   35354:	202f5f5f 	addi	t7,at,24415
+   35358:	207c2020 	addi	gp,v1,8224
+   3535c:	20207c20 	addi	zero,at,31776
+   35360:	2020202f 	addi	zero,at,8239
+   35364:	7c20205c 	0x7c20205c
+   35368:	2f207c20 	sltiu	zero,t9,31776
+   3536c:	20202020 	addi	zero,at,8224
+   35370:	202f5f7c 	addi	t7,at,24444
+   35374:	20202020 	addi	zero,at,8224
+   35378:	7c202020 	0x7c202020
+   3537c:	5c202020 	bgtzl	at,3d400 <arch_entrys+0xa60>
+   35380:	2f5f5f5f 	sltiu	ra,k0,24415
+   35384:	7c202020 	0x7c202020
+   35388:	7c202020 	0x7c202020
+   3538c:	20207c20 	addi	zero,at,31776
+   35390:	20202f20 	addi	zero,at,12064
+   35394:	0a20202f 	j	88080bc <kheader+0x87850bc>
+   35398:	00000000 	sll	zero,zero,0x0
+   3539c:	20202020 	addi	zero,at,8224
+   353a0:	20202020 	addi	zero,at,8224
+   353a4:	2f20202f 	sltiu	zero,t9,8239
+   353a8:	205c2020 	addi	gp,v0,8224
+   353ac:	20205c20 	addi	zero,at,23584
+   353b0:	7c202020 	0x7c202020
+   353b4:	20207c20 	addi	zero,at,31776
+   353b8:	20202020 	addi	zero,at,8224
+   353bc:	207c2020 	addi	gp,v1,8224
+   353c0:	20205f20 	addi	zero,at,24352
+   353c4:	5f202020 	bgtzl	t9,3d448 <arch_entrys+0xaa8>
+   353c8:	207c2020 	addi	gp,v1,8224
+   353cc:	7c207c20 	0x7c207c20
+   353d0:	20202020 	addi	zero,at,8224
+   353d4:	7c207c20 	0x7c207c20
+   353d8:	7c207c20 	0x7c207c20
+   353dc:	5f5f5f5f 	0x5f5f5f5f
+   353e0:	20205f5f 	addi	zero,at,24415
+   353e4:	5f5f5f20 	0x5f5f5f20
+   353e8:	7c202020 	0x7c202020
+   353ec:	205f2020 	addi	ra,v0,8224
+   353f0:	20202020 	addi	zero,at,8224
+   353f4:	7c20205f 	0x7c20205f
+   353f8:	7c202020 	0x7c202020
+   353fc:	5f5f7c20 	0x5f5f7c20
+   35400:	2f20202f 	sltiu	zero,t9,8239
+   35404:	20202020 	addi	zero,at,8224
+   35408:	00000a20 	0xa20
+   3540c:	20202020 	addi	zero,at,8224
+   35410:	2f202020 	sltiu	zero,t9,8224
+   35414:	5f2f2020 	0x5f2f2020
+   35418:	5c5f5f5f 	0x5c5f5f5f
+   3541c:	205c2020 	addi	gp,v0,8224
+   35420:	7c202020 	0x7c202020
+   35424:	20207c20 	addi	zero,at,31776
+   35428:	20202020 	addi	zero,at,8224
+   3542c:	207c2020 	addi	gp,v1,8224
+   35430:	205c207c 	addi	gp,v0,8316
+   35434:	202f2020 	addi	t7,at,8224
+   35438:	207c207c 	addi	gp,v1,8316
+   3543c:	7c207c20 	0x7c207c20
+   35440:	20202020 	addi	zero,at,8224
+   35444:	7c207c20 	0x7c207c20
+   35448:	5f5f5c20 	0x5f5f5c20
+   3544c:	5f5f5f5f 	0x5f5f5f5f
+   35450:	205c2020 	addi	gp,v0,8224
+   35454:	5f5f5f7c 	0x5f5f5f7c
+   35458:	7c20207c 	0x7c20207c
+   3545c:	5c207c20 	bgtzl	at,544e0 <cluster_manager+0xd730>
+   35460:	2f202020 	sltiu	zero,t9,8224
+   35464:	7c207c20 	0x7c207c20
+   35468:	7c202020 	0x7c202020
+   3546c:	5f5f2020 	0x5f5f2020
+   35470:	203c2020 	addi	gp,at,8224
+   35474:	00000a20 	0xa20
+   35478:	20202020 	addi	zero,at,8224
+   3547c:	202f2020 	addi	t7,at,8224
+   35480:	5f5f2020 	0x5f5f2020
+   35484:	5f5f5f5f 	0x5f5f5f5f
+   35488:	5c202020 	bgtzl	at,3d50c <arch_entrys+0xb6c>
+   3548c:	7c202020 	0x7c202020
+   35490:	20207c20 	addi	zero,at,31776
+   35494:	5f202020 	bgtzl	t9,3d518 <arch_entrys+0xb78>
+   35498:	207c2020 	addi	gp,v1,8224
+   3549c:	5c20207c 	bgtzl	at,3d690 <Arch_cid_To_Almos_cid+0xf0>
+   354a0:	20202f5f 	addi	zero,at,12127
+   354a4:	207c207c 	addi	gp,v1,8316
+   354a8:	7c207c20 	0x7c207c20
+   354ac:	20202020 	addi	zero,at,8224
+   354b0:	7c207c20 	0x7c207c20
+   354b4:	205f2020 	addi	ra,v0,8224
+   354b8:	20202020 	addi	zero,at,8224
+   354bc:	207c207c 	addi	gp,v1,8316
+   354c0:	20202020 	addi	zero,at,8224
+   354c4:	7c202020 	0x7c202020
+   354c8:	20207c20 	addi	zero,at,31776
+   354cc:	202f5f5c 	addi	t7,at,24412
+   354d0:	7c207c20 	0x7c207c20
+   354d4:	7c202020 	0x7c202020
+   354d8:	20207c20 	addi	zero,at,31776
+   354dc:	5c20205c 	bgtzl	at,3d650 <Arch_cid_To_Almos_cid+0xb0>
+   354e0:	000a2020 	add	a0,zero,t2
+   354e4:	20202020 	addi	zero,at,8224
+   354e8:	20202f20 	addi	zero,at,12064
+   354ec:	20202f20 	addi	zero,at,12064
+   354f0:	20202020 	addi	zero,at,8224
+   354f4:	2020205c 	addi	zero,at,8284
+   354f8:	7c20205c 	0x7c20205c
+   354fc:	5f5f7c20 	0x5f5f7c20
+   35500:	202f5f5f 	addi	t7,at,24415
+   35504:	207c207c 	addi	gp,v1,8316
+   35508:	2020207c 	addi	zero,at,8316
+   3550c:	20202020 	addi	zero,at,8224
+   35510:	207c207c 	addi	gp,v1,8316
+   35514:	20207c20 	addi	zero,at,31776
+   35518:	5f5f5f5c 	0x5f5f5f5c
+   3551c:	7c20202f 	0x7c20202f
+   35520:	5c207c20 	bgtzl	at,545a4 <cluster_manager+0xd7f4>
+   35524:	5f5f5f5f 	0x5f5f5f5f
+   35528:	207c202f 	addi	gp,v1,8239
+   3552c:	20202020 	addi	zero,at,8224
+   35530:	7c202020 	0x7c202020
+   35534:	20207c20 	addi	zero,at,31776
+   35538:	20202020 	addi	zero,at,8224
+   3553c:	7c207c20 	0x7c207c20
+   35540:	7c202020 	0x7c202020
+   35544:	20207c20 	addi	zero,at,31776
+   35548:	20205c20 	addi	zero,at,23584
+   3554c:	00000a5c 	0xa5c
+   35550:	20202020 	addi	zero,at,8224
+   35554:	5f5f5f2f 	0x5f5f5f2f
+   35558:	202f5f5f 	addi	t7,at,24415
+   3555c:	5c202020 	bgtzl	at,3d5e0 <Arch_cid_To_Almos_cid+0x40>
+   35560:	5f5f5f5f 	0x5f5f5f5f
+   35564:	5f7c5c5f 	0x5f7c5c5f
+   35568:	5f5f5f5f 	0x5f5f5f5f
+   3556c:	5f5f5f5f 	0x5f5f5f5f
+   35570:	5f5f7c2f 	0x5f5f7c2f
+   35574:	20207c5f 	addi	zero,at,31839
+   35578:	7c202020 	0x7c202020
+   3557c:	7c5f5f5f 	0x7c5f5f5f
+   35580:	5f5c2020 	0x5f5c2020
+   35584:	5f5f5f5f 	0x5f5f5f5f
+   35588:	202f5f5f 	addi	t7,at,24415
+   3558c:	5f5f7c20 	0x5f5f7c20
+   35590:	5f5f5f5f 	0x5f5f5f5f
+   35594:	202f5f5f 	addi	t7,at,24415
+   35598:	20202020 	addi	zero,at,8224
+   3559c:	5f7c2020 	0x5f7c2020
+   355a0:	207c5f5f 	addi	gp,v1,24415
+   355a4:	20202020 	addi	zero,at,8224
+   355a8:	5f5f5f7c 	0x5f5f5f7c
+   355ac:	5f7c207c 	0x5f7c207c
+   355b0:	207c5f5f 	addi	gp,v1,24415
+   355b4:	5f5c2020 	0x5f5c2020
+   355b8:	000a5c5f 	0xa5c5f
+   355bc:	09090a0a 	j	4242828 <kheader+0x41bf828>
+   355c0:	41200909 	0x41200909
+   355c4:	6e617664 	0x6e617664
+   355c8:	20646563 	addi	a0,v1,25955
+   355cc:	61636f4c 	0x61636f4c
+   355d0:	7974696c 	0x7974696c
+   355d4:	6e614d20 	0x6e614d20
+   355d8:	6d656761 	0x6d656761
+   355dc:	20746e65 	addi	s4,v1,28261
+   355e0:	7265704f 	0x7265704f
+   355e4:	6e697461 	0x6e697461
+   355e8:	79532067 	0x79532067
+   355ec:	6d657473 	0x6d657473
+   355f0:	0000000a 	movz	zero,zero,zero
+   355f4:	09090909 	j	4242424 <kheader+0x41bf424>
+   355f8:	55202020 	bnezl	t1,3d67c <Arch_cid_To_Almos_cid+0xdc>
+   355fc:	2f434d50 	sltiu	v1,k0,19792
+   35600:	3650494c 	ori	s0,s2,0x494c
+   35604:	436f532f 	c0	0x16f532f
+   35608:	73252820 	clz	a1,t9
+   3560c:	0a0a0a29 	j	82828a4 <kheader+0x81ff8a4>
+   35610:	00000000 	sll	zero,zero,0x0
+   35614:	4d203230 	0x4d203230
+   35618:	32207961 	andi	zero,s1,0x7961
+   3561c:	20363130 	addi	s6,at,12592
+   35620:	3731202d 	ori	s1,t9,0x202d
+   35624:	3a35343a 	xori	s5,s1,0x343a
+   35628:	00003832 	tlt	zero,zero,0xe0
+   3562c:	204d434b 	addi	t5,v0,17227
+   35630:	5359454b 	beql	k0,t9,46b60 <clusters_tbl+0x91c0>
+   35634:	00434552 	0x434552
+   35638:	6425205b 	0x6425205b
+   3563c:	5b205d20 	blezl	t9,4cac0 <cluster_manager+0x5d10>
+   35640:	20636572 	addi	v1,v1,25970
+   35644:	25783040 	addiu	t8,t3,12352
+   35648:	5b205d78 	blezl	t9,4cc2c <cluster_manager+0x5e7c>
+   3564c:	00000000 	sll	zero,zero,0x0
+   35650:	202c7825 	addi	t4,at,30757
+   35654:	00000000 	sll	zero,zero,0x0
+   35658:	203a7325 	addi	k0,at,29477
+   3565c:	72617473 	0x72617473
+   35660:	20646574 	addi	a0,v1,25972
+   35664:	656b205b 	0x656b205b
+   35668:	70207379 	0x70207379
+   3566c:	72207265 	0x72207265
+   35670:	726f6365 	0x726f6365
+   35674:	64252064 	0x64252064
+   35678:	3a205d20 	xori	zero,s1,0x5d20
+   3567c:	0000000a 	movz	zero,zero,zero
+   35680:	7379656b 	0x7379656b
+   35684:	705f6264 	0x705f6264
+   35688:	746e6972 	jalx	1b9a5c8 <kheader+0x1b175c8>
+   3568c:	00000000 	sll	zero,zero,0x0
+   35690:	494e4150 	0x494e4150
+   35694:	74612043 	jalx	184810c <kheader+0x17c510c>
+   35698:	6e696c20 	0x6e696c20
+   3569c:	25203a65 	addiu	zero,t1,14949
+   356a0:	66202c64 	0x66202c64
+   356a4:	3a656c69 	xori	a1,s3,0x6c69
+   356a8:	20732520 	addi	s3,v1,9504
+   356ac:	534d202c 	beql	k0,t5,3d760 <Arch_cid_To_Almos_cid+0x1c0>
+   356b0:	54203a47 	bnezl	at,43fd0 <clusters_tbl+0x6630>
+   356b4:	61657268 	0x61657268
+   356b8:	78252064 	0x78252064
+   356bc:	5043202c 	beql	v0,v1,3d770 <Arch_cid_To_Almos_cid+0x1d0>
+   356c0:	64252055 	0x64252055
+   356c4:	73756d20 	0x73756d20
+   356c8:	656e2074 	0x656e2074
+   356cc:	20726576 	addi	s2,v1,25974
+   356d0:	75746572 	jalx	5d195c8 <kheader+0x5c965c8>
+   356d4:	000a6e72 	tlt	zero,t2,0x1b9
+   356d8:	6e72656b 	0x6e72656b
+   356dc:	68746b2f 	0x68746b2f
+   356e0:	64616572 	0x64616572
+   356e4:	6572635f 	0x6572635f
+   356e8:	2e657461 	sltiu	a1,s3,29793
+   356ec:	00000063 	0x63
+   356f0:	4f444f54 	c3	0x1444f54
+   356f4:	0000000a 	movz	zero,zero,zero
+   356f8:	6e72656b 	0x6e72656b
+   356fc:	73636d2f 	0x73636d2f
+   35700:	6e79735f 	0x6e79735f
+   35704:	00632e63 	0x632e63
+   35708:	7825205b 	0x7825205b
+   3570c:	41205d20 	0x41205d20
+   35710:	72657373 	0x72657373
+   35714:	68742074 	0x68742074
+   35718:	3e2d7369 	0x3e2d7369
+   3571c:	6b636f6c 	0x6b636f6c
+   35720:	6f635f73 	0x6f635f73
+   35724:	20746e75 	addi	s4,v1,28277
+   35728:	2030203e 	addi	s0,at,8254
+   3572c:	6c696166 	0x6c696166
+   35730:	6c202c64 	0x6c202c64
+   35734:	20656e69 	addi	a1,v1,28265
+   35738:	202c6425 	addi	t4,at,25637
+   3573c:	656c6966 	0x656c6966
+   35740:	2c732520 	sltiu	s3,v1,9504
+   35744:	72685420 	0x72685420
+   35748:	20646165 	addi	a0,v1,24933
+   3574c:	5d78255b 	0x5d78255b
+   35750:	206e6f20 	addi	t6,v1,28448
+   35754:	20555043 	addi	s5,v0,20547
+   35758:	5d64255b 	0x5d64255b
+   3575c:	7543202c 	jalx	50c80b0 <kheader+0x50450b0>
+   35760:	6e657272 	0x6e657272
+   35764:	68542074 	0x68542074
+   35768:	64616572 	0x64616572
+   3576c:	78255b20 	0x78255b20
+   35770:	6e6f205d 	0x6e6f205d
+   35774:	55504320 	bnel	t2,s0,463f8 <clusters_tbl+0x8a58>
+   35778:	64255b20 	0x64255b20
+   3577c:	5b202c5d 	blezl	t9,408f4 <clusters_tbl+0x2f54>
+   35780:	0a5d7525 	j	975d494 <kheader+0x96da494>
+   35784:	00000000 	sll	zero,zero,0x0
+   35788:	4e524157 	c3	0x524157
+   3578c:	3a474e49 	xori	a3,s2,0x4e49
+   35790:	6d776d20 	0x6d776d20
+   35794:	6e695f72 	0x6e695f72
+   35798:	203a7469 	addi	k0,at,29801
+   3579c:	4f4d454d 	c3	0x14d454d
+   357a0:	53205952 	beqzl	t9,4bcec <cluster_manager+0x4f3c>
+   357a4:	54524f48 	bnel	v0,s2,494c8 <cluster_manager+0x2718>
+   357a8:	0a454741 	j	9151d04 <kheader+0x90ced04>
+   357ac:	00000000 	sll	zero,zero,0x0
+   357b0:	524d574d 	beql	s2,t5,4b4e8 <cluster_manager+0x4738>
+   357b4:	00000000 	sll	zero,zero,0x0
+   357b8:	204d434b 	addi	t5,v0,17227
+   357bc:	69646152 	0x69646152
+   357c0:	6f4e2078 	0x6f4e2078
+   357c4:	00006564 	0x6564
+   357c8:	4e524157 	c3	0x524157
+   357cc:	3a474e49 	xori	a3,s2,0x4e49
+   357d0:	3a732520 	xori	s3,s3,0x2520
+   357d4:	206f4e20 	addi	t7,v1,20000
+   357d8:	6d657469 	0x6d657469
+   357dc:	20666f20 	addi	a2,v1,28448
+   357e0:	2079656b 	addi	t9,v1,25963
+   357e4:	61206425 	0x61206425
+   357e8:	616d2073 	0x616d2073
+   357ec:	78652079 	0x78652079
+   357f0:	74636570 	jalx	18d95c0 <kheader+0x18565c0>
+   357f4:	000a6465 	0xa6465
+   357f8:	4e524157 	c3	0x524157
+   357fc:	3a474e49 	xori	a3,s2,0x4e49
+   35800:	3a732520 	xori	s3,s3,0x2520
+   35804:	766e6920 	jalx	9b9a480 <kheader+0x9b17480>
+   35808:	64696c61 	0x64696c61
+   3580c:	65706f20 	0x65706f20
+   35810:	69746172 	0x69746172
+   35814:	6f206e6f 	0x6f206e6f
+   35818:	7469206e 	jalx	1a481b8 <kheader+0x19c51b8>
+   3581c:	28206d65 	slti	zero,at,28005
+   35820:	252c6425 	addiu	t4,t1,25637
+   35824:	000a2964 	0xa2964
+   35828:	69646172 	0x69646172
+   3582c:	72745f78 	0x72745f78
+   35830:	645f6565 	0x645f6565
+   35834:	74656c65 	jalx	195b194 <kheader+0x18d8194>
+   35838:	00000065 	0x65
+   3583c:	69646172 	0x69646172
+   35840:	74695f78 	jalx	1a57de0 <kheader+0x19d4de0>
+   35844:	695f6d65 	0x695f6d65
+   35848:	5f6f666e 	0x5f6f666e
+   3584c:	6c707061 	0x6c707061
+   35850:	00000079 	0x79
+   35854:	494e4150 	0x494e4150
+   35858:	74612043 	jalx	184810c <kheader+0x17c510c>
+   3585c:	6e696c20 	0x6e696c20
+   35860:	25203a65 	addiu	zero,t1,14949
+   35864:	66202c64 	0x66202c64
+   35868:	3a656c69 	xori	a1,s3,0x6c69
+   3586c:	20732520 	addi	s3,v1,9504
+   35870:	534d202c 	beql	k0,t5,3d924 <__fb_screen+0x84>
+   35874:	53203a47 	beqzl	t9,44194 <clusters_tbl+0x67f4>
+   35878:	20544f4c 	addi	s4,v0,20300
+   3587c:	657a6973 	0x657a6973
+   35880:	6e616320 	0x6e616320
+   35884:	20746f6e 	addi	s4,v1,28526
+   35888:	62206562 	0x62206562
+   3588c:	65676769 	0x65676769
+   35890:	68742072 	0x68742072
+   35894:	66206e61 	0x66206e61
+   35898:	0a6f6669 	j	9bd99a4 <kheader+0x9b569a4>
+   3589c:	00000000 	sll	zero,zero,0x0
+   358a0:	6e72656b 	0x6e72656b
+   358a4:	6d65722f 	0x6d65722f
+   358a8:	5f65746f 	0x5f65746f
+   358ac:	6f666966 	0x6f666966
+   358b0:	0000632e 	0x632e
+   358b4:	5d64255b 	0x5d64255b
+   358b8:	21212120 	addi	at,t1,8480
+   358bc:	52524520 	beql	s2,s2,46d40 <clusters_tbl+0x93a0>
+   358c0:	6920524f 	0x6920524f
+   358c4:	7072206e 	0x7072206e
+   358c8:	65742063 	0x65742063
+   358cc:	6e207473 	0x6e207473
+   358d0:	6425b0c2 	0x6425b0c2
+   358d4:	21212120 	addi	at,t1,8480
+   358d8:	0000000a 	movz	zero,zero,zero
+   358dc:	203a7325 	addi	k0,at,29477
+   358e0:	20637072 	addi	v1,v1,28786
+   358e4:	202c7025 	addi	t4,at,28709
+   358e8:	72727563 	0x72727563
+   358ec:	20746e65 	addi	s4,v1,28261
+   358f0:	73756c63 	0x73756c63
+   358f4:	20726574 	addi	s2,v1,25972
+   358f8:	202c7825 	addi	t4,at,30757
+   358fc:	72727563 	0x72727563
+   35900:	5f746e65 	0x5f746e65
+   35904:	2d757063 	sltiu	s5,t3,28771
+   35908:	64696c3e 	0x64696c3e
+   3590c:	3a782520 	xori	t8,s3,0x2520
+   35910:	0000000a 	movz	zero,zero,zero
+   35914:	20637072 	addi	v1,v1,28786
+   35918:	20646967 	addi	a0,v1,26983
+   3591c:	202c7825 	addi	t4,at,30757
+   35920:	6f697270 	0x6f697270
+   35924:	2c642520 	sltiu	a0,v1,9504
+   35928:	6e657320 	0x6e657320
+   3592c:	20726564 	addi	s2,v1,25956
+   35930:	202c7025 	addi	t4,at,28709
+   35934:	73677261 	0x73677261
+   35938:	20626e5f 	addi	v0,v1,28255
+   3593c:	202c6425 	addi	t4,at,25637
+   35940:	657a6973 	0x657a6973
+   35944:	0a642520 	j	9909480 <kheader+0x9886480>
+   35948:	00000000 	sll	zero,zero,0x0
+   3594c:	3a435052 	xori	v1,s2,0x5052
+   35950:	65687420 	0x65687420
+   35954:	71657220 	0x71657220
+   35958:	74736575 	jalx	1cd95d4 <kheader+0x1c565d4>
+   3595c:	61206465 	0x61206465
+   35960:	6d756772 	0x6d756772
+   35964:	20746e65 	addi	s4,v1,28261
+   35968:	29642528 	slti	a0,t3,9512
+   3596c:	20736920 	addi	s3,v1,26912
+   35970:	20746f6e 	addi	s4,v1,28526
+   35974:	6c617661 	0x6c617661
+   35978:	656c6261 	0x656c6261
+   3597c:	0000000a 	movz	zero,zero,zero
+   35980:	4f444f54 	c3	0x1444f54
+   35984:	70722021 	clo	a0 or s2,v1
+   35988:	72665f63 	0x72665f63
+   3598c:	000a6565 	0xa6565
+   35990:	5d64255b 	0x5d64255b
+   35994:	43505220 	wait	0x54148
+   35998:	72726520 	0x72726520
+   3599c:	7520726f 	jalx	481c9bc <kheader+0x47999bc>
+   359a0:	6e61686e 	0x6e61686e
+   359a4:	64656c64 	0x64656c64
+   359a8:	21212121 	addi	at,t1,8481
+   359ac:	0000000a 	movz	zero,zero,zero
+   359b0:	20435052 	addi	v1,v0,20562
+   359b4:	65726854 	0x65726854
+   359b8:	00006461 	0x6461
+   359bc:	203a7325 	addi	k0,at,29477
+   359c0:	6f727265 	0x6f727265
+   359c4:	64252072 	0x64252072
+   359c8:	69687720 	0x69687720
+   359cc:	6320656c 	0x6320656c
+   359d0:	74616572 	jalx	18595c8 <kheader+0x17d65c8>
+   359d4:	20676e69 	addi	a3,v1,28265
+   359d8:	656e2061 	0x656e2061
+   359dc:	68742077 	0x68742077
+   359e0:	64616572 	0x64616572
+   359e4:	6f74203a 	0x6f74203a
+   359e8:	206c6174 	addi	t4,v1,24948
+   359ec:	203b6425 	addi	k1,at,25637
+   359f0:	206b7277 	addi	t3,v1,29303
+   359f4:	6425203d 	0x6425203d
+   359f8:	0000000a 	movz	zero,zero,zero
+   359fc:	494e4150 	0x494e4150
+   35a00:	74612043 	jalx	184810c <kheader+0x17c510c>
+   35a04:	6e696c20 	0x6e696c20
+   35a08:	25203a65 	addiu	zero,t1,14949
+   35a0c:	66202c64 	0x66202c64
+   35a10:	3a656c69 	xori	a1,s3,0x6c69
+   35a14:	20732520 	addi	s3,v1,9504
+   35a18:	534d202c 	beql	k0,t5,3dacc <clusters_tbl+0x12c>
+   35a1c:	52203a47 	beqzl	s1,4433c <clusters_tbl+0x699c>
+   35a20:	203a4350 	addi	k0,at,17232
+   35a24:	20656874 	addi	a1,v1,26740
+   35a28:	75716572 	jalx	5c595c8 <kheader+0x5bd65c8>
+   35a2c:	65747365 	0x65747365
+   35a30:	72612064 	0x72612064
+   35a34:	656d7567 	0x656d7567
+   35a38:	2820746e 	slti	zero,at,29806
+   35a3c:	20296425 	addi	t1,at,25637
+   35a40:	6e207369 	0x6e207369
+   35a44:	6120746f 	0x6120746f
+   35a48:	616c6176 	0x616c6176
+   35a4c:	0a656c62 	j	995b188 <kheader+0x98d8188>
+   35a50:	0000000a 	movz	zero,zero,zero
+   35a54:	6e72656b 	0x6e72656b
+   35a58:	6370722f 	0x6370722f
+   35a5c:	0000632e 	0x632e
+   35a60:	4f444f54 	c3	0x1444f54
+   35a64:	50522021 	beql	v0,s2,3daec <clusters_tbl+0x14c>
+   35a68:	4c415f43 	0x4c415f43
+   35a6c:	21434f4c 	addi	v1,t2,20300
+   35a70:	0000000a 	movz	zero,zero,zero
+   35a74:	494e4150 	0x494e4150
+   35a78:	74612043 	jalx	184810c <kheader+0x17c510c>
+   35a7c:	6e696c20 	0x6e696c20
+   35a80:	25203a65 	addiu	zero,t1,14949
+   35a84:	66202c64 	0x66202c64
+   35a88:	3a656c69 	xori	a1,s3,0x6c69
+   35a8c:	20732520 	addi	s3,v1,9504
+   35a90:	534d202c 	beql	k0,t5,3db44 <clusters_tbl+0x1a4>
+   35a94:	49203a47 	0x49203a47
+   35a98:	6974696e 	0x6974696e
+   35a9c:	73696c61 	0x73696c61
+   35aa0:	6f697461 	0x6f697461
+   35aa4:	666f206e 	0x666f206e
+   35aa8:	43505220 	wait	0x54148
+   35aac:	69616620 	0x69616620
+   35ab0:	2e64656c 	sltiu	a0,s3,25964
+   35ab4:	00000a0a 	0xa0a
+   35ab8:	5d64255b 	0x5d64255b
+   35abc:	50505220 	beql	v0,s0,4a340 <cluster_manager+0x3590>
+   35ac0:	76612043 	jalx	984810c <kheader+0x97c510c>
+   35ac4:	67617265 	0x67617265
+   35ac8:	69742065 	0x69742065
+   35acc:	2820656d 	slti	zero,at,25965
+   35ad0:	68746977 	0x68746977
+   35ad4:	20642520 	addi	a0,v1,9504
+   35ad8:	28757063 	slti	s5,v1,28771
+   35adc:	20292973 	addi	t1,at,10611
+   35ae0:	25207369 	addiu	zero,t1,29545
+   35ae4:	79632064 	0x79632064
+   35ae8:	73656c63 	0x73656c63
+   35aec:	0000000a 	movz	zero,zero,zero
+   35af0:	5d64255b 	0x5d64255b
+   35af4:	50435220 	beql	v0,v1,4a378 <cluster_manager+0x35c8>
+   35af8:	76612043 	jalx	984810c <kheader+0x97c510c>
+   35afc:	67617265 	0x67617265
+   35b00:	69742065 	0x69742065
+   35b04:	2820656d 	slti	zero,at,25965
+   35b08:	68746977 	0x68746977
+   35b0c:	20642520 	addi	a0,v1,9504
+   35b10:	73756c63 	0x73756c63
+   35b14:	28726574 	slti	s2,v1,25972
+   35b18:	20292973 	addi	t1,at,10611
+   35b1c:	25207369 	addiu	zero,t1,29545
+   35b20:	79632064 	0x79632064
+   35b24:	73656c63 	0x73656c63
+   35b28:	0000000a 	movz	zero,zero,zero
+   35b2c:	0000fbac 	0xfbac
+   35b30:	0000f9fc 	0xf9fc
+   35b34:	0000f9fc 	0xf9fc
+   35b38:	0000fbac 	0xfbac
+   35b3c:	5f637072 	0x5f637072
+   35b40:	69746361 	0x69746361
+   35b44:	65746176 	0x65746176
+   35b48:	7268745f 	0x7268745f
+   35b4c:	00646165 	0x646165
+   35b50:	494e4150 	0x494e4150
+   35b54:	74612043 	jalx	184810c <kheader+0x17c510c>
+   35b58:	6e696c20 	0x6e696c20
+   35b5c:	25203a65 	addiu	zero,t1,14949
+   35b60:	66202c64 	0x66202c64
+   35b64:	3a656c69 	xori	a1,s3,0x6c69
+   35b68:	20732520 	addi	s3,v1,9504
+   35b6c:	534d202c 	beql	k0,t5,3dc20 <clusters_tbl+0x280>
+   35b70:	72203a47 	0x72203a47
+   35b74:	63732d72 	0x63732d72
+   35b78:	2e646568 	sltiu	a0,s3,25960
+   35b7c:	74696e69 	jalx	1a5b9a4 <kheader+0x19d89a4>
+   35b80:	6166203a 	0x6166203a
+   35b84:	206c6174 	addi	t4,v1,24948
+   35b88:	6f727265 	0x6f727265
+   35b8c:	4f4e2072 	c3	0x14e2072
+   35b90:	0a4d454d 	j	9351534 <kheader+0x92ce534>
+   35b94:	0000000a 	movz	zero,zero,zero
+   35b98:	6e72656b 	0x6e72656b
+   35b9c:	2d72722f 	sltiu	s2,t3,29231
+   35ba0:	65686373 	0x65686373
+   35ba4:	6f6c5f64 	0x6f6c5f64
+   35ba8:	64656b63 	0x64656b63
+   35bac:	0000632e 	0x632e
+   35bb0:	65755172 	0x65755172
+   35bb4:	00736575 	0x736575
+   35bb8:	20757063 	addi	s5,v1,28771
+   35bbc:	202c6425 	addi	t4,at,25637
+   35bc0:	20646974 	addi	a0,v1,26996
+   35bc4:	202c7825 	addi	t4,at,30757
+   35bc8:	74617473 	jalx	185d1cc <kheader+0x17da1cc>
+   35bcc:	73252065 	0x73252065
+   35bd0:	0000000a 	movz	zero,zero,zero
+   35bd4:	00010358 	0x10358
+   35bd8:	000100cc 	syscall	0x403
+   35bdc:	0001014c 	syscall	0x405
+   35be0:	00010af8 	0x10af8
+   35be4:	000100c4 	0x100c4
+   35be8:	000101dc 	0x101dc
+   35bec:	0001024c 	syscall	0x409
+   35bf0:	000100bc 	0x100bc
+   35bf4:	00010080 	sll	zero,at,0x2
+   35bf8:	00010358 	0x10358
+   35bfc:	4f525245 	c3	0x1525245
+   35c00:	55203a52 	bnezl	t1,4454c <clusters_tbl+0x6bac>
+   35c04:	7078656e 	0x7078656e
+   35c08:	65746365 	0x65746365
+   35c0c:	77722064 	jalx	dc88190 <kheader+0xdc05190>
+   35c10:	6b636f6c 	0x6b636f6c
+   35c14:	6c6e755f 	0x6c6e755f
+   35c18:	0a6b636f 	j	9ad8dbc <kheader+0x9a55dbc>
+   35c1c:	00000000 	sll	zero,zero,0x0
+   35c20:	4f4c5752 	c3	0x14c5752
+   35c24:	203a4b43 	addi	k0,at,19267
+   35c28:	61657252 	0x61657252
+   35c2c:	73726564 	0x73726564
+   35c30:	00000000 	sll	zero,zero,0x0
+   35c34:	4f4c5752 	c3	0x14c5752
+   35c38:	203a4b43 	addi	k0,at,19267
+   35c3c:	74697257 	jalx	1a5c95c <kheader+0x19d995c>
+   35c40:	00737265 	0x737265
+   35c44:	3a525245 	xori	s2,s2,0x5245
+   35c48:	68637320 	0x68637320
+   35c4c:	675f6465 	0x675f6465
+   35c50:	6f707465 	0x6f707465
+   35c54:	7963696c 	0x7963696c
+   35c58:	6e75203a 	0x6e75203a
+   35c5c:	65707865 	0x65707865
+   35c60:	64657463 	0x64657463
+   35c64:	6c6f7020 	0x6c6f7020
+   35c68:	20796369 	addi	t9,v1,25449
+   35c6c:	6469545b 	0x6469545b
+   35c70:	5d782520 	0x5d782520
+   35c74:	0000000a 	movz	zero,zero,zero
+   35c78:	3a525245 	xori	s2,s2,0x5245
+   35c7c:	68637320 	0x68637320
+   35c80:	735f6465 	0x735f6465
+   35c84:	6f707465 	0x6f707465
+   35c88:	7963696c 	0x7963696c
+   35c8c:	6e75203a 	0x6e75203a
+   35c90:	65707865 	0x65707865
+   35c94:	64657463 	0x64657463
+   35c98:	6c6f7020 	0x6c6f7020
+   35c9c:	20796369 	addi	t9,v1,25449
+   35ca0:	6469545b 	0x6469545b
+   35ca4:	2c782520 	sltiu	t8,v1,9504
+   35ca8:	6c6f7020 	0x6c6f7020
+   35cac:	20796369 	addi	t9,v1,25449
+   35cb0:	0a5d6425 	j	9759094 <kheader+0x96d6094>
+   35cb4:	00000000 	sll	zero,zero,0x0
+   35cb8:	494e4150 	0x494e4150
+   35cbc:	74612043 	jalx	184810c <kheader+0x17c510c>
+   35cc0:	6e696c20 	0x6e696c20
+   35cc4:	25203a65 	addiu	zero,t1,14949
+   35cc8:	66202c64 	0x66202c64
+   35ccc:	3a656c69 	xori	a1,s3,0x6c69
+   35cd0:	20732520 	addi	s3,v1,9504
+   35cd4:	534d202c 	beql	k0,t5,3dd88 <clusters_tbl+0x3e8>
+   35cd8:	54203a47 	bnezl	at,445f8 <clusters_tbl+0x6c58>
+   35cdc:	61657268 	0x61657268
+   35ce0:	78252064 	0x78252064
+   35ce4:	206e6f20 	addi	t6,v1,28448
+   35ce8:	20555043 	addi	s5,v0,20547
+   35cec:	202c6425 	addi	t4,at,25637
+   35cf0:	7473756d 	jalx	1cdd5b4 <kheader+0x1c5a5b4>
+   35cf4:	76656e20 	jalx	995b880 <kheader+0x98d8880>
+   35cf8:	74207265 	jalx	81c994 <kheader+0x799994>
+   35cfc:	6572206f 	0x6572206f
+   35d00:	6e727574 	0x6e727574
+   35d04:	72656820 	clz	t5 or a1,s3
+   35d08:	21212065 	addi	at,t1,8293
+   35d0c:	0000000a 	movz	zero,zero,zero
+   35d10:	6e72656b 	0x6e72656b
+   35d14:	6863732f 	0x6863732f
+   35d18:	6c756465 	0x6c756465
+   35d1c:	632e7265 	0x632e7265
+   35d20:	00000000 	sll	zero,zero,0x0
+   35d24:	494e4150 	0x494e4150
+   35d28:	74612043 	jalx	184810c <kheader+0x17c510c>
+   35d2c:	6e696c20 	0x6e696c20
+   35d30:	25203a65 	addiu	zero,t1,14949
+   35d34:	66202c64 	0x66202c64
+   35d38:	3a656c69 	xori	a1,s3,0x6c69
+   35d3c:	20732520 	addi	s3,v1,9504
+   35d40:	534d202c 	beql	k0,t5,3ddf4 <clusters_tbl+0x454>
+   35d44:	5b203a47 	blezl	t9,44664 <clusters_tbl+0x6cc4>
+   35d48:	205d6425 	addi	sp,v0,25637
+   35d4c:	20656854 	addi	a1,v1,26708
+   35d50:	6e72656b 	0x6e72656b
+   35d54:	73206c65 	0x73206c65
+   35d58:	6b636174 	0x6b636174
+   35d5c:	20666f20 	addi	a2,v1,28448
+   35d60:	65726874 	0x65726874
+   35d64:	25206461 	addiu	zero,t1,25697
+   35d68:	6e6f2078 	0x6e6f2078
+   35d6c:	55504320 	bnel	t2,s0,469f0 <clusters_tbl+0x9050>
+   35d70:	20642520 	addi	a0,v1,9504
+   35d74:	20736168 	addi	s3,v1,24936
+   35d78:	7265766f 	0x7265766f
+   35d7c:	776f6c66 	jalx	dbdb198 <kheader+0xdb58198>
+   35d80:	3f206465 	0x3f206465
+   35d84:	00000a21 	0xa21
+   35d88:	65686353 	0x65686353
+   35d8c:	62642d64 	0x62642d64
+   35d90:	00000000 	sll	zero,zero,0x0
+   35d94:	65686373 	0x65686373
+   35d98:	656c7564 	0x656c7564
+   35d9c:	00000000 	sll	zero,zero,0x0
+   35da0:	4f464e49 	c3	0x1464e49
+   35da4:	7325203a 	0x7325203a
+   35da8:	6373203a 	0x6373203a
+   35dac:	2065706f 	addi	a1,v1,28783
+   35db0:	202c6425 	addi	t4,at,25637
+   35db4:	20646974 	addi	a0,v1,26996
+   35db8:	202c7825 	addi	t4,at,30757
+   35dbc:	206d6573 	addi	t5,v1,25971
+   35dc0:	202c7825 	addi	t4,at,30757
+   35dc4:	3a727265 	xori	s2,s3,0x7265
+   35dc8:	45444520 	0x45444520
+   35dcc:	4b4c4441 	c2	0x14c4441
+   35dd0:	0000000a 	movz	zero,zero,zero
+   35dd4:	4f464e49 	c3	0x1464e49
+   35dd8:	7325203a 	0x7325203a
+   35ddc:	6373203a 	0x6373203a
+   35de0:	2065706f 	addi	a1,v1,28783
+   35de4:	202c6425 	addi	t4,at,25637
+   35de8:	20646974 	addi	a0,v1,26996
+   35dec:	202c7825 	addi	t4,at,30757
+   35df0:	206d6573 	addi	t5,v1,25971
+   35df4:	203a7825 	addi	k0,at,30757
+   35df8:	656c6c69 	0x656c6c69
+   35dfc:	206c6167 	addi	t4,v1,24935
+   35e00:	7265706f 	0x7265706f
+   35e04:	6f697461 	0x6f697461
+   35e08:	00000a6e 	0xa6e
+   35e0c:	4f464e49 	c3	0x1464e49
+   35e10:	7325203a 	0x7325203a
+   35e14:	6373203a 	0x6373203a
+   35e18:	2065706f 	addi	a1,v1,28783
+   35e1c:	202c6425 	addi	t4,at,25637
+   35e20:	20646974 	addi	a0,v1,26996
+   35e24:	202c7825 	addi	t4,at,30757
+   35e28:	206d6573 	addi	t5,v1,25971
+   35e2c:	202c7825 	addi	t4,at,30757
+   35e30:	3a727265 	xori	s2,s3,0x7265
+   35e34:	45444520 	0x45444520
+   35e38:	4b4c4441 	c2	0x14c4441
+   35e3c:	00000000 	sll	zero,zero,0x0
+   35e40:	616d6553 	0x616d6553
+   35e44:	726f6870 	0x726f6870
+   35e48:	79532065 	0x79532065
+   35e4c:	0000636e 	0x636e
+   35e50:	5f6d6573 	0x5f6d6573
+   35e54:	77797274 	jalx	de5c9d0 <kheader+0xddd99d0>
+   35e58:	00746961 	0x746961
+   35e5c:	5f6d6573 	0x5f6d6573
+   35e60:	74736f70 	jalx	1cdbdc0 <kheader+0x1c58dc0>
+   35e64:	00000000 	sll	zero,zero,0x0
+   35e68:	5f6d6573 	0x5f6d6573
+   35e6c:	74696177 	jalx	1a585dc <kheader+0x19d55dc>
+   35e70:	00000000 	sll	zero,zero,0x0
+   35e74:	203a7325 	addi	k0,at,29477
+   35e78:	72656874 	0x72656874
+   35e7c:	73692065 	0x73692065
+   35e80:	206f6e20 	addi	t7,v1,28192
+   35e84:	636f7270 	0x636f7270
+   35e88:	20737365 	addi	s3,v1,29541
+   35e8c:	68746977 	0x68746977
+   35e90:	64697020 	0x64697020
+   35e94:	0a752520 	j	9d49480 <kheader+0x9cc6480>
+   35e98:	00000000 	sll	zero,zero,0x0
+   35e9c:	4f464e49 	c3	0x1464e49
+   35ea0:	6552203a 	0x6552203a
+   35ea4:	76656963 	jalx	995a58c <kheader+0x98d758c>
+   35ea8:	73206465 	0x73206465
+   35eac:	616e6769 	0x616e6769
+   35eb0:	6425206c 	0x6425206c
+   35eb4:	6970202c 	0x6970202c
+   35eb8:	64252064 	0x64252064
+   35ebc:	6974202c 	0x6974202c
+   35ec0:	78252064 	0x78252064
+   35ec4:	6f63202c 	0x6f63202c
+   35ec8:	25206572 	addiu	zero,t1,25970
+   35ecc:	5b202064 	blezl	t9,3e060 <clusters_tbl+0x6c0>
+   35ed0:	4c494b20 	0x4c494b20
+   35ed4:	2044454c 	addi	a0,v0,17740
+   35ed8:	00000a5d 	0xa5d
+   35edc:	6e676973 	0x6e676973
+   35ee0:	725f6c61 	0x725f6c61
+   35ee4:	00657369 	0x657369
+   35ee8:	6e72656b 	0x6e72656b
+   35eec:	6970732f 	0x6970732f
+   35ef0:	636f6c6e 	0x636f6c6e
+   35ef4:	00632e6b 	0x632e6b
+   35ef8:	204d434b 	addi	t5,v0,17227
+   35efc:	72726142 	0x72726142
+   35f00:	00726569 	0x726569
+   35f04:	20727375 	addi	s2,v1,29557
+   35f08:	72726162 	0x72726162
+   35f0c:	20726569 	addi	s2,v1,25961
+   35f10:	00727470 	tge	v1,s2,0x1d1
+   35f14:	52524142 	beql	s2,s2,46420 <clusters_tbl+0x8a80>
+   35f18:	5f524549 	0x5f524549
+   35f1c:	00004449 	0x4449
+   35f20:	204d434b 	addi	t5,v0,17227
+   35f24:	646e6f43 	0x646e6f43
+   35f28:	6f697469 	0x6f697469
+   35f2c:	6156206e 	0x6156206e
+   35f30:	62616972 	0x62616972
+   35f34:	0000656c 	0x656c
+   35f38:	444e4f43 	0x444e4f43
+   35f3c:	5241565f 	beql	s2,at,4b8bc <cluster_manager+0x4b0c>
+   35f40:	0044495f 	0x44495f
+   35f44:	20727375 	addi	s2,v1,29557
+   35f48:	70207663 	0x70207663
+   35f4c:	00007274 	teq	zero,zero,0x1c9
+   35f50:	20727375 	addi	s2,v1,29557
+   35f54:	206d6573 	addi	t5,v1,25971
+   35f58:	00727470 	tge	v1,s2,0x1d1
+   35f5c:	414d4553 	0x414d4553
+   35f60:	524f4850 	beql	s2,t7,480a4 <cluster_manager+0x12f4>
+   35f64:	44495f45 	0x44495f45
+   35f68:	00000000 	sll	zero,zero,0x0
+   35f6c:	00013870 	tge	zero,at,0xe1
+   35f70:	000137c8 	0x137c8
+   35f74:	000137a8 	0x137a8
+   35f78:	00013788 	0x13788
+   35f7c:	000138e0 	0x138e0
+   35f80:	43535953 	c0	0x1535953
+   35f84:	00464e4f 	0x464e4f
+   35f88:	53554c43 	beql	k0,s5,49098 <cluster_manager+0x22e8>
+   35f8c:	5f524554 	0x5f524554
+   35f90:	4e4c4e4f 	c3	0x4c4e4f
+   35f94:	20524e5f 	addi	s2,v0,20063
+   35f98:	430a6425 	c0	0x10a6425
+   35f9c:	4f5f5550 	c3	0x15f5550
+   35fa0:	5f4e4c4e 	0x5f4e4c4e
+   35fa4:	2520524e 	addiu	zero,t1,21070
+   35fa8:	50430a64 	beql	v0,v1,3893c <ramfs_m_op+0x1100>
+   35fac:	41435f55 	0x41435f55
+   35fb0:	5f454843 	0x5f454843
+   35fb4:	454e494c 	0x454e494c
+   35fb8:	5a49535f 	0x5a49535f
+   35fbc:	64252045 	0x64252045
+   35fc0:	4741500a 	c1	0x141500a
+   35fc4:	49535f45 	0x49535f45
+   35fc8:	2520455a 	addiu	zero,t1,17754
+   35fcc:	45480a64 	0x45480a64
+   35fd0:	4d5f5041 	0x4d5f5041
+   35fd4:	535f5841 	beql	k0,ra,4c0dc <cluster_manager+0x532c>
+   35fd8:	20455a49 	addi	a1,v0,23113
+   35fdc:	000a6425 	0xa6425
+   35fe0:	204d434b 	addi	t5,v0,17227
+   35fe4:	2d766544 	sltiu	s6,t3,25924
+   35fe8:	75716552 	jalx	5c59548 <kheader+0x5bd6548>
+   35fec:	00747365 	0x747365
+   35ff0:	4f525245 	c3	0x1525245
+   35ff4:	64203a52 	0x64203a52
+   35ff8:	615f616d 	0x615f616d
+   35ffc:	636e7973 	0x636e7973
+   36000:	7165725f 	0x7165725f
+   36004:	74736575 	jalx	1cd95d4 <kheader+0x1c565d4>
+   36008:	6576655f 	0x6576655f
+   3600c:	203a746e 	addi	k0,at,29806
+   36010:	20414d44 	addi	at,v0,19780
+   36014:	6e617274 	0x6e617274
+   36018:	72616673 	0x72616673
+   3601c:	73692065 	0x73692065
+   36020:	746f6e20 	jalx	1bdb880 <kheader+0x1b58880>
+   36024:	6c657720 	0x6c657720
+   36028:	6f63206c 	0x6f63206c
+   3602c:	656c706d 	0x656c706d
+   36030:	2c646574 	sltiu	a0,v1,25972
+   36034:	6d657220 	0x6d657220
+   36038:	696e6961 	0x696e6961
+   3603c:	2520676e 	addiu	zero,t1,26478
+   36040:	00000a64 	0xa64
+   36044:	4f464e49 	c3	0x1464e49
+   36048:	7325203a 	0x7325203a
+   3604c:	7563203a 	jalx	58c80e8 <kheader+0x58450e8>
+   36050:	6e657272 	0x6e657272
+   36054:	61742074 	0x61742074
+   36058:	28206b73 	slti	zero,at,27507
+   3605c:	20646970 	addi	a0,v1,26992
+   36060:	20296425 	addi	t1,at,25637
+   36064:	20736168 	addi	s3,v1,24936
+   36068:	65726f6d 	0x65726f6d
+   3606c:	61687420 	0x61687420
+   36070:	2031206e 	addi	s1,at,8302
+   36074:	65726874 	0x65726874
+   36078:	21206461 	addi	zero,t1,25697
+   3607c:	0000000a 	movz	zero,zero,zero
+   36080:	203a7325 	addi	k0,at,29477
+   36084:	6f727265 	0x6f727265
+   36088:	75252072 	jalx	49481c8 <kheader+0x48c51c8>
+   3608c:	72756420 	0x72756420
+   36090:	20676e69 	addi	a3,v1,28265
+   36094:	63657865 	0x63657865
+   36098:	43505220 	wait	0x54148
+   3609c:	0000000a 	movz	zero,zero,zero
+   360a0:	5f737973 	0x5f737973
+   360a4:	63657865 	0x63657865
+   360a8:	00000000 	sll	zero,zero,0x0
+   360ac:	4e524157 	c3	0x524157
+   360b0:	3a474e49 	xori	a3,s2,0x4e49
+   360b4:	3a732520 	xori	s3,s3,0x2520
+   360b8:	73656420 	0x73656420
+   360bc:	796f7274 	0x796f7274
+   360c0:	69686320 	0x69686320
+   360c4:	7420646c 	jalx	8191b0 <kheader+0x7961b0>
+   360c8:	61657268 	0x61657268
+   360cc:	00000a64 	0xa64
+   360d0:	4e524157 	c3	0x524157
+   360d4:	3a474e49 	xori	a3,s2,0x4e49
+   360d8:	3a732520 	xori	s3,s3,0x2520
+   360dc:	73656420 	0x73656420
+   360e0:	796f7274 	0x796f7274
+   360e4:	69686320 	0x69686320
+   360e8:	7420646c 	jalx	8191b0 <kheader+0x7961b0>
+   360ec:	0a6b7361 	j	9adcd84 <kheader+0x9a59d84>
+   360f0:	00000000 	sll	zero,zero,0x0
+   360f4:	4e524157 	c3	0x524157
+   360f8:	3a474e49 	xori	a3,s2,0x4e49
+   360fc:	3a732520 	xori	s3,s3,0x2520
+   36100:	726f6620 	0x726f6620
+   36104:	7265206b 	0x7265206b
+   36108:	64252072 	0x64252072
+   3610c:	64255b20 	0x64255b20
+   36110:	00000a5d 	0xa5d
+   36114:	4e524157 	c3	0x524157
+   36118:	3a474e49 	xori	a3,s2,0x4e49
+   3611c:	3a732520 	xori	s3,s3,0x2520
+   36120:	524f4620 	beql	s2,t7,479a4 <cluster_manager+0xbf4>
+   36124:	6166204b 	0x6166204b
+   36128:	64656c69 	0x64656c69
+   3612c:	0000000a 	movz	zero,zero,zero
+   36130:	5f737973 	0x5f737973
+   36134:	6b726f66 	0x6b726f66
+   36138:	00000000 	sll	zero,zero,0x0
+   3613c:	665f6f64 	0x665f6f64
+   36140:	006b726f 	0x6b726f
+   36144:	20727375 	addi	s2,v1,29557
+   36148:	20647763 	addi	a0,v1,30563
+   3614c:	66667562 	0x66667562
+   36150:	00007265 	0x7265
+   36154:	203a7325 	addi	k0,at,29477
+   36158:	20646963 	addi	a0,v1,26979
+   3615c:	202c6425 	addi	t4,at,25637
+   36160:	25207863 	addiu	zero,t1,30819
+   36164:	63202c64 	0x63202c64
+   36168:	64252079 	0x64252079
+   3616c:	7a63202c 	0x7a63202c
+   36170:	0a642520 	j	9909480 <kheader+0x9886480>
+   36174:	00000000 	sll	zero,zero,0x0
+   36178:	203a7325 	addi	k0,at,29477
+   3617c:	6f727265 	0x6f727265
+   36180:	6f632072 	0x6f632072
+   36184:	6e697970 	0x6e697970
+   36188:	65722067 	0x65722067
+   3618c:	746c7573 	jalx	1b1d5cc <kheader+0x1a9a5cc>
+   36190:	206f7420 	addi	t7,v1,29728
+   36194:	72657375 	0x72657375
+   36198:	646e616c 	0x646e616c
+   3619c:	7265202c 	0x7265202c
+   361a0:	64252072 	0x64252072
+   361a4:	0000000a 	movz	zero,zero,zero
+   361a8:	55424544 	bnel	t2,v0,476bc <cluster_manager+0x90c>
+   361ac:	25203a47 	addiu	zero,t1,14919
+   361b0:	63203a73 	0x63203a73
+   361b4:	25207570 	addiu	zero,t1,30064
+   361b8:	74202c64 	jalx	80b190 <kheader+0x788190>
+   361bc:	25206469 	addiu	zero,t1,25705
+   361c0:	76202c78 	jalx	880b1e0 <kheader+0x87881e0>
+   361c4:	72646461 	0x72646461
+   361c8:	2c782520 	sltiu	t8,v1,9504
+   361cc:	72726520 	0x72726520
+   361d0:	0a642520 	j	9909480 <kheader+0x9886480>
+   361d4:	00000000 	sll	zero,zero,0x0
+   361d8:	5f737973 	0x5f737973
+   361dc:	746e636d 	jalx	1b98db4 <kheader+0x1b15db4>
+   361e0:	0000006c 	0x6c
+   361e4:	203a7325 	addi	k0,at,29477
+   361e8:	6c696166 	0x6c696166
+   361ec:	202c6465 	addi	t4,at,25701
+   361f0:	79706f63 	0x79706f63
+   361f4:	20676e69 	addi	a3,v1,28265
+   361f8:	6d6f7266 	0x6d6f7266
+   361fc:	70737520 	0x70737520
+   36200:	20656361 	addi	a1,v1,25441
+   36204:	0a782540 	j	9e09500 <kheader+0x9d86500>
+   36208:	00000000 	sll	zero,zero,0x0
+   3620c:	203a7325 	addi	k0,at,29477
+   36210:	6c696166 	0x6c696166
+   36214:	202c6465 	addi	t4,at,25701
+   36218:	64206577 	0x64206577
+   3621c:	74276e6f 	jalx	9db9bc <kheader+0x9589bc>
+   36220:	6b696c20 	0x6b696c20
+   36224:	6c662065 	0x6c662065
+   36228:	20736761 	addi	s3,v1,26465
+   3622c:	29782528 	slti	t8,t3,9512
+   36230:	656c202c 	0x656c202c
+   36234:	6874676e 	0x6874676e
+   36238:	64252820 	0x64252820
+   3623c:	6f202c29 	0x6f202c29
+   36240:	64612072 	0x64612072
+   36244:	28207264 	slti	zero,at,29284
+   36248:	0a297825 	j	8a5e094 <kheader+0x89db094>
+   3624c:	00000000 	sll	zero,zero,0x0
+   36250:	203a7325 	addi	k0,at,29477
+   36254:	6c696166 	0x6c696166
+   36258:	202c6465 	addi	t4,at,25701
+   3625c:	20646162 	addi	a0,v1,24930
+   36260:	656c6966 	0x656c6966
+   36264:	73656420 	0x73656420
+   36268:	70697263 	0x70697263
+   3626c:	20726f74 	addi	s2,v1,28532
+   36270:	29642528 	slti	a0,t3,9512
+   36274:	0000000a 	movz	zero,zero,zero
+   36278:	203a7325 	addi	k0,at,29477
+   3627c:	6c696166 	0x6c696166
+   36280:	202c6465 	addi	t4,at,25701
+   36284:	7366666f 	0x7366666f
+   36288:	28207465 	slti	zero,at,29797
+   3628c:	20296425 	addi	t1,at,25637
+   36290:	656c202b 	0x656c202b
+   36294:	2528206e 	addiu	t0,t1,8302
+   36298:	3e202964 	0x3e202964
+   3629c:	6966203d 	0x6966203d
+   362a0:	7327656c 	0x7327656c
+   362a4:	7a697320 	0x7a697320
+   362a8:	25282065 	addiu	t0,t1,8293
+   362ac:	000a2964 	0xa2964
+   362b0:	203a7325 	addi	k0,at,29477
+   362b4:	6c696166 	0x6c696166
+   362b8:	202c6465 	addi	t4,at,25701
+   362bc:	43434145 	c0	0x1434145
+   362c0:	70205345 	0x70205345
+   362c4:	20746f72 	addi	s4,v1,28530
+   362c8:	29782528 	slti	t8,t3,9512
+   362cc:	5f66202c 	0x5f66202c
+   362d0:	67616c66 	0x67616c66
+   362d4:	25282073 	addiu	t0,t1,8307
+   362d8:	000a2978 	0xa2978
+   362dc:	203a7325 	addi	k0,at,29477
+   362e0:	6c696146 	0x6c696146
+   362e4:	202c6465 	addi	t4,at,25701
+   362e8:	706f7244 	0x706f7244
+   362ec:	20676e69 	addi	a3,v1,28265
+   362f0:	656c6966 	0x656c6966
+   362f4:	756f6320 	jalx	5bd8c80 <kheader+0x5b55c80>
+   362f8:	0a20746e 	j	881d1b8 <kheader+0x879a1b8>
+   362fc:	00000000 	sll	zero,zero,0x0
+   36300:	5f737973 	0x5f737973
+   36304:	70616d6d 	0x70616d6d
+   36308:	00000000 	sll	zero,zero,0x0
+   3630c:	203a7325 	addi	k0,at,29477
+   36310:	73756c63 	0x73756c63
+   36314:	20726574 	addi	s2,v1,25972
+   36318:	63207525 	0x63207525
+   3631c:	74276e61 	jalx	9db984 <kheader+0x958984>
+   36320:	65786520 	0x65786520
+   36324:	65747563 	0x65747563
+   36328:	69687420 	0x69687420
+   3632c:	75662073 	jalx	59881cc <kheader+0x59051cc>
+   36330:	6974636e 	0x6974636e
+   36334:	6f206e6f 	0x6f206e6f
+   36338:	6572206e 	0x6572206e
+   3633c:	65746f6d 	0x65746f6d
+   36340:	73617420 	0x73617420
+   36344:	7028206b 	0x7028206b
+   36348:	25206469 	addiu	zero,t1,25705
+   3634c:	6e6f2075 	0x6e6f2075
+   36350:	756c6320 	jalx	5b18c80 <kheader+0x5a95c80>
+   36354:	72657473 	0x72657473
+   36358:	29752520 	slti	s5,t3,9504
+   3635c:	0000000a 	movz	zero,zero,zero
+   36360:	4f464e49 	c3	0x1464e49
+   36364:	6970203a 	0x6970203a
+   36368:	64252064 	0x64252064
+   3636c:	6974202c 	0x6974202c
+   36370:	78252064 	0x78252064
+   36374:	7274202c 	0x7274202c
+   36378:	6e696361 	0x6e696361
+   3637c:	73692067 	0x73692067
+   36380:	72757420 	0x72757420
+   36384:	2064656e 	addi	a0,v1,25966
+   36388:	46464f5b 	c1	0x464f5b
+   3638c:	00000a5d 	0xa5d
+   36390:	4f464e49 	c3	0x1464e49
+   36394:	6970203a 	0x6970203a
+   36398:	64252064 	0x64252064
+   3639c:	6974202c 	0x6974202c
+   363a0:	78252064 	0x78252064
+   363a4:	7274202c 	0x7274202c
+   363a8:	6e696361 	0x6e696361
+   363ac:	73692067 	0x73692067
+   363b0:	72757420 	0x72757420
+   363b4:	2064656e 	addi	a0,v1,25966
+   363b8:	5d4e4f5b 	0x5d4e4f5b
+   363bc:	0000000a 	movz	zero,zero,zero
+   363c0:	5f737973 	0x5f737973
+   363c4:	635f7370 	0x635f7370
+   363c8:	6b636568 	0x6b636568
+   363cc:	7268745f 	0x7268745f
+   363d0:	00646165 	0x646165
+   363d4:	4f464e49 	c3	0x1464e49
+   363d8:	7973203a 	0x7973203a
+   363dc:	65725f73 	0x65725f73
+   363e0:	203a6461 	addi	k0,at,25697
+   363e4:	6f727245 	0x6f727245
+   363e8:	64252072 	0x64252072
+   363ec:	0000000a 	movz	zero,zero,zero
+   363f0:	204d434b 	addi	t5,v0,17227
+   363f4:	4f4c5752 	c3	0x14c5752
+   363f8:	00004b43 	sra	t1,zero,0xd
+   363fc:	4f4c5752 	c3	0x14c5752
+   36400:	495f4b43 	0x495f4b43
+   36404:	00000044 	0x44
+   36408:	20727375 	addi	s2,v1,29557
+   3640c:	6f6c7772 	0x6f6c7772
+   36410:	70206b63 	0x70206b63
+   36414:	00007274 	teq	zero,zero,0x1c9
+   36418:	000169cc 	syscall	0x5a7
+   3641c:	000169ac 	0x169ac
+   36420:	0001698c 	syscall	0x5a6
+   36424:	0001696c 	0x1696c
+   36428:	0001694c 	syscall	0x5a5
+   3642c:	000168ec 	0x168ec
+   36430:	0001690c 	syscall	0x5a4
+   36434:	204d434b 	addi	t5,v0,17227
+   36438:	616d6553 	0x616d6553
+   3643c:	726f6870 	0x726f6870
+   36440:	00000065 	0x65
+   36444:	20727375 	addi	s2,v1,29557
+   36448:	206d6573 	addi	t5,v1,25971
+   3644c:	0000706f 	0x706f
+   36450:	20727375 	addi	s2,v1,29557
+   36454:	206d6573 	addi	t5,v1,25971
+   36458:	006c6176 	tne	v1,t4,0x185
+   3645c:	00016d50 	0x16d50
+   36460:	00016cb0 	tge	zero,at,0x1b2
+   36464:	00016c4c 	syscall	0x5b1
+   36468:	00016bf0 	tge	zero,at,0x1af
+   3646c:	00016b6c 	0x16b6c
+   36470:	00016e00 	sll	t5,at,0x18
+   36474:	6f727265 	0x6f727265
+   36478:	72632072 	0x72632072
+   3647c:	69746165 	0x69746165
+   36480:	7220676e 	0x7220676e
+   36484:	746f6d65 	jalx	1bdb594 <kheader+0x1b58594>
+   36488:	68742065 	0x68742065
+   3648c:	64616572 	0x64616572
+   36490:	206e6f20 	addi	t6,v1,28448
+   36494:	000a6425 	0xa6425
+   36498:	6e72656b 	0x6e72656b
+   3649c:	7379732f 	0x7379732f
+   364a0:	7268745f 	0x7268745f
+   364a4:	5f646165 	0x5f646165
+   364a8:	74697865 	jalx	1a5e194 <kheader+0x19db194>
+   364ac:	0000632e 	0x632e
+   364b0:	203a7325 	addi	k0,at,29477
+   364b4:	20757063 	addi	s5,v1,28771
+   364b8:	202c6425 	addi	t4,at,25637
+   364bc:	20646970 	addi	a0,v1,26992
+   364c0:	202c6425 	addi	t4,at,25637
+   364c4:	20646974 	addi	a0,v1,26996
+   364c8:	202c6425 	addi	t4,at,25637
+   364cc:	656b7361 	0x656b7361
+   364d0:	6f742064 	0x6f742064
+   364d4:	206f6720 	addi	t7,v1,26400
+   364d8:	65656c73 	0x65656c73
+   364dc:	255b2070 	addiu	k1,t2,8304
+   364e0:	000a5d64 	0xa5d64
+   364e4:	203a7325 	addi	k0,at,29477
+   364e8:	20757063 	addi	s5,v1,28771
+   364ec:	202c6425 	addi	t4,at,25637
+   364f0:	20646970 	addi	a0,v1,26992
+   364f4:	202c6425 	addi	t4,at,25637
+   364f8:	20646974 	addi	a0,v1,26996
+   364fc:	202c6425 	addi	t4,at,25637
+   36500:	75736572 	jalx	5cd95c8 <kheader+0x5c565c8>
+   36504:	676e696d 	0x676e696d
+   36508:	64255b20 	0x64255b20
+   3650c:	00000a5d 	0xa5d
+   36510:	5f737973 	0x5f737973
+   36514:	65726874 	0x65726874
+   36518:	735f6461 	0x735f6461
+   3651c:	7065656c 	0x7065656c
+   36520:	00000000 	sll	zero,zero,0x0
+   36524:	203a7325 	addi	k0,at,29477
+   36528:	20646974 	addi	a0,v1,26996
+   3652c:	2d206425 	sltiu	zero,t1,25637
+   36530:	74203e2d 	jalx	80f8b4 <kheader+0x78c8b4>
+   36534:	25206469 	addiu	zero,t1,25705
+   36538:	255b2064 	addiu	k1,t2,8292
+   3653c:	255b5d64 	addiu	k1,t2,23908
+   36540:	000a5d64 	0xa5d64
+   36544:	203a7325 	addi	k0,at,29477
+   36548:	20757063 	addi	s5,v1,28771
+   3654c:	202c6425 	addi	t4,at,25637
+   36550:	20646970 	addi	a0,v1,26992
+   36554:	202c6425 	addi	t4,at,25637
+   36558:	20646974 	addi	a0,v1,26996
+   3655c:	202c7825 	addi	t4,at,30757
+   36560:	64252069 	0x64252069
+   36564:	6f63202c 	0x6f63202c
+   36568:	20746e75 	addi	s4,v1,28277
+   3656c:	202c6425 	addi	t4,at,25637
+   36570:	64697474 	0x64697474
+   36574:	2c782520 	sltiu	t8,v1,9504
+   36578:	71657220 	0x71657220
+   3657c:	74736575 	jalx	1cd95d4 <kheader+0x1c565d4>
+   36580:	73616820 	clz	t5 or at,k1
+   36584:	69616620 	0x69616620
+   36588:	2064656c 	addi	a0,v1,25964
+   3658c:	68746977 	0x68746977
+   36590:	72726520 	0x72726520
+   36594:	20642520 	addi	a0,v1,9504
+   36598:	5d64255b 	0x5d64255b
+   3659c:	0000000a 	movz	zero,zero,zero
+   365a0:	5f737973 	0x5f737973
+   365a4:	65726874 	0x65726874
+   365a8:	775f6461 	jalx	d7d9184 <kheader+0xd756184>
+   365ac:	75656b61 	jalx	595ad84 <kheader+0x58d7d84>
+   365b0:	00000070 	tge	zero,zero,0x1
+   365b4:	204d434b 	addi	t5,v0,17227
+   365b8:	6b736154 	0x6b736154
+   365bc:	00000000 	sll	zero,zero,0x0
+   365c0:	204d434b 	addi	t5,v0,17227
+   365c4:	4e494446 	c3	0x494446
+   365c8:	00004f46 	0x4f46
+   365cc:	6b736154 	0x6b736154
+   365d0:	73444620 	0x73444620
+   365d4:	00000000 	sll	zero,zero,0x0
+   365d8:	6b736154 	0x6b736154
+   365dc:	72687420 	0x72687420
+   365e0:	73646165 	0x73646165
+   365e4:	00000000 	sll	zero,zero,0x0
+   365e8:	6b736154 	0x6b736154
+   365ec:	6d695420 	0x6d695420
+   365f0:	00000065 	0x65
+   365f4:	20656854 	addi	a1,v1,26708
+   365f8:	74206466 	jalx	819198 <kheader+0x796198>
+   365fc:	656c6261 	0x656c6261
+   36600:	20736920 	addi	s3,v1,26912
+   36604:	6c6c7566 	0x6c6c7566
+   36608:	616d202c 	0x616d202c
+   3660c:	73692078 	0x73692078
+   36610:	74657320 	jalx	195cc80 <kheader+0x18d9c80>
+   36614:	206f7420 	addi	t7,v1,29728
+   36618:	000a6425 	0xa6425
+   3661c:	6b736154 	0x6b736154
+   36620:	674d2073 	0x674d2073
+   36624:	00000072 	tlt	zero,zero,0x1
+   36628:	4f525245 	c3	0x1525245
+   3662c:	25203a52 	addiu	zero,t1,14930
+   36630:	46203a73 	c1	0x203a73
+   36634:	656c6961 	0x656c6961
+   36638:	65202c64 	0x65202c64
+   3663c:	25207272 	addiu	zero,t1,29298
+   36640:	00000a64 	0xa64
+   36644:	4e524157 	c3	0x524157
+   36648:	3a474e49 	xori	a3,s2,0x4e49
+   3664c:	3a732520 	xori	s3,s3,0x2520
+   36650:	726f6320 	0x726f6320
+   36654:	64252065 	0x64252065
+   36658:	6970202c 	0x6970202c
+   3665c:	64252064 	0x64252064
+   36660:	6974202c 	0x6974202c
+   36664:	64252064 	0x64252064
+   36668:	6d76202c 	0x6d76202c
+   3666c:	78302061 	0x78302061
+   36670:	202c7825 	addi	t4,at,30757
+   36674:	20727265 	addi	s2,v1,29285
+   36678:	202c6425 	addi	t4,at,25637
+   3667c:	72747461 	0x72747461
+   36680:	25783020 	addiu	t8,t3,12320
+   36684:	70202c78 	0x70202c78
+   36688:	30206e70 	andi	zero,at,0x6e70
+   3668c:	0a782578 	j	9e095e0 <kheader+0x9d865e0>
+   36690:	00000000 	sll	zero,zero,0x0
+   36694:	494e4150 	0x494e4150
+   36698:	74612043 	jalx	184810c <kheader+0x17c510c>
+   3669c:	6e696c20 	0x6e696c20
+   366a0:	25203a65 	addiu	zero,t1,14949
+   366a4:	66202c64 	0x66202c64
+   366a8:	3a656c69 	xori	a1,s3,0x6c69
+   366ac:	20732520 	addi	s3,v1,9504
+   366b0:	534d202c 	beql	k0,t5,3e764 <clusters_tbl+0xdc4>
+   366b4:	46203a47 	neg.d	$f9,$f7
+   366b8:	656c6961 	0x656c6961
+   366bc:	6f742064 	0x6f742064
+   366c0:	6c6c6120 	0x6c6c6120
+   366c4:	7461636f 	jalx	1858dbc <kheader+0x17d5dbc>
+   366c8:	61742065 	0x61742065
+   366cc:	27736b73 	addiu	s3,k1,27507
+   366d0:	6e616d20 	0x6e616d20
+   366d4:	72656761 	0x72656761
+   366d8:	73616820 	clz	t5 or at,k1
+   366dc:	61742068 	0x61742068
+   366e0:	20656c62 	addi	a1,v1,27746
+   366e4:	000a0a21 	0xa0a21
+   366e8:	6e72656b 	0x6e72656b
+   366ec:	7361742f 	0x7361742f
+   366f0:	00632e6b 	0x632e6b
+   366f4:	494e4150 	0x494e4150
+   366f8:	74612043 	jalx	184810c <kheader+0x17c510c>
+   366fc:	6e696c20 	0x6e696c20
+   36700:	25203a65 	addiu	zero,t1,14949
+   36704:	66202c64 	0x66202c64
+   36708:	3a656c69 	xori	a1,s3,0x6c69
+   3670c:	20732520 	addi	s3,v1,9504
+   36710:	534d202c 	beql	k0,t5,3e7c4 <clusters_tbl+0xe24>
+   36714:	46203a47 	neg.d	$f9,$f7
+   36718:	656c6961 	0x656c6961
+   3671c:	6f742064 	0x6f742064
+   36720:	696e6920 	0x696e6920
+   36724:	6c616974 	0x6c616974
+   36728:	20657a69 	addi	a1,v1,31337
+   3672c:	6b736174 	0x6b736174
+   36730:	6d202773 	0x6d202773
+   36734:	67616e61 	0x67616e61
+   36738:	68207265 	0x68207265
+   3673c:	20687361 	addi	t0,v1,29537
+   36740:	6c626174 	0x6c626174
+   36744:	0a212065 	j	8848194 <kheader+0x87c5194>
+   36748:	0000000a 	movz	zero,zero,zero
+   3674c:	4e524157 	c3	0x524157
+   36750:	3a474e49 	xori	a3,s2,0x4e49
+   36754:	3a732520 	xori	s3,s3,0x2520
+   36758:	756c6320 	jalx	5b18c80 <kheader+0x5a95c80>
+   3675c:	72657473 	0x72657473
+   36760:	20752520 	addi	s5,v1,9504
+   36764:	6f207369 	0x6f207369
+   36768:	6f207475 	0x6f207475
+   3676c:	49502066 	0x49502066
+   36770:	000a7344 	0xa7344
+   36774:	203a7325 	addi	k0,at,29477
+   36778:	6b736174 	0x6b736174
+   3677c:	20752520 	addi	s5,v1,9504
+   36780:	20736168 	addi	s3,v1,24936
+   36784:	20746f6e 	addi	s4,v1,28526
+   36788:	736f6c63 	0x736f6c63
+   3678c:	61206465 	0x61206465
+   36790:	6f206c6c 	0x6f206c6c
+   36794:	656e6570 	0x656e6570
+   36798:	69662064 	0x69662064
+   3679c:	0a73656c 	j	9cd95b0 <kheader+0x9c565b0>
+   367a0:	00000000 	sll	zero,zero,0x0
+   367a4:	6b736174 	0x6b736174
+   367a8:	7365645f 	0x7365645f
+   367ac:	796f7274 	0x796f7274
+   367b0:	00000000 	sll	zero,zero,0x0
+   367b4:	6b736174 	0x6b736174
+   367b8:	6572635f 	0x6572635f
+   367bc:	00657461 	0x657461
+   367c0:	6b736174 	0x6b736174
+   367c4:	6f6f625f 	0x6f6f625f
+   367c8:	72747374 	0x72747374
+   367cc:	665f7061 	0x665f7061
+   367d0:	6c616e69 	0x6c616e69
+   367d4:	00657a69 	0x657a69
+   367d8:	6b736174 	0x6b736174
+   367dc:	6461765f 	0x6461765f
+   367e0:	70327264 	0x70327264
+   367e4:	00006e70 	tge	zero,zero,0x1b9
+   367e8:	6e696f4a 	0x6e696f4a
+   367ec:	6978452f 	0x6978452f
+   367f0:	79532074 	0x79532074
+   367f4:	0000636e 	0x636e
+   367f8:	52435f53 	beql	s2,v1,4e548 <cluster_manager+0x7798>
+   367fc:	45544145 	0x45544145
+   36800:	00000000 	sll	zero,zero,0x0
+   36804:	53555f53 	beql	k0,s5,4e554 <cluster_manager+0x77a4>
+   36808:	00000052 	mflhxu	zero
+   3680c:	454b5f53 	0x454b5f53
+   36810:	4c454e52 	0x4c454e52
+   36814:	00000000 	sll	zero,zero,0x0
+   36818:	45525f53 	0x45525f53
+   3681c:	00594441 	0x594441
+   36820:	41575f53 	0x41575f53
+   36824:	00005449 	0x5449
+   36828:	45445f53 	0x45445f53
+   3682c:	00004441 	0x4441
+   36830:	00525355 	0x525355
+   36834:	5248544b 	beql	s2,t0,4b964 <cluster_manager+0x4bb4>
+   36838:	00444145 	0x444145
+   3683c:	454c4449 	0x454c4449
+   36840:	00000000 	sll	zero,zero,0x0
+   36844:	544f4f42 	bnel	v0,t7,4a550 <cluster_manager+0x37a0>
+   36848:	00000000 	sll	zero,zero,0x0
+   3684c:	00435052 	0x435052
+
+00036850 <thread_state_name>:
+   36850:	000367f8 00036804 0003680c 00036818     .g...h...h...h..
+   36860:	00036820 00036828                        h..(h..
+
+00036868 <thread_attr_name>:
+   36868:	00036830 00036834 0003683c 00036844     0h..4h..<h..Dh..
+   36878:	0003684c 00000000 00000000 00000000     Lh..............
+   36888:	00000000 4f464e49 7453203a 69747261     ....INFO: Starti
+   36898:	5420676e 61657268 64492064 4f20656c     ng Thread Idle O
+   368a8:	6f43206e 25206572 4b4f0964 0000000a     n Core %d.OK....
+   368b8:	494e4150 74612043 6e696c20 25203a65     PANIC at line: %
+   368c8:	66202c64 3a656c69 20732520 534d202c     d, file: %s , MS
+   368d8:	46203a47 656c6961 6f742064 65726320     G: Failed to cre
+   368e8:	20657461 61666564 20746c75 6e657665     ate default even
+   368f8:	68207374 6c646e61 54207265 61657268     ts handler Threa
+   36908:	6f662064 50432072 64252055 00000a0a     d for CPU %d....
+   36918:	6e72656b 7268742f 5f646165 656c6469     kern/thread_idle
+   36928:	0000632e 6e657645 00007374 494e4150     .c..Events..PANI
+   36938:	74612043 6e696c20 25203a65 66202c64     C at line: %d, f
+   36948:	3a656c69 20732520 534d202c 46203a47     ile: %s , MSG: F
+   36958:	656c6961 6f742064 65726320 20657461     ailed to create 
+   36968:	61666564 20746c75 20435052 646e6168     default RPC hand
+   36978:	2072656c 65726854 66206461 4320726f     ler Thread for C
+   36988:	25205550 000a0a64 4f464e49 6854203a     PU %d...INFO: Th
+   36998:	64616572 43505220 20702520 61657243     read RPC %p Crea
+   369a8:	20646574 43206e4f 2065726f 20096425     ted On Core %d. 
+   369b8:	5d75255b 0000000a 494e4150 74612043     [%u]....PANIC at
+   369c8:	6e696c20 25203a65 66202c64 3a656c69      line: %d, file:
+   369d8:	20732520 534d202c 46203a47 656c6961      %s , MSG: Faile
+   369e8:	6f742064 65726320 20657461 5346564b     d to create KVFS
+   369f8:	6e6f2044 756c6320 72657473 2c642520     D on cluster %d,
+   36a08:	75706320 0a642520 0000000a 5346564b      cpu %d.....KVFS
+   36a18:	00000044 4f464e49 766b203a 20647366     D...INFO: kvfsd 
+   36a28:	20736168 6e656562 65726320 64657461     has been created
+   36a38:	206e6f20 20757063 000a6425 4e524157      on cpu %d..WARN
+   36a48:	3a474e49 61656820 616d5f70 6567616e     ING: heap_manage
+   36a58:	616d5f72 636f6c6c 4f4e203a 524f4d20     r_malloc: NO MOR
+   36a68:	56412045 414c4941 20454c42 4f4d454d     E AVAILABLE MEMO
+   36a78:	46205952 5320524f 20455a49 000a6425     RY FOR SIZE %d..
+   36a88:	70616548 72674d20 00000000 2b2b2b2b     Heap Mgr....++++
+   36a98:	2b2b2b2b 2b2b2b2b 636b0a2b 255b206d     +++++++++.kcm [%
+   36aa8:	73205d73 65746174 00000a3a 65726609     s] state:....fre
+   36ab8:	61705f65 5f736567 2520726e 62090a64     e_pages_nr %d..b
+   36ac8:	5f797375 65676170 726e5f73 0a642520     usy_pages_nr %d.
+   36ad8:	00000000 2d2d2d2d 41090a2d 76697463     ....-----..Activ
+   36ae8:	61502065 3a736567 2d2d2d0a 000a2d2d     e Pages:.-----..
+   36af8:	666e6970 200a3a6f 72754320 746e6572     pinfo:.  Current
+   36b08:	646e695f 25207865 65520a64 756f6366     _index %d.Refcou
+   36b18:	2520746e 00000a64 2d2d2d2d 2b2b0a2d     nt %d...-----.++
+   36b28:	2b2b2b2b 2b2b2b2b 0a2b2b2b 00000000     +++++++++++.....
+   36b38:	4f525245 25203a52 66203a73 646c6961     ERROR: %s: faild
+   36b48:	206f7420 6f6c6c61 65746163 67617020      to allocate pag
+   36b58:	63202c65 25207570 63202c64 7473756c     e, cpu %d, clust
+   36b68:	25207265 00000a64 203a7325 20757063     er %d...%s: cpu 
+   36b78:	203a6425 20646970 203a6425 20646974     %d: pid %d: tid 
+   36b88:	203a7825 78656e75 74636570 73206465     %x: unexpected s
+   36b98:	20657a69 66206425 6120726f 626f206e     ize %d for an ob
+   36ba8:	7463656a 20666f20 65707974 0a732520     ject of type %s.
+   36bb8:	00000000 4e524157 3a474e49 3a732520     ....WARNING: %s:
+   36bc8:	69616620 7420646c 7263206f 65746165      faild to create
+   36bd8:	4d434b20 726f6620 6a626f20 20746365      KCM for object 
+   36be8:	656d616e 20732520 7272655b 5d642520     name %s [err %d]
+   36bf8:	0000000a 4e524157 3a474e49 3a732520     ....WARNING: %s:
+   36c08:	75706320 2c642520 64696320 2c642520      cpu %d, cid %d,
+   36c18:	64697020 2c642520 64697420 2c642520      pid %d, tid %d,
+   36c28:	69616620 2064656c 61206f74 636f6c6c      failed to alloc
+   36c38:	70797420 64252065 6973202c 2520657a      type %d, size %
+   36c48:	66202c64 7367616c 0a782520 00000000     d, flags %x.....
+   36c58:	6d656d6b 7465675f 6d636b5f 00000000     kmem_get_kcm....
+   36c68:	6d656d6b 6c6c615f 0000636f 00000000     kmem_alloc......
+   36c78:	00000000 00006e64 0000c9bc 00013c1c     ....dn.......<..
+   36c88:	0001c7b4 000185dc 00018624 000226b0     ........$....&..
+   36c98:	00022860 000254e4 00026120 000235ec     `(...T.. a...5..
+   36ca8:	00023200 0002c0b8 00029f54 0002a118     .2......T.......
+   36cb8:	0002b5e0 0002197c 00016a68 00013610     ....|...hj...6..
+   36cc8:	00012f9c 00016780 00006870 0000afec     ./...g..ph......
+   36cd8:	00027328 0001c7fc 204d434b 7070614d     (s......KCM Mapp
+   36ce8:	00007265 204d434b 7070614d 43207265     er..KCM Mapper C
+   36cf8:	0000746e 7070614d 63207265 65686361     nt..Mapper cache
+   36d08:	00000000 7070614d 4f207265 63656a62     ....Mapper Objec
+   36d18:	00000074 4f525245 25203a52 63203a73     t...ERROR: %s: c
+   36d28:	25207570 70202c64 25206469 74202c64     pu %d, pid %d, t
+   36d38:	25206469 66202c64 656c6961 6f742064     id %d, failed to
+   36d48:	736e6920 2f747265 69646f6d 6e207966      insert/modify n
+   36d58:	2c65646f 72726520 20642520 5d75255b     ode, err %d [%u]
+   36d68:	0000000a 4f525245 25203a52 63203a73     ....ERROR: %s: c
+   36d78:	25207570 70202c64 25206469 74202c64     pu %d, pid %d, t
+   36d88:	25206469 66202c64 656c6961 6f742064     id %d, failed to
+   36d98:	6c6c6120 6c2f636f 2064616f 65676170      alloc/load page
+   36da8:	6e69202c 20786564 202c6425 20727265     , index %d, err 
+   36db8:	5b206425 0a5d7525 00000000 7825205b     %d [%u].....[ %x
+   36dc8:	41205d20 72657373 70622074 66206e70      ] Assert bppn f
+   36dd8:	646c6961 696c202c 2520656e 66202c64     aild, line %d, f
+   36de8:	20656c69 202c7325 65726854 5b206461     ile %s, Thread [
+   36df8:	205d7825 43206e6f 5b205550 2c5d6425     %x] on CPU [%d],
+   36e08:	72754320 746e6572 72685420 20646165      Current Thread 
+   36e18:	5d78255b 206e6f20 20555043 5d64255b     [%x] on CPU [%d]
+   36e28:	255b202c 000a5d75 6d2f6d6d 65707061     , [%u]..mm/mappe
+   36e38:	00632e72 203b6425 203b6425 61766e49     r.c.%d; %d; Inva
+   36e48:	2064696c 65676170 756f6620 6920646e     lid page found i
+   36e58:	616d206e 72657070 2c702520 61702620     n mapper %p, &pa
+   36e68:	25206567 70202c70 20656761 202c7025     ge %p, page %p, 
+   36e78:	6425206a 6f63202c 20746e75 202c6425     j %d, count %d, 
+   36e88:	706f6f6c 0a642520 00000000 7070616d     loop %d.....mapp
+   36e98:	675f7265 705f7465 00656761 65676150     er_get_page.Page
+   36ea8:	78252820 2978252c 74737b20 20657461      (%x,%x) {state 
+   36eb8:	202c6425 67616c66 78252073 6963202c     %d, flags %x, ci
+   36ec8:	64252064 726f202c 20726564 202c6425     d %d, order %d, 
+   36ed8:	6e756f63 64252074 6e69202c 20786564     count %d, index 
+   36ee8:	202c7825 7070616d 25207265 70202c78     %x, mapper %x, p
+   36ef8:	61766972 25206574 000a7d78 4f525245     rivate %x}..ERRO
+   36f08:	25203a52 63203a73 25207570 70202c64     R: %s: cpu %d, p
+   36f18:	25206469 74202c64 25206469 70202c78     id %d, tid %x, p
+   36f28:	20656761 202c7825 74617473 78252065     age %x, state %x
+   36f38:	6f63202c 20746e75 5b206425 0a5d6425     , count %d [%d].
+   36f48:	00000000 4f525245 25203a52 55203a73     ....ERROR: %s: U
+   36f58:	6f6e6b6e 41206e77 64656b73 61745320     nknown Asked Sta
+   36f68:	25206574 00000a64 6e6b6e55 206e776f     te %d...Unknown 
+   36f78:	65676150 00000000 6f6e6b55 4d206e77     Page....Uknown M
+   36f88:	65707061 00000072 656c6946 70616d20     apper...File map
+   36f98:	00726570 4f464e49 6f4e203a 25206564     per.INFO: Node %
+   36fa8:	50202c73 20656761 20642523 78254028     s, Page #%d (@%x
+   36fb8:	61482029 65422073 46206e65 6873756c     ) Has Been Flush
+   36fc8:	54206465 6944206f 000a6b73 74726944     ed To Disk..Dirt
+   36fd8:	61502079 00736567 0001eab0 0001eb1c     y Pages.........
+   36fe8:	0001eb08 0001eba0 0001ec70 0001ecb8     ........p.......
+   36ff8:	0001ecdc 0001eb5c 65676170 5f6f745f     ....\...page_to_
+   37008:	65657266 00000000 203a7325 76697250     free....%s: Priv
+   37018:	20657461 6f636e69 7369736e 636e6574     ate inconsistenc
+   37028:	74612079 64726f20 25207265 70202c64     y at order %d, p
+   37038:	20656761 000a6425 203a7325 69676542     age %d..%s: Begi
+   37048:	6461206e 30207264 3a782578 78257830     n addr 0x%x:0x%x
+   37058:	53202c20 74726174 64646120 78302072      , Start addr 0x
+   37068:	460a7825 20656572 65676170 756e2073     %x.Free pages nu
+   37078:	7265626d 0a642520 00000000 6564724f     mber %d.....Orde
+   37088:	64252072 20200a3a 65676170 726e5f73     r %d:.  pages_nr
+   37098:	0a642520 005b2020 202c6425 00000000      %d.  [.%d, ....
+   370a8:	0a5d0808 00000000 7825205b 41205d20     ..].....[ %x ] A
+   370b8:	72657373 70282074 3d206d70 2628203d     ssert (ppm == (&
+   370c8:	72727563 5f746e65 73756c63 2d726574     current_cluster-
+   370d8:	6d70703e 66202929 646c6961 696c202c     >ppm)) faild, li
+   370e8:	2520656e 66202c64 20656c69 202c7325     ne %d, file %s, 
+   370f8:	65726854 5b206461 205d7825 43206e6f     Thread [%x] on C
+   37108:	5b205550 2c5d6425 72754320 746e6572     PU [%d], Current
+   37118:	72685420 20646165 5d78255b 206e6f20      Thread [%x] on 
+   37128:	20555043 5d64255b 255b202c 000a5d75     CPU [%d], [%u]..
+   37138:	702f6d6d 632e6d70 00000000 004d5050     mm/ppm.c....PPM.
+   37148:	204d5050 41574750 00005449 204d5050     PPM PGWAIT..PPM 
+   37158:	54494157 4c425420 00000000 5f6d7070     WAIT TBL....ppm_
+   37168:	65737361 6f5f7472 72656472 00000000     assert_order....
+   37178:	5f6d7070 6e697270 00000074 203a7325     ppm_print...%s: 
+   37188:	20646970 202c6425 6e6a626f 20656d61     pid %d, objname 
+   37198:	203a7325 6f727245 64612072 28207264     %s: Error addr (
+   371a8:	20297825 74786574 78252820 73202c29     %x) text (%x), s
+   371b8:	20657a69 29642528 696c202c 2074696d     ize (%d), limit 
+   371c8:	29782528 7963202c 73656c63 0a752520     (%x), cycles %u.
+   371d8:	00000000 203a7325 20757063 202c6425     ....%s: cpu %d, 
+   371e8:	20646970 202c6425 20646974 202c6425     pid %d, tid %d, 
+   371f8:	69676572 6e206e6f 6620746f 646e756f     region not found
+   37208:	726f6620 64617620 30207264 20782578      for vaddr 0x%x 
+   37218:	5d78255b 0000000a 4f525245 25203a52     [%x]....ERROR: %
+   37228:	50203a73 25206469 54202c64 61657268     s: Pid %d, Threa
+   37238:	78252064 5043202c 64252055 7963202c     d %x, CPU %d, cy
+   37248:	20656c63 20096425 494b205b 44454c4c     cle %d. [ KILLED
+   37258:	000a5d20                                 ]..
+
+0003725c <vm_region_default_op>:
+	...
+   37268:	00020b8c 6d765f5f 61665f6d 5f746c75     ....__vmm_fault_
+   37278:	646e6168 0072656c 0001c880 0001c878     handler.....x...
+   37288:	0001c8a0 0001c9dc 00000000 0001c870     ............p...
+   37298:	5f6d6d76 63656863 64615f6b 73657264     vmm_check_addres
+   372a8:	00000073 204d434b 52204d56 4f494745     s...KCM VM REGIO
+   372b8:	0000004e 55424544 25203a47 63203a73     N...DEBUG: %s: c
+   372c8:	25207570 70202c64 25206469 76202c64     pu %d, pid %d, v
+   372d8:	72646461 2c782520 616c6620 25207367     addr %x, flags %
+   372e8:	72202c78 6f696765 255b206e 78252c78     x, region [%x,%x
+   372f8:	00000a5d 4f464e49 7325203a 7063203a     ]...INFO: %s: cp
+   37308:	64252075 6176202c 20726464 78257830     u %d, vaddr 0x%x
+   37318:	616c6620 30207367 2c782578 6f727020      flags 0x%x, pro
+   37328:	78302074 202c7825 65646e65 69772064     t 0x%x, ended wi
+   37338:	65206874 25207272 00000a64 4f464e49     th err %d...INFO
+   37348:	7063203a 64252075 6970202c 64252064     : cpu %d, pid %d
+   37358:	6572202c 253c2067 78252c78 6573203e     , reg <%x,%x> se
+   37368:	75612074 6d2d6f74 61726769 66206574     t auto-migrate f
+   37378:	2520726f 61702064 0a736567 00000000     or %d pages.....
+   37388:	52204d56 6f696765 0000006e 725f6d76     VM Region...vm_r
+   37398:	6f696765 70755f6e 65746164 00000000     egion_update....
+   373a8:	204d434b 46766544 54432073 00000058     KCM DevFs CTX...
+   373b8:	46766544 42442073 00000000 00564544     DevFs DB....DEV.
+
+000373c8 <devfs_ctx_op>:
+   373c8:	00022654 000226a0 000226ec 00000000     T&...&...&......
+   373d8:	000226a8 204d434b 46766544 69462073     .&..KCM DevFs Fi
+   373e8:	0000656c                                le..
+
+000373ec <devfs_f_op>:
+   373ec:	00022c30 000228a0 00022918 00022994     0,...(...)...)..
+   373fc:	00022ab8 000229d8 00022bec 00022a28     .*...)...+..(*..
+   3740c:	00022a70 4f525245 64203a52 73667665     p*..ERROR: devfs
+   3741c:	6f6f6c5f 5f70756b 65646f6e 7265203a     _lookup_node: er
+   3742c:	20726f72 77206425 656c6968 74656720     ror %d while get
+   3743c:	676e6974 76656420 20656369 61726170     ting device para
+   3744c:	6574656d 000a7372                       meters..
+
+00037454 <devfs_i_op>:
+   37454:	00022d94 00022dac 00000000 00022f60     .-...-......`/..
+   37464:	00022e64 00022da0 00022e6c 00000000     d....-..l.......
+   37474:	00022db4 00000000                       .-......
+
+0003747c <sysfs_ctx_op>:
+   3747c:	00023148 00023184 000231ac 0002318c     H1...1...1...1..
+   3748c:	000231a4 204d434b 46737953 69462073     .1..KCM SysFs Fi
+   3749c:	0000656c 4f464e49 7973203a 5f736673     le..INFO: sysfs_
+   374ac:	64616572 7265203a 20726f72 000a6425     read: error %d..
+
+000374bc <sysfs_f_op>:
+   374bc:	000234b8 000233bc 00023240 00023248     .4...3..@2..H2..
+   374cc:	00023258 00023250 00023378 00000000     X2..P2..x3......
+   374dc:	00000000 204d434b 46737953 6f4e2073     ....KCM SysFs No
+   374ec:	00006564                                de..
+
+000374f0 <sysfs_i_op>:
+   374f0:	00023900 0002362c 00000000 0002372c     .9..,6......,7..
+   37500:	00023634 000238c0 0002363c 00000000     46...8..<6......
+	...
+   37518:	4e524157 3a474e49 6c6c6120 665f636f     WARNING: alloc_f
+   37528:	203a7461 6f727265 65722072 6e696461     at: error readin
+   37538:	65732067 726f7463 0a642520 00000000     g sector %d.....
+   37548:	204d434b 54414656 58544320 00000000     KCM VFAT CTX....
+   37558:	4f525245 25203a52 66203a73 656c6961     ERROR: %s: faile
+   37568:	6f742064 696e6920 616d2074 72657070     d to init mapper
+   37578:	7265202c 64252072 0000000a 4f525245     , err %d....ERRO
+   37588:	56203a52 20544146 746e6f63 5f747865     R: VFAT context_
+   37598:	74696e69 2f49203a 7265204f 2c726f72     init: I/O error,
+   375a8:	756f6320 6e20646c 7220746f 20646165      could not read 
+   375b8:	20627062 6d6f7266 65687420 76656420     bpb from the dev
+   375c8:	2e656369 0000000a 494e4150 74612043     ice.....PANIC at
+   375d8:	6e696c20 25203a65 66202c64 3a656c69      line: %d, file:
+   375e8:	20732520 534d202c 56203a47 20544146      %s , MSG: VFAT 
+   375f8:	20767264 6f727265 62203a72 642f6270     drv error: bpb/d
+   37608:	63697665 6c622065 206b636f 657a6973     evice block size
+   37618:	73696d20 6374616d 70622068 6c622062      mismatch bpb bl
+   37628:	206b636f 202c6425 42766564 25206b6c     ock %d, devBlk %
+   37638:	000a0a64 662f7366 32337461 7461662f     d...fs/fat32/fat
+   37648:	635f3233 65746e6f 632e7478 00000000     32_context.c....
+   37658:	4f525245 76203a52 5f746166 61657263     ERROR: vfat_crea
+   37668:	635f6574 65746e6f 203a7478 54494e49     te_context: INIT
+   37678:	494c4149 474e495a 41465620 4f432054     IALIZING VFAT CO
+   37688:	5845544e 72652054 64252072 0000000a     NTEXT err %d....
+
+00037698 <vfat_ctx_op>:
+   37698:	000255f8 000255c0 00025520 00000000     .U...U.. U......
+   376a8:	000254dc 74616676 6572635f 5f657461     .T..vfat_create_
+   376b8:	746e6f63 00747865                       context.
+
+000376c0 <vfat_f_op>:
+   376c0:	00025898 0002b7d8 0002b630 00000000     .X......0.......
+   376d0:	000258b8 000258a8 000258b0 0002b978     .X...X...X..x...
+   376e0:	0002b628                                (...
+
+000376e4 <vfat_file_mapper_op>:
+   376e4:	00025eac 00025f08 0001c8a0 0001c9dc     .^..._..........
+   376f4:	0001c960 0001c870                       `...p...
+
+000376fc <vfat_inode_mapper_op>:
+   376fc:	00026014 00025f08 0001c8a0 0001c9dc     .`..._..........
+   3770c:	0001c960 0001c870 204d434b 54414656     `...p...KCM VFAT
+   3771c:	646f4e20 00000065 203a7325 62616e75      Node...%s: unab
+   3772c:	7420656c 6f6c206f 70206461 20656761     le to load page 
+   3773c:	20642523 6920666f 65646f6e 20642520     #%d of inode %d 
+   3774c:	6c696877 65722065 69766f6d 6e20676e     while removing n
+   3775c:	2065646f 000a7325                       ode %s..
+
+00037764 <vfat_i_op>:
+   37764:	00027198 00026d28 00026c04 000269e0     .q..(m...l...i..
+   37774:	000267c0 00026ce4 000263b0 00026614     .g...l...c...f..
+   37784:	000269d4 00000000                       .i......
+
+0003778c <vfat_d_op>:
+   3778c:	000261e0 74616676 6c6e755f 5f6b6e69     .a..vfat_unlink_
+   3779c:	65646f6e 00000000 203a7325 656e6f64     node....%s: done
+   377ac:	0000000a                                ....
+
+000377b0 <ramfs_ctx_op>:
+   377b0:	000272a4 0002722c 0002723c 00000000     .r..,r..<r......
+   377c0:	00027234 666d6172 72635f73 65746165     4r..ramfs_create
+   377d0:	6e6f635f 74786574 00000000 204d434b     _context....KCM 
+   377e0:	466d6152 69462073 0000656c              RamFs File..
+
+000377ec <ramfs_f_op>:
+   377ec:	000274f8 0002b7d8 0002b630 00000000     .t......0.......
+   377fc:	00027374 0002736c 000274b4 0002b978     ts..ls...t..x...
+   3780c:	0002b628                                (...
+
+00037810 <ramfs_i_op>:
+   37810:	000275cc 00027670 000275e4 00027630     .u..pv...u..0v..
+   37820:	00027620 00027628 00027648 00027638      v..(v..Hv..8v..
+   37830:	00027668 00000000                       hv......
+
+00037838 <ramfs_d_op>:
+   37838:	00027640                                @v..
+
+0003783c <ramfs_m_op>:
+   3783c:	000276f4 00027714 0001c8a0 0001c9dc     .v...w..........
+   3784c:	0001c960 0001c870 4f464e49 7453203a     `...p...INFO: St
+   3785c:	69747261 4b20676e 44534656 206e6f20     arting KVFSD on 
+   3786c:	20555043 5b206425 20642520 00000a5d     CPU %d [ %d ]...
+   3787c:	4f464e49 6956203a 61757472 6946206c     INFO: Virtual Fi
+   3788c:	5320656c 65747379 5628206d 20295346     le System (VFS) 
+   3789c:	52207349 79646165 0000000a 4e524157     Is Ready....WARN
+   378ac:	3a474e49 69616620 2064656c 6c206f74     ING: failed to l
+   378bc:	2064616f 72657375 6f727020 73736563     oad user process
+   378cc:	7265202c 64252072 75255b20 00000a5d     , err %d [%u]...
+   378dc:	4f464e49 7243203a 69746165 6b20676e     INFO: Creating k
+   378ec:	656e7265 656c206c 206c6576 6d726574     ernel level term
+   378fc:	6c616e69 0000000a 4f464e49 7953203a     inal....INFO: Sy
+   3790c:	6d657473 72754320 746e6572 6d695420     stem Current Tim
+   3791c:	61745365 2520706d 00000a75 66667562     eStamp %u...buff
+   3792c:	74207265 6d73206f 206c6c61 206e656c     er to small len 
+   3793c:	203b6425 746e6564 25207972 25202c70     %d; dentry %p, %
+   3794c:	00000a73 204d434b 20534656 646f6e49     s...KCM VFS Inod
+   3795c:	00000065 204d434b 20534656 65726944     e...KCM VFS Dire
+   3796c:	0000746e 20534656 65726944 4620746e     nt..VFS Dirent F
+   3797c:	6c656572 00747369 646f6e49 6f6c2065     reelist.Inode lo
+   3798c:	00006b63 646f6e49 69642065 746e6572     ck..Inode dirent
+   3799c:	63616320 00006568 203a7325 6c696166      cache..%s: fail
+   379ac:	74206465 6461206f 6e692064 2065646f     ed to add inode 
+   379bc:	6d756e69 2c642520 78746320 0a642520     inum %d, ctx %d.
+   379cc:	00000000 63614349 00006568 65724649     ....ICache..IFre
+   379dc:	63614365 00006568 5f736676 63616369     eCache..vfs_icac
+   379ec:	615f6568 00006464 204d434b 20534656     he_add..KCM VFS 
+   379fc:	656c6946 4d455220 0045544f 6f727245     File REMOTE.Erro
+   37a0c:	6e692072 6c696620 73252065 20746120     r in file %s at 
+   37a1c:	636e7566 20732520 656e696c 0a642520     func %s line %d.
+   37a2c:	00000000 2f736676 5f736676 656c6966     ....vfs/vfs_file
+   37a3c:	0000632e 5f736676 61666564 5f746c75     .c..vfs_default_
+   37a4c:	74697277 00000065 5f736676 61666564     write...vfs_defa
+   37a5c:	5f746c75 64616572 00000000 204d434b     ult_read....KCM 
+   37a6c:	20534656 00585443 494e4150 74612043     VFS CTX.PANIC at
+   37a7c:	6e696c20 25203a65 66202c64 3a656c69      line: %d, file:
+   37a8c:	20732520 534d202c 46203a47 656c6961      %s , MSG: Faile
+   37a9c:	6f742064 494e4920 4c414954 20455349     d to INITIALISE 
+   37aac:	646f6e49 61632065 2c656863 72726520     Inode cache, err
+   37abc:	0a642520 0000000a 2f736676 5f736676      %d.....vfs/vfs_
+   37acc:	74696e69 0000632e 4f525245 25203a52     init.c..ERROR: %
+   37adc:	69203a73 6c61766e 66206469 79745f73     s: invalid fs_ty
+   37aec:	76206570 65756c61 0a642520 00000000     pe value %d.....
+   37afc:	4f525245 25203a52 66203a73 79745f73     ERROR: %s: fs_ty
+   37b0c:	28206570 20297325 6e207369 6320746f     pe (%s) is not c
+   37b1c:	6e206e61 6220746f 6f6d2065 65746e75     an not be mounte
+   37b2c:	73612064 72206120 0a746f6f 00000000     d as a root.....
+   37b3c:	00504d54 46737953 00000053 46766544     TMP.SysFS...DevF
+   37b4c:	00000053 74616656 00005346 466d6152     S...VfatFS..RamF
+   37b5c:	00000053 6f666946 00005346 00000000     S...FifoFS......
+   37b6c:	00000000 00037b40 0003747c 00000001     ....@{..|t......
+   37b7c:	00000000 00037b48 000373c8 00000002     ....H{...s......
+   37b8c:	00000001 00037b50 00037698 00000003     ....P{...v......
+   37b9c:	00000000 00037b58 000377b0 00000004     ....X{...w......
+   37bac:	00000000 00037b60 00000000 5f736676     ....`{......vfs_
+   37bbc:	6e756f6d 73665f74 6f6f725f 00000074     mount_fs_root...
+   37bcc:	203a7325 73696854 6f687320 20646c75     %s: This should 
+   37bdc:	20746f6e 70706168 000a6e65 5f736676     not happen..vfs_
+   37bec:	646f6e69 6f6c5f65 70756b6f 00000000     inode_lookup....
+   37bfc:	5252450a 203a524f 5f666c65 64616568     .ERROR: elf_head
+   37c0c:	725f7265 3a646165 69616620 7420646c     er_read: faild t
+   37c1c:	706f206f 65206e65 75636578 6c626174     o open executabl
+   37c2c:	69662065 202c656c 6f727265 64252072     e file, error %d
+   37c3c:	70202c20 20687461 000a7325 5252450a      , path %s...ERR
+   37c4c:	203a524f 5f666c65 64616568 725f7265     OR: elf_header_r
+   37c5c:	3a646165 69616620 7420646c 6572206f     ead: faild to re
+   37c6c:	45206461 6820464c 65646165 67202c72     ad ELF header, g
+   37c7c:	2520746f 79622064 2c736574 70786520     ot %d bytes, exp
+   37c8c:	65746365 64252064 74796220 000a7365     ected %d bytes..
+   37c9c:	5252450a 203a524f 5f666c65 676f7270     .ERROR: elf_prog
+   37cac:	5f6d6172 72746e65 5f736569 64616572     ram_entries_read
+   37cbc:	6f6e203a 6f727020 6d617267 746e6520     : no program ent
+   37ccc:	73656972 756f6620 000a646e 5252450a     ries found...ERR
+   37cdc:	203a524f 5f666c65 676f7270 5f6d6172     OR: elf_program_
+   37cec:	72746e65 5f736569 64616572 6166203a     entries_read: fa
+   37cfc:	20646c69 6c206f74 6c61636f 20657369     ild to localise 
+   37d0c:	72746e65 0a736569 00000000 5252450a     entries......ERR
+   37d1c:	203a524f 5f666c65 676f7270 5f6d6172     OR: elf_program_
+   37d2c:	72746e65 5f736569 64616572 6166203a     entries_read: fa
+   37d3c:	20646c69 72206f74 20646165 676f7270     ild to read prog
+   37d4c:	206d6172 72746e65 2c736569 746f6720     ram entries, got
+   37d5c:	20642520 65747962 65202c73 63657078      %d bytes, expec
+   37d6c:	20646574 62206425 73657479 0000000a     ted %d bytes....
+   37d7c:	5252450a 203a524f 203a7325 61765f70     .ERROR: %s: p_va
+   37d8c:	20726464 202c7825 65646e69 64252078     ddr %x, index %d
+   37d9c:	45205b20 4d524550 000a5d20 5252450a      [ EPERM ]...ERR
+   37dac:	203a524f 203a7325 6c696166 6f742064     OR: %s: faild to
+   37dbc:	636f6c20 73696c61 65732065 6e656d67      localise segmen
+   37dcc:	69402074 7865646e 0a642520 00000000     t @index %d.....
+   37ddc:	4e524157 3a474e49 3a732520 67657320     WARNING: %s: seg
+   37dec:	746e656d 746f6e20 696c6120 64656e67     ment not aligned
+   37dfc:	78303c20 2d207825 25783020 000a3e78      <0x%x - 0x%x>..
+   37e0c:	4e524157 3a474e49 3a732520 69614620     WARNING: %s: Fai
+   37e1c:	7420646c 616d206f 65732070 6e656d67     ld to map segmen
+   37e2c:	303c2074 20782578 7830202d 2c3e7825     t <0x%x - 0x%x>,
+   37e3c:	6f727020 25206f74 66202c78 20656c69      proto %x, file 
+   37e4c:	646f6e69 78252065 0000000a 5252450a     inode %x.....ERR
+   37e5c:	203a524f 5f666c65 64616568 725f7265     OR: elf_header_r
+   37e6c:	3a646165 65786520 61747563 20656c62     ead: executable 
+   37e7c:	6e207369 6920746f 4c45206e 6f662046     is not in ELF fo
+   37e8c:	74616d72 0000000a 5252450a 203a524f     rmat.....ERROR: 
+   37e9c:	5f666c65 64616568 725f7265 3a646165     elf_header_read:
+   37eac:	746f6e20 70757320 74726f70 45206465      not supported E
+   37ebc:	000a666c 5f666c65 6d676573 73746e65     lf..elf_segments
+   37ecc:	616f6c5f 00000064 33323130 37363534     _load...01234567
+   37edc:	62613938 66656463 00000000 74706d65     89abcdef....empt
+   37eec:	74732079 00000072 4e524157 3a474e49     y str...WARNING:
+   37efc:	3a732520 69616620 2064656c 63206f74      %s: failed to c
+   37f0c:	65736f6c 6c696620 74612065 65746920     lose file at ite
+   37f1c:	69746172 25206e6f 65202c64 25207272     ration %d, err %
+   37f2c:	00000a64 5f746163 636e7566 00000000     d...cat_func....
+   37f3c:	0000002f 63256325 63256325 00000000     /...%c%c%c%c....
+   37f4c:	6f727265 68772072 20656c69 6e69706f     error while opin
+   37f5c:	25206769 00000a73 5645442f 5243532f     ig %s.../DEV/SCR
+   37f6c:	004e4545 67616d49 53582065 20455a49     EEN.Image XSIZE 
+   37f7c:	202c6425 5a495359 64252045 0000000a     %d, YSIZE %d....
+   37f8c:	67616d49 614e2065 203a656d 000a7325     Image Name: %s..
+   37f9c:	6f432020 6e616d6d 74732064 73697461       Command statis
+   37fac:	73636974 53090a3a 74726174 6d697420     tics:..Start tim
+   37fbc:	25203a65 45090a75 7420646e 3a656d69     e: %u..End time:
+   37fcc:	0a752520 616c4509 64657370 6d697420      %u..Elapsed tim
+   37fdc:	25203a65 48090a75 65646165 69742072     e: %u..Header ti
+   37fec:	203a656d 000a7525 6d6d6f43 20646e61     me: %u..Command 
+   37ffc:	20736168 6c696166 000a6465 63657865     has failed..exec
+   3800c:	696d203a 6e697373 706f2067 6e617265     : missing operan
+   3801c:	00000a64 4f4d4c41 45565f53 4f495352     d...ALMOS_VERSIO
+   3802c:	31763d4e 00000000 61746f54 6572206c     N=v1....Total re
+   3803c:	3a736461 412f4e20 746f540a 77206c61     ads: N/A.Total w
+   3804c:	65746972 4e203a73 440a412f 6c427665     rites: N/A.DevBl
+   3805c:	72206b6f 20646165 0a412f4e 7469480a     ok read N/A..Hit
+   3806c:	2f4e203a 694d0a41 4e207373 440a412f     : N/A.Miss N/A.D
+   3807c:	79616c65 57206465 65746972 412f4e20     elayed Write N/A
+   3808c:	0000000a 7373694d 20676e69 6e676973     ....Missing sign
+   3809c:	6e206c61 65626d75 726f2072 6f727020     al number or pro
+   380ac:	73736563 64697020 0000000a 6e6b6e55     cess pid....Unkn
+   380bc:	206e776f 6e676973 6e206c61 65626d75     own signal numbe
+   380cc:	25203a72 00000a64 6c696146 74206465     r: %d...Failed t
+   380dc:	6972206f 73206573 616e6769 6425206c     o rise signal %d
+   380ec:	206e6f20 6b736174 0a642520 00000000      on task %d.....
+   380fc:	5359532f 554c432f 52455453 000a6425     /SYS/CLUSTER%d..
+   3810c:	5359532f 554c432f 52455453 432f6425     /SYS/CLUSTER%d/C
+   3811c:	64255550 00000000 203a7325 6e6b6e55     PU%d....%s: Unkn
+   3812c:	206e776f 20595454 000a6469 203a7325     own TTY id..%s: 
+   3813c:	61766e49 2064696c 20595454 203a6469     Invalid TTY id: 
+   3814c:	000a6425 5f68736b 5f746573 5f797474     %d..ksh_set_tty_
+   3815c:	636e7566 00000000 3d3d3d3d 3d3d3d3d     func....========
+   3816c:	3d3d3d3d 3d3d3d3d 3d3d3d3d 3d3d3d3d     ================
+   3817c:	3d3d3d3d 00000a3d 72746e45 616e2079     =====...Entry na
+   3818c:	2520656d 09090973 00000009 5249443c     me %s.......<DIR
+   3819c:	0000003e 20676552 656c6966 00000000     >...Reg file....
+   381ac:	4f464946 6c696620 00000065 79540909     FIFO file.....Ty
+   381bc:	203a6570 000a7325 72746e45 616e2079     pe: %s..Entry na
+   381cc:	2520656d 00000973 70795409 25203a65     me %s....Type: %
+   381dc:	00000a73 09097325 00000000 4649463c     s...%s......<FIF
+   381ec:	00003e4f 5645443c 4b4c422d 0000003e     O>..<DEV-BLK>...
+   381fc:	5645443c 5248432d 0000003e 6765523c     <DEV-CHR>...<Reg
+   3820c:	656c6946 0000003e 656d614e 79540909     File>...Name..Ty
+   3821c:	09096570 657a6953 0000000a 2d2d2d2d     pe..Size....----
+   3822c:	2d2d0909 09092d2d 2d2d2d2d 0000000a     ..----..----....
+   3823c:	2064250a 6e756f66 00000a64 69617641     .%d found...Avai
+   3824c:	6c62616c 6f432065 6e616d6d 0a3a7364     lable Commands:.
+   3825c:	00000000 203a7325 000a7325 74697865     ....%s: %s..exit
+   3826c:	7845203a 61207469 7320646e 68636e79     : Exit and synch
+   3827c:	696e6f72 70206573 69646e61 6420676e     ronise panding d
+   3828c:	206b7369 74726977 69207365 6e612066     isk wirtes if an
+   3829c:	00000a79 20786469 003a6425 7c73257c     y...idx %d:.|%s|
+   382ac:	0000000a 4c4c554e 0000000a 63677261     ....NULL....argc
+   382bc:	0a642520 00000000 5d73255b 0000003e      %d.....[%s]>...
+   382cc:	6e6b6e55 206e776f 6d6d6f63 20646e61     Unknown command 
+   382dc:	000a7325 696e6946 64656873 0000000a     %s..Finished....
+   382ec:	74697865 00000000 74746573 00000079     exit....setty...
+   382fc:	20746553 204f2f49 6d726554 6c616e69     Set I/O Terminal
+   3830c:	6d754e20 00726562 00006463 6e616843      Number.cd..Chan
+   3831c:	44206567 63657269 79726f74 00000000     ge Directory....
+   3832c:	0000736c 7473694c 6c694620 49207365     ls..List Files I
+   3833c:	6944206e 74636572 0079726f 00007063     n Directory.cp..
+   3834c:	79706f43 6c694620 00000065 00746163     Copy File...cat.
+   3835c:	776f6853 6c694620 6f432065 6e65746e     Show File Conten
+   3836c:	00736574 00007370 776f6853 6f725020     tes.ps..Show Pro
+   3837c:	73736563 61542820 29736b73 61745320     cess (Tasks) Sta
+   3838c:	00006574 63657865 00000000 63657845     te..exec....Exec
+   3839c:	20657475 2077654e 636f7250 00737365     ute New Process.
+   383ac:	006d7070 6e697250 68502074 63736979     ppm.Print Phyisc
+   383bc:	50206c61 73656761 6e614d20 72656761     al Pages Manager
+   383cc:	00000000 00007363 73555043 61745320     ....cs..CPUs Sta
+   383dc:	00007374 74617473 00000000 776f6853     ts..stat....Show
+   383ec:	6c694620 79532065 6d657473 736e4920      File System Ins
+   383fc:	6d757274 61746e65 6e6f6974 00000000     trumentation....
+   3840c:	00647770 6e697250 6f572074 44206b72     pwd.Print Work D
+   3841c:	63657269 79726f74 00000000 00006d72     irectory....rm..
+   3842c:	6f6d6552 46206576 00656c69 6c6c696b     Remove File.kill
+   3843c:	00000000 646e6553 65687420 65707320     ....Send the spe
+   3844c:	69666963 73206465 616e6769 6f74206c     cified signal to
+   3845c:	65687420 65707320 69666963 70206465      the specified p
+   3846c:	65636f72 00007373 746d6f65 0000706b     rocess..eomtkp..
+   3847c:	70736944 2079616c 20494753 67616d49     Display SGI Imag
+   3848c:	6e4f2065 61724620 422d656d 65666675     e On Frame-Buffe
+   3849c:	00000072 61656c63 00000072 61656c43     r...clear...Clea
+   384ac:	6f532072 4c20656d 73656e69 00000000     r Some Lines....
+   384bc:	69646b6d 00000072 656b614d 77654e20     mkdir...Make New
+   384cc:	72694420 6f746365 00007972 69666b6d      Directory..mkfi
+   384dc:	00006f66 656b614d 77654e20 6d614e20     fo..Make New Nam
+   384ec:	46206465 204f4649 656c6946 00000000     ed FIFO File....
+   384fc:	706c6568 00000000 776f6853 61764120     help....Show Ava
+   3850c:	62616c69 6320656c 616d6d6f 0073646e     ilable commands.
+   3851c:	6e694d6b 65685369 00646c6c 000382f4     kMiniShelld.....
+   3852c:	000382fc 00031dd4 00038314 00038318     ................
+   3853c:	000315f0 0003832c 00038330 00032118     ....,...0....!..
+   3854c:	00038348 0003834c 000316ac 00038358     H...L.......X...
+   3855c:	0003835c 00031404 00038370 00038374     \.......p...t...
+   3856c:	00032d84 00038390 00038398 00031bdc     .-..............
+   3857c:	000383ac 000383b0 00032aa0 000383d0     .........*......
+   3858c:	000383d4 00031d0c 000383e0 000383e8     ................
+   3859c:	00031c18 0003840c 00038410 00032ee4     ................
+   385ac:	00038428 0003842c 00032f74 00038438     (...,...t/..8...
+   385bc:	00038440 00031c3c 00038474 0003847c     @...<...t...|...
+   385cc:	00031944 000384a0 000384a8 00031674     D...........t...
+   385dc:	000384bc 000384c4 000329ac 000384d8     .........)......
+   385ec:	000384e0 00032a98 000384fc 00038504     .....*..........
+   385fc:	000322d0 00000000 00000000 00000000     ."..............
+   3860c:	65646e55 72432d72 69746165 00006e6f     Under-Creation..
+   3861c:	544f4e45 00505553 00412f4e 49505b0a     ENOTSUP.N/A..[PI
+   3862c:	25205d44 505b2064 5d444950 20642520     D] %d [PPID] %d 
+   3863c:	6968435b 6572646c 25205d6e 435b2064     [Children] %d [C
+   3864c:	616d6d6f 205d646e 000a7325 5f7c2020     ommand] %s..  |_
+   3865c:	545b205f 205d4449 5b207825 5d44524f     _ [TID] %x [ORD]
+   3866c:	20642520 5d73255b 50435b20 25205d55      %d [%s] [CPU] %
+   3867c:	545b2064 734b4349 6425205d 63535b20     d [TICKs] %d [Sc
+   3868c:	5d646568 20642520 5f6d745b 5d737973     hed] %d [tm_sys]
+   3869c:	20752520 5f6d745b 5d727375 20752520      %u [tm_usr] %u 
+   386ac:	5f6d745b 65656c73 25205d70 73252075     [tm_sleep] %u %s
+   386bc:	25205b20 0a5d2073 00000000 206e4f0a      [ %s ]......On 
+   386cc:	73756c63 20726574 0a3a7525 00000000     cluster %u:.....
+   386dc:	746f540a 41206c61 76697463 20202065     .Total Active   
+   386ec:	20202020 73615420 2020736b 25203a20          Tasks   : %
+   386fc:	00000a64 61746f54 6341206c 65766974     d...Total Active
+   3870c:	65735520 20202072 65726854 20736461      User   Threads 
+   3871c:	6425203a 0000000a 2d2d2d2d 2d2d2d2d     : %d....--------
+   3872c:	2d2d2d2d 2d2d2d2d 00000a2d 00000000     ---------.......
+	...
+
+Disassembly of section .kdata:
+
+00039000 <__kdata_start>:
+   39000:	00000000 	sll	zero,zero,0x0
+   39004:	0003360c 	syscall	0xcd8
+	...
+   39014:	0003361c 	0x3361c
+   39018:	00033620 	0x33620
+   3901c:	00000001 	movf	zero,zero,$fcc0
+   39020:	0003362c 	0x3362c
+   39024:	00033634 	teq	zero,v1,0xd8
+   39028:	00000002 	srl	zero,zero,0x0
+   3902c:	0003362c 	0x3362c
+   39030:	00033634 	teq	zero,v1,0xd8
+   39034:	00000003 	sra	zero,zero,0x0
+   39038:	0003362c 	0x3362c
+   3903c:	00033634 	teq	zero,v1,0xd8
+   39040:	00000004 	sllv	zero,zero,zero
+   39044:	00033650 	0x33650
+   39048:	00033658 	0x33658
+   3904c:	00000005 	0x5
+   39050:	00033678 	0x33678
+   39054:	00033680 	sll	a2,v1,0x1a
+   39058:	00000006 	srlv	zero,zero,zero
+   3905c:	0003369c 	0x3369c
+   39060:	000336a4 	0x336a4
+   39064:	00000007 	srav	zero,zero,zero
+   39068:	000336c4 	0x336c4
+   3906c:	000336cc 	syscall	0xcdb
+   39070:	00000008 	jr	zero
+   39074:	000336e8 	0x336e8
+   39078:	000336f0 	tge	zero,v1,0xdb
+   3907c:	00000009 	jalr	zero,zero
+   39080:	00033710 	0x33710
+   39084:	00033718 	0x33718
+   39088:	0000000a 	movz	zero,zero,zero
+   3908c:	00033734 	teq	zero,v1,0xdc
+   39090:	00033738 	0x33738
+   39094:	0000000b 	movn	zero,zero,zero
+   39098:	00033750 	0x33750
+   3909c:	00033758 	0x33758
+   390a0:	0000000c 	syscall
+   390a4:	0003376c 	0x3376c
+   390a8:	00033770 	tge	zero,v1,0xdd
+   390ac:	0000000d 	break
+   390b0:	00033784 	0x33784
+   390b4:	00033790 	0x33790
+	...
+
+000390c0 <arch_bib_signature>:
+   390c0:	00033da4 00000000 00000000 00000000     .=..............
+
+000390d0 <printk_lock>:
+   390d0:	00000000 00033dc4 00000000 00000000     .....=..........
+
+000390e0 <isr_lock>:
+   390e0:	00000000 00033dd0 00000000 00000000     .....=..........
+
+000390f0 <boot_lock>:
+   390f0:	00000000 00033ddc 00000000 00000000     .....=..........
+
+00039100 <klog_tty>:
+   39100:	00000001 00000000 00000000 00000000     ................
+	...
+
+00039140 <kisr_tty>:
+   39140:	00000001 00000000 00000000 00000000     ................
+	...
+
+00039180 <kexcept_tty>:
+   39180:	00000001 00000000 00000000 00000000     ................
+	...
+   391c0:	00000001 00033df0 00033e08 00033e3c     .....=...>..<>..
+   391d0:	00000002 00033e4c 00033e64 00033e3c     ....L>..d>..<>..
+   391e0:	00000004 00033e98 00033eb8 00033ee8     .....>...>...>..
+   391f0:	00000008 00033ef4 00033f10 00033f3c     .....>...?..<?..
+   39200:	00000020 00033f48 00033f60 00033f3c      ...H?..`?..<?..
+   39210:	00000040 00033f94 00033fb4 00033fe0     @....?...?...?..
+   39220:	00000080 00033ff0 00034010 00033fe0     .....?...@...?..
+   39230:	00000100 0003403c 0003405c 00033fe0     ....<@..\@...?..
+   39240:	00001001 00034090 000340a8 000340dc     .....@...@...@..
+   39250:	00001002 000340ec 00034104 000340dc     .....@...A...@..
+   39260:	00001004 00034138 00034158 00033f3c     ....8A..XA..<?..
+   39270:	00001010 00034184 0003419c 00033f3c     .....A...A..<?..
+   39280:	00001020 000341cc 000341e4 00033f3c      ....A...A..<?..
+   39290:	00001040 00034214 00034230 00033fe0     @....B..0B...?..
+   392a0:	00001080 0003425c 00034278 00033fe0     ....\B..xB...?..
+   392b0:	00001100 000342a4 000342c4 00033fe0     .....B...B...?..
+   392c0:	00000000 000342f4 000342fc 00034334     .....B...B..4C..
+   392d0:	00000000 000343a4 000343a8 00000000     .....C...C......
+   392e0:	00000001 000343b8 000343c0 00039a00     .....C...C......
+   392f0:	00000002 000343f4 000343f8 000399c0     .....C...C......
+   39300:	00000003 00034414 00034418 00039450     .....D...D..P...
+   39310:	00000004 00034424 0003442c 00039410     ....$D..,D......
+   39320:	00000005 0003443c 00034440 00039488     ....<D..@D......
+   39330:	00000006 00034458 0003445c 000394d0     ....XD..\D......
+   39340:	00000007 00034474 0003447c 00039588     ....tD..|D......
+   39350:	00000008 0003448c 00034494 00039508     .....D...D......
+   39360:	00000009 000344c8 000344d0 00039540     .....D...D..@...
+   39370:	0000000a 000344ec 000344f4 00000000     .....D...D......
+   39380:	0000000b 00034524 0003452c 00000000     ....$E..,E......
+   39390:	0000000c 00000000 00000000 00000000     ................
+
+000393a0 <bdev_locks>:
+   393a0:	00000000 000345d8 00000000 00000000     .....E..........
+   393b0:	00000000 000345d8 00000000 00000000     .....E..........
+   393c0:	00000000 000345d8 00000000 00000000     .....E..........
+   393d0:	00000000 000345d8 00000000 00000000     .....E..........
+   393e0:	00000000 000345d8 00000000 00000000     .....E..........
+   393f0:	00000000 000345d8 00000000 00000000     .....E..........
+   39400:	00000000 000345d8 00000000 00000000     .....E..........
+
+00039410 <soclib_blkdev_driver>:
+   39410:	00003824 00000000 00000000 00000000     $8..............
+	...
+
+00039450 <soclib_dma_driver>:
+   39450:	00003e60 00000000 00000000 00000000     `>..............
+	...
+
+00039488 <soclib_fb_driver>:
+   39488:	00004684 00000000 00000000 00000000     .F..............
+	...
+   394cc:	0000467c                                |F..
+
+000394d0 <soclib_icu_driver>:
+   394d0:	00004ba8 00000000 00000000 00000000     .K..............
+	...
+
+00039508 <soclib_iopic_driver>:
+   39508:	00004ee0 00000000 00000000 00000000     .N..............
+	...
+
+00039540 <soclib_memc_driver>:
+   39540:	00004fcc 00000000 00000000 00000000     .O..............
+	...
+   39584:	00004fc4                                .O..
+
+00039588 <soclib_timer_driver>:
+   39588:	00005478 00000000 00000000 00000000     xT..............
+	...
+
+000395c0 <tty_locks>:
+   395c0:	00000000 00034774 00000000 00000000     ....tG..........
+   395d0:	00000000 00034774 00000000 00000000     ....tG..........
+   395e0:	00000000 00034774 00000000 00000000     ....tG..........
+   395f0:	00000000 00034774 00000000 00000000     ....tG..........
+   39600:	00000000 00034774 00000000 00000000     ....tG..........
+   39610:	00000000 00034774 00000000 00000000     ....tG..........
+   39620:	00000000 00034774 00000000 00000000     ....tG..........
+   39630:	00000000 00034774 00000000 00000000     ....tG..........
+   39640:	00000000 00034774 00000000 00000000     ....tG..........
+   39650:	00000000 00034774 00000000 00000000     ....tG..........
+   39660:	00000000 00034774 00000000 00000000     ....tG..........
+   39670:	00000000 00034774 00000000 00000000     ....tG..........
+   39680:	00000000 00034774 00000000 00000000     ....tG..........
+   39690:	00000000 00034774 00000000 00000000     ....tG..........
+   396a0:	00000000 00034774 00000000 00000000     ....tG..........
+   396b0:	00000000 00034774 00000000 00000000     ....tG..........
+   396c0:	00000000 00034774 00000000 00000000     ....tG..........
+   396d0:	00000000 00034774 00000000 00000000     ....tG..........
+   396e0:	00000000 00034774 00000000 00000000     ....tG..........
+   396f0:	00000000 00034774 00000000 00000000     ....tG..........
+   39700:	00000000 00034774 00000000 00000000     ....tG..........
+   39710:	00000000 00034774 00000000 00000000     ....tG..........
+   39720:	00000000 00034774 00000000 00000000     ....tG..........
+   39730:	00000000 00034774 00000000 00000000     ....tG..........
+   39740:	00000000 00034774 00000000 00000000     ....tG..........
+   39750:	00000000 00034774 00000000 00000000     ....tG..........
+   39760:	00000000 00034774 00000000 00000000     ....tG..........
+   39770:	00000000 00034774 00000000 00000000     ....tG..........
+   39780:	00000000 00034774 00000000 00000000     ....tG..........
+   39790:	00000000 00034774 00000000 00000000     ....tG..........
+   397a0:	00000000 00034774 00000000 00000000     ....tG..........
+   397b0:	00000000 00034774 00000000 00000000     ....tG..........
+
+000397c0 <tty_rdlocks>:
+   397c0:	00000000 00034780 00000000 00000000     .....G..........
+   397d0:	00000000 00034780 00000000 00000000     .....G..........
+   397e0:	00000000 00034780 00000000 00000000     .....G..........
+   397f0:	00000000 00034780 00000000 00000000     .....G..........
+   39800:	00000000 00034780 00000000 00000000     .....G..........
+   39810:	00000000 00034780 00000000 00000000     .....G..........
+   39820:	00000000 00034780 00000000 00000000     .....G..........
+   39830:	00000000 00034780 00000000 00000000     .....G..........
+   39840:	00000000 00034780 00000000 00000000     .....G..........
+   39850:	00000000 00034780 00000000 00000000     .....G..........
+   39860:	00000000 00034780 00000000 00000000     .....G..........
+   39870:	00000000 00034780 00000000 00000000     .....G..........
+   39880:	00000000 00034780 00000000 00000000     .....G..........
+   39890:	00000000 00034780 00000000 00000000     .....G..........
+   398a0:	00000000 00034780 00000000 00000000     .....G..........
+   398b0:	00000000 00034780 00000000 00000000     .....G..........
+   398c0:	00000000 00034780 00000000 00000000     .....G..........
+   398d0:	00000000 00034780 00000000 00000000     .....G..........
+   398e0:	00000000 00034780 00000000 00000000     .....G..........
+   398f0:	00000000 00034780 00000000 00000000     .....G..........
+   39900:	00000000 00034780 00000000 00000000     .....G..........
+   39910:	00000000 00034780 00000000 00000000     .....G..........
+   39920:	00000000 00034780 00000000 00000000     .....G..........
+   39930:	00000000 00034780 00000000 00000000     .....G..........
+   39940:	00000000 00034780 00000000 00000000     .....G..........
+   39950:	00000000 00034780 00000000 00000000     .....G..........
+   39960:	00000000 00034780 00000000 00000000     .....G..........
+   39970:	00000000 00034780 00000000 00000000     .....G..........
+   39980:	00000000 00034780 00000000 00000000     .....G..........
+   39990:	00000000 00034780 00000000 00000000     .....G..........
+   399a0:	00000000 00034780 00000000 00000000     .....G..........
+   399b0:	00000000 00034780 00000000 00000000     .....G..........
+
+000399c0 <soclib_tty_driver>:
+   399c0:	00005614 00000000 00000000 00000000     .V..............
+	...
+
+00039a00 <soclib_xicu_driver>:
+   39a00:	00005f9c 00000000 00000000 00000000     ._..............
+	...
+   39ad4:	0000ffff 0003bd30 00000000 00000000     ....0...........
+	...
+
+0003baf0 <unknown>:
+   3baf0:	000342f4                                .B..
+
+0003baf4 <envrion>:
+   3baf4:	00038020 00000000 00000000 00000000      ...............
+	...
+
+0003bc18 <ttys_tbl>:
+	...
+
+0003c70c <ksh_tty>:
+	...
+
+0003c950 <cpu_gid_tbl>:
+	...
+
+0003c960 <__current_cid>:
+	...
+
+0003c9a0 <arch_entrys>:
+	...
+
+0003d5a0 <Arch_cid_To_Almos_cid>:
+	...
+
+0003d7a0 <rt_timer>:
+	...
+
+0003d8a0 <__fb_screen>:
+	...
+
+0003d9a0 <clusters_tbl>:
+	...
+
+00046da0 <cpus_in_kernel>:
+	...
+
+00046db0 <cluster_manager>:
+	...
+
+000702e0 <devices_tbl>:
+	...
+
+000802e0 <idle_args>:
+	...
+
+00080320 <devfs_db>:
+	...
+
+00080390 <sysfs_root_entry>:
+	...
+
+00080400 <icache_lock>:
+	...
+
+00080410 <ifree_list_lock>:
+	...
+
+00080420 <dirent_freelist>:
+	...
+
+00080440 <icache>:
+	...
+
+00080450 <vfs_contexts>:
+	...
+
+000811d0 <args>:
+	...
+
+000816d4 <buffer>:
+	...
+
+000826d4 <kernel_list>:
+   826d4:	00000000                                ....
+
+000826d8 <kboot_tty_cid>:
+   826d8:	00000000                                ....
+
+000826dc <kboot_tty_base>:
+   826dc:	00000000                                ....
+
+000826e0 <boot_cluster>:
+   826e0:	00000000                                ....
+
+000826e4 <__sys_blk>:
+   826e4:	00000000                                ....
+
+000826e8 <__sys_dma>:
+   826e8:	00000000                                ....
+
+000826ec <dqdt_root>:
+   826ec:	00000000                                ....
+
+000826f0 <current_local_cpu_id>:
+   826f0:	00000000                                ....
+
+000826f4 <local_boot_signal>:
+   826f4:	00000000                                ....
+
+000826f8 <inode_freelist>:
+   826f8:	00000000                                ....
+
+000826fc <vfs_pipe_ctx>:
+   826fc:	00000000                                ....
+
+00082700 <root>:
+   82700:	00000000                                ....
+
+00082704 <ms_n_cwd>:
+	...
+
+00083000 <kheader>:
+   83000:	a5a5a5a5 	sh	a1,-23131(t5)
+   83004:	00000000 	sll	zero,zero,0x0
+   83008:	00039000 	sll	s2,v1,0x0
+   8300c:	00039000 	sll	s2,v1,0x0
+   83010:	00083000 	sll	a2,t0,0x0
+   83014:	000005a4 	0x5a4
+   83018:	0000abe4 	0xabe4
Index: trunk/kernel/obj.tsar/almos-mk-tsar-mipsel.elf.nm
===================================================================
--- trunk/kernel/obj.tsar/almos-mk-tsar-mipsel.elf.nm	(revision 1)
+++ trunk/kernel/obj.tsar/almos-mk-tsar-mipsel.elf.nm	(revision 1)
@@ -0,0 +1,1074 @@
+0003d5a0 T Arch_cid_To_Almos_cid
+0000084c T CpU_exception_handler
+00030368 T MD5Final
+0002f2b8 T MD5Init
+00030224 T MD5Update
+000027a8 T __arch_boot_dmsg
+0000820c T __cpu_check_sched
+00008120 T __cpu_in_kernel
+0003c960 T __current_cid
+         U __entry_end
+0003d8a0 T __fb_screen
+000026c0 T __fprintk
+00012db0 T __full_spinlock_lock
+0000bd14 T __get_ppn
+00083000 T __heap_start
+0000a91c T __hfind
+0000ffe4 T __increment_demarshall
+0000e5f8 T __increment_local
+0000e60c T __increment_main
+00029f9c T __inode_can_access
+0002a76c T __inode_size_get_demarshall
+00029fe0 T __inode_size_get_local
+0002a000 T __inode_size_get_main
+00083000 T __kdata_end
+00039000 T __kdata_start
+0000046c T __kentry_end
+00039000 T __ktext_end
+00000000 T __ktext_start
+0001e18c T __mapper_get_ppn_demarshall
+0001e294 T __mapper_get_ppn_local
+0001e13c T __mapper_get_ppn_main
+0001d658 T __mapper_request_
+0001dcec T __mapper_request_demarshall
+0001de48 T __mapper_request_local
+0001dbe8 T __mapper_request_main
+000025f4 T __perror
+0001fda4 T __ppn_refcount_down_demarshall
+0001fe74 T __ppn_refcount_down_local
+0001fd6c T __ppn_refcount_down_main
+0001fc9c T __ppn_refcount_up_demarshall
+0001fc5c T __ppn_refcount_up_local
+0001fc24 T __ppn_refcount_up_main
+000163dc T __ps_func_demarshall
+00016164 T __ps_func_local
+0001613c T __ps_func_main
+0000ec04 T __rpc_check
+0000f2ac T __rpc_send
+0000e618 T __rpc_test
+00011738 T __sched_sleep
+00011180 T __sched_wakeup
+00012564 T __signal_rise_demarshall
+000123dc T __signal_rise_local
+000121a8 T __signal_rise_main
+00012f04 T __spinlock_lock
+000128ac T __spinlock_trylock
+000826e4 T __sys_blk
+000826e8 T __sys_dma
+000142c8 T __sys_exec_demarshall
+000143b8 T __sys_exec_local
+00014138 T __sys_exec_main
+00019000 T __task_fd_dup
+00018538 T __task_fd_set
+000198a0 T __task_pid_alloc_demarshall
+0001941c T __task_pid_alloc_local
+000192d4 T __task_pid_alloc_main
+00019b0c T __task_whereis_demarshall
+000199e0 T __task_whereis_local
+00019994 T __task_whereis_main
+0000fbac T __test0
+0000f9fc T __test1
+000005a4 T __uspace_end
+0000046c T __uspace_start
+000242fc T __vfat_alloc_fat_entry_demarshall
+000243dc T __vfat_alloc_fat_entry_local
+00024058 T __vfat_alloc_fat_entry_main
+00024634 T __vfat_cluster_count_demarshall
+000245d4 T __vfat_cluster_count_local
+00024558 T __vfat_cluster_count_main
+00025110 T __vfat_cluster_lookup_demarshall
+000252fc T __vfat_cluster_lookup_local
+00024ecc T __vfat_cluster_lookup_main
+00024c50 T __vfat_extend_cluster_demarshall
+00024d44 T __vfat_extend_cluster_local
+00024a08 T __vfat_extend_cluster_main
+00023d44 T __vfat_free_fat_entry_demarshall
+00023e1c T __vfat_free_fat_entry_local
+00023ba4 T __vfat_free_fat_entry_main
+00023ab0 T __vfat_query_fat_demarshall
+00023a48 T __vfat_query_fat_local
+0002399c T __vfat_query_fat_main
+000268cc T __vfat_write_inode_demarshall
+00026344 T __vfat_write_inode_local
+000261e8 T __vfat_write_inode_main
+0002831c T __vfs_chmod_demarshall
+00028410 T __vfs_chmod_local
+0002829c T __vfs_chmod_main
+0002b2c0 T __vfs_create_inode_demarshall
+0002b3a0 T __vfs_create_inode_local
+0002b180 T __vfs_create_inode_main
+000285bc T __vfs_delete_dirent_demarshall
+000286cc T __vfs_delete_dirent_local
+00028478 T __vfs_delete_dirent_main
+0002bf0c T __vfs_file_down_demarshall
+0002bfa8 T __vfs_file_down_local
+0002bee4 T __vfs_file_down_main
+0002baa4 T __vfs_file_up_demarshall
+0002bb74 T __vfs_file_up_local
+0002ba9c T __vfs_file_up_main
+00028000 T __vfs_get_name_demarshall
+00028210 T __vfs_get_name_local
+00027df4 T __vfs_get_name_main
+0002de58 T __vfs_get_upath
+0002acdc T __vfs_icache_del
+0002dc64 T __vfs_lookup
+0002d8e8 T __vfs_lookup_child_demarshall
+0002d9cc T __vfs_lookup_child_local
+0002d79c T __vfs_lookup_child_main
+0002d2b0 T __vfs_lookup_parent_demarshall
+0002d1a8 T __vfs_lookup_parent_local
+0002d0ec T __vfs_lookup_parent_main
+00027abc T __vfs_lseek
+00027a34 T __vfs_lseek_
+00028b78 T __vfs_open_demarshall
+00028c70 T __vfs_open_local
+00028954 T __vfs_open_main
+00029c58 T __vfs_readdir_demarshall
+00029d30 T __vfs_readdir_local
+00029af0 T __vfs_readdir_main
+00028818 T __vfs_stat_demarshall
+000288f8 T __vfs_stat_local
+00028740 T __vfs_stat_main
+00028ea0 T __vfs_unlink
+0002af18 T __vfs_unlink_inode_demarshall
+0002afd4 T __vfs_unlink_inode_local
+0002ad68 T __vfs_unlink_inode_main
+000005a4 T __virtual_end
+00020324 T __vmm_fault_handler
+00027c38 T _vfs_lseek_demarshall
+00027d28 T _vfs_lseek_local
+00027c00 T _vfs_lseek_main
+00029d90 T _vfs_readdir
+0001b3a8 T alarm_clock
+0001b198 T alarm_manager_init
+0001b0ac T alarm_wait
+0002c7d0 T alloc_context_demarshall
+0002c878 T alloc_context_local
+0002c708 T alloc_context_main
+00001314 T arch_barrier_destroy
+0000135c T arch_barrier_init
+00001338 T arch_barrier_wait
+000390c0 T arch_bib_signature
+000015d4 T arch_boot_cid
+00001288 T arch_cpu_get_irq_entry
+000014f8 T arch_cpu_init
+000015c8 T arch_cpu_per_cluster
+000012a4 T arch_cpu_send_ipi
+00001270 T arch_cpu_set_irq_entry
+00001d80 T arch_dev_init
+00001928 T arch_dev_iopic_register
+00001630 T arch_dev_locate
+00001b54 T arch_dev_register
+0003c9a0 T arch_entrys
+00002318 T arch_init
+000015bc T arch_onln_cluster_nr
+000015b0 T arch_onln_cpu_nr
+00001380 T arch_set_power_state
+00002044 T arch_state_init
+0000167c T arch_xicu_set_mask
+000017e4 T arch_xicu_set_wti
+000811d0 T args
+00008bb4 T args_len
+00013f50 T args_ppns2pages
+0002e1cc T atoi
+000066e4 T atomic_add
+00006728 T atomic_cas
+00006704 T atomic_dec
+00006754 T atomic_get
+000066c0 T atomic_inc
+0000667c T atomic_init
+00006768 T atomic_set
+000067a8 T atomic_test_set
+0000e090 T backoff
+000068ac T barrier_destroy
+00006988 T barrier_init
+00012f9c T barrier_kmem_init
+00006bd4 T barrier_wait
+00003c70 T bdev_lock
+000393a0 T bdev_locks
+00003a24 T bdev_unlock
+0002e484 T bitmap_clear_range
+0002e308 T bitmap_ffc2
+0002e254 T bitmap_ffs2
+0002e3c0 T bitmap_set_range
+00006eac T blkio_destroy
+000070dc T blkio_init
+00006e64 T blkio_kmem_init
+00006f34 T blkio_sync
+00003a60 T block_irq_handler
+00003d08 T block_request
+000826e0 T boot_cluster
+000390f0 T boot_lock
+000816d4 T buffer
+00031404 T cat_func
+000315f0 T cd_func
+000111f8 T check_sleeping
+00031674 T clear_func
+00007ca0 T cluster_entry_init
+000078c0 T cluster_in_kernel
+0000794c T cluster_init
+000074ac T cluster_init_flag
+000075e0 T cluster_key_create_event_handler
+00007588 T cluster_key_delete_event_handler
+00046db0 T cluster_manager
+00007738 T cluster_manager_thread
+000073ec T cluster_wait_flag
+00007464 T cluster_with_ram_nr
+00007338 T clusters_sysfs_register
+0003d9a0 T clusters_tbl
+00032828 T cmdLineAnalyser
+0001beec T compute_active_page
+000092e8 T compute_args
+0002ec2c T compute_dec64
+000316ac T cp_func
+000082a0 T cpu_clock
+00007f58 T cpu_compute_stats
+00000734 T cpu_context_destroy
+00000774 T cpu_context_dup_finlize
+00000768 T cpu_context_get_stackaddr
+000005a4 T cpu_context_init
+0003305c T cpu_context_load
+00033130 T cpu_context_restore
+000330ec T cpu_context_save
+00000748 T cpu_context_set_pmm
+0000113c T cpu_context_set_sigreturn
+0000075c T cpu_context_set_stackaddr
+0000073c T cpu_context_set_tid
+0000046c T cpu_copy_from_uspace
+000004e8 T cpu_copy_to_uspace
+000008f4 T cpu_do_exception
+00000ebc T cpu_do_interrupt
+00000f78 T cpu_do_syscall
+000007f4 T cpu_except_get_entry
+00033208 T cpu_fpu_context_restore
+00033184 T cpu_fpu_context_save
+00007fd4 T cpu_get_ms
+00007fe4 T cpu_get_time
+0003c950 T cpu_gid_tbl
+000015e0 T cpu_gid_tbl_init
+00008184 T cpu_in_kernel
+0000837c T cpu_init
+000080c0 T cpu_ipi_notify
+000080c8 T cpu_kentry
+000080f4 T cpu_kexit
+000081e8 T cpu_lid2ptr
+00001148 T cpu_signal_notify
+00008030 T cpu_time_reset
+0000059c T cpu_uspace_error
+00000564 T cpu_uspace_strlen
+000010f4 T cpu_uzone_destroy
+00001268 T cpu_uzone_dup
+000010fc T cpu_uzone_getattr
+000010ec T cpu_uzone_init
+0000111c T cpu_uzone_setattr
+0000868c T cpu_yield
+00046da0 T cpus_in_kernel
+000826f0 T current_local_cpu_id
+00007d98 T cv_broadcast
+00007d50 T cv_destroy
+00007f00 T cv_init
+00013610 T cv_kmem_init
+00007dd0 T cv_signal
+00007e0c T cv_wait
+0000bc80 T default_gsize
+000229d8 T devfs_close
+00022654 T devfs_create_context
+00022dac T devfs_create_node
+000373c8 T devfs_ctx_op
+00080320 T devfs_db
+000226a0 T devfs_destroy_context
+000373ec T devfs_f_op
+00037454 T devfs_i_op
+00022d94 T devfs_init_node
+00022e74 T devfs_inode_create
+000226b0 T devfs_kmem_context_init
+00022860 T devfs_kmem_file_init
+00022f60 T devfs_lookup_node
+00022994 T devfs_lseek
+00022a28 T devfs_mmap
+00022a70 T devfs_munmap
+00022c30 T devfs_open
+000228a0 T devfs_read
+000226ec T devfs_read_root
+00022ab8 T devfs_readdir
+00022730 T devfs_register
+00022bec T devfs_release
+00022da0 T devfs_release_node
+000227ec T devfs_root_init
+00022db4 T devfs_stat_node
+00022e6c T devfs_unlink_node
+00022918 T devfs_write
+00022e64 T devfs_write_node
+000226a8 T devfs_write_root
+00008748 T device_alloc
+000702e0 T devices_tbl
+00080420 T dirent_freelist
+0001f030 T dirty_pages_init
+00008b90 T distlock_lock
+0000886c T distlock_trylock
+0000897c T distlock_unlock
+00013c1c T dma_kmem_request_init
+00013c94 T dma_memcpy
+00008f44 T do_exec
+00009e00 T do_interrupt
+00030430 T do_memcpy_8
+000305c4 T do_memset_8
+0001ab00 T do_migrate
+00009fdc T do_syscall
+0001711c T do_thread_create
+0000a3b0 T dqdt_init
+0000a4b0 T dqdt_mem_request
+0000a4f4 T dqdt_print
+0000a4d4 T dqdt_print_summary
+000826ec T dqdt_root
+0000a44c T dqdt_task_placement
+0000a404 T dqdt_thread_migrate
+0000a3bc T dqdt_thread_placement
+0000a3a0 T dqdt_update
+0000a3a8 T dqdt_update_threads_number
+00013e7c T drop_args_ppns
+00013f04 T drop_path
+000035e8 T drvdb_get_driver
+000035c4 T drvdb_locate_byId
+0000363c T drvdb_locate_byName
+00003610 T drvdb_set_driver
+0000266c T early_boot_dmsg
+0002e5b8 T elf_load_task
+0003baf4 T envrion
+00031944 T eomtkp_func
+0000a51c T event_destroy
+0000a514 T event_init
+0000a524 T event_listner_destroy
+0000a52c T event_listner_init
+0000a578 T event_listner_notify
+0000a798 T event_send
+00039000 T exception_lock
+00031bdc T exec_func
+0001510c T fork_event_handler
+00008e2c T free_args
+0001be48 T freelist_get
+0001bd10 T freelist_populate
+0001ba90 T freelist_release
+0000982c T full_do_exec
+000325d0 T getChar
+00032704 T getString
+0001bfe0 T get_block
+00014074 T get_path
+0001b5c8 T heap_manager_free
+0001b8ec T heap_manager_init
+0001b72c T heap_manager_malloc
+0000a9dc T hfind
+0000ab50 T hhalloc
+0000a8f4 T hhinit
+0000aa18 T hinsert
+0000a904 T hninit
+0000aac8 T hremove
+0000ab30 T htable_int_default
+00080440 T icache
+00080400 T icache_lock
+00004cc4 T icu_irq_handler
+000802e0 T idle_args
+00080410 T ifree_list_lock
+0002a4d0 T ifreelist_add
+0002a458 T ifreelist_get
+0001c850 T init_pages_table
+000826f8 T inode_freelist
+00029f20 T inode_hcompare
+00029ef8 T inode_hhash
+00004df4 T iopic_bind_wti_and_irq
+00004e78 T iopic_get_status
+0002eef8 T iprintk
+0002e560 T isalpha
+0002e550 T isprint
+000390e0 T isr_lock
+0002e574 T isspace
+0000ded0 T item_get_base
+0000dee4 T item_get_base_remote
+0000e150 T item_set
+00032404 T kMiniShelld
+000826dc T kboot_tty_base
+000826d8 T kboot_tty_cid
+000025cc T kboot_tty_init
+0001c11c T kcm_alloc
+0001c0c0 T kcm_free
+0001c1a0 T kcm_init
+0001bc88 T kcm_page_alloc
+0001bc80 T kcm_page_free
+0001bb9c T kcm_print
+0001c090 T kcm_release
+0000257c T kdmsg_init
+00000180 T kentry
+0000045c T kentry_load
+0000abe4 T kern_init
+000826d4 T kernel_list
+00039180 T kexcept_tty
+00008e0c T kexec_copy
+00008de4 T kexec_strlen
+0000b430 T keysdb_bind
+0000b524 T keysdb_destroy
+0000b700 T keysdb_init
+0000b258 T keysdb_insert
+0000b134 T keysdb_insert_seq
+0000b0e8 T keysdb_lookup
+0000b66c T keysdb_print
+0000b5c0 T keysdb_record_print
+0000b090 T keysdb_remove
+0000b028 T keysdb_unbind
+0000afec T keysrec_kmem_init
+0000b9b4 T kfifo_destroy
+0000b9f4 T kfifo_init
+00083000 T kheader
+00031c3c T kill_func
+00012690 T kill_sigaction
+00039140 T kisr_tty
+0000bff8 T kk_copy_from
+0000c048 T kk_copy_to
+0000be08 T kk_get_ppn
+0000bc88 T kk_get_ppn_max
+0000c094 T kk_scpy_from
+0000c0c8 T kk_scpy_to
+0000bff0 T kk_strlen
+0000bea0 T kk_vma2ppn
+00039100 T klog_tty
+0001c4fc T kmem_alloc
+0001c4d0 T kmem_free
+0001c308 T kmem_get_kcm
+00031d0c T ksh_cpu_state_func
+0003266c T ksh_getLine
+0003292c T ksh_print
+00031dd4 T ksh_set_tty_func
+0003c70c T ksh_tty
+000326b8 T ksh_write
+0000babc T kthread_create
+0001a284 T kthread_destroy
+0000bee4 T ku_copy_from
+0000bf70 T ku_copy_to
+0000be2c T ku_get_ppn
+0000bd0c T ku_get_ppn_max
+0000bf38 T ku_scpy_from
+0000bfc0 T ku_scpy_to
+0000beb0 T ku_strlen
+0000be50 T ku_vma2ppn
+00027734 T kvfsd
+000826f4 T local_boot_signal
+00032118 T ls_func
+0000769c T manager_alarm_event_handler
+00008e88 T map_args
+0001ca70 T mapper_add_page
+0001c7fc T mapper_cnt_kmem_init
+0001c960 T mapper_default_clear_page_dirty
+0001c880 T mapper_default_read_page
+0001c870 T mapper_default_release_page
+0001c9dc T mapper_default_set_page_dirty
+0001c8a0 T mapper_default_sync_page
+0001c878 T mapper_default_write_page
+0001e404 T mapper_destroy
+0001ce44 T mapper_find_page
+0001cdc4 T mapper_find_pages
+0001cb5c T mapper_find_pages_by_tag
+0001cbdc T mapper_find_pages_contig
+0001cf9c T mapper_get_page
+0001e300 T mapper_get_ppn
+0001cea8 T mapper_init
+0001c7b4 T mapper_kmem_init
+0001e114 T mapper_read
+0001e768 T mapper_remove_page
+0001c83c T mapper_replicate
+0001ded0 T mapper_request
+0001ccd8 T mapper_set_auto_migrate
+0001e0ec T mapper_write
+0000c0f4 T mcs_barrier_init
+0000c150 T mcs_barrier_wait
+0000c284 T mcs_lock
+0000c258 T mcs_lock_init
+0000c2e4 T mcs_lock_remote
+0000c4c0 T mcs_unlock
+0000c394 T mcs_unlock_remote
+000304ac T memcpy
+00030608 T memset
+0001b034 T migrate_event_handler
+000329ac T mkdir_func
+00032a98 T mkfifo_func
+00002824 T mmu_except_get_entry
+0000081c T mmu_exception_handler
+00082704 T ms_n_cwd
+0000b908 T multi_event_get
+0000b800 T multi_event_put
+0000c594 T mwmr_destroy
+0000c8d4 T mwmr_init
+0000c764 T mwmr_read
+0000c5e8 T mwmr_write
+0001eec0 T page_clear_dirty
+0001e91c T page_copy
+0001e80c T page_get_ppm
+0001e9e8 T page_lock
+0001e818 T page_print
+0001ef70 T page_set_dirty
+0001ea7c T page_state_set
+0001e970 T page_unlock
+0001e8e4 T page_zero
+00003284 T pagedir_dup
+00013e08 T pages_to_ppns
+00002bc8 T pmm_alloc_pages
+000028a4 T pmm_bootstrap_init
+00002a80 T pmm_cache_flush
+00002a58 T pmm_cache_flush_raddr
+00002a30 T pmm_cache_flush_vaddr
+00002b9c T pmm_destroy
+00003398 T pmm_dup
+00002958 T pmm_get_page
+000034dc T pmm_init
+00002c50 T pmm_lock_page
+00002888 T pmm_ppn2cid
+00002874 T pmm_ppn2ppm
+00002880 T pmm_ppn2vma
+00002aa8 T pmm_print
+0000305c T pmm_region_attr_set
+00002b60 T pmm_region_dup
+000033ac T pmm_region_map
+00002988 T pmm_region_unmap
+0000314c T pmm_release
+00003054 T pmm_set_page
+000029d0 T pmm_tlb_disable
+00002990 T pmm_tlb_enable
+00002a08 T pmm_tlb_flush_vaddr
+00002960 T pmm_unlock_page
+0001f084 T ppm_addr2page
+0001f640 T ppm_alloc_pages
+0001f154 T ppm_assert_order
+0001f594 T ppm_free_pages
+00032aa0 T ppm_func
+0001f8a4 T ppm_init
+0001f054 T ppm_page2addr
+0001f0a8 T ppm_page2ppn
+0001f0d4 T ppm_page_is_valid
+0001f104 T ppm_ppn2page
+0001f124 T ppm_ppn2vma
+0001f21c T ppm_print
+0001f13c T ppm_vma2ppn
+000200bc T ppn_copy
+0001feb4 T ppn_is_local
+0001feec T ppn_ppn2cid
+000200b4 T ppn_ppn2vma
+0001ffd4 T ppn_refcount_down
+0001fef4 T ppn_refcount_up
+000096f8 T prepare_args
+00032344 T print_args
+00031bd0 T print_error_msg
+000390d0 T printk_lock
+00032d84 T ps_func
+00032ac4 T ps_print_task
+0001a2d0 T pthread_destroy
+0001b974 T put_block
+00032ee4 T pwd_func
+0000ddec T radix_item_info_apply
+0000ca0c T radix_item_info_lookup
+0000c9bc T radix_node_kmem_init
+0000dd24 T radix_tree_delete
+0000d41c T radix_tree_gang_lookup
+0000cf58 T radix_tree_gang_lookup_tag
+0000d1a8 T radix_tree_gang_lookup_tag_slot
+0000c9fc T radix_tree_init
+0000d66c T radix_tree_insert
+0000cb08 T radix_tree_lookup
+0000d960 T radix_tree_remove_item
+0000ccbc T radix_tree_tag_clear
+0000ce4c T radix_tree_tag_get
+0000cb3c T radix_tree_tag_set
+0000d3f4 T radix_tree_tagged
+0002736c T ramfs_close
+00027640 T ramfs_compare
+00027670 T ramfs_create
+000272a4 T ramfs_create_context
+000377b0 T ramfs_ctx_op
+00037838 T ramfs_d_op
+00027638 T ramfs_delete
+0002722c T ramfs_destroy_context
+000377ec T ramfs_f_op
+000276f4 T ramfs_file_read_page
+00027714 T ramfs_file_write_page
+00037810 T ramfs_i_op
+000275e4 T ramfs_icreate
+000275cc T ramfs_init_inode
+00027328 T ramfs_kmem_file_init
+00027630 T ramfs_lookup
+00027364 T ramfs_lseek
+0003783c T ramfs_m_op
+000274f8 T ramfs_open
+0002723c T ramfs_read_root
+00027374 T ramfs_readdir
+000274b4 T ramfs_release
+00027628 T ramfs_release_inode
+00027668 T ramfs_stat_inode
+00027648 T ramfs_unlink_inode
+00027620 T ramfs_write_inode
+00027234 T ramfs_write_root
+00030758 T rand
+00030a94 T rb_erase
+00030e98 T rb_first
+000308c4 T rb_insert_color
+00030ec4 T rb_last
+00030ef0 T rb_next
+00030f5c T rb_prev
+00030fc8 T rb_replace_node
+00006824 T refcount_down
+0000685c T refcount_get
+000067f8 T refcount_init
+00006848 T refcount_set
+00006800 T refcount_up
+0000e014 T remote_fifo_destroy
+0000df74 T remote_fifo_get
+0000e01c T remote_fifo_init
+0000e370 T remote_fifo_put
+0000dfe0 T remote_fifo_release
+00008a50 T remote_spinlock_lock
+0000877c T remote_spinlock_trylock
+00008890 T remote_spinlock_unlock
+0002c638 T replicate_root_demarshall
+0002c350 T replicate_root_local
+0002c238 T replicate_root_main
+0000df58 T rf_get_index
+00032f74 T rm_func
+00082700 T root
+0000ea70 T rpc_activate_thread
+0000e5b8 T rpc_after_wakeup
+0000e8d0 T rpc_before_sleep
+0000ecec T rpc_check
+0000f130 T rpc_check_notify
+0000e4dc T rpc_exec
+0000e7a4 T rpc_get_arg
+0000ed44 T rpc_get_arg_sz
+0000edac T rpc_handle
+0000e500 T rpc_listner_check_new
+0000f464 T rpc_listner_init
+0000efe4 T rpc_listner_notify
+0000e5d4 T rpc_manager_init
+0000e700 T rpc_print
+0000efb8 T rpc_ptr_copy
+0000e850 T rpc_release
+0000f2a4 T rpc_response_notify
+0000fd8c T rpc_send_rsp
+0000e88c T rpc_send_rsp_err
+0000f4e4 T rpc_send_sync
+0000e6cc T rpc_test
+0000e938 T rpc_thread_create
+0000f7a0 T rppc_generic
+00010358 T rr_add_created
+00010080 T rr_clock
+000107fc T rr_clock_balancing
+00010af8 T rr_elect
+000104a0 T rr_elect_balancing
+0001014c T rr_exit
+000100cc T rr_remove
+000109d4 T rr_sched_init
+000106c8 T rr_sched_load_balance
+000100bc T rr_sched_strategy
+000101dc T rr_sleep
+0001024c T rr_wakeup
+000100c4 T rr_yield
+0003d7a0 T rt_timer
+000035bc T rt_timer_ctrl
+00003590 T rt_timer_init
+00003598 T rt_timer_read
+000035ac T rt_timer_set
+000035b4 T rt_timer_setperiod
+00010d50 T rwlock_destroy
+000110a0 T rwlock_init
+00016780 T rwlock_kmem_init
+00010fa0 T rwlock_rdlock
+00010d98 T rwlock_tryrdlock
+00010e1c T rwlock_trywrlock
+00010e94 T rwlock_unlock
+00011020 T rwlock_wrlock
+000112c8 T sched_add
+00011b2c T sched_add_created
+00011120 T sched_clock
+00011b90 T sched_exit
+00011294 T sched_get_listner
+00011338 T sched_getpolicy
+00011178 T sched_idle
+00011d1c T sched_init
+00011c54 T sched_register
+00011a68 T sched_remove
+00011380 T sched_setpolicy
+00011118 T sched_setprio
+000118d0 T sched_sleep
+00011898 T sched_sleep_check
+0001116c T sched_strategy
+0001194c T sched_switch
+0001128c T sched_wakeup
+000118d8 T sched_yield
+00011e10 T sem_destroy
+00011e00 T sem_getvalue
+000120ec T sem_init
+00016a68 T sem_kmem_init
+00011f40 T sem_post
+00011e7c T sem_trywait
+00012014 T sem_wait
+00031f44 T show1
+00031e7c T show2
+0003200c T show3
+00031c18 T show_instrumentation
+00012190 T signal_init
+00012650 T signal_manager_init
+00012700 T signal_notify
+0001243c T signal_rise
+0000b8ac T single_event_get
+0000b7a8 T single_event_put
+00039410 T soclib_blkdev_driver
+00003824 T soclib_block_init
+00039450 T soclib_dma_driver
+00003e60 T soclib_dma_init
+00039488 T soclib_fb_driver
+00004684 T soclib_fb_init
+00004b68 T soclib_icu_bind
+000394d0 T soclib_icu_driver
+00004ba8 T soclib_icu_init
+00039508 T soclib_iopic_driver
+00004ee0 T soclib_iopic_init
+00039540 T soclib_memc_driver
+00004fcc T soclib_memc_init
+00039588 T soclib_timer_driver
+00005478 T soclib_timer_init
+000399c0 T soclib_tty_driver
+00005614 T soclib_tty_init
+0000610c T soclib_xicu_barrier_destroy
+00006198 T soclib_xicu_barrier_init
+00005f80 T soclib_xicu_barrier_wait
+00005e98 T soclib_xicu_bind
+00005edc T soclib_xicu_bind_wti
+00039a00 T soclib_xicu_driver
+00005f9c T soclib_xicu_init
+00005f1c T soclib_xicu_ipi_send
+0001289c T spin_init
+00012f14 T spin_lock
+00012c0c T spin_unlock
+00012bfc T spin_unlock_nosched
+000128a4 T spinlock_destroy
+00012890 T spinlock_init
+00012f0c T spinlock_lock
+00012efc T spinlock_lock_noirq
+00012cec T spinlock_rdlock
+00012944 T spinlock_trylock
+000129dc T spinlock_tryrdlock
+00012c2c T spinlock_unlock
+00012bec T spinlock_unlock_noirq
+00012c1c T spinlock_unlock_nosched
+00031050 T sprintk
+00030740 T srand
+00031210 T strcasecmp
+000310b0 T strchr
+00031114 T strcmp
+000312a4 T strcpy
+00031344 T strlen
+0003116c T strncmp
+000312e0 T strncpy
+00031384 T strnlen
+000313d8 T strrchr
+0001ed64 T sync_all_pages
+00012f1c T sys_alarm
+00012f78 T sys_alarm_event_handler
+00012fd8 T sys_barrier
+000131e4 T sys_chdir
+000132cc T sys_chmod
+000133e8 T sys_clock
+000134a0 T sys_close
+00013550 T sys_closedir
+000136c8 T sys_cond_var
+00013ad0 T sys_creat
+00013c58 T sys_dma_memcpy
+00014414 T sys_exec
+00014e78 T sys_fork
+000151ac T sys_fsync
+000151b4 T sys_ftime
+00015274 T sys_getcwd
+000153b4 T sys_getpid
+000153c4 T sys_gettimeofday
+00016ef8 T sys_kill
+000154cc T sys_lseek
+00015590 T sys_madvise
+000156fc T sys_mcntl
+000158ec T sys_mkdir
+000159c0 T sys_mkfifo
+000159d8 T sys_mmap
+00015d70 T sys_open
+00015edc T sys_opendir
+00016020 T sys_pipe
+000161a0 T sys_ps
+000164ac T sys_read
+000165ac T sys_readdir
+000166a0 T sys_rmdir
+00016838 T sys_rwlock
+00016a40 T sys_sbrk
+00016aa4 T sys_sem
+00016ea4 T sys_signal
+00016f7c T sys_sigreturn_setup
+00016fa8 T sys_stat
+000173c8 T sys_thread_create
+00017810 T sys_thread_detach
+00017924 T sys_thread_exit
+00017a78 T sys_thread_getattr
+00017b04 T sys_thread_join
+00017cc8 T sys_thread_migrate
+00017e8c T sys_thread_sleep
+00017fe8 T sys_thread_wakeup
+00018298 T sys_thread_yield
+000182a0 T sys_times
+00018350 T sys_unlink
+000183e8 T sys_utls
+00018430 T sys_write
+00013928 T sysconf_init
+00023250 T sysfs_close
+00023148 T sysfs_create_context
+0002362c T sysfs_create_node
+0003747c T sysfs_ctx_op
+00023184 T sysfs_destroy_context
+000374bc T sysfs_f_op
+000374f0 T sysfs_i_op
+00023900 T sysfs_init_node
+00023644 T sysfs_inode_create
+00023200 T sysfs_kmem_file_init
+000235ec T sysfs_kmem_node_init
+0002372c T sysfs_lookup_node
+00023248 T sysfs_lseek
+000234b8 T sysfs_open
+000233bc T sysfs_read
+000231ac T sysfs_read_root
+00023258 T sysfs_readdir
+00023378 T sysfs_release
+000238c0 T sysfs_release_node
+0002318c T sysfs_repli_root
+00080390 T sysfs_root_entry
+0002363c T sysfs_unlink_node
+00023240 T sysfs_write
+00023634 T sysfs_write_node
+000231a4 T sysfs_write_root
+00018abc T task_bootstrap_finalize
+00018b28 T task_bootstrap_init
+00019568 T task_create
+00019d28 T task_create_clone
+00019bdc T task_destroy
+00019164 T task_dup
+0001851c T task_fd_check
+000189d4 T task_fd_destroy
+00019114 T task_fd_fork
+00018660 T task_fd_init
+00018770 T task_fd_lookup
+000187f8 T task_fd_put
+00018898 T task_fd_set
+00018624 T task_fdinfo_kmem_init
+000185bc T task_htable_pid_compare
+000185dc T task_kmem_init
+00009938 T task_load_init
+00018880 T task_lookup
+000185b0 T task_lookup_zero
+00018a84 T task_manager_init
+00018d84 T task_manager_init_finalize
+00019478 T task_pid_alloc
+00018e3c T task_restore
+00019f64 T task_vaddr2paddr
+00018c10 T task_vaddr2ppn
+00019a20 T task_whereis
+000185d0 T tasks_manager_get_htable
+00018d6c T tasks_manager_htable_hinsert
+00018d5c T tasks_manager_htable_hremove
+00018764 T tasks_manager_lock
+00018758 T tasks_manager_unlock
+00036868 T thread_attr_name
+0001a0f0 T thread_create
+00017768 T thread_create_event_handler
+0001a4bc T thread_destroy
+0001a4fc T thread_destroy_handler
+0001a520 T thread_dup
+0000a6b4 T thread_event_manager
+0001a260 T thread_get_attr_name
+0001a070 T thread_get_state_name
+0001a694 T thread_idle
+0001a09c T thread_init
+0001ad64 T thread_migrate
+0000f1a4 T thread_rpc_manager
+00036850 T thread_state_name
+0000555c T timer_irq_handler
+0001b1b0 T tm_born_compute
+0001b1a8 T tm_create_compute
+0001b1e8 T tm_exit_compute
+0001b348 T tm_sleep_compute
+0001b2a0 T tm_sys_compute
+0001b2f4 T tm_usr_compute
+0001b23c T tm_wait_compute
+0002e590 T toupper
+00005a5c T tty_get_params
+000055b0 T tty_get_status
+000057c4 T tty_irq_handler
+000395c0 T tty_locks
+000055a8 T tty_open
+000397c0 T tty_rdlocks
+00005b88 T tty_read
+00005a84 T tty_write
+0003bc18 T ttys_tbl
+0003baf0 T unknown
+0002c38c T update_remote_contexts
+0002cabc T update_task0_root_cwd
+00000000 A vaddr
+000248f4 T vfat_alloc_fat_entry
+000258a8 T vfat_close
+0002470c T vfat_cluster_count
+0002537c T vfat_cluster_lookup
+000261e0 T vfat_compare
+00026d28 T vfat_create
+000255f8 T vfat_create_context
+00037698 T vfat_ctx_op
+0003778c T vfat_d_op
+00026614 T vfat_delete
+000255c0 T vfat_destroy_context
+00024dac T vfat_extend_cluster
+000376c0 T vfat_f_op
+000376e4 T vfat_file_mapper_op
+00025eac T vfat_file_read_page
+00024800 T vfat_free_fat_entry
+0002615c T vfat_getshortname
+00037764 T vfat_i_op
+00026c04 T vfat_icreate
+00027198 T vfat_init_node
+000376fc T vfat_inode_mapper_op
+000254e4 T vfat_kmem_context_init
+00026120 T vfat_kmem_inode_init
+00023e7c T vfat_locate_entry
+000269e0 T vfat_lookup
+000258a0 T vfat_lseek
+00026014 T vfat_node_read_page
+00025f08 T vfat_node_write_page
+00025898 T vfat_open
+00024438 T vfat_query_fat
+00025520 T vfat_read_root
+000258b8 T vfat_readdir
+000258b0 T vfat_release
+00026ce4 T vfat_release_node
+000269d4 T vfat_stat_node
+000263b0 T vfat_unlink_node
+000267c0 T vfat_write_node
+000254dc T vfat_write_root
+0002b5b4 T vfs_cache_init
+00029694 T vfs_chdir
+00028cd8 T vfs_chmod
+00027d9c T vfs_close
+00027dd0 T vfs_closedir
+0002c224 T vfs_context_init
+00080450 T vfs_contexts
+00029680 T vfs_create
+0002b3fc T vfs_create_inode
+0002a648 T vfs_dcache_init
+0002b978 T vfs_default_mmap_file
+0002b628 T vfs_default_munmap_file
+0002b7d8 T vfs_default_read
+0002b630 T vfs_default_write
+0002a17c T vfs_dirent_clear_inload
+0002a1bc T vfs_dirent_down
+0002a108 T vfs_dirent_free
+0002a528 T vfs_dirent_init
+0002a170 T vfs_dirent_is_inload
+0002a5b8 T vfs_dirent_new
+0002a160 T vfs_dirent_set_inload
+0002a23c T vfs_dirent_up
+0002bfd8 T vfs_file_down
+0002bd08 T vfs_file_get
+0002be48 T vfs_file_remote_down
+0002bc8c T vfs_file_remote_get
+0002be18 T vfs_file_remote_put
+0002bbb4 T vfs_file_up
+0002a618 T vfs_freelist_init
+000290e8 T vfs_get_path
+0002b0ec T vfs_icache_add
+0002ad38 T vfs_icache_del
+0002b518 T vfs_icache_init
+0002a1b0 T vfs_icache_lock
+0002a51c T vfs_icache_unlock
+0002ca3c T vfs_init
+0002a9e4 T vfs_inode_down
+0002a988 T vfs_inode_free
+0002a018 T vfs_inode_get_cid
+0002a37c T vfs_inode_hold
+0002aaac T vfs_inode_init
+0002a2e8 T vfs_inode_link
+0002a190 T vfs_inode_lock
+0002d380 T vfs_inode_lookup
+0002ab58 T vfs_inode_new
+00029fc8 T vfs_inode_size_get
+0002a658 T vfs_inode_size_get_remote
+0002a818 T vfs_inode_trunc
+0002a2c8 T vfs_inode_unlock
+0002a414 T vfs_inode_up
+0002aca4 T vfs_inum_new
+00029f4c T vfs_inumber_free
+0002c0b8 T vfs_kmem_context_init
+0002a118 T vfs_kmem_dirent_init
+0002b5e0 T vfs_kmem_file_remote_init
+00029f54 T vfs_kmem_inode_init
+0002d49c T vfs_load_dirent
+0002e168 T vfs_lookup
+0002da28 T vfs_lookup_child
+0002db30 T vfs_lookup_elem
+0002d0ac T vfs_lookup_next
+0002d1e4 T vfs_lookup_parent
+0002de50 T vfs_lookup_path
+0002dfbc T vfs_lookup_path_init
+0002d0c0 T vfs_lookup_path_put
+00029a24 T vfs_lseek
+00029904 T vfs_lseek_remote
+00027d6c T vfs_mkdir
+00027984 T vfs_mkfifo
+0002cdcc T vfs_mount_fs_root
+0002c0f4 T vfs_mount_link
+0002c8b0 T vfs_mount_prepare
+000293c8 T vfs_open
+0002963c T vfs_opendir
+0002797c T vfs_pipe
+000826fc T vfs_pipe_ctx
+0002798c T vfs_read
+00029e70 T vfs_readdir
+0002cff0 T vfs_real_lookup
+000290d8 T vfs_rmdir
+0002975c T vfs_stat
+0002a024 T vfs_stat_inode
+000290e0 T vfs_unlink
+0002b010 T vfs_unlink_inode
+000279e0 T vfs_write
+00022108 T vm_region_attach
+0003725c T vm_region_default_op
+000219c4 T vm_region_destroy
+00022478 T vm_region_detach
+00021dac T vm_region_dup
+00021a2c T vm_region_find
+000219cc T vm_region_find_list
+00021c6c T vm_region_init
+0002197c T vm_region_kmem_init
+00021a8c T vm_region_resize
+00021a94 T vm_region_split
+0002238c T vm_region_unmap
+00021a9c T vm_region_update
+00020264 T vmm_check_address
+00020b8c T vmm_default_pagefault
+000216e8 T vmm_destroy
+00020974 T vmm_do_cow
+000215a4 T vmm_do_munmap
+000212f4 T vmm_do_shared_anon_mapping
+000217dc T vmm_dup
+00020554 T vmm_fault_handler
+0002177c T vmm_init
+000206e4 T vmm_inval_shared_page
+00020304 T vmm_keysdb_update
+00020780 T vmm_madvise_migrate
+0002025c T vmm_madvise_willneed
+00021004 T vmm_migrate_shared_page_seq
+000213b8 T vmm_mmap
+00021620 T vmm_munmap
+00021208 T vmm_sbrk
+00020848 T vmm_set_auto_migrate
+00020644 T vmm_update_shared_page
+0001b44c T wait_on
+0001b4a4 T wakeup_all
+0001b558 T wakeup_one
+00006870 T wqdb_kmem_init
+00005de0 T xicu_get_highest_irq
+00006380 T xicu_irq_handler
+000062cc T xicu_timer_irq_handler
Index: trunk/kernel/obj.tsar/arch/tsar/arch-dqdt.d
===================================================================
--- trunk/kernel/obj.tsar/arch/tsar/arch-dqdt.d	(revision 1)
+++ trunk/kernel/obj.tsar/arch/tsar/arch-dqdt.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/arch/tsar/arch-dqdt.o: arch/tsar/arch-dqdt.c libk/errno.h \
+ vfs/vfs-errno.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h libk/arch-bib.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/arch/tsar/arch.d
===================================================================
--- trunk/kernel/obj.tsar/arch/tsar/arch.d	(revision 1)
+++ trunk/kernel/obj.tsar/arch/tsar/arch.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/arch/tsar/arch.o: arch/tsar/arch.c libk/errno.h vfs/vfs-errno.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h drivers/soclib/soclib_xicu.h
Index: trunk/kernel/obj.tsar/arch/tsar/arch_init.d
===================================================================
--- trunk/kernel/obj.tsar/arch/tsar/arch_init.d	(revision 1)
+++ trunk/kernel/obj.tsar/arch/tsar/arch_init.d	(revision 1)
@@ -0,0 +1,18 @@
+obj.tsar/arch/tsar/arch_init.o: arch/tsar/arch_init.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/types.h libk/stdint.h libk/list.h \
+ kern/kmagics.h libk/bits.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h kern/mcs_sync.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h \
+ libk/boot-info.h mm/heap_manager.h kern/thread.h kern/task.h \
+ kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h mm/page.h \
+ drivers/soclib/drvdb.h drivers/soclib/soclib_xicu.h \
+ drivers/soclib/soclib_iopic.h libk/arch-bib.h
Index: trunk/kernel/obj.tsar/arch/tsar/kdmsg.d
===================================================================
--- trunk/kernel/obj.tsar/arch/tsar/kdmsg.d	(revision 1)
+++ trunk/kernel/obj.tsar/arch/tsar/kdmsg.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/arch/tsar/kdmsg.o: arch/tsar/kdmsg.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ drivers/soclib/soclib_tty.h kern/distlock.h kern/mcs_sync.h kern/kdmsg.h \
+ libk/boot-info.h kern/thread.h kern/wait_queue.h
Index: trunk/kernel/obj.tsar/arch/tsar/mmu-info.d
===================================================================
--- trunk/kernel/obj.tsar/arch/tsar/mmu-info.d	(revision 1)
+++ trunk/kernel/obj.tsar/arch/tsar/mmu-info.d	(revision 1)
@@ -0,0 +1,4 @@
+obj.tsar/arch/tsar/mmu-info.o: arch/tsar/mmu-info.c arch/tsar/mmu-info.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/bits.h
Index: trunk/kernel/obj.tsar/arch/tsar/pmm.d
===================================================================
--- trunk/kernel/obj.tsar/arch/tsar/pmm.d	(revision 1)
+++ trunk/kernel/obj.tsar/arch/tsar/pmm.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/arch/tsar/pmm.o: arch/tsar/pmm.c libk/errno.h vfs/vfs-errno.h \
+ libk/bits.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/task.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h kern/cluster.h \
+ mm/ppm.h mm/heap_manager.h mm/page.h arch/tsar/mmu-info.h
Index: trunk/kernel/obj.tsar/arch/tsar/rt_timer.d
===================================================================
--- trunk/kernel/obj.tsar/arch/tsar/rt_timer.d	(revision 1)
+++ trunk/kernel/obj.tsar/arch/tsar/rt_timer.d	(revision 1)
@@ -0,0 +1,10 @@
+obj.tsar/arch/tsar/rt_timer.o: arch/tsar/rt_timer.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h kern/rt_timer.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/__cpu_context.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/__cpu_context.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/__cpu_context.d	(revision 1)
@@ -0,0 +1,2 @@
+obj.tsar/cpu/mipsel/__cpu_context.o: cpu/mipsel/__cpu_context.S \
+ cpu/mipsel/cpu-regs.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/__cpu_kentry.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/__cpu_kentry.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/__cpu_kentry.d	(revision 1)
@@ -0,0 +1,2 @@
+obj.tsar/cpu/mipsel/__cpu_kentry.o: cpu/mipsel/__cpu_kentry.S \
+ cpu/mipsel/cpu-regs.h libk/boot-info.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/__cpu_uspace.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/__cpu_uspace.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/__cpu_uspace.d	(revision 1)
@@ -0,0 +1,2 @@
+obj.tsar/cpu/mipsel/__cpu_uspace.o: cpu/mipsel/__cpu_uspace.S \
+ libk/errno.h vfs/vfs-errno.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/__kheader.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/__kheader.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/__kheader.d	(revision 1)
@@ -0,0 +1,2 @@
+obj.tsar/cpu/mipsel/__kheader.o: cpu/mipsel/__kheader.S \
+ cpu/mipsel/cpu-regs.h libk/boot-info.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/cpu_context.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/cpu_context.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/cpu_context.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/cpu/mipsel/cpu_context.o: cpu/mipsel/cpu_context.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/thread.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h kern/wait_queue.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/keysdb.h \
+ kern/signal.h kern/cluster.h mm/ppm.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_exception.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_exception.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_exception.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/cpu/mipsel/cpu_do_exception.o: cpu/mipsel/cpu_do_exception.c \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/task.h libk/list.h kern/kmagics.h libk/bits.h \
+ kern/spinlock.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h kern/thread.h kern/distlock.h \
+ kern/cpu-trace.h arch/tsar/mmu-info.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_interrupt.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_interrupt.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_interrupt.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/cpu/mipsel/cpu_do_interrupt.o: cpu/mipsel/cpu_do_interrupt.c \
+ kern/cpu.h libk/utils.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/thread.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h kern/interrupt.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_syscall.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_syscall.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/cpu_do_syscall.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/cpu/mipsel/cpu_do_syscall.o: cpu/mipsel/cpu_do_syscall.c \
+ libk/errno.h vfs/vfs-errno.h kern/syscall.h kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/pmm.h arch/tsar/arch-pmm.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/interrupt.h
Index: trunk/kernel/obj.tsar/cpu/mipsel/cpu_uzone.d
===================================================================
--- trunk/kernel/obj.tsar/cpu/mipsel/cpu_uzone.d	(revision 1)
+++ trunk/kernel/obj.tsar/cpu/mipsel/cpu_uzone.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/cpu/mipsel/cpu_uzone.o: cpu/mipsel/cpu_uzone.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h
Index: trunk/kernel/obj.tsar/drivers/soclib/drvdb.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/drvdb.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/drvdb.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/drivers/soclib/drvdb.o: drivers/soclib/drvdb.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h libk/libk.h libk/string.h libk/ctype.h kern/event.h \
+ libk/list.h kern/kmagics.h kern/device.h kern/driver.h kern/metafs.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h drivers/soclib/drvdb.h \
+ drivers/soclib/soclib_xicu.h libk/bits.h drivers/soclib/soclib_icu.h \
+ drivers/soclib/soclib_tty.h drivers/soclib/soclib_timer.h \
+ drivers/soclib/soclib_dma.h drivers/soclib/soclib_block.h \
+ drivers/soclib/soclib_fb.h drivers/soclib/soclib_memc.h \
+ drivers/soclib/soclib_iopic.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_block.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_block.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_block.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/drivers/soclib/soclib_block.o: drivers/soclib/soclib_block.c \
+ kern/device.h kern/driver.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/list.h kern/kmagics.h \
+ kern/event.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h drivers/soclib/drvdb.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/time.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/thread.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ drivers/soclib/soclib_block.h kern/cpu-trace.h kern/distlock.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_dma.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_dma.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_dma.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/drivers/soclib/soclib_dma.o: drivers/soclib/soclib_dma.c \
+ libk/errno.h vfs/vfs-errno.h kern/cpu.h libk/utils.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ drivers/soclib/drvdb.h kern/thread.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h drivers/soclib/soclib_dma.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_fb.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_fb.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_fb.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/drivers/soclib/soclib_fb.o: drivers/soclib/soclib_fb.c \
+ kern/cpu.h libk/utils.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h drivers/soclib/drvdb.h vfs/vfs.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ drivers/soclib/soclib_fb.h kern/thread.h kern/task.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h \
+ kern/signal.h kern/dma.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_icu.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_icu.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_icu.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/drivers/soclib/soclib_icu.o: drivers/soclib/soclib_icu.c \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h drivers/soclib/drvdb.h \
+ drivers/soclib/soclib_icu.h kern/cpu-trace.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/thread.h kern/wait_queue.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_iopic.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_iopic.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_iopic.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/drivers/soclib/soclib_iopic.o: drivers/soclib/soclib_iopic.c \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/system.h kern/hal-arch.h arch/tsar/arch.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h drivers/soclib/drvdb.h drivers/soclib/soclib_iopic.h \
+ kern/cpu-trace.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/thread.h kern/wait_queue.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_memc.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_memc.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_memc.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/drivers/soclib/soclib_memc.o: drivers/soclib/soclib_memc.c \
+ libk/bits.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/device.h kern/driver.h libk/list.h kern/kmagics.h \
+ kern/event.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h drivers/soclib/drvdb.h libk/errno.h \
+ vfs/vfs-errno.h vfs/vfs.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/time.h fs/sysfs/sysfs.h kern/rpc.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ drivers/soclib/soclib_memc.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_timer.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_timer.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_timer.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/drivers/soclib/soclib_timer.o: drivers/soclib/soclib_timer.c \
+ kern/system.h kern/hal-arch.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h arch/tsar/arch.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/thread.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h drivers/soclib/soclib_timer.h \
+ drivers/soclib/drvdb.h kern/cpu-trace.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_tty.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_tty.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_tty.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/drivers/soclib/soclib_tty.o: drivers/soclib/soclib_tty.c \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h kern/system.h kern/hal-arch.h \
+ libk/types.h libk/stdint.h arch/tsar/arch.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h vfs/vfs.h kern/rwlock.h kern/wait_queue.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h drivers/soclib/drvdb.h \
+ drivers/soclib/soclib_tty.h kern/distlock.h kern/cpu-trace.h \
+ kern/thread.h kern/mwmr.h
Index: trunk/kernel/obj.tsar/drivers/soclib/soclib_xicu.d
===================================================================
--- trunk/kernel/obj.tsar/drivers/soclib/soclib_xicu.d	(revision 1)
+++ trunk/kernel/obj.tsar/drivers/soclib/soclib_xicu.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/drivers/soclib/soclib_xicu.o: drivers/soclib/soclib_xicu.c \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/system.h kern/hal-arch.h arch/tsar/arch.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h drivers/soclib/drvdb.h drivers/soclib/soclib_xicu.h \
+ kern/cpu-trace.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/thread.h kern/wait_queue.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/fs/devfs/devfs_context.d
===================================================================
--- trunk/kernel/obj.tsar/fs/devfs/devfs_context.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/devfs/devfs_context.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/fs/devfs/devfs_context.o: fs/devfs/devfs_context.c kern/device.h \
+ kern/driver.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/event.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h \
+ mm/kcm.h vfs/vfs.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ libk/errno.h vfs/vfs-errno.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/time.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h fs/devfs/devfs-private.h
Index: trunk/kernel/obj.tsar/fs/devfs/devfs_file.d
===================================================================
--- trunk/kernel/obj.tsar/fs/devfs/devfs_file.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/devfs/devfs_file.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/devfs/devfs_file.o: fs/devfs/devfs_file.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h kern/device.h kern/driver.h libk/types.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/event.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h \
+ mm/kcm.h vfs/vfs.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ libk/errno.h vfs/vfs-errno.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/time.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/thread.h \
+ fs/devfs/devfs-private.h
Index: trunk/kernel/obj.tsar/fs/devfs/devfs_node.d
===================================================================
--- trunk/kernel/obj.tsar/fs/devfs/devfs_node.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/devfs/devfs_node.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/fs/devfs/devfs_node.o: fs/devfs/devfs_node.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h mm/kmem.h libk/types.h libk/stdint.h mm/kcm.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h libk/string.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h \
+ libk/bits.h kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h vfs/vfs.h kern/rwlock.h kern/wait_queue.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ fs/devfs/devfs-private.h
Index: trunk/kernel/obj.tsar/fs/fat32/fat32_access.d
===================================================================
--- trunk/kernel/obj.tsar/fs/fat32/fat32_access.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/fat32/fat32_access.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/fat32/fat32_access.o: fs/fat32/fat32_access.c kern/driver.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/event.h kern/device.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/time.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/page.h mm/pmm.h arch/tsar/arch-pmm.h kern/thread.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h fs/fat32/fat32-private.h
Index: trunk/kernel/obj.tsar/fs/fat32/fat32_context.d
===================================================================
--- trunk/kernel/obj.tsar/fs/fat32/fat32_context.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/fat32/fat32_context.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/fat32/fat32_context.o: fs/fat32/fat32_context.c kern/kdmsg.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/rwlock.h kern/wait_queue.h mm/page.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h kern/thread.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h fs/fat32/fat32-private.h
Index: trunk/kernel/obj.tsar/fs/fat32/fat32_file.d
===================================================================
--- trunk/kernel/obj.tsar/fs/fat32/fat32_file.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/fat32/fat32_file.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/fat32/fat32_file.o: fs/fat32/fat32_file.c libk/stdint.h \
+ mm/kmem.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h mm/kcm.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h libk/string.h mm/ppm.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/ctype.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/page.h mm/mapper.h kern/radix.h kern/rwlock.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h mm/ppn.h kern/thread.h \
+ kern/sys-vfs.h fs/fat32/fat32-private.h
Index: trunk/kernel/obj.tsar/fs/fat32/fat32_mapper.d
===================================================================
--- trunk/kernel/obj.tsar/fs/fat32/fat32_mapper.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/fat32/fat32_mapper.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/fat32/fat32_mapper.o: fs/fat32/fat32_mapper.c libk/stdint.h \
+ mm/page.h kern/atomic.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h libk/types.h \
+ kern/spinlock.h libk/list.h kern/kmagics.h kern/wait_queue.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/ppm.h \
+ mm/pmm.h arch/tsar/arch-pmm.h vfs/vfs.h kern/rwlock.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/thread.h \
+ kern/blkio.h fs/fat32/fat32-private.h
Index: trunk/kernel/obj.tsar/fs/fat32/fat32_node.d
===================================================================
--- trunk/kernel/obj.tsar/fs/fat32/fat32_node.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/fat32/fat32_node.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/fat32/fat32_node.o: fs/fat32/fat32_node.c mm/kmem.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h mm/kcm.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ libk/string.h kern/thread.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h \
+ libk/bits.h kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/cluster.h mm/ppm.h mm/heap_manager.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/page.h mm/mapper.h kern/radix.h kern/rwlock.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h fs/fat32/fat32-private.h
Index: trunk/kernel/obj.tsar/fs/ramfs/ramfs_context.d
===================================================================
--- trunk/kernel/obj.tsar/fs/ramfs/ramfs_context.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/ramfs/ramfs_context.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/fs/ramfs/ramfs_context.o: fs/ramfs/ramfs_context.c kern/kdmsg.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/pmm.h \
+ arch/tsar/arch-pmm.h kern/rwlock.h kern/wait_queue.h mm/page.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h kern/thread.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ fs/ramfs/ramfs.h fs/ramfs/ramfs-private.h
Index: trunk/kernel/obj.tsar/fs/ramfs/ramfs_file.d
===================================================================
--- trunk/kernel/obj.tsar/fs/ramfs/ramfs_file.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/ramfs/ramfs_file.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/ramfs/ramfs_file.o: fs/ramfs/ramfs_file.c libk/stdint.h \
+ mm/kmem.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h mm/kcm.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h libk/string.h mm/ppm.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/ctype.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/page.h mm/mapper.h kern/radix.h kern/rwlock.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h mm/ppn.h kern/thread.h \
+ kern/sys-vfs.h fs/ramfs/ramfs.h fs/ramfs/ramfs-private.h
Index: trunk/kernel/obj.tsar/fs/ramfs/ramfs_inode.d
===================================================================
--- trunk/kernel/obj.tsar/fs/ramfs/ramfs_inode.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/ramfs/ramfs_inode.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/ramfs/ramfs_inode.o: fs/ramfs/ramfs_inode.c libk/stdint.h \
+ mm/kmem.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h mm/kcm.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h libk/string.h mm/ppm.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/ctype.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/page.h mm/mapper.h kern/radix.h kern/rwlock.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h mm/ppn.h kern/thread.h \
+ kern/sys-vfs.h fs/ramfs/ramfs.h fs/ramfs/ramfs-private.h
Index: trunk/kernel/obj.tsar/fs/ramfs/ramfs_mapper.d
===================================================================
--- trunk/kernel/obj.tsar/fs/ramfs/ramfs_mapper.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/ramfs/ramfs_mapper.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/fs/ramfs/ramfs_mapper.o: fs/ramfs/ramfs_mapper.c libk/stdint.h \
+ mm/page.h kern/atomic.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h libk/types.h \
+ kern/spinlock.h libk/list.h kern/kmagics.h kern/wait_queue.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/ppm.h \
+ mm/pmm.h arch/tsar/arch-pmm.h vfs/vfs.h kern/rwlock.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/thread.h \
+ kern/blkio.h fs/ramfs/ramfs.h fs/ramfs/ramfs-private.h
Index: trunk/kernel/obj.tsar/fs/sysfs/sysfs_context.d
===================================================================
--- trunk/kernel/obj.tsar/fs/sysfs/sysfs_context.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/sysfs/sysfs_context.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/fs/sysfs/sysfs_context.o: fs/sysfs/sysfs_context.c kern/device.h \
+ kern/driver.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/event.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h \
+ mm/kcm.h vfs/vfs.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ libk/errno.h vfs/vfs-errno.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/time.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h fs/sysfs/sysfs-private.h
Index: trunk/kernel/obj.tsar/fs/sysfs/sysfs_file.d
===================================================================
--- trunk/kernel/obj.tsar/fs/sysfs/sysfs_file.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/sysfs/sysfs_file.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/fs/sysfs/sysfs_file.o: fs/sysfs/sysfs_file.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h kern/device.h kern/driver.h libk/types.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/event.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h \
+ mm/kcm.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/time.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs.h kern/rwlock.h \
+ kern/wait_queue.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/thread.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ fs/sysfs/sysfs-private.h
Index: trunk/kernel/obj.tsar/fs/sysfs/sysfs_node.d
===================================================================
--- trunk/kernel/obj.tsar/fs/sysfs/sysfs_node.d	(revision 1)
+++ trunk/kernel/obj.tsar/fs/sysfs/sysfs_node.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/fs/sysfs/sysfs_node.o: fs/sysfs/sysfs_node.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h mm/kmem.h libk/types.h libk/stdint.h mm/kcm.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h libk/string.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h \
+ libk/bits.h kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h vfs/vfs.h kern/rwlock.h kern/wait_queue.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ fs/sysfs/sysfs-private.h
Index: trunk/kernel/obj.tsar/kern/almOS-date.h
===================================================================
--- trunk/kernel/obj.tsar/kern/almOS-date.h	(revision 1)
+++ trunk/kernel/obj.tsar/kern/almOS-date.h	(revision 1)
@@ -0,0 +1,1 @@
+#define ALMOS_DATE "02 May 2016 - 17:45:28"
Index: trunk/kernel/obj.tsar/kern/atomic.d
===================================================================
--- trunk/kernel/obj.tsar/kern/atomic.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/atomic.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/kern/atomic.o: kern/atomic.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/pmm.h \
+ arch/tsar/arch-pmm.h
Index: trunk/kernel/obj.tsar/kern/barrier.d
===================================================================
--- trunk/kernel/obj.tsar/kern/barrier.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/barrier.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/barrier.o: kern/barrier.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ libk/bits.h kern/task.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h kern/cluster.h \
+ mm/ppm.h mm/heap_manager.h kern/barrier.h
Index: trunk/kernel/obj.tsar/kern/blkio.d
===================================================================
--- trunk/kernel/obj.tsar/kern/blkio.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/blkio.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/blkio.o: kern/blkio.c kern/cpu.h libk/utils.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/thread.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h mm/page.h kern/blkio.h
Index: trunk/kernel/obj.tsar/kern/cluster.d
===================================================================
--- trunk/kernel/obj.tsar/kern/cluster.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/cluster.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/cluster.o: kern/cluster.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/types.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h kern/spinlock.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h kern/mcs_sync.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h \
+ libk/boot-info.h mm/heap_manager.h mm/pmm.h arch/tsar/arch-pmm.h \
+ kern/thread.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/kern/cond_var.d
===================================================================
--- trunk/kernel/obj.tsar/kern/cond_var.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/cond_var.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/cond_var.o: kern/cond_var.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/semaphore.h kern/cond_var.h
Index: trunk/kernel/obj.tsar/kern/cpu.d
===================================================================
--- trunk/kernel/obj.tsar/kern/cpu.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/cpu.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/cpu.o: kern/cpu.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h kern/cpu-trace.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/kern/device.d
===================================================================
--- trunk/kernel/obj.tsar/kern/device.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/device.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/kern/device.o: kern/device.c kern/device.h kern/driver.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/event.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h \
+ mm/kcm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/time.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/kern/distlock.d
===================================================================
--- trunk/kernel/obj.tsar/kern/distlock.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/distlock.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/kern/distlock.o: kern/distlock.c kern/system.h kern/hal-arch.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cluster.h mm/ppm.h mm/heap_manager.h \
+ kern/distlock.h
Index: trunk/kernel/obj.tsar/kern/do_exec.d
===================================================================
--- trunk/kernel/obj.tsar/kern/do_exec.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/do_exec.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/kern/do_exec.o: kern/do_exec.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/errno.h vfs/vfs-errno.h libk/types.h \
+ libk/stdint.h libk/libk.h libk/string.h libk/ctype.h libk/bits.h \
+ mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/task.h kern/atomic.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h fs/sysfs/sysfs.h \
+ kern/rpc.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h mm/page.h kern/thread.h \
+ kern/pid.h kern/sys-vfs.h kern/cluster.h mm/ppm.h mm/heap_manager.h \
+ kern/dqdt.h
Index: trunk/kernel/obj.tsar/kern/do_interrupt.d
===================================================================
--- trunk/kernel/obj.tsar/kern/do_interrupt.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/do_interrupt.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/do_interrupt.o: kern/do_interrupt.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h kern/cpu-trace.h
Index: trunk/kernel/obj.tsar/kern/do_syscall.d
===================================================================
--- trunk/kernel/obj.tsar/kern/do_syscall.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/do_syscall.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/kern/do_syscall.o: kern/do_syscall.c kern/syscall.h libk/errno.h \
+ vfs/vfs-errno.h kern/time.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/list.h kern/kmagics.h \
+ kern/device.h kern/driver.h kern/event.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/dma.h kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/keysdb.h \
+ kern/signal.h kern/sys-vfs.h kern/cpu-trace.h kern/semaphore.h \
+ kern/cond_var.h kern/barrier.h mm/page.h
Index: trunk/kernel/obj.tsar/kern/dqdt.d
===================================================================
--- trunk/kernel/obj.tsar/kern/dqdt.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/dqdt.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/dqdt.o: kern/dqdt.c libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h libk/types.h \
+ libk/stdint.h libk/errno.h vfs/vfs-errno.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h kern/thread.h libk/list.h kern/kmagics.h \
+ kern/spinlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/kern/event.d
===================================================================
--- trunk/kernel/obj.tsar/kern/event.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/event.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/kern/event.o: kern/event.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h kern/mcs_sync.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h \
+ libk/boot-info.h mm/heap_manager.h mm/pmm.h arch/tsar/arch-pmm.h \
+ kern/cpu-trace.h kern/thread.h
Index: trunk/kernel/obj.tsar/kern/htable.d
===================================================================
--- trunk/kernel/obj.tsar/kern/htable.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/htable.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/htable.o: kern/htable.c kern/htable.h libk/list.h \
+ kern/kmagics.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ kern/atomic.h libk/types.h libk/stdint.h mm/kmem.h mm/kcm.h \
+ kern/spinlock.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/pmm.h arch/tsar/arch-pmm.h kern/thread.h
Index: trunk/kernel/obj.tsar/kern/kern_init.d
===================================================================
--- trunk/kernel/obj.tsar/kern/kern_init.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/kern_init.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/kern/kern_init.o: kern/kern_init.c obj.tsar/kern/almOS-date.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h kern/cluster.h mm/ppm.h mm/heap_manager.h \
+ mm/page.h kern/sysconf.h kern/dqdt.h kern/pid.h
Index: trunk/kernel/obj.tsar/kern/keysdb.d
===================================================================
--- trunk/kernel/obj.tsar/kern/keysdb.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/keysdb.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/keysdb.o: kern/keysdb.c libk/errno.h vfs/vfs-errno.h \
+ libk/libk.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/string.h libk/ctype.h kern/kdmsg.h kern/spinlock.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/page.h kern/wait_queue.h mm/ppm.h mm/pmm.h \
+ arch/tsar/arch-pmm.h kern/thread.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/kfifo.d
===================================================================
--- trunk/kernel/obj.tsar/kern/kfifo.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/kfifo.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/kern/kfifo.o: kern/kfifo.c kern/cpu.h libk/utils.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/kfifo.h
Index: trunk/kernel/obj.tsar/kern/kthread_create.d
===================================================================
--- trunk/kernel/obj.tsar/kern/kthread_create.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/kthread_create.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/kthread_create.o: kern/kthread_create.c mm/kmem.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h mm/kcm.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/thread.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h mm/ppm.h kern/cluster.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/kern/ku_transfert.d
===================================================================
--- trunk/kernel/obj.tsar/kern/ku_transfert.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/ku_transfert.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/ku_transfert.o: kern/ku_transfert.c kern/ku_transfert.h \
+ kern/cpu.h libk/utils.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/cluster.h kern/mcs_sync.h mm/ppm.h \
+ kern/wait_queue.h kern/kdmsg.h libk/boot-info.h mm/heap_manager.h \
+ kern/thread.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/mcs_sync.d
===================================================================
--- trunk/kernel/obj.tsar/kern/mcs_sync.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/mcs_sync.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/mcs_sync.o: kern/mcs_sync.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/types.h libk/stdint.h kern/mcs_sync.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/kern/mwmr.d
===================================================================
--- trunk/kernel/obj.tsar/kern/mwmr.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/mwmr.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/mwmr.o: kern/mwmr.c libk/errno.h vfs/vfs-errno.h \
+ kern/mwmr.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h \
+ kern/spinlock.h kern/thread.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/kern/radix.d
===================================================================
--- trunk/kernel/obj.tsar/kern/radix.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/radix.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/kern/radix.o: kern/radix.c libk/errno.h vfs/vfs-errno.h \
+ kern/radix.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h \
+ kern/spinlock.h libk/bits.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/kern/remote_fifo.d
===================================================================
--- trunk/kernel/obj.tsar/kern/remote_fifo.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/remote_fifo.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/remote_fifo.o: kern/remote_fifo.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cluster.h mm/ppm.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/kern/rpc.d
===================================================================
--- trunk/kernel/obj.tsar/kern/rpc.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/rpc.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/kern/rpc.o: kern/rpc.c kern/rpc.h libk/errno.h vfs/vfs-errno.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ kern/remote_fifo.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h mm/pmm.h \
+ arch/tsar/arch-pmm.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/thread.h kern/wait_queue.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h
Index: trunk/kernel/obj.tsar/kern/rr-sched.d
===================================================================
--- trunk/kernel/obj.tsar/kern/rr-sched.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/rr-sched.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/kern/rr-sched.o: kern/rr-sched.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h
Index: trunk/kernel/obj.tsar/kern/rr-sched_locked.d
===================================================================
--- trunk/kernel/obj.tsar/kern/rr-sched_locked.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/rr-sched_locked.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/rr-sched_locked.o: kern/rr-sched_locked.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h kern/kdmsg.h libk/types.h libk/stdint.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/cluster.h mm/ppm.h \
+ kern/wait_queue.h mm/heap_manager.h kern/dqdt.h kern/thread.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/rwlock.d
===================================================================
--- trunk/kernel/obj.tsar/kern/rwlock.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/rwlock.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/rwlock.o: kern/rwlock.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/rwlock.h
Index: trunk/kernel/obj.tsar/kern/scheduler.d
===================================================================
--- trunk/kernel/obj.tsar/kern/scheduler.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/scheduler.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/scheduler.o: kern/scheduler.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ libk/list.h kern/kmagics.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/keysdb.h \
+ kern/signal.h kern/cpu-trace.h kern/cluster.h mm/ppm.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/kern/semaphore.d
===================================================================
--- trunk/kernel/obj.tsar/kern/semaphore.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/semaphore.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/semaphore.o: kern/semaphore.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/semaphore.h
Index: trunk/kernel/obj.tsar/kern/signal.d
===================================================================
--- trunk/kernel/obj.tsar/kern/signal.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/signal.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/signal.o: kern/signal.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ libk/utils.h kern/signal.h kern/thread.h libk/list.h kern/kmagics.h \
+ kern/spinlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/pid.h
Index: trunk/kernel/obj.tsar/kern/spinlock.d
===================================================================
--- trunk/kernel/obj.tsar/kern/spinlock.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/spinlock.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/spinlock.o: kern/spinlock.c kern/system.h kern/hal-arch.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h
Index: trunk/kernel/obj.tsar/kern/sys_alarm.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_alarm.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_alarm.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_alarm.o: kern/sys_alarm.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/thread.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h kern/task.h kern/rwlock.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h kern/cpu-trace.h
Index: trunk/kernel/obj.tsar/kern/sys_barrier.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_barrier.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_barrier.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_barrier.o: kern/sys_barrier.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ kern/barrier.h
Index: trunk/kernel/obj.tsar/kern/sys_chdir.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_chdir.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_chdir.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_chdir.o: kern/sys_chdir.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ mm/mapper.h kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/sys-vfs.h kern/thread.h kern/task.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_chmod.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_chmod.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_chmod.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_chmod.o: kern/sys_chmod.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ mm/mapper.h kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/sys-vfs.h kern/thread.h kern/task.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_clock.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_clock.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_clock.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/kern/sys_clock.o: kern/sys_clock.c libk/errno.h vfs/vfs-errno.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h kern/cpu.h libk/utils.h libk/types.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/thread.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h
Index: trunk/kernel/obj.tsar/kern/sys_close.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_close.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_close.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_close.o: kern/sys_close.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_closedir.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_closedir.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_closedir.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_closedir.o: kern/sys_closedir.c vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/thread.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_cond_var.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_cond_var.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_cond_var.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_cond_var.o: kern/sys_cond_var.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ kern/semaphore.h kern/cond_var.h
Index: trunk/kernel/obj.tsar/kern/sys_creat.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_creat.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_creat.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_creat.o: kern/sys_creat.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h vfs/vfs.h kern/system.h kern/hal-arch.h \
+ libk/types.h libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_dma_memcpy.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_dma_memcpy.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_dma_memcpy.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/kern/sys_dma_memcpy.o: kern/sys_dma_memcpy.c libk/errno.h \
+ vfs/vfs-errno.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/event.h libk/list.h kern/kmagics.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/time.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/dma.h kern/thread.h kern/wait_queue.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h
Index: trunk/kernel/obj.tsar/kern/sys_exec.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_exec.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_exec.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_exec.o: kern/sys_exec.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/cluster.h mm/ppm.h mm/heap_manager.h kern/task.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ kern/keysdb.h kern/signal.h kern/pid.h kern/thread.h mm/ppn.h
Index: trunk/kernel/obj.tsar/kern/sys_fork.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_fork.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_fork.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_fork.o: kern/sys_fork.c libk/errno.h vfs/vfs-errno.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h kern/cpu.h libk/utils.h libk/types.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/cluster.h \
+ kern/mcs_sync.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h libk/boot-info.h \
+ mm/heap_manager.h kern/thread.h kern/dqdt.h kern/task.h kern/rwlock.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h kern/pid.h
Index: trunk/kernel/obj.tsar/kern/sys_fsync.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_fsync.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_fsync.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/kern/sys_fsync.o: kern/sys_fsync.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h
Index: trunk/kernel/obj.tsar/kern/sys_ftime.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_ftime.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_ftime.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/sys_ftime.o: kern/sys_ftime.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h
Index: trunk/kernel/obj.tsar/kern/sys_getcwd.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_getcwd.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_getcwd.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_getcwd.o: kern/sys_getcwd.c libk/libk.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/string.h \
+ libk/ctype.h vfs/vfs.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ libk/errno.h vfs/vfs-errno.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h libk/list.h kern/kmagics.h kern/kdmsg.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/bits.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h mm/ppm.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_getpid.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_getpid.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_getpid.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_getpid.o: kern/sys_getpid.c kern/task.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/list.h \
+ kern/kmagics.h libk/bits.h kern/spinlock.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_gettimeofday.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_gettimeofday.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_gettimeofday.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/sys_gettimeofday.o: kern/sys_gettimeofday.c kern/cpu.h \
+ libk/utils.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h
Index: trunk/kernel/obj.tsar/kern/sys_lseek.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_lseek.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_lseek.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_lseek.o: kern/sys_lseek.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/thread.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_madvise.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_madvise.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_madvise.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_madvise.o: kern/sys_madvise.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h mm/vmm.h libk/list.h kern/kmagics.h \
+ libk/rbtree.h kern/spinlock.h kern/rwlock.h kern/wait_queue.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/thread.h kern/task.h kern/signal.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h mm/page.h
Index: trunk/kernel/obj.tsar/kern/sys_mcntl.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_mcntl.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_mcntl.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_mcntl.o: kern/sys_mcntl.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/syscall.h kern/cluster.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h kern/spinlock.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/mcs_sync.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h libk/boot-info.h \
+ mm/heap_manager.h mm/vmm.h libk/rbtree.h kern/rwlock.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/task.h kern/signal.h \
+ kern/thread.h mm/page.h
Index: trunk/kernel/obj.tsar/kern/sys_mkdir.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_mkdir.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_mkdir.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_mkdir.o: kern/sys_mkdir.c vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_mkfifo.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_mkfifo.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_mkfifo.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_mkfifo.o: kern/sys_mkfifo.c kern/kdmsg.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/spinlock.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h vfs/vfs.h kern/rwlock.h kern/wait_queue.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_mmap.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_mmap.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_mmap.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_mmap.o: kern/sys_mmap.c libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_open.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_open.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_open.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_open.o: kern/sys_open.c libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/cpu-trace.h
Index: trunk/kernel/obj.tsar/kern/sys_opendir.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_opendir.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_opendir.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_opendir.o: kern/sys_opendir.c vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_pipe.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_pipe.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_pipe.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_pipe.o: kern/sys_pipe.c vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_ps.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_ps.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_ps.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_ps.o: kern/sys_ps.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/task.h libk/list.h \
+ kern/kmagics.h libk/bits.h kern/spinlock.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/pid.h kern/thread.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/kern/sys_read.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_read.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_read.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_read.o: kern/sys_read.c libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_readdir.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_readdir.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_readdir.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_readdir.o: kern/sys_readdir.c vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_rmdir.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_rmdir.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_rmdir.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_rmdir.o: kern/sys_rmdir.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/thread.h kern/task.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h \
+ kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_rwlock.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_rwlock.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_rwlock.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_rwlock.o: kern/sys_rwlock.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_sbrk.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_sbrk.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_sbrk.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_sbrk.o: kern/sys_sbrk.c libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_sem.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_sem.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_sem.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_sem.o: kern/sys_sem.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ kern/semaphore.h
Index: trunk/kernel/obj.tsar/kern/sys_signal.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_signal.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_signal.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_signal.o: kern/sys_signal.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h kern/pid.h
Index: trunk/kernel/obj.tsar/kern/sys_stat.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_stat.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_stat.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_stat.o: kern/sys_stat.c libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/cpu-trace.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_create.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_create.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_create.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_thread_create.o: kern/sys_thread_create.c libk/errno.h \
+ vfs/vfs-errno.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h kern/cpu.h \
+ libk/utils.h libk/types.h libk/stdint.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h kern/mcs_sync.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h \
+ libk/boot-info.h mm/heap_manager.h kern/thread.h kern/task.h \
+ kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_detach.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_detach.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_detach.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_thread_detach.o: kern/sys_thread_detach.c libk/list.h \
+ kern/kmagics.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ kern/thread.h libk/types.h libk/stdint.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/task.h kern/rwlock.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_exit.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_exit.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_exit.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/kern/sys_thread_exit.o: kern/sys_thread_exit.c libk/list.h \
+ kern/kmagics.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ kern/thread.h libk/types.h libk/stdint.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h kern/dqdt.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_getattr.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_getattr.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_getattr.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/kern/sys_thread_getattr.o: kern/sys_thread_getattr.c \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/errno.h vfs/vfs-errno.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/bits.h kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/cluster.h kern/mcs_sync.h mm/ppm.h \
+ kern/wait_queue.h kern/kdmsg.h libk/boot-info.h mm/heap_manager.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_join.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_join.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_join.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_thread_join.o: kern/sys_thread_join.c libk/list.h \
+ kern/kmagics.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ kern/thread.h libk/types.h libk/stdint.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/task.h kern/rwlock.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_migrate.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_migrate.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_migrate.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_thread_migrate.o: kern/sys_thread_migrate.c kern/cpu.h \
+ libk/utils.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/keysdb.h \
+ kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_sleep.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_sleep.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_sleep.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_thread_sleep.o: kern/sys_thread_sleep.c \
+ kern/scheduler.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/rr-sched.h kern/thread.h \
+ kern/spinlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/task.h kern/rwlock.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_wakeup.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_wakeup.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_wakeup.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_thread_wakeup.o: kern/sys_thread_wakeup.c libk/errno.h \
+ vfs/vfs-errno.h kern/kmagics.h kern/cpu.h libk/utils.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h mm/kmem.h \
+ mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cluster.h mm/ppm.h \
+ kern/wait_queue.h mm/heap_manager.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h \
+ kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_thread_yield.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_thread_yield.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_thread_yield.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/sys_thread_yield.o: kern/sys_thread_yield.c kern/thread.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/kern/sys_times.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_times.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_times.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/sys_times.o: kern/sys_times.c kern/cpu.h libk/utils.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h
Index: trunk/kernel/obj.tsar/kern/sys_unlink.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_unlink.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_unlink.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/sys_unlink.o: kern/sys_unlink.c vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/thread.h
Index: trunk/kernel/obj.tsar/kern/sys_utls.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_utls.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_utls.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/sys_utls.o: kern/sys_utls.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/semaphore.h
Index: trunk/kernel/obj.tsar/kern/sys_write.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sys_write.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sys_write.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/kern/sys_write.o: kern/sys_write.c libk/errno.h vfs/vfs-errno.h \
+ kern/thread.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs.h kern/rwlock.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/sys-vfs.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/sysconf.d
===================================================================
--- trunk/kernel/obj.tsar/kern/sysconf.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/sysconf.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/kern/sysconf.o: kern/sysconf.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ fs/sysfs/sysfs.h libk/list.h kern/kmagics.h kern/metafs.h mm/kmem.h \
+ mm/kcm.h kern/spinlock.h mm/pmm.h arch/tsar/arch-pmm.h kern/thread.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/sysconf.h
Index: trunk/kernel/obj.tsar/kern/task.d
===================================================================
--- trunk/kernel/obj.tsar/kern/task.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/task.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/task.o: kern/task.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ libk/bits.h mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h \
+ kern/spinlock.h mm/page.h kern/atomic.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/vmm.h \
+ libk/rbtree.h kern/rwlock.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/thread.h kern/dqdt.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h kern/pid.h kern/task.h kern/signal.h
Index: trunk/kernel/obj.tsar/kern/thread_create.d
===================================================================
--- trunk/kernel/obj.tsar/kern/thread_create.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/thread_create.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/thread_create.o: kern/thread_create.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h \
+ kern/spinlock.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/thread.h \
+ kern/wait_queue.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/keysdb.h \
+ kern/signal.h kern/cluster.h mm/ppm.h mm/heap_manager.h mm/page.h
Index: trunk/kernel/obj.tsar/kern/thread_destroy.d
===================================================================
--- trunk/kernel/obj.tsar/kern/thread_destroy.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/thread_destroy.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/thread_destroy.o: kern/thread_destroy.c kern/cpu.h \
+ libk/utils.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/keysdb.h \
+ kern/signal.h kern/cluster.h mm/ppm.h mm/heap_manager.h mm/page.h
Index: trunk/kernel/obj.tsar/kern/thread_dup.d
===================================================================
--- trunk/kernel/obj.tsar/kern/thread_dup.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/thread_dup.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/thread_dup.o: kern/thread_dup.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/bits.h kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/thread.h kern/wait_queue.h kern/task.h \
+ kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h mm/page.h
Index: trunk/kernel/obj.tsar/kern/thread_idle.d
===================================================================
--- trunk/kernel/obj.tsar/kern/thread_idle.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/thread_idle.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/kern/thread_idle.o: kern/thread_idle.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h kern/mcs_sync.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h \
+ libk/boot-info.h mm/heap_manager.h kern/rt_timer.h kern/cpu-trace.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h \
+ mm/page.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/kern/thread_migrate.d
===================================================================
--- trunk/kernel/obj.tsar/kern/thread_migrate.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/thread_migrate.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/kern/thread_migrate.o: kern/thread_migrate.c libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/errno.h \
+ vfs/vfs-errno.h mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h \
+ kern/spinlock.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/thread.h \
+ kern/wait_queue.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h \
+ mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h \
+ vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/keysdb.h \
+ kern/signal.h kern/cluster.h mm/ppm.h mm/heap_manager.h kern/dqdt.h \
+ mm/page.h
Index: trunk/kernel/obj.tsar/kern/time.d
===================================================================
--- trunk/kernel/obj.tsar/kern/time.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/time.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/time.o: kern/time.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/thread.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ kern/rt_timer.h
Index: trunk/kernel/obj.tsar/kern/wait_queue.d
===================================================================
--- trunk/kernel/obj.tsar/kern/wait_queue.d	(revision 1)
+++ trunk/kernel/obj.tsar/kern/wait_queue.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/kern/wait_queue.o: kern/wait_queue.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/thread.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ kern/rt_timer.h
Index: trunk/kernel/obj.tsar/kldscript
===================================================================
--- trunk/kernel/obj.tsar/kldscript	(revision 1)
+++ trunk/kernel/obj.tsar/kldscript	(revision 1)
@@ -0,0 +1,28 @@
+vaddr = 0x00000000;
+SECTIONS
+{
+  .ktext vaddr : {
+    __ktext_start = .;
+    *(.kentry)
+    __kentry_end = .;
+    __uspace_start = .;
+    *(.uspace)
+    __uspace_end = .;
+    __virtual_end = .;
+      *(.text)
+      *(.rodata*)
+      . = ALIGN(0x1000);
+    __ktext_end = .;
+  }
+  .kdata : {
+    __kdata_start = .;
+    *(.data*)
+      *(.bss*)
+      *(COMMON*)
+      *(.scommon*)
+      . = ALIGN(0x1000);
+    __kdata_end = .;
+    __heap_start = .;
+    *(.kheader)
+  }
+}
Index: trunk/kernel/obj.tsar/ksh/cat.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/cat.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/cat.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/cat.o: ksh/cat.c libk/stdint.h libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h kern/sys-vfs.h vfs/vfs.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ libk/list.h kern/kmagics.h kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/cd.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/cd.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/cd.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/ksh/cd.o: ksh/cd.c ksh/kminiShell.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h
Index: trunk/kernel/obj.tsar/ksh/clear.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/clear.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/clear.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/clear.o: ksh/clear.c ksh/kminiShell.h vfs/vfs.h \
+ kern/system.h kern/hal-arch.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h arch/tsar/arch.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ libk/list.h kern/kmagics.h kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h
Index: trunk/kernel/obj.tsar/ksh/cp.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/cp.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/cp.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/ksh/cp.o: ksh/cp.c libk/string.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/eomtkp.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/eomtkp.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/eomtkp.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/eomtkp.o: ksh/eomtkp.c kern/cpu.h libk/utils.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h kern/spinlock.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h ksh/kminiShell.h vfs/vfs.h \
+ kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h ksh/sgiImg.h kern/sys-vfs.h
Index: trunk/kernel/obj.tsar/ksh/error.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/error.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/error.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/error.o: ksh/error.c kern/system.h kern/hal-arch.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h ksh/kminiShell.h vfs/vfs.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ libk/list.h kern/kmagics.h kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h
Index: trunk/kernel/obj.tsar/ksh/exec_func.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/exec_func.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/exec_func.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/ksh/exec_func.o: ksh/exec_func.c libk/stdint.h kern/thread.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/instrument.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/instrument.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/instrument.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/ksh/instrument.o: ksh/instrument.c fs/fat32/fat32.h mm/kmem.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h mm/kcm.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h fs/fat32/fat32-private.h \
+ ksh/kminiShell.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ mm/mapper.h kern/radix.h kern/ku_transfert.h fs/devfs/devfs.h \
+ kern/htable.h
Index: trunk/kernel/obj.tsar/ksh/kill.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/kill.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/kill.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/ksh/kill.o: ksh/kill.c ksh/kminiShell.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/thread.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/ksh/ksh_cpu_state.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/ksh_cpu_state.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/ksh_cpu_state.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/ksh/ksh_cpu_state.o: ksh/ksh_cpu_state.c libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h ksh/kminiShell.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/stdint.h arch/tsar/arch.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ libk/list.h kern/kmagics.h kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/thread.h \
+ kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h kern/keysdb.h kern/signal.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h
Index: trunk/kernel/obj.tsar/ksh/ksh_set_tty.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/ksh_set_tty.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/ksh_set_tty.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/ksh_set_tty.o: ksh/ksh_set_tty.c ksh/kminiShell.h vfs/vfs.h \
+ kern/system.h kern/hal-arch.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h arch/tsar/arch.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ libk/list.h kern/kmagics.h kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h
Index: trunk/kernel/obj.tsar/ksh/ls.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/ls.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/ls.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/ls.o: ksh/ls.c libk/stdint.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h kern/atomic.h \
+ kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h kern/kdmsg.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/miniShell.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/miniShell.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/miniShell.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/ksh/miniShell.o: ksh/miniShell.c kern/system.h kern/hal-arch.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h arch/tsar/arch.h libk/string.h vfs/vfs.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ libk/list.h kern/kmagics.h kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/thread.h \
+ ksh/kminiShell.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/ksh/miniShellIo.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/miniShellIo.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/miniShellIo.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/ksh/miniShellIo.o: ksh/miniShellIo.c libk/ctype.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/libk.h \
+ libk/string.h kern/thread.h libk/list.h kern/kmagics.h kern/spinlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h kern/sys-vfs.h vfs/vfs.h \
+ kern/rwlock.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/mkdir_func.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/mkdir_func.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/mkdir_func.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/mkdir_func.o: ksh/mkdir_func.c libk/stdint.h vfs/vfs.h \
+ kern/system.h kern/hal-arch.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/mkfifo_func.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/mkfifo_func.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/mkfifo_func.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/mkfifo_func.o: ksh/mkfifo_func.c libk/stdint.h vfs/vfs.h \
+ kern/system.h kern/hal-arch.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/ppm_func.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/ppm_func.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/ppm_func.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/ksh/ppm_func.o: ksh/ppm_func.c ksh/kminiShell.h vfs/vfs.h \
+ kern/system.h kern/hal-arch.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h arch/tsar/arch.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/rwlock.h kern/wait_queue.h \
+ libk/list.h kern/kmagics.h kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h mm/ppm.h mm/page.h \
+ kern/thread.h kern/cluster.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/ksh/ps.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/ps.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/ps.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/ksh/ps.o: ksh/ps.c libk/list.h kern/kmagics.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h kern/thread.h libk/types.h libk/stdint.h \
+ kern/spinlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/pid.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/ksh/pwd_func.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/pwd_func.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/pwd_func.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/pwd_func.o: ksh/pwd_func.c libk/stdint.h vfs/vfs.h \
+ kern/system.h kern/hal-arch.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/atomic.h kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h \
+ kern/kdmsg.h kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/ksh/rm.d
===================================================================
--- trunk/kernel/obj.tsar/ksh/rm.d	(revision 1)
+++ trunk/kernel/obj.tsar/ksh/rm.d	(revision 1)
@@ -0,0 +1,14 @@
+obj.tsar/ksh/rm.o: ksh/rm.c libk/stdint.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h kern/atomic.h \
+ kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h kern/kdmsg.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ ksh/kminiShell.h
Index: trunk/kernel/obj.tsar/libk/atoi.d
===================================================================
--- trunk/kernel/obj.tsar/libk/atoi.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/atoi.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/atoi.o: libk/atoi.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/ctype.h
Index: trunk/kernel/obj.tsar/libk/bits.d
===================================================================
--- trunk/kernel/obj.tsar/libk/bits.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/bits.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/libk/bits.o: libk/bits.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/bits.h kern/kdmsg.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/libk/ctype.d
===================================================================
--- trunk/kernel/obj.tsar/libk/ctype.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/ctype.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/ctype.o: libk/ctype.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h
Index: trunk/kernel/obj.tsar/libk/elf.d
===================================================================
--- trunk/kernel/obj.tsar/libk/elf.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/elf.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/libk/elf.o: libk/elf.c libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ kern/system.h kern/hal-arch.h libk/types.h libk/stdint.h \
+ arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h kern/thread.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h mm/ppm.h \
+ libk/elf.h
Index: trunk/kernel/obj.tsar/libk/iprintk.d
===================================================================
--- trunk/kernel/obj.tsar/libk/iprintk.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/iprintk.d	(revision 1)
@@ -0,0 +1,5 @@
+obj.tsar/libk/iprintk.o: libk/iprintk.c kern/remote_access.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h \
+ cpu/mipsel/cpu-remote.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ libk/libk.h libk/string.h libk/ctype.h
Index: trunk/kernel/obj.tsar/libk/md5.d
===================================================================
--- trunk/kernel/obj.tsar/libk/md5.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/md5.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/md5.o: libk/md5.c libk/md5.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/string.h
Index: trunk/kernel/obj.tsar/libk/memcpy.d
===================================================================
--- trunk/kernel/obj.tsar/libk/memcpy.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/memcpy.d	(revision 1)
@@ -0,0 +1,10 @@
+obj.tsar/libk/memcpy.o: libk/memcpy.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/cpu.h \
+ libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h \
+ libk/list.h kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/ctype.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/libk/memset.d
===================================================================
--- trunk/kernel/obj.tsar/libk/memset.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/memset.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/libk/memset.o: libk/memset.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h kern/kdmsg.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/libk/rand.d
===================================================================
--- trunk/kernel/obj.tsar/libk/rand.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/rand.d	(revision 1)
@@ -0,0 +1,11 @@
+obj.tsar/libk/rand.o: libk/rand.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/thread.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h
Index: trunk/kernel/obj.tsar/libk/rbtree.d
===================================================================
--- trunk/kernel/obj.tsar/libk/rbtree.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/rbtree.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/rbtree.o: libk/rbtree.c libk/rbtree.h libk/list.h \
+ kern/kmagics.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h
Index: trunk/kernel/obj.tsar/libk/sprintk.d
===================================================================
--- trunk/kernel/obj.tsar/libk/sprintk.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/sprintk.d	(revision 1)
@@ -0,0 +1,12 @@
+obj.tsar/libk/sprintk.o: libk/sprintk.c kern/thread.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/libk/strchr.d
===================================================================
--- trunk/kernel/obj.tsar/libk/strchr.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/strchr.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/strchr.o: libk/strchr.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h
Index: trunk/kernel/obj.tsar/libk/strcmp.d
===================================================================
--- trunk/kernel/obj.tsar/libk/strcmp.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/strcmp.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/strcmp.o: libk/strcmp.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/ctype.h
Index: trunk/kernel/obj.tsar/libk/strcpy.d
===================================================================
--- trunk/kernel/obj.tsar/libk/strcpy.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/strcpy.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/strcpy.o: libk/strcpy.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h
Index: trunk/kernel/obj.tsar/libk/strlen.d
===================================================================
--- trunk/kernel/obj.tsar/libk/strlen.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/strlen.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/strlen.o: libk/strlen.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h
Index: trunk/kernel/obj.tsar/libk/strrchr.d
===================================================================
--- trunk/kernel/obj.tsar/libk/strrchr.d	(revision 1)
+++ trunk/kernel/obj.tsar/libk/strrchr.d	(revision 1)
@@ -0,0 +1,3 @@
+obj.tsar/libk/strrchr.o: libk/strrchr.c libk/string.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h
Index: trunk/kernel/obj.tsar/mm/heap_manager.d
===================================================================
--- trunk/kernel/obj.tsar/mm/heap_manager.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/heap_manager.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/mm/heap_manager.o: mm/heap_manager.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/spinlock.h libk/bits.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h \
+ kern/kmagics.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/thread.h \
+ kern/wait_queue.h kern/cluster.h mm/ppm.h mm/heap_manager.h mm/page.h \
+ mm/pmm.h arch/tsar/arch-pmm.h
Index: trunk/kernel/obj.tsar/mm/kcm.d
===================================================================
--- trunk/kernel/obj.tsar/mm/kcm.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/kcm.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/mm/kcm.o: mm/kcm.c libk/list.h kern/kmagics.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/types.h libk/stdint.h mm/kcm.h kern/spinlock.h \
+ libk/libk.h libk/string.h libk/ctype.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h mm/kmem.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/pmm.h arch/tsar/arch-pmm.h mm/ppm.h \
+ kern/wait_queue.h kern/thread.h mm/page.h kern/cluster.h \
+ mm/heap_manager.h
Index: trunk/kernel/obj.tsar/mm/kmem.d
===================================================================
--- trunk/kernel/obj.tsar/mm/kmem.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/kmem.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/mm/kmem.o: mm/kmem.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/errno.h vfs/vfs-errno.h \
+ kern/spinlock.h mm/kmem.h mm/kcm.h libk/list.h kern/kmagics.h \
+ mm/heap_manager.h mm/ppm.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/page.h kern/cluster.h kern/thread.h kern/dma.h \
+ kern/blkio.h kern/task.h kern/rwlock.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h \
+ fs/ramfs/ramfs.h kern/semaphore.h kern/cond_var.h kern/barrier.h
Index: trunk/kernel/obj.tsar/mm/mapper.d
===================================================================
--- trunk/kernel/obj.tsar/mm/mapper.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/mapper.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/mm/mapper.o: mm/mapper.c mm/mapper.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h kern/radix.h mm/kmem.h mm/kcm.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h kern/mcs_sync.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h \
+ libk/errno.h vfs/vfs-errno.h libk/bits.h kern/atomic.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/thread.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h mm/page.h kern/blkio.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h mm/ppn.h
Index: trunk/kernel/obj.tsar/mm/page.d
===================================================================
--- trunk/kernel/obj.tsar/mm/page.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/page.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/mm/page.o: mm/page.c kern/atomic.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/types.h libk/stdint.h libk/list.h \
+ kern/kmagics.h kern/thread.h kern/spinlock.h kern/wait_queue.h \
+ kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h \
+ kern/event.h kern/time.h kern/device.h kern/driver.h kern/metafs.h \
+ libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/page.h mm/mapper.h kern/radix.h kern/rwlock.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/task.h mm/vmm.h libk/rbtree.h \
+ mm/vm_region.h kern/keysdb.h kern/signal.h
Index: trunk/kernel/obj.tsar/mm/ppm.d
===================================================================
--- trunk/kernel/obj.tsar/mm/ppm.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/ppm.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/mm/ppm.o: mm/ppm.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/list.h kern/kmagics.h \
+ libk/bits.h mm/pmm.h arch/tsar/arch-pmm.h mm/page.h kern/atomic.h \
+ kern/spinlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/ppm.h kern/thread.h \
+ kern/cluster.h mm/heap_manager.h kern/task.h kern/rwlock.h mm/vmm.h \
+ libk/rbtree.h mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h \
+ vfs/vfs-params.h vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h \
+ fs/devfs/devfs.h kern/htable.h kern/keysdb.h kern/signal.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/mm/ppn.d
===================================================================
--- trunk/kernel/obj.tsar/mm/ppn.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/ppn.d	(revision 1)
@@ -0,0 +1,13 @@
+obj.tsar/mm/ppn.o: mm/ppn.c kern/atomic.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/types.h libk/stdint.h kern/spinlock.h \
+ libk/list.h kern/kmagics.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h mm/ppn.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/page.h kern/thread.h kern/cluster.h mm/ppm.h \
+ mm/heap_manager.h
Index: trunk/kernel/obj.tsar/mm/vm_region.d
===================================================================
--- trunk/kernel/obj.tsar/mm/vm_region.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/vm_region.d	(revision 1)
@@ -0,0 +1,15 @@
+obj.tsar/mm/vm_region.o: mm/vm_region.c libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/list.h kern/kmagics.h \
+ libk/errno.h vfs/vfs-errno.h libk/libk.h libk/string.h libk/ctype.h \
+ libk/bits.h kern/thread.h kern/spinlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h kern/task.h kern/rwlock.h \
+ mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h mm/vm_region.h \
+ mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h vfs/vfs-private.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/keysdb.h kern/signal.h mm/ppm.h mm/page.h mm/ppn.h
Index: trunk/kernel/obj.tsar/mm/vmm.d
===================================================================
--- trunk/kernel/obj.tsar/mm/vmm.d	(revision 1)
+++ trunk/kernel/obj.tsar/mm/vmm.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/mm/vmm.o: mm/vmm.c libk/errno.h vfs/vfs-errno.h libk/libk.h \
+ libk/types.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h \
+ libk/stdint.h libk/string.h libk/ctype.h libk/bits.h kern/task.h \
+ libk/list.h kern/kmagics.h kern/spinlock.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h \
+ kern/rpc.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h kern/cluster.h \
+ mm/ppm.h mm/heap_manager.h kern/semaphore.h mm/page.h mm/ppn.h
Index: trunk/kernel/obj.tsar/vfs/kvfsd.d
===================================================================
--- trunk/kernel/obj.tsar/vfs/kvfsd.d	(revision 1)
+++ trunk/kernel/obj.tsar/vfs/kvfsd.d	(revision 1)
@@ -0,0 +1,17 @@
+obj.tsar/vfs/kvfsd.o: vfs/kvfsd.c libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h kern/kdmsg.h \
+ libk/types.h libk/stdint.h kern/spinlock.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/event.h kern/time.h kern/device.h kern/driver.h \
+ kern/metafs.h libk/libk.h libk/string.h libk/ctype.h mm/kmem.h mm/kcm.h \
+ fs/sysfs/sysfs.h kern/rpc.h libk/errno.h vfs/vfs-errno.h libk/bits.h \
+ kern/atomic.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h kern/thread.h kern/wait_queue.h vfs/vfs.h \
+ kern/rwlock.h vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h \
+ kern/radix.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h \
+ arch/tsar/arch-pmm.h mm/vm_region.h kern/keysdb.h kern/signal.h \
+ kern/cpu-trace.h kern/cluster.h mm/ppm.h mm/heap_manager.h \
+ kern/rt_timer.h kern/sysconf.h mm/page.h kern/dqdt.h
Index: trunk/kernel/obj.tsar/vfs/vfs.d
===================================================================
--- trunk/kernel/obj.tsar/vfs/vfs.d	(revision 1)
+++ trunk/kernel/obj.tsar/vfs/vfs.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/vfs/vfs.o: vfs/vfs.c kern/scheduler.h libk/types.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/stdint.h libk/list.h kern/kmagics.h \
+ kern/rr-sched.h kern/rwlock.h kern/wait_queue.h kern/kdmsg.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h \
+ arch/tsar/arch.h cpu/mipsel/cpu-regs.h kern/event.h kern/time.h \
+ kern/device.h kern/driver.h kern/metafs.h libk/libk.h libk/string.h \
+ libk/ctype.h mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h mm/mapper.h kern/radix.h kern/ku_transfert.h \
+ fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h kern/thread.h \
+ kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h kern/keysdb.h kern/signal.h mm/page.h mm/ppm.h \
+ kern/cpu-trace.h
Index: trunk/kernel/obj.tsar/vfs/vfs_cache.d
===================================================================
--- trunk/kernel/obj.tsar/vfs/vfs_cache.d	(revision 1)
+++ trunk/kernel/obj.tsar/vfs/vfs_cache.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/vfs/vfs_cache.o: vfs/vfs_cache.c kern/atomic.h libk/config.h \
+ cpu/mipsel/cpu-config.h arch/tsar/arch-config.h mm/mm-config.h \
+ kern/kernel-config.h libk/types.h libk/stdint.h vfs/vfs.h kern/system.h \
+ kern/hal-arch.h arch/tsar/arch.h libk/errno.h vfs/vfs-errno.h \
+ kern/rwlock.h kern/wait_queue.h libk/list.h kern/kmagics.h kern/kdmsg.h \
+ kern/spinlock.h kern/mcs_sync.h libk/boot-info.h kern/cpu.h libk/utils.h \
+ kern/hal-cpu.h cpu/mipsel/cpu-asm.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/bits.h \
+ kern/remote_access.h cpu/mipsel/cpu-remote.h kern/remote_fifo.h \
+ vfs/vfs-params.h vfs/vfs-private.h mm/mapper.h kern/radix.h \
+ kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h kern/htable.h \
+ kern/task.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h kern/keysdb.h kern/signal.h kern/thread.h kern/cluster.h \
+ mm/ppm.h mm/heap_manager.h
Index: trunk/kernel/obj.tsar/vfs/vfs_file.d
===================================================================
--- trunk/kernel/obj.tsar/vfs/vfs_file.d	(revision 1)
+++ trunk/kernel/obj.tsar/vfs/vfs_file.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/vfs/vfs_file.o: vfs/vfs_file.c kern/task.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h libk/list.h \
+ kern/kmagics.h libk/bits.h kern/spinlock.h kern/atomic.h kern/rwlock.h \
+ kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h libk/boot-info.h \
+ kern/cpu.h libk/utils.h kern/hal-cpu.h cpu/mipsel/cpu-asm.h \
+ kern/system.h kern/hal-arch.h arch/tsar/arch.h cpu/mipsel/cpu-regs.h \
+ kern/scheduler.h kern/rr-sched.h kern/event.h kern/time.h kern/device.h \
+ kern/driver.h kern/metafs.h libk/libk.h libk/string.h libk/ctype.h \
+ mm/kmem.h mm/kcm.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h kern/thread.h mm/page.h \
+ mm/ppm.h
Index: trunk/kernel/obj.tsar/vfs/vfs_init.d
===================================================================
--- trunk/kernel/obj.tsar/vfs/vfs_init.d	(revision 1)
+++ trunk/kernel/obj.tsar/vfs/vfs_init.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/vfs/vfs_init.o: vfs/vfs_init.c mm/kmem.h libk/types.h \
+ libk/config.h cpu/mipsel/cpu-config.h arch/tsar/arch-config.h \
+ mm/mm-config.h kern/kernel-config.h libk/stdint.h mm/kcm.h libk/list.h \
+ kern/kmagics.h kern/spinlock.h kern/task.h libk/bits.h kern/atomic.h \
+ kern/rwlock.h kern/wait_queue.h kern/kdmsg.h kern/mcs_sync.h \
+ libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h kern/remote_access.h cpu/mipsel/cpu-remote.h \
+ kern/remote_fifo.h mm/vmm.h libk/rbtree.h mm/pmm.h arch/tsar/arch-pmm.h \
+ mm/vm_region.h mm/mapper.h kern/radix.h vfs/vfs.h vfs/vfs-params.h \
+ vfs/vfs-private.h kern/ku_transfert.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/keysdb.h kern/signal.h mm/page.h kern/thread.h \
+ kern/cluster.h mm/ppm.h mm/heap_manager.h fs/ramfs/ramfs.h
Index: trunk/kernel/obj.tsar/vfs/vfs_lookup.d
===================================================================
--- trunk/kernel/obj.tsar/vfs/vfs_lookup.d	(revision 1)
+++ trunk/kernel/obj.tsar/vfs/vfs_lookup.d	(revision 1)
@@ -0,0 +1,16 @@
+obj.tsar/vfs/vfs_lookup.o: vfs/vfs_lookup.c vfs/vfs-private.h \
+ kern/spinlock.h libk/config.h cpu/mipsel/cpu-config.h \
+ arch/tsar/arch-config.h mm/mm-config.h kern/kernel-config.h libk/types.h \
+ libk/stdint.h libk/list.h kern/kmagics.h mm/mapper.h kern/radix.h \
+ mm/kmem.h mm/kcm.h kern/mcs_sync.h kern/rwlock.h kern/wait_queue.h \
+ kern/kdmsg.h libk/boot-info.h kern/cpu.h libk/utils.h kern/hal-cpu.h \
+ cpu/mipsel/cpu-asm.h kern/system.h kern/hal-arch.h arch/tsar/arch.h \
+ cpu/mipsel/cpu-regs.h kern/scheduler.h kern/rr-sched.h kern/event.h \
+ kern/time.h kern/device.h kern/driver.h kern/metafs.h libk/libk.h \
+ libk/string.h libk/ctype.h fs/sysfs/sysfs.h kern/rpc.h libk/errno.h \
+ vfs/vfs-errno.h libk/bits.h kern/atomic.h kern/remote_access.h \
+ cpu/mipsel/cpu-remote.h kern/remote_fifo.h vfs/vfs-params.h \
+ kern/ku_transfert.h kern/cpu-trace.h mm/ppm.h mm/pmm.h \
+ arch/tsar/arch-pmm.h vfs/vfs.h fs/fat32/fat32.h fs/devfs/devfs.h \
+ kern/htable.h kern/task.h mm/vmm.h libk/rbtree.h mm/vm_region.h \
+ kern/keysdb.h kern/signal.h kern/thread.h
Index: trunk/kernel/syscalls/sys_alarm.c
===================================================================
--- trunk/kernel/syscalls/sys_alarm.c	(revision 690)
+++ trunk/kernel/syscalls/sys_alarm.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_alarm.c - timed sleep/wakeup
+ * kern/sys_alarm.c - timed sleep/wakeup
  * 
- * Author    Alain Greiner (2016,2017)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,29 +17,45 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
+#include <types.h>
 #include <thread.h>
-#include <printk.h>
 #include <cluster.h>
-#include <process.h>
+#include <task.h>
+#include <time.h>
 #include <scheduler.h>
-#include <core.h>
+#include <cpu.h>
+#include <cpu-trace.h>
 
-#include <syscalls.h>
+EVENT_HANDLER(sys_alarm_event_handler)
+{
+	struct thread_s *thread;
 
-////////////////////////////////
-int sys_alarm( uint32_t cycles )
+	thread = event_get_argument(event);
+	sched_wakeup(thread);
+	return 0;
+}
+
+int sys_alarm (unsigned nb_sec)
 {
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
+	struct thread_s *this;
+	struct event_s event;
+	struct alarm_info_s info;
 
-    printk("\n[ERROR] in %s for thread %x in process %x : not implemented yet\n",
-    __FUNCTION__ , this->trdid , process->pid , cycles );
-    return -1;
+	if( nb_sec == 0)
+		return 0;
+
+	this = current_thread;
+	event_set_handler(&event, &sys_alarm_event_handler);
+	event_set_priority(&event, E_FUNC);
+	event_set_argument(&event,this);
+	info.event = &event;
+
+	alarm_wait(&info, nb_sec * 4);
+	sched_sleep(this);
+	return 0;
 }
 
 
-
Index: trunk/kernel/syscalls/sys_barrier.c
===================================================================
--- trunk/kernel/syscalls/sys_barrier.c	(revision 690)
+++ trunk/kernel/syscalls/sys_barrier.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_barrier.c - Access a POSIX barrier.
+ * kern/sys_barrier.c - barrier service interface for userland
  * 
- * authors       Alain Greiner (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,199 +17,96 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
+#include <types.h>
 #include <errno.h>
 #include <thread.h>
-#include <printk.h>
+#include <task.h>
+#include <kmem.h>
 #include <vmm.h>
-#include <syscalls.h>
-#include <remote_barrier.h>
+#include <kmagics.h>
+#include <barrier.h>
 
-/////////////////////////////////////////////////////////////////////////////////
-// This function returns a printable string for the barrier related command type.
-/////////////////////////////////////////////////////////////////////////////////
+int sys_barrier(struct barrier_s **barrier, uint_t operation, uint_t count)
+{
+	kmem_req_t req;
+	struct barrier_s *ibarrier;
+	error_t err = EINVAL;
+  
+	if((err = vmm_check_address("usr barrier ptr", 
+				    current_task, 
+				    barrier,
+				    sizeof(struct barrier_s*))))
+		goto SYS_BARRIER_END;
 
-#if DEBUG_SYS_SOCKET || DEBUG_SYSCALLS_ERROR
-static char* barrier_cmd_str( uint32_t type )
+	if((err = cpu_copy_from_uspace(&ibarrier, barrier, sizeof(struct barrier_s *))))
+		goto SYS_BARRIER_END;
+
+	switch(operation)
+	{
+	case BARRIER_INIT_PRIVATE:
+	case BARRIER_INIT_SHARED:
+		req.type  = KMEM_BARRIER;
+		req.size  = sizeof(*ibarrier);
+		req.flags = AF_USER;
+
+		if((ibarrier = kmem_alloc(&req)) == NULL)
+		{
+			err = ENOMEM;
+			break;
+		}
+    
+		if((err = barrier_init(ibarrier, count, operation)))
+			break;
+    
+		if((err = cpu_copy_to_uspace(barrier, &ibarrier, sizeof(struct barrier_s *))))
+		{
+			req.ptr = ibarrier;
+			kmem_free(&req);
+		}
+		break;
+
+	case BARRIER_WAIT:
+
+		if((err = vmm_check_object(ibarrier, struct barrier_s, BARRIER_ID)))
+			break;
+
+		err = barrier_wait(ibarrier);
+		break;
+
+	case BARRIER_DESTROY:
+    
+		if((err = vmm_check_object(ibarrier, struct barrier_s, BARRIER_ID)))
+			break;
+    
+		if((err = barrier_destroy(ibarrier)))
+			break;
+   
+		req.type = KMEM_BARRIER;
+		req.ptr  = ibarrier;
+		kmem_free(&req);
+		return 0;
+
+	default:
+		err = EINVAL;
+	}
+
+SYS_BARRIER_END:
+	current_thread->info.errno = err;
+	return err;
+}
+
+KMEM_OBJATTR_INIT(barrier_kmem_init)
 {
-    if     ( type == BARRIER_INIT     ) return "INIT"; 
-    else if( type == BARRIER_WAIT     ) return "WAIT"; 
-    else if( type == BARRIER_DESTROY  ) return "DESTROY";
-    else                                return "undefined";
+	attr->type   = KMEM_BARRIER;
+	attr->name   = "KCM Barrier";
+	attr->size   = sizeof(struct barrier_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_BARRIER_MIN;
+	attr->max    = CONFIG_BARRIER_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+	return 0;
 }
-#endif
-
-//////////////////////////////////
-int sys_barrier( intptr_t   vaddr,
-                 uint32_t   operation,
-                 uint32_t   count,
-                 intptr_t   attr )   
-{
-	error_t                 error;
-    vseg_t                * vseg;
-    pthread_barrierattr_t   k_attr;
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SYS_BARRIER || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_BARRIER
-if( DEBUG_SYS_BARRIER < tm_start )
-printk("\n[%s] thread[%x,%x] enters for %s / count %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, barrier_cmd_str(operation), count,
-(uint32_t)tm_start );
-#endif
-
-    // check vaddr in user vspace
-	if( vmm_get_vseg( process , vaddr , &vseg ) )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[ERROR] in %s for %s : unmapped barrier %x / thread[%x,%x]\n",
-__FUNCTION__, barrier_cmd_str(operation), vaddr, process->pid, this->trdid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    // execute requested operation
-	switch( operation )
-	{
-        //////////////////
-	    case BARRIER_INIT:
-        {
-            if( attr != 0 )   // QDT barrier required
-            {
-                if( vmm_get_vseg( process , attr , &vseg ) )
-                {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[ERROR] in %s for INIT : unmapped barrier attributes %x / thread[%x,%x]\n",
-__FUNCTION__ , attr , process->pid , this->trdid );
-#endif
-                    this->errno = EINVAL;
-                    return -1;
-                }
-  
-                // copy barrier attributes into kernel space
-                hal_copy_from_uspace( XPTR( local_cxy , &k_attr ),
-                                      (void *)attr,
-                                      sizeof(pthread_barrierattr_t) );
-
-                if ( count != k_attr.x_size * k_attr.y_size *k_attr.nthreads )  
-                {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[ERROR] in %s for INIT : count (%d) != x_size (%d) * y_size (%d) * nthreads (%x)\n",
-__FUNCTION__, count, k_attr.x_size, k_attr.y_size, k_attr.nthreads );
-#endif
-                    this->errno = EINVAL;
-                    return -1;
-                }
-  
-
-                // call relevant system function
-                error = generic_barrier_create( vaddr , count , &k_attr );
-            }
-            else               // simple barrier required
-            {
-                error = generic_barrier_create( vaddr , count , NULL );
-            }
-
-		    if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[ERROR] in %s for INIT : cannot create barrier %x / thread[%x,%x]\n",
-__FUNCTION__ , vaddr , process->pid , this->trdid );
-#endif
-                this->errno = ENOMEM;
-                return -1;
-            }
-			break;
-        }
-        //////////////////
-	    case BARRIER_WAIT:
-        {
-            xptr_t barrier_xp = generic_barrier_from_ident( vaddr );
-
-            if( barrier_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[ERROR] in %s for WAIT : barrier %x not registered / thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)vaddr , process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-            else                          // success
-            {
-                generic_barrier_wait( barrier_xp ); 
-            }
-            break;
-        }
-        /////////////////////
-	    case BARRIER_DESTROY:
-        {
-            xptr_t barrier_xp = generic_barrier_from_ident( vaddr );
-
-            if( barrier_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[ERROR] in %s for DESTROY : barrier %x not registered / thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)vaddr , process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-            else                          // success
-            {
-                generic_barrier_destroy( barrier_xp ); 
-            }
-            break;
-        }
-        ////////
-        default:
-        {
-            assert( __FUNCTION__, false, "illegal operation type <%x>", operation );
-        }
-	}  // end switch
-
-    hal_fence();
-
-#if (DEBUG_SYS_BARRIER || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_BARRIER
-if( DEBUG_SYS_BARRIER < tm_end )
-printk("\n[%s] thread[%x,%x] exit for %s / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, sys_barrier_op_str(operation), (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_BARRIER] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_BARRIER] , 1 );
-#endif
-
-	return 0;
-
-}  // end sys_barrier()
-
Index: trunk/kernel/syscalls/sys_chdir.c
===================================================================
--- trunk/kernel/syscalls/sys_chdir.c	(revision 690)
+++ trunk/kernel/syscalls/sys_chdir.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_chdir.c - kernel function implementing the "chdir" syscall.
+ * sys_chdir: change process current work directory
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Author    Alain Greiner (2016,2017,2018, 2019)
+ * This file is part of ALMOS-kernel.
  *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,122 +17,45 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <chdev.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
 #include <rwlock.h>
 #include <vfs.h>
-#include <errno.h>
+#include <sys-vfs.h>
 #include <thread.h>
-#include <printk.h>
-#include <process.h>
+#include <ku_transfert.h>
+#include <task.h>
 
-#include <syscalls.h>
+int sys_chdir (char *pathname)
+{
+	register error_t err = 0;
+	register struct thread_s *this;
+	register struct task_s *task;
+	struct ku_obj ku_path;
 
-/////////////////////////////////
-int sys_chdir ( char * pathname )
-{
-    error_t   error;
-    vseg_t  * vseg; 
-    xptr_t    root_inode_xp;
+	this = current_thread;
+	task = current_task;
 
-    char      kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SYS_CHDIR || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : pathname too long / thread[%x,%x]\n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    // check pathname in user space
-    if( vmm_get_vseg( process, (intptr_t)pathname , &vseg ) )
+	if(!pathname)
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : user buffer unmapped %x for thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)pathname , process->pid, this->trdid );
-#endif
-		this->errno = EINVAL;
-        return -1;
+		this->info.errno = EINVAL;
+		return -1;
+	}	
+      
+	KU_BUFF(ku_path, pathname);
+	rwlock_wrlock(&task->cwd_lock);
+	
+	if((err = vfs_chdir(&ku_path, &task->vfs_cwd)))
+	{
+		rwlock_unlock(&task->cwd_lock);
+		this->info.errno = (err < 0) ? -err : err;
+		return -1;
 	}
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_CHDIR
-if( DEBUG_SYS_CHDIR < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_start );
-#endif
-
-    // compute root inode for path 
-    if( kbuf[0] == '/' )                        // absolute path
-    {
-        // use extended pointer on VFS root inode
-        root_inode_xp = process->vfs_root_xp;
-    }
-    else                                        // relative path
-    {
-        // get cluster and local pointer on reference process
-        xptr_t      ref_xp  = process->ref_xp;
-        process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-        cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-        // use extended pointer on CWD inode
-        root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-    }
-
-    // call the relevant VFS function
-    error = vfs_chdir( root_inode_xp , kbuf );
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s / thread[%x,%x] : cannot change CWD\n",
-__FUNCTION__ , process->pid , this->trdid );
-#endif
-        this->errno = error;
-        return -1;
-    }
-
-    hal_fence();
-
-#if (DEBUG_SYS_CHDIR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_CHDIR
-if( DEBUG_SYS_CHDIR < tm_end )
-printk("\n[%s] thread[%x,%x] exit  / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_CHDIR] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_CHDIR] , 1 );
-#endif
-
-    return 0;
+   
+	rwlock_unlock(&task->cwd_lock);
+	return 0;
 }
Index: trunk/kernel/syscalls/sys_chmod.c
===================================================================
--- trunk/kernel/syscalls/sys_chmod.c	(revision 690)
+++ trunk/kernel/syscalls/sys_chmod.c	(revision 1)
@@ -1,16 +1,14 @@
 /*
- * sys_chmod.c - Change file access rights.
- *
- * Author       Alain Greiner  (2016,2017,2018,2019,2020)
- *
+ * sys_chmod: change file mode
+ * 
  * Copyright (c) 2015 UPMC Sorbonne Universites
  *
- * This file is part of ALMOS-MKH.
+ * This file is part of ALMOS-kernel.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,75 +16,46 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
+#include <rwlock.h>
 #include <vfs.h>
-#include <vmm.h>
-#include <printk.h>
+#include <sys-vfs.h>
 #include <thread.h>
-#include <process.h>
-#include <syscalls.h>
+#include <ku_transfert.h>
+#include <task.h>
 
-///////////////////////////////////
-int sys_chmod( char     * pathname,
-               uint32_t   rights __attribute__((unused)) )
+int sys_chmod (char *pathname, uint_t mode)
 {
-    char        kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
+	register error_t err = 0;
+	register struct thread_s *this;
+	register struct task_s *task;
+	struct ku_obj ku_path;
 
-    thread_t  * this    = CURRENT_THREAD;
+	this = current_thread;
+	task = current_task;
 
-#if DEBUG_SYS_CHMOD || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-process_t * process  = this->process;
-uint64_t    tm_start = hal_get_cycles();
-#endif
-
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / pathname too long\n",
-__FUNCTION__, this->trdid, process->pid );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-
-
-
-    printk("\n[ERROR] in %s : not implemented yet\n", __FUNCTION__ );
-    return -1;
-
-
-
-
-    hal_fence();
-
-#if (DEBUG_SYS_CHMOD || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_CHMOD
-if( DEBUG_SYS_CHMOD < tm_end )
-printk("\n[%s] thread[%x,%x] exit for / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_CHMOD] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_CHMOD] , 1 );
-#endif
-
-    return 0;
-
-}  // end sys_chmod()
+	if(!pathname || NOT_IN_USPACE(pathname))
+	{
+		this->info.errno = EINVAL;
+		return -1;
+	}	
+	
+      
+	KU_BUFF(ku_path, pathname);
+	rwlock_wrlock(&task->cwd_lock);
+	
+	if((err = vfs_chmod(&ku_path, &task->vfs_cwd, mode)))
+	{
+		rwlock_unlock(&task->cwd_lock);
+		this->info.errno = (err < 0) ? -err : err;
+		return -1;
+	}
+   
+	rwlock_unlock(&task->cwd_lock);
+	return 0;
+}
Index: trunk/kernel/syscalls/sys_clock.c
===================================================================
--- trunk/kernel/syscalls/sys_clock.c	(revision 1)
+++ trunk/kernel/syscalls/sys_clock.c	(revision 1)
@@ -0,0 +1,45 @@
+/*
+ * sys_clock: get system current time
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <config.h>
+#include <cpu.h>
+#include <thread.h>
+
+int sys_clock(uint64_t *val)
+{
+	error_t err;
+	uint64_t cycles;
+
+	if((val == NULL) || NOT_IN_USPACE((uint_t)val))
+	{
+		err = EINVAL;
+		goto fail_inval;
+	}
+
+	cycles = cpu_get_cycles(current_cpu);
+	err    = cpu_copy_to_uspace(val, &cycles, sizeof(cycles));
+
+fail_inval:
+	current_thread->info.errno = err;
+	return err; 
+}
Index: trunk/kernel/syscalls/sys_close.c
===================================================================
--- trunk/kernel/syscalls/sys_close.c	(revision 690)
+++ trunk/kernel/syscalls/sys_close.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_close.c  kernel function implementing the <close> syscall
+ * sys_close.c  close a process open file
  * 
- * Author       Alain Greiner (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,137 +17,40 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_special.h>
+#include <cpu.h>
+#include <device.h>
+#include <driver.h>
 #include <vfs.h>
+#include <sys-vfs.h>
 #include <process.h>
 #include <thread.h>
-#include <ksocket.h>
-#include <printk.h>
+#include <config.h>
 
-#include <syscalls.h>
-
-///////////////////////////////
-int sys_close ( uint32_t fdid )
+/////////////////////////////
+int sys_close ( uint32_t fd )
 {
-    error_t            error;
-    xptr_t             file_xp;
-    cxy_t              file_cxy;
-    vfs_file_t       * file_ptr;
-    vfs_file_type_t   file_type;
-
-	thread_t  * this    = CURRENT_THREAD;
-	process_t * process = this->process;
-
-#if DEBUG_SYS_CLOSE || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_CLOSE
-if( DEBUG_SYS_CLOSE < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter / fdid %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, fdid, (uint32_t)tm_start );
-#endif
- 
-    // check fdid argument
-	if( fdid >= CONFIG_PROCESS_FILE_MAX_NR )
+	register process_t * process = current_process;
+	register thread_t  * this    = current_thread;
+	struct vfs_file_s  * file    = NULL;
+	error_t              err;
+  
+	if(( fd >= CONFIG_TASK_FILE_MAX_NR ) || (process_fd_lookup( process , fd , &file )))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal file descriptor index = %d\n",
-__FUNCTION__ , process->pid , this->trdid , fdid );
-#endif
-		this->errno = EBADFD;
+		this->info.errno = EBADFD;
 		return -1;
 	}
 
-    // get extended pointer on remote file descriptor
-    file_xp = process_fd_get_xptr_from_local( process , fdid );
-
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / undefined file descriptor %d\n",
-__FUNCTION__ , process->pid , this->trdid , fdid );
-#endif
-        this->errno = EBADFD;
-		return -1;
-    }
-
-    // get file type
-    file_cxy  = GET_CXY( file_xp );
-    file_ptr  = GET_PTR( file_xp );
-    file_type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-
-    if( file_type == FILE_TYPE_DIR ) 
+	err = vfs_close( file , NULL );
+	if( err )
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / file descriptor %d is a directory\n",
-__FUNCTION__ , process->pid , this->trdid , fdid );
-#endif
-		this->errno = EBADFD;
-		return -1;
-	}
-    else if( file_type == FILE_TYPE_SOCK )
-    {
-        // call the relevant socket function
-        error = socket_close( file_xp , fdid );
-    }
-    else if( (file_type == FILE_TYPE_REG) ||
-             (file_type == FILE_TYPE_FIFO) )
-    {
-        // call the relevant VFS function
-	    error = vfs_close( file_xp , fdid );
-    }
-    else 
-    {
-           
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[WARNING] in %s : thread[%x,%x] / file_type (%s) unsupported / fdid %d\n",
-__FUNCTION__ , process->pid , this->trdid , vfs_inode_type_str(file_type) , fdid );
-#endif
-        error = 0;        
-    }
-
-	if( error )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] cannot close file descriptor %d\n",
-__FUNCTION__ , process->pid , this->trdid , fdid );
-#endif
-		this->errno = error;
+		this->info.errno = err;
 		return -1;
 	}
 
-	hal_fence();
-
-#if (DEBUG_SYS_CLOSE || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_CLOSE
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_CLOSE < tm_start )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_CLOSE] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_CLOSE] , 1 );
-#endif
-
+	process_fd_release( process , fd );
+	cpu_wbflush();
 	return 0;
 }
Index: trunk/kernel/syscalls/sys_closedir.c
===================================================================
--- trunk/kernel/syscalls/sys_closedir.c	(revision 690)
+++ trunk/kernel/syscalls/sys_closedir.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_closedir.c - Close an open VFS directory.
+ * sys_closedir.c close a process open directory
  * 
- * Author    Alain Greiner  (2016,2017,2018,2019,20120)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,89 +17,35 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
 #include <vfs.h>
-#include <printk.h>
+#include <sys-vfs.h>
 #include <thread.h>
 #include <process.h>
-#include <user_dir.h>
-#include <errno.h>
-#include <syscalls.h>
-#include <shared_syscalls.h>
 
-///////////////////////////////
-int sys_closedir ( DIR * dirp )
+////////////////////////////////
+int sys_closedir ( uint32_t fd )
 {
-    xptr_t         dir_xp;       // extended pointer on user_dir_t structure
-    user_dir_t   * dir_ptr;      // local pointer on user_dir_t structure
-    cxy_t          dir_cxy;      // cluster identifier (inode cluster)
+	register thread_t  * this    = current-thread;
+	register process_t * process = current_process;
+	struct vfs_file_s  * file    = NULL;
+	error_t              err;
 
-	thread_t  * this    = CURRENT_THREAD;  // client thread
-	process_t * process = this->process;   // client process
+	if(( fd >= CONFIG_TASK_FILE_MAX_NR ) || (process_fd_lookup( process , fd , &file )))
+	{
+		this->info.errno = EBADFD;
+		return -1;
+	}
 
-#if DEBUG_SYS_CLOSEDIR || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	err  = vfs_closedir( file , NULL );
+	if(err)
+	{
+		this->info.errno = (err < 0) ? -err : err;
+		return -1;
+	}
 
-#if DEBUG_SYS_CLOSEDIR
-if( DEBUG_SYS_CLOSEDIR < tm_start )
-printk("\n[%s] thread[%x,%x] enter for DIR <%x> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, dirp, (uint32_t)tm_start );
-#endif
- 
-    // get extended pointer on kernel user_dir_t structure from dirp
-    dir_xp  = user_dir_from_ident( (intptr_t)dirp );
-
-    if( dir_xp == XPTR_NULL )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / DIR pointer %x not registered\n",
-__FUNCTION__ , process->pid , this->trdid, dirp );
-#endif
-		this->errno = EINVAL;
-		return -1;
-	}	
-
-    // get cluster and local pointer for user_dir_t structure
-    dir_ptr = GET_PTR( dir_xp );
-    dir_cxy = GET_CXY( dir_xp );
-    
-    // delete both user_dir_t structure and dirent array
-    if( dir_cxy == local_cxy )
-    {
-        user_dir_destroy( dir_ptr,
-                          process->ref_xp );
-    }
-    else
-    {
-        rpc_user_dir_destroy_client( dir_cxy,
-                                     dir_ptr,
-                                     process->ref_xp );
-    }
-
-    hal_fence();
-
-#if (DEBUG_SYS_CLOSEDIR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_CLOSEDIR
-if( DEBUG_SYS_CLOSEDIR < tm_end )
-printk("\n[%s] thread[%x,%x] exit for DIR <%x> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, dirp, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_CLOSEDIR] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_CLOSEDIR] , 1 );
-#endif
-
-    return 0;
-
-}  // end sys_closedir()
+	process_fd_release( process , fd );
+	return 0;
+}
Index: trunk/kernel/syscalls/sys_cond_var.c
===================================================================
--- trunk/kernel/syscalls/sys_cond_var.c	(revision 1)
+++ trunk/kernel/syscalls/sys_cond_var.c	(revision 1)
@@ -0,0 +1,143 @@
+/*
+ * sys_cond_var: interface to access condition vraibles service
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <errno.h>
+#include <thread.h>
+#include <kmem.h>
+#include <task.h>
+#include <vmm.h>
+#include <kmagics.h>
+#include <semaphore.h>
+#include <cond_var.h>
+
+static inline bool_t isBadSem(struct semaphore_s *sem)
+{ 
+	return vmm_check_object(sem, struct semaphore_s, SEMAPHORE_ID);
+}
+
+static inline bool_t isBadCV(struct cv_s *cv)
+{ 
+	return vmm_check_object(cv, struct cv_s, COND_VAR_ID);
+}
+
+int sys_cond_var(struct cv_s **cv, uint_t operation, struct semaphore_s **sem)
+{
+	kmem_req_t req;
+	struct cv_s *icv;
+	struct semaphore_s *isem;
+	error_t err = EINVAL;
+ 
+	if((err = vmm_check_address("usr cv ptr", current_task,cv,sizeof(struct cv_s*))))
+		goto SYS_COND_END;
+
+	if((err = cpu_copy_from_uspace(&icv, cv, sizeof(struct cv_s *))))
+		goto SYS_COND_END;
+
+	switch(operation)
+	{
+	case CV_INIT:
+		req.type  = KMEM_CV;
+		req.size  = sizeof(*icv);
+		req.flags = AF_USER;
+    
+		if((icv = kmem_alloc(&req)) == NULL)
+		{
+			err = ENOMEM;
+			break;
+		}
+    
+		if((err = cv_init(icv)))
+			break;
+    
+		if((err = cpu_copy_to_uspace(cv, &icv, sizeof(struct cv_s *))))
+		{
+			req.ptr = icv;
+			kmem_free(&req);
+		}
+
+		break;
+
+	case CV_WAIT:
+		err = vmm_check_address("usr sem ptr", 
+					current_task, 
+					sem, sizeof(struct semaphore_s*));
+
+		if(err) break;
+
+		if((err = cpu_copy_from_uspace(&isem, sem, sizeof(struct semaphore_s *))))
+			break;
+
+		if(isBadSem(isem))
+			break;
+
+		if(isBadCV(icv))
+			break;
+    
+		return cv_wait(icv, isem);
+
+	case CV_SIGNAL:
+		if(isBadCV(icv))
+			break;
+    
+		return cv_signal(icv);
+
+	case CV_BROADCAST:
+		if(isBadCV(icv))
+			break;
+    
+		return cv_broadcast(icv);
+
+	case CV_DESTROY:
+		if(isBadCV(icv))
+			break;
+    
+		if((err = cv_destroy(icv)))
+			break;
+    
+		req.type = KMEM_CV;
+		req.ptr  = icv;
+		kmem_free(&req);
+		return 0;
+
+	default:
+		err = EINVAL;
+	}
+
+SYS_COND_END:
+	current_thread->info.errno = err;
+	return err;
+}
+
+KMEM_OBJATTR_INIT(cv_kmem_init)
+{
+	attr->type   = KMEM_CV;
+	attr->name   = "KCM Condition Variable";
+	attr->size   = sizeof(struct cv_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_CONDTION_VAR_MIN;
+	attr->max    = CONFIG_CONDTION_VAR_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+  
+	return 0;
+}
Index: trunk/kernel/syscalls/sys_condvar.c
===================================================================
--- trunk/kernel/syscalls/sys_condvar.c	(revision 690)
+++ 	(revision )
@@ -1,229 +1,0 @@
-/*
- * sys_condvar.c - Access a POSIX condvar.
- * 
- * Author    Alain Greiner  (2016,2017,2018,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <hal_vmm.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <vmm.h>
-#include <syscalls.h>
-#include <remote_condvar.h>
-#include <remote_mutex.h>
-
-
-#if DEBUG_SYS_CONDVAR
-/////////////////////////////////////////////////////
-static char * sys_convar_op_str( uint32_t operation )
-{
-  	if     ( operation == CONDVAR_INIT      ) return "INIT";
-  	else if( operation == CONDVAR_WAIT      ) return "WAIT";
-  	else if( operation == CONDVAR_SIGNAL    ) return "SIGNAL";
-  	else if( operation == CONDVAR_BROADCAST ) return "BROADCAST";
-  	else if( operation == CONDVAR_DESTROY   ) return "DESTROY";
-  	else                                      return "undefined";
-}
-#endif
-
-//////////////////////////////////////
-int sys_condvar( void         * condvar,
-                 uint32_t       operation,
-                 void         * mutex )
-{
-    vseg_t    * vseg;         // for condvar check
-	error_t     error;
- 
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SYS_CONDVAR
-uint64_t    tm_start;
-uint64_t    tm_end;
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_CONDVAR < tm_start )
-printk("\n[DBG] %s : thread %x in process %x enter for %s / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, sys_condvar_op_str( operation ), (uint32_t)tm_start );
-#endif
-
-    // check condvar in user vspace
-	error = vmm_get_vseg( process , (intptr_t)condvar , &vseg );
-
-	if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped condvar %x / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)condvar , this->trdid , process->pid );
-#endif
-        this->errno = error;
-        return -1;
-    }
-
-    // execute requested operation
-	switch( operation )
-	{
-        //////////////////
-        case CONDVAR_INIT:
-        {
-            error = remote_condvar_create( (intptr_t)condvar );
-    
-		    if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot create condvar %x / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)condvar , this->trdid , process->pid );
-#endif
-                this->errno = error;
-                return -1;
-            }
-		    break;
-        }
-        //////////////////
-	    case CONDVAR_WAIT:
-        {
-            // check mutex in user vspace
-	        error = vmm_get_vseg( process , (intptr_t)mutex , &vseg );
-
-	        if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped mutex %x / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)mutex , this->trdid , process->pid );
-#endif
-                this->errno = error;
-                return -1;
-            }
-
-            xptr_t condvar_xp = remote_condvar_from_ident( (intptr_t)condvar );
-
-            if( condvar_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : condvar %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)condvar , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-    
-            xptr_t mutex_xp = remote_mutex_from_ident( (intptr_t)mutex );
-
-            if( mutex_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)mutex , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            remote_condvar_wait( condvar_xp , mutex_xp );
-
-            break;
-        }
-        ////////////////////
-	    case CONDVAR_SIGNAL:
-        {
-            xptr_t condvar_xp = remote_condvar_from_ident( (intptr_t)condvar );
-
-            if( condvar_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : condvar %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)condvar , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            remote_condvar_signal( condvar_xp ); 
-            
-            break;
-        }
-        ///////////////////////
-	    case CONDVAR_BROADCAST:
-        {
-            xptr_t condvar_xp = remote_condvar_from_ident( (intptr_t)condvar );
-
-            if( condvar_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : condvar %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)condvar , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            remote_condvar_broadcast( condvar_xp );
-
-            break;
-        }
-        /////////////////////
-	    case CONDVAR_DESTROY:
-        {
-            xptr_t condvar_xp = remote_condvar_from_ident( (intptr_t)condvar );
-
-            if( condvar_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : condvar %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)condvar , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            remote_condvar_destroy( condvar_xp ); 
-
-            break;
-		}
-        /////////
-        default: 
-        {
-            assert( __FUNCTION__, false, "illegal operation type <%x>\n", operation );
-        }
-	}   // end switch
-
-    hal_fence();
-
-#if DEBUG_SYS_CONDVAR
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_MUTEX < tm_start )
-printk("\n[DBG] %s : thread %x in process %x exit for %s / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, sys_condvar_op_str( operation ), (uint32_t)tm_start );
-#endif
-
-	return 0;
-
-}  // enc sys_condvar()
-
Index: trunk/kernel/syscalls/sys_creat.c
===================================================================
--- trunk/kernel/syscalls/sys_creat.c	(revision 690)
+++ trunk/kernel/syscalls/sys_creat.c	(revision 1)
@@ -1,8 +1,7 @@
 /*
- * sys_creat.c - create a file
+ * kern/sys_creat.c - create a file
  * 
- * Author    Alain Greiner (2016,2017,2017,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
  * This file is part of ALMOS-kernel.
@@ -22,15 +21,56 @@
  */
 
-#include <hal_kernel_types.h>
+#include <config.h>
 #include <vfs.h>
-#include <syscalls.h>
-#include <shared_syscalls.h>
+#include <sys-vfs.h>
+#include <spinlock.h>
+#include <process.h>
+#include <thread.h>
 
 ////////////////////////////////////
-int sys_creat( char     * pathname,
-               uint32_t   mode )
+int sys_creat ( char     * pathname,
+                uint32_t   mode )
 { 
-	uint32_t    flags = O_CREAT;
+	CPU_HW_TRACE(sys_creat);
 
-    return sys_open( pathname , flags , mode );
+	register error_t     err;
+	register uint32_t    flags;
+	register thread_t  * this    = durrent_thread;
+	register process_t * process = current_process;
+	struct vfs_file_s    file;
+	struct ku_obj        ku_path;
+	uint32_t             fd      = (uint32_t)-1;
+   
+	if( process_fd_array_full( process ) )
+	{
+		this->info.errno = ENFILE;
+	    CPU_HW_TRACE(sys_creat);
+        return fd;
+	}
+
+	flags = 0;
+	KU_BUFF( ku_path , pathname );
+
+    // get the cwd lock
+	rwlock_rdlock( &process->cwd_lock );
+
+	err = vfs_create( &process->vfs_cwd , &ku_path , flags , mode , &file );
+	if( err )
+	{
+		this->info.errno = (err < 0 ) ? -err : err;
+	    rwlock_unlock( &process->cwd_lock );
+	    CPU_HW_TRACE(sys_creat);
+	    return fd;
+	}
+
+	err = process_fd_set( process , &file , &fd );
+	if( err )
+	{
+		vfs_close( &file , NULL );
+		this->info.errno = err;
+	}
+
+	rwlock_unlock( &process->cwd_lock );
+	CPU_HW_TRACE(sys_creat);
+	return fd;
 }
Index: trunk/kernel/syscalls/sys_display.c
===================================================================
--- trunk/kernel/syscalls/sys_display.c	(revision 690)
+++ 	(revision )
@@ -1,614 +1,0 @@
-/*
- * sys_display.c - display the current state of a kernel structure on TXT0
- *
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
- *  
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <errno.h>
-#include <vmm.h>
-#include <cluster.h>
-#include <thread.h>
-#include <process.h>
-#include <string.h>
-#include <shared_syscalls.h>
-#include <remote_barrier.h>
-#include <vfs.h>
-#include <mapper.h>
-#include <ksocket.h>
-#include <syscalls.h>
-
-/////////////////////////////////////////////////////////////////////////////////
-// This static function returns a printable string for the type of display.
-/////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_SYS_DISPLAY
-static char* display_type_str( uint32_t type )
-{
-    if     ( type == DISPLAY_STRING            ) return "STRING"; 
-    else if( type == DISPLAY_VMM               ) return "VMM"; 
-    else if( type == DISPLAY_SCHED             ) return "SCHED"; 
-    else if( type == DISPLAY_CLUSTER_PROCESSES ) return "CLUSTER_PROCESSES"; 
-    else if( type == DISPLAY_VFS               ) return "VFS"; 
-    else if( type == DISPLAY_CHDEV             ) return "CHDEV"; 
-    else if( type == DISPLAY_TXT_PROCESSES     ) return "TXT_PROCESSES"; 
-    else if( type == DISPLAY_DQDT              ) return "DQDT";
-    else if( type == DISPLAY_BUSYLOCKS         ) return "BUSYLOCKS"; 
-    else if( type == DISPLAY_MAPPER            ) return "MAPPER";
-    else if( type == DISPLAY_BARRIER           ) return "BARRIER";
-    else if( type == DISPLAY_FAT               ) return "FAT";
-    else if( type == DISPLAY_SOCKET            ) return "SOCKET";
-    else if( type == DISPLAY_FD                ) return "FD";
-    else if( type == DISPLAY_WINDOWS           ) return "WINDOWS";
-    else                                         return "undefined";
-}
-#endif
-
-/////////////////////////////
-int sys_display( reg_t  type,
-                 reg_t  arg0,
-                 reg_t  arg1,
-                 reg_t  arg2 )
-{
-
-    error_t     error;
-    vseg_t    * vseg;
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if (DEBUG_SYS_DISPLAY || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_DISPLAY
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_DISPLAY < tm_start )
-printk("\n[%s] thread[%x,%x] enter / type  %s / arg0 %x / arg1 %x / arg2 %x / cycle = %d\n",
-__FUNCTION__, process->pid, this->trdid, display_type_str(type),
-(uint32_t)arg0, (uint32_t)arg1, (uint32_t)arg2, (uint32_t)tm_start );
-#endif
-
-    switch( type )
-    {
-        ////////////////////
-        case DISPLAY_STRING:
-        {
-            char      kbuf[512];
-            uint32_t  length;
-
-            char    * string = (char *)arg0;
-
-            // check string in user space
-            error = vmm_get_vseg( process , (intptr_t)arg0 , &vseg );
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s for STRING : string buffer %x unmapped\n",
-__FUNCTION__ , (intptr_t)arg0 );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // ckeck string length
-            length = hal_strlen_from_uspace( string );
-            if( length >= 512 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s STRING : string length %d too large\n",
-__FUNCTION__ , length );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // copy string to kernel space
-            hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                                    string,
-                                    512 );
-
-            // print message on TXT0 kernel terminal
-            printk("\n%s / cycle %d\n", kbuf, (uint32_t)hal_get_cycles() );
-
-            break;
-        }
-        /////////////////
-        case DISPLAY_VMM:
-        {
-            cxy_t cxy      = (cxy_t)arg0;
-            pid_t pid      = (pid_t)arg1;
-            bool_t mapping = (arg2 != 0);
-
-            // check cxy argument
-	        if( cluster_is_active( cxy ) == false ) 
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s VMM : process %x in cluster %x not found\n",
-__FUNCTION__ , pid , cxy );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // get extended pointer on process PID in cluster CXY
-            xptr_t process_xp = cluster_get_process_from_pid_in_cxy( cxy , pid );
-	        if( process_xp == XPTR_NULL )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s VMM : process %x in cluster %x not found\n",
-__FUNCTION__ , pid , cxy );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // call kernel function
-	        hal_vmm_display( process_xp , mapping );
-
-            break;
-        }
-        ///////////////////
-        case DISPLAY_SCHED:
-        {
-            cxy_t cxy = (cxy_t)arg0;
-            lid_t lid = (lid_t)arg1;
-
-            // check cxy argument
-	        if( cluster_is_active( cxy ) == false ) 
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s SCHED : illegal cxy argument %x\n",
-__FUNCTION__ , cxy );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // check lid argument
-            if( lid >= LOCAL_CLUSTER->cores_nr )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s SCHED : illegal lid argument %x\n",
-__FUNCTION__ , lid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // call kernel function
-            sched_remote_display( cxy , lid );
-
-            break;
-        }
-        ///////////////////////////////
-        case DISPLAY_CLUSTER_PROCESSES:
-        {
-            cxy_t  cxy   = (cxy_t)arg0;
-            bool_t owned = (bool_t)arg1;
-
-            // check cxy argument
-	        if( cluster_is_active( cxy ) == false )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s CLUSTER_PROCESSES : illegal cxy argument %x\n",
-__FUNCTION__ , cxy );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            cluster_processes_display( cxy , owned );
-
-            break;
-        }
-        /////////////////
-        case DISPLAY_VFS:
-        {
-            vfs_display( process->vfs_root_xp );
-
-            break;
-        }
-        ///////////////////
-        case DISPLAY_CHDEV:
-        {
-            chdev_dir_display();
-
-            break;
-        }
-        ///////////////////////////
-        case DISPLAY_TXT_PROCESSES:
-        {
-            uint32_t txt_id = (uint32_t)arg0;
-
-            // check argument
-	        if( txt_id >= LOCAL_CLUSTER->nb_txt_channels )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s TXT_PROCESSES : illegal txt_id argument %d\n",
-__FUNCTION__ , txt_id );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            process_txt_display( txt_id );
-
-            break;
-        }
-        //////////////////
-        case DISPLAY_DQDT:
-        {
-            dqdt_display();
-
-            break;
-        }
-        ///////////////////////
-        case DISPLAY_BUSYLOCKS:
-        {
-            pid_t   pid   = (pid_t)arg0;
-            trdid_t trdid = (trdid_t)arg1;
-
-            // get extended pointer on target thread
-            xptr_t thread_xp = thread_get_xptr( pid , trdid );
-
-            if( thread_xp == XPTR_NULL )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s BUSYLOCKS : thread[%x,%x] not found\n",
-__FUNCTION__ , pid, trdid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            thread_display_busylocks( thread_xp , __FUNCTION__ );
-
-            break;
-        }
-        ////////////////////
-        case DISPLAY_MAPPER:
-        {
-            xptr_t        root_inode_xp;
-            xptr_t        inode_xp;
-            cxy_t         inode_cxy;
-            vfs_inode_t * inode_ptr;
-            xptr_t        mapper_xp;
-            mapper_t    * mapper_ptr;
-            xptr_t        page_xp;
-
-            char          kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
-
-            char     * path    = (char *)arg0;
-            uint32_t   page_id = (uint32_t)arg1;
-            uint32_t   nbytes  = (uint32_t)arg2;
-
-            // check pathname length
-            if( hal_strlen_from_uspace( path ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s MAPPER : pathname too long\n",
- __FUNCTION__ );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // check nbytes
-            if( nbytes >= 4096 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s MAPPER : nbytes cannot be larger than 4096\n",
- __FUNCTION__ );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-            
-            // copy pathname in kernel space
-            hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                                    path,
-                                    CONFIG_VFS_MAX_PATH_LENGTH );
-
-            // compute root inode for pathname 
-            if( kbuf[0] == '/' )                        // absolute path
-            {
-                // use extended pointer on VFS root inode
-                root_inode_xp = process->vfs_root_xp;
-            }
-            else                                        // relative path
-            {
-                // get cluster and local pointer on reference process
-                xptr_t      ref_xp  = process->ref_xp;
-                process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-                cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-                // get extended pointer on CWD inode
-                root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-            }
-
-            // get extended pointer on target inode
-            error = vfs_lookup( root_inode_xp,
-                                kbuf,
-                                0,
-                                &inode_xp,
-                                NULL );
-            if( error )
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s for MAPPER : cannot found inode <%s>\n",
-__FUNCTION__ , kbuf );
-#endif
-		        this->errno = ENFILE;
-		        return -1;
-	        }
-   
-            // get target inode cluster and local pointer
-            inode_cxy = GET_CXY( inode_xp );
-            inode_ptr = GET_PTR( inode_xp );
-
-            // get extended pointer on target mapper
-            mapper_ptr = hal_remote_lpt( XPTR( inode_cxy , &inode_ptr->mapper ) );
-            mapper_xp  = XPTR( inode_cxy , mapper_ptr );
-
-            // get extended pointer on target page
-            page_xp = mapper_get_page( mapper_xp , page_id );
-
-            if( page_xp == XPTR_NULL )
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s MAPPER : cannot get page %d\n",
-__FUNCTION__ , page_id );
-#endif
-		        this->errno = ENFILE;
-		        return -1;
-	        }
-
-            // display mapper
-            mapper_display_page( mapper_xp , page_xp , nbytes );
-
-
-            break;
-        }
-        /////////////////////
-        case DISPLAY_BARRIER:
-        {
-            // get target process PID
-            pid_t pid = (pid_t)arg0;
-
-            // get pointers on owner process
-            xptr_t      process_xp  = cluster_get_reference_process_from_pid( pid );
-            process_t * process_ptr = GET_PTR( process_xp );
-            cxy_t       process_cxy = GET_CXY( process_xp );
-
-            if( process_xp == XPTR_NULL )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s BARRIER : process %x not found\n",
-__FUNCTION__ , pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // get extended pointer on root of list of barriers
-            xptr_t root_xp = XPTR( process_cxy , &process_ptr->barrier_root );
-
-            if( xlist_is_empty( root_xp ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s BARRIER : no registered barrier in process %x\n",
-__FUNCTION__ , pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // get extended pointer on first registered generic barrier descriptor
-            xptr_t gen_barrier_xp  = XLIST_FIRST( root_xp , generic_barrier_t , list );
-
-            // display barrier state
-            generic_barrier_display( gen_barrier_xp );
-
-            break;
-        }
-        /////////////////
-        case DISPLAY_FAT:
-        {
-            uint32_t  slots = (uint32_t)arg1;
-
-            if( slots > 1024 )
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s FAT : nb_slots larger than 1024\n",
-__FUNCTION__ );
-#endif
-		        this->errno = EINVAL;
-		        return -1;
-	        }
-
-            if( slots == 0 )  // display fat context in cluster cxy
-            {
-                uint32_t  cxy = (uint32_t)arg0;
-
-                if( cluster_is_active( cxy ) == false ) 
-                {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s FAT : illegal cxy argument %x\n",
-__FUNCTION__ , cxy );
-#endif
-                     this->errno = EINVAL;
-                     return -1;
-                }
-
-                fatfs_display_ctx( cxy );
-            }
-            else                  // display nb_slots in page 
-            {                        
-                uint32_t min  = (uint32_t)arg0;
-
-                fatfs_display_fat( min , slots );
-            }
-
-            break;
-        }
-        ////////////////////
-        case DISPLAY_SOCKET:
-        {
-            pid_t   pid   = (pid_t)arg0;
-            trdid_t fdid  = (trdid_t)arg1;
-
-            // get extended pointer on owner process descriptor
-            xptr_t owner_xp = cluster_get_owner_process_from_pid( pid );
-
-            if( owner_xp == XPTR_NULL )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s for SOCKET : pid %x not found\n", __FUNCTION__ , pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // get extended pointer on file descriptor 
-            xptr_t file_xp = process_fd_get_xptr_from_owner( owner_xp , fdid );
-
-            if( file_xp == XPTR_NULL )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s for SOCKET : fdid %d not found\n", __FUNCTION__ , fdid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // get local pointer and cluster for file
-            vfs_file_t * file_ptr = GET_PTR( file_xp );
-            cxy_t        file_cxy = GET_CXY( file_xp );
-
-            // get local pointer on socket descriptor
-            socket_t * socket = hal_remote_lpt( XPTR( file_cxy , &file_ptr->socket ) );
-
-            // display socket descriptor on TXT0
-            socket_display( XPTR( file_cxy , socket ), __FUNCTION__ , NULL );
-
-            break;
-        }
-        ////////////////
-        case DISPLAY_FD:
-        {
-            pid_t   pid   = (pid_t)arg0;
-
-            // get extended pointer on owner process descriptor
-            xptr_t owner_xp = cluster_get_owner_process_from_pid( pid );
-
-            if( owner_xp == XPTR_NULL )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s for FD : pid %x not found\n", __FUNCTION__ , pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // display fd_array on TXT0
-            process_fd_display( owner_xp );
-
-            break;
-        }
-        /////////////////////
-        case DISPLAY_WINDOWS:
-        {
-            pid_t   pid   = (pid_t)arg0;
-
-            if( pid != 0 )  // only one target process
-            {
-                // get extended pointer on owner process descriptor
-                xptr_t owner_xp = cluster_get_owner_process_from_pid( pid );
-
-                if( owner_xp == XPTR_NULL )
-                {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s for FD : pid %x not found\n", __FUNCTION__ , pid );
-#endif
-                    this->errno = EINVAL;
-                    return -1;
-                }
-            }
-
-            // display windows state for one, or for all processes
-            dev_fbf_display_windows( pid );
-
-            break;
-        }
-        ////////
-        default: 
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : undefined display type %d\n",
-        __FUNCTION__ , type );
-#endif
-            this->errno = EINVAL;
-            return -1;
-        }
-    }  // end switch on type
-
-#if (DEBUG_SYS_DISPLAY || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_DISPLAY
-if( DEBUG_SYS_DISPLAY < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_DISPLAY] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_DISPLAY] , 1 );
-#endif
-
-    return 0;
-
-}  // end sys_display()
Index: trunk/kernel/syscalls/sys_dma_memcpy.c
===================================================================
--- trunk/kernel/syscalls/sys_dma_memcpy.c	(revision 1)
+++ trunk/kernel/syscalls/sys_dma_memcpy.c	(revision 1)
@@ -0,0 +1,119 @@
+/*
+ * kern/sys_dma_memcpy.c - exported DMA access to user process
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <errno.h>
+#include <types.h>
+#include <event.h>
+#include <device.h>
+#include <driver.h>
+#include <kmem.h>
+#include <kdmsg.h>
+#include <dma.h>
+#include <kcm.h>
+#include <thread.h>
+#include <cluster.h>
+#include <kcm.h>
+
+
+KMEM_OBJATTR_INIT(dma_kmem_request_init)
+{
+	attr->type = KMEM_DMA_REQUEST;
+	attr->name = "KCM Dev-Request";
+	attr->size = sizeof(dev_request_t);
+	attr->aligne = 0;
+	attr->min  = CONFIG_DMA_RQ_KCM_MIN;
+	attr->max  = CONFIG_DMA_RQ_KCM_MAX;
+	attr->ctor = NULL;
+	attr->dtor = NULL;
+  
+	return 0;
+}
+
+static EVENT_HANDLER(dma_async_request_event)
+{
+	kmem_req_t req;
+	error_t err;
+  
+	if((err=event_get_error(event)) != 0)
+		printk(ERROR, "ERROR: dma_async_request_event: DMA transfare is not well completed, remaining %d\n", err);
+
+	req.type = KMEM_DMA_REQUEST;
+	req.ptr  = event_get_argument(event);
+
+	assert(req.ptr != NULL && "Corrupted argument, expected the address of request");
+
+	kmem_free(&req);
+	return 0;
+}
+
+static inline error_t dma_do_async_request(void *dst, void *src, size_t size)
+{
+	kmem_req_t req;
+	dev_request_t *rq;
+  
+	req.type  = KMEM_DMA_REQUEST;
+	req.size  = sizeof(*rq);
+	req.flags = AF_KERNEL;
+
+	if((rq = kmem_alloc(&req)) == NULL)
+		return ENOMEM;
+
+	memset(rq, 0, sizeof(*rq));
+
+	rq->src   = src;
+	rq->dst   = dst;
+	rq->count = size;
+	rq->flags = DEV_RQ_NOBLOCK;
+
+	event_set_priority(&rq->event, E_FUNC);
+	event_set_handler(&rq->event, &dma_async_request_event);
+	event_set_argument(&rq->event, rq);
+  
+	return __sys_dma->op.dev.write(__sys_dma, rq);
+}
+
+static inline error_t dma_do_sync_request(void *dst, void *src, size_t size)
+{
+	dev_request_t rq;
+  
+	rq.src   = src;
+	rq.dst   = dst;
+	rq.count = size;
+	rq.flags = 0;
+  
+	return __sys_dma->op.dev.write(__sys_dma, &rq);
+}
+
+
+error_t dma_memcpy(void *dst, void *src, size_t size, uint_t isAsync)
+{
+	if(isAsync == DMA_ASYNC)
+		return dma_do_async_request(dst, src, size);
+	else
+		return dma_do_sync_request(dst, src, size);
+}
+
+
+int sys_dma_memcpy(void *src, void *dst, size_t size)
+{
+	return dma_do_sync_request(dst, src, size);
+}
Index: trunk/kernel/syscalls/sys_exec.c
===================================================================
--- trunk/kernel/syscalls/sys_exec.c	(revision 690)
+++ trunk/kernel/syscalls/sys_exec.c	(revision 1)
@@ -1,6 +1,7 @@
 /*
- * sys_exec.c - Kernel function implementing the "exec" system call.
- *
- * Authors   Alain Greiner (2016,2017,2017,2019,2020)
+ * sys_exec.c - Kernel function implementing the "exec" syscall
+ * 
+ * Authors    Mohamed Lamine Karaoui (2015)
+ *            Alain Greiner          (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,7 +23,6 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <errno.h>
 #include <printk.h>
@@ -36,320 +36,249 @@
 #include <rpc.h>
 
-#include <syscalls.h>
-
-////////////////////////////////////////////////i////////////////////////////////////////
+
+////////////////////////////////////////////////i////////////////////////////////////// 
+// This static function is called by the sys_exec() function to register the .elf
+// pathname in the exec_info  structure, from a string stored in user space.
+////////////////////////////////////////////////i////////////////////////////////////// 
+// @ exec_info : pointer on the exec_info structure.
+// @ pathname  : string containing the path to the .elf file (user space).
+// return 0 if success / non-zero if one string too long, or too many strings. 
+///////////////////////////////////////////////////////////////////////////////////////
+static error_t process_exec_get_path( exec_info_t  * exec_info,
+                                      char         * pathname )
+{
+    uint32_t length;
+
+    // get string length
+	hal_strlen_from_uspace( pathname , &length );
+	if( length > 255 ) 
+    {
+        printk(ERROR, "%s: elf file pathname larger than 255 bytes\n", __FUNCTION__ );
+        return EINVAL;
+    }
+
+    // copy string to exec_info
+    hal_copy_from_uspace( &exec_info->path[0] , pathname , length );
+
+    return 0;
+}
+
+////////////////////////////////////////////////i////////////////////////////////////// 
 // This static function is called twice by the sys_exec() function :
-// - to register the main() arguments (args) in the process <exec_info> structure.
-// - to register the environment variables (envs) in the <exec_info> structure.
-// In both cases the input is an array of NULL terminated string pointers in user space,
-// identified by the <u_pointers> argument. The strings can be dispatched anywhere in 
-// the calling user process space. The max number of envs, and the max number of args  
-// are defined by the CONFIG_PROCESS_ARGS_NR and CONFIG_PROCESS_ENVS_MAX_NR parameters. 
-////////////////////////////////////////////////i////////////////////////////////////////
-// Implementation Note:
-// Both the array of pointers and the strings themselve are stored in kernel space in one
-// single, dynamically allocated, kernel buffer containing an integer number of pages,
-// defined by the CONFIG_VMM_ENVS_SIZE and CONFIG_VMM_STACK_SIZE parameters.
-// These two kernel buffers contains :
-// - in the first bytes a fixed size kernel array of kernel pointers on the strings.
-// - in the following bytes the strings themselves.
-// The exec_info_t structure is defined in the <process.h> file.
-////////////////////////////////////////////////i////////////////////////////////////////
-// @ is_args     : [in]    true if called for (args) / false if called for (envs).
-// @ u_pointers  : [in]    array of pointers on the strings (in user space).
-// @ exec_info   : [inout] pointer on the exec_info structure.
-// @ return 0 if success / non-zero if too many strings or no memory.
-////////////////////////////////////////////////i////////////////////////////////////////
-static error_t exec_get_strings( bool_t         is_args,
-                                 char        ** u_pointers,
-                                 exec_info_t  * exec_info )
+// - to register the main() arguments (args) in the exec_info structure.
+// - to register the environment variables (envs) in the exec_info structure.
+// In both cases the input is an array of string pointers in user space,
+// and a set of strings in user space. 
+// We allocate one physical page to store a kernel copy of the array of pointers,
+// we allocate one or several physical pages to store the strings themselve,
+// and register these buffers and the number of strings in the exec_info structure.
+// The max number of strings is 1024 (for both args and envs). The numbers of pages 
+// to store the (args) and (envs) strings are configuration parameters.
+////////////////////////////////////////////////i////////////////////////////////////// 
+// @ exec_info : pointer on the exec_info structure.
+// @ is_args   : true if called for (args) / false if called for (envs).
+// @ pointers  : array of pointers on the strings (in user space).
+// @ return 0 if success / non-zero if too many strings or no more memory. 
+///////////////////////////////////////////////////////////////////////////////////////
+static error_t process_exec_get_strings( exec_info_t  * exec_info,
+                                         bool_t         is_args,
+			                             char        ** u_pointers )
 {
-    uint32_t     index;           // slot index in pointers array
-    uint32_t     length;          // string length (in bytes)
-    uint32_t     pointers_bytes;  // number of bytes to store pointers
-    uint32_t     max_index;       // max size of pointers array
-    char      ** k_pointers;      // base of kernel array of pointers
-    char       * k_buf_ptr;       // pointer on first empty slot in strings buffer
-    uint32_t     k_buf_space;     // number of bytes available in string buffer
-    char       * k_buf;           // kernel buffer for both pointers & strings 
-
-#if DEBUG_SYS_EXEC 
-thread_t * this  = CURRENT_THREAD;
-uint32_t   cycle = (uint32_t)hal_get_cycles();
-#endif
-
-    // Allocate one block of physical memory for both the pointers and the strings
-
-    if( is_args )
-    {
-        k_buf = kmem_alloc( bits_log2(CONFIG_VMM_ARGS_SIZE << CONFIG_PPM_PAGE_ORDER), AF_ZERO );
-
-        pointers_bytes = (CONFIG_PROCESS_ARGS_MAX_NR + 1) * sizeof(char *);
-        k_pointers     = (char **)k_buf;
-        k_buf_ptr      = k_buf + pointers_bytes;
-        k_buf_space    = (CONFIG_VMM_ARGS_SIZE << CONFIG_PPM_PAGE_ORDER) - pointers_bytes;
-        max_index      = CONFIG_PROCESS_ARGS_MAX_NR + 1;
-
-#if DEBUG_SYS_EXEC 
-if( DEBUG_SYS_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] for args / u_buf %x / k_buf %x\n",
-__FUNCTION__, this->process->pid, this->trdid, u_pointers, k_buf );
-#endif
-
-    }
-    else  // envs
-    {
-        k_buf = kmem_alloc( bits_log2(CONFIG_VMM_ENVS_SIZE << CONFIG_PPM_PAGE_ORDER), AF_ZERO );
-
-        pointers_bytes = (CONFIG_PROCESS_ENVS_MAX_NR + 1) * sizeof(char *);
-        k_pointers     = (char **)k_buf;
-        k_buf_ptr      = k_buf + pointers_bytes;
-        k_buf_space    = (CONFIG_VMM_ENVS_SIZE << CONFIG_PPM_PAGE_ORDER) - pointers_bytes;
-        max_index      = CONFIG_PROCESS_ENVS_MAX_NR + 1;
-
-#if DEBUG_SYS_EXEC 
-if( DEBUG_SYS_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] for envs / u_buf %x / k_buf %x\n",
-__FUNCTION__, this->process->pid, this->trdid, u_pointers, k_buf );
-#endif
-
-    }
-
-    // copy the user array of pointers to kernel buffer
-    hal_copy_from_uspace( XPTR( local_cxy , k_pointers ),
+    uint32_t     index;       // string index
+    uint32_t     found_null;  // NULL pointer found in array of pointers
+    uint32_t     length;      // string length
+    uint32_t     strings;     // actual number of strings
+    kmem_req_t   req;         // kmem request
+    page_t     * page;        // page descriptor
+    uint32_t     order;       // ln2( number of pages to store strings )
+    char      ** k_pointers;  // base of kernel buffer containing array of pointers
+    char       * buf_ptr;     // pointer on first empty slot in kernel strings buffer
+    char       * buf_base;    // base address of the kernel strings buffer
+
+    // compute ln2( number of pages for kernel strings buffer )
+    if( is_args ) order = CONFIG_PROCESS_ARGS_ORDER;
+    else          order = CONFIG_PROCESS_ENVS_ORDER;
+
+	req.type   = KMEM_PAGE;
+	req.flags  = AF_KERNEL | AF_ZERO;
+
+    // allocate one physical page for kernel array of pointers
+    req.type   = 0;
+    page       = kmem_alloc( &req );
+    if( page == NULL )
+    {
+        printk("ERROR in %s : cannot allocate memory for pointers\n", __FUNCTION__ );
+        return ENOMEM;
+    }
+    k_pointers = ppm_page2base( page );
+    
+    // allocate several physical pages to store the strings themselve
+    req.type   = order;
+    page       = kmem_alloc( &req );
+    if( page == NULL )
+    {
+        printk("ERROR in %s : cannot allocate memory for strings\n", __FUNCTION__ );
+        return ENOMEM;
+    }
+    buf_base    = ppm_page2base( page );
+    
+    // copy the array of pointers to kernel buffer 
+    hal_copy_from_uspace( k_pointers, 
                           u_pointers,
-                          pointers_bytes );
-
-    // WARNING : the pointers copied in the k_pointers[] array are user pointers,
-    // after the loop below, the k_pointers[] array contains kernel pointers.
-
-#if DEBUG_SYS_EXEC 
-if( DEBUG_SYS_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] moved u_ptr array of pointers to k_ptr array\n",
-__FUNCTION__, this->process->pid, this->trdid );
-#endif
-
-    // scan kernel array of pointers to copy strings to kernel buffer
-    for( index = 0 ; index < max_index ; index++ )
-    {
-        // exit loop if (k_pointers[index] == NUll)
-        if( k_pointers[index] == NULL ) break;
-
-        // compute string length (without the NUL character)
-        length = hal_strlen_from_uspace( k_pointers[index] );
-
-        // return error if overflow in kernel buffer
-        if( length > k_buf_space ) return -1;
-
-        // copy the string itself to kernel buffer
-        hal_copy_from_uspace( XPTR( local_cxy , k_buf_ptr ),
-                              k_pointers[index],
-                              length + 1 );
-
-#if DEBUG_SYS_EXEC 
-if( DEBUG_SYS_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] copied string[%d] <%s> to kernel buffer / length %d\n",
-__FUNCTION__, this->process->pid, this->trdid, index, k_buf_ptr, length );
-#endif
-
-        // replace the user pointer by a kernel pointer in the k_pointer[] array
-        k_pointers[index] = k_buf_ptr;
-
-        // increment loop variables
-        k_buf_ptr   += (length + 1);
-        k_buf_space -= (length + 1);
-
-#if DEBUG_SYS_EXEC 
-if( DEBUG_SYS_EXEC < cycle )
+                          CONFIG_PPM_PAGE_SIZE );
+
+    // scan local copy of array of pointers to copy the strings
+    found_null = 0;
+    buf_ptr    = buf_base;
+    for( index = 0 ; index < 1024 ; index++ )
+    {
+        if( k_pointers[index] == NULL ) 
+        {
+            found_null = 1;
+            break;
+        }
+
+        // compute string length
+	    hal_strlen_from_uspace( k_pointers[index] , &length );
+ 
+        // copy the user string to kernel buffer
+        hal_copy_from_uspace( k_strings,
+                              k_pointers[index];
+                              length );
+
+        // update k_pointer[index] entry
+        k_pointers[index] = buf_ptr;
+
+        // increment pointer on kernel strings buffer
+        buf_ptr += (length + 1);
+    }
+
+    // update into exec_info structure 
+    if( found_null && is_args )
+    {
+        exec_info->args_pointers  =  k_pointers;
+        exec_info->args_buf_base  =  buf_base;
+        exec_info->args_nr        =  index;
+    }
+    else if( found_null && !is_args )
+    {
+        exec_info->envs_pointers  =  k_pointers;
+        exec_info->envs_buf_base  =  buf_base;
+        exec_info->envs_buf_free  =  buf_ptr;
+        exec_info->envs_nr        =  index;
+    }
+    else 
+    {
+        printk("ERROR in %s : number of strings larger than 1024\n", __FUNCTION__ );
+        return EINVAL;
+    }
+
+    return 0;
+} // end process_exec_get_strings()
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// This function is executed in a "client" cluster by a process whose PID can belong
+// to another "server" cluster (defined by the MSB bits of the calling process PID).
+// A new process descriptor, and the associated main thread descriptor must be created
+// in the "server" cluster, using directly the process_make_exec() function if local,
+// or the rpc_process_exec_client() function if server is remote.
+/////////////////////////////////////////////////////////////////////////////////////////
+// Implementation note:
+// This function build an exec_info_t structure containing all informations
+// required to create the new process descriptor and the associated thread.
+// It calls the static process_exec_get_path() and process_exec_get_strings() functions
+// to copy the .elf pathname, the main() arguments and the environment variables from
+// user buffers to the exec_info_t, and calls the static process_make_exec() function.
+/////////////////////////////////////////////////////////////////////////////////////////
+int sys_exec( char  * filename,     // .elf file pathname
+              char ** argv,         // process arguments
+              char ** envp )        // environment variables
 {
-    if( k_pointers[0] != NULL )
-    printk("\n[%s] thread[%x,%x] : &arg0 = %x / arg0 = <%s>\n",
-    __FUNCTION__, this->process->pid, this->trdid, k_pointers[0], k_pointers[0] );
-    else 
-    printk("\n[%s] thread[%x,%x] : unexpected NULL value for &arg0\n",
-    __FUNCTION__, this->process->pid, this->trdid );
-}
-#endif
-
-    }  // end loop on index
-
-    // update into exec_info structure
-    if( is_args )
-    {
-        exec_info->args_pointers  =  k_pointers;
-        exec_info->args_nr        =  index;
-    }
-    else
-    {
-        exec_info->envs_pointers  =  k_pointers;
-        exec_info->envs_buf_free  =  k_buf_ptr;
-        exec_info->envs_nr        =  index;
-    }
-
-#if DEBUG_SYS_EXEC 
-if( DEBUG_SYS_EXEC < cycle )
-printk("\n[%s] thread[%x,%x] copied %d strings to kernel buffer\n",
-__FUNCTION__, this->process->pid, this->trdid, index );
-#endif
+    exec_info_t  exec_info;         // structure to pass to process_make_exec()
+    thread_t   * thread;            // pointer on thread created in server cluster
+	error_t      error   = 0;
+	process_t  * process = CURRENT_PROCESS;
+
+    // check arguments
+	if((filename == NULL) || (argv == NULL) || (envp == NULL)) 
+    {
+        printk("\n[ERROR] in %s : missing arguments / file = %x / argv = %x / envp = %x\n",
+               __FUNCTION__ , filename , argv , envp );
+        return EINVAL;
+    }
+
+    // compute client_cxy (local cluster) and server_cxy (target cluster)
+    cxy_t     cxy_server = CXY_FROM_PID( process->pid );
+    cxy_t     cxy_client = local_cxy;
+    bool_t    is_local   = (cxy_server == cxy_client);
+
+    exec_dmsg("\n[INFO] %s starts for process %x on core %d in cluster %x"
+                 " / target_cluster = %x / cycle %d\n",
+                 __FUNCTION__, process->pid , CURRENT_CORE->lid, 
+                 cxy_client, cxy_server, hal_time_stamp());
+
+    // Change process's state to prevent any concurent access TODO ??? [AG]
+
+    // initialize exec_info structure 
+    exec_info->pid      = process->pid;
+    exec_info->ppid     = process->ppid;
+    exec_info->fd_array = &process->fd_array;
+    exec_info->vfs_root = &process->vfs_root;
+    exec_info->vfs_cwd  = &process->vfs_cwd;
+    exec_info->vfs_bin  = &process->vfs_bin;
+
+	// check pathname and store it in exec_info structure
+	error = process_exec_get_path( &exec_info , filename );
+	if ( error ) return EINVAL;
+
+	// check and store argv in exec_info structure
+	error = process_exec_get_strings( &exec_info , true , argv );
+	if( error )  return EINVAL;
+	
+	// check and store envp in exec_info structure
+	error = process_exec_get_strings( &exec_info , false , envp );
+	if( error )  return EINVAL;
+	
+    if( is_local )  ////////////// local exec ////////////////////////// 
+    {
+        exec_dmsg("\n[INFO] %s starts local exec for process %x at cycle %d\n",
+                  __FUNCTION__, process->pid, hal_time_stamp());
+
+        // call directly the local process_make_exec() function
+        error = process_make_exec( &exec_info , &thread );
+        if error
+        {
+            printk("\n[ERROR] in %s : failed in local exec for process %x\n",
+                   __FUNCTION__ , process->pid );
+            return EINVAL;
+        }
+
+        exec_dmsg("\n[INFO] %s completes local exec for process %x at cycle %d\n",
+                  __FUNCTION__, process->pid , hal_time_stamp() );
+    }
+    else             ///////////// remote exec /////////////////////////
+    {
+        exec_dmsg("\n[INFO] %s starts remote exec for process %x at cycle %d\n",
+                  __FUNCTION__, process->pid, hal_time_stamp() );
+
+        // call the rpc_process_exec_client() function    
+        rpc_process_exec_client( cxy_server , &exec_info , &thread , &error );
+
+        if( error )
+        {
+            printk("\n[ERROR] in %s : failed in remote exec for process %x\n",
+                   __FUNCTION__ , process->pid );
+            return EINVAL;
+        }
+
+        exec_dmsg("\n[INFO] %s completes remote exec for process %x at cycle %d\n",
+                  __FUNCTION__, process->pid , hal_time_stamp() );
+    }
+
+    // If no error, delete the current thread an process descriptors.
+    thread_kill( CURRENT_THREAD );
+    process_kill( CURRENT_PROCESS );
 
     return 0;
-
-} // end exec_get_strings()
-
-
-///////////////////////////////
-int sys_exec( char  * pathname,    // .elf file pathname in user space
-              char ** user_args,   // pointer on array of process arguments in user space
-              char ** user_envs )  // pointer on array of env variables in user space
-{
-    error_t       error;
-    vseg_t      * vseg;
-
-    // get calling thread, process, & pid
-    thread_t    * this    = CURRENT_THREAD;
-    process_t   * process = this->process;
-    pid_t         pid     = process->pid;
-    trdid_t       trdid   = this->trdid;
-
-assert( __FUNCTION__, (CXY_FROM_PID( pid ) == local_cxy) ,
-"must be called in the owner cluster\n");
-
-assert( __FUNCTION__, (LTID_FROM_TRDID( trdid ) == 0) ,
-"must be called by the main thread\n");
-
-assert( __FUNCTION__, (user_envs == NULL) ,
-"environment variables not supported yet\n" );
-
-#if DEBUG_SYS_EXEC || DEBUG_SYSCALLS_ERROR 
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    // check "pathname" mapped in user space
-    if( vmm_get_vseg( process , (intptr_t)pathname , &vseg ) )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%] / pathname pointer %x unmapped\n",
-__FUNCTION__, pid, trdid, pathname );
-#endif
-        this->errno = EINVAL;
-		return -1;
-	}
-
-    // check "pathname" length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / pathname too long\n",
-__FUNCTION__, pid, trdid );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // check "args" mapped in user space if non NULL
-    if( (user_args != NULL) && (vmm_get_vseg( process , (intptr_t)user_args , &vseg )) )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for thread[%x,%] : user_args pointer %x unmapped\n",
-__FUNCTION__, pid, trdid, user_args );
-#endif
-        this->errno = EINVAL;
-		return -1;
-	}
-
-    // check "envs" mapped in user space if not NULL
-    if( (user_envs != NULL) && (vmm_get_vseg( process , (intptr_t)user_envs , &vseg )) )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%] / user_envs pointer %x unmapped\n",
-__FUNCTION__, pid, trdid, user_envs );
-#endif
-        this->errno = EINVAL;
-		return -1;
-	}
-
-    // 1. copy "pathname" in kernel exec_info structure 
-    hal_strcpy_from_uspace( XPTR( local_cxy , &process->exec_info.path[0] ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_EXEC
-if( DEBUG_SYS_EXEC < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter / path <%s> / args %x / envs %x / cycle %d\n",
-__FUNCTION__, pid, trdid, &process->exec_info.path[0],
-user_args, user_envs, (uint32_t)tm_start );
-#endif
-
-    // 2. copy "arguments" pointers & strings in process exec_info if required
-    if( user_args != NULL )
-    {
-        if( exec_get_strings( true , user_args , &process->exec_info ) )
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%] cannot get arguments for <%s>\n",
-__FUNCTION__, pid, trdid, pathname );
-#endif
-            this->errno = EINVAL;
-            return -1;
-        }
-
-#if DEBUG_SYS_EXEC
-if( DEBUG_SYS_EXEC < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] set arguments in exec_info / arg[0] = <%s>\n",
-__FUNCTION__, pid, trdid, process->exec_info.args_pointers[0] );
-#endif
-
-    }
-
-    // 3. copy "environment" pointers & strings in process exec_info if required
-    if( user_envs != NULL )
-    {
-        if( exec_get_strings( false , user_envs , &process->exec_info ) )
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%] cannot get env variables for <%s>\n",
-__FUNCTION__, pid, trdid, pathname );
-#endif
-            this->errno = EINVAL;
-            return -1;
-        }
-
-#if DEBUG_SYS_EXEC 
-if( DEBUG_SYS_EXEC < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] set envs in exec_info / env[0] = <%s>\n",
-__FUNCTION__, pid, trdid, process->exec_info.envs_pointers[0] );
-#endif
-
-    }
-
-    // call relevant kernel function (no return if success)
-    error = process_make_exec();
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create process <%s>\n",
-__FUNCTION__, pid, trdid, process->exec_info.path );
-#endif
-        this->errno = error;
-        return -1;
-    }
-
-    return 0;  
-
 } // end sys_exec()
 
Index: trunk/kernel/syscalls/sys_exit.c
===================================================================
--- trunk/kernel/syscalls/sys_exit.c	(revision 690)
+++ 	(revision )
@@ -1,186 +1,0 @@
-/*
- * sys_exit.c - Kernel function implementing the "exit" system call.
- * 
- * Author    Alain Greiner (2016,2017,2018,2019)
- *
- * Copyright (c)  UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <process.h>
-#include <dev_fbf.h>
-#include <shared_syscalls.h>
-#include <cluster.h>
-#include <rpc.h>
-
-#include <syscalls.h>
-
-///////////////////////////////
-int sys_exit( uint32_t status )
-{
-    xptr_t      owner_xp;          // extended pointer on owner process
-    cxy_t       owner_cxy;         // owner process cluster
-    process_t * owner_ptr;         // local pointer on owner process
-    thread_t  * main_ptr;          // local pointer on process main thread
-    xptr_t      parent_xp;         // extended pointer on parent process
-    cxy_t       parent_cxy;        // parent process cluster
-    process_t * parent_ptr;        // local pointer on parent process
-    thread_t  * parent_main_ptr;   // local pointer on parent main thread 
-    xptr_t      parent_main_xp;    // extended pointer on parent main thread
-    uint32_t    term_state;        // termination status for owner process
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-    pid_t       pid     = process->pid;
-
-#if (DEBUG_SYS_EXIT || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_EXIT
-if( DEBUG_SYS_EXIT < tm_start )
-printk("\n[%s] thread[%x,%x] enter / status %x / cycle %d\n",
-__FUNCTION__, pid, this->trdid , status , (uint32_t)tm_start );
-#endif
-
-    // get owner process descriptor pointers 
-    owner_xp  = process->owner_xp;
-    owner_cxy = GET_CXY( owner_xp );
-    owner_ptr = GET_PTR( owner_xp );
-
-    // get local pointer on the main thread
-    main_ptr  = hal_remote_lpt( XPTR( owner_cxy , &owner_ptr->th_tbl[0] ) );
-
-    // get parent process descriptor pointers
-    parent_xp  = process->parent_xp;
-    parent_cxy = GET_CXY( parent_xp );
-    parent_ptr = GET_PTR( parent_xp );
-
-    // get pointers on the parent process main thread
-    parent_main_ptr = hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->th_tbl[0] ) ); 
-    parent_main_xp  = XPTR( parent_cxy , parent_main_ptr );
-
-    // remove process from TXT list
-    process_txt_detach( owner_xp );
-
-#if( DEBUG_SYS_EXIT & 1)
-if( DEBUG_SYS_EXIT < tm_start )
-printk("\n[%s] thread[%x,%x] detached process %x from TXT\n",
-__FUNCTION__, pid, this->trdid, pid );
-#endif
-
-    // close all open files
-    process_fd_clean_all( owner_xp );
-
-#if( DEBUG_SYS_EXIT & 1)
-if( DEBUG_SYS_EXIT < tm_start )
-printk("\n[%s] thread[%x,%x] closed all files for process %x\n",
-__FUNCTION__, pid, this->trdid, pid );
-#endif
-
-    // delete all process registered FBF windows
-    dev_fbf_cleanup( pid );
-
-#if( DEBUG_SYS_EXIT & 1)
-if( DEBUG_SYS_EXIT < tm_start )
-printk("\n[%s] thread[%x,%x] deleted all FBF windows for process %x\n",
-__FUNCTION__, pid, this->trdid, pid );
-#endif
-
-    // mark for delete all process threads in all clusters, 
-    // but the main thread and this calling thread 
-    process_sigaction( pid , DELETE_ALL_THREADS );
-
-#if( DEBUG_SYS_EXIT & 1)
-if( DEBUG_SYS_EXIT < tm_start )
-printk("\n[%s] thread[%x,%x] deleted all threads in process %x (but itself)\n",
-__FUNCTION__, pid, this->trdid, pid );
-#endif
-
-    // mark for delete the calling thread when it is not the main
-    if( (owner_cxy != local_cxy) || (main_ptr != this) )
-    {
-
-#if( DEBUG_SYS_EXIT & 1)
-if( tm_start > DEBUG_SYS_EXIT )
-printk("\n[%s] thread[%x,%x] marked iself for delete\n",
-__FUNCTION__, pid, this->trdid );
-#endif
-        thread_delete_request( XPTR( local_cxy , this ) , true );    // forced
-    }
-
-    // block the main thread 
-    thread_block( XPTR( owner_cxy , main_ptr ) , THREAD_BLOCKED_GLOBAL );
-
-#if( DEBUG_SYS_EXIT & 1)
-trdid_t main_trdid = hal_remote_l32( XPTR( owner_cxy , &main_ptr->trdid ) );
-if( tm_start > DEBUG_SYS_EXIT )
-printk("\n[%s] thread[%x,%x] blocked main thread[%x,%x]\n",
-__FUNCTION__, pid, this->trdid, pid, main_trdid );
-#endif
-
-    // update term_state in owner process descriptor to ask
-    // the parent process sys_wait() function to delete the process 
-    term_state = (status & 0xFF) | PROCESS_TERM_EXIT;
-    hal_remote_atomic_or( XPTR( owner_cxy , &owner_ptr->term_state ) , term_state );
-
-#if( DEBUG_SYS_EXIT & 1)
-if( tm_start > DEBUG_SYS_EXIT )
-printk("\n[%s] thread[%x,%x] set exit status %x in owner process\n",
-__FUNCTION__, pid, this->trdid, term_state );
-#endif
-
-    // unblock the parent process main thread 
-    thread_unblock( parent_main_xp , THREAD_BLOCKED_WAIT );
-
-#if( DEBUG_SYS_EXIT & 1)
-if( tm_start > DEBUG_SYS_EXIT )
-printk("\n[%s] thread[%x,%x] unblocked parent main thread in process %x\n",
-__FUNCTION__ , pid, this->trdid,
-hal_remote_l32( XPTR( parent_cxy , &parent_ptr->pid) ) );
-#endif
-
-    hal_fence();
-
-#if (DEBUG_SYS_EXIT || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_EXIT
-if( DEBUG_SYS_EXIT < tm_end )
-printk("\n[%s] thread[%x,%x] exit / term_state %x / cycle %d\n",
-__FUNCTION__, pid, this->trdid, term_state,  (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_EXIT] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_EXIT] , 1 );
-#endif
-
-    // this thread deschedule
-    sched_yield( "process exit" );
-
-	return 0;
-
-}  // end sys_exit()
-
Index: trunk/kernel/syscalls/sys_fbf.c
===================================================================
--- trunk/kernel/syscalls/sys_fbf.c	(revision 690)
+++ 	(revision )
@@ -1,360 +1,0 @@
-/*
- * sys_fbf.c - Acces the frame buffer peripheral.
- * 
- * Authors     Alain Greiner (2016,2017,2018,2019,2020)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <shared_fbf.h>
-#include <dev_fbf.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <vmm.h>
-#include <syscalls.h>
-
-////////////////////////
-int sys_fbf( reg_t arg0,
-             reg_t arg1,
-             reg_t arg2,
-             reg_t arg3 )
-{
-	vseg_t         * vseg;        // for vaddr check
-    error_t          error;
-
-#if (DEBUG_SYS_FBF || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    thread_t       * this    = CURRENT_THREAD;
-    process_t      * process = this->process;
-
-    // for some operations, the MSB of arg0 can contain the wid 
-    uint32_t operation = arg0 & 0xFFFF;
-
-#if DEBUG_SYS_FBF
-if( DEBUG_SYS_FBF < tm_start )
-printk("\n[%s] thread[%x,%x] %s / a1 %x / a2 %x / a3 %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, dev_fbf_cmd_str( operation ),
-arg1, arg2, arg3, (uint32_t)tm_start );
-#endif
-
-    // execute requested operation
-	switch( operation )
-	{
-        ////////////////////
-	    case FBF_GET_CONFIG:
-        {
-            uint32_t width;
-            uint32_t height;
-            uint32_t type;
-
-            // check "width" in user vspace
-	        error = vmm_get_vseg( process , (intptr_t)arg1 , &vseg );
-	        if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped arg1 %x for %s / thread[%x,%x]\n",
-__FUNCTION__ , arg1, dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-
-            // check "height" in user vspace
-	        error |= vmm_get_vseg( process , (intptr_t)arg2 , &vseg );
-	        if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped arg2 %x for %s / thread[%x,%x]\n",
-__FUNCTION__ , arg2, dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-
-            // check "type" in user vspace
-	        error |= vmm_get_vseg( process , (intptr_t)arg3 , &vseg );
-	        if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped arg3 %x for %s / thread[%x,%x]\n",
-__FUNCTION__ , arg3, dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-
-            // call relevant kernel function to get  config
-            dev_fbf_get_config( &width , &height , &type );
-
-            // transfer to user space if no error
-            if( error == 0 )
-            {
-                hal_copy_to_uspace( (void*)arg1, XPTR(local_cxy , &width ), sizeof(uint32_t) );
-                hal_copy_to_uspace( (void*)arg2, XPTR(local_cxy , &height), sizeof(uint32_t) );
-                hal_copy_to_uspace( (void*)arg3, XPTR(local_cxy , &type  ), sizeof(uint32_t) );
-            }
-            break;
-        }
-        /////////////////////
-        case FBF_DIRECT_READ:
-        case FBF_DIRECT_WRITE:
-        {
-            void    * buffer   = (void *)arg1;
-            uint32_t  npixels  = arg2;
-            uint32_t  offset   = arg3;
-            bool_t    is_write = (operation == FBF_DIRECT_WRITE);
-            
-            // check buffer in user space
-	        error = vmm_get_vseg( process , (intptr_t)buffer , &vseg );
-	        if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped buffer %x for %s / thread[%x,%x]\n",
-__FUNCTION__ , buffer, dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            else
-            {
-                // call relevant kernel function
-                error |= dev_fbf_move_data( is_write, buffer, npixels, offset );           
-
-                if( error )
-                {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot move data for %s / buffer %x / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), buffer, process->pid, this->trdid );
-#endif
-                    this->errno = EINVAL;
-                }
-            }
-            break;
-        }
-        ///////////////////////
-        case FBF_CREATE_WINDOW:
-        {
-            uint32_t   l_zero  = arg1 >> 16;
-            uint32_t   p_zero  = arg1 & 0xFFFF;
-            uint32_t   nlines  = arg2 >> 16;
-            uint32_t   npixels = arg2 & 0xFFFF;
-
-            // check buffer in user space
-	        error = vmm_get_vseg( process , (intptr_t)arg3 , &vseg );
-	        if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped user buffer %x for %s / thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)arg3, dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            else
-            {
-                // allocated buffer base address
-                intptr_t  user_buffer;
-     
-                // call relevant kernel function
-                error = dev_fbf_create_window( nlines,
-                                               npixels,
-                                               l_zero,
-                                               p_zero,
-                                               &user_buffer );
-                if( error == -1 )
-                {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot create window for %s / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                    this->errno = EINVAL;
-                }
-
-                // copy vseg base address to user space buffer
-                hal_copy_to_uspace( (void *)arg3,
-                                    XPTR( local_cxy , &user_buffer ),
-                                    sizeof(intptr_t) );
-                hal_fence();
-            }
-            break;
-        }
-        ///////////////////////
-        case FBF_ACTIVE_WINDOW:
-        {
-            uint32_t  wid    = arg1;
-            uint32_t  active = arg2;
-
-            // call relevant kernel function
-            error = dev_fbf_active_window( wid , active );
-                
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot %s / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            break;
-        }
-        ///////////////////////
-        case FBF_DELETE_WINDOW:
-        {
-            uint32_t  wid = arg1;
-
-            // call relevant kernel function
-            error = dev_fbf_delete_window( wid );
-                
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot %s / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            break;
-        }
-        ////////////////////////
-        case FBF_REFRESH_WINDOW:
-        {
-            uint32_t  wid        = arg1;
-            uint32_t  line_first = arg2;
-            uint32_t  line_last  = arg3;
-
-            // call relevant kernel function
-            error = dev_fbf_refresh_window( wid,
-                                            line_first,
-                                            line_last );
-                
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot %s / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            break;
-        }
-        /////////////////////
-        case FBF_MOVE_WINDOW:
-        {
-            uint32_t  wid      = arg1; 
-            uint32_t  l_zero   = arg2;
-            uint32_t  p_zero   = arg3;
-
-            // call relevant kernel function to move data
-            error = dev_fbf_move_window( wid, l_zero, p_zero ); 
-
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot %s / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            break;
-        }
-        ///////////////////////
-        case FBF_RESIZE_WINDOW:
-        {
-            uint32_t  wid      = arg1; 
-            uint32_t  width    = arg2;
-            uint32_t  height   = arg3;
-
-            // call relevant kernel function to move data
-            error = dev_fbf_resize_window( wid , width , height ); 
-
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot %s / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            break;
-        }
-        //////////////////////
-        case FBF_FRONT_WINDOW:
-        {
-            uint32_t  wid = arg1;
-
-            // call relevant kernel function
-            error = dev_fbf_front_window( wid );
-                
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot %s / thread[%x,%x]\n",
-__FUNCTION__ , dev_fbf_cmd_str(operation), process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-            }
-            break;
-        }
-        ///////
-	    default:  // undefined operation                       
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : undefined operation type %d / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , operation, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
-            this->errno = EINVAL;
-            error = -1;
-        }
-        break;
-	}  // end switch on operation
-
-    hal_fence();
-
-#if (DEBUG_SYS_FBF || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_FBF
-if( DEBUG_SYS_FBF < tm_end )
-printk("\n[%s] thread[%x,%x] exit for %s / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, dev_fbf_cmd_str( operation ), (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_FBF] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_FBF] , 1 );
-#endif
-
-    return error;
-
-}  // end sys_fbf()
Index: trunk/kernel/syscalls/sys_fg.c
===================================================================
--- trunk/kernel/syscalls/sys_fg.c	(revision 690)
+++ 	(revision )
@@ -1,106 +1,0 @@
-/*
- * sys_fg.c - Kernel function implementing the "fg" system call.
- * 
- * Author    Alain Greiner (2016,2017)
- *
- * Copyright (c)  UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <process.h>
-#include <shared_syscalls.h>
-#include <cluster.h>
-#include <rpc.h>
-
-#include <syscalls.h>
-
-///////////////////////
-int sys_fg( pid_t pid )
-{
-    xptr_t      process_xp;     // extended pointer on reference process descriptor
-    process_t * process_ptr;
-    cxy_t       process_cxy;
-    xptr_t      file_xp;        // extended pointer on STDIN file descriptor
-    xptr_t      chdev_xp;       // extended pointer on TXT0_RX chdev
-    chdev_t   * chdev_ptr;
-    cxy_t       chdev_cxy;
-
-    thread_t  * this    = CURRENT_THREAD;
-
-#if DEBUG_SYS_FG
-uint64_t    tm_start;
-uint64_t    tm_end;
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_FG < tm_start )
-printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n",
-__FUNCTION__ , CURRENT_THREAD , pid, (uint32_t)tm_start );
-#endif
-
-    // check process existence
-    process_xp = cluster_get_reference_process_from_pid( pid );
-
-    if( process_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : process %x not found\n", __FUNCTION__ , pid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-    
-    // get reference process cluster and local pointer
-    process_ptr = (process_t *)GET_PTR( process_xp );
-    process_cxy = GET_CXY( process_xp );
-
-    // get extended pointer on the reference process STDIN file descriptor
-    file_xp = hal_remote_l64( XPTR( process_cxy , &process_ptr->fd_array.array[0] ) );
- 
-    // get extended pointer on TXT_RX chdev
-    chdev_xp = chdev_from_file( file_xp );
-
-    // get chdev cluster and local pointer
-    chdev_ptr = GET_PTR( chdev_xp );
-    chdev_cxy = GET_CXY( chdev_xp );
-
-    // set reference process owner in TXT_RX chdev
-    hal_remote_s64( XPTR( chdev_cxy , &chdev_ptr->ext.txt.owner_xp ) , process_xp );
-
-    // reset PROCESS_TERM_WAIT and PROCESS_TERM_STOP flags in process term_state
-    hal_remote_atomic_and( XPTR( process_cxy , &process_ptr->term_state ),
-                                 ~(PROCESS_TERM_WAIT | PROCESS_TERM_STOP) ); 
- 
-    hal_fence();
-
-#if DEBUG_SYS_FG
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_FG < tm_end )
-printk("\n[DBG] %s : thread %x exit / process %x get TXT_%d ownership / cycle %d\n",
-__FUNCTION__ , CURRENT_THREAD , pid, 
-hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->channel ) ) , (uint32_t)tm_end );
-#endif
-
-	return 0;
-
-}  // end sys_fg()
-
Index: trunk/kernel/syscalls/sys_fork.c
===================================================================
--- trunk/kernel/syscalls/sys_fork.c	(revision 690)
+++ trunk/kernel/syscalls/sys_fork.c	(revision 1)
@@ -1,6 +1,8 @@
 /*
- * sys_fork.c - Kernel function implementing the "fork" system call.
+ * sys_fork.c - fork the current process
  * 
- * Authors  Alain Greiner  (2016,2017,2018,2019,2020)
+ * Authors  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *          Mohamed Lamine Karaoui (2015)
+ *          Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,13 +24,9 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_context.h>
-#include <hal_switch.h>
-#include <hal_atomic.h>
 #include <errno.h>
-#include <printk.h>
-#include <core.h>
+#include <config.h>
+#include <cpu.h>
 #include <cluster.h>
+#include <event.h>
 #include <list.h>
 #include <thread.h>
@@ -38,175 +36,218 @@
 #include <process.h>
 
-#include <syscalls.h>
-
-////////////////////
-int sys_fork( void )
+#if CONFIG_FORK_DEBUG
+#define fork_debug(...) printk(__VA_ARGS__)
+#else
+#define fork_debug(...) /**/
+#endif
+
+/***********************************************************************************************
+ * This kernel function implement the "fork" system call.
+ * The calling process descriptor (parent process), and the associated thread descriptor are
+ * replicated in the same cluster as the calling thread, but the new process (child process)
+ * is registered in another target cluster, that will become the process owner. 
+ * The child process and the associated main thread will be migrated to the target cluster
+ * later, when the child process makes an "exec" or any other system call. 
+ * The target cluster depends on the "fork_user" flag and "fork_cxy" variable that can be
+ * stored in the calling thread descriptor by the specific fork_place() system call.
+ * If not, the sys_fork() function makes a query to the DQDT to select the target cluster. 
+ * @ returns child process PID if success / returns -1 if failure
+ **********************************************************************************************/
+int sys_fork();
 {
-	process_t       * parent_process_ptr;   // pointer on local parent process descriptor
-    xptr_t            parent_thread_xp;     // extended pointer on parent thread descriptor
-    pid_t             parent_pid;           // parent process identifier
-    thread_t        * parent_thread_ptr;    // local pointer on local parent thread
-    cxy_t             parent_cxy;           // parent thread cluster
-
-    pid_t             child_pid;            // child process identifier
-    thread_t        * child_thread_ptr;     // local pointer on remote child thread 
-    cxy_t             child_cxy;            // target cluster for forked child process 
+	process_t          * parent_process;  // pointer on parent process descriptor
+    pid_t                parent_pid;      // parent process identifier
+    thread_t           * parent_thread;   // pointer on parent thread descriptor
+	process_t          * child_process;   // pointer on child process descriptor
+    pid_t                child_pid;       // child process identifier
+	thread_t           * child_thread;    // pointer on child main thread descriptor
+    trdid_t              child_trdid;     // child main thread identifier
+    core_t             * child_core;      // pointer on core for child main thread
+    lid_t                child_core_lid;  // core local index for the child main thread
+    cxy_t                target_cxy;      // final target cluster for forked child process 
+	error_t              error;
+
+    cluster_t          * parent_cluster = LOCAL_CLUSTER;
+
+    // get pointers on parent process and thread
+	parent_thread  = CURRENT_THREAD;
+	parent_process = parent_thread->process;
+
+    // check parent process children number
+	if( hal_atomic_add( &parent_process->childs_nr , 1 ) >= CONFIG_PROCESS_CHILDS_MAX_NR )
+	{
+	    printk("ERROR in %s : too much children processes\n", __FUNCTION__);
+	    hal_atomic_add ( &parent_process->childs_nr , -1 );
+        return EAGAIN;
+	}
+
+	fork_debug("INFO : %s enters for process %d at cycle [%d]\n",
+		  __FUNCTION__, parent_process->pid, hal_time_stamp());
+
+    // save FPU state in fpu_context if parent process is FPU owner
+    // because we want the child process to share the FPU context
+	if( CURRENT_CORE->fpu_owner == parent_thread )
+	{
+		hal_fpu_context_save( parent_thread );
+		fork_debug("INFO : %s save FPU\n", __FUNCTION__);
+	}
+
+    // Select target cluster for future migration of child process and main thread.
+    // The placement can be specified by user. If placement is not user-defined,
+    // the placement is defined by the DQDT. 
+    // The two first processes ("init" and "sh") on boot cluster will not migrate. 
+	if( parent_threads->fork_user )
+	{
+        // user defined placement
+        target_cxy = parent->thread.fork_cxy;
+        parent->thread.fork_cxy = false;
+	}
+    else if( (LPID_FROM_PID(parent_process->pid) < 2 )  
+             && ( parent_cluster->cxy == parent_cluster->boot_cxy ) )
+    {
+        // 2 first process stay in boot cluster
+        target_cxy = parent_cluster->cxy;
+    }
+	else
+	{
+        // DQDT placement
+		target_cxy = dqdt_get_cluster_for_process();
+	}
+
+	fork_debug("INFO : %s select target_cluster = %x\n",
+              __FUNCTION__ , target_cxy );
+
+    // allocates memory in local cluster for the child process descriptor 
+	child_process = process_alloc(); 
+	if( child_process == NULL )
+	{
+	    printk("ERROR in %s : cannot allocate memory for child process\n", __FUNCTION__ );
+	    hal_atomic_add ( &parent_process->childs_nr , -1 );
+        return EAGAIN;
+	}
+
+    // get a new PID for child process
+    // it requires an RPC if target cluster is remote
+    xptr_t xp = XPTR( target_cxy , child_process ); 
+    if( target_cxy == parent_cluster->cxy )   // local cluster
+    {
+        error = process_pid_alloc( xp , &child_pid );
+    }
+    else                            // remote cluster
+    {
+        rpc_process_pid_alloc_server( target_cxy , xp , &error , &child_pid );
+    }
+    if( error )
+    {
+	    printk("ERROR in %s : cannot allocate PID\n", __FUNCTION__ );
+	    atomic_add ( &parent_process->childs_nr , -1 );
+        process_destroy( child_process );
+        return EAGAIN;
+    }
+
+    // initialize and register the child process descriptor
+    error = process_reference_init( child_process , child_pid , parent_pid );
+    if( error )
+    {
+	    printk("ERROR in %s : cannot initialise child process\n", __FUNCTION__ );
+	    atomic_add ( &parent_process->childs_nr , -1 );
+        process_destroy( child_process );
+        return EAGAIN;
+    }
+
+	fork_debug("INFO : %s created child process : pid = %x / ppid = %x\n", 
+              __FUNCTION__, child_pid , parent_pid );
+
+    // set IS_REFERENCE flag in child process descriptor
+    child_process->flags = PDF_IS_REFERENCE;
+
+    // initialises child process standard files structures
+    // ( root / cwd / bin ) from parent process descriptor
+	spinlock_lock( &parent_process->cwd_lock );
+
+	vfs_file_count_up( &parent_process->vfs_root );
+	child_process->vfs_root = parent_process->vfs_root;
+
+	vfs_file_count_up( &parent_process->vfs_cwd );
+	child_process->vfs_cwd  = parent_process->vfs_cwd;
+
+	vfs_file_count_up( &parent_process->vfs_bin );
+    child_process->vfs_bin = parent_process->vfs_bin;
+
+	spinlock_unlock( &parent_process->cwd_lock );
+  
+    // copy the parent process fd_array to the child process fd_array
+	process_fd_fork( child_process , parent_process );
+
+    // initialise child process signal manager TODO ???
+	signal_manager_init( child_process );
+  
+	fork_debug("INFO : %s duplicated child process from parent process\n",
+                  __FUNCTION__ );
+
+    // replicates virtual memory manager
+	error = vmm_dup( &child_process->vmm , &parent_process->vmm );
+	if( error )
+    {
+	    printk("ERROR in %s : cannot duplicate VMM\n", __FUNCTION__ );
+	    atomic_add ( &parent_process->childs_nr , -1 );
+        process_destroy( child_process );
+        return EAGAIN;
+    }
+  
+	fork_debug("INFO : %s: parent vmm duplicated in child process\n", __FUNCTION__ );
+
+    // create child main thread descriptor in local cluster TODO stack ???
+    error = thread_user_fork( &child_thread , process , parent_thread );
+	if( error )
+    {
+	    printk("ERROR in %s : cannot duplicate thread\n", __FUNCTION__ );
+	    atomic_add ( &parent_process->childs_nr , -1 );
+        process_destroy( child_process );
+        return EAGAIN;
+    }
+
+    // register child thread in child process, and get a TRDID
+    spinlock_lock( &child->process->th_lock );
+    error = process_register_thread( child->process, child->thread , &child_trdid );
+    spinlock_unlock( &process->th_lock );
+
+    if( error ) 
+    {
+        printk("ERROR in %s : cannot register thread\n", __FUNCTION__ );
+	    atomic_add ( &parent_process->childs_nr , -1 );
+        thread_destroy( child_thread );
+        process_destroy( child_process );
+        return EAGAIN;
+    }
  
-    xptr_t            ref_process_xp;       // extended pointer on reference parent process
-    cxy_t             ref_process_cxy;      // cluster of reference parent process
-    process_t       * ref_process_ptr;      // local pointer on reference parent process
-
-	error_t           error;
-
-    // get pointers on local parent process and thread
-	parent_thread_ptr  = CURRENT_THREAD;
-    parent_thread_xp   = XPTR( local_cxy , parent_thread_ptr );
-	parent_process_ptr = parent_thread_ptr->process;
-    parent_pid         = parent_process_ptr->pid;
-    parent_cxy         = local_cxy;
-
-#if DEBUG_SYS_FORK || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_FORK
-if( DEBUG_SYS_FORK < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter / cycle =  %d\n",
-__FUNCTION__, parent_pid, parent_thread_ptr->trdid, (uint32_t)tm_start );
-#endif
-
-    // get infos on reference parent process
-    ref_process_xp  = parent_process_ptr->ref_xp;
-    ref_process_cxy = GET_CXY( ref_process_xp );
-    ref_process_ptr = GET_PTR( ref_process_xp );
-
-    // check parent process children number from reference
-    xptr_t   children_xp = XPTR( ref_process_cxy , &ref_process_ptr->children_nr );
-    if( hal_remote_atomic_add( children_xp , 1 ) >= CONFIG_PROCESS_MAX_CHILDREN )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / too much children\n",
-__FUNCTION__, parent_pid, parent_thread_ptr->trdid );
-#endif
-	    hal_remote_atomic_add ( children_xp , -1 );
-        parent_thread_ptr->errno = EAGAIN;
-        return -1;
-	}
-
-    // Select target cluster for child process and main thread.
-    // If placement is not user-defined, it is defined by the DQDT. 
-	if( parent_thread_ptr->fork_user )
-	{
-        child_cxy = parent_thread_ptr->fork_cxy;
-        parent_thread_ptr->fork_user = false;
-	}
-	else                                  // DQDT placement
-	{
-		child_cxy = dqdt_get_cluster_for_thread( LOCAL_CLUSTER->dqdt_root_xp );
-	}
-
-#if (DEBUG_SYS_FORK & 1 )
-if( DEBUG_SYS_FORK < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] selected cluster %x\n",
-__FUNCTION__, parent_pid, parent_thread_ptr->trdid, child_cxy );
-#endif
-
-    // call process_make_fork in target cluster
-    if( child_cxy == local_cxy )
-    {
-        error = process_make_fork( ref_process_xp,
-                                   parent_thread_xp,
-                                   &child_pid,
-                                   &child_thread_ptr );
-    }
-    else
-    {
-        rpc_process_make_fork_client( child_cxy,
-                                      ref_process_xp,
-                                      parent_thread_xp,
-                                      &child_pid,
-                                      &child_thread_ptr,
-                                      &error );
-    }
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] cannot fork\n",
-__FUNCTION__, parent_pid, parent_thread_ptr->trdid );
-#endif
-        parent_thread_ptr->errno = EAGAIN;
-        return -1;
-    }
-
-    // set remote child FPU_context from parent_thread register values
-    // only when the parent thread is the FPU owner
-	if( CURRENT_THREAD->core->fpu_owner == parent_thread_ptr )
-	{
-		hal_fpu_context_save( XPTR( child_cxy , child_thread_ptr ) );
-	}
-
-    // set the remote child CPU context from parent register values,
-    // set the remote child uzone from 
-    // replicates the parent thread kernel stack to the child thread descriptor,
-    // and finally unblock the child thread. 
-    hal_cpu_context_fork( XPTR( child_cxy , child_thread_ptr ) );
-
-    // From this point, both parent and child threads execute the following code,
-    // but child thread will only execute it after being unblocked by parent thread.
-    // They can be distinguished by the (CURRENT_THREAD,local_cxy) values.
-    // - parent return child PID to user application.
-    // - child  return 0 to user application 
-
-    thread_t * current = CURRENT_THREAD;
-
-#if (DEBUG_SYS_FORK || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-    if( (current == parent_thread_ptr) && (local_cxy == parent_cxy) )   // parent thread
-    {
-
-#if DEBUG_SYS_FORK
-if( DEBUG_SYS_FORK < (uint32_t)tm_end )
-printk("\n[%s] parent thread[%x,%x] exit / child_pid %x / cycle %d\n",
-__FUNCTION__, current->process->pid, current->trdid, child_pid, (uint32_t)tm_end );
-#endif
-
-// only parent display the parent and child VMM
-#if (DEBUG_SYS_FORK & 1 )
-if( DEBUG_SYS_FORK < (uint32_t)tm_end )
-{
-    process_t * child_process_ptr = hal_remote_lpt( XPTR( child_cxy , 
-                                                          &child_thread_ptr->process ) );
-    xptr_t      child_process_xp  = XPTR( child_cxy , child_process_ptr );
-
-    hal_vmm_display( ref_process_xp , true ); 
-    hal_vmm_display( child_process_xp , true );
-}
-#endif
-
-// only parent contribute to syscalls instrumentation
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_FORK] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_FORK] , 1 );
-#endif
-        return child_pid;
-    }
-	else                                                               // child_thread
-    {
-
-#if DEBUG_SYS_FORK
-if( DEBUG_SYS_FORK < (uint32_t)tm_end )
-printk("\n[%s] child thread[%x,%x] exit / child_pid %x / cycle %d\n",
-__FUNCTION__, current->process->pid, current->trdid, child_pid, (uint32_t)tm_end );
-#endif
-
-        return 0;
-    }
+    // get a local core to execute child thread
+    child_core_lid = cluster_select_local_core();
+
+	// Update child thread descriptor
+	child_thread->core    = process->core_tbl[child_core_lid];
+	child_thread->process = child_process;
+    child_thread->trdid   = chid_trdid;
+
+	fork_debug("INFO : %s initialised child main thread\n", __FUNCTION__ );
+
+    // register local child thread into local child process th_tbl[]
+    // we don't use the th_lock because there is no concurrent access
+    ltid_t ltid = LTID_FROM_TRDID( trdid );
+	child_process->th_tbl[ltid] = XPTR( local_cxy , child_thread );
+	child_process->threads_nr = 1;
+
+    // register child thread in scheduler 
+	sched_register( child_thread->core , child_thread );
+  
+	fork_debug("INFO : %s registered main thread in scheduler\n", __FUNCTION__);
+
+	// update DQDT for the child thread 
+    dqdt_update_threads_number( 1 );
+
+	fork_debug("INFO :%s completed / parent pid = %x / child pid = %x / at cycle [%d]\n",
+	          __FUNCTION__, parent_process->pid, child_process->pid, hal_time_stamp() );
+
+	return child_process->pid;
 
 }  // end sys_fork()
Index: trunk/kernel/syscalls/sys_fsync.c
===================================================================
--- trunk/kernel/syscalls/sys_fsync.c	(revision 690)
+++ trunk/kernel/syscalls/sys_fsync.c	(revision 1)
@@ -1,16 +1,14 @@
 /*
- * sys_fsync.c - copy all modified pages of a given file mapper to IOC device.
+ * sys_fsync: sync file
  * 
- * Author    Alain Greiner  (2016,1017)
+ * Copyright (c) 2015 UPMC Sorbonne Universites
  *
- * Copyright (c)  UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,20 +16,14 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <vfs.h>
-#include <process.h>
-#include <thread.h>
-#include <printk.h>
 
-#include <syscalls.h>
+#include <types.h>
 
-/////////////////////////////////
-int sys_fsync( uint32_t file_id )
+int sys_fsync (uint_t fd)
 {
-    printk("\n[ERROR] in %d : not implemented yet\n", __FUNCTION__, file_id );
-    return ENOSYS;
+	//TODO
+	return 0;
 }
Index: trunk/kernel/syscalls/sys_get.c
===================================================================
--- trunk/kernel/syscalls/sys_get.c	(revision 690)
+++ 	(revision )
@@ -1,475 +1,0 @@
-/*
- * sys_get.c - Kernel function implementing all non_standard "get_xxx()" syscalls.
- * 
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
- *  
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <hal_special.h>
-#include <errno.h>
-#include <core.h>
-#include <thread.h>
-#include <process.h>
-#include <vmm.h>
-#include <printk.h>
-
-#include <syscalls.h>
-
-/////////////////////////////////////////////////////////////////////////////////
-// This function returns a printable string for the sys_get command type.
-/////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_SYS_GET
-static char* get_cmd_type_str( uint32_t type )
-{
-    if     ( type == GET_PROCESSES    ) return "PROCESSES";
-    else if( type == GET_CONFIG       ) return "CONFIG";
-    else if( type == GET_CORE_ID      ) return "CORE_ID";
-    else if( type == GET_NB_CORES     ) return "NB_CORES"; 
-    else if( type == GET_BEST_CORE    ) return "BEST_CORE";
-    else if( type == GET_CYCLE        ) return "CYCLE";
-    else if( type == GET_THREAD_INFO  ) return "THREAD_INFO";
-    else                                return "undefined";
-}
-#endif
-
-//////////////////////////
-int sys_get ( reg_t  arg0,
-              reg_t  arg1,
-              reg_t  arg2,
-              reg_t  arg3 )
-{
-    vseg_t    * vseg;
-	int         ret;
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-    uint32_t    type    = arg0;
-
-#if DEBUG_SYS_GET || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_GET
-if( DEBUG_SYS_GET < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter / %s / a1 %x / a2 %x / a3 %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, get_cmd_type_str( type ), 
-arg1, arg2, arg3, (uint32_t)tm_start );
-#endif
-
-    switch( type )
-    {
-        ///////////////
-        case GET_CYCLE:
-        {
-            char      * u_buf = (char *)(intptr_t)arg1;
-
-            // check buffer in user space
-            if( vmm_get_vseg( process , (intptr_t)arg1 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for CYCLE : thread[%x,%x] / user buffer unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg1 );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-	        }
-
-            // call relevant core function
-	        uint64_t k_cycle = hal_get_cycles();
-
-            // copy to user space
-	        hal_copy_to_uspace( u_buf,
-                                XPTR( local_cxy , &k_cycle ),
-                                sizeof(uint64_t) );
-            ret = 0;
-            break;
-        }   
-        ///////////////////
-        case GET_PROCESSES:
-        {
-            uint32_t    cxy   = ((uint32_t)arg1 >> 16);
-            uint32_t    owned = ((uint32_t)arg1 & 0xFFFF);
-            char      * u_buf = (char *)(intptr_t)arg2;
-            uint32_t    size  = (uint32_t)arg3;
-
-            char        k_buf[CONFIG_PROCESS_DISPLAY_BUF_SIZE];  // kernel buffer (one line)
-
-            uint32_t    length;         // number of bytes copied in k_buf (without NUL)
-            uint32_t    offset = 0;     // number of bytes already copied to u_buf
-            xptr_t      iter_xp;
-
-            // check buffer in user space
-            if( vmm_get_vseg( process , (intptr_t)u_buf , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for PROCESSES : thread[%x,%x] / user buffer unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-	        }
-
-#if DEBUG_SYS_GET
-if( DEBUG_SYS_GET < (uint32_t)tm_start )
-printk("\n[%s] for PROCESSES : thread[%x,%x] cxy %x / owned %d\n",
-__FUNCTION__, process->pid, this->trdid, cxy, owned );
-#endif
-
-            // build extended pointers on root and lock of process list in cluster cxy
-            xptr_t  root_xp = XPTR( cxy , &LOCAL_CLUSTER->pmgr.local_root );
-            xptr_t  lock_xp = XPTR( cxy , &LOCAL_CLUSTER->pmgr.local_lock );
-
-            // take lock on process list 
-            remote_queuelock_acquire( lock_xp );
-
-            // loop on all processes in cluster cxy 
-            XLIST_FOREACH( root_xp , iter_xp )
-            {
-                // get process pointers
-                xptr_t      process_xp  = XLIST_ELEMENT( iter_xp , process_t , local_list );
-                process_t * process_ptr = GET_PTR( process_xp );
-                cxy_t       process_cxy = GET_CXY( process_xp );
-
-                // get process PID
-                pid_t       pid = hal_remote_l32( XPTR( process_cxy , &process_ptr->pid ) );
-
-#if DEBUG_SYS_GET
-if( DEBUG_SYS_GET < (uint32_t)tm_start )
-printk("\n[%s] for PROCESSES : thread[%x,%x] in FOREACH / pid %x\n",
-__FUNCTION__, process->pid, this->trdid, pid );
-#endif
-
-                // when owned is set, display only owned user processes 
-                if( (owned == 0) || 
-                    ((CXY_FROM_PID( pid ) == cxy) && (LPID_FROM_PID( pid ) != 0)) )
-                {
-                    // build string for one line (one process descriptor)
-                    length = process_build_string( process_xp,
-                                                   k_buf,
-                                                   CONFIG_PROCESS_DISPLAY_BUF_SIZE );
-
-                    // copy this string to u_buf (with the '\n' , but without the NUL)
-                    hal_copy_to_uspace( u_buf + offset,
-                                        XPTR( local_cxy , k_buf ),
-                                        length );
-                    // update offset
-                    offset += length; 
-                }
-
-                // check user buffer overflow
-                if( (offset + CONFIG_PROCESS_DISPLAY_BUF_SIZE) >= size )
-                {
-                    // build a warning message
-                    length = snprintk( k_buf , CONFIG_PROCESS_DISPLAY_BUF_SIZE ,
-                             "   ... user buffer too for all process in cluster %x", cxy );
-
-                    // copy this string to u_buf 
-                    hal_copy_to_uspace( u_buf + offset,
-                                        XPTR( local_cxy , k_buf ),
-                                        length );
-                    // exit FOREACH loop
-                    break;
-                }
-                else             // add the NUL character in u_buf
-                {
-                    char byte = 0;
-
-                    // copy this NUL character to u_buf
-                    hal_copy_to_uspace( u_buf + offset,
-                                        XPTR( local_cxy , &byte ),
-                                        1 );
-                }
-            }   // end FOREACH
-
-            // release lock on process list 
-            remote_queuelock_release( lock_xp );
-
-            ret = 0;
-            break;
-        }
-        ////////////////
-        case GET_CONFIG:
-        {
-            hard_config_t * u_config = (hard_config_t *)arg1;
-
-            hard_config_t   k_config;  // local kernel structure
-
-            // check u_config mapped in user space
-            if( vmm_get_vseg( process , (intptr_t)u_config  , &vseg ) )
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for CONFIG : thread[%x,%x] / user pointer %x unmapped\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)u_config );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-	        }
-
-            // copy config parameters from cluster descriptor to kernel structure
-	        k_config.x_size       = LOCAL_CLUSTER->x_size;
-	        k_config.y_size       = LOCAL_CLUSTER->y_size;
-	        k_config.ncores       = LOCAL_CLUSTER->cores_nr;
-            k_config.txt_channels = LOCAL_CLUSTER->nb_txt_channels;
-            k_config.nic_channels = LOCAL_CLUSTER->nb_nic_channels;
-            k_config.ioc_channels = LOCAL_CLUSTER->nb_ioc_channels;
-            k_config.fbf_channels = LOCAL_CLUSTER->nb_fbf_channels;
-
-            // copy k_config structure to user space
-	        hal_copy_to_uspace( u_config , 
-                                XPTR(local_cxy, &k_config ),
-                                sizeof(hard_config_t) );
-            ret = 0;
-            break;             
-        }
-        /////////////////
-        case GET_CORE_ID:
-        {
-            uint32_t  * u_cxy = (uint32_t *)arg1;
-            uint32_t  * u_lid = (uint32_t *)arg2;
-
-            // check cxy buffer in user space
-            if( vmm_get_vseg( process , (intptr_t)u_cxy , &vseg ) )
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for CORE_ID : thread[%x,%x] / cxy buffer unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)u_cxy );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-	        }
-
-            // check lid buffer in user space
-            if(  vmm_get_vseg( process , (intptr_t)u_lid , &vseg ) )
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for CORE_ID : thread[%x,%x] / lid buffer unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)u_lid );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-	        }
-
-            // get lid from core decriptor
-	        lid_t lid = this->core->lid;
-
-            // copy cxy to user space
-	        hal_copy_to_uspace( u_cxy,
-                                XPTR( local_cxy , &local_cxy ),
-                                sizeof(uint32_t) );
-
-	        hal_copy_to_uspace( u_lid,
-                                XPTR( local_cxy , &lid ),
-                                sizeof(uint32_t) );
-            ret = 0;
-            break;
-        }
-        //////////////////
-        case GET_NB_CORES:
-        {
-            uint32_t   cores;
-            cxy_t      cxy    = arg1;
-            uint32_t * u_cores = (uint32_t *)arg2;
-
-            // check ncores buffer in user space
-            if( vmm_get_vseg( process , (intptr_t)u_cores , &vseg ) )
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for NB_CORES : thread[%x,%x] / user buffer unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)u_cores );
-#endif
-                this->errno = EFAULT;
-		        ret = -1;
-                break;
-	        }
-
-            // get number of cores in cluster
-            if( cluster_is_active( cxy ) )  
-            {
-	            cores = hal_remote_l32( XPTR( cxy , &LOCAL_CLUSTER->cores_nr ) );
-            }
-            else   // target cluster undefined
-            {
-                cores = 0;
-            }
-
-            // copy to user space
-	        hal_copy_to_uspace( u_cores,
-                                XPTR( local_cxy , &cores ),
-                                sizeof(uint32_t) );
-            ret = 0;
-            break;
-        }
-        ///////////////////
-        case GET_BEST_CORE:
-        {
-            uint32_t   base_cxy = ((uint32_t)arg1 >> 16); 
-            uint32_t   level    = ((uint32_t)arg1 & 0xFFFF);
-            uint32_t * cxy      = (uint32_t *)(intptr_t)arg2;
-            uint32_t * lid      = (uint32_t *)(intptr_t)arg3;
-
-            uint32_t  k_cxy;
-            uint32_t  k_lid;
-
-            // check <cxy> buffer in user space
-            if( vmm_get_vseg( process , (intptr_t)cxy , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for BEST_CORE : thread[%x,%x] / user buffer cxy unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , cxy );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-            }
-
-            // check <lid> buffer in user space
-            if( vmm_get_vseg( process , (intptr_t)lid , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for BEST_CORE : thread[%x,%x] / user buffer lid unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , lid );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-            }
-
-            // check level argument
-	        if( level > 5 ) 
-	        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for BEST_CORE : thread[%x,%x] / level argument %d too large\n",
-__FUNCTION__ , process->pid , this->trdid , level );
-#endif
-                this->errno = EINVAL;
-		        ret = -1;
-                break;
-	        }
-
-            // get extended pointer on the macro-cluster DQDT root node
-            xptr_t root_xp = dqdt_get_root( base_cxy , level );
-
-            if( root_xp == XPTR_NULL )  // macro-cluster undefined
-            {
-
-#if DEBUG_SYSCALLS_ERROR 
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for BEST_CORE ; thread[%x,%x] DQDT undefined\n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // get best core in best cluster
-  	        k_cxy = (uint32_t)dqdt_get_cluster_for_thread( root_xp );
-            k_lid = (uint32_t)cluster_select_local_core( k_cxy );
-
-            // copy to user space
-	        hal_copy_to_uspace( cxy,
-                                XPTR( local_cxy , &k_cxy ),
-                                sizeof(uint32_t) );
-
-   	        hal_copy_to_uspace( lid,
-                                XPTR( local_cxy , &k_lid ),
-                                sizeof(uint32_t) );
-            ret = 0;
-            break;
-        }
-        /////////////////////
-        case GET_THREAD_INFO:
-        {
-            thread_info_t * u_info = (thread_info_t *)arg1;
-
-            // check buffer in user space
-            if( vmm_get_vseg( process , (intptr_t)u_info , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s for THREAD_INFO : thread[%x,%x] / user buffer unmapped %x\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)u_info );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // copy this thread_info_t structure to user space
-	        hal_copy_to_uspace( u_info, 
-                                XPTR( local_cxy , &this->info),
-                                sizeof(thread_info_t) );
-            ret = 0;
-            break;
-        }
-        default:
-        {
-            ret = -1;
-        }
-    }   // end switch cmd
-
-    hal_fence();
-
-#if (DEBUG_SYS_GET || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_GET
-if( DEBUG_SYS_GET < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_GET] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_GET] , 1 );
-#endif
-
-	return ret; 
-
-}  // end sys_get()
Index: trunk/kernel/syscalls/sys_getcwd.c
===================================================================
--- trunk/kernel/syscalls/sys_getcwd.c	(revision 690)
+++ trunk/kernel/syscalls/sys_getcwd.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_getcwd.c - kernel function implementing the "getcwd" syscall.
+ * kern/sys_getcwd.c - get process current work directory
  * 
- * Author    Alain Greiner (2016,2017,2018,2019)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c)  UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,105 +17,51 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_special.h>
-#include <errno.h>
+#include <libk.h>
 #include <vfs.h>
-#include <vmm.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
+#include <kmem.h>
+#include <ppm.h>
 #include <thread.h>
-#include <printk.h>
 
-#include <syscalls.h>
+/* TODO: user page need to be locked as long as its region */
 
-///////////////////////////////////
-int sys_getcwd ( char     * buffer,
-                 uint32_t   nbytes )
+int sys_getcwd (char *buff, size_t size)
 {
-	error_t       error;
-    vseg_t      * vseg;
-    char        * first;                   // first character valid in buffer
+	register struct thread_s *this;
+	register struct task_s *task;
+	register error_t err;
+	struct ku_obj ku_buff;
+  
+	this      = current_thread;
+	task      = current_task;
 
-    char          kbuf[CONFIG_VFS_MAX_PATH_LENGTH]; 
-
-	thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if (DEBUG_SYS_GETCWD || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    // check buffer size
-	if( nbytes < CONFIG_VFS_MAX_PATH_LENGTH )
+	if((size < VFS_MAX_NAME_LENGTH) || (!buff)) 
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : buffer too small for thread %x,%x]\n",
-__FUNCTION__ , process->pid, this->trdid );
-#endif
-		this->errno = EINVAL;
-        return -1;
+		err = ERANGE;
+		goto SYS_GETCWD_ERROR;
 	}
 
-    // check buffer in user space
-    error = vmm_get_vseg( process, (intptr_t)buffer , &vseg );
-
-	if( error )
+	if(vmm_check_address("usr cwd buffer", task, buff, size))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : user buffer unmapped %x for thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)buffer , process->pid, this->trdid );
-#endif
-		this->errno = EINVAL;
-        return -1;
+		err = EFAULT;
+		goto SYS_GETCWD_ERROR;
 	}
 
-#if DEBUG_SYS_GETCWD
-if( DEBUG_SYS_GETCWD < tm_start )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_start );
-#endif
+	KU_SZ_BUFF(ku_buff, buff, size);
 
-    // get extended pointer on CWD inode from the reference process
-    xptr_t      ref_xp  = process->ref_xp;
-    process_t * ref_ptr = GET_PTR( ref_xp );
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    xptr_t      cwd_xp  = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
+	rwlock_rdlock(&task->cwd_lock);
 
-    // call relevant VFS function
-	error = vfs_get_path( cwd_xp,
-                          kbuf, 
-                          &first, 
-                          CONFIG_VFS_MAX_PATH_LENGTH );
+	err = vfs_get_path(&task->vfs_cwd, &ku_buff);
 
-    // copy kernel buffer to user space
-    hal_strcpy_to_uspace( buffer, 
-                          XPTR( local_cxy , first ),
-                          CONFIG_VFS_MAX_PATH_LENGTH );
+	rwlock_unlock(&task->cwd_lock);
 
-    hal_fence();
 
-#if (DEBUG_SYS_GETCWD || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_GETCWD
-if( DEBUG_SYS_GETCWD < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_GETCWD] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_GETCWD] , 1 );
-#endif
-
-	return 0;
-
-}  // end sys_getcwd()
+SYS_GETCWD_ERROR:
+	this->info.errno = err;
+	return (int)buff;
+}
Index: trunk/kernel/syscalls/sys_getpid.c
===================================================================
--- trunk/kernel/syscalls/sys_getpid.c	(revision 690)
+++ trunk/kernel/syscalls/sys_getpid.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * kern/sys_getpid.c - Kernel function implementing the "get_pid" system call.
+ * kern/sys_getpid.c - get process id
  * 
- * Author     Alain Greiner  (2016,2017, 2018)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,49 +17,13 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <task.h>
 #include <thread.h>
-#include <process.h>
-#include <syscalls.h>
 
-//////////////////////
-int sys_getpid( void )
+int sys_getpid()
 {
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if (DEBUG_SYS_GETPID || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_GETPID
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_FG < tm_start )
-printk("\n[DBG] %s : thread %x in process %x enter / cycle %d\n",
-__FUNCTION__ , this->trdid , process->pid, (uint32_t)tm_start );
-#endif
-
-    // get pid value from local process descriptor    
-    pid_t pid = process->pid;
-
-#if (DEBUG_SYS_GETPID || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_GETPID
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_GETPID < tm_end )
-printk("\n[DBG] %s : thread %x in process %x exit / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_GETPID] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_GETPID] , 1 );
-#endif
-
-	return pid;
-
-}  // end sys_getpid()
+	return current_task->pid; 
+}
Index: trunk/kernel/syscalls/sys_gettimeofday.c
===================================================================
--- trunk/kernel/syscalls/sys_gettimeofday.c	(revision 1)
+++ trunk/kernel/syscalls/sys_gettimeofday.c	(revision 1)
@@ -0,0 +1,53 @@
+/*
+ * sys_gettimeofday: get current time
+ * 
+ * Copyright (c) 2015 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <cpu.h>
+#include <thread.h>
+#include <time.h>
+
+int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
+{
+	error_t err;
+	uint_t tm_ms, tm_us;
+	struct timeval time;
+
+	if((tv == NULL) || NOT_IN_USPACE(tv) || NOT_IN_USPACE(tv+sizeof(*tv)))
+	{
+		err = EINVAL;
+		goto fail_inval;
+	}
+
+	if(tz) 
+		return ENOTSUPPORTED;
+
+	cpu_get_time(current_cpu, &tm_ms, &tm_us);
+	time.tv_sec = tm_ms/1000;
+	time.tv_usec = ((tm_ms%1000)*1000)+tm_us;
+
+	//printk(INFO, "%s: [%d] (%u ms) sec %u, usec %u\n", __FUNCTION__, 
+	//current_cpu->gid, tm_ms, (uint32_t)time.tv_sec, (uint32_t)time.tv_usec);
+
+	err    = cpu_copy_to_uspace(tv, &time, sizeof(time));
+
+fail_inval:
+	current_thread->info.errno = err;
+	return err; 
+}
Index: trunk/kernel/syscalls/sys_is_fg.c
===================================================================
--- trunk/kernel/syscalls/sys_is_fg.c	(revision 690)
+++ 	(revision )
@@ -1,117 +1,0 @@
-/*
- * sys_fg.c - Kernel function implementing the "is_fg" system call.
- * 
- * Author    Alain Greiner (2016,2017,2018,2019)
- *
- * Copyright (c)  UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <hal_special.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <process.h>
-#include <vseg.h>
-#include <shared_syscalls.h>
-#include <cluster.h>
-
-#include <syscalls.h>
-
-//////////////////////////////
-int sys_is_fg( pid_t      pid,
-               uint32_t * is_fg )
-{
-    xptr_t      process_xp;       // extended pointer on process descriptor in owner cluster
-    uint32_t    is_txt_owner;     // kernel buffer for is_fg
-    vseg_t    * vseg;             // for buffer mapping check
-    error_t     error;
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if (DEBUG_SYS_IS_FG || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_IS_FG
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_IS_FG < tm_start )
-printk("\n[DBG] %s : thread %x in process %x enter for pid %x / cycle %d\n",
-__FUNCTION__ , this->trdid , process->pid, pid, (uint32_t)tm_start );
-#endif
-
-    // check buffer in user vspace
-	error = vmm_get_vseg( process , (intptr_t)is_fg , &vseg );
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped owner buffer %x / thread %x in process %x\n",
-__FUNCTION__ , (intptr_t)is_fg, this->trdid, process->pid );
-#endif
-         this->errno = EINVAL;
-         return -1;
-    }
-
-    // check target process existence
-    process_xp = cluster_get_owner_process_from_pid( pid );
-
-    if( process_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : process %x not found\n", __FUNCTION__ , pid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-    
-    // call relevant kernel function
-    is_txt_owner = process_txt_is_owner( process_xp );
-
-    // copy to user space
-    hal_copy_to_uspace( is_fg,
-                        XPTR( local_cxy , &is_txt_owner ),
-                        sizeof(uint32_t) );
-
-    hal_fence();
-
-#if (DEBUG_SYS_IS_FG || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_IS_FG
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_IS_FG < tm_end )
-printk("\n[DBG] %s : thread %x in process %x exit / is_txt_owner %d / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, is_txt_owner, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_IS_FG] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_IS_FG] , 1 );
-#endif
-
-return 0;
-
-}  // end sys_is_fg()
-
Index: trunk/kernel/syscalls/sys_isatty.c
===================================================================
--- trunk/kernel/syscalls/sys_isatty.c	(revision 690)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*
- * sys_isatty.c - test if a file descriptor is a TXT device.
- * 
- * Author     Alain Greiner (2016,2017,2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_irqmask.h>
-#include <hal_special.h>
-#include <errno.h>
-#include <vfs.h>
-#include <vmm.h>
-#include <chdev.h>
-#include <thread.h>
-#include <printk.h>
-#include <process.h>
-
-#include <syscalls.h>
-
-////////////////////////////////////
-int sys_isatty( uint32_t   file_id )
-{
-	xptr_t    file_xp;     // extended pointer on remote file descriptor
-    xptr_t    chdev_xp;    // extended pointer on remote chdev
-    cxy_t     chdev_cxy;
-    chdev_t * chdev_ptr;
-    uint32_t  chdev_func;
-    int       retval;
-
-	thread_t  *  this    = CURRENT_THREAD;
-	process_t *  process = this->process;
- 
-#if DEBUG_SYS_ISATTY
-uint64_t tm_start;
-uint64_t tm_end;
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_ISATTY < tm_start )
-printk("\n[DBG] %s : thread %x enter / process %x / cycle %d\n"
-__FUNCTION__ , this, process->pid, (uint32_t)tm_start );
-#endif
-
-    // check file_id argument
-	if( file_id >= CONFIG_PROCESS_FILE_MAX_NR )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : illegal file descriptor index = %d\n", __FUNCTION__ , file_id );
-#endif
-		this->errno = EBADFD;
-		return -1;
-	}
-
-    // get extended pointer on remote file descriptor
-    file_xp = process_fd_get_xptr_from_local( process , file_id );
-
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : undefined fd_id %d in process %x\n",
-__FUNCTION__ , file_id , process->pid );
-#endif
-        this->errno = EBADFD;
-        return -1;
-    }
-
-    // get file descriptor cluster and local pointer
-    vfs_file_t * file_ptr = GET_PTR( file_xp );
-    cxy_t        file_cxy = GET_CXY( file_xp );
-
-    // get file type
-    vfs_file_type_t type = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-
-    // action depend on file type
-    if( type != FILE_TYPE_DEV )      // not a device 
-    {
-        retval = 0;
-	}
-    else                              // it is a device
-    {
-        // get cluster and pointers on chdev 
-        chdev_xp  = chdev_from_file( file_xp );
-        chdev_cxy = GET_CXY( chdev_xp );
-        chdev_ptr = GET_PTR( chdev_xp );
-
-        // get chdev type
-        chdev_func = hal_remote_l32( XPTR( chdev_cxy , &chdev_ptr->func ) );
-
-        if( chdev_func == DEV_FUNC_TXT ) retval = 1;
-        else                               retval = 0;
-    }
-
-#if DEBUG_SYS_ISATTY
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_ISATTY < tm_end )
-printk("\n[DBG] %s : thread %x exit / process %x / cost %d / cycle %d\n",
-__FUNCTION__, this, process->pid, (uint32_t)(tm_end - tm_start), (uint32_t)tm_end );
-#endif
-
-	return retval;
-
-}  // end sys_read()
Index: trunk/kernel/syscalls/sys_kill.c
===================================================================
--- trunk/kernel/syscalls/sys_kill.c	(revision 690)
+++ 	(revision )
@@ -1,256 +1,0 @@
-/*
- * sys_kill.c - Kernel function implementing the "kill" system call.
- * 
- * Author    Alain Greiner     (2016,2017,2018,2019,2020)
- *
- * Copyright (c)  UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <process.h>
-#include <shared_syscalls.h>
-#include <cluster.h>
-#include <rpc.h>
-
-#include <syscalls.h>
-
-
-#if DEBUG_SYS_KILL
-////////////////////////////////////////////
-static char* sig_type_str( uint32_t sig_id )
-{
-    switch( sig_id )
-    {
-        case SIGKILL: return "SIGKILL";
-        case SIGSTOP: return "SIGSTOP";
-        case SIGCONT: return "SIGCONT";
-        default:      return "undefined";
-    }
-}
-#endif
-
-
-///////////////////////////
-int sys_kill( pid_t    pid,
-              uint32_t sig_id )
-{
-    xptr_t      owner_xp;          // extended pointer on process in owner cluster
-    cxy_t       owner_cxy;         // process owner cluster
-    process_t * owner_ptr;         // local pointer on process in owner cluster
-    xptr_t      parent_xp;         // extended pointer on parent process
-    cxy_t       parent_cxy;        // parent process cluster
-    process_t * parent_ptr;        // local pointer on parent process
-    thread_t  * parent_main_ptr;   // local pointer on parent main thread
-    xptr_t      parent_main_xp;    // extended pointer on parent main thread
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if DEBUG_SYS_KILL || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_KILL
-if( DEBUG_SYS_KILL < tm_start )
-printk("\n[%s] thread[%x,%x] enter : %s to process %x / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid,
-sig_type_str(sig_id), pid, (uint32_t)tm_start );
-#endif
-
-    // get pointers on process descriptor in owner cluster
-    owner_xp  = cluster_get_owner_process_from_pid( pid );
-    owner_cxy = GET_CXY( owner_xp );
-    owner_ptr = GET_PTR( owner_xp );
-    
-#if (DEBUG_SYS_KILL & 1)
-if( DEBUG_SYS_KILL < tm_start )
-printk("\n[%s] thread[%x,%x] get target process descriptor %x in owner cluster %x\n",
-__FUNCTION__ , this->process->pid, this->trdid, owner_ptr, owner_cxy );
-#endif
-
-    // check process found
-    if( owner_xp == XPTR_NULL)
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / process %x not found\n",
-__FUNCTION__, process->pid, this->trdid, pid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    // get parent process descriptor pointers
-    parent_xp  = (xptr_t)hal_remote_l64( XPTR( owner_cxy , &owner_ptr->parent_xp ) );
-    parent_cxy = GET_CXY( parent_xp );
-    parent_ptr = GET_PTR( parent_xp );
-
-#if (DEBUG_SYS_KILL & 1)
-if( DEBUG_SYS_KILL < tm_start )
-printk("\n[%s] thread[%x,%x] get parent process descriptor %x in cluster %x\n",
-__FUNCTION__ , this->process->pid, this->trdid, parent_ptr, parent_cxy );
-#endif
-
-    // get pointers on the parent process main thread
-    parent_main_ptr = hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->th_tbl[0] ) ); 
-    parent_main_xp  = XPTR( parent_cxy , parent_main_ptr );
-
-    // analyse signal type / supported values are : 0, SIGSTOP, SIGCONT, SIGKILL
-    switch( sig_id )
-    {
-        case 0 :          // does nothing
-        {
-            break;
-        }
-        case SIGSTOP:     // block all target process threads
-        {
-            // block all threads in all clusters
-            process_sigaction( pid , BLOCK_ALL_THREADS );
-
-#if (DEBUG_SYS_KILL & 1)
-if( DEBUG_SYS_KILL < tm_start )
-printk("\n[%s] thread[%x,%x] blocked all threads of process %x\n",
-__FUNCTION__ , this->process->pid, this->trdid, pid );
-#endif
-            // atomically update owner process termination state
-            hal_remote_atomic_or( XPTR( owner_cxy , &owner_ptr->term_state ) ,
-                                  PROCESS_TERM_STOP );
-
-            // unblock the parent process main thread
-            thread_unblock( parent_main_xp , THREAD_BLOCKED_WAIT );
-
-            // calling thread deschedules when it is itself a target thread
-            if( this->process->pid == pid )
-            {
-
-#if (DEBUG_SYS_KILL & 1)
-if( DEBUG_SYS_KILL < tm_start )
-printk("\n[%s] thread[%x,%x] is a target thread => deschedule\n",
-__FUNCTION__ , this->process->pid, this->trdid );
-#endif
-                sched_yield("block itself");
-            }
-
-            break;
-        }
-        case SIGCONT:     // unblock all target process threads
-        {
-            // unblock all threads in all clusters
-            process_sigaction( pid , UNBLOCK_ALL_THREADS );
-
-            // atomically update owner process termination state
-            hal_remote_atomic_and( XPTR( owner_cxy , &owner_ptr->term_state ) ,
-                                   ~PROCESS_TERM_STOP );
-
-            // unblock the parent process main thread 
-            thread_unblock( parent_main_xp , THREAD_BLOCKED_WAIT );
-
-            break;
-        }
-        case SIGKILL:
-        {
-            // a process cannot kill itself
-            if( (pid == process->pid) ) 
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / process %x cannot kill itself\n",
-__FUNCTION__, process->pid, this->trdid, pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-
-            // processe INIT cannot be killed
-            if( pid == 1 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / process_init cannot be killed\n",
- __FUNCTION__, process->pid, this->trdid);
-#endif
-		        this->errno = EINVAL;
-                return -1;
-            }
-
-            // remove process from TXT list
-            process_txt_detach( owner_xp );
-
-            // close all open files
-            process_fd_clean_all( owner_xp );
-
-            // mark for delete all threads in all clusters, but the main 
-            process_sigaction( pid , DELETE_ALL_THREADS );
-
-            // block main thread
-            xptr_t main_xp = XPTR( owner_cxy , &owner_ptr->th_tbl[0] );
-            thread_block( main_xp , THREAD_BLOCKED_GLOBAL );
-
-            // atomically update owner process descriptor term_state to ask
-            // the parent process sys_wait() function to delete this main thread
-            hal_remote_atomic_or( XPTR( owner_cxy , &owner_ptr->term_state ) ,
-                                  PROCESS_TERM_KILL );
-
-            // unblock the parent process main thread 
-            thread_unblock( parent_main_xp , THREAD_BLOCKED_WAIT );
-
-            break;
-        }
-        default:
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal signal %d\n",
-__FUNCTION__, process->pid, this->trdid, sig_id );
-#endif
-    	    this->errno = EINVAL;
-            return -1;
-        }
-    }
-    
-    hal_fence();
-
-#if (DEBUG_SYS_KILL || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_KILL
-if( DEBUG_SYS_KILL < tm_end )
-printk("\n[%s] thread[%x,%x] exit / process %x / %s / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, pid,
-sig_type_str(sig_id), (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_KILL] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_KILL] , 1 );
-#endif
-
-	return 0;
-
-}  // end sys_kill()
-
Index: trunk/kernel/syscalls/sys_lseek.c
===================================================================
--- trunk/kernel/syscalls/sys_lseek.c	(revision 690)
+++ trunk/kernel/syscalls/sys_lseek.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * kern/sys_lseek.c - Kernel function implementing the lseek system call.
+ * kern/sys_lseek.c - set the read/write offset of an opened file 
  * 
- * AUthor        Alain Greiner (2016,2017,2018,2019)
-s
- * Copyright (c) UPMC Sorbonne Universites
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * This file is part of ALMOS-MKH.
+ * This file is part of ALMOS-kernel.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,96 +17,40 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <errno.h>
+#include <types.h>
 #include <vfs.h>
-#include <vmm.h>
 #include <thread.h>
-#include <printk.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
 
-/////////////////////////////////
-int sys_lseek ( uint32_t file_id,
-                uint32_t offset,
-                uint32_t whence )
+int sys_lseek (uint_t fd, off_t offset, int whence)
 {
-	error_t    error;
-    xptr_t     file_xp;
-    uint32_t   new_offset;
+	error_t err = 0;
+	size_t new_offset;
+	struct thread_s *this;
+	struct task_s *task;
+	struct vfs_file_s *file;
 
-	thread_t  * this    = CURRENT_THREAD;
-	process_t * process = this->process;
+	file = NULL;
+	this = current_thread;
+	task = current_task;
 
-#if (DEBUG_SYS_LSEEK || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_LSEEK
-if( DEBUG_SYS_LSEEK < tm_start )
-printk("\n[%s] thread[%x,%x] enter / file_id %d / offset %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, file_id, offset, (uint32_t)tm_start );
-#endif
-
-    // check file_id argument
-	if( file_id >= CONFIG_PROCESS_FILE_MAX_NR )
+	/* FIXME: file may be closed in parallel 
+	 * of seek/read/write/mmap ..etc 
+	 * so file may be NULL or invalid */
+	if((fd >= CONFIG_TASK_FILE_MAX_NR) || (task_fd_lookup(task, fd, &file)))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] illegal file descriptor index %d\n",
-__FUNCTION__ , process->pid, this->trdid, file_id );
-#endif
-		this->errno = EBADFD;
+		this->info.errno = EBADFD;
 		return -1;
 	}
 
-    // get extended pointer on remote file descriptor
-    file_xp = process_fd_get_xptr_from_local( process , file_id );
-
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] undefined fd_id %d\n",
-__FUNCTION__, process->pid, this->trdid, file_id );
-#endif
-		this->errno = EBADFD;
-		return -1;
-    }
-
-// FIXME: file may be closed in parallel of seek/read/write/mmap ..etc 
-
-    // call relevant VFS function
-	error = vfs_lseek( file_xp , offset , whence , &new_offset );
-
-	if( error )
+	if((err = vfs_lseek(file, offset, whence, &new_offset)))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot seek file_id %d\n",
-__FUNCTION__, process->pid, this->trdid, file_id );
-#endif
-		this->errno = error;
+		this->info.errno = (err < 0) ? -err : err;
 		return -1;
 	}
-
-#if (DEBUG_SYS_LSEEK || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_LSEEK
-if( DEBUG_SYS_LSEEK < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_LSEEK] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_LSEEK] , 1 );
-#endif
   
 	return new_offset;
Index: trunk/kernel/syscalls/sys_mkdir.c
===================================================================
--- trunk/kernel/syscalls/sys_mkdir.c	(revision 690)
+++ trunk/kernel/syscalls/sys_mkdir.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_mkdir.c - creates a new directory in VFS 
- *
- * Author     Alain Greiner (2016,2017,2018)
- *
- * Copyright (c)  UPMC Sorbonne Universites
+ * kern/sys_mkdir.c - creates new directory
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
  * This file is part of ALMOS-kernel.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,102 +17,30 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <errno.h>
 #include <vfs.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
 #include <thread.h>
-#include <printk.h>
 
-#include <syscalls.h>
+int sys_mkdir (char *pathname, uint_t mode)
+{
+	register error_t err = 0;
+	struct task_s *task = current_task;
+	struct ku_obj ku_path;
 
-////////////////////////////////////
-int sys_mkdir ( char     * pathname,
-                uint32_t   rights __attribute__((unused)) )
-{
-    error_t   error;
-    xptr_t    root_inode_xp;                     // extended pointer on root inode
-    char      kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
+	KU_BUFF(ku_path, pathname);
+	rwlock_rdlock(&task->cwd_lock);
 
-    thread_t     * this     = CURRENT_THREAD;
-    process_t    * process  = this->process;
-
-#if (DEBUG_SYS_MKDIR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_MKDIR
-if( DEBUG_SYS_MKDIR < tm_start )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_start );
-#endif
- 
-    // compute root inode for path 
-    if( kbuf[0] == '/' )                        // absolute path
-    {
-        // use extended pointer on VFS root inode
-        root_inode_xp = process->vfs_root_xp;
-    }
-    else                                        // relative path
-    {
-        // get cluster and local pointer on reference process
-        xptr_t      ref_xp  = process->ref_xp;
-        process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-        cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-        // use extended pointer on CWD inode
-        root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-    }
-
-    // call relevant VFS function
-    error  = vfs_mkdir( root_inode_xp , kbuf , rights );
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot create directory <%s>\n", __FUNCTION__, kbuf );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-#if (DEBUG_SYS_MKDIR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_MKDIR
-if( DEBUG_SYS_MKDIR < tm_end )
-printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_MKDIR] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_MKDIR] , 1 );
-#endif
-
-    return 0;
-
-} // end sys_mkdir()
+	if((err = vfs_mkdir(&task->vfs_cwd, &ku_path, mode)))
+	{
+		current_thread->info.errno = (err < 0) ? -err : err;
+		rwlock_unlock(&task->cwd_lock);
+		return -1;
+	}
+   
+	rwlock_unlock(&task->cwd_lock);
+	return 0;
+}
Index: trunk/kernel/syscalls/sys_mkfifo.c
===================================================================
--- trunk/kernel/syscalls/sys_mkfifo.c	(revision 690)
+++ trunk/kernel/syscalls/sys_mkfifo.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_mkfifo.c - creates a named FIFO file.
+ * kern/sys_mkfifo.c - creates a FIFO named file
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
+ * This file is part of ALMOS-kernel.
  *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,123 +17,37 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <printk.h>
+#include <kdmsg.h>
 #include <vfs.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
 #include <thread.h>
 
-////////////////////////////////////
-int sys_mkfifo ( char    * pathname,
-                 uint32_t  mode )
+int sys_mkfifo (char *pathname, uint_t mode)
 {
-    vseg_t      * vseg;
-    error_t       error;
-    xptr_t        root_inode_xp;           
-    char          kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
+	register error_t err = 0;
+	struct task_s *task = current_task;
+	struct ku_obj ku_path;
 
-    thread_t    * this    = CURRENT_THREAD;
-    process_t   * process = this->process;
+	current_thread->info.errno = ENOSYS;
+	return -1;
 
-#if DEBUG_SYS_MKFIFO || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	KU_BUFF(ku_path, pathname);
+	rwlock_rdlock(&task->cwd_lock);
+	if((err = vfs_mkfifo(&task->vfs_cwd, &ku_path, mode)))
+	{
+		printk(INFO, "INFO: sys_mkfifo: Thread %x, CPU %d, Error Code %d\n", 
+		       current_thread, 
+		       cpu_get_id(), 
+		       err);
 
-#if DEBUG_SYS_MKFIFO
-if( DEBUG_SYS_MKFIFO < tm_end )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, pathname, (uint32_t)tm_start );
-#endif
- 
-    // check pathname in user space
-    if( vmm_get_vseg( process, (intptr_t)pathname , &vseg ) )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : user buffer unmapped %x for thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)pathname , process->pid, this->trdid );
-#endif
-		this->errno = EINVAL;
-        return -1;
+		rwlock_unlock(&task->cwd_lock);
+		return -1;
 	}
-
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : pathname too long for thread[%x,%x]\n",
-__FUNCTION__ , process->pid , this->trdid );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_MKFIFO
-if( DEBUG_SYS_MKFIFO < tm_end )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_start );
-#endif
- 
-    // get cluster and local pointer on reference process
-    xptr_t      ref_xp  = process->ref_xp;
-    process_t * ref_ptr = GET_PTR( ref_xp );
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-    // get extended pointer on root inode in path
-    if( kbuf[0] == '/' )                            // absolute path
-    {
-        // use extended pointer on VFS root inode
-        root_inode_xp = process->vfs_root_xp;
-    }
-    else                                            // relative path
-    {
-        // use extended pointer on CWD inode
-        root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-    }
-
-    // call the relevant VFS function
-    error = vfs_mkfifo( root_inode_xp,
-                        kbuf,
-                        mode ); 
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create node in VFS for <%s> path\n",
-__FUNCTION__ , process->pid , this->trdid , kbuf );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-#if (DEBUG_SYS_MKFIFO || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_MKFIFO
-if( DEBUG_SYS_MKFIFO < tm_end )
-printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, pathname, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_MKFIFO] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_MKFIFO] , 1 );
-#endif
-
-    return 0;
-
-} // end sys_mkfifo()
+	rwlock_unlock(&task->cwd_lock);
+   
+	return 0;
+}
Index: trunk/kernel/syscalls/sys_mmap.c
===================================================================
--- trunk/kernel/syscalls/sys_mmap.c	(revision 690)
+++ trunk/kernel/syscalls/sys_mmap.c	(revision 1)
@@ -1,16 +1,16 @@
 /*
- * sys_mmap.c - map files, memory or devices into process virtual address space
+ * kern/sys_mmap.c - map files, memory or devices into process's 
+ *                   virtual address space
  * 
- * Authors       Alain Greiner (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,294 +18,130 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <hal_irqmask.h>
 #include <errno.h>
 #include <thread.h>
-#include <printk.h>
-#include <mapper.h>
 #include <vfs.h>
+#include <sys-vfs.h>
 #include <process.h>
 #include <vmm.h>
 
-#include <syscalls.h>
-#include <shared_syscalls.h>
+///////////////////////////////////
+int sys_mmap( mmap_attr_t * mattr )
+{
+	error_t err;
+	uint_t count;
+	struct thread_s *this;
+	struct process_s *process;
+	struct vfs_file_s *file;
+	mmap_attr_t attr;
+	size_t isize;
+	int retval;
+ 
+	this = current_thread;
+	process = this->process;
+	err  = EINVAL;
+	file = NULL;
 
-//////////////////////////////////
-int sys_mmap( mmap_attr_t * attr )
-{
-    vseg_t      * vseg;
-    cxy_t         vseg_cxy;     // target cluster for the vseg
-    vseg_type_t   vseg_type;    // vseg type
-    mmap_attr_t   k_attr;       // attributes copy in kernel space
-    xptr_t        mapper_xp;
-    reg_t         save_sr;      // required to enable IRQs
+	if((err = cpu_copy_from_uspace(&attr, mattr, sizeof(mmap_attr_t))))
+	{
+		printk(INFO, "%s: failed, copying from uspace @%x\n",
+		       __FUNCTION__, 
+		       mattr);
 
-	thread_t    * this    = CURRENT_THREAD;
-	process_t   * process = this->process;
+		this->info.errno = EFAULT;
+		return (int)VM_FAILED;
+	}
 
-#if (DEBUG_SYS_MMAP || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	if((attr.flags  & VM_REG_HEAP)                     ||
+	   ((attr.flags & VM_REG_PVSH) == VM_REG_PVSH)     || 
+	   ((attr.flags & VM_REG_PVSH) == 0)               ||
+	   (attr.length == 0)                              ||
+	   (attr.offset & PMM_PAGE_MASK)                   || 
+	   ((attr.addr != NULL) && (((uint_t)attr.addr & PMM_PAGE_MASK)          ||
+				(NOT_IN_USPACE(attr.length + (uint_t)attr.addr)) ||
+				(NOT_IN_USPACE((uint_t)attr.addr)) )))
+	{
+		printk(INFO, "%s: failed, we don't like flags (%x), length (%d), or addr (%x)\n",
+		       __FUNCTION__, 
+		       attr.flags, 
+		       attr.length, 
+		       attr.addr);
+     
+		this->info.errno = EINVAL;
+		return (int)VM_FAILED;
+	}
+   
+	if(attr.flags & VM_REG_ANON)
+	{
+		attr.offset = 0;
+		attr.addr   = (attr.flags & VM_REG_FIXED) ? attr.addr : NULL;
+	}
+	else
+	{      
+		/* FIXEME: possible concurent delete of file from another bugy thread closing it */
+		if((attr.fd >= CONFIG_TASK_FILE_MAX_NR) || (process_fd_lookup(process, attr.fd, &file)))
+		{
+			printk(INFO, "%s: failed, bad file descriptor (%d)\n", 
+			       __FUNCTION__, 
+			       attr.fd);
 
-#if DEBUG_SYS_MMAP
-if( DEBUG_SYS_MMAP < tm_start )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_start );
-#endif
+			this->info.errno = EBADFD;
+			return (int)VM_FAILED;
+		}
+     
+		//atomic_add(&file->f_count, 1);
+		vfs_file_up(file);//FIXME coalsce access to remote node info
+     
+		//FIXME: does we really to get the size...
+		isize = vfs_inode_size_get_remote(file->f_inode.ptr, file->f_inode.cid);
+		if((attr.offset + attr.length) > isize)
+		{
+			printk(INFO, "%s: failed, offset (%d) + len (%d) >= file's size (%d)\n", 
+			       __FUNCTION__, 
+			       attr.offset, 
+			       attr.length, 
+			       isize);
 
-    // check user buffer (containing attributes) is mapped 
-    if( vmm_get_vseg( process , (intptr_t)attr , &vseg ) )
-    {
+			this->info.errno = ERANGE;
+			goto SYS_MMAP_FILE_ERR;
+		}
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / mmap attributes unmapped %x\n",
-__FUNCTION__ , process->pid, this->trdid, (intptr_t)attr );
-#endif
-		this->errno = EINVAL;
-		return -1;
-    }
+		if(((attr.prot & VM_REG_RD) && !(VFS_IS(file->f_flags, VFS_O_RDONLY)))   ||
+		   ((attr.prot & VM_REG_WR) && !(VFS_IS(file->f_flags, VFS_O_WRONLY)))   ||
+		   ((attr.prot & VM_REG_WR) && (VFS_IS(file->f_flags, VFS_O_APPEND))))//    ||
+			//(!(attr.prot & VM_REG_RD) && (attr.flags & VM_REG_PRIVATE)))
+		{
+			printk(INFO, "%s: failed, EACCES prot (%x), f_flags (%x)\n", 
+			       __FUNCTION__, 
+			       attr.prot, 
+			       file->f_flags);
 
-    // copy attributes from user space to kernel space
-    hal_copy_from_uspace( XPTR( local_cxy , &k_attr ),
-                          attr,
-                          sizeof(mmap_attr_t) );
+			this->info.errno = EACCES;
+			goto SYS_MMAP_FILE_ERR;
+		}
+	}
 
-    // get addr, fdid, offset, and length attributes
-    uint32_t  fdid   = k_attr.fdid;
-    uint32_t  offset = k_attr.offset;
-    uint32_t  length = k_attr.length;
+	retval = (int) vmm_mmap(process,
+				file,
+				attr.addr,
+				attr.length,
+				attr.prot,
+				attr.flags,
+				attr.offset);
+   
+	if((retval != (int)VM_FAILED) || (attr.flags & VM_REG_ANON))
+		return retval;
 
-    // get flags
-    bool_t     map_fixed   = ( (k_attr.flags & MAP_FIXED)   != 0 );
-    bool_t     map_anon    = ( (k_attr.flags & MAP_ANON)    != 0 );
-    bool_t     map_remote  = ( (k_attr.flags & MAP_REMOTE)  != 0 );
-    bool_t     map_shared  = ( (k_attr.flags & MAP_SHARED)  != 0 );
-    bool_t     map_private = ( (k_attr.flags & MAP_PRIVATE) != 0 );
+SYS_MMAP_FILE_ERR:
+	printk(INFO, "%s: Failed, Droping file count \n", 
+	       __FUNCTION__);
+   
+	vfs_close( file , &count );
 
-    // MAP_FIXED not supported
-    if( map_fixed )
-    {
+	if(count == 1) process_fd_put( process , attr.fd );
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / MAP_FIXED not supported\n",
-__FUNCTION__ , process->pid, this->trdid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    if( map_shared == map_private )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / MAP_SHARED == MAP_PRIVATE\n",
-__FUNCTION__ , process->pid, this->trdid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-// FIXME handle Copy_On_Write for MAP_PRIVATE...
-
-    // test mmap type : can be FILE / ANON / REMOTE
-    // to define vseg_type & vseg_cxy
-
-    /////////////////////////////////////////////////////////// MAP_FILE
-    if( (map_anon == false) && (map_remote == false) )   
-    {
-
-#if (DEBUG_SYS_MMAP & 1)
-if ( DEBUG_SYS_MMAP < tm_start )
-printk("\n[%s] thread[%x,%x] type file : fdid %d / offset %x / %x bytes\n",
-__FUNCTION__, process->pid, this->trdid, fdid, offset, length );
-#endif
-
-// FIXME: handle concurent delete of file by another thread 
-
-		if( fdid >= CONFIG_PROCESS_FILE_MAX_NR ) 
-		{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / bad file descriptor %d\n",
-__FUNCTION__ , process->pid , this->trdid , fdid );
-#endif
-            this->errno = EBADFD;
-            return -1;
-        }
-
-        // get extended pointer on file descriptor
-        xptr_t file_xp = process_fd_get_xptr_from_local( process , fdid );
-
-        if( file_xp == XPTR_NULL )
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / file descriptor %d not found\n",
-__FUNCTION__  , this->trdid , process->pid , fdid );
-#endif
-            this->errno = EBADFD;
-            return -1;
-        }
-
-        // get file cluster and local pointer
-        cxy_t        file_cxy = GET_CXY( file_xp );
-        vfs_file_t * file_ptr = (vfs_file_t *)GET_PTR( file_xp );
-
-#if (DEBUG_SYS_MMAP & 1)
-if ( DEBUG_SYS_MMAP < tm_start )
-printk("\n[%s] thread[%x,%x] get file pointer %x in cluster %x\n",
-__FUNCTION__, process->pid, this->trdid, file_ptr, file_cxy );
-#endif
-
-        // get mapper pointer 
-        mapper_t    * mapper_ptr = hal_remote_lpt(XPTR(file_cxy , &file_ptr->mapper));
-
-#if (DEBUG_SYS_MMAP & 1)
-if ( DEBUG_SYS_MMAP < tm_start )
-printk("\n[%s] thread[%x,%x] get file mapper %x\n",
-__FUNCTION__, process->pid, this->trdid, mapper_ptr );
-#endif
-
-/* TODO
-        // chek access rigths
-        uint32_t   file_attr  = hal_remote_l32(XPTR(file_cxy , &file_ptr->attr  ));
-        bool_t     prot_read  = ( (k_attr.prot & PROT_READ )   != 0 );
-        bool_t     prot_write = ( (k_attr.prot & PROT_WRITE)   != 0 );
-
-        // check access rights
-		if( (prot_read  && !(file_attr & FD_ATTR_READ_ENABLE)) ||
-		    (prot_write && !(file_attr & FD_ATTR_WRITE_ENABLE)) )
-		{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s: prot = %x / file_attr = %x / thread %x , process %x\n", 
-__FUNCTION__ , k_attr.prot , file_attr , this->trdid , process->pid );
-#endif
-			this->errno = EACCES;
-			return -1;
-		}
-*/
-
-        mapper_xp = XPTR( file_cxy , mapper_ptr );
-        vseg_type = VSEG_TYPE_FILE;
-        vseg_cxy  = file_cxy;
-    }
-    ///////////////////////////////////////////////////////// MAP_ANON
-    else if ( map_anon )                                 
-    {
-        mapper_xp = XPTR_NULL;
-        vseg_type = VSEG_TYPE_ANON;
-        vseg_cxy  = local_cxy;
-
-#if (DEBUG_SYS_MMAP & 1)
-if ( DEBUG_SYS_MMAP < tm_start )
-printk("\n[%s] thread[%x,%x] type anon / %x bytes / cluster %x\n",
-__FUNCTION__, process->pid, this->trdid, length, vseg_cxy );
-#endif
-
-    } 
-    /////////////////////////////////////////////////////// MAP_REMOTE
-    else                                                 
-    {
-        mapper_xp = XPTR_NULL;
-        vseg_type = VSEG_TYPE_REMOTE;
-        vseg_cxy  = k_attr.fdid;
-
-#if (DEBUG_SYS_MMAP & 1)
-if ( DEBUG_SYS_MMAP < tm_start )
-printk("\n[%s] thread[%x,%x] type remote / %x bytes / target cluster %x\n",
-__FUNCTION__, process->pid, this->trdid, length, vseg_cxy );
-#endif
- 
-        if( cluster_is_active( vseg_cxy ) == false )
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal cxy %x for REMOTE\n",
-__FUNCTION__, this->trdid , process->pid, vseg_cxy );
-#endif
-            this->errno = EINVAL;
-            return -1;
-        }
-    }
-
-    // enable IRQs
-    hal_enable_irq( &save_sr );
-
-    // get reference process cluster and local pointer
-    xptr_t      ref_xp  = process->ref_xp;
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    process_t * ref_ptr = GET_PTR( ref_xp );
-
-    // register vseg in reference VSL
-    if( local_cxy == ref_cxy )
-    {
-        vseg = vmm_create_vseg( process,
-                                vseg_type,
-                                0,               // vseg base (unused for mmap)
-                                length,          // vseg size
-                                offset,          // file offset
-                                0,               // file_size (unused for mmap)
-                                mapper_xp,
-                                vseg_cxy );
-    }
-    else
-    {
-        rpc_vmm_create_vseg_client( ref_cxy,
-                                    ref_ptr,
-                                    vseg_type,
-                                    0,            // vseg base (unused for mmap)
-                                    length,       // vseg size
-                                    offset,       // file offset
-                                    0,            // file size (unused for mmap)
-                                    mapper_xp,
-                                    vseg_cxy,
-                                    &vseg ); 
-    }
-    
-    // restore IRQs
-    hal_restore_irq( save_sr );
-
-    if( vseg == NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot create vseg\n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-        this->errno = ENOMEM;
-        return -1;
-    }
-
-    // copy vseg base address to user space mmap_attr_t
-    hal_copy_to_uspace( &attr->addr,
-                        XPTR( ref_cxy , &vseg->min ),
-                        sizeof(intptr_t) );
-    hal_fence();
-
-#if (DEBUG_SYS_MMAP || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_MMAP] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_MMAP] , 1 );
-#endif
-
-#if DEBUG_SYS_MMAP
-if ( DEBUG_SYS_MMAP < tm_end )
-printk("\n[%s] thread[%x,%x] exit / %s / cxy %x / base %x / size %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid,
-vseg_type_str(vseg->type), vseg->cxy, vseg->min, length, (uint32_t)tm_end );
-#endif
-
-        return 0;
-
-}  // end sys_mmap()
-
+	return (int)VM_FAILED;
+}
Index: trunk/kernel/syscalls/sys_munmap.c
===================================================================
--- trunk/kernel/syscalls/sys_munmap.c	(revision 690)
+++ 	(revision )
@@ -1,169 +1,0 @@
-/*
- * sys_munmap.c - unmap a mapping from process virtual address space
- * 
- * Authors       Alain Greiner (2016,2017,2018,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <hal_irqmask.h>
-#include <shared_syscalls.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <mapper.h>
-#include <vfs.h>
-#include <process.h>
-#include <vmm.h>
-
-#include <syscalls.h>
-
-////////////////////////////////
-int sys_munmap( void     * vaddr,
-                uint32_t   size )
-{
-    error_t       error;
-    vseg_t      * vseg;
-    reg_t         save_sr;      // required to enable IRQs
-
-	thread_t    * this    = CURRENT_THREAD;
-	process_t   * process = this->process;
-
-#if (DEBUG_SYS_MUNMAP || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_MUNMAP
-if( DEBUG_SYS_MUNMAP < tm_start )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_start );
-#endif
-
-    // check user buffer is mapped 
-    error = vmm_get_vseg( process , (intptr_t)vaddr, &vseg );
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / user buffer unmapped %x\n",
-__FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr );
-#endif
-		this->errno = EINVAL;
-		return -1;
-    }
-
-    // compute unmapped region min an max
-    intptr_t addr_min = (intptr_t)vaddr;
-    intptr_t addr_max = addr_min + size;
-
-
-    // get vseg min & max addresses
-    intptr_t vseg_min = vseg->min; 
-    intptr_t vseg_max = vseg->max; 
-
-    // enable IRQs
-    hal_enable_irq( &save_sr );
-
-    // action depend on both vseg and region bases & sizes
-    if( (vseg_min > addr_min) || (vseg_max < addr_max) )   // region not included in vseg
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : region[%x->%x] / vseg[%x->%x] => non included in vseg\n",
-__FUNCTION__, process->pid, this->trdid, addr_min, addr_max, vseg_min, vseg_max );
-#endif
-		this->errno = EINVAL;
-		return -1;
-    }
-    else if( (vseg_min == addr_min) && (vseg_max == addr_max) )  
-    {
-
-#if( DEBUG_SYS_MUNMAP & 1 )
-if( DEBUG_SYS_MUNMAP < tm_start )
-printk("\n[%s] thread[%x,%x] unmapped region[%x->%x[ / vseg[%x->%x[ => delete vseg\n",
-__FUNCTION__, process->pid, this->trdid, addr_min, addr_max, vseg_min, vseg_max );
-#endif
-        // delete existing vseg
-        vmm_global_delete_vseg( process,
-                                vseg_min );
-    }
-    else if( (vseg_min == addr_min) || (vseg_max == addr_max) )  
-    {
-
-#if( DEBUG_SYS_MUNMAP & 1 )
-if( DEBUG_SYS_MUNMAP < tm_start )
-printk("\n[%s] thread[%x,%x] unmapped region[%x->%x[ / vseg[%x->%x[ => resize vseg\n",
-__FUNCTION__, process->pid, this->trdid, addr_min, addr_max, vseg_min, vseg_max );
-#endif
-        // resize existing vseg
-        vmm_global_resize_vseg( process,
-                                vseg_min,
-                                addr_min,
-                                addr_max - addr_min );
-    }
-    else     //  addr_min > vseg_min) && (addr_max < vseg_max)          
-    {
-
-#if( DEBUG_SYS_MUNMAP & 1 )
-if( DEBUG_SYS_MUNMAP < tm_start )
-printk("\n[%s] thread[%x,%x] unmapped region[%x->%x[ / vseg[%x->%x[ => create new vseg\n",
-__FUNCTION__, process->pid, this->trdid, addr_min, addr_max, vseg_min, vseg_max );
-#endif
-        // resize existing vseg
-        vmm_global_resize_vseg( process,
-                                vseg_min,
-                                vseg_min,
-                                addr_min - vseg_min ); 
-
-        // create new vseg
-        vmm_create_vseg( process,
-                         vseg->type,
-                         addr_max,
-                         vseg_max - addr_max,
-                         vseg->file_offset,
-                         vseg->file_size,
-                         vseg->mapper_xp,
-                         vseg->cxy );
-    }
-
-    // restore IRQs
-    hal_restore_irq( save_sr );
-
-#if (DEBUG_SYS_MUNMAP || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_MUNMAP] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_MUNMAP] , 1 );
-#endif
-
-#if DEBUG_SYS_MUNMAP
-if( DEBUG_SYS_MUNMAP < tm_start )
-printk("\n[%s] thread [%x,%x] exit / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end );
-#endif
-
-    return 0;
-
-}  // end sys_munmap()
-
Index: trunk/kernel/syscalls/sys_mutex.c
===================================================================
--- trunk/kernel/syscalls/sys_mutex.c	(revision 690)
+++ 	(revision )
@@ -1,242 +1,0 @@
-/*
- * sys_mutex.c - Access a POSIX mutex.
- * 
- * Author    Alain Greiner (2016,2017,2018,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <hal_vmm.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <vmm.h>
-#include <syscalls.h>
-#include <remote_mutex.h>
-
-
-#if DEBUG_SYS_MUTEX
-////////////////////////////////////////////////////
-static char * sys_mutex_op_str( uint32_t operation )
-{
-  	if     ( operation == MUTEX_INIT     ) return "INIT";
-  	else if( operation == MUTEX_LOCK     ) return "LOCK";
-  	else if( operation == MUTEX_UNLOCK   ) return "UNLOCK";
-  	else if( operation == MUTEX_TRYLOCK  ) return "TRYLOCK";
-  	else if( operation == MUTEX_DESTROY  ) return "DESTROY";
-  	else                                   return "undefined";
-}
-#endif
-
-/////////////////////////////////
-int sys_mutex( void     * vaddr,
-               uint32_t   operation,
-               uint32_t   attr )
-{
-	error_t     error;
-    vseg_t    * vseg;      // for vaddr check
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-#if (DEBUG_SYS_MUTEX || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_MUTEX
-if( DEBUG_SYS_MUTEX < tm_start )
-printk("\n[%s] thread[%x,%x] enter for %s / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ), (uint32_t)tm_start );
-#endif
-
-    // check vaddr in user vspace
-	error = vmm_get_vseg( process , (intptr_t)vaddr , &vseg );
-
-	if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex unmapped %x / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid );
-#endif
-        this->errno = error;
-        return -1;
-    }
-
-    // execute requested operation
-	switch( operation )
-	{   
-        //////////////// 
-	    case MUTEX_INIT:
-        { 
-            if( attr != 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex attribute non supported / thread %x / process %x\n",
-__FUNCTION__ , this->trdid , process->pid );
-#endif
-                this->errno = error;
-                return -1;
-            }
-   
-            error = remote_mutex_create( (intptr_t)vaddr );
-
-            if( error )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot create mutex / thread %x / process %x\n",
-__FUNCTION__ , this->trdid , process->pid );
-#endif
-                this->errno = error;
-                return -1;
-            } 
-		    break;
-		}
-        ///////////////////
-	    case MUTEX_DESTROY:
-        {
-            xptr_t mutex_xp = remote_mutex_from_ident( (intptr_t)vaddr );
-
-            if( mutex_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-            else                          // success
-            {
-                remote_mutex_destroy( mutex_xp ); 
-            }
-            break;
-        }
-        ////////////////
-	    case MUTEX_LOCK:
-        {
-            xptr_t mutex_xp = remote_mutex_from_ident( (intptr_t)vaddr );
-
-            if( mutex_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-            else                          // success
-            {
-                remote_mutex_lock( mutex_xp ); 
-            }
-            break;
-        }
-        //////////////////
-	    case MUTEX_UNLOCK:
-        {
-            xptr_t mutex_xp = remote_mutex_from_ident( (intptr_t)vaddr );
-
-            if( mutex_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-            else                          // success
-            {
-                error = remote_mutex_unlock( mutex_xp ); 
-
-                if( error )
-                {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex %x not owned in UNLOCK / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid );
-#endif
-                    this->errno = EINVAL;
-                    return -1;
-                }
-            }
-            break;
-        }
-        ///////////////////
-	    case MUTEX_TRYLOCK:
-        {
-            xptr_t mutex_xp = remote_mutex_from_ident( (intptr_t)vaddr );
-
-            if( mutex_xp == XPTR_NULL )     // user error
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : mutex %x not registered / thread %x / process %x\n",
-__FUNCTION__ , (intptr_t)vaddr , this->trdid , process->pid );
-#endif
-                this->errno = EINVAL;
-                return -1;
-            }
-            else                          // success
-            {
-                error = remote_mutex_trylock( mutex_xp ); 
-
-                if( error ) // non fatal : mutex already taken
-                {
-                    this->errno = EBUSY;
-                    return -1; 
-                }
-            }
-            break;
-        }
-        ////////
-        default: 
-        {
-            assert( __FUNCTION__, false, "illegal operation type <%x>", operation );
-        }
-	}
-
-    hal_fence();
-
-#if (DEBUG_SYS_MUTEX || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_MUTEX
-if( DEBUG_SYS_MUTEX < tm_end )
-printk("\n[%s] thread[%x,%x] exit for %s / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, sys_mutex_op_str( operation ), (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_MUTEX] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_MUTEX] , 1 );
-#endif
-
-	return 0;
-
-}  // end sys_mutex()
-
Index: trunk/kernel/syscalls/sys_open.c
===================================================================
--- trunk/kernel/syscalls/sys_open.c	(revision 690)
+++ trunk/kernel/syscalls/sys_open.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_open.c - open a file.
+ * kern/sys_open.c - open a named file
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Author        Alain Greiner (2016,2017,2018,2019)
+ * This file is part of ALMOS-kernel.
  *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,19 +17,15 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
 #include <errno.h>
 #include <thread.h>
-#include <printk.h>
 #include <vfs.h>
+#include <sys-vfs.h>
 #include <process.h>
-#include <remote_rwlock.h>
-
-#include <syscalls.h>
+#include <spinlock.h>
+#include <cpu-trace.h>
 
 ///////////////////////////////////
@@ -39,123 +34,47 @@
                uint32_t   mode )
 {
-    vseg_t       * vseg; 
-    error_t        error;
-    xptr_t         file_xp;                 // extended pointer on vfs_file_t
-    uint32_t       file_id;                 // file descriptor index
-    xptr_t         root_inode_xp;           // extended pointer on root inode
+	CPU_HW_TRACE(sys_open);
 
-    char           kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
+	error_t            err;
+	struct vfs_file_s  file;   
+	struct ku_obj      ku_path;
+	thread_t         * this     = current_thread;
+	process_t        * process  = current_process;
+	uint32_t           fd       = (uint32_t)-1;
 
-    thread_t     * this     = CURRENT_THREAD;
-    process_t    * process  = this->process;
+	cpu_trace_write(current_cpu, sys_open);
 
-#if DEBUG_SYS_OPEN || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	if( process_fd_aray_full( process ) )
+	{
+		this->info.errno = ENFILE;
+        CPU_HW_TRACE(sys_open);
+        return fd;
+	}
+   
+	if( VFS_IS( flags , VFS_O_DIRECTORY ) ) VFS_SET( flags , VFS_DIR );
 
-    // check fd_array not full
-    if( process_fd_array_full() )
-    {
+	KU_BUFF( ku_path , pathname );
 
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : file descriptor array full for thread[%x,%x]\n",
-__FUNCTION__ , process->pid , this->trdid );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // check pathname in user space
-    if( vmm_get_vseg( process, (intptr_t)pathname , &vseg ) )
+    // get the cwd lock
+	rwlock_rdlock( &process->cwd_lock );
+   
+	err = vfs_open( &process->vfs_cwd , &ku_path , flags , mode , &file );
+	if( err )
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : user buffer unmapped %x for thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)pathname , process->pid, this->trdid );
-#endif
-		this->errno = EINVAL;
-        return -1;
+		this->info.errno = (err < 0 ) ? -err : err;
+	    rwlock_unlock( &process->cwd_lock );
+	    CPU_HW_TRACE(sys_open);
+	    return fd;
+	}
+	
+	err = process_fd_set( process , &file , &fd );
+	if( err )
+	{
+		vfs_close(&file, NULL);
+		this->info.errno = err;
 	}
 
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : pathname too long for thread[%x,%x]\n",
-__FUNCTION__ , process->pid , this->trdid );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-#if DEBUG_SYS_OPEN
-if( DEBUG_SYS_OPEN < tm_start )
-printk("\n[%s] thread[%x,%x] enter for <%s> / flags %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, flags, (uint32_t)tm_start );
-#endif
- 
-    // get cluster and local pointer on reference process
-    xptr_t      owner_xp  = process->owner_xp;
-    process_t * owner_ptr = GET_PTR( owner_xp );
-    cxy_t       owner_cxy = GET_CXY( owner_xp );
-
-    // get extended pointer on root inode in path
-    if( kbuf[0] == '/' )                            // absolute path
-    {
-        // use extended pointer on VFS root inode
-        root_inode_xp = process->vfs_root_xp;
-    }
-    else                                            // relative path
-    {
-        // use extended pointer on CWD inode
-        root_inode_xp = hal_remote_l64( XPTR( owner_cxy , &owner_ptr->cwd_xp ) );
-    }
-
-    // call the relevant VFS function
-    error = vfs_open( root_inode_xp,
-                      kbuf,
-                      owner_xp,
-                      flags,
-                      mode,
-                      &file_xp,
-                      &file_id );
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create file descriptor for %s\n",
-__FUNCTION__ , process->pid , this->trdid , kbuf );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    hal_fence();
-
-#if (DEBUG_SYS_OPEN || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_OPEN
-if( DEBUG_SYS_OPEN < tm_end )
-printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_OPEN] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_OPEN] , 1 );
-#endif
-
-    return file_id;
+	rwlock_unlock( &process->cwd_lock );
+	CPU_HW_TRACE(sys_open);
+	return fd;
 }
Index: trunk/kernel/syscalls/sys_opendir.c
===================================================================
--- trunk/kernel/syscalls/sys_opendir.c	(revision 690)
+++ trunk/kernel/syscalls/sys_opendir.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_opendir.c - Open an user accessible VFS directory.
+ * kern/sys_opendir.c - open a directory
  * 
- * Author        Alain Greiner (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,197 +17,51 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
+#include <vfs.h>
+#include <sys-vfs.h>
+#include <process.h>
 #include <thread.h>
-#include <process.h>
-#include <user_dir.h>
-#include <printk.h>
-#include <errno.h>
-#include <vseg.h>
-#include <vfs.h>
-#include <syscalls.h>
-#include <shared_syscalls.h>
+#include <spinlock.h>
 
 ///////////////////////////////////
-int sys_opendir ( char *  pathname,
-                  DIR  ** dirp )
+int sys_opendir ( char * pathname )
 {
-    error_t        error;
-    xptr_t         root_inode_xp;          // extended pointer on path root inode
-    xptr_t         inode_xp;               // extended pointer on directory inode
-    vfs_inode_t  * inode_ptr;              // local pointer on directory inode
-    cxy_t          inode_cxy;              // directory inode cluster
-    uint32_t       inode_type;             // to check directory inode type
-    user_dir_t   * dir_ptr;                // local pointer on user_dir_t
-    vseg_t       * vseg;                   // for user space checking
-    intptr_t       ident;                  // dirent array pointer in user space                  
-    char          kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
-	
-	thread_t     * this    = CURRENT_THREAD;  // client thread
-	process_t    * process = this->process;   // client process
+	error_t             err;
+	struct vfs_file_s   file;
+	struct ku_obj       ku_path;
+	thread_t          * this    = current_thread;
+	process_t         * process = current_process;
+	uint32_t            fd        = (uint32_t)-1;
+	uint32_t            mode      = 0;
+   
+	if( process_fd_array_full( process ) )
+	{
+		this->info.errno = ENFILE;
+	    return fd;
+	}
 
-#if DEBUG_SYS_OPENDIR || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	KU_BUFF(ku_path, pathname);
 
-    // check DIR buffer in user space
-    error = vmm_get_vseg( process , (intptr_t)dirp, &vseg );
+	rwlock_rdlock( &process->cwd_lock );
 
-	if( error )
+	err = vfs_opendir( &process->vfs_cwd , &ku_path , mode , &file );
+	if( err )
 	{
+		this->info.errno = (err < 0 ) ? -err : err;
+	    rwlock_unlock( &process->cwd_lock );
+	    return fd;
+	}
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / DIR buffer %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid, dirp, (uint32_t)tm_start );
-#endif
-		this->errno = EINVAL;
-		return -1;
-	}	
-
-    // check pathname in user space
-    error = vmm_get_vseg( process , (intptr_t)pathname, &vseg );
-
-	if( error )
+	err = process_fd_set( process , &file , &fd);
+	if( err )
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / pathname %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid, pathname, (uint32_t)tm_start );
-#endif
-		this->errno = EINVAL;
-		return -1;
-	}	
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s / thread[%x,%x] : pathname too long / cycle %d\n",
- __FUNCTION__ , process->pid , this->trdid, (uint32_t)tm_start );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_OPENDIR
-if( DEBUG_SYS_OPENDIR < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter for directory <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_start );
-#endif
-
-    // compute root inode for pathname 
-    if( kbuf[0] == '/' )                        // absolute path
-    {
-        // use extended pointer on VFS root inode
-        root_inode_xp = process->vfs_root_xp;
-    }
-    else                                        // relative path
-    {
-        // get cluster and local pointer on reference process
-        xptr_t      ref_xp  = process->ref_xp;
-        process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-        cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-        // use extended pointer on CWD inode
-        root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-    }
-
-    // get extended pointer on directory inode
-    error = vfs_lookup( root_inode_xp,
-                        kbuf,
-                        0,
-                        &inode_xp,
-                        NULL );
-    if( error )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot found directory <%s> / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , kbuf , (uint32_t)tm_start );
-#endif
-		this->errno = ENFILE;
-		return -1;
+		vfs_close(&file, NULL);
+		this->info.errno = err;
 	}
    
-    // check inode type 
-    inode_ptr  = GET_PTR( inode_xp );
-    inode_cxy  = GET_CXY( inode_xp );
-    inode_type = hal_remote_l32( XPTR( inode_cxy , &inode_ptr->type ) );
-
-    if( inode_type != FILE_TYPE_DIR )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / <%s> is not a directory / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , kbuf , (uint32_t)tm_start );
-#endif
-		this->errno = ENFILE;
-		return -1;
-	}
-   
-    // create an user_dir_t structure in cluster containing directory inode
-    // map it in the reference user process VMM (in a new ANON vseg)
-    // an get the local pointer on the created user_dir_t structure 
-    if( inode_cxy == local_cxy )
-    {
-        dir_ptr = user_dir_create( inode_ptr,
-                                   process->ref_xp );
-    }
-    else
-    {
-        rpc_user_dir_create_client( inode_cxy,
-                                    inode_ptr,
-                                    process->ref_xp,
-                                    &dir_ptr );
-    }
-
-    if( dir_ptr == NULL )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot create user_dir for <%s> / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , kbuf , (uint32_t)tm_start );
-#endif
-		this->errno = ENFILE;
-		return -1;
-	}
-   
-    // get ident from user_dir structure
-    ident = (intptr_t)hal_remote_lpt( XPTR( inode_cxy , &dir_ptr->ident ) );
-
-    // set ident value in user buffer
-    hal_copy_to_uspace( dirp,
-                        XPTR( local_cxy , &ident ),
-                        sizeof(intptr_t) );
-
-    hal_fence();
-
-#if (DEBUG_SYS_OPENDIR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_OPENDIR
-if( DEBUG_SYS_OPENDIR < tm_end )
-printk("\n[%s] thread[%x,%x] exit for directory <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_OPENDIR] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_OPENDIR] , 1 );
-#endif
-
-	return 0;
-
-}  // end sys_opendir()
+	rwlock_unlock( &process->cwd_lock );
+	return fd;
+}
Index: trunk/kernel/syscalls/sys_pipe.c
===================================================================
--- trunk/kernel/syscalls/sys_pipe.c	(revision 690)
+++ trunk/kernel/syscalls/sys_pipe.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_pipe.c - open a pipe communication channel
+ * kern/sys_pipe.c - open a pipe communication channel
  * 
- * Author    Alain Greiner  (2016,1017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c)  UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,176 +17,17 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
 #include <vfs.h>
-#include <hal_uspace.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
 #include <thread.h>
-#include <printk.h>
-#include <pipe.h>
+#include <spinlock.h>
 
-#include <syscalls.h>
-
-////////////////////////////
-int sys_pipe ( fdid_t * fd )
+int sys_pipe (uint_t *pipefd)
 {
-    vseg_t       * vseg;
-    pipe_t       * pipe;
-    vfs_file_t   * file_0;
-    vfs_file_t   * file_1;
-    fdid_t         fdid_0;
-    fdid_t         fdid_1;
-    error_t        error;
-
-    thread_t     * this    = CURRENT_THREAD;
-    process_t    * process = this->process;
-
-#if DEBUG_SYS_PIPE || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t   tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_PIPE
-if( DEBUG_SYS_PIPE < tm_end )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, pathname, (uint32_t)tm_end );
-#endif
-
-    // check user buffer is mapped 
-    if( vmm_get_vseg( process , (intptr_t)fd , &vseg ) )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / output user buffer unmapped %x\n",
-__FUNCTION__ , process->pid, this->trdid, (intptr_t)fd );
-#endif
-		this->errno = EINVAL;
-		return -1;
-    }
-
-    // 1. allocate memory in local cluster for pipe descriptor,
-    //    remote buf_descriptor, and associated data buffer
-    pipe = pipe_create( local_cxy,
-                        CONFIG_PIPE_BUF_SIZE );
-
-    if( pipe == NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / no memory for pipe\n",
-__FUNCTION__ , process->pid, this->trdid );
-#endif
-        goto error_1;
-    }
-
-    // 2. allocate memory for fd[0] file descriptor in local cluster
-    // we don't use the vfs_file_create function because there is no inode.
-	file_0 = kmem_alloc( bits_log2(sizeof(vfs_file_t)) , AF_ZERO );
-
-    if( file_0 == NULL ) 
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / no memory for file descriptor\n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-        goto error_2;
-    }
-    
-    // 3. get fd[0] fdid value and register it in owner process fd_array[]
-    error = process_fd_register( process->owner_xp,
-                                 XPTR( local_cxy , file_0 ),
-                                 &fdid_0 );
-    if ( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot register file descriptor \n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-        goto error_3;
-    }
-
-    // 4. allocate memory for fd[1] file descriptor in local cluster
-    // we don't use the vfs_file_create function because there is no inode.
-	file_1 = kmem_alloc( bits_log2(sizeof(vfs_file_t)) , AF_ZERO );
-
-    if( file_1 == NULL ) 
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / no memory for file descriptor\n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-        goto error_4;
-    }
-
-    // 5. get fd[1] fdid value and register it in owner process fd_array[]
-    error = process_fd_register( process->owner_xp,
-                                 XPTR( local_cxy , file_1 ),
-                                 &fdid_1 );
-    if ( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot register file descriptor \n",
-__FUNCTION__, process->pid, this->trdid );
-#endif
-        goto error_5;
-    }
-
-    // link the two file descriptors to the pipe
-    file_0->pipe = pipe;
-    file_1->pipe = pipe;
-
-    // copy fdid_0 & fdid_1 values to user buffer
-    hal_copy_to_uspace( &fd[0] , XPTR( local_cxy , &fdid_0 ) , sizeof(fdid_t) );
-    hal_copy_to_uspace( &fd[1] , XPTR( local_cxy , &fdid_1 ) , sizeof(fdid_t) );
-
-#if (DEBUG_SYS_PIPE || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_PIPE
-if( DEBUG_SYS_PIPE < tm_end )
-printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, pathname, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_PIPE] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_PIPE] , 1 );
-#endif
-
-    return 0;
-
-error_5:    // release memory allocated for fd[1] file descriptor
-
-    kmem_free( file_1 , bits_log2(sizeof(vfs_file_t)) );
-
-error_4:    // release fdid_0 from fd_array[]
-
-    process_fd_remove( process->ref_xp , fdid_0 );
-
-error_3:    // release memory allocated for fd[0] file descriptor
-
-    kmem_free( file_0 , bits_log2(sizeof(vfs_file_t)) );
-
-error_2:    // release memory allocated for the pipe 
-
-    pipe_destroy( XPTR( local_cxy , pipe ) );
-
-error_1:   // set errno and return error
-
-    this->errno = ENOMEM;
-    return -1;
-
-}  // end sys_pipe()
+	current_thread->info.errno = ENOSYS;
+	return -1;
+}
Index: trunk/kernel/syscalls/sys_place_fork.c
===================================================================
--- trunk/kernel/syscalls/sys_place_fork.c	(revision 690)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/*
- * sys_get_core.c - get calling core cluster and local index.
- * 
- * Author    Alain Greiner (2016,2017,2018,2019)
- *  
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_special.h>
-#include <errno.h>
-#include <core.h>
-#include <thread.h>
-#include <process.h>
-#include <vmm.h>
-#include <printk.h>
-
-#include <syscalls.h>
-
-///////////////////////////////////
-int sys_place_fork( uint32_t  cxy )
-{
-    thread_t  * this    = CURRENT_THREAD;
-
-#if DEBUG_SYS_PLACE_FORK || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t    tm_start = hal_get_cycles();
-process_t * process  = this->process;
-#endif
-
-#if DEBUG_SYS_PLACE_FORK
-if( DEBUG_SYS_PLACE_FORK < tm_start )
-printk("\n[%s] thread[%x,%x] enter / cxy %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, cxy, (uint32_t)tm_start );
-#endif
-
-    // check cxy argument
-    if( cluster_is_active( cxy ) == false )
-    {
-        
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,‰x] / illegal cxy argument %x\n",
-__FUNCTION__ , process->pid , this->trdid , cxy );
-#endif
-        this->errno = EFAULT;
-		return -1;
-	}
-
-    // set relevant arguments in calling thread descriptor
-    this->fork_user = true;
-    this->fork_cxy  = cxy;
-
-#if (DEBUG_SYS_PLACE_FORK || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_PLACE_FORK
-if( DEBUG_SYS_PLACE_FORK < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_PLACE_FORK] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_PLACE_FORK] , 1 );
-#endif
-
-	return 0; 
-
-}  // end sys_place_fork()
Index: trunk/kernel/syscalls/sys_ps.c
===================================================================
--- trunk/kernel/syscalls/sys_ps.c	(revision 1)
+++ trunk/kernel/syscalls/sys_ps.c	(revision 1)
@@ -0,0 +1,129 @@
+/*
+ * kern/sys_ps.c - show kernel active processes and threads
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012,2013,2014,2015 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <task.h>
+#include <pid.h>
+#include <thread.h>
+#include <vmm.h>
+#include <errno.h>
+#include <utils.h>
+#include <rpc.h>
+#include <cluster.h>
+
+extern error_t ps_func(void *param);
+
+/* TODO: add remote support. */
+static error_t sys_ps_check_thread(pid_t pid, uint_t tid, struct thread_s **th_ptr)
+{
+	struct task_s *task;
+	struct thread_s *thread;
+        cid_t  location;
+
+	if(pid == PID_MIN_LOCAL)
+		return EINVAL;
+
+        location = task_whereis(pid);
+
+        tasks_manager_lock();
+        if ( location == current_cid )
+        {
+                task = task_lookup(pid)->task;
+
+                if((task == NULL) || (tid > task->max_order))
+                        return EINVAL;
+
+                thread = task->th_tbl[tid];
+
+                if((thread == NULL)                 ||
+                   (thread->signature != THREAD_ID) ||
+                   (thread->info.attr.key != tid))
+                {
+                        return ESRCH;
+                }
+
+                *th_ptr = thread;
+                return 0;
+        }
+        else
+        {
+                printk(WARNING, "%s: cluster %u can't execute this function on remote task (pid %u on cluster %u)\n",   \
+                                __FUNCTION__, current_cid, pid, location);
+                return ENOSYS;
+        }
+        tasks_manager_unlock();
+}
+
+/*TODO: use RPC_ARG_NULL instead of sending a useless variable.
+ * It's not urgent, it's a minor change.
+ */
+RPC_DECLARE(__ps_func,                                  \
+                RPC_RET( RPC_RET_PTR(error_t, err) ),   \
+                RPC_ARG( RPC_ARG_PTR(error_t, foo) )    \
+           )
+{
+        *err = ps_func(NULL);
+}
+
+int sys_ps(uint_t cmd, pid_t pid, uint_t tid)
+{
+        cid_t next;
+	error_t err;
+	struct thread_s *thread;
+        struct kernel_iter_s *kernel_iter;
+
+        err = 0;
+
+	switch(cmd)
+	{
+	case TASK_PS_TRACE_OFF:
+		err = sys_ps_check_thread(pid, tid, &thread);
+		if(err) goto fail_trace_off;
+		thread->info.isTraced = false;
+		cpu_wbflush();
+		printk(INFO,"INFO: pid %d, tid %x, tracing is turned [OFF]\n", pid, tid);
+		break;
+
+	case TASK_PS_TRACE_ON:
+		err = sys_ps_check_thread(pid, tid, &thread);
+		if(err) goto fail_trace_on;
+		thread->info.isTraced = true;
+		cpu_wbflush();
+		printk(INFO,"INFO: pid %d, tid %x, tracing is turned [ON]\n", pid, tid);
+		break;
+
+	case TASK_PS_SHOW:
+                kernel_foreach_backward(kernel_iter, next)
+                {
+                        RCPC( next, RPC_PRIO_PS, __ps_func,
+                              RPC_RECV( RPC_RECV_OBJ(err) ),
+                              RPC_SEND( RPC_SEND_OBJ(err) )
+                           );
+                }
+		break;
+	}
+
+fail_trace_on:
+fail_trace_off:
+	current_thread->info.errno = err;
+	return err;
+}
Index: trunk/kernel/syscalls/sys_read.c
===================================================================
--- trunk/kernel/syscalls/sys_read.c	(revision 690)
+++ trunk/kernel/syscalls/sys_read.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_read.c - Kernel function implementing the "read" system call.
+ * kern/sys_read.c - read bytes from an opened file
  * 
- * Author     Alain Greiner (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,283 +17,40 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_vmm.h>
-#include <hal_uspace.h>
-#include <hal_irqmask.h>
-#include <hal_special.h>
 #include <errno.h>
+#include <thread.h>
 #include <vfs.h>
-#include <vmm.h>
-#include <thread.h>
-#include <printk.h>
-#include <pipe.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
 
+int sys_read (uint_t fd, void *buf, size_t count)
+{
+	struct ku_obj kub;
+	ssize_t err;
+	struct thread_s *this;
+	struct task_s *task;
+	struct vfs_file_s *file;
 
-extern uint32_t enter_sys_read;
-extern uint32_t enter_devfs_read;
-extern uint32_t enter_txt_read;
-extern uint32_t enter_chdev_cmd_read;
-extern uint32_t enter_chdev_server_read;
-extern uint32_t enter_tty_cmd_read;
-extern uint32_t enter_tty_isr_read;
-extern uint32_t exit_tty_isr_read;
-extern uint32_t exit_tty_cmd_read;
-extern uint32_t exit_chdev_server_read;
-extern uint32_t exit_chdev_cmd_read;
-extern uint32_t exit_txt_read;
-extern uint32_t exit_devfs_read;
-extern uint32_t exit_sys_read;
+	file = NULL;
+	this = current_thread;
+	task = current_task;
 
-
-/////////////////////////////////
-int sys_read( uint32_t   file_id,
-              void     * vaddr,
-              uint32_t   count )
-{
-    error_t       error;
-    vseg_t      * vseg;            // required for user space checking
-    xptr_t        file_xp;         // remote file extended pointer
-    vfs_file_t  * file_ptr;        // remote file local pointer
-    cxy_t         file_cxy;        // remote file cluster identifier
-    uint32_t      file_type;       // file type
-    uint32_t      file_offset;     // file offset 
-    uint32_t      file_attr;       // file attributes
-    vfs_inode_t * inode_ptr;       // local pointer on file inode
-    uint32_t      nbytes;          // number of bytes actually read
-    reg_t         save_sr;         // required to enable IRQs during syscall
-
-	thread_t    * this             = CURRENT_THREAD;
-	process_t   * process          = this->process;
-    xptr_t        process_owner_xp = process->owner_xp;
- 
-#if DEBUG_SYS_READ || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_READ
-if( DEBUG_SYS_READ < tm_start )
-printk("\n[%s] thread[%x,%x] enter / vaddr %x / count %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, vaddr, count, (uint32_t)tm_start );
-#endif
-
-#if (DEBUG_SYS_READ & 1)
-enter_sys_read = (uint32_t)tm_start;
-#endif
-
-    // check file_id argument
-	if( file_id >= CONFIG_PROCESS_FILE_MAX_NR )
+	if((fd >= CONFIG_TASK_FILE_MAX_NR) || (task_fd_lookup(task, fd, &file)))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal file descriptor index %d\n",
-__FUNCTION__ , process->pid, this->trdid, file_id );
-#endif
-		this->errno = EBADFD;
+		this->info.errno = EBADFD;
 		return -1;
 	}
 
-    // check user buffer in user space
-    error = vmm_get_vseg( process , (intptr_t)vaddr , &vseg );
-
-    if ( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / user buffer unmapped %x\n",
-__FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr );
-#endif
-		this->errno = EINVAL;
+	KU_SLICE_BUFF(kub, buf, count);
+	if((err = vfs_read(file, &kub)) < 0)
+	{
+		this->info.errno = -err;
+		printk(INFO, "INFO: sys_read: Error %d\n", this->info.errno);
 		return -1;
-    }
-
-    // get extended pointer on remote file descriptor
-    file_xp = process_fd_get_xptr_from_local( process , file_id );
-
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / undefined fd_id %d\n",
-__FUNCTION__, process->pid, this->trdid, file_id );
-#endif
-        this->errno = EBADFD;
-        return -1;
-    }
-
-    // get file descriptor cluster and local pointer
-    file_ptr = GET_PTR( file_xp );
-    file_cxy = GET_CXY( file_xp );
-
-    // get inode, file type, offset and attributes 
-    inode_ptr   = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode  ) );
-    file_type   = hal_remote_l32( XPTR( file_cxy , &file_ptr->type   ) );
-    file_offset = hal_remote_l32( XPTR( file_cxy , &file_ptr->offset ) );
-    file_attr   = hal_remote_l32( XPTR( file_cxy , &file_ptr->attr   ) );
-
-    // enable IRQs
-    hal_enable_irq( &save_sr );
-
-    // check file readable
-    if( (file_attr & FD_ATTR_READ_ENABLE) == 0 )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / file %d not readable\n",
-__FUNCTION__, process->pid, this->trdid, file_id );
-#endif
-        hal_restore_irq( save_sr );
-        this->errno = EBADFD;
-        return -1;
-    }
-
-    // action depend on file type:
-    if( file_type == FILE_TYPE_REG )                           // read from mapper 
-    {
-        // try to move count bytes from mapper
-        nbytes = vfs_user_move( true,   //  from mapper
-                                file_xp,
-                                vaddr, 
-                                count );
-    }
-    else if( file_type == FILE_TYPE_DEV )                      // read from TXT device
-    {
-        // get cluster and pointers on TXT_RX chdev 
-        xptr_t    chdev_xp  = chdev_from_file( file_xp );
-        cxy_t     chdev_cxy = GET_CXY( chdev_xp );
-        chdev_t * chdev_ptr = GET_PTR( chdev_xp );
-
-        volatile xptr_t    txt_owner_xp;    
-        uint32_t           iter = 0;
-
-        while( 1 )
-        {
-            // extended pointer on TXT owner process
-            txt_owner_xp  = hal_remote_l64( XPTR( chdev_cxy , 
-                                                  &chdev_ptr->ext.txt.owner_xp ) );
-            // wait for TXT_RX ownership
-            if ( process_owner_xp != txt_owner_xp )
-            {
-                if( (iter & 0xFFF) == 0 )
-                printk("\n[WARNING] in %s : thread[%x,%x] wait TXT_RX / cycle %d\n",
-                __FUNCTION__, process->pid, this->trdid, (uint32_t)hal_get_cycles() );
-
-                // deschedule without blocking
-                sched_yield( "wait TXT_RX ownership" );
-
-                iter++;
-            }
-            else
-            {
-                break;
-            }
-        }
-
-        // try to move count bytes from TXT device
-        nbytes = devfs_user_move( true,    // from device 
-                                  file_xp,
-                                  vaddr,
-                                  count );
-    }
-    else if( (file_type == FILE_TYPE_PIPE) ||
-             (file_type == FILE_TYPE_FIFO) )                  // read from pipe 
-    {
-        // try to move count bytes from pipe
-        nbytes = pipe_user_move( true,    // from pipe 
-                                 file_xp,
-                                 vaddr,
-                                 count );
-    }   
-    else                                                      // unsupported type
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / unsupported inode type %d\n",
-__FUNCTION__, vfs_inode_type_str( file_type ) );
-#endif
-		this->errno = EBADFD;
-        hal_restore_irq( save_sr );
-		return -1;
-    }
-
-    // check error
-    if( nbytes == 0xFFFFFFFF )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,‰x] cannot read data from file %d\n",
-__FUNCTION__, process->pid, this->trdid, file_id );
-#endif
-        this->errno = EIO;
-        hal_restore_irq( save_sr );
-        return -1;
-    }
-
-    // restore IRQs
-    hal_restore_irq( save_sr );
-
-    hal_fence();
-
-#if (DEBUG_SYS_READ || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_READ
-if( DEBUG_SYS_READ < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_READ] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_READ] , 1 );
-#endif
-
-#if (DEBUG_SYS_READ & 1) 
-exit_sys_read = (uint32_t)tm_end;
-
-printk("\n***** timing to read one character *****\n"
-" - enter_sys_read          = %d / delta %d\n"
-" - enter_devfs_read        = %d / delta %d\n"
-" - enter_txt_read          = %d / delta %d\n"
-" - enter_chdev_cmd_read    = %d / delta %d\n"
-" - enter_chdev_server_read = %d / delta %d\n"
-" - enter_tty_cmd_read      = %d / delta %d\n"
-" - enter_tty_isr_read      = %d / delta %d\n"
-" - exit_tty_isr_read       = %d / delta %d\n"
-" - exit_tty_cmd_read       = %d / delta %d\n"
-" - exit_chdev_server_read  = %d / delta %d\n"
-" - exit_chdev_cmd_read     = %d / delta %d\n"
-" - exit_txt_read           = %d / delta %d\n"
-" - exit_devfs_read         = %d / delta %d\n"
-" - exit_sys_read           = %d / delta %d\n",
-enter_sys_read          , 0 ,
-enter_devfs_read        , enter_devfs_read        - enter_sys_read          ,
-enter_txt_read          , enter_txt_read          - enter_devfs_read        ,
-enter_chdev_cmd_read    , enter_chdev_cmd_read    - enter_txt_read          ,
-enter_chdev_server_read , enter_chdev_server_read - enter_chdev_cmd_read    ,
-enter_tty_cmd_read      , enter_tty_cmd_read      - enter_chdev_server_read ,
-enter_tty_isr_read      , enter_tty_isr_read      - enter_tty_cmd_read      ,
-exit_tty_isr_read       , exit_tty_isr_read       - enter_tty_isr_read      ,
-exit_tty_cmd_read       , exit_tty_cmd_read       - exit_tty_isr_read       ,
-exit_chdev_server_read  , exit_chdev_server_read  - exit_tty_cmd_read       ,
-exit_chdev_cmd_read     , exit_chdev_cmd_read     - exit_chdev_server_read  ,
-exit_txt_read           , exit_txt_read           - exit_chdev_cmd_read     ,
-exit_devfs_read         , exit_devfs_read         - exit_txt_read           ,
-exit_sys_read           , exit_sys_read           - exit_devfs_read         );
-#endif
- 
-	return nbytes;
-
-}  // end sys_read()
+	}
+   
+	return err;
+}
Index: trunk/kernel/syscalls/sys_readdir.c
===================================================================
--- trunk/kernel/syscalls/sys_readdir.c	(revision 690)
+++ trunk/kernel/syscalls/sys_readdir.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_readdir.c - Copy one entry from an open VFS directory to an user buffer.
+ * sys_read.c: read entries from an opened directory
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
+ * This file is part of ALMOS-kernel.
  *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,125 +17,42 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <errno.h>
+#include <vfs.h>
+#include <sys-vfs.h>
+#include <task.h>
 #include <thread.h>
-#include <printk.h>
-#include <vfs.h>
-#include <process.h>
-#include <user_dir.h>
-#include <syscalls.h>
-#include <shared_syscalls.h>
 
-///////////////////////////////////////
-int sys_readdir( DIR            * dirp,
-                 struct dirent ** buffer )
+/* FIXEME: reading dirent from user without any protection */
+
+int sys_readdir (uint_t fd, struct vfs_usp_dirent_s *dirent)
 {
-    error_t         error;
-    vseg_t        * vseg;               // for user space checking of buffer
-    xptr_t          dir_xp;             // extended pointer on user_dir structure
-    user_dir_t    * dir_ptr;            // local pointer on user_dir structure
-    cxy_t           dir_cxy;            // user_dir stucture cluster identifier
-    struct dirent * direntp;            // dirent pointer in user space  
-    uint32_t        entries;            // total number of dirent entries
-    uint32_t        current;            // current dirent index
+	error_t err;
+	struct ku_obj dir;
+	struct task_s *task;
+	struct thread_s *this;
+	struct vfs_file_s *file;
+  
+	file = NULL;
+	task = current_task;
+	this = current_thread;
 
-	thread_t  * this    = CURRENT_THREAD;  // client thread
-	process_t * process = this->process;   // client process
+	if((dirent == NULL)                || 
+	   (fd >= CONFIG_TASK_FILE_MAX_NR) || 
+	   (task_fd_lookup(task, fd, &file)))
+	{
+		this->info.errno = EBADFD;
+		return -1;
+	}
 
-#if (DEBUG_SYS_READDIR || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_READDIR
-if( DEBUG_SYS_READDIR < tm_start )
-printk("\n[%s] thread[%x,%x] enter / dirp %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, dirp, (uint32_t)tm_start );
-#endif
- 
-    // check dirent buffer in user space
-    error = vmm_get_vseg( process , (intptr_t)buffer, &vseg );
-
-	if( error )
+	KU_OBJ(dir, dirent);
+	if((err = vfs_readdir(file, &dir)))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / dirent user buffer %x unmapped\n",
-__FUNCTION__ , process->pid , this->trdid, buffer );
-#endif
-		this->errno = EINVAL;
+		this->info.errno = (err < 0) ? -err : err; 
 		return -1;
-	}	
-
-    // get pointers on user_dir structure from dirp
-    dir_xp  = user_dir_from_ident( (intptr_t)dirp );
-    dir_ptr = GET_PTR( dir_xp );
-    dir_cxy = GET_CXY( dir_xp );
-
-    if( dir_xp == XPTR_NULL )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / dirp %x not registered\n",
-__FUNCTION__ , process->pid , this->trdid, dirp );
-#endif
-		this->errno = EBADF;
-		return -1;
-	}	
-
-    // get "current" and "entries_nr" values from user_dir_t structure
-    current = hal_remote_l32( XPTR( dir_cxy , &dir_ptr->current ) );
-    entries = hal_remote_l32( XPTR( dir_cxy , &dir_ptr->entries ) );
-
-    // check "current" index
-    if( current >= entries )
-    {
-        this->errno = 0;
-        return -1;
-    }
-
-    // compute dirent pointer in user space
-    direntp = (struct dirent *)dirp + current;
-
-#if (DEBUG_SYS_READDIR & 1)
-if( DEBUG_SYS_READDIR < (uint32_t)tm_start )
-printk("\n[%s] entries = %d / current = %d / direntp = %x\n",
-__FUNCTION__, entries, current, direntp );
-#endif
-
-    // copy dirent pointer to user buffer 
-    hal_copy_to_uspace( buffer,
-                        XPTR( local_cxy , &direntp ),
-                        sizeof(void *) );
-
-    // update current index in user_dir structure
-    hal_remote_atomic_add( XPTR( dir_cxy , &dir_ptr->current ) , 1 );
-
-    hal_fence();
-
-#if (DEBUG_SYS_READDIR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_READDIR
-if( DEBUG_SYS_READDIR < (uint32_t)tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_READDIR] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_READDIR] , 1 );
-#endif
-
+	}
+   
 	return 0;
-
-}  // end sys_readdir()
+}
Index: trunk/kernel/syscalls/sys_rename.c
===================================================================
--- trunk/kernel/syscalls/sys_rename.c	(revision 690)
+++ 	(revision )
@@ -1,149 +1,0 @@
-/*
- * sys_rename.c - Rename a file or a directory.
- *
- * Author        Alain Greiner (2016,2017,2018,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <errno.h>
-#include <printk.h>
-#include <thread.h>
-#include <vfs.h>
-#include <process.h>
-#include <remote_rwlock.h>
-
-#include <syscalls.h>
-
-///////////////////////////
-int sys_rename( char * old,
-                char * new )
-{
-    error_t        error;
-    xptr_t         old_root_inode_xp;   // extended pointer on old path root inode
-    xptr_t         new_root_inode_xp;   // extended pointer on new path root inode
-
-    char           k_old[CONFIG_VFS_MAX_PATH_LENGTH];
-    char           k_new[CONFIG_VFS_MAX_PATH_LENGTH];
-
-    thread_t     * this     = CURRENT_THREAD;
-    process_t    * process  = this->process;
-
-#if (DEBUG_SYS_RENAME || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    // check old name length
-    if( hal_strlen_from_uspace( old ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : old name too long\n", __FUNCTION__ );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // check new name length
-    if( hal_strlen_from_uspace( new ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : new name too long\n", __FUNCTION__ );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy old name an new name in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , k_old ) , old , CONFIG_VFS_MAX_PATH_LENGTH );
-    hal_strcpy_from_uspace( XPTR( local_cxy , k_new ) , new , CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_RENAME
-if( DEBUG_SYS_RENAME < tm_start )
-printk("\n[%s] thread[%x,%x] enter / old <%s> / new <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, k_old, k_new, (uint32_t)tm_start );
-#endif
- 
-    // get extended pointer on current working directory
-    xptr_t      ref_xp  = process->ref_xp;
-    process_t * ref_ptr = GET_PTR( ref_xp );
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-    xptr_t      cwd_xp  = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-
-    // compute root inode for old path 
-    if( k_old[0] == '/' )   old_root_inode_xp = process->vfs_root_xp;
-    else                    old_root_inode_xp = cwd_xp;
-
-    // compute root inode for new path 
-    if( k_new[0] == '/' )   new_root_inode_xp = process->vfs_root_xp;
-    else                    new_root_inode_xp = cwd_xp;
-
-    // call the VFS function to creates the new link
-    // this function takes & releases the lock protecting the Inode Tree
-    error = vfs_link( old_root_inode_xp,
-                      k_old,
-                      new_root_inode_xp,
-                      k_new );
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot link new <%s>\n", __FUNCTION__, k_new );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // call the VFS function to remove the old link
-    // this function takes & releases the lock protecting the Inode Tree
-    error = vfs_unlink( old_root_inode_xp,
-                        k_old );
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot unlink old <%s>\n", __FUNCTION__, k_old );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    hal_fence();
-
-#if (DEBUG_SYS_RENAME || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_RENAME
-if( DEBUG_SYS_RENAME < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_RENAME] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_RENAME] , 1 );
-#endif
-
-    return 0;
-
-}  // end sys_rename()
Index: trunk/kernel/syscalls/sys_rmdir.c
===================================================================
--- trunk/kernel/syscalls/sys_rmdir.c	(revision 690)
+++ trunk/kernel/syscalls/sys_rmdir.c	(revision 1)
@@ -1,16 +1,14 @@
 /*
- * sys_rmdir.c - Remove a directory from file system.
- *
- * Author    Alain Greiner (2016,2017,2018,2019)
+ * sys_rmdir: remove a directory
  *
  * Copyright (c) 2015 UPMC Sorbonne Universites
  *
- * This file is part of ALMOS-MKH.
+ * This file is part of ALMOS-kernel.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,66 +16,42 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <printk.h>
-#include <errno.h>
+#include <cpu.h>
 #include <vfs.h>
-#include <vmm.h>
+#include <sys-vfs.h>
 #include <thread.h>
-#include <process.h>
+#include <task.h>
 
-#include <syscalls.h>
 
-////////////////////////////////
-int sys_rmdir( char * pathname )
+int sys_rmdir (char *pathname)
 {
-    // error_t     error;
-    char        kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
+	register struct thread_s *this;
+	register struct task_s *task;
+	struct ku_obj ku_path;
+	error_t err = 0;
 	
-	thread_t  * this    = CURRENT_THREAD;
-	process_t * process = this->process;
+	this = current_thread;
+	task = current_task;
 
-#if (DEBUG_SYS_RMDIR || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	if(!pathname)
+	{
+		this->info.errno = EINVAL;
+		return -1;
+	}
 
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
+	KU_BUFF(ku_path, pathname);
+	rwlock_wrlock(&task->cwd_lock);
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-    // get cluster and local pointer on reference process
-    xptr_t      ref_xp  = process->ref_xp;
-    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-    cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-    // get extended pointer on cwd inode
-    // xptr_t cwd_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->vfs_cwd_xp ) );
-   
-    // get the cwd lock in write mode from reference process
-	remote_rwlock_wr_acquire( XPTR( ref_cxy , &ref_ptr->cwd_lock ) );
-
-    // call the relevant VFS function
-	printk("\n[ERROR] in %s : non implemented yet\n", __FUNCTION__ );
-
-    // release the cwd lock
-	remote_rwlock_wr_release( XPTR( ref_cxy , &ref_ptr->cwd_lock ) );
-
+	if((err = vfs_rmdir(&current_task->vfs_cwd, &ku_path)))
+	{
+		current_thread->info.errno = (err < 0) ? -err : err;
+		rwlock_unlock(&task->cwd_lock); 
+		return -1;
+	}
+	
+	rwlock_unlock(&task->cwd_lock); 
 	return 0;
-
-}  // end sys_rmdir()
+}
Index: trunk/kernel/syscalls/sys_rwlock.c
===================================================================
--- trunk/kernel/syscalls/sys_rwlock.c	(revision 1)
+++ trunk/kernel/syscalls/sys_rwlock.c	(revision 1)
@@ -0,0 +1,141 @@
+/*
+ * kern/sys_rwlock.c - interface to access Read-Write locks service
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <errno.h>
+#include <thread.h>
+#include <kmem.h>
+#include <task.h>
+#include <vmm.h>
+#include <kmagics.h>
+#include <rwlock.h>
+
+
+static inline bool_t isBadLock(struct rwlock_s *rwlock)
+{ 
+	return vmm_check_object(rwlock, struct rwlock_s, RWLOCK_ID);
+}
+
+int sys_rwlock(struct rwlock_s **rwlock, uint_t operation)
+{
+	kmem_req_t req;
+	struct rwlock_s *irwlock;
+	error_t err;
+  
+	err = vmm_check_address("usr rwlock ptr", 
+				current_task, 
+				rwlock,
+				sizeof(struct rwlock_s*));
+	if(err)
+		goto SYS_RWLOCK_END;
+
+	if((err = cpu_copy_from_uspace(&irwlock, rwlock, sizeof(struct rwlock_s *))))
+		goto SYS_RWLOCK_END;
+  
+	switch(operation)
+	{    
+	case RWLOCK_INIT:    
+		req.type  = KMEM_RWLOCK;
+		req.size  = sizeof(*irwlock);
+		req.flags = AF_USER;
+
+		if((irwlock = kmem_alloc(&req)) == NULL)
+		{
+			err = ENOMEM;
+			break;
+		}
+    
+		if((err = rwlock_init(irwlock)))
+			break;
+    
+		if((err = cpu_copy_to_uspace(rwlock, &irwlock, sizeof(struct rwlock_s *))))
+		{
+			req.ptr = irwlock;
+			kmem_free(&req);
+		}
+		break;
+
+	case RWLOCK_WRLOCK:
+		if(isBadLock(irwlock))
+			break;
+    
+		return rwlock_wrlock(irwlock);
+
+	case RWLOCK_RDLOCK:
+		if(isBadLock(irwlock))
+			break;
+    
+		return rwlock_rdlock(irwlock);
+
+	case RWLOCK_TRYWRLOCK:
+		if(isBadLock(irwlock))
+			break;
+    
+		return rwlock_trywrlock(irwlock);
+
+	case RWLOCK_TRYRDLOCK:
+		if(isBadLock(irwlock))
+			break;
+    
+		return rwlock_tryrdlock(irwlock);
+
+	case RWLOCK_UNLOCK:
+		if(isBadLock(irwlock))
+			break;
+    
+		if((err = rwlock_unlock(irwlock)))
+			break;
+
+	case RWLOCK_DESTROY:
+		if(isBadLock(irwlock))
+			break;
+    
+		if((err = rwlock_destroy(irwlock)))
+			break;
+
+		req.type = KMEM_RWLOCK;
+		req.ptr  = irwlock;
+		kmem_free(&req);
+		return 0;
+
+	default:
+		err = EINVAL;
+	}
+
+SYS_RWLOCK_END:
+	current_thread->info.errno = err;
+	return err;
+}
+
+KMEM_OBJATTR_INIT(rwlock_kmem_init)
+{
+	attr->type   = KMEM_RWLOCK;
+	attr->name   = "KCM RWLOCK";
+	attr->size   = sizeof(struct rwlock_s);
+	attr->aligne = 0;
+	attr->min    = CONFIG_RWLOCK_MIN;
+	attr->max    = CONFIG_RWLOCK_MAX;
+	attr->ctor   = NULL;
+	attr->dtor   = NULL;
+  
+	return 0;
+}
Index: trunk/kernel/syscalls/sys_sem.c
===================================================================
--- trunk/kernel/syscalls/sys_sem.c	(revision 690)
+++ trunk/kernel/syscalls/sys_sem.c	(revision 1)
@@ -2,15 +2,14 @@
  * sys_sem.c - Acces a POSIX unamed semaphore.
  * 
- * Authors     Alain Greiner (2016,2017,2018,2019)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,67 +17,39 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <shared_semaphore.h>
-#include <errno.h>
-#include <thread.h>
-#include <printk.h>
-#include <vmm.h>
+#include <hal_types.h>
+#include <hal_uspace.
 #include <remote_sem.h>
-#include <syscalls.h>
-
-#if DEBUG_SYS_SEM
-//////////////////////////////////////////////////
-static char * sys_sem_op_str( uint32_t operation )
-{
-  	if     ( operation == SEM_INIT     ) return "INIT";
-  	else if( operation == SEM_WAIT     ) return "WAIT";
-  	else if( operation == SEM_POST     ) return "POST";
-  	else if( operation == SEM_GETVALUE ) return "GETVALUE";
-  	else if( operation == SEM_DESTROY  ) return "DESTROY";
-  	else                                 return "undefined";
-}
-#endif
 
 //////////////////////////////////
-int sys_sem( void         * vaddr,            // semaphore virtual  address 
-             uint32_t       operation,        // requested operation type
-             uint32_t       init_value,       // initial value
-             uint32_t     * current_value )   // pointer on current value buffer
+int sys_sem( void         * vaddr,        // semaphore virtual  address 
+             uint32_t       operation,    // requested operation type
+             uint32_t     * value )       // pointer on in/out argument
 {
-	vseg_t         * vseg;        // for vaddr check
-    error_t          error;
+	uint32_t             data;   
+	error_t              error;
 
-    thread_t       * this    = CURRENT_THREAD;
-    process_t      * process = this->process;
-
-#if (DEBUG_SYS_SEM || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_SEM
-if( DEBUG_SYS_SEM < tm_start )
-printk("\n[DBG] %s : thread %x in process %x enter for %s / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, sys_sem_op_str( operation ), (uint32_t)tm_start );
-#endif
+    thread_t           * this      = CURRENT_THREAD;
+	process_t          * process   = CURRENT_PROCESS;
 
     // check vaddr in user vspace
-	error = vmm_get_vseg( process , (intptr_t)vaddr , &vseg );
-	if( error )
+	error = vmm_check_address( process , vaddr , sizeof(unsigned long) );
+	if( error ) 
     {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : unmapped semaphore pointer %x / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
-        this->errno = EINVAL;
+        this->errno = error;
         return -1;
     }
 
+    // check value in user vspace
+    error = vmm_check_address( process , value , sizeof(int*) );
+	if( error ) 
+    {
+        this->errno = error;
+        return -1;   
+    }
+    
     // execute requested operation
 	switch( operation )
@@ -87,157 +58,100 @@
 	    case SEM_INIT:
         {
-            // call relevant kernel function to initialize semaphore
-            error = remote_sem_create( (intptr_t)vaddr , 
-                                       init_value );
+            // get argument
+		    hal_copy_from_uspace( &data , value , sizeof(uint32_t) );
+
+            // call init function
+            error = remote_sem_init( (intptr_t)vaddr , data );
+
             if ( error )
             {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s INIT: cannot create semaphore / thread %x in process %x / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
-                this->errno = ENOMEM;
+                this->errno = error;
                 return -1;
             }
+            break;
         }
-        break;
         //////////////////
         case SEM_GETVALUE:
         {
-            // check current_value buffer in user vspace
-	        error = vmm_get_vseg( process , (intptr_t)current_value , &vseg );
-            if( error )
+            // get extended pointer on remote semaphore
+            xptr_t sem_xp = remote_sem_from_vaddr( (intptr_t)vaddr );
+
+            if( sem_xp == XPTR_NULL )     // user error
             {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s GETVALUE: unmapped buffer %x / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , (intptr_t)current_value, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
                 this->errno = EINVAL;
                 return -1;
             }
-
-            // get extended pointer on remote semaphore
-            xptr_t sem_xp = remote_sem_from_ident( (intptr_t)vaddr );
-
-            // check semaphore registered
-            if( sem_xp == XPTR_NULL )
+            else                          // success
             {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s GETVALUE: semaphore %x not found / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
-                this->errno = EINVAL;
-                return -1;
+                // get semaphore current value
+		        remote_sem_get_value( sem_xp , &data );
+ 
+                // return value to user
+                hal_copy_to_uspace( value , &data , sizeof(uint32_t) );
             }
-
-            // call relevant kernel function to get semaphore current value
-            uint32_t current;
-		    remote_sem_get_value( sem_xp , &current );
- 
-            // return value to user
-            hal_copy_to_uspace( current_value,
-                                XPTR( local_cxy , &current ),
-                                sizeof(uint32_t) );
+            break;
         }
-        break;
         //////////////
 	    case SEM_WAIT:
         {  
             // get extended pointer on remote semaphore
-            xptr_t sem_xp = remote_sem_from_ident( (intptr_t)vaddr );
+            xptr_t sem_xp = remote_sem_from_vaddr( (intptr_t)vaddr );
 
-            // check semaphore registered
-            if( sem_xp == XPTR_NULL )
+            if( sem_xp == XPTR_NULL )     // user error
             {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s WAIT: semaphore %x not found / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
                 this->errno = EINVAL;
                 return -1;
             }
-
-            // call relevant kernel function to wait semaphore available
-            remote_sem_wait( sem_xp );
+            else                          // success
+            {
+                // wait semaphore available
+                remote_sem_wait( sem_xp );
+            }
+            break;
         }
-        break;
         //////////////
 	    case SEM_POST:
         {
             // get extended pointer on remote semaphore
-            xptr_t sem_xp = remote_sem_from_ident( (intptr_t)vaddr );
+            xptr_t sem_xp = remote_sem_from_vaddr( (intptr_t)vaddr );
 
-            // check semaphore registered
-            if( sem_xp == XPTR_NULL )
+            if( sem_xp == XPTR_NULL )     // user error
             {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s POST: semaphore %x not found / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
                 this->errno = EINVAL;
                 return -1;
             }
-
-            // call relevant kernel function to release semaphore 
-            remote_sem_post( sem_xp );
+            else                          // success
+            {
+                // release semaphore 
+                remote_sem_post( sem_xp );
+            }
+			break;
         }
-		break;
         /////////////////
 	    case SEM_DESTROY:
         {
             // get extended pointer on remote semaphore
-            xptr_t sem_xp = remote_sem_from_ident( (intptr_t)vaddr );
+            xptr_t sem_xp = remote_sem_from_vaddr( (intptr_t)vaddr );
 
-            // check semaphore registered
-            if( sem_xp == XPTR_NULL )
+            if( sem_xp == XPTR_NULL )     // user error
             {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s DESTROY: semaphore %x not found / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , (intptr_t)vaddr, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
                 this->errno = EINVAL;
                 return -1;
             }
-
-            // destroy semaphore
-            remote_sem_destroy( sem_xp );
+            else                          // success 
+            {
+                // destroy semaphore
+                remote_sem_destroy( sem_xp );
+            }
+            break;
 	    }	
-        break;
         ///////
 	    default:  // undefined operation                       
         {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : undefined operation type %d / thread %x in process %x / cycle %d\n",
-__FUNCTION__ , operation, this->trdid, process->pid, (uint32_t)hal_get_cycles() );
-#endif
-            this->errno = EINVAL;
+		    this->errno = EINVAL;
             return -1;
         }
 	}
 
-    hal_fence();
-
-#if (DEBUG_SYS_SEM || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_SEM
-if( DEBUG_SYS_SEM < tm_end )
-printk("\n[DBG] %s : thread %x in process %x exit for %s / cost = %d / cycle %d\n",
-__FUNCTION__, this->trdid, process->pid, sys_sem_op_str( operation ),
-(uint32_t)(tm_end - tm_start), (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_SEM] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_SEM] , 1 );
-#endif
-
     return 0;
 
Index: trunk/kernel/syscalls/sys_signal.c
===================================================================
--- trunk/kernel/syscalls/sys_signal.c	(revision 690)
+++ trunk/kernel/syscalls/sys_signal.c	(revision 1)
@@ -1,9 +1,7 @@
 /*
- * sys_signal.c - associate a specific signal handler to a given signal.
+ * sys_sem.c: interface to access signal service
  * 
- * Authors   Ghassan Almaless (2008,2009,2010,2011,2012)
- *           Alain Greiner (2016,2017)
- *
- * Copyright (c) UPMC Sorbonne Universites
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012,2013,2014,2015 UPMC Sorbonne Universites
  *
  * This file is part of ALMOS-kernel.
@@ -23,21 +21,73 @@
  */
 
-#include <hal_kernel_types.h>
+#include <types.h>
 #include <errno.h>
 #include <thread.h>
-#include <printk.h>
+#include <task.h>
+#include <pid.h>
+#include <signal.h>
 
-#include <syscalls.h>
 
-//////////////////////////////////
-int sys_signal( uint32_t   sig_id,
-                void     * handler )
-{
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
+int sys_signal(uint_t sig, sa_handler_t *handler)
+{  
+	register struct thread_s *this;
+	int retval;
 
-    printk("\n[ERROR] in %s : thread %x in process %x / not implemented yet\n", 
-    __FUNCTION__, this->trdid, process->pid, sig_id, handler );
-    return ENOSYS;
+	this = current_thread;
+
+	if((sig == 0) || (sig >= SIG_NR) || (sig == SIGKILL) || (sig == SIGSTOP))
+	{
+		this->info.errno = EINVAL;
+		return SIG_ERROR;
+	}
+
+	retval = (int) this->task->sig_mgr.sigactions[sig];
+	this->task->sig_mgr.sigactions[sig] = handler;
+
+	sig_dmsg(1, "%s: handler @%x has been registred for signal %d\n",
+	       __FUNCTION__, 
+	       handler, 
+	       sig);
+
+	return retval;
 }
 
+
+int sys_sigreturn_setup(void *sigreturn_func)
+{
+	struct thread_s *this;
+
+	this = current_thread;
+	this->info.attr.sigreturn_func = sigreturn_func;
+	cpu_context_set_sigreturn(&this->pws, sigreturn_func);
+	return 0;
+}
+
+
+int sys_kill(pid_t pid, uint_t sig)
+{
+        cid_t   location;
+	error_t err;
+
+	if((sig == 0) || (sig >= SIG_NR))
+	{
+		err = EINVAL;
+	}
+        else
+        {
+                if ( PID_GET_CLUSTER(pid) == current_cid )
+                        location = current_cid;
+                else
+                        location = task_whereis(pid);
+
+                err = signal_rise(pid, location, sig);
+
+                /* No error, return 0 */
+                if (!err)
+                        return 0;
+        }
+
+        /* Error. Set errno and return */
+	current_thread->info.errno = err;
+	return -1;
+}
Index: trunk/kernel/syscalls/sys_socket.c
===================================================================
--- trunk/kernel/syscalls/sys_socket.c	(revision 690)
+++ 	(revision )
@@ -1,574 +1,0 @@
-/*
- * sys_socket.c - implement the various socket related system calls
- *
- * Author    Alain Greiner (2016,2017,2018,2019,2020)
- *  
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <errno.h>
-#include <vmm.h>
-#include <cluster.h>
-#include <thread.h>
-#include <process.h>
-#include <ksocket.h>
-#include <string.h>
-#include <shared_syscalls.h>
-#include <shared_socket.h> 
-#include <remote_barrier.h>
-#include <vfs.h>
-#include <mapper.h>
-
-#include <syscalls.h>
-
-/////////////////////////////////////////////////////////////////////////////////
-// This function returns a printable string for the socket related command type.
-/////////////////////////////////////////////////////////////////////////////////
-
-#if DEBUG_SYS_SOCKET
-static char* socket_user_cmd_str( uint32_t type )
-{
-    if     ( type == SOCK_CREATE      ) return "CREATE"; 
-    else if( type == SOCK_BIND        ) return "BIND"; 
-    else if( type == SOCK_LISTEN      ) return "LISTEN"; 
-    else if( type == SOCK_CONNECT     ) return "CONNECT"; 
-    else if( type == SOCK_ACCEPT      ) return "ACCEPT";
-    else if( type == SOCK_SEND        ) return "SEND"; 
-    else if( type == SOCK_RECV        ) return "RECV"; 
-    else if( type == SOCK_SENDTO      ) return "SENDTO"; 
-    else if( type == SOCK_RECVFROM    ) return "RECVFROM"; 
-    else                                return "undefined";
-}
-#endif
-
-/////////////////////////////
-int sys_socket( reg_t  arg0,
-                reg_t  arg1,
-                reg_t  arg2,
-                reg_t  arg3 )
-{
-    int             ret;
-    vseg_t        * vseg;
-
-    sockaddr_in_t   k_sockaddr;  // kernel buffer for one socket address
-
-    thread_t      * this    = CURRENT_THREAD;
-    process_t     * process = this->process;
-
-    uint32_t        cmd = arg0;
-
-#if DEBUG_SYS_SOCKET || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_SOCKET
-char kbuf[64];
-if( DEBUG_SYS_SOCKET < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter for %s / a1 %x / a2 %x / a3 %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, socket_user_cmd_str(cmd), 
-arg1, arg2, arg3, (uint32_t)tm_start );
-#endif
-
-    switch( cmd )
-    {
-        /////////////////
-        case SOCK_CREATE:
-        {
-            uint32_t domain = arg1;
-            uint32_t type   = arg2;
-
-            if( domain != AF_INET )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / CREATE / domain %d =! AF_INET / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , domain , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            if( (type != SOCK_DGRAM) && (type != SOCK_STREAM) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / CREATE / illegal socket type / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid  , (uint32_t)tm_start);
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // call relevant kernel socket function
-            ret = socket_build( domain , type );
-
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / CREATE / cannot create socket / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid  , (uint32_t)tm_start);
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            break;
-        }
-        ///////////////
-        case SOCK_BIND:
-        {
-            uint32_t        fdid = arg1;
-            sockaddr_in_t * u_sockaddr = (sockaddr_in_t *)(intptr_t)arg2;
-
-            // check addr pointer in user space
-            if( vmm_get_vseg( process , (intptr_t)arg2 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / BIND / socket address %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // copy sockaddr structure from uspace to kernel space
-            hal_copy_from_uspace( XPTR( local_cxy , &k_sockaddr ),
-                                  u_sockaddr, 
-                                  sizeof(sockaddr_in_t) );
-
-            // call relevant kernel socket function
-	        ret = socket_bind( fdid,
-                               k_sockaddr.sin_addr,
-                               k_sockaddr.sin_port );
-
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / BIND / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid ,  process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            break;
-        }
-        /////////////////
-        case SOCK_LISTEN:
-        {
-            uint32_t     fdid        = (uint32_t)arg1;
-            uint32_t     max_pending = (uint32_t)arg2;
-
-            // call relevant kernel socket function
-	        ret = socket_listen( fdid , max_pending );
-
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / LISTEN / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid ,  process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            break;
-        }
-        //////////////////
-        case SOCK_CONNECT:
-        {
-            uint32_t        fdid = (uint32_t)arg1;
-            sockaddr_in_t * u_sockaddr = (sockaddr_in_t *)(intptr_t)arg2;
-
-            // check addr pointer in user space
-            if( vmm_get_vseg( process , (intptr_t)arg2 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / CONNECT / server address %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // copy sockaddr structure from uspace to kernel space
-            hal_copy_from_uspace( XPTR( local_cxy , &k_sockaddr ),
-                                  u_sockaddr ,
-                                  sizeof(sockaddr_in_t) );
-
-            // call relevant kernel function
-	        ret = socket_connect( fdid,
-                                  k_sockaddr.sin_addr,
-                                  k_sockaddr.sin_port );
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / LISTEN / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid ,  process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            break;
-        }
-        /////////////////
-        case SOCK_ACCEPT:
-        {
-            uint32_t        fdid = (uint32_t)arg1;
-            sockaddr_in_t * u_sockaddr = (sockaddr_in_t *)(intptr_t)arg2;
-
-            // check addr pointer in user space
-            if( vmm_get_vseg( process , (intptr_t)arg2 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / CONNECT / server address %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // call relevant kernel function
-            ret = socket_accept( fdid,
-                                 &k_sockaddr.sin_addr, 
-                                 &k_sockaddr.sin_port );
-
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / ACCEPT / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-            }
-
-            // copy sockaddr structure from kernel space to uspace
-            hal_copy_to_uspace( u_sockaddr,
-                                XPTR( local_cxy , &k_sockaddr ),
-                                sizeof(sockaddr_in_t) );
-
-            break;
-        }
-        ///////////////
-        case SOCK_SEND:
-        {
-            uint32_t     fdid   = (uint32_t)arg1;
-            uint8_t    * u_buf  = (uint8_t *)(intptr_t)arg2;
-            uint32_t     length = (uint32_t)arg3;
-
-            // check buffer is mapped in user space
-            if( vmm_get_vseg( process , (intptr_t)arg2 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / SEND / u_buf %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // check length argument
-            if( (length == 0) || (length > (1<<CONFIG_SOCK_TX_BUF_ORDER)) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / SEND / bad buffer length %d / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , length , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // cal relevant socket function
-            ret = socket_send( fdid,
-                               u_buf,
-                               length );
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / SEND / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-            }
-
-#if DEBUG_SYS_SOCKET
-if( DEBUG_SYS_SOCKET < (uint32_t)tm_start )
-{
-    hal_copy_from_uspace( XPTR( local_cxy , &kbuf ) , u_buf , ret );
-    printk("\n[%s] thread[%x,%x] send %d bytes <%s>\n",
-    __FUNCTION__, process->pid, this->trdid , ret, kbuf );
-}
-#endif
-            break;
-        }
-        ///////////////
-        case SOCK_RECV:
-        {
-            uint32_t     fdid   = (uint32_t)arg1;
-            uint8_t    * u_buf  = (uint8_t *)(intptr_t)arg2;
-            uint32_t     length = (uint32_t)arg3;
-
-            // check buffer is mapped in user space
-            if( vmm_get_vseg( process , (intptr_t)arg2 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / RECV / u_buf %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // check length argument
-            if( (length == 0) || (length > (1<<CONFIG_SOCK_RX_BUF_ORDER)) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / RECV / bad buffer length %d / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , length , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // cal relevant kernel socket function
-            ret =  socket_recv( fdid, 
-                                u_buf,
-                                length );
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / RECV / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-            }
-
-#if DEBUG_SYS_SOCKET
-if( DEBUG_SYS_SOCKET < (uint32_t)tm_start )
-{
-    hal_copy_from_uspace( XPTR( local_cxy , &kbuf ) , u_buf , ret );
-    printk("\n[%s] thread[%x,%x] received %d bytes <%s>\n",
-    __FUNCTION__, process->pid, this->trdid , ret, kbuf );
-}
-#endif
-            break;
-        }
-        /////////////////
-        case SOCK_SENDTO:
-        {
-            sockaddr_in_t k_remote_addr;
-
-            uint32_t      fdid          = (uint32_t)arg1 & 0x0000FFFF;
-            uint32_t      length        = (uint32_t)arg1 >> 16;
-            uint8_t     * u_buf         = (uint8_t *)(intptr_t)arg2;
-            sockaddr_t  * u_remote_addr = (sockaddr_t *)(intptr_t)arg3;
-
-            // check u_buf mapped in user space
-            if( vmm_get_vseg( process , (intptr_t)arg2 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / SENDTO / u_buf %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // check u_remote_addr mapped in user space
-            if( vmm_get_vseg( process , (intptr_t)arg3 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / SENDTO / u_remote_addr %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg3 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // check length argument
-            if( (length == 0) || (length > (1<<CONFIG_SOCK_TX_BUF_ORDER)) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / SENDTO / bad length %d / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , length , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // make a kernel copy of the sockaddr_t structure
-            hal_copy_from_uspace( XPTR( local_cxy , &k_remote_addr ),
-                                  u_remote_addr, sizeof(sockaddr_t) );
-
-            // cal relevant socket function
-            ret = socket_sendto( fdid,
-                                 u_buf,
-                                 length,
-                                 k_remote_addr.sin_addr,
-                                 k_remote_addr.sin_port );
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / SENDTO / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-            }
-
-            break;
-        }
-        ///////////////////
-        case SOCK_RECVFROM:
-        {
-            sockaddr_in_t k_remote_addr;
-
-            uint32_t      fdid          = (uint32_t)arg1 & 0x0000FFFF;
-            uint32_t      length        = (uint32_t)arg1 >> 16;
-            uint8_t     * u_buf         = (uint8_t *)(intptr_t)arg2;
-            sockaddr_t  * u_remote_addr = (sockaddr_t *)(intptr_t)arg3;
-
-            // check buffer is mapped in user space
-            if( vmm_get_vseg( process , (intptr_t)arg2 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / RECVFROM / u_buf %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg2 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // check u_remote_addr mapped in user space
-            if( vmm_get_vseg( process , (intptr_t)arg3 , &vseg ) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / RECVFROM / u_remote_addr %x unmapped / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , (intptr_t)arg3 , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // check length argument
-            if( (length == 0) || (length > (1<<CONFIG_SOCK_RX_BUF_ORDER)) )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / RECVFROM / bad length %d / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , length , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-                ret = -1;
-                break;
-            }
-
-            // make a kernel copy of the sockaddr_t structure
-            hal_copy_from_uspace( XPTR( local_cxy , &k_remote_addr ),
-                                  u_remote_addr, sizeof(sockaddr_t) );
-
-            // cal relevant socket function
-            ret = socket_recvfrom( fdid,
-                                   u_buf,
-                                   length,
-                                   k_remote_addr.sin_addr,
-                                   k_remote_addr.sin_port );
-            if( ret < 0 )
-            {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / RECVFROM / cannot access socket[%x,%d] / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , process->pid, fdid , (uint32_t)tm_start );
-#endif
-                this->errno = EINVAL;
-            }
-
-            break;
-        }
-        ////////
-        default: 
-        {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / undefined socket operation %d / cycle %d\n",
-__FUNCTION__ , process->pid , this->trdid , cmd , (uint32_t)tm_start );
-#endif
-            this->errno = EINVAL;
-            ret = -1;
-            break;
-        }
-    }  // end switch on cmd
-
-#if (DEBUG_SYS_SOCKET || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_SOCKET
-printk("\n[%s] thread[%x,%x] exit for %s / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, socket_user_cmd_str(cmd), (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_SOCKET] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_SOCKET] , 1 );
-#endif
-
-    return ret;
-
-}  // end sys_socket()
Index: trunk/kernel/syscalls/sys_stat.c
===================================================================
--- trunk/kernel/syscalls/sys_stat.c	(revision 690)
+++ trunk/kernel/syscalls/sys_stat.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_stat.c - kernel function implementing the "stat" syscall.
+ * kern/sys_stat.c - stats a file or directory
  * 
- * Author    Alain Greiner  (2016,2017,2018,2019)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,133 +17,64 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <hal_special.h>
 #include <errno.h>
 #include <thread.h>
-#include <printk.h>
 #include <vfs.h>
-#include <vmm.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
+#include <spinlock.h>
+#include <cpu-trace.h>
 
-#include <syscalls.h>
 
-/////////////////////////////////////
-int sys_stat( char        * pathname,
-              struct stat * u_stat )
+int sys_stat(char *pathname, struct vfs_stat_s *buff, int fd)
 {
-    error_t       error;
-    vseg_t      * vseg;                   // for user space checking
-    struct stat   k_stat;                 // in kernel space 
-    xptr_t        root_inode_xp;          // extended pointer on path root inode
+	CPU_HW_TRACE(sys_stat);
+	struct thread_s *this;
+	register error_t err = 0;
+	struct vfs_file_s *file;
+	struct ku_obj ku_path;
+	struct task_s *task;
 
-    char          kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
-	
-	thread_t  * this    = CURRENT_THREAD;
-	process_t * process = this->process;
+	file = NULL;
+	this = current_thread;
+	task = current_task;
 
-#if (DEBUG_SYS_STAT || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    // check stat structure in user space
-    error = vmm_get_vseg( process , (intptr_t)u_stat , &vseg );
-
-	if( error )
+	if((buff == NULL) || ((pathname == NULL) && (fd == -1)))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s / thread[%x,%x] : stat structure %x unmapped\n",
-__FUNCTION__ , process->pid , this->trdid, u_stat );
-#endif
-		this->errno = EINVAL;
-		return -1;
-	}	
-
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s / thread[%x,%x] : pathname too long\n",
- __FUNCTION__ , process->pid , this->trdid );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_STAT
-if( DEBUG_SYS_STAT < tm_start )
-printk("\n[%s] thread[%x,%x] enter for file <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_start );
-#endif
-
-    // compute root inode for path 
-    if( kbuf[0] == '/' )                        // absolute path
-    {
-        // use extended pointer on VFS root inode
-        root_inode_xp = process->vfs_root_xp;
-    }
-    else                                        // relative path
-    {
-        // get cluster and local pointer on reference process
-        xptr_t      ref_xp  = process->ref_xp;
-        process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-        cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-        // use extended pointer on CWD inode
-        root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-    }
-
-    // call the relevant VFS function
-    error = vfs_stat( root_inode_xp,
-                      kbuf,
-                      &k_stat ); 
-    if( error )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s / thread[%x,%x] : cannot get stats for inode <%s>\n",
-__FUNCTION__ , process->pid , this->trdid , pathname );
-#endif
-		this->errno = ENFILE;
+		this->info.errno = EINVAL;
+		CPU_HW_TRACE(sys_stat);
 		return -1;
 	}
-   
-    // copy k_stat to u_stat 
-    hal_copy_to_uspace( u_stat,
-                        XPTR( local_cxy , &k_stat ),
-                        sizeof(struct stat) );
 
-    hal_fence();
+	if(NOT_IN_USPACE((uint_t)buff))
+	{
+		this->info.errno = EPERM;
+		CPU_HW_TRACE(sys_stat);
+		return -1;
+	}
 
-#if (DEBUG_SYS_STAT || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_STAT
-if( DEBUG_SYS_STAT < tm_end )
-printk("\n[%s] thread[%x,%x] exit for file <%s> / size %d / mode %d / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf,
-k_stat.st_size, k_stat.st_mode, (uint32_t)tm_end );
-#endif
+	if(pathname == NULL)
+	{
+		if((fd >= CONFIG_TASK_FILE_MAX_NR) || (task_fd_lookup(task, fd, &file)))
+		{
+			CPU_HW_TRACE(sys_stat);
+			return EBADFD;
+		}
  
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_STAT] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_STAT] , 1 );
-#endif
-
+		err = vfs_stat(&task->vfs_cwd, NULL, buff, file);
+	}
+	else
+	{
+		KU_BUFF(ku_path, pathname);
+		rwlock_rdlock(&task->cwd_lock);
+		err = vfs_stat(&task->vfs_cwd, &ku_path, buff, NULL);
+		rwlock_unlock(&task->cwd_lock);
+	}
+ 
+	this->info.errno = err;
+	CPU_HW_TRACE(sys_stat);
 	return 0;
-
-}  // end sys_stat()
-
+}
Index: trunk/kernel/syscalls/sys_sync.c
===================================================================
--- trunk/kernel/syscalls/sys_sync.c	(revision 690)
+++ 	(revision )
@@ -1,37 +1,0 @@
-/*
- * sys_sync.c - copy modified pages for all kernel mappers to IOC device.
- * 
- * Author    Alain Greiner  (2016,1017,2018,2019)
- *
- * Copyright (c)  UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <vfs.h>
-#include <process.h>
-#include <thread.h>
-#include <printk.h>
-
-#include <syscalls.h>
-
-////////////////
-int sys_sync ( )
-{
-    printk("\n[ERROR] in %d : not implemented yet\n", __FUNCTION__ );
-    return ENOSYS;
-}
Index: trunk/kernel/syscalls/sys_thread_cancel.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_cancel.c	(revision 690)
+++ 	(revision )
@@ -1,115 +1,0 @@
-/*
- * sys_thread_cancel.c - terminate execution of an user thread.
- * 
- * Authors   Alain Greiner (2016,2017, 2018)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
-#include <hal_remote.h>
-#include <hal_special.h>
-#include <thread.h>
-#include <errno.h>
-#include <printk.h>
-
-#include <syscalls.h>
-
-//////////////////////////////////////
-int sys_thread_cancel( trdid_t trdid )
-{
-    reg_t        save_sr;       // required to enable IRQs
-    xptr_t       target_xp;     // target thread extended pointer
-    cxy_t        target_cxy;    // target thread cluster identifier
-    ltid_t       target_ltid;   // target thread local index
-    xptr_t       owner_xp;      // extended pointer on owner process
-    cxy_t        owner_cxy;     // process owner cluster identifier
-
-    // get killer thread pointers
-	thread_t   * this    = CURRENT_THREAD;
-    process_t  * process = this->process;
-    pid_t        pid     = process->pid;
-
-#if DEBUG_SYS_THREAD_CANCEL
-uint64_t     tm_start;
-uint64_t     tm_end;
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_THREAD_CANCEL < tm_start )
-printk("\n[DBG] %s : thread %x enter to kill thread %x in process %x / cycle %d\n",
-__FUNCTION__, this , trdid , pid , (uint32_t)tm_start );
-#endif
-
-    // get extended pointer on target thread
-	target_xp  = thread_get_xptr( pid , trdid );
-
-    // check target_xp
-    if( target_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : target thread %x not found\n", __FUNCTION__, trdid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    // get process owner cluster
-    owner_xp  = process->owner_xp;
-    owner_cxy = GET_CXY( owner_xp );
-
-    // get target thread ltid and cluster
-    target_cxy  = CXY_FROM_TRDID( trdid );
-    target_ltid = LTID_FROM_TRDID( trdid );
-
-    // If target thread is the main thread, the process must be deleted, 
-    // This require synchronisation with parent process
-    if( (target_cxy == owner_cxy) && (target_ltid == 0) )
-    {
-        // mark for delete all threads but the main 
-        hal_enable_irq( &save_sr );
-        process_sigaction( pid , DELETE_ALL_THREADS );
-        hal_restore_irq( save_sr );
-
-        // remove process from TXT list
-        process_txt_detach( owner_xp );
-
-        // block the main thread 
-        thread_block( XPTR( local_cxy ,this ) , THREAD_BLOCKED_GLOBAL );
-
-        // atomically update owner process descriptor term_state to ask
-        // the parent process sys_wait() function to delete the main thread 
-        hal_remote_atomic_or( XPTR( local_cxy , &process->term_state ) ,
-                              PROCESS_TERM_EXIT );
-    }
-    else
-    {
-        // block target thread and mark it for delete
-        thread_delete_request( target_xp , false );              // not forced
-    }
-
-#if DEBUG_SYS_THREAD_CANCEL
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_THREAD_CANCEL < tm_end )
-printk("\n[DBG] %s : thread %x exit after kill thread %x in process %x / cycle %d\n",
-__FUNCTION__, this , trdid , pid , (uint32_t)tm_end );
-#endif
-
-	return 0;
-
-}  // end sys_thread_cancel()
Index: trunk/kernel/syscalls/sys_thread_create.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_create.c	(revision 690)
+++ trunk/kernel/syscalls/sys_thread_create.c	(revision 1)
@@ -1,6 +1,8 @@
 /*
  * sys_thread_create.c - creates a new user thread
- *
- * Author     Alain Greiner (2016,2017,2018,2019)
+ * 
+ * Author  Ghassan Almaless (2008,2009,2010,2011,2012)
+ *         Mohamed lamine Karaoui (2015)
+ *         Alain Greiner (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,8 +24,6 @@
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
+#include <almos_config.h>
+#include <hal_types.h>
 #include <printk.h>
 #include <errno.h>
@@ -36,193 +36,122 @@
 #include <kmem.h>
 #include <process.h>
+#include <spinlock.h>
 #include <dqdt.h>
-#include <rpc.h>
 
-#include <syscalls.h>
 
-/////////////////////////////////////////////////////////
-int sys_thread_create( trdid_t               * trdid_ptr,
-                       struct pthread_attr_s * user_attr,
-                       void                  * start_func,
-                       void                  * start_args )
+//////////////////////////////////////////////////////////////////////////////////////////
+// This function implements the pthread_create system call
+//////////////////////////////////////////////////////////////////////////////////////////
+int sys_thread_create ( thread_t       * new_thread,    // [out] argument
+                        pthread_attr_t * user_attr,     // [in] argument
+                        void           * start_func,    // [in] argument
+                        void           * start_args )   // [in] argument
 {
-    pthread_attr_t   kern_attr;        // copy of pthread attributes in kernel space
-    thread_t       * parent;           // pointer on thread executing the pthread_create
-    cxy_t            child_cxy;        // created child thread cluster identifier
-    thread_t       * child_ptr;        // pointer on created child thread
-    xptr_t           child_xp;         // extended pointer on created thread
+	pthread_attr_t   attr;             // copy of pthread attributes in kernel space
+	thread_t       * parent;           // pointer on thread executing the pthread_create
+    xptr_t           xp_parent;        // extended pointer on created thread
+    thread_t       * child;            // pointer on created child thread
+    xptr_t           xp_child;         // extended pointer on created thread
     trdid_t          trdid;            // created thread identifier
     process_t      * process;          // pointer on local process descriptor
-    vseg_t         * vseg;             // required for user space checking
     error_t          error;
 
-    // get parent thead pointer, extended pointer, and process 
-    parent     = CURRENT_THREAD;
-    process    = parent->process;
+	uint32_t         tm_start;
+	uint32_t         tm_end;
 
-#if (DEBUG_SYS_THREAD_CREATE || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	tm_start = hal_time_stamp();
 
-#if DEBUG_SYS_THREAD_CREATE
-if( DEBUG_SYS_THREAD_CREATE < tm_start )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, process->pid, parent->trdid, (uint32_t)tm_start );
-#endif
+    // get parent thead pointer, extended pointer, and process pointer
+	parent     = CURRENT_THREAD;
+    xp_parent  = XPTR( local_cxy , parent );    
+	process    = parent->process;
 
-    // check trdid buffer in user space
-    if( vmm_get_vseg( process , (intptr_t)trdid_ptr , &vseg ) )
+    // check user_attr & start_func arguments
+	if( user_attr == NULL )
+	{
+		printk("\n[ERROR] in %s : user_attr is NULL\n", __FUNCTION__ );
+		return EINVAL;
+	}
+	if( start_func== NULL )
+	{
+		printk("\n[ERROR] in %s : start_func is NULL\n", __FUNCTION__ );
+		return EINVAL;
+	}
+
+    // copy user_attr structure to kernel space
+	hal_copy_from_uspace( &attr , user_attr , sizeof(pthread_attr_t) );
+
+    // check/set "cxy" attribute
+	if( attr.flags & PT_FLAG_CLUSTER_DEFINED ) 
     {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / trdid buffer %x unmapped %x\n",
-__FUNCTION__, process->pid, parent->trdid, (intptr_t)trdid_ptr );
-#endif
-		parent->errno = EINVAL;
-		return -1;
+        if( cluster_is_undefined( attr.cxy ) )
+        {
+		    printk("\n[ERROR] in %s : illegal target cluster = %x\n",
+                   __FUNCTION__ , attr.cxy );
+		    return = EINVAL;
+        } 
+    }
+    else
+    {
+        attr.cxy = dqdt_get_cluster_for_process();
     }
 
-	// check user_attr buffer in user space & copy to kernel space
-    if( user_attr != NULL )
+    // set "pid", "start_func" & "start_args" attributes
+    attr.pid        = process->pid;
+    attr.start_func = start_func;
+    attr.start_args = start_args;
+
+    // create the thread, using a RPC if required
+    // this returns "error", "child", and "xp_child" 
+    if( attr.cxy == local_cxy )                 // target cluster is local 
     {
-	    if( vmm_get_vseg( process , (intptr_t)user_attr , &vseg ) )
-	    {
+        // allocate a stack from local VMM 
+        vseg_t * vseg = vmm_create_vseg( process, 
+                                         0,
+                                         0,
+                                         VSEG_TYPE_STACK,
+                                         local_cxy );
+        if( vseg == NULL )
+        {
+		    printk("\n[ERROR] in %s for : cannot create stack vseg\n", __FUNCTION__ );
+		    return = EINVAL;
+        } 
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / user_attr buffer unmapped %x\n",
-__FUNCTION__, process->pid, parent->trdid, (intptr_t)user_attr );
-#endif
-		    parent->errno = EINVAL;
-		    return -1;
-	    }
-        
-	    hal_copy_from_uspace( XPTR( local_cxy , &kern_attr ),
-                              user_attr,
-                              sizeof(pthread_attr_t) );
+        // create thread in local cluster
+        error = thread_user_create( &child,
+                                    &attr,
+                                    vseg->min,
+                                    vseg->max - vseg->min );
+
+        xp_child = XPTR( local_cxy , thread );
+    }
+    else                                                 // target cluster is remote
+    {
+        rpc_thread_user_create( attr.cxy , &attr , &error , &xp_child );
+        child = (thread_t *)GET_PTR( xp_child );
     }
 
-	// check start_func in user space
-	if( vmm_get_vseg( process , (intptr_t)start_func , &vseg ) )
+    // check successful thread creation
+    if( error ) 
     {
+		printk("\n[ERROR] in %s : cannot create thread\n", __FUNCTION__ );
+        return ENOMEM;
+    }
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / start_func unmapped %x\n",
-__FUNCTION__, process->pid, parent->trdid, (intptr_t)start_func );
-#endif
-        parent->errno = EINVAL;
-	    return -1;
-	}
+    // returns trdid to user space 
+    trdid = hal_remote_lw( XPTR( attr.cxy , &child->trdid ) );   
+	hal_copy_to_uspace( new_thread , &trdid , sizeof(pthread_t) );
+    
+    // register new-thread in parent-thread children list if required
+    if( attr.flags & PT_FLAG_DETACH == 0 ) thread_child_parent_link( xp_parent , xp_child );
 
-	// check start_args buffer in user space
-	if( start_args != NULL )
-    {
-        if( vmm_get_vseg( process , (intptr_t)start_args , &vseg ) )
-	    {
+	tm_end = hal_time_stamp();
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / start_args buffer unmapped %x\n",
-__FUNCTION__, process->pid, parent->trdid, (intptr_t)start_args );
-#endif
-		    parent->errno = EINVAL;
-		    return -1;
-        }
-	}
-
-    // define attributes and child_cxy
-    if( user_attr != NULL )                      // user defined attributes
-    {
-	    // check / get child_cxy
-	    if( kern_attr.attributes & PT_ATTR_CLUSTER_DEFINED )
-	    {
-		    if( cluster_is_active( kern_attr.cxy ) == false )
-		    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal target cluster %x\n",
-__FUNCTION__, process->pid, parent->trdid, kern_attr.cxy );
-#endif
-			    parent->errno = EINVAL;
-			    return -1;
-            }
-            child_cxy = kern_attr.cxy;
-		}
-        else
-        {
-            child_cxy = dqdt_get_cluster_for_thread( LOCAL_CLUSTER->dqdt_root_xp );
-        }
-	}
-	else                                        // set default attributes
-	{
-        kern_attr.attributes = PT_ATTR_CLUSTER_DEFINED;
-        child_cxy = dqdt_get_cluster_for_thread( LOCAL_CLUSTER->dqdt_root_xp );
-	}
-
-	// create the thread, using a RPC if required
-	// this returns "error", "child_ptr", and "child_xp"
-
-	if( child_cxy == local_cxy )                         // target cluster is local
-	{
-		// create thread in local cluster
-		error = thread_user_create( process->pid,
-		                            start_func,
-		                            start_args,
-		                            &kern_attr,
-		                            &child_ptr );
-
-		child_xp = XPTR( local_cxy , child_ptr );
-	}
-	else                                                 // target cluster is remote
-	{
-		rpc_thread_user_create_client( child_cxy,
-		                               process->pid,
-		                               start_func,
-		                               start_args,
-		                               &kern_attr,
-		                               &child_xp,
-		                               &error );
-
-		child_ptr = (thread_t *)GET_PTR( child_xp );
-	}
-
-	// check successful thread creation
-	if( error )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : thread[%x,%x] cannot create new thread\n",
-__FUNCTION__ , process->pid, parent->trdid );
-#endif
-		parent->errno = ENOMEM;
-		return -1;
-	}
-
-	// returns trdid to user space
-	trdid = hal_remote_l32( XPTR( child_cxy , &child_ptr->trdid ) );
-	hal_copy_to_uspace( trdid_ptr,
-                        XPTR( local_cxy , &trdid ),
-                        sizeof(pthread_t) );
-
-    // activate new thread
-	thread_unblock( child_xp , THREAD_BLOCKED_GLOBAL );
-
-    hal_fence();
-
-#if (DEBUG_SYS_THREAD_CREATE || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_THREAD_CREATE
-if( DEBUG_SYS_THREAD_CREATE < tm_end )
-printk("\n[%s] thread[%x,%x] created thread %x / cycle %d\n",
-__FUNCTION__, process->pid, parent->trdid, child_ptr->trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_THREAD_CREATE] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_THREAD_CREATE] , 1 );
-#endif
-
+	thread_dmsg("\n[INFO] %s created thread %x for process %x in cluster %x\n"
+                "  start_cycle = %d / end_cycle = %d\n",
+                   trdid , process->pid , attr.cxy , tm_start , tm_end );
 	return 0;
 
 }  // end sys_thread_create()
 
+
Index: trunk/kernel/syscalls/sys_thread_detach.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_detach.c	(revision 690)
+++ trunk/kernel/syscalls/sys_thread_detach.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_thread_detach.c - detach a joinable thread
+ * kern/sys_thread_detach.c - detach a joinable thread
  * 
- * Authors   Alain Greiner (2016,2017,2018,2019)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c)  UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,70 +17,69 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <hal_special.h>
+#include <list.h>
 #include <thread.h>
+#include <kmem.h>
+#include <kmagics.h>
 #include <errno.h>
-#include <printk.h>
+#include <task.h>
+#include <spinlock.h>
 
-#include <syscalls.h>
+int sys_thread_detach (pthread_t tid)
+{
+	register struct task_s *task;
+	struct thread_s *target_th;
+	uint_t state;
+	error_t err;
 
-//////////////////////////////////////
-int sys_thread_detach( trdid_t trdid )
-{
-    xptr_t       target_xp;
-	thread_t   * target_ptr;
-    cxy_t        target_cxy;
-    ltid_t       target_ltid;
-    uint32_t     flags;
+	task = current_task;
 
-	thread_t   * this    = CURRENT_THREAD;
-    process_t  * process = this->process;
+	if(tid > task->max_order)
+	{
+		err = EINVAL;
+		goto fail_arg;
+	}
+ 
+	spinlock_lock(&task->th_lock);
 
-    // get target thread ltid and cxy
-    target_ltid = LTID_FROM_TRDID( trdid );
-    target_cxy  = CXY_FROM_TRDID( trdid );
+	target_th = task->th_tbl[tid];
+   
+	if((target_th == NULL)                 ||
+	   (target_th->signature != THREAD_ID) || 
+	   (target_th->info.attr.key != tid))
+	{
+		err = ESRCH;
+		goto fail_srch;
+	}
+  
+	if(!(thread_isJoinable(target_th)))
+	{
+		err = EINVAL;
+		goto fail_not_joinable;
+	}
+  
+	err = 0;
 
-    // check trdid argument
-	if( (target_ltid >= CONFIG_THREADS_MAX_PER_CLUSTER) ||
-        (cluster_is_active( target_cxy ) == false) )  
+	spinlock_lock(&target_th->lock);
+
+	thread_clear_joinable(target_th);
+
+	if((target_th->info.join == NULL) && 
+	   !(state = wait_queue_isEmpty(&target_th->info.wait_queue)))
 	{
-        printk("\n[ERROR] in %s : illegal trdid argument\n", __FUNCTION__ );
-		this->errno = EINVAL;
-		return -1;
+		wakeup_one(&target_th->info.wait_queue, WAIT_ANY);
 	}
 
-    // get extended pointer on target thread
-	target_xp  = thread_get_xptr( process->pid , trdid );
+	spinlock_unlock(&target_th->lock);
+  
+fail_not_joinable:
+fail_srch:
+	spinlock_unlock(&task->lock);
 
-    if( target_xp == XPTR_NULL )
-    {
-        printk("\n[ERROR] in %s : target thread not found\n", __FUNCTION__ );
-        this->errno = ESRCH;
-        return -1;
-    }
-
-    // get local pointer on target thread
-    target_ptr = (thread_t *)GET_PTR( target_xp );
-
-    // get target thread flags
-    flags = hal_remote_l32( XPTR( target_cxy , &target_ptr->flags ) );
-
-    // check target thread joinable
-    if( flags & THREAD_FLAG_DETACHED )
-    {
-        printk("\n[ERROR] in %s : target thread not joinable\n", __FUNCTION__ );
-        this->errno = EINVAL; 
-        return -1;
-    }
-
-    // atomically set the thread DETACHED flag
-    hal_remote_atomic_or( XPTR( target_cxy , &target_ptr->flags ) , THREAD_FLAG_DETACHED );
-
-	return 0;
-
-}  // end sys_thread_detach()
+fail_arg:
+	current_thread->info.errno = err;
+	return err;
+}
Index: trunk/kernel/syscalls/sys_thread_exit.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_exit.c	(revision 690)
+++ trunk/kernel/syscalls/sys_thread_exit.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_thread_exit.c - terminates the execution of calling thread
+ * kern/sys_thread_exit.c - terminates the execution of current thread
  * 
- * Authors   Alain Greiner (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,102 +17,77 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_irqmask.h>
+#include <list.h>
 #include <thread.h>
+#include <scheduler.h>
+#include <wait_queue.h>
+#include <cluster.h>
+#include <dqdt.h>
 #include <process.h>
-#include <core.h>
-#include <vmm.h>
-#include <scheduler.h>
-#include <printk.h>
 
-#include <syscalls.h>
+///////////////////////////////////////
+int sys_thread_exit ( void * exit_val )
+{
+	thread_t * this = current_thread;
+    cpu_t    * cpu  = current_cpu;
+	uint32_t   state;
+	bool_t     isEmpty;
+	bool_t     isReleased;
 
-/////////////////////////////////////////
-int sys_thread_exit( void * exit_status )
-{
-    error_t     error;
-    vseg_t    * vseg;
+	/* TODO: the cpu->lid must match the core index in the logical cluster */
+	if(this->process->pid != 1)
+		dqdt_update_threads_number( local_cxy , cpu->lid , -1 );
 
-	thread_t  * this      = CURRENT_THREAD;
-    trdid_t     trdid     = this->trdid;
-    process_t * process   = this->process;
-    pid_t       pid       = process->pid;
-    
-#if DEBUG_SYS_THREAD_EXIT || DEBUG_SYSCALLS_ERROR 
-uint64_t     tm_start = hal_get_cycles();
-#endif
+	spinlock_lock( &this->lock );
 
-    // check exit_value pointer in user space if required
-    if( exit_status != NULL )
-    {
-        error = vmm_get_vseg( process , (intptr_t)exit_status  , &vseg );
+	if(!(thread_isJoinable(this)))
+	{
+		spinlock_unlock_nosched(&this->lock);
+		goto exit_dead;
+	}
 
-    	if( error )
-	    {
+	// Check if there's a thread waiting the end of callee thread
+	isEmpty = wait_queue_isEmpty(&this->info.wait_queue);
 
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[WARNING] in %s : exit_status buffer %x unmapped / thread[%x,%x]\n",
-__FUNCTION__, (intptr_t)exit_status, pid, trdid );
-#endif
-            this->errno = EINVAL;
-	        return -1;
-        }
-    }
+	if(isEmpty)
+	{
+		this->info.exit_value = exit_val;
+		wait_on(&this->info.wait_queue, WAIT_ANY);
+		spinlock_unlock_nosched(&this->lock);
+		sched_sleep(this);
+	}
+	else
+	{
+		this->info.join->info.exit_value = exit_val;
+		wakeup_one(&this->info.wait_queue, WAIT_ANY);
+		spinlock_unlock_nosched(&this->lock);
+	}
 
-	// check busylocks
-    uint32_t count = this->busylocks;
-	if( count )
+exit_dead:
+
+	isReleased = false;
+
+	// Release FPU if required
+	cpu_disable_all_irq(&state);
+	if(current_cpu->fpu_owner == this)
 	{
+		current_cpu->fpu_owner = NULL;
+		isReleased = true;
+	}
+	cpu_restore_irq(state);
 
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start ) 
-printk("\n[WARNING] in %s : busylocks count = %d  / thread[%x,%x]\n",
-__FUNCTION__ , count, pid, trdid );
-#endif
-            this->errno = EINVAL;
-	        return -1;
-    }
+	if(isReleased)
+	{
+		thread_dmsg(1, "INFO: Thread %x has released FPU on CPU %d\n",
+		       this, 
+		       current_cpu->gid);
+	}
 
-    // If calling thread is the main thread, the process must be deleted. 
-    // => delete all process threads and synchronize with parent process.
-    // If calling thread is not the main thread, only this thread must be deleted.
-    // => register exit_status in thread descriptor, block the thread, 
-    //    mark it for delete, and synchronize with joining thread. 
+	sched_exit(this);
 
-    if( (CXY_FROM_PID( pid ) == local_cxy) && (LTID_FROM_TRDID(trdid) == 0) )  // main
-    {
-
-#if DEBUG_SYS_THREAD_EXIT
-if( DEBUG_SYS_THREAD_EXIT < (uint32_t)tm_start ) 
-printk("\n[%s] thread[%x,%x] is main => delete process / cycle %d\n",
-__FUNCTION__ , pid , trdid , (uint32_t)tm_start );
-#endif
-        // delete process
-        sys_exit( 0 );
-    }
-    else                                                             // not the main
-    {
-
-#if DEBUG_SYS_THREAD_EXIT
-if( DEBUG_SYS_THREAD_EXIT < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] is not main => delete thread / cycle %d\n",
-__FUNCTION__ , pid , trdid , (uint32_t)tm_start );
-#endif
-        // register exit_status in thread descriptor
-        this->exit_status = exit_status;
-
-        // block calling thread and mark it for delete,
-        thread_delete_request( XPTR( local_cxy , this ) , false );   // not forced
-
-        // deschedule
-        sched_yield( "suicide after thread_exit" );
-    }
-
-    return 0;   // never executed but required by compiler
-
-}  // end sys_thread exit
+	PANIC ("Thread %x, CPU %d must never return", this, current_cpu->gid);
+	return -1;		/* Fake return ! */
+}
Index: trunk/kernel/syscalls/sys_thread_getattr.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_getattr.c	(revision 1)
+++ trunk/kernel/syscalls/sys_thread_getattr.c	(revision 1)
@@ -0,0 +1,54 @@
+/*
+ * kern/sys_thread_getattr.c - gets current thread's attributes
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <types.h>
+#include <errno.h>
+#include <cpu.h>
+#include <cluster.h>
+#include <thread.h>
+
+int sys_thread_getattr(pthread_attr_t *attr)
+{
+	struct thread_s *this;
+	struct cpu_s *cpu;
+	error_t err;
+
+	this = current_thread;
+	cpu  = current_cpu;
+	
+	if(NOT_IN_USPACE((uint_t)attr))
+	{
+		err = EPERM;
+		goto fail_attr;
+	}
+
+	this->info.attr.cid     = cpu->cluster->id;
+	this->info.attr.cpu_lid = cpu->lid;
+	this->info.attr.cpu_gid = cpu->gid;
+  
+	err = cpu_copy_to_uspace(attr, &this->info.attr,
+				 sizeof(pthread_attr_t));
+
+fail_attr:
+	this->info.errno = err;
+	return err;
+}
Index: trunk/kernel/syscalls/sys_thread_join.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_join.c	(revision 690)
+++ trunk/kernel/syscalls/sys_thread_join.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_thread_join.c - wait termination of of an attached thread.
+ * kern/sys_thread_join.c - passive wait on the end of a given thread
  * 
- * Authors    Alain Greiner (2016,2017,2018,2019)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,208 +17,113 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_remote.h>
-#include <hal_special.h>
-#include <hal_irqmask.h>
-#include <hal_uspace.h>
+#include <list.h>
 #include <thread.h>
-#include <vmm.h>
 #include <scheduler.h>
+#include <kmem.h>
 #include <errno.h>
-#include <printk.h>
-#include <remote_busylock.h>
+#include <task.h>
+#include <spinlock.h>
 
-#include <syscalls.h>
+int sys_thread_join (pthread_t tid, void **thread_return)
+{
+	register struct task_s *task;
+	register struct thread_s *this;
+	register struct thread_s *target_th;
+	register uint_t state = 0;
+	void *retval;
+	int err;
 
-///////////////////////////////////////
-int sys_thread_join ( trdid_t    trdid,
-                      void    ** exit_status )
-{
-    error_t       error;
-    reg_t         save_sr;
-    xptr_t        target_xp;
-    thread_t    * target_ptr;
-    cxy_t         target_cxy;
-    ltid_t        target_ltid;
-    xptr_t        target_join_lock_xp;
-    xptr_t        target_flags_xp;
-    xptr_t        target_join_xp_xp;
-    xptr_t        target_exit_status_xp;
-    xptr_t        killer_xp;
-    xptr_t        joining_xp;
-    thread_t    * joining_ptr;
-    process_t   * process;
-    vseg_t      * vseg;
-    void        * status;
+	this   = current_thread;
+	task   = this->task;
+	retval = 0;
 
-    // get joining thread pointers
-	joining_ptr = CURRENT_THREAD;
-    joining_xp  = XPTR( local_cxy , joining_ptr );
-    process     = joining_ptr->process;
-
-    // get target thread ltid and cxy
-    target_ltid = LTID_FROM_TRDID( trdid );
-    target_cxy  = CXY_FROM_TRDID( trdid );
-
-#if DEBUG_SYS_THREAD_JOIN
-uint64_t  tm_start = hal_get_cycles();
-if( DEBUG_SYS_THREAD_JOIN < tm_start )
-printk("\n[%s] joining thread[%x,%x] enter / target thread[%x,%x] / cycle %d\n",
-__FUNCTION__ , process->pid, joining_ptr->trdid,
-process->pid, trdid, (uint32_t)tm_start );
-#endif
-
-    // check trdid argument
-	if( (target_ltid >= CONFIG_THREADS_MAX_PER_CLUSTER) || 
-        (cluster_is_active(target_cxy) == false) )
+	if((tid > task->max_order) || 
+	   ((thread_return != NULL) && 
+	    (NOT_IN_USPACE((uint_t)thread_return + sizeof(void*)))))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : illegal trdid argument %x / joining thread[%x,%x]\n",
-__FUNCTION__, trdid, joining_ptr->process->pid, joining_ptr-trdid );
-#endif
-		joining_ptr->errno = EINVAL;
-		return -1;
+		err = EINVAL;
+		goto fail_arg;
 	}
 
-    // check exit_value argument in user space
-    error = vmm_get_vseg( process , (intptr_t)exit_status  , &vseg );
-	if( error )
+	/* try to write to userland address */
+	if(thread_return)
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : exit_status argument %x not mapped / joining thread[%x,%x]\n",
-__FUNCTION__, exit_status, joining_ptr->process->pid, joining_ptr-trdid );
-#endif
-		joining_ptr->errno = EINVAL;
-		return -1;
+		if((err = cpu_copy_to_uspace(thread_return, &retval, sizeof(void *)))) 
+			goto fail_uspace_ret;
 	}
 
-    // check target thread != this thread
-    if( joining_ptr->trdid == trdid )
-    {
+	spinlock_lock(&task->th_lock);
+	target_th = task->th_tbl[tid];
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : joinig thread[%x,%x] == target thread\n",
-__FUNCTION__, joining_ptr->process->pid, joining_ptr->trdid );
-#endif
-        joining_ptr->errno = EDEADLK;
-        return -1;
-    }
+	if((target_th == NULL)                 ||
+	   (target_th->signature != THREAD_ID) || 
+	   (target_th->info.attr.key != tid))
+	{
+		err = ESRCH;
+		goto fail_srch;
+	}
 
-    // get pointers on target thread
-	target_xp  = thread_get_xptr( process->pid , trdid );
-    target_ptr = GET_PTR( target_xp );
+	if(target_th == this)
+	{
+		err = EDEADLK;
+		goto fail_deadlock;
+	}
 
-    if( target_xp == XPTR_NULL )
-    {
+	if(!(thread_isJoinable(target_th)))
+	{
+		err = EINVAL;
+		goto fail_joinable;
+	}
+   
+	spinlock_lock(&target_th->lock);
+   
+	if(target_th->info.join != NULL)
+	{
+		spinlock_unlock(&target_th->lock);
+		err = EINVAL;
+		goto fail_joined;
+	}
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : target thread[%x,%x] not found / joining_thread[%x,%x]\n",
-__FUNCTION__, process->pid, trdid, joining_ptr->process->pid, joining_ptr-trdid );
-#endif
-        joining_ptr->errno = ESRCH;
-        return -1;
-    }
+	// Get the exit code of the target thread
+	if ((state=wait_queue_isEmpty(&target_th->info.wait_queue)))
+	{
+		target_th->info.join = this;
+		wait_on(&target_th->info.wait_queue, WAIT_ANY);
+		spinlock_unlock(&target_th->lock);
+		spinlock_unlock_nosched(&task->th_lock);
+		sched_sleep(this);
+		retval = this->info.exit_value;
+	}
+	else
+	{
+		retval = target_th->info.exit_value;
+		wakeup_one(&target_th->info.wait_queue, WAIT_ANY);
+		spinlock_unlock(&target_th->lock);
+		spinlock_unlock(&task->th_lock);
+	}
 
-    // get extended pointers on various fields in target thread
-    target_join_lock_xp   = XPTR( target_cxy , &target_ptr->join_lock );
-    target_flags_xp       = XPTR( target_cxy , &target_ptr->flags );
-    target_join_xp_xp     = XPTR( target_cxy , &target_ptr->join_xp );
-    target_exit_status_xp = XPTR( target_cxy , &target_ptr->exit_status );
+	/* Probably will not fail */
+	if(thread_return)
+	{
+		if((err = cpu_copy_to_uspace(thread_return, &retval, sizeof(void *)))) 
+			goto fail_uspace;
+	}
 
-    // check target thread joinable
-    if( (hal_remote_l32( target_flags_xp ) & THREAD_FLAG_DETACHED) != 0 )
-    {
+	return 0;
 
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : target thread[%x,‰x] not attached / joining thread[%x,%x]\n",
-__FUNCTION__, process->pid, trdid, joining_ptr->process->pid, joining_ptr-trdid );
-#endif
-        joining_ptr->errno = EINVAL; 
-        return -1;
-    }
+fail_joined:
+fail_joinable:
+fail_deadlock:
+fail_srch:
+	spinlock_unlock(&task->th_lock); 
 
-    // mask IRQs
-    hal_disable_irq( &save_sr );
-
-    // get the lock protecting the join in target thread
-    remote_busylock_acquire( target_join_lock_xp );
-
-    // test the kill_done flag from the target thread
-    if( hal_remote_l32( target_flags_xp ) & THREAD_FLAG_KILL_DONE )  // killer is first
-    {
-        // get exit_status from target thread
-        status = (void*)hal_remote_lpt( target_exit_status_xp );
-
-        // get pointers on killer thread
-        killer_xp  = (xptr_t)hal_remote_l64( target_join_xp_xp );
-
-        // reset the kill_done flag in target thread
-        hal_remote_atomic_and( target_flags_xp , ~THREAD_FLAG_KILL_DONE );
-
-        // unblock the killer thread
-        thread_unblock( killer_xp , THREAD_BLOCKED_JOIN );
-
-        // release the lock protecting join      
-        remote_busylock_release( target_join_lock_xp );
-    }
-    else                                                          // joining is first
-    {
-        // set the join_done flag in target thread
-        hal_remote_atomic_or( target_flags_xp , THREAD_FLAG_JOIN_DONE );
-
-        // block joining thread on BLOCKED_JOIN
-        thread_block( joining_xp , THREAD_BLOCKED_JOIN );
-
-        // register the joining thread extended pointer in target thread
-        hal_remote_s64( target_join_xp_xp , joining_xp );
-
-        // release the lock protecting the join      
-        remote_busylock_release( target_join_lock_xp );
-
-#if DEBUG_SYS_THREAD_JOIN 
-if( DEBUG_SYS_THREAD_JOIN < tm_start )
-printk("\n[%s] joining thread[%x,%x] deschedules / target thread[%x,%x] not completed\n",
-__FUNCTION__ , process->pid, joining_ptr->trdid, process->pid, trdid );
-#endif
-        // deschedule
-        sched_yield( "joining thread waiting killer thread" );
-
-        // returns exit_status from joining thread
-        status = joining_ptr->exit_status;
-    }
-    
-    // returns exit_status to user space
-    hal_copy_to_uspace( exit_status,
-                        XPTR( local_cxy , &status ),
-                        sizeof( void* ) );
-
-    // restore IRQs
-    hal_restore_irq( save_sr );
-
-    hal_fence();
-
-#if (DEBUG_SYS_THREAD_JOIN || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_THREAD_JOIN] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_THREAD_JOIN] , 1 );
-#endif
-
-#if DEBUG_SYS_THREAD_JOIN 
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_THREAD_JOIN < tm_end )
-printk("\n[%s] joining thread[%x,%x] exit / target thread[%x,%x] completed / cycle %d\n",
-__FUNCTION__ , process->pid, joining_ptr->trdid, process->pid, trdid, (uint32_t)tm_end );
-#endif
-
-    return 0;
-
-}  // end sys_thread_join()
+fail_uspace:
+fail_uspace_ret:
+fail_arg:
+	this->info.errno = err;
+	return err;
+}
Index: trunk/kernel/syscalls/sys_thread_sleep.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_sleep.c	(revision 690)
+++ trunk/kernel/syscalls/sys_thread_sleep.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_thread_sleep.c - block the calling thread on SLEEP, with or without alarm
+ * kern/sys_thread_sleep.c - puts the current thread in sleep state
  * 
- * Author    Alain Greiner    (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,86 +17,41 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_special.h>
 #include <scheduler.h>
 #include <thread.h>
-#include <printk.h>
-#include <syscalls.h>
+#include <task.h>
 
-///////////////////////////////////////////////////////////////////////////////////////
-// This static function implements the alarm handler used to wake-up a thread
-// when the amarm rings after after a sleep( seconds ) syscall.
-///////////////////////////////////////////////////////////////////////////////////////
-// @ thread_xp  : extended pointer on blocked thread.
-///////////////////////////////////////////////////////////////////////////////////////
-static void __attribute__((noinline)) sleep_alarm_handler( xptr_t thread_xp )
+int sys_thread_sleep()
 {
-    // stop the alarm
-    alarm_stop( thread_xp );
+	struct thread_s *this;
 
-    // unblock the thread
-    thread_unblock( thread_xp , THREAD_BLOCKED_SLEEP );
+	this = current_thread;
 
-}  // end sleep_alarm_handler()
+	if(this->info.isTraced == true)
+	{
+		printk(INFO, "%s: cpu %d, pid %d, tid %d, asked to go sleep [%d]\n", 
+		       __FUNCTION__,
+		       cpu_get_id(),
+		       this->task->pid,
+		       this->info.order,
+		       cpu_time_stamp());
+	}
 
-////////////////////////////////////////
-int sys_thread_sleep( uint32_t seconds )
-{
-    cycle_t    ncycles;    // number of cycles to sleep
-
-    thread_t  * this      = CURRENT_THREAD;
-    xptr_t      thread_xp = XPTR( local_cxy , this );
-
-    cycle_t     tm_start = hal_get_cycles();
-
-#if DEBUG_SYS_THREAD_SLEEP
-if( DEBUG_SYS_THREAD_SLEEP < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, (uint32_t)tm_start );
-#endif
-
-    if( seconds == 0 )   // sleep without alarm
-    {
- 
-#if DEBUG_SYS_THREAD_SLEEP
-if( DEBUG_SYS_THREAD_SLEEP < tm_start )
-printk("\n[%s] thread[%x,%x] blocks on <SLEEP> without alarm / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, (uint32_t)tm_start );
-#endif
-        // threads blocks and deschedules
-        thread_block( thread_xp , THREAD_BLOCKED_SLEEP );
-        sched_yield("sleep without alarm");
-    }
-    else                // sleep with alarm
-    {
-        // translate seconds to ncycles
-        ncycles = seconds * LOCAL_CLUSTER->sys_clk;
-
-        // register & start the calling thread alarm
-        alarm_start( thread_xp,
-                     tm_start + ncycles,
-                     &sleep_alarm_handler,
-                     thread_xp );
+	thread_set_cap_wakeup(this);
+	sched_sleep(this);
   
-#if DEBUG_SYS_THREAD_SLEEP
-if( DEBUG_SYS_THREAD_SLEEP < tm_start )
-printk("\n[DBG] %s : thread[%x,%x] blocks on <SLEEP> for %d seconds / cycle %d\n",
-__FUNCTION__ , this->process->pid,  this->trdid, seconds, (uint32_t)tm_start );
-#endif
-        // thread blocks & deschedules 
-        thread_block( thread_xp , THREAD_BLOCKED_SLEEP );
-        sched_yield("sleep with alarm");
-    }
-
-#if DEBUG_SYS_THREAD_SLEEP
-if( DEBUG_SYS_THREAD_SLEEP < tm_end )
-printk("\n[%s] thread[%x,%x] resume / cycle %d\n",
-__FUNCTION__ , this->process->pid, this->trdid, (uint32_t)tm_end );
-#endif
+	if(this->info.isTraced == true)
+	{
+		printk(INFO, "%s: cpu %d, pid %d, tid %d, resuming [%d]\n",
+		       __FUNCTION__,
+		       cpu_get_id(),
+		       this->task->pid,
+		       this->info.order,
+		       cpu_time_stamp());
+	} 
 
 	return 0;
-
-}  // end sys_thread_sleep()
+}
Index: trunk/kernel/syscalls/sys_thread_wakeup.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_wakeup.c	(revision 690)
+++ trunk/kernel/syscalls/sys_thread_wakeup.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_thread_wakeup.c - unblock indicated thread from the SLEEP condition
+ * kern/sys_thread_wakeup.c - wakeup all indicated threads
  * 
- * Author    Alain Greiner     (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,94 +17,115 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
+#include <errno.h>
+#include <kmagics.h>
+#include <cpu.h>
+#include <kdmsg.h>
+#include <cluster.h>
+#include <task.h>
+#include <scheduler.h>
 #include <thread.h>
-#include <printk.h>
-#include <process.h>
-#include <errno.h>
-#include <syscalls.h>
 
-//////////////////////////////////////
-int sys_thread_wakeup( trdid_t trdid )
+/* 
+ * FIXME: define spinlock_rdlock() so all locking on task->th_lock 
+ * becoms rdlock but on join/detach/destroy 
+ */
+int sys_thread_wakeup(pthread_t tid, pthread_t *tid_tbl, uint_t count)
 {
-	thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
+	struct task_s *task;
+	struct thread_s *this;
+	struct thread_s *target;
+	pthread_t tbl[100];
+	void *listner;
+	uint_t event;
+	sint_t i;
+	error_t err;
 
-#if DEBUG_SYS_THREAD_WAKEUP || DEBUG_SYSCALLS_ERROR || CONFIG_INTRUMENTATION_SYSCALLS
-cycle_t      tm_start = hal_get_cycles();
-#endif
+	this = current_thread;
+	task = this->task;
+	i = -1;
 
-#if DEBUG_SYS_THREAD_WAKEUP
-if( DEBUG_SYS_THREAD_WAKEUP < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter to activate thread %x / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, trdid, (uint32_t)tm_start );
-#endif
+	if(tid_tbl != NULL)
+	{
+		if((NOT_IN_USPACE((uint_t)tid_tbl + (count*sizeof(pthread_t)))) || 
+		   (count == 0) || (count > 100))
+		{
+			err = -1;
+			goto fail_tid_tbl;
+		}
 
-    // get target thread ltid and cxy
-    ltid_t   target_ltid = LTID_FROM_TRDID( trdid );
-    cxy_t    target_cxy  = CXY_FROM_TRDID( trdid );
+		if((err = cpu_copy_from_uspace(&tbl[0], tid_tbl, sizeof(pthread_t*) * count))) 
+			goto fail_usapce;
 
-    // check trdid argument
-	if( (target_ltid >= CONFIG_THREADS_MAX_PER_CLUSTER) ||
-        (cluster_is_active( target_cxy ) == false) )  
+		if(tbl[0] != tid)
+		{
+			err = -2;
+			goto fail_first_tid;
+		}
+	}
+	else
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal trdid argument %x\n",
-__FUNCTION__, process->pid, this->trdid, trdid );
-#endif
-		this->errno = EINVAL;
-		return -1;
+		count = 1;
+		tbl[0] = tid;
 	}
 
-    // get extended pointer on target thread
-    xptr_t thread_xp = thread_get_xptr( process->pid , trdid );
+	for(i = 0; i < count; i++)
+	{
+		tid = tbl[i];
 
-    if( thread_xp == XPTR_NULL )
-    {
+		if(tid > task->max_order)
+		{
+			err = -3;
+			goto fail_tid;
+		}
 
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / cannot find thread[%x,%x]\n",
-__FUNCTION__, process->pid, this->trdid, process->pid, trdid );
-#endif
-        CURRENT_THREAD->errno = EINVAL;
-        return -1;
-    }
+		target = task->th_tbl[tid];
+   
+		if((target == NULL) || (target->signature != THREAD_ID))
+		{
+			err = -4;
+			goto fail_target;
+		}
 
-    // get target thread cluster and local pointer
-    thread_t * tgt_ptr = GET_PTR( thread_xp );
-    cxy_t      tgt_cxy = GET_CXY( thread_xp );
+		listner = sched_get_listner(target, SCHED_OP_UWAKEUP);
+		event = sched_event_make(target,SCHED_OP_UWAKEUP);
+    
+		if(this->info.isTraced == true)
+		{
+			printk(INFO,"%s: tid %d --> tid %d [%d][%d]\n", 
+			       __FUNCTION__, 
+			       this->info.order, 
+			       tid, 
+			       cpu_time_stamp(),
+			       i);
+		}
 
-    // get state of the target thread alarm
-    bool_t linked = hal_remote_l32( XPTR( tgt_cxy , &tgt_ptr->alarm.linked ) );
+		sched_event_send(listner,event);
+		cpu_wbflush();
+	}
 
-    // delete the alarm if active
-    if( linked ) alarm_stop( thread_xp );
+	return 0;
 
-    // unblock target thread
-    thread_unblock( thread_xp , THREAD_BLOCKED_SLEEP );
+fail_target:
+fail_tid:
+fail_first_tid:
+fail_usapce:
+fail_tid_tbl:
 
-#if (DEBUG_SYS_THREAD_WAKEUP || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-
-#if DEBUG_SYS_THREAD_WAKEUP
-if( DEBUG_SYS_THREAD_WAKEUP < tm_end )
-printk("\n[%s] thread[%x,%x] exit / thread[%x,%x] activated / cycle %d\n",
-__FUNCTION__ , process->pid, this->trdid, process->pid, trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_THREAD_WAKEUP] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_THREAD_WAKEUP] , 1 );
-#endif
-
-    return 0;
-
-}  // end sys_thread_wakeup()
+	printk(INFO, "%s: cpu %d, pid %d, tid %x, i %d, count %d, ttid %x, request has failed with err %d [%d]\n",
+	       __FUNCTION__,
+	       cpu_get_id(),
+	       task->pid,
+	       this,
+	       i,
+	       count,
+	       tid,
+	       err,
+	       cpu_time_stamp());
+  
+	this->info.errno = EINVAL;
+	return -1;
+}
Index: trunk/kernel/syscalls/sys_thread_yield.c
===================================================================
--- trunk/kernel/syscalls/sys_thread_yield.c	(revision 690)
+++ trunk/kernel/syscalls/sys_thread_yield.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_thread_yield.c - calls the scheduler to yield 
+ * kern/sys_thread_yield.c - calls the scheduler to yield current CPU
  * 
- * Authors       Alain Greiner (2016,2017)
- *
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
  * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * This file is part of ALMOS-MKH.
+ * This file is part of ALMOS-kernel.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,37 +17,13 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
-#include <hal_special.h>
+#include <thread.h>
 #include <scheduler.h>
-#include <thread.h>
 
-#include <syscalls.h>
-
-int sys_thread_yield( void )
+int sys_thread_yield()
 {
- 
-#if DEBUG_SYS_THREAD_YIELD
-uint64_t     tm_start;
-uint64_t     tm_end;
-tm_start = hal_get_cycles();
-if( DEBUG_SYS_THREAD_YIELD < tm_start )
-printk("\n[DBG] %s : thread %x in process %x deschedule / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, (uint32_t)tm_start );
-#endif
-
-    // deschedule
-	sched_yield("user request"); 
-
-#if DEBUG_SYS_THREAD_YIELD
-tm_end = hal_get_cycles();
-if( DEBUG_SYS_THREAD_YIELD < tm_start )
-printk("\n[DBG] %s : thread %x in process %x resume / cycle %d\n",
-__FUNCTION__, CURRENT_THREAD->trdid, CURRENT_THREAD->process->pid, (uint32_t)tm_end );
-#endif
-
-	return 0;
+	return sched_yield(current_thread); 
 }
Index: trunk/kernel/syscalls/sys_timeofday.c
===================================================================
--- trunk/kernel/syscalls/sys_timeofday.c	(revision 690)
+++ 	(revision )
@@ -1,118 +1,0 @@
-/*
- * sys_timeofday.c - Get current time
- *
- * Author    Alain Greiner      (2016,2017,2018,2019,2020) 
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_vmm.h>
-#include <thread.h>
-#include <printk.h>
-#include <errno.h>
-#include <process.h>
-#include <vmm.h>
-#include <core.h>
-#include <shared_syscalls.h>
-#include <syscalls.h>
-
-////////////////////////////////////////
-int sys_timeofday( struct timeval  * tv,
-                   struct timezone * tz )
-{
-	error_t        error;
-    vseg_t       * vseg;
-
-	uint32_t       tm_s;
-    uint32_t       tm_us;
-
-	struct timeval k_tv;
-
-	thread_t  *    this    = CURRENT_THREAD;
-	process_t *    process = this->process;
-
-#if DEBUG_SYS_TIMEOFDAY || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_TIMEOFDAY
-if( DEBUG_SYS_TIMEOFDAY < (uint32_t)tm_start )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_start );
-#endif
- 
-    // check tz (non supported / must be null)
-    if( tz )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / tz argument must be NULL\n",
-__FUNCTION__ , this->trdid , process->pid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
- 
-    // check tv
-    error = vmm_get_vseg( process , (intptr_t)tv , &vseg );
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / user buffer tv unmapped\n",
-__FUNCTION__ , this->trdid , process->pid , (intptr_t)tz );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    // get time from calling core descriptor
-    core_get_time( this->core , &tm_s , &tm_us );
-	k_tv.tv_sec  = tm_s;
-	k_tv.tv_usec = tm_us;
-
-    // copy values to user space
-	hal_copy_to_uspace( tv,
-                        XPTR( local_cxy , &k_tv ),
-                        sizeof(struct timeval) );
-
-    hal_fence();
-
-#if (DEBUG_SYS_TIMEOFDAY || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_TIMEOFDAY
-if( DEBUG_SYS_TIMEOFDAY < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_TIMEOFDAY] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_TIMEOFDAY] , 1 );
-#endif
-
-	return 0; 
-
-}  // end sys_timeofday()
Index: trunk/kernel/syscalls/sys_times.c
===================================================================
--- trunk/kernel/syscalls/sys_times.c	(revision 1)
+++ trunk/kernel/syscalls/sys_times.c	(revision 1)
@@ -0,0 +1,58 @@
+/*
+ * times.c: thread sus/usr time
+ * 
+ * Copyright (c) 2015 UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-kernel.
+ *
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+
+#include <cpu.h>
+#include <thread.h>
+#include <time.h>
+
+int sys_times(struct tms *utms)
+{
+#ifdef CONFIG_THREAD_TIME_STAT
+	struct thread_s *this;
+	struct tms _tms;
+	error_t err;
+
+	if((utms == NULL) || NOT_IN_USPACE((uint_t)utms) || 
+		NOT_IN_USPACE((uint_t)utms+sizeof(struct tms)))
+	{
+		return EINVAL;
+	}
+
+	this = current_thread;
+
+	_tms.tms_utime = this->info.tm_usr;
+	_tms.tms_stime = this->info.tm_sys;
+	_tms.tms_cutime = 0;
+	_tms.tms_cstime = 0;
+	
+	err =  cpu_copy_to_uspace(utms, &_tms, sizeof(struct tms));
+
+	this->info.errno = err;
+	if(err)	return -1;
+	return 0; 
+#else
+	this->info.errno = ENOTSUPPORTED;
+	return -1;
+
+#endif
+}
Index: trunk/kernel/syscalls/sys_trace.c
===================================================================
--- trunk/kernel/syscalls/sys_trace.c	(revision 690)
+++ 	(revision )
@@ -1,107 +1,0 @@
-/*
- * sys_trace.c - activate / desactivate the context switches trace for a given core
- * 
- * Author    Alain Greiner (c) (2016,2017,2018,2019)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_special.h>
-#include <printk.h>
-#include <thread.h>
-#include <errno.h>
-#include <shared_syscalls.h>
-#include <syscalls.h>
-
-///////////////////////////////
-int sys_trace( bool_t   active,
-               cxy_t    cxy,
-               lid_t    lid )
-{
-    uint32_t    ncores;
-
-    thread_t  * this    = CURRENT_THREAD;
-
-#if DEBUG_SYS_TRACE || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-process_t * process  = this->process;
-uint64_t    tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_TRACE
-if( DEBUG_SYS_TRACE < tm_start )
-printk("\n[%s] thread[%x,%x] enters / cycle = %d\n",
-__FUNCTION__, this->process->pid, this->trdid, (uint32_t)tm_start );
-#endif
-
-    // check cluster identifier
-    if( cluster_is_active( cxy ) == false )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal cxy argument %x\n",
-__FUNCTION__ , this->trdid , process->pid , cxy );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    // check core local index
-    ncores = hal_remote_l32( XPTR( cxy , &LOCAL_CLUSTER->cores_nr ) );
-    if( lid >= ncores )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal lid argument %x\n",
-__FUNCTION__ , this->trdid , process->pid , lid );
-#endif
-        this->errno = EINVAL;
-        return -1;
-    }
-
-    // get local pointer on target core
-    core_t * core = &LOCAL_CLUSTER->core_tbl[lid];
-
-    // get extended pointer on target scheduler trace field
-    xptr_t trace_xp = XPTR( cxy , &core->scheduler.trace );
-
-    if ( active ) hal_remote_s32( trace_xp , 1 );
-    else          hal_remote_s32( trace_xp , 0 );
-    
-    hal_fence();
-
-#if (DEBUG_SYS_TRACE || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_TRACE
-if( DEBUG_SYS_TRACE < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, this->process->pid, this->trdid, (uint32_t)tm_end );
-#endif
-
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_TRACE] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_TRACE] , 1 );
-#endif
-
-    return 0;
-
-}  // end sys_trace()
Index: trunk/kernel/syscalls/sys_undefined.c
===================================================================
--- trunk/kernel/syscalls/sys_undefined.c	(revision 690)
+++ 	(revision )
@@ -1,39 +1,0 @@
-/*
- * sys_undefined.c - function executed for an undefined syscall.
- * 
- * Author    Alain Greiner (2016,2017)
- *
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <errno.h>
-#include <thread.h>
-#include <process.h>
-#include <printk.h>
-
-///////////////////
-int sys_undefined( void )
-{
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-
-    printk("\n[ERROR] in %s : undefined syscall calle by thread %x in process %x\n",
-           __FUNCTION__ , this->trdid , process->pid );
-    this->errno = EINVAL;
-    return -1;
-}
Index: trunk/kernel/syscalls/sys_unlink.c
===================================================================
--- trunk/kernel/syscalls/sys_unlink.c	(revision 690)
+++ trunk/kernel/syscalls/sys_unlink.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_unlink.c - unlink a file or directorya from VFS
- *
- * Author     Alain Greiner (2016,2017,2018,2019)
- *
- * Copyright (c)  UPMC Sorbonne Universites
+ * kern/sys_unlink.c - file unlink
+ * 
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
  * This file is part of ALMOS-kernel.
  *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,102 +17,25 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <errno.h>
 #include <vfs.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
 #include <thread.h>
-#include <printk.h>
 
-#include <syscalls.h>
+int sys_unlink (char *pathname)
+{
+	error_t err = 0;
+	struct ku_obj ku_path;
 
-//////////////////////////////////
-int sys_unlink ( char * pathname )
-{
-    error_t   error;
-    xptr_t    root_inode_xp;           // extended pointer on path root inode
-
-    char      kbuf[CONFIG_VFS_MAX_PATH_LENGTH];
-
-    thread_t     * this     = CURRENT_THREAD;
-    process_t    * process  = this->process;
-
-#if (DEBUG_SYS_UNLINK || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-    // check pathname length
-    if( hal_strlen_from_uspace( pathname ) >= CONFIG_VFS_MAX_PATH_LENGTH )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : pathname too long\n", __FUNCTION__ );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-    // copy pathname in kernel space
-    hal_strcpy_from_uspace( XPTR( local_cxy , kbuf ),
-                            pathname,
-                            CONFIG_VFS_MAX_PATH_LENGTH );
-
-#if DEBUG_SYS_UNLINK
-if( DEBUG_SYS_UNLINK < tm_start )
-printk("\n[%s] thread[%x,%x] enter for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_start );
-#endif
- 
-    // compute root inode for path 
-    if( kbuf[0] == '/' )                        // absolute path
-    {
-        // use extended pointer on VFS root inode
-        root_inode_xp = process->vfs_root_xp;
-    }
-    else                                        // relative path
-    {
-        // get cluster and local pointer on reference process
-        xptr_t      ref_xp  = process->ref_xp;
-        process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
-        cxy_t       ref_cxy = GET_CXY( ref_xp );
-
-        // use extended pointer on CWD inode
-        root_inode_xp = hal_remote_l64( XPTR( ref_cxy , &ref_ptr->cwd_xp ) );
-    }
-
-    // call the relevant VFS function
-    error  = vfs_unlink( root_inode_xp , kbuf );
-
-    if( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : cannot unlink file/dir %s\n", __FUNCTION__, kbuf );
-#endif
-        this->errno = ENFILE;
-        return -1;
-    }
-
-#if (DEBUG_SYS_UNLINK || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_UNLINK
-if( DEBUG_SYS_UNLINK < tm_end )
-printk("\n[%s] thread[%x,%x] exit for <%s> / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, kbuf, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_UNLINK] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_UNLINK] , 1 );
-#endif
-
-    return 0;
-
-} // end sys_unlink()
+	KU_BUFF(ku_path, pathname);
+	if((err = vfs_unlink(&current_task->vfs_cwd, &ku_path)))
+	{
+		current_thread->info.errno = (err < 0) ? -err : err;
+		return -1;
+	}
+  
+	return 0;
+}
Index: trunk/kernel/syscalls/sys_utls.c
===================================================================
--- trunk/kernel/syscalls/sys_utls.c	(revision 690)
+++ trunk/kernel/syscalls/sys_utls.c	(revision 1)
@@ -2,16 +2,14 @@
  * kern/sys_utls.c - User Thread Local Storage
  * 
- * Author    Ghassan Almaless (2008,2009,2010,2011,2012)
- *           Alain Greiner (2016,2017)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -19,37 +17,38 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <hal_kernel_types.h>
+#include <types.h>
 #include <errno.h>
 #include <thread.h>
-#include <printk.h>
-#include <syscalls.h>
+#include <kmem.h>
+#include <kmagics.h>
+#include <semaphore.h>
 
-/////////////////////////////////
-int sys_utls( uint32_t operation,
-              uint32_t value )
+#define UTLS_SET       1
+#define UTLS_GET       2
+#define UTLS_GET_ERRNO 3
+
+int sys_utls(uint_t operation, uint_t value)
 {
-    thread_t * this = CURRENT_THREAD;
+	struct thread_s *this = current_thread;
   
 	switch(operation)
 	{
-	    case UTLS_SET:
-		this->utls = value;
+	case UTLS_SET:
+		this->info.usr_tls = value;
 		return 0;
 
-	    case UTLS_GET:
-		return this->utls;
+	case UTLS_GET:
+		return this->info.usr_tls;
 
-	    case UTLS_GET_ERRNO:
-		return this->errno;
+	case UTLS_GET_ERRNO:
+		return this->info.errno;
 
-	    default:
-        printk("\n[ERROR] in %s : illegal utls operation\n", __FUNCTION__ );
-		this->errno = EINVAL;
+	default:
+		this->info.errno = EINVAL;
 		return -1;
 	}
-
-}  // end sys_utls()
+}
Index: trunk/kernel/syscalls/sys_vector.c
===================================================================
--- trunk/kernel/syscalls/sys_vector.c	(revision 1)
+++ trunk/kernel/syscalls/sys_vector.c	(revision 1)
@@ -0,0 +1,198 @@
+/*
+ * syscall.c - kernel unified syscall entry-point
+ * 
+ * Author Ghassan Almaless (2008,2009,2010,2011,2012)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH.is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH.is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH.; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <syscall.h>
+#include <errno.h>
+#include <time.h>
+#include <cpu.h>
+#include <dma.h>
+#include <thread.h>
+#include <process.h>
+#include <scheduler.h>
+#include <kmem.h>
+#include <kdmsg.h>
+#include <sys-vfs.h>
+#include <cpu-trace.h>
+#include <semaphore.h>
+#include <cond_var.h>
+#include <barrier.h>
+#include <rwlock.h>
+#include <vmm.h>
+#include <signal.h>
+#include <page.h>
+
+/////////////////////////////////
+static error_t sys_notAvailable()
+{
+	printk(WARNING, "WARNING: Undefined system call\n");
+	return ENOSYS;
+}
+
+//////////////////////////////////////////////////////////////////////////
+// Syscall vector definition
+//////////////////////////////////////////////////////////////////////////
+
+typedef int (*sys_func_t) ();
+
+static const sys_func_t sys_call_tbl[SYSCALLS_NR] = 
+{
+	sys_thread_exit,      // 0
+	sys_mmap,             // 1
+	sys_thread_create,    // 2
+	sys_thread_join,      // 3
+	sys_thread_detach,    // 4
+	sys_thread_yield,     // 5
+	sys_sem,              // 6
+	sys_cond_var,         // 7
+	sys_barrier,          // 8
+	sys_rwlock,           // 9
+	sys_thread_sleep,     // 10
+	sys_thread_wakeup,    // 11
+	sys_open,             // 12
+	sys_creat,            // 13
+	sys_read,             // 14
+	sys_write,            // 15
+	sys_lseek,            // 16
+	sys_close,            // 17
+	sys_unlink,           // 18
+	sys_pipe,             // 19
+	sys_chdir,            // 20
+	sys_mkdir,            // 21
+	sys_mkfifo,           // 22
+	sys_opendir,          // 23
+	sys_readdir,          // 24
+	sys_closedir,         // 25
+	sys_getcwd,           // 26
+	sys_clock,            // 27
+	sys_alarm,            // 28
+	sys_dma_memcpy,       // 29
+	sys_utls,             // 30
+	sys_notAvailable,	  // 31	 reserved for sigreturn TODO ??? [AG]
+	sys_signal,           // 32
+	sys_sigreturn_setup,  // 33
+	sys_kill,             // 34
+	sys_getpid,           // 35
+	sys_fork,             // 36
+	sys_exec,             // 37
+	sys_thread_getattr,   // 38
+	sys_ps,               // 39
+	sys_madvise,          // 40
+	sys_mcntl,            // 41
+	sys_stat,             // 42
+	sys_thread_migrate,   // 43
+	sys_sbrk,             // 44
+	sys_rmdir,            // 45
+	sys_ftime,            // 46
+	sys_chmod,            // 47
+	sys_fsync,            // 48
+	sys_gettimeofday,     // 49
+	sys_times             // 50
+};
+
+/////////////////////////////
+reg_t do_syscall ( reg_t arg0,
+		           reg_t arg1,
+		           reg_t arg2,
+		           reg_t arg3,
+		           reg_t service_num )
+  
+{
+	int32_t    return_val = 0;                        // default value 
+    thread_t * this       = CURRENT_THREAD;
+	cpu_t    * cpu        = thread_current_cpu( this );
+	
+    // change thread state
+	this->state = S_KERNEL;
+	
+    // prepare kernel time computation
+	tm_usr_compute( this );
+
+/*  TODO Pourqoi cette sauvegarde ? [AG]
+	return_val = cpu_context_save( &this->info.pss );
+   
+	if(return_val != 0)
+	{
+		// Reload these pointers as the process may be forked
+		this = CURRENT_THREAD;
+		cpu  = current_cpu;
+		cpu_wbflush();
+		
+		return_val = this->info.retval;
+		goto END_DO_SYSCALL;
+	}
+*/
+
+    // check syscall index
+	if( service_num >= SYSCALLS_NR )
+	{
+		printk(INFO, "INFO %s : Undefined sysccall %d / thread = %x in cluster %x\n",
+		       __FUNCTION__, service_num, this, cluster_cxy );
+
+		this->info.errno = ENOSYS;
+		goto END_DO_SYSCALL;
+	}
+
+    // debug message before syscall execution
+	if( this->info.isTraced == true )
+	{
+		printk(DEBUG, "DEBUG %s : Pid %d / Tid %d / CPU %d in cluster %x\n"
+                      "           Service %d / Arg0 %x / Arg1 %x / Arg2 %x / Arg3 %x\n",
+		       __FUNCTION__, this->process->pid, this->info.order, cpu->lid, cluster_cxy,
+		       service_num, arg0, arg1, arg2, arg3);
+	}
+
+    // reset errno
+	this->info.errno = 0;
+
+    // enable interrupts
+	cpu_enable_all_irq( NULL );
+  
+    // call the proper kernel function
+	return_val = sys_call_tbl[service_num] (arg0,arg1,arg2,arg3);
+
+    // disable interrupts	
+	cpu_disable_all_irq(NULL);
+   
+    // debug message after syscall execution
+	if(this->info.isTraced == true)
+	{
+		printk(DEBUG, "DEBUG %s : Pid %d / Tid %d / CPU %d in cluster %x\n"
+		              "           Service %d / Return = %x / Error = %d\n",
+		       __FUNCTION__, this->process->pid, this->info.order, cpu->lid, cluster_cxy,
+		       service_num, return_val, this->info.errno );
+	}
+
+END_DO_SYSCALL:
+
+    // compute kernel time
+	tm_sys_compute(this);
+
+    // update thread state
+	this->info.retval = return_val;
+	this->state = S_USER;
+
+    // notify syscall completion
+	signal_notify( this );
+
+	return return_val;
+} // end do_syscall()
Index: trunk/kernel/syscalls/sys_wait.c
===================================================================
--- trunk/kernel/syscalls/sys_wait.c	(revision 690)
+++ 	(revision )
@@ -1,196 +1,0 @@
-/*
- * sys_wait.c - wait termination or blocking of a child process.
- * 
- * Author    Alain Greiner (2016,2017,2018,2019)
- *  
- * Copyright (c) UPMC Sorbonne Universites
- *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2.0 of the License.
- *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <hal_kernel_types.h>
-#include <hal_uspace.h>
-#include <hal_irqmask.h>
-#include <hal_vmm.h>
-#include <remote_queuelock.h>
-#include <core.h>
-#include <thread.h>
-#include <process.h>
-#include <vmm.h>
-#include <printk.h>
-
-#include <syscalls.h>
-
-/////////////////////////////////
-int sys_wait( uint32_t * status )
-{
-	error_t     error;
-    vseg_t    * vseg;
-    xptr_t      iter_xp;
-    xptr_t      child_xp;
-    process_t * child_ptr;
-    cxy_t       child_cxy;
-    pid_t       child_pid;
-    uint32_t    child_state;
-    thread_t  * child_thread;
-    reg_t       save_sr;
-
-    thread_t  * this    = CURRENT_THREAD;
-    process_t * process = this->process;
-    pid_t       pid     = process->pid;
-
-
-#if DEBUG_SYS_WAIT
-uint64_t cycle = hal_get_cycles();
-if( DEBUG_SYS_WAIT < cycle )
-printk("\n[%s] thread[%x,%x] enter / cycle %d\n",
-__FUNCTION__, pid, this->trdid, (uint32_t)cycle );
-#endif
-
-    // check status in user space
-    error = vmm_get_vseg( process, (intptr_t)status , &vseg );
-
-	if( error )
-	{
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : status buffer %x unmapped for thread[%x,%x]\n",
-__FUNCTION__ , (intptr_t)status, pid, this->trdid );
-#endif
-        this->errno = EINVAL;
-		return -1;
-	}
-
-    // get calling process owner cluster
-    cxy_t   owner_cxy = CXY_FROM_PID( pid );
-
-    // get calling thread trdid
-    trdid_t trdid = this->trdid;
-
-    // this function must be executed by the process main thread
-    if( (owner_cxy != local_cxy) || (LTID_FROM_TRDID(trdid) != 0) )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-printk("\n[ERROR] in %s : calling thread[%x,%x] is not thread 0 in owner cluster %x\n",
-__FUNCTION__ , pid, this->trdid , owner_cxy );
-#endif
-        this->errno = EINVAL;
-		return -1;
-	}
-
-    // get extended pointer on children list root and lock
-    xptr_t children_root_xp = XPTR( owner_cxy , &process->children_root );
-    xptr_t children_lock_xp = XPTR( owner_cxy , &process->children_lock );
-
-    // exit this loop only when a child processes change state
-    while( 1 )
-    {
-        // enable IRQS
-        hal_enable_irq( &save_sr );
- 
-        // get lock protecting children list
-        remote_queuelock_acquire( children_lock_xp );
-
-        // scan the list of child process
-        XLIST_FOREACH( children_root_xp , iter_xp )
-        {
-            // get child process owner cluster and local pointer 
-            child_xp  = XLIST_ELEMENT( iter_xp , process_t , children_list );
-            child_ptr = GET_PTR( child_xp );
-            child_cxy = GET_CXY( child_xp );
-
-            // get PID, term_state, and main thread from child process
-            child_pid    = hal_remote_l32 (XPTR( child_cxy , &child_ptr->pid ));
-            child_state  = hal_remote_l32 ( XPTR(child_cxy , &child_ptr->term_state ) );
-            child_thread = hal_remote_lpt(XPTR( child_cxy , &child_ptr->th_tbl[0] ));
-
-            // test if this child process is terminated,
-            // but termination not yet reported to parent process
-            if( ((child_state & PROCESS_TERM_EXIT)  || 
-                 (child_state & PROCESS_TERM_KILL)  ||
-                 (child_state & PROCESS_TERM_STOP)) &&
-                 ((child_state & PROCESS_TERM_WAIT) == 0) )
-            {
-                // set the PROCESS_TERM_WAIT in child process descriptor
-                hal_remote_atomic_or( XPTR( child_cxy , &child_ptr->term_state ),
-                                      PROCESS_TERM_WAIT );
-
-                // set the THREAD_FLAG_REQ_DELETE in main thread if kill or exit
-                if((child_state & PROCESS_TERM_EXIT) || (child_state & PROCESS_TERM_KILL))
-                hal_remote_atomic_or( XPTR( child_cxy , &child_thread->flags ) ,
-                                            THREAD_FLAG_REQ_DELETE );
-
-                // release lock protecting children list
-                remote_queuelock_release( children_lock_xp );
-
-#if DEBUG_SYS_WAIT 
-cycle = hal_get_cycles();
-if( DEBUG_SYS_WAIT < cycle )
-{
-    if( child_state & PROCESS_TERM_EXIT )
-        printk("\n[%s] thread[%x,%x] exit : child process %x terminated / cycle %d\n",
-        __FUNCTION__, pid, this->trdid, child_pid, (uint32_t)cycle );
-    if( child_state & PROCESS_TERM_KILL )
-        printk("\n[%s] thread[%x,%x] exit : child process %x killed / cycle %d\n",
-        __FUNCTION__, pid, this->trdid, child_pid, (uint32_t)cycle );
-    if( child_state & PROCESS_TERM_STOP )
-        printk("\n[%s] thread[%x,%x] exit : child process %x stopped / cycle %d\n",
-        __FUNCTION__, pid, this->trdid, child_pid, (uint32_t)cycle );
-}
-#endif
-                 // return child termination state  to parent process 
-                 hal_copy_to_uspace( status,
-                                     XPTR( local_cxy , &child_state ),
-                                     sizeof(int) );
-                 return child_pid;
-            }
-        }  // end loop on children
-        
-        // we execute this code when no child change detected
-        // - release the lock protecting children list,
-        // - block on the WAIT condition
-        // - deschedule to keep waiting in the while loop
-
-        // release lock protecting children list 
-        remote_queuelock_release( children_lock_xp );
-
-        // block on WAIT condition
-        thread_block( XPTR( local_cxy , this ) , THREAD_BLOCKED_WAIT );
-
-#if (DEBUG_SYS_WAIT & 1)
-cycle = hal_get_cycles();
-if( DEBUG_SYS_WAIT < cycle )
-printk("\n[%s] thread[%x,%x] block & deschedule / cycle %d\n",
-__FUNCTION__, pid, this->trdid, (uint32_t)cycle );
-#endif
-
-        // deschedule
-        sched_yield( "parent process wait children processes termination" );
-
-#if (DEBUG_SYS_WAIT & 1) 
-cycle = hal_get_cycles();
-if( DEBUG_SYS_WAIT < cycle )
-printk("\n[%s] thread[%x,%x] resume / cycle %d\n",
-__FUNCTION__, pid, this->trdid, (uint32_t)cycle );
-#endif
-
-    }  // end while
-
-    // never executed
-	return 0; 
-
-}  // end sys_wait()
Index: trunk/kernel/syscalls/sys_write.c
===================================================================
--- trunk/kernel/syscalls/sys_write.c	(revision 690)
+++ trunk/kernel/syscalls/sys_write.c	(revision 1)
@@ -1,16 +1,15 @@
 /*
- * sys_write.c - Kernel function implementing the "write" system call.
+ * kern/sys_write.c - write bytes to a file
  * 
- * Author        Alain Greiner (2016,2017,2018,2019,2020)
+ * Copyright (c) 2008,2009,2010,2011,2012 Ghassan Almaless
+ * Copyright (c) 2011,2012 UPMC Sorbonne Universites
  *
- * Copyright (c) UPMC Sorbonne Universites
+ * This file is part of ALMOS-kernel.
  *
- * This file is part of ALMOS-MKH.
- *
- * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * ALMOS-kernel is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by
  * the Free Software Foundation; version 2.0 of the License.
  *
- * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * ALMOS-kernel is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
@@ -18,253 +17,40 @@
  *
  * You should have received a copy of the GNU General Public License
- * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * along with ALMOS-kernel; if not, write to the Free Software Foundation,
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include <kernel_config.h>
-#include <hal_kernel_types.h>
-#include <hal_vmm.h>
-#include <hal_uspace.h>
-#include <hal_irqmask.h>
-#include <hal_special.h>
 #include <errno.h>
+#include <thread.h>
 #include <vfs.h>
-#include <vmm.h>
 #include <thread.h>
-#include <printk.h>
-#include <pipe.h>
-#include <process.h>
+#include <sys-vfs.h>
+#include <task.h>
 
+int sys_write (uint_t fd, void *buf, size_t count)
+{
+	ssize_t err = 0;
+	struct thread_s *this;
+	struct task_s *task;
+	struct vfs_file_s *file;
+	struct ku_obj kub;
 
-extern uint32_t enter_sys_write;
-extern uint32_t enter_devfs_write;
-extern uint32_t enter_txt_write;
-extern uint32_t enter_chdev_cmd_write;
-extern uint32_t enter_chdev_server_write;
-extern uint32_t enter_tty_cmd_write;
-extern uint32_t enter_tty_isr_write;
-extern uint32_t exit_tty_isr_write;
-extern uint32_t exit_tty_cmd_write;
-extern uint32_t exit_chdev_server_write;
-extern uint32_t exit_chdev_cmd_write;
-extern uint32_t exit_txt_write;
-extern uint32_t exit_devfs_write;
-extern uint32_t exit_sys_write;
-
-//////////////////////////////////
-int sys_write( uint32_t   file_id,
-               void     * vaddr,
-               uint32_t   count )
-{
-    error_t       error;
-    vseg_t      * vseg;            // required for user space checking
-	xptr_t        file_xp;         // remote file extended pointer
-    vfs_file_t  * file_ptr;        // remote file local pointer
-    cxy_t         file_cxy;        // remote file cluster identifier
-    uint32_t      file_type;       // file type
-    uint32_t      file_offset;     // file offset
-    uint32_t      file_attr;       // file attributes
-    vfs_inode_t * inode_ptr;       // local pointer on associated inode
-    uint32_t      nbytes;          // number of bytes actually written
-    reg_t         save_sr;         // required to enable IRQs during syscall
-
-	thread_t    * this = CURRENT_THREAD;
-	process_t   * process = this->process;
-
-#if DEBUG_SYS_WRITE || DEBUG_SYSCALLS_ERROR || CONFIG_INSTRUMENTATION_SYSCALLS
-uint64_t     tm_start = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_WRITE
-if( DEBUG_SYS_WRITE < tm_start )
-printk("\n[%s] thread[%x,%x] enter / vaddr %x / %d bytes / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, vaddr, count, (uint32_t)tm_start );
-#endif
+	file = NULL;
+	this = current_thread;
+	task = current_task;
  
-#if (DEBUG_SYS_WRITE & 1)
-if( DEBUG_SYS_WRITE < tm_start )
-enter_sys_write = (uint32_t)tm_start;
-#endif
-
-    // check file_id argument
-	if( file_id >= CONFIG_PROCESS_FILE_MAX_NR )
+	if((fd >= CONFIG_TASK_FILE_MAX_NR) || (task_fd_lookup(task, fd, &file)))
 	{
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal file descriptor index %d\n",
-__FUNCTION__, process->pid, this->trdid, file_id );
-#endif
-        this->errno = EBADFD;
+		this->info.errno = EBADFD;
 		return -1;
 	}
 
-    // check user buffer in user space
-    error = vmm_get_vseg( process , (intptr_t)vaddr , &vseg );
-
-    if ( error )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / user buffer unmapped %x\n",
-__FUNCTION__ , process->pid, this->trdid, (intptr_t)vaddr );
-#endif
-		this->errno = EINVAL;
+	KU_SLICE_BUFF(kub, buf, count);
+	if((err = vfs_write(file, &kub)) < 0)
+	{
+		this->info.errno = (err < 0) ? -err : err;
 		return -1;
-    }
-
-    // get extended pointer on remote file descriptor
-    file_xp = process_fd_get_xptr_from_local( process , file_id );
-
-    if( file_xp == XPTR_NULL )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / undefined file descriptor = %d\n",
-__FUNCTION__, process->pid, this->trdid, file_id );
-#endif
-		this->errno = EBADFD;
-		return -1;
-    }
-
-    // get file descriptor cluster and local pointer
-    file_ptr = GET_PTR( file_xp );
-    file_cxy = GET_CXY( file_xp );
-
-    // get file type, offset, aatributes, and associated inode
-    file_type   = hal_remote_l32( XPTR( file_cxy , &file_ptr->type ) );
-    file_offset = hal_remote_l32( XPTR( file_cxy , &file_ptr->offset ) );
-    inode_ptr   = hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) );
-    file_attr   = hal_remote_l32( XPTR( file_cxy , &file_ptr->attr ) );
-
-    // enable IRQs
-    hal_enable_irq( &save_sr );
-
-    // check file writable
-    if( (file_attr & FD_ATTR_WRITE_ENABLE) == 0 )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / file %d not writable\n",
-__FUNCTION__ , process->pid, this->trdid, file_id );
-#endif
-            hal_restore_irq( save_sr );
-		    this->errno = EBADFD;
-		    return -1;
-    }
-
-    // action depend on file type:
-    if( file_type == FILE_TYPE_REG )                         // write to mapper 
-    {
-        // move count bytes to mapper
-        nbytes = vfs_user_move( false,    // to mapper
-                                file_xp,
-                                vaddr, 
-                                count );
-    }
-    else if( file_type == FILE_TYPE_DEV )                     // write to TXT device
-    {
-        // move count bytes to device
-        nbytes = devfs_user_move( false,  // to device
-                                  file_xp,
-                                  vaddr,
-                                  count );
-    }
-    else if( (file_type == FILE_TYPE_PIPE) ||
-             (file_type == FILE_TYPE_FIFO) )                  // write to pipe
-    {
-        // move count bytes to pipe
-        nbytes = pipe_user_move( false,   // to pipe 
-                                 file_xp,
-                                 vaddr,
-                                 count );
-    }
-    else                                                       // unsupported type
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,%x] / illegal inode type %\n",
-__FUNCTION__, vfs_inode_type_str( file_type ) );
-#endif
-        hal_restore_irq( save_sr );
-		this->errno = EBADFD;
-		return -1;
-    }
-
-    // chek error
-    if( nbytes == 0xFFFFFFFF )
-    {
-
-#if DEBUG_SYSCALLS_ERROR
-if( DEBUG_SYSCALLS_ERROR < (uint32_t)tm_start )
-printk("\n[ERROR] in %s : thread[%x,‰x] cannot write data to file %d\n",
-__FUNCTION__ , process->pid, this->trdid, file_id );
-#endif
-        hal_restore_irq( save_sr );
-        this->errno = EIO;
-        return -1;
-    }
-
-    // restore IRQs
-    hal_restore_irq( save_sr );
-
-    hal_fence();
-
-#if (DEBUG_SYS_WRITE || CONFIG_INSTRUMENTATION_SYSCALLS)
-uint64_t     tm_end = hal_get_cycles();
-#endif
-
-#if DEBUG_SYS_WRITE
-if( DEBUG_SYS_WRITE < tm_end )
-printk("\n[%s] thread[%x,%x] exit / cycle %d\n",
-__FUNCTION__, process->pid, this->trdid, (uint32_t)tm_end );
-#endif
- 
-#if CONFIG_INSTRUMENTATION_SYSCALLS
-hal_atomic_add( &syscalls_cumul_cost[SYS_WRITE] , tm_end - tm_start );
-hal_atomic_add( &syscalls_occurences[SYS_WRITE] , 1 );
-#endif
-
-#if (DEBUG_SYS_WRITE & 1) 
-if( DEBUG_SYS_WRITE < tm_start )
-exit_sys_write = (uint32_t)tm_end;
-
-if( DEBUG_SYS_WRITE < tm_start )
-printk("\n***** timing to write a string *****\n"
-" - enter_sys_write          = %d / delta %d\n"
-" - enter_devfs_write        = %d / delta %d\n"
-" - enter_txt_write          = %d / delta %d\n"
-" - enter_chdev_cmd_write    = %d / delta %d\n"
-" - enter_chdev_server_write = %d / delta %d\n"
-" - enter_tty_cmd_write      = %d / delta %d\n"
-" - enter_tty_isr_write      = %d / delta %d\n"
-" - exit_tty_isr_write       = %d / delta %d\n"
-" - exit_tty_cmd_write       = %d / delta %d\n"
-" - exit_chdev_server_write  = %d / delta %d\n"
-" - exit_chdev_cmd_write     = %d / delta %d\n"
-" - exit_txt_write           = %d / delta %d\n"
-" - exit_devfs_write         = %d / delta %d\n"
-" - exit_sys_write           = %d / delta %d\n",
-enter_sys_write          , 0 ,
-enter_devfs_write        , enter_devfs_write        - enter_sys_write          ,
-enter_txt_write          , enter_txt_write          - enter_devfs_write        ,
-enter_chdev_cmd_write    , enter_chdev_cmd_write    - enter_txt_write          ,
-enter_chdev_server_write , enter_chdev_server_write - enter_chdev_cmd_write    ,
-enter_tty_cmd_write      , enter_tty_cmd_write      - enter_chdev_server_write ,
-enter_tty_isr_write      , enter_tty_isr_write      - enter_tty_cmd_write      ,
-exit_tty_isr_write       , exit_tty_isr_write       - enter_tty_isr_write      ,
-exit_tty_cmd_write       , exit_tty_cmd_write       - exit_tty_isr_write       ,
-exit_chdev_server_write  , exit_chdev_server_write  - exit_tty_cmd_write       ,
-exit_chdev_cmd_write     , exit_chdev_cmd_write     - exit_chdev_server_write  ,
-exit_txt_write           , exit_txt_write           - exit_chdev_cmd_write     ,
-exit_devfs_write         , exit_devfs_write         - exit_txt_write           ,
-exit_sys_write           , exit_sys_write           - exit_devfs_write         );
-#endif
- 
-	return nbytes;
-
-}  // end sys_write()
+	}
+   
+	return err;
+}
Index: trunk/kernel/syscalls/syscalls.h
===================================================================
--- trunk/kernel/syscalls/syscalls.h	(revision 690)
+++ trunk/kernel/syscalls/syscalls.h	(revision 1)
@@ -1,6 +1,7 @@
 /*
- * syscalls.h - Kernel side services for syscall handling.
+ * syscall.h - kernel services definition
  * 
- * Author     Alain Greiner (2016,2017,2018,2019,2020)
+ * Author  Ghassan Almaless (2007,2008,2009,2010,2011,2012)
+ *         Alain Greiner    (2016)
  *
  * Copyright (c) UPMC Sorbonne Universites
@@ -22,791 +23,123 @@
  */
 
-#ifndef _SYSCALLS_H_
-#define _SYSCALLS_H_
+#ifndef _SYSCALL_H_
+#define _SYSCALL_H_
 
-#include <hal_kernel_types.h>
-#include <shared_syscalls.h>
+/******************************************************************************************
+ * This enum defines the system calls index.
+ * It must be kept consistant with the syscall vector defined in sys_vector.c file.
+ *****************************************************************************************/
+enum
+{
+	SYS_EXIT,          /* 0  */
+	SYS_MMAP,          /* 1  */
+	SYS_CREATE,        /* 2  */
+	SYS_JOIN,          /* 3  */
+	SYS_DETACH,        /* 4  */
+	SYS_YIELD,         /* 5  */
+	SYS_SEMAPHORE,     /* 6  */
+	SYS_COND_VAR,      /* 7  */
+	SYS_BARRIER,       /* 8  */
+	SYS_RWLOCK,        /* 9  */
+	SYS_SLEEP,         /* 10 */
+	SYS_WAKEUP,        /* 11 */
+	SYS_OPEN,          /* 12 */
+	SYS_CREAT,         /* 13 */
+	SYS_READ,          /* 14 */
+	SYS_WRITE,         /* 15 */
+	SYS_LSEEK,         /* 16 */
+	SYS_CLOSE,         /* 17 */
+	SYS_UNLINK,        /* 18 */   
+	SYS_PIPE,          /* 19 */
+	SYS_CHDIR,         /* 20 */
+	SYS_MKDIR,         /* 21 */
+	SYS_MKFIFO,        /* 22 */    
+	SYS_OPENDIR,       /* 23 */
+	SYS_READDIR,       /* 24 */
+	SYS_CLOSEDIR,      /* 25 */
+	SYS_GETCWD,        /* 26 */
+	SYS_CLOCK,         /* 27 */
+	SYS_ALARM,         /* 28 */   
+	SYS_DMA_MEMCPY,    /* 29 */
+	SYS_UTLS,          /* 30 */  
+	SYS_SIGRETURN,     /* 31 */
+	SYS_SIGNAL,        /* 32 */
+	SYS_SET_SIGRETURN, /* 33 */
+	SYS_KILL,          /* 34 */
+	SYS_GETPID,        /* 35 */
+	SYS_FORK,          /* 36 */
+	SYS_EXEC,          /* 37 */
+	SYS_GETATTR,       /* 38 */     
+	SYS_PS,            /* 39 */
+	SYS_MADVISE,       /* 40 */   
+	SYS_PAGEINFO,      /* 41 */
+	SYS_STAT,          /* 42 */
+	SYS_MIGRATE,       /* 43 */
+	SYS_SBRK,          /* 44 */
+	SYS_RMDIR,         /* 45 */
+	SYS_FTIME,         /* 46 */
+	SYS_CHMOD,         /* 47 */
+	SYS_FSYNC,         /* 48 */
+	SYS_GET_TOD,       /* 49 */
+	SYS_TIMES,         /* 50 */
+	SYSCALLS_NR,
+};
 
-/**   Forward declarations  *****/
+/********************************************************************************************/
+/********************   Process related system calls  ***************************************/ 
+/********************************************************************************************/
 
-struct thread_s;                  // defined in thread.h
-struct pthread_attr_s;            // defined in thread.h
-struct vfs_stat_s;                // defined in vfs.h
-struct vfs_dirent_s;              // defined in vfs.h
-struct mmap_attr_s;               // defined in vmm.h
+/********************************************************************************************* 
+ * This function TODO
+ ********************************************************************************************/
+int sys_getpid();
+
+/********************************************************************************************* 
+ * This function implement the "fork" system call.
+ * The calling process descriptor (parent process), and the associated thread descriptor are
+ * replicated in the same cluster as the calling thread, but the new process (child process)
+ * is registered in another target cluster, that will become the process owner. 
+ * The child process and the associated main thread will be migrated to the target cluster
+ * later, when the child process makes an "exec" or any other system call. 
+ * The target cluster depends on the "fork_user" flag and "fork_cxy" variable that can be
+ * stored in the calling thread descriptor by the specific fork_place() system call.
+ * If not, the sys_fork() function makes a query to the DQDT to select the target cluster. 
+ ********************************************************************************************* 
+ * @ returns child process PID if success / returns -1 if failure
+ ********************************************************************************************/
+int sys_fork();
+
+/********************************************************************************************* 
+ * This function implement the exec system call.
+ * It is executed in the client cluster, but the new process descriptor and main thread
+ * must be created in a server cluster, that is generally another cluster, using a RPC.
+ * - If the server_cluster is the client cluster, call directly make_exec() in local
+ *   mode, to change the process image and launch a new thread in local cluster.
+ *   finally, the old thread is deleted.
+ * - If the target_cluster is remote, call rpc_process_exec_client() to execute the
+ *   make_exec() in remote mode on the remote cluster, to create a new process
+ *   descriptor and a new thread on remote cluster. Finally, both the local
+ *   process descriptor and the local thread descriptor are deleted.
+ * In both case this function build an exec_info_t structure containing all informations
+ * required to build the new process descriptor and the associated thread, including
+ * the mode (local/remote).
+ * @ filename : string pointer on .elf filename (virtual pointer in user space)
+ * @ argv     : array of strings on process arguments (virtual pointers in user space)
+ * @ envp     : array of strings on Renvironment variables (virtual pointers in user space)
+ * @ returns O if success / returns non-zero if error.
+ ********************************************************************************************/
+int sys_exec( char  * filename,
+              char ** argv,
+              char ** envp );
 
 
-/****************************************************************************************** 
- * This function forces the calling thread to sleep, for a fixed number of seconds.
- ******************************************************************************************
- * @ seconds   : number of seconds.
- *****************************************************************************************/
-int sys_alarm( uint32_t seconds );
-
-/****************************************************************************************** 
- * This function implement all operations on a POSIX barrier.
- * The kernel structure representing a barrier is defined in the remote_barrier.h file.
- * The code implementting the operations is defined in the remote_barrier.c file.
- ******************************************************************************************
- * @ vaddr     : barrier address in user space == identifier.
- * @ operation : BARRIER_INIT / BARRIER_DESTROY / BARRIER_WAIT.
- * @ count     : number of expected threads (only used by BARRIER_INIT).
- * @ attr      : barrier attributes address in user space (only used by BARRIER_INIT).
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_barrier( intptr_t   vaddr,
-                 uint32_t   operation,
-                 uint32_t   count,
-                 intptr_t   attr );
-
-/****************************************************************************************** 
- * This function change the current working directory in reference process descriptor.
- ******************************************************************************************
- * @ pathname   : pathname (can be relative or absolute).
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_chdir( char * pathname );
-
-/****************************************************************************************** 
- * This function change the acces rights for the file/directory inode identified by the
- * <pathname> argument, as specified by the <mode> argument.
- ******************************************************************************************
- * @ pathname : pathname (can be relative or absolute).
- * @ mode     : acces rights.
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_chmod( char       * pathname,
-               uint32_t     mode );
-
-/****************************************************************************************** 
- * This function release the memory allocated for the file descriptor identified by 
- * the <file_id> argument, and remove the fd array_entry in all copies of the process 
- * descriptor.
- ******************************************************************************************
-  file_id   : file descriptor index in fd_array.
- * @ returns 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_close( uint32_t file_id );
-
-/****************************************************************************************** 
- * This function closes the directory identified by the <dirp> argument, and releases
- * all structures associated with the <dirp> pointer.
- ******************************************************************************************
- * @ dirp     : [in] user pointer on dirent array identifying the open directory.
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_closedir( DIR * dirp );
-
-/****************************************************************************************** 
- * This function implement all operations on a POSIX condition variable.
- * The kernel structure representing a condvar is defined in the remote_condvar.h file,
- * The code implementing the operations is defined in the remote_condvar.c file.
- ******************************************************************************************
- * @ vaddr     : condvar virtual address in user space == identifier.
- * @ operation : operation type (see below).
- * @ attr      : mutex virtual address in user space == identifier.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_condvar( void     * condvar,
-                 uint32_t   operation,
-                 void     * mutex );
-
-/****************************************************************************************** 
- * This debug function displays on the kernel terminal TXT0 an user defined string,
- * or the current state of a kernel structure, identified by the <type> argument.
- * The <arg0>, <arg1>, and <arg2> arguments depends on the structure type.
- ******************************************************************************************
- * type      : [in] type of display 
- * arg0      : [in] type dependant argument.
- * arg1      : [in] type dependant argument.
- * arg2      : [in] type dependant argument.
- * @ return 0 if success / return -1 if illegal arguments
- *****************************************************************************************/
-int sys_display( reg_t  type,
-                 reg_t  arg0,
-                 reg_t  arg1,
-                 reg_t  arg2 );
-
-/****************************************************************************************** 
- * This function implement the "exec" system call on the kernel side.
- * It creates, in the same cluster as the calling thread, a new process descriptor,
- * and a new associated main thread descriptor, executing a new memory image defined 
- * by the <filename> argument. This new process inherit from the old process the PID
- * and the PPID, as well as all open files registered in fd_array, including the TXT. 
- * The old process descriptor, and all its threads are blocked, and marked for deletion.
- * Therefore the exec syscall does not return to the calling thread in case of success.
- * This function must be called by the main thread (thread 0 in owner cluster), of the
- * calling process, to destroy all process copies, and all other threads in all clusters. 
- ****************************************************************************************** 
- * Implementation note:
- * It fill the calling process "exec_info" structure containing all informations required
- * to initialize the new process descriptor and the associated main thread. This includes:
- * - pathname to the new process .elf> file in VFS. 
- * - array of string pointers defining the process arguments, and the associated strings.
- * - array of string pointers defining environment variables, and the associated strings.
- * To do this, it calls the process_exec_get_strings function, that copies all relevant
- * information from user space to kernel space, using functions defined in <hal_uspace.h>.
- * Then it calls the process_make_exec() function that returns only in case of failure.
- *
- * TODO : the <envs> argument is not supported yet and must be NULL.
- ****************************************************************************************** 
- * @ filename      : string pointer on .elf filename (pointer in user space)
- * @ user_args     : array of strings on process arguments (pointers in user space)
- * @ user_envs     : array of strings on environment variables (pointers in user space)
- * @ does not return if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_exec( char  * filename,
-              char ** user_args,
-              char ** user_envs );
-
-/****************************************************************************************** 
- * This function implements the "exit" system call terminating a POSIX process.
- * It can be called by any thread running in any cluster.
- * It uses both remote accesses to access the owner process descriptor, and the
- * RPC_PROCESS_SIGACTION to delete remote process copies and thread descriptors.
- * In the present implementation, this function implements actually the _exit():
- * - it does not flush open output streams.
- * - it does not close open streams.
- ******************************************************************************************
- * @ status   : terminaison status returned to parent process.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_exit( uint32_t status );
-
-/****************************************************************************************** 
- * This generic function implements the non-standard FBF related syscalls.
- * The operation types mnemonics are defined in the <shared_fbf> file.
- * The supported operations are defined in the <almosmkh.h> & <almosmkh.c> files.
- * This function ckecks the syscall arguments, and call the relevant kernel function.
- ******************************************************************************************
- * @ arg0       : operation type (mnemonics defined in shared_fbf.h)
- * @ arg1       : depends on operation type
- * @ arg2       : depends on operation type
- * @ arg3       : depends on operation type
- * @ return 0 if success / return -1 if illegal argument.
- *****************************************************************************************/
-int sys_fbf( reg_t   arg0,
-             reg_t   arg1,
-             reg_t   arg2,
-             reg_t   arg3 );
-
-/****************************************************************************************** 
- * This function gives the process identified by the <pid> argument
- * the exclusive ownership of its TXT_TX terminal (put it in foreground).
- ******************************************************************************************
- * @ pid    : process identifier.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_fg( pid_t   pid );
-
-/****************************************************************************************** 
- * This function implements the "fsync" system call.
- * It forces all modified pages of the file mapper identified by the <fd> argument
- * to be copied to the IOC device.
- * It can be called by any thread running in any cluster.
- * TODO not implemented yet.
- ******************************************************************************************
- * @ file_id   : file descriptor index in fd_array.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_fsync( uint32_t file_id );
-
-/****************************************************************************************** 
- * This function implement the "fork" system call on the kernel side.
- * The calling process descriptor (parent process), and the associated thread descriptor
- * are replicated in a - likely - remote cluster, that becomes the child process owner. 
- * The child process get a new PID, and is linked to the parent PID. The child process 
- * inherit from its parent the memory image, and all open files (including the TXT).
- * The child process becomes the TXT terminal owner.
- * The target cluster depends on the "fork_user" flag and "fork_cxy" variable that can be
- * stored in the calling thread descriptor by the specific fork_place() system call.
- * If not, the kernel function makes a query to the DQDT to select the target cluster. 
- ****************************************************************************************** 
- * @ if success, returns child process PID to parent, and return O to child.
- * @ if failure, returns -1 to parent / no child process is created.
- *****************************************************************************************/
-int sys_fork( void );
-
-/****************************************************************************************** 
- * This generic function implements all the non standard syscalls of type "get_xxx()",
- * defined in the <almosmkh.h> and <almosmkh.c> files.
- * The operation types mnemonics are defined in the <shared_almos.h> file.
- * This function ckecks the syscall arguments, and call the relevant kernel function.
- ******************************************************************************************
- * @ arg0       : operation type (mnemonics defined in shared_get.h)
- * @ arg1       : depends on operation type
- * @ arg2       : depends on operation type
- * @ arg3       : depends on operation type
- * @ return 0 if success / return -1 if illegal argument.
- *****************************************************************************************/
-int sys_get( reg_t   arg0,
-             reg_t   arg1,
-             reg_t   arg2,
-             reg_t   arg3 );
-
-/****************************************************************************************** 
- * This function implements the non-standard "get_best_core" syscall.
- * It selects, in a macro-cluster specified by the <base_cxy> and <level> arguments,
- * the core that has the lowest load.
- * When an active core has been found in the target macro-cluster, it writes into the 
- * <cxy> and <lid> buffers the cluster identifier and the core local index, and return 0.
- * It returns -1 in case of illegal arguments (level / cxy / lid).
- * It returns +1 if there is no active core in specified macro-cluster.
- ******************************************************************************************
- * @ base_cxy : [in]  any cluster identifier in macro-cluster.
- * @ level    : [in]  macro-cluster level in [1,2,3,4,5].
- * @ cxy      : [out] selected core cluster identifier.
- * @ lid      : [out] selected core local index in cluster.
- * @ return 0 if success / -1 if illegal arguments / +1 if no core in macro-clusters.
- *****************************************************************************************/
-int sys_get_best_core( uint32_t   base_cxy,
-                       uint32_t   level,
-                       uint32_t * cxy,
-                       uint32_t * lid );
-
-/****************************************************************************************** 
- * This function implement the non-standard get_config() syscall.
- * It returns the global hardware platform parameters in the <config> shared structure,
- * that is defined in the shared_almos.h file.
- ******************************************************************************************
- * @ config   : [out] pointer on the hard_config_t structure in user space.
- * @ return 0 if success / return -1 if illegal argument
- *****************************************************************************************/
-int sys_get_config( struct hard_config_s * config );
-
-/****************************************************************************************** 
- * This function implements the non-standard get_core_id() syscall.
- * It returns in <cxy> and <lid> the calling core cluster and local index.
- ******************************************************************************************
- * @ cxy      : [out] cluster identifier (fixed format)
- * @ lid      : [out] core local index in cluster.
- * @ return 0 if success / return -1 if illegal arguments
- *****************************************************************************************/
-int sys_get_core_id( uint32_t * cxy,
-                     uint32_t * lid );
-
-/****************************************************************************************** 
- * This function implements the non-standard get_cycle() syscall.
- * It returns in a 64 bits user buffer the calling core cycles count.
- * It uses both the hardware register and the core descriptor cycles count to take
- * into account a possible harware register overflow  in 32 bits architectures.
- ******************************************************************************************
- * cycle    : [out] address of buffer in user space.
- * @ return 0 if success / return -1 if illegal arguments
- *****************************************************************************************/
-int sys_get_cycle( uint64_t * cycle );
-
-/****************************************************************************************** 
- * This function returns the pathname of the current working directory.
- ******************************************************************************************
- * buf     : buffer addres in user space.
- * nbytes  : user buffer size in bytes.
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_getcwd( char     * buf,
-                uint32_t   nbytes );
-
-/****************************************************************************************** 
- * This function implements the non-standard "get_nb_cores" syscall.
- * It writes in the <ncores> buffer the number of cores in the target cluster <cxy>.
- ******************************************************************************************
- * @ cxy      : [in]  target cluster identifier.
- * @ ncores   : [out] number of cores / 0 if cluster cxy undefined in architecture.
- * @ return 0 if success / return -1 if illegal "ncores" arguments.
- *****************************************************************************************/
-int sys_get_nb_cores( uint32_t   cxy,
-                      uint32_t * ncores );
-
-/****************************************************************************************** 
- * This function implements the "getpid" system call on the kernel side.
- ****************************************************************************************** 
- * @ returns the process PID for the calling thread.
- *****************************************************************************************/
-int sys_getpid( void );
-
-/****************************************************************************************** 
- * This function implements the non-standard "get_thread_info" syscall.
- * It copies in the user structure defined by the <info> argument the values registered
- * in the calling thread "thread_info_t" kernel structure.
- ******************************************************************************************
- * @ info      : [out] pointer on thread_info_t structure in user space.
- * @ return 0 if success / return -1 if illegal argument.
- *****************************************************************************************/
-int sys_get_thread_info( thread_info_t * info );
-
-/****************************************************************************************** 
- * This function tests whether a given file descriptor dentified by the <file_id>
- * argument is an open file descriptor referring to a terminal.
- ******************************************************************************************
- * @ file_id   : file descriptor index
- * @ return 1 if it is a TXT device / return 0 if it is not a TXT device.
- *****************************************************************************************/
-int sys_isatty( uint32_t file_id );
-
-/****************************************************************************************** 
- * This function returns a non-zero value in the <is_fg> buffer when the process
- * identified by the <pid> argument is the current TXT owner.
- ******************************************************************************************
- * @ pid      : process identifier.
- * @ is_fg    : pointer on buffer.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_is_fg( pid_t      pid,
-               uint32_t * is_fg );
-
-/****************************************************************************************** 
- * This function implements the "kill" system call on the kernel side.
- * It register the signal defined by the <sig_id> argument in all thread descriptors 
- * of a target process identified by the <pid> argument. This is done in all clusters
- * containing threads for the target process.
- * It can be executed by any thread running in any cluster, as this function uses
- * remote access to traverse the list of process copies stored in the owner cluster,
- * and the RPC_SIGNAL_RISE to signal the remote threads. 
- * This function does nothing for (sig_id == 0). This can be used to check process pid.
- * TODO : This first implementation supports only SIGKILL / SIGSTOP / SIGCONT values.
- ****************************************************************************************** 
- * @ pid      : target process identifier.
- * @ sig_id   : index defining the signal type. 
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_kill( pid_t    pid,
-              uint32_t sig_id );
-
-/****************************************************************************************** 
- * This function repositions the offset of the file descriptor identified by the
- * <file_id> argument, according to the operation type defined by the <whence> argument.
- ******************************************************************************************
- * @ file_id  : open file index in fd_array.
- * @ offset   : used to compute new offset value.
- * @ whence   : operation type (see below).
- * @ returns new offset value if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_lseek( xptr_t    file_id,
-               uint32_t  offset,
-               uint32_t  whence );
-
-/****************************************************************************************** 
- * This function implements the "mkdir" system call, creating a new directory in
- * the file system, as defined by the <pathname> argument, with the access permission
- * defined by the <rights> argument. All nodes but the last in the pathname must exist.
- * It can be called by any thread running in any cluster.
- ******************************************************************************************
- * @ pathname  : pathname defining the new directory location in file system.
- * @ rights    : access rights (non used yet).
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_mkdir( char     * pathname,
-               uint32_t   rights );
-
-/****************************************************************************************** 
- * This function creates a new inode/dentry couple of type FIFO, and registers it in 
- * the Inode-Tree, as specified by the <pathname> and <mode> arguments. 
- * The associated file descriptors are created later, using the sys_open() function.
- ******************************************************************************************
- * @ pathname   : pathname (can be relative or absolute).
- * @ mode       : access rights (as defined in chmod).
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_mkfifo( char     * pathname,
-                uint32_t   mode );
-
-/****************************************************************************************** 
- * This function map physical memory (or a file) in the calling thread virtual space.
- * The <attr> argument is a pointer on a structure for arguments (see shared_mman.h).
- * The user defined virtual address (MAP_FIXED flag) is not supported.
- * TODO : the access rights checking is not implemented yet [AG]
- * TODO : the Copy on Write for MAP_PRIVATE is not implemented yet [AG]
- ******************************************************************************************
- * @ attr       : pointer on attributes structure.
- * @ returns 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_mmap( mmap_attr_t * attr );
-
-/****************************************************************************************** 
- * This function remove an existing mapping defined by the <addr> and <size>
- * arguments in user space. This can modify the number of vsegs:
- * (a) if the region is not entirely mapped in one existing vseg, it's an error.
- * (b) if the region has same base and size as an existing vseg, the vseg is removed.
- * (c) if the removed region cut the exiting vseg in two parts, it is resized.
- * (d) if the removed region cut the vseg in three parts, it is modified, and a new
- *     vseg is created with same type.
- * All existing VSL copies are updated.
-******************************************************************************************
- * @ addr  : base address in user space.
- * @ size  : number of bytes.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_munmap( void     * addr,
-                uint32_t   size );
-
-/****************************************************************************************** 
- * This function implement all operations on a POSIX mutex.
- * The kernel structure representing a barrier is defined in the remote_barrier.h file.
- * The code implementting the operations is defined in the remote_barrier.c file.
- ******************************************************************************************
- * @ vaddr     : mutex virtual address in user space == identifier.
- * @ operation : MUTEX_INIT / MUTEX_DESTROY / MUTEX_LOCK / MUTEX_UNLOCK
- * @ attr      : mutex attributes (non supported yet => must be 0).
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_mutex( void     * vaddr,
-               uint32_t   operation,
-               uint32_t   count );
-
-/****************************************************************************************** 
- * This function creates a new file descriptor for an existing inode.
- * It creates a new inode if required by the flags.
- ******************************************************************************************
- * @ pathname   : pathname in the inode tree (can be relative or absolute).
- * @ flags      : bit vector attributes (see in shared_fcntl.h file)
- * @ mode       : access rights.
- * @ return file descriptor index in fd_array if success / return -1 if failure.
- *****************************************************************************************/
-int sys_open( char       * pathname,
-              uint32_t     flags,
-              uint32_t     mode );
-
-/****************************************************************************************** 
- * This function creates an user level directory descriptor (including the associated
- * array of user level dirents), and intialise it from the kernel directory mapper, that
- * contains all entries in this directory). The directory is identified by the <pathname>
- * argument. If the corresponding inode is missing in the Inode Tree, the inode is created,
- * but the directory must exist in the file system. 
- * It returns a DIR pointer <dirp> on the dirent array in user space.
- * The calling process fd_array is NOT modified.
- ******************************************************************************************
- * @ pathname   : [in]  pathname (can be relative or absolute).
- * @ dirp       : [out] buffer for pointer on user directory (DIR).
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_opendir( char * pathname,
-                 DIR ** dirp );
-
-/****************************************************************************************** 
- * This function creates in the calling thread cluster an unnamed pipe, implemented
- * as a remote_buffer_t, creates two (read and write) file descriptors, and links these
- * two file descriptors to the pipe.
- * TODO  : the dynamic memory allocation in case of buffer full is not implemented.
- * FIXME : wich syscall release the kernel memory allocated by this syscall ?
- ******************************************************************************************
- * @ fd   : pointeur on a 2 slots array of fdid : fd[0] read / fd[1] write.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_pipe( fdid_t * fd );
-
-/****************************************************************************************** 
- * This function implements the non-standard place_fork() syscall.
- * It can be used to specify the target cluster <cxy> for a new process created
- * by a subsequent fork() syscall.
- * WARNING: it must be called before each fork() syscall, as the placement specification
- *          is reset by the fork syscall. 
- ******************************************************************************************
- * @ cxy    : cluster identifier.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_place_fork( uint32_t cxy );
-
-/****************************************************************************************** 
- * This function read bytes from an open file identified by its file descriptor.
- * The file can be a regular file or character oriented device.
- * IRQs are enabled during this system call.
- ******************************************************************************************
- * @ file_id  : open file index in fd_array.
- * @ buf      : buffer virtual address in user space.
- * @ count    : number of bytes.
- * @ returns number of bytes actually read if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_read( uint32_t   file_id,
-              void     * buf,
-              uint32_t   count );
-
-/****************************************************************************************** 
- * This function returns an user pointer on the dirent structure describing the
- * next directory entry in the directory identified by the <dirp> argument.
- ******************************************************************************************
- * @ dirp     : [in]  user pointer on dirent array identifying the open directory.
- * @ buffer   : [out] pointer on user buffer for a pointer on dirent in user space.
- * @ return O if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_readdir( DIR            * dirp,
-                 struct dirent ** buffer );
-
-/****************************************************************************************** 
- * This function causes the file named <old> to be renamed as <new>.
- * If new exists, it is first removed.  Both old and new must be of the same type (both
- * must be either directories or non-directories) and must reside on the same file system.
- * It guarantees that an instance of <new> will always exist, even if the system should 
- * crash in the middle of the operation.
- ******************************************************************************************
- * @ old      : old file name.
- * @ new      : new file name.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_rename( char *old,
-                char *new );
-
-/****************************************************************************************** 
- * This function removes a directory file whose name is given by <pathname>.
- * The directory must not have any entries other than `.' and `..'.
- ******************************************************************************************
- * @ pathname   : pathname (can be relative or absolute).
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_rmdir( char * pathname );
-
-/****************************************************************************************** 
- * This function implement all operations on a POSIX unnamed semaphore,
- * that can be shared by threads running in different clusters.
- * The kernel structure representing a remote semaphore is in the remote_sem.h file,
- * and the code implementing the operations is in the remore_sem.c file.
- ******************************************************************************************
- * @ vaddr         : semaphore virtual address in user space == identifier.
- * @ operation     : SEM_INIT / SEM_DESTROY / SEM_GETVALUE / SEM_POST / SEM_WAIT.
- * @ init_value    : initial semaphore value.
- * @ current_value : pointer on buffer for current semaphore value.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_sem( void       * vaddr,
-             uint32_t     operation,
-             uint32_t     init_value,
-             uint32_t   * current_value );
-
-/****************************************************************************************** 
- * This function associate a specific signal handler to a given signal type.
- * The handlers for the SIGKILL and SIGSTOP signals cannot be redefined.
- ****************************************************************************************** 
- * @ sig_id    : index defining signal type (from 1 to 31).
- * @ handler   : pointer on fonction implementing the specific handler.
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_signal( uint32_t   sig_id,
-                void     * handler );
-
-/****************************************************************************************** 
- * This generic function implements all socket related syscalls.
- * The operation types mnemonics are defined in the <shared_socket> file.
- * The supported operations are defined in the <socket.h> & <socket.c> files.
- * This function ckecks the syscall arguments, and call the relevant kernel function.
- ******************************************************************************************
- * @ arg0       : operation type (mnemonics defined in shared_socket.h)
- * @ arg1       : depends on operation type
- * @ arg2       : depends on operation type
- * @ arg3       : depends on operation type
- * @ return 0 if success / return -1 if illegal argument.
- *****************************************************************************************/
-int sys_socket( reg_t   arg0,
-                reg_t   arg1,
-                reg_t   arg2,
-                reg_t   arg3 );
-
-/****************************************************************************************** 
- * This function  returns in the <stat> structure, defined in the "shared_syscalls.h" 
- * file, various informations on the file/directory identified by the <pathname> argument.
- * TODO only the <st_ino>, <st_mode>,<st_uid>,<st_gid>,<st_size> are set.
- ****************************************************************************************** 
- * @ pathname  : user pointer on file pathname.
- * @ stat      : user pointer on the stat structure.
- * @ returns O if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_stat( char        * pathname,
-              struct stat * stat );
-
-/****************************************************************************************** 
- * This function implements the "sync" system call.
- * It forces all modified pages in all kernel mappers to be copied to the IOC device.
- * It can be called by any thread running in any cluster.
- * TODO not implemented yet.
- ******************************************************************************************
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_sync( void );
-
-/****************************************************************************************** 
- * This function returns in the structure <tv>, defined in the time.h file,
- * the current time (in seconds & micro-seconds).
- * It is computed from the calling core descriptor.
- * The timezone is not supported.
- ******************************************************************************************
- * @ tv      : pointer on the timeval structure.
- * @ tz      : pointer on the timezone structure : must be NULL.       
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_timeofday( struct timeval  * tv,
-                   struct timezone * tz );
-
-/****************************************************************************************** 
- * This function requests a target thread identified by its <trdid> argument
- * to be cancelled. It calls the thread_kill() function to block the target thread
- * on the THREAD_BLOCKED_GLOBAL condition, and to set the THREAD_FLAG_REQ_DELETE.
- * The thread will be detached from its process, and the memory allocated to the thread
- * descriptor will be released by the scheduler at the next scheduling point.
- ******************************************************************************************
- * @ trdid   : thread identifier.
- * @ return 0 if success / return -1 if illegal argument.
- *****************************************************************************************/
-int sys_thread_cancel( trdid_t  trdid );
-
-/****************************************************************************************** 
- * This function creates a new user thread. The <user_attr> argument is a pointer
- * on astructure containing the thread attributes, defined in thread.h file.
- ******************************************************************************************
- * @ trdid_ptr   : [out] pointer on buffer for created thread trdid.
- * @ user_attr   : [in]  pointer on thread attributes structure.
- * @ start_func  : [in]  pointer on start function.
- * @ start_args  : [in]  pointer on start function arguments.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_thread_create( trdid_t               * trdid_ptr,
-                       struct pthread_attr_s * user_attr,
-                       void                  * start_func,
-                       void                  * start_args );
-
-/****************************************************************************************** 
- * This function detach a joinable thread.
- ******************************************************************************************
- * @ trdid   : thread identifier.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_thread_detach( trdid_t  trdid );
-
-/****************************************************************************************** 
- * This function terminates the execution of the calling user thread, and makes 
- * the <exit_status> pointer available to any successful pthread_join() with the 
- * terminating thread.
- * - If the calling thread is the main thread, it calls the sys_exit() function to delete
- *   completely the user process.  
- * - if the calling thread is not the main thread, it registers the <exit_status> pointer
- *   in the thread descriptor, and calls the thread_delete() function, that will set the
- *   THREAD_SIG_EXIT signal, set the THREAD_BLOCKED_GLOBAL bit in thread descriptor, and 
- *   deschedules. All memory allocated to the thread is released later by the scheduler.
- *   If the thread is in "detached" mode, the thread_delete() function implements
- *   the synchonisation with the joining thread.
- ******************************************************************************************
- * @ exit_status  : [out] pointer to be returned to joining thread if thread is attached.
- * @ return 0 if success / return -1 if all locks not released or illegal argument.
- *****************************************************************************************/
-int sys_thread_exit( void * exit_status );
-
-/****************************************************************************************** 
- * This blocking function suspend execution of the calling thread until completion 
- * of another target thread identified by the <trdid> argument.
- * The target thread must be joinable (running in ATTACHED mode), and must be different
- * from the calling thread.
- * If the <exit_value> argument is not NULL, the value passed to pthread_exit() by the 
- * target thread is stored in the location referenced by exit_value.
- ******************************************************************************************
- * @ trdid     : [in]  target thread identifier.
- * @ thread    : [out] buffer for exit_value returned by target thread. 
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_thread_join( trdid_t    trdid,
-                     void    ** exit_value );
-
-/****************************************************************************************** 
- * This function blocks the calling thread on the THREAD_BLOCKED_SLEEP condition,
- * and deschedules. When the <seconds> argument is non-zero, this argument defines
- * the sleeping time. When it is zero, the sleeping time is unbounded, and the thread
- * must be unblocked by the sys_thread_wakeup() function
- ******************************************************************************************
- * @ seconds : number of seconds of sleep / No alarm is activated when 0. 
- * @ return 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_thread_sleep( uint32_t seconds );
-
-/****************************************************************************************** 
- * This function unblock the thread identified by its <trdid> from the 
- * THREAD_BLOCKED_SLEEP condition, and cancel the registered alarm if required.
- ******************************************************************************************
- * @ trdid  : target thread identifier.
- * @ return 0 if success / return -1 if failure.
- *****************************************************************************************/
-int sys_thread_wakeup( trdid_t trdid );
-
-/****************************************************************************************** 
- * This function calls the scheduler for the core running the calling thread.
- ******************************************************************************************
- * @ return always 0.
- *****************************************************************************************/
-int sys_thread_yield( void );
-
-/****************************************************************************************** 
- * This debug function is used to activate / desactivate the context switches trace
- * for a core identified by the <cxy> and <lid> arguments.
- * It can be called by any other thread in the same process.
- ****************************************************************************************** 
- * @ active     : activate trace if true / desactivate trace if false.
- * @ cxy        : cluster identifier.
- * @ lid        : core local index.
- * @ returns O if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_trace( bool_t   active,
-               cxy_t    cxy, 
-               lid_t    lid );
-
-/****************************************************************************************** 
- * This function implement the operations related to User Thread Local Storage.
- * It is actually implemented as an uint32_t variable in the thread descriptor.
- ******************************************************************************************
- * @ operation  : UTLS operation type as defined below.
- * @ value      : argument value for the UTLS_SET operation.
- * @ return value for the UTLS_GET and UTLS_GET_ERRNO / return -1 if failure.
- *****************************************************************************************/
-int sys_utls( uint32_t operation,
-              uint32_t value );
-
-/****************************************************************************************** 
- * This function removes a directory entry identified by the <pathname> from the
- * directory, and decrement the link count of the file referenced by the link.
- * If the link count reduces to zero, and no process has the file open, then all resources
- * associated with the file are reclaimed.  If one or more process have the file open when
- * the last link is removed, the link is removed, but the removal of the file is delayed 
- * until all references to it have been closed.
- ******************************************************************************************
- * @ pathname   : pathname (can be relative or absolute).
- * @ returns 0 if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_unlink( char * pathname );
-
-/****************************************************************************************** 
- * This blocking function waits a change of a child process state, that can be:
- * - a termination of child following a process_make_exit().
- * - a termination of child following a process_make_kill().
- * - a blocking of child following a SIGSTOP signal.
- * In case of a multi-thread process, this function must be called by the main thread
- * runningin the reference cluster.
- * When a change has been observed, it returns the PID of the child process, and stores
- * in the <status> argument relevant information on the child state change.
- * The following macros can be used to extract information from status:
- * - WIFEXITED(status)   : is true if the child process terminated with an exit().
- * - WIFSIGNALED(status) : is true if the child process killed by a signal.
- * - WIFSTOPPED(status)  : is true if the child process is stopped by a signal.
- * - WEXITSTATUS(status) : returns the low-order 8 bits of the exit() argument.
- * If a parent process terminates without waiting for all child processes to terminate,
- * the remaining child processes are attached to the init process.
- * WARNING: negative values for the <pid> argument are not supported.
- ******************************************************************************************
- * @ searched_pid : searched child process identifier.
- * @ status       : [out] child termination status.
- * @ return child PID if success / return -1 if searched PID not found.
- *****************************************************************************************/
-int sys_wait( uint32_t * status );
-
-/****************************************************************************************** 
- * This function writes bytes to an open file identified by its file descriptor.
- * The file can be a regular file or character oriented device. For a regular file,
- * the target inode "size" field is updated if (offset + count) is larger than the
- * current "size" value. The size value registered in the mappers of the parent(s)
- * directory are not modified and will be asynchronously updated when the file is closed.
- * IRQs are enabled during this system call.
- ******************************************************************************************
- * @ file_id  : open file index in fd_array.
- * @ buf      : buffer virtual address in user space.
- * @ count    : number of bytes.
- * @ returns number of bytes actually written if success / returns -1 if failure.
- *****************************************************************************************/
-int sys_write( uint32_t   file_id,
-               void     * buf,
-               uint32_t   count );
+/********************************************************************************************* 
+ * This function TODO
+ ********************************************************************************************/
+int sys_ps( uint32_t cmd, 
+            pid_t    pid, 
+            uint32_t tid );
 
 
-#endif  // _SYSCALLS_H_
+
+#endif
Index: trunk/kernel/tags
===================================================================
--- trunk/kernel/tags	(revision 1)
+++ trunk/kernel/tags	(revision 1)
@@ -0,0 +1,5725 @@
+!_TAG_FILE_FORMAT	2	/extended format; --format=1 will not append ;" to lines/
+!_TAG_FILE_SORTED	1	/0=unsorted, 1=sorted, 2=foldcase/
+!_TAG_PROGRAM_AUTHOR	Darren Hiebert	/dhiebert@users.sourceforge.net/
+!_TAG_PROGRAM_NAME	Exuberant Ctags	//
+!_TAG_PROGRAM_URL	http://ctags.sourceforge.net	/official site/
+!_TAG_PROGRAM_VERSION	5.8	//
+A0	cpu/mipsel/cpu-regs.h	/^#define      A0 /;"	d
+A1	cpu/mipsel/cpu-regs.h	/^#define      A1 /;"	d
+A2	cpu/mipsel/cpu-regs.h	/^#define      A2 /;"	d
+A3	cpu/mipsel/cpu-regs.h	/^#define      A3 /;"	d
+ABS	libk/bits.h	/^#define ABS(/;"	d
+AF_AFFINITY	mm/kmem.h	/^#define AF_AFFINITY /;"	d
+AF_BOOT	mm/kmem.h	/^#define AF_BOOT /;"	d
+AF_EXCEPT	mm/kmem.h	/^#define AF_EXCEPT /;"	d
+AF_GETTTL	mm/kmem.h	/^#define AF_GETTTL(/;"	d
+AF_HINT_MASK	mm/kmem.h	/^#define AF_HINT_MASK /;"	d
+AF_KERNEL	mm/kmem.h	/^#define AF_KERNEL /;"	d
+AF_NONE	mm/kmem.h	/^#define AF_NONE /;"	d
+AF_NORMAL	mm/kmem.h	/^#define AF_NORMAL /;"	d
+AF_PGFAULT	mm/kmem.h	/^#define AF_PGFAULT /;"	d
+AF_PRIO	mm/kmem.h	/^#define AF_PRIO /;"	d
+AF_REMOTE	mm/kmem.h	/^#define AF_REMOTE /;"	d
+AF_SYS	mm/kmem.h	/^#define AF_SYS /;"	d
+AF_TTL_AVRG	mm/kmem.h	/^#define AF_TTL_AVRG /;"	d
+AF_TTL_HIGH	mm/kmem.h	/^#define AF_TTL_HIGH /;"	d
+AF_TTL_LOW	mm/kmem.h	/^#define AF_TTL_LOW /;"	d
+AF_TTL_MASK	mm/kmem.h	/^#define AF_TTL_MASK /;"	d
+AF_TTL_NORM	mm/kmem.h	/^#define AF_TTL_NORM /;"	d
+AF_URGENT	mm/kmem.h	/^#define AF_URGENT /;"	d
+AF_USER	mm/kmem.h	/^#define AF_USER /;"	d
+AF_USR	mm/kmem.h	/^#define AF_USR /;"	d
+AF_ZERO	mm/kmem.h	/^#define AF_ZERO /;"	d
+ALMOS_DATE	obj.tsar/kern/almOS-date.h	/^#define ALMOS_DATE /;"	d
+ALPHA	arch/ibmpc/arch.h	/^#define ALPHA /;"	d
+ALRM_INFO_ID	kern/kmagics.h	/^#define ALRM_INFO_ID /;"	d
+ARCH_HAS_BARRIERS	arch/tsar/arch.h	/^#define ARCH_HAS_BARRIERS /;"	d
+ARCH_HAS_BARRIERS	arch/tsar/arch.h	/^#undef ARCH_HAS_BARRIERS$/;"	d
+ARCH_HAS_BARRIERS	kern/hal-arch.h	/^#define ARCH_HAS_BARRIERS$/;"	d
+ARCH_PWR_IDLE	kern/hal-arch.h	/^	ARCH_PWR_IDLE,$/;"	e	enum:__anon16
+ARCH_PWR_SHUTDOWN	kern/hal-arch.h	/^	ARCH_PWR_SHUTDOWN$/;"	e	enum:__anon16
+ARCH_PWR_SLEEP	kern/hal-arch.h	/^	ARCH_PWR_SLEEP,$/;"	e	enum:__anon16
+ARCH_THREAD_PAGE_ORDER	arch/tsar/arch.h	/^#define ARCH_THREAD_PAGE_ORDER /;"	d
+ARCH_THREAD_PAGE_ORDER	arch/tsar/arch.h	/^#undef  ARCH_THREAD_PAGE_ORDER$/;"	d
+ARCH_THREAD_PAGE_ORDER	kern/hal-arch.h	/^#define ARCH_THREAD_PAGE_ORDER	/;"	d
+ARG_CHOOSER0	kern/rpc.h	/^#define ARG_CHOOSER0(/;"	d
+ARG_CHOOSER00	kern/rpc.h	/^#define ARG_CHOOSER00(/;"	d
+ARG_CHOOSER01	kern/rpc.h	/^#define ARG_CHOOSER01(/;"	d
+ARG_CHOOSER1	kern/rpc.h	/^#define ARG_CHOOSER1(/;"	d
+ARG_CHOOSER10	kern/rpc.h	/^#define ARG_CHOOSER10(/;"	d
+ARG_CHOOSER11	kern/rpc.h	/^#define ARG_CHOOSER11(/;"	d
+ARG_CHOOSER2	kern/rpc.h	/^#define ARG_CHOOSER2(/;"	d
+ARG_CHOOSER3	kern/rpc.h	/^#define ARG_CHOOSER3(/;"	d
+ARROUND_DOWN	libk/bits.h	/^#define ARROUND_DOWN(/;"	d
+ARROUND_UP	cpu/i386/boot.c	/^#define ARROUND_UP(/;"	d	file:
+ARROUND_UP	libk/bits.h	/^#define ARROUND_UP(/;"	d
+ASSERT	kern/kdmsg.h	/^#define ASSERT /;"	d
+AT	cpu/mipsel/cpu-regs.h	/^#define      AT /;"	d
+ATA0_DRIVE0	arch/ibmpc/segmentation.h	/^#define     ATA0_DRIVE0 /;"	d
+ATA0_DRIVE1	arch/ibmpc/segmentation.h	/^#define     ATA0_DRIVE1 /;"	d
+ATA1_DRIVE0	arch/ibmpc/segmentation.h	/^#define     ATA1_DRIVE0 /;"	d
+ATA1_DRIVE1	arch/ibmpc/segmentation.h	/^#define     ATA1_DRIVE1 /;"	d
+ATA_BASE	drivers/ibmpc/ata.c	/^#define ATA_BASE(/;"	d	file:
+ATA_BSY	drivers/ibmpc/ata.h	/^#define ATA_BSY	/;"	d
+ATA_BUSY	drivers/ibmpc/ata.h	/^#define ATA_BUSY	/;"	d
+ATA_CMD_REG	drivers/ibmpc/ata.h	/^#define ATA_CMD_REG /;"	d
+ATA_CORR	drivers/ibmpc/ata.h	/^#define ATA_CORR /;"	d
+ATA_COUNT_REG	drivers/ibmpc/ata.h	/^#define ATA_COUNT_REG /;"	d
+ATA_DATA_REG	drivers/ibmpc/ata.h	/^#define ATA_DATA_REG	/;"	d
+ATA_DOR_PORT	drivers/ibmpc/ata.h	/^#define ATA_DOR_PORT /;"	d
+ATA_DRDY	drivers/ibmpc/ata.h	/^#define ATA_DRDY	/;"	d
+ATA_DRIVE	drivers/ibmpc/ata.c	/^#define ATA_DRIVE(/;"	d	file:
+ATA_DRIVE_REG	drivers/ibmpc/ata.h	/^#define ATA_DRIVE_REG	/;"	d
+ATA_DRQ	drivers/ibmpc/ata.h	/^#define ATA_DRQ /;"	d
+ATA_DSC	drivers/ibmpc/ata.h	/^#define ATA_DSC /;"	d
+ATA_ERR	drivers/ibmpc/ata.h	/^#define ATA_ERR /;"	d
+ATA_ERROR	drivers/ibmpc/ata.h	/^#define ATA_ERROR	/;"	d
+ATA_ERROR_REG	drivers/ibmpc/ata.h	/^#define ATA_ERROR_REG	/;"	d
+ATA_IDENTIFY_CMD	drivers/ibmpc/ata.h	/^#define ATA_IDENTIFY_CMD /;"	d
+ATA_IDLE	drivers/ibmpc/ata.h	/^#define ATA_IDLE	/;"	d
+ATA_IDX	drivers/ibmpc/ata.h	/^#define ATA_IDX /;"	d
+ATA_LBA_CAP	drivers/ibmpc/ata.h	/^#define ATA_LBA_CAP /;"	d
+ATA_LBA_HIGH_REG	drivers/ibmpc/ata.h	/^#define ATA_LBA_HIGH_REG	/;"	d
+ATA_LBA_LOW_REG	drivers/ibmpc/ata.h	/^#define ATA_LBA_LOW_REG	/;"	d
+ATA_LBA_MID_REG	drivers/ibmpc/ata.h	/^#define ATA_LBA_MID_REG	/;"	d
+ATA_PRECOMPENSATION_REG	drivers/ibmpc/ata.h	/^#define ATA_PRECOMPENSATION_REG	/;"	d
+ATA_READ_CMD	drivers/ibmpc/ata.h	/^#define ATA_READ_CMD /;"	d
+ATA_READ_ERROR	drivers/ibmpc/ata.h	/^#define ATA_READ_ERROR	/;"	d
+ATA_READ_SUCCESS	drivers/ibmpc/ata.h	/^#define ATA_READ_SUCCESS	/;"	d
+ATA_STATUS_REG	drivers/ibmpc/ata.h	/^#define ATA_STATUS_REG /;"	d
+ATA_WFT	drivers/ibmpc/ata.h	/^#define ATA_WFT /;"	d
+ATA_WRITE_CMD	drivers/ibmpc/ata.h	/^#define ATA_WRITE_CMD /;"	d
+ATA_WRITE_ERROR	drivers/ibmpc/ata.h	/^#define ATA_WRITE_ERROR	/;"	d
+ATA_WRITE_SUCCESS	drivers/ibmpc/ata.h	/^#define ATA_WRITE_SUCCESS	/;"	d
+ATOMIC_INITIALIZER	kern/atomic.h	/^#define ATOMIC_INITIALIZER /;"	d
+Arch_cid_To_Almos_cid	arch/tsar/arch_init.c	/^cid_t Arch_cid_To_Almos_cid[CLUSTER_NR]; \/\/address of info->arch_cid_to_cid array$/;"	v
+BARRIER_DESTROY	kern/barrier.h	/^	BARRIER_DESTROY,$/;"	e	enum:__anon4
+BARRIER_ID	kern/kmagics.h	/^#define BARRIER_ID /;"	d
+BARRIER_INIT_PRIVATE	kern/barrier.h	/^	BARRIER_INIT_PRIVATE,$/;"	e	enum:__anon4
+BARRIER_INIT_SHARED	kern/barrier.h	/^	BARRIER_INIT_SHARED,$/;"	e	enum:__anon4
+BARRIER_WAIT	kern/barrier.h	/^	BARRIER_WAIT,$/;"	e	enum:__anon4
+BARRIER_WQDB_NR	kern/barrier.h	/^#define BARRIER_WQDB_NR /;"	d
+BITMAP_DECLARE	libk/bits.h	/^#define BITMAP_DECLARE(/;"	d
+BITMAP_SIZE	libk/bits.h	/^#define BITMAP_SIZE(/;"	d
+BLKIO_H_	kern/blkio.h	/^#define BLKIO_H_$/;"	d
+BLKIO_INIT	kern/blkio.h	/^#define BLKIO_INIT /;"	d
+BLKIO_RD	kern/blkio.h	/^#define BLKIO_RD /;"	d
+BLKIO_SYNC	kern/blkio.h	/^#define BLKIO_SYNC /;"	d
+BLK_DEV_BLOCK_SIZE_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_BLOCK_SIZE_REG	/;"	d	file:
+BLK_DEV_BUFFER_EXT_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_BUFFER_EXT_REG /;"	d	file:
+BLK_DEV_BUFFER_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_BUFFER_REG	/;"	d	file:
+BLK_DEV_BUSY	drivers/soclib/soclib_block.c	/^#define BLK_DEV_BUSY	/;"	d	file:
+BLK_DEV_COUNT_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_COUNT_REG	/;"	d	file:
+BLK_DEV_ERROR	drivers/soclib/soclib_block.c	/^#define BLK_DEV_ERROR	/;"	d	file:
+BLK_DEV_IDLE	drivers/soclib/soclib_block.c	/^#define BLK_DEV_IDLE	/;"	d	file:
+BLK_DEV_IRQ_ENABLE_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_IRQ_ENABLE_REG	/;"	d	file:
+BLK_DEV_LBA_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_LBA_REG	/;"	d	file:
+BLK_DEV_NOOP	drivers/soclib/soclib_block.c	/^#define BLK_DEV_NOOP	/;"	d	file:
+BLK_DEV_OP_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_OP_REG	/;"	d	file:
+BLK_DEV_READ	drivers/soclib/soclib_block.c	/^#define BLK_DEV_READ	/;"	d	file:
+BLK_DEV_READ_ERROR	drivers/soclib/soclib_block.c	/^#define BLK_DEV_READ_ERROR	/;"	d	file:
+BLK_DEV_READ_SUCCESS	drivers/soclib/soclib_block.c	/^#define BLK_DEV_READ_SUCCESS	/;"	d	file:
+BLK_DEV_SIZE_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_SIZE_REG	/;"	d	file:
+BLK_DEV_STATUS_REG	drivers/soclib/soclib_block.c	/^#define BLK_DEV_STATUS_REG	/;"	d	file:
+BLK_DEV_WRITE	drivers/soclib/soclib_block.c	/^#define BLK_DEV_WRITE	/;"	d	file:
+BLK_DEV_WRITE_ERROR	drivers/soclib/soclib_block.c	/^#define BLK_DEV_WRITE_ERROR	/;"	d	file:
+BLK_DEV_WRITE_SUCCESS	drivers/soclib/soclib_block.c	/^#define BLK_DEV_WRITE_SUCCESS	/;"	d	file:
+BLOCK_DEV_NR	drivers/soclib/soclib_block.c	/^#define BLOCK_DEV_NR /;"	d	file:
+BOOT	kern/kdmsg.h	/^#define BOOT /;"	d
+BOOT_SIGNAL	kern/kern_init.c	/^#define BOOT_SIGNAL /;"	d	file:
+BPB_BkBootSec	fs/fat32/fat32-private.h	/^	uint16_t	BPB_BkBootSec;$/;"	m	struct:vfat_bpb_s
+BPB_BytsPerSec	fs/fat32/fat32-private.h	/^	uint16_t	BPB_BytsPerSec;$/;"	m	struct:vfat_bpb_s
+BPB_ExtFlags	fs/fat32/fat32-private.h	/^	uint16_t	BPB_ExtFlags;$/;"	m	struct:vfat_bpb_s
+BPB_FATSz16	fs/fat32/fat32-private.h	/^	uint16_t	BPB_FATSz16;$/;"	m	struct:vfat_bpb_s
+BPB_FATSz32	fs/fat32/fat32-private.h	/^	uint32_t	BPB_FATSz32;$/;"	m	struct:vfat_bpb_s
+BPB_FSInfo	fs/fat32/fat32-private.h	/^	uint16_t	BPB_FSInfo;$/;"	m	struct:vfat_bpb_s
+BPB_HiddSec	fs/fat32/fat32-private.h	/^	uint32_t	BPB_HiddSec;$/;"	m	struct:vfat_bpb_s
+BPB_Media	fs/fat32/fat32-private.h	/^	uint8_t	        BPB_Media;$/;"	m	struct:vfat_bpb_s
+BPB_NumFATs	fs/fat32/fat32-private.h	/^	uint8_t	        BPB_NumFATs;$/;"	m	struct:vfat_bpb_s
+BPB_NumHeads	fs/fat32/fat32-private.h	/^	uint16_t	BPB_NumHeads;$/;"	m	struct:vfat_bpb_s
+BPB_Reserved	fs/fat32/fat32-private.h	/^	uint8_t	        BPB_Reserved[12];$/;"	m	struct:vfat_bpb_s
+BPB_RootClus	fs/fat32/fat32-private.h	/^	uint32_t	BPB_RootClus;$/;"	m	struct:vfat_bpb_s
+BPB_RootEntCnt	fs/fat32/fat32-private.h	/^	uint16_t	BPB_RootEntCnt;$/;"	m	struct:vfat_bpb_s
+BPB_RsvdSecCnt	fs/fat32/fat32-private.h	/^	uint16_t	BPB_RsvdSecCnt;$/;"	m	struct:vfat_bpb_s
+BPB_SecPerClus	fs/fat32/fat32-private.h	/^	uint8_t	        BPB_SecPerClus;$/;"	m	struct:vfat_bpb_s
+BPB_SecPerTrk	fs/fat32/fat32-private.h	/^	uint16_t	BPB_SecPerTrk;$/;"	m	struct:vfat_bpb_s
+BPB_TotSec16	fs/fat32/fat32-private.h	/^	uint16_t	BPB_TotSec16;$/;"	m	struct:vfat_bpb_s
+BPB_TotSec32	fs/fat32/fat32-private.h	/^	uint32_t	BPB_TotSec32;$/;"	m	struct:vfat_bpb_s
+BPB_VFVer	fs/fat32/fat32-private.h	/^	uint16_t	BPB_VFVer;$/;"	m	struct:vfat_bpb_s
+BS_BootSig	fs/fat32/fat32-private.h	/^	uint8_t	        BS_BootSig;$/;"	m	struct:vfat_bpb_s
+BS_DrvNum	fs/fat32/fat32-private.h	/^	uint8_t	        BS_DrvNum;$/;"	m	struct:vfat_bpb_s
+BS_FilSysType	fs/fat32/fat32-private.h	/^	uint8_t	        BS_FilSysType[8];$/;"	m	struct:vfat_bpb_s
+BS_OEMName	fs/fat32/fat32-private.h	/^	uint8_t         BS_OEMName[8];$/;"	m	struct:vfat_bpb_s
+BS_Reserved1	fs/fat32/fat32-private.h	/^	uint8_t	        BS_Reserved1;$/;"	m	struct:vfat_bpb_s
+BS_VolID	fs/fat32/fat32-private.h	/^	uint32_t	BS_VolID;$/;"	m	struct:vfat_bpb_s
+BS_VolLab	fs/fat32/fat32-private.h	/^	uint8_t	        BS_VolLab[11];$/;"	m	struct:vfat_bpb_s
+BS_jmpBoot	fs/fat32/fat32-private.h	/^	uint8_t         BS_jmpBoot[3];$/;"	m	struct:vfat_bpb_s
+BUFFER_SIZE	ksh/eomtkp.c	/^#define BUFFER_SIZE /;"	d	file:
+BUFFER_SIZE	ksh/eomtkp.c	/^#undef BUFFER_SIZE /;"	d	file:
+BUFFER_SIZE	ksh/kminiShell.h	/^#define BUFFER_SIZE /;"	d
+BUFFER_SIZE	libk/elf.c	/^#define BUFFER_SIZE /;"	d	file:
+CACHELINE	cpu/mipsel/cpu-asm.h	/^uint_t cpu_gid_tbl[CPU_PER_CLUSTER] CACHELINE;$/;"	v
+CACHELINE	kern/cluster.h	/^	uint_t val CACHELINE;$/;"	m	struct:cluster_key_s
+CACHELINE	kern/dqdt.h	/^	uint_t   pages_tbl[CONFIG_PPM_MAX_ORDER] CACHELINE;$/;"	m	struct:dqdt_indicators_s
+CACHELINE	kern/event.h	/^	volatile uint_t prio CACHELINE;$/;"	m	struct:event_listner_s
+CACHELINE	kern/mcs_sync.h	/^	char        *name CACHELINE;$/;"	m	struct:mcs_barrier_s
+CACHELINE	kern/mcs_sync.h	/^	char        *name CACHELINE;$/;"	m	struct:mcs_lock_s
+CACHELINE	kern/spinlock.h	/^}CACHELINE;$/;"	v	typeref:struct:spinlock_s
+CACHELINE	libk/types.h	/^#define CACHELINE /;"	d
+CACHE_LINE_SIZE	arch/ibmpc/arch.h	/^#define CACHE_LINE_SIZE /;"	d
+CACHE_LINE_SIZE	arch/tsar/arch.h	/^#define CACHE_LINE_SIZE /;"	d
+CACHE_LINE_SIZE	mm/heap_manager.c	/^#define CACHE_LINE_SIZE /;"	d	file:
+CFILES	Makefile	/^CFILES=	$(foreach DIR,$(DIRS),$(wildcard $(DIR)\/*.c))$/;"	m
+CFLAGS	Makefile	/^CFLAGS  = 	$(INCLUDES) -fno-builtin -static -Wall -Werror -MMD -Wundef$/;"	m
+CHECKSUM	cpu/i386/__boot.S	/^#define CHECKSUM -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)$/;"	d
+CID_NULL	libk/stdint.h	/^#define CID_NULL /;"	d
+CLUSTER_CPU_ONLY	kern/cluster.h	/^#define  CLUSTER_CPU_ONLY /;"	d
+CLUSTER_DOWN	kern/cluster.h	/^#define  CLUSTER_DOWN /;"	d
+CLUSTER_IO	kern/cluster.h	/^#define  CLUSTER_IO /;"	d
+CLUSTER_MEM_ONLY	kern/cluster.h	/^#define  CLUSTER_MEM_ONLY /;"	d
+CLUSTER_NR	arch/ibmpc/arch.h	/^#define CLUSTER_NR /;"	d
+CLUSTER_NR	arch/ibmpc/arch.h	/^#undef CLUSTER_NR$/;"	d
+CLUSTER_NR	arch/tsar/arch.h	/^#define CLUSTER_NR /;"	d
+CLUSTER_NR	arch/tsar/arch.h	/^#undef CLUSTER_NR$/;"	d
+CLUSTER_NR	kern/hal-arch.h	/^#define CLUSTER_NR$/;"	d
+CLUSTER_STANDBY	kern/cluster.h	/^#define  CLUSTER_STANDBY /;"	d
+CLUSTER_TOTAL_KEYS_NR	kern/cluster.h	/^#define  CLUSTER_TOTAL_KEYS_NR /;"	d
+CLUSTER_UP	kern/cluster.h	/^#define  CLUSTER_UP /;"	d
+COMMA_PLACE00	kern/rpc.h	/^#define COMMA_PLACE00(/;"	d
+COMMA_PLACE01	kern/rpc.h	/^#define COMMA_PLACE01(/;"	d
+COMMA_PLACE10	kern/rpc.h	/^#define COMMA_PLACE10(/;"	d
+COMMA_PLACE11	kern/rpc.h	/^#define COMMA_PLACE11(/;"	d
+COMMA_PLACE2	kern/rpc.h	/^#define COMMA_PLACE2(/;"	d
+CONCATENATE	kern/rpc.h	/^#define CONCATENATE(/;"	d
+CONCATENATE1	kern/rpc.h	/^#define CONCATENATE1(/;"	d
+CONCATENATE2	kern/rpc.h	/^#define CONCATENATE2(/;"	d
+COND_VAR_ID	kern/kmagics.h	/^#define COND_VAR_ID /;"	d
+CONFIG_ALMOS_LIST_DEBUG	kern/kernel-config.h	/^#define CONFIG_ALMOS_LIST_DEBUG	/;"	d
+CONFIG_ALMOS_VERSION	kern/kernel-config.h	/^#define CONFIG_ALMOS_VERSION /;"	d
+CONFIG_ARCH_HAS_BARRIERS	arch/tsar/arch-config.h	/^#define CONFIG_ARCH_HAS_BARRIERS /;"	d
+CONFIG_ARCH_NAME	arch/tsar/arch-config.h	/^#define CONFIG_ARCH_NAME /;"	d
+CONFIG_BACKOFF_SPINLOCK	cpu/i386/cpu-config.h	/^#define CONFIG_BACKOFF_SPINLOCK /;"	d
+CONFIG_BACKOFF_SPINLOCK	cpu/mipsel/cpu-config.h	/^#define CONFIG_BACKOFF_SPINLOCK /;"	d
+CONFIG_BARRIER_ACTIVE_WAIT	kern/kernel-config.h	/^#define CONFIG_BARRIER_ACTIVE_WAIT /;"	d
+CONFIG_BARRIER_BORADCAST_UREAD	kern/kernel-config.h	/^#define CONFIG_BARRIER_BORADCAST_UREAD /;"	d
+CONFIG_BARRIER_MAX	mm/mm-config.h	/^#define CONFIG_BARRIER_MAX /;"	d
+CONFIG_BARRIER_MIN	mm/mm-config.h	/^#define CONFIG_BARRIER_MIN /;"	d
+CONFIG_BARRIER_WQDB_NR	kern/kernel-config.h	/^#define CONFIG_BARRIER_WQDB_NR /;"	d
+CONFIG_BC_DEBUG	kern/kernel-config.h	/^#define CONFIG_BC_DEBUG /;"	d
+CONFIG_BC_INSTRUMENT	kern/kernel-config.h	/^#define CONFIG_BC_INSTRUMENT /;"	d
+CONFIG_BLKIO_DEBUG	kern/kernel-config.h	/^#define CONFIG_BLKIO_DEBUG /;"	d
+CONFIG_BLKIO_MAX	mm/mm-config.h	/^#define CONFIG_BLKIO_MAX /;"	d
+CONFIG_BLKIO_MIN	mm/mm-config.h	/^#define CONFIG_BLKIO_MIN /;"	d
+CONFIG_BOOT_CLUSTER_ID	arch/ibmpc/arch-config.h	/^#define CONFIG_BOOT_CLUSTER_ID /;"	d
+CONFIG_BOOT_CPU_ID	arch/ibmpc/arch-config.h	/^#define CONFIG_BOOT_CPU_ID /;"	d
+CONFIG_CACHE_LINE_LENGTH	cpu/i386/cpu-config.h	/^#define CONFIG_CACHE_LINE_LENGTH /;"	d
+CONFIG_CACHE_LINE_LENGTH	cpu/mipsel/cpu-config.h	/^#define CONFIG_CACHE_LINE_LENGTH /;"	d
+CONFIG_CACHE_LINE_POW	cpu/mipsel/cpu-config.h	/^#define CONFIG_CACHE_LINE_POW	/;"	d
+CONFIG_CACHE_LINE_SIZE	cpu/i386/cpu-config.h	/^#define CONFIG_CACHE_LINE_SIZE /;"	d
+CONFIG_CACHE_LINE_SIZE	cpu/mipsel/cpu-config.h	/^#define CONFIG_CACHE_LINE_SIZE /;"	d
+CONFIG_CLUSTER_BITS_NR	arch/ibmpc/arch-config.h	/^#define CONFIG_CLUSTER_BITS_NR /;"	d
+CONFIG_CLUSTER_KEYS_NR	kern/kernel-config.h	/^#define CONFIG_CLUSTER_KEYS_NR /;"	d
+CONFIG_CLUSTER_NR	arch/ibmpc/arch-config.h	/^#define CONFIG_CLUSTER_NR /;"	d
+CONFIG_CONDTION_VAR_MAX	mm/mm-config.h	/^#define CONFIG_CONDTION_VAR_MAX /;"	d
+CONFIG_CONDTION_VAR_MIN	mm/mm-config.h	/^#define CONFIG_CONDTION_VAR_MIN /;"	d
+CONFIG_CPU_64BITS	cpu/mipsel/cpu-config.h	/^#define CONFIG_CPU_64BITS /;"	d
+CONFIG_CPU_ABI_NAME	cpu/mipsel/cpu-config.h	/^#define CONFIG_CPU_ABI_NAME /;"	d
+CONFIG_CPU_BACKOFF_SPINLOCK	cpu/i386/cpu-config.h	/^#define CONFIG_CPU_BACKOFF_SPINLOCK /;"	d
+CONFIG_CPU_BACKOFF_SPINLOCK	cpu/mipsel/cpu-config.h	/^#define CONFIG_CPU_BACKOFF_SPINLOCK /;"	d
+CONFIG_CPU_BALANCING_PERIOD	kern/kernel-config.h	/^#define CONFIG_CPU_BALANCING_PERIOD /;"	d
+CONFIG_CPU_BITS_NR	arch/ibmpc/arch-config.h	/^#define CONFIG_CPU_BITS_NR /;"	d
+CONFIG_CPU_BYTE_ORDER	cpu/mipsel/cpu-config.h	/^#define CONFIG_CPU_BYTE_ORDER /;"	d
+CONFIG_CPU_CHECK_EVERY	kern/kernel-config.h	/^#define CONFIG_CPU_CHECK_EVERY	/;"	d
+CONFIG_CPU_IRQ_NR	cpu/i386/cpu-config.h	/^#define CONFIG_CPU_IRQ_NR /;"	d
+CONFIG_CPU_IRQ_NR	cpu/mipsel/cpu-config.h	/^#define CONFIG_CPU_IRQ_NR /;"	d
+CONFIG_CPU_LOAD_BALANCING	kern/kernel-config.h	/^#define CONFIG_CPU_LOAD_BALANCING /;"	d
+CONFIG_CPU_LOAD_PERIOD	kern/kernel-config.h	/^#define CONFIG_CPU_LOAD_PERIOD /;"	d
+CONFIG_CPU_NAME	cpu/mipsel/cpu-config.h	/^#define CONFIG_CPU_NAME /;"	d
+CONFIG_CPU_NR	arch/ibmpc/arch-config.h	/^#define CONFIG_CPU_NR /;"	d
+CONFIG_CPU_PER_CLUSTER_NR	arch/ibmpc/arch-config.h	/^#define CONFIG_CPU_PER_CLUSTER_NR /;"	d
+CONFIG_CPU_TRACE	kern/kernel-config.h	/^#define CONFIG_CPU_TRACE /;"	d
+CONFIG_CPU_TYPE	cpu/mipsel/cpu-config.h	/^#define CONFIG_CPU_TYPE /;"	d
+CONFIG_DEVFS_CTX_MAX	mm/mm-config.h	/^#define CONFIG_DEVFS_CTX_MAX /;"	d
+CONFIG_DEVFS_CTX_MIN	mm/mm-config.h	/^#define CONFIG_DEVFS_CTX_MIN /;"	d
+CONFIG_DEVFS_DEBUG	kern/kernel-config.h	/^#define CONFIG_DEVFS_DEBUG /;"	d
+CONFIG_DEVFS_FILE_MAX	mm/mm-config.h	/^#define CONFIG_DEVFS_FILE_MAX /;"	d
+CONFIG_DEVFS_FILE_MIN	mm/mm-config.h	/^#define CONFIG_DEVFS_FILE_MIN /;"	d
+CONFIG_DEVFS_NODE_MAX	mm/mm-config.h	/^#define CONFIG_DEVFS_NODE_MAX /;"	d
+CONFIG_DEVFS_NODE_MIN	mm/mm-config.h	/^#define CONFIG_DEVFS_NODE_MIN /;"	d
+CONFIG_DEVREGION_SIZE	arch/tsar/arch-config.h	/^ #define CONFIG_DEVREGION_SIZE /;"	d
+CONFIG_DEV_STDERR	kern/kernel-config.h	/^#define CONFIG_DEV_STDERR /;"	d
+CONFIG_DEV_STDIN	kern/kernel-config.h	/^#define CONFIG_DEV_STDIN /;"	d
+CONFIG_DEV_STDOUT	kern/kernel-config.h	/^#define CONFIG_DEV_STDOUT /;"	d
+CONFIG_DEV_VERSION	kern/kernel-config.h	/^#define CONFIG_DEV_VERSION /;"	d
+CONFIG_DIRECT_SPINLOCK	cpu/i386/cpu-config.h	/^#define CONFIG_DIRECT_SPINLOCK /;"	d
+CONFIG_DIRECT_SPINLOCK	cpu/mipsel/cpu-config.h	/^#define CONFIG_DIRECT_SPINLOCK /;"	d
+CONFIG_DMA_RQ_KCM_MAX	mm/mm-config.h	/^#define CONFIG_DMA_RQ_KCM_MAX /;"	d
+CONFIG_DMA_RQ_KCM_MIN	mm/mm-config.h	/^#define CONFIG_DMA_RQ_KCM_MIN /;"	d
+CONFIG_DMSG_BOOT_TTY	arch/ibmpc/arch-config.h	/^#define CONFIG_DMSG_BOOT_TTY /;"	d
+CONFIG_DMSG_EXCEPT_TTY	arch/ibmpc/arch-config.h	/^#define CONFIG_DMSG_EXCEPT_TTY /;"	d
+CONFIG_DMSG_ISR_TTY	arch/ibmpc/arch-config.h	/^#define CONFIG_DMSG_ISR_TTY /;"	d
+CONFIG_DMSG_KLOG_TTY	arch/ibmpc/arch-config.h	/^#define CONFIG_DMSG_KLOG_TTY /;"	d
+CONFIG_DMSG_LEVEL	kern/kernel-config.h	/^#define CONFIG_DMSG_LEVEL /;"	d
+CONFIG_DQDT_DEBUG	kern/kernel-config.h	/^#define CONFIG_DQDT_DEBUG /;"	d
+CONFIG_DQDT_LEVELS_NR	kern/kernel-config.h	/^#define CONFIG_DQDT_LEVELS_NR /;"	d
+CONFIG_DQDT_MGR_PERIOD	kern/kernel-config.h	/^#define CONFIG_DQDT_MGR_PERIOD /;"	d
+CONFIG_DQDT_ROOTMGR_PERIOD	kern/kernel-config.h	/^#define CONFIG_DQDT_ROOTMGR_PERIOD /;"	d
+CONFIG_DQDT_WAIT_FOR_UPDATE	kern/kernel-config.h	/^#define CONFIG_DQDT_WAIT_FOR_UPDATE /;"	d
+CONFIG_ELF_DEBUG	kern/kernel-config.h	/^#define CONFIG_ELF_DEBUG /;"	d
+CONFIG_ENABLE_TASK_TRACE	kern/kernel-config.h	/^#define CONFIG_ENABLE_TASK_TRACE /;"	d
+CONFIG_ENABLE_THREAD_TRACE	kern/kernel-config.h	/^#define CONFIG_ENABLE_THREAD_TRACE /;"	d
+CONFIG_ENV_MAX_SIZE	kern/kernel-config.h	/^#define CONFIG_ENV_MAX_SIZE /;"	d
+CONFIG_EXEC_DEBUG	kern/kernel-config.h	/^#define CONFIG_EXEC_DEBUG /;"	d
+CONFIG_EXEC_LOCAL	kern/kernel-config.h	/^#define CONFIG_EXEC_LOCAL /;"	d
+CONFIG_EXT2_CTX_MAX	mm/mm-config.h	/^#define CONFIG_EXT2_CTX_MAX /;"	d
+CONFIG_EXT2_CTX_MIN	mm/mm-config.h	/^#define CONFIG_EXT2_CTX_MIN /;"	d
+CONFIG_EXT2_DEBUG	kern/kernel-config.h	/^#define CONFIG_EXT2_DEBUG /;"	d
+CONFIG_EXT2_FILE_MAX	mm/mm-config.h	/^#define CONFIG_EXT2_FILE_MAX /;"	d
+CONFIG_EXT2_FILE_MIN	mm/mm-config.h	/^#define CONFIG_EXT2_FILE_MIN /;"	d
+CONFIG_EXT2_NODE_MAX	mm/mm-config.h	/^#define CONFIG_EXT2_NODE_MAX /;"	d
+CONFIG_EXT2_NODE_MIN	mm/mm-config.h	/^#define CONFIG_EXT2_NODE_MIN /;"	d
+CONFIG_FB_USE_DMA	arch/ibmpc/arch-config.h	/^#define CONFIG_FB_USE_DMA /;"	d
+CONFIG_FB_USE_DMA	arch/tsar/arch-config.h	/^#define CONFIG_FB_USE_DMA /;"	d
+CONFIG_FDINFO_KCM_MAX	mm/mm-config.h	/^#define CONFIG_FDINFO_KCM_MAX /;"	d
+CONFIG_FDINFO_KCM_MIN	mm/mm-config.h	/^#define CONFIG_FDINFO_KCM_MIN /;"	d
+CONFIG_FIFO_SUBSYSTEM	kern/kernel-config.h	/^#define CONFIG_FIFO_SUBSYSTEM /;"	d
+CONFIG_FORK_DEBUG	kern/kernel-config.h	/^#define CONFIG_FORK_DEBUG /;"	d
+CONFIG_GLOBAL_CLUSTERS_ORDER	kern/kernel-config.h	/^#define CONFIG_GLOBAL_CLUSTERS_ORDER /;"	d
+CONFIG_GLOBAL_CORES_ORDER	kern/kernel-config.h	/^#define CONFIG_GLOBAL_CORES_ORDER /;"	d
+CONFIG_HTBL_DEBUG	kern/kernel-config.h	/^#define CONFIG_HTBL_DEBUG /;"	d
+CONFIG_IO_CLUSTER_ID	arch/ibmpc/arch-config.h	/^#define CONFIG_IO_CLUSTER_ID /;"	d
+CONFIG_KCM_DEBUG	kern/kernel-config.h	/^#define CONFIG_KCM_DEBUG /;"	d
+CONFIG_KERNEL_LIMIT	arch/tsar/arch-config.h	/^ #define CONFIG_KERNEL_LIMIT /;"	d
+CONFIG_KERNEL_OFFSET	arch/tsar/arch-config.h	/^ #define CONFIG_KERNEL_OFFSET /;"	d
+CONFIG_KERNEL_REPLICATE	kern/kernel-config.h	/^#define CONFIG_KERNEL_REPLICATE /;"	d
+CONFIG_KEYREC_MAX	mm/mm-config.h	/^#define CONFIG_KEYREC_MAX /;"	d
+CONFIG_KEYREC_MIN	mm/mm-config.h	/^#define CONFIG_KEYREC_MIN /;"	d
+CONFIG_KFIFO_DEBUG	kern/kernel-config.h	/^#define CONFIG_KFIFO_DEBUG /;"	d
+CONFIG_KHEAP_ORDER	mm/mm-config.h	/^#define CONFIG_KHEAP_ORDER /;"	d
+CONFIG_KHM_DEBUG	kern/kernel-config.h	/^#define CONFIG_KHM_DEBUG /;"	d
+CONFIG_KMEM_DEBUG	kern/kernel-config.h	/^#define CONFIG_KMEM_DEBUG /;"	d
+CONFIG_KSH_TTY	arch/ibmpc/arch-config.h	/^#define CONFIG_KSH_TTY /;"	d
+CONFIG_LOCAL_PHYSICAL_BITS	arch/tsar/arch-config.h	/^#define CONFIG_LOCAL_PHYSICAL_BITS /;"	d
+CONFIG_LOCKS_DEBUG	kern/kernel-config.h	/^#define CONFIG_LOCKS_DEBUG /;"	d
+CONFIG_MAPPER_AUTO_MGRT	kern/kernel-config.h	/^#define CONFIG_MAPPER_AUTO_MGRT /;"	d
+CONFIG_MAPPER_DEBUG	kern/kernel-config.h	/^#define CONFIG_MAPPER_DEBUG /;"	d
+CONFIG_MAPPER_MAX	mm/mm-config.h	/^#define CONFIG_MAPPER_MAX /;"	d
+CONFIG_MAPPER_MIN	mm/mm-config.h	/^#define CONFIG_MAPPER_MIN /;"	d
+CONFIG_MAX_CLUSTER_NR	kern/kernel-config.h	/^#define CONFIG_MAX_CLUSTER_NR /;"	d
+CONFIG_MAX_CLUSTER_ROOT	kern/kernel-config.h	/^#define CONFIG_MAX_CLUSTER_ROOT /;"	d
+CONFIG_MAX_CPU_PER_CLUSTER_NR	kern/kernel-config.h	/^#define CONFIG_MAX_CPU_PER_CLUSTER_NR /;"	d
+CONFIG_MAX_DEVICE_NR	kern/kernel-config.h	/^#define CONFIG_MAX_DEVICE_NR /;"	d
+CONFIG_MAX_DQDT_DEPTH	kern/kernel-config.h	/^#define CONFIG_MAX_DQDT_DEPTH /;"	d
+CONFIG_MEM_CHECK	kern/kernel-config.h	/^#define CONFIG_MEM_CHECK /;"	d
+CONFIG_METAFS_DEBUG	kern/kernel-config.h	/^#define CONFIG_METAFS_DEBUG /;"	d
+CONFIG_PHYSICAL_BITS	arch/tsar/arch-config.h	/^#define CONFIG_PHYSICAL_BITS	/;"	d
+CONFIG_PID_DEBUG	kern/kernel-config.h	/^#define CONFIG_PID_DEBUG /;"	d
+CONFIG_PPM_KPRIO_PGMIN	mm/mm-config.h	/^#define CONFIG_PPM_KPRIO_PGMIN /;"	d
+CONFIG_PPM_MAX_ORDER	mm/mm-config.h	/^#define CONFIG_PPM_MAX_ORDER /;"	d
+CONFIG_PPM_UPRIO_PGMIN	mm/mm-config.h	/^#define CONFIG_PPM_UPRIO_PGMIN /;"	d
+CONFIG_PPM_URGENT_PGMIN	mm/mm-config.h	/^#define CONFIG_PPM_URGENT_PGMIN /;"	d
+CONFIG_PPN_BITS_NR	arch/tsar/arch-config.h	/^#define CONFIG_PPN_BITS_NR /;"	d
+CONFIG_PTHREAD_STACK_MIN	kern/kernel-config.h	/^#define CONFIG_PTHREAD_STACK_MIN /;"	d
+CONFIG_PTHREAD_STACK_SIZE	kern/kernel-config.h	/^#define CONFIG_PTHREAD_STACK_SIZE /;"	d
+CONFIG_PTHREAD_THREADS_MAX	kern/kernel-config.h	/^#define CONFIG_PTHREAD_THREADS_MAX /;"	d
+CONFIG_RADIX_NODE_MAX	mm/mm-config.h	/^#define CONFIG_RADIX_NODE_MAX /;"	d
+CONFIG_RADIX_NODE_MIN	mm/mm-config.h	/^#define CONFIG_RADIX_NODE_MIN /;"	d
+CONFIG_RAMFS_FILE_MAX	mm/mm-config.h	/^#define CONFIG_RAMFS_FILE_MAX	/;"	d
+CONFIG_RAMFS_FILE_MIN	mm/mm-config.h	/^#define CONFIG_RAMFS_FILE_MIN /;"	d
+CONFIG_REL_KFIFO_SIZE	kern/kernel-config.h	/^#define CONFIG_REL_KFIFO_SIZE /;"	d
+CONFIG_REMOTE_THREAD_CREATE	kern/kernel-config.h	/^#define CONFIG_REMOTE_THREAD_CREATE /;"	d
+CONFIG_ROOTFS_IS_EXT2	kern/kernel-config.h	/^#define CONFIG_ROOTFS_IS_EXT2 /;"	d
+CONFIG_ROOTFS_IS_VFAT	kern/kernel-config.h	/^#define CONFIG_ROOTFS_IS_VFAT /;"	d
+CONFIG_RPC_FIFO_SLOT_NR	kern/kernel-config.h	/^#define CONFIG_RPC_FIFO_SLOT_NR	/;"	d
+CONFIG_RWLOCK_MAX	mm/mm-config.h	/^#define CONFIG_RWLOCK_MAX /;"	d
+CONFIG_RWLOCK_MIN	mm/mm-config.h	/^#define CONFIG_RWLOCK_MIN /;"	d
+CONFIG_SCHED_DEBUG	kern/kernel-config.h	/^#define CONFIG_SCHED_DEBUG /;"	d
+CONFIG_SCHED_RR_CHECK	kern/kernel-config.h	/^#define CONFIG_SCHED_RR_CHECK /;"	d
+CONFIG_SCHED_SHOW_NOTIFICATIONS	kern/kernel-config.h	/^#define CONFIG_SCHED_SHOW_NOTIFICATIONS /;"	d
+CONFIG_SCHED_THREADS_NR	kern/kernel-config.h	/^#define CONFIG_SCHED_THREADS_NR /;"	d
+CONFIG_SEMAPHORE_MAX	mm/mm-config.h	/^#define CONFIG_SEMAPHORE_MAX /;"	d
+CONFIG_SEMAPHORE_MIN	mm/mm-config.h	/^#define CONFIG_SEMAPHORE_MIN /;"	d
+CONFIG_SHOW_ALL_BOOT_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_ALL_BOOT_MSG /;"	d
+CONFIG_SHOW_BOOT_BANNER	kern/kernel-config.h	/^#define CONFIG_SHOW_BOOT_BANNER /;"	d
+CONFIG_SHOW_CPU_IPI_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_CPU_IPI_MSG /;"	d
+CONFIG_SHOW_CPU_USAGE	kern/kernel-config.h	/^#define CONFIG_SHOW_CPU_USAGE /;"	d
+CONFIG_SHOW_EPC_CPU0	kern/kernel-config.h	/^#define CONFIG_SHOW_EPC_CPU0 /;"	d
+CONFIG_SHOW_FPU_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_FPU_MSG /;"	d
+CONFIG_SHOW_KMEM_INIT	kern/kernel-config.h	/^#define CONFIG_SHOW_KMEM_INIT /;"	d
+CONFIG_SHOW_LOCAL_EVENTS	kern/kernel-config.h	/^#define CONFIG_SHOW_LOCAL_EVENTS /;"	d
+CONFIG_SHOW_MIGRATE_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_MIGRATE_MSG /;"	d
+CONFIG_SHOW_PAGEFAULT	kern/kernel-config.h	/^#define CONFIG_SHOW_PAGEFAULT /;"	d
+CONFIG_SHOW_PPM_PGALLOC_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_PPM_PGALLOC_MSG /;"	d
+CONFIG_SHOW_REMOTE_PGALLOC	kern/kernel-config.h	/^#define CONFIG_SHOW_REMOTE_PGALLOC /;"	d
+CONFIG_SHOW_RPC_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_RPC_MSG /;"	d
+CONFIG_SHOW_SIG_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_SIG_MSG /;"	d
+CONFIG_SHOW_SPURIOUS_PGFAULT	kern/kernel-config.h	/^#define CONFIG_SHOW_SPURIOUS_PGFAULT /;"	d
+CONFIG_SHOW_SYSMGRT_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_SYSMGRT_MSG /;"	d
+CONFIG_SHOW_THREAD_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_THREAD_MSG /;"	d
+CONFIG_SHOW_VMMMGRT_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_VMMMGRT_MSG /;"	d
+CONFIG_SHOW_VMM_ERROR_MSG	kern/kernel-config.h	/^#define CONFIG_SHOW_VMM_ERROR_MSG /;"	d
+CONFIG_SHOW_VMM_LOOKUP_TM	kern/kernel-config.h	/^#define CONFIG_SHOW_VMM_LOOKUP_TM /;"	d
+CONFIG_SPINLOCK_CHECK	kern/kernel-config.h	/^#define CONFIG_SPINLOCK_CHECK /;"	d
+CONFIG_SPINLOCK_TIMEOUT	kern/kernel-config.h	/^#define CONFIG_SPINLOCK_TIMEOUT /;"	d
+CONFIG_SYSFS_DEBUG	kern/kernel-config.h	/^#define CONFIG_SYSFS_DEBUG /;"	d
+CONFIG_SYSFS_FILE_MAX	mm/mm-config.h	/^#define CONFIG_SYSFS_FILE_MAX /;"	d
+CONFIG_SYSFS_FILE_MIN	mm/mm-config.h	/^#define CONFIG_SYSFS_FILE_MIN /;"	d
+CONFIG_SYSFS_NODE_MAX	mm/mm-config.h	/^#define CONFIG_SYSFS_NODE_MAX /;"	d
+CONFIG_SYSFS_NODE_MIN	mm/mm-config.h	/^#define CONFIG_SYSFS_NODE_MIN /;"	d
+CONFIG_TASK_ARGS_PAGES_MAX_NR	kern/kernel-config.h	/^#define CONFIG_TASK_ARGS_PAGES_MAX_NR /;"	d
+CONFIG_TASK_CHILDS_MAX_NR	kern/kernel-config.h	/^#define CONFIG_TASK_CHILDS_MAX_NR /;"	d
+CONFIG_TASK_FILE_MAX_NR	kern/kernel-config.h	/^#define CONFIG_TASK_FILE_MAX_NR /;"	d
+CONFIG_TASK_HEAP_MAX_SIZE	kern/kernel-config.h	/^#define CONFIG_TASK_HEAP_MAX_SIZE /;"	d
+CONFIG_TASK_HEAP_MIN_SIZE	kern/kernel-config.h	/^#define CONFIG_TASK_HEAP_MIN_SIZE /;"	d
+CONFIG_TASK_KCM_MAX	mm/mm-config.h	/^#define CONFIG_TASK_KCM_MAX /;"	d
+CONFIG_TASK_KCM_MIN	mm/mm-config.h	/^#define CONFIG_TASK_KCM_MIN /;"	d
+CONFIG_TASK_MAX_NR	kern/kernel-config.h	/^#define CONFIG_TASK_MAX_NR /;"	d
+CONFIG_TASK_MAX_NR_POW	kern/kernel-config.h	/^#define CONFIG_TASK_MAX_NR_POW /;"	d
+CONFIG_THREAD_LOCAL_ALLOC	kern/kernel-config.h	/^#define CONFIG_THREAD_LOCAL_ALLOC /;"	d
+CONFIG_THREAD_PAGE_ORDER	arch/tsar/arch-config.h	/^#define CONFIG_THREAD_PAGE_ORDER /;"	d
+CONFIG_THREAD_TIME_STAT	kern/kernel-config.h	/^#define CONFIG_THREAD_TIME_STAT /;"	d
+CONFIG_TIMER_WITH_IRQ	arch/ibmpc/arch-config.h	/^#define CONFIG_TIMER_WITH_IRQ /;"	d
+CONFIG_TTY_BUFFER_DEPTH	arch/tsar/arch-config.h	/^#define CONFIG_TTY_BUFFER_DEPTH /;"	d
+CONFIG_TTY_DEV_NR	arch/ibmpc/arch-config.h	/^#define CONFIG_TTY_DEV_NR /;"	d
+CONFIG_TTY_ECHO_MODE	arch/ibmpc/arch-config.h	/^#define CONFIG_TTY_ECHO_MODE /;"	d
+CONFIG_TTY_ECHO_MODE	arch/tsar/arch-config.h	/^#define CONFIG_TTY_ECHO_MODE /;"	d
+CONFIG_TTY_MAX_DEV_NR	arch/tsar/arch-config.h	/^#define CONFIG_TTY_MAX_DEV_NR /;"	d
+CONFIG_USE_COA	kern/kernel-config.h	/^#define CONFIG_USE_COA /;"	d
+CONFIG_USE_DQDT	kern/kernel-config.h	/^#define CONFIG_USE_DQDT /;"	d
+CONFIG_USE_KEYSDB	kern/kernel-config.h	/^#define CONFIG_USE_KEYSDB /;"	d
+CONFIG_USE_RPC_TEST	kern/kernel-config.h	/^#define CONFIG_USE_RPC_TEST /;"	d
+CONFIG_USE_SCHED_LOCKS	kern/kernel-config.h	/^#define CONFIG_USE_SCHED_LOCKS /;"	d
+CONFIG_USR_LIMIT	arch/ibmpc/arch-config.h	/^#define CONFIG_USR_LIMIT /;"	d
+CONFIG_USR_LIMIT	arch/tsar/arch-config.h	/^ #define CONFIG_USR_LIMIT /;"	d
+CONFIG_USR_OFFSET	arch/ibmpc/arch-config.h	/^#define CONFIG_USR_OFFSET /;"	d
+CONFIG_USR_OFFSET	arch/tsar/arch-config.h	/^ #define CONFIG_USR_OFFSET /;"	d
+CONFIG_VERBOSE_LOCK	kern/kernel-config.h	/^#define CONFIG_VERBOSE_LOCK /;"	d
+CONFIG_VFAT_CTX_MAX	mm/mm-config.h	/^#define CONFIG_VFAT_CTX_MAX /;"	d
+CONFIG_VFAT_CTX_MIN	mm/mm-config.h	/^#define CONFIG_VFAT_CTX_MIN /;"	d
+CONFIG_VFAT_DEBUG	kern/kernel-config.h	/^#define CONFIG_VFAT_DEBUG /;"	d
+CONFIG_VFAT_FILE_MAX	mm/mm-config.h	/^#define CONFIG_VFAT_FILE_MAX /;"	d
+CONFIG_VFAT_FILE_MIN	mm/mm-config.h	/^#define CONFIG_VFAT_FILE_MIN /;"	d
+CONFIG_VFAT_INSTRUMENT	kern/kernel-config.h	/^#define CONFIG_VFAT_INSTRUMENT /;"	d
+CONFIG_VFAT_NODE_MAX	mm/mm-config.h	/^#define CONFIG_VFAT_NODE_MAX /;"	d
+CONFIG_VFAT_NODE_MIN	mm/mm-config.h	/^#define CONFIG_VFAT_NODE_MIN /;"	d
+CONFIG_VFAT_PGWRITE_ENABLE	kern/kernel-config.h	/^#define CONFIG_VFAT_PGWRITE_ENABLE /;"	d
+CONFIG_VFS_CTX_MAX	mm/mm-config.h	/^#define CONFIG_VFS_CTX_MAX /;"	d
+CONFIG_VFS_CTX_MIN	mm/mm-config.h	/^#define CONFIG_VFS_CTX_MIN /;"	d
+CONFIG_VFS_DEBUG	kern/kernel-config.h	/^#define CONFIG_VFS_DEBUG /;"	d
+CONFIG_VFS_FILE_MAX	mm/mm-config.h	/^#define CONFIG_VFS_FILE_MAX /;"	d
+CONFIG_VFS_FILE_MIN	mm/mm-config.h	/^#define CONFIG_VFS_FILE_MIN /;"	d
+CONFIG_VFS_INODE_LOCAL	kern/kernel-config.h	/^#define CONFIG_VFS_INODE_LOCAL /;"	d
+CONFIG_VFS_INODE_MAX	mm/mm-config.h	/^#define CONFIG_VFS_INODE_MAX /;"	d
+CONFIG_VFS_INODE_MIN	mm/mm-config.h	/^#define CONFIG_VFS_INODE_MIN /;"	d
+CONFIG_VFS_NODES_PER_CLUSTER	kern/kernel-config.h	/^#define CONFIG_VFS_NODES_PER_CLUSTER /;"	d
+CONFIG_VMM_DEBUG	kern/kernel-config.h	/^#define CONFIG_VMM_DEBUG /;"	d
+CONFIG_VMM_REGION_DEBUG	kern/kernel-config.h	/^#define CONFIG_VMM_REGION_DEBUG /;"	d
+CONFIG_VM_REGION_KEYWIDTH	mm/mm-config.h	/^#define CONFIG_VM_REGION_KEYWIDTH /;"	d
+CONFIG_VM_REGION_MAX	mm/mm-config.h	/^#define CONFIG_VM_REGION_MAX /;"	d
+CONFIG_VM_REGION_MIN	mm/mm-config.h	/^#define CONFIG_VM_REGION_MIN /;"	d
+CONFIG_WAITQUEUEDB_MAX	mm/mm-config.h	/^#define CONFIG_WAITQUEUEDB_MAX /;"	d
+CONFIG_WAITQUEUEDB_MIN	mm/mm-config.h	/^#define CONFIG_WAITQUEUEDB_MIN /;"	d
+CONFIG_XICU_USR_ACCESS	kern/kernel-config.h	/^#define CONFIG_XICU_USR_ACCESS /;"	d
+CPU_ACTIVE	kern/cpu.h	/^	CPU_ACTIVE,$/;"	e	enum:__anon9
+CPU_CLOCK_TICK	arch/tsar/arch.h	/^#define CPU_CLOCK_TICK /;"	d
+CPU_CLOCK_TICK	arch/tsar/arch.h	/^#undef CPU_CLOCK_TICK$/;"	d
+CPU_CLOCK_TICK	kern/hal-arch.h	/^#define CPU_CLOCK_TICK$/;"	d
+CPU_DEACTIVE	kern/cpu.h	/^	CPU_DEACTIVE$/;"	e	enum:__anon9
+CPU_HW_IRQ_NR	cpu/i386/cpu-asm.h	/^#define CPU_HW_IRQ_NR /;"	d
+CPU_HW_IRQ_NR	cpu/i386/cpu-asm.h	/^#undef  CPU_HW_IRQ_NR$/;"	d
+CPU_HW_IRQ_NR	cpu/mipsel/cpu-asm.h	/^#define CPU_HW_IRQ_NR /;"	d
+CPU_HW_IRQ_NR	cpu/mipsel/cpu-asm.h	/^#undef  CPU_HW_IRQ_NR$/;"	d
+CPU_HW_IRQ_NR	kern/hal-cpu.h	/^#define CPU_HW_IRQ_NR$/;"	d
+CPU_HW_TRACE	cpu/mipsel/cpu-asm.h	/^#define CPU_HW_TRACE(/;"	d
+CPU_HW_TRACE	cpu/mipsel/cpu-asm.h	/^#undef CPU_HW_TRACE$/;"	d
+CPU_HW_TRACE	kern/hal-cpu.h	/^#define CPU_HW_TRACE(/;"	d
+CPU_IDLE	kern/cpu.h	/^	CPU_IDLE,$/;"	e	enum:__anon9
+CPU_IN_KERNEL	cpu/mipsel/cpu-regs.h	/^#define CPU_IN_KERNEL /;"	d
+CPU_IRQ_NR	cpu/i386/cpu-asm.h	/^#define CPU_IRQ_NR /;"	d
+CPU_IRQ_NR	cpu/i386/cpu-asm.h	/^#undef  CPU_IRQ_NR$/;"	d
+CPU_IRQ_NR	cpu/mipsel/cpu-asm.h	/^#define CPU_IRQ_NR /;"	d
+CPU_IRQ_NR	cpu/mipsel/cpu-asm.h	/^#undef  CPU_IRQ_NR$/;"	d
+CPU_IRQ_NR	kern/hal-cpu.h	/^#define CPU_IRQ_NR$/;"	d
+CPU_LOWPOWER	kern/cpu.h	/^	CPU_LOWPOWER,$/;"	e	enum:__anon9
+CPU_NR	arch/ibmpc/arch.h	/^#define CPU_NR /;"	d
+CPU_NR	arch/ibmpc/arch.h	/^#undef CPU_NR$/;"	d
+CPU_PER_CLUSTER	arch/ibmpc/arch.h	/^#define CPU_PER_CLUSTER /;"	d
+CPU_PER_CLUSTER	arch/ibmpc/arch.h	/^#undef CPU_PER_CLUSTER$/;"	d
+CPU_PER_CLUSTER	arch/tsar/arch.h	/^#define CPU_PER_CLUSTER /;"	d
+CPU_PER_CLUSTER	arch/tsar/arch.h	/^#undef CPU_PER_CLUSTER$/;"	d
+CPU_PER_CLUSTER_NR	kern/hal-arch.h	/^#define CPU_PER_CLUSTER_NR$/;"	d
+CPU_SUSPEND	kern/cpu.h	/^	CPU_SUSPEND,$/;"	e	enum:__anon9
+CPU_SYS_MODE	cpu/i386/cpu-asm.h	/^#define CPU_SYS_MODE /;"	d
+CPU_SYS_MODE	cpu/i386/cpu-asm.h	/^#undef  CPU_SYS_MODE$/;"	d
+CPU_SYS_MODE	cpu/mipsel/cpu-asm.h	/^#define CPU_SYS_MODE /;"	d
+CPU_SYS_MODE	cpu/mipsel/cpu-asm.h	/^#undef  CPU_SYS_MODE$/;"	d
+CPU_SYS_MODE	kern/hal-cpu.h	/^#define CPU_SYS_MODE$/;"	d
+CPU_TRACE_LOG_LENGTH	kern/cpu-trace.h	/^#define CPU_TRACE_LOG_LENGTH /;"	d
+CPU_UNKNOWN_ERR	cpu/mipsel/cpu_do_exception.c	/^#define CPU_UNKNOWN_ERR /;"	d	file:
+CPU_USR_MODE	cpu/i386/cpu-asm.h	/^#define CPU_USR_MODE /;"	d
+CPU_USR_MODE	cpu/i386/cpu-asm.h	/^#undef  CPU_USR_MODE$/;"	d
+CPU_USR_MODE	cpu/mipsel/cpu-asm.h	/^#define CPU_USR_MODE /;"	d
+CPU_USR_MODE	cpu/mipsel/cpu-asm.h	/^#undef  CPU_USR_MODE$/;"	d
+CPU_USR_MODE	kern/hal-cpu.h	/^#define CPU_USR_MODE$/;"	d
+CR	cpu/mipsel/cpu-regs.h	/^#define      CR /;"	d
+CR3	cpu/i386/__cpu_context.S	/^#define CR3		6*4$/;"	d
+CV_BROADCAST	kern/cond_var.h	/^	CV_BROADCAST,$/;"	e	enum:__anon8
+CV_DESTROY	kern/cond_var.h	/^	CV_DESTROY$/;"	e	enum:__anon8
+CV_INIT	kern/cond_var.h	/^	CV_INIT,$/;"	e	enum:__anon8
+CV_SIGNAL	kern/cond_var.h	/^	CV_SIGNAL,$/;"	e	enum:__anon8
+CV_WAIT	kern/cond_var.h	/^	CV_WAIT,$/;"	e	enum:__anon8
+CYCLES_PER_SECOND	arch/ibmpc/arch.h	/^#define CYCLES_PER_SECOND /;"	d
+CYCLES_PER_SECOND	arch/ibmpc/arch.h	/^#undef CYCLES_PER_SECOND$/;"	d
+CYCLES_PER_SECOND	arch/tsar/arch.h	/^#define CYCLES_PER_SECOND /;"	d
+CYCLES_PER_SECOND	arch/tsar/arch.h	/^#undef CYCLES_PER_SECOND$/;"	d
+CYCLES_PER_SECOND	kern/hal-arch.h	/^#define CYCLES_PER_SECOND$/;"	d
+CYCLES_TO_LW	kern/remote_fifo.c	/^#define CYCLES_TO_LW /;"	d	file:
+CopyToLittleEndian	libk/md5.c	/^static void CopyToLittleEndian (uint32_t *dst, const uint8_t *src, int length) {$/;"	f	file:
+CpU_exception_handler	cpu/mipsel/cpu_do_exception.c	/^error_t CpU_exception_handler(struct thread_s *this, reg_t cpu_id, reg_t *regs_tbl)$/;"	f
+DEBUG	kern/kdmsg.h	/^#define DEBUG /;"	d
+DEBUG_XICU	drivers/soclib/soclib_xicu.c	/^#define DEBUG_XICU /;"	d	file:
+DECLARE_EXCEPT	cpu/i386/__kentry.S	/^#define DECLARE_EXCEPT(n)	\\$/;"	d
+DECLARE_EXCEPT_ERR	cpu/i386/__kentry.S	/^#define DECLARE_EXCEPT_ERR(n)	  \\$/;"	d
+DECLARE_IRQ	cpu/i386/__kentry.S	/^#define DECLARE_IRQ(n)		\\$/;"	d
+DELAYED_SLOT_MASK	cpu/mipsel/cpu_do_exception.c	/^#define  DELAYED_SLOT_MASK /;"	d	file:
+DEPS	Makefile	/^DEPS=	$(OBJS:.o=.d)$/;"	m
+DEVICE_NR	arch/tsar/arch.h	/^#define DEVICE_NR /;"	d
+DEVICE_NR	arch/tsar/arch.h	/^#undef DEVICE_NR$/;"	d
+DEV_BLK	kern/device.h	/^	DEV_BLK,$/;"	e	enum:__anon10
+DEV_CHR	kern/device.h	/^	DEV_CHR,$/;"	e	enum:__anon10
+DEV_INTERNAL	kern/device.h	/^	DEV_INTERNAL$/;"	e	enum:__anon10
+DEV_MAX_NAME	kern/device.h	/^#define DEV_MAX_NAME /;"	d
+DEV_RQ_KERNEL	kern/driver.h	/^#define DEV_RQ_KERNEL /;"	d
+DEV_RQ_NESTED	kern/driver.h	/^#define DEV_RQ_NESTED /;"	d
+DEV_RQ_NOBLOCK	kern/driver.h	/^#define DEV_RQ_NOBLOCK /;"	d
+DEV_STDERR	kern/do_exec.c	/^#define DEV_STDERR /;"	d	file:
+DEV_STDIN	kern/do_exec.c	/^#define DEV_STDIN /;"	d	file:
+DEV_STDOUT	kern/do_exec.c	/^#define DEV_STDOUT /;"	d	file:
+DIRS	Makefile	/^DIRS=	cpu\/$(CPU)           	  \\$/;"	m
+DIR_Attr	fs/fat32/fat32-private.h	/^	uint8_t	        DIR_Attr;$/;"	m	struct:vfat_DirEntry_s
+DIR_CrtDate	fs/fat32/fat32-private.h	/^	uint16_t	DIR_CrtDate;$/;"	m	struct:vfat_DirEntry_s
+DIR_CrtTime	fs/fat32/fat32-private.h	/^	uint16_t	DIR_CrtTime;$/;"	m	struct:vfat_DirEntry_s
+DIR_CrtTimeTenth	fs/fat32/fat32-private.h	/^	uint8_t	        DIR_CrtTimeTenth;$/;"	m	struct:vfat_DirEntry_s
+DIR_FileSize	fs/fat32/fat32-private.h	/^	uint32_t	DIR_FileSize;$/;"	m	struct:vfat_DirEntry_s
+DIR_FstClusHI	fs/fat32/fat32-private.h	/^	uint16_t	DIR_FstClusHI;$/;"	m	struct:vfat_DirEntry_s
+DIR_FstClusLO	fs/fat32/fat32-private.h	/^	uint16_t	DIR_FstClusLO;$/;"	m	struct:vfat_DirEntry_s
+DIR_LstAccTime	fs/fat32/fat32-private.h	/^	uint16_t	DIR_LstAccTime;$/;"	m	struct:vfat_DirEntry_s
+DIR_NTRes	fs/fat32/fat32-private.h	/^	uint8_t	        DIR_NTRes;$/;"	m	struct:vfat_DirEntry_s
+DIR_Name	fs/fat32/fat32-private.h	/^	uint8_t	        DIR_Name[11];$/;"	m	struct:vfat_DirEntry_s
+DIR_WrtDate	fs/fat32/fat32-private.h	/^	uint16_t	DIR_WrtDate;$/;"	m	struct:vfat_DirEntry_s
+DIR_WrtTime	fs/fat32/fat32-private.h	/^	uint16_t	DIR_WrtTime;$/;"	m	struct:vfat_DirEntry_s
+DISTLOCK_DECLARE	kern/distlock.h	/^#define DISTLOCK_DECLARE(/;"	d
+DISTLOCK_TABLE	kern/distlock.h	/^#define DISTLOCK_TABLE(/;"	d
+DMA_ASYNC	kern/dma.h	/^#define DMA_ASYNC /;"	d
+DMA_DST_REG	drivers/soclib/soclib_dma.c	/^#define DMA_DST_REG /;"	d	file:
+DMA_IRQ_DISABLED	drivers/soclib/soclib_dma.c	/^#define DMA_IRQ_DISABLED /;"	d	file:
+DMA_LEN_REG	drivers/soclib/soclib_dma.c	/^#define DMA_LEN_REG /;"	d	file:
+DMA_RESET_REG	drivers/soclib/soclib_dma.c	/^#define DMA_RESET_REG /;"	d	file:
+DMA_SRC_REG	drivers/soclib/soclib_dma.c	/^#define DMA_SRC_REG /;"	d	file:
+DMA_SYNC	kern/dma.h	/^#define DMA_SYNC /;"	d
+DMSG_ASSERT	libk/config.h	/^#define DMSG_ASSERT /;"	d
+DMSG_BOOT	libk/config.h	/^#define DMSG_BOOT /;"	d
+DMSG_DEBUG	libk/config.h	/^#define DMSG_DEBUG /;"	d
+DMSG_ERROR	libk/config.h	/^#define DMSG_ERROR /;"	d
+DMSG_INFO	libk/config.h	/^#define DMSG_INFO /;"	d
+DMSG_NONE	libk/config.h	/^#define DMSG_NONE /;"	d
+DMSG_WARNING	libk/config.h	/^#define DMSG_WARNING /;"	d
+DP_EXT	cpu/mipsel/cpu-regs.h	/^#define      DP_EXT	/;"	d
+DQDT_BIG_T	kern/dqdt.c	/^#define DQDT_BIG_T /;"	d	file:
+DQDT_CLUSTER_READY	kern/dqdt.h	/^#define DQDT_CLUSTER_READY /;"	d
+DQDT_CLUSTER_UP	kern/dqdt.h	/^#define DQDT_CLUSTER_UP /;"	d
+DQDT_DIST_DEFAULT	kern/hal-arch.h	/^#define DQDT_DIST_DEFAULT /;"	d
+DQDT_DIST_NOTSET	kern/hal-arch.h	/^#define DQDT_DIST_NOTSET /;"	d
+DQDT_DIST_RANDOM	kern/hal-arch.h	/^#define DQDT_DIST_RANDOM /;"	d
+DQDT_FORK_OP	kern/dqdt.c	/^#define DQDT_FORK_OP /;"	d	file:
+DQDT_LEVELS_NR	kern/dqdt.h	/^#define DQDT_LEVELS_NR /;"	d
+DQDT_MAX_D	kern/dqdt.c	/^#define DQDT_MAX_D /;"	d	file:
+DQDT_MAX_DEPTH	kern/dqdt.h	/^#define DQDT_MAX_DEPTH /;"	d
+DQDT_MAX_M	kern/dqdt.c	/^#define DQDT_MAX_M /;"	d	file:
+DQDT_MAX_T	kern/dqdt.c	/^#define DQDT_MAX_T /;"	d	file:
+DQDT_MAX_U	kern/dqdt.c	/^#define DQDT_MAX_U /;"	d	file:
+DQDT_MEMORY_OP	kern/dqdt.c	/^#define DQDT_MEMORY_OP /;"	d	file:
+DQDT_MGR_PERIOD	kern/dqdt.c	/^#define DQDT_MGR_PERIOD /;"	d	file:
+DQDT_MIGRATE_OP	kern/dqdt.c	/^#define DQDT_MIGRATE_OP /;"	d	file:
+DQDT_SELECT_HELPER	kern/dqdt.c	/^#define DQDT_SELECT_HELPER(/;"	d	file:
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_core_min_threads_select)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_core_min_threads_select_old)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_cpu_min_usage_select)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_mem_do_request)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_select_by_M)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_select_by_T)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_select_by_T_M)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_select_by_T_U)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_sort_by_M_D)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_sort_by_T_D)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_sort_by_U_T_D)$/;"	f
+DQDT_SELECT_HELPER	kern/dqdt.c	/^DQDT_SELECT_HELPER(dqdt_sort_by_rT_D)$/;"	f
+DQDT_SELECT_LTCN	kern/dqdt.c	/^#define DQDT_SELECT_LTCN /;"	d	file:
+DQDT_THREAD_OP	kern/dqdt.c	/^#define DQDT_THREAD_OP /;"	d	file:
+E2BIG	libk/errno.h	/^#define E2BIG	/;"	d
+EACCES	libk/errno.h	/^#define EACCES	/;"	d
+EADDRINUSE	libk/errno.h	/^#define EADDRINUSE	/;"	d
+EADDRNOTAVAIL	libk/errno.h	/^#define EADDRNOTAVAIL	/;"	d
+EADV	libk/errno.h	/^#define EADV	/;"	d
+EAFNOSUPPORT	libk/errno.h	/^#define EAFNOSUPPORT	/;"	d
+EAGAIN	libk/errno.h	/^#define EAGAIN	/;"	d
+EALREADY	libk/errno.h	/^#define EALREADY	/;"	d
+EBADBLK	libk/errno.h	/^#define EBADBLK /;"	d
+EBADE	libk/errno.h	/^#define EBADE	/;"	d
+EBADF	libk/errno.h	/^#define EBADF	/;"	d
+EBADFD	libk/errno.h	/^#define EBADFD	/;"	d
+EBADMSG	libk/errno.h	/^#define EBADMSG	/;"	d
+EBADR	libk/errno.h	/^#define EBADR	/;"	d
+EBADRQC	libk/errno.h	/^#define EBADRQC	/;"	d
+EBADSLT	libk/errno.h	/^#define EBADSLT	/;"	d
+EBFONT	libk/errno.h	/^#define EBFONT	/;"	d
+EBP	cpu/i386/__cpu_context.S	/^#define EBP		2*4$/;"	d
+EBUSY	libk/errno.h	/^#define EBUSY	/;"	d
+EBX	cpu/i386/__cpu_context.S	/^#define EBX		0*4$/;"	d
+ECANCELED	libk/errno.h	/^#define	ECANCELED	/;"	d
+ECHILD	libk/errno.h	/^#define ECHILD	/;"	d
+ECHRNG	libk/errno.h	/^#define ECHRNG	/;"	d
+ECOMM	libk/errno.h	/^#define ECOMM	/;"	d
+ECONNABORTED	libk/errno.h	/^#define ECONNABORTED	/;"	d
+ECONNREFUSED	libk/errno.h	/^#define ECONNREFUSED	/;"	d
+ECONNRESET	libk/errno.h	/^#define ECONNRESET	/;"	d
+EDEADLK	libk/errno.h	/^#define EDEADLK	/;"	d
+EDEADLOCK	libk/errno.h	/^#define EDEADLOCK	/;"	d
+EDESTADDRREQ	libk/errno.h	/^#define EDESTADDRREQ	/;"	d
+EDI	cpu/i386/__cpu_context.S	/^#define EDI		3*4$/;"	d
+EDOM	libk/errno.h	/^#define EDOM	/;"	d
+EDOTDOT	libk/errno.h	/^#define EDOTDOT	/;"	d
+EDQUOT	libk/errno.h	/^#define EDQUOT	/;"	d
+EEODIR	libk/errno.h	/^#define EEODIR /;"	d
+EEXIST	libk/errno.h	/^#define EEXIST	/;"	d
+EFAULT	libk/errno.h	/^#define EFAULT	/;"	d
+EFBIG	libk/errno.h	/^#define EFBIG	/;"	d
+EHOSTDOWN	libk/errno.h	/^#define EHOSTDOWN	/;"	d
+EHOSTUNREACH	libk/errno.h	/^#define EHOSTUNREACH	/;"	d
+EIDRM	libk/errno.h	/^#define EIDRM	/;"	d
+EILSEQ	libk/errno.h	/^#define EILSEQ	/;"	d
+EINPROGRESS	libk/errno.h	/^#define EINPROGRESS	/;"	d
+EINTR	libk/errno.h	/^#define EINTR	/;"	d
+EINVAL	libk/errno.h	/^#define EINVAL	/;"	d
+EIO	libk/errno.h	/^#define EIO	/;"	d
+EIP	cpu/i386/__cpu_context.S	/^#define EIP		5*4$/;"	d
+EISCONN	libk/errno.h	/^#define EISCONN	/;"	d
+EISDIR	libk/errno.h	/^#define EISDIR	/;"	d
+EISNAM	libk/errno.h	/^#define EISNAM	/;"	d
+EI_CLASS	libk/elf.h	/^#define EI_CLASS	/;"	d
+EI_DATA	libk/elf.h	/^#define EI_DATA	/;"	d
+EI_MAG0	libk/elf.h	/^#define EI_MAG0	/;"	d
+EI_MAG1	libk/elf.h	/^#define EI_MAG1	/;"	d
+EI_MAG2	libk/elf.h	/^#define EI_MAG2	/;"	d
+EI_MAG3	libk/elf.h	/^#define EI_MAG3	/;"	d
+EI_NIDENT	libk/elf.h	/^#define EI_NIDENT /;"	d
+EI_OSABI	libk/elf.h	/^#define EI_OSABI	/;"	d
+EI_VERSION	libk/elf.h	/^#define EI_VERSION	/;"	d
+EKEYEXPIRED	libk/errno.h	/^#define	EKEYEXPIRED	/;"	d
+EKEYREJECTED	libk/errno.h	/^#define	EKEYREJECTED	/;"	d
+EKEYREVOKED	libk/errno.h	/^#define	EKEYREVOKED	/;"	d
+EL2HLT	libk/errno.h	/^#define EL2HLT	/;"	d
+EL2NSYNC	libk/errno.h	/^#define EL2NSYNC	/;"	d
+EL3HLT	libk/errno.h	/^#define EL3HLT	/;"	d
+EL3RST	libk/errno.h	/^#define EL3RST	/;"	d
+ELFCLASS32	libk/elf.h	/^#define ELFCLASS32	/;"	d
+ELFCLASSNONE	libk/elf.h	/^#define ELFCLASSNONE	/;"	d
+ELFCLASSNUM	libk/elf.h	/^#define ELFCLASSNUM	/;"	d
+ELFDATA2LSB	libk/elf.h	/^#define ELFDATA2LSB	/;"	d
+ELFDATA2MSB	libk/elf.h	/^#define ELFDATA2MSB	/;"	d
+ELFDATANONE	libk/elf.h	/^#define ELFDATANONE	/;"	d
+ELFDATANUM	libk/elf.h	/^#define ELFDATANUM	/;"	d
+ELFMAG0	libk/elf.h	/^#define ELFMAG0	/;"	d
+ELFMAG1	libk/elf.h	/^#define ELFMAG1	/;"	d
+ELFMAG2	libk/elf.h	/^#define ELFMAG2	/;"	d
+ELFMAG3	libk/elf.h	/^#define ELFMAG3	/;"	d
+ELFOSABI_NONE	libk/elf.h	/^#define ELFOSABI_NONE	/;"	d
+ELIBACC	libk/errno.h	/^#define ELIBACC	/;"	d
+ELIBBAD	libk/errno.h	/^#define ELIBBAD	/;"	d
+ELIBEXEC	libk/errno.h	/^#define ELIBEXEC	/;"	d
+ELIBMAX	libk/errno.h	/^#define ELIBMAX	/;"	d
+ELIBSCN	libk/errno.h	/^#define ELIBSCN	/;"	d
+ELNRNG	libk/errno.h	/^#define ELNRNG	/;"	d
+ELOOP	libk/errno.h	/^#define ELOOP	/;"	d
+EL_LOCAL	kern/event.h	/^	EL_LOCAL,$/;"	e	enum:__anon14
+EL_REMOTE	kern/event.h	/^	EL_REMOTE$/;"	e	enum:__anon14
+EMEDIUMTYPE	libk/errno.h	/^#define EMEDIUMTYPE	/;"	d
+EMFILE	libk/errno.h	/^#define EMFILE	/;"	d
+EMLINK	libk/errno.h	/^#define EMLINK	/;"	d
+EMSGSIZE	libk/errno.h	/^#define EMSGSIZE	/;"	d
+EMULTIHOP	libk/errno.h	/^#define EMULTIHOP	/;"	d
+EM_386	libk/elf.h	/^#define EM_386	/;"	d
+EM_860	libk/elf.h	/^#define EM_860	/;"	d
+EM_ARM	libk/elf.h	/^#define EM_ARM	/;"	d
+EM_MIPS	libk/elf.h	/^#define EM_MIPS	/;"	d
+EM_MIPS_RS3_LE	libk/elf.h	/^#define EM_MIPS_RS3_LE	/;"	d
+EM_NONE	libk/elf.h	/^#define EM_NONE	/;"	d
+EM_PPC	libk/elf.h	/^#define EM_PPC	/;"	d
+EM_PPC64	libk/elf.h	/^#define EM_PPC64	/;"	d
+ENAMETOOLONG	libk/errno.h	/^#define ENAMETOOLONG	/;"	d
+ENAVAIL	libk/errno.h	/^#define ENAVAIL	/;"	d
+ENETDOWN	libk/errno.h	/^#define ENETDOWN	/;"	d
+ENETRESET	libk/errno.h	/^#define ENETRESET	/;"	d
+ENETUNREACH	libk/errno.h	/^#define ENETUNREACH	/;"	d
+ENFILE	libk/errno.h	/^#define ENFILE	/;"	d
+ENOANO	libk/errno.h	/^#define ENOANO	/;"	d
+ENOBUFS	libk/errno.h	/^#define ENOBUFS	/;"	d
+ENOCSI	libk/errno.h	/^#define ENOCSI	/;"	d
+ENODATA	libk/errno.h	/^#define ENODATA	/;"	d
+ENODEV	libk/errno.h	/^#define ENODEV	/;"	d
+ENOENT	libk/errno.h	/^#define ENOENT	/;"	d
+ENOEXEC	libk/errno.h	/^#define ENOEXEC	/;"	d
+ENOKEY	libk/errno.h	/^#define	ENOKEY	/;"	d
+ENOLCK	libk/errno.h	/^#define ENOLCK	/;"	d
+ENOLINK	libk/errno.h	/^#define ENOLINK	/;"	d
+ENOMEDIUM	libk/errno.h	/^#define ENOMEDIUM	/;"	d
+ENOMEM	libk/errno.h	/^#define ENOMEM	/;"	d
+ENOMSG	libk/errno.h	/^#define ENOMSG	/;"	d
+ENONET	libk/errno.h	/^#define ENONET	/;"	d
+ENOPKG	libk/errno.h	/^#define ENOPKG	/;"	d
+ENOPROTOOPT	libk/errno.h	/^#define ENOPROTOOPT	/;"	d
+ENOSPC	libk/errno.h	/^#define ENOSPC	/;"	d
+ENOSR	libk/errno.h	/^#define ENOSR	/;"	d
+ENOSTR	libk/errno.h	/^#define ENOSTR	/;"	d
+ENOSYS	libk/errno.h	/^#define ENOSYS	/;"	d
+ENOTBLK	libk/errno.h	/^#define ENOTBLK	/;"	d
+ENOTCONN	libk/errno.h	/^#define ENOTCONN	/;"	d
+ENOTDIR	libk/errno.h	/^#define ENOTDIR	/;"	d
+ENOTEMPTY	libk/errno.h	/^#define ENOTEMPTY	/;"	d
+ENOTFOUND	kern/radix.c	/^#define ENOTFOUND /;"	d	file:
+ENOTNAM	libk/errno.h	/^#define ENOTNAM	/;"	d
+ENOTSOCK	libk/errno.h	/^#define ENOTSOCK	/;"	d
+ENOTSUP	libk/errno.h	/^#define ENOTSUP	/;"	d
+ENOTSUPPORTED	libk/errno.h	/^#define ENOTSUPPORTED /;"	d
+ENOTTY	libk/errno.h	/^#define ENOTTY	/;"	d
+ENOTUNIQ	libk/errno.h	/^#define ENOTUNIQ	/;"	d
+ENXIO	libk/errno.h	/^#define ENXIO	/;"	d
+EOPNOTSUPP	libk/errno.h	/^#define EOPNOTSUPP	/;"	d
+EOVERFLOW	libk/errno.h	/^#define EOVERFLOW	/;"	d
+EPC	cpu/mipsel/cpu-regs.h	/^#define      EPC /;"	d
+EPERM	libk/errno.h	/^#define EPERM	/;"	d
+EPFNOSUPPORT	libk/errno.h	/^#define EPFNOSUPPORT	/;"	d
+EPIPE	libk/errno.h	/^#define EPIPE	/;"	d
+EPROTO	libk/errno.h	/^#define EPROTO	/;"	d
+EPROTONOSUPPORT	libk/errno.h	/^#define EPROTONOSUPPORT	/;"	d
+EPROTOTYPE	libk/errno.h	/^#define EPROTOTYPE	/;"	d
+ERANGE	libk/errno.h	/^#define ERANGE	/;"	d
+EREMCHG	libk/errno.h	/^#define EREMCHG	/;"	d
+EREMOTE	libk/errno.h	/^#define EREMOTE	/;"	d
+EREMOTEIO	libk/errno.h	/^#define EREMOTEIO	/;"	d
+ERESTART	libk/errno.h	/^#define ERESTART	/;"	d
+EROFS	libk/errno.h	/^#define EROFS	/;"	d
+ERROR	kern/kdmsg.h	/^#define ERROR /;"	d
+ESHUTDOWN	libk/errno.h	/^#define ESHUTDOWN	/;"	d
+ESI	cpu/i386/__cpu_context.S	/^#define ESI		4*4$/;"	d
+ESOCKTNOSUPPORT	libk/errno.h	/^#define ESOCKTNOSUPPORT	/;"	d
+ESP	cpu/i386/__cpu_context.S	/^#define ESP		1*4$/;"	d
+ESPIPE	libk/errno.h	/^#define ESPIPE	/;"	d
+ESP_R0	cpu/i386/__cpu_context.S	/^#define ESP_R0		1*4$/;"	d
+ESP_R1	cpu/i386/__cpu_context.S	/^#define ESP_R1		3*4$/;"	d
+ESRCH	libk/errno.h	/^#define ESRCH	/;"	d
+ESRMNT	libk/errno.h	/^#define ESRMNT	/;"	d
+ESTALE	libk/errno.h	/^#define ESTALE	/;"	d
+ESTRPIPE	libk/errno.h	/^#define ESTRPIPE	/;"	d
+ETIME	libk/errno.h	/^#define ETIME	/;"	d
+ETIMEDOUT	libk/errno.h	/^#define ETIMEDOUT	/;"	d
+ETOOMANYREFS	libk/errno.h	/^#define ETOOMANYREFS	/;"	d
+ETXTBSY	libk/errno.h	/^#define ETXTBSY	/;"	d
+ET_CORE	libk/elf.h	/^#define ET_CORE	/;"	d
+ET_DYN	libk/elf.h	/^#define ET_DYN	/;"	d
+ET_EXEC	libk/elf.h	/^#define ET_EXEC	/;"	d
+ET_HIOS	libk/elf.h	/^#define ET_HIOS	/;"	d
+ET_HIPROC	libk/elf.h	/^#define ET_HIPROC	/;"	d
+ET_LOOS	libk/elf.h	/^#define ET_LOOS	/;"	d
+ET_LOPROC	libk/elf.h	/^#define ET_LOPROC	/;"	d
+ET_NONE	libk/elf.h	/^#define ET_NONE	/;"	d
+ET_NUM	libk/elf.h	/^#define	ET_NUM	/;"	d
+ET_REL	libk/elf.h	/^#define ET_REL	/;"	d
+EUCLEAN	libk/errno.h	/^#define EUCLEAN	/;"	d
+EUNATCH	libk/errno.h	/^#define EUNATCH	/;"	d
+EUNKNOWN	libk/errno.h	/^#define EUNKNOWN /;"	d
+EUSERS	libk/errno.h	/^#define EUSERS	/;"	d
+EVENT_HANDLER	drivers/soclib/soclib_dma.c	/^static EVENT_HANDLER(dma_async_frag_event)$/;"	f	file:
+EVENT_HANDLER	kern/barrier.c	/^static EVENT_HANDLER(barrier_broadcast_event)$/;"	f	file:
+EVENT_HANDLER	kern/blkio.c	/^static EVENT_HANDLER(blkio_async)$/;"	f	file:
+EVENT_HANDLER	kern/cluster.c	/^EVENT_HANDLER(cluster_key_create_event_handler)$/;"	f
+EVENT_HANDLER	kern/cluster.c	/^EVENT_HANDLER(cluster_key_delete_event_handler)$/;"	f
+EVENT_HANDLER	kern/cluster.c	/^EVENT_HANDLER(manager_alarm_event_handler)$/;"	f
+EVENT_HANDLER	kern/event.h	/^#define EVENT_HANDLER(/;"	d
+EVENT_HANDLER	kern/sys_alarm.c	/^EVENT_HANDLER(sys_alarm_event_handler)$/;"	f
+EVENT_HANDLER	kern/sys_dma_memcpy.c	/^static EVENT_HANDLER(dma_async_request_event)$/;"	f	file:
+EVENT_HANDLER	kern/sys_fork.c	/^EVENT_HANDLER(fork_event_handler)$/;"	f
+EVENT_HANDLER	kern/sys_thread_create.c	/^EVENT_HANDLER(thread_create_event_handler)$/;"	f
+EVENT_HANDLER	kern/thread_destroy.c	/^EVENT_HANDLER(thread_destroy_handler)$/;"	f
+EVENT_HANDLER	kern/thread_migrate.c	/^EVENT_HANDLER(migrate_event_handler)$/;"	f
+EVENT_HANDLER	vfs/kvfsd.c	/^static EVENT_HANDLER(kvfsd_alarm_event_handler)$/;"	f	file:
+EVENT_PENDING	kern/event.h	/^#define EVENT_PENDING /;"	d
+EV_CURRENT	libk/elf.h	/^#define EV_CURRENT	/;"	d
+EV_NONE	libk/elf.h	/^#define EV_NONE	/;"	d
+EV_NUM	libk/elf.h	/^#define EV_NUM	/;"	d
+EWOULDBLOCK	libk/errno.h	/^#define EWOULDBLOCK	/;"	d
+EXDEV	libk/errno.h	/^#define EXDEV	/;"	d
+EXFULL	libk/errno.h	/^#define EXFULL	/;"	d
+EXP_BACK_OFF	kern/remote_fifo.c	/^#define EXP_BACK_OFF /;"	d	file:
+E_BLK	kern/event.h	/^	E_BLK,$/;"	e	enum:__anon13
+E_CHR	kern/event.h	/^	E_CHR,$/;"	e	enum:__anon13
+E_CLK	kern/event.h	/^	E_CLK = 0,			\/* Fixed Priority *\/$/;"	e	enum:__anon13
+E_CREATE	kern/event.h	/^	E_CREATE,$/;"	e	enum:__anon13
+E_EXEC	kern/event.h	/^	E_EXEC,$/;"	e	enum:__anon13
+E_FORK	kern/event.h	/^	E_FORK,$/;"	e	enum:__anon13
+E_FUNC	kern/event.h	/^	E_FUNC,$/;"	e	enum:__anon13
+E_MIGRATE	kern/event.h	/^	E_MIGRATE,$/;"	e	enum:__anon13
+E_PRIO_NR	kern/event.h	/^	E_PRIO_NR$/;"	e	enum:__anon13
+E_TLB	kern/event.h	/^	E_TLB,$/;"	e	enum:__anon13
+Elf32_Addr	libk/elf.h	/^typedef uint32_t Elf32_Addr;$/;"	t
+Elf32_Ehdr	libk/elf.h	/^} Elf32_Ehdr;$/;"	t	typeref:struct:__anon42
+Elf32_Half	libk/elf.h	/^typedef uint16_t Elf32_Half;$/;"	t
+Elf32_Off	libk/elf.h	/^typedef uint32_t Elf32_Off;$/;"	t
+Elf32_Phdr	libk/elf.h	/^} Elf32_Phdr;$/;"	t	typeref:struct:__anon43
+Elf32_Section	libk/elf.h	/^typedef uint16_t Elf32_Section;$/;"	t
+Elf32_Sword	libk/elf.h	/^typedef	int32_t  Elf32_Sword;$/;"	t
+Elf32_Sxword	libk/elf.h	/^typedef	int64_t  Elf32_Sxword;$/;"	t
+Elf32_Versym	libk/elf.h	/^typedef Elf32_Half Elf32_Versym;$/;"	t
+Elf32_Word	libk/elf.h	/^typedef uint32_t Elf32_Word;$/;"	t
+Elf32_Xword	libk/elf.h	/^typedef uint64_t Elf32_Xword;$/;"	t
+F	libk/md5.c	/^#define F(/;"	d	file:
+FB_READ_REG	drivers/soclib/soclib_fb.c	/^#define FB_READ_REG /;"	d	file:
+FB_WRITE_REG	drivers/soclib/soclib_fb.c	/^#define FB_WRITE_REG /;"	d	file:
+FD_BUSY	kern/task.h	/^#define FD_BUSY /;"	d
+FF	libk/md5.c	/^#define FF(/;"	d	file:
+FOR_EACH	kern/rpc.h	/^#define FOR_EACH(/;"	d
+FOR_EACH2	kern/rpc.h	/^#define FOR_EACH2(/;"	d
+FOR_EACH2_	kern/rpc.h	/^#define FOR_EACH2_(/;"	d
+FOR_EACH2_0	kern/rpc.h	/^#define FOR_EACH2_0(/;"	d
+FOR_EACH2_10	kern/rpc.h	/^#define FOR_EACH2_10(/;"	d
+FOR_EACH2_2	kern/rpc.h	/^#define FOR_EACH2_2(/;"	d
+FOR_EACH2_4	kern/rpc.h	/^#define FOR_EACH2_4(/;"	d
+FOR_EACH2_6	kern/rpc.h	/^#define FOR_EACH2_6(/;"	d
+FOR_EACH2_8	kern/rpc.h	/^#define FOR_EACH2_8(/;"	d
+FOR_EACH3	kern/rpc.h	/^#define FOR_EACH3(/;"	d
+FOR_EACH3_	kern/rpc.h	/^#define FOR_EACH3_(/;"	d
+FOR_EACH3_0	kern/rpc.h	/^#define FOR_EACH3_0(/;"	d
+FOR_EACH3_12	kern/rpc.h	/^#define FOR_EACH3_12(/;"	d
+FOR_EACH3_15	kern/rpc.h	/^#define FOR_EACH3_15(/;"	d
+FOR_EACH3_3	kern/rpc.h	/^#define FOR_EACH3_3(/;"	d
+FOR_EACH3_6	kern/rpc.h	/^#define FOR_EACH3_6(/;"	d
+FOR_EACH3_9	kern/rpc.h	/^#define FOR_EACH3_9(/;"	d
+FOR_EACH_	kern/rpc.h	/^#define FOR_EACH_(/;"	d
+FOR_EACH_0	kern/rpc.h	/^#define FOR_EACH_0(/;"	d
+FOR_EACH_1	kern/rpc.h	/^#define FOR_EACH_1(/;"	d
+FOR_EACH_2	kern/rpc.h	/^#define FOR_EACH_2(/;"	d
+FOR_EACH_3	kern/rpc.h	/^#define FOR_EACH_3(/;"	d
+FOR_EACH_4	kern/rpc.h	/^#define FOR_EACH_4(/;"	d
+FOR_EACH_5	kern/rpc.h	/^#define FOR_EACH_5(/;"	d
+FOR_EACH_6	kern/rpc.h	/^#define FOR_EACH_6(/;"	d
+FOR_EACH_7	kern/rpc.h	/^#define FOR_EACH_7(/;"	d
+FOR_EACH_8	kern/rpc.h	/^#define FOR_EACH_8(/;"	d
+FPU	cpu/mipsel/__cpu_context.S	/^#define FPU    	REGS_NR$/;"	d
+FPU_CONTEXT_COMPUTE	cpu/mipsel/__cpu_context.S	/^#define FPU_CONTEXT_COMPUTE(op)	\\$/;"	d
+G	libk/md5.c	/^#define G(/;"	d	file:
+GDT_ENTRIES_NR	cpu/i386/cpu_internal.c	/^#define GDT_ENTRIES_NR /;"	d	file:
+GDT_FIXED_NR	cpu/i386/cpu-internal.h	/^	GDT_FIXED_NR$/;"	e	enum:__anon1
+GDT_KDATA_ENTRY	cpu/i386/cpu-internal.h	/^	GDT_KDATA_ENTRY,		\/* 0x10 *\/$/;"	e	enum:__anon1
+GDT_KTEXT_ENTRY	cpu/i386/cpu-internal.h	/^	GDT_KTEXT_ENTRY,		\/* 0x08 *\/$/;"	e	enum:__anon1
+GDT_NULL_ENTRY	cpu/i386/cpu-internal.h	/^	GDT_NULL_ENTRY = 0,		\/* 0x00 *\/$/;"	e	enum:__anon1
+GDT_UDATA_ENTRY	cpu/i386/cpu-internal.h	/^	GDT_UDATA_ENTRY,		\/* 0x20 used in cpu_context.c::__cpu_context_init *\/$/;"	e	enum:__anon1
+GDT_UTEXT_ENTRY	cpu/i386/cpu-internal.h	/^	GDT_UTEXT_ENTRY,		\/* 0x18 used in cpu_context.c::__cpu_context_init *\/$/;"	e	enum:__anon1
+GDT_UTLS_ENTRY	cpu/i386/cpu-internal.h	/^	GDT_UTLS_ENTRY,                 \/* 0x28 used in cpu_context.c::__cpu_context_init *\/$/;"	e	enum:__anon1
+GET_CLUSTER_ID	arch/ibmpc/arch.h	/^#define GET_CLUSTER_ID(/;"	d
+GET_CLUSTER_ID	arch/ibmpc/arch.h	/^#undef GET_CLUSTER_ID$/;"	d
+GET_CPU_ID	arch/ibmpc/arch.h	/^#define GET_CPU_ID(/;"	d
+GET_CPU_ID	arch/ibmpc/arch.h	/^#undef GET_CPU_ID$/;"	d
+GG	libk/md5.c	/^#define GG(/;"	d	file:
+GP	cpu/mipsel/cpu-regs.h	/^#define      GP /;"	d
+H	libk/md5.c	/^#define H(/;"	d	file:
+HH	libk/md5.c	/^#define HH(/;"	d	file:
+HI	cpu/mipsel/cpu-regs.h	/^#define      HI /;"	d
+I	libk/md5.c	/^#define I(/;"	d	file:
+I386	libk/config.h	/^#define  I386 /;"	d
+ICU_HIGHEST_IRQ	drivers/soclib/soclib_icu.c	/^#define ICU_HIGHEST_IRQ /;"	d	file:
+ICU_INPUT_REG	drivers/soclib/soclib_icu.c	/^#define ICU_INPUT_REG /;"	d	file:
+ICU_IRQ_MAX	drivers/soclib/soclib_icu.c	/^#define ICU_IRQ_MAX /;"	d	file:
+ICU_MASK	arch/ibmpc/arch_init.c	/^#define ICU_MASK /;"	d	file:
+ICU_MASK	arch/tsar/arch_init.c	/^#define ICU_MASK /;"	d	file:
+ICU_MASK_CLEAR_REG	drivers/soclib/soclib_icu.c	/^#define ICU_MASK_CLEAR_REG /;"	d	file:
+ICU_MASK_REG	drivers/soclib/soclib_icu.c	/^#define ICU_MASK_REG /;"	d	file:
+ICU_MASK_SET_REG	drivers/soclib/soclib_icu.c	/^#define ICU_MASK_SET_REG /;"	d	file:
+ID	kern/rpc.h	/^#define ID(/;"	d
+IDT_ENTRIES_NR	cpu/i386/cpu_internal.c	/^#define IDT_ENTRIES_NR /;"	d	file:
+II	libk/md5.c	/^#define II(/;"	d	file:
+INCLUDES	Makefile	/^INCLUDES=	$(foreach DIR,$(DIRS),-I$(DIR)) -I$(OBJDIR)\/kern\/$/;"	m
+INFO	kern/kdmsg.h	/^#define INFO /;"	d
+INIT_PATH	kern/do_exec.c	/^#define INIT_PATH /;"	d	file:
+INT16_MAX	libk/stdint.h	/^#define INT16_MAX /;"	d
+INT16_MIN	libk/stdint.h	/^#define INT16_MIN /;"	d
+INT32_MAX	libk/stdint.h	/^#define INT32_MAX /;"	d
+INT32_MIN	libk/stdint.h	/^#define INT32_MIN /;"	d
+INT8_MAX	libk/stdint.h	/^#define INT8_MAX /;"	d
+INT8_MIN	libk/stdint.h	/^#define INT8_MIN /;"	d
+IN_KSPACE	libk/config.h	/^#define IN_KSPACE(/;"	d
+IN_USPACE	libk/config.h	/^#define IN_USPACE(/;"	d
+IOPIC_ADDRESS	drivers/soclib/soclib_iopic.h	/^#define IOPIC_ADDRESS /;"	d
+IOPIC_EXTEND	drivers/soclib/soclib_iopic.h	/^#define IOPIC_EXTEND /;"	d
+IOPIC_SPAN	drivers/soclib/soclib_iopic.h	/^#define IOPIC_SPAN /;"	d
+IOPIC_STATUS	drivers/soclib/soclib_iopic.h	/^#define IOPIC_STATUS /;"	d
+IOPIC_WTI_PER_CLSTR	drivers/soclib/soclib_iopic.h	/^#define IOPIC_WTI_PER_CLSTR /;"	d
+IO_CLUSTER_ID	arch/ibmpc/hardware.h	/^#define IO_CLUSTER_ID /;"	d
+IRQ_DYN	kern/interrupt.h	/^#define IRQ_DYN /;"	d
+IRQ_SHD	kern/interrupt.h	/^#define IRQ_SHD /;"	d
+ISR_KTTY_LOCK	kern/kdmsg.h	/^	ISR_KTTY_LOCK,$/;"	e	enum:__anon17
+IS_EMPTY	kern/rpc.h	/^#define IS_EMPTY(/;"	d
+KATTR	arch/tsar/arch_init.c	/^#define KATTR /;"	d	file:
+KCM_ALIGNE	mm/kcm.c	/^#define KCM_ALIGNE /;"	d	file:
+KCM_PAGE_ACTIVE	mm/kcm.c	/^#define KCM_PAGE_ACTIVE /;"	d	file:
+KCM_PAGE_BUSY	mm/kcm.c	/^#define KCM_PAGE_BUSY /;"	d	file:
+KCM_PAGE_CLEAR	mm/kcm.c	/^#define KCM_PAGE_CLEAR(/;"	d	file:
+KCM_PAGE_IS	mm/kcm.c	/^#define KCM_PAGE_IS(/;"	d	file:
+KCM_PAGE_MASK	mm/kcm.c	/^#define KCM_PAGE_MASK /;"	d	file:
+KCM_PAGE_SET	mm/kcm.c	/^#define KCM_PAGE_SET(/;"	d	file:
+KCM_PAGE_SIZE	mm/kcm.c	/^#define KCM_PAGE_SIZE /;"	d	file:
+KCOND_VAR_ID	kern/kmagics.h	/^#define KCOND_VAR_ID /;"	d
+KDEV_ATTR	arch/tsar/arch_init.c	/^#define KDEV_ATTR /;"	d	file:
+KERNEL_MODE	cpu/mipsel/__cpu_kentry.S	/^KERNEL_MODE:$/;"	l
+KERNEL_REV	Makefile	/^KERNEL_REV ?=current$/;"	m
+KERNEL_SIGNATURE	libk/boot-info.h	/^#define KERNEL_SIGNATURE /;"	d
+KERNEL_TOTAL_NR	libk/utils.h	/^#define  KERNEL_TOTAL_NR /;"	d
+KEYBOARD_READ_REG	drivers/ibmpc/tty.c	/^#define KEYBOARD_READ_REG /;"	d	file:
+KEYBOARD_STATUS_REG	drivers/ibmpc/tty.c	/^#define KEYBOARD_STATUS_REG /;"	d	file:
+KEYBOARD_WRITE_REG	drivers/ibmpc/tty.c	/^#define KEYBOARD_WRITE_REG /;"	d	file:
+KEYBORAD_CMD_REG	drivers/ibmpc/tty.c	/^#define KEYBORAD_CMD_REG /;"	d	file:
+KEYS_PER_REC	kern/keysdb.c	/^#define KEYS_PER_REC /;"	d	file:
+KEYS_PER_REC_LOG2	kern/keysdb.c	/^#define KEYS_PER_REC_LOG2 /;"	d	file:
+KEY_IS_ALT	drivers/ibmpc/tty.c	/^#define KEY_IS_ALT /;"	d	file:
+KEY_IS_CAPSLOCK	drivers/ibmpc/tty.c	/^#define KEY_IS_CAPSLOCK /;"	d	file:
+KEY_IS_CTRL	drivers/ibmpc/tty.c	/^#define KEY_IS_CTRL /;"	d	file:
+KEY_IS_HOLD	drivers/ibmpc/tty.c	/^#define KEY_IS_HOLD /;"	d	file:
+KEY_IS_LEFT_SHIFT	drivers/ibmpc/tty.c	/^#define KEY_IS_LEFT_SHIFT /;"	d	file:
+KEY_IS_RIGHT_SHIFT	drivers/ibmpc/tty.c	/^#define KEY_IS_RIGHT_SHIFT /;"	d	file:
+KFIFO_GET	kern/kfifo.c	/^KFIFO_GET(multi_event_get)$/;"	f
+KFIFO_GET	kern/kfifo.c	/^KFIFO_GET(single_event_get)$/;"	f
+KFIFO_GET	kern/kfifo.h	/^#define KFIFO_GET(/;"	d
+KFIFO_MASK	kern/kfifo.h	/^#define KFIFO_MASK /;"	d
+KFIFO_MR	kern/kfifo.h	/^#define KFIFO_MR /;"	d
+KFIFO_MR	kern/kfifo.h	/^#define KFIFO_MR$/;"	d
+KFIFO_MR	kern/kfifo.h	/^#undef  KFIFO_MR$/;"	d
+KFIFO_MW	kern/kfifo.h	/^#define KFIFO_MW /;"	d
+KFIFO_MW	kern/kfifo.h	/^#define KFIFO_MW$/;"	d
+KFIFO_MW	kern/kfifo.h	/^#undef  KFIFO_MW$/;"	d
+KFIFO_MWMR	kern/kfifo.h	/^#define KFIFO_MWMR /;"	d
+KFIFO_MWMR	kern/kfifo.h	/^#define KFIFO_MWMR$/;"	d
+KFIFO_MWMR	kern/kfifo.h	/^#undef  KFIFO_MWMR$/;"	d
+KFIFO_NA	kern/kfifo.h	/^#define KFIFO_NA /;"	d
+KFIFO_NA	kern/kfifo.h	/^#define KFIFO_NA$/;"	d
+KFIFO_NA	kern/kfifo.h	/^#undef  KFIFO_NA$/;"	d
+KFIFO_PUT	kern/kfifo.c	/^KFIFO_PUT(multi_event_put)$/;"	f
+KFIFO_PUT	kern/kfifo.c	/^KFIFO_PUT(single_event_put)$/;"	f
+KFIFO_PUT	kern/kfifo.h	/^#define KFIFO_PUT(/;"	d
+KK_BUFF	kern/ku_transfert.h	/^#define KK_BUFF(/;"	d
+KK_OBJ	kern/ku_transfert.h	/^#define KK_OBJ(/;"	d
+KK_SZ_BUFF	kern/ku_transfert.h	/^#define KK_SZ_BUFF(/;"	d
+KMEM_BARRIER	mm/kmem.h	/^  KMEM_BARRIER,$/;"	e	enum:__anon46
+KMEM_BLKIO	mm/kmem.h	/^  KMEM_BLKIO,$/;"	e	enum:__anon46
+KMEM_BOOT_STAGE	mm/heap_manager.h	/^#define  KMEM_BOOT_STAGE /;"	d
+KMEM_CV	mm/kmem.h	/^  KMEM_CV,$/;"	e	enum:__anon46
+KMEM_DEVFS_CTX	mm/kmem.h	/^  KMEM_DEVFS_CTX,$/;"	e	enum:__anon46
+KMEM_DEVFS_FILE	mm/kmem.h	/^  KMEM_DEVFS_FILE,		\/* 10 *\/$/;"	e	enum:__anon46
+KMEM_DMA_REQUEST	mm/kmem.h	/^  KMEM_DMA_REQUEST,$/;"	e	enum:__anon46
+KMEM_FDINFO	mm/kmem.h	/^  KMEM_FDINFO,$/;"	e	enum:__anon46
+KMEM_GENERIC	mm/kmem.h	/^  KMEM_GENERIC,                \/* RESERVED *\/$/;"	e	enum:__anon46
+KMEM_KEYSREC	mm/kmem.h	/^  KMEM_KEYSREC,			$/;"	e	enum:__anon46
+KMEM_MAPPER	mm/kmem.h	/^  KMEM_MAPPER,$/;"	e	enum:__anon46
+KMEM_MAPPER_CNT	mm/kmem.h	/^  KMEM_MAPPER_CNT,$/;"	e	enum:__anon46
+KMEM_OBJATTR_INIT	fs/devfs/devfs_context.c	/^KMEM_OBJATTR_INIT(devfs_kmem_context_init)$/;"	f
+KMEM_OBJATTR_INIT	fs/devfs/devfs_file.c	/^KMEM_OBJATTR_INIT(devfs_kmem_file_init)$/;"	f
+KMEM_OBJATTR_INIT	fs/fat32/fat32_context.c	/^KMEM_OBJATTR_INIT(vfat_kmem_context_init)$/;"	f
+KMEM_OBJATTR_INIT	fs/fat32/fat32_node.c	/^KMEM_OBJATTR_INIT(vfat_kmem_inode_init)$/;"	f
+KMEM_OBJATTR_INIT	fs/ramfs/ramfs_file.c	/^KMEM_OBJATTR_INIT(ramfs_kmem_file_init)$/;"	f
+KMEM_OBJATTR_INIT	fs/sysfs/sysfs_file.c	/^KMEM_OBJATTR_INIT(sysfs_kmem_file_init)$/;"	f
+KMEM_OBJATTR_INIT	fs/sysfs/sysfs_node.c	/^KMEM_OBJATTR_INIT(sysfs_kmem_node_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/barrier.c	/^KMEM_OBJATTR_INIT(wqdb_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/blkio.c	/^KMEM_OBJATTR_INIT(blkio_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/keysdb.c	/^KMEM_OBJATTR_INIT(keysrec_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/radix.c	/^KMEM_OBJATTR_INIT(radix_node_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/sys_barrier.c	/^KMEM_OBJATTR_INIT(barrier_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/sys_cond_var.c	/^KMEM_OBJATTR_INIT(cv_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/sys_dma_memcpy.c	/^KMEM_OBJATTR_INIT(dma_kmem_request_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/sys_rwlock.c	/^KMEM_OBJATTR_INIT(rwlock_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/sys_sem.c	/^KMEM_OBJATTR_INIT(sem_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/task.c	/^KMEM_OBJATTR_INIT(task_fdinfo_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	kern/task.c	/^KMEM_OBJATTR_INIT(task_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	mm/kmem.h	/^#define KMEM_OBJATTR_INIT(/;"	d
+KMEM_OBJATTR_INIT	mm/mapper.c	/^KMEM_OBJATTR_INIT(mapper_cnt_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	mm/mapper.c	/^KMEM_OBJATTR_INIT(mapper_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	mm/vm_region.c	/^KMEM_OBJATTR_INIT(vm_region_kmem_init)$/;"	f
+KMEM_OBJATTR_INIT	vfs/vfs_cache.c	/^KMEM_OBJATTR_INIT(vfs_kmem_dirent_init)$/;"	f
+KMEM_OBJATTR_INIT	vfs/vfs_cache.c	/^KMEM_OBJATTR_INIT(vfs_kmem_inode_init)$/;"	f
+KMEM_OBJATTR_INIT	vfs/vfs_file.c	/^KMEM_OBJATTR_INIT(vfs_kmem_file_remote_init)$/;"	f
+KMEM_OBJATTR_INIT	vfs/vfs_init.c	/^KMEM_OBJATTR_INIT(vfs_kmem_context_init)$/;"	f
+KMEM_PAGE	mm/kmem.h	/^  KMEM_PAGE = 0,	       \/* RESERVED *\/$/;"	e	enum:__anon46
+KMEM_RADIX_NODE	mm/kmem.h	/^  KMEM_RADIX_NODE,$/;"	e	enum:__anon46
+KMEM_RAMFS_FILE	mm/kmem.h	/^  KMEM_RAMFS_FILE,			$/;"	e	enum:__anon46
+KMEM_RWLOCK	mm/kmem.h	/^  KMEM_RWLOCK,$/;"	e	enum:__anon46
+KMEM_SEM	mm/kmem.h	/^  KMEM_SEM,			$/;"	e	enum:__anon46
+KMEM_SYSFS_FILE	mm/kmem.h	/^  KMEM_SYSFS_FILE,$/;"	e	enum:__anon46
+KMEM_SYSFS_NODE	mm/kmem.h	/^  KMEM_SYSFS_NODE,$/;"	e	enum:__anon46
+KMEM_TASK	mm/kmem.h	/^  KMEM_TASK,$/;"	e	enum:__anon46
+KMEM_TYPES_NR	mm/kmem.h	/^  KMEM_TYPES_NR$/;"	e	enum:__anon46
+KMEM_VFAT_CTX	mm/kmem.h	/^  KMEM_VFAT_CTX,$/;"	e	enum:__anon46
+KMEM_VFAT_NODE	mm/kmem.h	/^  KMEM_VFAT_NODE,$/;"	e	enum:__anon46
+KMEM_VFS_CTX	mm/kmem.h	/^  KMEM_VFS_CTX,$/;"	e	enum:__anon46
+KMEM_VFS_DIRENT	mm/kmem.h	/^  KMEM_VFS_DIRENT,$/;"	e	enum:__anon46
+KMEM_VFS_FILE_REMOTE	mm/kmem.h	/^  KMEM_VFS_FILE_REMOTE,$/;"	e	enum:__anon46
+KMEM_VFS_INODE	mm/kmem.h	/^  KMEM_VFS_INODE,$/;"	e	enum:__anon46
+KMEM_VM_REGION	mm/kmem.h	/^  KMEM_VM_REGION,		\/* 20 *\/$/;"	e	enum:__anon46
+KMEM_WQDB	mm/kmem.h	/^  KMEM_WQDB,			\/* 25 *\/$/;"	e	enum:__anon46
+KSP	cpu/i386/__cpu_context.S	/^#define KSP		10*4$/;"	d
+KSP	cpu/mipsel/cpu-regs.h	/^#define      KSP /;"	d
+KTHREAD	kern/thread.h	/^	KTHREAD = 1,$/;"	e	enum:__anon37
+KU_BUFF	kern/ku_transfert.h	/^#define KU_BUFF(/;"	d
+KU_OBJ	kern/ku_transfert.h	/^#define KU_OBJ(/;"	d
+KU_SLICE_BUFF	kern/ku_transfert.h	/^#define KU_SLICE_BUFF(/;"	d
+KU_SZ_BUFF	kern/ku_transfert.h	/^#define KU_SZ_BUFF(/;"	d
+LEVEL	kern/kdmsg.h	/^#define LEVEL /;"	d
+LFLAGS	Makefile	/^LFLAGS = -T$(OBJDIR)\/kldscript $(CPULFLAGS)$/;"	m
+LIST_NEXT_DEAD	kern/kmagics.h	/^#define LIST_NEXT_DEAD /;"	d
+LIST_PRED_DEAD	kern/kmagics.h	/^#define LIST_PRED_DEAD /;"	d
+LIST_ROOT_INITIALIZER	libk/list.h	/^#define LIST_ROOT_INITIALIZER(/;"	d
+LIST_SNEXT_DEAD	kern/kmagics.h	/^#define LIST_SNEXT_DEAD /;"	d
+LO	cpu/mipsel/cpu-regs.h	/^#define      LO /;"	d
+LOADABLE	cpu/i386/__cpu_context.S	/^#define LOADABLE	7*4$/;"	d
+LOAD_KERNEL_SEGMENT	cpu/i386/__kentry.S	/^#define LOAD_KERNEL_SEGMENT	  \\$/;"	d
+LOAD_KERNEL_STACK	cpu/mipsel/__cpu_kentry.S	/^LOAD_KERNEL_STACK:$/;"	l
+LSB	arch/tsar/arch_init.c	/^#define LSB(/;"	d	file:
+LSB	arch/tsar/kdmsg.c	/^#define LSB(/;"	d	file:
+LSB	drivers/soclib/soclib_iopic.c	/^#define LSB(/;"	d	file:
+M	kern/dqdt.h	/^	uint_t   M;$/;"	m	struct:dqdt_indicators_s
+MADV_DONTNEED	mm/vmm.h	/^#define MADV_DONTNEED /;"	d
+MADV_MIGRATE	mm/vmm.h	/^#define MADV_MIGRATE /;"	d
+MADV_NORMAL	mm/vmm.h	/^#define MADV_NORMAL /;"	d
+MADV_RANDOM	mm/vmm.h	/^#define MADV_RANDOM /;"	d
+MADV_SEQUENTIAL	mm/vmm.h	/^#define MADV_SEQUENTIAL /;"	d
+MADV_WILLNEED	mm/vmm.h	/^#define MADV_WILLNEED /;"	d
+MAIN_DEVICE_NBR	drivers/soclib/soclib_block.c	/^#define MAIN_DEVICE_NBR /;"	d	file:
+MAKE_CPU_ID	arch/ibmpc/arch.h	/^#define MAKE_CPU_ID(/;"	d
+MAKE_CPU_ID	arch/ibmpc/arch.h	/^#undef MAKE_CPU_ID$/;"	d
+MAPPER_CLEAR_PAGE_DIRTY	mm/mapper.c	/^MAPPER_CLEAR_PAGE_DIRTY(mapper_default_clear_page_dirty)$/;"	f
+MAPPER_CLEAR_PAGE_DIRTY	mm/mapper.h	/^#define MAPPER_CLEAR_PAGE_DIRTY(/;"	d
+MAPPER_IS_HOME	mm/mapper.h	/^#define MAPPER_IS_HOME(/;"	d
+MAPPER_IS_MIGRATABLE	mm/mapper.h	/^#define MAPPER_IS_MIGRATABLE(/;"	d
+MAPPER_IS_NULL	mm/mapper.h	/^#define MAPPER_IS_NULL(/;"	d
+MAPPER_OP_FIRST	mm/mapper.c	/^#define MAPPER_OP_FIRST /;"	d	file:
+MAPPER_OP_LAST	mm/mapper.c	/^#define MAPPER_OP_LAST	/;"	d	file:
+MAPPER_OP_READ	mm/mapper.c	/^#define MAPPER_OP_READ	/;"	d	file:
+MAPPER_READ_PAGE	fs/fat32/fat32_mapper.c	/^MAPPER_READ_PAGE(vfat_file_read_page) $/;"	f
+MAPPER_READ_PAGE	fs/fat32/fat32_mapper.c	/^MAPPER_READ_PAGE(vfat_node_read_page)$/;"	f
+MAPPER_READ_PAGE	fs/ramfs/ramfs_mapper.c	/^MAPPER_READ_PAGE(ramfs_file_read_page) $/;"	f
+MAPPER_READ_PAGE	fs/ramfs/ramfs_mapper.c	/^MAPPER_READ_PAGE(ramfs_file_write_page) $/;"	f
+MAPPER_READ_PAGE	mm/mapper.c	/^MAPPER_READ_PAGE(mapper_default_read_page)$/;"	f
+MAPPER_READ_PAGE	mm/mapper.h	/^#define MAPPER_READ_PAGE(/;"	d
+MAPPER_RELEASE_PAGE	mm/mapper.c	/^MAPPER_RELEASE_PAGE(mapper_default_release_page)$/;"	f
+MAPPER_RELEASE_PAGE	mm/mapper.h	/^#define MAPPER_RELEASE_PAGE(/;"	d
+MAPPER_SET_PAGE_DIRTY	mm/mapper.c	/^MAPPER_SET_PAGE_DIRTY(mapper_default_set_page_dirty)$/;"	f
+MAPPER_SET_PAGE_DIRTY	mm/mapper.h	/^#define MAPPER_SET_PAGE_DIRTY(/;"	d
+MAPPER_SYNC_OP	mm/mapper.h	/^#define MAPPER_SYNC_OP /;"	d
+MAPPER_SYNC_PAGE	mm/mapper.c	/^MAPPER_SYNC_PAGE(mapper_default_sync_page)$/;"	f
+MAPPER_SYNC_PAGE	mm/mapper.h	/^#define MAPPER_SYNC_PAGE(/;"	d
+MAPPER_WRITE_PAGE	fs/fat32/fat32_mapper.c	/^MAPPER_WRITE_PAGE(vfat_node_write_page) $/;"	f
+MAPPER_WRITE_PAGE	mm/mapper.c	/^MAPPER_WRITE_PAGE(mapper_default_write_page)$/;"	f
+MAPPER_WRITE_PAGE	mm/mapper.h	/^#define MAPPER_WRITE_PAGE(/;"	d
+MAX	libk/bits.h	/^#define MAX(/;"	d
+MAX_CPU_NR	kern/sys_thread_create.c	/^#define MAX_CPU_NR /;"	d	file:
+MAX_CPU_NR	kern/sys_thread_migrate.c	/^#define MAX_CPU_NR /;"	d	file:
+MAX_FS	vfs/vfs_init.c	/^#define MAX_FS /;"	d	file:
+MAX_KEY_ID	kern/radix.c	/^#define MAX_KEY_ID(/;"	d	file:
+MAX_NAME_SIZE	kern/task.h	/^#define MAX_NAME_SIZE /;"	d
+MCNTL_L1_iFLUSH	mm/page.h	/^#define MCNTL_L1_iFLUSH /;"	d
+MCNTL_MOVE	mm/page.h	/^#define MCNTL_MOVE /;"	d
+MCNTL_OPS_NR	mm/page.h	/^#define MCNTL_OPS_NR /;"	d
+MCNTL_READ	mm/page.h	/^#define MCNTL_READ /;"	d
+MD5Final	libk/md5.c	/^void MD5Final (uint8_t digest[16], MD5_CTX* context) {$/;"	f
+MD5Init	libk/md5.c	/^void MD5Init (MD5_CTX* context) {$/;"	f
+MD5Update	libk/md5.c	/^void MD5Update (MD5_CTX *context, const uint8_t *input, size_t inputBytes) {$/;"	f
+MD5_CTX	libk/md5.h	/^} MD5_CTX;$/;"	t	typeref:struct:__anon44
+MEMC_BINVLT_TIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_BINVLT_TIDX /;"	d	file:
+MEMC_BINVL_TOTAL	drivers/soclib/soclib_memc.c	/^#define MEMC_BINVL_TOTAL /;"	d	file:
+MEMC_CLNUP_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_CLNUP_CIDX /;"	d	file:
+MEMC_CLNUP_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_CLNUP_COST /;"	d	file:
+MEMC_CLNUP_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_CLNUP_LIDX /;"	d	file:
+MEMC_CLNUP_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_CLNUP_LOCAL /;"	d	file:
+MEMC_CLNUP_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_CLNUP_REMOTE /;"	d	file:
+MEMC_CLNUP_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_CLNUP_RIDX /;"	d	file:
+MEMC_CNF_FUNC	drivers/soclib/soclib_memc.c	/^#define MEMC_CNF_FUNC /;"	d	file:
+MEMC_COHER_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_COHER_SEL /;"	d	file:
+MEMC_CS_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_CS_CIDX /;"	d	file:
+MEMC_CS_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_CS_COST /;"	d	file:
+MEMC_CS_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_CS_LIDX /;"	d	file:
+MEMC_CS_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_CS_LOCAL /;"	d	file:
+MEMC_CS_MINVLT_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_CS_MINVLT_SEL /;"	d	file:
+MEMC_CS_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_CS_REMOTE /;"	d	file:
+MEMC_CS_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_CS_RIDX /;"	d	file:
+MEMC_DIRCT_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_DIRCT_SEL /;"	d	file:
+MEMC_ERR_FUNC	drivers/soclib/soclib_memc.c	/^#define MEMC_ERR_FUNC /;"	d	file:
+MEMC_HI_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_HI_SEL /;"	d	file:
+MEMC_LL_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_LL_CIDX /;"	d	file:
+MEMC_LL_CLNUP_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_LL_CLNUP_SEL /;"	d	file:
+MEMC_LL_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_LL_COST /;"	d	file:
+MEMC_LL_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_LL_LIDX /;"	d	file:
+MEMC_LL_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_LL_LOCAL /;"	d	file:
+MEMC_LL_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_LL_REMOTE /;"	d	file:
+MEMC_LL_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_LL_RIDX /;"	d	file:
+MEMC_LOC_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_LOC_SEL /;"	d	file:
+MEMC_LO_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_LO_SEL /;"	d	file:
+MEMC_MINVLT_TIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVLT_TIDX /;"	d	file:
+MEMC_MINVL_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVL_CIDX /;"	d	file:
+MEMC_MINVL_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVL_COST /;"	d	file:
+MEMC_MINVL_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVL_LIDX /;"	d	file:
+MEMC_MINVL_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVL_LOCAL /;"	d	file:
+MEMC_MINVL_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVL_REMOTE /;"	d	file:
+MEMC_MINVL_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVL_RIDX /;"	d	file:
+MEMC_MINVL_TOTAL	drivers/soclib/soclib_memc.c	/^#define MEMC_MINVL_TOTAL /;"	d	file:
+MEMC_MUPDTT_TIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDTT_TIDX /;"	d	file:
+MEMC_MUPDT_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDT_CIDX /;"	d	file:
+MEMC_MUPDT_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDT_COST /;"	d	file:
+MEMC_MUPDT_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDT_LIDX /;"	d	file:
+MEMC_MUPDT_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDT_LOCAL /;"	d	file:
+MEMC_MUPDT_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDT_REMOTE /;"	d	file:
+MEMC_MUPDT_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDT_RIDX /;"	d	file:
+MEMC_MUPDT_TOTAL	drivers/soclib/soclib_memc.c	/^#define MEMC_MUPDT_TOTAL /;"	d	file:
+MEMC_OTH_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_OTH_SEL /;"	d	file:
+MEMC_PRF_FUNC	drivers/soclib/soclib_memc.c	/^#define MEMC_PRF_FUNC /;"	d	file:
+MEMC_RD_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_RD_CIDX /;"	d	file:
+MEMC_RD_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_RD_COST /;"	d	file:
+MEMC_RD_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_RD_LIDX /;"	d	file:
+MEMC_RD_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_RD_LOCAL /;"	d	file:
+MEMC_RD_MUPDT_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_RD_MUPDT_SEL /;"	d	file:
+MEMC_RD_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_RD_REMOTE /;"	d	file:
+MEMC_RD_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_RD_RIDX /;"	d	file:
+MEMC_REG	drivers/soclib/soclib_memc.c	/^#define MEMC_REG(/;"	d	file:
+MEMC_REG_IDX	drivers/soclib/soclib_memc.c	/^#define MEMC_REG_IDX(/;"	d	file:
+MEMC_REG_NR	drivers/soclib/soclib_memc.c	/^#define MEMC_REG_NR /;"	d	file:
+MEMC_REM_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_REM_SEL /;"	d	file:
+MEMC_SC_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_SC_CIDX /;"	d	file:
+MEMC_SC_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_SC_COST /;"	d	file:
+MEMC_SC_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_SC_LIDX /;"	d	file:
+MEMC_SC_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_SC_LOCAL /;"	d	file:
+MEMC_SC_MUPDTT_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_SC_MUPDTT_SEL /;"	d	file:
+MEMC_SC_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_SC_REMOTE /;"	d	file:
+MEMC_SC_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_SC_RIDX /;"	d	file:
+MEMC_WR_CIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_WR_CIDX /;"	d	file:
+MEMC_WR_COST	drivers/soclib/soclib_memc.c	/^#define MEMC_WR_COST /;"	d	file:
+MEMC_WR_LIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_WR_LIDX /;"	d	file:
+MEMC_WR_LOCAL	drivers/soclib/soclib_memc.c	/^#define MEMC_WR_LOCAL /;"	d	file:
+MEMC_WR_MINVL_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_WR_MINVL_SEL /;"	d	file:
+MEMC_WR_REMOTE	drivers/soclib/soclib_memc.c	/^#define MEMC_WR_REMOTE /;"	d	file:
+MEMC_WR_RIDX	drivers/soclib/soclib_memc.c	/^#define MEMC_WR_RIDX /;"	d	file:
+MEMC_XX_BINVLT_SEL	drivers/soclib/soclib_memc.c	/^#define MEMC_XX_BINVLT_SEL /;"	d	file:
+MEM_CHECK_VAL	kern/kmagics.h	/^#define MEM_CHECK_VAL /;"	d
+METAFS_HASH_SIZE	kern/metafs.h	/^#define METAFS_HASH_SIZE /;"	d
+MGRT_DEFAULT	mm/vmm.h	/^#define MGRT_DEFAULT /;"	d
+MGRT_STACK	mm/vmm.h	/^#define MGRT_STACK /;"	d
+MIN	libk/bits.h	/^#define MIN(/;"	d
+MIPS32	libk/config.h	/^#define  MIPS32 /;"	d
+MMU_CLEAR	arch/tsar/arch-pmm.h	/^#define MMU_CLEAR(/;"	d
+MMU_DBVAR	arch/tsar/mmu-info.h	/^#define MMU_DBVAR /;"	d
+MMU_DCACHE_FLUSH	arch/tsar/mmu-info.h	/^#define MMU_DCACHE_FLUSH /;"	d
+MMU_DCACHE_INVAL	arch/tsar/mmu-info.h	/^#define MMU_DCACHE_INVAL /;"	d
+MMU_DCACHE_PA_INV	arch/tsar/mmu-info.h	/^#define MMU_DCACHE_PA_INV /;"	d
+MMU_DCACHE_PREFETCH	arch/tsar/mmu-info.h	/^#define MMU_DCACHE_PREFETCH /;"	d
+MMU_DETR	arch/tsar/mmu-info.h	/^#define MMU_DETR /;"	d
+MMU_DOUBLE_LL	arch/tsar/mmu-info.h	/^#define MMU_DOUBLE_LL /;"	d
+MMU_DOUBLE_SC	arch/tsar/mmu-info.h	/^#define MMU_DOUBLE_SC /;"	d
+MMU_DTLB_INVAL	arch/tsar/mmu-info.h	/^#define MMU_DTLB_INVAL /;"	d
+MMU_EFATAL	arch/tsar/arch-pmm.h	/^#define MMU_EFATAL /;"	d
+MMU_EKMODE	arch/tsar/arch-pmm.h	/^#define MMU_EKMODE /;"	d
+MMU_EWMASK	arch/tsar/arch-pmm.h	/^#define MMU_EWMASK /;"	d
+MMU_IBVAR	arch/tsar/mmu-info.h	/^#define MMU_IBVAR /;"	d
+MMU_ICACHE_FLUSH	arch/tsar/mmu-info.h	/^#define MMU_ICACHE_FLUSH /;"	d
+MMU_ICACHE_INVAL	arch/tsar/mmu-info.h	/^#define MMU_ICACHE_INVAL /;"	d
+MMU_ICACHE_PA_INV	arch/tsar/mmu-info.h	/^#define MMU_ICACHE_PA_INV /;"	d
+MMU_ICACHE_PREFETCH	arch/tsar/mmu-info.h	/^#define MMU_ICACHE_PREFETCH /;"	d
+MMU_IETR	arch/tsar/mmu-info.h	/^#define MMU_IETR /;"	d
+MMU_IS_SET	arch/tsar/arch-pmm.h	/^#define MMU_IS_SET(/;"	d
+MMU_ITLB_INVAL	arch/tsar/mmu-info.h	/^#define MMU_ITLB_INVAL /;"	d
+MMU_LACCESSED	arch/tsar/arch-pmm.h	/^#define MMU_LACCESSED /;"	d
+MMU_MD	cpu/mipsel/cpu-regs.h	/^#define      MMU_MD	/;"	d
+MMU_MD_MASK	cpu/mipsel/__cpu_kentry.S	/^#define MMU_MD_MASK  0xF$/;"	d
+MMU_MODE	arch/tsar/mmu-info.h	/^#define MMU_MODE /;"	d
+MMU_PARAMS	arch/tsar/mmu-info.h	/^#define MMU_PARAMS /;"	d
+MMU_PDE	arch/tsar/arch-pmm.h	/^#define MMU_PDE(/;"	d
+MMU_PDE_ATTR_MASK	arch/tsar/arch-pmm.h	/^#define MMU_PDE_ATTR_MASK /;"	d
+MMU_PDE_MASK	arch/tsar/arch-pmm.h	/^#define MMU_PDE_MASK /;"	d
+MMU_PDE_PPN_MASK	arch/tsar/arch-pmm.h	/^#define MMU_PDE_PPN_MASK /;"	d
+MMU_PDE_SHIFT	arch/tsar/arch-pmm.h	/^#define MMU_PDE_SHIFT /;"	d
+MMU_PPN_MASK	arch/tsar/arch-pmm.h	/^#define MMU_PPN_MASK /;"	d
+MMU_PTD1	arch/tsar/arch-pmm.h	/^#define MMU_PTD1 /;"	d
+MMU_PTE	arch/tsar/arch-pmm.h	/^#define MMU_PTE(/;"	d
+MMU_PTE_MASK	arch/tsar/arch-pmm.h	/^#define MMU_PTE_MASK /;"	d
+MMU_PTE_SHIFT	arch/tsar/arch-pmm.h	/^#define MMU_PTE_SHIFT /;"	d
+MMU_PTPR	arch/tsar/mmu-info.h	/^#define MMU_PTPR /;"	d
+MMU_RACCESSED	arch/tsar/arch-pmm.h	/^#define MMU_RACCESSED /;"	d
+MMU_RELEASE	arch/tsar/mmu-info.h	/^#define MMU_RELEASE /;"	d
+MMU_SET	arch/tsar/arch-pmm.h	/^#define MMU_SET(/;"	d
+MMU_SYNC	arch/tsar/mmu-info.h	/^#define MMU_SYNC /;"	d
+MMU_UNKNOWN_ERR	arch/tsar/mmu-info.c	/^#define MMU_UNKNOWN_ERR /;"	d	file:
+MMU_WORD_HI	arch/tsar/mmu-info.h	/^#define MMU_WORD_HI /;"	d
+MMU_WORD_LO	arch/tsar/mmu-info.h	/^#define MMU_WORD_LO /;"	d
+MSB	arch/tsar/arch_init.c	/^#define MSB(/;"	d	file:
+MSB	arch/tsar/kdmsg.c	/^#define MSB(/;"	d	file:
+MSB	drivers/soclib/soclib_iopic.c	/^#define MSB(/;"	d	file:
+MSEC_PER_TICK	arch/tsar/arch.h	/^#define MSEC_PER_TICK /;"	d
+MSEC_PER_TICK	arch/tsar/arch.h	/^#undef MSEC_PER_TICK$/;"	d
+MSEC_PER_TICK	kern/hal-arch.h	/^#define MSEC_PER_TICK$/;"	d
+MSG_STR_LEN	ksh/kminiShell.h	/^#define MSG_STR_LEN /;"	d
+MS_MAX_ARG_LEN	ksh/kminiShell.h	/^#define MS_MAX_ARG_LEN /;"	d
+MS_MAX_LINE_LEN	ksh/kminiShell.h	/^#define MS_MAX_LINE_LEN /;"	d
+MULTIBOOT_HEADER_FLAGS	cpu/i386/__boot.S	/^#define MULTIBOOT_HEADER_FLAGS	0x00000003$/;"	d
+MULTIBOOT_HEADER_MAGIC	cpu/i386/__boot.S	/^#define MULTIBOOT_HEADER_MAGIC  0x1BADB002$/;"	d
+NB_TAGS	kern/radix.h	/^	NB_TAGS$/;"	e	enum:__anon24
+NB_TEST	kern/rpc.c	/^#define NB_TEST /;"	d	file:
+NEXT_CHILD	kern/radix.c	/^#define NEXT_CHILD(/;"	d	file:
+NOT_IN_USPACE	libk/config.h	/^#define NOT_IN_USPACE(/;"	d
+NO_KTTY_LOCK	kern/kdmsg.h	/^	NO_KTTY_LOCK$/;"	e	enum:__anon17
+NR_THREADS	ksh/miniShell.c	/^#define NR_THREADS /;"	d	file:
+NULL	libk/list.h	/^#define NULL /;"	d
+NULL	libk/types.h	/^#define NULL /;"	d
+OBJDIRS	Makefile	/^OBJDIRS= $(addprefix $(OBJDIR)\/, $(DIRS))$/;"	m
+OBJS	Makefile	/^OBJS=	$(addprefix $(OBJDIR)\/, $(CFILES:.c=.o) $(SFILES:.S=.o))$/;"	m
+OUTPUT_IRQ_PER_PROC	drivers/soclib/soclib_xicu.h	/^#define OUTPUT_IRQ_PER_PROC /;"	d
+OUT_KENTRY	cpu/mipsel/__cpu_kentry.S	/^OUT_KENTRY:$/;"	l
+OUT_MMU_3	cpu/mipsel/__cpu_kentry.S	/^OUT_MMU_3:$/;"	l
+OUT_MMU_7	cpu/mipsel/__cpu_kentry.S	/^OUT_MMU_7:$/;"	l
+PAGES_TBL_SIZE	mm/mapper.c	/^#define PAGES_TBL_SIZE /;"	d	file:
+PAGE_CLEAR	mm/page.h	/^#define PAGE_CLEAR(/;"	d
+PAGE_IS	mm/page.h	/^#define PAGE_IS(/;"	d
+PAGE_SET	mm/page.h	/^#define PAGE_SET(/;"	d
+PANIC	kern/kdmsg.h	/^#define PANIC(/;"	d
+PASTE2	kern/rpc.h	/^#define PASTE2(/;"	d
+PASTE2_	kern/rpc.h	/^#define PASTE2_(/;"	d
+PASTE2__	kern/rpc.h	/^#define PASTE2__(/;"	d
+PASTE3	kern/rpc.h	/^#define PASTE3(/;"	d
+PASTE3_	kern/rpc.h	/^#define PASTE3_(/;"	d
+PASTE3__	kern/rpc.h	/^#define PASTE3__(/;"	d
+PCI_BAR0	drivers/ibmpc/pci-bus.h	/^#define PCI_BAR0 /;"	d
+PCI_BAR1	drivers/ibmpc/pci-bus.h	/^#define PCI_BAR1 /;"	d
+PCI_BAR2	drivers/ibmpc/pci-bus.h	/^#define PCI_BAR2 /;"	d
+PCI_BAR3	drivers/ibmpc/pci-bus.h	/^#define PCI_BAR3 /;"	d
+PCI_BAR4	drivers/ibmpc/pci-bus.h	/^#define PCI_BAR4 /;"	d
+PCI_BAR5	drivers/ibmpc/pci-bus.h	/^#define PCI_BAR5 /;"	d
+PCI_BRIDGE_TYPE	drivers/ibmpc/pci-bus.h	/^#define PCI_BRIDGE_TYPE /;"	d
+PCI_BUS_DEV_MAX_NR	drivers/ibmpc/pci-bus.h	/^#define PCI_BUS_DEV_MAX_NR /;"	d
+PCI_BUS_MAX_NR	drivers/ibmpc/pci-bus.h	/^#define PCI_BUS_MAX_NR /;"	d
+PCI_CARDBUS_BRIDGE_TYPE	drivers/ibmpc/pci-bus.h	/^#define PCI_CARDBUS_BRIDGE_TYPE /;"	d
+PCI_CLASS_ID	drivers/ibmpc/pci-bus.h	/^#define PCI_CLASS_ID /;"	d
+PCI_CMD_REG	drivers/ibmpc/pci-bus.h	/^#define PCI_CMD_REG /;"	d
+PCI_CONFIG_ADDR	drivers/ibmpc/pci-bus.h	/^#define PCI_CONFIG_ADDR /;"	d
+PCI_CONFIG_DATA	drivers/ibmpc/pci-bus.h	/^#define PCI_CONFIG_DATA /;"	d
+PCI_DEVCIE_ID	drivers/ibmpc/pci-bus.h	/^#define PCI_DEVCIE_ID /;"	d
+PCI_DEV_FUNC_MAX_NR	drivers/ibmpc/pci-bus.h	/^#define PCI_DEV_FUNC_MAX_NR /;"	d
+PCI_HEADER_TYPE	drivers/ibmpc/pci-bus.h	/^#define PCI_HEADER_TYPE /;"	d
+PCI_INT_INFO	drivers/ibmpc/pci-bus.h	/^#define PCI_INT_INFO /;"	d
+PCI_REVISION_ID	drivers/ibmpc/pci-bus.h	/^#define PCI_REVISION_ID /;"	d
+PCI_STATUS_REG	drivers/ibmpc/pci-bus.h	/^#define PCI_STATUS_REG /;"	d
+PCI_STD_DEV_TYPE	drivers/ibmpc/pci-bus.h	/^#define PCI_STD_DEV_TYPE /;"	d
+PCI_TGT_MAX_CONFIG_REG	drivers/ibmpc/pci-bus.h	/^#define PCI_TGT_MAX_CONFIG_REG /;"	d
+PCI_TGT_MAX_CONFIG_SPACE	drivers/ibmpc/pci-bus.h	/^#define PCI_TGT_MAX_CONFIG_SPACE /;"	d
+PCI_VENDOR_ID	drivers/ibmpc/pci-bus.h	/^#define PCI_VENDOR_ID /;"	d
+PF_MASKOS	libk/elf.h	/^#define PF_MASKOS	/;"	d
+PF_MASKPROC	libk/elf.h	/^#define PF_MASKPROC	/;"	d
+PF_R	libk/elf.h	/^#define PF_R	/;"	d
+PF_W	libk/elf.h	/^#define PF_W	/;"	d
+PF_X	libk/elf.h	/^#define PF_X	/;"	d
+PGFREE	mm/page.h	/^	PGFREE,$/;"	e	enum:__anon47
+PGINIT	mm/page.h	/^	PGINIT = 1,$/;"	e	enum:__anon47
+PGINVALID	mm/page.h	/^	PGINVALID,$/;"	e	enum:__anon47
+PGLOCKED	mm/page.h	/^	PGLOCKED$/;"	e	enum:__anon47
+PGLOCKEDIO	mm/page.h	/^	PGLOCKEDIO,$/;"	e	enum:__anon47
+PGRESERVED	mm/page.h	/^	PGRESERVED,$/;"	e	enum:__anon47
+PGVALID	mm/page.h	/^	PGVALID,$/;"	e	enum:__anon47
+PG_BUFFER	mm/page.h	/^#define PG_BUFFER	/;"	d
+PG_BUSY	mm/page.h	/^#define PG_BUSY	/;"	d
+PG_DIRTY	mm/page.h	/^#define PG_DIRTY	/;"	d
+PG_FREE	mm/page.h	/^#define PG_FREE	/;"	d
+PG_INIT	mm/page.h	/^#define PG_INIT	/;"	d
+PG_INLOAD	mm/page.h	/^#define PG_INLOAD	/;"	d
+PG_IO_ERR	mm/page.h	/^#define PG_IO_ERR	/;"	d
+PG_LOCKED	mm/page.h	/^#define PG_LOCKED /;"	d
+PG_MIGRATE	mm/page.h	/^#define PG_MIGRATE /;"	d
+PG_PINNED	mm/page.h	/^#define PG_PINNED /;"	d
+PG_RESERVED	mm/page.h	/^#define PG_RESERVED	/;"	d
+PIC_BASE	arch/ibmpc/segmentation.h	/^#define     PIC_BASE /;"	d
+PIC_CMD_REG	drivers/ibmpc/pic.h	/^#define PIC_CMD_REG /;"	d
+PIC_DATA_REG	drivers/ibmpc/pic.h	/^#define PIC_DATA_REG /;"	d
+PIC_IMR_REG	drivers/ibmpc/pic.h	/^#define PIC_IMR_REG	/;"	d
+PIC_IRQ_MAX	drivers/ibmpc/pic.h	/^#define PIC_IRQ_MAX /;"	d
+PIC_PRIMARY_PIO	drivers/ibmpc/pic.c	/^#define PIC_PRIMARY_PIO /;"	d	file:
+PIC_SECONDARY_PIO	drivers/ibmpc/pic.c	/^#define PIC_SECONDARY_PIO /;"	d	file:
+PIC_STATUS_REG	drivers/ibmpc/pic.h	/^#define PIC_STATUS_REG /;"	d
+PID_GET_CLUSTER	kern/pid.h	/^#define PID_GET_CLUSTER(/;"	d
+PID_GET_LOCAL	kern/pid.h	/^#define PID_GET_LOCAL(/;"	d
+PID_MASK	kern/pid.h	/^#define PID_MASK /;"	d
+PID_MAX_GLOBAL	kern/pid.h	/^#define PID_MAX_GLOBAL /;"	d
+PID_MAX_LOCAL	kern/pid.h	/^#define PID_MAX_LOCAL /;"	d
+PID_MIN_GLOBAL	kern/pid.h	/^#define PID_MIN_GLOBAL /;"	d
+PID_MIN_LOCAL	kern/pid.h	/^#define PID_MIN_LOCAL /;"	d
+PMM_ACCESSED	arch/tsar/arch-pmm.h	/^#define PMM_ACCESSED /;"	d
+PMM_ACCESSED	arch/tsar/arch-pmm.h	/^#undef PMM_ACCESSED$/;"	d
+PMM_ACCESSED	mm/pmm.h	/^#define PMM_ACCESSED$/;"	d
+PMM_CACHED	arch/tsar/arch-pmm.h	/^#define PMM_CACHED /;"	d
+PMM_CACHED	arch/tsar/arch-pmm.h	/^#undef PMM_CACHED$/;"	d
+PMM_CACHED	mm/pmm.h	/^#define PMM_CACHED$/;"	d
+PMM_CID_SHIFT	arch/tsar/arch-pmm.h	/^#define PMM_CID_SHIFT	/;"	d
+PMM_CLEAR	arch/tsar/arch-pmm.h	/^#define PMM_CLEAR /;"	d
+PMM_CLEAR	arch/tsar/arch-pmm.h	/^#undef PMM_CLEAR$/;"	d
+PMM_CLEAR	mm/pmm.h	/^#define PMM_CLEAR$/;"	d
+PMM_COW	arch/tsar/arch-pmm.h	/^#define PMM_COW /;"	d
+PMM_COW	arch/tsar/arch-pmm.h	/^#undef PMM_COW$/;"	d
+PMM_COW	mm/pmm.h	/^#define PMM_COW$/;"	d
+PMM_DATA	arch/tsar/arch-pmm.h	/^#define PMM_DATA /;"	d
+PMM_DATA	arch/tsar/arch-pmm.h	/^#undef PMM_DATA$/;"	d
+PMM_DATA	mm/pmm.h	/^#define PMM_DATA$/;"	d
+PMM_DEBUG	arch/tsar/pmm.c	/^#define PMM_DEBUG /;"	d	file:
+PMM_DIRTY	arch/tsar/arch-pmm.h	/^#define PMM_DIRTY /;"	d
+PMM_DIRTY	arch/tsar/arch-pmm.h	/^#undef PMM_DIRTY$/;"	d
+PMM_DIRTY	mm/pmm.h	/^#define PMM_DIRTY$/;"	d
+PMM_EXECUTE	arch/tsar/arch-pmm.h	/^#define PMM_EXECUTE /;"	d
+PMM_EXECUTE	arch/tsar/arch-pmm.h	/^#undef PMM_EXECUTE$/;"	d
+PMM_EXECUTE	mm/pmm.h	/^#define PMM_EXECUTE$/;"	d
+PMM_GLOBAL	arch/tsar/arch-pmm.h	/^#define PMM_GLOBAL /;"	d
+PMM_GLOBAL	arch/tsar/arch-pmm.h	/^#undef PMM_GLOBAL$/;"	d
+PMM_GLOBAL	mm/pmm.h	/^#define PMM_GLOBAL$/;"	d
+PMM_HUGE	arch/tsar/arch-pmm.h	/^#define PMM_HUGE /;"	d
+PMM_HUGE	arch/tsar/arch-pmm.h	/^#undef PMM_HUGE$/;"	d
+PMM_HUGE	mm/pmm.h	/^#define PMM_HUGE$/;"	d
+PMM_HUGE_PAGE_MASK	arch/tsar/arch-pmm.h	/^#define PMM_HUGE_PAGE_MASK /;"	d
+PMM_HUGE_PAGE_SHIFT	arch/tsar/arch-pmm.h	/^#define PMM_HUGE_PAGE_SHIFT /;"	d
+PMM_HUGE_PAGE_SIZE	arch/tsar/arch-pmm.h	/^#define PMM_HUGE_PAGE_SIZE /;"	d
+PMM_HUGE_PAGE_SIZE	arch/tsar/arch-pmm.h	/^#undef PMM_HUGE_PAGE_SIZE$/;"	d
+PMM_HUGE_PAGE_SIZE	mm/pmm.h	/^#define PMM_HUGE_PAGE_SIZE$/;"	d
+PMM_LAZY	arch/tsar/arch-pmm.h	/^#define PMM_LAZY /;"	d
+PMM_LAZY	arch/tsar/arch-pmm.h	/^#undef PMM_LAZY$/;"	d
+PMM_LAZY	mm/pmm.h	/^#define PMM_LAZY$/;"	d
+PMM_LOCKED	arch/tsar/arch-pmm.h	/^#define PMM_LOCKED /;"	d
+PMM_LOCKED	arch/tsar/arch-pmm.h	/^#undef PMM_LOCKED$/;"	d
+PMM_LOCKED	mm/pmm.h	/^#define PMM_LOCKED$/;"	d
+PMM_MIGRATE	arch/tsar/arch-pmm.h	/^#define PMM_MIGRATE /;"	d
+PMM_MIGRATE	arch/tsar/arch-pmm.h	/^#undef PMM_MIGRATE$/;"	d
+PMM_MIGRATE	mm/pmm.h	/^#define PMM_MIGRATE$/;"	d
+PMM_OTHER_TASK	arch/tsar/arch-pmm.h	/^#define PMM_OTHER_TASK /;"	d
+PMM_OTHER_TASK	arch/tsar/arch-pmm.h	/^#undef PMM_OTHER_TASK$/;"	d
+PMM_OTHER_TASK	mm/pmm.h	/^#define PMM_OTHER_TASK$/;"	d
+PMM_PAGE_MASK	arch/tsar/arch-pmm.h	/^#define PMM_PAGE_MASK /;"	d
+PMM_PAGE_MASK	arch/tsar/arch-pmm.h	/^#undef PMM_PAGE_MASK /;"	d
+PMM_PAGE_MASK	mm/pmm.h	/^#define PMM_PAGE_MASK /;"	d
+PMM_PAGE_SHIFT	arch/tsar/arch-pmm.h	/^#define PMM_PAGE_SHIFT /;"	d
+PMM_PAGE_SHIFT	arch/tsar/arch-pmm.h	/^#undef PMM_PAGE_SHIFT$/;"	d
+PMM_PAGE_SHIFT	mm/pmm.h	/^#define PMM_PAGE_SHIFT$/;"	d
+PMM_PAGE_SIZE	arch/tsar/arch-pmm.h	/^#define PMM_PAGE_SIZE /;"	d
+PMM_PAGE_SIZE	arch/tsar/arch-pmm.h	/^#undef PMM_PAGE_SIZE$/;"	d
+PMM_PAGE_SIZE	mm/pmm.h	/^#define PMM_PAGE_SIZE$/;"	d
+PMM_PRESENT	arch/tsar/arch-pmm.h	/^#define PMM_PRESENT /;"	d
+PMM_PRESENT	arch/tsar/arch-pmm.h	/^#undef PMM_PRESENT$/;"	d
+PMM_PRESENT	mm/pmm.h	/^#define PMM_PRESENT$/;"	d
+PMM_READ	arch/tsar/arch-pmm.h	/^#define PMM_READ /;"	d
+PMM_READ	arch/tsar/arch-pmm.h	/^#undef PMM_READ /;"	d
+PMM_READ	mm/pmm.h	/^#define PMM_READ /;"	d
+PMM_SWAP	arch/tsar/arch-pmm.h	/^#define PMM_SWAP /;"	d
+PMM_SWAP	arch/tsar/arch-pmm.h	/^#undef PMM_SWAP$/;"	d
+PMM_SWAP	mm/pmm.h	/^#define PMM_SWAP$/;"	d
+PMM_TEXT	arch/tsar/arch-pmm.h	/^#define PMM_TEXT /;"	d
+PMM_TEXT	arch/tsar/arch-pmm.h	/^#undef PMM_TEXT$/;"	d
+PMM_TEXT	mm/pmm.h	/^#define PMM_TEXT$/;"	d
+PMM_UNKNOWN	arch/tsar/arch-pmm.h	/^#define PMM_UNKNOWN /;"	d
+PMM_UNKNOWN	arch/tsar/arch-pmm.h	/^#undef PMM_UNKNOWN$/;"	d
+PMM_UNKNOWN	mm/pmm.h	/^#define PMM_UNKNOWN$/;"	d
+PMM_USER	arch/tsar/arch-pmm.h	/^#define PMM_USER /;"	d
+PMM_USER	arch/tsar/arch-pmm.h	/^#undef PMM_USER$/;"	d
+PMM_USER	mm/pmm.h	/^#define PMM_USER$/;"	d
+PMM_WRITE	arch/tsar/arch-pmm.h	/^#define PMM_WRITE /;"	d
+PMM_WRITE	arch/tsar/arch-pmm.h	/^#undef PMM_WRITE /;"	d
+PMM_WRITE	mm/pmm.h	/^#define PMM_WRITE /;"	d
+POBJECT_CREATED	kern/kmagics.h	/^#define POBJECT_CREATED /;"	d
+PPM_HUGE_PAGE_MASK	arch/tsar/arch-pmm.h	/^#undef PPM_HUGE_PAGE_MASK$/;"	d
+PPM_HUGE_PAGE_MASK	mm/pmm.h	/^#define PPM_HUGE_PAGE_MASK$/;"	d
+PPM_HUGE_PAGE_SHIFT	arch/tsar/arch-pmm.h	/^#undef PPM_HUGE_PAGE_SHIFT$/;"	d
+PPM_HUGE_PAGE_SHIFT	mm/pmm.h	/^#define PPM_HUGE_PAGE_SHIFT$/;"	d
+PPM_ID	kern/kmagics.h	/^#define PPM_ID /;"	d
+PPM_LAST_ORDER	mm/ppm.h	/^#define PPM_LAST_ORDER /;"	d
+PPM_MAX_ORDER	mm/ppm.h	/^#define PPM_MAX_ORDER /;"	d
+PPM_MAX_WAIT	mm/ppm.h	/^#define PPM_MAX_WAIT /;"	d
+PRINTK_KTTY_LOCK	kern/kdmsg.h	/^	PRINTK_KTTY_LOCK,$/;"	e	enum:__anon17
+PRINT_RPC	kern/rpc.c	/^#define PRINT_RPC(/;"	d	file:
+PROC_WIDTH	cpu/mipsel/__cpu_kentry.S	/^#define PROC_WIDTH 2$/;"	d
+PTHREAD	kern/thread.h	/^	PTHREAD = 0,$/;"	e	enum:__anon37
+PTHREAD_BARRIER_SERIAL_THREAD	kern/barrier.c	/^#define PTHREAD_BARRIER_SERIAL_THREAD /;"	d	file:
+PT_ATTR_AUTO_MGRT	kern/thread.h	/^#define PT_ATTR_AUTO_MGRT /;"	d
+PT_ATTR_AUTO_NXTT	kern/thread.h	/^#define PT_ATTR_AUTO_NXTT /;"	d
+PT_ATTR_DEFAULT	kern/thread.h	/^#define PT_ATTR_DEFAULT /;"	d
+PT_ATTR_DETACH	kern/thread.h	/^#define PT_ATTR_DETACH /;"	d
+PT_ATTR_INTERLEAVE_ALL	kern/thread.h	/^#define PT_ATTR_INTERLEAVE_ALL /;"	d
+PT_ATTR_INTERLEAVE_SEQ	kern/thread.h	/^#define PT_ATTR_INTERLEAVE_SEQ /;"	d
+PT_ATTR_LEGACY_MASK	kern/thread.h	/^#define PT_ATTR_LEGACY_MASK /;"	d
+PT_ATTR_MEM_CID_RR	kern/thread.h	/^#define PT_ATTR_MEM_CID_RR /;"	d
+PT_ATTR_MEM_PRIO	kern/thread.h	/^#define PT_ATTR_MEM_PRIO /;"	d
+PT_DYNAMIC	libk/elf.h	/^#define PT_DYNAMIC	/;"	d
+PT_FORK_USE_AFFINITY	kern/thread.h	/^#define PT_FORK_USE_AFFINITY /;"	d
+PT_FORK_USE_TARGET_CPU	kern/thread.h	/^#define PT_FORK_USE_TARGET_CPU /;"	d
+PT_FORK_WILL_EXEC	kern/thread.h	/^#define PT_FORK_WILL_EXEC /;"	d
+PT_GNU_EH_FRAME	libk/elf.h	/^#define PT_GNU_EH_FRAME	/;"	d
+PT_GNU_RELRO	libk/elf.h	/^#define PT_GNU_RELRO	/;"	d
+PT_GNU_STACK	libk/elf.h	/^#define PT_GNU_STACK	/;"	d
+PT_HIOS	libk/elf.h	/^#define PT_HIOS	/;"	d
+PT_HIPROC	libk/elf.h	/^#define PT_HIPROC	/;"	d
+PT_HISUNW	libk/elf.h	/^#define PT_HISUNW	/;"	d
+PT_INTERP	libk/elf.h	/^#define PT_INTERP	/;"	d
+PT_LOAD	libk/elf.h	/^#define PT_LOAD	/;"	d
+PT_LOOS	libk/elf.h	/^#define PT_LOOS	/;"	d
+PT_LOPROC	libk/elf.h	/^#define PT_LOPROC	/;"	d
+PT_LOSUNW	libk/elf.h	/^#define PT_LOSUNW	/;"	d
+PT_NOTE	libk/elf.h	/^#define PT_NOTE	/;"	d
+PT_NULL	libk/elf.h	/^#define	PT_NULL	/;"	d
+PT_NUM	libk/elf.h	/^#define	PT_NUM	/;"	d
+PT_PHDR	libk/elf.h	/^#define PT_PHDR	/;"	d
+PT_SHLIB	libk/elf.h	/^#define PT_SHLIB	/;"	d
+PT_SUNWBSS	libk/elf.h	/^#define PT_SUNWBSS	/;"	d
+PT_SUNWSTACK	libk/elf.h	/^#define PT_SUNWSTACK	/;"	d
+PT_TLS	libk/elf.h	/^#define PT_TLS	/;"	d
+RA	cpu/mipsel/cpu-regs.h	/^#define      RA /;"	d
+RADIX_H_	kern/radix.h	/^#define RADIX_H_$/;"	d
+RADIX_INFO_DELETE	kern/radix.h	/^	RADIX_INFO_DELETE,$/;"	e	enum:__anon25
+RADIX_INFO_INSERT	kern/radix.h	/^	RADIX_INFO_INSERT$/;"	e	enum:__anon25
+RADIX_INFO_SET	kern/radix.h	/^	RADIX_INFO_SET,$/;"	e	enum:__anon25
+RAMSCREEN	cpu/i386/screen.h	/^#define RAMSCREEN /;"	d
+RB_BLACK	libk/rbtree.h	/^#define	RB_BLACK	/;"	d
+RB_CLEAR_NODE	libk/rbtree.h	/^#define RB_CLEAR_NODE(/;"	d
+RB_EMPTY_NODE	libk/rbtree.h	/^#define RB_EMPTY_NODE(/;"	d
+RB_EMPTY_ROOT	libk/rbtree.h	/^#define RB_EMPTY_ROOT(/;"	d
+RB_RED	libk/rbtree.h	/^#define	RB_RED	/;"	d
+RB_ROOT	libk/rbtree.h	/^#define RB_ROOT	/;"	d
+RCPC	kern/rpc.h	/^#define RCPC(/;"	d
+REGS_NR	cpu/mipsel/cpu-regs.h	/^#define      REGS_NR /;"	d
+REMOTE_FIFO_MAX_SLOT	kern/remote_fifo.h	/^#define REMOTE_FIFO_MAX_SLOT /;"	d
+REMOTE_IS_AS_LOCAL	kern/remote_fifo.h	/^#define REMOTE_IS_AS_LOCAL /;"	d
+RESTORE_REGS	cpu/i386/__kentry.S	/^#define RESTORE_REGS	  \\$/;"	d
+RETRY_PRINT	kern/remote_fifo.c	/^#define RETRY_PRINT /;"	d	file:
+RF_DEBUG	kern/remote_fifo.h	/^#define RF_DEBUG /;"	d
+RF_PRINT	kern/remote_fifo.c	/^#define RF_PRINT /;"	d	file:
+ROTATE_LEFT	libk/md5.c	/^#define ROTATE_LEFT(/;"	d	file:
+RPC_ALIGN	kern/rpc.h	/^#define RPC_ALIGN /;"	d
+RPC_ALLOCATE_ON_STACK_SZ	kern/rpc.h	/^#define RPC_ALLOCATE_ON_STACK_SZ /;"	d
+RPC_ARG	kern/rpc.h	/^#define RPC_ARG(/;"	d
+RPC_ARG_PTR	kern/rpc.h	/^#define RPC_ARG_PTR(/;"	d
+RPC_ARG_VAL	kern/rpc.h	/^#define RPC_ARG_VAL(/;"	d
+RPC_DECLARE	fs/fat32/fat32_access.c	/^RPC_DECLARE(__vfat_alloc_fat_entry, RPC_RET(RPC_RET_PTR(error_t, err), RPC_RET_PTR(vfat_cluster_t,new_cluster)), $/;"	f
+RPC_DECLARE	fs/fat32/fat32_access.c	/^RPC_DECLARE(__vfat_cluster_count, RPC_RET(RPC_RET_PTR(int, count)), $/;"	f
+RPC_DECLARE	fs/fat32/fat32_access.c	/^RPC_DECLARE(__vfat_cluster_lookup, RPC_RET(RPC_RET_PTR(error_t, err), $/;"	f
+RPC_DECLARE	fs/fat32/fat32_access.c	/^RPC_DECLARE(__vfat_extend_cluster, RPC_RET(RPC_RET_PTR(error_t, err), $/;"	f
+RPC_DECLARE	fs/fat32/fat32_access.c	/^RPC_DECLARE(__vfat_free_fat_entry, RPC_RET(RPC_RET_PTR(error_t, err)), $/;"	f
+RPC_DECLARE	fs/fat32/fat32_access.c	/^RPC_DECLARE(__vfat_query_fat, RPC_RET(RPC_RET_PTR(error_t, err), $/;"	f
+RPC_DECLARE	fs/fat32/fat32_node.c	/^RPC_DECLARE(__vfat_write_inode, RPC_RET(RPC_RET_PTR(error_t, err)),$/;"	f
+RPC_DECLARE	kern/rpc.c	/^RPC_DECLARE(__increment, RPC_RET(RPC_RET_PTR(uint32_t, res)), $/;"	f
+RPC_DECLARE	kern/rpc.h	/^#define RPC_DECLARE(/;"	d
+RPC_DECLARE	kern/sys_exec.c	/^RPC_DECLARE(__sys_exec, RPC_RET( RPC_RET_PTR(error_t, err), $/;"	f
+RPC_DECLARE	kern/task.c	/^RPC_DECLARE(__task_pid_alloc,$/;"	f
+RPC_DECLARE	kern/task.c	/^RPC_DECLARE(__task_whereis,$/;"	f
+RPC_DECLARE	mm/mapper.c	/^RPC_DECLARE( __mapper_get_ppn, $/;"	f
+RPC_DECLARE	mm/mapper.c	/^RPC_DECLARE(__mapper_request, $/;"	f
+RPC_DECLARE	mm/ppn.c	/^RPC_DECLARE(__ppn_refcount_down, $/;"	f
+RPC_DECLARE	mm/ppn.c	/^RPC_DECLARE(__ppn_refcount_up, $/;"	f
+RPC_DECLARE	vfs/vfs.c	/^RPC_DECLARE(__vfs_chmod, $/;"	f
+RPC_DECLARE	vfs/vfs.c	/^RPC_DECLARE(__vfs_delete_dirent, $/;"	f
+RPC_DECLARE	vfs/vfs.c	/^RPC_DECLARE(__vfs_get_name, $/;"	f
+RPC_DECLARE	vfs/vfs.c	/^RPC_DECLARE(__vfs_open, $/;"	f
+RPC_DECLARE	vfs/vfs.c	/^RPC_DECLARE(__vfs_readdir, RPC_RET(RPC_RET_PTR(error_t, err)),  $/;"	f
+RPC_DECLARE	vfs/vfs.c	/^RPC_DECLARE(__vfs_stat, RPC_RET(RPC_RET_PTR(error_t, err), $/;"	f
+RPC_DECLARE	vfs/vfs.c	/^RPC_DECLARE(_vfs_lseek, RPC_RET(RPC_RET_PTR(error_t, err), $/;"	f
+RPC_DECLARE	vfs/vfs_cache.c	/^RPC_DECLARE(__inode_size_get, $/;"	f
+RPC_DECLARE	vfs/vfs_cache.c	/^RPC_DECLARE(__vfs_create_inode, RPC_RET(RPC_RET_PTR(error_t, err), $/;"	f
+RPC_DECLARE	vfs/vfs_cache.c	/^RPC_DECLARE(__vfs_unlink_inode, $/;"	f
+RPC_DECLARE	vfs/vfs_file.c	/^RPC_DECLARE(__vfs_file_down,$/;"	f
+RPC_DECLARE	vfs/vfs_file.c	/^RPC_DECLARE(__vfs_file_up,$/;"	f
+RPC_DECLARE	vfs/vfs_init.c	/^RPC_DECLARE(alloc_context, RPC_RET(RPC_RET_PTR(struct vfs_context_s*, ctx)), RPC_ARG())$/;"	f
+RPC_DECLARE	vfs/vfs_init.c	/^RPC_DECLARE(replicate_root, RPC_RET(RPC_RET_PTR(error_t, err)), $/;"	f
+RPC_DECLARE	vfs/vfs_lookup.c	/^RPC_DECLARE( __vfs_lookup_child, $/;"	f
+RPC_DECLARE	vfs/vfs_lookup.c	/^RPC_DECLARE( __vfs_lookup_parent, $/;"	f
+RPC_DEFAULT_PROC_HANDLER	kern/rpc.h	/^#define RPC_DEFAULT_PROC_HANDLER /;"	d
+RPC_FUNC_DEMARSHALL	kern/rpc.h	/^#define RPC_FUNC_DEMARSHALL(/;"	d
+RPC_FUNC_LOCAL	kern/rpc.h	/^#define RPC_FUNC_LOCAL(/;"	d
+RPC_FUNC_NAME	kern/rpc.h	/^#define RPC_FUNC_NAME(/;"	d
+RPC_PRIO_EXEC	kern/rpc.h	/^#define RPC_PRIO_EXEC /;"	d
+RPC_PRIO_FS	kern/rpc.h	/^#define RPC_PRIO_FS /;"	d
+RPC_PRIO_FS_LOOKUP	kern/rpc.h	/^#define RPC_PRIO_FS_LOOKUP /;"	d
+RPC_PRIO_FS_STAT	kern/rpc.h	/^#define RPC_PRIO_FS_STAT /;"	d
+RPC_PRIO_FS_WRITE	kern/rpc.h	/^#define RPC_PRIO_FS_WRITE /;"	d
+RPC_PRIO_LAZY	kern/rpc.h	/^	RPC_PRIO_LAZY,$/;"	e	enum:__anon29
+RPC_PRIO_MAPPER	kern/rpc.h	/^#define RPC_PRIO_MAPPER /;"	d
+RPC_PRIO_NR	kern/rpc.h	/^	RPC_PRIO_NR$/;"	e	enum:__anon29
+RPC_PRIO_NRML	kern/rpc.h	/^	RPC_PRIO_NRML = RPC_PRIO_START,			\/* Fixed Priority *\/$/;"	e	enum:__anon29
+RPC_PRIO_PID_ALLOC	kern/rpc.h	/^#define RPC_PRIO_PID_ALLOC /;"	d
+RPC_PRIO_PPM	kern/rpc.h	/^#define RPC_PRIO_PPM /;"	d
+RPC_PRIO_PS	kern/rpc.h	/^#define RPC_PRIO_PS /;"	d
+RPC_PRIO_SIG_RISE	kern/rpc.h	/^#define RPC_PRIO_SIG_RISE /;"	d
+RPC_PRIO_START	kern/rpc.h	/^#define RPC_PRIO_START /;"	d
+RPC_PRIO_TSK_LOOKUP	kern/rpc.h	/^#define RPC_PRIO_TSK_LOOKUP /;"	d
+RPC_RECV	kern/rpc.h	/^#define RPC_RECV(/;"	d
+RPC_RECV_OBJ	kern/rpc.h	/^#define RPC_RECV_OBJ(/;"	d
+RPC_RET	kern/rpc.h	/^#define RPC_RET(/;"	d
+RPC_RET_PTR	kern/rpc.h	/^#define RPC_RET_PTR(/;"	d
+RPC_RSP_SEND	kern/rpc.h	/^#define RPC_RSP_SEND(/;"	d
+RPC_SEND	kern/rpc.h	/^#define RPC_SEND(/;"	d
+RPC_SEND_MEM	kern/rpc.h	/^#define RPC_SEND_MEM(/;"	d
+RPC_SEND_NULL	kern/rpc.h	/^#define RPC_SEND_NULL /;"	d
+RPC_SEND_OBJ	kern/rpc.h	/^#define RPC_SEND_OBJ(/;"	d
+RPC_THREAD_MAX	kern/rpc.h	/^#define RPC_THREAD_MAX /;"	d
+RPC_TH_PP	kern/thread_idle.c	/^#define RPC_TH_PP /;"	d	file:
+RPPC	kern/rpc.h	/^#define RPPC(/;"	d
+RR_QUANTUM	kern/rr-sched.c	/^#define RR_QUANTUM /;"	d	file:
+RR_QUANTUM	kern/rr-sched_locked.c	/^#define RR_QUANTUM /;"	d	file:
+RT_TIMER_ADJUST	kern/rt_timer.h	/^#define RT_TIMER_ADJUST /;"	d
+RT_TIMER_RUN	kern/rt_timer.h	/^#define RT_TIMER_RUN /;"	d
+RT_TIMER_STOP	kern/rt_timer.h	/^#define RT_TIMER_STOP /;"	d
+RUN_IN_PHYSICAL_MODE	arch/tsar/arch-config.h	/^#define RUN_IN_PHYSICAL_MODE /;"	d
+RWLOCK_DESTROY	kern/rwlock.h	/^	RWLOCK_DESTROY$/;"	e	enum:__anon30
+RWLOCK_ID	kern/kmagics.h	/^#define RWLOCK_ID /;"	d
+RWLOCK_INIT	kern/rwlock.h	/^	RWLOCK_INIT,$/;"	e	enum:__anon30
+RWLOCK_RDLOCK	kern/rwlock.h	/^	RWLOCK_RDLOCK,$/;"	e	enum:__anon30
+RWLOCK_TRYRDLOCK	kern/rwlock.h	/^	RWLOCK_TRYRDLOCK,$/;"	e	enum:__anon30
+RWLOCK_TRYWRLOCK	kern/rwlock.h	/^	RWLOCK_TRYWRLOCK,$/;"	e	enum:__anon30
+RWLOCK_UNLOCK	kern/rwlock.h	/^	RWLOCK_UNLOCK,$/;"	e	enum:__anon30
+RWLOCK_WRLOCK	kern/rwlock.h	/^	RWLOCK_WRLOCK,$/;"	e	enum:__anon30
+S0	cpu/mipsel/cpu-regs.h	/^#define      S0 /;"	d
+S1	cpu/mipsel/cpu-regs.h	/^#define      S1 /;"	d
+S2	cpu/mipsel/cpu-regs.h	/^#define      S2 /;"	d
+S3	cpu/mipsel/cpu-regs.h	/^#define      S3 /;"	d
+S4	cpu/mipsel/cpu-regs.h	/^#define      S4 /;"	d
+S5	cpu/mipsel/cpu-regs.h	/^#define      S5 /;"	d
+S6	cpu/mipsel/cpu-regs.h	/^#define      S6 /;"	d
+S7	cpu/mipsel/cpu-regs.h	/^#define      S7 /;"	d
+S8	cpu/mipsel/cpu-regs.h	/^#define      S8 /;"	d
+SAVE_REGS	cpu/i386/__kentry.S	/^#define SAVE_REGS         \\$/;"	d
+SAVE_SIZE	cpu/mipsel/__cpu_kentry.S	/^#define SAVE_SIZE      REGS_NR*4$/;"	d
+SCHEDS_NR	kern/scheduler.h	/^#define SCHEDS_NR /;"	d
+SCHED_CHECK_VAL	kern/kmagics.h	/^#define SCHED_CHECK_VAL /;"	d
+SCHED_FIFO	kern/scheduler.h	/^#define SCHED_FIFO /;"	d
+SCHED_OP	kern/scheduler.h	/^#define SCHED_OP(/;"	d
+SCHED_OP_ADD_CREATED	kern/scheduler.h	/^#define SCHED_OP_ADD_CREATED /;"	d
+SCHED_OP_ADD_CREATED	kern/scheduler.h	/^#define SCHED_OP_ADD_CREATED$/;"	d
+SCHED_OP_ADD_CREATED	kern/scheduler.h	/^#undef  SCHED_OP_ADD_CREATED /;"	d
+SCHED_OP_MASK	kern/scheduler.h	/^#define SCHED_OP_MASK /;"	d
+SCHED_OP_NOP	kern/scheduler.h	/^#define SCHED_OP_NOP /;"	d
+SCHED_OP_NOP	kern/scheduler.h	/^#define SCHED_OP_NOP$/;"	d
+SCHED_OP_NOP	kern/scheduler.h	/^#undef  SCHED_OP_NOP	/;"	d
+SCHED_OP_UWAKEUP	kern/scheduler.h	/^#define SCHED_OP_UWAKEUP /;"	d
+SCHED_OP_UWAKEUP	kern/scheduler.h	/^#define SCHED_OP_UWAKEUP$/;"	d
+SCHED_OP_UWAKEUP	kern/scheduler.h	/^#undef  SCHED_OP_UWAKEUP /;"	d
+SCHED_OP_WAKEUP	kern/scheduler.h	/^#define SCHED_OP_WAKEUP /;"	d
+SCHED_OP_WAKEUP	kern/scheduler.h	/^#define SCHED_OP_WAKEUP$/;"	d
+SCHED_OP_WAKEUP	kern/scheduler.h	/^#undef  SCHED_OP_WAKEUP /;"	d
+SCHED_OTHER	kern/scheduler.h	/^#define SCHED_OTHER /;"	d
+SCHED_PORT	kern/scheduler.h	/^#define SCHED_PORT(/;"	d
+SCHED_PORTS_NR	kern/scheduler.h	/^#define SCHED_PORTS_NR /;"	d
+SCHED_RR	kern/scheduler.h	/^#define SCHED_RR /;"	d
+SCHED_SCOPE	kern/rr-sched.c	/^#define SCHED_SCOPE /;"	d	file:
+SCHED_SCOPE	kern/rr-sched.c	/^#define SCHED_SCOPE$/;"	d	file:
+SCHED_SCOPE	kern/rr-sched.c	/^#undef SCHED_SCOPE$/;"	d	file:
+SCHED_SCOPE	kern/rr-sched_locked.c	/^#define SCHED_SCOPE /;"	d	file:
+SCHED_SCOPE	kern/rr-sched_locked.c	/^#define SCHED_SCOPE$/;"	d	file:
+SCHED_SCOPE	kern/rr-sched_locked.c	/^#undef SCHED_SCOPE$/;"	d	file:
+SCHED_SCOPE	kern/scheduler.c	/^#define SCHED_SCOPE /;"	d	file:
+SCHED_SCOPE	kern/scheduler.c	/^#define SCHED_SCOPE$/;"	d	file:
+SCHED_THREADS_NR	kern/rr-sched.c	/^#define SCHED_THREADS_NR /;"	d	file:
+SCHED_THREADS_NR	kern/rr-sched_locked.c	/^#define SCHED_THREADS_NR /;"	d	file:
+SCHED_THREADS_NR	kern/scheduler.c	/^#define SCHED_THREADS_NR /;"	d	file:
+SCREENLIM	cpu/i386/screen.h	/^#define SCREENLIM /;"	d
+SEMAPHORE_ID	kern/kmagics.h	/^#define SEMAPHORE_ID /;"	d
+SEM_DESTROY	kern/semaphore.h	/^	SEM_DESTROY$/;"	e	enum:__anon32
+SEM_GETVALUE	kern/semaphore.h	/^	SEM_GETVALUE,$/;"	e	enum:__anon32
+SEM_INIT	kern/semaphore.h	/^	SEM_INIT,$/;"	e	enum:__anon32
+SEM_POST	kern/semaphore.h	/^	SEM_POST,$/;"	e	enum:__anon32
+SEM_SCOPE_SYS	kern/semaphore.h	/^#define SEM_SCOPE_SYS /;"	d
+SEM_SCOPE_USR	kern/semaphore.h	/^#define SEM_SCOPE_USR /;"	d
+SEM_TRYWAIT	kern/semaphore.h	/^	SEM_TRYWAIT,$/;"	e	enum:__anon32
+SEM_VALUE_MAX	kern/semaphore.c	/^#define SEM_VALUE_MAX /;"	d	file:
+SEM_WAIT	kern/semaphore.h	/^	SEM_WAIT,$/;"	e	enum:__anon32
+SFILES	Makefile	/^SFILES=	$(wildcard cpu\/$(CPU)\/*.S)$/;"	m
+SGI_ALIGN2	ksh/sgiImg.h	/^#define SGI_ALIGN2(/;"	d
+SGI_ALIGN4	ksh/sgiImg.h	/^#define SGI_ALIGN4(/;"	d
+SGI_TO_LE2	ksh/sgiImg.h	/^#define SGI_TO_LE2(/;"	d
+SIGABRT	kern/signal.h	/^#define SIGABRT /;"	d
+SIGALRM	kern/signal.h	/^#define SIGALRM /;"	d
+SIGBUS	kern/signal.h	/^#define SIGBUS /;"	d
+SIGCHLD	kern/signal.h	/^#define SIGCHLD /;"	d
+SIGCLD	kern/signal.h	/^#define SIGCLD /;"	d
+SIGCONT	kern/signal.h	/^#define SIGCONT /;"	d
+SIGEMT	kern/signal.h	/^#define SIGEMT /;"	d
+SIGFPE	kern/signal.h	/^#define SIGFPE /;"	d
+SIGHUP	kern/signal.h	/^#define SIGHUP /;"	d
+SIGILL	kern/signal.h	/^#define SIGILL /;"	d
+SIGINT	kern/signal.h	/^#define SIGINT /;"	d
+SIGIO	kern/signal.h	/^#define SIGIO /;"	d
+SIGIOT	kern/signal.h	/^#define SIGIOT /;"	d
+SIGKILL	kern/signal.h	/^#define SIGKILL /;"	d
+SIGLOST	kern/signal.h	/^#define SIGLOST /;"	d
+SIGNAL_HANDLER	kern/signal.c	/^SIGNAL_HANDLER(kill_sigaction)$/;"	f
+SIGNAL_HANDLER	kern/signal.h	/^#define SIGNAL_HANDLER(/;"	d
+SIGPIPE	kern/signal.h	/^#define SIGPIPE /;"	d
+SIGPOLL	kern/signal.h	/^#define SIGPOLL /;"	d
+SIGPROF	kern/signal.h	/^#define SIGPROF /;"	d
+SIGQUIT	kern/signal.h	/^#define SIGQUIT /;"	d
+SIGSEGV	kern/signal.h	/^#define SIGSEGV /;"	d
+SIGSTOP	kern/signal.h	/^#define SIGSTOP /;"	d
+SIGSYS	kern/signal.h	/^#define SIGSYS /;"	d
+SIGTERM	kern/signal.h	/^#define SIGTERM /;"	d
+SIGTRAP	kern/signal.h	/^#define SIGTRAP /;"	d
+SIGTSTP	kern/signal.h	/^#define SIGTSTP /;"	d
+SIGTTIN	kern/signal.h	/^#define SIGTTIN /;"	d
+SIGTTOU	kern/signal.h	/^#define SIGTTOU /;"	d
+SIGURG	kern/signal.h	/^#define SIGURG /;"	d
+SIGUSR1	kern/signal.h	/^#define SIGUSR1 /;"	d
+SIGUSR2	kern/signal.h	/^#define SIGUSR2 /;"	d
+SIGVTALRM	kern/signal.h	/^#define SIGVTALRM /;"	d
+SIGWINCH	kern/signal.h	/^#define SIGWINCH /;"	d
+SIGXCPU	kern/signal.h	/^#define SIGXCPU /;"	d
+SIGXFSZ	kern/signal.h	/^#define SIGXFSZ /;"	d
+SIG_DEFAULT	kern/signal.h	/^#define SIG_DEFAULT /;"	d
+SIG_DEFAULT_MASK	kern/signal.h	/^#define SIG_DEFAULT_MASK /;"	d
+SIG_DEFAULT_STACK_SIZE	kern/signal.h	/^#define SIG_DEFAULT_STACK_SIZE /;"	d
+SIG_ERROR	kern/signal.h	/^#define SIG_ERROR /;"	d
+SIG_IGNORE	kern/signal.h	/^#define SIG_IGNORE /;"	d
+SIG_NR	kern/signal.h	/^#define SIG_NR /;"	d
+SIZESCREEN	cpu/i386/screen.h	/^#define SIZESCREEN /;"	d
+SIZE_OF_BUF	libk/iprintk.c	/^#define SIZE_OF_BUF /;"	d	file:
+SL_WRITER	kern/spinlock.c	/^#define SL_WRITER /;"	d	file:
+SOCLIB_BLKDEV_ID	drivers/soclib/drvdb.h	/^	SOCLIB_BLKDEV_ID,$/;"	e	enum:__anon2
+SOCLIB_CHDMA_ID	drivers/soclib/drvdb.h	/^	SOCLIB_CHDMA_ID,$/;"	e	enum:__anon2
+SOCLIB_DMA_ID	drivers/soclib/drvdb.h	/^	SOCLIB_DMA_ID,$/;"	e	enum:__anon2
+SOCLIB_DRVID_NR	drivers/soclib/drvdb.h	/^	SOCLIB_DRVID_NR$/;"	e	enum:__anon2
+SOCLIB_FB_ID	drivers/soclib/drvdb.h	/^	SOCLIB_FB_ID,$/;"	e	enum:__anon2
+SOCLIB_ICU_ID	drivers/soclib/drvdb.h	/^	SOCLIB_ICU_ID,$/;"	e	enum:__anon2
+SOCLIB_IOPIC_ID	drivers/soclib/drvdb.h	/^	SOCLIB_IOPIC_ID,$/;"	e	enum:__anon2
+SOCLIB_MEMC_ID	drivers/soclib/drvdb.h	/^	SOCLIB_MEMC_ID,$/;"	e	enum:__anon2
+SOCLIB_MNIC_ID	drivers/soclib/drvdb.h	/^	SOCLIB_MNIC_ID,$/;"	e	enum:__anon2
+SOCLIB_RAM_ID	drivers/soclib/drvdb.h	/^	SOCLIB_RAM_ID = 0,$/;"	e	enum:__anon2
+SOCLIB_RESERVED_ID	drivers/soclib/drvdb.h	/^	SOCLIB_RESERVED_ID,$/;"	e	enum:__anon2
+SOCLIB_TIMER_ID	drivers/soclib/drvdb.h	/^	SOCLIB_TIMER_ID,$/;"	e	enum:__anon2
+SOCLIB_TTY_ID	drivers/soclib/drvdb.h	/^	SOCLIB_TTY_ID,$/;"	e	enum:__anon2
+SOCLIB_XICU_ID	drivers/soclib/drvdb.h	/^	SOCLIB_XICU_ID,$/;"	e	enum:__anon2
+SP	cpu/mipsel/cpu-regs.h	/^#define      SP /;"	d
+SR	cpu/mipsel/cpu-regs.h	/^#define      SR /;"	d
+STRINGIZE	kern/rpc.h	/^#define STRINGIZE(/;"	d
+STRINGIZE1	kern/rpc.h	/^#define STRINGIZE1(/;"	d
+STRINGIZE2	kern/rpc.h	/^#define STRINGIZE2(/;"	d
+SYNC_MS_PERIOD	vfs/kvfsd.c	/^#define SYNC_MS_PERIOD /;"	d	file:
+SYSFS_BUFFER_SIZE	fs/sysfs/sysfs.h	/^#define SYSFS_BUFFER_SIZE /;"	d
+SYSFS_NAME_LEN	fs/sysfs/sysfs.h	/^#define SYSFS_NAME_LEN /;"	d
+SYS_ALARM	kern/syscall.h	/^	SYS_ALARM,                    $/;"	e	enum:__anon36
+SYS_BARRIER	kern/syscall.h	/^	SYS_BARRIER,                  $/;"	e	enum:__anon36
+SYS_CHDIR	kern/syscall.h	/^	SYS_CHDIR,                    \/* Service NR 20 *\/$/;"	e	enum:__anon36
+SYS_CHMOD	kern/syscall.h	/^	SYS_CHMOD,$/;"	e	enum:__anon36
+SYS_CLOCK	kern/syscall.h	/^	SYS_CLOCK,$/;"	e	enum:__anon36
+SYS_CLOSE	kern/syscall.h	/^	SYS_CLOSE,$/;"	e	enum:__anon36
+SYS_CLOSEDIR	kern/syscall.h	/^	SYS_CLOSEDIR,$/;"	e	enum:__anon36
+SYS_COND_VAR	kern/syscall.h	/^	SYS_COND_VAR,$/;"	e	enum:__anon36
+SYS_CREAT	kern/syscall.h	/^	SYS_CREAT,$/;"	e	enum:__anon36
+SYS_CREATE	kern/syscall.h	/^	SYS_CREATE,$/;"	e	enum:__anon36
+SYS_DETACH	kern/syscall.h	/^	SYS_DETACH,$/;"	e	enum:__anon36
+SYS_DMA_MEMCPY	kern/syscall.h	/^	SYS_DMA_MEMCPY,$/;"	e	enum:__anon36
+SYS_EXEC	kern/syscall.h	/^	SYS_EXEC,$/;"	e	enum:__anon36
+SYS_EXIT	kern/syscall.h	/^	SYS_EXIT,                      \/* SYS_EXIT SERIVCE NUMBER IS FROZEN *\/$/;"	e	enum:__anon36
+SYS_FORK	kern/syscall.h	/^	SYS_FORK,$/;"	e	enum:__anon36
+SYS_FSYNC	kern/syscall.h	/^	SYS_FSYNC,$/;"	e	enum:__anon36
+SYS_FTIME	kern/syscall.h	/^	SYS_FTIME,$/;"	e	enum:__anon36
+SYS_GETATTR	kern/syscall.h	/^	SYS_GETATTR,                 $/;"	e	enum:__anon36
+SYS_GETCWD	kern/syscall.h	/^	SYS_GETCWD,$/;"	e	enum:__anon36
+SYS_GETPID	kern/syscall.h	/^	SYS_GETPID,$/;"	e	enum:__anon36
+SYS_GET_TOD	kern/syscall.h	/^	SYS_GET_TOD,$/;"	e	enum:__anon36
+SYS_JOIN	kern/syscall.h	/^	SYS_JOIN,$/;"	e	enum:__anon36
+SYS_KILL	kern/syscall.h	/^	SYS_KILL,$/;"	e	enum:__anon36
+SYS_LSEEK	kern/syscall.h	/^	SYS_LSEEK,$/;"	e	enum:__anon36
+SYS_MADVISE	kern/syscall.h	/^	SYS_MADVISE,			\/* Service NR 40 *\/   $/;"	e	enum:__anon36
+SYS_MIGRATE	kern/syscall.h	/^	SYS_MIGRATE,$/;"	e	enum:__anon36
+SYS_MKDIR	kern/syscall.h	/^	SYS_MKDIR,$/;"	e	enum:__anon36
+SYS_MKFIFO	kern/syscall.h	/^	SYS_MKFIFO,                   $/;"	e	enum:__anon36
+SYS_MMAP	kern/syscall.h	/^	SYS_MMAP,$/;"	e	enum:__anon36
+SYS_OPEN	kern/syscall.h	/^	SYS_OPEN,                    $/;"	e	enum:__anon36
+SYS_OPENDIR	kern/syscall.h	/^	SYS_OPENDIR,$/;"	e	enum:__anon36
+SYS_PAGEINFO	kern/syscall.h	/^	SYS_PAGEINFO,$/;"	e	enum:__anon36
+SYS_PIPE	kern/syscall.h	/^	SYS_PIPE,$/;"	e	enum:__anon36
+SYS_PS	kern/syscall.h	/^	SYS_PS,$/;"	e	enum:__anon36
+SYS_READ	kern/syscall.h	/^	SYS_READ,$/;"	e	enum:__anon36
+SYS_READDIR	kern/syscall.h	/^	SYS_READDIR,$/;"	e	enum:__anon36
+SYS_RMDIR	kern/syscall.h	/^	SYS_RMDIR,$/;"	e	enum:__anon36
+SYS_RWLOCK	kern/syscall.h	/^	SYS_RWLOCK,$/;"	e	enum:__anon36
+SYS_SBRK	kern/syscall.h	/^	SYS_SBRK,$/;"	e	enum:__anon36
+SYS_SEMAPHORE	kern/syscall.h	/^	SYS_SEMAPHORE,$/;"	e	enum:__anon36
+SYS_SET_SIGRETURN	kern/syscall.h	/^	SYS_SET_SIGRETURN,$/;"	e	enum:__anon36
+SYS_SIGNAL	kern/syscall.h	/^	SYS_SIGNAL,                $/;"	e	enum:__anon36
+SYS_SIGRETURN	kern/syscall.h	/^	SYS_SIGRETURN,$/;"	e	enum:__anon36
+SYS_SLEEP	kern/syscall.h	/^	SYS_SLEEP,                    \/* Service NR 10 *\/$/;"	e	enum:__anon36
+SYS_STAT	kern/syscall.h	/^	SYS_STAT,$/;"	e	enum:__anon36
+SYS_TIMES	kern/syscall.h	/^	SYS_TIMES,$/;"	e	enum:__anon36
+SYS_TTY	arch/ibmpc/hardware.h	/^#define SYS_TTY /;"	d
+SYS_UNLINK	kern/syscall.h	/^	SYS_UNLINK,                   $/;"	e	enum:__anon36
+SYS_UTLS	kern/syscall.h	/^	SYS_UTLS,                     \/* Service NR 30 *\/  $/;"	e	enum:__anon36
+SYS_WAKEUP	kern/syscall.h	/^	SYS_WAKEUP,$/;"	e	enum:__anon36
+SYS_WRITE	kern/syscall.h	/^	SYS_WRITE,$/;"	e	enum:__anon36
+SYS_YIELD	kern/syscall.h	/^	SYS_YIELD,$/;"	e	enum:__anon36
+S_CREATE	kern/thread.h	/^	S_CREATE = 0,$/;"	e	enum:__anon38
+S_DEAD	kern/thread.h	/^	S_DEAD,$/;"	e	enum:__anon38
+S_KERNEL	kern/thread.h	/^	S_KERNEL,$/;"	e	enum:__anon38
+S_READY	kern/thread.h	/^	S_READY,$/;"	e	enum:__anon38
+S_USR	kern/thread.h	/^	S_USR,$/;"	e	enum:__anon38
+S_WAIT	kern/thread.h	/^	S_WAIT,$/;"	e	enum:__anon38
+T	cpu/i386/cpu-internal.h	/^	uint16_t T:1;			\/* 25 *\/$/;"	m	struct:cpu_tss_s
+T	kern/dqdt.h	/^	atomic_t T;$/;"	m	struct:dqdt_indicators_s
+T0	cpu/mipsel/cpu-regs.h	/^#define      T0 /;"	d
+T1	cpu/mipsel/cpu-regs.h	/^#define      T1 /;"	d
+T2	cpu/mipsel/cpu-regs.h	/^#define      T2 /;"	d
+T3	cpu/mipsel/cpu-regs.h	/^#define      T3 /;"	d
+T4	cpu/mipsel/cpu-regs.h	/^#define      T4 /;"	d
+T5	cpu/mipsel/cpu-regs.h	/^#define      T5 /;"	d
+T6	cpu/mipsel/cpu-regs.h	/^#define      T6 /;"	d
+T7	cpu/mipsel/cpu-regs.h	/^#define      T7 /;"	d
+T8	cpu/mipsel/cpu-regs.h	/^#define      T8 /;"	d
+T9	cpu/mipsel/cpu-regs.h	/^#define      T9 /;"	d
+TAG_CLEAR	kern/radix.c	/^#define TAG_CLEAR(/;"	d	file:
+TAG_GET	kern/radix.c	/^#define TAG_GET(/;"	d	file:
+TAG_PG_DIRTY	kern/radix.h	/^	TAG_PG_DIRTY = 0,$/;"	e	enum:__anon24
+TAG_SET	kern/radix.c	/^#define TAG_SET(/;"	d	file:
+TARGET	Makefile	/^TARGET=$(OBJDIR)\/almos-mk-$(ARCH)-$(CPU)$/;"	m
+TARGET	Makefile	/^TARGET=$(OBJDIR)\/almos-mk-$(ARCH)-$(CPU)-$(KERNEL_REV)$/;"	m
+TASK_CREATE	kern/task.h	/^#define TASK_CREATE /;"	d
+TASK_DEFAULT_HEAP_SIZE	kern/do_exec.c	/^#define TASK_DEFAULT_HEAP_SIZE /;"	d	file:
+TASK_MIGRATE	kern/task.h	/^#define TASK_MIGRATE /;"	d
+TASK_PS_SHOW	kern/task.h	/^#define TASK_PS_SHOW /;"	d
+TASK_PS_TRACE_OFF	kern/task.h	/^#define TASK_PS_TRACE_OFF /;"	d
+TASK_PS_TRACE_ON	kern/task.h	/^#define TASK_PS_TRACE_ON /;"	d
+TASK_READY	kern/task.h	/^#define TASK_READY /;"	d
+TASK_ZOMBIE	kern/task.h	/^#define TASK_ZOMBIE /;"	d
+THREAD_ID	kern/kmagics.h	/^#define THREAD_ID /;"	d
+THREAD_STATES_NR	kern/thread.h	/^	THREAD_STATES_NR$/;"	e	enum:__anon38
+THREAD_TYPES_NR	kern/thread.h	/^	THREAD_TYPES_NR$/;"	e	enum:__anon37
+TH_BOOT	kern/thread.h	/^	TH_BOOT = 4,$/;"	e	enum:__anon37
+TH_CAN_MIGRATE	kern/thread.h	/^#define TH_CAN_MIGRATE /;"	d
+TH_CAN_WAKEUP	kern/thread.h	/^#define TH_CAN_WAKEUP /;"	d
+TH_CAP_MIGRATE	kern/thread.h	/^#define TH_CAP_MIGRATE /;"	d
+TH_CAP_WAKEUP	kern/thread.h	/^#define TH_CAP_WAKEUP /;"	d
+TH_DOING_SIGNAL	kern/thread.h	/^#define TH_DOING_SIGNAL /;"	d
+TH_EXPORTED	kern/thread.h	/^#define TH_EXPORTED /;"	d
+TH_FORCED_YIELD	kern/thread.h	/^#define TH_FORCED_YIELD /;"	d
+TH_IDLE	kern/thread.h	/^	TH_IDLE = 2,$/;"	e	enum:__anon37
+TH_IMPORTED	kern/thread.h	/^#define TH_IMPORTED /;"	d
+TH_JOINABLE	kern/thread.h	/^#define TH_JOINABLE /;"	d
+TH_NEED_TO_MIGRATE	kern/thread.h	/^#define TH_NEED_TO_MIGRATE /;"	d
+TH_NEED_TO_SCHED	kern/thread.h	/^#define TH_NEED_TO_SCHED /;"	d
+TH_NO_VM_REGION	kern/thread.h	/^#define TH_NO_VM_REGION /;"	d
+TH_RPC	kern/thread.h	/^	TH_RPC  = 8,$/;"	e	enum:__anon37
+TIC	arch/ibmpc/arch.h	/^#define TIC /;"	d
+TIC	arch/ibmpc/arch.h	/^#undef TIC$/;"	d
+TID	cpu/i386/__cpu_context.S	/^#define TID		9*4$/;"	d
+TIMER_BASE	arch/ibmpc/segmentation.h	/^#define     TIMER_BASE /;"	d
+TIMER_DEV_NR	arch/ibmpc/hardware.h	/^#define TIMER_DEV_NR /;"	d
+TIMER_IRQ_ENABLED	drivers/soclib/soclib_timer.c	/^#define TIMER_IRQ_ENABLED /;"	d	file:
+TIMER_MODE_REG	drivers/soclib/soclib_timer.c	/^#define TIMER_MODE_REG /;"	d	file:
+TIMER_PERIOD_REG	drivers/soclib/soclib_timer.c	/^#define TIMER_PERIOD_REG /;"	d	file:
+TIMER_RESET_IRQ	drivers/soclib/soclib_timer.c	/^#define TIMER_RESET_IRQ /;"	d	file:
+TIMER_RESET_IRQ_REG	drivers/soclib/soclib_timer.c	/^#define TIMER_RESET_IRQ_REG /;"	d	file:
+TIMER_RUNNING	drivers/soclib/soclib_timer.c	/^#define TIMER_RUNNING /;"	d	file:
+TIMER_SIZE	arch/ibmpc/segmentation.h	/^#define     TIMER_SIZE /;"	d
+TIMER_STOP	drivers/soclib/soclib_timer.c	/^#define TIMER_STOP /;"	d	file:
+TIMER_VALUE_REG	drivers/soclib/soclib_timer.c	/^#define TIMER_VALUE_REG /;"	d	file:
+TIME_STAMP	kern/sys_thread_create.c	/^#define TIME_STAMP(/;"	d	file:
+TLS_K1	cpu/mipsel/cpu-regs.h	/^#define      TLS_K1 /;"	d
+TMP_BUFF_SZ	fs/devfs/devfs_file.c	/^#define TMP_BUFF_SZ /;"	d	file:
+TSS	cpu/i386/__cpu_context.S	/^#define TSS		8*4$/;"	d
+TTY_BASE	arch/ibmpc/segmentation.h	/^#define     TTY_BASE /;"	d
+TTY_BUFFER_DEPTH	arch/ibmpc/hardware.h	/^#define TTY_BUFFER_DEPTH /;"	d
+TTY_BUFFER_DEPTH	arch/tsar/arch.h	/^#define TTY_BUFFER_DEPTH /;"	d
+TTY_CURSOR_CMD	drivers/ibmpc/tty.c	/^#define TTY_CURSOR_CMD /;"	d	file:
+TTY_CURSOR_DATA	drivers/ibmpc/tty.c	/^#define TTY_CURSOR_DATA /;"	d	file:
+TTY_DEV_NR	arch/ibmpc/hardware.h	/^#define TTY_DEV_NR /;"	d
+TTY_DEV_NR	arch/tsar/arch.h	/^#define TTY_DEV_NR /;"	d
+TTY_READ_REG	drivers/ibmpc/tty.h	/^#define TTY_READ_REG /;"	d
+TTY_READ_REG	drivers/soclib/soclib_tty.h	/^#define TTY_READ_REG /;"	d
+TTY_SIZE	arch/ibmpc/segmentation.h	/^#define     TTY_SIZE /;"	d
+TTY_STATUS_REG	drivers/ibmpc/tty.h	/^#define TTY_STATUS_REG /;"	d
+TTY_STATUS_REG	drivers/soclib/soclib_tty.h	/^#define TTY_STATUS_REG /;"	d
+TTY_WRITE_REG	drivers/ibmpc/tty.h	/^#define TTY_WRITE_REG /;"	d
+TTY_WRITE_REG	drivers/soclib/soclib_tty.h	/^#define TTY_WRITE_REG /;"	d
+TTY_XSIZE	arch/ibmpc/segmentation.h	/^#define     TTY_XSIZE /;"	d
+TTY_YSIZE	arch/ibmpc/segmentation.h	/^#define     TTY_YSIZE /;"	d
+U	kern/dqdt.h	/^	uint_t   U;$/;"	m	struct:dqdt_indicators_s
+UINT16_MAX	libk/stdint.h	/^#define UINT16_MAX /;"	d
+UINT32_MAX	libk/stdint.h	/^#define UINT32_MAX /;"	d
+UINT8_MAX	libk/stdint.h	/^#define UINT8_MAX /;"	d
+UNIFIED_MODE	cpu/mipsel/__cpu_kentry.S	/^UNIFIED_MODE:	$/;"	l
+USR_LIMIT	kern/do_exec.c	/^#define USR_LIMIT /;"	d	file:
+USR_START	vfs/kvfsd.c	/^#define USR_START /;"	d	file:
+UTLS_GET	kern/sys_utls.c	/^#define UTLS_GET /;"	d	file:
+UTLS_GET_ERRNO	kern/sys_utls.c	/^#define UTLS_GET_ERRNO /;"	d	file:
+UTLS_SET	kern/sys_utls.c	/^#define UTLS_SET /;"	d	file:
+V0	cpu/mipsel/cpu-regs.h	/^#define      V0 /;"	d
+V1	cpu/mipsel/cpu-regs.h	/^#define      V1 /;"	d
+VFAT_ATTR_ARCHIVE	fs/fat32/fat32-private.h	/^#define VFAT_ATTR_ARCHIVE	/;"	d
+VFAT_ATTR_DIRECTORY	fs/fat32/fat32-private.h	/^#define VFAT_ATTR_DIRECTORY	/;"	d
+VFAT_ATTR_HIDDEN	fs/fat32/fat32-private.h	/^#define VFAT_ATTR_HIDDEN	/;"	d
+VFAT_ATTR_LONG_NAME	fs/fat32/fat32-private.h	/^#define VFAT_ATTR_LONG_NAME	/;"	d
+VFAT_ATTR_READ_ONLY	fs/fat32/fat32-private.h	/^#define VFAT_ATTR_READ_ONLY	/;"	d
+VFAT_ATTR_SYSTEM	fs/fat32/fat32-private.h	/^#define VFAT_ATTR_SYSTEM	/;"	d
+VFAT_ATTR_VOLUME_ID	fs/fat32/fat32-private.h	/^#define VFAT_ATTR_VOLUME_ID	/;"	d
+VFAT_CONVERT_CLUSTER	fs/fat32/fat32-private.h	/^#define VFAT_CONVERT_CLUSTER(/;"	d
+VFAT_DEBUG	fs/fat32/fat32-private.h	/^#define VFAT_DEBUG /;"	d
+VFAT_INSTRUMENT	fs/fat32/fat32-private.h	/^#define VFAT_INSTRUMENT /;"	d
+VFS_ARCHIVE	vfs/vfs-params.h	/^#define VFS_ARCHIVE /;"	d
+VFS_CLEAR	vfs/vfs-params.h	/^#define VFS_CLEAR(/;"	d
+VFS_CLOSE_FILE	fs/devfs/devfs_file.c	/^VFS_CLOSE_FILE(devfs_close)$/;"	f
+VFS_CLOSE_FILE	fs/fat32/fat32_file.c	/^VFS_CLOSE_FILE(vfat_close) $/;"	f
+VFS_CLOSE_FILE	fs/ramfs/ramfs_file.c	/^VFS_CLOSE_FILE(ramfs_close) $/;"	f
+VFS_CLOSE_FILE	fs/sysfs/sysfs_file.c	/^VFS_CLOSE_FILE(sysfs_close)$/;"	f
+VFS_CLOSE_FILE	vfs/vfs.h	/^#define VFS_CLOSE_FILE(/;"	d
+VFS_COMPARE_DIRENT	fs/fat32/fat32_node.c	/^VFS_COMPARE_DIRENT(vfat_compare)$/;"	f
+VFS_COMPARE_DIRENT	fs/ramfs/ramfs_inode.c	/^VFS_COMPARE_DIRENT(ramfs_compare)$/;"	f
+VFS_COMPARE_DIRENT	vfs/vfs.h	/^#define VFS_COMPARE_DIRENT(/;"	d
+VFS_CREATE_CONTEXT	fs/devfs/devfs_context.c	/^VFS_CREATE_CONTEXT(devfs_create_context)$/;"	f
+VFS_CREATE_CONTEXT	fs/fat32/fat32_context.c	/^VFS_CREATE_CONTEXT(vfat_create_context)$/;"	f
+VFS_CREATE_CONTEXT	fs/ramfs/ramfs_context.c	/^VFS_CREATE_CONTEXT(ramfs_create_context)$/;"	f
+VFS_CREATE_CONTEXT	fs/sysfs/sysfs_context.c	/^VFS_CREATE_CONTEXT(sysfs_create_context)$/;"	f
+VFS_CREATE_CONTEXT	vfs/vfs.h	/^#define VFS_CREATE_CONTEXT(/;"	d
+VFS_CREATE_NODE	fs/devfs/devfs_node.c	/^VFS_CREATE_NODE(devfs_create_node)$/;"	f
+VFS_CREATE_NODE	fs/fat32/fat32_node.c	/^VFS_CREATE_NODE(vfat_create) $/;"	f
+VFS_CREATE_NODE	fs/ramfs/ramfs_inode.c	/^VFS_CREATE_NODE(ramfs_create)$/;"	f
+VFS_CREATE_NODE	fs/sysfs/sysfs_node.c	/^VFS_CREATE_NODE(sysfs_create_node)$/;"	f
+VFS_CREATE_NODE	vfs/vfs.h	/^#define VFS_CREATE_NODE(/;"	d
+VFS_DEBUG	vfs/vfs-params.h	/^#define VFS_DEBUG /;"	d
+VFS_DELETE_NODE	fs/fat32/fat32_node.c	/^VFS_DELETE_NODE(vfat_delete)$/;"	f
+VFS_DELETE_NODE	fs/ramfs/ramfs_inode.c	/^VFS_DELETE_NODE(ramfs_delete)$/;"	f
+VFS_DELETE_NODE	vfs/vfs.h	/^#define VFS_DELETE_NODE(/;"	d
+VFS_DESTROY_CONTEXT	fs/devfs/devfs_context.c	/^VFS_DESTROY_CONTEXT(devfs_destroy_context)$/;"	f
+VFS_DESTROY_CONTEXT	fs/fat32/fat32_context.c	/^VFS_DESTROY_CONTEXT(vfat_destroy_context)$/;"	f
+VFS_DESTROY_CONTEXT	fs/ramfs/ramfs_context.c	/^VFS_DESTROY_CONTEXT(ramfs_destroy_context)$/;"	f
+VFS_DESTROY_CONTEXT	fs/sysfs/sysfs_context.c	/^VFS_DESTROY_CONTEXT(sysfs_destroy_context)$/;"	f
+VFS_DESTROY_CONTEXT	vfs/vfs.h	/^#define VFS_DESTROY_CONTEXT(/;"	d
+VFS_DEV	vfs/vfs-params.h	/^#define VFS_DEV /;"	d
+VFS_DEVFS_TYPE	vfs/vfs-params.h	/^	VFS_DEVFS_TYPE,$/;"	e	enum:__anon51
+VFS_DEV_BLK	vfs/vfs-params.h	/^#define VFS_DEV_BLK /;"	d
+VFS_DEV_CHR	vfs/vfs-params.h	/^#define VFS_DEV_CHR /;"	d
+VFS_DIR	vfs/vfs-params.h	/^#define VFS_DIR /;"	d
+VFS_DIRTY	vfs/vfs-params.h	/^#define VFS_DIRTY /;"	d
+VFS_EBADBLK	vfs/vfs-errno.h	/^#define VFS_EBADBLK /;"	d
+VFS_EBADF	vfs/vfs-errno.h	/^#define VFS_EBADF /;"	d
+VFS_EEXIST	vfs/vfs-errno.h	/^#define VFS_EEXIST /;"	d
+VFS_EINVAL	vfs/vfs-errno.h	/^#define VFS_EINVAL /;"	d
+VFS_EISDIR	vfs/vfs-errno.h	/^#define VFS_EISDIR /;"	d
+VFS_EISPIPE	vfs/vfs-errno.h	/^#define VFS_EISPIPE /;"	d
+VFS_ENOMEM	vfs/vfs-errno.h	/^#define VFS_ENOMEM /;"	d
+VFS_ENOSPC	vfs/vfs-errno.h	/^#define VFS_ENOSPC /;"	d
+VFS_ENOTDIR	vfs/vfs-errno.h	/^#define VFS_ENOTDIR /;"	d
+VFS_ENOTEMPTY	vfs/vfs-errno.h	/^#define VFS_ENOTEMPTY /;"	d
+VFS_ENOTUSED	vfs/vfs-errno.h	/^#define VFS_ENOTUSED /;"	d
+VFS_EODIR	vfs/vfs-errno.h	/^#define VFS_EODIR /;"	d
+VFS_EOVERFLOW	vfs/vfs-errno.h	/^#define VFS_EOVERFLOW /;"	d
+VFS_EPIPE	vfs/vfs-errno.h	/^#define VFS_EPIPE /;"	d
+VFS_EUNKNOWN	vfs/vfs-errno.h	/^#define VFS_EUNKNOWN /;"	d
+VFS_FIFO	vfs/vfs-params.h	/^#define VFS_FIFO /;"	d
+VFS_FILE_IS_NULL	vfs/vfs.h	/^#define VFS_FILE_IS_NULL(/;"	d
+VFS_FOUND	vfs/vfs-errno.h	/^#define VFS_FOUND /;"	d
+VFS_FREE	vfs/vfs-params.h	/^#define VFS_FREE /;"	d
+VFS_FS_LOCAL	vfs/vfs-params.h	/^#define VFS_FS_LOCAL	/;"	d
+VFS_FS_USE_MAPPER	vfs/vfs-params.h	/^#define VFS_FS_USE_MAPPER	/;"	d
+VFS_ICREATE_NODE	fs/fat32/fat32_node.c	/^VFS_ICREATE_NODE(vfat_icreate)$/;"	f
+VFS_ICREATE_NODE	fs/ramfs/ramfs_inode.c	/^VFS_ICREATE_NODE(ramfs_icreate)$/;"	f
+VFS_ICREATE_NODE	vfs/vfs.h	/^#define VFS_ICREATE_NODE(/;"	d
+VFS_IEXEC	vfs/vfs-params.h	/^#define VFS_IEXEC /;"	d
+VFS_IFBLK	vfs/vfs-params.h	/^#define VFS_IFBLK	/;"	d
+VFS_IFCHR	vfs/vfs-params.h	/^#define VFS_IFCHR	/;"	d
+VFS_IFDIR	vfs/vfs-params.h	/^#define VFS_IFDIR	/;"	d
+VFS_IFIFO	vfs/vfs-params.h	/^#define VFS_IFIFO	/;"	d
+VFS_IFLNK	vfs/vfs-params.h	/^#define VFS_IFLNK	/;"	d
+VFS_IFMT	vfs/vfs-params.h	/^#define VFS_IFMT	/;"	d
+VFS_IFREG	vfs/vfs-params.h	/^#define VFS_IFREG	/;"	d
+VFS_IFSOCK	vfs/vfs-params.h	/^#define VFS_IFSOCK	/;"	d
+VFS_INIT_NODE	fs/devfs/devfs_node.c	/^VFS_INIT_NODE(devfs_init_node)$/;"	f
+VFS_INIT_NODE	fs/fat32/fat32_node.c	/^VFS_INIT_NODE(vfat_init_node)$/;"	f
+VFS_INIT_NODE	fs/ramfs/ramfs_inode.c	/^VFS_INIT_NODE(ramfs_init_inode)$/;"	f
+VFS_INIT_NODE	fs/sysfs/sysfs_node.c	/^VFS_INIT_NODE(sysfs_init_node)$/;"	f
+VFS_INIT_NODE	vfs/vfs.h	/^#define VFS_INIT_NODE(/;"	d
+VFS_INLOAD	vfs/vfs-params.h	/^#define VFS_INLOAD /;"	d
+VFS_INODE_REF_COMPARE	vfs/vfs.h	/^#define VFS_INODE_REF_COMPARE(/;"	d
+VFS_INODE_REF_SET	vfs/vfs.h	/^#define VFS_INODE_REF_SET(/;"	d
+VFS_IO_ERR	vfs/vfs-errno.h	/^#define VFS_IO_ERR /;"	d
+VFS_IREAD	vfs/vfs-params.h	/^#define VFS_IREAD /;"	d
+VFS_IRGRP	vfs/vfs-params.h	/^#define VFS_IRGRP /;"	d
+VFS_IROTH	vfs/vfs-params.h	/^#define VFS_IROTH /;"	d
+VFS_IRUSR	vfs/vfs-params.h	/^#define VFS_IRUSR /;"	d
+VFS_IRWXG	vfs/vfs-params.h	/^#define VFS_IRWXG /;"	d
+VFS_IRWXO	vfs/vfs-params.h	/^#define VFS_IRWXO /;"	d
+VFS_IRWXU	vfs/vfs-params.h	/^#define VFS_IRWXU /;"	d
+VFS_IS	vfs/vfs-params.h	/^#define VFS_IS(/;"	d
+VFS_ISGID	vfs/vfs-params.h	/^#define VFS_ISGID	/;"	d
+VFS_ISUID	vfs/vfs-params.h	/^#define VFS_ISUID	/;"	d
+VFS_ISVTX	vfs/vfs-params.h	/^#define VFS_ISVTX	/;"	d
+VFS_IWGRP	vfs/vfs-params.h	/^#define VFS_IWGRP /;"	d
+VFS_IWOTH	vfs/vfs-params.h	/^#define VFS_IWOTH /;"	d
+VFS_IWRITE	vfs/vfs-params.h	/^#define VFS_IWRITE /;"	d
+VFS_IWUSR	vfs/vfs-params.h	/^#define VFS_IWUSR /;"	d
+VFS_IXGRP	vfs/vfs-params.h	/^#define VFS_IXGRP /;"	d
+VFS_IXOTH	vfs/vfs-params.h	/^#define VFS_IXOTH /;"	d
+VFS_IXUSR	vfs/vfs-params.h	/^#define VFS_IXUSR /;"	d
+VFS_LOOKUP_FILE	vfs/vfs-params.h	/^#define VFS_LOOKUP_FILE	/;"	d
+VFS_LOOKUP_HELD	vfs/vfs-params.h	/^#define VFS_LOOKUP_HELD	/;"	d
+VFS_LOOKUP_LAST	vfs/vfs-params.h	/^#define VFS_LOOKUP_LAST	/;"	d
+VFS_LOOKUP_NODE	fs/devfs/devfs_node.c	/^VFS_LOOKUP_NODE(devfs_lookup_node)$/;"	f
+VFS_LOOKUP_NODE	fs/fat32/fat32_node.c	/^VFS_LOOKUP_NODE(vfat_lookup)$/;"	f
+VFS_LOOKUP_NODE	fs/ramfs/ramfs_inode.c	/^VFS_LOOKUP_NODE(ramfs_lookup)$/;"	f
+VFS_LOOKUP_NODE	fs/sysfs/sysfs_node.c	/^VFS_LOOKUP_NODE(sysfs_lookup_node)$/;"	f
+VFS_LOOKUP_NODE	vfs/vfs.h	/^#define VFS_LOOKUP_NODE(/;"	d
+VFS_LOOKUP_OPEN	vfs/vfs-params.h	/^#define VFS_LOOKUP_OPEN	/;"	d
+VFS_LOOKUP_PARENT	vfs/vfs-params.h	/^#define VFS_LOOKUP_PARENT	/;"	d
+VFS_LOOKUP_RESTART	vfs/vfs-params.h	/^#define VFS_LOOKUP_RESTART	/;"	d
+VFS_LOOKUP_RETRY	vfs/vfs-params.h	/^#define VFS_LOOKUP_RETRY	/;"	d
+VFS_LSEEK_FILE	fs/devfs/devfs_file.c	/^VFS_LSEEK_FILE(devfs_lseek)$/;"	f
+VFS_LSEEK_FILE	fs/fat32/fat32_file.c	/^VFS_LSEEK_FILE(vfat_lseek)$/;"	f
+VFS_LSEEK_FILE	fs/ramfs/ramfs_file.c	/^VFS_LSEEK_FILE(ramfs_lseek)$/;"	f
+VFS_LSEEK_FILE	fs/sysfs/sysfs_file.c	/^VFS_LSEEK_FILE(sysfs_lseek)$/;"	f
+VFS_LSEEK_FILE	vfs/vfs.h	/^#define VFS_LSEEK_FILE(/;"	d
+VFS_MAX_FILE_NUMBER	vfs/vfs-params.h	/^#define VFS_MAX_FILE_NUMBER /;"	d
+VFS_MAX_NAME_LENGTH	vfs/vfs-params.h	/^#define VFS_MAX_NAME_LENGTH /;"	d
+VFS_MAX_NODE_NUMBER	vfs/vfs-params.h	/^#define VFS_MAX_NODE_NUMBER /;"	d
+VFS_MAX_PATH	vfs/vfs-params.h	/^#define VFS_MAX_PATH /;"	d
+VFS_MAX_PATH_DEPTH	vfs/vfs-params.h	/^#define VFS_MAX_PATH_DEPTH /;"	d
+VFS_MMAP_FILE	fs/devfs/devfs_file.c	/^VFS_MMAP_FILE(devfs_mmap)$/;"	f
+VFS_MMAP_FILE	fs/devfs/devfs_file.c	/^VFS_MMAP_FILE(devfs_munmap)$/;"	f
+VFS_MMAP_FILE	vfs/vfs.h	/^#define VFS_MMAP_FILE(/;"	d
+VFS_MMAP_FILE	vfs/vfs_file.c	/^VFS_MMAP_FILE(vfs_default_mmap_file)$/;"	f
+VFS_MUNMAP_FILE	vfs/vfs.h	/^#define VFS_MUNMAP_FILE(/;"	d
+VFS_MUNMAP_FILE	vfs/vfs_file.c	/^VFS_MUNMAP_FILE(vfs_default_munmap_file)$/;"	f
+VFS_NOT_FOUND	vfs/vfs-errno.h	/^#define VFS_NOT_FOUND /;"	d
+VFS_OPEN_FILE	fs/devfs/devfs_file.c	/^VFS_OPEN_FILE(devfs_open)$/;"	f
+VFS_OPEN_FILE	fs/fat32/fat32_file.c	/^VFS_OPEN_FILE(vfat_open) $/;"	f
+VFS_OPEN_FILE	fs/ramfs/ramfs_file.c	/^VFS_OPEN_FILE(ramfs_open) $/;"	f
+VFS_OPEN_FILE	fs/sysfs/sysfs_file.c	/^VFS_OPEN_FILE(sysfs_open)$/;"	f
+VFS_OPEN_FILE	vfs/vfs.h	/^#define VFS_OPEN_FILE(/;"	d
+VFS_O_APPEND	vfs/vfs-params.h	/^#define VFS_O_APPEND /;"	d
+VFS_O_CREATE	vfs/vfs-params.h	/^#define VFS_O_CREATE /;"	d
+VFS_O_DEV	vfs/vfs-params.h	/^#define VFS_O_DEV /;"	d
+VFS_O_DIRECTORY	vfs/vfs-params.h	/^#define VFS_O_DIRECTORY /;"	d
+VFS_O_EXCL	vfs/vfs-params.h	/^#define VFS_O_EXCL /;"	d
+VFS_O_FIFO	vfs/vfs-params.h	/^#define VFS_O_FIFO /;"	d
+VFS_O_MOUNTPOINT	vfs/vfs-params.h	/^#define VFS_O_MOUNTPOINT /;"	d
+VFS_O_PIPE	vfs/vfs-params.h	/^#define VFS_O_PIPE /;"	d
+VFS_O_RDONLY	vfs/vfs-params.h	/^#define VFS_O_RDONLY /;"	d
+VFS_O_RDWR	vfs/vfs-params.h	/^#define VFS_O_RDWR /;"	d
+VFS_O_SHARED	vfs/vfs-params.h	/^#define VFS_O_SHARED	/;"	d
+VFS_O_SYNC	vfs/vfs-params.h	/^#define VFS_O_SYNC	/;"	d
+VFS_O_TRUNC	vfs/vfs-params.h	/^#define VFS_O_TRUNC /;"	d
+VFS_O_WRONLY	vfs/vfs-params.h	/^#define VFS_O_WRONLY /;"	d
+VFS_PIPE	vfs/vfs-params.h	/^#define VFS_PIPE /;"	d
+VFS_PIPE_TYPE	vfs/vfs-params.h	/^	VFS_PIPE_TYPE,$/;"	e	enum:__anon51
+VFS_RAMFS_TYPE	vfs/vfs-params.h	/^	VFS_RAMFS_TYPE,$/;"	e	enum:__anon51
+VFS_RD_ONLY	vfs/vfs-params.h	/^#define VFS_RD_ONLY /;"	d
+VFS_READ_DIR	fs/devfs/devfs_file.c	/^VFS_READ_DIR(devfs_readdir)$/;"	f
+VFS_READ_DIR	fs/fat32/fat32_file.c	/^VFS_READ_DIR(vfat_readdir) $/;"	f
+VFS_READ_DIR	fs/ramfs/ramfs_file.c	/^VFS_READ_DIR(ramfs_readdir) $/;"	f
+VFS_READ_DIR	fs/sysfs/sysfs_file.c	/^VFS_READ_DIR(sysfs_readdir)$/;"	f
+VFS_READ_DIR	vfs/vfs.h	/^#define VFS_READ_DIR(/;"	d
+VFS_READ_FILE	fs/devfs/devfs_file.c	/^VFS_READ_FILE(devfs_read)$/;"	f
+VFS_READ_FILE	fs/sysfs/sysfs_file.c	/^VFS_READ_FILE(sysfs_read)$/;"	f
+VFS_READ_FILE	vfs/vfs.h	/^#define VFS_READ_FILE(/;"	d
+VFS_READ_FILE	vfs/vfs_file.c	/^VFS_READ_FILE(vfs_default_read) $/;"	f
+VFS_READ_ROOT	fs/devfs/devfs_context.c	/^VFS_READ_ROOT(devfs_read_root)$/;"	f
+VFS_READ_ROOT	fs/fat32/fat32_context.c	/^VFS_READ_ROOT(vfat_read_root)$/;"	f
+VFS_READ_ROOT	fs/ramfs/ramfs_context.c	/^VFS_READ_ROOT(ramfs_read_root)$/;"	f
+VFS_READ_ROOT	fs/sysfs/sysfs_context.c	/^VFS_READ_ROOT(sysfs_read_root)$/;"	f
+VFS_READ_ROOT	vfs/vfs.h	/^#define VFS_READ_ROOT(/;"	d
+VFS_REGFILE	vfs/vfs-params.h	/^#define VFS_REGFILE /;"	d
+VFS_RELEASE_FILE	fs/devfs/devfs_file.c	/^VFS_RELEASE_FILE(devfs_release)$/;"	f
+VFS_RELEASE_FILE	fs/fat32/fat32_file.c	/^VFS_RELEASE_FILE(vfat_release) $/;"	f
+VFS_RELEASE_FILE	fs/ramfs/ramfs_file.c	/^VFS_RELEASE_FILE(ramfs_release) $/;"	f
+VFS_RELEASE_FILE	fs/sysfs/sysfs_file.c	/^VFS_RELEASE_FILE(sysfs_release)$/;"	f
+VFS_RELEASE_FILE	vfs/vfs.h	/^#define VFS_RELEASE_FILE(/;"	d
+VFS_RELEASE_NODE	fs/devfs/devfs_node.c	/^VFS_RELEASE_NODE(devfs_release_node)$/;"	f
+VFS_RELEASE_NODE	fs/fat32/fat32_node.c	/^VFS_RELEASE_NODE(vfat_release_node)$/;"	f
+VFS_RELEASE_NODE	fs/ramfs/ramfs_inode.c	/^VFS_RELEASE_NODE(ramfs_release_inode)$/;"	f
+VFS_RELEASE_NODE	fs/sysfs/sysfs_node.c	/^VFS_RELEASE_NODE(sysfs_release_node)$/;"	f
+VFS_RELEASE_NODE	vfs/vfs.h	/^#define VFS_RELEASE_NODE(/;"	d
+VFS_REPLI_ROOT	fs/sysfs/sysfs_context.c	/^VFS_REPLI_ROOT(sysfs_repli_root)$/;"	f
+VFS_REPLI_ROOT	vfs/vfs.h	/^#define VFS_REPLI_ROOT(/;"	d
+VFS_SEEK_CUR	vfs/vfs-params.h	/^#define VFS_SEEK_CUR /;"	d
+VFS_SEEK_END	vfs/vfs-params.h	/^#define VFS_SEEK_END /;"	d
+VFS_SEEK_SET	vfs/vfs-params.h	/^#define VFS_SEEK_SET /;"	d
+VFS_SET	vfs/vfs-params.h	/^#define VFS_SET(/;"	d
+VFS_SOCK	vfs/vfs-params.h	/^#define VFS_SOCK /;"	d
+VFS_STAT_NODE	fs/devfs/devfs_node.c	/^VFS_STAT_NODE(devfs_stat_node)$/;"	f
+VFS_STAT_NODE	fs/fat32/fat32_node.c	/^VFS_STAT_NODE(vfat_stat_node)$/;"	f
+VFS_STAT_NODE	fs/ramfs/ramfs_inode.c	/^VFS_STAT_NODE(ramfs_stat_inode)$/;"	f
+VFS_STAT_NODE	vfs/vfs.h	/^#define VFS_STAT_NODE(/;"	d
+VFS_SYMLNK	vfs/vfs-params.h	/^#define VFS_SYMLNK /;"	d
+VFS_SYS	vfs/vfs-params.h	/^#define VFS_SYS /;"	d
+VFS_SYSFS_TYPE	vfs/vfs-params.h	/^	VFS_SYSFS_TYPE = 0,$/;"	e	enum:__anon51
+VFS_TRUNC_NODE	vfs/vfs.h	/^#define VFS_TRUNC_NODE(/;"	d
+VFS_TYPES_NR	vfs/vfs-params.h	/^	VFS_TYPES_NR$/;"	e	enum:__anon51
+VFS_UNLINK_NODE	fs/devfs/devfs_node.c	/^VFS_UNLINK_NODE(devfs_unlink_node)$/;"	f
+VFS_UNLINK_NODE	fs/fat32/fat32_node.c	/^VFS_UNLINK_NODE(vfat_unlink_node)$/;"	f
+VFS_UNLINK_NODE	fs/ramfs/ramfs_inode.c	/^VFS_UNLINK_NODE(ramfs_unlink_inode)$/;"	f
+VFS_UNLINK_NODE	fs/sysfs/sysfs_node.c	/^VFS_UNLINK_NODE(sysfs_unlink_node)$/;"	f
+VFS_UNLINK_NODE	vfs/vfs.h	/^#define VFS_UNLINK_NODE(/;"	d
+VFS_VFAT_TYPE	vfs/vfs-params.h	/^	VFS_VFAT_TYPE,$/;"	e	enum:__anon51
+VFS_WRITE_FILE	fs/devfs/devfs_file.c	/^VFS_WRITE_FILE(devfs_write)$/;"	f
+VFS_WRITE_FILE	fs/sysfs/sysfs_file.c	/^VFS_WRITE_FILE(sysfs_write)$/;"	f
+VFS_WRITE_FILE	vfs/vfs.h	/^#define VFS_WRITE_FILE(/;"	d
+VFS_WRITE_FILE	vfs/vfs_file.c	/^VFS_WRITE_FILE(vfs_default_write) $/;"	f
+VFS_WRITE_NODE	fs/devfs/devfs_node.c	/^VFS_WRITE_NODE(devfs_write_node)$/;"	f
+VFS_WRITE_NODE	fs/fat32/fat32_node.c	/^VFS_WRITE_NODE(vfat_write_node)$/;"	f
+VFS_WRITE_NODE	fs/ramfs/ramfs_inode.c	/^VFS_WRITE_NODE(ramfs_write_inode)$/;"	f
+VFS_WRITE_NODE	fs/sysfs/sysfs_node.c	/^VFS_WRITE_NODE(sysfs_write_node)$/;"	f
+VFS_WRITE_NODE	vfs/vfs.h	/^#define VFS_WRITE_NODE(/;"	d
+VFS_WRITE_ROOT	fs/devfs/devfs_context.c	/^VFS_WRITE_ROOT(devfs_write_root)$/;"	f
+VFS_WRITE_ROOT	fs/fat32/fat32_context.c	/^VFS_WRITE_ROOT(vfat_write_root)$/;"	f
+VFS_WRITE_ROOT	fs/ramfs/ramfs_context.c	/^VFS_WRITE_ROOT(ramfs_write_root)$/;"	f
+VFS_WRITE_ROOT	fs/sysfs/sysfs_context.c	/^VFS_WRITE_ROOT(sysfs_write_root)$/;"	f
+VFS_WRITE_ROOT	vfs/vfs.h	/^#define VFS_WRITE_ROOT(/;"	d
+VMM_ECHECKUSPACE	mm/vmm.h	/^	VMM_ECHECKUSPACE,$/;"	e	enum:__anon50
+VMM_ERESOLVED	mm/vmm.h	/^	VMM_ERESOLVED = 0,$/;"	e	enum:__anon50
+VMM_ESIGBUS	mm/vmm.h	/^	VMM_ESIGBUS$/;"	e	enum:__anon50
+VMM_ESIGSEGV	mm/vmm.h	/^	VMM_ESIGSEGV,$/;"	e	enum:__anon50
+VM_FAILED	mm/vm_region.h	/^#define VM_FAILED /;"	d
+VM_REGION_PAGE_FAULT	drivers/soclib/soclib_fb.c	/^static VM_REGION_PAGE_FAULT(fb_pagefault)$/;"	f	file:
+VM_REGION_PAGE_FAULT	drivers/soclib/soclib_memc.c	/^static VM_REGION_PAGE_FAULT(memc_pagefault)$/;"	f	file:
+VM_REGION_PAGE_FAULT	drivers/soclib/soclib_xicu.c	/^static VM_REGION_PAGE_FAULT(icu_pagefault)$/;"	f	file:
+VM_REGION_PAGE_FAULT	mm/vm_region.h	/^#define VM_REGION_PAGE_FAULT(/;"	d
+VM_REGION_PAGE_FAULT	mm/vmm.c	/^VM_REGION_PAGE_FAULT(vmm_default_pagefault)$/;"	f
+VM_REGION_PAGE_IN	mm/vm_region.h	/^#define VM_REGION_PAGE_IN(/;"	d
+VM_REGION_PAGE_LOOKUP	mm/vm_region.h	/^#define VM_REGION_PAGE_LOOKUP(/;"	d
+VM_REGION_PAGE_OUT	mm/vm_region.h	/^#define VM_REGION_PAGE_OUT(/;"	d
+VM_REG_ANON	mm/vm_region.h	/^#define VM_REG_ANON /;"	d
+VM_REG_CAP_EX	mm/vm_region.h	/^#define VM_REG_CAP_EX /;"	d
+VM_REG_CAP_RD	mm/vm_region.h	/^#define VM_REG_CAP_RD /;"	d
+VM_REG_CAP_WR	mm/vm_region.h	/^#define VM_REG_CAP_WR /;"	d
+VM_REG_DEV	mm/vm_region.h	/^#define VM_REG_DEV /;"	d
+VM_REG_EX	mm/vm_region.h	/^#define VM_REG_EX /;"	d
+VM_REG_FILE	mm/vm_region.h	/^#define VM_REG_FILE /;"	d
+VM_REG_FIXED	mm/vm_region.h	/^#define VM_REG_FIXED /;"	d
+VM_REG_HEAP	mm/vm_region.h	/^#define VM_REG_HEAP /;"	d
+VM_REG_HUGETLB	mm/vm_region.h	/^#define VM_REG_HUGETLB /;"	d
+VM_REG_INIT	mm/vm_region.h	/^#define VM_REG_INIT /;"	d
+VM_REG_INST	mm/vm_region.h	/^#define VM_REG_INST /;"	d
+VM_REG_LAZY	mm/vm_region.h	/^#define VM_REG_LAZY /;"	d
+VM_REG_LOCKED	mm/vm_region.h	/^#define VM_REG_LOCKED /;"	d
+VM_REG_NON	mm/vm_region.h	/^#define VM_REG_NON /;"	d
+VM_REG_PRIVATE	mm/vm_region.h	/^#define VM_REG_PRIVATE /;"	d
+VM_REG_PVSH	mm/vm_region.h	/^#define VM_REG_PVSH /;"	d
+VM_REG_RD	mm/vm_region.h	/^#define VM_REG_RD /;"	d
+VM_REG_SHARED	mm/vm_region.h	/^#define VM_REG_SHARED /;"	d
+VM_REG_STACK	mm/vm_region.h	/^#define VM_REG_STACK /;"	d
+VM_REG_WR	mm/vm_region.h	/^#define VM_REG_WR /;"	d
+WAIT_ANY	kern/wait_queue.h	/^#define WAIT_ANY /;"	d
+WAIT_FIRST	kern/wait_queue.h	/^#define WAIT_FIRST /;"	d
+WAIT_LAST	kern/wait_queue.h	/^#define WAIT_LAST /;"	d
+WARNING	kern/kdmsg.h	/^#define WARNING /;"	d
+XICU_CNTR_ACTIVE	drivers/soclib/soclib_xicu.h	/^#define XICU_CNTR_ACTIVE /;"	d
+XICU_CNTR_MASK	drivers/soclib/soclib_xicu.h	/^#define XICU_CNTR_MASK /;"	d
+XICU_CNTR_MAX	drivers/soclib/soclib_xicu.h	/^#define XICU_CNTR_MAX /;"	d
+XICU_CNTR_REG	drivers/soclib/soclib_xicu.h	/^#define XICU_CNTR_REG /;"	d
+XICU_CNTR_TYPE	drivers/soclib/soclib_xicu.h	/^#define XICU_CNTR_TYPE /;"	d
+XICU_HWI_ACTIVE	drivers/soclib/soclib_xicu.h	/^#define XICU_HWI_ACTIVE /;"	d
+XICU_HWI_MAX	drivers/soclib/soclib_xicu.h	/^#define XICU_HWI_MAX /;"	d
+XICU_HWI_TYPE	drivers/soclib/soclib_xicu.h	/^#define XICU_HWI_TYPE /;"	d
+XICU_MSK_CNTR	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_CNTR /;"	d
+XICU_MSK_CNTR_DISABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_CNTR_DISABLE /;"	d
+XICU_MSK_CNTR_ENABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_CNTR_ENABLE /;"	d
+XICU_MSK_HWI	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_HWI /;"	d
+XICU_MSK_HWI_DISABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_HWI_DISABLE /;"	d
+XICU_MSK_HWI_ENABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_HWI_ENABLE /;"	d
+XICU_MSK_PTI	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_PTI /;"	d
+XICU_MSK_PTI_DISABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_PTI_DISABLE /;"	d
+XICU_MSK_PTI_ENABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_PTI_ENABLE /;"	d
+XICU_MSK_WTI	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_WTI /;"	d
+XICU_MSK_WTI_DISABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_WTI_DISABLE /;"	d
+XICU_MSK_WTI_ENABLE	drivers/soclib/soclib_xicu.h	/^#define XICU_MSK_WTI_ENABLE /;"	d
+XICU_PRIO	drivers/soclib/soclib_xicu.h	/^#define XICU_PRIO /;"	d
+XICU_PRIO_HAS_CNTR	drivers/soclib/soclib_xicu.c	/^#define XICU_PRIO_HAS_CNTR(/;"	d	file:
+XICU_PRIO_HAS_HWI	drivers/soclib/soclib_xicu.c	/^#define XICU_PRIO_HAS_HWI(/;"	d	file:
+XICU_PRIO_HAS_PTI	drivers/soclib/soclib_xicu.c	/^#define XICU_PRIO_HAS_PTI(/;"	d	file:
+XICU_PRIO_HAS_WTI	drivers/soclib/soclib_xicu.c	/^#define XICU_PRIO_HAS_WTI(/;"	d	file:
+XICU_PRIO_HWI	drivers/soclib/soclib_xicu.c	/^#define XICU_PRIO_HWI(/;"	d	file:
+XICU_PRIO_PTI	drivers/soclib/soclib_xicu.c	/^#define XICU_PRIO_PTI(/;"	d	file:
+XICU_PRIO_WTI	drivers/soclib/soclib_xicu.c	/^#define XICU_PRIO_WTI(/;"	d	file:
+XICU_PTI_ACK	drivers/soclib/soclib_xicu.h	/^#define XICU_PTI_ACK /;"	d
+XICU_PTI_ACTIVE	drivers/soclib/soclib_xicu.h	/^#define XICU_PTI_ACTIVE /;"	d
+XICU_PTI_MAX	drivers/soclib/soclib_xicu.h	/^#define XICU_PTI_MAX /;"	d
+XICU_PTI_PER	drivers/soclib/soclib_xicu.h	/^#define XICU_PTI_PER /;"	d
+XICU_PTI_TYPE	drivers/soclib/soclib_xicu.h	/^#define XICU_PTI_TYPE /;"	d
+XICU_PTI_VAL	drivers/soclib/soclib_xicu.h	/^#define XICU_PTI_VAL /;"	d
+XICU_WTI_ACTIVE	drivers/soclib/soclib_xicu.h	/^#define XICU_WTI_ACTIVE /;"	d
+XICU_WTI_MAX	drivers/soclib/soclib_xicu.h	/^#define XICU_WTI_MAX /;"	d
+XICU_WTI_REG	drivers/soclib/soclib_xicu.h	/^#define XICU_WTI_REG /;"	d
+XICU_WTI_TYPE	drivers/soclib/soclib_xicu.h	/^#define XICU_WTI_TYPE /;"	d
+XY_MASK	cpu/mipsel/__cpu_kentry.S	/^#define XY_MASK   0xFF$/;"	d
+XY_WIDTH	cpu/mipsel/__cpu_kentry.S	/^#define XY_WIDTH  8$/;"	d
+X_AdEL	cpu/mipsel/cpu_do_exception.c	/^#define X_AdEL /;"	d	file:
+X_AdES	cpu/mipsel/cpu_do_exception.c	/^#define X_AdES /;"	d	file:
+X_CpU	cpu/mipsel/cpu_do_exception.c	/^#define X_CpU /;"	d	file:
+X_DBE	cpu/mipsel/cpu_do_exception.c	/^#define X_DBE /;"	d	file:
+X_IBE	cpu/mipsel/cpu_do_exception.c	/^#define X_IBE /;"	d	file:
+_ALMOS_ASM_	cpu/mipsel/__cpu_kentry.S	/^#define _ALMOS_ASM_$/;"	d
+_ALMOS_ASM_	cpu/mipsel/__kheader.S	/^#define _ALMOS_ASM_$/;"	d
+_ALMOS_LIST_H_	libk/list.h	/^#define _ALMOS_LIST_H_$/;"	d
+_ARCH_BIB_H_	libk/arch-bib.h	/^#define _ARCH_BIB_H_$/;"	d
+_ARCH_BIB_SIGNATURE_	arch/tsar/arch_init.c	/^#define _ARCH_BIB_SIGNATURE_$/;"	d	file:
+_ARCH_CONFIG_H_	arch/ibmpc/arch-config.h	/^#define _ARCH_CONFIG_H_$/;"	d
+_ARCH_CONFIG_H_	arch/tsar/arch-config.h	/^#define _ARCH_CONFIG_H_$/;"	d
+_ARCH_H_	arch/ibmpc/arch.h	/^#define _ARCH_H_$/;"	d
+_ARCH_H_	arch/tsar/arch.h	/^#define _ARCH_H_$/;"	d
+_ARCH_PMM_H_	arch/tsar/arch-pmm.h	/^#define _ARCH_PMM_H_$/;"	d
+_ATA_H_	drivers/ibmpc/ata.h	/^#define _ATA_H_$/;"	d
+_ATOMIC_H_	kern/atomic.h	/^#define _ATOMIC_H_$/;"	d
+_BARRIER_H_	kern/barrier.h	/^#define _BARRIER_H_$/;"	d
+_BITS_H_	libk/bits.h	/^#define _BITS_H_$/;"	d
+_BOOT_INFO_H_	libk/boot-info.h	/^#define _BOOT_INFO_H_$/;"	d
+_CLUSTER_H_	kern/cluster.h	/^#define _CLUSTER_H_$/;"	d
+_COND_VAR_H_	kern/cond_var.h	/^#define _COND_VAR_H_$/;"	d
+_CONFIG_H_	arch/tsar/kldscript.h	/^#define _CONFIG_H_$/;"	d
+_CONFIG_H_	libk/config.h	/^#define _CONFIG_H_$/;"	d
+_CPU_ASM_H_	cpu/i386/cpu-asm.h	/^#define  _CPU_ASM_H_$/;"	d
+_CPU_ASM_H_	cpu/mipsel/cpu-asm.h	/^#define  _CPU_ASM_H_$/;"	d
+_CPU_CONFIG_H_	cpu/i386/cpu-config.h	/^#define _CPU_CONFIG_H_$/;"	d
+_CPU_CONFIG_H_	cpu/mipsel/cpu-config.h	/^#define _CPU_CONFIG_H_$/;"	d
+_CPU_H_	kern/cpu.h	/^#define _CPU_H_$/;"	d
+_CPU_INTERNAL_H_	cpu/i386/cpu-internal.h	/^#define _CPU_INTERNAL_H_$/;"	d
+_CPU_IO_H_	cpu/i386/cpu-io.h	/^#define _CPU_IO_H_$/;"	d
+_CPU_REGS_H_	cpu/mipsel/cpu-regs.h	/^#define _CPU_REGS_H_$/;"	d
+_CPU_REMOTE_H_	cpu/mipsel/cpu-remote.h	/^#define	 _CPU_REMOTE_H_ /;"	d
+_CPU_TRACE_H_	kern/cpu-trace.h	/^#define _CPU_TRACE_H_$/;"	d
+_CTYPE_H_	libk/ctype.h	/^#define _CTYPE_H_$/;"	d
+_DEVFS_H_	fs/devfs/devfs.h	/^#define _DEVFS_H_$/;"	d
+_DEVFS_PRIVATE_H_	fs/devfs/devfs-private.h	/^#define _DEVFS_PRIVATE_H_$/;"	d
+_DEVICE_H_	kern/device.h	/^#define _DEVICE_H_$/;"	d
+_DISTLOCK_H_	kern/distlock.h	/^#define _DISTLOCK_H_$/;"	d
+_DMA_H_	kern/dma.h	/^#define _DMA_H_$/;"	d
+_DQDT_H_	kern/dqdt.h	/^#define _DQDT_H_$/;"	d
+_DRIVER_H_	kern/driver.h	/^#define _DRIVER_H_$/;"	d
+_DRVDB_H_	drivers/soclib/drvdb.h	/^#define _DRVDB_H_$/;"	d
+_ELF_H_	libk/elf.h	/^#define	_ELF_H_ /;"	d
+_ERRNO_H_	libk/errno.h	/^#define _ERRNO_H_$/;"	d
+_EVENT_H_	kern/event.h	/^#define _EVENT_H_$/;"	d
+_FAT32_H_	fs/fat32/fat32.h	/^#define _FAT32_H_$/;"	d
+_HAL_ARCH_H_	kern/hal-arch.h	/^#define  _HAL_ARCH_H_$/;"	d
+_HAL_CPU_H_	kern/hal-cpu.h	/^#define  _HAL_CPU_H_$/;"	d
+_HARDWARE_H_	arch/ibmpc/hardware.h	/^#define _HARDWARE_H_$/;"	d
+_HEAP_MANAGER_H_	mm/heap_manager.h	/^#define _HEAP_MANAGER_H_$/;"	d
+_HTABLE_H_	kern/htable.h	/^#define _HTABLE_H_$/;"	d
+_INTERRUPT_H_	kern/interrupt.h	/^#define _INTERRUPT_H_$/;"	d
+_KCM_H_	mm/kcm.h	/^#define _KCM_H_$/;"	d
+_KCOND_VAR_H_	kern/kcond_var.h	/^#define _KCOND_VAR_H_$/;"	d
+_KDMSG_H_	kern/kdmsg.h	/^#define _KDMSG_H_$/;"	d
+_KERNEL_CONFIG_H_	kern/kernel-config.h	/^#define _KERNEL_CONFIG_H_$/;"	d
+_KEYS_DB_H_	kern/keysdb.h	/^#define _KEYS_DB_H_$/;"	d
+_KFIFO_H_	kern/kfifo.h	/^#define _KFIFO_H_$/;"	d
+_KMAGICS_H_	kern/kmagics.h	/^#define _KMAGICS_H_$/;"	d
+_KMEM_H_	mm/kmem.h	/^#define _KMEM_H_$/;"	d
+_KU_TRANSFERT_H_	kern/ku_transfert.h	/^#define _KU_TRANSFERT_H_ /;"	d
+_LIBK_H_	libk/libk.h	/^#define _LIBK_H_$/;"	d
+_LINUX_RBTREE_H	libk/rbtree.h	/^#define	_LINUX_RBTREE_H$/;"	d
+_MAPPER_H_	mm/mapper.h	/^#define _MAPPER_H_$/;"	d
+_MCS_SYNC_H_	kern/mcs_sync.h	/^#define _MCS_SYNC_H_$/;"	d
+_MD5_H	libk/md5.h	/^#define _MD5_H$/;"	d
+_METAFS_H_	kern/metafs.h	/^#define _METAFS_H_$/;"	d
+_MMU_INFO_H_	arch/tsar/mmu-info.h	/^#define _MMU_INFO_H_$/;"	d
+_MM_CONFIG_H_	mm/mm-config.h	/^#define _MM_CONFIG_H_$/;"	d
+_MWMR_H_	kern/mwmr.h	/^#define _MWMR_H_$/;"	d
+_PAGE_H_	mm/page.h	/^#define _PAGE_H_$/;"	d
+_PCI_BUS_H_	drivers/ibmpc/pci-bus.h	/^#define _PCI_BUS_H_$/;"	d
+_PIC_ICU_H_	drivers/ibmpc/pic.h	/^#define _PIC_ICU_H_$/;"	d
+_PID_H_	kern/pid.h	/^#define _PID_H_$/;"	d
+_PMM_BIT_ORDER	arch/tsar/arch-pmm.h	/^#define _PMM_BIT_ORDER(/;"	d
+_PMM_H_	mm/pmm.h	/^#define _PMM_H_$/;"	d
+_PMM_INIT	arch/tsar/pmm.c	/^#define _PMM_INIT /;"	d	file:
+_PMM_VALID	arch/tsar/pmm.c	/^#define _PMM_VALID /;"	d	file:
+_PPM_H_	mm/ppm.h	/^#define _PPM_H_$/;"	d
+_PPN_H_	mm/ppn.h	/^#define _PPN_H_$/;"	d
+_RAMFS_H_	fs/ramfs/ramfs.h	/^#define _RAMFS_H_$/;"	d
+_RAMFS_PRIVATE_H_	fs/ramfs/ramfs-private.h	/^#define _RAMFS_PRIVATE_H_$/;"	d
+_REMOTE_ACCESS_H_	kern/remote_access.h	/^#define _REMOTE_ACCESS_H_ /;"	d
+_REMOTE_FIFO_H_	kern/remote_fifo.h	/^#define _REMOTE_FIFO_H_$/;"	d
+_RPC_H_	kern/rpc.h	/^#define _RPC_H_$/;"	d
+_RR_SCHED_H_	kern/rr-sched.h	/^#define _RR_SCHED_H_$/;"	d
+_RT_TIMER_H_	kern/rt_timer.h	/^#define  _RT_TIMER_H_$/;"	d
+_RW_LOCK_H_	kern/rwlock.h	/^#define _RW_LOCK_H_$/;"	d
+_SCHEDULER_H_	kern/scheduler.h	/^#define _SCHEDULER_H_$/;"	d
+_SCREEN_H_	cpu/i386/screen.h	/^#define _SCREEN_H_$/;"	d
+_SEMAPHORE_H_	kern/semaphore.h	/^#define _SEMAPHORE_H_$/;"	d
+_SGI_IMG_H_	ksh/sgiImg.h	/^#define _SGI_IMG_H_$/;"	d
+_SIGNAL_H_	kern/signal.h	/^#define _SIGNAL_H_$/;"	d
+_SOCLIB_BLOCK_H_	drivers/soclib/soclib_block.h	/^#define _SOCLIB_BLOCK_H_$/;"	d
+_SOCLIB_DMA_H_	drivers/soclib/soclib_dma.h	/^#define _SOCLIB_DMA_H_$/;"	d
+_SOCLIB_FB_H_	drivers/soclib/soclib_fb.h	/^#define _SOCLIB_FB_H_$/;"	d
+_SOCLIB_ICU_H_	drivers/soclib/soclib_icu.h	/^#define _SOCLIB_ICU_H_$/;"	d
+_SOCLIB_IOPIC_H_	drivers/soclib/soclib_iopic.h	/^#define _SOCLIB_IOPIC_H_$/;"	d
+_SOCLIB_MEMC_H_	drivers/soclib/soclib_memc.h	/^#define _SOCLIB_MEMC_H_$/;"	d
+_SOCLIB_TIMER_H_	drivers/soclib/soclib_timer.h	/^#define _SOCLIB_TIMER_H_$/;"	d
+_SOCLIB_TTY_H_	drivers/soclib/soclib_tty.h	/^#define _SOCLIB_TTY_H_$/;"	d
+_SOCLIB_XICU_H_	drivers/soclib/soclib_xicu.h	/^#define _SOCLIB_XICU_H_$/;"	d
+_SPINLOCK_H_	kern/spinlock.h	/^#define _SPINLOCK_H_$/;"	d
+_STDINT_H_	libk/stdint.h	/^#define _STDINT_H_$/;"	d
+_STRING_H_	libk/string.h	/^#define _STRING_H_$/;"	d
+_SYSCALL_H_	kern/syscall.h	/^#define _SYSCALL_H_$/;"	d
+_SYSCONF_H_	kern/sysconf.h	/^#define _SYSCONF_H_$/;"	d
+_SYSFS_H_	fs/sysfs/sysfs.h	/^#define _SYSFS_H_$/;"	d
+_SYSFS_PRIVATE_H_	fs/sysfs/sysfs-private.h	/^#define _SYSFS_PRIVATE_H_$/;"	d
+_SYSTEM_H_	kern/system.h	/^#define _SYSTEM_H_$/;"	d
+_SYS_VFS_H_	kern/sys-vfs.h	/^#define _SYS_VFS_H_$/;"	d
+_TASK_H_	kern/task.h	/^#define _TASK_H_$/;"	d
+_THREAD_H_	kern/thread.h	/^#define _THREAD_H_$/;"	d
+_TIME_H_	kern/time.h	/^#define _TIME_H_$/;"	d
+_TTY_H_	drivers/ibmpc/tty.h	/^#define _TTY_H_$/;"	d
+_TYPES_H_	libk/types.h	/^#define _TYPES_H_$/;"	d
+_USE_MMU_INFO_H_	arch/tsar/mmu-info.c	/^#define _USE_MMU_INFO_H_$/;"	d	file:
+_USE_MMU_INFO_H_	arch/tsar/pmm.c	/^#define _USE_MMU_INFO_H_$/;"	d	file:
+_USE_MMU_INFO_H_	cpu/mipsel/cpu_do_exception.c	/^#define _USE_MMU_INFO_H_$/;"	d	file:
+_UTILS_H_	libk/utils.h	/^#define _UTILS_H_$/;"	d
+_VFS_ERRNO_H_	vfs/vfs-errno.h	/^#define _VFS_ERRNO_H_$/;"	d
+_VFS_H_	vfs/vfs.h	/^#define _VFS_H_$/;"	d
+_VFS_PARAMS_H_	vfs/vfs-params.h	/^#define _VFS_PARAMS_H_$/;"	d
+_VFS_PRIVATE_H_	vfs/vfs-private.h	/^#define _VFS_PRIVATE_H_$/;"	d
+_VMM_H_	mm/vmm.h	/^#define _VMM_H_$/;"	d
+_VM_REGION_H_	mm/vm_region.h	/^#define _VM_REGION_H_$/;"	d
+_WAIT_QUEUE_H_	kern/wait_queue.h	/^#define _WAIT_QUEUE_H_$/;"	d
+__ARG_CAST	kern/rpc.h	/^#define __ARG_CAST(/;"	d
+__BIG_ENDIAN	libk/config.h	/^#define  __BIG_ENDIAN /;"	d
+__BYTE_ORDER	libk/md5.c	/^#define __BYTE_ORDER /;"	d	file:
+__CLUSTER_BITS_NR	arch/ibmpc/arch.h	/^#define __CLUSTER_BITS_NR /;"	d
+__CLUSTER_NR	arch/ibmpc/arch.h	/^#define __CLUSTER_NR /;"	d
+__CPU_BITS_NR	arch/ibmpc/arch.h	/^#define __CPU_BITS_NR /;"	d
+__CPU_NR	arch/ibmpc/arch.h	/^#define __CPU_NR /;"	d
+__CPU_USR_MODE_FPU	cpu/mipsel/cpu-asm.h	/^#define __CPU_USR_MODE_FPU /;"	d
+__CPU_WIDTH	libk/bits.h	/^#define __CPU_WIDTH /;"	d
+__CPUs	arch/ibmpc/arch.h	/^#define __CPUs /;"	d
+__FUNC_CALL	kern/rpc.h	/^#define	__FUNC_CALL(/;"	d
+__FUNC_CALL_	kern/rpc.h	/^#define	__FUNC_CALL_(/;"	d
+__FUNC_DECL	kern/rpc.h	/^#define	__FUNC_DECL(/;"	d
+__FUNC_DECL_	kern/rpc.h	/^#define	__FUNC_DECL_(/;"	d
+__FUNC_DEMA1	kern/rpc.h	/^#define __FUNC_DEMA1(/;"	d
+__FUNC_DEMA1_	kern/rpc.h	/^#define __FUNC_DEMA1_(/;"	d
+__FUNC_DEMA2	kern/rpc.h	/^#define __FUNC_DEMA2(/;"	d
+__FUNC_LOCA	kern/rpc.h	/^#define __FUNC_LOCA(/;"	d
+__FUNC_LOCA_	kern/rpc.h	/^#define __FUNC_LOCA_(/;"	d
+__GET_ARG_CAST	kern/rpc.h	/^#define __GET_ARG_CAST(/;"	d
+__GET_ARG_CASTS	kern/rpc.h	/^#define __GET_ARG_CASTS(/;"	d
+__GET_ARG_CASTS_	kern/rpc.h	/^#define __GET_ARG_CASTS_(/;"	d
+__GET_ARG_CAST_PTR	kern/rpc.h	/^#define __GET_ARG_CAST_PTR(/;"	d
+__GET_ARG_CAST_VAL	kern/rpc.h	/^#define __GET_ARG_CAST_VAL(/;"	d
+__GET_ARG_CASV	kern/rpc.h	/^#define __GET_ARG_CASV(/;"	d
+__GET_ARG_CASV_	kern/rpc.h	/^#define __GET_ARG_CASV_(/;"	d
+__GET_ARG_PTR	kern/rpc.h	/^#define __GET_ARG_PTR(/;"	d
+__GET_ARG_PTR_	kern/rpc.h	/^#define __GET_ARG_PTR_(/;"	d
+__GET_ARG_TV	kern/rpc.h	/^#define __GET_ARG_TV(/;"	d
+__GET_ARG_TV_	kern/rpc.h	/^#define __GET_ARG_TV_(/;"	d
+__GET_ARG_TYPE	kern/rpc.h	/^#define __GET_ARG_TYPE(/;"	d
+__GET_ARG_TYPE_PTR	kern/rpc.h	/^#define __GET_ARG_TYPE_PTR(/;"	d
+__GET_ARG_TYPE_VAL	kern/rpc.h	/^#define __GET_ARG_TYPE_VAL(/;"	d
+__GET_BOOL	kern/rpc.h	/^#define __GET_BOOL(/;"	d
+__GET_NB_ARG	kern/rpc.h	/^#define __GET_NB_ARG(/;"	d
+__GET_NB_ARG_	kern/rpc.h	/^#define __GET_NB_ARG_(/;"	d
+__GET_NB_ARG_BOOL_N	kern/rpc.h	/^#define __GET_NB_ARG_BOOL_N(/;"	d
+__GET_NB_ARG_N	kern/rpc.h	/^#define __GET_NB_ARG_N(/;"	d
+__GET_NB_ARG_RSEQ_N	kern/rpc.h	/^#define __GET_NB_ARG_RSEQ_N(/;"	d
+__GET_RET_PTR	kern/rpc.h	/^#define __GET_RET_PTR(/;"	d
+__GET_RET_PTR_	kern/rpc.h	/^#define __GET_RET_PTR_(/;"	d
+__GET_RET_TP	kern/rpc.h	/^#define __GET_RET_TP(/;"	d
+__GET_RET_TP_	kern/rpc.h	/^#define __GET_RET_TP_(/;"	d
+__GET_RET_VAL	kern/rpc.h	/^#define __GET_RET_VAL(/;"	d
+__GET_RET_VAL_	kern/rpc.h	/^#define __GET_RET_VAL_(/;"	d
+__KU_OBJ_CONSTRUCTOR	kern/ku_transfert.h	/^#define __KU_OBJ_CONSTRUCTOR(/;"	d
+__LITTLE_ENDIAN	libk/config.h	/^#define  __LITTLE_ENDIAN /;"	d
+__MD5Transform	libk/md5.c	/^static void __MD5Transform (uint32_t state[4], const uint8_t *in, int repeat) {$/;"	f	file:
+__MINI_SHELL_H__	ksh/kminiShell.h	/^#define __MINI_SHELL_H__$/;"	d
+__PAGE_SIZE	arch/ibmpc/arch.h	/^#define __PAGE_SIZE /;"	d
+__RCPC_ARG	kern/rpc.h	/^#define __RCPC_ARG(/;"	d
+__RCPC_ARG_SZ	kern/rpc.h	/^#define __RCPC_ARG_SZ(/;"	d
+__RCPC_GET_FIRST	kern/rpc.h	/^#define __RCPC_GET_FIRST(/;"	d
+__RCPC_GET_FIRST_	kern/rpc.h	/^#define __RCPC_GET_FIRST_(/;"	d
+__RCPC_GET_SECND	kern/rpc.h	/^#define __RCPC_GET_SECND(/;"	d
+__RCPC_GET_SECND_	kern/rpc.h	/^#define __RCPC_GET_SECND_(/;"	d
+__RCPC_RET	kern/rpc.h	/^#define __RCPC_RET(/;"	d
+__RCPC_RET_SZ	kern/rpc.h	/^#define __RCPC_RET_SZ(/;"	d
+__RCPC_TABLE	kern/rpc.h	/^#define __RCPC_TABLE(/;"	d
+__RCPC__	kern/rpc.h	/^#define __RCPC__(/;"	d
+__RET_CAST	kern/rpc.h	/^#define __RET_CAST(/;"	d
+__RPC_ALLOCATE	kern/rpc.h	/^#define __RPC_ALLOCATE(/;"	d
+__RPC_ALLOCATE_ON_HEAP	kern/rpc.h	/^#define __RPC_ALLOCATE_ON_HEAP(/;"	d
+__RPC_FREE	kern/rpc.h	/^#define __RPC_FREE(/;"	d
+__RPC_RESPOND	kern/rpc.h	/^#define __RPC_RESPOND(/;"	d
+__RPC_RESPOND_ALLOC	kern/rpc.h	/^#define __RPC_RESPOND_ALLOC(/;"	d
+__RPPC	kern/rpc.h	/^#define __RPPC(/;"	d
+__RPPC_GENERIC	kern/rpc.h	/^#define __RPPC_GENERIC(/;"	d
+__RPPC_RESPONSE_PREPARE	kern/rpc.h	/^#define __RPPC_RESPONSE_PREPARE(/;"	d
+__RPPC__	kern/rpc.h	/^#define __RPPC__(/;"	d
+__SIZE_OF	kern/rpc.h	/^#define __SIZE_OF(/;"	d
+__SYS_CALL_SERVICES_NUM	kern/syscall.h	/^	__SYS_CALL_SERVICES_NUM,$/;"	e	enum:__anon36
+__SYS_NERR	libk/errno.h	/^#define __SYS_NERR /;"	d
+__VFAT_PRIVATE_H__	fs/fat32/fat32-private.h	/^#define __VFAT_PRIVATE_H__$/;"	d
+__arch_boot_dmsg	arch/tsar/kdmsg.c	/^int __arch_boot_dmsg (const char *fmt, ...)$/;"	f
+__blk_addr	arch/ibmpc/hardware.h	/^#define __blk_addr /;"	d
+__boot_stack	cpu/i386/__boot.S	/^__boot_stack:/;"	l
+__cpu_check_sched	kern/cpu.c	/^inline bool_t __cpu_check_sched(struct thread_s *this)$/;"	f
+__cpu_context_init	cpu/i386/cpu_context.c	/^void __cpu_context_init(struct cpu_context_s* ctx, struct cpu_context_attr_s *attr)$/;"	f
+__cpu_in_kernel	kern/cpu.c	/^inline bool_t __cpu_in_kernel(cid_t cid, gid_t lid)$/;"	f
+__current_cid	arch/tsar/arch_init.c	/^global_t __current_cid;$/;"	v
+__distlock_exec	kern/distlock.c	/^#define __distlock_exec(/;"	d	file:
+__dma_addr	arch/ibmpc/hardware.h	/^#define __dma_addr /;"	d
+__do_exception	cpu/i386/__do_exception.c	/^void __do_exception(struct cpu_regs_s *regs)$/;"	f
+__do_interrupt	cpu/i386/__do_interrupt.c	/^void __do_interrupt(struct cpu_regs_s *regs)$/;"	f
+__except	cpu/i386/__kentry.S	/^__except:	$/;"	l
+__fb_addr	arch/ibmpc/hardware.h	/^#define __fb_addr /;"	d
+__fb_screen	arch/ibmpc/arch_init.c	/^struct device_s __fb_screen;$/;"	v	typeref:struct:device_s
+__fb_screen	drivers/soclib/soclib_fb.c	/^struct device_s __fb_screen;$/;"	v	typeref:struct:device_s
+__fprintk	arch/ibmpc/kdmsg.c	/^int __fprintk (int tty, spinlock_t *lock, const char *fmt, ...)$/;"	f
+__fprintk	arch/tsar/kdmsg.c	/^int __fprintk (int tty, ktty_lock_t ktty, const char *fmt, ...)$/;"	f
+__full_spinlock_lock	kern/spinlock.c	/^void __full_spinlock_lock(sint_t *lock, uint_t *irq_state)$/;"	f
+__full_spinlock_unlock	kern/spinlock.c	/^static void __full_spinlock_unlock(void *val, bool_t canYield, $/;"	f	file:
+__get_ppn	kern/ku_transfert.c	/^uint_t __get_ppn(struct ku_obj *kuo, ppn_t *ppns, size_t nb_ppn, $/;"	f
+__hfind	kern/htable.c	/^struct hnode_s* __hfind(struct hheader_s *hd, hash_t hval, void *key)$/;"	f
+__inode_can_access	vfs/vfs_cache.c	/^error_t __inode_can_access(struct vfs_inode_s *inode, gc_t igc)$/;"	f
+__irq	cpu/i386/__kentry.S	/^__irq:	$/;"	l
+__mapper_remove_page	mm/mapper.c	/^static inline void __mapper_remove_page(struct mapper_s *mapper, struct page_s *page)$/;"	f	file:
+__mapper_request_	mm/mapper.c	/^error_t __mapper_request_(struct mapper_s* mapper, $/;"	f
+__path_ptrs	vfs/vfs-private.h	/^	char *__path_ptrs[VFS_MAX_PATH_DEPTH];$/;"	m	struct:vfs_lookup_path_s
+__perror	arch/ibmpc/kdmsg.c	/^int __perror (int fatal, const char *fmt, ...)$/;"	f
+__perror	arch/tsar/kdmsg.c	/^int __perror (int fatal, const char *fmt, ...)$/;"	f
+__pic_addr	arch/ibmpc/hardware.h	/^#define __pic_addr /;"	d
+__pmm_get_page	arch/tsar/pmm.c	/^static error_t __pmm_get_page(uint_t *pgdir, vma_t vaddr, pmm_page_info_t *info)$/;"	f	file:
+__pmm_set_page	arch/tsar/pmm.c	/^static error_t __pmm_set_page(uint_t* pgdir, vma_t vaddr, pmm_page_info_t *info)$/;"	f	file:
+__rb_erase_color	libk/rbtree.c	/^static void __rb_erase_color(struct rb_node *node, struct rb_node *parent,$/;"	f	file:
+__rb_rotate_left	libk/rbtree.c	/^static void __rb_rotate_left(struct rb_node *node, struct rb_root *root)$/;"	f	file:
+__rb_rotate_right	libk/rbtree.c	/^static void __rb_rotate_right(struct rb_node *node, struct rb_root *root)$/;"	f	file:
+__rpc_check	kern/rpc.c	/^bool_t __rpc_check(struct rpc_listner_s *li)$/;"	f
+__rpc_send	kern/rpc.c	/^void __rpc_send(struct rpc_listner_s *rl, cid_t cid, gid_t lid, gid_t gid, $/;"	f
+__rpc_test	kern/rpc.c	/^void* __rpc_test()$/;"	f
+__sched_sleep	kern/scheduler.c	/^void __sched_sleep(struct thread_s *this, bool_t add_to_sleep_check)$/;"	f
+__sched_switch	kern/scheduler.c	/^SCHED_SCOPE void __sched_switch(struct thread_s *this, struct thread_s *elected)$/;"	f
+__sched_wakeup	kern/scheduler.c	/^void __sched_wakeup(struct thread_s *thread)$/;"	f
+__spinlock_lock	kern/spinlock.c	/^void __spinlock_lock(sint_t *lock)$/;"	f
+__spinlock_trylock	kern/spinlock.c	/^uint_t __spinlock_trylock(spinlock_t *lock)$/;"	f
+__spinlock_unlock	kern/spinlock.c	/^static void __spinlock_unlock(void *val,  bool_t canYield)$/;"	f	file:
+__sys_blk	arch/ibmpc/arch_init.c	/^struct device_s __sys_blk;$/;"	v	typeref:struct:device_s
+__sys_blk	drivers/soclib/soclib_block.c	/^struct device_s * __sys_blk;$/;"	v	typeref:struct:device_s
+__sys_blk	kern/thread_idle.c	/^struct device_s * __sys_blk;$/;"	v	typeref:struct:device_s
+__sys_dma	arch/ibmpc/arch_init.c	/^struct device_s __sys_dma;$/;"	v	typeref:struct:device_s
+__sys_dma	drivers/soclib/soclib_dma.c	/^struct device_s *__sys_dma;$/;"	v	typeref:struct:device_s
+__task_fd_dup	kern/task.c	/^error_t __task_fd_dup(struct fd_info_s *dst, struct fd_info_s *src)$/;"	f
+__task_fd_migrate	kern/task.c	/^static error_t __task_fd_migrate(struct task_s *dst, $/;"	f	file:
+__task_fd_set	kern/task.c	/^error_t __task_fd_set(struct task_s *task, uint_t fd, struct vfs_file_s *file)$/;"	f
+__test0	kern/rpc.c	/^error_t __test0(int nb)$/;"	f
+__test1	kern/rpc.c	/^error_t __test1(int nb)$/;"	f
+__timer_addr	arch/ibmpc/hardware.h	/^#define __timer_addr /;"	d
+__tty_addr	arch/ibmpc/hardware.h	/^#define __tty_addr /;"	d
+__vfs_destroy_imapper	vfs/vfs_cache.c	/^static void __vfs_destroy_imapper(struct vfs_inode_s* inode, bool_t sync)$/;"	f	file:
+__vfs_free_imapper	vfs/vfs_cache.c	/^static void __vfs_free_imapper(struct vfs_inode_s* inode)$/;"	f	file:
+__vfs_get_upath	vfs/vfs_lookup.c	/^error_t __vfs_get_upath(struct ku_obj *ku_path, struct page_s **k_path_pg, char **k_path, uint_t *len)$/;"	f
+__vfs_icache_del	vfs/vfs_cache.c	/^error_t __vfs_icache_del(struct vfs_inode_s *inode)$/;"	f
+__vfs_inode_free	vfs/vfs_cache.c	/^static void __vfs_inode_free(struct vfs_inode_s *inode)$/;"	f	file:
+__vfs_lookup	vfs/vfs_lookup.c	/^error_t __vfs_lookup(struct vfs_file_s *cwd, $/;"	f
+__vfs_lseek	vfs/vfs.c	/^error_t __vfs_lseek(struct vfs_file_remote_s *fremote, $/;"	f
+__vfs_lseek_	vfs/vfs.c	/^error_t __vfs_lseek_(size_t offset, uint_t whence, $/;"	f
+__vfs_open_s	vfs/vfs.c	/^struct __vfs_open_s$/;"	s	file:
+__vfs_stat_s	vfs/vfs.c	/^struct __vfs_stat_s$/;"	s	file:
+__vfs_unlink	vfs/vfs.c	/^error_t __vfs_unlink(struct vfs_file_s *cwd, struct ku_obj *path, uint_t flags)$/;"	f
+__vma2ppn	kern/ku_transfert.c	/^typedef ppn_t __vma2ppn(vma_t addr, bool_t write);$/;"	t	file:
+__vma_link_rb	mm/vm_region.c	/^static void __vma_link_rb(struct vmm_s *mm, struct vm_region_s *vma,$/;"	f	file:
+__vmm_fault_handler	mm/vmm.c	/^error_t __vmm_fault_handler(uint_t bad_vaddr, uint_t flags)$/;"	f
+_boot_init	cpu/i386/boot.c	/^void _boot_init()$/;"	f
+_start	cpu/i386/__boot.S	/^_start:$/;"	l
+_vfs_readdir	vfs/vfs.c	/^error_t _vfs_readdir(struct vfs_file_s *file, struct vfs_usp_dirent_s *dir)$/;"	f
+access	cpu/i386/cpu-internal.h	/^	uint8_t  access;$/;"	m	struct:cpu_gdt_entry_s
+action	arch/ibmpc/arch.h	/^	struct irq_action_s *action;$/;"	m	struct:arch_cpu_s	typeref:struct:arch_cpu_s::irq_action_s
+action	kern/device.h	/^	struct irq_action_s action;       \/*! to manage interrupt generated by the device *\/$/;"	m	struct:device_s	typeref:struct:device_s::irq_action_s
+active_pages_nr	mm/kcm.h	/^	uint_t active_pages_nr;$/;"	m	struct:kcm_s
+activelist	mm/kcm.h	/^	struct list_entry activelist;$/;"	m	struct:kcm_s	typeref:struct:kcm_s::list_entry
+add	kern/scheduler.h	/^	sched_add_t         *add;$/;"	m	struct:sched_ops_s
+add_created	kern/scheduler.h	/^	sched_add_created_t *add_created;$/;"	m	struct:sched_ops_s
+addr	mm/vmm.h	/^	void *addr;$/;"	m	struct:mmap_attr_s
+after_wakeup	kern/thread.h	/^	after_wakeup_t *after_wakeup;	    \/*! called after wakeup with interuption disabled  *\/$/;"	m	struct:thread_info
+after_wakeup_t	kern/thread.h	/^typedef void after_wakeup_t(struct thread_s *thread);$/;"	t
+alarm_clock	kern/time.c	/^void alarm_clock(struct alarm_s *alarm, uint_t ticks_nr)$/;"	f
+alarm_info_s	kern/time.h	/^struct alarm_info_s $/;"	s
+alarm_manager_init	kern/time.c	/^error_t alarm_manager_init(struct alarm_s *alarm)$/;"	f
+alarm_mgr	kern/cpu.h	/^	struct alarm_s alarm_mgr;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::alarm_s
+alarm_s	kern/time.h	/^struct alarm_s$/;"	s
+alarm_wait	kern/time.c	/^error_t alarm_wait(struct alarm_info_s *info, uint_t msec)$/;"	f
+aligne	mm/kcm.h	/^	uint_t aligne;$/;"	m	struct:kcm_s
+aligne	mm/kmem.h	/^  uint_t aligne;$/;"	m	struct:kmem_objattr_s
+arch	kern/cpu.h	/^	struct arch_cpu_s arch;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::arch_cpu_s
+arch	libk/arch-bib.h	/^	char       arch[16];$/;"	m	struct:arch_bib_header_s
+arch_barrier_destroy	arch/tsar/arch.c	/^error_t arch_barrier_destroy(struct cluster_s *cluster, uint_t barrier_id)$/;"	f
+arch_barrier_init	arch/tsar/arch.c	/^sint_t arch_barrier_init(struct cluster_s *cluster, struct event_s *event, uint_t count)$/;"	f
+arch_barrier_wait	arch/tsar/arch.c	/^sint_t arch_barrier_wait(struct cluster_s *cluster, uint_t barrier_id)$/;"	f
+arch_bib_cluster_s	libk/arch-bib.h	/^struct arch_bib_cluster_s$/;"	s
+arch_bib_device_s	libk/arch-bib.h	/^struct arch_bib_device_s$/;"	s
+arch_bib_header_s	libk/arch-bib.h	/^struct arch_bib_header_s$/;"	s
+arch_bib_signature	libk/arch-bib.h	/^const char* arch_bib_signature = "@ALMOS ARCH BIB";$/;"	v
+arch_boot_cid	arch/tsar/arch_init.c	/^inline cid_t arch_boot_cid(void)$/;"	f
+arch_boot_cid_	arch/tsar/arch_init.c	/^static global_t arch_boot_cid_;$/;"	v	file:
+arch_bootstrap_cpu	libk/arch-bib.h	/^	uint32_t   arch_bootstrap_cpu;	\/* Boot Frozen Order *\/$/;"	m	struct:arch_bib_header_s
+arch_cid	arch/tsar/arch.h	/^	uint_t arch_cid;$/;"	m	struct:arch_entry_s
+arch_cid	libk/arch-bib.h	/^	uint8_t arch_cid;$/;"	m	struct:arch_bib_cluster_s
+arch_clst_arch_cid	arch/tsar/arch.h	/^static inline uint_t arch_clst_arch_cid(cid_t cid)$/;"	f
+arch_clst_cid	arch/tsar/arch.h	/^static inline cid_t arch_clst_cid(uint_t arch_cid)$/;"	f
+arch_cpu_cid	arch/tsar/arch.h	/^static inline uint_t arch_cpu_cid(uint_t cpu_gid)$/;"	f
+arch_cpu_get_irq_entry	arch/ibmpc/arch.c	/^error_t arch_cpu_get_irq_entry(struct cpu_s *cpu, int irq_nr, struct irq_action_s **action)$/;"	f
+arch_cpu_get_irq_entry	arch/tsar/arch.c	/^error_t arch_cpu_get_irq_entry(struct cpu_s *cpu, int irq_nr, struct irq_action_s **action)$/;"	f
+arch_cpu_gid	arch/tsar/arch.h	/^static inline uint_t arch_cpu_gid(uint_t cid, uint_t lid)$/;"	f
+arch_cpu_init	arch/ibmpc/arch.c	/^error_t arch_cpu_init(struct cpu_s *cpu)$/;"	f
+arch_cpu_init	arch/tsar/arch.c	/^error_t arch_cpu_init(struct cpu_s *cpu)$/;"	f
+arch_cpu_lid	arch/tsar/arch.h	/^static inline uint_t arch_cpu_lid(uint_t cpu_gid)$/;"	f
+arch_cpu_per_cluster	arch/tsar/arch_init.c	/^inline uint_t arch_cpu_per_cluster(void)$/;"	f
+arch_cpu_s	arch/ibmpc/arch.h	/^struct arch_cpu_s$/;"	s
+arch_cpu_s	arch/tsar/arch.h	/^struct arch_cpu_s$/;"	s
+arch_cpu_send_ipi	arch/tsar/arch.c	/^error_t arch_cpu_send_ipi(gid_t dest, uint32_t val)$/;"	f
+arch_cpu_set_irq_entry	arch/ibmpc/arch.c	/^error_t arch_cpu_set_irq_entry(struct cpu_s *cpu, int irq_nr, struct irq_action_s *action)$/;"	f
+arch_cpu_set_irq_entry	arch/tsar/arch.c	/^error_t arch_cpu_set_irq_entry(struct cpu_s *cpu, int irq_nr, struct irq_action_s *action)$/;"	f
+arch_cpus_per_cluster	arch/tsar/arch_init.c	/^static global_t arch_cpus_per_cluster;$/;"	v	file:
+arch_dev_init	arch/tsar/arch_init.c	/^bool_t arch_dev_init(struct cluster_s *cluster, struct cluster_entry_s *centry,$/;"	f
+arch_dev_iopic_register	arch/tsar/arch_init.c	/^void arch_dev_iopic_register(struct cluster_s *cluster, $/;"	f
+arch_dev_locate	arch/tsar/arch_init.c	/^struct device_s* arch_dev_locate(struct list_entry *devlist_root, uint_t drvid)$/;"	f
+arch_dev_register	arch/tsar/arch_init.c	/^void arch_dev_register(struct cluster_s *cluster, $/;"	f
+arch_entry_s	arch/tsar/arch.h	/^struct arch_entry_s$/;"	s
+arch_entry_t	arch/tsar/arch.h	/^typedef struct arch_entry_s *arch_entry_t;$/;"	t	typeref:struct:arch_entry_s
+arch_entrys	arch/tsar/arch_init.c	/^struct arch_entry_s arch_entrys[CLUSTER_NR];$/;"	v	typeref:struct:arch_entry_s
+arch_info	libk/boot-info.h	/^	uint_t arch_info;$/;"	m	struct:boot_info_s
+arch_init	arch/ibmpc/arch_init.c	/^error_t arch_init(void)$/;"	f
+arch_init	arch/tsar/arch_init.c	/^void arch_init(struct boot_info_s *info)$/;"	f
+arch_onln_cluster_nr	arch/tsar/arch_init.c	/^inline uint_t arch_onln_cluster_nr(void)$/;"	f
+arch_onln_clusters_nr	arch/tsar/arch_init.c	/^static global_t arch_onln_clusters_nr;$/;"	v	file:
+arch_onln_cpu_nr	arch/tsar/arch_init.c	/^inline uint_t arch_onln_cpu_nr(void)$/;"	f
+arch_onln_cpus_nr	arch/tsar/arch_init.c	/^static global_t arch_onln_cpus_nr;$/;"	v	file:
+arch_power_state_t	kern/hal-arch.h	/^} arch_power_state_t;$/;"	t	typeref:enum:__anon16
+arch_set_power_state	arch/tsar/arch.c	/^error_t arch_set_power_state(struct cpu_s *cpu, arch_power_state_t state)$/;"	f
+arch_state_init	arch/tsar/arch_init.c	/^void arch_state_init(struct boot_info_s *info)$/;"	f
+arch_xicu_set_mask	arch/tsar/arch_init.c	/^void arch_xicu_set_mask(struct cluster_s *cluster, struct device_s *icu)\/\/FG : we changed the interruption policy if 4 clusters$/;"	f
+arch_xicu_set_wti	arch/tsar/arch_init.c	/^void arch_xicu_set_wti(struct device_s *xicu, $/;"	f
+arg	kern/event.h	/^	void *arg;$/;"	m	struct:__anon15
+arg1	cpu/i386/cpu-asm.h	/^	reg_t arg1;$/;"	m	struct:cpu_context_s
+arg1	cpu/mipsel/cpu-asm.h	/^	reg_t arg1;			\/* 16 *\/$/;"	m	struct:cpu_context_s
+arg1	kern/thread.h	/^	void *arg1;$/;"	m	struct:__anon39
+arg2	cpu/i386/cpu-asm.h	/^	reg_t arg2;$/;"	m	struct:cpu_context_s
+arg2	cpu/mipsel/cpu-asm.h	/^	reg_t arg2;			\/* 17 *\/$/;"	m	struct:cpu_context_s
+arg2	kern/thread.h	/^	void *arg2;$/;"	m	struct:__anon39
+argc	ksh/kminiShell.h	/^  uint_t argc;$/;"	m	struct:ms_argument_s
+args	ksh/miniShell.c	/^ms_args_t args;$/;"	v
+args_len	kern/do_exec.c	/^error_t args_len(char **vect, uint_t pages_max, $/;"	f
+args_nb	kern/rpc.h	/^	uint8_t args_nb;$/;"	m	struct:rpc_s
+args_ppns	kern/task.h	/^	ppn_t			args_ppns[CONFIG_TASK_ARGS_PAGES_MAX_NR];$/;"	m	struct:sys_exec_remote_s
+args_ppns2pages	kern/sys_exec.c	/^error_t args_ppns2pages(ppn_t ppns[], struct page_s *pgtbl[], bool_t is_local)$/;"	f
+argv	ksh/kminiShell.h	/^  char argv[MS_MAX_ARG_LEN][MS_MAX_LINE_LEN];$/;"	m	struct:ms_argument_s
+argv_end	kern/task.h	/^	uint_t			argv_end;$/;"	m	struct:sys_exec_remote_s
+argv_index	kern/task.h	/^	uint_t			argv_index;$/;"	m	struct:sys_exec_remote_s
+assert	kern/kdmsg.h	/^#define assert(/;"	d
+assert2	kern/kdmsg.h	/^#define assert2(/;"	d
+ata_busy_wait	drivers/ibmpc/ata.c	/^error_t ata_busy_wait(uint_t base)$/;"	f
+ata_context_s	drivers/ibmpc/ata.h	/^struct ata_context_s$/;"	s
+ata_finalize_request	drivers/ibmpc/ata.c	/^static void ata_finalize_request(struct device_s *dev, dev_request_t *rq, uint32_t type)$/;"	f	file:
+ata_get_params	drivers/ibmpc/ata.c	/^static sint_t ata_get_params(struct device_s *blk_dev, dev_params_t *params) $/;"	f	file:
+ata_identify_s	drivers/ibmpc/ata.h	/^struct ata_identify_s$/;"	s
+ata_irq_handler	drivers/ibmpc/ata.c	/^void __attribute__ ((noinline)) ata_irq_handler(struct irq_action_s *action)$/;"	f
+ata_params_s	drivers/ibmpc/ata.h	/^struct ata_params_s$/;"	s
+ata_read	drivers/ibmpc/ata.c	/^static sint_t ata_read(struct device_s *blk_dev, dev_request_t *rq)$/;"	f	file:
+ata_request	drivers/ibmpc/ata.c	/^int32_t __attribute__ ((noinline)) ata_request(struct device_s *blk_dev, dev_request_t *rq, uint32_t type)$/;"	f
+ata_start_request	drivers/ibmpc/ata.c	/^static void ata_start_request(struct device_s *dev, dev_request_t *rq, uint32_t type)$/;"	f	file:
+ata_write	drivers/ibmpc/ata.c	/^static sint_t ata_write(struct device_s *blk_dev, dev_request_t *rq)$/;"	f	file:
+atoi	libk/atoi.c	/^int atoi(const char *nptr)$/;"	f
+atomic_add	kern/atomic.c	/^inline sint_t atomic_add(atomic_t *ptr, sint_t val)$/;"	f
+atomic_cas	kern/atomic.c	/^inline bool_t atomic_cas(atomic_t *ptr, sint_t old, sint_t new)$/;"	f
+atomic_dec	kern/atomic.c	/^inline sint_t atomic_dec(atomic_t *ptr)$/;"	f
+atomic_get	kern/atomic.c	/^inline sint_t atomic_get(atomic_t *ptr)$/;"	f
+atomic_inc	kern/atomic.c	/^inline sint_t atomic_inc(atomic_t *ptr)$/;"	f
+atomic_init	kern/atomic.c	/^inline void atomic_init(atomic_t *ptr, sint_t val)$/;"	f
+atomic_s	kern/atomic.h	/^struct atomic_s$/;"	s
+atomic_set	kern/atomic.c	/^inline sint_t atomic_set(atomic_t *ptr, sint_t val)$/;"	f
+atomic_t	kern/atomic.h	/^typedef struct atomic_s atomic_t;$/;"	t	typeref:struct:atomic_s
+atomic_test_set	kern/atomic.c	/^inline bool_t atomic_test_set(atomic_t *ptr, sint_t val)$/;"	f
+attr	drivers/ibmpc/tty.h	/^	uint_t attr;$/;"	m	struct:tty_context_s
+attr	kern/sys_thread_create.c	/^	pthread_attr_t    *attr;$/;"	m	struct:__anon35	file:
+attr	kern/thread.h	/^	pthread_attr_t attr;$/;"	m	struct:thread_info
+attr	mm/pmm.h	/^	uint_t attr;$/;"	m	struct:pmm_page_info_s
+attr	vfs/vfs.c	/^	uint_t attr;$/;"	m	struct:__vfs_open_s	file:
+attr	vfs/vfs.h	/^	uint32_t attr;$/;"	m	struct:vfs_icreate_s
+b_ctrl	kern/blkio.h	/^	}                     b_ctrl;         \/\/ Only used in head-blkio$/;"	m	struct:blkio_s	typeref:struct:blkio_s::__anon7
+b_dev	kern/blkio.h	/^	struct device_s*	b_dev;		\/\/ block device$/;"	m	struct:blkio_s	typeref:struct:blkio_s::device_s
+b_dev_rq	kern/blkio.h	/^	dev_request_t		b_dev_rq;	\/\/ request for the block device$/;"	m	struct:blkio_s
+b_flags	kern/blkio.h	/^	uint_t                b_flags;        \/\/ BLKIO_INIT$/;"	m	struct:blkio_s
+b_list	kern/blkio.h	/^	struct slist_entry	b_list;	        \/\/ next buffer in this page$/;"	m	struct:blkio_s	typeref:struct:blkio_s::slist_entry
+b_page	kern/blkio.h	/^	struct page_s*	b_page;		\/\/ buffer page descriptor$/;"	m	struct:blkio_s	typeref:struct:blkio_s::page_s
+b_private	kern/blkio.h	/^	void*			b_private;	\/\/ data for the I\/O completion method$/;"	m	struct:blkio_s
+backoff	kern/remote_fifo.c	/^void backoff(uint_t waiting_pos)$/;"	f
+barrier_destroy	kern/barrier.c	/^error_t barrier_destroy(struct barrier_s *barrier)$/;"	f
+barrier_do_broadcast	kern/barrier.c	/^static void barrier_do_broadcast(struct barrier_s *barrier)$/;"	f	file:
+barrier_init	kern/barrier.c	/^error_t barrier_init(struct barrier_s *barrier, uint_t count, uint_t scope)$/;"	f
+barrier_kmem_init	kern/barrier.h	/^KMEM_OBJATTR_INIT(barrier_kmem_init);$/;"	v
+barrier_operation_t	kern/barrier.h	/^} barrier_operation_t;$/;"	t	typeref:enum:__anon4
+barrier_s	kern/barrier.h	/^struct barrier_s$/;"	s
+barrier_wait	kern/barrier.c	/^error_t barrier_wait(struct barrier_s *barrier)$/;"	f
+base	cpu/i386/cpu-internal.h	/^	uint32_t base;$/;"	m	struct:cpu_gdt_ptr_s
+base	cpu/i386/cpu-internal.h	/^	uint32_t base;$/;"	m	struct:cpu_idt_ptr_s
+base	kern/device.h	/^	volatile void *base;              \/*! base address of the mapped device *\/$/;"	m	struct:device_s
+base	libk/arch-bib.h	/^	uint64_t base;$/;"	m	struct:arch_bib_device_s
+base	mm/heap_manager.h	/^	uint_t base;$/;"	m	struct:heap_manager_s
+base_high	cpu/i386/cpu-internal.h	/^	uint8_t  base_high;$/;"	m	struct:cpu_gdt_entry_s
+base_low	cpu/i386/cpu-internal.h	/^	uint16_t base_low;$/;"	m	struct:cpu_gdt_entry_s
+base_middle	cpu/i386/cpu-internal.h	/^	uint8_t  base_middle;$/;"	m	struct:cpu_gdt_entry_s
+base_paddr	kern/device.h	/^	uint64_t base_paddr;		  \/*! physical address where the device is mapped *\/$/;"	m	struct:device_s
+bassert	kern/kdmsg.h	/^#define bassert(/;"	d
+bdev_lock	drivers/soclib/soclib_block.c	/^void bdev_lock(struct device_s *bdev)$/;"	f
+bdev_unlock	drivers/soclib/soclib_block.c	/^void bdev_unlock(struct device_s *bdev)$/;"	f
+bdump	arch/ibmpc/kdmsg.c	/^void bdump(uint_t fd, char* buff, size_t count)$/;"	f
+before_sleep	kern/thread.h	/^	before_sleep_t *before_sleep;	    \/*! called before sleep with interuption disabled *\/$/;"	m	struct:thread_info
+before_sleep_t	kern/thread.h	/^typedef void before_sleep_t(struct thread_s *thread);$/;"	t
+begin	mm/ppm.h	/^	uint64_t begin;$/;"	m	struct:ppm_s
+bin	kern/task.h	/^	struct vfs_file_s bin;$/;"	m	struct:task_s	typeref:struct:task_s::vfs_file_s
+bin	kern/task.h	/^        struct vfs_file_s       bin;$/;"	m	struct:sys_exec_remote_s	typeref:struct:sys_exec_remote_s::vfs_file_s
+bind	kern/driver.h	/^	icu_bind_t *bind;$/;"	m	struct:dev_icu_op
+bind_wti	kern/driver.h	/^	icu_bind_wti_t *bind_wti;$/;"	m	struct:dev_icu_op
+bind_wti_and_irq	kern/driver.h	/^    iopic_bind_wti_and_irq_t *bind_wti_and_irq;$/;"	m	struct:dev_iopic_op
+bitmap_clear	libk/bits.h	/^static inline void bitmap_clear(bitmap_t *bitmap, uint_t index)$/;"	f
+bitmap_clear_range	libk/bits.c	/^void bitmap_clear_range(bitmap_t *bitmap, register sint_t index, register sint_t len)$/;"	f
+bitmap_ffc	libk/bits.h	/^static inline sint_t bitmap_ffc(bitmap_t *bitmap, size_t size)$/;"	f
+bitmap_ffc2	libk/bits.c	/^sint_t bitmap_ffc2(bitmap_t *bitmap, uint_t index, size_t size)$/;"	f
+bitmap_ffs	libk/bits.h	/^static inline sint_t bitmap_ffs(bitmap_t *bitmap, size_t size)$/;"	f
+bitmap_ffs2	libk/bits.c	/^sint_t bitmap_ffs2(bitmap_t *bitmap, uint_t index, size_t size)$/;"	f
+bitmap_set	libk/bits.h	/^static inline void bitmap_set(bitmap_t *bitmap, uint_t index)$/;"	f
+bitmap_set_range	libk/bits.c	/^void bitmap_set_range(bitmap_t *bitmap, register sint_t index, register sint_t len)$/;"	f
+bitmap_size	mm/kcm.c	/^	uint8_t bitmap_size;$/;"	m	struct:page_info_s	file:
+bitmap_state	libk/bits.h	/^static inline int bitmap_state(bitmap_t *bitmap, uint32_t index)$/;"	f
+bitmap_t	libk/bits.h	/^typedef uint_t bitmap_t;$/;"	t
+bits_log2	libk/bits.h	/^static inline uint_t bits_log2(uint_t val)$/;"	f
+bits_nr	libk/bits.h	/^static inline uint_t bits_nr(uint_t val)$/;"	f
+blk_count	drivers/ibmpc/ata.h	/^	uint32_t blk_count;$/;"	m	struct:ata_params_s
+blk_count	drivers/soclib/soclib_block.c	/^	uint32_t blk_count;$/;"	m	struct:block_params_s	file:
+blk_rd_count	fs/fat32/fat32_access.c	/^uint32_t blk_rd_count ;$/;"	v
+blk_size	drivers/ibmpc/ata.h	/^	uint32_t blk_size;$/;"	m	struct:ata_params_s
+blk_size	drivers/soclib/soclib_block.c	/^	uint32_t blk_size;$/;"	m	struct:block_params_s	file:
+blk_tbl	mm/kcm.c	/^	uint8_t *blk_tbl;$/;"	m	struct:page_info_s	file:
+blkio_ctor	kern/blkio.c	/^static void blkio_ctor(struct kcm_s *kcm, void *ptr) $/;"	f	file:
+blkio_destroy	kern/blkio.c	/^error_t blkio_destroy(struct page_s *page) $/;"	f
+blkio_init	kern/blkio.c	/^error_t blkio_init(struct device_s *dev, struct page_s *page, uint_t count) $/;"	f
+blkio_kmem_init	kern/blkio.h	/^KMEM_OBJATTR_INIT(blkio_kmem_init);$/;"	v
+blkio_s	kern/blkio.h	/^struct blkio_s $/;"	s
+blkio_set_initial	kern/blkio.h	/^#define blkio_set_initial(/;"	d
+blkio_sync	kern/blkio.c	/^error_t blkio_sync(struct page_s *page, uint_t flags) $/;"	f
+block	kern/task.h	/^	mcs_lock_t block;$/;"	m	struct:task_s
+block_context_s	drivers/soclib/soclib_block.c	/^struct block_context_s$/;"	s	file:
+block_get_params	drivers/soclib/soclib_block.c	/^static sint_t block_get_params(struct device_s *blk_dev, dev_params_t *params) $/;"	f	file:
+block_info_s	mm/heap_manager.c	/^struct block_info_s$/;"	s	file:
+block_info_t	mm/heap_manager.c	/^typedef struct block_info_s block_info_t;$/;"	t	typeref:struct:block_info_s	file:
+block_irq_handler	drivers/soclib/soclib_block.c	/^void __attribute__ ((noinline)) block_irq_handler(struct irq_action_s *action)$/;"	f
+block_open	drivers/soclib/soclib_block.c	/^static sint_t block_open(struct device_s *blk_dev, dev_request_t *rq)$/;"	f	file:
+block_params_s	drivers/soclib/soclib_block.c	/^struct block_params_s$/;"	s	file:
+block_read	drivers/soclib/soclib_block.c	/^static sint_t block_read(struct device_s *blk_dev, dev_request_t *rq)$/;"	f	file:
+block_request	drivers/soclib/soclib_block.c	/^int32_t __attribute__ ((noinline)) block_request(struct device_s *blk_dev, dev_request_t *rq, uint32_t type)$/;"	f
+block_start_request	drivers/soclib/soclib_block.c	/^static void block_start_request(struct device_s *block, dev_request_t *rq, uint32_t type)$/;"	f	file:
+block_write	drivers/soclib/soclib_block.c	/^static sint_t block_write(struct device_s *blk_dev, dev_request_t *rq)$/;"	f	file:
+blocks_nr	mm/kcm.h	/^	uint_t blocks_nr;$/;"	m	struct:kcm_s
+bool_t	libk/types.h	/^typedef unsigned long bool_t;$/;"	t
+boosted_prio	kern/thread.h	/^	sint_t boosted_prio;$/;"	m	struct:thread_s
+boot_clstr	kern/cluster.h	/^	uint_t boot_clstr;$/;"	m	struct:cluster_s
+boot_cluster	arch/tsar/kdmsg.c	/^uint_t boot_cluster;$/;"	v
+boot_cluster_id	libk/boot-info.h	/^	uint_t boot_cluster_id;$/;"	m	struct:boot_info_s
+boot_cpu_id	libk/boot-info.h	/^	uint_t boot_cpu_id;$/;"	m	struct:boot_info_s
+boot_device	cpu/i386/boot.c	/^	unsigned long boot_device;$/;"	m	struct:mb_partial_info_s	file:
+boot_dmsg	kern/kdmsg.h	/^#define boot_dmsg(/;"	d
+boot_info_s	libk/boot-info.h	/^struct boot_info_s$/;"	s
+boot_info_t	libk/boot-info.h	/^typedef struct boot_info_s boot_info_t;$/;"	t	typeref:struct:boot_info_s
+boot_loader_end	libk/boot-info.h	/^	uint_t boot_loader_end;$/;"	m	struct:boot_info_s
+boot_loader_start	libk/boot-info.h	/^	uint_t boot_loader_start;$/;"	m	struct:boot_info_s
+boot_lock	arch/tsar/kdmsg.c	/^DISTLOCK_DECLARE(boot_lock);$/;"	v
+boot_pgdir	libk/boot-info.h	/^	uint_t boot_pgdir;$/;"	m	struct:boot_info_s
+boot_signal	libk/boot-info.h	/^	boot_signal_t *boot_signal;$/;"	m	struct:boot_info_s
+boot_signal_t	libk/boot-info.h	/^typedef void (boot_signal_t)(struct boot_info_s*);$/;"	t
+boot_tbl_entry_s	libk/boot-info.h	/^struct boot_tbl_entry_s$/;"	s
+boot_tbl_entry_t	libk/boot-info.h	/^typedef struct boot_tbl_entry_s boot_tbl_entry_t;$/;"	t	typeref:struct:boot_tbl_entry_s
+bootstrap_cpu	libk/arch-bib.h	/^	uint32_t   bootstrap_cpu;	\/\/FG : almos_id$/;"	m	struct:arch_bib_header_s
+bootstrap_dma	libk/arch-bib.h	/^	uint64_t   bootstrap_dma;	\/\/FG$/;"	m	struct:arch_bib_header_s
+bootstrap_tty	libk/arch-bib.h	/^	uint64_t   bootstrap_tty;	\/\/FG$/;"	m	struct:arch_bib_header_s
+bpc	ksh/sgiImg.h	/^  uint8_t    bpc;$/;"	m	struct:sgi_info_s
+brom_end	libk/boot-info.h	/^	uint_t brom_end;$/;"	m	struct:boot_info_s
+brom_start	libk/boot-info.h	/^	uint_t brom_start;$/;"	m	struct:boot_info_s
+browse_rb	mm/vm_region.c	/^static int browse_rb(struct rb_root *root)$/;"	f	file:
+buckets	kern/htable.h	/^	struct list_entry *buckets;$/;"	m	struct:hheader_s	typeref:struct:hheader_s::list_entry
+buddy_list_s	mm/ppm.h	/^struct buddy_list_s$/;"	s
+buff	kern/ku_transfert.h	/^	void* buff;$/;"	m	struct:ku_obj
+buff	vfs/vfs.c	/^	struct vfs_stat_s buff;$/;"	m	struct:__vfs_stat_s	typeref:struct:__vfs_stat_s::vfs_stat_s	file:
+buff_offset	mm/mapper.h	/^	size_t buff_offset;$/;"	m	struct:mapper_buff_s
+buff_ppns	mm/mapper.h	/^	ppn_t *buff_ppns;$/;"	m	struct:mapper_buff_s
+buffer	fs/sysfs/sysfs.h	/^	uint8_t buffer[SYSFS_BUFFER_SIZE];$/;"	m	struct:__anon3
+buffer	ksh/miniShell.c	/^uint8_t buffer[BUFFER_SIZE];$/;"	v
+buffer	libk/md5.h	/^  uint8_t  buffer[64];     \/* input buffer for incomplete buffer data *\/$/;"	m	struct:__anon44
+buffers_nr	kern/cluster.h	/^	atomic_t buffers_nr;$/;"	m	struct:cluster_s
+builtin_cmds	ksh/miniShell.c	/^static ksh_builtin_t builtin_cmds[] = $/;"	v	file:
+busy	kern/task.h	/^	char busy;$/;"	m	struct:fd_entry_s
+busy	mm/heap_manager.c	/^	uint_t busy:1;$/;"	m	struct:block_info_s	file:
+busy_pages_nr	mm/kcm.h	/^	uint_t busy_pages_nr;$/;"	m	struct:kcm_s
+busy_percent	kern/cpu.h	/^	uint_t busy_percent;$/;"	m	struct:cpu_s
+busylist	mm/kcm.h	/^	struct list_entry busylist;$/;"	m	struct:kcm_s	typeref:struct:kcm_s::list_entry
+bytes_per_cluster	fs/fat32/fat32.h	/^	uint32_t bytes_per_cluster;$/;"	m	struct:vfat_context_s
+bytes_per_sector	fs/fat32/fat32.h	/^	uint32_t bytes_per_sector;$/;"	m	struct:vfat_context_s
+c0_sr	cpu/mipsel/cpu-asm.h	/^	reg_t c0_sr;			\/* 11 *\/$/;"	m	struct:cpu_context_s
+cache_line_s	libk/types.h	/^struct cache_line_s$/;"	s
+cacheline_t	libk/types.h	/^typedef struct cache_line_s cacheline_t;$/;"	t	typeref:struct:cache_line_s
+callback	kern/thread.h	/^	sched_callback_t *callback;   \/* for sleep_check *\/$/;"	m	struct:thread_s
+callback_data	kern/thread.h	/^	void *callback_data;	      \/* for sleep_check *\/$/;"	m	struct:thread_s
+capabilities	drivers/ibmpc/ata.h	/^	uint16_t capabilities;$/;"	m	struct:ata_identify_s
+cat_func	ksh/cat.c	/^error_t cat_func(void *param)$/;"	f
+cause_int	cpu/mipsel/__cpu_kentry.S	/^cause_int:$/;"	l
+cause_sys	cpu/mipsel/__cpu_kentry.S	/^cause_sys:$/;"	l
+cd_func	ksh/cd.c	/^error_t cd_func(void *param)$/;"	f
+check_args	kern/sys_madvise.c	/^static error_t check_args(struct vmm_s *vmm, uint_t start, uint_t len, struct vm_region_s **reg)$/;"	f	file:
+check_sleeping	kern/scheduler.c	/^void check_sleeping(struct scheduler_s * scheduler)$/;"	f
+child_task	kern/sys_fork.c	/^	struct task_s    *child_task;$/;"	m	struct:__anon34	typeref:struct:__anon34::task_s	file:
+child_thread	kern/sys_fork.c	/^	struct thread_s  *child_thread;$/;"	m	struct:__anon34	typeref:struct:__anon34::thread_s	file:
+children	kern/dqdt.h	/^	struct dqdt_cluster_s *children[4];$/;"	m	struct:dqdt_cluster_s	typeref:struct:dqdt_cluster_s::dqdt_cluster_s
+children	kern/radix.c	/^	void*			        children[64];     \/\/ pointers on children$/;"	m	struct:radix_node_s	file:
+children	kern/task.h	/^	struct list_entry children; $/;"	m	struct:task_s	typeref:struct:task_s::list_entry
+children_nr	kern/metafs.h	/^	uint_t children_nr;$/;"	m	struct:metafs_s
+childs_limit	kern/task.h	/^	uint16_t childs_limit;$/;"	m	struct:task_s
+childs_nr	kern/dqdt.h	/^	uint_t childs_nr;$/;"	m	struct:dqdt_cluster_s
+childs_nr	kern/task.h	/^	atomic_t childs_nr;$/;"	m	struct:task_s
+chip_id	kern/cluster.h	/^	uint16_t chip_id;$/;"	m	struct:cluster_s
+cid	kern/cluster.h	/^	uint_t cid;$/;"	m	struct:cluster_entry_s
+cid	kern/device.h	/^	uint_t cid;			  \/*! the cluster containing the device *\/$/;"	m	struct:device_s
+cid	kern/dqdt.h	/^	uint_t cid;$/;"	m	struct:dqdt_attr_s
+cid	kern/rpc.h	/^	cid_t cid;$/;"	m	struct:rpc_ptr_s
+cid	kern/task.h	/^        cid_t  cid;$/;"	m	struct:task_locator_s
+cid	kern/thread.h	/^	cid_t cid;$/;"	m	struct:__anon39
+cid	libk/arch-bib.h	/^	uint8_t cid;$/;"	m	struct:arch_bib_cluster_s
+cid	libk/utils.h	/^        cid_t cid;$/;"	m	struct:kernel_iter_s
+cid	mm/page.h	/^	uint32_t cid   : 12;$/;"	m	struct:page_s
+cid	vfs/vfs.h	/^	cid_t cid; gc_t gc; $/;"	m	struct:vfs_inode_ref_s
+cid_exec	kern/dqdt.h	/^        uint_t cid_exec;                \/* cid where the task is moved on exec() *\/$/;"	m	struct:dqdt_attr_s
+cid_exec	kern/sys_fork.c	/^        cid_t            cid_exec;$/;"	m	struct:__anon34	file:
+cid_t	libk/stdint.h	/^typedef uint16_t cid_t;$/;"	t
+ckey_t	kern/cluster.h	/^typedef struct cluster_key_s ckey_t;$/;"	t	typeref:struct:cluster_key_s
+clear_func	ksh/clear.c	/^error_t clear_func(void* param)$/;"	f
+clear_page_dirty	mm/mapper.h	/^	mapper_clear_page_dirty_t   *clear_page_dirty;$/;"	m	struct:mapper_op_s
+clock	kern/scheduler.h	/^	sched_clock_t       *clock;$/;"	m	struct:sched_ops_s
+clock_cntr	kern/rr-sched.c	/^	uint_t clock_cntr;$/;"	m	struct:rQueues_s	file:
+clock_cntr	kern/rr-sched_locked.c	/^	uint_t clock_cntr;$/;"	m	struct:rQueues_s	file:
+clock_t	libk/types.h	/^typedef uint64_t clock_t;$/;"	t
+close	fs/sysfs/sysfs.h	/^	sysfs_request_func_t *close;$/;"	m	struct:sysfs_op_s
+close	kern/driver.h	/^	device_request_t *close;$/;"	m	struct:dev_icu_op
+close	kern/driver.h	/^	device_request_t *close;$/;"	m	struct:dev_op
+close	vfs/vfs.h	/^	vfs_close_file_t *close;$/;"	m	struct:vfs_file_op_s
+clstr_nr	kern/cluster.h	/^	uint_t clstr_nr;$/;"	m	struct:cluster_s
+clstr_wram_nr	kern/cluster.h	/^	uint_t clstr_wram_nr;$/;"	m	struct:cluster_s
+cluster	arch/tsar/arch-pmm.h	/^	struct cluster_s *cluster;$/;"	m	struct:pmm_s	typeref:struct:pmm_s::cluster_s
+cluster	kern/barrier.h	/^	struct cluster_s *cluster;$/;"	m	struct:barrier_s	typeref:struct:barrier_s::cluster_s
+cluster	kern/cpu.h	/^	struct cluster_s *cluster;\/\/ to remove: always point to local cluster!?$/;"	m	struct:cpu_s	typeref:struct:cpu_s::cluster_s
+cluster	kern/task.h	/^	struct cluster_s *cluster;$/;"	m	struct:task_s	typeref:struct:task_s::cluster_s
+cluster	mm/pmm.h	/^	struct cluster_s *cluster;$/;"	m	struct:pmm_page_info_s	typeref:struct:pmm_page_info_s::cluster_s
+cluster_begin_lba	fs/fat32/fat32.h	/^	vfat_cluster_t cluster_begin_lba;$/;"	m	struct:vfat_context_s
+cluster_entry_init	kern/cluster.c	/^void cluster_entry_init(uint_t cid, uint_t addr_start, size_t size)$/;"	f
+cluster_entry_s	kern/cluster.h	/^struct cluster_entry_s$/;"	s
+cluster_get_cpus_nr	kern/cluster.h	/^#define cluster_get_cpus_nr(/;"	d
+cluster_get_cpus_nr	kern/cluster.h	/^#undef cluster_get_cpus_nr$/;"	d
+cluster_get_keyValue	kern/cluster.h	/^#define cluster_get_keyValue(/;"	d
+cluster_get_keyValue	kern/cluster.h	/^#undef cluster_get_keyValue$/;"	d
+cluster_in_kernel	kern/cluster.c	/^bool_t cluster_in_kernel(cid_t cid)$/;"	f
+cluster_info_t	arch/tsar/arch_init.c	/^typedef struct arch_bib_cluster_s cluster_info_t;$/;"	t	typeref:struct:arch_bib_cluster_s	file:
+cluster_init	kern/cluster.c	/^error_t cluster_init(struct boot_info_s *info,$/;"	f
+cluster_init_flag	kern/cluster.c	/^void cluster_init_flag(struct boot_info_s *info)$/;"	f
+cluster_key_s	kern/cluster.h	/^struct cluster_key_s$/;"	s
+cluster_manager	kern/cluster.c	/^struct cluster_s cluster_manager;\/\/TODO: align the field on a cache line$/;"	v	typeref:struct:cluster_s
+cluster_manager_thread	kern/cluster.c	/^void* cluster_manager_thread(void *arg)$/;"	f
+cluster_nr	libk/boot-info.h	/^	uint_t cluster_nr;$/;"	m	struct:boot_info_s
+cluster_periph	libk/boot-info.h	/^	uint_t cluster_periph;$/;"	m	struct:boot_info_s
+cluster_s	kern/cluster.h	/^struct cluster_s$/;"	s
+cluster_span	libk/boot-info.h	/^	uint_t cluster_span;$/;"	m	struct:boot_info_s
+cluster_wait_flag	kern/cluster.c	/^void cluster_wait_flag(struct boot_info_s *info)$/;"	f
+cluster_with_ram_nr	kern/cluster.c	/^uint_t cluster_with_ram_nr(struct boot_info_s *info)$/;"	f
+clusters_sysfs_register	kern/cluster.c	/^void clusters_sysfs_register(void)$/;"	f
+clusters_tbl	kern/cluster.c	/^struct cluster_entry_s clusters_tbl[CLUSTER_NR];$/;"	v	typeref:struct:cluster_entry_s
+cmd	ksh/miniShell.c	/^  ksh_cmd_t *cmd;$/;"	m	struct:ksh_builtin_s	file:
+cmdLineAnalyser	ksh/miniShellIo.c	/^void cmdLineAnalyser(ms_args_t *args)$/;"	f
+cmdline	cpu/i386/boot.c	/^	unsigned long cmdline;$/;"	m	struct:mb_partial_info_s	file:
+cntr	kern/blkio.h	/^		uint16_t            cntr;	        $/;"	m	struct:blkio_s::__anon7
+cntr	kern/mcs_sync.h	/^	cacheline_t cntr;$/;"	m	struct:mcs_barrier_s
+cntr	kern/mcs_sync.h	/^	cacheline_t cntr;$/;"	m	struct:mcs_lock_s
+cntr_irq_vector	drivers/soclib/soclib_xicu.c	/^	xicu_cntr_info_t cntr_irq_vector[XICU_CNTR_MAX];$/;"	m	struct:xicu_context_s	file:
+cntr_lock	drivers/soclib/soclib_xicu.c	/^	spinlock_t cntr_lock;$/;"	m	struct:xicu_context_s	file:
+code	cpu/mipsel/cpu_do_exception.c	/^	uint_t code;$/;"	m	struct:cpu_except_info_s	file:
+color_map	ksh/sgiImg.h	/^  uint32_t   color_map;$/;"	m	struct:sgi_info_s
+compare	vfs/vfs.h	/^	vfs_compare_dirent_t *compare;$/;"	m	struct:vfs_dirent_op_s
+compute_active_page	mm/kcm.c	/^page_info_t* compute_active_page(struct kcm_s *kcm)$/;"	f
+compute_args	kern/do_exec.c	/^error_t compute_args(struct task_s *task, $/;"	f
+compute_dec	libk/iprintk.c	/^static char* __attribute__((noinline)) compute_dec(char **addr,$/;"	f	file:
+compute_dec64	libk/iprintk.c	/^char* __attribute__((noinline)) compute_dec64(char **addr,$/;"	f
+compute_hex	libk/iprintk.c	/^static char* __attribute__((noinline)) compute_hex(char **addr, $/;"	f	file:
+cond1	kern/rr-sched.c	/^	uint8_t cond1;$/;"	m	struct:rQueues_s	file:
+cond1	kern/rr-sched_locked.c	/^	uint8_t cond1;$/;"	m	struct:rQueues_s	file:
+cond2	kern/rr-sched.c	/^	uint8_t cond2;$/;"	m	struct:rQueues_s	file:
+cond2	kern/rr-sched_locked.c	/^	uint8_t cond2;$/;"	m	struct:rQueues_s	file:
+cond3	kern/rr-sched.c	/^	uint8_t cond3;$/;"	m	struct:rQueues_s	file:
+cond3	kern/rr-sched_locked.c	/^	uint8_t cond3;$/;"	m	struct:rQueues_s	file:
+cond4	kern/rr-sched.c	/^	uint8_t cond4;$/;"	m	struct:rQueues_s	file:
+cond4	kern/rr-sched_locked.c	/^	uint8_t cond4;$/;"	m	struct:rQueues_s	file:
+container_of	libk/libk.h	/^#define container_of(/;"	d
+container_of	libk/utils.h	/^#define container_of(/;"	d
+copy_from_buff	kern/ku_transfert.h	/^		ku_copy_t *copy_from_buff;$/;"	m	union:ku_obj::__anon23
+copy_to_buff	kern/ku_transfert.h	/^		ku_copy_t *copy_to_buff;$/;"	m	union:ku_obj::__anon22
+cores_nr	kern/dqdt.h	/^	uint_t cores_nr;$/;"	m	struct:dqdt_cluster_s
+count	fs/sysfs/sysfs.h	/^	uint_t count;$/;"	m	struct:__anon3
+count	kern/barrier.h	/^	uint_t count;$/;"	m	struct:barrier_s
+count	kern/blkio.h	/^		uint16_t            count;	$/;"	m	struct:blkio_s::__anon7
+count	kern/driver.h	/^	uint32_t count;		$/;"	m	struct:dev_request_s
+count	kern/driver.h	/^	uint_t count;$/;"	m	struct:dev_params_s
+count	kern/event.h	/^	uint_t count;$/;"	m	struct:event_listner_s
+count	kern/event.h	/^	volatile uint_t count;$/;"	m	struct:event_list_s
+count	kern/radix.c	/^	uint_t		            count;$/;"	m	struct:radix_node_s	file:
+count	kern/rpc.h	/^	uint_t count;$/;"	m	struct:rpc_listner_s
+count	kern/rwlock.h	/^	sint_t count;$/;"	m	struct:rwlock_s
+count	kern/scheduler.h	/^	volatile uint_t count;      \/* runnables counter *\/$/;"	m	struct:sched_s
+count	kern/semaphore.h	/^	sint_t count;$/;"	m	struct:semaphore_s
+count	libk/md5.h	/^  uint32_t count[2];       \/* number of bits, modulo 2^64 (least sig word first) *\/$/;"	m	struct:__anon44
+count	mm/page.h	/^	refcount_t count;$/;"	m	struct:page_s
+cp_func	ksh/cp.c	/^error_t cp_func(void *param)$/;"	f
+cptr	vfs/vfs-private.h	/^	char **cptr;$/;"	m	struct:vfs_lookup_path_s
+cpu	kern/rr-sched.c	/^	struct cpu_s *cpu;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::cpu_s	file:
+cpu	kern/rr-sched_locked.c	/^	struct cpu_s *cpu;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::cpu_s	file:
+cpu	kern/sys_fork.c	/^	struct cpu_s     *cpu;$/;"	m	struct:__anon34	typeref:struct:__anon34::cpu_s	file:
+cpu	kern/task.h	/^	struct cpu_s *cpu;$/;"	m	struct:task_s	typeref:struct:task_s::cpu_s
+cpu_all_irq_disabled	cpu/mipsel/cpu-asm.h	/^static inline bool_t cpu_all_irq_disabled()$/;"	f
+cpu_atomic_add	cpu/i386/cpu-asm.h	/^static inline sint_t cpu_atomic_add(void *ptr, sint_t val)$/;"	f
+cpu_atomic_add	cpu/mipsel/cpu-asm.h	/^static inline sint_t cpu_atomic_add(void *ptr, sint_t val)$/;"	f
+cpu_atomic_cas	cpu/mipsel/cpu-asm.h	/^static inline bool_t cpu_atomic_cas(void *ptr, sint_t old, sint_t new)$/;"	f
+cpu_atomic_dec	cpu/i386/cpu-asm.h	/^static inline sint_t cpu_atomic_dec(void *ptr)$/;"	f
+cpu_atomic_dec	cpu/mipsel/cpu-asm.h	/^static inline sint_t cpu_atomic_dec(void *ptr)$/;"	f
+cpu_atomic_get	cpu/i386/cpu-asm.h	/^static inline sint_t cpu_atomic_get(void *ptr)$/;"	f
+cpu_atomic_get	cpu/mipsel/cpu-asm.h	/^static inline sint_t cpu_atomic_get(void *ptr)$/;"	f
+cpu_atomic_inc	cpu/i386/cpu-asm.h	/^static inline sint_t cpu_atomic_inc(void *ptr)$/;"	f
+cpu_atomic_inc	cpu/mipsel/cpu-asm.h	/^static inline sint_t cpu_atomic_inc(void *ptr)$/;"	f
+cpu_atomic_set	cpu/i386/cpu-asm.h	/^static inline sint_t cpu_atomic_set(void *ptr, sint_t new_val)$/;"	f
+cpu_check_sched	kern/cpu.h	/^#define cpu_check_sched(/;"	d
+cpu_clock	kern/cpu.c	/^void cpu_clock(struct cpu_s *cpu)$/;"	f
+cpu_compute_stats	kern/cpu.c	/^void cpu_compute_stats(struct cpu_s *cpu, sint_t threshold)$/;"	f
+cpu_context_destroy	cpu/i386/cpu-asm.h	/^inline void cpu_context_destroy(struct cpu_context_s *ctx)$/;"	f
+cpu_context_destroy	cpu/mipsel/cpu_context.c	/^inline void cpu_context_destroy(struct cpu_context_s *ctx)$/;"	f
+cpu_context_dup	cpu/i386/cpu-asm.h	/^static void cpu_context_dup(struct cpu_context_s *dest,$/;"	f
+cpu_context_dup_finlize	cpu/mipsel/cpu_context.c	/^inline void cpu_context_dup_finlize(struct cpu_context_s *dst, struct cpu_context_s *src)$/;"	f
+cpu_context_get_stackaddr	cpu/mipsel/cpu_context.c	/^inline uint_t cpu_context_get_stackaddr(struct cpu_context_s *ctx)$/;"	f
+cpu_context_init	cpu/i386/cpu-asm.h	/^static inline void cpu_context_init(struct cpu_context_s* ctx, struct cpu_context_attr_s *attr)$/;"	f
+cpu_context_init	cpu/mipsel/cpu_context.c	/^inline void cpu_context_init(struct cpu_context_s *ctx, struct thread_s *thread)$/;"	f
+cpu_context_load	cpu/i386/cpu_context.c	/^void cpu_context_load(struct cpu_context_s *ctx)$/;"	f
+cpu_context_load	cpu/mipsel/__cpu_context.S	/^cpu_context_load:$/;"	l
+cpu_context_restore	cpu/i386/__cpu_context.S	/^cpu_context_restore:$/;"	l
+cpu_context_restore	cpu/mipsel/__cpu_context.S	/^cpu_context_restore:$/;"	l
+cpu_context_s	cpu/i386/cpu-asm.h	/^struct cpu_context_s$/;"	s
+cpu_context_s	cpu/mipsel/cpu-asm.h	/^struct cpu_context_s$/;"	s
+cpu_context_save	cpu/i386/__cpu_context.S	/^cpu_context_save:$/;"	l
+cpu_context_save	cpu/mipsel/__cpu_context.S	/^cpu_context_save:$/;"	l
+cpu_context_set_pmm	cpu/mipsel/cpu_context.c	/^inline void cpu_context_set_pmm(struct cpu_context_s *ctx, struct pmm_s *pmm)$/;"	f
+cpu_context_set_sigreturn	cpu/mipsel/cpu_uzone.c	/^void cpu_context_set_sigreturn(struct cpu_context_s *ctx, void *sigreturn_func)$/;"	f
+cpu_context_set_stackaddr	cpu/mipsel/cpu_context.c	/^inline void cpu_context_set_stackaddr(struct cpu_context_s *ctx, reg_t addr)$/;"	f
+cpu_context_set_tid	cpu/mipsel/cpu_context.c	/^inline void cpu_context_set_tid(struct cpu_context_s *ctx, reg_t tid)$/;"	f
+cpu_copy_from_uspace	cpu/mipsel/__cpu_uspace.S	/^cpu_copy_from_uspace:$/;"	l
+cpu_copy_to_uspace	cpu/mipsel/__cpu_uspace.S	/^cpu_copy_to_uspace:$/;"	l
+cpu_current_thread	cpu/i386/cpu-asm.h	/^inline struct thread_s* cpu_current_thread (void)$/;"	f
+cpu_current_thread	cpu/mipsel/cpu-asm.h	/^static inline struct thread_s* cpu_current_thread (void)$/;"	f
+cpu_default_irq_handler	arch/tsar/arch.c	/^static void cpu_default_irq_handler(struct irq_action_s *action)$/;"	f	file:
+cpu_disable_all_irq	cpu/i386/cpu-asm.h	/^static inline void cpu_disable_all_irq (uint_t *old)$/;"	f
+cpu_disable_all_irq	cpu/mipsel/cpu-asm.h	/^static inline void cpu_disable_all_irq (uint_t *old)$/;"	f
+cpu_disable_single_irq	cpu/i386/cpu-asm.h	/^static inline void cpu_disable_single_irq (uint_t irq_num, uint_t *old)$/;"	f
+cpu_disable_single_irq	cpu/mipsel/cpu-asm.h	/^static inline void cpu_disable_single_irq (uint_t irq_num, uint_t *old)$/;"	f
+cpu_do_exception	cpu/mipsel/cpu_do_exception.c	/^void cpu_do_exception(struct thread_s *this, reg_t cpu_id, reg_t *regs_tbl)$/;"	f
+cpu_do_interrupt	cpu/mipsel/cpu_do_interrupt.c	/^void cpu_do_interrupt(struct thread_s *this, $/;"	f
+cpu_do_syscall	cpu/mipsel/cpu_do_syscall.c	/^struct thread_s* cpu_do_syscall(reg_t *regs_tbl)$/;"	f
+cpu_enable_all_irq	cpu/i386/cpu-asm.h	/^static inline void cpu_enable_all_irq (uint_t *old)$/;"	f
+cpu_enable_all_irq	cpu/mipsel/cpu-asm.h	/^static inline void cpu_enable_all_irq (uint_t *old)$/;"	f
+cpu_enable_single_irq	cpu/i386/cpu-asm.h	/^static inline void cpu_enable_single_irq(uint_t irq_num, uint_t *old)$/;"	f
+cpu_enable_single_irq	cpu/mipsel/cpu-asm.h	/^static inline void cpu_enable_single_irq(uint_t irq_num, uint_t *old)$/;"	f
+cpu_except_db	cpu/mipsel/cpu_do_exception.c	/^static cpu_except_info_t cpu_except_db[] = $/;"	v	file:
+cpu_except_get_entry	cpu/mipsel/cpu_do_exception.c	/^inline cpu_except_info_t* cpu_except_get_entry(uint_t excCode)$/;"	f
+cpu_except_info_s	cpu/mipsel/cpu_do_exception.c	/^struct cpu_except_info_s$/;"	s	file:
+cpu_except_info_t	cpu/mipsel/cpu_do_exception.c	/^typedef struct cpu_except_info_s cpu_except_info_t;$/;"	t	typeref:struct:cpu_except_info_s	file:
+cpu_fpu_context_restore	cpu/mipsel/__cpu_context.S	/^cpu_fpu_context_restore:$/;"	l
+cpu_fpu_context_save	cpu/mipsel/__cpu_context.S	/^cpu_fpu_context_save:$/;"	l
+cpu_fpu_disable	cpu/i386/cpu-asm.h	/^static inline void cpu_fpu_disable(void)$/;"	f
+cpu_fpu_disable	cpu/mipsel/cpu-asm.h	/^static inline void cpu_fpu_disable(void)$/;"	f
+cpu_fpu_enable	cpu/i386/cpu-asm.h	/^static inline void cpu_fpu_enable(void)$/;"	f
+cpu_fpu_enable	cpu/mipsel/cpu-asm.h	/^static inline void cpu_fpu_enable(void)$/;"	f
+cpu_gdt	cpu/i386/cpu_internal.c	/^struct cpu_gdt_entry_s cpu_gdt[GDT_ENTRIES_NR];$/;"	v	typeref:struct:cpu_gdt_entry_s
+cpu_gdt_entry_s	cpu/i386/cpu-internal.h	/^struct cpu_gdt_entry_s$/;"	s
+cpu_gdt_init	cpu/i386/cpu_internal.c	/^void cpu_gdt_init()$/;"	f
+cpu_gdt_ptr	cpu/i386/cpu_internal.c	/^struct cpu_gdt_ptr_s cpu_gdt_ptr __attribute__((aligned(8)));$/;"	v	typeref:struct:cpu_gdt_ptr_s
+cpu_gdt_ptr_s	cpu/i386/cpu-internal.h	/^struct cpu_gdt_ptr_s$/;"	s
+cpu_get_bad_vaddr	cpu/mipsel/cpu-asm.h	/^static inline uint_t cpu_get_bad_vaddr(void)$/;"	f
+cpu_get_cid	cpu/mipsel/cpu-asm.h	/^static inline cid_t cpu_get_cid(void)$/;"	f
+cpu_get_cycles	kern/cpu.h	/^static inline uint64_t cpu_get_cycles(struct cpu_s *cpu)$/;"	f
+cpu_get_gdt_entry	cpu/i386/cpu_internal.c	/^struct cpu_gdt_entry_s* cpu_get_gdt_entry(int entry)$/;"	f
+cpu_get_gdt_ptr	cpu/i386/cpu_internal.c	/^struct cpu_gdt_ptr_s* cpu_get_gdt_ptr(void)$/;"	f
+cpu_get_id	cpu/i386/cpu-asm.h	/^static inline uint_t cpu_get_id(void)$/;"	f
+cpu_get_id	cpu/mipsel/cpu-asm.h	/^static inline uint_t cpu_get_id(void)$/;"	f
+cpu_get_lid	cpu/mipsel/cpu-asm.h	/^static inline gid_t cpu_get_lid(void)$/;"	f
+cpu_get_ms	kern/cpu.c	/^uint_t cpu_get_ms(struct cpu_s *cpu)$/;"	f
+cpu_get_stack	cpu/i386/cpu-asm.h	/^static inline uint_t cpu_get_stack(void)$/;"	f
+cpu_get_stack	cpu/mipsel/cpu-asm.h	/^static inline uint_t cpu_get_stack(void)$/;"	f
+cpu_get_state	kern/cpu.h	/^#define cpu_get_state(/;"	d
+cpu_get_state	kern/cpu.h	/^#undef cpu_get_state$/;"	d
+cpu_get_thread_idle	kern/cpu.h	/^#define cpu_get_thread_idle(/;"	d
+cpu_get_thread_idle	kern/cpu.h	/^#undef cpu_get_thread_idle$/;"	d
+cpu_get_ticks	kern/cpu.h	/^#define cpu_get_ticks(/;"	d
+cpu_get_ticks	kern/cpu.h	/^#undef cpu_get_ticks$/;"	d
+cpu_get_ticks_period	kern/cpu.h	/^#define cpu_get_ticks_period(/;"	d
+cpu_get_ticks_period	kern/cpu.h	/^#undef cpu_get_ticks_period$/;"	d
+cpu_get_time	kern/cpu.c	/^void cpu_get_time(struct cpu_s *cpu, uint_t *tm_ms, uint_t* tm_us)$/;"	f
+cpu_get_tss	cpu/i386/cpu_internal.c	/^struct cpu_tss_s* cpu_get_tss(int cpu_id)$/;"	f
+cpu_gid	kern/thread.h	/^	sint_t cpu_gid;$/;"	m	struct:__anon39
+cpu_gid_tbl_init	arch/tsar/arch_init.c	/^inline void cpu_gid_tbl_init(struct boot_info_s *info)$/;"	f
+cpu_id	cpu/i386/cpu-asm.h	/^	reg_t cpu_id;$/;"	m	struct:cpu_context_s
+cpu_id	kern/dqdt.h	/^	uint_t cpu_id;\/\/local to cid$/;"	m	struct:dqdt_attr_s
+cpu_idt	cpu/i386/cpu_internal.c	/^struct cpu_idt_entry_s cpu_idt[IDT_ENTRIES_NR];$/;"	v	typeref:struct:cpu_idt_entry_s
+cpu_idt_entry_s	cpu/i386/cpu-internal.h	/^struct cpu_idt_entry_s$/;"	s
+cpu_idt_init	cpu/i386/cpu_internal.c	/^void cpu_idt_init()$/;"	f
+cpu_idt_ptr_s	cpu/i386/cpu-internal.h	/^struct cpu_idt_ptr_s$/;"	s
+cpu_in_kernel	kern/cpu.c	/^bool_t cpu_in_kernel(cid_t cid, gid_t lid)$/;"	f
+cpu_init	kern/cpu.c	/^error_t cpu_init(struct cpu_s *cpu, struct cluster_s *cluster, uint_t lid, uint_t gid)$/;"	f
+cpu_invalid_dcache_line	cpu/i386/cpu-asm.h	/^static inline void cpu_invalid_dcache_line(void *ptr)$/;"	f
+cpu_invalid_dcache_line	cpu/mipsel/cpu-asm.h	/^static inline void cpu_invalid_dcache_line(void *ptr)$/;"	f
+cpu_io_in16	cpu/i386/cpu-io.c	/^uint16_t cpu_io_in16(uint_t port)$/;"	f
+cpu_io_in32	cpu/i386/cpu-io.c	/^uint32_t cpu_io_in32(uint_t port)$/;"	f
+cpu_io_in8	cpu/i386/cpu-io.c	/^uint8_t cpu_io_in8(uint_t port)$/;"	f
+cpu_io_out16	cpu/i386/cpu-io.c	/^void cpu_io_out16(uint_t port, uint16_t value)$/;"	f
+cpu_io_out32	cpu/i386/cpu-io.c	/^void cpu_io_out32(uint_t port, uint32_t value)$/;"	f
+cpu_io_out8	cpu/i386/cpu-io.c	/^void cpu_io_out8(uint_t port, uint8_t value)$/;"	f
+cpu_ipi_notify	kern/cpu.c	/^void cpu_ipi_notify(struct cpu_s *cpu, uint32_t ipi_val)$/;"	f
+cpu_isBad_addr	cpu/i386/cpu-asm.h	/^static inline bool_t cpu_isBad_addr(void *addr)$/;"	f
+cpu_isBad_addr	cpu/mipsel/cpu-asm.h	/^static inline bool_t cpu_isBad_addr(void *addr)$/;"	f
+cpu_kentry	kern/cpu.c	/^void cpu_kentry(uint_t cpu_lid, struct thread_s *this)$/;"	f
+cpu_kexit	kern/cpu.c	/^void cpu_kexit(uint_t cpu_lid, struct thread_s *this)$/;"	f
+cpu_last_check	kern/thread.h	/^	uint_t cpu_last_check;        \/*! skip check once on two *\/$/;"	m	struct:thread_s
+cpu_lid	kern/thread.h	/^	sint_t cpu_lid;$/;"	m	struct:__anon39
+cpu_lid2ptr	kern/cpu.c	/^inline struct cpu_s* cpu_lid2ptr(uint_t lid)$/;"	f
+cpu_load_word	cpu/mipsel/cpu-asm.h	/^static inline uint_t cpu_load_word(void *ptr)$/;"	f
+cpu_log_msg	kern/kdmsg.h	/^#define cpu_log_msg(/;"	d
+cpu_mbarrier	kern/kfifo.c	/^#define cpu_mbarrier /;"	d	file:
+cpu_mbarrier	kern/remote_fifo.c	/^#define cpu_mbarrier /;"	d	file:
+cpu_nr	kern/cluster.h	/^	uint_t cpu_nr;$/;"	m	struct:cluster_s
+cpu_nr	libk/arch-bib.h	/^	uint32_t   cpu_nr;		\/* Boot Frozen Order *\/ \/\/local_cpu_nr!$/;"	m	struct:arch_bib_header_s
+cpu_nr	libk/arch-bib.h	/^	uint8_t  cpu_nr;$/;"	m	struct:arch_bib_cluster_s
+cpu_owner	kern/mcs_sync.h	/^	cpu_t cpu_owner;$/;"	m	struct:mcs_lock_s
+cpu_power_idle	cpu/mipsel/cpu-asm.h	/^static inline void cpu_power_idle(void)$/;"	f
+cpu_rdbar	cpu/mipsel/cpu-asm.h	/^static inline void cpu_rdbar(void)$/;"	f
+cpu_regs_s	cpu/i386/cpu-internal.h	/^struct cpu_regs_s$/;"	s
+cpu_remote_atomic_add	cpu/mipsel/cpu-remote.h	/^static inline sint_t cpu_remote_atomic_add(void *ptr, cid_t cid, sint_t val)$/;"	f
+cpu_remote_atomic_cas	cpu/mipsel/cpu-remote.h	/^static inline bool_t cpu_remote_atomic_cas(void *ptr, uint_t cid, $/;"	f
+cpu_remote_atomic_try_add	cpu/mipsel/cpu-remote.h	/^static inline error_t cpu_remote_atomic_try_add$/;"	f
+cpu_remote_lb	cpu/mipsel/cpu-remote.h	/^static inline uint_t cpu_remote_lb(void* addr, uint_t cid)$/;"	f
+cpu_remote_lw	cpu/mipsel/cpu-remote.h	/^static inline uint_t cpu_remote_lw(void* addr, uint_t cid)$/;"	f
+cpu_remote_lw_unc	cpu/mipsel/cpu-remote.h	/^static inline uint_t cpu_remote_lw_unc(void* addr, uint_t cid)$/;"	f
+cpu_remote_memcpy	cpu/mipsel/cpu-remote.h	/^static inline void cpu_remote_memcpy(void* dest, uint_t dcid, $/;"	f
+cpu_remote_sb	cpu/mipsel/cpu-remote.h	/^static inline void cpu_remote_sb(void* addr, uint_t cid, char val)$/;"	f
+cpu_remote_sw	cpu/mipsel/cpu-remote.h	/^static inline void cpu_remote_sw(void* addr, uint_t cid, uint_t val)$/;"	f
+cpu_restore_irq	cpu/i386/cpu-asm.h	/^static inline void cpu_restore_irq(uint_t old)$/;"	f
+cpu_restore_irq	cpu/mipsel/cpu-asm.h	/^static inline void cpu_restore_irq(uint_t old)$/;"	f
+cpu_s	kern/cpu.h	/^struct cpu_s$/;"	s
+cpu_set_current_thread	cpu/i386/cpu-asm.h	/^static inline void cpu_set_current_thread (struct thread_s *thread)$/;"	f
+cpu_set_current_thread	cpu/mipsel/cpu-asm.h	/^static inline void cpu_set_current_thread (struct thread_s *thread)$/;"	f
+cpu_set_stack	cpu/i386/cpu-asm.h	/^static inline uint_t cpu_set_stack(void* val)$/;"	f
+cpu_set_stack	cpu/mipsel/cpu-asm.h	/^static inline uint_t cpu_set_stack(void* new_val)$/;"	f
+cpu_set_state	kern/cpu.h	/^#define cpu_set_state(/;"	d
+cpu_set_state	kern/cpu.h	/^#undef cpu_set_state$/;"	d
+cpu_set_thread_idle	kern/cpu.h	/^#define cpu_set_thread_idle(/;"	d
+cpu_set_thread_idle	kern/cpu.h	/^#undef cpu_set_thread_idle$/;"	d
+cpu_set_utls	cpu/i386/cpu_internal.c	/^void cpu_set_utls(uint_t addr)$/;"	f
+cpu_signal_notify	cpu/mipsel/cpu_uzone.c	/^void cpu_signal_notify(struct thread_s *this, void *handler, uint_t sig)$/;"	f
+cpu_spinlock_destroy	cpu/i386/cpu-asm.h	/^static inline void cpu_spinlock_destroy(void *lock)$/;"	f
+cpu_spinlock_destroy	cpu/mipsel/cpu-asm.h	/^static inline void cpu_spinlock_destroy(void *lock)$/;"	f
+cpu_spinlock_init	cpu/i386/cpu-asm.h	/^static inline void cpu_spinlock_init(void *lock, uint_t val)$/;"	f
+cpu_spinlock_init	cpu/mipsel/cpu-asm.h	/^static inline void cpu_spinlock_init(void *lock, uint_t val)$/;"	f
+cpu_spinlock_lock	cpu/i386/cpu-asm.h	/^static inline void cpu_spinlock_lock(void *lock)$/;"	f
+cpu_spinlock_lock	cpu/mipsel/cpu-asm.h	/^static inline void cpu_spinlock_lock(void *lock)$/;"	f
+cpu_spinlock_trylock	cpu/i386/cpu-asm.h	/^static inline bool_t cpu_spinlock_trylock (void *lock)$/;"	f
+cpu_spinlock_trylock	cpu/mipsel/cpu-asm.h	/^static inline bool_t cpu_spinlock_trylock (void *lock)$/;"	f
+cpu_spinlock_unlock	cpu/i386/cpu-asm.h	/^static inline void cpu_spinlock_unlock (void *lock)$/;"	f
+cpu_spinlock_unlock	cpu/mipsel/cpu-asm.h	/^static inline void cpu_spinlock_unlock (void *lock)$/;"	f
+cpu_sysfs_op_init	kern/cpu.c	/^static void cpu_sysfs_op_init(sysfs_op_t *op)$/;"	f	file:
+cpu_sysfs_read_op	kern/cpu.c	/^static error_t cpu_sysfs_read_op(sysfs_entry_t *entry, sysfs_request_t *rq, uint_t *offset)$/;"	f	file:
+cpu_tbl	kern/cluster.h	/^	struct cpu_s cpu_tbl[CPU_PER_CLUSTER];$/;"	m	struct:cluster_s	typeref:struct:cluster_s::cpu_s
+cpu_time_reset	kern/cpu.c	/^void cpu_time_reset(struct cpu_s *cpu)$/;"	f
+cpu_time_s	kern/cpu.h	/^struct cpu_time_s$/;"	s
+cpu_time_stamp	cpu/i386/cpu-asm.h	/^static inline uint_t cpu_time_stamp(void)$/;"	f
+cpu_time_stamp	cpu/mipsel/cpu-asm.h	/^static inline uint_t cpu_time_stamp(void)$/;"	f
+cpu_time_update	kern/cpu.c	/^static void cpu_time_update(struct cpu_s *cpu)$/;"	f	file:
+cpu_trace_dump	kern/cpu-trace.h	/^static inline void cpu_trace_dump(struct cpu_s *cpu)$/;"	f
+cpu_trace_info_s	kern/cpu-trace.h	/^typedef struct cpu_trace_info_s$/;"	s
+cpu_trace_info_t	kern/cpu-trace.h	/^}cpu_trace_info_t;$/;"	t	typeref:struct:cpu_trace_info_s
+cpu_trace_recorder_0	kern/cpu.c	/^struct cpu_trace_recorder_s cpu_trace_recorder_0 = { 0 };$/;"	v	typeref:struct:cpu_trace_recorder_s
+cpu_trace_recorder_1	kern/cpu.c	/^struct cpu_trace_recorder_s cpu_trace_recorder_1 = { 0 };$/;"	v	typeref:struct:cpu_trace_recorder_s
+cpu_trace_recorder_2	kern/cpu.c	/^struct cpu_trace_recorder_s cpu_trace_recorder_2 = { 0 };$/;"	v	typeref:struct:cpu_trace_recorder_s
+cpu_trace_recorder_3	kern/cpu.c	/^struct cpu_trace_recorder_s cpu_trace_recorder_3 = { 0 };$/;"	v	typeref:struct:cpu_trace_recorder_s
+cpu_trace_recorder_s	kern/cpu-trace.h	/^struct cpu_trace_recorder_s$/;"	s
+cpu_trace_write	kern/cpu-trace.h	/^#define cpu_trace_write(/;"	d
+cpu_trace_write	kern/cpu-trace.h	/^#undef  cpu_trace_write$/;"	d
+cpu_tss_s	cpu/i386/cpu-internal.h	/^struct cpu_tss_s$/;"	s
+cpu_tss_tbl	cpu/i386/cpu_internal.c	/^struct cpu_tss_s cpu_tss_tbl[CPU_NR] __attribute__((aligned(8)));$/;"	v	typeref:struct:cpu_tss_s
+cpu_uncached_read	cpu/mipsel/cpu-asm.h	/^static inline uint_t cpu_uncached_read(void *ptr)$/;"	f
+cpu_uspace_error	cpu/mipsel/__cpu_uspace.S	/^cpu_uspace_error:$/;"	l
+cpu_uspace_strlen	cpu/mipsel/__cpu_uspace.S	/^cpu_uspace_strlen:$/;"	l
+cpu_uzone_attr_s	kern/hal-cpu.h	/^struct cpu_uzone_attr_s$/;"	s
+cpu_uzone_destroy	cpu/mipsel/cpu_uzone.c	/^void cpu_uzone_destroy(struct cpu_uzone_s *uzone)$/;"	f
+cpu_uzone_dup	cpu/mipsel/cpu_uzone.c	/^void cpu_uzone_dup(struct cpu_uzone_s *dst, struct cpu_uzone_s *src)$/;"	f
+cpu_uzone_getattr	cpu/mipsel/cpu_uzone.c	/^error_t cpu_uzone_getattr(struct cpu_uzone_s *uzone, struct cpu_uzone_attr_s *attr)$/;"	f
+cpu_uzone_init	cpu/mipsel/cpu_uzone.c	/^void cpu_uzone_init(struct cpu_uzone_s *uzone)$/;"	f
+cpu_uzone_s	cpu/mipsel/cpu-asm.h	/^struct cpu_uzone_s$/;"	s
+cpu_uzone_setattr	cpu/mipsel/cpu_uzone.c	/^error_t cpu_uzone_setattr(struct cpu_uzone_s *uzone, struct cpu_uzone_attr_s *attr)$/;"	f
+cpu_wait	cpu/mipsel/cpu-asm.h	/^static inline void cpu_wait(uint_t val)$/;"	f
+cpu_wbflush	cpu/mipsel/cpu-asm.h	/^static inline void cpu_wbflush(void)$/;"	f
+cpu_yield	kern/cpu.c	/^inline bool_t cpu_yield()$/;"	f
+cpus_in_kernel	kern/cluster.c	/^uint32_t cpus_in_kernel[CPU_PER_CLUSTER];$/;"	v
+cr3	cpu/i386/cpu-asm.h	/^	reg_t eip,cr3;$/;"	m	struct:cpu_context_s
+cr3_pdbr	cpu/i386/cpu-internal.h	/^	uint32_t cr3_pdbr;		\/* 7 *\/$/;"	m	struct:cpu_tss_s
+create	vfs/vfs.h	/^	vfs_create_context_t *create;$/;"	m	struct:vfs_context_op_s
+create	vfs/vfs.h	/^	vfs_create_inode_t *create;$/;"	m	struct:vfs_inode_op_s
+create_node	kern/radix.c	/^static int create_node(struct radix_node_s* node, int index)$/;"	f	file:
+cs	cpu/i386/cpu-internal.h	/^	uint16_t cs, reserved_5;	\/* 19 *\/$/;"	m	struct:cpu_tss_s
+ctor	mm/kmem.h	/^  kcm_init_destroy_t *ctor;$/;"	m	struct:kmem_objattr_s
+ctx	fs/devfs/devfs-private.h	/^	struct devfs_context_s *ctx;$/;"	m	struct:devfs_file_s	typeref:struct:devfs_file_s::devfs_context_s
+ctx	fs/fat32/fat32-private.h	/^	struct vfat_context_s *ctx;$/;"	m	struct:vfat_entry_request_s	typeref:struct:vfat_entry_request_s::vfat_context_s
+ctx	fs/fat32/fat32_mapper.c	/^	struct vfat_context_s *ctx;$/;"	m	struct:vfat_file_s	typeref:struct:vfat_file_s::vfat_context_s	file:
+ctx	vfs/vfs.c	/^	struct vfs_context_s *ctx;$/;"	m	struct:__vfs_open_s	typeref:struct:__vfs_open_s::vfs_context_s	file:
+ctx	vfs/vfs.h	/^	struct vfs_context_s *ctx;$/;"	m	struct:vfs_icreate_s	typeref:struct:vfs_icreate_s::vfs_context_s
+ctx	vfs/vfs.h	/^	struct vfs_context_s *ctx;$/;"	m	struct:vfs_lookup_response_s	typeref:struct:vfs_lookup_response_s::vfs_context_s
+ctx	vfs/vfs_cache.c	/^	struct vfs_context_s *ctx;$/;"	m	struct:icache_key	typeref:struct:icache_key::vfs_context_s	file:
+ctx_blksize	vfs/vfs.h	/^	uint32_t ctx_blksize;$/;"	m	struct:vfs_context_s
+ctx_count	vfs/vfs.h	/^	atomic_t ctx_count;$/;"	m	struct:vfs_context_s
+ctx_dev	vfs/vfs.h	/^	struct device_s *ctx_dev;$/;"	m	struct:vfs_context_s	typeref:struct:vfs_context_s::device_s
+ctx_devfs	vfs/vfs.h	/^		struct devfs_context_s ctx_devfs;$/;"	m	union:vfs_context_s::__anon54	typeref:struct:vfs_context_s::__anon54::devfs_context_s
+ctx_dirent_op	vfs/vfs.h	/^	struct vfs_dirent_op_s *ctx_dirent_op;$/;"	m	struct:vfs_context_s	typeref:struct:vfs_context_s::vfs_dirent_op_s
+ctx_file_op	vfs/vfs.h	/^	struct vfs_file_op_s *ctx_file_op;$/;"	m	struct:vfs_context_s	typeref:struct:vfs_context_s::vfs_file_op_s
+ctx_flags	vfs/vfs.h	/^	uint_t	ctx_flags;$/;"	m	struct:vfs_context_s
+ctx_inode_op	vfs/vfs.h	/^	struct vfs_inode_op_s *ctx_inode_op;$/;"	m	struct:vfs_context_s	typeref:struct:vfs_context_s::vfs_inode_op_s
+ctx_inum_count	vfs/vfs.h	/^	atomic_t ctx_inum_count; \/* default inum allocator *\/$/;"	m	struct:vfs_context_s
+ctx_op	vfs/vfs.h	/^	struct vfs_context_op_s *ctx_op;$/;"	m	struct:vfs_context_s	typeref:struct:vfs_context_s::vfs_context_op_s
+ctx_root	vfs/vfs.h	/^	struct vfs_inode_ref_s ctx_root;$/;"	m	struct:vfs_context_s	typeref:struct:vfs_context_s::vfs_inode_ref_s
+ctx_sysfs	vfs/vfs.h	/^		struct sysfs_context_s ctx_sysfs;$/;"	m	union:vfs_context_s::__anon54	typeref:struct:vfs_context_s::__anon54::sysfs_context_s
+ctx_type	vfs/vfs.h	/^	uint_t	ctx_type;$/;"	m	struct:vfs_context_s
+ctx_vfat	vfs/vfs.h	/^		struct vfat_context_s ctx_vfat;$/;"	m	union:vfs_context_s::__anon54	typeref:struct:vfs_context_s::__anon54::vfat_context_s
+current	kern/metafs.h	/^	struct metafs_s *current;$/;"	m	struct:metafs_iter_s	typeref:struct:metafs_iter_s::metafs_s
+current	kern/task.h	/^        uint_t current;$/;"	m	struct:fd_info_s
+current	mm/heap_manager.h	/^	uint_t current;$/;"	m	struct:heap_manager_s
+current	vfs/vfs.h	/^	struct vfs_inode_ref_s current;$/;"	m	struct:vfs_lookup_s	typeref:struct:vfs_lookup_s::vfs_inode_ref_s
+current_cid	kern/thread.h	/^#define current_cid	/;"	d
+current_cid	kern/thread.h	/^#define current_cid$/;"	d
+current_cid	kern/thread.h	/^#undef current_cid$/;"	d
+current_clstr	kern/sys_fork.c	/^        struct cluster_s *current_clstr;$/;"	m	struct:__anon34	typeref:struct:__anon34::cluster_s	file:
+current_clstr	kern/task.h	/^	struct cluster_s *current_clstr;$/;"	m	struct:task_s	typeref:struct:task_s::cluster_s
+current_cluster	kern/thread.h	/^#define current_cluster /;"	d
+current_cluster	kern/thread.h	/^#define current_cluster$/;"	d
+current_cluster	kern/thread.h	/^#undef current_cluster$/;"	d
+current_cpu	kern/thread.h	/^#define current_cpu /;"	d
+current_cpu	kern/thread.h	/^#define current_cpu$/;"	d
+current_cpu	kern/thread.h	/^#undef current_cpu$/;"	d
+current_ecid	kern/thread.h	/^#define current_ecid	/;"	d
+current_ecid	kern/thread.h	/^#define current_ecid$/;"	d
+current_ecid	kern/thread.h	/^#undef current_ecid$/;"	d
+current_egid	kern/thread.h	/^#define current_egid	/;"	d
+current_egid	kern/thread.h	/^#define current_egid$/;"	d
+current_egid	kern/thread.h	/^#undef current_egid$/;"	d
+current_index	fs/sysfs/sysfs-private.h	/^	uint_t current_index;$/;"	m	struct:sysfs_file_s
+current_index	kern/cpu-trace.h	/^	uint_t current_index;$/;"	m	struct:cpu_trace_recorder_s
+current_index	mm/kcm.c	/^	uint8_t current_index;$/;"	m	struct:page_info_s	file:
+current_local_cpu_id	kern/dqdt.c	/^uint_t current_local_cpu_id;$/;"	v
+current_task	kern/thread.h	/^#define current_task /;"	d
+current_task	kern/thread.h	/^#define current_task$/;"	d
+current_task	kern/thread.h	/^#undef current_task$/;"	d
+current_thread	kern/thread.h	/^#define current_thread /;"	d
+current_thread	kern/thread.h	/^#define current_thread$/;"	d
+current_thread	kern/thread.h	/^#undef current_thread$/;"	d
+cv_broadcast	kern/cond_var.c	/^error_t cv_broadcast(struct cv_s *cv)$/;"	f
+cv_destroy	kern/cond_var.c	/^error_t cv_destroy(struct cv_s *cv)$/;"	f
+cv_init	kern/cond_var.c	/^error_t cv_init(struct cv_s *cv)$/;"	f
+cv_kmem_init	kern/cond_var.h	/^KMEM_OBJATTR_INIT(cv_kmem_init);$/;"	v
+cv_operation_t	kern/cond_var.h	/^} cv_operation_t;$/;"	t	typeref:enum:__anon8
+cv_s	kern/cond_var.h	/^struct cv_s$/;"	s
+cv_signal	kern/cond_var.c	/^error_t cv_signal(struct cv_s *cv)$/;"	f
+cv_wait	kern/cond_var.c	/^error_t cv_wait(struct cv_s *cv, struct semaphore_s *sem)$/;"	f
+cwd_lock	kern/task.h	/^	struct rwlock_s cwd_lock;$/;"	m	struct:task_s	typeref:struct:task_s::rwlock_s
+cycles	kern/cpu.h	/^	uint64_t cycles;$/;"	m	struct:cpu_time_s
+d_attr	kern/dqdt.h	/^	uint_t d_attr;$/;"	m	struct:dqdt_attr_s
+d_attr	vfs/vfs.h	/^	uint_t d_attr;\/\/or i_attr$/;"	m	struct:vfs_dirent_s
+d_count	vfs/vfs.h	/^	uint_t d_count;$/;"	m	struct:vfs_dirent_s
+d_ctx	vfs/vfs.h	/^	struct vfs_context_s *d_ctx;$/;"	m	struct:vfs_dirent_s	typeref:struct:vfs_dirent_s::vfs_context_s
+d_freelist	vfs/vfs.h	/^	struct list_entry  d_freelist;$/;"	m	struct:vfs_dirent_s	typeref:struct:vfs_dirent_s::list_entry
+d_inode	vfs/vfs.h	/^	struct vfs_inode_ref_s d_inode;$/;"	m	struct:vfs_dirent_s	typeref:struct:vfs_dirent_s::vfs_inode_ref_s
+d_inum	vfs/vfs.h	/^	uint_t d_inum;$/;"	m	struct:vfs_dirent_s
+d_meta	vfs/vfs.h	/^	struct metafs_s d_meta;\/\/allow a search by name$/;"	m	struct:vfs_dirent_s	typeref:struct:vfs_dirent_s::metafs_s
+d_mounted	vfs/vfs.h	/^	struct vfs_context_s *d_mounted;\/\/mounted fs context$/;"	m	struct:vfs_dirent_s	typeref:struct:vfs_dirent_s::vfs_context_s
+d_name	vfs/vfs.h	/^	char d_name[VFS_MAX_NAME_LENGTH];$/;"	m	struct:vfs_dirent_s
+d_op	vfs/vfs.h	/^	struct vfs_dirent_op_s *d_op;$/;"	m	struct:vfs_dirent_s	typeref:struct:vfs_dirent_s::vfs_dirent_op_s
+d_parent	vfs/vfs.h	/^	struct vfs_inode_s *d_parent;\/\/always in same cluster as this dirent, holding the dirent make the parent stable$/;"	m	struct:vfs_dirent_s	typeref:struct:vfs_dirent_s::vfs_inode_s
+d_state	vfs/vfs.h	/^	uint_t d_state;\/\/VFS_INLOAD ...$/;"	m	struct:vfs_dirent_s
+d_vfat	vfs/vfs.h	/^		struct vfat_dirent_s d_vfat;$/;"	m	union:vfs_dirent_s::__anon53	typeref:struct:vfs_dirent_s::__anon53::vfat_dirent_s
+data	fs/sysfs/sysfs.h	/^	void *data;$/;"	m	struct:__anon3
+data	kern/device.h	/^	void *data;                       \/*! pointer to an eventual ISR private data *\/$/;"	m	struct:irq_action_s
+data	kern/device.h	/^	void *data;                       \/*! pointer to an eventual driver's private data *\/$/;"	m	struct:device_s
+data	kern/dqdt.h	/^	void *data;$/;"	m	struct:dqdt_attr_s
+data	kern/driver.h	/^	void *data;$/;"	m	struct:dev_request_s
+data	kern/event.h	/^	void *data;$/;"	m	struct:event_s
+data	kern/mwmr.c	/^	char *data;$/;"	m	struct:fifomwmr_s	file:
+data	kern/scheduler.h	/^	void *data;$/;"	m	struct:sched_s
+data	libk/boot-info.h	/^	void *data;$/;"	m	struct:boot_info_s
+data	mm/page.h	/^		void *data;$/;"	m	union:page_s::__anon49
+data	mm/pmm.h	/^	void *data;$/;"	m	struct:pmm_page_info_s
+data_end	libk/boot-info.h	/^	uint_t data_end;$/;"	m	struct:boot_info_s
+data_end	libk/boot-info.h	/^	uint_t data_end;\/*5*\/$/;"	m	struct:kernel_info_s
+data_end	mm/vmm.h	/^	uint_t data_end;$/;"	m	struct:vmm_s
+data_offset	mm/mapper.h	/^	size_t data_offset;$/;"	m	struct:mapper_buff_s
+data_start	libk/boot-info.h	/^	uint_t data_start;$/;"	m	struct:boot_info_s
+data_start	libk/boot-info.h	/^	uint_t data_start;\/*4*\/$/;"	m	struct:kernel_info_s
+data_start	mm/vmm.h	/^	uint_t data_start;$/;"	m	struct:vmm_s
+db	fs/devfs/devfs.h	/^	struct metafs_s *db;$/;"	m	struct:devfs_context_s	typeref:struct:devfs_context_s::metafs_s
+db	kern/scheduler.h	/^	struct sched_db_s *db;$/;"	m	struct:scheduler_s	typeref:struct:scheduler_s::sched_db_s
+default_gsize	kern/ku_transfert.c	/^uint_t default_gsize(struct ku_obj *kuo)$/;"	f
+desc	cpu/mipsel/cpu_do_exception.c	/^	char *desc;$/;"	m	struct:cpu_except_info_s	file:
+destroy	kern/driver.h	/^	device_action_t *destroy;$/;"	m	struct:driver_s
+destroy	vfs/vfs.h	/^	vfs_destroy_context_t *destroy;$/;"	m	struct:vfs_context_op_s
+dev	fs/devfs/devfs-private.h	/^	struct device_s *dev;$/;"	m	struct:devfs_file_s	typeref:struct:devfs_file_s::device_s
+dev	fs/fat32/fat32.h	/^	struct device_s *dev;$/;"	m	struct:vfat_context_s	typeref:struct:vfat_context_s::device_s
+dev	kern/device.h	/^	struct device_s *dev;             \/*! device identifier *\/$/;"	m	struct:irq_action_s	typeref:struct:irq_action_s::device_s
+dev	kern/driver.h	/^		struct dev_op       dev;$/;"	m	union:driver_s::__anon12	typeref:struct:driver_s::__anon12::dev_op
+dev	vfs/vfs.h	/^	void* dev;$/;"	m	union:vfs_file_private_s
+dev_icu_op	kern/driver.h	/^struct dev_icu_op$/;"	s
+dev_info_t	arch/tsar/arch_init.c	/^typedef struct arch_bib_device_s  dev_info_t;$/;"	t	typeref:struct:arch_bib_device_s	file:
+dev_iopic_op	kern/driver.h	/^struct dev_iopic_op$/;"	s
+dev_nr	libk/arch-bib.h	/^	uint8_t  dev_nr;$/;"	m	struct:arch_bib_cluster_s
+dev_op	kern/driver.h	/^struct dev_op$/;"	s
+dev_params_s	kern/driver.h	/^typedef struct dev_params_s$/;"	s
+dev_params_t	kern/driver.h	/^}dev_params_t;$/;"	t	typeref:struct:dev_params_s
+dev_request_s	kern/driver.h	/^typedef struct dev_request_s$/;"	s
+dev_request_t	kern/driver.h	/^}dev_request_t;$/;"	t	typeref:struct:dev_request_s
+dev_timer_op	kern/driver.h	/^struct dev_timer_op$/;"	s
+dev_type_t	kern/device.h	/^} dev_type_t;$/;"	t	typeref:enum:__anon10
+devfs_context_s	fs/devfs/devfs.h	/^struct devfs_context_s$/;"	s
+devfs_ctx_op	fs/devfs/devfs_context.c	/^const struct vfs_context_op_s devfs_ctx_op = $/;"	v	typeref:struct:vfs_context_op_s
+devfs_db	fs/devfs/devfs_context.c	/^struct devfs_db_s devfs_db;$/;"	v	typeref:struct:devfs_db_s
+devfs_db_s	fs/devfs/devfs-private.h	/^struct devfs_db_s$/;"	s
+devfs_dmsg	kern/kdmsg.h	/^#define devfs_dmsg(/;"	d
+devfs_f_op	fs/devfs/devfs-private.h	/^const struct vfs_file_op_s devfs_f_op;$/;"	v	typeref:struct:vfs_file_op_s
+devfs_f_op	fs/devfs/devfs_file.c	/^const struct vfs_file_op_s devfs_f_op = $/;"	v	typeref:struct:vfs_file_op_s
+devfs_file_s	fs/devfs/devfs-private.h	/^struct devfs_file_s$/;"	s
+devfs_i_op	fs/devfs/devfs-private.h	/^const struct vfs_inode_op_s devfs_i_op;$/;"	v	typeref:struct:vfs_inode_op_s
+devfs_i_op	fs/devfs/devfs_node.c	/^const struct vfs_inode_op_s devfs_i_op = $/;"	v	typeref:struct:vfs_inode_op_s
+devfs_inode_create	fs/devfs/devfs_node.c	/^error_t devfs_inode_create(struct vfs_dirent_s *dirent, $/;"	f
+devfs_kmem_context_init	fs/devfs/devfs.h	/^KMEM_OBJATTR_INIT(devfs_kmem_context_init);$/;"	v
+devfs_kmem_file_init	fs/devfs/devfs.h	/^KMEM_OBJATTR_INIT(devfs_kmem_file_init);$/;"	v
+devfs_register	fs/devfs/devfs_context.c	/^void devfs_register(struct device_s *dev)$/;"	f
+devfs_root_init	fs/devfs/devfs_context.c	/^void devfs_root_init(void)$/;"	f
+device_action_t	kern/driver.h	/^typedef error_t (device_action_t)(struct device_s *dev, uint_t flags);$/;"	t
+device_alloc	kern/device.c	/^struct device_s *device_alloc()$/;"	f
+device_init_t	kern/driver.h	/^typedef error_t (device_init_t)(struct device_s *dev);$/;"	t
+device_params_t	kern/driver.h	/^typedef sint_t (device_params_t)(struct device_s *dev, dev_params_t *params);$/;"	t
+device_request_t	kern/driver.h	/^typedef sint_t (device_request_t)(struct device_s *dev, dev_request_t *rq);$/;"	t
+device_s	kern/device.h	/^struct device_s$/;"	s
+devices_tbl	kern/device.c	/^struct device_s devices_tbl[DEVICE_NR];$/;"	v	typeref:struct:device_s
+devlist	kern/cluster.h	/^	struct list_entry devlist;$/;"	m	struct:cluster_entry_s	typeref:struct:cluster_entry_s::list_entry
+devreg_addr	mm/vmm.h	/^	uint_t devreg_addr;$/;"	m	struct:vmm_s
+die	arch/tsar/arch_init.c	/^#define die(/;"	d	file:
+die	kern/kern_init.c	/^#define die(/;"	d	file:
+dimension	ksh/sgiImg.h	/^  uint16_t   dimension;$/;"	m	struct:sgi_info_s
+dirent	ksh/ls.c	/^static struct vfs_dirent_s dirent ;$/;"	v	typeref:struct:vfs_dirent_s	file:
+dirent	vfs/vfs.h	/^	struct vfs_dirent_s *dirent;$/;"	m	struct:vfs_icreate_s	typeref:struct:vfs_icreate_s::vfs_dirent_s
+dirent_freelist	vfs/vfs_cache.c	/^struct vfs_freelist_s dirent_freelist;$/;"	v	typeref:struct:vfs_freelist_s
+dirty_pages	mm/page.c	/^static struct dirty_pages_s dirty_pages;$/;"	v	typeref:struct:dirty_pages_s	file:
+dirty_pages_init	mm/page.c	/^void dirty_pages_init()$/;"	f
+dirty_pages_s	mm/page.c	/^struct dirty_pages_s $/;"	s	file:
+distlock_lock	kern/distlock.c	/^void distlock_lock(distlock_t *lock)$/;"	f
+distlock_t	kern/distlock.h	/^typedef struct spinlock_s distlock_t;$/;"	t	typeref:struct:spinlock_s
+distlock_trylock	kern/distlock.c	/^uint_t distlock_trylock(distlock_t *lock)$/;"	f
+distlock_unlock	kern/distlock.c	/^void distlock_unlock(distlock_t *lock)$/;"	f
+distlocks_count	kern/thread.h	/^	error_t distlocks_count;      \/*! number of locks which are locked by the current thread *\/$/;"	m	struct:thread_s
+dma	arch/tsar/arch.h	/^	struct device_s *dma;$/;"	m	struct:arch_entry_s	typeref:struct:arch_entry_s::device_s
+dma_context_s	drivers/soclib/soclib_dma.c	/^struct dma_context_s$/;"	s	file:
+dma_count	drivers/soclib/soclib_dma.c	/^static uint_t dma_count = 0;$/;"	v	file:
+dma_do_async_request	kern/sys_dma_memcpy.c	/^static inline error_t dma_do_async_request(void *dst, void *src, size_t size)$/;"	f	file:
+dma_do_sync_request	kern/sys_dma_memcpy.c	/^static inline error_t dma_do_sync_request(void *dst, void *src, size_t size)$/;"	f	file:
+dma_frag_init	drivers/soclib/soclib_dma.c	/^static error_t dma_frag_init(dev_request_t *frag, uint_t src_start, uint_t dst_start, uint_t count)$/;"	f	file:
+dma_fraglist_build	drivers/soclib/soclib_dma.c	/^static error_t dma_fraglist_build(dev_request_t *rq)$/;"	f	file:
+dma_fraglist_destroy	drivers/soclib/soclib_dma.c	/^static void dma_fraglist_destroy(dev_request_t *ptr)$/;"	f	file:
+dma_irq_handler	drivers/soclib/soclib_dma.c	/^static void dma_irq_handler(struct irq_action_s *action)$/;"	f	file:
+dma_kmem_request_init	kern/dma.h	/^KMEM_OBJATTR_INIT(dma_kmem_request_init);$/;"	v
+dma_memcpy	kern/sys_dma_memcpy.c	/^error_t dma_memcpy(void *dst, void *src, size_t size, uint_t isAsync)$/;"	f
+dma_open	drivers/soclib/soclib_dma.c	/^static sint_t dma_open(struct device_s *dma, dev_request_t *rq)$/;"	f	file:
+dma_request	drivers/soclib/soclib_dma.c	/^static sint_t dma_request(struct device_s *dma, dev_request_t *rq)$/;"	f	file:
+dma_start_request	drivers/soclib/soclib_dma.c	/^static void dma_start_request(struct device_s *dma, dev_request_t *ptr)$/;"	f	file:
+dmsg	kern/kdmsg.h	/^#define dmsg(/;"	d
+do_exec	kern/do_exec.c	/^error_t do_exec(struct task_s *task,$/;"	f
+do_fork	kern/sys_fork.c	/^error_t do_fork(fork_info_t *info)$/;"	f
+do_interrupt	kern/do_interrupt.c	/^void do_interrupt(struct thread_s *this, uint_t irq_num)$/;"	f
+do_memcpy_8	libk/memcpy.c	/^void do_memcpy_8(void *dst, void *src, size_t size)$/;"	f
+do_memset_8	libk/memset.c	/^void do_memset_8(void *dst, uint32_t val, size_t size)$/;"	f
+do_migrate	kern/thread_migrate.c	/^error_t do_migrate(th_migrate_info_t *info)$/;"	f
+do_syscall	kern/do_syscall.c	/^reg_t do_syscall (reg_t arg0,$/;"	f
+do_thread_create	kern/sys_thread_create.c	/^error_t do_thread_create(thread_info_t *info)$/;"	f
+do_thread_stat	kern/thread_destroy.c	/^static void do_thread_stat(struct thread_s *thread)$/;"	f	file:
+down_dmsg	kern/dqdt.c	/^#define down_dmsg(/;"	d	file:
+dqdt_attr_get_cid	kern/dqdt.h	/^#define dqdt_attr_get_cid(/;"	d
+dqdt_attr_get_cid	kern/dqdt.h	/^#undef dqdt_attr_get_cid$/;"	d
+dqdt_attr_get_cpu_id	kern/dqdt.h	/^#define dqdt_attr_get_cpu_id(/;"	d
+dqdt_attr_get_cpu_id	kern/dqdt.h	/^#undef dqdt_attr_get_cpu_id$/;"	d
+dqdt_attr_init	kern/dqdt.h	/^#define dqdt_attr_init(/;"	d
+dqdt_attr_init	kern/dqdt.h	/^#undef dqdt_attr_init$/;"	d
+dqdt_attr_s	kern/dqdt.h	/^struct dqdt_attr_s$/;"	s
+dqdt_check_mem_indicators	kern/dqdt.c	/^bool_t dqdt_check_mem_indicators(dqdt_indicators_t *entry, struct dqdt_attr_s *attr)$/;"	f
+dqdt_cluster_s	kern/dqdt.h	/^struct dqdt_cluster_s$/;"	s
+dqdt_dmsg	kern/kdmsg.h	/^#define dqdt_dmsg(/;"	d
+dqdt_do_placement	kern/dqdt.c	/^error_t dqdt_do_placement(struct dqdt_cluster_s *logical, $/;"	f
+dqdt_down_traversal	kern/dqdt.c	/^bool_t dqdt_down_traversal(struct dqdt_cluster_s *logical, $/;"	f
+dqdt_estimation_s	kern/dqdt.h	/^typedef struct dqdt_estimation_s$/;"	s
+dqdt_estimation_t	kern/dqdt.h	/^} dqdt_estimation_t;$/;"	t	typeref:struct:dqdt_estimation_s
+dqdt_indicators_s	kern/dqdt.h	/^typedef struct dqdt_indicators_s$/;"	s
+dqdt_indicators_t	kern/dqdt.h	/^} dqdt_indicators_t;$/;"	t	typeref:struct:dqdt_indicators_s
+dqdt_indicators_update	kern/dqdt.c	/^void dqdt_indicators_update(dqdt_indicators_t *entry,$/;"	f
+dqdt_init	kern/dqdt.c	/^void dqdt_init(struct boot_info_s *info)$/;"	f
+dqdt_lock	kern/dqdt.c	/^static spinlock_t dqdt_lock;$/;"	v	file:
+dqdt_logical_lookup	kern/dqdt.c	/^struct dqdt_cluster_s* dqdt_logical_lookup(uint_t level)$/;"	f
+dqdt_mem_request	kern/dqdt.c	/^error_t dqdt_mem_request(struct dqdt_cluster_s *logical, struct dqdt_attr_s *attr)$/;"	f
+dqdt_primary_table_sort1	kern/dqdt.c	/^void dqdt_primary_table_sort1(sint_t *values_tbl, sint_t *aux_tbl, uint_t count)$/;"	f
+dqdt_primary_table_sort2	kern/dqdt.c	/^void dqdt_primary_table_sort2(sint_t *key_tbl, sint_t *aux1_tbl, sint_t *aux2_tbl, uint_t count)$/;"	f
+dqdt_primary_table_sort3	kern/dqdt.c	/^void dqdt_primary_table_sort3(sint_t *key_tbl, sint_t *aux1_tbl, sint_t *aux2_tbl, sint_t *aux3_tbl, uint_t count)$/;"	f
+dqdt_print	kern/dqdt.c	/^void dqdt_print(struct dqdt_cluster_s *cluster)$/;"	f
+dqdt_print_summary	kern/dqdt.c	/^void dqdt_print_summary(struct dqdt_cluster_s *cluster)$/;"	f
+dqdt_root	kern/dqdt.c	/^struct dqdt_cluster_s *dqdt_root;$/;"	v	typeref:struct:dqdt_cluster_s
+dqdt_secondary_table_sort	kern/dqdt.c	/^void dqdt_secondary_table_sort(sint_t *key_tbl, sint_t *aux_tbl, sint_t *select_tbl, uint_t count)$/;"	f
+dqdt_select_t	kern/dqdt.c	/^typedef DQDT_SELECT_HELPER(dqdt_select_t);$/;"	t	file:
+dqdt_task_placement	kern/dqdt.c	/^error_t dqdt_task_placement(struct dqdt_cluster_s *logical, struct dqdt_attr_s *attr)$/;"	f
+dqdt_task_queue	kern/dqdt.c	/^static struct wait_queue_s dqdt_task_queue;$/;"	v	typeref:struct:wait_queue_s	file:
+dqdt_tertiary_table_sort	kern/dqdt.c	/^void dqdt_tertiary_table_sort(sint_t *key1_tbl, sint_t *key2_tbl, sint_t *aux_tbl, sint_t *select_tbl, uint_t count)$/;"	f
+dqdt_thread_migrate	kern/dqdt.c	/^error_t dqdt_thread_migrate  (struct dqdt_cluster_s *logical, struct dqdt_attr_s *attr)$/;"	f
+dqdt_thread_migrate	kern/dqdt.c	/^error_t dqdt_thread_migrate(struct dqdt_cluster_s *logical, struct dqdt_attr_s *attr)$/;"	f
+dqdt_thread_placement	kern/dqdt.c	/^error_t dqdt_thread_placement(struct dqdt_cluster_s *logical, struct dqdt_attr_s *attr)$/;"	f
+dqdt_up_traversal	kern/dqdt.c	/^error_t dqdt_up_traversal(struct dqdt_cluster_s *logical,$/;"	f
+dqdt_update	kern/dqdt.c	/^error_t dqdt_update(void)$/;"	f
+dqdt_update_cntr	kern/dqdt.c	/^static uint_t dqdt_update_cntr;$/;"	v	file:
+dqdt_update_done	kern/dqdt.c	/^void dqdt_update_done(void)$/;"	f
+dqdt_update_threads_number	kern/dqdt.c	/^void dqdt_update_threads_number(struct dqdt_cluster_s *logical, uint_t core_index, sint_t count)$/;"	f
+dqdt_update_threads_number	kern/dqdt.c	/^void dqdt_update_threads_number(uint_t cid, uint_t core_index, sint_t count)$/;"	f
+dqdt_wait_for_update	kern/dqdt.c	/^void dqdt_wait_for_update(void)$/;"	f
+dqdt_waiting_cntr	kern/dqdt.c	/^static atomic_t dqdt_waiting_cntr;$/;"	v	file:
+driver	drivers/soclib/drvdb.h	/^	driver_t *driver;$/;"	m	struct:drvdb_entry_s
+driver_s	kern/driver.h	/^struct driver_s$/;"	s
+driver_t	kern/driver.h	/^typedef struct driver_s driver_t;$/;"	t	typeref:struct:driver_s
+drivers_db	drivers/soclib/drvdb.c	/^static struct drvdb_entry_s drivers_db[SOCLIB_DRVID_NR] = $/;"	v	typeref:struct:drvdb_entry_s	file:
+drop_args_ppns	kern/sys_exec.c	/^void drop_args_ppns(struct page_s *pgtbl[], bool_t is_local)$/;"	f
+drop_path	kern/sys_exec.c	/^void drop_path(char *path, uint_t is_local)$/;"	f
+drop_upath	kern/sys_exec.c	/^static void drop_upath(ppn_t pg_ppn)$/;"	f	file:
+drvdb_entry_get_driver	drivers/soclib/drvdb.h	/^#define drvdb_entry_get_driver(/;"	d
+drvdb_entry_get_driver	drivers/soclib/drvdb.h	/^#undef drvdb_entry_get_driver$/;"	d
+drvdb_entry_get_id	drivers/soclib/drvdb.h	/^#define drvdb_entry_get_id(/;"	d
+drvdb_entry_get_id	drivers/soclib/drvdb.h	/^#undef drvdb_entry_get_id$/;"	d
+drvdb_entry_get_info	drivers/soclib/drvdb.h	/^#define drvdb_entry_get_info(/;"	d
+drvdb_entry_get_info	drivers/soclib/drvdb.h	/^#undef drvdb_entry_get_info$/;"	d
+drvdb_entry_get_name	drivers/soclib/drvdb.h	/^#define drvdb_entry_get_name(/;"	d
+drvdb_entry_get_name	drivers/soclib/drvdb.h	/^#undef drvdb_entry_get_name$/;"	d
+drvdb_entry_s	drivers/soclib/drvdb.h	/^struct drvdb_entry_s$/;"	s
+drvdb_entry_set_driver	drivers/soclib/drvdb.h	/^#define drvdb_entry_set_driver(/;"	d
+drvdb_entry_set_driver	drivers/soclib/drvdb.h	/^#undef drvdb_entry_set_driver$/;"	d
+drvdb_entry_set_id	drivers/soclib/drvdb.h	/^#define drvdb_entry_set_id(/;"	d
+drvdb_entry_set_id	drivers/soclib/drvdb.h	/^#undef drvdb_entry_set_id$/;"	d
+drvdb_entry_set_info	drivers/soclib/drvdb.h	/^#define drvdb_entry_set_info(/;"	d
+drvdb_entry_set_info	drivers/soclib/drvdb.h	/^#undef drvdb_entry_set_info$/;"	d
+drvdb_entry_set_name	drivers/soclib/drvdb.h	/^#define drvdb_entry_set_name(/;"	d
+drvdb_entry_set_name	drivers/soclib/drvdb.h	/^#undef drvdb_entry_set_name$/;"	d
+drvdb_get_driver	drivers/soclib/drvdb.c	/^driver_t* drvdb_get_driver(uint_t drvid)$/;"	f
+drvdb_locate_byId	drivers/soclib/drvdb.c	/^struct drvdb_entry_s *drvdb_locate_byId(uint_t drvid)$/;"	f
+drvdb_locate_byName	drivers/soclib/drvdb.c	/^struct drvdb_entry_s *drvdb_locate_byName(char *name)$/;"	f
+drvdb_set_driver	drivers/soclib/drvdb.c	/^error_t drvdb_set_driver(uint_t drvid, driver_t *driver)$/;"	f
+drvid	kern/driver.h	/^	uint_t drvid;			        \/* Driver ID *\/$/;"	m	struct:driver_s
+ds	cpu/i386/cpu-internal.h	/^	uint16_t ds, reserved_7;	\/* 21 *\/$/;"	m	struct:cpu_tss_s
+ds	cpu/i386/cpu-internal.h	/^	uint_t ds;$/;"	m	struct:cpu_regs_s
+dst	kern/driver.h	/^	void *dst;			$/;"	m	struct:dev_request_s
+dstflag	kern/time.h	/^	short          dstflag;$/;"	m	struct:timeb
+dtlb_down	cpu/mipsel/cpu-remote.h	/^#define dtlb_down(/;"	d
+dtlb_up	cpu/mipsel/cpu-remote.h	/^#define dtlb_up(/;"	d
+dtor	mm/kmem.h	/^  kcm_init_destroy_t *dtor;$/;"	m	struct:kmem_objattr_s
+dummy1	ksh/sgiImg.h	/^  uint32_t   dummy1;$/;"	m	struct:sgi_info_s
+dummy2	ksh/sgiImg.h	/^  uint8_t    dummy2[404];$/;"	m	struct:sgi_info_s
+dump	cpu/i386/screen.c	/^void dump (uint8_t* addr, int n)$/;"	f
+dynamic_prio	kern/thread.h	/^	uint_t dynamic_prio;$/;"	m	struct:thread_s
+e_bckp	kern/event.h	/^	event_info_t e_bckp;$/;"	m	struct:event_s
+e_ehsize	libk/elf.h	/^	Elf32_Half	e_ehsize;		\/* ELF header size in bytes *\/$/;"	m	struct:__anon42
+e_entry	libk/elf.h	/^	Elf32_Addr	e_entry;		\/* Entry point virtual address *\/$/;"	m	struct:__anon42
+e_flags	libk/elf.h	/^	Elf32_Word	e_flags;		\/* Processor-specific flags *\/$/;"	m	struct:__anon42
+e_ident	libk/elf.h	/^	unsigned char	e_ident[EI_NIDENT];	\/* Magic number and other info *\/$/;"	m	struct:__anon42
+e_info	kern/event.h	/^	event_info_t e_info;$/;"	m	struct:event_s
+e_info	kern/thread.h	/^	struct event_s e_info;$/;"	m	struct:thread_info	typeref:struct:thread_info::event_s
+e_list	kern/event.h	/^	struct list_entry e_list;$/;"	m	struct:event_s	typeref:struct:event_s::list_entry
+e_machine	libk/elf.h	/^	Elf32_Half	e_machine;		\/* Architecture *\/$/;"	m	struct:__anon42
+e_phentsize	libk/elf.h	/^	Elf32_Half	e_phentsize;		\/* Program header table entry size *\/$/;"	m	struct:__anon42
+e_phnum	libk/elf.h	/^	Elf32_Half	e_phnum;		\/* Program header table entry count *\/$/;"	m	struct:__anon42
+e_phoff	libk/elf.h	/^	Elf32_Off	e_phoff;		\/* Program header table file offset *\/$/;"	m	struct:__anon42
+e_shentsize	libk/elf.h	/^	Elf32_Half	e_shentsize;		\/* Section header table entry size *\/$/;"	m	struct:__anon42
+e_shnum	libk/elf.h	/^	Elf32_Half	e_shnum;		\/* Section header table entry count *\/$/;"	m	struct:__anon42
+e_shoff	libk/elf.h	/^	Elf32_Off	e_shoff;		\/* Section header table file offset *\/$/;"	m	struct:__anon42
+e_shstrndx	libk/elf.h	/^	Elf32_Half	e_shstrndx;		\/* Section header string table index *\/$/;"	m	struct:__anon42
+e_type	libk/elf.h	/^	Elf32_Half	e_type;			\/* Object file type *\/$/;"	m	struct:__anon42
+e_version	libk/elf.h	/^	Elf32_Word	e_version;		\/* Object file version *\/$/;"	m	struct:__anon42
+early_boot_dmsg	arch/tsar/kdmsg.c	/^int early_boot_dmsg (const char *fmt, ...)$/;"	f
+eax	cpu/i386/cpu-internal.h	/^	uint32_t eax,ecx,edx,ebx;	\/* 10 *\/$/;"	m	struct:cpu_tss_s
+eax	cpu/i386/cpu-internal.h	/^	uint_t eax;$/;"	m	struct:cpu_regs_s
+ebp	cpu/i386/cpu-asm.h	/^	reg_t ebx,esp,ebp,edi,esi;$/;"	m	struct:cpu_context_s
+ebp	cpu/i386/cpu-internal.h	/^	uint32_t esp,ebp,esi,edi;	\/* 14 *\/$/;"	m	struct:cpu_tss_s
+ebp	cpu/i386/cpu-internal.h	/^	uint_t ebp;$/;"	m	struct:cpu_regs_s
+ebx	cpu/i386/cpu-asm.h	/^	reg_t ebx,esp,ebp,edi,esi;$/;"	m	struct:cpu_context_s
+ebx	cpu/i386/cpu-internal.h	/^	uint32_t eax,ecx,edx,ebx;	\/* 10 *\/$/;"	m	struct:cpu_tss_s
+ebx	cpu/i386/cpu-internal.h	/^	uint_t ebx;$/;"	m	struct:cpu_regs_s
+ecid	kern/thread.h	/^	cid_t ecid;		      \/*! on behalf of wich cid this thread work (!= from local cluster for rpc threads) *\/$/;"	m	struct:thread_s
+ecx	cpu/i386/cpu-internal.h	/^	uint32_t eax,ecx,edx,ebx;	\/* 10 *\/$/;"	m	struct:cpu_tss_s
+ecx	cpu/i386/cpu-internal.h	/^	uint_t ecx;$/;"	m	struct:cpu_regs_s
+edi	cpu/i386/cpu-asm.h	/^	reg_t ebx,esp,ebp,edi,esi;$/;"	m	struct:cpu_context_s
+edi	cpu/i386/cpu-internal.h	/^	uint32_t esp,ebp,esi,edi;	\/* 14 *\/$/;"	m	struct:cpu_tss_s
+edi	cpu/i386/cpu-internal.h	/^	uint_t edi;$/;"	m	struct:cpu_regs_s
+edx	cpu/i386/cpu-internal.h	/^	uint32_t eax,ecx,edx,ebx;	\/* 10 *\/$/;"	m	struct:cpu_tss_s
+edx	cpu/i386/cpu-internal.h	/^	uint_t edx;$/;"	m	struct:cpu_regs_s
+eflags	cpu/i386/cpu-internal.h	/^	uint32_t eflags;$/;"	m	struct:cpu_tss_s
+eflags	cpu/i386/cpu-internal.h	/^	uint_t eflags;$/;"	m	struct:cpu_regs_s
+egid	kern/thread.h	/^	gid_t egid;		      \/*! on behalf of wich gid this thread work (!= from lcpu for rpc threads) *\/$/;"	m	struct:thread_s
+eip	cpu/i386/cpu-asm.h	/^	reg_t eip,cr3;$/;"	m	struct:cpu_context_s
+eip	cpu/i386/cpu-internal.h	/^	uint32_t eip;			$/;"	m	struct:cpu_tss_s
+elect	kern/scheduler.h	/^	sched_elect_t       *elect;$/;"	m	struct:sched_ops_s
+elf_dmsg	kern/kdmsg.h	/^#define elf_dmsg(/;"	d
+elf_header_read	libk/elf.c	/^static error_t elf_header_read(char* pathname, struct vfs_file_s *file, Elf32_Ehdr **header)$/;"	f	file:
+elf_isElfHeader	libk/elf.c	/^static error_t elf_isElfHeader(Elf32_Ehdr *e_header)$/;"	f	file:
+elf_isValidHeader	libk/elf.c	/^static error_t elf_isValidHeader(Elf32_Ehdr *e_header)$/;"	f	file:
+elf_load_task	libk/elf.c	/^error_t elf_load_task(char *pathname, struct task_s *task)$/;"	f
+elf_program_entries_read	libk/elf.c	/^static error_t elf_program_entries_read(struct vfs_file_s *file, Elf32_Ehdr *e_header, Elf32_Phdr **p_entries)$/;"	f	file:
+elf_segments_load	libk/elf.c	/^static error_t elf_segments_load(struct vfs_file_s *file,$/;"	f	file:
+empty	fs/sysfs/sysfs.h	/^	void *empty;$/;"	m	struct:sysfs_context_s
+entry	fs/fat32/fat32-private.h	/^	struct vfat_DirEntry_s *entry;$/;"	m	struct:vfat_entry_request_s	typeref:struct:vfat_entry_request_s::vfat_DirEntry_s
+entry	fs/sysfs/sysfs-private.h	/^	sysfs_entry_t *entry;$/;"	m	struct:sysfs_file_s
+entry	kern/cluster.h	/^	struct cluster_entry_s* entry;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::cluster_entry_s
+entry_func	cpu/i386/cpu-asm.h	/^	reg_t entry_func;$/;"	m	struct:cpu_context_s
+entry_func	kern/thread.h	/^	void *entry_func;                  \/* mandatory *\/$/;"	m	struct:__anon39
+entry_index	fs/fat32/fat32-private.h	/^	uint_t *entry_index;$/;"	m	struct:vfat_entry_request_s
+entry_index	fs/fat32/fat32.h	/^	uint_t entry_index;$/;"	m	struct:vfat_dirent_s
+entry_name	fs/fat32/fat32-private.h	/^	char *entry_name;$/;"	m	struct:vfat_entry_request_s
+entry_point	mm/vmm.h	/^	uint_t entry_point;$/;"	m	struct:vmm_s
+env_end	kern/task.h	/^	uint_t			env_end;$/;"	m	struct:sys_exec_remote_s
+env_index	kern/task.h	/^	uint_t			env_index;$/;"	m	struct:sys_exec_remote_s
+envrion	ksh/exec_func.c	/^char *envrion[] = { "ALMOS_VERSION=v1", NULL};$/;"	v
+eol	drivers/ibmpc/tty.h	/^	unsigned int eol;		\/* End Of Line *\/$/;"	m	struct:tty_context_s
+eol	drivers/soclib/soclib_tty.c	/^	unsigned int eol;		\/* End Of Line *\/$/;"	m	struct:tty_context_s	file:
+eomtkp_func	ksh/eomtkp.c	/^error_t eomtkp_func(void *param)$/;"	f
+err	arch/tsar/mmu-info.h	/^	uint_t err;$/;"	m	struct:mmu_except_info_s
+err	kern/driver.h	/^	error_t err;			$/;"	m	struct:dev_request_s
+err	kern/event.h	/^	error_t err;$/;"	m	struct:__anon15
+err	kern/sys_fork.c	/^	volatile error_t  err;$/;"	m	struct:__anon34	file:
+err	kern/sys_thread_create.c	/^	volatile error_t  err;$/;"	m	struct:__anon35	file:
+err	kern/thread_migrate.c	/^	volatile error_t    err;$/;"	m	struct:__anon41	file:
+err	vfs/vfs.h	/^	error_t err;$/;"	m	struct:vfs_lookup_response_s
+err_code	cpu/i386/cpu-internal.h	/^	uint_t err_code;$/;"	m	struct:cpu_regs_s
+errno	kern/thread.h	/^	error_t errno;                      \/*! errno value of last system call *\/$/;"	m	struct:thread_info
+error	kern/blkio.h	/^		error_t             error;	$/;"	m	struct:blkio_s::__anon7
+error_t	libk/types.h	/^typedef signed long error_t;$/;"	t
+es	cpu/i386/cpu-internal.h	/^	uint16_t es, reserved_4;	\/* 18 *\/$/;"	m	struct:cpu_tss_s
+es	cpu/i386/cpu-internal.h	/^	uint_t es;$/;"	m	struct:cpu_regs_s
+esi	cpu/i386/cpu-asm.h	/^	reg_t ebx,esp,ebp,edi,esi;$/;"	m	struct:cpu_context_s
+esi	cpu/i386/cpu-internal.h	/^	uint32_t esp,ebp,esi,edi;	\/* 14 *\/$/;"	m	struct:cpu_tss_s
+esi	cpu/i386/cpu-internal.h	/^	uint_t esi;$/;"	m	struct:cpu_regs_s
+esp	cpu/i386/cpu-asm.h	/^	reg_t ebx,esp,ebp,edi,esi;$/;"	m	struct:cpu_context_s
+esp	cpu/i386/cpu-internal.h	/^	uint32_t esp,ebp,esi,edi;	\/* 14 *\/$/;"	m	struct:cpu_tss_s
+esp	cpu/i386/cpu-internal.h	/^	uint_t esp;$/;"	m	struct:cpu_regs_s
+esp_r0	cpu/i386/cpu-internal.h	/^	uint32_t esp_r0;		\/* 1 *\/$/;"	m	struct:cpu_tss_s
+esp_r1	cpu/i386/cpu-internal.h	/^	uint32_t esp_r1;		\/* 3 *\/$/;"	m	struct:cpu_tss_s
+esp_r2	cpu/i386/cpu-internal.h	/^	uint32_t esp_r2;		\/* 5 *\/$/;"	m	struct:cpu_tss_s
+event	drivers/soclib/soclib_xicu.c	/^	struct event_s *event;$/;"	m	struct:xicu_cntr_info_s	typeref:struct:xicu_cntr_info_s::event_s	file:
+event	kern/barrier.c	/^	uint_t event;$/;"	m	struct:wqdb_record_s	file:
+event	kern/barrier.h	/^	struct event_s event;$/;"	m	struct:barrier_s	typeref:struct:barrier_s::event_s
+event	kern/driver.h	/^	struct event_s event;$/;"	m	struct:dev_request_s	typeref:struct:dev_request_s::event_s
+event	kern/sys_fork.c	/^	struct event_s    event;$/;"	m	struct:__anon34	typeref:struct:__anon34::event_s	file:
+event	kern/sys_thread_create.c	/^	struct event_s    event;$/;"	m	struct:__anon35	typeref:struct:__anon35::event_s	file:
+event	kern/thread_migrate.c	/^	struct event_s      event;$/;"	m	struct:__anon41	typeref:struct:__anon41::event_s	file:
+event	kern/time.h	/^	struct event_s *event;$/;"	m	struct:alarm_info_s	typeref:struct:alarm_info_s::event_s
+event_backup	kern/event.h	/^#define event_backup(/;"	d
+event_destroy	kern/event.c	/^void event_destroy(struct event_s *event)$/;"	f
+event_get_argument	kern/event.h	/^#define event_get_argument(/;"	d
+event_get_argument	kern/event.h	/^#undef event_get_argument$/;"	d
+event_get_error	kern/event.h	/^#define event_get_error(/;"	d
+event_get_error	kern/event.h	/^#undef event_get_error$/;"	d
+event_get_handler	kern/event.h	/^#define event_get_handler(/;"	d
+event_get_handler	kern/event.h	/^#undef event_get_handler$/;"	d
+event_get_priority	kern/event.h	/^#define event_get_priority(/;"	d
+event_get_priority	kern/event.h	/^#undef event_get_priority$/;"	d
+event_get_senderId	kern/event.h	/^#define event_get_senderId(/;"	d
+event_get_senderId	kern/event.h	/^#undef event_get_senderId$/;"	d
+event_handler_t	kern/event.h	/^typedef EVENT_HANDLER(event_handler_t);$/;"	t
+event_info_t	kern/event.h	/^}event_info_t;$/;"	t	typeref:struct:__anon15
+event_init	kern/event.c	/^error_t event_init(struct event_s *event)$/;"	f
+event_is_pending	kern/event.h	/^#define event_is_pending(/;"	d
+event_is_pending	kern/event.h	/^#undef event_is_pending$/;"	d
+event_list_s	kern/event.h	/^struct event_list_s$/;"	s
+event_listner_destroy	kern/event.c	/^void event_listner_destroy(struct event_listner_s *el)$/;"	f
+event_listner_get_cpu	kern/event.h	/^#define event_listner_get_cpu(/;"	d
+event_listner_get_cpu	kern/event.h	/^#undef event_listner_get_cpu$/;"	d
+event_listner_init	kern/event.c	/^error_t event_listner_init(struct event_listner_s *el)$/;"	f
+event_listner_notify	kern/event.c	/^void event_listner_notify(struct event_listner_s *el)$/;"	f
+event_listner_s	kern/event.h	/^struct event_listner_s$/;"	s
+event_listner_type_t	kern/event.h	/^}event_listner_type_t;$/;"	t	typeref:enum:__anon14
+event_mgr	kern/cpu.h	/^	struct thread_s *event_mgr;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::thread_s
+event_prio_t	kern/event.h	/^}event_prio_t;$/;"	t	typeref:enum:__anon13
+event_restore	kern/event.h	/^#define event_restore(/;"	d
+event_s	kern/event.h	/^struct event_s$/;"	s
+event_send	kern/event.c	/^void event_send(struct event_s *event, uint_t cpu_gid)$/;"	f
+event_set_argument	kern/event.h	/^#define event_set_argument(/;"	d
+event_set_argument	kern/event.h	/^#undef event_set_argument$/;"	d
+event_set_error	kern/event.h	/^#define event_set_error(/;"	d
+event_set_error	kern/event.h	/^#undef event_set_error$/;"	d
+event_set_handler	kern/event.h	/^#define event_set_handler(/;"	d
+event_set_handler	kern/event.h	/^#undef event_set_handler$/;"	d
+event_set_priority	kern/event.h	/^#define event_set_priority(/;"	d
+event_set_priority	kern/event.h	/^#undef event_set_priority$/;"	d
+event_set_senderId	kern/event.h	/^#define event_set_senderId(/;"	d
+event_set_senderId	kern/event.h	/^#undef event_set_senderId$/;"	d
+event_tm	kern/thread_migrate.c	/^	uint_t              event_tm;$/;"	m	struct:__anon41	file:
+except_dmsg	kern/kdmsg.h	/^#define except_dmsg(/;"	d
+exception_lock	arch/ibmpc/kdmsg.c	/^spinlock_t exception_lock;$/;"	v
+exception_lock	cpu/mipsel/cpu_do_exception.c	/^DISTLOCK_DECLARE(exception_lock);$/;"	v
+exception_name	cpu/i386/__do_exception.c	/^static char *exception_name[32] = {"Division By Zero Exception",$/;"	v	file:
+exec_copy_t	kern/task.h	/^typedef error_t exec_copy_t(void *dst, void *src, uint_t count);$/;"	t
+exec_dmsg	kern/kdmsg.h	/^#define exec_dmsg(/;"	d
+exec_func	ksh/exec_func.c	/^error_t exec_func(void *param)$/;"	f
+exec_strlen_t	kern/task.h	/^typedef error_t exec_strlen_t(char *dst, uint_t *count);$/;"	t
+exit	kern/scheduler.h	/^	sched_exit_t        *exit;$/;"	m	struct:sched_ops_s
+exit_func	cpu/i386/cpu-asm.h	/^	reg_t exit_func;$/;"	m	struct:cpu_context_s
+exit_func	cpu/mipsel/cpu-asm.h	/^	reg_t exit_func;		\/* 15 *\/$/;"	m	struct:cpu_context_s
+exit_func	kern/thread.h	/^	void *exit_func;                   \/* mandatory *\/$/;"	m	struct:__anon39
+exit_value	kern/thread.h	/^	void *exit_value;                   \/*! exit value returned by thread or joined one *\/$/;"	m	struct:thread_info
+expand_tree	kern/radix.c	/^static int expand_tree(struct radix_s* root)$/;"	f	file:
+export_nr	kern/scheduler.h	/^	uint16_t export_nr;$/;"	m	struct:scheduler_s
+ext2_dmsg	kern/kdmsg.h	/^#define ext2_dmsg(/;"	d
+extended	kern/task.h	/^        bool_t extended;$/;"	m	struct:fd_info_s
+f_attr	vfs/vfs.h	/^	uint_t f_attr;$/;"	m	struct:vfs_file_s
+f_ctx	vfs/vfs.h	/^	struct vfs_context_s *f_ctx;$/;"	m	struct:vfs_file_s	typeref:struct:vfs_file_s::vfs_context_s
+f_flags	vfs/vfs.h	/^	uint_t f_flags;$/;"	m	struct:vfs_file_s
+f_inode	vfs/vfs.h	/^	struct vfs_inode_ref_s f_inode;$/;"	m	struct:vfs_file_s	typeref:struct:vfs_file_s::vfs_inode_ref_s
+f_mapper	vfs/vfs.h	/^	struct mapper_s f_mapper;$/;"	m	struct:vfs_file_s	typeref:struct:vfs_file_s::mapper_s
+f_mode	vfs/vfs.h	/^	uint_t f_mode;$/;"	m	struct:vfs_file_s
+f_offset	vfs/vfs.h	/^	uint_t f_offset; \/* Cache fr_offset if ...*\/$/;"	m	struct:vfs_file_s
+f_op	vfs/vfs.h	/^	struct vfs_file_op_s *f_op;$/;"	m	struct:vfs_file_s	typeref:struct:vfs_file_s::vfs_file_op_s
+f_private	vfs/vfs.h	/^	union vfs_file_private_s f_private;$/;"	m	struct:vfs_file_s	typeref:union:vfs_file_s::vfs_file_private_s
+f_remote	vfs/vfs.h	/^	struct vfs_file_remote_s *f_remote;$/;"	m	struct:vfs_file_s	typeref:struct:vfs_file_s::vfs_file_remote_s
+f_version	vfs/vfs.h	/^	uint_t f_version;$/;"	m	struct:vfs_file_s
+false	libk/types.h	/^#define false /;"	d
+fat_attr	fs/fat32/fat32.h	/^	uint32_t fat_attr;$/;"	m	struct:vfat_inode_create_s
+fat_begin_lba	fs/fat32/fat32.h	/^	vfat_sector_t fat_begin_lba;$/;"	m	struct:vfat_context_s
+fat_blk_count	fs/fat32/fat32.h	/^	vfat_sector_t fat_blk_count;$/;"	m	struct:vfat_context_s
+fat_cid	fs/fat32/fat32.h	/^	cid_t fat_cid;$/;"	m	struct:vfat_context_s
+fb_count	drivers/soclib/soclib_fb.c	/^static uint_t fb_count = 0;$/;"	v	file:
+fb_get_params	drivers/soclib/soclib_fb.c	/^static sint_t fb_get_params(struct device_s *fb, dev_params_t *params)$/;"	f	file:
+fb_lseek	drivers/soclib/soclib_fb.c	/^static error_t fb_lseek(struct device_s *fb, dev_request_t *rq)$/;"	f	file:
+fb_mmap	drivers/soclib/soclib_fb.c	/^static error_t fb_mmap(struct device_s *fb, dev_request_t *rq)$/;"	f	file:
+fb_munmap	drivers/soclib/soclib_fb.c	/^static error_t fb_munmap(struct device_s *fb, dev_request_t *rq)$/;"	f	file:
+fb_open	drivers/soclib/soclib_fb.c	/^static sint_t fb_open(struct device_s *fb, dev_request_t *rq)$/;"	f	file:
+fb_read	drivers/soclib/soclib_fb.c	/^static sint_t fb_read(struct device_s *fb, dev_request_t *rq)$/;"	f	file:
+fb_vm_region_op	drivers/soclib/soclib_fb.c	/^static struct vm_region_op_s fb_vm_region_op = $/;"	v	typeref:struct:vm_region_op_s	file:
+fb_write	drivers/soclib/soclib_fb.c	/^static sint_t fb_write(struct device_s *fb, dev_request_t *rq)$/;"	f	file:
+fd	mm/vmm.h	/^	uint_t fd;$/;"	m	struct:mmap_attr_s
+fd_entry	kern/task.h	/^        struct fd_entry_s *fd_entry;$/;"	m	struct:fd_info_s	typeref:struct:fd_info_s::fd_entry_s
+fd_entry_base	kern/task.h	/^	struct fd_entry_s fd_entry_base[CONFIG_TASK_FILE_MAX_NR];$/;"	m	struct:fd_info_s	typeref:struct:fd_info_s::fd_entry_s
+fd_entry_s	kern/task.h	/^struct fd_entry_s$/;"	s
+fd_info	kern/task.h	/^	struct fd_info_s  fd_info;$/;"	m	struct:task_s	typeref:struct:task_s::fd_info_s
+fd_info	kern/task.h	/^        struct fd_info_s        fd_info;$/;"	m	struct:sys_exec_remote_s	typeref:struct:sys_exec_remote_s::fd_info_s
+fd_info_s	kern/task.h	/^struct fd_info_s$/;"	s
+fifo_tbl	kern/rpc.h	/^	struct remote_fifo_s fifo_tbl[RPC_PRIO_NR];$/;"	m	struct:rpc_listner_s	typeref:struct:rpc_listner_s::remote_fifo_s
+fifomwmr_s	kern/mwmr.c	/^struct fifomwmr_s$/;"	s	file:
+file	kern/driver.h	/^		struct vfs_file_s *file;$/;"	m	union:dev_request_s::__anon11	typeref:struct:dev_request_s::__anon11::vfs_file_s
+file	kern/task.h	/^	struct vfs_file_s file;$/;"	m	struct:fd_entry_s	typeref:struct:fd_entry_s::vfs_file_s
+file	mm/mapper.h	/^	struct vfs_file_remote_s *file;$/;"	m	struct:mapper_buff_s	typeref:struct:mapper_buff_s::vfs_file_remote_s
+fill_arch_cid_to_almos_array	arch/tsar/arch_init.c	/^static void fill_arch_cid_to_almos_array(struct arch_bib_header_s *header)$/;"	f	file:
+first_cluster	fs/fat32/fat32-private.h	/^	vfat_cluster_t first_cluster;$/;"	m	struct:vfat_inode_s
+first_cluster	fs/fat32/fat32.h	/^	uint_t first_cluster;$/;"	m	struct:vfat_dirent_s
+first_cluster	fs/fat32/fat32.h	/^	vfat_cluster_t first_cluster;$/;"	m	struct:vfat_inode_create_s
+first_cluster	fs/fat32/fat32_mapper.c	/^	vfat_cluster_t  first_cluster;$/;"	m	struct:vfat_file_s	file:
+flags	arch/tsar/arch-pmm.h	/^	uint_t flags;$/;"	m	struct:pmm_s
+flags	cpu/i386/boot.c	/^	unsigned long flags;$/;"	m	struct:mb_partial_info_s	file:
+flags	cpu/i386/cpu-internal.h	/^	uint8_t  flags;$/;"	m	struct:cpu_idt_entry_s
+flags	fs/fat32/fat32-private.h	/^	uint32_t flags;$/;"	m	struct:vfat_inode_s
+flags	kern/cluster.h	/^	volatile uint_t flags;$/;"	m	struct:cluster_entry_s
+flags	kern/dqdt.h	/^	uint_t flags;$/;"	m	struct:dqdt_attr_s
+flags	kern/dqdt.h	/^	uint_t flags;$/;"	m	struct:dqdt_cluster_s
+flags	kern/driver.h	/^	uint32_t flags;		$/;"	m	struct:dev_request_s
+flags	kern/event.h	/^	volatile uint_t flags;$/;"	m	struct:event_listner_s
+flags	kern/sys_fork.c	/^	uint_t           flags;$/;"	m	struct:__anon34	file:
+flags	kern/thread.h	/^	uint_t flags;                 \/*! TH_NEED_TO_SCHED, .. *\/$/;"	m	struct:thread_s
+flags	kern/thread.h	/^	uint_t flags;$/;"	m	struct:__anon39
+flags	mm/heap_manager.h	/^	uint_t flags;$/;"	m	struct:heap_manager_s
+flags	mm/kcm.c	/^	uint8_t flags;$/;"	m	struct:page_info_s	file:
+flags	mm/kmem.h	/^  uint_t flags;$/;"	m	struct:kmem_req_s
+flags	mm/page.h	/^	uint32_t flags : 12;$/;"	m	struct:page_s
+flags	mm/vmm.h	/^	uint_t flags;$/;"	m	struct:mmap_attr_s
+flags	vfs/vfs-private.h	/^	uint_t flags;$/;"	m	struct:vfs_lookup_path_s
+flags	vfs/vfs.h	/^	uint_t flags;$/;"	m	struct:vfs_lookup_s
+fork_dmsg	kern/kdmsg.h	/^#define fork_dmsg(/;"	d
+fork_info_t	kern/sys_fork.c	/^}fork_info_t;$/;"	t	typeref:struct:__anon34	file:
+fp_30	cpu/mipsel/cpu-asm.h	/^	reg_t fp_30;			\/* 9 *\/$/;"	m	struct:cpu_context_s
+fpos_t	libk/types.h	/^typedef uint32_t fpos_t;$/;"	t
+fpu_owner	kern/cpu.h	/^	struct thread_s *fpu_owner;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::thread_s
+fpu_regs	cpu/mipsel/cpu-asm.h	/^	reg_t fpu_regs[32];           \/* offset: +REGS_NR *\/$/;"	m	struct:cpu_uzone_s
+fr_count	vfs/vfs.h	/^	atomic_t fr_count;$/;"	m	struct:vfs_file_remote_s
+fr_ino_gc	vfs/vfs.h	/^	gc_t fr_ino_gc;$/;"	m	struct:vfs_file_remote_s
+fr_inode	vfs/vfs.h	/^	struct vfs_inode_s *fr_inode;$/;"	m	struct:vfs_file_remote_s	typeref:struct:vfs_file_remote_s::vfs_inode_s
+fr_offset	vfs/vfs.h	/^	uint_t fr_offset;$/;"	m	struct:vfs_file_remote_s
+fr_op	vfs/vfs.h	/^	struct vfs_file_op_s *fr_op;$/;"	m	struct:vfs_file_remote_s	typeref:struct:vfs_file_remote_s::vfs_file_op_s
+fr_pv	vfs/vfs.h	/^	void *fr_pv;$/;"	m	struct:vfs_file_remote_s
+fr_rwlock	vfs/vfs.h	/^	struct rwlock_s fr_rwlock;$/;"	m	struct:vfs_file_remote_s	typeref:struct:vfs_file_remote_s::rwlock_s
+fr_version	vfs/vfs.h	/^	uint_t fr_version;$/;"	m	struct:vfs_file_remote_s
+free_args	kern/do_exec.c	/^void free_args(struct page_s *pgtbl[])$/;"	f
+free_pages	mm/ppm.h	/^	struct buddy_list_s free_pages[PPM_MAX_ORDER];$/;"	m	struct:ppm_s	typeref:struct:ppm_s::buddy_list_s
+free_pages_max	mm/kcm.h	/^	uint_t free_pages_max;$/;"	m	struct:kcm_s
+free_pages_min	mm/kcm.h	/^	uint_t free_pages_min;$/;"	m	struct:kcm_s
+free_pages_nr	mm/kcm.h	/^	uint_t free_pages_nr;$/;"	m	struct:kcm_s
+free_pages_nr	mm/ppm.h	/^	uint_t free_pages_nr;$/;"	m	struct:ppm_s
+freelist	mm/kcm.h	/^	struct list_entry freelist;$/;"	m	struct:kcm_s	typeref:struct:kcm_s::list_entry
+freelist_get	mm/kcm.c	/^page_info_t* freelist_get(struct kcm_s *kcm)$/;"	f
+freelist_populate	mm/kcm.c	/^error_t freelist_populate(struct kcm_s *kcm)$/;"	f
+freelist_release	mm/kcm.c	/^void freelist_release(struct kcm_s *kcm)$/;"	f
+fremote	kern/driver.h	/^		struct vfs_file_remote_s *fremote;$/;"	m	union:dev_request_s::__anon11	typeref:struct:dev_request_s::__anon11::vfs_file_remote_s
+fremote	vfs/vfs.c	/^	struct vfs_file_remote_s *fremote;$/;"	m	struct:__vfs_open_s	typeref:struct:__vfs_open_s::vfs_file_remote_s	file:
+fs	cpu/i386/cpu-internal.h	/^	uint16_t fs, reserved_8;	\/* 22 *\/$/;"	m	struct:cpu_tss_s
+fs	cpu/i386/cpu-internal.h	/^	uint_t fs;$/;"	m	struct:cpu_regs_s
+fs_tbl	vfs/vfs_init.c	/^static fs_type_t fs_tbl[VFS_TYPES_NR] = $/;"	v	file:
+fs_type_s	vfs/vfs_init.c	/^typedef struct fs_type_s$/;"	s	file:
+fs_type_t	vfs/vfs_init.c	/^}fs_type_t;$/;"	t	typeref:struct:fs_type_s	file:
+full_assert	kern/kdmsg.h	/^#define full_assert(/;"	d
+full_do_exec	kern/do_exec.c	/^error_t full_do_exec(struct task_s *task,$/;"	f
+func_addr	kern/cpu-trace.h	/^	void *func_addr;$/;"	m	struct:cpu_trace_info_s
+funcs	kern/rpc.c	/^static const rpc_test_func_t funcs[NB_TEST] = {__test0, __test1, __test1, __test0};$/;"	v	file:
+gc	vfs/vfs.h	/^	cid_t cid; gc_t gc; $/;"	m	struct:vfs_inode_ref_s
+gc_t	libk/types.h	/^typedef uint32_t gc_t;$/;"	t
+gdt_entry_set	cpu/i386/cpu_internal.c	/^void gdt_entry_set(struct cpu_gdt_entry_s *entry,$/;"	f
+gdt_print	cpu/i386/cpu_internal.c	/^void gdt_print(struct cpu_gdt_entry_s *gdt, int nr)$/;"	f
+gdt_print_entry	cpu/i386/cpu_internal.c	/^void gdt_print_entry(struct cpu_gdt_entry_s *entry)$/;"	f
+general	drivers/ibmpc/ata.h	/^	uint16_t general;$/;"	m	struct:ata_identify_s
+geometry	drivers/ibmpc/ata.h	/^	uint16_t geometry[6];$/;"	m	struct:ata_identify_s
+get	kern/kfifo.h	/^		kfifo_get_t *get;$/;"	m	struct:kfifo_s::__anon21
+getChar	ksh/miniShellIo.c	/^char getChar()$/;"	f
+getString	ksh/miniShellIo.c	/^void getString(char *buff,size_t size)$/;"	f
+get_arch_entry	arch/tsar/arch.h	/^static inline arch_entry_t get_arch_entry(uint_t cid)$/;"	f
+get_block	mm/kcm.c	/^void* get_block(struct kcm_s *kcm, page_info_t *pinfo)$/;"	f
+get_highest_irq	kern/driver.h	/^	icu_get_highest_irq_t *get_highest_irq;$/;"	m	struct:dev_icu_op
+get_mask	kern/driver.h	/^	icu_get_mask_t *get_mask;$/;"	m	struct:dev_icu_op
+get_params	kern/driver.h	/^	device_params_t  *get_params;$/;"	m	struct:dev_icu_op
+get_params	kern/driver.h	/^	device_params_t  *get_params;$/;"	m	struct:dev_op
+get_path	kern/sys_exec.c	/^error_t get_path(ppn_t path_ppn, char **path, uint_t is_local)$/;"	f
+get_ppn	kern/ku_transfert.h	/^	ku_get_ppn_t *get_ppn;$/;"	m	struct:ku_obj
+get_ppn_max	kern/ku_transfert.h	/^	ku_size_t *get_ppn_max;\/\/reuse the typedef of size$/;"	m	struct:ku_obj
+get_size	kern/ku_transfert.h	/^	ku_size_t *get_size;$/;"	m	struct:ku_obj
+get_status	kern/driver.h	/^    iopic_get_status_t *get_status;$/;"	m	struct:dev_iopic_op
+get_upath	kern/sys_exec.c	/^static error_t get_upath(char* ufilename, $/;"	f	file:
+get_value	kern/driver.h	/^	timer_get_value_t *get_value;$/;"	m	struct:dev_timer_op
+gid	kern/cpu.h	/^	uint_t gid;$/;"	m	struct:cpu_s
+gid	kern/rpc.h	/^	gid_t gid;$/;"	m	struct:rpc_s
+gid	kern/task.h	/^	gid_t gid;$/;"	m	struct:task_s
+gid_t	libk/stdint.h	/^typedef unsigned long gid_t;$/;"	t
+global_t	libk/types.h	/^typedef struct cache_line_s global_t;$/;"	t	typeref:struct:cache_line_s
+granularity	cpu/i386/cpu-internal.h	/^	uint8_t  granularity;$/;"	m	struct:cpu_gdt_entry_s
+gs	cpu/i386/cpu-internal.h	/^	uint16_t gs, reserved_9;	\/* 23 *\/$/;"	m	struct:cpu_tss_s
+gs	cpu/i386/cpu-internal.h	/^	uint_t gs;$/;"	m	struct:cpu_regs_s
+handled	kern/remote_fifo.h	/^	volatile char handled;$/;"	m	struct:rf_item_s
+handled	kern/rpc.h	/^	atomic_t handled;$/;"	m	struct:rpc_listner_s
+handler	kern/event.h	/^	event_handler_t *handler;$/;"	m	struct:__anon15
+handler	kern/rpc.h	/^	rpc_handler_t *handler;$/;"	m	struct:rpc_s
+handler	kern/signal.h	/^	struct thread_s     *handler;$/;"	m	struct:sig_mgr_s	typeref:struct:sig_mgr_s::thread_s
+hash	kern/htable.h	/^	hash_t hash;$/;"	m	struct:hnode_s
+hash_index	kern/metafs.h	/^	uint_t hash_index;$/;"	m	struct:metafs_iter_s
+hash_t	kern/htable.h	/^typedef uint_t hash_t;$/;"	t
+hash_tbl	kern/metafs.h	/^	struct list_entry hash_tbl[METAFS_HASH_SIZE];$/;"	m	struct:metafs_s	typeref:struct:metafs_s::list_entry
+hcompare	kern/htable.h	/^	hcompare_t *hcompare;$/;"	m	struct:hheader_s
+hcompare_t	kern/htable.h	/^typedef bool_t hcompare_t(struct hnode_s *hn, void* key);$/;"	t
+hdidx	kern/remote_fifo.h	/^		volatile uint_t hdidx;$/;"	m	union:remote_fifo_s::__anon27
+header	cpu/mipsel/__kheader.S	/^	header:	.word KERNEL_SIGNATURE, __ktext_start, __ktext_end, __kdata_start, __kdata_end, __virtual_end, kern_init$/;"	l
+header_info_t	arch/tsar/arch_init.c	/^typedef struct arch_bib_header_s  header_info_t;$/;"	t	typeref:struct:arch_bib_header_s	file:
+heap_current	mm/vmm.h	/^	uint_t heap_current;$/;"	m	struct:vmm_s
+heap_manager_free	mm/heap_manager.c	/^void heap_manager_free(void *ptr)$/;"	f
+heap_manager_init	mm/heap_manager.c	/^error_t heap_manager_init(struct heap_manager_s *heap_mgr,$/;"	f
+heap_manager_malloc	mm/heap_manager.c	/^void* heap_manager_malloc(struct heap_manager_s *heap_mgr, size_t size, uint_t flags)$/;"	f
+heap_manager_s	mm/heap_manager.h	/^struct heap_manager_s$/;"	s
+heap_mgr	mm/heap_manager.c	/^	struct heap_manager_s *heap_mgr;$/;"	m	struct:block_info_s	typeref:struct:block_info_s::heap_manager_s	file:
+heap_region	mm/vmm.h	/^	struct vm_region_s *heap_region;$/;"	m	struct:vmm_s	typeref:struct:vmm_s::vm_region_s
+heap_start	mm/vmm.h	/^	uint_t heap_start;$/;"	m	struct:vmm_s
+height	kern/radix.h	/^	int	                    height;$/;"	m	struct:radix_s
+height	kern/radix.h	/^	uint_t height;$/;"	m	struct:radix_item_info_s
+help_func	ksh/miniShell.c	/^static error_t help_func(void *param)$/;"	f	file:
+hfind	kern/htable.c	/^struct hnode_s* hfind(struct hheader_s *hd, void *key)$/;"	f
+hhalloc	kern/htable.c	/^error_t hhalloc(struct hheader_s *hd, uint_t flags)$/;"	f
+hhash	kern/htable.h	/^	hhash_ft *hhash;$/;"	m	struct:hheader_s
+hhash_ft	kern/htable.h	/^typedef hash_t hhash_ft(void* key);$/;"	t
+hheader_s	kern/htable.h	/^struct hheader_s$/;"	s
+hhinit	kern/htable.c	/^error_t hhinit(struct hheader_s *hd, hhash_ft *hhash, hcompare_t *hcompare)$/;"	f
+hide_cursor	cpu/i386/screen.c	/^void hide_cursor(void)$/;"	f
+high_mem	cpu/i386/boot.c	/^	unsigned long high_mem;$/;"	m	struct:mb_partial_info_s	file:
+hinsert	kern/htable.c	/^error_t hinsert(struct hheader_s *hd, struct hnode_s *hn, void *key)$/;"	f
+hninit	kern/htable.c	/^error_t hninit(struct hnode_s *hn)$/;"	f
+hnode_s	kern/htable.h	/^struct hnode_s$/;"	s
+home	kern/dqdt.h	/^	struct cluster_s *home;$/;"	m	struct:dqdt_cluster_s	typeref:struct:dqdt_cluster_s::cluster_s
+hremove	kern/htable.c	/^error_t hremove(struct hheader_s *hd, void *key)$/;"	f
+htable_int_default	kern/htable.c	/^hash_t htable_int_default(void* key)$/;"	f
+htbl_dmsg	kern/kdmsg.h	/^#define htbl_dmsg(/;"	d
+hwi_irq_vector	drivers/soclib/soclib_xicu.c	/^	struct irq_action_s *hwi_irq_vector[XICU_HWI_MAX];$/;"	m	struct:xicu_context_s	typeref:struct:xicu_context_s::irq_action_s	file:
+hwi_lock	drivers/soclib/soclib_xicu.c	/^	spinlock_t hwi_lock;$/;"	m	struct:xicu_context_s	file:
+hwid	kern/barrier.h	/^		uint_t hwid;$/;"	m	union:barrier_s::__anon6
+i_acl	vfs/vfs.h	/^	uint_t   i_acl;$/;"	m	struct:vfs_inode_s
+i_attr	vfs/vfs.h	/^	uint_t   i_attr;$/;"	m	struct:vfs_inode_s
+i_count	vfs/vfs.h	/^	uint_t	 i_count; $/;"	m	struct:vfs_inode_s
+i_ctx	vfs/vfs.h	/^	struct vfs_context_s *i_ctx;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::vfs_context_s
+i_ctx	vfs/vfs_init.c	/^	struct vfs_context_s *i_ctx;$/;"	m	struct:root_info	typeref:struct:root_info::vfs_context_s	file:
+i_dirent	vfs/vfs.h	/^	struct vfs_dirent_s *i_dirent; $/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::vfs_dirent_s
+i_dirent	vfs/vfs_init.c	/^	struct vfs_dirent_s *i_dirent; $/;"	m	struct:root_info	typeref:struct:root_info::vfs_dirent_s	file:
+i_dirty	vfs/vfs.h	/^	uint_t   i_dirty;$/;"	m	struct:vfs_inode_s
+i_flags	vfs/vfs.h	/^	uint_t   i_flags;$/;"	m	struct:vfs_inode_s
+i_freelist	vfs/vfs.h	/^	struct slist_entry  i_freelist;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::slist_entry
+i_gc	vfs/vfs.h	/^	gc_t	 i_gc;$/;"	m	struct:vfs_inode_s
+i_gid	vfs/vfs.h	/^	gid_t    i_gid;$/;"	m	struct:vfs_inode_s
+i_hnode	vfs/vfs.h	/^	struct hnode_s i_hnode;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::hnode_s
+i_links	vfs/vfs.h	/^	uint_t   i_links;$/;"	m	struct:vfs_inode_s
+i_lock	vfs/vfs.h	/^	spinlock_t i_lock;$/;"	m	struct:vfs_inode_s
+i_mapper	vfs/vfs.h	/^	struct mapper_s   *i_mapper;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::mapper_s
+i_meta	vfs/vfs.h	/^	struct metafs_s i_meta;\/\/allow a search by name$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::metafs_s
+i_mode	vfs/vfs.h	/^	uint_t   i_mode;$/;"	m	struct:vfs_inode_s
+i_mount_ctx	vfs/vfs.h	/^	struct vfs_context_s *i_mount_ctx;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::vfs_context_s
+i_mount_ctx	vfs/vfs_init.c	/^	struct vfs_context_s *i_mount_ctx;$/;"	m	struct:root_info	typeref:struct:root_info::vfs_context_s	file:
+i_number	vfs/vfs.h	/^	uint_t   i_number;$/;"	m	struct:vfs_inode_s
+i_op	vfs/vfs.h	/^	struct vfs_inode_op_s *i_op;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::vfs_inode_op_s
+i_parent	vfs/vfs.h	/^	struct vfs_inode_ref_s i_parent; $/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::vfs_inode_ref_s
+i_parent	vfs/vfs_init.c	/^	struct vfs_inode_ref_s i_parent;$/;"	m	struct:root_info	typeref:struct:root_info::vfs_inode_ref_s	file:
+i_pv	vfs/vfs.h	/^	void    *i_pv;$/;"	m	struct:vfs_inode_s
+i_readers	vfs/vfs.h	/^	uint_t   i_readers;$/;"	m	struct:vfs_inode_s
+i_rwlock	vfs/vfs.h	/^	struct rwlock_s i_rwlock;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::rwlock_s
+i_size	vfs/vfs.h	/^	uint64_t i_size;$/;"	m	struct:vfs_inode_s
+i_stat	vfs/vfs.h	/^	struct vfs_stat_s  i_stat;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::vfs_stat_s
+i_state	vfs/vfs.h	/^	uint_t   i_state;$/;"	m	struct:vfs_inode_s
+i_type	vfs/vfs.h	/^	uint_t   i_type;$/;"	m	struct:vfs_inode_s
+i_uid	vfs/vfs.h	/^	uid_t    i_uid;$/;"	m	struct:vfs_inode_s
+i_wait_queue	vfs/vfs.h	/^	struct wait_queue_s   i_wait_queue;$/;"	m	struct:vfs_inode_s	typeref:struct:vfs_inode_s::wait_queue_s
+i_writers	vfs/vfs.h	/^	uint_t   i_writers;$/;"	m	struct:vfs_inode_s
+ibmpc_ata_init	drivers/ibmpc/ata.c	/^void ibmpc_ata_init(struct device_s *hdd, void *base, uint_t irq)$/;"	f
+ibmpc_pic_bind	drivers/ibmpc/pic.c	/^void ibmpc_pic_bind(struct device_s *pic, struct device_s *dev)$/;"	f
+ibmpc_pic_init	drivers/ibmpc/pic.c	/^void ibmpc_pic_init(struct device_s *pic, void *base, uint_t irq)$/;"	f
+ibmpc_tty_init	drivers/ibmpc/tty.c	/^void ibmpc_tty_init(struct device_s *tty, void *base, uint_t irq, uint_t tty_id)$/;"	f
+icache	vfs/vfs_cache.c	/^struct hheader_s icache;$/;"	v	typeref:struct:hheader_s
+icache_key	vfs/vfs_cache.c	/^struct icache_key$/;"	s	file:
+icache_lock	vfs/vfs_cache.c	/^spinlock_t icache_lock;$/;"	v
+icreate	vfs/vfs.h	/^	vfs_icreate_inode_t *icreate;$/;"	m	struct:vfs_inode_op_s
+icu	kern/driver.h	/^		struct dev_icu_op   icu;$/;"	m	union:driver_s::__anon12	typeref:struct:driver_s::__anon12::dev_icu_op
+icu_bind_t	kern/driver.h	/^typedef error_t (icu_bind_t)(struct device_s *icu, struct device_s *dev);$/;"	t
+icu_bind_wti_t	kern/driver.h	/^typedef error_t (icu_bind_wti_t)(struct device_s *icu, struct irq_action_s *dev, uint_t wti_index);$/;"	t
+icu_context_s	drivers/soclib/soclib_icu.c	/^struct icu_context_s$/;"	s	file:
+icu_count	drivers/soclib/soclib_icu.c	/^static uint_t icu_count = 0;$/;"	v	file:
+icu_default_irq_handler	drivers/soclib/soclib_icu.c	/^static void icu_default_irq_handler(struct device_s *icu, uint_t irq_num)$/;"	f	file:
+icu_get_highest_irq	drivers/soclib/soclib_icu.c	/^static sint_t icu_get_highest_irq(struct device_s *icu, uint_t type, uint_t output_irq)$/;"	f	file:
+icu_get_highest_irq_t	kern/driver.h	/^typedef sint_t (icu_get_highest_irq_t)(struct device_s *icu, uint_t type, uint_t output_irq);$/;"	t
+icu_get_mask	drivers/soclib/soclib_icu.c	/^static uint_t icu_get_mask(struct device_s *icu, uint_t type, uint_t output_irq)$/;"	f	file:
+icu_get_mask_t	kern/driver.h	/^typedef uint_t (icu_get_mask_t)(struct device_s *icu, uint_t type, uint_t output_irq);$/;"	t
+icu_irq_handler	drivers/soclib/soclib_icu.c	/^void icu_irq_handler (struct irq_action_s *action)$/;"	f
+icu_set_mask	drivers/soclib/soclib_icu.c	/^static void icu_set_mask(struct device_s *icu, uint_t mask, uint_t type, uint_t output_irq)$/;"	f	file:
+icu_set_mask_t	kern/driver.h	/^typedef void   (icu_set_mask_t)(struct device_s *icu, uint_t mask, uint_t type, uint_t output_irq);$/;"	t
+icu_vm_region_op	drivers/soclib/soclib_xicu.c	/^static struct vm_region_op_s icu_vm_region_op = $/;"	v	typeref:struct:vm_region_op_s	file:
+id	drivers/ibmpc/tty.h	/^	uint_t id;$/;"	m	struct:tty_context_s
+id	drivers/soclib/drvdb.h	/^	uint_t id;$/;"	m	struct:drvdb_entry_s
+id	drivers/soclib/soclib_tty.c	/^	uint_t id;$/;"	m	struct:tty_context_s	file:
+id	kern/cluster.h	/^	uint_t id;$/;"	m	struct:cluster_s
+id	kern/event.h	/^	void *id;$/;"	m	struct:__anon15
+id	kern/kdmsg.h	/^		uint_t id;$/;"	m	union:kdmsg_channel_s::__anon18
+id	libk/arch-bib.h	/^	uint8_t id;$/;"	m	struct:arch_bib_device_s
+idle_args	kern/kern_init.c	/^kthread_args_t idle_args;$/;"	v
+idt_entry_set	cpu/i386/cpu_internal.c	/^void idt_entry_set(struct cpu_idt_entry_s *entry,$/;"	f
+idt_ptr	cpu/i386/cpu_internal.c	/^struct cpu_idt_ptr_s idt_ptr __attribute__((aligned(8)));$/;"	v	typeref:struct:cpu_idt_ptr_s
+ifree_list_lock	vfs/vfs_cache.c	/^spinlock_t ifree_list_lock;$/;"	v
+ifreelist_add	vfs/vfs_cache.c	/^void ifreelist_add(struct vfs_inode_s *inode)$/;"	f
+ifreelist_get	vfs/vfs_cache.c	/^struct vfs_inode_s* ifreelist_get()$/;"	f
+img_name	ksh/sgiImg.h	/^  uint8_t    img_name[80];$/;"	m	struct:sgi_info_s
+import_nr	kern/scheduler.h	/^	uint16_t import_nr;$/;"	m	struct:scheduler_s
+in_channel	drivers/ibmpc/tty.h	/^	struct fifomwmr_s *in_channel;$/;"	m	struct:tty_context_s	typeref:struct:tty_context_s::fifomwmr_s
+index	kern/barrier.h	/^		uint_t index;$/;"	m	union:barrier_s::__anon6
+index	kern/dqdt.h	/^	uint_t index;$/;"	m	struct:dqdt_cluster_s
+index	kern/radix.h	/^	uint_t index;$/;"	m	struct:radix_item_info_s
+index	mm/page.h	/^		uint32_t index;$/;"	m	union:page_s::__anon48
+info	arch/tsar/mmu-info.h	/^	char *info;$/;"	m	struct:mmu_except_info_s
+info	drivers/ibmpc/ata.h	/^	struct ata_identify_s info;$/;"	m	struct:ata_params_s	typeref:struct:ata_params_s::ata_identify_s
+info	drivers/soclib/drvdb.h	/^	char *info;$/;"	m	struct:drvdb_entry_s
+info	kern/dqdt.h	/^	dqdt_estimation_t info;$/;"	m	struct:dqdt_cluster_s
+info	kern/thread.h	/^	struct thread_info info;      \/*! (exit value, statistics, ...) *\/$/;"	m	struct:thread_s	typeref:struct:thread_s::thread_info
+info	ksh/miniShell.c	/^  char *info;$/;"	m	struct:ksh_builtin_s	file:
+info1	drivers/ibmpc/ata.h	/^	uint16_t info1[37];$/;"	m	struct:ata_identify_s
+info2	drivers/ibmpc/ata.h	/^	uint16_t info2;$/;"	m	struct:ata_identify_s
+info3	drivers/ibmpc/ata.h	/^	uint16_t info3[10];$/;"	m	struct:ata_identify_s
+info4	drivers/ibmpc/ata.h	/^	uint32_t info4;$/;"	m	struct:ata_identify_s
+inheritsched	kern/thread.h	/^	uint_t inheritsched;$/;"	m	struct:__anon39
+init	kern/driver.h	/^	device_init_t   *init;		        \/* Mandatory Function *\/$/;"	m	struct:driver_s
+init	vfs/vfs.h	/^	vfs_init_inode_t *init;$/;"	m	struct:vfs_inode_op_s
+init_pages_table	mm/mapper.c	/^void init_pages_table(struct page_s **pages)$/;"	f
+ino	vfs/vfs.h	/^	uint32_t ino;$/;"	m	struct:vfs_icreate_s
+inode	vfs/vfs.c	/^	struct vfs_inode_ref_s inode;$/;"	m	struct:__vfs_open_s	typeref:struct:__vfs_open_s::vfs_inode_ref_s	file:
+inode	vfs/vfs.h	/^	struct vfs_inode_ref_s inode;$/;"	m	struct:vfs_lookup_response_s	typeref:struct:vfs_lookup_response_s::vfs_inode_ref_s
+inode_freelist	vfs/vfs_cache.c	/^struct slist_entry inode_freelist;$/;"	v	typeref:struct:slist_entry
+inode_hcompare	vfs/vfs_cache.c	/^bool_t inode_hcompare(struct hnode_s *hn, void* key)$/;"	f
+inode_hhash	vfs/vfs_cache.c	/^hash_t inode_hhash(void* key)$/;"	f
+int16_t	libk/stdint.h	/^typedef signed short int int16_t;$/;"	t
+int32_t	libk/stdint.h	/^typedef signed int int32_t;$/;"	t
+int64_t	libk/stdint.h	/^typedef signed long long int int64_t;$/;"	t
+int8_t	libk/stdint.h	/^typedef signed char int8_t;$/;"	t
+int_fast16_t	libk/stdint.h	/^typedef int32_t int_fast16_t;$/;"	t
+int_fast32_t	libk/stdint.h	/^typedef int32_t int_fast32_t;$/;"	t
+int_fast64_t	libk/stdint.h	/^typedef int64_t int_fast64_t;$/;"	t
+int_fast8_t	libk/stdint.h	/^typedef int32_t int_fast8_t;$/;"	t
+int_nr	cpu/i386/cpu-internal.h	/^	uint_t int_nr;$/;"	m	struct:cpu_regs_s
+inum	vfs/vfs_cache.c	/^	uint_t inum;$/;"	m	struct:icache_key	file:
+ioCluster_init	arch/ibmpc/arch_init.c	/^static void ioCluster_init(struct cluster_s *cluster, uint_t id)$/;"	f	file:
+io_clstr	kern/cluster.h	/^	uint_t io_clstr;$/;"	m	struct:cluster_s
+io_cluster_id	libk/boot-info.h	/^	uint_t io_cluster_id;$/;"	m	struct:boot_info_s
+io_map	cpu/i386/cpu-internal.h	/^	uint16_t io_map;$/;"	m	struct:cpu_tss_s
+iopic	kern/device.h	/^	struct device_s *iopic;$/;"	m	struct:device_s	typeref:struct:device_s::device_s
+iopic	kern/driver.h	/^		struct dev_iopic_op iopic;\/\/FG$/;"	m	union:driver_s::__anon12	typeref:struct:driver_s::__anon12::dev_iopic_op
+iopic_bind_wti_and_irq	drivers/soclib/soclib_iopic.c	/^void iopic_bind_wti_and_irq(struct device_s *iopic, struct device_s *dev)$/;"	f
+iopic_bind_wti_and_irq_t	kern/driver.h	/^typedef void (iopic_bind_wti_and_irq_t)(struct device_s *iopic, struct device_s *dev);$/;"	t
+iopic_cluster	libk/arch-bib.h	/^	uint16_t   iopic_cluster;	\/\/FG$/;"	m	struct:arch_bib_header_s
+iopic_count	drivers/soclib/soclib_iopic.c	/^static uint_t iopic_count = 0;$/;"	v	file:
+iopic_get_status	drivers/soclib/soclib_iopic.c	/^void iopic_get_status(struct device_s *iopic, uint_t wti_channel, uint_t *status)$/;"	f
+iopic_get_status_t	kern/driver.h	/^typedef void (iopic_get_status_t)(struct device_s *iopic, uint_t wti_channel, uint_t * status);$/;"	t
+iprintk	libk/iprintk.c	/^int iprintk (char *addr, uint_t cid, int inc, const char *fmt, va_list ap)$/;"	f
+irq	kern/device.h	/^	sint_t irq;                       \/*! irq number affected to the device *\/$/;"	m	struct:device_s
+irq	libk/arch-bib.h	/^	int16_t  irq;$/;"	m	struct:arch_bib_device_s
+irq_action_s	kern/device.h	/^struct irq_action_s$/;"	s
+irq_cpu_dmsg	kern/do_interrupt.c	/^#define irq_cpu_dmsg(/;"	d	file:
+irq_handler	kern/device.h	/^	irq_handler_t *irq_handler;       \/*! pointer to Interrupt Service Routine *\/$/;"	m	struct:irq_action_s
+irq_handler_t	kern/device.h	/^typedef void (irq_handler_t) (struct irq_action_s *action);$/;"	t
+irq_nr	kern/cpu.h	/^	uint_t irq_nr;$/;"	m	struct:cpu_s
+irq_vector	arch/tsar/arch.h	/^	struct irq_action_s *irq_vector[CONFIG_CPU_IRQ_NR];$/;"	m	struct:arch_cpu_s	typeref:struct:arch_cpu_s::irq_action_s
+irq_vector	drivers/ibmpc/pic.c	/^struct irq_action_s *irq_vector[PIC_IRQ_MAX];$/;"	v	typeref:struct:irq_action_s
+irq_vector	drivers/soclib/soclib_icu.c	/^	struct irq_action_s *irq_vector[ICU_IRQ_MAX];$/;"	m	struct:icu_context_s	typeref:struct:icu_context_s::irq_action_s	file:
+isAbsolute	vfs/vfs-private.h	/^	bool_t isAbsolute;$/;"	m	struct:vfs_lookup_path_s
+isAlt	drivers/ibmpc/tty.c	/^static uint_t isAlt;$/;"	v	file:
+isAtomic	kern/mwmr.c	/^	uint_t isAtomic;$/;"	m	struct:fifomwmr_s	file:
+isAtomic	mm/pmm.h	/^	bool_t isAtomic;$/;"	m	struct:pmm_page_info_s
+isBadCV	kern/sys_cond_var.c	/^static inline bool_t isBadCV(struct cv_s *cv)$/;"	f	file:
+isBadLock	kern/sys_rwlock.c	/^static inline bool_t isBadLock(struct rwlock_s *rwlock)$/;"	f	file:
+isBadSem	kern/sys_cond_var.c	/^static inline bool_t isBadSem(struct semaphore_s *sem)$/;"	f	file:
+isBadSem	kern/sys_sem.c	/^static inline bool_t isBadSem(struct semaphore_s *sem)$/;"	f	file:
+isCAPSLOCK	drivers/ibmpc/tty.c	/^static uint_t isCAPSLOCK;$/;"	v	file:
+isCtrl	drivers/ibmpc/tty.c	/^static uint_t isCtrl;$/;"	v	file:
+isDone	kern/sys_fork.c	/^	volatile bool_t   isDone;$/;"	m	struct:__anon34	file:
+isDone	kern/sys_thread_create.c	/^	volatile bool_t   isDone;$/;"	m	struct:__anon35	file:
+isLeftShift	drivers/ibmpc/tty.c	/^static uint_t isLeftShift;$/;"	v	file:
+isPinned	kern/sys_fork.c	/^	bool_t           isPinned;$/;"	m	struct:__anon34	file:
+isPinned	kern/sys_thread_create.c	/^	bool_t            isPinned;$/;"	m	struct:__anon35	file:
+isRightShift	drivers/ibmpc/tty.c	/^static uint_t isRightShift;$/;"	v	file:
+isRoot	vfs/vfs_init.c	/^	bool_t isRoot;$/;"	m	struct:fs_type_s	file:
+isTraced	kern/thread.h	/^	bool_t isTraced;$/;"	m	struct:thread_info
+isalpha	libk/ctype.c	/^int isalpha(int c)$/;"	f
+isprint	libk/ctype.c	/^int isprint(int c)$/;"	f
+isr_dmsg	kern/kdmsg.h	/^#define isr_dmsg(/;"	d
+isr_lock	arch/ibmpc/kdmsg.c	/^spinlock_t isr_lock;$/;"	v
+isr_lock	arch/tsar/kdmsg.c	/^DISTLOCK_DECLARE(isr_lock);$/;"	v
+isspace	libk/ctype.c	/^int isspace(int c)$/;"	f
+item	kern/mwmr.c	/^	uint_t item;$/;"	m	struct:fifomwmr_s	file:
+item	kern/radix.h	/^	void *item;$/;"	m	struct:radix_item_info_s
+item_get_base	kern/remote_fifo.c	/^void* item_get_base(struct remote_fifo_s *remote_fifo, uint_t pos)$/;"	f
+item_get_base_remote	kern/remote_fifo.c	/^void* item_get_base_remote(struct remote_fifo_s *remote_fifo, cid_t cid, uint_t pos)$/;"	f
+item_set	kern/remote_fifo.c	/^void item_set(struct remote_fifo_s *remote_fifo, cid_t cid, void *item, uint_t pos)$/;"	f
+item_size	kern/remote_fifo.h	/^	size_t	item_size;$/;"	m	struct:remote_fifo_s
+iter	fs/devfs/devfs-private.h	/^	struct metafs_iter_s iter;$/;"	m	struct:devfs_file_s	typeref:struct:devfs_file_s::metafs_iter_s
+iter	fs/ramfs/ramfs-private.h	/^	struct metafs_iter_s iter;$/;"	m	struct:ramfs_file_s	typeref:struct:ramfs_file_s::metafs_iter_s
+iter	fs/sysfs/sysfs-private.h	/^	struct metafs_iter_s iter;$/;"	m	struct:sysfs_file_s	typeref:struct:sysfs_file_s::metafs_iter_s
+itoa	cpu/i386/printk.c	/^void itoa(char *buf, unsigned long int n, int base)$/;"	f
+join	kern/thread.h	/^	struct thread_s *join;              \/*! points to waiting thread in join case *\/$/;"	m	struct:thread_info	typeref:struct:thread_info::thread_s
+joinable	kern/thread.h	/^	uint_t joinable;	  $/;"	m	struct:thread_s
+kMiniShelld	ksh/miniShell.c	/^void* kMiniShelld(void *arg)$/;"	f
+kX	cpu/i386/screen.h	/^char kX    = 0;                 \/* position courante du curseur a l'ecran *\/$/;"	v
+kY	cpu/i386/screen.h	/^char kY    = 0;$/;"	v
+k_runnable	kern/scheduler.h	/^	uint16_t k_runnable;$/;"	m	struct:scheduler_s
+kattr	cpu/i386/screen.h	/^char kattr = 0x02;              \/* attributs video des caracteres a afficher *\/$/;"	v
+kboot_entry	cpu/i386/boot.c	/^void kboot_entry(struct mb_partial_info_s *mbi)$/;"	f
+kboot_tty_base	arch/tsar/kdmsg.c	/^uint_t kboot_tty_base;$/;"	v
+kboot_tty_cid	arch/tsar/kdmsg.c	/^uint_t kboot_tty_cid;$/;"	v
+kboot_tty_init	arch/tsar/kdmsg.c	/^void kboot_tty_init(boot_info_t *info)$/;"	f
+kcm	kern/cluster.h	/^	struct kcm_s kcm;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::kcm_s
+kcm	mm/kcm.c	/^	struct kcm_s *kcm;$/;"	m	struct:page_info_s	typeref:struct:page_info_s::kcm_s	file:
+kcm_alloc	mm/kcm.c	/^void* kcm_alloc(struct kcm_s *kcm, uint_t flags)$/;"	f
+kcm_dmsg	kern/kdmsg.h	/^#define kcm_dmsg(/;"	d
+kcm_free	mm/kcm.c	/^void kcm_free (void *ptr)$/;"	f
+kcm_init	mm/kcm.c	/^error_t kcm_init(struct kcm_s *kcm,$/;"	f
+kcm_init_destroy_t	mm/kcm.h	/^typedef void           (kcm_init_destroy_t) (struct kcm_s *kcm, void *ptr);$/;"	t
+kcm_page_alloc	mm/kcm.c	/^struct page_s* kcm_page_alloc(struct kcm_s *kcm)$/;"	f
+kcm_page_alloc_t	mm/kcm.h	/^typedef struct page_s* (kcm_page_alloc_t)   (struct kcm_s *kcm);$/;"	t	typeref:struct:kcm_page_alloc_t
+kcm_page_free	mm/kcm.c	/^void kcm_page_free(struct kcm_s *kcm, struct page_s *page)$/;"	f
+kcm_page_free_t	mm/kcm.h	/^typedef void           (kcm_page_free_t)    (struct kcm_s *kcm, struct page_s *page);$/;"	t
+kcm_print	mm/kcm.c	/^void kcm_print(struct kcm_s *kcm)$/;"	f
+kcm_release	mm/kcm.c	/^void kcm_release(struct kcm_s *kcm)$/;"	f
+kcm_s	mm/kcm.h	/^struct kcm_s                      $/;"	s
+kcv_broadcast	kern/kcond_var.h	/^static inline uint_t kcv_broadcast(kcv_t *cv)$/;"	f
+kcv_destroy	kern/kcond_var.h	/^#define kcv_destroy(/;"	d
+kcv_destroy	kern/kcond_var.h	/^#undef kcv_destroy$/;"	d
+kcv_init	kern/kcond_var.h	/^#define kcv_init(/;"	d
+kcv_init	kern/kcond_var.h	/^#undef kcv_init$/;"	d
+kcv_signal	kern/kcond_var.h	/^#define kcv_signal(/;"	d
+kcv_signal	kern/kcond_var.h	/^#undef kcv_signal$/;"	d
+kcv_t	kern/kcond_var.h	/^typedef struct wait_queue_s kcv_t;		$/;"	t	typeref:struct:wait_queue_s
+kcv_wait	kern/kcond_var.h	/^#define kcv_wait(/;"	d
+kcv_wait	kern/kcond_var.h	/^#undef kcv_wait$/;"	d
+kdmsg_channel_s	kern/kdmsg.h	/^typedef struct kdmsg_channel_s$/;"	s
+kdmsg_channel_t	kern/kdmsg.h	/^}kdmsg_channel_t;$/;"	t	typeref:struct:kdmsg_channel_s
+kdmsg_init	arch/ibmpc/kdmsg.c	/^void kdmsg_init()$/;"	f
+kdmsg_init	arch/tsar/kdmsg.c	/^void kdmsg_init()$/;"	f
+kentry	cpu/mipsel/__cpu_kentry.S	/^kentry:$/;"	l
+kentry_exit	cpu/mipsel/__cpu_kentry.S	/^kentry_exit:$/;"	l
+kentry_load	cpu/mipsel/__cpu_kentry.S	/^kentry_load:$/;"	l
+kern_init	kern/kern_init.c	/^void kern_init (boot_info_t *info)$/;"	f
+kern_init	libk/boot-info.h	/^	uint_t kern_init;\/*7*\/$/;"	m	struct:kernel_info_s
+kernel_foreach	libk/utils.h	/^#define kernel_foreach(/;"	d
+kernel_foreach_backward	libk/utils.h	/^#define kernel_foreach_backward(/;"	d
+kernel_foreach_backward_init	libk/utils.h	/^#define kernel_foreach_backward_init(/;"	d
+kernel_info_s	libk/boot-info.h	/^typedef struct kernel_info_s$/;"	s
+kernel_info_t	libk/boot-info.h	/^}kernel_info_t;$/;"	t	typeref:struct:kernel_info_s
+kernel_iter_s	libk/utils.h	/^struct kernel_iter_s {$/;"	s
+kernel_list	libk/utils.h	/^struct kernel_iter_s kernel_list;$/;"	v	typeref:struct:kernel_iter_s
+kexcept_tty	arch/tsar/kdmsg.c	/^kdmsg_channel_t kexcept_tty = {{.id = 1}};$/;"	v
+kexec_copy	kern/do_exec.c	/^error_t kexec_copy(void *dst, void *src, uint_t count)$/;"	f
+kexec_strlen	kern/do_exec.c	/^error_t kexec_strlen(char *dst, uint_t *count)$/;"	f
+key	kern/radix.h	/^	uint_t key;$/;"	m	struct:radix_item_info_s
+key	kern/sys_thread_create.c	/^	pthread_t         key; $/;"	m	struct:__anon35	file:
+key	kern/thread.h	/^	uint_t key;$/;"	m	struct:__anon39
+key_width	kern/keysdb.h	/^	uint_t key_width;$/;"	m	struct:keysdb_s
+keyboard_map	drivers/ibmpc/tty.c	/^uint8_t keyboard_map[] = { 0x1B, 0x1B, 0x1B, 0x1B,$/;"	v
+keys_per_record	kern/keysdb.h	/^	uint_t keys_per_record;$/;"	m	struct:keysdb_s
+keys_record_s	kern/keysdb.c	/^struct keys_record_s$/;"	s	file:
+keys_record_t	kern/keysdb.c	/^typedef struct keys_record_s keys_record_t;$/;"	t	typeref:struct:keys_record_s	file:
+keys_tbl	kern/cluster.h	/^	void *keys_tbl[CLUSTER_TOTAL_KEYS_NR];$/;"	m	struct:cluster_s
+keysdb_bind	kern/keysdb.c	/^error_t keysdb_bind(struct keysdb_s *db, uint_t key_start, uint_t keys_nr, void *value)$/;"	f
+keysdb_destroy	kern/keysdb.c	/^error_t keysdb_destroy(struct keysdb_s *db)$/;"	f
+keysdb_index	kern/keysdb.c	/^static inline void keysdb_index(struct keysdb_s *db, uint_t key, uint_t *rec_index, uint_t *key_index)$/;"	f	file:
+keysdb_init	kern/keysdb.c	/^error_t keysdb_init(struct keysdb_s *db, uint_t key_width)$/;"	f
+keysdb_insert	kern/keysdb.c	/^error_t keysdb_insert(struct keysdb_s *db, uint_t key, void *value)$/;"	f
+keysdb_insert_seq	kern/keysdb.c	/^error_t keysdb_insert_seq(struct keysdb_s *db, uint_t key, void *value)$/;"	f
+keysdb_lookup	kern/keysdb.c	/^void* keysdb_lookup(struct keysdb_s *db, uint_t key)$/;"	f
+keysdb_print	kern/keysdb.c	/^void keysdb_print(struct keysdb_s *db)$/;"	f
+keysdb_record_print	kern/keysdb.c	/^void keysdb_record_print(keys_record_t *rec, uint_t index, uint_t size)$/;"	f
+keysdb_remove	kern/keysdb.c	/^void* keysdb_remove(struct keysdb_s *db, uint_t key)$/;"	f
+keysdb_s	kern/keysdb.h	/^struct keysdb_s$/;"	s
+keysdb_unbind	kern/keysdb.c	/^error_t keysdb_unbind(struct keysdb_s *db, uint_t key_start, uint_t keys_nr)$/;"	f
+keysrec_kmem_init	kern/keysdb.h	/^KMEM_OBJATTR_INIT(keysrec_kmem_init);$/;"	v
+kfifo_destroy	kern/kfifo.c	/^void kfifo_destroy(struct kfifo_s *kfifo)$/;"	f
+kfifo_get	kern/kfifo.h	/^static inline error_t kfifo_get(struct kfifo_s *kfifo, void **value)$/;"	f
+kfifo_get_t	kern/kfifo.h	/^typedef KFIFO_GET(kfifo_get_t);$/;"	t
+kfifo_init	kern/kfifo.c	/^error_t kfifo_init(struct kfifo_s *kfifo, size_t size, uint_t mode)$/;"	f
+kfifo_isEmpty	kern/kfifo.h	/^static inline bool_t kfifo_isEmpty(struct kfifo_s *kfifo)$/;"	f
+kfifo_isFull	kern/kfifo.h	/^static inline bool_t kfifo_isFull(struct kfifo_s *kfifo)$/;"	f
+kfifo_print	kern/kfifo.c	/^void kfifo_print(struct kfifo_s *kfifo)$/;"	f
+kfifo_put	kern/kfifo.h	/^static inline error_t kfifo_put(struct kfifo_s *kfifo, void *value)$/;"	f
+kfifo_put_t	kern/kfifo.h	/^typedef KFIFO_PUT(kfifo_put_t);$/;"	t
+kfifo_s	kern/kfifo.h	/^struct kfifo_s$/;"	s
+kheader	cpu/mipsel/__kheader.S	/^kheader:	$/;"	l
+kheap_limit	cpu/i386/boot.c	/^static uint_t kheap_limit;$/;"	v	file:
+kheap_start	cpu/i386/boot.c	/^static uint_t kheap_start;$/;"	v	file:
+khm	kern/cluster.h	/^	struct heap_manager_s khm;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::heap_manager_s
+khm_dmsg	kern/kdmsg.h	/^#define khm_dmsg(/;"	d
+kill_func	ksh/kill.c	/^error_t kill_func(void *param)$/;"	f
+kisr_tty	arch/tsar/kdmsg.c	/^kdmsg_channel_t kisr_tty = {{.id = 1}};$/;"	v
+kk_copy_from	kern/ku_transfert.c	/^uint_t kk_copy_from(struct ku_obj *kuo, void *ptr)$/;"	f
+kk_copy_to	kern/ku_transfert.c	/^uint_t kk_copy_to(struct ku_obj *kuo, void *ptr)$/;"	f
+kk_get_ppn	kern/ku_transfert.c	/^uint_t kk_get_ppn(struct ku_obj *kuo, ppn_t *ppns, size_t nb_ppn, bool_t write)$/;"	f
+kk_get_ppn_max	kern/ku_transfert.c	/^uint_t kk_get_ppn_max(struct ku_obj *kuo)$/;"	f
+kk_scpy_from	kern/ku_transfert.c	/^uint_t kk_scpy_from(struct ku_obj *kuo, void *ptr, uint_t size)$/;"	f
+kk_scpy_to	kern/ku_transfert.c	/^uint_t kk_scpy_to(struct ku_obj *kuo, void *ptr, uint_t size)$/;"	f
+kk_strlen	kern/ku_transfert.c	/^uint_t kk_strlen(struct ku_obj *kuo)$/;"	f
+kk_vma2ppn	kern/ku_transfert.c	/^ppn_t kk_vma2ppn(vma_t addr, bool_t write)$/;"	f
+klog_tty	arch/tsar/kdmsg.c	/^kdmsg_channel_t klog_tty = {{.id = 1}};$/;"	v
+kmem_alloc	mm/kmem.c	/^void* kmem_alloc(struct kmem_req_s *req)$/;"	f
+kmem_dmsg	kern/kdmsg.h	/^#define kmem_dmsg(/;"	d
+kmem_free	mm/kmem.c	/^void kmem_free(struct kmem_req_s *req)$/;"	f
+kmem_get_kcm	mm/kmem.c	/^error_t kmem_get_kcm(struct cluster_s *cluster, kmem_req_t *req, struct kmem_objattr_s *attr)$/;"	f
+kmem_init_t	mm/kmem.c	/^typedef KMEM_OBJATTR_INIT(kmem_init_t);$/;"	t	file:
+kmem_init_tbl	mm/kmem.c	/^static kmem_init_t * const kmem_init_tbl[KMEM_TYPES_NR] = {$/;"	v	file:
+kmem_kcm_alloc	mm/kmem.c	/^void* kmem_kcm_alloc(struct cluster_s *cluster, kmem_req_t *req)$/;"	f
+kmem_objattr_s	mm/kmem.h	/^struct kmem_objattr_s$/;"	s
+kmem_req_s	mm/kmem.h	/^typedef struct kmem_req_s$/;"	s
+kmem_req_t	mm/kmem.h	/^} kmem_req_t;$/;"	t	typeref:struct:kmem_req_s
+kmem_types_t	mm/kmem.h	/^}kmem_types_t;$/;"	t	typeref:enum:__anon46
+kprio_pages_min	mm/ppm.h	/^	uint_t kprio_pages_min;$/;"	m	struct:ppm_s
+ksh_builtin_s	ksh/miniShell.c	/^typedef struct ksh_builtin_s$/;"	s	file:
+ksh_builtin_t	ksh/miniShell.c	/^}ksh_builtin_t;$/;"	t	typeref:struct:ksh_builtin_s	file:
+ksh_cmd_t	ksh/kminiShell.h	/^typedef error_t (ksh_cmd_t)(void*);$/;"	t
+ksh_cpu_state_func	ksh/ksh_cpu_state.c	/^error_t ksh_cpu_state_func(void *param)$/;"	f
+ksh_exec_cmd	ksh/miniShell.c	/^static error_t ksh_exec_cmd(char *cmd, ms_args_t *args)$/;"	f	file:
+ksh_getLine	ksh/miniShellIo.c	/^ssize_t ksh_getLine(char *buff, int count)$/;"	f
+ksh_msg_buff	ksh/miniShellIo.c	/^static char ksh_msg_buff[MSG_STR_LEN];$/;"	v	file:
+ksh_print	ksh/miniShellIo.c	/^void ksh_print(const char *fmt, ...)$/;"	f
+ksh_print	ksh/ps.c	/^#define ksh_print(/;"	d	file:
+ksh_set_tty_func	ksh/ksh_set_tty.c	/^error_t ksh_set_tty_func(void *param)$/;"	f
+ksh_tty	ksh/miniShellIo.c	/^kdmsg_channel_t ksh_tty = {{.id = 0}};$/;"	v
+ksh_write	ksh/miniShellIo.c	/^void ksh_write(void *buff, size_t size)$/;"	f
+kstack_addr	kern/thread.h	/^	void  *kstack_addr;$/;"	m	struct:thread_info
+kstack_ptr	cpu/i386/cpu-asm.h	/^	reg_t kstack_ptr;$/;"	m	struct:cpu_context_s
+kstack_size	kern/thread.h	/^	uint_t kstack_size;$/;"	m	struct:thread_info
+kthread_args_s	kern/thread.h	/^struct kthread_args_s$/;"	s
+kthread_args_t	kern/thread.h	/^typedef struct kthread_args_s kthread_args_t;$/;"	t	typeref:struct:kthread_args_s
+kthread_create	kern/kthread_create.c	/^struct thread_s* kthread_create(struct task_s *task, kthread_t *kfunc, void *arg, uint_t cpu_lid)$/;"	f
+kthread_destroy	kern/thread_destroy.c	/^void kthread_destroy(struct thread_s *thread)$/;"	f
+kthread_exit	kern/kthread_create.c	/^static void kthread_exit(void)$/;"	f	file:
+kthread_t	kern/thread.h	/^typedef void* (kthread_t) (void *);$/;"	t
+kthreads	kern/rr-sched.c	/^	struct list_entry kthreads;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::list_entry	file:
+kthreads	kern/rr-sched_locked.c	/^	struct list_entry kthreads;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::list_entry	file:
+ktty_lock_t	kern/kdmsg.h	/^} ktty_lock_t;$/;"	t	typeref:enum:__anon17
+ku_copy_from	kern/ku_transfert.c	/^uint_t ku_copy_from(struct ku_obj *kuo, void *ptr)$/;"	f
+ku_copy_t	kern/ku_transfert.h	/^typedef uint_t ku_copy_t(struct ku_obj *kuo, void *ptr);$/;"	t
+ku_copy_to	kern/ku_transfert.c	/^uint_t ku_copy_to(struct ku_obj *kuo, void *ptr)$/;"	f
+ku_get_ppn	kern/ku_transfert.c	/^uint_t ku_get_ppn(struct ku_obj *kuo, ppn_t *ppns, size_t nb_ppn, bool_t write)$/;"	f
+ku_get_ppn_max	kern/ku_transfert.c	/^uint_t ku_get_ppn_max(struct ku_obj *kuo)$/;"	f
+ku_get_ppn_t	kern/ku_transfert.h	/^typedef uint_t ku_get_ppn_t(struct ku_obj *kuo, ppn_t *ppns, size_t nb_ppn, bool_t write);$/;"	t
+ku_obj	kern/ku_transfert.h	/^struct ku_obj{$/;"	s
+ku_scpy_from	kern/ku_transfert.c	/^uint_t ku_scpy_from(struct ku_obj *kuo, void *ptr, uint_t size)$/;"	f
+ku_scpy_t	kern/ku_transfert.h	/^typedef uint_t ku_scpy_t(struct ku_obj *kuo, void *ptr, uint_t size);$/;"	t
+ku_scpy_to	kern/ku_transfert.c	/^uint_t ku_scpy_to(struct ku_obj *kuo, void *ptr, uint_t size)$/;"	f
+ku_size_t	kern/ku_transfert.h	/^typedef uint_t ku_size_t(struct ku_obj *kuo);$/;"	t
+ku_strlen	kern/ku_transfert.c	/^uint_t ku_strlen(struct ku_obj *kuo)$/;"	f
+ku_vma2ppn	kern/ku_transfert.c	/^ppn_t ku_vma2ppn(vma_t addr, bool_t write)$/;"	f
+kvfsd	vfs/kvfsd.c	/^void* kvfsd(void *arg)$/;"	f
+last_allocated_index	fs/fat32/fat32.h	/^	vfat_sector_t last_allocated_index;$/;"	m	struct:vfat_context_s
+last_allocated_sector	fs/fat32/fat32.h	/^	vfat_sector_t last_allocated_sector;$/;"	m	struct:vfat_context_s
+last_mmap	mm/vmm.h	/^	uint_t last_mmap;$/;"	m	struct:vmm_s
+last_num	kern/cpu.h	/^	uint_t last_num;$/;"	m	struct:cpu_s
+last_region	mm/vmm.h	/^	struct vm_region_s *last_region;$/;"	m	struct:vmm_s	typeref:struct:vmm_s::vm_region_s
+lcpu	kern/thread.h	/^	struct cpu_s *lcpu;           \/*! pointer to the local CPU description structure *\/$/;"	m	struct:thread_s	typeref:struct:thread_s::cpu_s
+ldt	cpu/i386/cpu-internal.h	/^	uint16_t ldt,reserved_10;	\/* 24 *\/$/;"	m	struct:cpu_tss_s
+le_listner	kern/cpu.h	/^	struct event_listner_s le_listner;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::event_listner_s
+length	kern/mwmr.c	/^	uint_t length;$/;"	m	struct:fifomwmr_s	file:
+length	mm/vmm.h	/^	uint_t length; $/;"	m	struct:mmap_attr_s
+level	kern/dqdt.h	/^	uint_t level;$/;"	m	struct:dqdt_cluster_s
+levels_tbl	kern/cluster.h	/^	struct dqdt_cluster_s *levels_tbl[CONFIG_DQDT_LEVELS_NR];$/;"	m	struct:cluster_s	typeref:struct:cluster_s::dqdt_cluster_s
+lffb_dmsg	kern/kdmsg.h	/^#define lffb_dmsg(/;"	d
+li	kern/thread.h	/^	struct rpc_listner_s *li;$/;"	m	struct:thread_s	typeref:struct:thread_s::rpc_listner_s
+lid	kern/cpu.h	/^	uint_t lid;$/;"	m	struct:cpu_s
+limit	cpu/i386/cpu-internal.h	/^	uint16_t limit;$/;"	m	struct:cpu_gdt_ptr_s
+limit	cpu/i386/cpu-internal.h	/^	uint16_t limit;$/;"	m	struct:cpu_idt_ptr_s
+limit	mm/heap_manager.h	/^	uint_t limit;$/;"	m	struct:heap_manager_s
+limit_addr	mm/vmm.h	/^	uint_t limit_addr;$/;"	m	struct:vmm_s
+limit_low	cpu/i386/cpu-internal.h	/^	uint16_t limit_low;$/;"	m	struct:cpu_gdt_entry_s
+line	kern/cpu-trace.h	/^	uint_t line;$/;"	m	struct:cpu_trace_info_s
+list	kern/cluster.h	/^	struct list_entry list;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::list_entry
+list	kern/device.h	/^	struct list_entry list;$/;"	m	struct:device_s	typeref:struct:device_s::list_entry
+list	kern/driver.h	/^	struct list_entry list;$/;"	m	struct:dev_request_s	typeref:struct:dev_request_s::list_entry
+list	kern/htable.h	/^	struct list_entry list;	$/;"	m	struct:hnode_s	typeref:struct:hnode_s::list_entry
+list	kern/metafs.h	/^	struct list_entry list;$/;"	m	struct:metafs_s	typeref:struct:metafs_s::list_entry
+list	kern/task.h	/^	struct list_entry list;$/;"	m	struct:task_s	typeref:struct:task_s::list_entry
+list	kern/thread.h	/^	struct list_entry list;       \/*! next\/pred threads at the same state *\/$/;"	m	struct:thread_s	typeref:struct:thread_s::list_entry
+list	kern/time.h	/^	struct list_entry list;$/;"	m	struct:alarm_info_s	typeref:struct:alarm_info_s::list_entry
+list	mm/kcm.c	/^	struct list_entry list;$/;"	m	struct:page_info_s	typeref:struct:page_info_s::list_entry	file:
+list	mm/kcm.h	/^	struct list_entry list;$/;"	m	struct:kcm_s	typeref:struct:kcm_s::list_entry
+list	mm/page.h	/^	struct list_entry list;$/;"	m	struct:page_s	typeref:struct:page_s::list_entry
+list_add	libk/list.h	/^static inline void list_add(struct list_entry *root, struct list_entry *entry)$/;"	f
+list_add_first	libk/list.h	/^#define list_add_first(/;"	d
+list_add_last	libk/list.h	/^#define list_add_last(/;"	d
+list_add_next	libk/list.h	/^#define list_add_next(/;"	d
+list_add_pred	libk/list.h	/^#define list_add_pred(/;"	d
+list_assert_dead	libk/list.h	/^#define list_assert_dead(/;"	d
+list_container	libk/list.h	/^#define list_container(/;"	d
+list_element	libk/list.h	/^#define list_element(/;"	d
+list_empty	libk/list.h	/^#define list_empty(/;"	d
+list_entry	libk/list.h	/^struct list_entry{$/;"	s
+list_entry_init	libk/list.h	/^static inline void list_entry_init(struct list_entry *entry)$/;"	f
+list_first	libk/list.h	/^#define list_first(/;"	d
+list_foreach	libk/list.h	/^#define list_foreach(/;"	d
+list_foreach_backward	libk/list.h	/^#define list_foreach_backward(/;"	d
+list_foreach_forward	libk/list.h	/^#define list_foreach_forward(/;"	d
+list_head	libk/list.h	/^#define list_head(/;"	d
+list_last	libk/list.h	/^#define list_last(/;"	d
+list_next	libk/list.h	/^static inline struct list_entry* list_next(struct list_entry *root, struct list_entry *current)$/;"	f
+list_pop	libk/list.h	/^static inline struct slist_entry* list_pop(struct slist_entry *root)$/;"	f
+list_pred	libk/list.h	/^static inline struct list_entry* list_pred(struct list_entry *root, struct list_entry *current)$/;"	f
+list_push	libk/list.h	/^#define list_push(/;"	d
+list_replace	libk/list.h	/^static inline void list_replace(struct list_entry *current, struct list_entry *new)$/;"	f
+list_root_init	libk/list.h	/^static inline void list_root_init(struct list_entry *root)$/;"	f
+list_unlink	libk/list.h	/^static inline void list_unlink(struct list_entry *entry)$/;"	f
+listner	kern/barrier.c	/^	void* listner;$/;"	m	struct:wqdb_record_s	file:
+loadable	cpu/i386/cpu-asm.h	/^	reg_t loadable;$/;"	m	struct:cpu_context_s
+loadable	cpu/mipsel/cpu-asm.h	/^	reg_t loadable;		        \/* 14 *\/$/;"	m	struct:cpu_context_s
+local_boot_signal	kern/kern_init.c	/^volatile uint_t local_boot_signal;$/;"	v
+local_bscpu	kern/cluster.h	/^	struct cpu_s *local_bscpu;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::cpu_s
+local_cluster_id	libk/boot-info.h	/^	uint_t local_cluster_id;$/;"	m	struct:boot_info_s
+local_cpu_id	libk/boot-info.h	/^	uint_t local_cpu_id;$/;"	m	struct:boot_info_s
+local_cpu_nr	libk/boot-info.h	/^	uint_t local_cpu_nr;$/;"	m	struct:boot_info_s
+local_event_listner_notify	kern/event.c	/^static void local_event_listner_notify(struct event_listner_s *el)$/;"	f	file:
+local_event_send	kern/event.c	/^static void local_event_send(struct event_s *event, struct event_listner_s *el, bool_t isFIFO) $/;"	f	file:
+local_onln_cpu_nr	libk/boot-info.h	/^	uint_t local_onln_cpu_nr;$/;"	m	struct:boot_info_s
+local_sched	kern/thread.h	/^	struct sched_s *local_sched;  \/*! pointer to the local scheduler structure *\/$/;"	m	struct:thread_s	typeref:struct:thread_s::sched_s
+lock	fs/devfs/devfs-private.h	/^	spinlock_t lock;$/;"	m	struct:devfs_db_s
+lock	fs/fat32/fat32.h	/^	struct rwlock_s lock;$/;"	m	struct:vfat_context_s	typeref:struct:vfat_context_s::rwlock_s
+lock	kern/barrier.h	/^		spinlock_t lock;$/;"	m	union:barrier_s::__anon5
+lock	kern/blkio.h	/^		spinlock_t		lock;		$/;"	m	struct:blkio_s::__anon7
+lock	kern/cluster.h	/^	spinlock_t lock;$/;"	m	struct:cluster_s
+lock	kern/cond_var.h	/^	spinlock_t lock;$/;"	m	struct:cv_s
+lock	kern/device.h	/^	spinlock_t lock;		  \/*! lock to guarantee mutual exclusion accesses *\/$/;"	m	struct:device_s
+lock	kern/mwmr.c	/^	spinlock_t lock;$/;"	m	struct:fifomwmr_s	file:
+lock	kern/rr-sched_locked.c	/^	spinlock_t lock;$/;"	m	struct:rQueues_s	file:
+lock	kern/rwlock.h	/^	mcs_lock_t lock;$/;"	m	struct:rwlock_s
+lock	kern/scheduler.c	/^	spinlock_t lock;$/;"	m	struct:sched_db_s	file:
+lock	kern/semaphore.h	/^	spinlock_t lock;$/;"	m	struct:semaphore_s
+lock	kern/task.h	/^	spinlock_t lock;$/;"	m	struct:fd_info_s
+lock	kern/task.h	/^	spinlock_t lock;$/;"	m	struct:task_s
+lock	kern/thread.h	/^	spinlock_t lock;$/;"	m	struct:thread_s
+lock	mm/heap_manager.h	/^	spinlock_t lock;$/;"	m	struct:heap_manager_s
+lock	mm/kcm.h	/^	spinlock_t lock;$/;"	m	struct:kcm_s
+lock	mm/page.c	/^	spinlock_t		lock;$/;"	m	struct:dirty_pages_s	file:
+lock	mm/page.h	/^	slock_t    lock;$/;"	m	struct:page_s
+lock	mm/ppm.h	/^	spinlock_t lock;$/;"	m	struct:ppm_s
+lock	mm/vmm.h	/^	spinlock_t lock;$/;"	m	struct:vmm_s
+lock	vfs/vfs-private.h	/^	spinlock_t lock;			\/* FIXME: should be spin_rwlock *\/$/;"	m	struct:vfs_freelist_s
+lock	vfs/vfs-private.h	/^	spinlock_t lock;$/;"	m	struct:vfs_file_freelist_s
+locked_nr	mm/vmm.h	/^	uint_t locked_nr;$/;"	m	struct:vmm_s
+locks_count	kern/thread.h	/^	error_t locks_count;	      \/*! number of locks which are locked by the current thread *\/$/;"	m	struct:thread_s
+log	kern/cpu-trace.h	/^	cpu_trace_info_t log[CPU_TRACE_LOG_LENGTH];$/;"	m	struct:cpu_trace_recorder_s
+lookup	vfs/vfs.h	/^	vfs_lookup_inode_t *lookup;$/;"	m	struct:vfs_inode_op_s
+lookup_flags	vfs/vfs.c	/^	uint32_t lookup_flags;$/;"	m	struct:__vfs_stat_s	file:
+lookup_flags	vfs/vfs.c	/^	uint_t lookup_flags;$/;"	m	struct:__vfs_open_s	file:
+lookup_flags	vfs/vfs.h	/^	uint_t lookup_flags;$/;"	m	struct:vfs_lookup_response_s
+lookup_flags	vfs/vfs.h	/^	uint_t lookup_flags;$/;"	m	struct:vfs_lookup_s
+low_mem	cpu/i386/boot.c	/^	unsigned long low_mem;$/;"	m	struct:mb_partial_info_s	file:
+ls_func	ksh/ls.c	/^error_t ls_func(void *param)$/;"	f
+lseek	kern/driver.h	/^	device_request_t *lseek;$/;"	m	struct:dev_icu_op
+lseek	kern/driver.h	/^	device_request_t *lseek;$/;"	m	struct:dev_op
+lseek	vfs/vfs.h	/^	vfs_lseek_file_t *lseek;$/;"	m	struct:vfs_file_op_s
+ltid	kern/thread.h	/^	uint_t ltid;$/;"	m	struct:thread_s
+m_cache_lock	mm/mapper.h	/^	#define m_cache_lock /;"	d
+m_cnt	mm/mapper.h	/^		struct mapper_cnt_s*	m_cnt;$/;"	m	struct:mapper_s	typeref:struct:mapper_s::mapper_cnt_s
+m_data	mm/mapper.h	/^	#define m_data /;"	d
+m_err_nr	kern/thread.h	/^	uint_t m_err_nr;$/;"	m	struct:thread_info
+m_err_nr	mm/vmm.h	/^	uint_t m_err_nr;$/;"	m	struct:vmm_s
+m_home	mm/mapper.h	/^		struct mapper_s*	m_home;$/;"	m	struct:mapper_s	typeref:struct:mapper_s::mapper_s
+m_home_cid	mm/mapper.h	/^	cid_t			m_home_cid;$/;"	m	struct:mapper_s
+m_inode	mm/mapper.h	/^	#define m_inode /;"	d
+m_lock	mm/mapper.h	/^	#define m_lock /;"	d
+m_ops	mm/mapper.h	/^	#define m_ops /;"	d
+m_radix	mm/mapper.h	/^	#define m_radix /;"	d
+m_refcount	mm/mapper.h	/^	#define m_refcount /;"	d
+m_reg_lock	mm/mapper.h	/^	#define m_reg_lock /;"	d
+m_reg_root	mm/mapper.h	/^	#define m_reg_root /;"	d
+m_runnable	kern/rr-sched.c	/^	uint_t m_runnable;$/;"	m	struct:rQueues_s	file:
+m_runnable	kern/rr-sched_locked.c	/^	uint_t m_runnable;$/;"	m	struct:rQueues_s	file:
+m_threshold	kern/dqdt.h	/^	uint_t m_threshold;$/;"	m	struct:dqdt_attr_s
+magic	ksh/sgiImg.h	/^  uint16_t   magic;$/;"	m	struct:sgi_info_s
+mailbox	kern/device.h	/^	uint64_t mailbox;$/;"	m	struct:device_s
+main_cpu_local_id	libk/boot-info.h	/^	uint_t main_cpu_local_id;$/;"	m	struct:boot_info_s
+manager	kern/cluster.h	/^	struct thread_s *manager;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::thread_s
+map_args	kern/do_exec.c	/^error_t map_args(struct task_s *task,$/;"	f
+mapper	fs/fat32/fat32.h	/^	struct mapper_s *mapper;$/;"	m	struct:vfat_context_s	typeref:struct:vfat_context_s::mapper_s
+mapper	mm/page.h	/^	struct mapper_s *mapper;$/;"	m	struct:page_s	typeref:struct:page_s::mapper_s
+mapper	vfs/vfs.c	/^	struct mapper_s *mapper;$/;"	m	struct:__vfs_open_s	typeref:struct:__vfs_open_s::mapper_s	file:
+mapper_add_page	mm/mapper.c	/^error_t mapper_add_page(struct mapper_s *mapper, struct page_s* page, uint_t index)$/;"	f
+mapper_buff_s	mm/mapper.h	/^struct mapper_buff_s{$/;"	s
+mapper_clear_page_dirty_t	mm/mapper.h	/^typedef MAPPER_CLEAR_PAGE_DIRTY(mapper_clear_page_dirty_t);$/;"	t
+mapper_cnt_kmem_init	mm/mapper.h	/^KMEM_OBJATTR_INIT(mapper_cnt_kmem_init);$/;"	v
+mapper_cnt_s	mm/mapper.h	/^struct mapper_cnt_s$/;"	s
+mapper_ctor	mm/mapper.c	/^static void mapper_ctor(struct kcm_s *kcm, void *ptr) $/;"	f	file:
+mapper_default_clear_page_dirty	mm/mapper.h	/^MAPPER_CLEAR_PAGE_DIRTY(mapper_default_clear_page_dirty);$/;"	v
+mapper_default_read_page	mm/mapper.h	/^MAPPER_READ_PAGE(mapper_default_read_page);$/;"	v
+mapper_default_release_page	mm/mapper.h	/^MAPPER_RELEASE_PAGE(mapper_default_release_page);$/;"	v
+mapper_default_set_page_dirty	mm/mapper.h	/^MAPPER_SET_PAGE_DIRTY(mapper_default_set_page_dirty);$/;"	v
+mapper_default_sync_page	mm/mapper.h	/^MAPPER_SYNC_PAGE(mapper_default_sync_page);$/;"	v
+mapper_default_write_page	mm/mapper.h	/^MAPPER_READ_PAGE(mapper_default_write_page);$/;"	v
+mapper_destroy	mm/mapper.c	/^void mapper_destroy(struct mapper_s *mapper, bool_t doSync)$/;"	f
+mapper_dmsg	kern/kdmsg.h	/^#define mapper_dmsg(/;"	d
+mapper_find_page	mm/mapper.c	/^struct page_s* mapper_find_page(struct mapper_s* mapper, uint_t index) $/;"	f
+mapper_find_pages	mm/mapper.c	/^uint_t mapper_find_pages(struct mapper_s* mapper, $/;"	f
+mapper_find_pages_by_tag	mm/mapper.c	/^uint_t mapper_find_pages_by_tag(struct mapper_s* mapper, $/;"	f
+mapper_find_pages_contig	mm/mapper.c	/^uint_t mapper_find_pages_contig(struct mapper_s* mapper, $/;"	f
+mapper_get_page	mm/mapper.c	/^struct page_s* mapper_get_page(struct mapper_s*	mapper, uint_t index, uint_t flags)$/;"	f
+mapper_get_ppn	mm/mapper.c	/^ppn_t mapper_get_ppn(struct mapper_s* mapper, uint_t index, uint_t flags)$/;"	f
+mapper_init	mm/mapper.c	/^error_t mapper_init(struct mapper_s *mapper, $/;"	f
+mapper_kmem_init	mm/mapper.h	/^KMEM_OBJATTR_INIT(mapper_kmem_init);$/;"	v
+mapper_op_s	mm/mapper.h	/^struct mapper_op_s $/;"	s
+mapper_read	mm/mapper.c	/^error_t mapper_read(struct mapper_s* mapper, struct mapper_buff_s *mp_buffs, $/;"	f
+mapper_read_page_t	mm/mapper.h	/^typedef MAPPER_READ_PAGE(mapper_read_page_t);$/;"	t
+mapper_release_page_t	mm/mapper.h	/^typedef MAPPER_RELEASE_PAGE(mapper_release_page_t);$/;"	t
+mapper_remove_page	mm/mapper.c	/^void mapper_remove_page(struct page_s *page)$/;"	f
+mapper_replicate	mm/mapper.c	/^error_t mapper_replicate(struct mapper_s* mapper,$/;"	f
+mapper_request	mm/mapper.c	/^error_t mapper_request(struct mapper_s* mapper, $/;"	f
+mapper_s	mm/mapper.h	/^struct mapper_s $/;"	s
+mapper_set_auto_migrate	mm/mapper.c	/^uint_t mapper_set_auto_migrate(struct mapper_s* mapper)$/;"	f
+mapper_set_page_dirty_t	mm/mapper.h	/^typedef MAPPER_SET_PAGE_DIRTY(mapper_set_page_dirty_t);$/;"	t
+mapper_sync_page_t	mm/mapper.h	/^typedef MAPPER_SYNC_PAGE(mapper_sync_page_t);$/;"	t
+mapper_write	mm/mapper.c	/^error_t mapper_write(struct mapper_s* mapper, struct mapper_buff_s *mp_buffs, $/;"	f
+mapper_write_page_t	mm/mapper.h	/^typedef MAPPER_WRITE_PAGE(mapper_write_page_t);$/;"	t
+max	kern/task.h	/^        uint_t max;$/;"	m	struct:fd_info_s
+max	mm/kmem.h	/^  uint_t max;$/;"	m	struct:kmem_objattr_s
+max_key	kern/radix.h	/^	uint32_t		        max_key;$/;"	m	struct:radix_s
+max_order	kern/task.h	/^	uint_t max_order;$/;"	m	struct:task_s
+max_ppns	mm/mapper.h	/^	size_t max_ppns;$/;"	m	struct:mapper_buff_s
+mb_partial_info_s	cpu/i386/boot.c	/^struct mb_partial_info_s $/;"	s	file:
+mc_cache_lock	mm/mapper.h	/^	spinlock_t		     	        mc_cache_lock;$/;"	m	struct:mapper_cnt_s
+mc_data	mm/mapper.h	/^	void*				            mc_data;		\/\/ private data$/;"	m	struct:mapper_cnt_s
+mc_inode	mm/mapper.h	/^	struct vfs_inode_s*             mc_inode;	    \/\/ owner$/;"	m	struct:mapper_cnt_s	typeref:struct:mapper_cnt_s::vfs_inode_s
+mc_lock	mm/mapper.h	/^	mcs_lock_t                      mc_lock;$/;"	m	struct:mapper_cnt_s
+mc_ops	mm/mapper.h	/^	const struct mapper_op_s*    	mc_ops;		    \/\/ operations$/;"	m	struct:mapper_cnt_s	typeref:struct:mapper_cnt_s::mapper_op_s
+mc_radix	mm/mapper.h	/^	radix_t			     	        mc_radix;	    \/\/ pages depot$/;"	m	struct:mapper_cnt_s
+mc_refcount	mm/mapper.h	/^	atomic_t			            mc_refcount;$/;"	m	struct:mapper_cnt_s
+mc_reg_lock	mm/mapper.h	/^	struct rwlock_s                 mc_reg_lock;$/;"	m	struct:mapper_cnt_s	typeref:struct:mapper_cnt_s::rwlock_s
+mc_reg_root	mm/mapper.h	/^	struct list_entry		        mc_reg_root;$/;"	m	struct:mapper_cnt_s	typeref:struct:mapper_cnt_s::list_entry
+mcs_barrier_flush	kern/mcs_sync.c	/^#define mcs_barrier_flush(/;"	d	file:
+mcs_barrier_init	kern/mcs_sync.c	/^void mcs_barrier_init(mcs_barrier_t *ptr, char *name, uint_t count)$/;"	f
+mcs_barrier_s	kern/mcs_sync.h	/^struct mcs_barrier_s$/;"	s
+mcs_barrier_t	kern/mcs_sync.h	/^typedef struct mcs_barrier_s mcs_barrier_t;$/;"	t	typeref:struct:mcs_barrier_s
+mcs_barrier_wait	kern/mcs_sync.c	/^void mcs_barrier_wait(mcs_barrier_t *ptr)$/;"	f
+mcs_lock	kern/mcs_sync.c	/^void mcs_lock(mcs_lock_t *ptr, uint_t *irq_state)$/;"	f
+mcs_lock_init	kern/mcs_sync.c	/^void mcs_lock_init(mcs_lock_t *ptr, char *name)$/;"	f
+mcs_lock_remote	kern/mcs_sync.c	/^void mcs_lock_remote(mcs_lock_t *ptr, cid_t cid, uint_t *irq_state)$/;"	f
+mcs_lock_s	kern/mcs_sync.h	/^struct mcs_lock_s$/;"	s
+mcs_lock_t	kern/mcs_sync.h	/^typedef struct mcs_lock_s mcs_lock_t;$/;"	t	typeref:struct:mcs_lock_s
+mcs_unlock	kern/mcs_sync.c	/^void mcs_unlock(mcs_lock_t *ptr, uint_t irq_state)$/;"	f
+mcs_unlock_remote	kern/mcs_sync.c	/^void mcs_unlock_remote(mcs_lock_t *ptr, cid_t cid, uint_t irq_state)$/;"	f
+memc_count	drivers/soclib/soclib_memc.c	/^static uint_t memc_count = 0;$/;"	v	file:
+memc_get_params	drivers/soclib/soclib_memc.c	/^static sint_t memc_get_params(struct device_s *memc, dev_params_t *params)$/;"	f	file:
+memc_lseek	drivers/soclib/soclib_memc.c	/^static error_t memc_lseek(struct device_s *memc, dev_request_t *rq)$/;"	f	file:
+memc_mmap	drivers/soclib/soclib_memc.c	/^static error_t memc_mmap(struct device_s *memc, dev_request_t *rq)$/;"	f	file:
+memc_munmap	drivers/soclib/soclib_memc.c	/^static error_t memc_munmap(struct device_s *memc, dev_request_t *rq)$/;"	f	file:
+memc_open	drivers/soclib/soclib_memc.c	/^static sint_t memc_open(struct device_s *memc, dev_request_t *rq)$/;"	f	file:
+memc_read	drivers/soclib/soclib_memc.c	/^static sint_t memc_read(struct device_s *memc, dev_request_t *rq)$/;"	f	file:
+memc_vm_region_op	drivers/soclib/soclib_memc.c	/^static struct vm_region_op_s memc_vm_region_op = $/;"	v	typeref:struct:vm_region_op_s	file:
+memc_write	drivers/soclib/soclib_memc.c	/^static sint_t memc_write(struct device_s *memc, dev_request_t *rq)$/;"	f	file:
+memcpy	libk/memcpy.c	/^void *memcpy (void *dest, void *src, unsigned long size)$/;"	f
+memset	libk/memset.c	/^void *memset(void *s, int c, unsigned int size)$/;"	f
+metafs_container	kern/metafs.h	/^#define metafs_container(/;"	d
+metafs_container	kern/metafs.h	/^#undef metafs_container$/;"	d
+metafs_get_children_nr	kern/metafs.h	/^#define metafs_get_children_nr(/;"	d
+metafs_get_children_nr	kern/metafs.h	/^#undef metafs_get_children_nr$/;"	d
+metafs_get_name	kern/metafs.h	/^#define metafs_get_name(/;"	d
+metafs_get_name	kern/metafs.h	/^#undef metafs_get_name$/;"	d
+metafs_hasChild	kern/metafs.h	/^#define metafs_hasChild(/;"	d
+metafs_hasChild	kern/metafs.h	/^#undef metafs_hasChild$/;"	d
+metafs_hash_index	kern/metafs.h	/^static inline uint_t metafs_hash_index(char *dev_name)$/;"	f
+metafs_init	kern/metafs.h	/^static inline void metafs_init(struct metafs_s *node, char *name)$/;"	f
+metafs_iter_init	kern/metafs.h	/^static inline void metafs_iter_init(struct metafs_s *node, struct metafs_iter_s *iter)$/;"	f
+metafs_iter_s	kern/metafs.h	/^struct metafs_iter_s$/;"	s
+metafs_lookup	kern/metafs.h	/^static inline struct metafs_s* metafs_lookup(struct metafs_s *parent, char *name)$/;"	f
+metafs_lookup_next	kern/metafs.h	/^static inline struct metafs_s* metafs_lookup_next(struct metafs_s *parent, struct metafs_iter_s *iter)$/;"	f
+metafs_print	kern/metafs.h	/^static inline void metafs_print(struct metafs_s *node)$/;"	f
+metafs_register	kern/metafs.h	/^static inline void metafs_register(struct metafs_s *parent, struct metafs_s *child)$/;"	f
+metafs_s	kern/metafs.h	/^struct metafs_s$/;"	s
+metafs_set_name	kern/metafs.h	/^#define metafs_set_name(/;"	d
+metafs_set_name	kern/metafs.h	/^#undef metafs_set_name$/;"	d
+metafs_unregister	kern/metafs.h	/^#define metafs_unregister(/;"	d
+metafs_unregister	kern/metafs.h	/^#undef metafs_unregister$/;"	d
+mi_cid	mm/page.h	/^	uint_t mi_cid;$/;"	m	struct:minfo_s
+mi_cx	mm/page.h	/^	uint_t mi_cx;$/;"	m	struct:minfo_s
+mi_cy	mm/page.h	/^	uint_t mi_cy;$/;"	m	struct:minfo_s
+mi_cz	mm/page.h	/^	uint_t mi_cz;$/;"	m	struct:minfo_s
+migrate	kern/rr-sched.c	/^	struct list_entry migrate;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::list_entry	file:
+migrate	kern/rr-sched_locked.c	/^	struct list_entry migrate;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::list_entry	file:
+migration_cntr	kern/thread.h	/^	uint_t migration_cntr;$/;"	m	struct:thread_info
+migration_fail_cntr	kern/thread.h	/^	uint_t migration_fail_cntr;$/;"	m	struct:thread_info
+millitm	kern/time.h	/^	unsigned short millitm;$/;"	m	struct:timeb
+min	mm/kmem.h	/^  uint_t min;$/;"	m	struct:kmem_objattr_s
+minfo_s	mm/page.h	/^struct minfo_s$/;"	s
+minfo_t	mm/page.h	/^typedef struct minfo_s minfo_t;$/;"	t	typeref:struct:minfo_s
+mips_get_cp2	cpu/mipsel/cpu-asm.h	/^#define mips_get_cp2(/;"	d
+mips_remote_load	cpu/mipsel/cpu-remote.h	/^#define mips_remote_load(/;"	d
+mips_remote_store	cpu/mipsel/cpu-remote.h	/^#define mips_remote_store(/;"	d
+mips_set_cp2	cpu/mipsel/cpu-asm.h	/^#define mips_set_cp2(/;"	d
+mkdir_func	ksh/mkdir_func.c	/^error_t mkdir_func(void *param)$/;"	f
+mkfifo_func	ksh/mkfifo_func.c	/^error_t mkfifo_func(void *param)$/;"	f
+mmap	kern/driver.h	/^	device_request_t *mmap;$/;"	m	struct:dev_icu_op
+mmap	kern/driver.h	/^	device_request_t *mmap;$/;"	m	struct:dev_op
+mmap	vfs/vfs.h	/^	vfs_mmap_file_t *mmap;$/;"	m	struct:vfs_file_op_s
+mmap_attr_s	mm/vmm.h	/^typedef struct mmap_attr_s$/;"	s
+mmap_attr_t	mm/vmm.h	/^}mmap_attr_t;$/;"	t	typeref:struct:mmap_attr_s
+mmu_except_db	arch/tsar/mmu-info.c	/^static mmu_except_info_t mmu_except_db[] = $/;"	v	file:
+mmu_except_get_entry	arch/tsar/mmu-info.c	/^inline mmu_except_info_t* mmu_except_get_entry(uint_t mmu_err_val)$/;"	f
+mmu_except_info_s	arch/tsar/mmu-info.h	/^struct mmu_except_info_s$/;"	s
+mmu_except_info_t	arch/tsar/mmu-info.h	/^typedef struct mmu_except_info_s mmu_except_info_t;$/;"	t	typeref:struct:mmu_except_info_s
+mmu_exception_handler	cpu/mipsel/cpu_do_exception.c	/^error_t mmu_exception_handler(reg_t cpu_id, reg_t *regs_tbl, uint_t mmu_err_val, uint_t mmu_bad_vaddr)$/;"	f
+mmu_mode	cpu/mipsel/cpu-asm.h	/^	reg_t mmu_mode;			\/* 23 *\/$/;"	m	struct:cpu_context_s
+mode	cpu/i386/cpu-asm.h	/^	reg_t mode;$/;"	m	struct:cpu_context_s
+mode	vfs/vfs-private.h	/^	uint_t mode;$/;"	m	struct:vfs_lookup_path_s
+mode	vfs/vfs.h	/^	uint_t mode;$/;"	m	struct:vfs_lookup_s
+move_cursor	cpu/i386/screen.c	/^void move_cursor(uint8_t x, uint8_t y)$/;"	f
+ms_args_t	ksh/kminiShell.h	/^}ms_args_t;$/;"	t	typeref:struct:ms_argument_s
+ms_argument_s	ksh/kminiShell.h	/^typedef struct ms_argument_s$/;"	s
+ms_n_cwd	ksh/miniShell.c	/^struct vfs_file_s *ms_n_cwd ;$/;"	v	typeref:struct:vfs_file_s
+multiboot_header	cpu/i386/__boot.S	/^multiboot_header:$/;"	l
+munmap	kern/driver.h	/^	device_request_t *munmap;$/;"	m	struct:dev_icu_op
+munmap	kern/driver.h	/^	device_request_t *munmap;$/;"	m	struct:dev_op
+munmap	vfs/vfs.h	/^	vfs_munmap_file_t *munmap;$/;"	m	struct:vfs_file_op_s
+mwmr_destroy	kern/mwmr.c	/^void mwmr_destroy(struct fifomwmr_s *fifo)$/;"	f
+mwmr_init	kern/mwmr.c	/^struct fifomwmr_s* mwmr_init(int item, int length, int isAtomic)$/;"	f
+mwmr_read	kern/mwmr.c	/^int mwmr_read(struct fifomwmr_s *fifo, void *buffer, size_t size)$/;"	f
+mwmr_write	kern/mwmr.c	/^int mwmr_write(struct fifomwmr_s *fifo, void *buffer, size_t size)$/;"	f
+name	arch/tsar/mmu-info.h	/^	char *name;$/;"	m	struct:mmu_except_info_s
+name	cpu/mipsel/cpu_do_exception.c	/^	char *name;$/;"	m	struct:cpu_except_info_s	file:
+name	drivers/soclib/drvdb.h	/^	char *name;$/;"	m	struct:drvdb_entry_s
+name	kern/barrier.h	/^	const char *name;$/;"	m	struct:barrier_s
+name	kern/cluster.h	/^	char name[SYSFS_NAME_LEN];$/;"	m	struct:cluster_entry_s
+name	kern/cpu.h	/^	char name[SYSFS_NAME_LEN];$/;"	m	struct:cpu_s
+name	kern/device.h	/^	char name[DEV_MAX_NAME];	  \/*! device name *\/$/;"	m	struct:device_s
+name	kern/metafs.h	/^	char *name;$/;"	m	struct:metafs_s
+name	kern/spinlock.h	/^	char *name;$/;"	m	struct:spinlock_s
+name	kern/wait_queue.h	/^	const char *name;$/;"	m	struct:wait_queue_s
+name	ksh/miniShell.c	/^  char *name;$/;"	m	struct:ksh_builtin_s	file:
+name	mm/kcm.h	/^	char *name;$/;"	m	struct:kcm_s
+name	mm/kmem.h	/^  char *name;$/;"	m	struct:kmem_objattr_s
+name	vfs/vfs_init.c	/^	const char *name;$/;"	m	struct:fs_type_s	file:
+nb_buckets	kern/htable.h	/^	uint_t nb_buckets;$/;"	m	struct:hheader_s
+new_thread	kern/sys_thread_create.c	/^	struct thread_s   *new_thread;$/;"	m	struct:__anon35	typeref:struct:__anon35::thread_s	file:
+next	kern/scheduler.c	/^	cacheline_t next;$/;"	m	struct:sched_db_s	file:
+next	libk/list.h	/^	struct list_entry *next;$/;"	m	struct:list_entry	typeref:struct:list_entry::list_entry
+next	libk/list.h	/^	struct slist_entry *next;$/;"	m	struct:slist_entry	typeref:struct:slist_entry::slist_entry
+next	mm/heap_manager.h	/^	uint_t next;$/;"	m	struct:heap_manager_s
+next_cntr	drivers/soclib/soclib_xicu.c	/^	uint_t next_cntr;$/;"	m	struct:xicu_context_s	file:
+next_key	kern/cluster.h	/^	uint_t next_key;$/;"	m	struct:cluster_s
+next_order	kern/task.h	/^	uint_t next_order;$/;"	m	struct:task_s
+no	libk/config.h	/^#define no /;"	d
+node	fs/sysfs/sysfs-private.h	/^	struct metafs_s *node;$/;"	m	struct:sysfs_file_s	typeref:struct:sysfs_file_s::metafs_s
+node	fs/sysfs/sysfs-private.h	/^	struct metafs_s *node;$/;"	m	struct:sysfs_node_s	typeref:struct:sysfs_node_s::metafs_s
+node	fs/sysfs/sysfs.h	/^	struct metafs_s node;$/;"	m	struct:sysfs_entry_s	typeref:struct:sysfs_entry_s::metafs_s
+node	kern/cluster.h	/^	sysfs_entry_t node;$/;"	m	struct:cluster_entry_s
+node	kern/cpu.h	/^	sysfs_entry_t node;$/;"	m	struct:cpu_s
+node	kern/device.h	/^	struct metafs_s node;		  \/*! Metafs node associated with this device *\/$/;"	m	struct:device_s	typeref:struct:device_s::metafs_s
+node	kern/radix.h	/^	struct radix_node_s *node;$/;"	m	struct:radix_item_info_s	typeref:struct:radix_item_info_s::radix_node_s
+obj_destroy	mm/kcm.h	/^	kcm_init_destroy_t *obj_destroy;$/;"	m	struct:kcm_s
+obj_init	mm/kcm.h	/^	kcm_init_destroy_t *obj_init;$/;"	m	struct:kcm_s
+ocpu	kern/thread.h	/^	struct cpu_s *ocpu;$/;"	m	struct:thread_info	typeref:struct:thread_info::cpu_s
+ocpu	kern/thread_migrate.c	/^	struct cpu_s        *ocpu;$/;"	m	struct:__anon41	typeref:struct:__anon41::cpu_s	file:
+off_t	libk/types.h	/^typedef sint_t off_t;$/;"	t
+offset	libk/arch-bib.h	/^	uint16_t offset;$/;"	m	struct:arch_bib_cluster_s
+offset	mm/vmm.h	/^	off_t offset;$/;"	m	struct:mmap_attr_s
+offset	vfs/vfs.c	/^	uint_t offset;$/;"	m	struct:__vfs_open_s	file:
+offset_high	cpu/i386/cpu-internal.h	/^	uint16_t offset_high;$/;"	m	struct:cpu_idt_entry_s
+offset_low	cpu/i386/cpu-internal.h	/^	uint16_t offset_low;$/;"	m	struct:cpu_idt_entry_s
+offsetof	libk/list.h	/^#define offsetof(/;"	d
+old_esp	cpu/i386/cpu-internal.h	/^	uint_t old_esp;$/;"	m	struct:cpu_regs_s
+old_ss	cpu/i386/cpu-internal.h	/^	uint_t old_ss;$/;"	m	struct:cpu_regs_s
+onln_clstr_nr	libk/arch-bib.h	/^	uint16_t   onln_clstr_nr;$/;"	m	struct:arch_bib_header_s
+onln_clstr_nr	libk/boot-info.h	/^	uint_t onln_clstr_nr;$/;"	m	struct:boot_info_s
+onln_cpu_nr	kern/cluster.h	/^	uint_t onln_cpu_nr;$/;"	m	struct:cluster_s
+onln_cpu_nr	libk/arch-bib.h	/^	uint16_t   onln_cpu_nr;$/;"	m	struct:arch_bib_header_s
+onln_cpu_nr	libk/boot-info.h	/^	uint_t onln_cpu_nr;$/;"	m	struct:boot_info_s
+op	fs/sysfs/sysfs.h	/^	struct sysfs_op_s op;$/;"	m	struct:sysfs_entry_s	typeref:struct:sysfs_entry_s::sysfs_op_s
+op	kern/device.h	/^	driver_t op;                      \/*! set of operations supplied by the device driver *\/$/;"	m	struct:device_s
+op	kern/scheduler.h	/^	struct sched_ops_s op;$/;"	m	struct:sched_s	typeref:struct:sched_s::sched_ops_s
+op_reg	cpu/mipsel/__cpu_context.S	/^#define op_reg(_op,_r)	_op	$f##_r,	((FPU + _r)*4)($4) $/;"	d
+open	fs/sysfs/sysfs.h	/^	sysfs_request_func_t *open;$/;"	m	struct:sysfs_op_s
+open	kern/driver.h	/^	device_request_t *open;$/;"	m	struct:dev_icu_op
+open	kern/driver.h	/^	device_request_t *open;$/;"	m	struct:dev_op
+open	vfs/vfs.h	/^	vfs_open_file_t *open;$/;"	m	struct:vfs_file_op_s
+ops	kern/kfifo.h	/^	}ops;$/;"	m	struct:kfifo_s	typeref:struct:kfifo_s::__anon21
+ops	vfs/vfs_init.c	/^	const struct vfs_context_op_s *ops;$/;"	m	struct:fs_type_s	typeref:struct:fs_type_s::vfs_context_op_s	file:
+order	kern/thread.h	/^	uint_t order;$/;"	m	struct:thread_info
+order	mm/page.h	/^	uint32_t order : 4;$/;"	m	struct:page_s
+order	mm/ppm.h	/^	uint_t order;$/;"	m	struct:ppm_dqdt_req_s
+origin	kern/dqdt.h	/^	struct dqdt_cluster_s *origin;$/;"	m	struct:dqdt_attr_s	typeref:struct:dqdt_attr_s::dqdt_cluster_s
+origin_cluster	kern/thread.h	/^#define origin_cluster /;"	d
+origin_cluster	kern/thread.h	/^#define origin_cluster$/;"	d
+origin_cluster	kern/thread.h	/^#undef origin_cluster$/;"	d
+origin_cpu	kern/thread.h	/^#define origin_cpu /;"	d
+origin_cpu	kern/thread.h	/^#define origin_cpu$/;"	d
+origin_cpu	kern/thread.h	/^#undef origin_cpu$/;"	d
+out_channel	drivers/ibmpc/tty.h	/^	struct fifiomwmr_s *out_channel;$/;"	m	struct:tty_context_s	typeref:struct:tty_context_s::fifiomwmr_s
+owner	kern/barrier.h	/^	struct task_s *owner;$/;"	m	struct:barrier_s	typeref:struct:barrier_s::task_s
+owner	kern/semaphore.h	/^	struct thread_s *owner;$/;"	m	struct:semaphore_s	typeref:struct:semaphore_s::thread_s
+owner	kern/spinlock.h	/^	struct thread_s *owner;$/;"	m	struct:spinlock_s	typeref:struct:spinlock_s::thread_s
+p_align	libk/elf.h	/^	Elf32_Word	p_align;        \/* Segment alignment *\/$/;"	m	struct:__anon43
+p_filesz	libk/elf.h	/^	Elf32_Word	p_filesz;	\/* Segment size in file *\/$/;"	m	struct:__anon43
+p_flags	libk/elf.h	/^	Elf32_Word	p_flags;	\/* Segment flags *\/$/;"	m	struct:__anon43
+p_memsz	libk/elf.h	/^	Elf32_Word	p_memsz;	\/* Segment size in memory *\/$/;"	m	struct:__anon43
+p_offset	libk/elf.h	/^	Elf32_Off	p_offset;	\/* Segment file offset *\/$/;"	m	struct:__anon43
+p_paddr	libk/elf.h	/^	Elf32_Addr	p_paddr;	\/* Segment physical address *\/$/;"	m	struct:__anon43
+p_type	libk/elf.h	/^	Elf32_Word	p_type;		\/* Segment type *\/$/;"	m	struct:__anon43
+p_vaddr	libk/elf.h	/^	Elf32_Addr	p_vaddr;	\/* Segment virtual address *\/$/;"	m	struct:__anon43
+pad	kern/atomic.h	/^	uint_t pad[CONFIG_CACHE_LINE_LENGTH - 1];$/;"	m	struct:atomic_s
+pad	kern/thread.h	/^		cacheline_t pad;$/;"	m	union:kthread_args_s::__anon40
+padding1	kern/kfifo.h	/^		cacheline_t padding1;$/;"	m	union:kfifo_s::__anon19
+padding1	kern/remote_fifo.h	/^		cacheline_t padding1;$/;"	m	union:remote_fifo_s::__anon26
+padding2	kern/kfifo.h	/^		cacheline_t padding2;$/;"	m	union:kfifo_s::__anon20
+padding2	kern/remote_fifo.h	/^		cacheline_t padding2;$/;"	m	union:remote_fifo_s::__anon27
+padding2	kern/remote_fifo.h	/^		cacheline_t padding2;$/;"	m	union:remote_fifo_s::__anon28
+page	arch/tsar/arch-pmm.h	/^	struct page_s *page;$/;"	m	struct:pmm_s	typeref:struct:pmm_s::page_s
+page	kern/keysdb.h	/^	struct page_s *page;$/;"	m	struct:keysdb_s	typeref:struct:keysdb_s::page_s
+page	kern/thread.h	/^	struct page_s *page;$/;"	m	struct:thread_info	typeref:struct:thread_info::page_s
+page	mm/kcm.c	/^	struct page_s *page;$/;"	m	struct:page_info_s	typeref:struct:page_info_s::page_s	file:
+page	vfs/vfs-private.h	/^	struct page_s *page;$/;"	m	struct:vfs_lookup_path_s	typeref:struct:vfs_lookup_path_s::page_s
+page_alloc	mm/kcm.h	/^	kcm_page_alloc_t *page_alloc;$/;"	m	struct:kcm_s
+page_clear_dirty	mm/page.c	/^bool_t page_clear_dirty(struct page_s *page)$/;"	f
+page_copy	mm/page.c	/^void page_copy(struct page_s *dst, struct page_s *src)$/;"	f
+page_fault	mm/vm_region.h	/^	vm_reg_pagefault_t *page_fault;$/;"	m	struct:vm_region_op_s
+page_free	mm/kcm.h	/^	kcm_page_free_t  *page_free;$/;"	m	struct:kcm_s
+page_get_ppm	mm/page.c	/^inline struct ppm_s* page_get_ppm(struct page_s *page)$/;"	f
+page_in	mm/vm_region.h	/^	vm_reg_pagein_t *page_in;$/;"	m	struct:vm_region_op_s
+page_info_s	mm/kcm.c	/^typedef struct page_info_s$/;"	s	file:
+page_info_t	mm/kcm.c	/^} page_info_t;$/;"	t	typeref:struct:page_info_s	file:
+page_init	mm/page.h	/^static inline void page_init(struct page_s *page, uint_t cid)$/;"	f
+page_lock	mm/page.c	/^void page_lock(struct page_s *page)$/;"	f
+page_lookup	mm/vm_region.h	/^	vm_reg_lookup_t *page_lookup;$/;"	m	struct:vm_region_op_s
+page_out	mm/vm_region.h	/^	vm_reg_pageout_t *page_out;$/;"	m	struct:vm_region_op_s
+page_print	mm/page.c	/^void page_print(struct page_s *page)$/;"	f
+page_refcount_down	mm/page.h	/^static inline uint_t page_refcount_down(struct page_s *page)$/;"	f
+page_refcount_get	mm/page.h	/^static inline uint_t page_refcount_get(struct page_s *page)$/;"	f
+page_refcount_up	mm/page.h	/^static inline uint_t page_refcount_up(struct page_s *page)$/;"	f
+page_s	mm/page.h	/^struct page_s$/;"	s
+page_set_dirty	mm/page.c	/^bool_t page_set_dirty(struct page_s *page)$/;"	f
+page_shared_down	mm/page.h	/^static inline uint_t page_shared_down(struct page_s *page)$/;"	f
+page_shared_get	mm/page.h	/^static inline uint_t page_shared_get(struct page_s *page)$/;"	f
+page_shared_init	mm/page.h	/^static inline void page_shared_init(struct page_s *page)$/;"	f
+page_shared_up	mm/page.h	/^static inline uint_t page_shared_up(struct page_s *page)$/;"	f
+page_state_get	mm/page.h	/^static inline page_state_t page_state_get(struct page_s *page)$/;"	f
+page_state_set	mm/page.c	/^void page_state_set(struct page_s *page, page_state_t new_state)$/;"	f
+page_state_t	mm/page.h	/^}page_state_t;$/;"	t	typeref:enum:__anon47
+page_to_free	mm/page.c	/^static void page_to_free(struct page_s *page)$/;"	f	file:
+page_to_invalid	mm/page.c	/^static void page_to_invalid(struct page_s *page)$/;"	f	file:
+page_to_locked	mm/page.c	/^static void page_to_locked(struct page_s *page)$/;"	f	file:
+page_to_locked_io	mm/page.c	/^static void page_to_locked_io(struct page_s *page)$/;"	f	file:
+page_to_valid	mm/page.c	/^static void page_to_valid(struct page_s *page)$/;"	f	file:
+page_unlock	mm/page.c	/^void page_unlock(struct page_s *page)$/;"	f
+page_zero	mm/page.c	/^void page_zero(struct page_s *page)$/;"	f
+pagedir_dup	arch/tsar/pmm.c	/^error_t pagedir_dup(uint_t* pgdir_dst, uint_t* pgdir_src, $/;"	f
+pages_limit	mm/vmm.h	/^	uint_t pages_limit;$/;"	m	struct:vmm_s
+pages_nr	mm/ppm.h	/^	uint_t pages_nr;$/;"	m	struct:buddy_list_s
+pages_nr	mm/ppm.h	/^	uint_t pages_nr;$/;"	m	struct:ppm_s
+pages_nr	mm/vmm.h	/^	uint_t pages_nr;$/;"	m	struct:vmm_s
+pages_tbl	kern/barrier.h	/^	struct page_s *pages_tbl[BARRIER_WQDB_NR];$/;"	m	struct:barrier_s	typeref:struct:barrier_s::page_s
+pages_tbl	mm/ppm.h	/^	struct page_s *pages_tbl;$/;"	m	struct:ppm_s	typeref:struct:ppm_s::page_s
+pages_to_ppns	kern/sys_exec.c	/^void pages_to_ppns(struct page_s *pgtbl[], ppn_t ppns[])$/;"	f
+params	drivers/ibmpc/ata.h	/^	struct ata_params_s params;$/;"	m	struct:ata_context_s	typeref:struct:ata_context_s::ata_params_s
+params	drivers/soclib/soclib_block.c	/^	struct block_params_s params;$/;"	m	struct:block_context_s	typeref:struct:block_context_s::block_params_s	file:
+parent	fs/fat32/fat32-private.h	/^	struct vfs_inode_s *parent;$/;"	m	struct:vfat_entry_request_s	typeref:struct:vfat_entry_request_s::vfs_inode_s
+parent	kern/dqdt.h	/^	struct dqdt_cluster_s *parent;$/;"	m	struct:dqdt_cluster_s	typeref:struct:dqdt_cluster_s::dqdt_cluster_s
+parent	kern/radix.c	/^	struct radix_node_s*	parent;$/;"	m	struct:radix_node_s	typeref:struct:radix_node_s::radix_node_s	file:
+parent	kern/task.h	/^	pid_t parent;$/;"	m	struct:task_s
+parent	vfs/vfs.h	/^	struct vfs_inode_ref_s parent; $/;"	m	struct:vfs_icreate_s	typeref:struct:vfs_icreate_s::vfs_inode_ref_s
+path_ppn	kern/task.h	/^        ppn_t                   path_ppn;$/;"	m	struct:sys_exec_remote_s
+path_ptrs	vfs/vfs-private.h	/^	char **path_ptrs;$/;"	m	struct:vfs_lookup_path_s
+pci_config_read	drivers/ibmpc/pci-bus.h	/^static inline uint16_t pci_config_read(uint_t bus, uint_t slot, uint_t func, uint_t offset)$/;"	f
+pci_mkconfig1_addr	drivers/ibmpc/pci-bus.h	/^#define pci_mkconfig1_addr(/;"	d
+pending	drivers/ibmpc/ata.h	/^	struct wait_queue_s pending;$/;"	m	struct:ata_context_s	typeref:struct:ata_context_s::wait_queue_s
+pending	drivers/soclib/soclib_block.c	/^	struct wait_queue_s pending;$/;"	m	struct:block_context_s	typeref:struct:block_context_s::wait_queue_s	file:
+pending	drivers/soclib/soclib_dma.c	/^	struct wait_queue_s pending;$/;"	m	struct:dma_context_s	typeref:struct:dma_context_s::wait_queue_s	file:
+pending	kern/rpc.h	/^	volatile uint_t pending;$/;"	m	struct:rpc_listner_s
+pending_rq	drivers/ibmpc/tty.h	/^	dev_request_t *pending_rq;$/;"	m	struct:tty_context_s
+pending_rq	drivers/soclib/soclib_tty.c	/^	dev_request_t *pending_rq;$/;"	m	struct:tty_context_s	file:
+period	kern/rr-sched.c	/^	uint_t period;$/;"	m	struct:rQueues_s	file:
+period	kern/rr-sched_locked.c	/^	uint_t period;$/;"	m	struct:rQueues_s	file:
+pg_current_cluster	fs/fat32/fat32_mapper.c	/^	vfat_cluster_t  pg_current_cluster;$/;"	m	struct:vfat_file_s	file:
+pg_current_rank	fs/fat32/fat32_mapper.c	/^	vfat_cluster_t  pg_current_rank;$/;"	m	struct:vfat_file_s	file:
+pgdir	arch/tsar/arch-pmm.h	/^	uint_t *pgdir;$/;"	m	struct:pmm_s
+pgdir	cpu/mipsel/cpu-asm.h	/^	reg_t pgdir;			\/* 13 *\/$/;"	m	struct:cpu_context_s
+pgdir_ppn	arch/tsar/arch-pmm.h	/^	ppn_t pgdir_ppn;$/;"	m	struct:pmm_s
+pgfault_cntr	kern/thread.h	/^	uint_t pgfault_cntr;$/;"	m	struct:thread_info
+pgfault_nr	mm/vmm.h	/^	uint_t pgfault_nr;$/;"	m	struct:vmm_s
+phase	kern/barrier.h	/^	uint_t phase;$/;"	m	struct:barrier_s
+phase	kern/mcs_sync.h	/^	cacheline_t phase;$/;"	m	struct:mcs_barrier_s
+pic_ICWs	drivers/ibmpc/pic.c	/^static void pic_ICWs()$/;"	f	file:
+pic_default_irq_handler	drivers/ibmpc/pic.c	/^static void pic_default_irq_handler(struct irq_action_s *action)$/;"	f	file:
+pic_get_highest_irq	drivers/ibmpc/pic.c	/^static sint_t pic_get_highest_irq(struct device_s *icu, uint_t type, uint_t output_irq)$/;"	f	file:
+pic_get_mask	drivers/ibmpc/pic.c	/^static uint_t pic_get_mask(struct device_s *icu, uint_t type, uint_t output_irq)$/;"	f	file:
+pic_irq_handler	drivers/ibmpc/pic.c	/^void pic_irq_handler(struct irq_action_s *action)$/;"	f
+pic_set_mask	drivers/ibmpc/pic.c	/^static void pic_set_mask(struct device_s *pic, uint_t mask, uint_t type, uint_t output_irq)$/;"	f	file:
+pid	kern/task.h	/^	pid_t pid;$/;"	m	struct:task_s
+pid	kern/task.h	/^        pid_t                   pid;$/;"	m	struct:sys_exec_remote_s
+pid	kern/thread.h	/^	uint_t pid;                        \/* mandatory *\/$/;"	m	struct:__anon39
+pid_dmsg	kern/kdmsg.h	/^#define pid_dmsg(/;"	d
+pid_t	libk/types.h	/^typedef unsigned long pid_t;$/;"	t
+pix_max	ksh/sgiImg.h	/^  uint32_t   pix_max;$/;"	m	struct:sgi_info_s
+pix_min	ksh/sgiImg.h	/^  uint32_t   pix_min;$/;"	m	struct:sgi_info_s
+pma_t	libk/types.h	/^typedef unsigned long pma_t;$/;"	t
+pmm	mm/vmm.h	/^	struct pmm_s pmm;$/;"	m	struct:vmm_s	typeref:struct:vmm_s::pmm_s
+pmm_alloc_pages	arch/tsar/pmm.c	/^struct page_s* pmm_alloc_pages(struct cluster_s *cluster, int order, ppn_t *ppn, uint_t **vma)$/;"	f
+pmm_bootstrap_init	arch/tsar/pmm.c	/^error_t pmm_bootstrap_init(struct pmm_s *init, uint_t arg)$/;"	f
+pmm_cache_flush	arch/tsar/pmm.c	/^void pmm_cache_flush(uint_t flags)$/;"	f
+pmm_cache_flush_raddr	arch/tsar/pmm.c	/^void pmm_cache_flush_raddr(vma_t vaddr, uint_t cid, uint_t flags)$/;"	f
+pmm_cache_flush_vaddr	arch/tsar/pmm.c	/^void pmm_cache_flush_vaddr(vma_t vaddr, uint_t flags)$/;"	f
+pmm_destroy	arch/tsar/pmm.c	/^error_t pmm_destroy(struct pmm_s *pmm)$/;"	f
+pmm_dup	arch/tsar/pmm.c	/^error_t pmm_dup(struct pmm_s *dst, struct pmm_s *src)$/;"	f
+pmm_except_init	arch/tsar/arch-pmm.h	/^#define pmm_except_init(/;"	d
+pmm_except_isExecute	arch/tsar/arch-pmm.h	/^#define pmm_except_isExecute(/;"	d
+pmm_except_isExecute	arch/tsar/arch-pmm.h	/^#undef pmm_except_isExecute$/;"	d
+pmm_except_isExecute	mm/pmm.h	/^#define pmm_except_isExecute(/;"	d
+pmm_except_isInKernelMode	arch/tsar/arch-pmm.h	/^#define pmm_except_isInKernelMode(/;"	d
+pmm_except_isInKernelMode	arch/tsar/arch-pmm.h	/^#undef pmm_except_isInKernelMode$/;"	d
+pmm_except_isInKernelMode	mm/pmm.h	/^#define pmm_except_isInKernelMode(/;"	d
+pmm_except_isPresent	arch/tsar/arch-pmm.h	/^#define pmm_except_isPresent(/;"	d
+pmm_except_isPresent	arch/tsar/arch-pmm.h	/^#undef pmm_except_isPresent$/;"	d
+pmm_except_isPresent	mm/pmm.h	/^#define pmm_except_isPresent(/;"	d
+pmm_except_isRights	arch/tsar/arch-pmm.h	/^#define pmm_except_isRights(/;"	d
+pmm_except_isRights	arch/tsar/arch-pmm.h	/^#undef pmm_except_isRights$/;"	d
+pmm_except_isRights	mm/pmm.h	/^#define pmm_except_isRights(/;"	d
+pmm_except_isWrite	arch/tsar/arch-pmm.h	/^#define pmm_except_isWrite(/;"	d
+pmm_except_isWrite	arch/tsar/arch-pmm.h	/^#undef pmm_except_isWrite$/;"	d
+pmm_except_isWrite	mm/pmm.h	/^#define pmm_except_isWrite(/;"	d
+pmm_except_set_Rights	arch/tsar/arch-pmm.h	/^#define pmm_except_set_Rights(/;"	d
+pmm_except_set_Rights	arch/tsar/arch-pmm.h	/^#undef pmm_except_set_Rights$/;"	d
+pmm_except_set_Rights	mm/pmm.h	/^#define pmm_except_set_Rights(/;"	d
+pmm_except_set_executable	arch/tsar/arch-pmm.h	/^#define pmm_except_set_executable(/;"	d
+pmm_except_set_executable	arch/tsar/arch-pmm.h	/^#undef pmm_except_set_executable$/;"	d
+pmm_except_set_executable	mm/pmm.h	/^#define pmm_except_set_executable(/;"	d
+pmm_except_set_inKernelMode	arch/tsar/arch-pmm.h	/^#define pmm_except_set_inKernelMode(/;"	d
+pmm_except_set_inKernelMode	arch/tsar/arch-pmm.h	/^#undef pmm_except_set_inKernelMode$/;"	d
+pmm_except_set_inKernelMode	mm/pmm.h	/^#define pmm_except_set_inKernelMode(/;"	d
+pmm_except_set_present	arch/tsar/arch-pmm.h	/^#define pmm_except_set_present(/;"	d
+pmm_except_set_present	arch/tsar/arch-pmm.h	/^#undef pmm_except_set_present$/;"	d
+pmm_except_set_present	mm/pmm.h	/^#define pmm_except_set_present(/;"	d
+pmm_except_set_writable	arch/tsar/arch-pmm.h	/^#define pmm_except_set_writable(/;"	d
+pmm_except_set_writable	arch/tsar/arch-pmm.h	/^#undef pmm_except_set_writable$/;"	d
+pmm_except_set_writable	mm/pmm.h	/^#define pmm_except_set_writable(/;"	d
+pmm_get_page	arch/tsar/pmm.c	/^error_t pmm_get_page(struct pmm_s *pmm, vma_t vaddr, pmm_page_info_t *info)$/;"	f
+pmm_init	arch/tsar/pmm.c	/^error_t pmm_init(struct pmm_s *pmm, struct cluster_s *cluster)$/;"	f
+pmm_lock_page	arch/tsar/pmm.c	/^error_t pmm_lock_page(struct pmm_s *pmm, vma_t vaddr, pmm_page_info_t *info)$/;"	f
+pmm_page_info_s	mm/pmm.h	/^struct pmm_page_info_s$/;"	s
+pmm_page_info_t	mm/pmm.h	/^typedef struct pmm_page_info_s pmm_page_info_t;$/;"	t	typeref:struct:pmm_page_info_s
+pmm_ppn2cid	arch/tsar/pmm.c	/^inline cid_t pmm_ppn2cid(ppn_t ppn)$/;"	f
+pmm_ppn2ppm	arch/tsar/pmm.c	/^struct ppm_s* pmm_ppn2ppm(ppn_t ppn)$/;"	f
+pmm_ppn2vma	arch/tsar/pmm.c	/^inline vma_t pmm_ppn2vma(ppn_t ppn)$/;"	f
+pmm_print	arch/tsar/pmm.c	/^void pmm_print(struct pmm_s *pmm)$/;"	f
+pmm_region_attr_set	arch/tsar/pmm.c	/^error_t pmm_region_attr_set(struct pmm_s *pmm, vma_t vaddr, uint_t pages_nr, uint_t attr)$/;"	f
+pmm_region_dup	arch/tsar/pmm.c	/^error_t pmm_region_dup(struct pmm_s *dst, struct pmm_s *src, vma_t vaddr, vma_t limit, uint_t flags)$/;"	f
+pmm_region_map	arch/tsar/pmm.c	/^error_t pmm_region_map(struct pmm_s *pmm, vma_t vaddr, uint_t pages_nr, pmm_page_info_t *info)$/;"	f
+pmm_region_unmap	arch/tsar/pmm.c	/^error_t pmm_region_unmap(struct pmm_s *pmm, vma_t vaddr, uint_t pages_nr, uint_t flags)$/;"	f
+pmm_release	arch/tsar/pmm.c	/^error_t pmm_release(struct pmm_s *pmm)$/;"	f
+pmm_s	arch/tsar/arch-pmm.h	/^struct pmm_s$/;"	s
+pmm_set_page	arch/tsar/pmm.c	/^error_t pmm_set_page(struct pmm_s *pmm, vma_t vaddr, pmm_page_info_t *info)$/;"	f
+pmm_tlb_disable	arch/tsar/pmm.c	/^void pmm_tlb_disable(uint_t flags)$/;"	f
+pmm_tlb_enable	arch/tsar/pmm.c	/^void pmm_tlb_enable(uint_t flags)$/;"	f
+pmm_tlb_flush_vaddr	arch/tsar/pmm.c	/^void pmm_tlb_flush_vaddr(vma_t vaddr, uint_t flags)$/;"	f
+pmm_unlock_page	arch/tsar/pmm.c	/^error_t pmm_unlock_page(struct pmm_s *pmm, vma_t vaddr, pmm_page_info_t *info)$/;"	f
+ports	kern/scheduler.c	/^	uint_t ports[SCHED_PORTS_NR];$/;"	m	struct:__anon31	file:
+pos_X	drivers/ibmpc/tty.h	/^	uint_t pos_X, pos_Y;$/;"	m	struct:tty_context_s
+pos_Y	drivers/ibmpc/tty.h	/^	uint_t pos_X, pos_Y;$/;"	m	struct:tty_context_s
+ppid	kern/task.h	/^        pid_t                   ppid;$/;"	m	struct:sys_exec_remote_s
+ppm	kern/cluster.h	/^	struct ppm_s ppm;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::ppm_s
+ppm_addr2page	mm/ppm.c	/^inline struct page_s* ppm_addr2page(struct ppm_s *ppm, void *addr) $/;"	f
+ppm_alloc_pages	mm/ppm.c	/^struct page_s* ppm_alloc_pages( struct ppm_s * ppm,$/;"	f
+ppm_assert_order	mm/ppm.c	/^void ppm_assert_order(struct ppm_s *ppm)$/;"	f
+ppm_do_alloc_pages	mm/ppm.c	/^static struct page_s* ppm_do_alloc_pages(struct ppm_s *ppm, uint_t order, uint_t flags)$/;"	f	file:
+ppm_dqdt_req_s	mm/ppm.h	/^struct ppm_dqdt_req_s$/;"	s
+ppm_free_pages	mm/ppm.c	/^void ppm_free_pages(struct page_s *page)$/;"	f
+ppm_free_pages_nolock	mm/ppm.c	/^static void ppm_free_pages_nolock(struct ppm_s *ppm, struct page_s *page, uint_t order, uint_t index)$/;"	f	file:
+ppm_func	ksh/ppm_func.c	/^error_t ppm_func(void *param)$/;"	f
+ppm_get_cluster	mm/ppm.h	/^#define ppm_get_cluster(/;"	d
+ppm_get_cluster	mm/ppm.h	/^#undef ppm_get_cluster$/;"	d
+ppm_get_pages_nr	mm/ppm.h	/^#define ppm_get_pages_nr(/;"	d
+ppm_get_pages_nr	mm/ppm.h	/^#undef ppm_get_pages_nr$/;"	d
+ppm_init	mm/ppm.c	/^error_t ppm_init( struct ppm_s *       ppm, $/;"	f
+ppm_init_finalize	mm/ppm.c	/^static error_t ppm_init_finalize(struct ppm_s *ppm, struct boot_info_s *info)$/;"	f	file:
+ppm_init_pages	mm/ppm.c	/^static void ppm_init_pages(struct ppm_s *ppm, uint_t cid)$/;"	f	file:
+ppm_last_cid	kern/thread.h	/^	uint_t ppm_last_cid;$/;"	m	struct:thread_info
+ppm_page2addr	mm/ppm.c	/^inline void* ppm_page2addr(struct page_s *page)$/;"	f
+ppm_page2ppn	mm/ppm.c	/^inline ppn_t ppm_page2ppn(struct page_s *page)$/;"	f
+ppm_page_is_valid	mm/ppm.c	/^inline bool_t ppm_page_is_valid(struct page_s *page)$/;"	f
+ppm_ppn2page	mm/ppm.c	/^inline struct page_s* ppm_ppn2page(struct ppm_s *ppm, ppn_t ppn)$/;"	f
+ppm_ppn2vma	mm/ppm.c	/^inline void* ppm_ppn2vma(struct ppm_s *ppm, ppn_t ppn)$/;"	f
+ppm_print	mm/ppm.c	/^void ppm_print(struct ppm_s *ppm)$/;"	f
+ppm_s	mm/ppm.h	/^struct ppm_s$/;"	s
+ppm_vma2ppn	mm/ppm.c	/^inline ppn_t ppm_vma2ppn(struct ppm_s *ppm, void* vma)$/;"	f
+ppm_wait_on	mm/ppm.h	/^static inline error_t ppm_wait_on(struct ppm_s *ppm, struct page_s *page)$/;"	f
+ppm_wakeup_all	mm/ppm.h	/^static inline uint_t ppm_wakeup_all(struct ppm_s *ppm, struct page_s *page)$/;"	f
+ppn	mm/pmm.h	/^	uint_t ppn;$/;"	m	struct:pmm_page_info_s
+ppn_copy	mm/ppn.c	/^void ppn_copy(ppn_t dest, ppn_t src)$/;"	f
+ppn_is_local	mm/ppn.c	/^bool_t ppn_is_local(ppn_t ppn)$/;"	f
+ppn_ppn2cid	mm/ppn.c	/^cid_t ppn_ppn2cid(ppn_t ppn)$/;"	f
+ppn_ppn2vma	mm/ppn.c	/^vma_t ppn_ppn2vma(ppn_t ppn)$/;"	f
+ppn_refcount_down	mm/ppn.c	/^void ppn_refcount_down(ppn_t ppn)$/;"	f
+ppn_refcount_up	mm/ppn.c	/^void ppn_refcount_up(ppn_t ppn)$/;"	f
+ppn_start	mm/ppm.h	/^	uint_t ppn_start;$/;"	m	struct:ppm_s
+ppn_t	libk/types.h	/^typedef unsigned long ppn_t;$/;"	t
+pred	libk/list.h	/^	struct list_entry *pred;$/;"	m	struct:list_entry	typeref:struct:list_entry::list_entry
+pred_link	cpu/i386/cpu-internal.h	/^	uint16_t pred_link;		\/* 0 *\/$/;"	m	struct:cpu_tss_s
+prepare_args	kern/do_exec.c	/^error_t prepare_args(struct task_s *task,$/;"	f
+print	mm/ppm.c	/^#define  print(/;"	d	file:
+print	mm/ppm.c	/^#undef print$/;"	d	file:
+print_args	ksh/miniShell.c	/^void print_args(ms_args_t *args)$/;"	f
+print_boot_banner	kern/kern_init.c	/^static void print_boot_banner(void)$/;"	f	file:
+print_error_msg	ksh/error.c	/^void print_error_msg(error_t err)$/;"	f
+print_pinfo	mm/kcm.c	/^static void print_pinfo(page_info_t *pinfo)$/;"	f	file:
+print_thread	cpu/mipsel/cpu_do_exception.c	/^static void print_thread(struct thread_s *th)$/;"	f	file:
+print_thread	cpu/mipsel/cpu_do_exception.c	/^static void print_thread(struct thread_s* ths)$/;"	f	file:
+printf	cpu/i386/printk.c	/^void printf(char *s, ...)$/;"	f
+printk	kern/kdmsg.h	/^#define printk(/;"	d
+printk_lock	arch/ibmpc/kdmsg.c	/^spinlock_t printk_lock;$/;"	v
+printk_lock	arch/tsar/kdmsg.c	/^DISTLOCK_DECLARE(printk_lock);$/;"	v
+prio	kern/event.h	/^	uint_t prio;$/;"	m	struct:__anon15
+prio	kern/rpc.h	/^	uint_t prio;\/\/ ?$/;"	m	struct:rpc_s
+prio	kern/thread.h	/^	uint_t prio;$/;"	m	struct:thread_s
+priv	vfs/vfs.c	/^	union vfs_file_private_s priv;$/;"	m	struct:__vfs_open_s	typeref:union:__vfs_open_s::vfs_file_private_s	file:
+private_list	mm/page.h	/^	struct list_entry private_list;$/;"	m	struct:page_s	typeref:struct:page_s::list_entry
+prng_A	kern/cpu.h	/^	uint_t prng_A;$/;"	m	struct:cpu_s
+prng_C	kern/cpu.h	/^	uint_t prng_C;$/;"	m	struct:cpu_s
+prot	mm/vmm.h	/^	uint_t prot;$/;"	m	struct:mmap_attr_s
+ps_func	ksh/ps.c	/^error_t ps_func(void *param)$/;"	f
+ps_print_task	ksh/ps.c	/^void ps_print_task(struct task_s *task, uint_t *usr_nr, uint_t *sys_nr, uint_t *tasks_nr)$/;"	f
+pss	kern/thread.h	/^	struct cpu_context_s pss;	    \/*! Processor Saved State *\/$/;"	m	struct:thread_info	typeref:struct:thread_info::cpu_context_s
+pthread_attr_t	kern/thread.h	/^} pthread_attr_t;$/;"	t	typeref:struct:__anon39
+pthread_barrier_t	libk/types.h	/^typedef unsigned long pthread_barrier_t;$/;"	t
+pthread_barrierattr_t	libk/types.h	/^typedef unsigned long pthread_barrierattr_t;$/;"	t
+pthread_cond_t	libk/types.h	/^typedef unsigned long pthread_cond_t;$/;"	t
+pthread_condattr_t	libk/types.h	/^typedef unsigned long pthread_condattr_t;$/;"	t
+pthread_destroy	kern/thread_destroy.c	/^void pthread_destroy(struct thread_s *thread)$/;"	f
+pthread_key_t	libk/types.h	/^typedef unsigned long pthread_key_t;$/;"	t
+pthread_mutexattr_t	libk/types.h	/^typedef unsigned long pthread_mutexattr_t;$/;"	t
+pthread_rwlock_t	libk/types.h	/^typedef unsigned long pthread_rwlock_t;$/;"	t
+pthread_rwlockattr_t	libk/types.h	/^typedef unsigned long pthread_rwlockattr_t;$/;"	t
+pthread_t	libk/types.h	/^typedef unsigned long pthread_t;$/;"	t
+pti_lock	drivers/soclib/soclib_xicu.c	/^	spinlock_t pti_lock;$/;"	m	struct:xicu_context_s	file:
+ptr	kern/rpc.h	/^	struct rpc_s* ptr;$/;"	m	struct:rpc_ptr_s	typeref:struct:rpc_ptr_s::rpc_s
+ptr	mm/kmem.h	/^  void *ptr;$/;"	m	struct:kmem_req_s
+ptr	vfs/vfs.h	/^	struct vfs_inode_s *ptr; $/;"	m	struct:vfs_inode_ref_s	typeref:struct:vfs_inode_ref_s::vfs_inode_s
+put	kern/kfifo.h	/^		kfifo_put_t *put;$/;"	m	struct:kfifo_s::__anon21
+put_block	mm/kcm.c	/^error_t put_block(struct kcm_s *kcm, void *ptr)$/;"	f
+putcar	cpu/i386/screen.c	/^void putcar(uint8_t c)$/;"	f
+pv_data	kern/rt_timer.h	/^	void *pv_data;$/;"	m	struct:rt_params_s
+pwd_func	ksh/pwd_func.c	/^error_t pwd_func(void *param)$/;"	f
+pws	kern/thread.h	/^	struct cpu_context_s pws;     \/*! processor work state (register saved zone) *\/$/;"	m	struct:thread_s	typeref:struct:thread_s::cpu_context_s
+quantum	kern/thread.h	/^	sint_t quantum;               \/*! number of clock ticks given to the thread *\/$/;"	m	struct:thread_s
+queue	kern/thread.h	/^	struct wait_queue_s *queue;$/;"	m	struct:thread_info	typeref:struct:thread_info::wait_queue_s
+rQueues_s	kern/rr-sched.c	/^typedef struct rQueues_s$/;"	s	file:
+rQueues_s	kern/rr-sched_locked.c	/^typedef struct rQueues_s$/;"	s	file:
+rQueues_t	kern/rr-sched.c	/^} rQueues_t;$/;"	t	typeref:struct:rQueues_s	file:
+rQueues_t	kern/rr-sched_locked.c	/^} rQueues_t;$/;"	t	typeref:struct:rQueues_s	file:
+ra_31	cpu/mipsel/cpu-asm.h	/^	reg_t ra_31;			\/* 10 *\/$/;"	m	struct:cpu_context_s
+radix_container	kern/radix.c	/^#define radix_container(/;"	d	file:
+radix_dmsg	kern/radix.c	/^#define radix_dmsg(/;"	d	file:
+radix_info_op_t	kern/radix.h	/^} radix_info_op_t;$/;"	t	typeref:enum:__anon25
+radix_item_info_apply	kern/radix.c	/^error_t radix_item_info_apply(struct radix_s *root, $/;"	f
+radix_item_info_lookup	kern/radix.c	/^bool_t radix_item_info_lookup(struct radix_s    *root, $/;"	f
+radix_item_info_s	kern/radix.h	/^struct radix_item_info_s $/;"	s
+radix_item_info_t	kern/radix.h	/^typedef struct radix_item_info_s radix_item_info_t;$/;"	t	typeref:struct:radix_item_info_s
+radix_node_kmem_init	kern/radix.h	/^KMEM_OBJATTR_INIT(radix_node_kmem_init);$/;"	v
+radix_node_s	kern/radix.c	/^struct radix_node_s $/;"	s	file:
+radix_s	kern/radix.h	/^struct radix_s $/;"	s
+radix_t	kern/radix.h	/^typedef struct radix_s radix_t;$/;"	t	typeref:struct:radix_s
+radix_tags_t	kern/radix.h	/^} radix_tags_t;$/;"	t	typeref:enum:__anon24
+radix_tree_delete	kern/radix.c	/^void* radix_tree_delete( struct radix_s*   root, $/;"	f
+radix_tree_gang_lookup	kern/radix.c	/^unsigned int radix_tree_gang_lookup(struct radix_s*	root,$/;"	f
+radix_tree_gang_lookup_tag	kern/radix.c	/^unsigned int radix_tree_gang_lookup_tag( struct radix_s* root,$/;"	f
+radix_tree_gang_lookup_tag_slot	kern/radix.c	/^unsigned int radix_tree_gang_lookup_tag_slot(struct radix_s*	root,$/;"	f
+radix_tree_init	kern/radix.c	/^void radix_tree_init(struct radix_s* root)$/;"	f
+radix_tree_insert	kern/radix.c	/^int radix_tree_insert( struct radix_s* root, $/;"	f
+radix_tree_lookup	kern/radix.c	/^void* radix_tree_lookup( struct radix_s*   root, $/;"	f
+radix_tree_remove_item	kern/radix.c	/^error_t radix_tree_remove_item(struct radix_s *root, radix_item_info_t *info)$/;"	f
+radix_tree_tag_clear	kern/radix.c	/^void* radix_tree_tag_clear(struct radix_s* root, unsigned long index, unsigned int tag)$/;"	f
+radix_tree_tag_get	kern/radix.c	/^int radix_tree_tag_get( struct radix_s* root,$/;"	f
+radix_tree_tag_set	kern/radix.c	/^void* radix_tree_tag_set(struct radix_s* root, unsigned long index, unsigned int tag)$/;"	f
+radix_tree_tagged	kern/radix.c	/^int radix_tree_tagged(struct radix_s* root, unsigned int tag)$/;"	f
+ramfs_ctx_op	fs/ramfs/ramfs_context.c	/^const struct vfs_context_op_s ramfs_ctx_op =$/;"	v	typeref:struct:vfs_context_op_s
+ramfs_d_op	fs/ramfs/ramfs_inode.c	/^const struct vfs_dirent_op_s ramfs_d_op =$/;"	v	typeref:struct:vfs_dirent_op_s
+ramfs_dmsg	fs/ramfs/ramfs-private.h	/^#define ramfs_dmsg /;"	d
+ramfs_f_op	fs/ramfs/ramfs_file.c	/^const struct vfs_file_op_s ramfs_f_op =$/;"	v	typeref:struct:vfs_file_op_s
+ramfs_file_s	fs/ramfs/ramfs-private.h	/^struct ramfs_file_s$/;"	s
+ramfs_i_op	fs/ramfs/ramfs_inode.c	/^const struct vfs_inode_op_s ramfs_i_op =$/;"	v	typeref:struct:vfs_inode_op_s
+ramfs_kmem_file_init	fs/ramfs/ramfs.h	/^KMEM_OBJATTR_INIT(ramfs_kmem_file_init);$/;"	v
+ramfs_m_op	fs/ramfs/ramfs_mapper.c	/^const struct mapper_op_s ramfs_m_op =$/;"	v	typeref:struct:mapper_op_s
+rand	libk/rand.c	/^uint_t rand(void)$/;"	f
+rb_color	libk/rbtree.h	/^#define rb_color(/;"	d
+rb_entry	libk/rbtree.h	/^#define	rb_entry(/;"	d
+rb_erase	libk/rbtree.c	/^void rb_erase(struct rb_node *node, struct rb_root *root)$/;"	f
+rb_first	libk/rbtree.c	/^struct rb_node *rb_first(const struct rb_root *root)$/;"	f
+rb_insert_color	libk/rbtree.c	/^void rb_insert_color(struct rb_node *node, struct rb_root *root)$/;"	f
+rb_is_black	libk/rbtree.h	/^#define rb_is_black(/;"	d
+rb_is_red	libk/rbtree.h	/^#define rb_is_red(/;"	d
+rb_last	libk/rbtree.c	/^struct rb_node *rb_last(const struct rb_root *root)$/;"	f
+rb_left	libk/rbtree.h	/^	struct rb_node *rb_left;$/;"	m	struct:rb_node	typeref:struct:rb_node::rb_node
+rb_link_node	libk/rbtree.h	/^static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,$/;"	f
+rb_next	libk/rbtree.c	/^struct rb_node *rb_next(const struct rb_node *node)$/;"	f
+rb_node	libk/rbtree.h	/^	struct rb_node *rb_node;$/;"	m	struct:rb_root	typeref:struct:rb_root::rb_node
+rb_node	libk/rbtree.h	/^struct rb_node$/;"	s
+rb_parent	libk/rbtree.h	/^#define rb_parent(/;"	d
+rb_parent_color	libk/rbtree.h	/^	unsigned long  rb_parent_color;$/;"	m	struct:rb_node
+rb_prev	libk/rbtree.c	/^struct rb_node *rb_prev(const struct rb_node *node)$/;"	f
+rb_replace_node	libk/rbtree.c	/^void rb_replace_node(struct rb_node *victim, struct rb_node *new,$/;"	f
+rb_right	libk/rbtree.h	/^	struct rb_node *rb_right;$/;"	m	struct:rb_node	typeref:struct:rb_node::rb_node
+rb_root	libk/rbtree.h	/^struct rb_root$/;"	s
+rb_set_black	libk/rbtree.h	/^#define rb_set_black(/;"	d
+rb_set_color	libk/rbtree.h	/^static inline void rb_set_color(struct rb_node *rb, int color)$/;"	f
+rb_set_parent	libk/rbtree.h	/^static inline void rb_set_parent(struct rb_node *rb, struct rb_node *p)$/;"	f
+rb_set_red	libk/rbtree.h	/^#define rb_set_red(/;"	d
+rd_count	fs/fat32/fat32_access.c	/^uint32_t rd_count     ;$/;"	v
+rd_wait_queue	kern/rwlock.h	/^	struct wait_queue_s rd_wait_queue;$/;"	m	struct:rwlock_s	typeref:struct:rwlock_s::wait_queue_s
+rdidx	kern/kfifo.h	/^		volatile uint_t rdidx;$/;"	m	union:kfifo_s::__anon20
+rdidx	kern/remote_fifo.h	/^		volatile uint_t rdidx;$/;"	m	union:remote_fifo_s::__anon28
+re_listner	kern/cluster.h	/^	struct rpc_listner_s re_listner;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::rpc_listner_s
+re_listner	kern/cpu.h	/^	struct rpc_listner_s re_listner;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::rpc_listner_s
+read	fs/sysfs/sysfs.h	/^	sysfs_request_func_t *read;$/;"	m	struct:sysfs_op_s
+read	kern/driver.h	/^	device_request_t *read;$/;"	m	struct:dev_icu_op
+read	kern/driver.h	/^	device_request_t *read;$/;"	m	struct:dev_op
+read	vfs/vfs.h	/^	vfs_read_file_t *read;$/;"	m	struct:vfs_file_op_s
+read_ptr	kern/mwmr.c	/^	uint_t read_ptr;$/;"	m	struct:fifomwmr_s	file:
+read_root	vfs/vfs.h	/^	vfs_read_root_t *read_root;$/;"	m	struct:vfs_context_op_s
+readdir	vfs/vfs.h	/^	vfs_read_dir_t *readdir;$/;"	m	struct:vfs_file_op_s
+reader	kern/remote_fifo.h	/^	struct thread_s *reader;$/;"	m	struct:remote_fifo_s	typeref:struct:remote_fifo_s::thread_s
+readpage	mm/mapper.h	/^	mapper_read_page_t	    *readpage;$/;"	m	struct:mapper_op_s
+records_bits	kern/keysdb.h	/^	uint_t records_bits;$/;"	m	struct:keysdb_s
+records_nr	kern/keysdb.h	/^	uint_t records_nr;$/;"	m	struct:keysdb_s
+refcount	mm/kcm.c	/^	uint8_t refcount;$/;"	m	struct:page_info_s	file:
+refcount_down	kern/atomic.c	/^inline uint_t refcount_down(refcount_t *ptr)$/;"	f
+refcount_get	kern/atomic.c	/^inline uint_t refcount_get(refcount_t *ptr)$/;"	f
+refcount_init	kern/atomic.c	/^inline void refcount_init(refcount_t *ptr)$/;"	f
+refcount_set	kern/atomic.c	/^inline uint_t refcount_set(refcount_t *ptr, uint_t new_val)$/;"	f
+refcount_t	kern/atomic.h	/^typedef uint_t refcount_t;$/;"	t
+refcount_up	kern/atomic.c	/^inline uint_t refcount_up(refcount_t *ptr)$/;"	f
+reg_t	kern/hal-cpu.h	/^typedef unsigned long reg_t;$/;"	t
+reg_tbl	drivers/soclib/soclib_memc.c	/^static const uint16_t reg_tbl[MEMC_REG_NR] = {$/;"	v	file:
+region	kern/driver.h	/^	struct vm_region_s *region;$/;"	m	struct:dev_request_s	typeref:struct:dev_request_s::vm_region_s
+regions_db	mm/vmm.h	/^	struct keysdb_s regions_db;$/;"	m	struct:vmm_s	typeref:struct:vmm_s::keysdb_s
+regions_nr	mm/vmm.h	/^	uint_t regions_nr;$/;"	m	struct:vmm_s
+regions_root	mm/vmm.h	/^	struct list_entry regions_root;$/;"	m	struct:vmm_s	typeref:struct:vmm_s::list_entry
+regions_tree	mm/vmm.h	/^	struct rb_root regions_tree;$/;"	m	struct:vmm_s	typeref:struct:vmm_s::rb_root
+regs	cpu/mipsel/cpu-asm.h	/^	reg_t regs[REGS_NR];		\/* REGS_NR in mips-regs.h *\/$/;"	m	struct:cpu_uzone_s
+release	vfs/vfs.h	/^	vfs_release_file_t *release;$/;"	m	struct:vfs_file_op_s
+release	vfs/vfs.h	/^	vfs_release_inode_t *release;$/;"	m	struct:vfs_inode_op_s
+releasepage	mm/mapper.h	/^	mapper_release_page_t	    *releasepage;$/;"	m	struct:mapper_op_s
+remote_atomic_add	kern/remote_access.h	/^#define remote_atomic_add(/;"	d
+remote_atomic_cas	kern/remote_access.h	/^#define remote_atomic_cas(/;"	d
+remote_atomic_try_add	kern/remote_access.h	/^#define remote_atomic_try_add /;"	d
+remote_fifo_destroy	kern/remote_fifo.c	/^void remote_fifo_destroy(struct remote_fifo_s *remote_fifo)$/;"	f
+remote_fifo_get	kern/remote_fifo.c	/^error_t remote_fifo_get(struct remote_fifo_s *remote_fifo, void **item)$/;"	f
+remote_fifo_init	kern/remote_fifo.c	/^error_t remote_fifo_init(struct remote_fifo_s *remote_fifo, size_t slot_nbr, size_t size)$/;"	f
+remote_fifo_isEmpty	kern/remote_fifo.h	/^static inline bool_t remote_fifo_isEmpty(struct remote_fifo_s *remote_fifo, cid_t cid)$/;"	f
+remote_fifo_isFull	kern/remote_fifo.h	/^static inline bool_t remote_fifo_isFull(struct remote_fifo_s *remote_fifo, cid_t cid)$/;"	f
+remote_fifo_put	kern/remote_fifo.c	/^error_t remote_fifo_put(struct remote_fifo_s *remote_fifo, cid_t cid, void *item, uint_t *pos)$/;"	f
+remote_fifo_release	kern/remote_fifo.c	/^void remote_fifo_release(struct remote_fifo_s *remote_fifo, void *item)$/;"	f
+remote_fifo_s	kern/remote_fifo.h	/^struct remote_fifo_s$/;"	s
+remote_fifo_used_items	kern/remote_fifo.h	/^static inline size_t remote_fifo_used_items(uint_t wridx, uint_t hdidx)$/;"	f
+remote_lb	kern/remote_access.h	/^#define remote_lb(/;"	d
+remote_lw	kern/remote_access.h	/^#define remote_lw(/;"	d
+remote_lw_unc	kern/remote_access.h	/^#define remote_lw_unc(/;"	d
+remote_memcpy	kern/remote_access.h	/^#define remote_memcpy(/;"	d
+remote_pages_cntr	kern/thread.h	/^	uint_t remote_pages_cntr;$/;"	m	struct:thread_info
+remote_pages_nr	mm/vmm.h	/^	uint_t remote_pages_nr;$/;"	m	struct:vmm_s
+remote_sb	kern/remote_access.h	/^#define remote_sb(/;"	d
+remote_spinlock_lock	kern/distlock.c	/^void remote_spinlock_lock(spinlock_t *lock, cid_t cid)$/;"	f
+remote_spinlock_trylock	kern/distlock.c	/^uint_t remote_spinlock_trylock(spinlock_t *lock, cid_t cid)$/;"	f
+remote_spinlock_unlock	kern/distlock.c	/^void remote_spinlock_unlock(spinlock_t *lock, cid_t cid)$/;"	f
+remote_sw	kern/remote_access.h	/^#define remote_sw(/;"	d
+remove	kern/scheduler.h	/^	sched_remove_t      *remove;$/;"	m	struct:sched_ops_s
+repli_root	vfs/vfs.h	/^	vfs_read_root_t *repli_root;$/;"	m	struct:vfs_context_op_s
+request_queue	drivers/ibmpc/ata.h	/^	struct list_entry request_queue;$/;"	m	struct:ata_context_s	typeref:struct:ata_context_s::list_entry
+request_queue	drivers/soclib/soclib_block.c	/^	struct list_entry request_queue;$/;"	m	struct:block_context_s	typeref:struct:block_context_s::list_entry	file:
+request_queue	drivers/soclib/soclib_dma.c	/^	struct list_entry request_queue;$/;"	m	struct:dma_context_s	typeref:struct:dma_context_s::list_entry	file:
+reserved	cpu/i386/cpu-internal.h	/^	uint8_t  reserved;$/;"	m	struct:cpu_idt_entry_s
+reserved1	drivers/ibmpc/ata.h	/^	uint16_t reserved1[64];$/;"	m	struct:ata_identify_s
+reserved2	drivers/ibmpc/ata.h	/^	uint16_t reserved2[96];$/;"	m	struct:ata_identify_s
+reserved_0	cpu/i386/cpu-internal.h	/^	uint16_t reserved_0;$/;"	m	struct:cpu_tss_s
+reserved_1	cpu/i386/cpu-internal.h	/^	uint16_t reserved_1;$/;"	m	struct:cpu_tss_s
+reserved_10	cpu/i386/cpu-internal.h	/^	uint16_t ldt,reserved_10;	\/* 24 *\/$/;"	m	struct:cpu_tss_s
+reserved_11	cpu/i386/cpu-internal.h	/^	uint16_t reserved_11:15;$/;"	m	struct:cpu_tss_s
+reserved_2	cpu/i386/cpu-internal.h	/^	uint16_t reserved_2;$/;"	m	struct:cpu_tss_s
+reserved_3	cpu/i386/cpu-internal.h	/^	uint16_t reserved_3;$/;"	m	struct:cpu_tss_s
+reserved_4	cpu/i386/cpu-internal.h	/^	uint16_t es, reserved_4;	\/* 18 *\/$/;"	m	struct:cpu_tss_s
+reserved_5	cpu/i386/cpu-internal.h	/^	uint16_t cs, reserved_5;	\/* 19 *\/$/;"	m	struct:cpu_tss_s
+reserved_6	cpu/i386/cpu-internal.h	/^	uint16_t ss, reserved_6;	\/* 20 *\/$/;"	m	struct:cpu_tss_s
+reserved_7	cpu/i386/cpu-internal.h	/^	uint16_t ds, reserved_7;	\/* 21 *\/$/;"	m	struct:cpu_tss_s
+reserved_8	cpu/i386/cpu-internal.h	/^	uint16_t fs, reserved_8;	\/* 22 *\/$/;"	m	struct:cpu_tss_s
+reserved_9	cpu/i386/cpu-internal.h	/^	uint16_t gs, reserved_9;	\/* 23 *\/$/;"	m	struct:cpu_tss_s
+reserved_end	libk/boot-info.h	/^	uint32_t reserved_end;$/;"	m	struct:boot_tbl_entry_s
+reserved_end	libk/boot-info.h	/^	uint_t reserved_end;$/;"	m	struct:boot_info_s
+reserved_start	libk/boot-info.h	/^	uint32_t reserved_start;$/;"	m	struct:boot_tbl_entry_s
+reserved_start	libk/boot-info.h	/^	uint_t reserved_start;$/;"	m	struct:boot_info_s
+response	kern/rpc.h	/^	volatile bool_t response;\/\/is this message a response ?$/;"	m	struct:rpc_s
+restore	cpu/i386/__cpu_context.S	/^restore:$/;"	l
+resume	kern/driver.h	/^	device_action_t *resume;$/;"	m	struct:driver_s
+ret_cs	cpu/i386/cpu-internal.h	/^	uint_t ret_cs;$/;"	m	struct:cpu_regs_s
+ret_eip	cpu/i386/cpu-internal.h	/^	uint_t ret_eip;$/;"	m	struct:cpu_regs_s
+ret_rpc	kern/rpc.h	/^	struct rpc_s *ret_rpc;\/\/pre allocated buffer for the response$/;"	m	struct:rpc_s	typeref:struct:rpc_s::rpc_s
+ret_size	kern/rpc.h	/^	size_t ret_size;$/;"	m	struct:rpc_s
+retval	kern/thread.h	/^	error_t retval;                     \/*! return value of last system call *\/$/;"	m	struct:thread_info
+revision	libk/arch-bib.h	/^	uint16_t   revision;$/;"	m	struct:arch_bib_header_s
+rf_get_index	kern/remote_fifo.c	/^size_t rf_get_index(struct remote_fifo_s *remote_fifo, struct rf_item_s* item)$/;"	f
+rf_item_s	kern/remote_fifo.h	/^struct rf_item_s$/;"	s
+rm_func	ksh/rm.c	/^error_t rm_func(void *param)$/;"	f
+rm_spinlock_check	kern/distlock.c	/^static void __attribute__((noinline)) rm_spinlock_check(struct thread_s *this, uint_t *mode)$/;"	f	file:
+root	fs/devfs/devfs-private.h	/^	struct metafs_s root;$/;"	m	struct:devfs_db_s	typeref:struct:devfs_db_s::metafs_s
+root	kern/event.h	/^	struct list_entry root;$/;"	m	struct:event_list_s	typeref:struct:event_list_s::list_entry
+root	kern/keysdb.h	/^	struct keys_record_s **root;$/;"	m	struct:keysdb_s	typeref:struct:keysdb_s::keys_record_s
+root	kern/wait_queue.h	/^	struct list_entry root;$/;"	m	struct:wait_queue_s	typeref:struct:wait_queue_s::list_entry
+root	ksh/miniShell.c	/^struct vfs_file_s *root ;$/;"	v	typeref:struct:vfs_file_s
+root	mm/page.c	/^	struct list_entry	root;$/;"	m	struct:dirty_pages_s	typeref:struct:dirty_pages_s::list_entry	file:
+root	mm/page.h	/^		struct slist_entry root;            $/;"	m	union:page_s::__anon49	typeref:struct:page_s::__anon49::slist_entry
+root	mm/ppm.h	/^	struct list_entry root;$/;"	m	struct:buddy_list_s	typeref:struct:buddy_list_s::list_entry
+root	vfs/vfs-private.h	/^	struct list_entry root;$/;"	m	struct:vfs_file_freelist_s	typeref:struct:vfs_file_freelist_s::list_entry
+root	vfs/vfs-private.h	/^	struct list_entry root;$/;"	m	struct:vfs_freelist_s	typeref:struct:vfs_freelist_s::list_entry
+root_info	vfs/vfs_init.c	/^struct root_info$/;"	s	file:
+root_node	kern/radix.h	/^	struct radix_node_s*    root_node;$/;"	m	struct:radix_s	typeref:struct:radix_s::radix_node_s
+rootdir_first_cluster	fs/fat32/fat32.h	/^	vfat_cluster_t rootdir_first_cluster;$/;"	m	struct:vfat_context_s
+rope	kern/cluster.h	/^	struct list_entry rope;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::list_entry
+rope	kern/thread.h	/^	struct list_entry rope;       \/*! next\/pred threads in the __rope list of thread *\/$/;"	m	struct:thread_s	typeref:struct:thread_s::list_entry
+rpc_activate_thread	kern/rpc.c	/^error_t rpc_activate_thread(struct rpc_listner_s *li)$/;"	f
+rpc_after_wakeup	kern/rpc.c	/^void rpc_after_wakeup(struct thread_s *thread)$/;"	f
+rpc_backoff	kern/rpc.c	/^static void rpc_backoff()$/;"	f	file:
+rpc_before_sleep	kern/rpc.c	/^void rpc_before_sleep(struct thread_s *thread)$/;"	f
+rpc_callback	kern/rpc.c	/^static bool_t rpc_callback(void* data)$/;"	f	file:
+rpc_check	kern/rpc.c	/^bool_t rpc_check()$/;"	f
+rpc_check_handler	kern/rpc.h	/^#define rpc_check_handler(/;"	d
+rpc_check_notify	kern/rpc.c	/^void rpc_check_notify(uint_t *irq_state)$/;"	f
+rpc_debug	kern/rpc.c	/^#define rpc_debug(/;"	d	file:
+rpc_dmsg	kern/kdmsg.h	/^#define rpc_dmsg(/;"	d
+rpc_exec	kern/rpc.c	/^void *rpc_exec(void* _rpc)$/;"	f
+rpc_get_arg	kern/rpc.c	/^void* rpc_get_arg(struct rpc_s *rpc, size_t args_nb)$/;"	f
+rpc_get_arg_sz	kern/rpc.c	/^size_t rpc_get_arg_sz(struct rpc_s *rpc, size_t args_nb)$/;"	f
+rpc_handle	kern/rpc.c	/^void rpc_handle(struct rpc_ptr_s * rpc_ptr)$/;"	f
+rpc_handler_t	kern/rpc.h	/^typedef void rpc_handler_t(struct rpc_s* rpc);$/;"	t
+rpc_is_handled	kern/rpc.h	/^#define rpc_is_handled(/;"	d
+rpc_is_pending	kern/rpc.h	/^#define rpc_is_pending(/;"	d
+rpc_list	kern/cpu.h	/^	struct list_entry rpc_list;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::list_entry
+rpc_listner_check_new	kern/rpc.c	/^bool_t rpc_listner_check_new(struct rpc_listner_s *rl)$/;"	f
+rpc_listner_init	kern/rpc.c	/^error_t rpc_listner_init(struct rpc_listner_s *rl)$/;"	f
+rpc_listner_notify	kern/rpc.c	/^error_t rpc_listner_notify(struct rpc_listner_s *rl, uint_t *irq_state)$/;"	f
+rpc_listner_s	kern/rpc.h	/^struct rpc_listner_s$/;"	s
+rpc_manager_init	kern/rpc.c	/^void rpc_manager_init(struct cpu_s *cpu)$/;"	f
+rpc_mgr	kern/cpu.h	/^	struct thread_s *rpc_mgr;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::thread_s
+rpc_print	kern/rpc.c	/^void rpc_print(struct rpc_s* rpc)$/;"	f
+rpc_prio_t	kern/rpc.h	/^}rpc_prio_t;$/;"	t	typeref:enum:__anon29
+rpc_ptr_copy	kern/rpc.c	/^error_t rpc_ptr_copy(struct rpc_ptr_s *rpc_ptr, struct rpc_ptr_s *local)$/;"	f
+rpc_ptr_s	kern/rpc.h	/^struct rpc_ptr_s$/;"	s
+rpc_release	kern/rpc.c	/^void rpc_release(struct rpc_s *rpc)$/;"	f
+rpc_response_notify	kern/rpc.c	/^void rpc_response_notify(struct rpc_s *rpc)$/;"	f
+rpc_s	kern/rpc.h	/^struct rpc_s$/;"	s
+rpc_send_rsp	kern/rpc.c	/^error_t rpc_send_rsp(struct rpc_s* sender_rpc, struct rpc_s* rpc, size_t size, uint32_t nb_ret)$/;"	f
+rpc_send_rsp_err	kern/rpc.c	/^void rpc_send_rsp_err(struct rpc_ptr_s *rpc_ptr)$/;"	f
+rpc_send_sync	kern/rpc.c	/^error_t rpc_send_sync(gid_t gid,  bool_t to_cid, size_t prio, void* func, $/;"	f
+rpc_set_handled	kern/rpc.h	/^#define rpc_set_handled(/;"	d
+rpc_set_handler	kern/rpc.h	/^#define rpc_set_handler(/;"	d
+rpc_test	kern/rpc.c	/^void rpc_test()$/;"	f
+rpc_test_func_t	kern/rpc.c	/^typedef error_t (*rpc_test_func_t)();$/;"	t	file:
+rpc_test_s	kern/rpc.c	/^struct rpc_test_s{$/;"	s	file:
+rpc_thread	kern/cpu.h	/^	uint_t rpc_thread;		\/\/Total number of rpc_thread$/;"	m	struct:cpu_s
+rpc_thread_create	kern/rpc.c	/^error_t rpc_thread_create(struct cpu_s *cpu, struct task_s *task)$/;"	f
+rpc_unset_handled	kern/rpc.h	/^#define rpc_unset_handled(/;"	d
+rpc_wait_response	kern/rpc.c	/^static void rpc_wait_response(struct rpc_s *rpc)$/;"	f	file:
+rppc_generic	kern/rpc.c	/^error_t rppc_generic(gid_t gid, bool_t to_clst, size_t prio, void* func, $/;"	f
+rq	fs/sysfs/sysfs-private.h	/^	sysfs_request_t rq;$/;"	m	struct:sysfs_file_s
+rr_add_created	kern/rr-sched.c	/^SCHED_SCOPE void rr_add_created(struct thread_s *thread)$/;"	f
+rr_add_created	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_add_created(struct thread_s *thread)$/;"	f
+rr_clock	kern/rr-sched.c	/^SCHED_SCOPE void rr_clock(struct thread_s *this, uint_t ticks_nr)$/;"	f
+rr_clock	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_clock(struct thread_s *this, uint_t ticks_nr)$/;"	f
+rr_clock_balancing	kern/rr-sched.c	/^SCHED_SCOPE void rr_clock_balancing(struct thread_s *this, uint_t ticks_nr)$/;"	f
+rr_clock_balancing	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_clock_balancing(struct thread_s *this, uint_t ticks_nr)$/;"	f
+rr_cpu_dmsg	kern/rr-sched.c	/^#define rr_cpu_dmsg(/;"	d	file:
+rr_cpu_dmsg	kern/rr-sched_locked.c	/^#define rr_cpu_dmsg(/;"	d	file:
+rr_dmsg	kern/rr-sched.c	/^#define rr_dmsg(/;"	d	file:
+rr_dmsg	kern/rr-sched_locked.c	/^#define rr_dmsg(/;"	d	file:
+rr_elect	kern/rr-sched.c	/^SCHED_SCOPE struct thread_s *rr_elect(struct sched_s *sched)$/;"	f
+rr_elect	kern/rr-sched_locked.c	/^SCHED_SCOPE struct thread_s *rr_elect(struct sched_s *sched)$/;"	f
+rr_elect_balancing	kern/rr-sched.c	/^SCHED_SCOPE struct thread_s *rr_elect_balancing(struct sched_s *sched)$/;"	f
+rr_elect_balancing	kern/rr-sched_locked.c	/^SCHED_SCOPE struct thread_s *rr_elect_balancing(struct sched_s *sched)$/;"	f
+rr_exit	kern/rr-sched.c	/^SCHED_SCOPE void rr_exit(struct thread_s *this)$/;"	f
+rr_exit	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_exit(struct thread_s *this)$/;"	f
+rr_remove	kern/rr-sched.c	/^SCHED_SCOPE void rr_remove(struct thread_s *this)$/;"	f
+rr_remove	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_remove(struct thread_s *this)$/;"	f
+rr_sched_init	kern/rr-sched.c	/^error_t rr_sched_init(struct scheduler_s *scheduler, struct sched_s *sched)$/;"	f
+rr_sched_init	kern/rr-sched_locked.c	/^error_t rr_sched_init(struct scheduler_s *scheduler, struct sched_s *sched)$/;"	f
+rr_sched_load_balance	kern/rr-sched.c	/^void __attribute__ ((noinline)) rr_sched_load_balance(struct thread_s *this,$/;"	f
+rr_sched_load_balance	kern/rr-sched_locked.c	/^void __attribute__ ((noinline)) rr_sched_load_balance(struct thread_s *this,$/;"	f
+rr_sched_op	kern/rr-sched.c	/^static const struct sched_ops_s rr_sched_op = $/;"	v	typeref:struct:sched_ops_s	file:
+rr_sched_op	kern/rr-sched_locked.c	/^static const struct sched_ops_s rr_sched_op = $/;"	v	typeref:struct:sched_ops_s	file:
+rr_sched_strategy	kern/rr-sched.c	/^SCHED_SCOPE void rr_sched_strategy(struct sched_s *sched)$/;"	f
+rr_sched_strategy	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_sched_strategy(struct sched_s *sched)$/;"	f
+rr_sleep	kern/rr-sched.c	/^SCHED_SCOPE void rr_sleep(struct thread_s *this)$/;"	f
+rr_sleep	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_sleep(struct thread_s *this)$/;"	f
+rr_wakeup	kern/rr-sched.c	/^SCHED_SCOPE void rr_wakeup (struct thread_s *thread)$/;"	f
+rr_wakeup	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_wakeup (struct thread_s *thread)$/;"	f
+rr_yield	kern/rr-sched.c	/^SCHED_SCOPE void rr_yield(struct thread_s *this)$/;"	f
+rr_yield	kern/rr-sched_locked.c	/^SCHED_SCOPE void rr_yield(struct thread_s *this)$/;"	f
+rsrvd_limit	libk/arch-bib.h	/^	uint32_t   rsrvd_limit;	        \/* Boot Frozen Order *\/$/;"	m	struct:arch_bib_header_s
+rsrvd_start	libk/arch-bib.h	/^	uint32_t   rsrvd_start;		\/\/FG$/;"	m	struct:arch_bib_header_s
+rt_cmd	kern/rt_timer.h	/^	uint_t rt_cmd;$/;"	m	struct:rt_params_s
+rt_params_s	kern/rt_timer.h	/^struct rt_params_s$/;"	s
+rt_timer	arch/ibmpc/arch_init.c	/^struct device_s rt_timer;$/;"	v	typeref:struct:device_s
+rt_timer	arch/tsar/rt_timer.c	/^struct device_s rt_timer;$/;"	v	typeref:struct:device_s
+rt_timer_ctrl	arch/ibmpc/rt_timer.c	/^error_t rt_timer_ctrl(struct rt_params_s *param)$/;"	f
+rt_timer_ctrl	arch/tsar/rt_timer.c	/^error_t rt_timer_ctrl(struct rt_params_s *param)$/;"	f
+rt_timer_init	arch/ibmpc/rt_timer.c	/^error_t rt_timer_init(uint_t period, uint_t withIrq)$/;"	f
+rt_timer_init	arch/tsar/rt_timer.c	/^error_t rt_timer_init(uint_t period, uint_t withIrq)$/;"	f
+rt_timer_read	arch/ibmpc/rt_timer.c	/^error_t rt_timer_read(uint_t *time)$/;"	f
+rt_timer_read	arch/tsar/rt_timer.c	/^error_t rt_timer_read(uint_t *time)$/;"	f
+rt_timer_set	arch/ibmpc/rt_timer.c	/^error_t rt_timer_set(uint_t time)$/;"	f
+rt_timer_set	arch/tsar/rt_timer.c	/^error_t rt_timer_set(uint_t time)$/;"	f
+rt_timer_setperiod	arch/ibmpc/rt_timer.c	/^error_t rt_timer_setperiod(uint_t period)$/;"	f
+rt_timer_setperiod	arch/tsar/rt_timer.c	/^error_t rt_timer_setperiod(uint_t period)$/;"	f
+rt_value	kern/rt_timer.h	/^	sint_t rt_value;$/;"	m	struct:rt_params_s
+run	kern/driver.h	/^	timer_run_t *run;$/;"	m	struct:dev_timer_op
+runnable	kern/rr-sched.c	/^	struct list_entry runnable;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::list_entry	file:
+runnable	kern/rr-sched_locked.c	/^	struct list_entry runnable;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::list_entry	file:
+rwlock	drivers/ibmpc/tty.h	/^	struct rwlock_s rwlock;$/;"	m	struct:tty_context_s	typeref:struct:tty_context_s::rwlock_s
+rwlock	mm/vmm.h	/^	struct rwlock_s rwlock;$/;"	m	struct:vmm_s	typeref:struct:vmm_s::rwlock_s
+rwlock_destroy	kern/rwlock.c	/^error_t rwlock_destroy(struct rwlock_s *rwlock)$/;"	f
+rwlock_get_value	kern/rwlock.h	/^#define rwlock_get_value(/;"	d
+rwlock_get_value	kern/rwlock.h	/^#undef rwlock_get_value$/;"	d
+rwlock_init	kern/rwlock.c	/^error_t rwlock_init(struct rwlock_s *rwlock)$/;"	f
+rwlock_kmem_init	kern/rwlock.h	/^KMEM_OBJATTR_INIT(rwlock_kmem_init);$/;"	v
+rwlock_operation_t	kern/rwlock.h	/^} rwlock_operation_t;$/;"	t	typeref:enum:__anon30
+rwlock_rdlock	kern/rwlock.c	/^error_t rwlock_rdlock(struct rwlock_s *rwlock)$/;"	f
+rwlock_s	kern/rwlock.h	/^struct rwlock_s$/;"	s
+rwlock_tryrdlock	kern/rwlock.c	/^error_t rwlock_tryrdlock(struct rwlock_s *rwlock)$/;"	f
+rwlock_trywrlock	kern/rwlock.c	/^error_t rwlock_trywrlock(struct rwlock_s *rwlock)$/;"	f
+rwlock_unlock	kern/rwlock.c	/^error_t rwlock_unlock(struct rwlock_s *rwlock)$/;"	f
+rwlock_wrlock	kern/rwlock.c	/^error_t rwlock_wrlock(struct rwlock_s *rwlock)$/;"	f
+s0_16	cpu/mipsel/cpu-asm.h	/^	reg_t s0_16;$/;"	m	struct:cpu_context_s
+s1_17	cpu/mipsel/cpu-asm.h	/^	reg_t s1_17;$/;"	m	struct:cpu_context_s
+s2_18	cpu/mipsel/cpu-asm.h	/^	reg_t s2_18;$/;"	m	struct:cpu_context_s
+s3_19	cpu/mipsel/cpu-asm.h	/^	reg_t s3_19;$/;"	m	struct:cpu_context_s
+s4_20	cpu/mipsel/cpu-asm.h	/^	reg_t s4_20;$/;"	m	struct:cpu_context_s
+s5_21	cpu/mipsel/cpu-asm.h	/^	reg_t s5_21;$/;"	m	struct:cpu_context_s
+s6_22	cpu/mipsel/cpu-asm.h	/^	reg_t s6_22;$/;"	m	struct:cpu_context_s
+s7_23	cpu/mipsel/cpu-asm.h	/^	reg_t s7_23;$/;"	m	struct:cpu_context_s
+sa_flags	kern/signal.h	/^	uint32_t sa_flags;$/;"	m	struct:sigaction_s
+sa_handler	kern/signal.h	/^		sa_handler_t *sa_handler;$/;"	m	union:sigaction_s::__anon33
+sa_handler_t	kern/signal.h	/^typedef SIGNAL_HANDLER(sa_handler_t);$/;"	t
+sa_mask	kern/signal.h	/^	sigset_t sa_mask;$/;"	m	struct:sigaction_s
+sa_sigaction	kern/signal.h	/^		void (*sa_sigaction)(int, siginfo_t *, void *);$/;"	m	union:sigaction_s::__anon33
+sched_add	kern/scheduler.c	/^void sched_add(struct thread_s *thread)$/;"	f
+sched_add_created	kern/scheduler.c	/^void sched_add_created(struct thread_s *thread)$/;"	f
+sched_add_created_t	kern/scheduler.h	/^typedef void sched_add_created_t (struct thread_s *thread);$/;"	t
+sched_add_t	kern/scheduler.h	/^typedef void sched_add_t         (struct thread_s *thread);$/;"	t
+sched_alive_count	kern/scheduler.h	/^static inline uint_t sched_alive_count(struct scheduler_s *scheduler)$/;"	f
+sched_assert	kern/rr-sched.c	/^#define sched_assert(/;"	d	file:
+sched_assert	kern/rr-sched_locked.c	/^#define sched_assert(/;"	d	file:
+sched_callback_t	kern/scheduler.h	/^typedef bool_t sched_callback_t(void* data);$/;"	t
+sched_clock	kern/scheduler.c	/^void sched_clock(struct thread_s *this, uint_t ticks_nr)$/;"	f
+sched_clock_t	kern/scheduler.h	/^typedef void sched_clock_t    (struct thread_s *thread, uint_t ticks_nr);$/;"	t
+sched_db_s	kern/scheduler.c	/^struct sched_db_s$/;"	s	file:
+sched_dmsg	kern/rr-sched_locked.c	/^#define sched_dmsg(/;"	d	file:
+sched_elect_t	kern/scheduler.h	/^typedef struct thread_s* sched_elect_t (struct sched_s *sched);$/;"	t	typeref:struct:sched_elect_t
+sched_event	kern/thread_migrate.c	/^	uint_t              sched_event;$/;"	m	struct:__anon41	file:
+sched_event_make	kern/scheduler.h	/^#define sched_event_make(/;"	d
+sched_event_make	kern/scheduler.h	/^#undef sched_event_make$/;"	d
+sched_event_notify	kern/scheduler.c	/^#define sched_event_notify(/;"	d	file:
+sched_event_notify	kern/scheduler.c	/^SCHED_SCOPE void sched_event_notify(struct scheduler_s *scheduler)$/;"	f
+sched_event_send	kern/scheduler.h	/^static inline void sched_event_send(void *listner, uint_t event)$/;"	f
+sched_exit	kern/scheduler.c	/^void sched_exit(struct thread_s *this)$/;"	f
+sched_exit_t	kern/scheduler.h	/^typedef void sched_exit_t        (struct thread_s *thread);$/;"	t
+sched_get_listner	kern/scheduler.c	/^void* sched_get_listner(struct thread_s *thread, uint_t sched_op)$/;"	f
+sched_getpolicy	kern/scheduler.c	/^uint_t sched_getpolicy(struct thread_s *thread)$/;"	f
+sched_idle	kern/scheduler.c	/^void sched_idle(struct thread_s *this)$/;"	f
+sched_init	kern/scheduler.c	/^error_t sched_init(struct scheduler_s *scheduler)$/;"	f
+sched_init_t	kern/scheduler.h	/^typedef error_t sched_init_t     (struct scheduler_s *scheduler, struct sched_s *sched);$/;"	t
+sched_isPending	kern/scheduler.h	/^#define sched_isPending(/;"	d
+sched_isPending	kern/scheduler.h	/^#undef sched_isPending$/;"	d
+sched_listner	kern/sys_thread_create.c	/^	void              *sched_listner;$/;"	m	struct:__anon35	file:
+sched_listner	kern/thread_migrate.c	/^	void                *sched_listner;$/;"	m	struct:__anon41	file:
+sched_notify_dmsg	kern/scheduler.c	/^#define sched_notify_dmsg(/;"	d	file:
+sched_nr	kern/thread.h	/^	uint_t sched_nr;$/;"	m	struct:thread_info
+sched_ops_s	kern/scheduler.h	/^struct sched_ops_s$/;"	s
+sched_param	kern/scheduler.h	/^struct sched_param$/;"	s
+sched_param	kern/thread.h	/^	struct sched_param  sched_param;$/;"	m	struct:__anon39	typeref:struct:__anon39::sched_param
+sched_pinfo_t	kern/scheduler.c	/^}sched_pinfo_t;$/;"	t	typeref:struct:__anon31	file:
+sched_policy	kern/thread.h	/^	uint_t sched_policy;$/;"	m	struct:__anon39
+sched_priority	kern/scheduler.h	/^	int sched_priority;$/;"	m	struct:sched_param
+sched_register	kern/scheduler.c	/^error_t sched_register(struct thread_s *thread)$/;"	f
+sched_remove	kern/scheduler.c	/^void sched_remove(struct thread_s *this)$/;"	f
+sched_remove_t	kern/scheduler.h	/^typedef void sched_remove_t      (struct thread_s *thread);$/;"	t
+sched_runnable_count	kern/scheduler.h	/^static inline uint_t sched_runnable_count(struct scheduler_s *scheduler)$/;"	f
+sched_s	kern/scheduler.h	/^struct sched_s$/;"	s
+sched_setpolicy	kern/scheduler.c	/^error_t sched_setpolicy(struct thread_s *thread, uint_t policy)$/;"	f
+sched_setprio	kern/scheduler.c	/^void sched_setprio(struct thread_s *thread, uint_t prio)$/;"	f
+sched_setprio_t	kern/scheduler.h	/^typedef void sched_setprio_t  (struct thread_s *thread, uint_t prio);$/;"	t
+sched_sleep	kern/scheduler.c	/^void sched_sleep(struct thread_s *this)$/;"	f
+sched_sleep_check	kern/scheduler.c	/^void sched_sleep_check(struct thread_s *this, $/;"	f
+sched_sleep_t	kern/scheduler.h	/^typedef void sched_sleep_t    (struct thread_s *thread);$/;"	t
+sched_strategy	kern/scheduler.c	/^void sched_strategy(struct scheduler_s *scheduler)$/;"	f
+sched_strategy_t	kern/scheduler.h	/^typedef void sched_strategy_t    (struct sched_s *sched);$/;"	t
+sched_switch	kern/scheduler.c	/^void sched_switch(struct thread_s *this, struct thread_s *elected)$/;"	f
+sched_unregister	kern/scheduler.c	/^SCHED_SCOPE void sched_unregister(struct thread_s *thread)$/;"	f
+sched_wakeup	kern/scheduler.c	/^void sched_wakeup (struct thread_s *thread)$/;"	f
+sched_wakeup_t	kern/scheduler.h	/^typedef void sched_wakeup_t   (struct thread_s *thread);$/;"	t
+sched_yield	kern/scheduler.c	/^int sched_yield(struct thread_s *this)$/;"	f
+sched_yield_t	kern/scheduler.h	/^typedef void sched_yield_t    (struct thread_s *thread);$/;"	t
+scheds_tbl	kern/scheduler.h	/^	struct sched_s scheds_tbl[SCHEDS_NR];$/;"	m	struct:scheduler_s	typeref:struct:scheduler_s::sched_s
+schedule	kern/scheduler.c	/^SCHED_SCOPE void schedule(struct thread_s *this)$/;"	f
+scheduler	kern/cpu.h	/^	struct scheduler_s scheduler;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::scheduler_s
+scheduler	kern/rr-sched.c	/^	struct scheduler_s *scheduler;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::scheduler_s	file:
+scheduler	kern/rr-sched_locked.c	/^	struct scheduler_s *scheduler;$/;"	m	struct:rQueues_s	typeref:struct:rQueues_s::scheduler_s	file:
+scheduler_s	kern/scheduler.h	/^struct scheduler_s$/;"	s
+scope	kern/semaphore.h	/^	uint_t scope;$/;"	m	struct:semaphore_s
+scpy_from_buff	kern/ku_transfert.h	/^		ku_scpy_t *scpy_from_buff;$/;"	m	union:ku_obj::__anon23
+scpy_to_buff	kern/ku_transfert.h	/^		ku_scpy_t *scpy_to_buff;$/;"	m	union:ku_obj::__anon22
+scrollup	cpu/i386/screen.c	/^void scrollup(unsigned int n)$/;"	f
+sda_count	drivers/soclib/soclib_block.c	/^static uint_t sda_count = 0;$/;"	v	file:
+sector_size	kern/driver.h	/^	uint_t sector_size;$/;"	m	struct:dev_params_s
+sectors	drivers/ibmpc/ata.h	/^	uint32_t sectors;$/;"	m	struct:ata_identify_s
+sectors_per_cluster	fs/fat32/fat32.h	/^	uint32_t sectors_per_cluster;$/;"	m	struct:vfat_context_s
+select_dmsg	kern/dqdt.c	/^#define select_dmsg(/;"	d	file:
+select_tbl	kern/dqdt.h	/^	sint_t *select_tbl;$/;"	m	struct:dqdt_attr_s
+selector	cpu/i386/cpu-internal.h	/^	uint16_t selector;$/;"	m	struct:cpu_idt_entry_s
+sem_destroy	kern/semaphore.c	/^error_t sem_destroy(struct semaphore_s *sem)$/;"	f
+sem_getvalue	kern/semaphore.c	/^error_t sem_getvalue(struct semaphore_s *sem, int *value)$/;"	f
+sem_init	kern/semaphore.c	/^error_t sem_init(struct semaphore_s *sem, uint_t value, uint_t scope)$/;"	f
+sem_kmem_init	kern/semaphore.h	/^KMEM_OBJATTR_INIT(sem_kmem_init);$/;"	v
+sem_operation_t	kern/semaphore.h	/^} sem_operation_t;$/;"	t	typeref:enum:__anon32
+sem_post	kern/semaphore.c	/^error_t sem_post(struct semaphore_s *sem)$/;"	f
+sem_t	libk/types.h	/^typedef unsigned long sem_t;$/;"	t
+sem_trywait	kern/semaphore.c	/^error_t sem_trywait(struct semaphore_s *sem)$/;"	f
+sem_wait	kern/semaphore.c	/^error_t sem_wait(struct semaphore_s *sem)$/;"	f
+semaphore_s	kern/semaphore.h	/^struct semaphore_s$/;"	s
+sender	kern/rpc.h	/^	struct thread_s *sender;$/;"	m	struct:rpc_s	typeref:struct:rpc_s::thread_s
+set	kern/remote_fifo.h	/^	volatile char set;$/;"	m	struct:rf_item_s
+set_extension	cpu/mipsel/cpu-remote.h	/^#define set_extension(/;"	d
+set_mask	kern/driver.h	/^	icu_set_mask_t *set_mask;$/;"	m	struct:dev_icu_op
+set_page_dirty	mm/mapper.h	/^	mapper_set_page_dirty_t     *set_page_dirty;$/;"	m	struct:mapper_op_s
+set_params	kern/driver.h	/^	device_params_t  *set_params;$/;"	m	struct:dev_icu_op
+set_params	kern/driver.h	/^	device_params_t  *set_params;$/;"	m	struct:dev_op
+set_period	kern/driver.h	/^	timer_set_period_t *set_period;$/;"	m	struct:dev_timer_op
+set_value	kern/driver.h	/^	timer_set_value_t *set_value;$/;"	m	struct:dev_timer_op
+severty	arch/tsar/mmu-info.h	/^	char *severty;$/;"	m	struct:mmu_except_info_s
+sgi_info_s	ksh/sgiImg.h	/^struct sgi_info_s$/;"	s
+shared	mm/page.h	/^		uint32_t shared;$/;"	m	union:page_s::__anon48
+show1	ksh/ls.c	/^ void show1(void)$/;"	f
+show2	ksh/ls.c	/^ void show2(void)$/;"	f
+show3	ksh/ls.c	/^ void show3(void)$/;"	f
+show_cursor	cpu/i386/screen.c	/^void show_cursor(void)$/;"	f
+show_instrumentation	ksh/instrument.c	/^error_t show_instrumentation(void *param)$/;"	f
+shrink_tree	kern/radix.c	/^static void shrink_tree(struct radix_s*	root)$/;"	f	file:
+si_addr	kern/signal.h	/^	void    *si_addr;     \/* Memory location which caused fault *\/$/;"	m	struct:siginfo_s
+si_band	kern/signal.h	/^	int      si_band;     \/* Band event *\/$/;"	m	struct:siginfo_s
+si_code	kern/signal.h	/^	int      si_code;     \/* Signal code *\/$/;"	m	struct:siginfo_s
+si_errno	kern/signal.h	/^	int      si_errno;    \/* An errno value *\/$/;"	m	struct:siginfo_s
+si_fd	kern/signal.h	/^	int      si_fd;       \/* File descriptor *\/$/;"	m	struct:siginfo_s
+si_int	kern/signal.h	/^	int      si_int;      \/* POSIX.1b signal *\/$/;"	m	struct:siginfo_s
+si_pid	kern/signal.h	/^	pid_t    si_pid;      \/* Sending process ID *\/$/;"	m	struct:siginfo_s
+si_ptr	kern/signal.h	/^	void    *si_ptr;      \/* POSIX.1b signal *\/$/;"	m	struct:siginfo_s
+si_signo	kern/signal.h	/^	int      si_signo;    \/* Signal number *\/$/;"	m	struct:siginfo_s
+si_status	kern/signal.h	/^	int      si_status;   \/* Exit value or signal *\/$/;"	m	struct:siginfo_s
+si_stime	kern/signal.h	/^	clock_t  si_stime;    \/* System time consumed *\/$/;"	m	struct:siginfo_s
+si_uid	kern/signal.h	/^	uid_t    si_uid;      \/* Real user ID of sending process *\/$/;"	m	struct:siginfo_s
+si_utime	kern/signal.h	/^	clock_t  si_utime;    \/* User time consumed *\/$/;"	m	struct:siginfo_s
+si_value	kern/signal.h	/^	sigval_t si_value;    \/* Signal value *\/$/;"	m	struct:siginfo_s
+sig_dmsg	kern/kdmsg.h	/^#define sig_dmsg(/;"	d
+sig_mask	kern/thread.h	/^	uint_t sig_mask;$/;"	m	struct:thread_info
+sig_mgr	kern/task.h	/^	struct sig_mgr_s sig_mgr;$/;"	m	struct:task_s	typeref:struct:task_s::sig_mgr_s
+sig_mgr_s	kern/signal.h	/^struct sig_mgr_s$/;"	s
+sig_state	kern/thread.h	/^	uint_t sig_state;$/;"	m	struct:thread_info
+sigaction_s	kern/signal.h	/^struct sigaction_s $/;"	s
+sigactions	kern/signal.h	/^	sa_handler_t *sigactions[SIG_NR];$/;"	m	struct:sig_mgr_s
+siginfo_s	kern/signal.h	/^typedef struct siginfo_s$/;"	s
+siginfo_t	kern/signal.h	/^}siginfo_t;$/;"	t	typeref:struct:siginfo_s
+signal_init	kern/signal.c	/^error_t signal_init(struct thread_s *thread)$/;"	f
+signal_manager_destroy	kern/signal.h	/^#define signal_manager_destroy(/;"	d
+signal_manager_init	kern/signal.c	/^error_t signal_manager_init(struct task_s *task)$/;"	f
+signal_notify	kern/signal.c	/^void signal_notify(struct thread_s *this)$/;"	f
+signal_rise	kern/signal.c	/^error_t signal_rise(pid_t pid, cid_t location, uint_t sig)$/;"	f
+signal_rise_all	kern/signal.c	/^static error_t signal_rise_all(struct task_s *task, uint_t sig)$/;"	f	file:
+signal_rise_one	kern/signal.c	/^static error_t signal_rise_one(struct task_s *task, uint_t sig)$/;"	f	file:
+signature	kern/barrier.h	/^	uint_t signature;$/;"	m	struct:barrier_s
+signature	kern/cond_var.h	/^	uint_t signature;$/;"	m	struct:cv_s
+signature	kern/rwlock.h	/^	uint_t signature;$/;"	m	struct:rwlock_s
+signature	kern/semaphore.h	/^	uint_t signature;$/;"	m	struct:semaphore_s
+signature	kern/thread.h	/^	uint_t signature;$/;"	m	struct:thread_s
+signature	kern/time.h	/^	uint_t signature;$/;"	m	struct:alarm_info_s
+signature	libk/arch-bib.h	/^	char       signature[16];$/;"	m	struct:arch_bib_header_s
+signature	libk/boot-info.h	/^	uint_t signature;\/*1*\/$/;"	m	struct:kernel_info_s
+signature	mm/ppm.h	/^	uint_t signature;$/;"	m	struct:ppm_s
+sigreturn_func	cpu/mipsel/cpu-asm.h	/^	reg_t sigreturn_func;           \/* 20 *\/$/;"	m	struct:cpu_context_s
+sigreturn_func	kern/thread.h	/^	void *sigreturn_func;$/;"	m	struct:__anon39
+sigset_t	kern/signal.h	/^typedef uint32_t sigset_t;$/;"	t
+sigstack_addr	kern/thread.h	/^	void *sigstack_addr;$/;"	m	struct:__anon39
+sigstack_size	cpu/mipsel/cpu-asm.h	/^	reg_t sigstack_size;		\/* 22 *\/$/;"	m	struct:cpu_context_s
+sigstack_size	kern/thread.h	/^	size_t sigstack_size;$/;"	m	struct:__anon39
+sigstack_top	cpu/mipsel/cpu-asm.h	/^	reg_t sigstack_top;             \/* 21 *\/$/;"	m	struct:cpu_context_s
+sigval_t	kern/signal.h	/^typedef uint32_t sigval_t;$/;"	t
+sint_t	libk/types.h	/^typedef signed long sint_t;$/;"	t
+size	kern/cluster.h	/^	uint_t size;$/;"	m	struct:cluster_entry_s
+size	kern/device.h	/^	uint_t size;			  \/*! size of the mapped device *\/$/;"	m	struct:device_s
+size	kern/driver.h	/^	size_t size;$/;"	m	struct:dev_params_s
+size	kern/kfifo.h	/^	size_t  size;$/;"	m	struct:kfifo_s
+size	kern/ku_transfert.h	/^	uint_t size;$/;"	m	struct:ku_obj
+size	kern/rpc.h	/^	size_t size;$/;"	m	struct:rpc_ptr_s
+size	kern/rpc.h	/^	size_t size;$/;"	m	struct:rpc_s
+size	libk/arch-bib.h	/^	uint16_t   size;$/;"	m	struct:arch_bib_header_s
+size	libk/arch-bib.h	/^	uint32_t size;$/;"	m	struct:arch_bib_device_s
+size	mm/heap_manager.c	/^	uint_t size:31;$/;"	m	struct:block_info_s	file:
+size	mm/kcm.h	/^	size_t size;$/;"	m	struct:kcm_s
+size	mm/kmem.h	/^  uint_t size;$/;"	m	struct:kmem_objattr_s
+size	mm/kmem.h	/^  uint_t size;$/;"	m	struct:kmem_req_s
+size	mm/mapper.h	/^	size_t size;$/;"	m	struct:mapper_buff_s
+size	vfs/vfs.h	/^	size_t size;$/;"	m	struct:vfs_icreate_s
+size_t	libk/stdint.h	/^typedef unsigned long size_t;$/;"	t
+sleep	kern/scheduler.h	/^	sched_sleep_t       *sleep;$/;"	m	struct:sched_ops_s
+sleep_check	kern/scheduler.h	/^	struct list_entry sleep_check;$/;"	m	struct:scheduler_s	typeref:struct:scheduler_s::list_entry
+slist_assert_dead	libk/list.h	/^#define slist_assert_dead(/;"	d
+slist_empty	libk/list.h	/^#define slist_empty(/;"	d
+slist_entry	libk/list.h	/^struct slist_entry{$/;"	s
+slist_entry_init	libk/list.h	/^#define slist_entry_init(/;"	d
+slist_root_init	libk/list.h	/^#define slist_root_init(/;"	d
+slock_t	kern/spinlock.h	/^typedef sint_t slock_t;$/;"	t
+slot_nbr	kern/remote_fifo.h	/^	size_t	slot_nbr;$/;"	m	struct:remote_fifo_s
+slot_size	kern/remote_fifo.h	/^	size_t	slot_size;$/;"	m	struct:remote_fifo_s
+soclib_blkdev_driver	drivers/soclib/soclib_block.c	/^driver_t soclib_blkdev_driver = { .init = &soclib_block_init };$/;"	v
+soclib_block_init	drivers/soclib/soclib_block.c	/^error_t soclib_block_init(struct device_s *block)$/;"	f
+soclib_dma_driver	drivers/soclib/soclib_dma.c	/^driver_t soclib_dma_driver = { .init = &soclib_dma_init };$/;"	v
+soclib_dma_init	drivers/soclib/soclib_dma.c	/^error_t soclib_dma_init(struct device_s *dma)$/;"	f
+soclib_drvid_t	drivers/soclib/drvdb.h	/^}soclib_drvid_t;$/;"	t	typeref:enum:__anon2
+soclib_fb_driver	drivers/soclib/soclib_fb.c	/^driver_t soclib_fb_driver = { .init = &soclib_fb_init };$/;"	v
+soclib_fb_init	drivers/soclib/soclib_fb.c	/^error_t soclib_fb_init(struct device_s *fb)$/;"	f
+soclib_icu_bind	drivers/soclib/soclib_icu.c	/^error_t soclib_icu_bind(struct device_s *icu, struct device_s *dev)$/;"	f
+soclib_icu_driver	drivers/soclib/soclib_icu.c	/^driver_t soclib_icu_driver = { .init = &soclib_icu_init };$/;"	v
+soclib_icu_init	drivers/soclib/soclib_icu.c	/^error_t soclib_icu_init(struct device_s *icu)$/;"	f
+soclib_iopic_driver	drivers/soclib/soclib_iopic.c	/^driver_t soclib_iopic_driver = { .init = &soclib_iopic_init };$/;"	v
+soclib_iopic_init	drivers/soclib/soclib_iopic.c	/^error_t soclib_iopic_init(struct device_s *iopic)$/;"	f
+soclib_memc_driver	drivers/soclib/soclib_memc.c	/^driver_t soclib_memc_driver = { .init = &soclib_memc_init };$/;"	v
+soclib_memc_init	drivers/soclib/soclib_memc.c	/^error_t soclib_memc_init(struct device_s *memc)$/;"	f
+soclib_timer_driver	drivers/soclib/soclib_timer.c	/^driver_t soclib_timer_driver = { .init = &soclib_timer_init };$/;"	v
+soclib_timer_init	drivers/soclib/soclib_timer.c	/^error_t soclib_timer_init(struct device_s *timer)$/;"	f
+soclib_tty_driver	drivers/soclib/soclib_tty.c	/^driver_t soclib_tty_driver = { .init = &soclib_tty_init };$/;"	v
+soclib_tty_init	drivers/soclib/soclib_tty.c	/^error_t soclib_tty_init(struct device_s *tty)$/;"	f
+soclib_xicu_barrier_destroy	drivers/soclib/soclib_xicu.c	/^error_t soclib_xicu_barrier_destroy(struct device_s *xicu, uint_t barrier_id)$/;"	f
+soclib_xicu_barrier_init	drivers/soclib/soclib_xicu.c	/^sint_t soclib_xicu_barrier_init(struct device_s *xicu, struct event_s *event, uint_t count)$/;"	f
+soclib_xicu_barrier_wait	drivers/soclib/soclib_xicu.c	/^sint_t  soclib_xicu_barrier_wait(struct device_s *xicu, uint_t barrier_id)$/;"	f
+soclib_xicu_bind	drivers/soclib/soclib_xicu.c	/^error_t soclib_xicu_bind(struct device_s *icu, struct device_s *dev)$/;"	f
+soclib_xicu_bind_wti	drivers/soclib/soclib_xicu.c	/^error_t soclib_xicu_bind_wti(struct device_s *icu, struct irq_action_s *action, uint_t wti_index)$/;"	f
+soclib_xicu_driver	drivers/soclib/soclib_xicu.c	/^driver_t soclib_xicu_driver = { .init = &soclib_xicu_init };$/;"	v
+soclib_xicu_init	drivers/soclib/soclib_xicu.c	/^error_t soclib_xicu_init(struct device_s *icu)$/;"	f
+soclib_xicu_ipi_send	drivers/soclib/soclib_xicu.c	/^error_t soclib_xicu_ipi_send(struct device_s *xicu, uint_t port, uint32_t val)$/;"	f
+sort_dmsg	kern/dqdt.c	/^#define sort_dmsg(/;"	d	file:
+sp_29	cpu/mipsel/cpu-asm.h	/^	reg_t sp_29;			\/* 8 *\/$/;"	m	struct:cpu_context_s
+speed	kern/driver.h	/^	uint_t speed;$/;"	m	struct:dev_params_s
+spin_init	kern/spinlock.c	/^inline void spin_init(slock_t *lock)$/;"	f
+spin_lock	kern/spinlock.c	/^void spin_lock(slock_t *lock)$/;"	f
+spin_unlock	kern/spinlock.c	/^void spin_unlock(slock_t *lock)$/;"	f
+spin_unlock_nosched	kern/spinlock.c	/^void spin_unlock_nosched(slock_t *lock)$/;"	f
+spinlock_check	kern/spinlock.c	/^static void __attribute__((noinline)) spinlock_check(struct thread_s *this, uint_t *mode)$/;"	f	file:
+spinlock_destroy	kern/spinlock.c	/^inline void spinlock_destroy(spinlock_t *lock)$/;"	f
+spinlock_get_name	kern/spinlock.h	/^static inline char* spinlock_get_name(spinlock_t *lock)$/;"	f
+spinlock_init	kern/spinlock.c	/^inline void spinlock_init(spinlock_t *lock, char *name)$/;"	f
+spinlock_lock	kern/spinlock.c	/^void spinlock_lock(spinlock_t *lock)$/;"	f
+spinlock_lock_noirq	kern/spinlock.c	/^void spinlock_lock_noirq(spinlock_t *lock, uint_t *irq_state)$/;"	f
+spinlock_rdlock	kern/spinlock.c	/^void spinlock_rdlock(spinlock_t *lock)$/;"	f
+spinlock_s	kern/spinlock.h	/^struct spinlock_s$/;"	s
+spinlock_t	kern/spinlock.h	/^typedef struct spinlock_s spinlock_t;$/;"	t	typeref:struct:spinlock_s
+spinlock_trylock	kern/spinlock.c	/^uint_t spinlock_trylock(spinlock_t *lock)$/;"	f
+spinlock_tryrdlock	kern/spinlock.c	/^uint_t spinlock_tryrdlock(spinlock_t *lock)$/;"	f
+spinlock_unlock	kern/spinlock.c	/^void spinlock_unlock(spinlock_t *lock)$/;"	f
+spinlock_unlock_noirq	kern/spinlock.c	/^void spinlock_unlock_noirq(spinlock_t *lock, uint_t irq_state)$/;"	f
+spinlock_unlock_nosched	kern/spinlock.c	/^void spinlock_unlock_nosched(spinlock_t *lock)$/;"	f
+sprintk	libk/sprintk.c	/^int sprintk (char *s, char *fmt, ...)$/;"	f
+spurious_irq_nr	kern/cpu.h	/^	uint_t spurious_irq_nr;$/;"	m	struct:cpu_s
+spurious_pgfault_cntr	kern/thread.h	/^	uint_t spurious_pgfault_cntr;$/;"	m	struct:thread_info
+spurious_pgfault_nr	mm/vmm.h	/^	uint_t spurious_pgfault_nr;$/;"	m	struct:vmm_s
+srand	libk/rand.c	/^void srand(unsigned int seed)$/;"	f
+src	kern/driver.h	/^	void *src;			$/;"	m	struct:dev_request_s
+ss	cpu/i386/cpu-internal.h	/^	uint16_t ss, reserved_6;	\/* 20 *\/$/;"	m	struct:cpu_tss_s
+ss_r0	cpu/i386/cpu-internal.h	/^	uint16_t ss_r0;		        \/* 2 *\/$/;"	m	struct:cpu_tss_s
+ss_r1	cpu/i386/cpu-internal.h	/^	uint16_t ss_r1;		        \/* 4 *\/$/;"	m	struct:cpu_tss_s
+ss_r2	cpu/i386/cpu-internal.h	/^	uint16_t ss_r2;		        \/* 6 *\/$/;"	m	struct:cpu_tss_s
+ssize_t	libk/stdint.h	/^typedef signed long ssize_t;$/;"	t
+st_atime	vfs/vfs.h	/^	time_t    st_atime;   \/* time of last access *\/$/;"	m	struct:vfs_stat_s
+st_blksize	vfs/vfs.h	/^	uint_t    st_blksize; \/* blocksize for file system I\/O *\/$/;"	m	struct:vfs_stat_s
+st_blocks	vfs/vfs.h	/^	uint_t    st_blocks;  \/* number of 512B blocks allocated *\/$/;"	m	struct:vfs_stat_s
+st_ctime	vfs/vfs.h	/^	time_t    st_ctime;   \/* time of last status change *\/$/;"	m	struct:vfs_stat_s
+st_dev	vfs/vfs.h	/^	uint_t    st_dev;     \/* ID of device containing file *\/$/;"	m	struct:vfs_stat_s
+st_gid	vfs/vfs.h	/^	uint_t    st_gid;     \/* group ID of owner *\/$/;"	m	struct:vfs_stat_s
+st_ino	vfs/vfs.h	/^	uint_t    st_ino;     \/* inode number *\/$/;"	m	struct:vfs_stat_s
+st_mode	vfs/vfs.h	/^	uint_t    st_mode;    \/* protection *\/$/;"	m	struct:vfs_stat_s
+st_mtime	vfs/vfs.h	/^	time_t    st_mtime;   \/* time of last modification *\/$/;"	m	struct:vfs_stat_s
+st_nlink	vfs/vfs.h	/^	uint_t    st_nlink;   \/* number of hard links *\/$/;"	m	struct:vfs_stat_s
+st_rdev	vfs/vfs.h	/^	uint_t    st_rdev;    \/* device ID (if special file) *\/$/;"	m	struct:vfs_stat_s
+st_size	vfs/vfs.h	/^	uint64_t  st_size;    \/* total size, in bytes *\/$/;"	m	struct:vfs_stat_s
+st_uid	vfs/vfs.h	/^	uint_t    st_uid;     \/* user ID of owner *\/$/;"	m	struct:vfs_stat_s
+stack_addr	cpu/mipsel/cpu-asm.h	/^	reg_t stack_addr;		\/* 18 *\/$/;"	m	struct:cpu_context_s
+stack_addr	kern/thread.h	/^	void *stack_addr;$/;"	m	struct:__anon39
+stack_ptr	cpu/i386/cpu-asm.h	/^	reg_t stack_ptr;$/;"	m	struct:cpu_context_s
+stack_ptr	kern/cpu-trace.h	/^	uint_t stack_ptr;$/;"	m	struct:cpu_trace_info_s
+stack_size	cpu/mipsel/cpu-asm.h	/^	reg_t stack_size;		\/* 19 *\/$/;"	m	struct:cpu_context_s
+stack_size	kern/thread.h	/^	size_t stack_size;$/;"	m	struct:__anon39
+stack_top	kern/hal-cpu.h	/^	reg_t stack_top;$/;"	m	struct:cpu_uzone_attr_s
+start	cpu/i386/__boot.S	/^start:$/;"	l
+start	mm/heap_manager.h	/^	uint_t start;$/;"	m	struct:heap_manager_s
+stat	vfs/vfs.h	/^	vfs_stat_inode_t *stat;$/;"	m	struct:vfs_inode_op_s
+state	kern/barrier.h	/^	uint_t state[2];$/;"	m	struct:barrier_s
+state	kern/cpu.h	/^	uint_t state;$/;"	m	struct:cpu_s
+state	kern/task.h	/^	uint_t state;$/;"	m	struct:task_s
+state	kern/thread.h	/^	thread_state_t state;$/;"	m	struct:thread_s
+state	kern/wait_queue.h	/^	sint_t state;$/;"	m	struct:wait_queue_s
+state	libk/md5.h	/^  uint32_t state[4];       \/* state (ABCD) *\/$/;"	m	struct:__anon44
+state	mm/page.h	/^	uint32_t state : 4;$/;"	m	struct:page_s
+static_prio	kern/thread.h	/^	uint_t static_prio;$/;"	m	struct:thread_s
+status	kern/mwmr.c	/^	uint_t status;$/;"	m	struct:fifomwmr_s	file:
+stop	kern/driver.h	/^	timer_stop_t *stop;$/;"	m	struct:dev_timer_op
+storage	ksh/sgiImg.h	/^  uint8_t    storage;$/;"	m	struct:sgi_info_s
+str	vfs/vfs-private.h	/^	char *str;$/;"	m	struct:vfs_lookup_path_s
+strategy	kern/scheduler.h	/^	sched_strategy_t    *strategy;$/;"	m	struct:sched_ops_s
+strcasecmp	libk/strcmp.c	/^int strcasecmp (const char *str1, const char *str2)$/;"	f
+strchr	libk/strchr.c	/^char *strchr(const char *s, int c)$/;"	f
+strcmp	libk/strcmp.c	/^int strcmp (const char *s1, const char *s2)$/;"	f
+strcpy	libk/strcpy.c	/^char* strcpy (char *dest, char *src)$/;"	f
+strlen	cpu/i386/printk.c	/^static int strlen (char *s)$/;"	f	file:
+strlen	libk/strlen.c	/^int strlen (const char *str)$/;"	f
+strncmp	libk/strcmp.c	/^int strncmp(const char *s1, const char *s2, size_t n)$/;"	f
+strncpy	libk/strcpy.c	/^char* strncpy(char *dest, char *src, size_t n)$/;"	f
+strnlen	libk/strlen.c	/^int strnlen (const char *str, int count)$/;"	f
+strrchr	libk/strrchr.c	/^char *strrchr(const char *t, int c) {$/;"	f
+summary	kern/dqdt.h	/^	dqdt_indicators_t summary;$/;"	m	struct:dqdt_estimation_s
+suspend	kern/driver.h	/^	device_action_t *suspend;	        \/* lowpower, sleep *\/$/;"	m	struct:driver_s
+sync_all_pages	mm/page.c	/^void sync_all_pages(void) $/;"	f
+sync_page	mm/mapper.h	/^	mapper_sync_page_t          *sync_page;$/;"	m	struct:mapper_op_s
+sys_alarm	kern/sys_alarm.c	/^int sys_alarm (unsigned nb_sec)$/;"	f
+sys_barrier	kern/sys_barrier.c	/^int sys_barrier(struct barrier_s **barrier, uint_t operation, uint_t count)$/;"	f
+sys_call_tbl	kern/do_syscall.c	/^static const sys_func_t sys_call_tbl[__SYS_CALL_SERVICES_NUM] = {$/;"	v	file:
+sys_chdir	kern/sys_chdir.c	/^int sys_chdir (char *pathname)$/;"	f
+sys_chmod	kern/sys_chmod.c	/^int sys_chmod (char *pathname, uint_t mode)$/;"	f
+sys_clock	kern/sys_clock.c	/^int sys_clock(uint64_t *val)$/;"	f
+sys_close	kern/sys_close.c	/^int sys_close (uint_t fd)$/;"	f
+sys_closedir	kern/sys_closedir.c	/^int sys_closedir (uint_t fd)$/;"	f
+sys_cond_var	kern/sys_cond_var.c	/^int sys_cond_var(struct cv_s **cv, uint_t operation, struct semaphore_s **sem)$/;"	f
+sys_creat	kern/sys_creat.c	/^int sys_creat (char *pathname, uint_t mode)$/;"	f
+sys_dma_memcpy	kern/sys_dma_memcpy.c	/^int sys_dma_memcpy(void *src, void *dst, size_t size)$/;"	f
+sys_exec	kern/sys_exec.c	/^int sys_exec(char *filename, char **argv, char **envp)$/;"	f
+sys_exec_remote_s	kern/task.h	/^struct sys_exec_remote_s$/;"	s
+sys_fork	kern/sys_fork.c	/^int sys_fork(uint_t flags, uint_t cpu_gid)$/;"	f
+sys_fsync	kern/sys_fsync.c	/^int sys_fsync (uint_t fd)$/;"	f
+sys_ftime	kern/sys_ftime.c	/^int sys_ftime(struct timeb *utime)$/;"	f
+sys_func_t	kern/do_syscall.c	/^typedef int (*sys_func_t) ();$/;"	t	file:
+sys_getcwd	kern/sys_getcwd.c	/^int sys_getcwd (char *buff, size_t size)$/;"	f
+sys_getpid	kern/sys_getpid.c	/^int sys_getpid()$/;"	f
+sys_gettimeofday	kern/sys_gettimeofday.c	/^int sys_gettimeofday(struct timeval *tv, struct timezone *tz)$/;"	f
+sys_kill	kern/sys_signal.c	/^int sys_kill(pid_t pid, uint_t sig)$/;"	f
+sys_lseek	kern/sys_lseek.c	/^int sys_lseek (uint_t fd, off_t offset, int whence)$/;"	f
+sys_madvise	kern/sys_madvise.c	/^int sys_madvise(void *start, size_t length, uint_t advice)$/;"	f
+sys_mcntl	kern/sys_mcntl.c	/^int sys_mcntl(int op, uint_t vaddr, size_t len, minfo_t *pinfo)$/;"	f
+sys_mkdir	kern/sys_mkdir.c	/^int sys_mkdir (char *pathname, uint_t mode)$/;"	f
+sys_mkfifo	kern/sys_mkfifo.c	/^int sys_mkfifo (char *pathname, uint_t mode)$/;"	f
+sys_mmap	kern/sys_mmap.c	/^int sys_mmap(mmap_attr_t *mattr)$/;"	f
+sys_notAvailable	kern/do_syscall.c	/^static int sys_notAvailable()$/;"	f	file:
+sys_open	kern/sys_open.c	/^int sys_open (char *pathname, uint_t flags, uint_t mode)$/;"	f
+sys_opendir	kern/sys_opendir.c	/^int sys_opendir (char *pathname)$/;"	f
+sys_pipe	kern/sys_pipe.c	/^int sys_pipe (uint_t *pipefd)$/;"	f
+sys_ps	kern/sys_ps.c	/^int sys_ps(uint_t cmd, pid_t pid, uint_t tid)$/;"	f
+sys_ps_check_thread	kern/sys_ps.c	/^static error_t sys_ps_check_thread(pid_t pid, uint_t tid, struct thread_s **th_ptr)$/;"	f	file:
+sys_read	kern/sys_read.c	/^int sys_read (uint_t fd, void *buf, size_t count)$/;"	f
+sys_readdir	kern/sys_readdir.c	/^int sys_readdir (uint_t fd, struct vfs_usp_dirent_s *dirent)$/;"	f
+sys_rmdir	kern/sys_rmdir.c	/^int sys_rmdir (char *pathname)$/;"	f
+sys_rwlock	kern/sys_rwlock.c	/^int sys_rwlock(struct rwlock_s **rwlock, uint_t operation)$/;"	f
+sys_sbrk	kern/sys_sbrk.c	/^int sys_sbrk(uint_t current_heap_ptr, uint_t size)$/;"	f
+sys_sem	kern/sys_sem.c	/^int sys_sem(struct semaphore_s **sem, uint_t operation, uint_t pshared, int *value)$/;"	f
+sys_signal	kern/sys_signal.c	/^int sys_signal(uint_t sig, sa_handler_t *handler)$/;"	f
+sys_sigreturn	cpu/mipsel/cpu_do_syscall.c	/^static void sys_sigreturn(void)$/;"	f	file:
+sys_sigreturn_setup	kern/sys_signal.c	/^int sys_sigreturn_setup(void *sigreturn_func)$/;"	f
+sys_stat	kern/sys_stat.c	/^int sys_stat(char *pathname, struct vfs_stat_s *buff, int fd)$/;"	f
+sys_thread_create	kern/sys_thread_create.c	/^int sys_thread_create (pthread_t *tid, pthread_attr_t *thread_attr)$/;"	f
+sys_thread_detach	kern/sys_thread_detach.c	/^int sys_thread_detach (pthread_t tid)$/;"	f
+sys_thread_exit	kern/sys_thread_exit.c	/^int sys_thread_exit (void *exit_val)$/;"	f
+sys_thread_getattr	kern/sys_thread_getattr.c	/^int sys_thread_getattr(pthread_attr_t *attr)$/;"	f
+sys_thread_join	kern/sys_thread_join.c	/^int sys_thread_join (pthread_t tid, void **thread_return)$/;"	f
+sys_thread_migrate	kern/sys_thread_migrate.c	/^int sys_thread_migrate(pthread_attr_t *thread_attr)$/;"	f
+sys_thread_sleep	kern/sys_thread_sleep.c	/^int sys_thread_sleep()$/;"	f
+sys_thread_wakeup	kern/sys_thread_wakeup.c	/^int sys_thread_wakeup(pthread_t tid, pthread_t *tid_tbl, uint_t count)$/;"	f
+sys_thread_yield	kern/sys_thread_yield.c	/^int sys_thread_yield()$/;"	f
+sys_times	kern/sys_times.c	/^int sys_times(struct tms *utms)$/;"	f
+sys_unlink	kern/sys_unlink.c	/^int sys_unlink (char *pathname)$/;"	f
+sys_utls	kern/sys_utls.c	/^int sys_utls(uint_t operation, uint_t value)$/;"	f
+sys_write	kern/sys_write.c	/^int sys_write (uint_t fd, void *buf, size_t count)$/;"	f
+sysconf	kern/sysconf.c	/^static sysfs_entry_t sysconf;$/;"	v	file:
+sysconf_init	kern/sysconf.c	/^error_t sysconf_init(void)$/;"	f
+sysconf_sysfs_op_init	kern/sysconf.c	/^static void sysconf_sysfs_op_init(sysfs_op_t *op)$/;"	f	file:
+sysconf_sysfs_read_op	kern/sysconf.c	/^static error_t sysconf_sysfs_read_op(sysfs_entry_t *entry, sysfs_request_t *rq, uint_t *offset)$/;"	f	file:
+sysfs_container	fs/sysfs/sysfs.h	/^#define sysfs_container(/;"	d
+sysfs_container	fs/sysfs/sysfs.h	/^#undef  sysfs_container$/;"	d
+sysfs_context_s	fs/sysfs/sysfs.h	/^struct sysfs_context_s$/;"	s
+sysfs_ctx_op	fs/sysfs/sysfs_context.c	/^const struct vfs_context_op_s sysfs_ctx_op = $/;"	v	typeref:struct:vfs_context_op_s
+sysfs_dmsg	kern/kdmsg.h	/^#define sysfs_dmsg(/;"	d
+sysfs_entry_init	fs/sysfs/sysfs.h	/^static inline void sysfs_entry_init(sysfs_entry_t *entry, sysfs_op_t *op, char *name)$/;"	f
+sysfs_entry_register	fs/sysfs/sysfs.h	/^static inline void sysfs_entry_register(sysfs_entry_t *parent, sysfs_entry_t *entry)$/;"	f
+sysfs_entry_s	fs/sysfs/sysfs.h	/^struct sysfs_entry_s$/;"	s
+sysfs_entry_t	fs/sysfs/sysfs.h	/^typedef struct sysfs_entry_s sysfs_entry_t;$/;"	t	typeref:struct:sysfs_entry_s
+sysfs_entry_unregister	fs/sysfs/sysfs.h	/^static inline void sysfs_entry_unregister(sysfs_entry_t *parent, sysfs_entry_t *entry)$/;"	f
+sysfs_f_op	fs/sysfs/sysfs_file.c	/^const struct vfs_file_op_s sysfs_f_op = $/;"	v	typeref:struct:vfs_file_op_s
+sysfs_file_s	fs/sysfs/sysfs-private.h	/^struct sysfs_file_s$/;"	s
+sysfs_i_op	fs/sysfs/sysfs_node.c	/^const struct vfs_inode_op_s sysfs_i_op = $/;"	v	typeref:struct:vfs_inode_op_s
+sysfs_inode_create	fs/sysfs/sysfs_node.c	/^error_t sysfs_inode_create(struct vfs_dirent_s *dirent, $/;"	f
+sysfs_kmem_file_init	fs/sysfs/sysfs.h	/^KMEM_OBJATTR_INIT(sysfs_kmem_file_init);$/;"	v
+sysfs_kmem_node_init	fs/sysfs/sysfs.h	/^KMEM_OBJATTR_INIT(sysfs_kmem_node_init);$/;"	v
+sysfs_node_s	fs/sysfs/sysfs-private.h	/^struct sysfs_node_s$/;"	s
+sysfs_op_s	fs/sysfs/sysfs.h	/^struct sysfs_op_s$/;"	s
+sysfs_op_t	fs/sysfs/sysfs.h	/^typedef struct sysfs_op_s sysfs_op_t;$/;"	t	typeref:struct:sysfs_op_s
+sysfs_request_func_t	fs/sysfs/sysfs.h	/^typedef error_t (sysfs_request_func_t)(struct sysfs_entry_s *entry, sysfs_request_t *rq, uint_t *offset);$/;"	t
+sysfs_request_t	fs/sysfs/sysfs.h	/^}sysfs_request_t;$/;"	t	typeref:struct:__anon3
+sysfs_root_entry	fs/sysfs/sysfs_context.c	/^sysfs_entry_t sysfs_root_entry;$/;"	v
+sysfs_root_init	fs/sysfs/sysfs.h	/^static inline void sysfs_root_init()$/;"	f
+t_hnode	kern/task.h	/^        struct hnode_s t_hnode;$/;"	m	struct:task_s	typeref:struct:task_s::hnode_s
+tags	kern/radix.c	/^	uint64_t		        tags[NB_TAGS];$/;"	m	struct:radix_node_s	file:
+task	kern/cluster.h	/^	struct task_s *task;$/;"	m	struct:cluster_s	typeref:struct:cluster_s::task_s
+task	kern/sys_thread_create.c	/^	struct task_s     *task;$/;"	m	struct:__anon35	typeref:struct:__anon35::task_s	file:
+task	kern/task.h	/^        struct task_s *task;$/;"	m	struct:task_locator_s	typeref:struct:task_locator_s::task_s
+task	kern/thread.h	/^	struct task_s *task;$/;"	m	struct:thread_s	typeref:struct:thread_s::task_s
+task	kern/thread_migrate.c	/^	struct task_s       *task;$/;"	m	struct:__anon41	typeref:struct:__anon41::task_s	file:
+task0	kern/task.c	/^static struct task_s task0;$/;"	v	typeref:struct:task_s	file:
+task_bootstrap_finalize	kern/task.c	/^error_t task_bootstrap_finalize(struct boot_info_s *info)$/;"	f
+task_bootstrap_init	kern/task.c	/^error_t task_bootstrap_init(struct boot_info_s *info)$/;"	f
+task_create	kern/task.c	/^error_t task_create(struct task_s **new_task, struct dqdt_attr_s *attr, uint_t mode)$/;"	f
+task_create_clone	kern/task.c	/^error_t task_create_clone(struct task_s **new_task, uint_t mode, pid_t pid, pid_t ppid)$/;"	f
+task_ctor	kern/task.c	/^static void task_ctor(struct kcm_s *kcm, void *ptr)$/;"	f	file:
+task_destroy	kern/task.c	/^void task_destroy(struct task_s *task)$/;"	f
+task_dup	kern/task.c	/^error_t task_dup(struct task_s *dst, struct task_s *src)$/;"	f
+task_fd_check	kern/task.c	/^error_t task_fd_check(struct task_s *task)$/;"	f
+task_fd_destroy	kern/task.c	/^error_t task_fd_destroy(struct task_s *task)$/;"	f
+task_fd_fork	kern/task.c	/^error_t task_fd_fork(struct task_s *dst, struct task_s *src)$/;"	f
+task_fd_init	kern/task.c	/^error_t task_fd_init(struct task_s *task)$/;"	f
+task_fd_lookup	kern/task.c	/^error_t task_fd_lookup(struct task_s *task, uint_t fd, struct vfs_file_s **file)$/;"	f
+task_fd_put	kern/task.c	/^error_t task_fd_put(struct task_s *task, uint_t fd)$/;"	f
+task_fd_set	kern/task.c	/^error_t task_fd_set(struct task_s *task, struct vfs_file_s *file, uint_t *ret_fd)$/;"	f
+task_fdinfo_kmem_init	kern/task.h	/^KMEM_OBJATTR_INIT(task_fdinfo_kmem_init);$/;"	v
+task_htable_pid_compare	kern/task.c	/^bool_t task_htable_pid_compare(struct hnode_s *hn, void* key)$/;"	f
+task_kmem_init	kern/task.h	/^KMEM_OBJATTR_INIT(task_kmem_init);$/;"	v
+task_load_init	kern/do_exec.c	/^error_t task_load_init(struct task_s *task)$/;"	f
+task_locator_s	kern/task.h	/^struct task_locator_s {$/;"	s
+task_lookup	kern/task.c	/^struct task_locator_s* task_lookup(pid_t pid)$/;"	f
+task_lookup_zero	kern/task.c	/^inline struct task_s* task_lookup_zero()$/;"	f
+task_manager_init	kern/task.c	/^void task_manager_init(void)$/;"	f
+task_manager_init_finalize	kern/task.c	/^void task_manager_init_finalize(void)$/;"	f
+task_pid_alloc	kern/task.c	/^task_pid_alloc(pid_t *new_pid, cid_t rcid, struct task_s *new_task)$/;"	f
+task_restore	kern/task.c	/^error_t task_restore(struct task_s *task, struct sys_exec_remote_s *exec_remote)$/;"	f
+task_s	kern/task.h	/^struct task_s$/;"	s
+task_vaddr2paddr	kern/task.c	/^inline void* task_vaddr2paddr(struct task_s* task, void *vma)$/;"	f
+task_vaddr2ppn	kern/task.c	/^inline ppn_t task_vaddr2ppn(struct task_s* task, void *vma, bool_t write)$/;"	f
+task_whereis	kern/task.c	/^cid_t task_whereis(pid_t pid)$/;"	f
+tasks_manager_get_htable	kern/task.c	/^inline struct hheader_s* tasks_manager_get_htable()$/;"	f
+tasks_manager_htable_hinsert	kern/task.c	/^inline error_t tasks_manager_htable_hinsert(struct task_s *task)$/;"	f
+tasks_manager_htable_hremove	kern/task.c	/^inline error_t tasks_manager_htable_hremove(struct task_s *task)$/;"	f
+tasks_manager_lock	kern/task.c	/^inline void tasks_manager_lock()$/;"	f
+tasks_manager_s	kern/task.c	/^struct tasks_manager_s$/;"	s	file:
+tasks_manager_unlock	kern/task.c	/^inline void tasks_manager_unlock()$/;"	f
+tasks_mgr	kern/task.c	/^static struct tasks_manager_s tasks_mgr = $/;"	v	typeref:struct:tasks_manager_s	file:
+tbl	kern/barrier.c	/^	wqdb_record_t tbl[0];$/;"	m	struct:wait_queue_db_s	file:
+tbl	kern/dqdt.h	/^	dqdt_indicators_t tbl[4];$/;"	m	struct:dqdt_estimation_s
+tbl	kern/event.h	/^	struct  event_list_s tbl[E_PRIO_NR];$/;"	m	struct:event_listner_s	typeref:struct:event_listner_s::event_list_s
+tbl	kern/keysdb.c	/^	void *tbl[KEYS_PER_REC];$/;"	m	struct:keys_record_s	file:
+tbl	kern/kfifo.h	/^	void    **tbl;$/;"	m	struct:kfifo_s
+tbl	kern/remote_fifo.h	/^	cacheline_t tbl[REMOTE_FIFO_MAX_SLOT];$/;"	m	struct:remote_fifo_s
+tbl	kern/remote_fifo.h	/^	void*	tbl;$/;"	m	struct:remote_fifo_s
+tbl	kern/scheduler.c	/^	sched_pinfo_t tbl[SCHED_THREADS_NR];$/;"	m	struct:sched_db_s	file:
+test_func	kern/rpc.c	/^	rpc_test_func_t test_func;$/;"	m	struct:rpc_test_s	file:
+test_name	kern/rpc.c	/^	char test_name[10];$/;"	m	struct:rpc_test_s	file:
+text_end	libk/boot-info.h	/^	uint_t text_end;$/;"	m	struct:boot_info_s
+text_end	libk/boot-info.h	/^	uint_t text_end;\/*3*\/$/;"	m	struct:kernel_info_s
+text_end	mm/vmm.h	/^	uint_t text_end;$/;"	m	struct:vmm_s
+text_start	libk/boot-info.h	/^	uint_t text_start;$/;"	m	struct:boot_info_s
+text_start	libk/boot-info.h	/^	uint_t text_start;\/*2*\/$/;"	m	struct:kernel_info_s
+text_start	mm/vmm.h	/^	uint_t text_start;$/;"	m	struct:vmm_s
+th_gid	vfs/vfs.h	/^	uint_t th_gid;$/;"	m	struct:vfs_lookup_s
+th_lock	kern/task.h	/^	spinlock_t th_lock;$/;"	m	struct:task_s
+th_migrate_info_t	kern/thread_migrate.c	/^}th_migrate_info_t;$/;"	t	typeref:struct:__anon41	file:
+th_root	kern/task.h	/^	struct list_entry th_root;$/;"	m	struct:task_s	typeref:struct:task_s::list_entry
+th_tbl	kern/task.h	/^	struct thread_s **th_tbl;$/;"	m	struct:task_s	typeref:struct:task_s::thread_s
+th_tbl_pg	kern/task.h	/^	struct page_s *th_tbl_pg;$/;"	m	struct:task_s	typeref:struct:task_s::page_s
+th_uid	vfs/vfs.h	/^	uint_t th_uid;$/;"	m	struct:vfs_lookup_s
+this_task	kern/sys_fork.c	/^	struct task_s    *this_task;$/;"	m	struct:__anon34	typeref:struct:__anon34::task_s	file:
+this_thread	kern/sys_fork.c	/^	struct thread_s  *this_thread;$/;"	m	struct:__anon34	typeref:struct:__anon34::thread_s	file:
+thread_attr_name	kern/thread_create.c	/^const char* const thread_attr_name[THREAD_TYPES_NR] =$/;"	v
+thread_attr_t	kern/thread.h	/^} thread_attr_t;$/;"	t	typeref:enum:__anon37
+thread_clear_cap_migrate	kern/thread.h	/^#define thread_clear_cap_migrate(/;"	d
+thread_clear_cap_migrate	kern/thread.h	/^#undef thread_clear_cap_migrate$/;"	d
+thread_clear_exported	kern/thread.h	/^#define thread_clear_exported(/;"	d
+thread_clear_exported	kern/thread.h	/^#undef thread_clear_exported$/;"	d
+thread_clear_forced_yield	kern/thread.h	/^#define thread_clear_forced_yield(/;"	d
+thread_clear_forced_yield	kern/thread.h	/^#undef thread_clear_forced_yield$/;"	d
+thread_clear_imported	kern/thread.h	/^#define thread_clear_imported(/;"	d
+thread_clear_imported	kern/thread.h	/^#undef thread_clear_imported$/;"	d
+thread_clear_joinable	kern/thread.h	/^#define thread_clear_joinable(/;"	d
+thread_clear_joinable	kern/thread.h	/^#undef thread_clear_joinable$/;"	d
+thread_clear_signaled	kern/thread.h	/^#define thread_clear_signaled(/;"	d
+thread_clear_signaled	kern/thread.h	/^#undef thread_clear_signaled$/;"	d
+thread_clear_wakeable	kern/thread.h	/^#define thread_clear_wakeable(/;"	d
+thread_clear_wakeable	kern/thread.h	/^#undef thread_clear_wakeable$/;"	d
+thread_create	kern/thread_create.c	/^error_t thread_create(struct task_s *task, pthread_attr_t *attr, struct thread_s **new_thread)$/;"	f
+thread_current_cluster	kern/thread.h	/^#define thread_current_cluster(/;"	d
+thread_current_cluster	kern/thread.h	/^#undef thread_current_cluster$/;"	d
+thread_current_cpu	kern/thread.h	/^#define thread_current_cpu(/;"	d
+thread_current_cpu	kern/thread.h	/^#undef thread_current_cpu$/;"	d
+thread_destroy	kern/thread_destroy.c	/^error_t thread_destroy(struct thread_s *thread)$/;"	f
+thread_destroy_handler	kern/thread.h	/^EVENT_HANDLER(thread_destroy_handler);$/;"	v
+thread_dmsg	kern/kdmsg.h	/^#define thread_dmsg(/;"	d
+thread_dup	kern/thread_dup.c	/^error_t thread_dup(struct task_s *task, $/;"	f
+thread_event_manager	kern/event.c	/^void* thread_event_manager(void *arg)$/;"	f
+thread_get_attr_name	kern/thread_create.c	/^const char* thread_get_attr_name(thread_attr_t _type)$/;"	f
+thread_get_state_name	kern/thread_create.c	/^const char* thread_get_state_name(thread_state_t state)$/;"	f
+thread_has_vmregion	kern/thread.h	/^#define thread_has_vmregion(/;"	d
+thread_has_vmregion	kern/thread.h	/^#undef thread_has_vmregion$/;"	d
+thread_idle	kern/cpu.h	/^	struct thread_s *thread_idle;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::thread_s
+thread_idle	kern/thread_idle.c	/^void* thread_idle(void *arg)$/;"	f
+thread_info	kern/thread.h	/^struct thread_info$/;"	s
+thread_info_t	kern/sys_thread_create.c	/^}thread_info_t;$/;"	t	typeref:struct:__anon35	file:
+thread_init	kern/thread_create.c	/^void thread_init(struct thread_s *thread)$/;"	f
+thread_isBootStrap	kern/thread.h	/^#define thread_isBootStrap(/;"	d
+thread_isBootStrap	kern/thread.h	/^#undef thread_isBootStrap$/;"	d
+thread_isCapMigrate	kern/thread.h	/^#define thread_isCapMigrate(/;"	d
+thread_isCapMigrate	kern/thread.h	/^#undef thread_isCapMigrate$/;"	d
+thread_isCapWakeup	kern/thread.h	/^#define thread_isCapWakeup(/;"	d
+thread_isCapWakeup	kern/thread.h	/^#undef thread_isCapWakeup$/;"	d
+thread_isExported	kern/thread.h	/^#define thread_isExported(/;"	d
+thread_isExported	kern/thread.h	/^#undef thread_isExported$/;"	d
+thread_isForcedYield	kern/thread.h	/^#define thread_isForcedYield(/;"	d
+thread_isForcedYield	kern/thread.h	/^#undef thread_isForcedYield$/;"	d
+thread_isImported	kern/thread.h	/^#define thread_isImported(/;"	d
+thread_isImported	kern/thread.h	/^#undef thread_isImported$/;"	d
+thread_isJoinable	kern/thread.h	/^#define thread_isJoinable(/;"	d
+thread_isJoinable	kern/thread.h	/^#undef thread_isJoinable$/;"	d
+thread_isPreemptable	kern/thread.h	/^#define thread_isPreemptable(/;"	d
+thread_isPreemptable	kern/thread.h	/^#undef thread_isPreemptable$/;"	d
+thread_isSignaled	kern/thread.h	/^#define thread_isSignaled(/;"	d
+thread_isSignaled	kern/thread.h	/^#undef thread_isSignaled$/;"	d
+thread_isStack_overflow	kern/thread.h	/^#define thread_isStack_overflow(/;"	d
+thread_isStack_overflow	kern/thread.h	/^#undef thread_isStack_overflow$/;"	d
+thread_isWakeable	kern/thread.h	/^#define thread_isWakeable(/;"	d
+thread_isWakeable	kern/thread.h	/^#undef thread_isWakeable$/;"	d
+thread_locks_count_down	kern/thread.h	/^#define thread_locks_count_down(/;"	d
+thread_locks_count_down	kern/thread.h	/^#undef thread_locks_count_down$/;"	d
+thread_locks_count_up	kern/thread.h	/^#define thread_locks_count_up(/;"	d
+thread_locks_count_up	kern/thread.h	/^#undef thread_locks_count_up$/;"	d
+thread_migrate	kern/thread_migrate.c	/^error_t thread_migrate(struct thread_s *this, sint_t target_gid)$/;"	f
+thread_migration_activate	kern/thread.h	/^#define thread_migration_activate(/;"	d
+thread_migration_activate	kern/thread.h	/^#undef thread_migration_activate$/;"	d
+thread_migration_deactivate	kern/thread.h	/^#define thread_migration_deactivate(/;"	d
+thread_migration_deactivate	kern/thread.h	/^#undef thread_migration_deactivate$/;"	d
+thread_migration_disable	kern/thread.h	/^#define thread_migration_disable(/;"	d
+thread_migration_disable	kern/thread.h	/^#undef thread_migration_disable$/;"	d
+thread_migration_disabled	kern/thread.h	/^#define thread_migration_disabled(/;"	d
+thread_migration_disabled	kern/thread.h	/^#undef thread_migration_disabled$/;"	d
+thread_migration_enable	kern/thread.h	/^#define thread_migration_enable(/;"	d
+thread_migration_enable	kern/thread.h	/^#undef thread_migration_enable$/;"	d
+thread_migration_enabled	kern/thread.h	/^#define thread_migration_enabled(/;"	d
+thread_migration_enabled	kern/thread.h	/^#undef thread_migration_enabled$/;"	d
+thread_migration_isActivated	kern/thread.h	/^#define thread_migration_isActivated(/;"	d
+thread_migration_isActivated	kern/thread.h	/^#undef thread_migration_isActivated$/;"	d
+thread_migration_isEnabled	kern/thread.h	/^#define thread_migration_isEnabled(/;"	d
+thread_migration_isEnabled	kern/thread.h	/^#undef thread_migration_isEnabled$/;"	d
+thread_origin_cluster	kern/thread.h	/^#define thread_origin_cluster(/;"	d
+thread_origin_cluster	kern/thread.h	/^#undef thread_origin_cluster$/;"	d
+thread_origin_cpu	kern/thread.h	/^#define thread_origin_cpu(/;"	d
+thread_origin_cpu	kern/thread.h	/^#undef thread_origin_cpu$/;"	d
+thread_preempt_disable	kern/thread.h	/^#define thread_preempt_disable(/;"	d
+thread_preempt_disable	kern/thread.h	/^#undef thread_preempt_disable$/;"	d
+thread_preempt_enable	kern/thread.h	/^#define thread_preempt_enable(/;"	d
+thread_preempt_enable	kern/thread.h	/^#undef thread_preempt_enable$/;"	d
+thread_ptr	cpu/i386/cpu-asm.h	/^	reg_t thread_ptr;$/;"	m	struct:cpu_context_s
+thread_ptr	kern/cpu-trace.h	/^	void *thread_ptr;$/;"	m	struct:cpu_trace_info_s
+thread_rpc_manager	kern/rpc.c	/^void* thread_rpc_manager(void *arg)$/;"	f
+thread_s	kern/thread.h	/^struct thread_s$/;"	s
+thread_sched_activate	kern/thread.h	/^#define thread_sched_activate(/;"	d
+thread_sched_activate	kern/thread.h	/^#undef thread_sched_activate$/;"	d
+thread_sched_deactivate	kern/thread.h	/^#define thread_sched_deactivate(/;"	d
+thread_sched_deactivate	kern/thread.h	/^#undef thread_sched_deactivate$/;"	d
+thread_sched_isActivated	kern/thread.h	/^#define thread_sched_isActivated(/;"	d
+thread_sched_isActivated	kern/thread.h	/^#undef thread_sched_isActivated$/;"	d
+thread_set_cap_migrate	kern/thread.h	/^#define thread_set_cap_migrate(/;"	d
+thread_set_cap_migrate	kern/thread.h	/^#undef thread_set_cap_migrate$/;"	d
+thread_set_cap_wakeup	kern/thread.h	/^#define thread_set_cap_wakeup(/;"	d
+thread_set_cap_wakeup	kern/thread.h	/^#undef thread_set_cap_wakeup$/;"	d
+thread_set_current_cpu	kern/thread.h	/^#define thread_set_current_cpu(/;"	d
+thread_set_current_cpu	kern/thread.h	/^#undef thread_set_current_cpu$/;"	d
+thread_set_exported	kern/thread.h	/^#define thread_set_exported(/;"	d
+thread_set_exported	kern/thread.h	/^#undef thread_set_exported$/;"	d
+thread_set_forced_yield	kern/thread.h	/^#define thread_set_forced_yield(/;"	d
+thread_set_forced_yield	kern/thread.h	/^#undef thread_set_forced_yield$/;"	d
+thread_set_imported	kern/thread.h	/^#define thread_set_imported(/;"	d
+thread_set_imported	kern/thread.h	/^#undef thread_set_imported$/;"	d
+thread_set_joinable	kern/thread.h	/^#define thread_set_joinable(/;"	d
+thread_set_joinable	kern/thread.h	/^#undef thread_set_joinable$/;"	d
+thread_set_no_vmregion	kern/thread.h	/^#define thread_set_no_vmregion(/;"	d
+thread_set_no_vmregion	kern/thread.h	/^#undef thread_set_no_vmregion$/;"	d
+thread_set_origin_cpu	kern/thread.h	/^#define thread_set_origin_cpu(/;"	d
+thread_set_origin_cpu	kern/thread.h	/^#undef thread_set_origin_cpu$/;"	d
+thread_set_signaled	kern/thread.h	/^#define thread_set_signaled(/;"	d
+thread_set_signaled	kern/thread.h	/^#undef thread_set_signaled$/;"	d
+thread_set_wakeable	kern/thread.h	/^#define thread_set_wakeable(/;"	d
+thread_set_wakeable	kern/thread.h	/^#undef thread_set_wakeable$/;"	d
+thread_state_name	kern/thread_create.c	/^const char* const thread_state_name[THREAD_STATES_NR] = $/;"	v
+thread_state_t	kern/thread.h	/^} thread_state_t;$/;"	t	typeref:enum:__anon38
+threads_count	kern/task.h	/^	uint_t threads_count;$/;"	m	struct:task_s
+threads_limit	kern/task.h	/^	uint_t threads_limit;$/;"	m	struct:task_s
+threads_nr	kern/task.h	/^	uint_t threads_nr;$/;"	m	struct:task_s
+threshold	mm/ppm.h	/^	uint_t threshold;$/;"	m	struct:ppm_dqdt_req_s
+ticket	kern/mcs_sync.h	/^	cacheline_t ticket;$/;"	m	struct:mcs_barrier_s
+ticket	kern/mcs_sync.h	/^	cacheline_t ticket;$/;"	m	struct:mcs_lock_s
+ticket2	kern/mcs_sync.h	/^	cacheline_t ticket2;$/;"	m	struct:mcs_barrier_s
+ticks_count	kern/cpu.h	/^	uint_t ticks_count;$/;"	m	struct:cpu_s
+ticks_nr	kern/cpu.h	/^	uint_t ticks_nr;$/;"	m	struct:cpu_time_s
+ticks_nr	kern/thread.h	/^	uint_t ticks_nr;              \/*! number of ticks used *\/$/;"	m	struct:thread_s
+ticks_period	kern/cpu.h	/^	uint_t ticks_period;  $/;"	m	struct:cpu_time_s
+tid	cpu/mipsel/cpu-asm.h	/^	reg_t tid;                      \/* 12 *\/$/;"	m	struct:cpu_context_s
+tid	kern/thread.h	/^	uint_t tid;			   \/* mandatory *\/$/;"	m	struct:__anon39
+time	kern/cpu.h	/^	struct cpu_time_s time;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::cpu_time_s
+time	kern/time.h	/^	time_t         time;$/;"	m	struct:timeb
+time_stamp	kern/cpu-trace.h	/^	uint_t time_stamp;$/;"	m	struct:cpu_trace_info_s
+time_t	libk/types.h	/^typedef uint_t time_t;$/;"	t
+timeb	kern/time.h	/^struct timeb {$/;"	s
+timer	kern/driver.h	/^		struct dev_timer_op timer;$/;"	m	union:driver_s::__anon12	typeref:struct:driver_s::__anon12::dev_timer_op
+timer_count	drivers/soclib/soclib_timer.c	/^static uint_t timer_count = 0;$/;"	v	file:
+timer_get_value	drivers/soclib/soclib_timer.c	/^static uint_t timer_get_value(struct device_s *timer)$/;"	f	file:
+timer_get_value_t	kern/driver.h	/^typedef uint_t (timer_get_value_t)(struct device_s *timer);$/;"	t
+timer_irq_handler	arch/ibmpc/rt_timer.c	/^static void timer_irq_handler (struct irq_action_s *action)$/;"	f	file:
+timer_irq_handler	drivers/soclib/soclib_timer.c	/^void timer_irq_handler (struct irq_action_s *action)$/;"	f
+timer_reset_irq	drivers/soclib/soclib_timer.c	/^static void timer_reset_irq(struct device_s *timer)$/;"	f	file:
+timer_run	drivers/soclib/soclib_timer.c	/^static void timer_run(struct device_s *timer, bool_t withIrq)$/;"	f	file:
+timer_run_t	kern/driver.h	/^typedef void (timer_run_t)(struct device_s *timer, bool_t withIrq);$/;"	t
+timer_set_period	drivers/soclib/soclib_timer.c	/^static void timer_set_period(struct device_s *timer, uint_t period)$/;"	f	file:
+timer_set_period_t	kern/driver.h	/^typedef void (timer_set_period_t)(struct device_s *timer, uint_t period);$/;"	t
+timer_set_value_t	kern/driver.h	/^typedef uint_t (timer_set_value_t)(struct device_s *timer, uint_t value);$/;"	t
+timer_stop	drivers/soclib/soclib_timer.c	/^static void timer_stop(struct device_s *timer)$/;"	f	file:
+timer_stop_t	kern/driver.h	/^typedef void (timer_stop_t)(struct device_s *timer);$/;"	t
+timeval	kern/time.h	/^struct timeval {$/;"	s
+timezone	kern/time.h	/^	short          timezone;$/;"	m	struct:timeb
+timezone	kern/time.h	/^struct timezone {$/;"	s
+tls	kern/hal-cpu.h	/^	reg_t tls;$/;"	m	struct:cpu_uzone_attr_s
+tm_born	kern/thread.h	/^	uint_t tm_born;                     \/*! date of the thread loading *\/$/;"	m	struct:thread_info
+tm_born_compute	kern/time.c	/^inline void tm_born_compute(struct thread_s *thread)$/;"	f
+tm_born_compute	kern/time.h	/^#define tm_born_compute(/;"	d
+tm_create	kern/thread.h	/^	uint_t tm_create;                   \/*! date of the creation *\/$/;"	m	struct:thread_info
+tm_create_compute	kern/time.c	/^inline void tm_create_compute(struct thread_s *thread)$/;"	f
+tm_create_compute	kern/time.h	/^#define tm_create_compute(/;"	d
+tm_dead	kern/thread.h	/^	uint_t tm_dead;                     \/*! date of the death *\/$/;"	m	struct:thread_info
+tm_event	kern/sys_fork.c	/^	uint_t           tm_event;$/;"	m	struct:__anon34	file:
+tm_event	kern/sys_thread_create.c	/^	uint_t            tm_event;$/;"	m	struct:__anon35	file:
+tm_exec	kern/thread.h	/^	uint_t tm_exec;$/;"	m	struct:thread_info
+tm_exit_compute	kern/time.c	/^inline void tm_exit_compute(struct thread_s *thread)$/;"	f
+tm_exit_compute	kern/time.h	/^#define tm_exit_compute(/;"	d
+tm_first	kern/barrier.h	/^	uint_t tm_first;$/;"	m	struct:barrier_s
+tm_htable	kern/task.c	/^        struct hheader_s tm_htable;$/;"	m	struct:tasks_manager_s	typeref:struct:tasks_manager_s::hheader_s	file:
+tm_last	kern/barrier.h	/^	uint_t tm_last;$/;"	m	struct:barrier_s
+tm_last_pid	kern/task.c	/^	pid_t tm_last_pid;$/;"	m	struct:tasks_manager_s	file:
+tm_lock	kern/task.c	/^	spinlock_t tm_lock;$/;"	m	struct:tasks_manager_s	file:
+tm_lock	kern/task.h	/^	spinlock_t tm_lock; $/;"	m	struct:task_s
+tm_next_clstr	kern/task.c	/^	atomic_t tm_next_clstr;$/;"	m	struct:tasks_manager_s	file:
+tm_next_cpu	kern/task.c	/^	atomic_t tm_next_cpu;$/;"	m	struct:tasks_manager_s	file:
+tm_request	kern/dqdt.h	/^	uint_t tm_request;$/;"	m	struct:dqdt_attr_s
+tm_sleep	kern/thread.h	/^	clock_t tm_sleep;                    \/*! sleeping duration *\/$/;"	m	struct:thread_info
+tm_sleep_compute	kern/time.c	/^inline void tm_sleep_compute(struct thread_s *thread)$/;"	f
+tm_sleep_compute	kern/time.h	/^#define tm_sleep_compute(/;"	d
+tm_sys	kern/thread.h	/^	clock_t tm_sys;                      \/*! system execution duration *\/$/;"	m	struct:thread_info
+tm_sys_compute	kern/time.c	/^inline void tm_sys_compute(struct thread_s *thread)$/;"	f
+tm_sys_compute	kern/time.h	/^#define tm_sys_compute(/;"	d
+tm_tbl	kern/task.c	/^	struct task_locator_s tm_tbl[PID_MAX_LOCAL];$/;"	m	struct:tasks_manager_s	typeref:struct:tasks_manager_s::task_locator_s	file:
+tm_tmp	kern/thread.h	/^	uint_t tm_tmp;                      \/*! temporary date to compute execution duration *\/$/;"	m	struct:thread_info
+tm_usr	kern/thread.h	/^	clock_t tm_usr;                      \/*! user execution duration *\/$/;"	m	struct:thread_info
+tm_usr_compute	kern/time.c	/^inline void tm_usr_compute(struct thread_s *thread)$/;"	f
+tm_usr_compute	kern/time.h	/^#define tm_usr_compute(/;"	d
+tm_wait	kern/thread.h	/^	clock_t tm_wait;$/;"	m	struct:thread_info
+tm_wait_compute	kern/time.c	/^inline void tm_wait_compute(struct thread_s *thread)$/;"	f
+tm_wait_compute	kern/time.h	/^#define tm_wait_compute(/;"	d
+tm_wakeup	kern/time.h	/^	uint_t tm_wakeup;$/;"	m	struct:alarm_info_s
+tms	kern/time.h	/^struct tms $/;"	s
+tms_cstime	kern/time.h	/^       clock_t tms_cstime; \/* system time of children *\/$/;"	m	struct:tms
+tms_cutime	kern/time.h	/^       clock_t tms_cutime; \/* user time of children *\/$/;"	m	struct:tms
+tms_stime	kern/time.h	/^       clock_t tms_stime;  \/* system time *\/$/;"	m	struct:tms
+tms_utime	kern/time.h	/^       clock_t tms_utime;  \/* user time *\/$/;"	m	struct:tms
+tmstmp	kern/cpu.h	/^	uint_t tmstmp;$/;"	m	struct:cpu_time_s
+total_nr	kern/scheduler.h	/^	uint16_t total_nr;$/;"	m	struct:scheduler_s
+toupper	libk/ctype.c	/^int toupper(int c)$/;"	f
+trace_recorder	kern/cpu.h	/^	struct cpu_trace_recorder_s *trace_recorder;$/;"	m	struct:cpu_s	typeref:struct:cpu_s::cpu_trace_recorder_s
+true	libk/types.h	/^#define true /;"	d
+trunc	vfs/vfs.h	/^	vfs_trunc_inode_t *trunc;$/;"	m	struct:vfs_inode_op_s
+tss_ptr	cpu/i386/cpu-asm.h	/^	reg_t tss_ptr;$/;"	m	struct:cpu_context_s
+tty_base	libk/boot-info.h	/^	uint_t tty_base; \/\/ fg ?$/;"	m	struct:boot_info_s
+tty_buffer	drivers/soclib/soclib_tty.c	/^	struct fifomwmr_s *tty_buffer;$/;"	m	struct:tty_context_s	typeref:struct:tty_context_s::fifomwmr_s	file:
+tty_cid	libk/boot-info.h	/^	uint_t tty_cid; $/;"	m	struct:boot_info_s
+tty_cleanup	drivers/ibmpc/tty.c	/^static void tty_cleanup(struct device_s *tty)$/;"	f	file:
+tty_clear	cpu/i386/boot.c	/^static void tty_clear()$/;"	f	file:
+tty_clear	drivers/ibmpc/tty.c	/^static void tty_clear(struct device_s *tty)$/;"	f	file:
+tty_context_s	drivers/ibmpc/tty.h	/^struct tty_context_s$/;"	s
+tty_context_s	drivers/soclib/soclib_tty.c	/^struct tty_context_s$/;"	s	file:
+tty_count	drivers/soclib/soclib_tty.c	/^static uint_t tty_count = 0;$/;"	v	file:
+tty_get_params	drivers/ibmpc/tty.c	/^static sint_t tty_get_params(struct device_s *tty, dev_params_t *params)$/;"	f	file:
+tty_get_params	drivers/soclib/soclib_tty.c	/^sint_t tty_get_params(struct device_s *tty, dev_params_t *params)$/;"	f
+tty_get_status	drivers/soclib/soclib_tty.c	/^char tty_get_status(struct device_s *tty)$/;"	f
+tty_getc	drivers/ibmpc/tty.c	/^static error_t tty_getc(struct device_s *tty)$/;"	f	file:
+tty_irq_handler	drivers/ibmpc/tty.c	/^static void tty_irq_handler(struct irq_action_s *action)$/;"	f	file:
+tty_irq_handler	drivers/soclib/soclib_tty.c	/^void tty_irq_handler(struct irq_action_s *action)$/;"	f
+tty_move_cursor	drivers/ibmpc/tty.c	/^void tty_move_cursor(uint_t pos_X, uint_t pos_Y)$/;"	f
+tty_open	drivers/soclib/soclib_tty.c	/^sint_t tty_open(struct device_s *tty, dev_request_t *rq)$/;"	f
+tty_putc	drivers/ibmpc/tty.c	/^static void tty_putc(struct device_s *tty, uint8_t ch)$/;"	f	file:
+tty_rdlock	drivers/soclib/soclib_tty.c	/^static void tty_rdlock(struct device_s *tty)$/;"	f	file:
+tty_rdunlock	drivers/soclib/soclib_tty.c	/^static void tty_rdunlock(struct device_s *tty)$/;"	f	file:
+tty_read	drivers/ibmpc/tty.c	/^static sint_t tty_read(struct device_s *tty, dev_request_t *rq)$/;"	f	file:
+tty_read	drivers/soclib/soclib_tty.c	/^sint_t tty_read(struct device_s *tty, dev_request_t *rq)$/;"	f
+tty_reserve_iopic	drivers/soclib/soclib_tty.c	/^static void tty_reserve_iopic(struct device_s *tty)$/;"	f	file:
+tty_scrollup	drivers/ibmpc/tty.c	/^void tty_scrollup(struct device_s *tty, int n)$/;"	f
+tty_try_rdlock	drivers/soclib/soclib_tty.c	/^static uint_t tty_try_rdlock(struct device_s *tty)$/;"	f	file:
+tty_write	drivers/ibmpc/tty.c	/^static sint_t tty_write(struct device_s *tty, dev_request_t *rq)$/;"	f	file:
+tty_write	drivers/soclib/soclib_tty.c	/^sint_t tty_write(struct device_s *tty, dev_request_t *rq)$/;"	f
+tty_wrlock	drivers/soclib/soclib_tty.c	/^static void tty_wrlock(struct device_s *tty)$/;"	f	file:
+tty_wrunlock	drivers/soclib/soclib_tty.c	/^static void tty_wrunlock(struct device_s *tty)$/;"	f	file:
+ttys_tbl	drivers/ibmpc/tty.c	/^struct device_s ttys_tbl[TTY_DEV_NR];$/;"	v	typeref:struct:device_s
+ttys_tbl	drivers/soclib/soclib_tty.c	/^struct device_s *ttys_tbl[TTY_DEV_NR] = {NULL};$/;"	v	typeref:struct:device_s
+tv_sec	kern/time.h	/^	clock_t tv_sec;    \/* secondes *\/$/;"	m	struct:timeval
+tv_usec	kern/time.h	/^	clock_t tv_usec;   \/* microsecondes *\/$/;"	m	struct:timeval
+type	kern/device.h	/^	dev_type_t type;		  \/*! type of device (i.g. DEV_CHR, DEV_BLK ..etc) *\/$/;"	m	struct:device_s
+type	kern/driver.h	/^	uint_t type;$/;"	m	struct:dev_params_s
+type	kern/thread.h	/^	thread_attr_t type;           \/*! 3 types : usr (PTHREAD), kernel (KTHREAD) or idle (TH_IDLE) *\/$/;"	m	struct:thread_s
+type	mm/kmem.h	/^  kmem_types_t type;$/;"	m	struct:kmem_objattr_s
+type	mm/kmem.h	/^  kmem_types_t type;$/;"	m	struct:kmem_req_s
+type	vfs/vfs_init.c	/^	uint_t type;$/;"	m	struct:fs_type_s	file:
+typedef	cpu/mipsel/__kheader.S	/^typedef struct kernel_info_s$/;"	t
+tz_dsttime	kern/time.h	/^	int tz_dsttime;         \/* type of DST correction *\/$/;"	m	struct:timezone
+tz_minuteswest	kern/time.h	/^	int tz_minuteswest;     \/* minutes west of Greenwich *\/$/;"	m	struct:timezone
+u_attr	vfs/vfs.h	/^	uint32_t u_attr;$/;"	m	struct:vfs_usp_dirent_s
+u_err_nr	kern/thread.h	/^	uint_t u_err_nr;$/;"	m	struct:thread_info
+u_err_nr	mm/vmm.h	/^	uint_t u_err_nr;$/;"	m	struct:vmm_s
+u_ino	vfs/vfs.h	/^	uint32_t u_ino;$/;"	m	struct:vfs_usp_dirent_s
+u_name	vfs/vfs.h	/^	uint8_t  u_name[VFS_MAX_NAME_LENGTH];$/;"	m	struct:vfs_usp_dirent_s
+u_runnable	kern/rr-sched.c	/^	uint_t u_runnable;$/;"	m	struct:rQueues_s	file:
+u_runnable	kern/rr-sched_locked.c	/^	uint_t u_runnable;$/;"	m	struct:rQueues_s	file:
+u_runnable	kern/scheduler.h	/^	uint16_t u_runnable;$/;"	m	struct:scheduler_s
+u_threshold	kern/dqdt.h	/^	uint_t u_threshold;$/;"	m	struct:dqdt_attr_s
+uid	kern/task.h	/^	uid_t uid;$/;"	m	struct:task_s
+uid_t	libk/types.h	/^typedef unsigned long uid_t;$/;"	t
+uint16_t	libk/stdint.h	/^typedef unsigned short int uint16_t;$/;"	t
+uint32_t	libk/stdint.h	/^typedef unsigned int uint32_t;$/;"	t
+uint64_t	libk/stdint.h	/^typedef unsigned long long int uint64_t;$/;"	t
+uint8_t	libk/stdint.h	/^typedef unsigned char uint8_t;$/;"	t
+uint_fast16_t	libk/stdint.h	/^typedef uint32_t uint_fast16_t;$/;"	t
+uint_fast32_t	libk/stdint.h	/^typedef uint32_t uint_fast32_t;$/;"	t
+uint_fast64_t	libk/stdint.h	/^typedef uint64_t uint_fast64_t;$/;"	t
+uint_fast8_t	libk/stdint.h	/^typedef uint32_t uint_fast8_t;$/;"	t
+uint_subwo	libk/utils.h	/^#define uint_subwo(/;"	d
+uint_t	libk/types.h	/^typedef unsigned long uint_t;$/;"	t
+uintptr_t	libk/stdint.h	/^typedef unsigned long uintptr_t;$/;"	t
+unified_except_entry	cpu/i386/__kentry.S	/^unified_except_entry:$/;"	l
+unified_irq_entry	cpu/i386/__kentry.S	/^unified_irq_entry:	$/;"	l
+unknown	kern/thread_create.c	/^const char* unknown = "UNKNOWN";$/;"	v
+unlink	vfs/vfs.h	/^	vfs_unlink_inode_t *unlink;$/;"	m	struct:vfs_inode_op_s
+unset_extension	cpu/mipsel/cpu-remote.h	/^#define unset_extension(/;"	d
+up_dmsg	kern/dqdt.c	/^#define up_dmsg(/;"	d	file:
+update_dmsg	kern/dqdt.c	/^#define update_dmsg(/;"	d	file:
+update_remote_contexts	vfs/vfs_init.c	/^error_t update_remote_contexts(struct vfs_inode_s *root)$/;"	f
+update_task0_root_cwd	vfs/vfs_init.c	/^void update_task0_root_cwd(struct task_s *task0)$/;"	f
+uprio_pages_min	mm/ppm.h	/^	uint_t uprio_pages_min;$/;"	m	struct:ppm_s
+urgent_pages_min	mm/ppm.h	/^	uint_t urgent_pages_min;$/;"	m	struct:ppm_s
+usage	kern/cpu.h	/^	uint_t usage;$/;"	m	struct:cpu_s
+used_rg	cpu/mipsel/cpu-remote.h	/^#define used_rg(/;"	d
+user_nr	kern/scheduler.h	/^	uint16_t user_nr;$/;"	m	struct:scheduler_s
+usr_tls	kern/thread.h	/^	uint_t usr_tls;$/;"	m	struct:thread_info
+uzone	kern/thread.h	/^	struct cpu_uzone_s uzone;     \/*! User related info, this offset is frozen *\/$/;"	m	struct:thread_s	typeref:struct:thread_s::cpu_uzone_s
+vaddr_begin	mm/ppm.h	/^	uint_t vaddr_begin;$/;"	m	struct:ppm_s
+vaddr_start	mm/ppm.h	/^	uint_t vaddr_start;$/;"	m	struct:ppm_s
+val	kern/atomic.h	/^	volatile sint_t val;$/;"	m	struct:atomic_s
+val	kern/kdmsg.h	/^		global_t val;$/;"	m	union:kdmsg_channel_s::__anon18
+val	kern/mcs_sync.h	/^	cacheline_t val;$/;"	m	struct:mcs_barrier_s
+val	kern/spinlock.h	/^	sint_t val;		\/* must be keeped sync with cpu_spinlock_lock *\/$/;"	m	struct:spinlock_s
+val	kern/thread.h	/^		uint_t val[6];$/;"	m	union:kthread_args_s::__anon40
+value	drivers/soclib/soclib_xicu.c	/^	uint32_t value;$/;"	m	struct:xicu_cntr_info_s	file:
+value	kern/semaphore.h	/^	uint_t value;$/;"	m	struct:semaphore_s
+value	libk/types.h	/^    uint_t value;$/;"	m	union:cache_line_s::__anon45
+values	libk/types.h	/^    uint_t values[CONFIG_CACHE_LINE_LENGTH];$/;"	m	union:cache_line_s::__anon45
+vendor_id1	drivers/ibmpc/ata.h	/^	uint16_t vendor_id1[3];$/;"	m	struct:ata_identify_s
+vendor_id2	drivers/ibmpc/ata.h	/^	uint16_t vendor_id2;$/;"	m	struct:ata_identify_s
+vendor_id3	drivers/ibmpc/ata.h	/^	uint16_t vendor_id3[32];$/;"	m	struct:ata_identify_s
+vfat_DirEntry_s	fs/fat32/fat32-private.h	/^struct vfat_DirEntry_s$/;"	s
+vfat_alloc_fat_entry	fs/fat32/fat32_access.c	/^error_t vfat_alloc_fat_entry(struct vfat_context_s* ctx, vfat_cluster_t *new_cluster)$/;"	f
+vfat_bpb_s	fs/fat32/fat32-private.h	/^struct vfat_bpb_s$/;"	s
+vfat_cluster_count	fs/fat32/fat32_access.c	/^int vfat_cluster_count(struct vfat_context_s *ctx, vfat_cluster_t cluster_index) $/;"	f
+vfat_cluster_lookup	fs/fat32/fat32_access.c	/^error_t vfat_cluster_lookup(struct vfat_context_s* ctx,$/;"	f
+vfat_cluster_t	fs/fat32/fat32.h	/^typedef uint32_t vfat_cluster_t;$/;"	t
+vfat_context_init	fs/fat32/fat32_context.c	/^static error_t vfat_context_init(struct vfat_context_s *ctx)$/;"	f	file:
+vfat_context_s	fs/fat32/fat32.h	/^struct vfat_context_s$/;"	s
+vfat_convert_name	fs/fat32/fat32_node.c	/^static inline void vfat_convert_name(char *str1, char *str2) {$/;"	f	file:
+vfat_ctx_op	fs/fat32/fat32_context.c	/^const struct vfs_context_op_s vfat_ctx_op =$/;"	v	typeref:struct:vfs_context_op_s
+vfat_d_op	fs/fat32/fat32_node.c	/^const struct vfs_dirent_op_s vfat_d_op =$/;"	v	typeref:struct:vfs_dirent_op_s
+vfat_dirent_s	fs/fat32/fat32.h	/^struct vfat_dirent_s$/;"	s
+vfat_dmsg	kern/kdmsg.h	/^#define vfat_dmsg(/;"	d
+vfat_entry_request_s	fs/fat32/fat32-private.h	/^struct vfat_entry_request_s$/;"	s
+vfat_extend_cluster	fs/fat32/fat32_access.c	/^error_t vfat_extend_cluster(struct vfat_context_s* ctx,$/;"	f
+vfat_f_op	fs/fat32/fat32_file.c	/^const struct vfs_file_op_s vfat_f_op =$/;"	v	typeref:struct:vfs_file_op_s
+vfat_file_mapper_op	fs/fat32/fat32_mapper.c	/^const struct mapper_op_s vfat_file_mapper_op =$/;"	v	typeref:struct:mapper_op_s
+vfat_file_s	fs/fat32/fat32_mapper.c	/^struct vfat_file_s$/;"	s	file:
+vfat_free_fat_entry	fs/fat32/fat32_access.c	/^error_t vfat_free_fat_entry(struct vfat_context_s* ctx, vfat_cluster_t start_cluster)$/;"	f
+vfat_getshortname	fs/fat32/fat32_node.c	/^inline void vfat_getshortname(char *from, char *to) {$/;"	f
+vfat_i_op	fs/fat32/fat32_node.c	/^const struct vfs_inode_op_s vfat_i_op =$/;"	v	typeref:struct:vfs_inode_op_s
+vfat_icreate	vfs/vfs.h	/^		struct vfat_inode_create_s vfat_icreate;$/;"	m	union:vfs_icreate_s::__anon52	typeref:struct:vfs_icreate_s::__anon52::vfat_inode_create_s
+vfat_inode_create_s	fs/fat32/fat32.h	/^struct vfat_inode_create_s$/;"	s
+vfat_inode_mapper_op	fs/fat32/fat32_mapper.c	/^const struct mapper_op_s vfat_inode_mapper_op =$/;"	v	typeref:struct:mapper_op_s
+vfat_inode_s	fs/fat32/fat32-private.h	/^struct vfat_inode_s$/;"	s
+vfat_kmem_context_init	fs/fat32/fat32.h	/^KMEM_OBJATTR_INIT(vfat_kmem_context_init);$/;"	v
+vfat_kmem_inode_init	fs/fat32/fat32.h	/^KMEM_OBJATTR_INIT(vfat_kmem_inode_init);$/;"	v
+vfat_locate_entry	fs/fat32/fat32_access.c	/^error_t vfat_locate_entry(struct vfat_entry_request_s *rq)$/;"	f
+vfat_offset_t	fs/fat32/fat32.h	/^typedef uint32_t vfat_offset_t;$/;"	t
+vfat_pgio_fat	fs/fat32/fat32_mapper.c	/^static inline error_t vfat_pgio_fat(struct vfat_context_s* ctx, struct page_s *page, uint_t flags) $/;"	f	file:
+vfat_pgio_reg	fs/fat32/fat32_mapper.c	/^static inline error_t vfat_pgio_reg(struct vfat_file_s *file_info, struct page_s *page, uint_t flags)$/;"	f	file:
+vfat_query_fat	fs/fat32/fat32_access.c	/^error_t vfat_query_fat(struct vfat_context_s* ctx,$/;"	f
+vfat_sector_t	fs/fat32/fat32.h	/^typedef uint32_t vfat_sector_t;$/;"	t
+vfs_cache_init	vfs/vfs_cache.c	/^error_t vfs_cache_init()$/;"	f
+vfs_chdir	vfs/vfs.c	/^error_t vfs_chdir(struct ku_obj *pathname, struct vfs_file_s *cwd) $/;"	f
+vfs_chmod	vfs/vfs.c	/^error_t vfs_chmod(struct ku_obj *path, struct vfs_file_s *cwd, uint_t mode) $/;"	f
+vfs_close	vfs/vfs.c	/^error_t vfs_close(struct vfs_file_s *file, uint_t *refcount)$/;"	f
+vfs_close_file_t	vfs/vfs.h	/^typedef VFS_CLOSE_FILE(vfs_close_file_t);$/;"	t
+vfs_closedir	vfs/vfs.c	/^error_t vfs_closedir(struct vfs_file_s *file, uint_t *refcount) $/;"	f
+vfs_compare_dirent_t	vfs/vfs.h	/^typedef VFS_COMPARE_DIRENT(vfs_compare_dirent_t) ;$/;"	t
+vfs_context_init	vfs/vfs_init.c	/^void vfs_context_init(struct vfs_context_s *ctx)$/;"	f
+vfs_context_op_s	vfs/vfs.h	/^struct vfs_context_op_s$/;"	s
+vfs_context_s	vfs/vfs.h	/^struct vfs_context_s$/;"	s
+vfs_contexts	vfs/vfs_init.c	/^struct vfs_context_s vfs_contexts[MAX_FS];$/;"	v	typeref:struct:vfs_context_s
+vfs_create	vfs/vfs.c	/^error_t vfs_create(struct vfs_file_s *cwd,$/;"	f
+vfs_create_context_t	vfs/vfs.h	/^typedef VFS_CREATE_CONTEXT(vfs_create_context_t);$/;"	t
+vfs_create_inode	vfs/vfs_cache.c	/^error_t vfs_create_inode(struct vfs_icreate_s *ic)$/;"	f
+vfs_create_inode_t	vfs/vfs.h	/^typedef VFS_CREATE_NODE(vfs_create_inode_t);$/;"	t
+vfs_cwd	kern/task.h	/^	struct vfs_file_s vfs_cwd;$/;"	m	struct:task_s	typeref:struct:task_s::vfs_file_s
+vfs_cwd	kern/task.h	/^        struct vfs_file_s       vfs_cwd;$/;"	m	struct:sys_exec_remote_s	typeref:struct:sys_exec_remote_s::vfs_file_s
+vfs_dcache_init	vfs/vfs_cache.c	/^error_t vfs_dcache_init(uint_t length)$/;"	f
+vfs_default_mmap_file	vfs/vfs.h	/^VFS_MMAP_FILE(vfs_default_mmap_file);$/;"	v
+vfs_default_munmap_file	vfs/vfs.h	/^VFS_MMAP_FILE(vfs_default_munmap_file);$/;"	v
+vfs_default_read	vfs/vfs.h	/^VFS_READ_FILE(vfs_default_read);$/;"	v
+vfs_default_write	vfs/vfs.h	/^VFS_WRITE_FILE(vfs_default_write);$/;"	v
+vfs_delete_inode_t	vfs/vfs.h	/^typedef VFS_DELETE_NODE(vfs_delete_inode_t);$/;"	t
+vfs_destroy_context_t	vfs/vfs.h	/^typedef VFS_DESTROY_CONTEXT(vfs_destroy_context_t);$/;"	t
+vfs_dir_count	vfs/vfs_lookup.c	/^static uint_t vfs_dir_count(char *path) $/;"	f	file:
+vfs_dirent_clear_inload	vfs/vfs_cache.c	/^void vfs_dirent_clear_inload(struct vfs_dirent_s *dirent)$/;"	f
+vfs_dirent_ctor	vfs/vfs_cache.c	/^static void vfs_dirent_ctor(struct kcm_s *kcm, void *ptr)$/;"	f	file:
+vfs_dirent_down	vfs/vfs_cache.c	/^void vfs_dirent_down(struct vfs_dirent_s *dirent)$/;"	f
+vfs_dirent_free	vfs/vfs_cache.c	/^void vfs_dirent_free(struct vfs_dirent_s *dirent)$/;"	f
+vfs_dirent_init	vfs/vfs_cache.c	/^void vfs_dirent_init(struct vfs_dirent_s *dirent, struct vfs_context_s *ctx, char* name)$/;"	f
+vfs_dirent_is_inload	vfs/vfs_cache.c	/^bool_t vfs_dirent_is_inload(struct vfs_dirent_s *dirent)$/;"	f
+vfs_dirent_new	vfs/vfs_cache.c	/^struct vfs_dirent_s* vfs_dirent_new(struct vfs_context_s *ctx, char* name)$/;"	f
+vfs_dirent_op_s	vfs/vfs.h	/^struct vfs_dirent_op_s$/;"	s
+vfs_dirent_s	vfs/vfs.h	/^struct vfs_dirent_s$/;"	s
+vfs_dirent_set_inload	vfs/vfs_cache.c	/^void vfs_dirent_set_inload(struct vfs_dirent_s *dirent)$/;"	f
+vfs_dirent_up	vfs/vfs_cache.c	/^void vfs_dirent_up(struct vfs_dirent_s *dirent)$/;"	f
+vfs_dmsg	kern/kdmsg.h	/^#define vfs_dmsg(/;"	d
+vfs_file_ctor	vfs/vfs_file.c	/^static void vfs_file_ctor(struct kcm_s *kcm, void *ptr)$/;"	f	file:
+vfs_file_down	vfs/vfs_file.c	/^sint_t vfs_file_down(struct vfs_file_s *file)$/;"	f
+vfs_file_freelist_s	vfs/vfs-private.h	/^struct vfs_file_freelist_s$/;"	s
+vfs_file_get	vfs/vfs_file.c	/^struct vfs_file_s* vfs_file_get(struct vfs_context_s *ctx,$/;"	f
+vfs_file_op_s	vfs/vfs.h	/^struct vfs_file_op_s$/;"	s
+vfs_file_private_s	vfs/vfs.h	/^union vfs_file_private_s$/;"	u
+vfs_file_remote_down	vfs/vfs_file.c	/^sint_t vfs_file_remote_down(struct vfs_file_remote_s *file)$/;"	f
+vfs_file_remote_get	vfs/vfs_file.c	/^vfs_file_remote_get(struct vfs_inode_s *inode)$/;"	f
+vfs_file_remote_put	vfs/vfs_file.c	/^void vfs_file_remote_put(struct vfs_file_remote_s* fremote)$/;"	f
+vfs_file_remote_s	vfs/vfs.h	/^struct vfs_file_remote_s$/;"	s
+vfs_file_s	vfs/vfs.h	/^struct vfs_file_s$/;"	s
+vfs_file_up	vfs/vfs_file.c	/^sint_t vfs_file_up(struct vfs_file_s *file)$/;"	f
+vfs_freelist_init	vfs/vfs_cache.c	/^error_t vfs_freelist_init(struct vfs_freelist_s *freelist, uint_t length)$/;"	f
+vfs_freelist_s	vfs/vfs-private.h	/^struct vfs_freelist_s $/;"	s
+vfs_get_path	vfs/vfs.c	/^error_t vfs_get_path(struct vfs_file_s *file, struct ku_obj *buff)$/;"	f
+vfs_icache_add	vfs/vfs_cache.c	/^error_t vfs_icache_add(struct vfs_inode_s *inode)$/;"	f
+vfs_icache_del	vfs/vfs_cache.c	/^error_t vfs_icache_del(struct vfs_inode_s *inode)$/;"	f
+vfs_icache_init	vfs/vfs_cache.c	/^error_t vfs_icache_init(uint_t length)$/;"	f
+vfs_icache_lock	vfs/vfs_cache.c	/^void vfs_icache_lock()$/;"	f
+vfs_icache_unlock	vfs/vfs_cache.c	/^void vfs_icache_unlock()$/;"	f
+vfs_icreate_inode_t	vfs/vfs.h	/^typedef VFS_ICREATE_NODE(vfs_icreate_inode_t);$/;"	t
+vfs_icreate_s	vfs/vfs.h	/^struct vfs_icreate_s$/;"	s
+vfs_init	vfs/vfs_init.c	/^void vfs_init()$/;"	f
+vfs_init_inode_t	vfs/vfs.h	/^typedef VFS_INIT_NODE(vfs_init_inode_t);$/;"	t
+vfs_inode_ctor	vfs/vfs_cache.c	/^static void vfs_inode_ctor(struct kcm_s *kcm, void *ptr)$/;"	f	file:
+vfs_inode_down	vfs/vfs_cache.c	/^error_t vfs_inode_down(struct vfs_inode_s *inode)$/;"	f
+vfs_inode_free	vfs/vfs_cache.c	/^void vfs_inode_free(struct vfs_inode_s *inode, bool_t sync)$/;"	f
+vfs_inode_get_cid	vfs/vfs_cache.c	/^cid_t vfs_inode_get_cid(uint_t ino)$/;"	f
+vfs_inode_hold	vfs/vfs_cache.c	/^error_t vfs_inode_hold(struct vfs_inode_s *inode, gc_t igc)$/;"	f
+vfs_inode_init	vfs/vfs_cache.c	/^error_t vfs_inode_init(struct vfs_inode_s *inode, struct vfs_context_s *ctx)$/;"	f
+vfs_inode_link	vfs/vfs_cache.c	/^error_t vfs_inode_link(struct vfs_inode_s *inode, gc_t igc)$/;"	f
+vfs_inode_lock	vfs/vfs_cache.c	/^error_t vfs_inode_lock(struct vfs_inode_s *inode)$/;"	f
+vfs_inode_lookup	vfs/vfs_lookup.c	/^struct vfs_dirent_s* vfs_inode_lookup(struct vfs_inode_s *inode, char *name)$/;"	f
+vfs_inode_new	vfs/vfs_cache.c	/^struct vfs_inode_s* vfs_inode_new(struct vfs_context_s* ctx)$/;"	f
+vfs_inode_op_s	vfs/vfs.h	/^struct vfs_inode_op_s$/;"	s
+vfs_inode_ref_s	vfs/vfs.h	/^struct vfs_inode_ref_s$/;"	s
+vfs_inode_s	vfs/vfs.h	/^struct vfs_inode_s$/;"	s
+vfs_inode_size_get	vfs/vfs_cache.c	/^size_t vfs_inode_size_get(struct vfs_inode_s *inode)$/;"	f
+vfs_inode_size_get_remote	vfs/vfs_cache.c	/^size_t vfs_inode_size_get_remote(struct vfs_inode_s *inode, cid_t inode_cid)$/;"	f
+vfs_inode_trunc	vfs/vfs_cache.c	/^error_t vfs_inode_trunc(struct vfs_inode_s *inode)$/;"	f
+vfs_inode_unlock	vfs/vfs_cache.c	/^error_t vfs_inode_unlock(struct vfs_inode_s *inode)$/;"	f
+vfs_inode_up	vfs/vfs_cache.c	/^void vfs_inode_up(struct vfs_inode_s *inode)$/;"	f
+vfs_inum_new	vfs/vfs_cache.c	/^uint32_t vfs_inum_new(struct vfs_context_s *ctx)$/;"	f
+vfs_inumber_free	vfs/vfs_cache.c	/^void vfs_inumber_free(struct vfs_context_s *ctx, uint_t inum)$/;"	f
+vfs_kmem_context_init	vfs/vfs-private.h	/^KMEM_OBJATTR_INIT(vfs_kmem_context_init);$/;"	v
+vfs_kmem_dirent_init	vfs/vfs-private.h	/^KMEM_OBJATTR_INIT(vfs_kmem_dirent_init);$/;"	v
+vfs_kmem_file_remote_init	vfs/vfs-private.h	/^KMEM_OBJATTR_INIT(vfs_kmem_file_remote_init);$/;"	v
+vfs_kmem_inode_init	vfs/vfs-private.h	/^KMEM_OBJATTR_INIT(vfs_kmem_inode_init);$/;"	v
+vfs_load_dirent	vfs/vfs_lookup.c	/^error_t vfs_load_dirent(struct vfs_inode_s *parent, char* name, $/;"	f
+vfs_lookup	vfs/vfs_lookup.c	/^error_t vfs_lookup(struct vfs_file_s *cwd, struct ku_obj *path, uint_t flags, $/;"	f
+vfs_lookup_child	vfs/vfs_lookup.c	/^void vfs_lookup_child(struct vfs_lookup_response_s *lkr, $/;"	f
+vfs_lookup_elem	vfs/vfs_lookup.c	/^error_t vfs_lookup_elem(struct vfs_lookup_s *lkp, $/;"	f
+vfs_lookup_inode_t	vfs/vfs.h	/^typedef VFS_LOOKUP_NODE(vfs_lookup_inode_t);$/;"	t
+vfs_lookup_next	vfs/vfs_lookup.c	/^error_t vfs_lookup_next(struct vfs_lookup_path_s * path)$/;"	f
+vfs_lookup_parent	vfs/vfs_lookup.c	/^void vfs_lookup_parent(struct vfs_lookup_response_s *lkr, $/;"	f
+vfs_lookup_path	vfs/vfs_lookup.c	/^error_t vfs_lookup_path(struct vfs_file_s *cwd, $/;"	f
+vfs_lookup_path_init	vfs/vfs_lookup.c	/^error_t vfs_lookup_path_init(struct vfs_lookup_path_s *lkp_path, $/;"	f
+vfs_lookup_path_put	vfs/vfs_lookup.c	/^void vfs_lookup_path_put(struct vfs_lookup_path_s *lkp_path)$/;"	f
+vfs_lookup_path_s	vfs/vfs-private.h	/^struct vfs_lookup_path_s$/;"	s
+vfs_lookup_response_s	vfs/vfs.h	/^struct vfs_lookup_response_s$/;"	s
+vfs_lookup_s	vfs/vfs.h	/^struct vfs_lookup_s$/;"	s
+vfs_lseek	vfs/vfs.c	/^error_t vfs_lseek(struct vfs_file_s *file, size_t offset, uint_t whence, size_t *new_offset_ptr) $/;"	f
+vfs_lseek_file_t	vfs/vfs.h	/^typedef VFS_LSEEK_FILE(vfs_lseek_file_t);$/;"	t
+vfs_lseek_remote	vfs/vfs.c	/^error_t vfs_lseek_remote(struct vfs_file_s *file, size_t offset, uint_t whence, size_t *new_offset_ptr) $/;"	f
+vfs_mkdir	vfs/vfs.c	/^error_t vfs_mkdir(struct vfs_file_s *cwd, struct ku_obj *pathname, uint_t mode) $/;"	f
+vfs_mkfifo	vfs/vfs.c	/^error_t vfs_mkfifo(struct vfs_file_s *cwd, struct ku_obj *pathname, uint_t mode) {$/;"	f
+vfs_mmap_file_t	vfs/vfs.h	/^typedef VFS_MMAP_FILE(vfs_mmap_file_t);$/;"	t
+vfs_mount_fs_root	vfs/vfs_init.c	/^error_t vfs_mount_fs_root(struct device_s *device,$/;"	f
+vfs_mount_link	vfs/vfs_init.c	/^void vfs_mount_link(struct vfs_inode_s *mount_point,$/;"	f
+vfs_mount_prepare	vfs/vfs_init.c	/^error_t vfs_mount_prepare(struct device_s *dev,$/;"	f
+vfs_munmap_file_t	vfs/vfs.h	/^typedef VFS_MUNMAP_FILE(vfs_munmap_file_t);$/;"	t
+vfs_nodes_nr	kern/cluster.h	/^	atomic_t vfs_nodes_nr;$/;"	m	struct:cluster_s
+vfs_open	vfs/vfs.c	/^error_t vfs_open(struct vfs_file_s *cwd,$/;"	f
+vfs_open_file_t	vfs/vfs.h	/^typedef VFS_OPEN_FILE(vfs_open_file_t);$/;"	t
+vfs_opendir	vfs/vfs.c	/^error_t vfs_opendir(struct vfs_file_s *cwd, struct ku_obj *path, uint_t mode, struct vfs_file_s *file) $/;"	f
+vfs_pipe	vfs/vfs.c	/^error_t vfs_pipe(struct vfs_file_s *pipefd[2]) {$/;"	f
+vfs_pipe_ctx	vfs/vfs_lookup.c	/^struct vfs_context_s *vfs_pipe_ctx;$/;"	v	typeref:struct:vfs_context_s
+vfs_read	vfs/vfs.c	/^ssize_t vfs_read(struct vfs_file_s *file, struct ku_obj * buffer) $/;"	f
+vfs_read_dir_t	vfs/vfs.h	/^typedef VFS_READ_DIR(vfs_read_dir_t);$/;"	t
+vfs_read_file_t	vfs/vfs.h	/^typedef VFS_READ_FILE(vfs_read_file_t);$/;"	t
+vfs_read_root_t	vfs/vfs.h	/^typedef VFS_READ_ROOT(vfs_read_root_t);$/;"	t
+vfs_readdir	vfs/vfs.c	/^error_t vfs_readdir(struct vfs_file_s *file, struct ku_obj *dirent) $/;"	f
+vfs_real_lookup	vfs/vfs_lookup.c	/^error_t vfs_real_lookup(struct vfs_inode_s *parent, uint32_t flags, $/;"	f
+vfs_release_file_t	vfs/vfs.h	/^typedef VFS_RELEASE_FILE(vfs_release_file_t);$/;"	t
+vfs_release_inode_t	vfs/vfs.h	/^typedef VFS_RELEASE_NODE(vfs_release_inode_t);$/;"	t
+vfs_repli_root_t	vfs/vfs.h	/^typedef VFS_REPLI_ROOT(vfs_repli_root_t);$/;"	t
+vfs_rmdir	vfs/vfs.c	/^error_t vfs_rmdir(struct vfs_file_s *cwd, struct ku_obj *pathname) $/;"	f
+vfs_root	kern/task.h	/^	struct vfs_file_s vfs_root;$/;"	m	struct:task_s	typeref:struct:task_s::vfs_file_s
+vfs_root	kern/task.h	/^        struct vfs_file_s       vfs_root;$/;"	m	struct:sys_exec_remote_s	typeref:struct:sys_exec_remote_s::vfs_file_s
+vfs_split_path	vfs/vfs_lookup.c	/^static uint_t vfs_split_path(char *path, char **dirs) $/;"	f	file:
+vfs_stat	vfs/vfs.c	/^error_t vfs_stat(struct vfs_file_s *cwd, struct ku_obj *path, struct vfs_stat_s* ustat, struct vfs_file_s *file)$/;"	f
+vfs_stat_inode	vfs/vfs_cache.c	/^error_t vfs_stat_inode(struct vfs_inode_s* inode, uint_t inum)$/;"	f
+vfs_stat_inode_t	vfs/vfs.h	/^typedef VFS_STAT_NODE(vfs_stat_inode_t);$/;"	t
+vfs_stat_s	vfs/vfs.h	/^struct vfs_stat_s $/;"	s
+vfs_trunc_inode_t	vfs/vfs.h	/^typedef VFS_TRUNC_NODE(vfs_trunc_inode_t);$/;"	t
+vfs_types_t	vfs/vfs-params.h	/^}vfs_types_t;$/;"	t	typeref:enum:__anon51
+vfs_unlink	vfs/vfs.c	/^error_t vfs_unlink(struct vfs_file_s *cwd, struct ku_obj *pathname) $/;"	f
+vfs_unlink_inode	vfs/vfs_cache.c	/^error_t vfs_unlink_inode(struct vfs_inode_ref_s *ref)$/;"	f
+vfs_unlink_inode_t	vfs/vfs.h	/^typedef VFS_UNLINK_NODE(vfs_unlink_inode_t);$/;"	t
+vfs_usp_dirent_s	vfs/vfs.h	/^struct vfs_usp_dirent_s$/;"	s
+vfs_write	vfs/vfs.c	/^ssize_t vfs_write(struct vfs_file_s *file, struct ku_obj *buffer) $/;"	f
+vfs_write_file_t	vfs/vfs.h	/^typedef VFS_WRITE_FILE(vfs_write_file_t);$/;"	t
+vfs_write_inode_t	vfs/vfs.h	/^typedef VFS_WRITE_NODE(vfs_write_inode_t);$/;"	t
+vfs_write_root_t	vfs/vfs.h	/^typedef VFS_WRITE_ROOT(vfs_write_root_t);$/;"	t
+victim	kern/thread_migrate.c	/^	struct thread_s     *victim;$/;"	m	struct:__anon41	typeref:struct:__anon41::thread_s	file:
+virtual_end	libk/boot-info.h	/^	uint_t virtual_end;\/*6*\/$/;"	m	struct:kernel_info_s
+vm_begin	mm/vm_region.h	/^	uint_t vm_begin;$/;"	m	struct:vm_region_s
+vm_data	mm/vm_region.h	/^	void *vm_data;$/;"	m	struct:vm_region_s
+vm_end	mm/vm_region.h	/^	uint_t vm_end;$/;"	m	struct:vm_region_s
+vm_file	mm/vm_region.h	/^	struct vfs_file_s vm_file;$/;"	m	struct:vm_region_s	typeref:struct:vm_region_s::vfs_file_s
+vm_flags	mm/vm_region.h	/^	uint_t vm_flags;$/;"	m	struct:vm_region_s
+vm_limit	mm/vm_region.h	/^	volatile uint_t vm_limit;$/;"	m	struct:vm_region_s
+vm_list	mm/vm_region.h	/^	struct list_entry vm_list;$/;"	m	struct:vm_region_s	typeref:struct:vm_region_s::list_entry
+vm_lock	mm/vm_region.h	/^	mcs_lock_t vm_lock;$/;"	m	struct:vm_region_s
+vm_mapper	mm/vm_region.h	/^	struct mapper_s vm_mapper;$/;"	m	struct:vm_region_s	typeref:struct:vm_region_s::mapper_s
+vm_node	mm/vm_region.h	/^	struct rb_node vm_node;$/;"	m	struct:vm_region_s	typeref:struct:vm_region_s::rb_node
+vm_offset	mm/vm_region.h	/^	uint_t vm_offset;$/;"	m	struct:vm_region_s
+vm_op	mm/vm_region.h	/^	struct vm_region_op_s *vm_op;$/;"	m	struct:vm_region_s	typeref:struct:vm_region_s::vm_region_op_s
+vm_pgprot	mm/vm_region.h	/^	uint_t vm_pgprot;$/;"	m	struct:vm_region_s
+vm_prot	mm/vm_region.h	/^	uint_t vm_prot;$/;"	m	struct:vm_region_s
+vm_refcount	mm/vm_region.h	/^	atomic_t vm_refcount;$/;"	m	struct:vm_region_s
+vm_reg_lookup_t	mm/vm_region.h	/^typedef VM_REGION_PAGE_LOOKUP(vm_reg_lookup_t);$/;"	t
+vm_reg_pagefault_t	mm/vm_region.h	/^typedef VM_REGION_PAGE_FAULT(vm_reg_pagefault_t);$/;"	t
+vm_reg_pagein_t	mm/vm_region.h	/^typedef VM_REGION_PAGE_IN(vm_reg_pagein_t);$/;"	t
+vm_reg_pageout_t	mm/vm_region.h	/^typedef VM_REGION_PAGE_OUT(vm_reg_pageout_t);$/;"	t
+vm_region_attach	mm/vm_region.c	/^error_t vm_region_attach(struct vmm_s *vmm, struct vm_region_s *region)$/;"	f
+vm_region_attach_rbtree	mm/vm_region.c	/^static error_t vm_region_attach_rbtree(struct vmm_s *vmm, struct vm_region_s *region)$/;"	f	file:
+vm_region_ctor	mm/vm_region.c	/^static void vm_region_ctor(struct kcm_s *kcm, void *ptr)$/;"	f	file:
+vm_region_default_op	mm/vmm.c	/^const struct vm_region_op_s vm_region_default_op =$/;"	v	typeref:struct:vm_region_op_s
+vm_region_destroy	mm/vm_region.c	/^error_t vm_region_destroy(struct vm_region_s *region)$/;"	f
+vm_region_detach	mm/vm_region.c	/^error_t vm_region_detach(struct vmm_s *vmm, struct vm_region_s *region)$/;"	f
+vm_region_dup	mm/vm_region.c	/^error_t vm_region_dup(struct vm_region_s *dst, struct vm_region_s *src)$/;"	f
+vm_region_find	mm/vm_region.c	/^struct vm_region_s* vm_region_find(struct vmm_s *vmm, uint_t vaddr)$/;"	f
+vm_region_find_list	mm/vm_region.c	/^struct vm_region_s* vm_region_find_list(struct vmm_s *vmm, uint_t vaddr)$/;"	f
+vm_region_find_prepare	mm/vm_region.c	/^static struct vm_region_s* vm_region_find_prepare(struct vmm_s *vmm, uint_t addr,$/;"	f	file:
+vm_region_init	mm/vm_region.c	/^error_t vm_region_init(struct vm_region_s *region,$/;"	f
+vm_region_kmem_init	mm/vm_region.h	/^KMEM_OBJATTR_INIT(vm_region_kmem_init);$/;"	v
+vm_region_op_s	mm/vm_region.h	/^struct vm_region_op_s$/;"	s
+vm_region_resize	mm/vm_region.c	/^error_t vm_region_resize(struct vmm_s *vmm, struct vm_region_s *region, uint_t start, uint_t end)$/;"	f
+vm_region_s	mm/vm_region.h	/^struct vm_region_s$/;"	s
+vm_region_solve	mm/vm_region.c	/^static error_t vm_region_solve(struct vmm_s *vmm, struct vm_region_s *region)$/;"	f	file:
+vm_region_split	mm/vm_region.c	/^error_t vm_region_split(struct vmm_s *vmm, struct vm_region_s *region, uint_t start_addr, uint_t length)$/;"	f
+vm_region_unmap	mm/vm_region.c	/^error_t vm_region_unmap(struct vm_region_s *region)$/;"	f
+vm_region_update	mm/vm_region.c	/^error_t vm_region_update(struct vm_region_s *region, uint_t vaddr, uint_t flags)$/;"	f
+vm_shared_list	mm/vm_region.h	/^	struct list_entry vm_shared_list;$/;"	m	struct:vm_region_s	typeref:struct:vm_region_s::list_entry
+vm_start	mm/vm_region.h	/^	uint_t vm_start;$/;"	m	struct:vm_region_s
+vma_t	libk/types.h	/^typedef unsigned long vma_t;$/;"	t
+vmem_start	kern/cluster.h	/^	uint_t vmem_start;$/;"	m	struct:cluster_entry_s
+vmm	kern/task.h	/^	struct vmm_s vmm;$/;"	m	struct:task_s	typeref:struct:task_s::vmm_s
+vmm	mm/vm_region.h	/^	struct vmm_s *vmm;$/;"	m	struct:vm_region_s	typeref:struct:vm_region_s::vmm_s
+vmm_anon_mapper_op	mm/vmm.c	/^static const struct mapper_op_s vmm_anon_mapper_op = $/;"	v	typeref:struct:mapper_op_s	file:
+vmm_check_address	mm/vmm.c	/^inline error_t vmm_check_address(char *objname, struct task_s *task, void *addr, uint_t size)$/;"	f
+vmm_check_object	mm/vmm.h	/^#define vmm_check_object(/;"	d
+vmm_destroy	mm/vmm.c	/^error_t vmm_destroy(struct vmm_s *vmm)$/;"	f
+vmm_dmsg	kern/kdmsg.h	/^#define vmm_dmsg(/;"	d
+vmm_do_aod	mm/vmm.c	/^static inline error_t vmm_do_aod(struct vm_region_s *region, uint_t vaddr)$/;"	f	file:
+vmm_do_cow	mm/vmm.c	/^error_t vmm_do_cow(struct vm_region_s *region, pmm_page_info_t *pinfo, uint_t vaddr)$/;"	f
+vmm_do_mapped	mm/vmm.c	/^static inline error_t vmm_do_mapped(struct vm_region_s *region, uint_t vaddr, uint_t flags)$/;"	f	file:
+vmm_do_migrate	mm/vmm.c	/^static inline error_t vmm_do_migrate(struct vm_region_s *region, pmm_page_info_t *pinfo, uint_t vaddr)$/;"	f	file:
+vmm_do_munmap	mm/vmm.c	/^error_t vmm_do_munmap(struct vmm_s *vmm, struct vm_region_s *region, uint_t addr, uint_t length)$/;"	f
+vmm_do_shared_anon_mapping	mm/vmm.c	/^error_t vmm_do_shared_anon_mapping(struct vm_region_s *region)$/;"	f
+vmm_dup	mm/vmm.c	/^error_t vmm_dup(struct vmm_s *dst, struct vmm_s *src)$/;"	f
+vmm_error_t	mm/vmm.h	/^}vmm_error_t;$/;"	t	typeref:enum:__anon50
+vmm_fault_handler	mm/vmm.c	/^error_t vmm_fault_handler(uint_t bad_vaddr, uint_t flags)$/;"	f
+vmm_get_task	mm/vmm.h	/^#define vmm_get_task(/;"	d
+vmm_get_task	mm/vmm.h	/^#undef vmm_get_task$/;"	d
+vmm_init	mm/vmm.c	/^error_t vmm_init(struct vmm_s *vmm)$/;"	f
+vmm_inval_shared_page	mm/vmm.c	/^error_t vmm_inval_shared_page(struct vm_region_s *region, vma_t vaddr, ppn_t ppn)$/;"	f
+vmm_keysdb_update	mm/vmm.c	/^void vmm_keysdb_update(struct vmm_s *vmm, struct vm_region_s *region, uint_t vaddr)$/;"	f
+vmm_madvise_migrate	mm/vmm.c	/^error_t vmm_madvise_migrate(struct vmm_s *vmm, uint_t start, uint_t len)$/;"	f
+vmm_madvise_willneed	mm/vmm.c	/^error_t vmm_madvise_willneed(struct vmm_s *vmm, uint_t start, uint_t len)$/;"	f
+vmm_migrate_shared_page_seq	mm/vmm.c	/^error_t vmm_migrate_shared_page_seq(struct vm_region_s *region, struct page_s *page, struct page_s **new)$/;"	f
+vmm_mmap	mm/vmm.c	/^void *vmm_mmap(struct task_s *task, $/;"	f
+vmm_munmap	mm/vmm.c	/^error_t vmm_munmap(struct vmm_s *vmm, uint_t vaddr, uint_t length)$/;"	f
+vmm_reg_dmsg	kern/kdmsg.h	/^#define vmm_reg_dmsg(/;"	d
+vmm_s	mm/vmm.h	/^struct vmm_s$/;"	s
+vmm_sbrk	mm/vmm.c	/^error_t vmm_sbrk(struct vmm_s *vmm, uint_t current, uint_t size)$/;"	f
+vmm_set_auto_migrate	mm/vmm.c	/^error_t vmm_set_auto_migrate(struct vmm_s *vmm, uint_t start, uint_t flags)$/;"	f
+vmm_update_shared_page	mm/vmm.c	/^error_t vmm_update_shared_page(struct vm_region_s *region, vma_t vaddr, ppn_t ppn)$/;"	f
+wait	kern/blkio.h	/^		struct wait_queue_s wait;$/;"	m	struct:blkio_s::__anon7	typeref:struct:blkio_s::__anon7::wait_queue_s
+wait_lock	mm/ppm.h	/^	spinlock_t wait_lock;$/;"	m	struct:ppm_s
+wait_on	kern/wait_queue.c	/^error_t wait_on(struct wait_queue_s *queue, uint_t order)$/;"	f
+wait_queue	drivers/ibmpc/tty.h	/^	struct wait_queue_s wait_queue;$/;"	m	struct:tty_context_s	typeref:struct:tty_context_s::wait_queue_s
+wait_queue	drivers/soclib/soclib_tty.c	/^	struct wait_queue_s wait_queue;$/;"	m	struct:tty_context_s	typeref:struct:tty_context_s::wait_queue_s	file:
+wait_queue	kern/cond_var.h	/^	struct wait_queue_s wait_queue;$/;"	m	struct:cv_s	typeref:struct:cv_s::wait_queue_s
+wait_queue	kern/semaphore.h	/^	struct wait_queue_s wait_queue;$/;"	m	struct:semaphore_s	typeref:struct:semaphore_s::wait_queue_s
+wait_queue	kern/thread.h	/^	struct wait_queue_s wait_queue;$/;"	m	struct:thread_info	typeref:struct:thread_info::wait_queue_s
+wait_queue	kern/time.h	/^	struct list_entry wait_queue;$/;"	m	struct:alarm_s	typeref:struct:alarm_s::list_entry
+wait_queue	mm/page.h	/^	struct wait_queue_s wait_queue;$/;"	m	struct:page_s	typeref:struct:page_s::wait_queue_s
+wait_queue_db_s	kern/barrier.c	/^struct wait_queue_db_s$/;"	s	file:
+wait_queue_destroy	kern/wait_queue.h	/^static inline void wait_queue_destroy(struct wait_queue_s *queue)$/;"	f
+wait_queue_init	kern/wait_queue.h	/^static inline void wait_queue_init(struct wait_queue_s *queue, const char* name)$/;"	f
+wait_queue_init2	kern/wait_queue.h	/^static inline void wait_queue_init2(struct wait_queue_s *queue, struct wait_queue_s *another)$/;"	f
+wait_queue_isEmpty	kern/wait_queue.h	/^static inline uint_t wait_queue_isEmpty(struct wait_queue_s *queue)$/;"	f
+wait_queue_s	kern/wait_queue.h	/^struct wait_queue_s$/;"	s
+wait_tbl	mm/ppm.h	/^	struct wait_queue_s wait_tbl[PPM_MAX_WAIT];$/;"	m	struct:ppm_s	typeref:struct:ppm_s::wait_queue_s
+waiting	kern/barrier.h	/^		atomic_t waiting;$/;"	m	union:barrier_s::__anon5
+waker	kern/thread.h	/^	struct thread_s *waker;$/;"	m	struct:thread_info	typeref:struct:thread_info::thread_s
+wakeup	kern/scheduler.h	/^	sched_wakeup_t      *wakeup;$/;"	m	struct:sched_ops_s
+wakeup_all	kern/wait_queue.c	/^uint_t wakeup_all(struct wait_queue_s *queue)$/;"	f
+wakeup_date	kern/thread.h	/^	uint_t wakeup_date;                 \/*! wakeup date in seconds *\/$/;"	m	struct:thread_info
+wakeup_one	kern/wait_queue.c	/^struct thread_s* wakeup_one(struct wait_queue_s *queue, uint_t order)$/;"	f
+with_cpu_clstr_nr	libk/arch-bib.h	/^	uint16_t   with_cpu_clstr_nr;	\/\/FG$/;"	m	struct:arch_bib_header_s
+working_rpc_thread	kern/cpu.h	/^	uint_t working_rpc_thread;	\/\/synchro. by disabling interrupt$/;"	m	struct:cpu_s
+wq_dmsg	kern/wait_queue.c	/^#define wq_dmsg(/;"	d	file:
+wqdb_kmem_init	kern/barrier.h	/^KMEM_OBJATTR_INIT(wqdb_kmem_init);$/;"	v
+wqdb_record_s	kern/barrier.c	/^typedef struct wqdb_record_s$/;"	s	file:
+wqdb_record_t	kern/barrier.c	/^} wqdb_record_t;$/;"	t	typeref:struct:wqdb_record_s	file:
+wqdb_t	kern/barrier.c	/^typedef struct wait_queue_db_s wqdb_t;$/;"	t	typeref:struct:wait_queue_db_s	file:
+wqdb_tbl	kern/barrier.h	/^	struct wait_queue_db_s *wqdb_tbl[BARRIER_WQDB_NR];$/;"	m	struct:barrier_s	typeref:struct:barrier_s::wait_queue_db_s
+wr_count	fs/fat32/fat32_access.c	/^uint32_t wr_count     ;$/;"	v
+wr_wait_queue	kern/rwlock.h	/^	struct wait_queue_s wr_wait_queue;$/;"	m	struct:rwlock_s	typeref:struct:rwlock_s::wait_queue_s
+wridx	kern/kfifo.h	/^		volatile uint_t wridx;$/;"	m	union:kfifo_s::__anon19
+wridx	kern/remote_fifo.h	/^		volatile uint_t wridx;$/;"	m	union:remote_fifo_s::__anon26
+write	fs/sysfs/sysfs.h	/^	sysfs_request_func_t *write;$/;"	m	struct:sysfs_op_s
+write	kern/driver.h	/^	device_request_t *write;$/;"	m	struct:dev_icu_op
+write	kern/driver.h	/^	device_request_t *write;$/;"	m	struct:dev_op
+write	vfs/vfs.h	/^	vfs_write_file_t *write;$/;"	m	struct:vfs_file_op_s
+write	vfs/vfs.h	/^	vfs_write_inode_t *write;$/;"	m	struct:vfs_inode_op_s
+write_ptr	kern/mwmr.c	/^	uint_t write_ptr;$/;"	m	struct:fifomwmr_s	file:
+write_root	vfs/vfs.h	/^	vfs_write_root_t *write_root;$/;"	m	struct:vfs_context_op_s
+writepage	mm/mapper.h	/^	mapper_write_page_t	    *writepage;$/;"	m	struct:mapper_op_s
+wti_vector	drivers/soclib/soclib_xicu.c	/^	struct irq_action_s *wti_vector[XICU_WTI_MAX];$/;"	m	struct:xicu_context_s	typeref:struct:xicu_context_s::irq_action_s	file:
+xSize	kern/driver.h	/^	uint_t xSize;$/;"	m	struct:dev_params_s
+x_coord	kern/cluster.h	/^	uint16_t x_coord;$/;"	m	struct:cluster_s
+x_max	libk/arch-bib.h	/^	uint16_t   x_max;$/;"	m	struct:arch_bib_header_s
+x_size	ksh/sgiImg.h	/^  uint16_t   x_size;$/;"	m	struct:sgi_info_s
+xicu	arch/tsar/arch.h	/^	struct device_s *xicu;$/;"	m	struct:arch_entry_s	typeref:struct:arch_entry_s::device_s
+xicu_cntr_info_s	drivers/soclib/soclib_xicu.c	/^typedef struct xicu_cntr_info_s$/;"	s	file:
+xicu_cntr_info_t	drivers/soclib/soclib_xicu.c	/^}xicu_cntr_info_t;$/;"	t	typeref:struct:xicu_cntr_info_s	file:
+xicu_context_s	drivers/soclib/soclib_xicu.c	/^struct xicu_context_s$/;"	s	file:
+xicu_count	drivers/soclib/soclib_xicu.c	/^static uint_t xicu_count = 0;$/;"	v	file:
+xicu_default_irq_handler	drivers/soclib/soclib_xicu.c	/^static void xicu_default_irq_handler(struct device_s *icu, uint_t irq_num, uint_t output_irq)$/;"	f	file:
+xicu_dmsg	drivers/soclib/soclib_xicu.c	/^#define xicu_dmsg(/;"	d	file:
+xicu_file_op	drivers/soclib/soclib_xicu.c	/^static sint_t xicu_file_op(struct device_s *icu, dev_request_t *rq)$/;"	f	file:
+xicu_get_highest_irq	drivers/soclib/soclib_xicu.c	/^sint_t xicu_get_highest_irq(struct device_s *icu, uint_t type, uint_t output_irq)$/;"	f
+xicu_get_mask	drivers/soclib/soclib_xicu.c	/^static uint_t xicu_get_mask(struct device_s *icu, uint_t type, uint_t output_irq)$/;"	f	file:
+xicu_irq_handler	drivers/soclib/soclib_xicu.c	/^void xicu_irq_handler (struct irq_action_s *action)$/;"	f
+xicu_mmap	drivers/soclib/soclib_xicu.c	/^static error_t xicu_mmap(struct device_s *icu, dev_request_t *rq)$/;"	f	file:
+xicu_munmap	drivers/soclib/soclib_xicu.c	/^static error_t xicu_munmap(struct device_s *icu, dev_request_t *rq)$/;"	f	file:
+xicu_open_op	drivers/soclib/soclib_xicu.c	/^static sint_t xicu_open_op(struct device_s *icu, dev_request_t *rq)$/;"	f	file:
+xicu_params_op	drivers/soclib/soclib_xicu.c	/^static sint_t xicu_params_op(struct device_s *icu, dev_params_t *params)$/;"	f	file:
+xicu_reg_read	drivers/soclib/soclib_xicu.c	/^static inline uint_t xicu_reg_read(volatile void *base, uint_t func, uint_t id)$/;"	f	file:
+xicu_reg_write	drivers/soclib/soclib_xicu.c	/^static inline void xicu_reg_write(volatile void *base, cid_t base_cid, uint_t func, uint_t id, uint32_t val)$/;"	f	file:
+xicu_set_mask	drivers/soclib/soclib_xicu.c	/^static void xicu_set_mask(struct device_s *icu, uint_t mask, uint_t type, uint_t output_irq)$/;"	f	file:
+xicu_timer_irq_handler	drivers/soclib/soclib_xicu.c	/^void xicu_timer_irq_handler (struct device_s *xicu, uint_t output_irq)$/;"	f
+ySize	kern/driver.h	/^	uint_t ySize;$/;"	m	struct:dev_params_s
+y_coord	kern/cluster.h	/^	uint16_t y_coord;$/;"	m	struct:cluster_s
+y_max	libk/arch-bib.h	/^	uint16_t   y_max;$/;"	m	struct:arch_bib_header_s
+y_size	ksh/sgiImg.h	/^  uint16_t   y_size;$/;"	m	struct:sgi_info_s
+yes	libk/config.h	/^#define yes /;"	d
+yield	kern/scheduler.h	/^	sched_yield_t       *yield;$/;"	m	struct:sched_ops_s
+z_coord	kern/cluster.h	/^	uint16_t z_coord;$/;"	m	struct:cluster_s
+z_size	ksh/sgiImg.h	/^  uint16_t   z_size;$/;"	m	struct:sgi_info_s
Index: trunk/kernel/vfs/fatfs.c
===================================================================
--- trunk/kernel/vfs/fatfs.c	(revision 1)
+++ trunk/kernel/vfs/fatfs.c	(revision 1)
@@ -0,0 +1,291 @@
+/*
+ * fatfs.c - FATFS file system API implementation.
+ *
+ * Author    Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <hal_types.h>
+#include <hal_special.h>
+#include <printk.h>
+#include <kmem.h>
+#include <ppm.h>
+#include <vfs.h>
+#include <rpc.h>
+#include <mapper.h>
+#include <dev_ioc.h>
+#include <fatfs.h>
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////
+// FATFS specific functions : these functions cannot be called by the VFS 
+//////////////////////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////
+inline uint32_t fatfs_lba_from_cluster( fatfs_ctx_t * ctx,
+                                        uint32_t      cluster )
+{
+    return (ctx->cluster_begin_lba + ((cluster - 2) * ctx->sectors_per_cluster));
+}
+
+/////////////////////////////////////////////
+error_t fatfs_get_cluster( mapper_t * mapper,
+                           uint32_t   first_cluster,
+                           uint32_t   searched_page,
+                           uint32_t * cluster )
+{
+    page_t   * current_page_desc;      // pointer on current page descriptor
+    uint32_t * current_page_buffer;    // pointer on current page (array of uint32_t)
+    uint32_t   current_page_index;     // index of current page in mapper 
+    uint32_t   current_page_offset;    // offset of slot in current page
+    uint32_t   page_count_in_file;     // index of page in file (index in linked list)
+    uint32_t   current_cluster;        // content of current FAT slot
+
+    // compute number of FAT slots per PPM page
+    uint32_t slots_per_page = CONFIG_PPM_PAGE_SIZE >> 2;
+
+    // initialize loop variable
+    current_page_index  = first_cluster / slots_per_page;
+    current_page_offset = first_cluster % slots_per_page;
+    page_count_in_file  = 0;
+
+    // scan FAT (i.e. traverse FAT linked list)
+    while( page_count_in_file <= searched_page )
+    {
+        // get pointer on current page descriptor
+        current_page_desc = mapper_get_page( mapper , current_page_index );
+
+        if( current_page_desc == NULL ) return EIO;
+
+        // get pointer on buffer for current page
+        current_page_buffer = (uint32_t *)ppm_page2base( current_page_desc );
+
+        // get FAT slot content 
+        current_cluster = current_page_buffer[current_page_offset];
+
+        // update loop variables
+        current_page_index  = current_cluster / slots_per_page;
+        current_page_offset = current_cluster % slots_per_page;
+        page_count_in_file++;
+    }
+    
+    // return success
+    *cluster = current_cluster;
+    return 0;
+
+}  // end fatfs_get_cluster()
+
+
+////////////////////////////////////////////////////////////////////////////////////////
+// This function returns the FATFS cluster index of a page identified by its page
+// index in the file, using the FAT mapper. It scans the FAT mapper, starting from the
+// FATFS cluster index allocated to the first page of the file, until it reaches the 
+// searched page. The FAT mapper is automatically updated in case of miss. 
+// This function can be called by any thread running in any cluster, as it uses the
+// RPC_FATFS_GET_CLUSTER to access the remote FAT mapper if required.
+// We use a RPC to scan the FAT because the RPC_FIFO will avoid contention
+// in the cluster containing the FAT mapper, and the RPC latency is not critical
+// compared to the device access latency.
+////////////////////////////////////////////////////////////////////////////////////////
+// @ ctx	       : pointer on local FATFS context.
+// @ first_cluster : first cluster allocated to a file in FATFS.
+// @ page_index    : index of searched page in file (one page occupies one cluster).
+// @ cluster_index : [out] pointer on buffer for FATFS cluster index.
+// @ return 0 if success / return EIO if a FAT cluster miss cannot be solved.
+////////////////////////////////////////////////////////////////////////////////////////
+static error_t fatfs_cluster_from_index( fatfs_ctx_t * ctx,
+                                         uint32_t      first_cluster,
+                                         uint32_t      page_index,
+                                         uint32_t    * cluster_index )
+{
+    uint32_t searched_cluster;   // searched FATFS cluster index
+    error_t  error;
+
+    // get extended pointer on FAT mapper
+    xptr_t fat_mapper_xp = ctx->fat_mapper_xp;
+
+    // get cluster cxy and local pointer on FAT mapper
+    cxy_t      fat_mapper_cxy = GET_CXY( fat_mapper_xp );
+    mapper_t * fat_mapper_ptr = (mapper_t *)GET_PTR( fat_mapper_xp );
+
+    if( fat_mapper_cxy == local_cxy )    // FAT mapper is local
+    {
+        error = fatfs_get_cluster( fat_mapper_ptr,
+                                   first_cluster,
+                                   page_index,
+                                   &searched_cluster );
+    }
+    else                                 // FAT mapper is remote
+    {
+        rpc_fatfs_get_cluster_client( fat_mapper_cxy,
+                                      fat_mapper_ptr,
+                                      first_cluster,
+                                      page_index,
+                                      &searched_cluster,
+                                      &error );
+    }
+    
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot access FAT\n", __FUNCTION__ );
+        return error;
+    }
+
+    // return success
+    *cluster_index = searched_cluster;
+    return 0;
+
+}  // end fatfs_cluster_from_index()
+
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+// Generic API : the following functions are called by the VFS, 
+//               and must be defined by all isupported file systems.
+///////////////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+error_t fatfs_inode_create( struct vfs_inode_s * vfs_inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    kmem_req_t      req;
+    fatfs_inode_t * fatfs_inode;
+
+    // allocate memory for fatfs inode
+	req.type    = KMEM_FATFS_INODE;
+	req.size    = sizeof(fatfs_inode_t);
+    req.flags   = AF_KERNEL | AF_ZERO;
+	fatfs_inode = (fatfs_inode_t *)kmem_alloc( &req );
+
+    if( fatfs_inode == NULL ) return ENOMEM;
+
+    // initialise ramfs_inode 
+    fatfs_inode->first_cluster = 0;   // TODO ???
+    fatfs_inode->ctx           = (fatfs_ctx_t *)vfs_inode->ctx->extend;
+ 
+    // link fatfs_inode to vfs_inode
+    vfs_inode->extend = fatfs_inode;
+
+    return 0;
+
+}
+
+//////////////////////////////////////////////////////
+void fatfs_inode_destroy( struct vfs_inode_s * inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+}
+
+//////////////////////////////////////////////////
+error_t fatfs_ctx_create( struct vfs_ctx_s * ctx )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    return 0;
+}
+
+////////////////////////////////////////////////
+void fatfs_ctx_destroy( struct vfs_ctx_s * ctx )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+}
+
+////////////////////////////////////////////////
+static error_t fatfs_access_page( page_t * page,
+                                  bool_t   is_read )
+{
+    // get source buffer base address
+    char * buffer = (char *)ppm_page2base( page );
+ 
+    // get pointer on source mapper and page index from page descriptor
+    mapper_t * src_mapper  = page->mapper;
+    uint32_t   page_index  = page->index;
+
+    if( src_mapper == NULL)
+    {
+        printk("\n[PANIC] in %s : no mapper for this page\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get VFS inode pointer from mapper
+    vfs_inode_t * vfs_inode = src_mapper->inode;
+
+    // get FATFS inode pointer for VFS inode
+    fatfs_inode_t * fatfs_inode = (fatfs_inode_t *)vfs_inode->extend;
+
+    // get first cluster index from FATFS inode
+    uint32_t  first_cluster = fatfs_inode->first_cluster;
+
+    // get FATFS context pointer from FATFS inode
+    fatfs_ctx_t * fatfs_ctx = fatfs_inode->ctx;
+
+    // get number of sectors 
+    uint32_t count = fatfs_ctx->sectors_per_cluster;
+
+    // compute FATFS_cluster index for the accessed page
+    uint32_t cluster;
+    error_t  error = fatfs_cluster_from_index( fatfs_ctx,
+                                               first_cluster,
+                                               page_index,
+                                               &cluster );
+    if( error ) return EIO;
+
+    // get lba from cluster
+    uint32_t lba = fatfs_lba_from_cluster( fatfs_ctx , cluster );
+
+    // access device
+    if( is_read ) error = dev_ioc_read ( buffer , lba , count );
+    else          error = dev_ioc_write( buffer , lba , count );     
+
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot access IOC device\n", __FUNCTION__ );
+        return error;
+    } 
+
+    // successful access 
+    return 0;
+}
+
+////////////////////////////////////////////////
+error_t fatfs_write_page( struct page_s * page )
+{
+    bool_t is_read = false;
+    return fatfs_access_page( page , is_read );
+}
+
+///////////////////////////////////////////////
+error_t fatfs_read_page( struct page_s * page )
+{
+    bool_t is_read = true;
+    return fatfs_access_page( page , is_read );
+}
+
Index: trunk/kernel/vfs/fatfs.h
===================================================================
--- trunk/kernel/vfs/fatfs.h	(revision 1)
+++ trunk/kernel/vfs/fatfs.h	(revision 1)
@@ -0,0 +1,162 @@
+/*
+ * fatfs.h - FATFS file system API definition.
+ *
+ * Author    Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _FATFS_H_
+#define _FATFS_H_
+
+#include <hal_types.h>
+#include <rwlock.h>
+
+/****  Forward declarations  ****/
+
+struct mapper_s;
+struct device_s;
+struct vfs_inode_s;
+struct vfs_ctx_s;
+struct page_s;
+
+/*****************************************************************************************
+ * This structure defines a FATFS specific context extension. 
+ ****************************************************************************************/
+
+typedef struct fatfs_ctx_s
+{
+    rwlock_t          lock;                  /*! TODO protect what ???                  */
+    uint32_t          fat_begin_lba;         /*! first lba of FAT region                */
+    uint32_t          fat_sectors_count;     /*! number of sectors in FAT region        */
+    uint32_t          bytes_per_sector;      /*!                                        */
+    uint32_t          bytes_per_cluster;     /*!                                        */
+    uint32_t          cluster_begin_lba;     /*! first lba of data region on device     */
+    uint32_t          sectors_per_cluster;   /*!                                        */
+    uint32_t          rootdir_first_cluster; /*                                         */
+    uint32_t          last_allocated_sector; /*!                                        */
+    uint32_t          last_allocated_index;  /*! TODO last allocated cluster ???        */
+    xptr_t            fat_mapper_xp;         /*! FAT mapper (in IO cluster)             */ 
+}
+fatfs_ctx_t;
+
+/*****************************************************************************************
+ * This structure defines the FAT specific inode extension (versus the VFS inode).
+ ****************************************************************************************/
+
+typedef struct fatfs_inode_s
+{
+    struct fatfs_ctx_s * ctx;                /*! local pointer on the FATFS context     */ 
+	uint32_t             first_cluster;      /*! first cluster for this file/dir        */ 
+}
+fatfs_inode_t;
+
+
+
+/*****************************************************************************************
+ * This function returns the LBA of the first sector of a FAT cluster.
+ * This function can be called by any thread running in any cluster.
+ *****************************************************************************************
+ * @ ctx	  :	pointer on FATFS context.
+ * @ cluster  :	cluster index in FATFS.
+ * # return the lba value.
+ ****************************************************************************************/
+inline uint32_t fatfs_lba_from_cluster( fatfs_ctx_t * ctx,
+                                        uint32_t      cluster );
+
+/*****************************************************************************************
+ * This function scan the FAT (File Allocation Table), stored in the FAT mapper,
+ * and return the FATFS cluster index for a given page of a given file.
+ * It must be called by a thread running in the cluster containing the FAT mapper
+ * (can be a local thread or a RPC thread).
+ * The FAT is actually an array of uint32_t slots. Each slot in this array contains the 
+ * index of another slot in this array, to form one linked list for each file stored on
+ * device in the RAMFS file system. This index in the FAT array is also the index of the
+ * FATFS cluster on the device. One FATFS cluster is supposed to contain one PPM page. 
+ * For a given file, the entry point in the FAT is simply the index of the FATFS cluster 
+ * containing the first page of the file. The mapper being a cache, this function 
+ * automatically updates the FAT mapper from informations stored on device in case of miss.
+ *****************************************************************************************
+ * @ mapper	 : local pointer on the FAT mapper.
+ * @ first	 : index of the first FATFS cluster allocated to the file.
+ * @ page    : index of searched page in the file.
+ * @ cluster : [out] pointer on buffer for the found FATFS cluster index.
+ * @ return 0 if success / return EIO if FAT mapper miss cannot be solved.
+ ****************************************************************************************/
+error_t fatfs_get_cluster( struct mapper_s * mapper,
+                           uint32_t          first_cluster,
+                           uint32_t          searched_page,
+                           uint32_t        * cluster );
+
+/*****************************************************************************************
+ * This function allocates memory for a FATFS inode, initializes it,
+ * and link it to the VFS inode.
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ * @ return 0 if success / return ENOMEM if error. 
+ ****************************************************************************************/
+error_t fatfs_inode_create( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function releases memory allocated for a FATFS inode.
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ ****************************************************************************************/
+void fatfs_inode_destroy( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function allocates memory for a FATFS context, initialises it, 
+ * and link it to the local VFS context.
+ *****************************************************************************************
+ * @ inode   : local pointer on VFS context.
+ * @ return 0 if success / return ENOMEM if error. 
+ ****************************************************************************************/
+error_t fatfs_ctx_create( struct vfs_ctx_s * ctx );
+
+/*****************************************************************************************
+ * This function releases memory allocated for a FATFS context.
+ *****************************************************************************************
+ * @ ctx   : local pointer on VFS context.
+ ****************************************************************************************/
+void fatfs_ctx_destroy( struct vfs_ctx_s * ctx );
+
+/*****************************************************************************************
+ * This function moves a page from the mapper to the FATFS file system.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+ *****************************************************************************************
+ * @ page    : local pointer on page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t fatfs_write_page( struct page_s * page );
+
+/*****************************************************************************************
+ * This function moves a page from the FATFS file system on device to the mapper.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+ *****************************************************************************************
+ * @ page    : local pointer on page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t fatfs_read_page( struct page_s * page );
+
+
+#endif	/* _FATFS_H_ */
Index: trunk/kernel/vfs/ramfs.c
===================================================================
--- trunk/kernel/vfs/ramfs.c	(revision 1)
+++ trunk/kernel/vfs/ramfs.c	(revision 1)
@@ -0,0 +1,96 @@
+/*
+ * ramfs.c  RAMFS file system API implementation.
+ *
+ * Authors   Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <hal_types.h>
+#include <hal_special.h>
+#include <printk.h>
+#include <kmem.h>
+#include <vfs.h>
+#include <ramfs.h>
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// RAMFS specific functions : these static functions cannot be called by the VFS 
+///////////////////////////////////////////////////////////////////////////////////////
+
+
+
+///////////////////////////////////////////////////////////////////////////////////////
+// Generic API : the following functions are called by the VFS, 
+//               and must be defined by all supported file systems.
+///////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////
+error_t ramfs_inode_create( struct vfs_inode_s * vfs_inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    kmem_req_t      req;
+    ramfs_inode_t * ramfs_inode;
+
+    // allocate memory for ramfs inode
+	req.type    = KMEM_RAMFS_INODE;
+	req.size    = sizeof(ramfs_inode_t);
+    req.flags   = AF_KERNEL | AF_ZERO;
+	ramfs_inode = (ramfs_inode_t *)kmem_alloc( &req );
+
+    if( ramfs_inode == NULL ) return ENOMEM;
+
+    // initialise ramfs_inode TODO
+
+    // link vfs_inode to ramfs_inode
+    vfs_inode->extend = ramfs_inode;
+
+    return 0;
+}
+
+//////////////////////////////////////////////////////
+void ramfs_inode_destroy( struct vfs_inode_s * inode )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    return 0;
+}
+
+/////////////////////////////////////////////////
+error_t ramfs_write_page( struct page_s  * page )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    return 0;
+}
+
+////////////////////////////////////////////////
+error_t ramfs_read_page( struct page_s  * page )
+{
+    printk("\n[PANIC] %s not fully implemented yet\n", __FUNCTION__ );
+    hal_core_sleep();
+
+    return 0;
+}
+   
Index: trunk/kernel/vfs/ramfs.h
===================================================================
--- trunk/kernel/vfs/ramfs.h	(revision 1)
+++ trunk/kernel/vfs/ramfs.h	(revision 1)
@@ -0,0 +1,96 @@
+/*
+ * ramfs.h  RAMFS file system API definition.
+ *
+ * Authors   Mohamed Lamine Karaoui (2015)
+ *           Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _RAMFS_H_
+#define _RAMFS_H_
+
+/****  Forward declarations  ****/
+
+struct vfs_inode_s;
+struct page_s;
+
+/*****************************************************************************************
+ * This structure defines a RAMFS specific context extension. 
+ ****************************************************************************************/
+
+typedef struct ramfs_ctx_s
+{
+    intptr_t          base;                                                                 
+    rwlock_t          size;
+}
+ramfs_ctx_t;
+
+/*****************************************************************************************
+ * This structure defines the RAMFS inode specific extension (versus the VFS inode).
+ ****************************************************************************************/
+
+typedef struct ramfs_inode_s
+{
+    struct vfs_inode_s * vfs_inode;   /*! local pointer on VFS inode                    */
+}
+ramfs_inode_t;
+
+
+
+
+/*****************************************************************************************
+ * This function allocates memory for a RAMFS inode, and link it to the VFS inode.
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ * @ return 0 if success / return ENOMEM if error. 
+ ****************************************************************************************/
+error_t ramfs_inode_create( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function releases memory allocated for a RAMFS inode.
+ *****************************************************************************************
+ * @ inode   : local pointer on vfs_inode.
+ ****************************************************************************************/
+void ramfs_inode_destroy( struct vfs_inode_s * inode );
+
+/*****************************************************************************************
+ * This function moves a page from the mapper to the RAMFS file system.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+******************************************************************************************
+ * @ page    : local pointer on source page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t ramfs_write_page( struct page_s  * page );
+
+/*****************************************************************************************
+ * This function moves a page from the RAMFS file system to the mapper.
+ * It must be called by a thread running in cluster containing the mapper.
+ * The pointer on the mapper and the page index in file are supposed to be registered
+ * in the page descriptor. 
+ *****************************************************************************************
+ * @ page    : local pointer on destination page descriptor.
+ * @ return 0 if success / return EIO if error. 
+ ****************************************************************************************/
+error_t ramfs_read_page( struct page_s  * page );
+
+
+   
+#endif	/* _RAMFS_H_ */
Index: trunk/kernel/vfs/vfs.c
===================================================================
--- trunk/kernel/vfs/vfs.c	(revision 1)
+++ trunk/kernel/vfs/vfs.c	(revision 1)
@@ -0,0 +1,926 @@
+/*
+ * vfs.c - Virtual File System implementation.
+ *
+ * Author  Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <hal_atomic.h>
+#include <hal_special.h>
+#include <readlock.h>
+#include <spinlock.h>
+#include <printk.h>
+#include <list.h>
+#include <xlist.h>
+#include <slist.h>
+#include <xhtab.h>
+#include <errno.h>
+#include <kmem.h>
+#include <mapper.h>
+#include <thread.h>
+#include <process.h>
+#include <fatfs.h>
+#include <ramfs.h>
+#include <vfs.h>
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//           Global variables         
+//////////////////////////////////////////////////////////////////////////////////////////
+
+// array of supported FS contexts (indexed by the FS type)
+vfs_ctx_t   fs_context[FS_TYPES_NR];
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//           Context related functions
+//////////////////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////
+error_t vfs_ctx_inum_alloc( vfs_ctx_t * ctx,
+                            uint32_t  * inum )
+{
+    // get lock on inum allocator
+    spinlock_lock( &ctx->lock );
+
+    // get lid from local inum allocator
+    uint32_t lid = bitmap_ffc( ctx->inum , CONFIG_VFS_MAX_INODES );
+
+    if( lid == -1 )   // no more free slot => error
+    {
+        // release lock
+        spinlock_unlock( &ctx->lock );
+
+        // return error
+        return 1;
+    }
+    else              // found => return inum
+    {
+        // set slot allocated
+        bitmap_set( ctx->inum , lid );
+
+        // release lock
+        spinlock_unlock( &ctx->lock );
+
+        // return inum
+        *inum = (((uint32_t)local_cxy) << 16) | (lid & 0xFFFF);
+        return 0;
+    }
+}
+
+////////////////////////////////////////////
+void vfs_ctx_inum_release( vfs_ctx_t * ctx,
+                           uint32_t    inum )
+{
+    bitmap_clear( ctx->inum , inum & 0xFFFF ); 
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//           Inode related functions
+//////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////
+error_t vfs_inode_create( xptr_t      dentry_xp,
+                          uint32_t    type,
+                          uint32_t    attr,
+                          uint32_t    mode,
+                          uid_t       uid,
+                          gid_t       gid,
+                          xptr_t    * inode_xp )
+{
+    mapper_t         * mapper;     // associated mapper( to be allocated)
+    vfs_inode_t      * inode;      // inode descriptor (to be allocated)
+    uint32_t           inum;       // inode identifier (to be allocated)
+    vfs_ctx_t        * ctx;        // file system context 
+	kmem_req_t         req;        // request to kernel memory allocator
+    error_t            error;
+
+    // check type and get pointer on context
+    if     ( type == FS_TYPE_FATFS ) ctx = &fs_context[FS_TYPE_FATFS];
+    else if( type == FS_TYPE_RAMFS ) ctx = &fs_context[FS_TYPE_RAMFS];
+    else
+    {
+        ctx = NULL;
+        printk("\n[PANIC] in %s : undefined file system type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // allocate inum
+    error = vfs_ctx_inum_alloc( ctx , &inum );
+
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot allocate inum\n", __FUNCTION__ );
+        return ENOMEM;
+    }
+
+    // allocate memory for mapper
+    mapper = mapper_create();
+
+    if( mapper == NULL )
+    {
+        printk("\n[ERROR] in %s : cannot allocate mapper\n", __FUNCTION__ );
+        vfs_ctx_inum_release( ctx , inum );
+        return ENOMEM;
+    }
+
+    // allocate memory for inode descriptor
+	req.type  = KMEM_VFS_INODE;
+	req.size  = sizeof(vfs_inode_t);
+    req.flags = AF_KERNEL | AF_ZERO;
+	inode     = (vfs_inode_t *)kmem_alloc( &req );
+
+    if( inode == NULL )
+    {
+        printk("\n[ERROR] in %s : cannot allocate inode descriptor\n", __FUNCTION__ );
+        vfs_ctx_inum_release( ctx , inum );
+        mapper_destroy( mapper );
+        return ENOMEM;
+    }
+
+    // initialize inode descriptor
+    inode->gc         = 0;
+    inode->inum       = inum;
+    inode->attr       = attr;
+    inode->mode       = mode;
+    inode->uid        = uid;
+    inode->gid        = gid;
+    inode->refcount   = 0;
+    inode->parent_xp  = dentry_xp;
+    inode->ctx        = ctx;
+    inode->mapper     = NULL;  
+
+    // initialise threads waiting queue
+    xlist_root_init( XPTR( local_cxy , &inode->wait_root ) );
+
+    // initialize dentries hash table, if new inode is a directory
+    if( attr & INODE_ATTR_DIR )  xhtab_init( &inode->children , XHTAB_DENTRY_TYPE );
+
+    // initialize inode locks 
+    remote_rwlock_init( XPTR( local_cxy , &inode->size_lock ) );
+    remote_spinlock_init( XPTR( local_cxy , &inode->main_lock ) );
+
+    // create FS specific inode
+    if     ( ctx->type == FS_TYPE_FATFS )  fatfs_inode_create( inode );
+    else if( ctx->type == FS_TYPE_RAMFS )  ramfs_inode_create( inode );
+
+    // return extended pointer on inode
+    *inode_xp = XPTR( local_cxy , inode );
+    return 0;
+
+}  // end vfs_inode_create()  
+
+/////////////////////////////////////////////
+void vfs_inode_destroy( vfs_inode_t * inode )
+{
+    if( inode->refcount )
+    {
+        printk("\n[PANIC] in %s : inode refcount non zero\n", __FUNCTION__ );
+        hal_core_sleep(); 
+    }       
+
+    // release memory allocated for mapper
+    mapper_destroy( inode->mapper );
+
+    // release memory allocate for inode descriptor
+	kmem_req_t req;
+	req.ptr   = inode;
+	req.type  = KMEM_VFS_INODE;
+	kmem_free( &req );
+
+}  // end vfs_inode_destroy()
+
+////////////////////////////////////////////
+void vfs_inode_remote_up( xptr_t  inode_xp )
+{
+    // get inode cluster and local pointer
+    cxy_t         inode_cxy = GET_CXY( inode_xp );
+    vfs_inode_t * inode_ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    hal_remote_atomic_add( XPTR( inode_cxy , &inode_ptr->refcount ) , 1 );    
+}
+
+//////////////////////////////////////////////
+void vfs_inode_remote_down( xptr_t  inode_xp )
+{
+    // get inode cluster and local pointer
+    cxy_t         inode_cxy = GET_CXY( inode_xp );
+    vfs_inode_t * inode_ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    hal_remote_atomic_add( XPTR( inode_cxy , &inode_ptr->refcount ) , -1 );    
+}
+
+//////////////////////////////////////////////
+uint32_t vfs_inode_get_size( xptr_t inode_xp )
+{
+    // get inode cluster and local pointer
+    cxy_t         cxy = GET_CXY( inode_xp );
+    vfs_inode_t * ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    // get size
+    remote_rwlock_rd_lock( XPTR( cxy , &ptr->size_lock ) );
+    uint32_t size = hal_remote_lw( XPTR( cxy , &ptr->size ) );
+    remote_rwlock_rd_unlock( XPTR( cxy , &ptr->size_lock ) );
+    return size;
+}
+
+/////////////////////////////////////////////////
+void vfs_inode_size_set_size( xptr_t    inode_xp,
+                              uint32_t  size )
+{
+    // get inode cluster and local pointer
+    cxy_t         cxy = GET_CXY( inode_xp );
+    vfs_inode_t * ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    // set size
+    remote_rwlock_wr_unlock( XPTR( cxy , &ptr->size_lock ) );
+    hal_remote_sw( XPTR( cxy , &ptr->size ) , size );
+    remote_rwlock_wr_unlock( XPTR( cxy , &ptr->size_lock ) );
+}
+
+///////////////////////////////////////////////
+void vfs_inode_remote_unlock( xptr_t inode_xp )
+{
+    // get inode cluster and local pointer
+    cxy_t         cxy = GET_CXY( inode_xp );
+    vfs_inode_t * ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    // release the main lock
+    remote_spinlock_unlock( XPTR( cxy , &ptr->main_lock ) );
+}
+
+/////////////////////////////////////////////
+void vfs_inode_remote_lock( xptr_t inode_xp )
+{
+    // get inode cluster and local pointer
+    cxy_t         cxy = GET_CXY( inode_xp );
+    vfs_inode_t * ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    // get the main lock
+    remote_spinlock_lock( XPTR( cxy , &ptr->main_lock ) );
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//           Dentry related functions
+//////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////
+error_t vfs_dentry_create( uint32_t      type,
+                           char        * name,
+                           vfs_inode_t * parent,
+                           xptr_t      * dentry_xp )
+{
+    vfs_ctx_t      * ctx;        // context descriptor
+    vfs_dentry_t   * dentry;     // dentry descriptor (to be allocated)
+	kmem_req_t       req;        // request to kernel memory allocator
+    xptr_t           xhtab_xp;   // extended pointer on xhtab_t embedded in inode
+    xptr_t           xlist_xp;   // extended pointer on xlist_entry_t in dentry
+
+    // check type and get pointer on context
+    if     ( type == FS_TYPE_FATFS ) ctx = &fs_context[FS_TYPE_FATFS];
+    else if( type == FS_TYPE_RAMFS ) ctx = &fs_context[FS_TYPE_RAMFS];
+    else
+    {
+        ctx = NULL;
+        printk("\n[PANIC] in %s : undefined file system type\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // get name length
+    uint32_t length = strlen( name );
+
+    if( length > (CONFIG_VFS_MAX_NAME_LENGTH - 1) )
+    {
+        printk("\n[ERROR] in %s : name too long\n", __FUNCTION__ );
+        return EINVAL;
+    }
+
+    // allocate memory for dentry descriptor
+	req.type  = KMEM_VFS_DENTRY;
+	req.size  = sizeof(vfs_dentry_t);
+    req.flags = AF_KERNEL | AF_ZERO;
+	dentry     = (vfs_dentry_t *)kmem_alloc( &req );
+
+    if( dentry == NULL )
+    {
+        printk("\n[ERROR] in %s : cannot allocate dentry descriptor\n", __FUNCTION__ );
+        return ENOMEM;
+    }
+
+    // initialize dentry descriptor
+    dentry->ctx     = ctx;
+    dentry->length  = length;
+    dentry->parent  = parent;
+    strcpy( dentry->name , name );
+
+    // return extended pointer on dentry to caller
+    *dentry_xp = XPTR( local_cxy , dentry );
+
+    // register dentry in hash table rooted in parent inode
+    xhtab_xp    = XPTR( local_cxy , &parent->children );
+    xlist_xp    = XPTR( local_cxy , &dentry->xlist );
+    xhtab_register( xhtab_xp  , name , xlist_xp );
+    
+    return 0;
+
+}  // end vfs_dentry_create()
+
+////////////////////////////////////////////////
+void vfs_dentry_destroy( vfs_dentry_t * dentry )
+{
+    if( dentry->refcount )
+    {
+        printk("\n[PANIC] in %s : dentry refcount non zero\n", __FUNCTION__ );
+        hal_core_sleep(); 
+    }       
+
+	kmem_req_t req;
+	req.ptr   = dentry;
+	req.type  = KMEM_VFS_DENTRY;
+	kmem_free( &req );
+}
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//           File descriptor related functions
+//////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////
+void vfs_file_count_up( xptr_t file_xp )
+{
+    // get file cluster and local pointer
+    cxy_t        file_cxy = GET_CXY( file_xp );
+    vfs_file_t * file_ptr = (vfs_file_t *)GET_PTR( file_xp ); 
+
+    // atomically increment count
+    hal_remote_atomic_add( XPTR( file_cxy , &file_ptr->refcount ) , 1 ); 
+}
+
+//////////////////////////////////////////
+void vfs_file_count_down( xptr_t file_xp )
+{
+    // get file cluster and local pointer
+    cxy_t        file_cxy = GET_CXY( file_xp );
+    vfs_file_t * file_ptr = (vfs_file_t *)GET_PTR( file_xp ); 
+
+    // atomically decrement count
+    hal_remote_atomic_add( XPTR( file_cxy , &file_ptr->refcount ) , -1 ); 
+}
+
+////////////////////////////////////////////////
+error_t vfs_file_create( xptr_t        inode_xp,
+                         uint32_t      type,
+                         uint32_t      attr,
+                         xptr_t      * file_xp )  
+{
+    vfs_file_t  * file_ptr;
+	kmem_req_t    req;
+
+    // get inode cluster and local pointer
+    cxy_t         inode_cxy = GET_CXY( inode_xp );
+    vfs_inode_t * inode_ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    // check cluster identifier
+    if( inode_cxy != local_cxy )
+    {
+        printk("\n[PANIC] in %s : local cluster is not the inode owner\n", __FUNCTION__ );
+        hal_core_sleep();
+    }
+
+    // allocate memory for new file descriptor
+	req.type  = KMEM_VFS_FILE;
+	req.size  = sizeof(vfs_file_t);
+    req.flags = AF_KERNEL | AF_ZERO;
+	file_ptr  = (vfs_file_t *)kmem_alloc( &req );
+
+    if( file_ptr == NULL ) return ENOMEM;
+
+    // get inode local pointer
+    // initializes new file descriptor
+    file_ptr->gc       = 0;
+    file_ptr->type     = type;
+    file_ptr->attr     = attr;
+    file_ptr->offset   = 0;
+    file_ptr->refcount = 0;
+    file_ptr->inode    = inode_ptr;
+    file_ptr->ctx      = inode_ptr->ctx;
+    file_ptr->mapper   = inode_ptr->mapper;
+
+    remote_rwlock_init( XPTR( local_cxy , &file_ptr->lock ) );
+
+    *file_xp = XPTR( local_cxy , file_ptr );
+    return 0;
+}
+
+////////////////////////////////////////
+void vfs_file_destroy( xptr_t  file_xp )
+{
+    // get file cluster and local pointer
+    cxy_t        file_cxy = GET_CXY( file_xp );
+    vfs_file_t * file_ptr = (vfs_file_t *)GET_PTR( file_xp );
+
+    if( file_cxy != local_cxy )
+    {
+        printk("\n[PANIC] in %s : file descriptor not in local cluster\n", __FUNCTION__ );
+        hal_core_sleep(); 
+    }
+
+    if( file_ptr->refcount )
+    {
+        printk("\n[PANIC] in %s : file refcount non zero\n", __FUNCTION__ );
+        hal_core_sleep(); 
+    }       
+
+	kmem_req_t req;
+	req.ptr   = file_ptr;
+	req.type  = KMEM_VFS_FILE;
+	kmem_free( &req );
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//           File related functions
+//////////////////////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////
+error_t vfs_open( xptr_t     cwd_xp,
+		          char     * path,
+		          uint32_t   flags,
+		          xptr_t   * file_xp )
+{
+    return 0;
+}
+
+///////////////////////////////////
+uint32_t vfs_read( xptr_t   file_xp, 
+                   void   * buffer,
+                   uint32_t size )
+{
+    return 0;
+}
+
+////////////////////////////////////
+uint32_t vfs_write( xptr_t   file_xp,
+                    void   * buffer,
+                    uint32_t size )
+{
+    return 0;
+}
+
+//////////////////////////////////////
+error_t vfs_lseek( xptr_t     file_xp,
+                   uint32_t   offset,
+                   uint32_t   whence, 
+                   uint32_t * new_offset )
+{
+    return 0;
+}
+
+//////////////////////////////////////
+error_t vfs_close( xptr_t     file_xp, 
+                   uint32_t * refcount )
+{
+    return 0;
+}
+
+////////////////////////////////////
+error_t vfs_unlink( xptr_t   cwd_xp,
+                    char   * path )
+{
+    return 0;
+}
+
+//////////////////////////////////////
+error_t vfs_stat( xptr_t       file_xp,
+                  vfs_stat_t * stat )
+{
+    return 0;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//           Directory related functions
+//////////////////////////////////////////////////////////////////////////////////////////
+
+
+
+
+
+//////////////////////////////////////////////////////////////////////////////////////////
+//            Inode Tree functions
+//////////////////////////////////////////////////////////////////////////////////////////
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// This static function is used by the vfs_lookup() function.
+// It takes an extended pointer on a remote inode (parent directory inode),
+// and check access_rights violation for the calling thread.
+// It can be used by any thread running in any cluster.
+//////////////////////////////////////////////////////////////////////////////////////////
+// @ inode_xp    : extended pointer on inode.
+// @ client_uid  : client thread user ID
+// @ client_gid  : client thread group ID
+// @ return true if access rights are violated.
+//////////////////////////////////////////////////////////////////////////////////////////
+bool_t vfs_access_denied( xptr_t   inode_xp,
+                          uint32_t client_uid,
+                          uint32_t client_gid )
+{
+    // get found inode cluster and local pointer
+    cxy_t         inode_cxy = GET_CXY( inode_xp );
+    vfs_inode_t * inode_ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+    // get inode access mode, UID, and GID
+    // TODO uint32_t  mode = hal_remote_lw( XPTR( inode_cxy , &inode_ptr->mode ) );
+    uid_t     uid  = hal_remote_lw( XPTR( inode_cxy , &inode_ptr->uid  ) );
+    gid_t     gid  = hal_remote_lw( XPTR( inode_cxy , &inode_ptr->gid  ) );
+
+    // FIXME : me must use mode
+    if( (uid == client_uid) || (gid == client_gid) ) return false;
+    else                                             return true;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// This static function is used by the vfs_lookup() function.
+// It takes an extended pointer on a remote inode (parent directory inode), a directory 
+// entry name, and returns an extended pointer on the child inode. 
+// It can be used by any thread running in any cluster.
+//////////////////////////////////////////////////////////////////////////////////////////
+// @ parent_xp   : extended pointer on parent inode in remote cluster.
+// @ name        : dentry name
+// @ child_xp    : [out] buffer for extended pointer on child inode.
+// @ return true if success / return false if not found.
+//////////////////////////////////////////////////////////////////////////////////////////
+static bool_t vfs_get_child( xptr_t   parent_xp,
+                             char   * name,
+                             xptr_t * child_xp )
+{
+    xptr_t  xhtab_xp;    // extended pointer on hash table containing children dentries
+    xptr_t  dentry_xp;   // extended pointer on children dentry
+
+    // get parent inode cluster and local pointer
+    cxy_t         parent_cxy = GET_CXY( parent_xp );
+    vfs_inode_t * parent_ptr = (vfs_inode_t *)GET_PTR( parent_xp );
+
+    // get extended pointer on hash table of children directory entries
+    xhtab_xp = XPTR( parent_cxy , &parent_ptr->children );
+
+    // search extended pointer on matching dentry
+    dentry_xp = xhtab_lookup( xhtab_xp , name );
+
+    if( dentry_xp == XPTR_NULL ) return false;
+
+    // get dentry cluster and local pointer
+    cxy_t          dentry_cxy = GET_CXY( dentry_xp );
+    vfs_dentry_t * dentry_ptr = (vfs_dentry_t *)GET_PTR( dentry_xp );
+
+    // return child inode
+    *child_xp = (xptr_t)hal_remote_lwd( XPTR( dentry_cxy , &dentry_ptr->parent ) );
+    return true;
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// This static function is used by the vfs_lookup() function.
+// It takes the <current> pointer on a buffer containing a complete pathname, and return
+// in the <name> buffer, allocated by the caller, a single name in the path.
+// It return also in the <next> pointer the next character to analyse in the path.
+// Finally it returns a <last> boolean, that is true when the returned <name> is the
+// last name in the path. The names are supposed to be separated by one or several '/'
+// characters, that are not written in  the <name> buffer.
+//////////////////////////////////////////////////////////////////////////////////////////
+// @ current   : pointer on first character to analyse in buffer containing the path.
+// @ name      : [out] pointer on buffer allocated by the caller for the returned name.
+// @ next      : [out] pointer on next character to analyse in buffer containing the path.
+// @ last      : [out] true if the returned name is the last (NUL character found).
+// @ return 0 if success / return EINVAL if string empty (first chracter is NUL).
+//////////////////////////////////////////////////////////////////////////////////////////
+static error_t vfs_get_name_from_path( char     * current,
+                                       char     * name,
+                                       char    ** next,
+                                       bool_t   * last )
+{
+    char * ptr = current;
+
+    // skip leading '/' characters
+    while( *ptr == '/' ) ptr++;
+
+    // return EINVAL if string empty
+    if( *ptr == 0 ) return EINVAL;
+
+    // copy all characters in name until NUL or '/'
+    while( (*ptr != 0) && (*ptr !='/') )  *(name++) = *(ptr++);
+
+    // return last an next
+    if( *ptr == 0 )             // last found character is NUL => last name in path
+    {
+        *last = true;
+    }
+    else                        // last found character is '/' => skip it 
+    {
+        *last = false;
+        *next = ptr + 1;
+    }
+
+    return 0;
+}
+
+////////////////////////////////////////
+error_t vfs_lookup( xptr_t       cwd_xp,
+                    char       * pathname,
+                    uint32_t     client_uid,
+                    uint32_t     client_gid,
+					xptr_t     * inode_xp,
+                    xptr_t     * ctx_xp )
+{
+    char          name[CONFIG_VFS_MAX_NAME_LENGTH];   // one name in path 
+
+    xptr_t        parent_xp;    // extended pointer on parent inode
+    cxy_t         parent_cxy;   // cluster for parentc inode
+    vfs_inode_t * parent_ptr;   // local pointer on parent inode  
+    xptr_t        child_xp;     // extended pointer on child inode
+    cxy_t         child_cxy;    // cluster for child inode
+    vfs_inode_t * child_ptr;    // local pointer on child inode  
+    char        * current;      // current pointer on path
+    char        * next;         // next value for current pointer   
+    bool_t        last;         // true when the name is the last in path
+    bool_t        found;        // true when a child has been found
+    thread_t    * this;         // pointer on calling thread descriptor
+    process_t   * process;      // pointer on calling process descriptor
+    vfs_ctx_t   * ctx;          // parent inode context
+    uint32_t      type;         // file system type of parent inode
+    error_t       error;
+
+    this    = CURRENT_THREAD;
+    process = this->process;
+
+    // get extended pointer on first inode to search
+    if( pathname[0] == '/' ) parent_xp = process->vfs_root_xp;
+    else                     parent_xp = cwd_xp;
+
+    // initialise loop variables
+    current  = pathname;
+    next     = NULL;
+    last     = false;
+    child_xp = XPTR_NULL;
+
+    // take lock on parent inode
+    vfs_inode_remote_lock( parent_xp );
+
+    // break : if one intermediate name not found
+    // exit  : when last name found (i.e. last == true)
+    do
+    {
+        // get cluster and local pointer for parent inode
+        parent_cxy = GET_CXY( parent_xp );
+        parent_ptr = (vfs_inode_t *)GET_PTR( parent_xp );
+        
+        // get parent inode FS type
+        ctx = (vfs_ctx_t *)(intptr_t)hal_remote_lpt( XPTR( parent_cxy , &parent_ptr->ctx ) );
+        type = ctx->type;
+
+        // get one name from path
+        vfs_get_name_from_path( current , name , &next , &last );
+
+        // search a child dentry matching name for parent inode
+        found = vfs_get_child( parent_xp,
+                               name,
+                               &child_xp );
+
+        if( found == false ) // child inode not found in inode tree => try to load it
+        {
+            // release lock on parent inode
+            vfs_inode_remote_unlock( parent_xp );
+
+            // insert a new dentry/inode in parent inode
+            error = vfs_add_child_in_parent( type , parent_xp , name , &child_xp );
+
+            if( error )
+            {
+                printk("\n[ERROR] in %s : inode %s not found in path %s\n",
+                       __FUNCTION__ , name , pathname );
+                return ENOENT;
+            }
+
+            // take lock on parent inode
+            vfs_inode_remote_lock( parent_xp );
+        }
+
+        // check access rights
+        error = vfs_access_denied( child_xp,
+                                   client_uid,
+                                   client_gid );
+        if( error ) 
+        {
+            printk("\n[ERROR] in %s : permission denied for %s\n", __FUNCTION__ , name );
+            return EACCES;
+        }
+
+        // take lock on child inode if not last
+        if( last == false ) vfs_inode_remote_lock( child_xp );
+
+        // release lock on parent inode
+        vfs_inode_remote_unlock( parent_xp );
+
+        // update loop variables
+        parent_xp = child_xp;
+        current   = next;
+    }
+    while( last == false );
+
+    vfs_dmsg("\n[INFO] in %s : searched inode found for %s\n",
+                 __FUNCTION__ , pathname );
+
+    // get cluster and local pointer on child inode
+    child_cxy = GET_CXY( child_xp );
+    child_ptr = (vfs_inode_t *)GET_PTR( child_xp );
+
+    // return searched pointers
+    *inode_xp = child_xp;
+    *ctx_xp   = (xptr_t)hal_remote_lwd( XPTR( child_cxy , &child_ptr->ctx ) );
+
+    return 0;
+
+}  // end vfs_lookup()
+
+
+////////////////////////////////////////////
+error_t vfs_get_path( xptr_t    searched_xp,
+                      char    * buffer,
+                      uint32_t  max_size )
+{
+	xptr_t       dentry_xp;   // extended pointer on current dentry
+    char       * name;        // local pointer on current dentry name
+	uint32_t     length;      // length of current dentry name
+	uint32_t     count;       // number of characters written in buffer
+	uint32_t     index;       // slot index in buffer
+    xptr_t       inode_xp;  // extended pointer on    
+
+    // implementation note:
+    // we use two variables "index" and "count" because the buffer
+    // is actually written in decreasing index order (from leaf to root) 
+    // TODO : handle conflict with a concurrent rename 
+    // FIXME : handle synchro in the loop ... [AG]
+
+	// set the NUL character in buffer / initialise buffer index and count
+	buffer[max_size - 1] = 0;
+	count	 = 1;
+    index    = max_size - 2;
+
+    // initialize current inode
+    inode_xp  = searched_xp;
+
+    // exit when root inode found (i.e. dentry_xp == XPTR_NULL)
+	do
+    {
+        // get inode cluster and local pointer
+        cxy_t         inode_cxy = GET_CXY( inode_xp );
+        vfs_inode_t * inode_ptr = (vfs_inode_t *)GET_PTR( inode_xp );
+
+        // get extended pointer on parent dentry		
+        dentry_xp = (xptr_t)hal_remote_lwd( XPTR( inode_cxy , inode_ptr->parent_xp ) );
+
+        // get dentry cluster and local pointer
+        cxy_t          dentry_cxy = GET_CXY( dentry_xp );
+        vfs_dentry_t * dentry_ptr = (vfs_dentry_t *)GET_PTR( dentry_xp );
+
+        // get dentry name length and pointer
+        length =  hal_remote_lw( XPTR( dentry_cxy , &dentry_ptr->length ) );
+        name   = (char *)hal_remote_lpt( XPTR( dentry_cxy , &dentry_ptr->name ) );
+
+        // update index and count
+        index -= (length + 1); 
+        count += (length + 1);
+
+        // check buffer overflow
+        if( count >= max_size )
+        {
+            printk("\n[ERROR] in %s : kernel buffer too small\n", __FUNCTION__ );
+            return EINVAL;
+        }
+
+        // update pathname
+        hal_remote_memcpy( XPTR( local_cxy , &buffer[index + 1] ) ,
+                           XPTR( dentry_cxy , name ) , length );
+		buffer[index] = '/';
+
+		// get extended pointer on next inode
+        inode_xp = (xptr_t)hal_remote_lwd( XPTR( dentry_cxy , dentry_ptr->parent ) );
+    }
+    while( (dentry_xp != XPTR_NULL) );
+
+	return 0;
+
+}  // end vfs_get_path()
+
+///////////////////////////////////////////////
+error_t vfs_add_child_in_parent( uint32_t type,
+                                 xptr_t   parent_xp,
+                                 char   * name,   
+                                 xptr_t * child_xp )
+{
+    xptr_t     dentry_xp;  // extended pointer on created dentry
+    xptr_t     inode_xp;   // extended pointer on created inode
+    error_t    error;
+
+    // get parent inode cluster and local pointer
+    cxy_t         parent_cxy = GET_CXY( parent_xp );
+    vfs_inode_t * parent_ptr = (vfs_inode_t *)GET_PTR( parent_xp );
+
+    // create dentry
+    if( parent_cxy == local_cxy )      // parent cluster is the local cluster
+    {
+        error = vfs_dentry_create( type,
+                                   name,
+                                   parent_ptr,
+                                   &dentry_xp );
+    }
+    else                               // parent cluster is remote
+    {
+        rpc_vfs_dentry_create_client( parent_cxy,
+                                      type,
+                                      name,
+                                      parent_ptr,
+                                      &dentry_xp,
+                                      &error );
+    }
+                                      
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot create dentry in cluster %x\n",
+               __FUNCTION__ , parent_cxy );
+
+        return error;
+    }
+
+    // select a target cluster for child inode
+    uint32_t  x_size    = LOCAL_CLUSTER->x_size;
+    uint32_t  y_size    = LOCAL_CLUSTER->y_size;
+    uint32_t  y_width   = LOCAL_CLUSTER->y_width;
+    uint32_t  index     = ( hal_time_stamp() + hal_get_gid() ) % (x_size * y_size);
+    uint32_t  x         = index / y_size;    
+    uint32_t  y         = index % y_size;
+    cxy_t     child_cxy = (x<<y_width) + y;
+                                      
+    // create child inode TODO : define attr / mode / uid / gid
+    uint32_t attr = 0;
+    uint32_t mode = 0;
+    uint32_t uid  = 0;
+    uint32_t gid  = 0;
+    
+    if( child_cxy == local_cxy )      // child cluster is the local cluster
+    {
+        error = vfs_inode_create( dentry_xp,
+                                  type,
+                                  attr,
+                                  mode,
+                                  uid,
+                                  gid,
+                                  &inode_xp );
+    }
+    else                              // child cluster is remote
+    {
+        rpc_vfs_inode_create_client( child_cxy,
+                                     dentry_xp,
+                                     type,
+                                     attr,
+                                     mode,
+                                     uid,
+                                     gid,
+                                     &inode_xp,
+                                     &error );
+    }
+                                     
+    if( error )
+    {
+        printk("\n[ERROR] in %s : cannot create inode in cluster %x\n",
+               __FUNCTION__ , child_cxy );
+ 
+        vfs_dentry_t * dentry = (vfs_dentry_t *)GET_PTR( dentry_xp );
+        if( parent_cxy == local_cxy ) vfs_dentry_destroy( dentry );
+        else rpc_vfs_dentry_destroy_client( parent_cxy , dentry );
+        return error;
+    }
+
+    // success : return extended pointer on child inode
+    *child_xp = inode_xp;
+    return 0;
+
+}  // end vfs_add_child_in_parent()
+
+
Index: trunk/kernel/vfs/vfs.h
===================================================================
--- trunk/kernel/vfs/vfs.h	(revision 1)
+++ trunk/kernel/vfs/vfs.h	(revision 1)
@@ -0,0 +1,925 @@
+/*
+ * vfs.h - Virtual File System definition.
+ *
+ * Author  Mohamed Lamine Karaoui (2015)
+ *         Alain Greiner (2016)
+ *
+ * Copyright (c) UPMC Sorbonne Universites
+ *
+ * This file is part of ALMOS-MKH.
+ *
+ * ALMOS-MKH is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2.0 of the License.
+ *
+ * ALMOS-MKH is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with ALMOS-MKH; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _VFS_H_
+#define _VFS_H_
+
+#include <almos_config.h>
+#include <hal_types.h>
+#include <hal_atomic.h>
+#include <remote_rwlock.h>
+#include <remote_spinlock.h>
+#include <spinlock.h>
+#include <list.h>
+#include <xlist.h>
+#include <slist.h>
+#include <bits.h>
+#include <xhtab.h>
+#include <errno.h>
+#include <metafs.h>
+
+#include <fatfs.h>
+#include <ramfs.h>
+
+/****  Forward declarations  ***/
+
+struct vfs_inode_s;
+struct vfs_dentry_t;
+struct vfs_ctx_t;
+struct vfs_file_ref_s;
+struct vfs_file_s;
+
+struct vfs_inode_op_s;
+struct vfs_dentry_op_s;
+struct vfs_file_op_s;
+struct vfs_ctx_op_s;
+
+struct vfs_lookup_cmd_s;
+struct vfs_lookup_rsp_s;
+
+struct mapper_s;
+struct process_s;
+struct device_s;
+struct vseg_s;
+
+/*********************************************************************************************
+ * This defines the various Flags arguments for an open() or opendir() system call.
+ ********************************************************************************************/
+
+#define VFS_O_APPEND         0x00080000
+#define VFS_O_RDONLY         0x00100000
+#define VFS_O_WRONLY         0x00200000
+#define VFS_O_RDWR           0x00300000
+#define VFS_O_CREATE         0x00400000
+#define VFS_O_EXCL           0x00800000
+#define VFS_O_TRUNC          0x01000000
+#define VFS_O_SYNC	         0x08000000
+
+/*********************************************************************************************
+ * This defines the various types of command for an lseek() system call.
+ ********************************************************************************************/
+
+#define VFS_SEEK_SET         0
+#define VFS_SEEK_CUR         1
+#define VFS_SEEK_END         2
+
+/*********************************************************************************************
+ * TODO : the following flags were defined in the vfs-params.h file...
+ *        ... and must be documented. [AG]
+ ********************************************************************************************/
+
+
+//////////////////////////////////////
+///    keep these flags compact    ///
+//////////////////////////////////////
+#define VFS_REGFILE          0x0000000
+#define VFS_DIR              0x0000001
+#define VFS_FIFO             0x0000002
+#define VFS_DEV_CHR          0x0000004
+#define VFS_DEV_BLK          0x0000008
+#define VFS_DEV              0x000000C
+#define VFS_SOCK             0x0000010
+#define VFS_SYMLNK           0x0000020
+//////////////////////////////////////
+
+#define VFS_RD_ONLY          0x0000040
+#define VFS_SYS              0x0000080
+#define VFS_ARCHIVE          0x0000100
+#define VFS_PIPE             0x0000200
+
+#define VFS_IFMT	     0x0170000
+#define VFS_IFSOCK	     0x0140000
+#define VFS_IFLNK	     0x0120000
+#define VFS_IFREG	     0x0100000
+#define VFS_IFBLK	     0x0060000
+#define VFS_IFDIR	     0x0040000
+#define VFS_IFCHR	     0x0020000
+#define VFS_IFIFO	     0x0010000
+
+#define VFS_ISUID	     0x0004000
+#define VFS_ISGID	     0x0002000
+#define VFS_ISVTX	     0x0001000
+
+#define VFS_IRWXU            0x0000700
+#define VFS_IRUSR            0x0000400
+#define VFS_IWUSR            0x0000200
+#define VFS_IXUSR            0x0000100
+#define VFS_IRWXG            0x0000070
+#define VFS_IRGRP            0x0000040
+#define VFS_IWGRP            0x0000020
+#define VFS_IXGRP            0x0000010
+#define VFS_IRWXO            0x0000007
+#define VFS_IROTH            0x0000004
+#define VFS_IWOTH            0x0000002
+#define VFS_IXOTH            0x0000001
+
+#define VFS_IREAD            VFS_IRUSR
+#define VFS_IWRITE           VFS_IWUSR
+#define VFS_IEXEC            VFS_IXUSR
+
+#define VFS_SET(state,flag)    (state) |= (flag)
+#define VFS_IS(state,flag)     (state) & (flag)
+#define VFS_CLEAR(state,flag)  (state) &= ~(flag)
+
+
+/* Lookup flags */
+#define VFS_LOOKUP_FILE		0x1
+#define VFS_LOOKUP_LAST		0x2
+#define VFS_LOOKUP_OPEN		0x4
+#define VFS_LOOKUP_RESTART	0x8
+#define VFS_LOOKUP_RETRY	0x10
+#define VFS_LOOKUP_PARENT	0x20
+#define VFS_LOOKUP_HELD		0x40
+
+/* Context flags*/
+#define VFS_FS_LOCAL		0x1
+#define VFS_FS_USE_MAPPER	0x2
+
+
+
+
+/******************************************************************************************
+ * This structure define a VFS inode.
+ * It contains an extended pointer on the parent dentry, and (for directory only)
+ * an hash table xhtab refering all children dentries.
+ * The <parent> inode is unique for a directory (not hard links for directories). 
+ * For a file, the parent field points to the first dentry who created this inode.
+ * TODO pourquoi deux types de locks ???
+ *****************************************************************************************/
+
+typedef enum 
+{
+    INODE_ATTR_DIRTY  = 0x01,
+    INODE_ATTR_DIR    = 0x02,
+    INODE_ATTR_INLOAD = 0x04,
+    INODE_ATTR_NEW    = 0x08,
+}
+inode_attr_t;
+
+typedef struct vfs_inode_s
+{
+	struct vfs_ctx_s      * ctx;         /*! Rlocal pointer on FS context                */
+    uint32_t                gc;          /*! generation counter                          */
+	uint32_t                inum;        /*! inode identifier (unique in file system)    */
+	uint32_t                attr;        /*! inode attributes (see above)                */
+	uint32_t                size;        /*! number of bytes                             */
+	uint32_t                links;       /*! number of alias dentry                      */
+	uid_t                   uid;         /*! user owner identifier                       */
+	gid_t                   gid;         /*! group owner identifier                      */
+    uint32_t                mode;        /*! access mode                                 */
+	uint32_t	            refcount;    /*! reference counter (all pointers)            */
+	xptr_t                  parent_xp;   /*! extended pointer on parent dentry           */
+	xhtab_t                 children;    /*! embedded htab of dir entries (for dir type) */
+	remote_rwlock_t         size_lock;   /*! protect size field modifications            */
+	remote_spinlock_t       main_lock;   /*! protect other fields (including children)   */
+	xlist_entry_t           xlist;       /*! member of set of inodes in same cluster     */
+	xlist_entry_t           wait_root;   /*! root of threads waiting on this inode       */
+	struct vfs_inode_op_s * op;          /*! TODO ???                                    */
+	struct mapper_s       * mapper;      /*! associated file cache                       */
+	void                  * extend;      /*! FS specific inode extension                 */
+}
+vfs_inode_t;
+
+/******************************************************************************************
+ * This structure defines a directory entry.
+ * A dentry contains the name of a remote file/dir, an extended pointer on the 
+ * inode representing this file/dir, and a local pointer on the inode representing 
+ * the parent directory.
+ *****************************************************************************************/
+
+typedef struct vfs_dentry_s
+{
+    struct vfs_ctx_s       * ctx;        /*! local pointer on FS context                 */
+	char                     name[CONFIG_VFS_MAX_NAME_LENGTH];
+	uint32_t                 length;     /*! name length (bytes)                         */
+	uint32_t                 refcount;   /*! reference counter (all pointers)            */
+    struct vfs_inode_s     * parent;     /*! local pointer on parent inode               */
+    xptr_t                   child_xp;   /*! extended pointer on child inode             */
+    xlist_entry_t            xlist;      /*! member of xlist of dentries with same key   */
+	struct vfs_dentry_op_s * op;         /*! TODO                                        */
+	void                   * extend;     /*! FS specific extension                       */
+}
+vfs_dentry_t;
+
+/******************************************************************************************
+ * This structure describes an open file/directory for a given process.
+ * It is not replicated, and is dynamically allocated in the cluster that contains
+ * the inode, when a thread makes an open() or opendir() system call.
+ *****************************************************************************************/
+
+typedef enum   
+{
+    VFS_FD_NORMAL,                      /*! file or directory                            */
+    VFS_FD_PIPE,                        /*! POSIX pipe                                   */
+    VFS_FD_SOCKET,                      /*! POSIX socket                                 */
+    VFS_FD_DEV,                         /*! peripheral channel                           */
+}
+vfs_fd_type_t;
+
+typedef enum
+{
+    VFS_ATTR_READ_ENABLE  = 0x01,       /*! read access possible                         */
+    VFS_ATTR_WRITE_ENABLE = 0x02,       /*! write access possible                        */
+    VFS_ATTR_APPEND       = 0x04,       /*! append on each write                         */
+    VFS_ATTR_CLOSE_EXEC   = 0x08,       /*! close file on exec                           */
+    VFS_ATTR_SYNC         = 0x10,       /*! synchronise FS on each write                 */
+    VFS_ATTR_IS_DIR       = 0x20,       /*! this is a directory                          */
+}
+vfs_fd_attr_t;
+
+typedef struct vfs_file_s
+{
+	uint32_t                gc;         /*! generation counter                           */
+	uint32_t                type;       /*! see above                                    */
+	uint32_t                attr;       /*! see above                                    */
+	uint32_t                offset;     /*! seek position in file                        */
+	uint32_t                refcount;   /*! all pointers on this file                    */
+	remote_rwlock_t       lock;       /*! protect offset modifications                 */
+	struct mapper_s       * mapper;     /*! associated file cache                        */
+	struct vfs_inode_s    * inode;      /*! local pointer on associated inode            */
+	struct vfs_ctx_s      * ctx;        /*! file system features                         */
+	struct vfs_file_op_s  * op;         /*! local set of function pointers               */
+}
+vfs_file_t;
+
+/******************************************************************************************
+ * This structure defines informations common to all inodes and dentries
+ * of a given file system. As it is declared a global variable in the kdata segment,
+ * it is replicated in all clusters and handled as private by each OS intance.
+ *****************************************************************************************/
+
+typedef enum
+{
+	FS_TYPE_SYSFS = 0,
+	FS_TYPE_DEVFS = 1,
+	FS_TYPE_FATFS = 2,
+	FS_TYPE_RAMFS = 3,
+ 
+	FS_TYPES_NR   = 4,
+}
+vfs_types_t;
+
+typedef struct vfs_ctx_s
+{
+	uint32_t	              type;          /*! File System type                        */
+	uint32_t	              flags;         /*! TODO ???                                */
+	uint32_t                  count;         /*! number of clusters                      */
+	uint32_t                  blksize;       /*! cluster size                            */
+    xptr_t                    ioc_xp;        /*! extended pointer on IOC device          */
+	xptr_t                    root_xp;       /*! extended pointer on root inode          */
+
+    spinlock_t                lock;          /*! lock protecting inum allocator          */
+	BITMAP( inum , CONFIG_VFS_MAX_INODES );  /*! inum allocator                          */ 
+
+    void                    * extend;        /*! FS specific context extension           */
+}
+vfs_ctx_t;
+
+/******************************************************************************************
+ * This structure define the informations associated to a given file descriptor,
+ * that are returned by the vfs_stat() function.
+ *****************************************************************************************/
+
+typedef struct vfs_stat_s 
+{
+	uint32_t    dev;        /*! ID of device containing file                             */
+	uint32_t    ino;        /*! inode number                                             */
+	uint32_t    mode;       /*! protection                                               */
+	uint32_t    nlink;      /*! number of hard links                                     */
+	uint32_t    uid;        /*! user ID of owner                                         */
+	uint32_t    gid;        /*! group ID of owner                                        */
+	uint32_t    rdev;       /*! device ID (if special file)                              */
+	uint64_t    size;       /*! total size, in bytes                                     */
+	uint32_t    blksize;    /*! blocksize for file system I/O                            */
+	uint32_t    blocks;     /*! number of 512B blocks allocated                          */
+	uint64_t    atime;      /*! time of last access                                      */
+	uint64_t    mtime;      /*! time of last modification                                */
+	uint64_t    ctime;      /*! time of last status change                               */
+}
+vfs_stat_t;
+
+
+
+
+
+
+/****************************************************************************************** 
+ * This structure defines the set of operations that can be done on a VFS context. 
+ * TODO A quoi cela sert-il ? [AG]
+ *****************************************************************************************/
+
+typedef error_t (vfs_create_context_t)  ( vfs_ctx_t * context );
+typedef error_t (vfs_destroy_context_t) ( vfs_ctx_t * context );
+typedef error_t (vfs_read_root_t)       ( vfs_ctx_t * context , vfs_inode_t * root );
+typedef error_t (vfs_reply_root_t)      ( vfs_ctx_t * context , vfs_inode_t * root );
+typedef error_t (vfs_write_root_t)      ( vfs_ctx_t * context , vfs_inode_t * root );
+
+struct vfs_ctx_op_s
+{
+	vfs_create_context_t  * create;      /*! allocate memory and initialize a context   */
+	vfs_destroy_context_t * destroy;     /*! release memory allocated to a context      */
+	vfs_read_root_t       * read_root;   /*! TODO                                       */
+	vfs_reply_root_t      * repli_root;  /*! TODO                                       */
+	vfs_write_root_t      * write_root;  /*! TODO                                       */
+}
+vfs_ctx_op_t;
+
+/****************************************************************************************** 
+ * This structure defines the set of operations that can be done on a VFS inode. 
+ * TODO A quoi cela sert-il ? [AG]
+ *****************************************************************************************/
+
+typedef error_t (vfs_init_inode_t)    ( vfs_inode_t * inode );
+typedef error_t (vfs_create_inode_t)  ( vfs_inode_t * parent , vfs_dentry_t  * dentry );
+typedef error_t (vfs_lookup_inode_t)  ( vfs_inode_t * parent , vfs_dentry_t  * dentry );
+typedef error_t (vfs_write_inode_t)   ( vfs_inode_t * inode );
+typedef error_t (vfs_release_inode_t) ( vfs_inode_t * inode );
+typedef error_t (vfs_unlink_inode_t)  ( vfs_inode_t * parent , vfs_dentry_t  * dentry , uint32_t flags );
+typedef error_t (vfs_stat_inode_t)    ( vfs_inode_t * inode );
+typedef error_t (vfs_trunc_inode_t)   ( vfs_inode_t * inode );
+typedef error_t (vfs_delete_inode_t)  ( vfs_inode_t * inode );
+
+typedef struct vfs_inode_op_s
+{
+	vfs_init_inode_t    * init;     /*! initialise inode from scratch                    */
+	vfs_create_inode_t  * create;   /*! allocate memory for one inode                    */
+	vfs_lookup_inode_t  * lookup;   /*! get one directory entry by name                  */ 
+	vfs_write_inode_t   * write;    /*! update the device from the inode                 */
+	vfs_release_inode_t * release;  /*! reset one inode and release associated objects   */
+	vfs_unlink_inode_t  * unlink;   /*! unlink a directory entry from parent inode       */
+	vfs_delete_inode_t  * delete;   /*! release memory allocated to inode when count = 0 */
+	vfs_stat_inode_t    * stat;     /*! TODO                                             */
+	vfs_trunc_inode_t   * trunc;    /*! change the size of a file                        */
+}
+vfs_inode_op_t;
+
+/****************************************************************************************** 
+ * This structure defines the set of operations that can be done on a VFS dentry.
+ * TODO A quoi cela sert-il ? [AG]
+ *****************************************************************************************/
+
+typedef error_t (vfs_compare_dentry_t) ( char * first , char * second );
+
+typedef struct vfs_dentry_op_s
+{
+	vfs_compare_dentry_t * compare;
+}
+vfs_dentry_op_t;
+
+/****************************************************************************************** 
+ * This structure defines the set of operations that can be done on a VFS file.  
+ * TODO A quoi cela sert-il ? [AG]
+ *****************************************************************************************/
+
+typedef error_t (vfs_open_file_t)    ( vfs_file_t * file , void * priv );
+typedef error_t (vfs_read_file_t)    ( vfs_file_t * file , char * buffer );
+typedef error_t (vfs_write_file_t)   ( vfs_file_t * file , char * buffer );
+typedef error_t (vfs_lseek_file_t)   ( vfs_file_t * file );
+typedef error_t (vfs_close_file_t)   ( vfs_file_t * file );
+typedef error_t (vfs_release_file_t) ( vfs_file_t * file );
+typedef error_t (vfs_read_dir_t)     ( vfs_file_t * file );
+typedef error_t (vfs_mmap_file_t)    ( vfs_file_t * file , struct vseg_s * vseg );
+typedef error_t (vfs_munmap_file_t)  ( vfs_file_t * file , struct vseg_s * vseg );
+
+typedef struct vfs_file_op_s
+{
+	vfs_open_file_t    * open;
+	vfs_read_file_t    * read;
+	vfs_write_file_t   * write;
+	vfs_lseek_file_t   * lseek;
+	vfs_read_dir_t     * readdir;
+	vfs_close_file_t   * close;
+	vfs_release_file_t * release;
+	vfs_mmap_file_t    * mmap;
+	vfs_munmap_file_t  * munmap;
+}
+vfs_file_op_t;
+
+
+
+
+
+
+/*****************************************************************************************/
+/******************** VFS global functions ***********************************************/
+/*****************************************************************************************/ 
+
+/****************************************************************************************** 
+ * This function initializes the Virtual File System.     
+ *****************************************************************************************/
+void vfs_init();
+
+/****************************************************************************************** 
+ * This function mount a given file system type for a given process.     
+ *****************************************************************************************/
+error_t vfs_mount_fs_root( struct device_s  * device,
+			               uint32_t           fs_type,
+			               struct process_s * process );
+
+
+/*****************************************************************************************/
+/******************* FS Context related functions ****************************************/
+/*****************************************************************************************/
+
+/****************************************************************************************** 
+ * This function allocates an inode identifier from the local cluster inum allocator.
+ * The inum respects a fixed format:
+ * - the 16 MSB bits contain the cluster identifier : cxy
+ * - the 16 LSB bits contains the local inode identifier  : lid
+ ******************************************************************************************
+ * @ ctx      : local pointer on file system context.
+ * @ inum     : [ou] buffer for allocated inode identifier.
+ * @ return 0 if success / return non-zero if error.
+ *****************************************************************************************/
+error_t vfs_ctx_inum_alloc( vfs_ctx_t * ctx,
+                            uint32_t  * inum );
+
+/****************************************************************************************** 
+ * This function release an inode identifier.                                  
+ ******************************************************************************************
+ * @ ctx      : local pointer on file system context.
+ * @ inum     : released inode identifier.
+ *****************************************************************************************/
+void vfs_ctx_inum_release( vfs_ctx_t * ctx,
+                           uint32_t    inum );
+
+
+
+/*****************************************************************************************/
+/************************ File Descriptor related functions ******************************/
+/*****************************************************************************************/
+
+/****************************************************************************************** 
+ * This function allocates memory and initializes a new local file descriptor.
+ * It must be executed in the owner cluster containing the inode.
+ * If the client thread is not running in the owner cluster, it must use the
+ * rpc_vfs_file_create_client() function.
+ ****************************************************************************************** 
+ * @ inode_xp : extended pointer on associated inode.
+ * @ type     : file descriptor type.
+ * @ attr     : file descriptor attributes.
+ * @ file_xp  : [out] buffer for extended pointer on created file descriptor.
+ * @ return 0 if success / return ENOMEM if error.
+ *****************************************************************************************/
+error_t vfs_file_create( xptr_t     inode_xp,
+                         uint32_t   type,
+                         uint32_t   attr,
+                         xptr_t   * file_xp );  
+
+/****************************************************************************************** 
+ * This function releases memory allocated to a local file descriptor.
+ * It must be executed by a thread running in the cluster containing the inode,
+ * and the file refcount must be zero.
+ * If the client thread is not running in the owner cluster, it must use the
+ * rpc_vfs_file_destroy_client() function.
+ ****************************************************************************************** 
+ * @ file_xp  : extended pointer on file descriptor.
+ *****************************************************************************************/
+void vfs_file_destroy( xptr_t  file_xp );  
+
+
+/****************************************************************************************** 
+ * These functions increment (resp. decrement) the count field in a remote file
+ * descriptor, using a remote_atomic access. 
+ *****************************************************************************************/
+void vfs_file_count_up  ( xptr_t   file_xp );
+void vfs_file_count_down( xptr_t   file_xp );
+
+
+
+/*****************************************************************************************/
+/********************* Inode related functions *******************************************/
+/*****************************************************************************************/
+
+/****************************************************************************************** 
+ * This function allocates memory from local cluster for an inode descriptor and the 
+ * associated mapper. It initialise these descriptors from arguments values. 
+ * The parent dentry must have been previously created.
+ * If the client thread is not running in the cluster containing this inode,
+ * it must use the rpc_vfs_inode_create_client() function.
+ ******************************************************************************************
+ * @ dentry_xp  : extended pointer on associated dentry (in parent inode cluster).
+ * @ type       : file system type.
+ * @ attr       : inode attributes.
+ * @ mode       : inode access mode.
+ * @ uid        : user owner ID.
+ * @ gid        : group owner ID.
+ * @ inode_xp   : [out] buffer for extended pointer on created inode.
+ * # return 0 if success / return ENOMEM or EINVAL if error.
+ *****************************************************************************************/
+error_t vfs_inode_create( xptr_t      dentry_xp,
+                          uint32_t    type,
+                          uint32_t    attr,
+                          uint32_t    mode,
+                          uid_t       uid,
+                          gid_t       gid,
+                          xptr_t    * inode_xp );
+
+/****************************************************************************************** 
+ * This function releases memory allocated to an inode descriptor.
+ * It must be executed by a thread running in the cluster containing the inode,
+ * and the inode refcount must be zero.
+ * If the client thread is not running in the owner cluster, it must use the
+ * rpc_vfs_inode_destroy_client() function.
+ ****************************************************************************************** 
+ * @ inode  : local pointer on inode descriptor.
+ *****************************************************************************************/
+void vfs_inode_destroy( vfs_inode_t *  inode );  
+
+/****************************************************************************************** 
+ * This function atomically increment the inode refcount.
+ * It can be called by any thread running in any cluster.
+ *****************************************************************************************/
+void vfs_inode_remote_up( xptr_t  inode_xp );
+
+/****************************************************************************************** 
+ * This function atomically decrement the inode refcount. 
+ * It can be called by any thread running in any cluster.
+ *****************************************************************************************/
+void vfs_inode_remote_down( xptr_t  inode_xp );
+
+/****************************************************************************************** 
+ * This function returns the <size> of a file/dir from a remote inode,
+ * taking the remote_rwlock protecting <size> in READ_MODE.
+ *****************************************************************************************
+ * @ inode_xp  : extended pointer on the remote inode.
+ * @ return the current size.
+ *****************************************************************************************/
+uint32_t vfs_inode_get_size( xptr_t inode_xp );
+
+/****************************************************************************************** 
+ * This function set the <size> of a file/dir to a remote inode,
+ * taking the remote_rwlock protecting <size> in WRITE_MODE.
+ *****************************************************************************************
+ * @ inode_xp  : extended pointer on the remote inode.
+ * @ size      : value to be written.
+ *****************************************************************************************/
+void vfs_inode_set_size( xptr_t   inode_xp,
+                         uint32_t size );
+
+/****************************************************************************************** 
+ * This function takes the main lock of a remote inode.
+ * This lock protect all inode fiels, including the children dentries.
+ *****************************************************************************************
+ * @ inode_xp  : extended pointer on the remote inode.
+ *****************************************************************************************/
+void vfs_inode_remote_lock( xptr_t inode_xp );
+
+/****************************************************************************************** 
+ * This function releases the main lock of a remote inode.
+ * This lock protect all inode fiels, including the children dentries.
+ *****************************************************************************************
+ * @ inode_xp  : extended pointer on the remote inode.
+ *****************************************************************************************/
+void vfs_inode_remote_unlock( xptr_t inode_xp );
+
+
+
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_inode_hold( vfs_inode_t * inode,
+                        uint32_t      gc );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_inode_trunc( vfs_inode_t * inode );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_inode_link( vfs_inode_t * inode,
+                        uint32_t      igc );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_inode_unlink( vfs_inode_t * inode );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_inode_stat( vfs_inode_t * inode,
+                        uint32_t      inum );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_icache_del( vfs_inode_t * inode );
+
+
+/****************************************************************************************** 
+ * This function TODO  Pourquoi 2 arguments ?
+ *****************************************************************************************/
+error_t vfs_stat_inode( vfs_inode_t * inode,
+                        uint32_t      inum );
+
+
+/*****************************************************************************************/
+/***************** Dentry related functions **********************************************/
+/*****************************************************************************************/
+
+/****************************************************************************************** 
+ * This function allocates memory from local cluster for a dentry descriptor, 
+ * initialises it from  arguments values, and returns the extended pointer on dentry.
+ * The inode field is not initialized, because the inode does not exist yet.
+ * If the client thread is not running in the target cluster for this inode,
+ * it must use the rpc_dentry_create_client() function.
+ ******************************************************************************************
+ * @ type       : file system type.
+ * @ name       : directory entry file/dir name.
+ * @ parent     : local pointer on parent inode.
+ * @ dentry_xp  : [out] buffer for extended pointer on created inode.
+ * @ return 0 if success / return ENOMEM or EINVAL if error.
+ *****************************************************************************************/
+error_t vfs_dentry_create( uint32_t      type,
+                           char        * name,
+                           vfs_inode_t * parent,
+                           xptr_t      * dentry_xp );
+ 
+/****************************************************************************************** 
+ * This function releases memory allocated to a dentry descriptor.
+ * It must be executed by a thread running in the cluster containing the dentry,
+ * and the dentry refcount must be zero.
+ * If the client thread is not running in the owner cluster, it must use the
+ * rpc_dentry_destroy_client() function.
+ ****************************************************************************************** 
+ * @ dentry  : local pointer on dentry descriptor.
+ *****************************************************************************************/
+void vfs_dentry_destroy( vfs_dentry_t *  dentry );  
+
+/****************************************************************************************** 
+ * This function atomically increment the dentry refcount.                                
+ * It can be called by any thread running in any cluster.
+ *****************************************************************************************/
+void vfs_dentry_remote_up( xptr_t dentry_xp );
+
+/****************************************************************************************** 
+ * This function atomically decrement the dentry refcount.                                
+ * It can be called by any thread running in any cluster.
+ *****************************************************************************************/
+void vfs_dentry_remote_down( xptr_t dentry_xp );
+
+
+/*****************************************************************************************/
+/*                 Inode-Tree related functions                                          */ 
+/*****************************************************************************************/ 
+
+/****************************************************************************************** 
+ * This function returns in a kernel buffer allocated by the caller function,
+ * the pathname of a file/dir identified by an extended pointer on the inode. 
+ * It traverse the Inode Tree from the target node to the root.
+ * It can be called by any thread running in any cluster.
+ ******************************************************************************************
+ * @ inode_xp    : pointer on inode descriptor.
+ * @ buffer      : kernel buffer for pathname (must be allocated by caller).
+ * @ size        : max number of characters in buffer.
+ * @ return 0 if success / return EINVAL if buffer too small.
+ *****************************************************************************************/
+error_t vfs_get_path( xptr_t    inode_xp,
+                      char    * buffer,
+                      uint32_t  max_size );
+
+/******************************************************************************************
+ * This function takes a pathname (absolute or relative to cwd) and returns an extended 
+ * pointer on the associated inode, and an extended pointer on the inode context.
+ * If a given name in the path is not found in the inode tree, it try to load the missing
+ * dentry/inode couple, from informations found in the parent directory.
+ * If this directory entry does not exist on device, it returns an error.
+ ******************************************************************************************
+ * @ cwd_xp     : extended pointer on current directory (for relative path).
+ * @ pathname   : path in kernel space (can be relative or absolute).
+ * @ client_uid : client thread user ID (for checking).
+ * @ client_gid : client thread group ID (for checking).
+ * @ inode_xp   : [out] buffer for extended pointer on inode.
+ * @ ctx_xp     : [out] buffer for extended pointer on inode context.
+ * @ return 0 if success / ENOENT if inode not found / EACCES if permissopn denied
+ *****************************************************************************************/
+error_t vfs_lookup( xptr_t       cwd_xp,
+                    char       * pathname,
+                    uint32_t     client_uid,
+                    uint32_t     client_gid,
+					xptr_t     * inode_xp,
+                    xptr_t     * ctx_xp );
+
+/******************************************************************************************
+ * This function creates a new couple dentry/inode, and insert it in the Inode-Tree.
+ * It can be executed by any thread running in any cluster, as this function
+ * uses the rpc_dentry_create_client() and rpc_inode_create client() if required.
+ * - The dentry is created in the cluster containing the existing <parent_xp> inode.
+ * - the child inode and its associated mapper are created in a randomly selected cluster.
+ * - The dentry name is defined by the <name> argument.
+ ******************************************************************************************
+ * @ type       : new inode type
+ * @ parent_xp  : extended pointer on parent inode.
+ * @ name       : new directory entry name.
+ * @ child_xp   : [out] buffer for extended pointer on child inode.
+ * @ return 0 if success / ENOENT if entry not found in parent directory
+ *****************************************************************************************/
+error_t vfs_add_child_in_parent( uint32_t type,
+                                 xptr_t   parent_xp,
+                                 char   * name,   
+                                 xptr_t * child_xp );
+
+/******************************************************************************************
+ * TODO
+ ******************************************************************************************
+ * @ child_xp   : extended pointer on removed inode.
+ *****************************************************************************************/
+error_t vfs_remove_child_from_parent( xptr_t child_xp );
+
+/*****************************************************************************************/
+/************************ File related functions *****************************************/
+/*****************************************************************************************/
+
+/****************************************************************************************** 
+ * This function allocates a vfs_file_t structure in the cluster containing the inode
+ * associated to the requested file, initializes it, and returns an extended pointer 
+ * on this remote open file descriptor. 
+ * The pathname can be relative to current directory or absolute.
+ * If the inode does not exist in the inode cache, it try to find file on the mounted
+ * device, and creates an inode on a pseudo randomly selected cluster if found.
+ * It the requested file does not exist on device, it creates a new inode if the
+ * O_CREAT flag is set and return an error otherwise. 
+ ****************************************************************************************** 
+ * @ cwd_xp    : extended pointer on current directory file descriptor (for relative path).
+ * @ path      : file pathname (absolute or relative to current directory).
+ * @ flags     : O_RDONLY, O_WRONLY, O_CREATE etc...
+ * @ file_xp   : [out] buffer for extended pointer on created remote file descriptor.
+ * @ return 0 if success / return non-zero if error.
+ *****************************************************************************************/
+error_t vfs_open( xptr_t     cwd_xp,
+		          char     * path,
+		          uint32_t   flags,
+		          xptr_t   * file_xp );
+
+/****************************************************************************************** 
+ * This function moves <size> bytes from the file identified by the open file descriptor
+ * <file_xp> to the local kernel <buffer> , taken into account the offset in <file_xp>.
+ ****************************************************************************************** 
+ * @ file_xp   : extended pointer on the remote open file descriptor.
+ * @ buffer    : local pointer on destination kernel buffer.
+ * @ size      : requested number of bytes from offset.
+ * @ returns number of bytes actually transfered / 0 if EOF / -1 if error.
+ *****************************************************************************************/
+uint32_t vfs_read( xptr_t   file_xp, 
+                   void   * buffer,
+                   uint32_t size );
+
+/****************************************************************************************** 
+ * This function moves <size> bytes from the local kernel <buffer> to the open file 
+ * descriptor <file_xp>, taken into account the offset defined in <file_xp>.
+ ****************************************************************************************** 
+ * @ file_xp   : extended pointer on the remote open file descriptor.
+ * @ buffer    : local pointer on source kernel buffer.
+ * @ size      : requested number of bytes to be written from offset.
+ * @ returns number of bytes actually transfered / -1 if error.
+ *****************************************************************************************/
+uint32_t vfs_write( xptr_t   file_xp,
+                    void   * buffer,
+                    uint32_t size );
+
+/****************************************************************************************** 
+ * This function set a new value in the offset of the open file descriptor <file_xp>.
+ * This value depends on the <whence> argument:
+ * - if VFS_SEEK_SET, new value is <offset>
+ * - if VFS_SEEK_CUR, new value is current_offset + <offset>
+ * - if VFS_SEEK_END, new value is file_size + <offset>
+ ****************************************************************************************** 
+ * @ file_xp   : extended pointer on the remote open file descriptor.
+ * @ offset    : local pointer on source kernel buffer.
+ * @ whence    : VFS_SEEK_SET / VFS_SEEK_CUR / VFS_SEEK_END.
+ * @ new_offset : [out] buffer for new offset value.
+ * @ returns 0 if success / -1 if error.
+ *****************************************************************************************/
+error_t vfs_lseek( xptr_t     file_xp,
+                   uint32_t   offset,
+                   uint32_t   whence, 
+                   uint32_t * new_offset );
+
+/****************************************************************************************** 
+ * This function close an open file descriptor.                              
+ ******************************************************************************************
+ * @ file_xp     : extended pointer on the file descriptor.
+ * @ refcount    : number of references after close.
+ * @ return 0 if success / return -1 if error
+ *****************************************************************************************/
+error_t vfs_close( xptr_t     file_xp, 
+                   uint32_t * refcount );
+
+/****************************************************************************************** 
+ * This function remove from the file system a directory entry identified by its pathname.
+ * The pathname can be relative to current directory or absolute.
+ ******************************************************************************************
+ * @ cwd_xp   : extended pointer on the current directory file descriptor.
+ * @ path     : pathname (absolute or relative to current directory).
+ *****************************************************************************************/
+error_t vfs_unlink( xptr_t   cwd_xp,
+                    char   * path );
+
+/****************************************************************************************** 
+ * This function returns in the <ustat> structure various informations on the file TODO
+ *****************************************************************************************/
+error_t vfs_stat( xptr_t       file_xp,
+                  vfs_stat_t * ustat );
+
+
+
+
+/*****************************************************************************************/
+/************************ Directory related functions ************************************/
+/*****************************************************************************************/
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_opendir( xptr_t      cwd_xp,
+                     char      * path,
+                     uint32_t    flags,
+                     xptr_t      file_xp );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *    fat32_readdir need cleaning
+ *****************************************************************************************/
+error_t vfs_readdir( xptr_t            file_xp,
+                     char            * path );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_mkdir( xptr_t            file_xp,
+                   char            * path,
+                   uint32_t          mode );
+
+/****************************************************************************************** 
+ * This function remove a directory from the file system.
+ *****************************************************************************************/
+error_t vfs_rmdir( xptr_t            file_xp,
+                   char            * path );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_chdir( char            * pathname,
+                   xptr_t            cwd_xp );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_chmod( char            * pathname,
+                   vfs_file_t      * cwd,
+                   uint32_t          mode );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_closedir( xptr_t       file_xp,
+                      uint32_t   * refcount );
+
+
+
+
+/*****************************************************************************************/
+/*******************  Pipe related functions *********************************************/
+/*****************************************************************************************/
+
+/****************************************************************************************** 
+ * This function TODO ???                                                         
+ *****************************************************************************************/
+error_t vfs_pipe( xptr_t pipefd[2] );
+
+/****************************************************************************************** 
+ * This function TODO                                                          
+ *****************************************************************************************/
+error_t vfs_mkfifo( xptr_t            cwd_xp,
+                    char            * path,
+                    uint32_t          mode );
+
+
+
+
+#endif	/* _VFS_H_ */
