diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/adeos/armv.c linux-2.6.8.1-tcl1-adeos/adeos/armv.c
--- linux-2.6.8.1-tcl1/adeos/armv.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/adeos/armv.c	2005-11-18 14:18:42.000000000 +0000
@@ -0,0 +1,477 @@
+/*
+ *   linux/adeos/arm.c
+ *
+ *   Copyright (C) 2003,2004 Philippe Gerum.
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version.
+ *
+ *   This program is 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 this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *   Architecture-dependent ADEOS support for ARM.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/interrupt.h>
+#include <asm/hardware.h>
+#include <asm/mach/irq.h>
+#include <asm/system.h>
+#include <asm/atomic.h>
+#include <asm/io.h>
+#include <asm-arm/errno.h>
+#include <asm-arm/smp.h>
+
+extern spinlock_t __adeos_pipelock;
+
+extern struct list_head __adeos_pipeline;
+
+extern struct pt_regs *regs;
+
+extern struct irqdesc *desc;
+
+extern struct irqdesc irq_desc[];
+
+extern struct pt_regs __adeos_irq_regs;
+
+asmlinkage void asm_do_IRQ(int irq,
+		       struct pt_regs *regs);
+
+
+extern struct irqchip __adeos_std_irq_chip[NR_IRQS];
+
+static void __adeos_override_irq_mask (unsigned irq)
+
+{
+    unsigned long adflags, hwflags;
+    adeos_declare_cpuid;
+
+    adeos_hw_local_irq_save(hwflags);
+   adflags = adeos_test_and_stall_pipeline();
+#ifdef CONFIG_PREEMPT
+    preempt_disable();
+#endif /* CONFIG_PREEMPT */
+    __adeos_std_irq_chip[irq].mask(irq);
+    __adeos_lock_irq(adp_cpu_current[cpuid],cpuid,irq);
+#ifdef CONFIG_PREEMPT
+    preempt_enable_no_resched();
+#endif /* CONFIG_PREEMPT */
+    adeos_restore_pipeline_nosync(adp_cpu_current[cpuid],adflags,cpuid);
+    adeos_hw_local_irq_restore(hwflags);
+}
+
+static void __adeos_override_irq_unmask (unsigned irq)
+
+{
+    unsigned long adflags, hwflags;
+    adeos_declare_cpuid;
+
+    adeos_hw_local_irq_save(hwflags);
+    adflags = adeos_test_and_stall_pipeline();
+#ifdef CONFIG_PREEMPT
+    preempt_disable();
+#endif /* CONFIG_PREEMPT */
+    __adeos_unlock_irq(adp_cpu_current[cpuid],irq);
+    __adeos_std_irq_chip[irq].unmask(irq);
+#ifdef CONFIG_PREEMPT
+    preempt_enable_no_resched();
+#endif /* CONFIG_PREEMPT */
+    adeos_restore_pipeline_nosync(adp_cpu_current[cpuid],adflags,cpuid);
+    adeos_hw_local_irq_restore(hwflags);
+}
+
+static void __adeos_override_irq_mask_ack (unsigned irq)
+
+{
+    unsigned long adflags, hwflags;
+    adeos_declare_cpuid;
+
+    adeos_hw_local_irq_save(hwflags);
+    adflags = adeos_test_and_stall_pipeline();
+#ifdef CONFIG_PREEMPT
+    preempt_disable();
+#endif /* CONFIG_PREEMPT */
+    __adeos_std_irq_chip[irq].ack(irq);
+    /* No locking here, since this would prevent to sync the stage. */
+#ifdef CONFIG_PREEMPT
+    preempt_enable_no_resched();
+#endif /* CONFIG_PREEMPT */
+    adeos_restore_pipeline_nosync(adp_cpu_current[cpuid],adflags,cpuid);
+    adeos_hw_local_irq_restore(hwflags);
+}
+
+static void __adeos_override_irq_ack(unsigned irq) { }
+
+static int __adeos_ack_irq (unsigned irq)
+
+{
+    struct irqdesc *desc = irq_desc + irq;
+      __adeos_std_irq_chip[irq].ack(irq);
+      return 1;
+}
+
+/* __adeos_enable_pipeline() -- Take over the interrupt control from
+   the root domain (i.e. Linux). After this routine has returned, all
+   interrupts go through the pipeline. */
+
+void __adeos_enable_pipeline (void)
+
+{
+
+    unsigned long flags;
+    unsigned irq;
+
+    flags = adeos_critical_enter(NULL);
+
+    /* First, virtualize all interrupts from the root domain. */
+
+    for (irq = 0; irq < NR_IRQS; irq++)
+	adeos_virtualize_irq(irq,
+			   (void (*)(unsigned))&asm_do_IRQ,
+			     __adeos_ack_irq,
+			     IPIPE_HANDLE_MASK|IPIPE_PASS_MASK);
+
+    /* Interpose on the IRQ control routines so we can make them
+       atomic using hw masking and prevent the interrupt log from
+       being untimely flushed. */
+
+
+    for (irq = 0; irq < NR_IRQS; irq++)
+	__adeos_std_irq_chip[irq] = *irq_desc[irq].chip;
+
+    /* The original controller structs are often shared, so we first
+       save them all before changing any of them. Notice that we don't
+       redirect the ack handler since the relevant IC management code
+       is already Adeos-aware. */
+
+    for (irq = 0; irq < NR_IRQS; irq++)
+	{
+	if (irq_desc[irq].chip->mask != NULL)       {
+	    irq_desc[irq].chip->mask = __adeos_override_irq_mask;
+ 	}
+	 if (irq_desc[irq].chip->unmask != NULL)         {
+	    irq_desc[irq].chip->unmask = __adeos_override_irq_unmask;
+	}
+	if (irq_desc[irq].chip->ack != NULL)             {
+ //	 irq_desc[irq].chip->ack = __adeos_override_irq_ack;
+ 	irq_desc[irq].chip->ack = __adeos_override_irq_mask_ack;
+	}
+	}
+
+#ifdef CONFIG_ADEOS_MODULE
+    adp_pipelined = 1;
+#endif /* CONFIG_ADEOS_MODULE */
+
+    adeos_critical_exit(flags);
+
+}
+
+/* __adeos_disable_pipeline() -- Disengage the pipeline. */
+
+void __adeos_disable_pipeline (void)
+
+{
+    unsigned long flags;
+    unsigned irq;
+
+    flags = adeos_critical_enter(NULL);
+
+    /* Restore interrupt controllers. */
+
+    for (irq = 0; irq < NR_IRQS; irq++)
+	*irq_desc[irq].chip = __adeos_std_irq_chip[irq];
+
+#ifdef CONFIG_ADEOS_MODULE
+    adp_pipelined = 0;
+#endif /* CONFIG_ADEOS_MODULE */
+
+    adeos_critical_exit(flags);
+}
+
+/* adeos_virtualize_irq_from() -- Attach a handler (and optionally a
+   hw acknowledge routine) to an interrupt for the given domain. */
+
+int adeos_virtualize_irq_from (adomain_t *adp,
+			       unsigned irq,
+			       void (*handler)(unsigned irq),
+			       int (*acknowledge)(unsigned irq),
+			       unsigned modemask)
+{
+    unsigned long flags;
+    int err;
+
+    if (irq >= IPIPE_NR_IRQS)
+	return -EINVAL;
+
+    if (adp->irqs[irq].control & IPIPE_SYSTEM_MASK)
+	return -EPERM;
+
+    adeos_spin_lock_irqsave(&__adeos_pipelock,flags);
+
+    if (handler != NULL)
+	{
+	/* A bit of hack here: if we are re-virtualizing an IRQ just
+	   to change the acknowledge routine by passing the special
+	   ADEOS_SAME_HANDLER value, then allow to recycle the current
+	   handler for the IRQ. This allows Linux device drivers
+	   managing shared IRQ lines to call adeos_virtualize_irq() in
+	   addition to request_irq() just for the purpose of
+	   interposing their own shared acknowledge routine. */
+
+	if (handler == ADEOS_SAME_HANDLER)
+	    {
+	    handler = adp->irqs[irq].handler;
+
+	    if (handler == NULL)
+		{
+		err = -EINVAL;
+		goto unlock_and_exit;
+		}
+	    }
+	else if ((modemask & IPIPE_EXCLUSIVE_MASK) != 0 &&
+		 adp->irqs[irq].handler != NULL)
+	    {
+	    err = -EBUSY;
+	    goto unlock_and_exit;
+	    }
+
+	if ((modemask & (IPIPE_SHARED_MASK|IPIPE_PASS_MASK)) == IPIPE_SHARED_MASK)
+	    {
+	    err = -EINVAL;
+	    goto unlock_and_exit;
+	    }
+
+	if ((modemask & IPIPE_STICKY_MASK) != 0)
+	    modemask |= IPIPE_HANDLE_MASK;
+	}
+    else
+	modemask &= ~(IPIPE_HANDLE_MASK|IPIPE_STICKY_MASK|IPIPE_SHARED_MASK);
+
+    if (acknowledge == NULL)
+	{
+	if ((modemask & IPIPE_SHARED_MASK) == 0)
+	    /* Acknowledge handler unspecified -- this is ok in
+	       non-shared management mode, but we will force the use
+	       of the Linux-defined handler instead. */
+	    acknowledge = adp_root->irqs[irq].acknowledge;
+	else
+	    {
+	    /* A valid acknowledge handler to be called in shared mode
+	       is required when declaring a shared IRQ. */
+	    err = -EINVAL;
+	    goto unlock_and_exit;
+	    }
+	}
+
+    adp->irqs[irq].handler = handler;
+    adp->irqs[irq].acknowledge = acknowledge;
+    adp->irqs[irq].control = modemask;
+
+    if (irq < NR_IRQS &&
+	handler != NULL &&
+	!adeos_virtual_irq_p(irq) &&
+	(modemask & IPIPE_ENABLE_MASK) != 0)
+	{
+	if (adp != adp_current)
+	    {
+	    /* IRQ enable/disable state is domain-sensitive, so we may
+	       not change it for another domain. What is allowed
+	       however is forcing some domain to handle an interrupt
+	       source, by passing the proper 'adp' descriptor which
+	       thus may be different from adp_current. */
+	    err = -EPERM;
+	    goto unlock_and_exit;
+	    }
+
+	enable_irq(irq);
+	}
+
+    err = 0;
+
+unlock_and_exit:
+
+    adeos_spin_unlock_irqrestore(&__adeos_pipelock,flags);
+
+    return err;
+}
+
+/* adeos_control_irq() -- Change an interrupt mode. This affects the
+   way a given interrupt is handled by ADEOS for the current
+   domain. setmask is a bitmask telling whether:
+   - the interrupt should be passed to the domain (IPIPE_HANDLE_MASK),
+     and/or
+   - the interrupt should be passed down to the lower priority domain(s)
+     in the pipeline (IPIPE_PASS_MASK).
+   This leads to four possibilities:
+   - PASS only => Ignore the interrupt
+   - HANDLE only => Terminate the interrupt (process but don't pass down)
+   - PASS + HANDLE => Accept the interrupt (process and pass down)
+   - <none> => Discard the interrupt
+   - DYNAMIC is currently an alias of HANDLE since it marks an interrupt
+   which is processed by the current domain but not implicitely passed
+   down to the pipeline, letting the domain's handler choose on a case-
+   by-case basis whether the interrupt propagation should be forced
+   using adeos_propagate_irq().
+   clrmask clears the corresponding bits from the control field before
+   setmask is applied.
+*/
+
+int adeos_control_irq (unsigned irq,
+		       unsigned clrmask,
+		       unsigned setmask)
+{
+    struct irqdesc *desc;
+    unsigned long flags;
+
+    if (irq >= IPIPE_NR_IRQS)
+	return -EINVAL;
+
+    if (adp_current->irqs[irq].control & IPIPE_SYSTEM_MASK)
+	return -EPERM;
+
+    if (((setmask|clrmask) & IPIPE_SHARED_MASK) != 0)
+	return -EINVAL;
+
+    desc = irq_desc + irq;
+
+    if (adp_current->irqs[irq].handler == NULL)
+	setmask &= ~(IPIPE_HANDLE_MASK|IPIPE_STICKY_MASK);
+
+    if ((setmask & IPIPE_STICKY_MASK) != 0)
+	setmask |= IPIPE_HANDLE_MASK;
+
+    if ((clrmask & (IPIPE_HANDLE_MASK|IPIPE_STICKY_MASK)) != 0)	/* If one goes, both go. */
+	clrmask |= (IPIPE_HANDLE_MASK|IPIPE_STICKY_MASK);
+
+    adeos_spin_lock_irqsave(&__adeos_pipelock,flags);
+
+    adp_current->irqs[irq].control &= ~clrmask;
+    adp_current->irqs[irq].control |= setmask;
+
+    if ((setmask & IPIPE_ENABLE_MASK) != 0)
+	enable_irq(irq);
+    else if ((clrmask & IPIPE_ENABLE_MASK) != 0)
+	disable_irq(irq);
+
+    adeos_spin_unlock_irqrestore(&__adeos_pipelock,flags);
+
+    return 0;
+}
+
+static inline unsigned long __current_domain_access_control (void)
+
+{
+    unsigned long domain_access_control;
+    __asm__ __volatile__ ("mrc p15, 0, %0, c3, c0" : "=r" (domain_access_control));
+    return domain_access_control;
+}
+
+void __adeos_init_domain (adomain_t *adp, adattr_t *attr)
+
+{
+    int estacksz = attr->estacksz > 0 ? attr->estacksz : 8192, _cpuid;
+    unsigned long init_arch_flags, init_domain_access_control;
+    adeos_declare_cpuid;
+
+    adeos_load_cpuid();
+    adeos_hw_local_irq_flags(init_arch_flags);
+    init_domain_access_control = __current_domain_access_control();
+
+    for (_cpuid = 0; _cpuid < smp_num_cpus; _cpuid++)
+	{
+	int **psp = &adp->esp[_cpuid];
+
+	adp->estackbase[_cpuid] = (int *)kmalloc(estacksz,GFP_KERNEL);
+
+	if (adp->estackbase[_cpuid] == NULL)
+	    panic("Adeos: No memory for domain stack on CPU #%d",_cpuid);
+
+	adp->esp[_cpuid] = adp->estackbase[_cpuid];
+	**psp = 0;
+	*psp = (int *)(((unsigned long)*psp + estacksz - 60) & ~0x3);
+	*--(*psp) = (int)attr->entry; /* r14=lr */
+	*--(*psp) = 0;		/* r11=fp */
+	*--(*psp) = 0;		/* r10=sl */
+	*--(*psp) = 0;		/* r9 */
+	*--(*psp) = 0;		/* r8 */
+	*--(*psp) = 0;		/* r7 */
+	*--(*psp) = 0;		/* r6 */
+	*--(*psp) = 0;		/* r5 */
+	*--(*psp) = 0;		/* r4 */
+	*--(*psp) = 0;		/* r3 */
+	*--(*psp) = 0;		/* r2 */
+	*--(*psp) = 0;		/* r1 */
+	*--(*psp) = (_cpuid == cpuid); /* r0=iflag */
+	*--(*psp) = init_arch_flags;	/* cpsr_SVC */
+	*--(*psp) = init_domain_access_control;
+	}
+}
+
+void __adeos_cleanup_domain (adomain_t *adp)
+
+{
+    adeos_unstall_pipeline_from(adp);
+
+    if (adp->estackbase[0] != NULL)
+	kfree(adp->estackbase[0]);
+}
+
+int adeos_get_sysinfo (adsysinfo_t *info)
+
+{
+    info->ncpus = 1;
+    info->cpufreq = CLOCK_TICK_RATE;
+    info->archdep.tmirq = ADEOS_TIMER_IRQ;
+
+    return 0;
+}
+
+int adeos_tune_timer (unsigned long ns, int flags)
+
+{
+    unsigned long x, hz;
+
+    if (flags & ADEOS_RESET_TIMER)
+	hz = HZ;
+    else
+	{
+	if (ns < 50000)	/* FIXME: this needs to be defined more accurately */
+	    return -EINVAL;
+
+	hz = 1000000000 / ns;
+	}
+
+    adeos_hw_local_irq_save(x);
+
+    __adeos_tune_timer(hz);
+
+    adeos_hw_local_irq_restore(x);
+
+    return 0;
+}
+
+/* adeos_trigger_ipi() -- Send the ADEOS service IPI to other
+   processors. Not implemented for this architecture. */
+
+int adeos_trigger_ipi (int _cpuid)
+
+{
+    printk(KERN_WARNING "Adeos: Call to unimplemented adeos_trigger_ipi() from %s\n",adp_current->name);
+    return 0;
+}
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/adeos/generic.c linux-2.6.8.1-tcl1-adeos/adeos/generic.c
--- linux-2.6.8.1-tcl1/adeos/generic.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/adeos/generic.c	2005-11-18 14:18:43.000000000 +0000
@@ -0,0 +1,796 @@
+/*
+ *   linux/adeos/generic.c
+ *
+ *   Copyright (C) 2002 Philippe Gerum.
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version.
+ *
+ *   This program is 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 this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *   Architecture-independent ADEOS services.
+ */
+
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/adeos.h>
+#include <linux/irq.h>
+
+MODULE_DESCRIPTION("Adeos nanokernel");
+MODULE_AUTHOR("Philippe Gerum");
+MODULE_LICENSE("GPL");
+
+extern spinlock_t __adeos_pipelock;
+
+extern struct list_head __adeos_pipeline;
+
+/* adeos_register_domain() -- Add a new domain to the system. All
+   client domains must call this routine to register themselves to
+   ADEOS before using its services. */
+
+int adeos_register_domain (adomain_t *adp, adattr_t *attr)
+
+{
+    struct list_head *pos;
+    unsigned long flags;
+    int n;
+    if (adp_current != adp_root) 
+	{
+	printk(KERN_WARNING "Adeos: Only the root domain may register a new domain.\n");
+	return -EPERM;
+	}
+
+    flags = adeos_critical_enter(NULL);
+
+    list_for_each(pos,&__adeos_pipeline) {
+    	adomain_t *_adp = list_entry(pos,adomain_t,p_link);
+	if (_adp->domid == attr->domid)
+            break;
+    }
+
+    adeos_critical_exit(flags);
+
+    if (pos != &__adeos_pipeline)
+	/* A domain with the given id already exists -- fail. */
+	return -EBUSY;
+
+    for (n = 0; n < ADEOS_NR_CPUS; n++)
+	adp->cpudata[n].status = 0;
+
+    /* A special case for domains who won't process events (i.e. no
+       entry). We have to mark them as suspended so that
+       adeos_suspend_domain() won't consider them, unless they
+       _actually_ receive events, which would lead to a panic
+       situation since they have no stack context... :o> */
+
+    for (n = 0; n < ADEOS_NR_CPUS; n++)
+	{
+	set_bit(IPIPE_SLEEP_FLAG,&adp->cpudata[n].status);
+
+	if (attr->entry == NULL)
+	    adp->estackbase[n] = NULL;
+	}
+
+    adp->name = attr->name;
+    adp->priority = attr->priority;
+    adp->domid = attr->domid;
+    adp->dswitch = attr->dswitch;
+     adp->flags = 0;
+    adp->ptd_setfun = attr->ptdset;
+    adp->ptd_getfun = attr->ptdget;
+    adp->ptd_keymap = 0;
+    adp->ptd_keycount = 0;
+    adp->ptd_keymax = attr->nptdkeys;
+
+    for (n = 0; n < ADEOS_NR_EVENTS; n++)
+	/* Event handlers must be cleared before the i-pipe stage is
+	   inserted since an exception may occur on behalf of the new
+	   emerging domain. */
+	adp->events[n].handler = NULL;
+
+    if (attr->entry != NULL)
+	__adeos_init_domain(adp,attr);
+
+    /* Insert the domain in the interrupt pipeline last, so it won't
+       be resumed for processing interrupts until it has a valid stack
+       context. */
+
+    __adeos_init_stage(adp);
+
+    INIT_LIST_HEAD(&adp->p_link);
+
+    flags = adeos_critical_enter(NULL);
+
+    list_for_each(pos,&__adeos_pipeline) {
+    	adomain_t *_adp = list_entry(pos,adomain_t,p_link);
+	if (adp->priority > _adp->priority)
+            break;
+    }
+
+    list_add_tail(&adp->p_link,pos);
+
+    adeos_critical_exit(flags);
+
+    printk(KERN_WARNING "Adeos: Domain %s registered.\n",adp->name);
+
+    /* Finally, allow the new domain to perform its initialization
+       chores on behalf of its own stack context. */
+
+    if (attr->entry != NULL)
+	{
+	adeos_declare_cpuid;
+
+	adeos_get_cpu(flags);
+
+	__adeos_switch_to(adp,cpuid);
+
+	adeos_load_cpuid();	/* Processor might have changed. */
+
+	if (!test_bit(IPIPE_STALL_FLAG,&adp_root->cpudata[cpuid].status) &&
+	    adp_root->cpudata[cpuid].irq_pending_hi != 0)
+	    __adeos_sync_stage();
+
+	adeos_put_cpu(flags);
+	}
+
+    return 0;
+}
+
+/* adeos_unregister_domain() -- Remove a domain from the system. All
+   client domains must call this routine to unregister themselves from
+   the ADEOS layer. */
+
+int adeos_unregister_domain (adomain_t *adp)
+
+{
+    unsigned long flags;
+    unsigned event;
+
+    if (adp_current != adp_root)
+	{
+	printk(KERN_WARNING "Adeos: Only the root domain may unregister a domain.\n");
+	return -EPERM;
+	}
+
+    if (adp == adp_root)
+	{
+	printk(KERN_WARNING "Adeos: Cannot unregister the root domain.\n");
+	return -EPERM;
+	}
+
+    for (event = 0; event < ADEOS_NR_EVENTS; event++)
+	/* Need this to update the monitor count. */
+	adeos_catch_event(event,NULL);
+
+#ifdef CONFIG_SMP
+    {
+    unsigned irq;
+    int _cpuid;
+
+    /* In the SMP case, wait for the logged events to drain on other
+       processors before eventually removing the domain from the
+       pipeline. */
+
+    adeos_unstall_pipeline_from(adp);
+
+    flags = adeos_critical_enter(NULL);
+
+    for (irq = 0; irq < IPIPE_NR_IRQS; irq++)
+	{
+	clear_bit(IPIPE_HANDLE_FLAG,&adp->irqs[irq].control);
+	clear_bit(IPIPE_STICKY_FLAG,&adp->irqs[irq].control);
+	set_bit(IPIPE_PASS_FLAG,&adp->irqs[irq].control);
+	}
+
+    adeos_critical_exit(flags);
+
+    for (_cpuid = 0; _cpuid < smp_num_cpus; _cpuid++)
+	{
+	for (irq = 0; irq < IPIPE_NR_IRQS; irq++)
+	    while (adp->cpudata[_cpuid].irq_hits[irq] > 0)
+		cpu_relax();
+
+	while (test_bit(IPIPE_XPEND_FLAG,&adp->cpudata[_cpuid].status))
+	    cpu_relax();
+
+	while (!test_bit(IPIPE_SLEEP_FLAG,&adp->cpudata[_cpuid].status))
+	     cpu_relax();
+	}
+    }
+#endif /* CONFIG_SMP */
+
+    /* Simply remove the domain from the pipeline and we are almost
+       done. */
+
+    flags = adeos_critical_enter(NULL);
+    list_del_init(&adp->p_link);
+    adeos_critical_exit(flags);
+
+    __adeos_cleanup_domain(adp);
+
+    printk(KERN_WARNING "Adeos: Domain %s unregistered.\n",adp->name);
+
+    return 0;
+}
+
+/* adeos_renice_domain() -- Change the priority of the current
+   domain. This affects the position of the domain in the interrupt
+   pipeline. The greater the priority value, the earlier the domain is
+   informed of incoming events when the pipeline is processed. This
+   routine causes a round-robin effect if newpri == oldpri. */
+
+void adeos_renice_domain (int newpri)
+
+{
+    adomain_t *adp, *nadp = NULL;
+    unsigned long lflags, xflags;
+    struct list_head *pos;
+    adeos_declare_cpuid;
+
+    /* We do want adeos_critical_exit() to leave the IRQs masked, so
+       we first clear the interrupt bit before calling
+       adeos_critical_enter(). */
+
+    adeos_lock_cpu(lflags);
+
+    adp = adp_cpu_current[cpuid];
+
+    xflags = adeos_critical_enter(NULL);
+
+    list_del_init(&adp->p_link);
+
+    list_for_each(pos,&__adeos_pipeline) {
+    	adomain_t *_adp = list_entry(pos,adomain_t,p_link);
+
+	if (newpri > _adp->priority)
+            break;
+
+	/* While scanning the pipeline from its head to the current
+	   domain's new position, pick the first domain which is
+	   entitled to preempt us. Such domain must be either:
+	   o in a preempted state (i.e. !sleeping),
+	   o or sleeping and unstalled with events to process. */
+
+	if (nadp == NULL &&
+	    (!test_bit(IPIPE_SLEEP_FLAG,&_adp->cpudata[cpuid].status) ||
+	     (!test_bit(IPIPE_STALL_FLAG,&_adp->cpudata[cpuid].status) &&
+	      _adp->cpudata[cpuid].irq_pending_hi != 0) ||
+	     test_bit(IPIPE_XPEND_FLAG,&_adp->cpudata[cpuid].status)))
+	    nadp = _adp;
+    }
+
+    list_add_tail(&adp->p_link,pos);
+    adp->priority = newpri;
+
+    /* On SMP systems, we release the other CPUs but we still keep the
+       local IRQs masked so that we can't jump to a stale domain. */
+
+    adeos_critical_exit(xflags);
+
+    if (nadp == NULL)
+	goto release_cpu_and_exit;
+
+    __adeos_switch_to(nadp,cpuid);
+
+    adeos_load_cpuid(); /* Processor might have changed. */
+
+    /* Try sync'ing pending interrupts on return from our preemption
+       point. */
+
+    if (!test_bit(IPIPE_STALL_FLAG,&adp_cpu_current[cpuid]->cpudata[cpuid].status) &&
+	adp_cpu_current[cpuid]->cpudata[cpuid].irq_pending_hi != 0)
+	__adeos_sync_stage();
+
+    /* Note that we only need to sync interrupts here, since other
+       kind of events (i.e. synchronous ones) cannot flow across the
+       domain which triggers them down the pipeline. Since a more
+       prioritary domain was running up to now, there is no chance for
+       us to have such event pending. */
+
+release_cpu_and_exit:
+
+    adeos_unlock_cpu(lflags);
+}
+
+int __adeos_schedule_irq (unsigned irq, struct list_head *head)
+
+{
+    struct list_head *ln;
+    unsigned long flags;
+    adeos_declare_cpuid;
+
+    if (irq >= IPIPE_NR_IRQS ||
+	(adeos_virtual_irq_p(irq) && !test_bit(irq - IPIPE_VIRQ_BASE,&__adeos_virtual_irq_map)))
+	return -EINVAL;
+
+    adeos_lock_cpu(flags);
+
+    ln = head;
+
+    while (ln != &__adeos_pipeline)
+	{
+	adomain_t *adp = list_entry(ln,adomain_t,p_link);
+
+	if (test_bit(IPIPE_HANDLE_FLAG,&adp->irqs[irq].control))
+	    {
+	    adp->cpudata[cpuid].irq_hits[irq]++;
+	    __adeos_set_irq_bit(adp,cpuid,irq);
+	    adeos_unlock_cpu(flags);
+	    return 1;
+	    }
+
+	ln = adp->p_link.next;
+	}
+
+    adeos_unlock_cpu(flags);
+
+    return 0;
+}
+
+/* adeos_propagate_irq() -- Force a given IRQ propagation on behalf of
+   a running interrupt handler to the next domain down the pipeline.
+   Returns non-zero if a domain has received the interrupt
+   notification, zero otherwise.
+   This call is useful for handling shared interrupts among domains.
+   e.g. pipeline = [domain-A]---[domain-B]...
+   Both domains share IRQ #X.
+   - domain-A handles IRQ #X but does not pass it down (i.e. Terminate
+   or Dynamic interrupt control mode)
+   - domain-B handles IRQ #X (i.e. Terminate or Accept interrupt
+   control modes).
+   When IRQ #X is raised, domain-A's handler determines whether it
+   should process the interrupt by identifying its source. If not,
+   adeos_propagate_irq() is called so that the next domain down the
+   pipeline which handles IRQ #X is given a chance to process it. This
+   process can be repeated until the end of the pipeline is
+   reached. */
+
+int adeos_propagate_irq (unsigned irq) {
+
+    return __adeos_schedule_irq(irq,adp_current->p_link.next);
+}
+
+/* adeos_schedule_irq() -- Almost the same as adeos_propagate_irq(),
+   but attempts to pend the interrupt for the current domain first. */
+
+int adeos_schedule_irq (unsigned irq) {
+
+    return __adeos_schedule_irq(irq,&adp_current->p_link);
+}
+
+unsigned long adeos_set_irq_affinity (unsigned irq, unsigned long cpumask)
+
+{
+#ifdef CONFIG_SMP
+     if (irq >= IPIPE_NR_XIRQS)
+	 /* Allow changing affinity of external IRQs only. */
+	 return 0;
+
+     if (smp_num_cpus > 1)
+	 /* Allow changing affinity of external IRQs only. */
+	 return __adeos_set_irq_affinity(irq,cpumask);
+#endif /* CONFIG_SMP */
+
+    return 0;
+}
+
+/* adeos_free_irq() -- Return a previously allocated virtual/soft
+   pipelined interrupt to the pool of allocatable interrupts. */
+
+int adeos_free_irq (unsigned irq)
+
+{
+    if (irq >= IPIPE_NR_IRQS)
+	return -EINVAL;
+
+    clear_bit(irq - IPIPE_VIRQ_BASE,&__adeos_virtual_irq_map);
+
+    return 0;
+}
+
+/* adeos_unstall_pipeline_from() -- Unstall the interrupt pipeline and
+   synchronize pending events from a given domain. */
+
+void adeos_unstall_pipeline_from (adomain_t *adp)
+
+{
+    struct list_head *pos;
+    unsigned long flags;
+    adeos_declare_cpuid;
+
+    adeos_get_cpu(flags);
+
+    __clear_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+
+    if (adp == adp_cpu_current[cpuid])
+	{
+	if (adp->cpudata[cpuid].irq_pending_hi != 0)
+	    __adeos_sync_stage();
+
+	goto release_cpu_and_exit;
+	}
+
+    /* Attempt to flush all events that might be pending at the
+       unstalled domain level. This code is roughly lifted from
+       drivers/adeos/x86.c:__adeos_walk_pipeline(). */
+
+    list_for_each(pos,&__adeos_pipeline) {
+
+    	adomain_t *_adp = list_entry(pos,adomain_t,p_link);
+
+	if (test_bit(IPIPE_STALL_FLAG,&_adp->cpudata[cpuid].status))
+	    break; /* Stalled stage -- do not go further. */
+
+	if (_adp->cpudata[cpuid].irq_pending_hi != 0)
+	    {
+	    /* Since the critical IPI might be triggered by the
+	       following actions, the current domain might not be
+	       linked to the pipeline anymore after its handler
+	       returns on SMP boxen, even if the domain remains valid
+	       (see adeos_unregister_domain()), so don't make any
+	       hazardous assumptions here. */
+
+	    if (_adp == adp_cpu_current[cpuid])
+		__adeos_sync_stage();
+	    else
+		{
+		__adeos_switch_to(_adp,cpuid);
+
+		adeos_load_cpuid(); /* Processor might have changed. */
+
+		if (!test_bit(IPIPE_STALL_FLAG,&adp_cpu_current[cpuid]->cpudata[cpuid].status) &&
+		    adp_cpu_current[cpuid]->cpudata[cpuid].irq_pending_hi != 0)
+		    __adeos_sync_stage();
+		}
+
+	    break;
+	    }
+	else if (_adp == adp_cpu_current[cpuid])
+	    break;
+    }
+
+release_cpu_and_exit:
+
+    adeos_put_cpu(flags);
+}
+
+/* adeos_catch_event_from() -- Interpose an event handler starting
+   from a given domain. */
+
+int adeos_catch_event_from (adomain_t *adp, unsigned event, void (*handler)(adevinfo_t *))
+
+{
+    if (event >= ADEOS_NR_EVENTS)
+	return -EINVAL;
+
+    if (!xchg(&adp->events[event].handler,handler))
+	{
+	if (handler)
+	    __adeos_event_monitors[event]++;
+	}
+    else if (!handler)
+	__adeos_event_monitors[event]--;
+
+    return 0;
+}
+
+void (*adeos_hook_dswitch(void (*handler)(void))) (void) {
+
+    return (void (*)(void))xchg(&adp_current->dswitch,handler);
+}
+
+void adeos_init_attr (adattr_t *attr)
+
+{
+    attr->name = "Anonymous";
+    attr->domid = 1;
+    attr->entry = NULL;
+    attr->estacksz = 0;	/* Let ADEOS choose a reasonable stack size */
+    attr->priority = ADEOS_ROOT_PRI;
+    attr->dswitch = NULL;
+    attr->nptdkeys = 0;
+    attr->ptdset = NULL;
+    attr->ptdget = NULL;
+}
+
+int adeos_alloc_ptdkey (void)
+
+{
+    unsigned long flags;
+    int key = -1;
+
+    adeos_spin_lock_irqsave(&__adeos_pipelock,flags);
+
+    if (adp_current->ptd_keycount < adp_current->ptd_keymax)
+	{
+	key = ffz(adp_current->ptd_keymap);
+	set_bit(key,&adp_current->ptd_keymap);
+	adp_current->ptd_keycount++;
+	}
+
+    adeos_spin_unlock_irqrestore(&__adeos_pipelock,flags);
+
+    return key;
+}
+
+int adeos_free_ptdkey (int key)
+
+{
+    unsigned long flags;
+
+    if (key < 0 || key >= adp_current->ptd_keymax)
+	return -EINVAL;
+
+    adeos_spin_lock_irqsave(&__adeos_pipelock,flags);
+
+    if (test_and_clear_bit(key,&adp_current->ptd_keymap))
+	adp_current->ptd_keycount--;
+
+    adeos_spin_unlock_irqrestore(&__adeos_pipelock,flags);
+
+    return 0;
+}
+
+int adeos_set_ptd (int key, void *value)
+
+{
+    if (key < 0 || key >= adp_current->ptd_keymax)
+	return -EINVAL;
+
+    if (!adp_current->ptd_setfun)
+	{
+	printk(KERN_WARNING "Adeos: No ptdset hook for %s\n",adp_current->name);
+	return -EINVAL;
+	}
+
+    adp_current->ptd_setfun(key,value);
+
+    return 0;
+}
+
+void *adeos_get_ptd (int key)
+
+{
+    if (key < 0 || key >= adp_current->ptd_keymax)
+	return NULL;
+
+    if (!adp_current->ptd_getfun)
+	{
+	printk(KERN_WARNING "Adeos: No ptdget hook for %s\n",adp_current->name);
+	return NULL;
+	}
+
+    return adp_current->ptd_getfun(key);
+}
+
+int adeos_init_mutex (admutex_t *mutex)
+
+{
+    admutex_t initm = ADEOS_MUTEX_UNLOCKED;
+    *mutex = initm;
+    return 0;
+}
+
+int adeos_destroy_mutex (admutex_t *mutex)
+
+{
+    if (!adeos_spin_trylock(&mutex->lock) &&
+	adp_current != adp_root &&
+	mutex->owner != adp_current)
+	return -EBUSY;  
+
+    return 0;
+}
+
+static inline void __adeos_sleepon_mutex (admutex_t *mutex, adomain_t *sleeper, int cpuid)
+
+{
+    adomain_t *owner = mutex->owner;
+
+    /* Make the current domain (== sleeper) wait for the mutex to be
+       released. Adeos' pipelined scheme guarantees that the new
+       sleeper _is_ more prioritary than any aslept domain since we
+       have stalled each sleeper's stage. Must be called with local hw
+       interrupts off. */
+
+    sleeper->m_link = mutex->sleepq;
+    mutex->sleepq = sleeper;
+    __adeos_switch_to(owner,cpuid);
+    mutex->owner = sleeper;
+    adeos_spin_unlock(&mutex->lock);
+}
+
+static inline void __adeos_signal_mutex (admutex_t *mutex, int cpuid)
+
+{
+    adomain_t *sleeper;
+
+    /* Wake up first most prioritary sleeper. Must be called with
+       local hw interrupts off. */
+
+    sleeper = mutex->sleepq;
+    mutex->sleepq = sleeper->m_link;
+    __adeos_switch_to(sleeper,cpuid);
+}
+
+unsigned long adeos_lock_mutex (admutex_t *mutex)
+
+{
+    unsigned long flags, hwflags;
+    adeos_declare_cpuid;
+    adomain_t *adp;
+
+    if (unlikely(!adp_pipelined))
+	{
+	adeos_hw_local_irq_save(hwflags);
+	flags = adeos_hw_test_iflag(hwflags);
+	adeos_spin_lock(&mutex->lock);
+	return flags;
+	}
+
+    adeos_lock_cpu(hwflags);
+
+    adp = adp_cpu_current[cpuid];
+
+    flags = test_and_set_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+
+    /* Two cases to handle here on SMP systems, only one for UP:
+       1) in case of a conflicting access from a prioritary domain
+       running on the same cpu, make this domain sleep on the mutex,
+       and resume the current owner so it can release the lock asap.
+       2) in case of a conflicting access from any domain on a
+       different cpu than the current owner's, simply enter a spinning
+       loop. Note that testing mutex->owncpu is safe since it is only
+       changed by the current owner, and set to -1 when the mutex is
+       unlocked. */
+
+#ifdef CONFIG_SMP
+    while (!adeos_spin_trylock(&mutex->lock))
+	{
+	if (mutex->owncpu == cpuid)
+	    {
+	    __adeos_sleepon_mutex(mutex,adp,cpuid);
+	    adeos_load_cpuid();
+	    }
+	}
+
+    mutex->owncpu = cpuid;
+#else  /* !CONFIG_SMP */
+    while (mutex->owner != NULL && mutex->owner != adp)
+	__adeos_sleepon_mutex(mutex,adp,cpuid);
+#endif /* CONFIG_SMP */
+
+    mutex->owner = adp;
+
+    adeos_unlock_cpu(hwflags);
+
+    return flags;
+}
+
+void adeos_unlock_mutex (admutex_t *mutex, unsigned long flags)
+
+{
+    unsigned long hwflags;
+    adeos_declare_cpuid;
+    adomain_t *adp;
+
+    if (unlikely(!adp_pipelined))
+	{
+	adeos_spin_unlock(&mutex->lock);
+
+	if (flags)
+	    adeos_hw_cli();
+	else
+	    adeos_hw_sti();
+
+	return;
+	}
+
+#ifdef CONFIG_SMP
+    mutex->owncpu = -1;
+#endif /* CONFIG_SMP */
+
+    if (!flags)
+	adeos_hw_sti();	/* Absolutely needed. */
+
+    adeos_lock_cpu(hwflags);
+
+    if (unlikely(mutex->sleepq != NULL))
+	{
+	__adeos_signal_mutex(mutex,cpuid); /* Wake up one sleeper. */
+	adeos_load_cpuid();
+	}
+    else
+	{
+	mutex->owner = NULL;
+	adeos_spin_unlock(&mutex->lock);
+	}
+
+    adp = adp_cpu_current[cpuid];
+
+    if (flags)
+	set_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+    else
+	{
+	__clear_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+
+	if (adp->cpudata[cpuid].irq_pending_hi != 0)
+	    __adeos_sync_stage();
+	}
+
+    adeos_unlock_cpu(hwflags);
+}
+
+void __adeos_takeover (void)
+
+{
+    __adeos_enable_pipeline();
+    printk(KERN_WARNING "Adeos: Pipelining started.\n");
+}
+
+#ifdef CONFIG_ADEOS_MODULE
+
+static int __init adeos_init_module (void)
+
+{
+	adeos_declare_cpuid;
+   __adeos_takeover();
+    return 0;
+}
+
+static void __exit adeos_exit_module (void)
+
+{
+   __adeos_disable_pipeline();
+    printk(KERN_WARNING "Adeos: Pipelining stopped.\n");
+}
+
+module_init(adeos_init_module);
+module_exit(adeos_exit_module);
+
+#endif /* CONFOG_ADEOS_MODULE */
+
+EXPORT_SYMBOL(adeos_register_domain);
+EXPORT_SYMBOL(adeos_unregister_domain);
+EXPORT_SYMBOL(adeos_renice_domain);
+EXPORT_SYMBOL(adeos_virtualize_irq_from);
+EXPORT_SYMBOL(adeos_control_irq);
+EXPORT_SYMBOL(adeos_propagate_irq);
+EXPORT_SYMBOL(adeos_schedule_irq);
+EXPORT_SYMBOL(adeos_free_irq);
+EXPORT_SYMBOL(adeos_trigger_ipi);
+EXPORT_SYMBOL(adeos_stall_pipeline);
+EXPORT_SYMBOL(adeos_unstall_pipeline);
+EXPORT_SYMBOL(adeos_unstall_pipeline_from);
+EXPORT_SYMBOL(adeos_catch_event_from);
+EXPORT_SYMBOL(adeos_hook_dswitch);
+EXPORT_SYMBOL(adeos_init_attr);
+EXPORT_SYMBOL(adeos_get_sysinfo);
+EXPORT_SYMBOL(adeos_tune_timer);
+EXPORT_SYMBOL(adeos_alloc_ptdkey);
+EXPORT_SYMBOL(adeos_free_ptdkey);
+EXPORT_SYMBOL(adeos_set_ptd);
+EXPORT_SYMBOL(adeos_get_ptd);
+EXPORT_SYMBOL(adeos_set_irq_affinity);
+EXPORT_SYMBOL(adeos_init_mutex);
+EXPORT_SYMBOL(adeos_destroy_mutex);
+EXPORT_SYMBOL(adeos_lock_mutex);
+EXPORT_SYMBOL(adeos_unlock_mutex);
+
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/adeos/Kconfig linux-2.6.8.1-tcl1-adeos/adeos/Kconfig
--- linux-2.6.8.1-tcl1/adeos/Kconfig	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/adeos/Kconfig	2005-11-18 14:18:42.000000000 +0000
@@ -0,0 +1,20 @@
+menu "Adeos support"
+
+config ADEOS
+	tristate "Adeos support"
+	default y
+	---help---
+	  Activate this option if you want the Adeos nanokernel to be
+	  compiled in.
+
+config ADEOS_CORE
+	bool
+	depends on ADEOS
+	default y
+
+config ADEOS_THREADS
+	def_bool ADEOS_CORE
+
+endmenu
+
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/adeos/Makefile linux-2.6.8.1-tcl1-adeos/adeos/Makefile
--- linux-2.6.8.1-tcl1/adeos/Makefile	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/adeos/Makefile	2005-11-18 14:18:42.000000000 +0000
@@ -0,0 +1,9 @@
+#
+# Makefile for the Adeos layer.
+#
+
+obj-$(CONFIG_ADEOS)	+= adeos.o
+
+adeos-objs		:= generic.o
+
+adeos-$(CONFIG_ARM)	+= armv.o
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/Kconfig linux-2.6.8.1-tcl1-adeos/arch/arm/Kconfig
--- linux-2.6.8.1-tcl1/arch/arm/Kconfig	2005-11-18 09:08:08.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/Kconfig	2005-11-18 12:41:17.000000000 +0000
@@ -843,3 +843,7 @@ source "crypto/Kconfig"
 
 source "lib/Kconfig"
 
+source "adeos/Kconfig"
+
+
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/adeos.c linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/adeos.c
--- linux-2.6.8.1-tcl1/arch/arm/kernel/adeos.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/adeos.c	2005-11-18 12:39:25.000000000 +0000
@@ -0,0 +1,539 @@
+/*
+ *   linux/arch/armnommu/kernel/adeos.c
+ *
+ *   Copyright (C) 2003,2004 Philippe Gerum.
+ * RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version.
+ *
+ *   This program is 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 this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *   Architecture-dependent ADEOS core support for ARM.
+ */
+
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/smp.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <linux/bitops.h>
+#include <asm/system.h>
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+#include <asm/arch/irq.h>
+#include <asm-arm/errno.h>
+#include <linux/module.h>
+
+int mio_irq;
+EXPORT_SYMBOL(mio_irq);
+
+asmlinkage void asm_do_IRQ(int irq,
+		       struct pt_regs *regs);
+
+extern struct list_head __adeos_pipeline;
+
+#ifdef CONFIG_ADEOS_MODULE
+/* A global flag telling whether Adeos pipelining is engaged. */
+int adp_pipelined = 0;
+#endif /* CONFIG_ADEOS_MODULE */
+
+struct pt_regs __adeos_irq_regs;
+
+#define ffnz(x) (ffs(x) - 1)
+#if 0
+void call_pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs){
+	pxa_timer_interrupt(irq, dev_id, regs);
+}
+EXPORT_SYMBOL(call_pxa_timer_interrupt);
+#endif
+
+/* adeos_critical_enter() -- Grab the superlock for entering a global
+   critical section. On this uniprocessor-only arch, this is identical
+   to hw cli(). */
+
+unsigned long adeos_critical_enter (void (*syncfn)(void))
+
+{
+    unsigned long flags;
+    adeos_hw_local_irq_save(flags);
+    return flags;
+}
+
+/* adeos_critical_exit() -- Release the superlock. */
+
+void adeos_critical_exit (unsigned long flags) {
+
+    adeos_hw_local_irq_restore(flags);
+}
+
+void __adeos_macro_disable_irq (void)
+
+{
+    if (likely(adp_pipelined))
+	{
+		__set_bit(IPIPE_STALL_FLAG, &adp_root->cpudata[adeos_processor_id()].status);
+	}
+}
+
+void  __adeos_macro_enable_irq (void)
+
+{
+    if (likely(adp_pipelined))
+	{
+	__clear_bit(IPIPE_STALL_FLAG, &adp_root->cpudata[adeos_processor_id()].status);
+ 	}
+}
+
+void __adeos_init_stage (adomain_t *adp)
+
+{
+    int cpuid, n;
+
+    for (cpuid = 0; cpuid < ADEOS_NR_CPUS; cpuid++)
+	{
+	adp->cpudata[cpuid].irq_pending_hi = 0;
+
+	for (n = 0; n < IPIPE_IRQ_IWORDS; n++)
+	    adp->cpudata[cpuid].irq_pending_lo[n] = 0;
+
+	for (n = 0; n < IPIPE_NR_IRQS; n++)
+	    adp->cpudata[cpuid].irq_hits[n] = 0;
+	}
+
+    for (n = 0; n < IPIPE_NR_IRQS; n++)
+	{
+	adp->irqs[n].acknowledge = NULL;
+	adp->irqs[n].handler = NULL;
+	adp->irqs[n].control = IPIPE_PASS_MASK;	/* Pass but don't handle */
+	}
+}
+EXPORT_SYMBOL(__adeos_init_stage);
+
+/* __adeos_sync_stage() -- Flush the pending IRQs for the current
+   domain (and processor).  This routine flushes the interrupt log
+   (see "Optimistic interrupt protection" from D. Stodolsky et al. for
+   more on the deferred interrupt scheme). Every interrupt that
+   occurred while the pipeline was stalled gets played.  WARNING:
+   callers on SMP boxen should always check for CPU migration on
+   return of this routine. */
+
+void __adeos_sync_stage(void)
+
+{
+    unsigned long mask, submask, flags;
+    struct adcpudata *cpudata;
+    adeos_declare_cpuid;
+    int level, rank;
+    adomain_t *adp;
+	int irq;
+	adeos_lock_cpu(flags);
+
+    adp = adp_cpu_current[cpuid];
+    cpudata = &adp->cpudata[cpuid];
+    do
+	{
+	if (unlikely(test_and_set_bit(IPIPE_SYNC_FLAG,&cpudata->status)))
+	    goto release_cpu_and_exit;
+
+	/* The policy here is to keep the dispatching code
+	   interrupt-free by stalling the current stage. If the upper
+	   domain handler (which we call) wants to re-enable
+	   interrupts while in a safe portion of the code
+	   (e.g. SA_INTERRUPT flag unset for Linux's sigaction()), it
+	   will have to unstall (then stall again before returning to
+	   us!) the stage when it sees fit. */
+
+	while ((mask = cpudata->irq_pending_hi) != 0)
+	    {
+	    /* Give a slight priority advantage to high-numbered IRQs
+	       like the virtual ones. */
+	    level = ffnz(mask);
+	    __clear_bit(level,&cpudata->irq_pending_hi);
+
+	    while ((submask = cpudata->irq_pending_lo[level]) != 0)
+		{
+		rank = ffnz(submask);
+		irq = (level << IPIPE_IRQ_ISHIFT) + rank;
+
+		if (unlikely(test_bit(IPIPE_LOCK_FLAG,&adp->irqs[irq].control)))
+		    {
+		    __clear_bit(rank,&cpudata->irq_pending_lo[level]);
+		    continue;
+		    }
+
+		if (likely(--cpudata->irq_hits[irq] == 0))
+		    __clear_bit(rank,&cpudata->irq_pending_lo[level]);
+
+		/* Allow the sync routine to be reentered on behalf of
+		   the IRQ handler and any execution context switched
+		   in by the IRQ handler. The latter also means that
+		   returning from the switched out context is always
+		   safe even if the sync routine has been reentered in
+		   the meantime. */
+		set_bit(IPIPE_STALL_FLAG,&cpudata->status);
+
+		__clear_bit(IPIPE_SYNC_FLAG,&cpudata->status);
+
+		adeos_unlock_cpu(flags);
+
+		adeos_hw_sti();
+
+		/* 1. __adeos_irq_regs is only overwritten when a
+		   timer IRQ is caught.
+		   2. IPIPE_CALLASM_FLAG is dummy for this arch. */
+		((void (*)(unsigned, struct pt_regs *))adp->irqs[irq].handler)(irq,&__adeos_irq_regs);
+		adeos_lock_cpu(flags);
+
+		__clear_bit(IPIPE_STALL_FLAG,&cpudata->status);
+
+		if (test_and_set_bit(IPIPE_SYNC_FLAG,&cpudata->status))
+		    goto release_cpu_and_exit;
+		}
+	    }
+
+	__clear_bit(IPIPE_SYNC_FLAG,&cpudata->status);
+
+	}
+    while (cpudata->irq_pending_hi != 0);
+
+release_cpu_and_exit:
+
+    adeos_unlock_cpu(flags);
+
+}
+
+static inline void __adeos_walk_pipeline (struct list_head *pos, int cpuid)
+
+{
+    while (pos != &__adeos_pipeline)
+	{
+    	adomain_t *_adp = list_entry(pos,adomain_t,p_link);
+
+	if (test_bit(IPIPE_STALL_FLAG,&_adp->cpudata[cpuid].status))
+
+	    break; /* Stalled stage -- do not go further. */
+
+	if (_adp->cpudata[cpuid].irq_pending_hi != 0)
+	    {
+	    if (_adp == adp_cpu_current[cpuid])
+		__adeos_sync_stage();
+	    else
+		{
+		__adeos_switch_to(_adp,cpuid);
+
+		if (!test_bit(IPIPE_STALL_FLAG,&adp_cpu_current[cpuid]->cpudata[cpuid].status) &&
+		    adp_cpu_current[cpuid]->cpudata[cpuid].irq_pending_hi != 0)
+		    __adeos_sync_stage();
+		}
+
+
+	    break;
+	    }
+	else if (_adp == adp_cpu_current[cpuid])
+
+	    break;
+
+	pos = _adp->p_link.next;
+	}
+
+}
+
+/* __adeos_handle_irq() -- ADEOS' generic IRQ handler. An optimistic
+   interrupt protection log is maintained here for each
+   domain. Interrupts are off on entry. */
+
+extern int (*adeos_irq_entry)(int irq, struct pt_regs *regs);
+EXPORT_SYMBOL(adeos_irq_entry);
+asmlinkage int __adeos_handle_irq (int irq, struct pt_regs *regs)
+{
+    struct list_head *head, *pos;
+    adeos_declare_cpuid;
+    int m_ack, s_ack;
+    m_ack = irq & 0x100;
+    irq &= 0xff;
+
+    if (!adp_pipelined)
+	{
+	asm_do_IRQ(irq,regs);
+	return 1;
+	}
+
+    if (!adeos_virtual_irq_p(irq))
+    {
+	irq = fixup_irq(irq);
+	}
+
+    if (irq >= IPIPE_NR_IRQS)
+	{
+	printk(KERN_ERR "ADEOS: spurious interrupt %d\n",irq);
+	return 1;
+	}
+    adeos_load_cpuid();
+    s_ack = m_ack;
+
+    if (unlikely(test_bit(IPIPE_STICKY_FLAG,&adp_cpu_current[cpuid]->irqs[irq].control)))
+	head = &adp_cpu_current[cpuid]->p_link;
+    else
+	head = __adeos_pipeline.next;
+
+    /* Ack the interrupt. */
+
+    pos = head;
+
+    while (pos != &__adeos_pipeline)
+	{
+    	adomain_t *_adp = list_entry(pos,adomain_t,p_link);
+
+	/* For each domain handling the incoming IRQ, mark it as
+           pending in its log. */
+
+	if (test_bit(IPIPE_HANDLE_FLAG,&_adp->irqs[irq].control))
+	    {
+	    /* Domains that handle this IRQ are polled for
+	       acknowledging it by decreasing priority order. The
+	       interrupt must be made pending _first_ in the domain's
+	       status flags before the PIC is unlocked. */
+
+	    _adp->cpudata[cpuid].irq_hits[irq]++;
+	    __adeos_set_irq_bit(_adp,cpuid,irq);
+
+	    /* Always get the first master acknowledge available. Once2Change
+
+	       we've got it, allow slave acknowledge handlers to run
+	       (until one of them stops us). */
+
+	    if (!m_ack)
+		m_ack = _adp->irqs[irq].acknowledge(irq);
+	    else if (test_bit(IPIPE_SHARED_FLAG,&_adp->irqs[irq].control) && !s_ack)
+		s_ack = _adp->irqs[irq].acknowledge(irq);
+	    }
+
+	/* If the domain does not want the IRQ to be passed down the
+	   interrupt pipe, exit the loop now. */
+
+	if (!test_bit(IPIPE_PASS_FLAG,&_adp->irqs[irq].control))
+	    break;
+
+	pos = _adp->p_link.next;
+	}
+
+    if (likely(irq == ADEOS_TIMER_IRQ))
+	{
+	__adeos_irq_regs.ARM_cpsr = regs->ARM_cpsr;
+	__adeos_irq_regs.ARM_pc = regs->ARM_pc;
+	}
+
+    /* Now walk the pipeline, yielding control to the highest priority
+       domain that has pending interrupt(s) or immediately to the
+       current domain if the interrupt has been marked as
+       'sticky'. This search does not go beyond the current domain in
+       the pipeline. To understand this code properly, one must keep
+       in mind that domains having a higher priority than the current
+       one are sleeping on the adeos_suspend_domain() service. In
+       addition, domains having a lower priority have been preempted
+       by an interrupt dispatched to a more prioritary domain. Once
+       the first and most prioritary stage has been selected here, the
+       subsequent stages will be activated in turn when each visited
+       domain calls adeos_suspend_domain() to wake up its neighbour
+       down the pipeline. */
+
+    __adeos_walk_pipeline(head,cpuid);
+
+    return (adp_cpu_current[cpuid] == adp_root &&
+	    !test_bit(IPIPE_STALL_FLAG,&adp_root->cpudata[cpuid].status));
+}
+
+/* adeos_trigger_irq() -- Push the interrupt to the pipeline entry
+   just like if it has been actually received from a hw source. This
+   both works for real and virtual interrupts. This also means that
+   the current domain might be immediately preempted by a more
+   prioritary domain who happens to handle this interrupt. */
+
+int adeos_trigger_irq (unsigned irq)
+
+{
+    struct pt_regs regs;
+
+    if (irq >= IPIPE_NR_IRQS ||
+	(adeos_virtual_irq_p(irq) && !test_bit(irq - IPIPE_VIRQ_BASE,&__adeos_virtual_irq_map)))     
+	return -EINVAL;
+
+    adeos_hw_local_irq_flags(regs.ARM_cpsr);
+
+    __adeos_handle_irq(irq | 0x100,&regs);
+
+    return 1;
+}
+
+/* default handler for Adeos syscall (will be replaced by non-root domain, e.g.
+ * RTAI for LXRT calls and SRQs */
+asmlinkage int __adeos_handle_syscall(struct pt_regs *regs)
+
+{
+    /* just return error code and do fast return from syscall */
+    *(long long*)&regs->ARM_r0 = -ENODEV;
+    return 1;
+}
+
+asmlinkage int __adeos_enter_syscall (struct pt_regs *regs, int scno)
+
+{
+    if (unlikely(__adeos_event_monitors[ADEOS_SYSCALL_PROLOGUE] > 0))
+	{
+	long oldip = regs->ARM_ip;
+	int s;
+
+	regs->ARM_ip = scno;
+	s = __adeos_handle_event(ADEOS_SYSCALL_PROLOGUE,regs);
+	regs->ARM_ip = oldip;
+
+	return s;
+	}
+
+    return 0;
+}
+
+asmlinkage int __adeos_exit_syscall (void) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_SYSCALL_EPILOGUE] > 0))
+	return __adeos_handle_event(ADEOS_SYSCALL_EPILOGUE,NULL);
+
+    return 0;
+}
+
+extern int (*adeos_syscall_entry)(struct pt_regs *regs);
+EXPORT_SYMBOL(adeos_syscall_entry);
+
+/**********************************/
+#ifdef CONFIG_ADEOS_CORE
+extern asmlinkage int do_notify_resume( struct pt_regs *regs, unsigned int thread_flags, int syscall);
+extern asmlinkage void syscall_trace(int why,  struct pt_regs *regs);
+asmlinkage void __adeos_wrap_schedule(void)
+{
+		schedule();
+}
+
+asmlinkage void __adeos_wrap_syscall_trace(int why, struct pt_regs *regs)
+{
+		syscall_trace(why, regs);
+}
+
+asmlinkage int __adeos_wrap_do_notify_resume( struct pt_regs *regs, unsigned int thread_flags, int syscall)
+{
+		return do_notify_resume(regs, thread_flags, syscall);
+}
+#if 0
+/*Possible interrupt consistency verifications taken from Guennadi's patch for linux 2.4.19 PXA*/
+asmlinkage void __adeos_wrap_schedule(void)
+{
+	if (!adp_pipelined) {
+		schedule();
+	}  else {
+		unsigned long flags;
+		unsigned long adeos_i_bit;
+
+		adeos_hw_local_irq_flags(flags);
+		adeos_i_bit = __adeos_test_root();
+		if ( flags & PSR_I_BIT) {
+			if (!adeos_i_bit) {
+				__adeos_stall_root();
+			}
+			adeos_hw_sti();
+		} else if (adeos_i_bit) {
+			__adeos_unstall_root();
+		}
+		schedule();
+		adeos_hw_local_irq_flags(flags);
+		if (flags & PSR_I_BIT) {
+			adeos_hw_sti();
+			BUG();
+		}
+		if (__adeos_test_root()) {
+			adeos_hw_cli();
+		}
+		__adeos_restore_root_nosync(adeos_i_bit);
+	}
+}
+
+asmlinkage void __adeos_wrap_syscall_trace(int why, struct pt_regs *regs)
+{
+	if (!adp_pipelined) {
+		syscall_trace(why, regs);
+	}  else {
+		unsigned long flags;
+		unsigned long adeos_i_bit;
+
+		adeos_hw_local_irq_flags(flags);
+		adeos_i_bit = __adeos_test_root();
+		if ( flags & PSR_I_BIT) {
+			if (!adeos_i_bit) {
+				__adeos_stall_root();
+			}
+			adeos_hw_sti();
+		} else if (adeos_i_bit) {
+			__adeos_unstall_root();
+		}
+		syscall_trace(why, regs);
+		adeos_hw_local_irq_flags(flags);
+		if (flags & PSR_I_BIT) {
+			adeos_hw_sti();
+			BUG();
+		}
+		if (__adeos_test_root()) {
+			adeos_hw_cli();
+		}
+		__adeos_restore_root_nosync(adeos_i_bit);
+	}
+}
+
+asmlinkage int __adeos_wrap_do_notify_resume( struct pt_regs *regs, unsigned int thread_flags, int syscall)
+{
+		int ret;
+	if (!adp_pipelined) {
+		return do_notify_resume(regs, thread_flags, syscall);
+	}  else {
+		unsigned long flags;
+		unsigned long adeos_i_bit;
+
+		adeos_hw_local_irq_flags(flags);
+		adeos_i_bit = __adeos_test_root();
+		if ( flags & PSR_I_BIT) {
+			if (!adeos_i_bit) {
+				__adeos_stall_root();
+			}
+			adeos_hw_sti();
+		} else if (adeos_i_bit) {
+			__adeos_unstall_root();
+		}
+		ret = do_notify_resume(regs, thread_flags, syscall);
+		adeos_hw_local_irq_flags(flags);
+		if (flags & PSR_I_BIT) {
+			adeos_hw_sti();
+			BUG();
+		}
+		if (__adeos_test_root()) {
+			adeos_hw_cli();
+		}
+		__adeos_restore_root_nosync(adeos_i_bit);
+	}
+	return ret;
+}
+#endif
+
+#endif
+
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/armksyms.c linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/armksyms.c
--- linux-2.6.8.1-tcl1/arch/arm/kernel/armksyms.c	2005-11-18 09:05:58.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/armksyms.c	2005-11-18 12:39:05.000000000 +0000
@@ -2,6 +2,9 @@
  *  linux/arch/arm/kernel/armksyms.c
  *
  *  Copyright (C) 2000 Russell King
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -25,6 +28,7 @@
  */
 extern void __ashldi3(void);
 extern void __ashrdi3(void);
+extern void __divdi3(void);
 extern void __divsi3(void);
 extern void __lshrdi3(void);
 extern void __modsi3(void);
@@ -49,6 +53,31 @@ extern void fp_enter(void);
   __attribute__((section("__ksymtab"))) =	\
     { (unsigned long)&orig, #sym };
 
+#ifdef CONFIG_ADEOS_CORE
+#ifdef CONFIG_ADEOS_MODULE
+EXPORT_SYMBOL(adp_pipelined);
+#endif /* CONFIG_ADEOS_MODULE */
+EXPORT_SYMBOL(adeos_critical_enter);
+EXPORT_SYMBOL(adeos_critical_exit);
+EXPORT_SYMBOL(adeos_trigger_irq);
+EXPORT_SYMBOL(__adeos_sync_stage);
+EXPORT_SYMBOL(__adeos_irq_regs);
+EXPORT_SYMBOL(__adeos_tune_timer);
+EXPORT_SYMBOL(__adeos_switch_domain);
+EXPORT_SYMBOL(__adeos_handle_irq);
+
+extern void cpu_do_switch_mm(unsigned long pgd_phys, struct mm_struct *mm);
+EXPORT_SYMBOL(cpu_do_switch_mm);
+
+
+/* The following are per-platform convenience exports which are needed
+   by some Adeos domains loaded as kernel modules. */
+extern struct irqdesc irq_desc[];
+EXPORT_SYMBOL_NOVERS(irq_desc);
+EXPORT_SYMBOL_NOVERS(__switch_to);
+extern void show_regs(struct pt_regs * regs);
+EXPORT_SYMBOL_NOVERS(show_regs);
+#endif /* CONFIG_ADEOS_CORE */
 /*
  * floating point math emulator support.
  * These symbols will never change their calling convention...
@@ -127,6 +156,7 @@ EXPORT_SYMBOL_NOVERS(__put_user_8);
 	/* gcc lib functions */
 EXPORT_SYMBOL_NOVERS(__ashldi3);
 EXPORT_SYMBOL_NOVERS(__ashrdi3);
+EXPORT_SYMBOL_NOVERS(__divdi3);
 EXPORT_SYMBOL_NOVERS(__divsi3);
 EXPORT_SYMBOL_NOVERS(__lshrdi3);
 EXPORT_SYMBOL_NOVERS(__modsi3);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/entry-armv.S linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/entry-armv.S
--- linux-2.6.8.1-tcl1/arch/arm/kernel/entry-armv.S	2005-11-18 09:06:00.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/entry-armv.S	2005-11-18 12:39:09.000000000 +0000
@@ -3,6 +3,9 @@
  *
  *  Copyright (C) 1996,1997,1998 Russell King.
  *  ARM700 fix by Matthew Godbolt (linux-user@willothewisp.demon.co.uk)
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -386,6 +389,11 @@ ENTRY(soft_irq_mask)
 		ands	\irqstat, \irqstat, \irqnr
 		mov	\irqnr, #0
 		beq	1001f
+#ifdef CONFIG_ADEOS_CORE
+		tst     \irqstat, #0x04000000   @ check OSMR0 first
+		movne   \irqnr, #26
+		bne     1001f
+#endif /* CONFIG_ADEOS_CORE */
 		tst	\irqstat, #0xff
 		moveq	\irqstat, \irqstat, lsr #8
 		addeq	\irqnr, \irqnr, #8
@@ -411,12 +419,12 @@ ENTRY(soft_irq_mask)
 
 #elif defined(CONFIG_ARCH_L7200)
 #include <asm/hardware.h>
-	
+
 		.equ	irq_base_addr,	IO_BASE_2
 
 		.macro  disable_fiq
 		.endm
- 
+
 		.macro  get_irqnr_and_base, irqnr, irqstat, base, tmp
 		mov     \irqstat, #irq_base_addr		@ Virt addr IRQ regs
 		add	\irqstat, \irqstat, #0x00001000		@ Status reg
@@ -976,7 +984,11 @@ __irq_svc:	sub	sp, sp, #S_FRAME_SIZE
 		@ routine called with r0 = irq number, r1 = struct pt_regs *
 		@
 		adrsvc	ne, lr, 1b
+#ifdef CONFIG_ADEOS_CORE
+		ldrne	pc, adeos_irq_entry		@ ...(r0 = irq number, r1 = struct pt_regs *)
+#else /* !CONFIG_ADEOS_CORE */
 		bne	asm_do_IRQ
+#endif /* CONFIG_ADEOS_CORE */
 #ifdef CONFIG_PREEMPT
 		ldr	r0, [r8, #TI_FLAGS]		@ get flags
 		tst	r0, #_TIF_NEED_RESCHED
@@ -1022,6 +1034,14 @@ __und_svc:	sub	sp, sp, #S_FRAME_SIZE
 		add	r2, sp, #S_SP
 		stmia	r2, {r3 - r7}			@ save sp_SVC, lr_SVC, pc, cpsr, old_ro
 
+#ifdef CONFIG_ADEOS_CORE
+		mov	r0, #4				@ SIGILL
+		mov	r1, sp				@ struct pt_regs *regs
+		bl	__adeos_handle_event
+		cmp	r0, #0				@ branch to root (Linux) trap handler
+		bne	1f				@ on null return.
+#endif /* CONFIG_ADEOS_CORE */
+
 		ldr	r0, [r5, #-4]			@ r0 = instruction
 		adrsvc	al, r9, 1f			@ r9 = normal FP return
 		bl	call_fpe			@ lr = undefined instr return
@@ -1066,6 +1086,11 @@ __pabt_svc:	sub	sp, sp, #S_FRAME_SIZE
 #ifdef CONFIG_PREEMPT
 .LCirq_stat:	.word	irq_stat
 #endif
+#ifdef CONFIG_ADEOS_CORE
+		@ hook for RTAI immediate irq dispatching
+		.globl adeos_irq_entry
+adeos_irq_entry:		.word	__adeos_handle_irq	@ Adeos default irq handler
+#endif /* CONFIG_ADEOS_CORE */
 
 		irq_prio_table
 
@@ -1116,7 +1141,14 @@ __irq_usr:	sub	sp, sp, #S_FRAME_SIZE
 		@
 		@ routine called with r0 = irq number, r1 = struct pt_regs *
 		@
+#ifdef CONFIG_ADEOS_CORE
+ 		ldrne	pc, adeos_irq_entry
+		cmp	r0, #0
+		bne	 2f
+		slow_restore_user_regs
+#else /* !CONFIG_ADEOS_CORE */
 		bne	asm_do_IRQ
+#endif /* CONFIG_ADEOS_CORE */
 #ifdef CONFIG_PREEMPT
 		ldr	r0, [r8, #TI_PREEMPT]
 		teq	r0, r7
@@ -1124,7 +1156,7 @@ __irq_usr:	sub	sp, sp, #S_FRAME_SIZE
 		strne	r0, [r0, -r0]
 		mov	tsk, r8
 #else
-		get_thread_info tsk
+2:  get_thread_info tsk
 #endif
 		mov	why, #0
 		b	ret_to_user
@@ -1275,6 +1307,33 @@ ENTRY(__switch_to)
 #endif
 		ldmib	r2, {r4 - sl, fp, sp, pc}	@ Load all regs saved previously
 
+#ifdef CONFIG_ADEOS_CORE
+/*
+ * Domain switch code. Interrupts must be off on entry.
+ * r0 = incoming domain, r1 = &adp_cpu_current[cpuid]
+ * Contributed by Jerome Poichet <jerome@kingofsofa.org>
+ */
+
+ENTRY(__adeos_switch_domain)
+	stmfd   sp!, {r0 - sl, fp, lr}  @ push most registers onto stack (scratch ip never)
+	mrs     ip, cpsr                @ get current cpsr_SVC and
+	str     ip, [sp, #-4]!          @ push it onto stack
+	mrc     p15, 0, r2, c3, c0      @ get current domain_access_control and
+	str     r2, [sp, #-4]!          @ push it onto stack
+
+	ldr     r2, [r1]                @ r2 = adp_cpu_current[cpuid] (outgoing domain)
+	str     sp, [r2, #4]            @ save outgoing sp_SVC
+	str     r0, [r1]                @ adp_cpu_current[cpuid] = incoming_domain
+	ldr     sp, [r0, #4]            @ load incoming sp_SVC
+
+	ldr     r2, [sp], #4            @ pop previous domain_access_control from stack
+	ldr     ip, [sp], #4            @ pop previous cpsr_SVC from stack
+	mcr     p15, 0, r2, c3, c0      @ restore previous domain_access_control
+	msr     spsr, ip                @ replace current spsr_SVC with previous cpsr_SVC
+	ldmfd   sp!, {r0 - sl, fp, pc}^ @ pop previous registers, pc = previous lr
+
+#endif /* CONFIG_ADEOS_CORE */
+
 		__INIT
 /*
  * Vector stubs.  NOTE that we only align 'vector_IRQ' to a cache line boundary,
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/entry-common.S linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/entry-common.S
--- linux-2.6.8.1-tcl1/arch/arm/kernel/entry-common.S	2005-11-18 09:06:01.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/entry-common.S	2005-11-18 12:39:09.000000000 +0000
@@ -2,6 +2,9 @@
  *  linux/arch/arm/kernel/entry-common.S
  *
  *  Copyright (C) 2000 Russell King
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -14,7 +17,7 @@
 
 #include "entry-header.S"
 
-/* 
+/*
  * We rely on the fact that R0 is at the bottom of the stack (due to
  * slow/fast restore user regs).
  */
@@ -29,6 +32,12 @@
  * stack.
  */
 ret_fast_syscall:
+#ifdef CONFIG_ADEOS_CORE
+	str	r0, [sp, #-4]!			@ Save return code
+	bl	__adeos_exit_syscall
+	ldr	r0, [sp], #4
+__adeos_fast_ret:
+#endif /* CONFIG_ADEOS_CORE */
 	disable_irq r1				@ disable interrupts
 	ldr	r1, [tsk, #TI_FLAGS]
 	tst	r1, #_TIF_WORK_MASK
@@ -47,12 +56,20 @@ work_pending:
 	beq	no_work_pending
 	mov	r0, sp				@ 'regs'
 	mov	r2, why				@ 'syscall'
+#ifdef CONFIG_ADEOS_CORE
+	bl	__adeos_wrap_do_notify_resume
+#else
 	bl	do_notify_resume
+#endif
 	disable_irq r1				@ disable interrupts
 	b	no_work_pending
 
 work_resched:
+#ifdef CONFIG_ADEOS_CORE
+	bl	__adeos_wrap_schedule
+#else
 	bl	schedule
+#endif
 /*
  * "slow" syscall return path.  "why" tells us if this was a real syscall.
  */
@@ -77,9 +94,13 @@ ENTRY(ret_from_fork)
 	beq	ret_slow_syscall
 	mov	r1, sp
 	mov	r0, #1				@ trace exit [IP = 1]
+#ifdef CONFIG_ADEOS_CORE
+	bl	__adeos_wrap_syscall_trace
+#else
 	bl	syscall_trace
+#endif
 	b	ret_slow_syscall
-	
+
 
 #include "calls.S"
 
@@ -130,9 +151,32 @@ ENTRY(vector_swi)
 	str	r4, [sp, #-S_OFF]!		@ push fifth arg
 
 	get_thread_info tsk
+/*#ifdef CONFIG_ADEOS_CORE
+	stmfd	sp!, {r0-r3, ip}
+	add	r0, sp, #(4*4 + S_OFF)
+	mov	r1, scno
+	bl	__adeos_enter_syscall
+	cmp     r0,#0
+	ldmfd	sp!, {r0-r3, ip}
+	bne	__adeos_fast_ret
+#endif*/
 	ldr	ip, [tsk, #TI_FLAGS]		@ check for syscall tracing
 	bic	scno, scno, #0xff000000		@ mask off SWI op-code
+#ifdef CONFIG_ADEOS_CORE
+	ldr	tbl, .__adeos_usr2kern_mode
+	cmp	scno, tbl			@ (use tbl for scratch)
+	beq	4f
+#endif
 	eor	scno, scno, #OS_NUMBER << 20	@ check OS number
+#ifdef CONFIG_ADEOS_CORE
+	stmfd	sp!, {r0-r3, ip}
+	add	r0, sp, #S_OFF
+	mov	r1, scno
+	bl	__adeos_enter_syscall
+	cmp     r0,#0
+	ldmfd	sp!, {r0-r3, ip}
+	bne	__adeos_fast_ret
+#endif  /* CONFIG_ADEOS_CORE */
 	adr	tbl, sys_call_table		@ load syscall table pointer
 	tst	ip, #_TIF_SYSCALL_TRACE		@ are we tracing syscalls?
 	bne	__sys_trace
@@ -145,8 +189,41 @@ ENTRY(vector_swi)
 2:	mov	why, #0				@ no longer a real syscall
 	cmp	scno, #ARMSWI_OFFSET
 	eor	r0, scno, #OS_NUMBER << 20	@ put OS number back
-	bcs	arm_syscall	
+	bcs	arm_syscall
 	b	sys_ni_syscall			@ not private func
+#if 0
+#ifdef CONFIG_ADEOS_CORE
+4: 	ldr	r7, adeos_syscall_entry
+	mov	lr, pc                  @ call ...
+	mov	pc, r7			@ ... if available
+	add	sp, sp, #S_OFF		@ hmm, leave anyway
+	cmp	r0 , #0
+	bne		__adeos_fast_ret
+	b		work_pending
+.__adeos_usr2kern_mode:	.word	0x404404
+	#endif
+#endif
+
+#ifdef CONFIG_ADEOS_CORE
+	@ handle Adeos syscall (used by RTAI for LXRT calls and SRQs)
+4:	ldr	ip, adeos_syscall_entry
+	add	r0, sp, #S_OFF			@ r0 <- ptr to saved regs
+	mov	lr, pc
+	mov	pc, ip				@ adeos_syscall_entry(pt_regs*)
+	cmp	r0 , #0				@ slow or fast return?
+	@ long long return value is in saved r0/r1, r0 is not loaded from stack
+	@ by fast_restore_user_regs => load it here.
+	ldrne	r0, [sp, #S_R0 + S_OFF]
+	disable_irq ip				@ needed in both cases! (i.e. slow + fast return)
+	@ r0 != 0 -> fast
+	bne	__adeos_fast_ret
+	@ r0 == 0 -> slow return
+	add	sp, sp, #S_OFF			@ fix stack-pointer for restore_user_regs
+	mov	why, #0				@ no longer a real syscall
+	b	ret_to_user
+.__adeos_usr2kern_mode:	.word	0x404404
+#endif /* CONFIG_ADEOS_CORE */
+
 
 	/*
 	 * This is the really slow path.  We're going to be doing
@@ -155,7 +232,11 @@ ENTRY(vector_swi)
 __sys_trace:
 	add	r1, sp, #S_OFF
 	mov	r0, #0				@ trace entry [IP = 0]
+#ifdef CONFIG_ADEOS_CORE
+	bl	__adeos_wrap_syscall_trace
+#else
 	bl	syscall_trace
+#endif
 
 	adrsvc	al, lr, __sys_trace_return	@ return address
 	add	r1, sp, #S_R0 + S_OFF		@ pointer to regs
@@ -168,7 +249,11 @@ __sys_trace_return:
 	str	r0, [sp, #S_R0 + S_OFF]!	@ save returned r0
 	mov	r1, sp
 	mov	r0, #1				@ trace exit [IP = 1]
+#ifdef CONFIG_ADEOS_CORE
+	bl	__adeos_wrap_syscall_trace
+#else
 	bl	syscall_trace
+#endif
 	b	ret_slow_syscall
 
 	.align	5
@@ -177,6 +262,13 @@ __sys_trace_return:
 __cr_alignment:
 	.word	cr_alignment
 #endif
+#ifdef CONFIG_ADEOS_CORE
+	.word	__adeos_enter_syscall
+	.word	__adeos_exit_syscall
+	.globl adeos_syscall_entry
+adeos_syscall_entry:	.word	__adeos_handle_syscall	@ Adeos default syscall handler
+#endif /* CONFIG_ADEOS_CORE */
+
 
 	.type	sys_call_table, #object
 ENTRY(sys_call_table)
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/irq.c linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/irq.c
--- linux-2.6.8.1-tcl1/arch/arm/kernel/irq.c	2005-11-18 09:06:01.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/irq.c	2005-11-18 12:39:09.000000000 +0000
@@ -3,6 +3,9 @@
  *
  *  Copyright (C) 1992 Linus Torvalds
  *  Modifications for ARM processor Copyright (C) 1995-2000 Russell King.
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
@@ -330,6 +333,9 @@ do_edge_IRQ(unsigned int irq, struct irq
 	/*
 	 * Acknowledge and clear the IRQ, but don't mask it.
 	 */
+#ifdef CONFIG_ADEOS_CORE
+    if (!adp_pipelined)
+#endif /* CONFIG_ADEOS_CORE */
 	desc->chip->ack(irq);
 
 	/*
@@ -453,7 +459,6 @@ static void do_pending_irqs(struct pt_re
 asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs)
 {
 	struct irqdesc *desc = irq_desc + irq;
-
 	/*
 	 * Some hardware gives randomly wrong interrupts.  Rather
 	 * than crashing, do something sensible.
@@ -474,6 +479,7 @@ asmlinkage void asm_do_IRQ(unsigned int 
 	spin_unlock(&irq_controller_lock);
 	irq_exit();
 }
+EXPORT_SYMBOL(asm_do_IRQ);                      
 
 void __set_irq_handler(unsigned int irq, irq_handler_t handle, int is_chained)
 {
@@ -873,5 +879,3 @@ static int __init noirqdebug_setup(char 
 
 __setup("noirqdebug", noirqdebug_setup);
 
-
-
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/Makefile linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/Makefile
--- linux-2.6.8.1-tcl1/arch/arm/kernel/Makefile	2005-11-18 09:05:58.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/Makefile	2005-11-18 12:39:05.000000000 +0000
@@ -11,6 +11,7 @@ obj-y		:= arch.o compat.o dma.o entry-ar
 		   time.o traps.o
 
 obj-$(CONFIG_APM)		+= apm.o
+obj-$(CONFIG_ADEOS_CORE)	+= adeos.o
 obj-$(CONFIG_ARCH_ACORN)	+= ecard.o 
 obj-$(CONFIG_FOOTBRIDGE)	+= isa.o
 obj-$(CONFIG_FIQ)		+= fiq.o
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/process.c linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/process.c
--- linux-2.6.8.1-tcl1/arch/arm/kernel/process.c	2005-11-18 09:06:02.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/process.c	2005-11-18 12:39:11.000000000 +0000
@@ -102,6 +102,9 @@ void cpu_idle(void)
 		void (*idle)(void) = pm_idle;
 		if (!idle)
 			idle = default_idle;
+#ifdef CONFIG_ADEOS_CORE
+		adeos_suspend_domain();
+#endif /* CONFIG_ADEOS_CORE */
 		preempt_disable();
 		leds_event(led_idle_start);
 		while (!need_resched())
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/kernel/time.c linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/time.c
--- linux-2.6.8.1-tcl1/arch/arm/kernel/time.c	2005-11-18 09:06:06.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/kernel/time.c	2005-11-18 12:39:15.000000000 +0000
@@ -15,6 +15,10 @@
  *              fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
  *  1998-12-20  Updated NTP code according to technical memorandum Jan '96
  *              "A Kernel Model for Precision Timekeeping" by Dave Mills
+ *
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
  */
 #include <linux/config.h>
 #include <linux/module.h>
@@ -323,6 +327,8 @@ void timer_tick(struct pt_regs *regs)
 	do_timer(regs);
 }
 
+EXPORT_SYMBOL(timer_tick);
+
 void (*init_arch_time)(void);
 
 void __init time_init(void)
@@ -330,3 +336,30 @@ void __init time_init(void)
 	init_arch_time();
 }
 
+#ifdef CONFIG_ADEOS_CORE  
+
+static inline void __adeos_set_timer (unsigned long hz)
+
+{
+    OSMR0 = ((CLOCK_TICK_RATE + hz/2) / hz); /* set next match */
+    OSSR = 0xf;		/* clear status on all timers */
+    OIER |= OIER_E0;	/* enable match on timer 0 to cause interrupts */
+    OSCR = 0;		/* re-initialize free-running timer */
+}
+
+#endif /* CONFIG_ADEOS_CORE */
+
+#ifdef CONFIG_ADEOS_CORE
+
+/* Simply inline the arch-specific code to set the frequency of the
+   timer. Interrrupts must be masked on entry. */
+
+void __adeos_tune_timer (unsigned long hz) {
+
+    __adeos_set_timer(hz);
+}
+
+#endif /* CONFIG_ADEOS_CORE */
+
+
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/lib/udivdi3.c linux-2.6.8.1-tcl1-adeos/arch/arm/lib/udivdi3.c
--- linux-2.6.8.1-tcl1/arch/arm/lib/udivdi3.c	2005-11-18 09:06:28.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/lib/udivdi3.c	2005-11-18 12:39:35.000000000 +0000
@@ -240,3 +240,44 @@ __umoddi3 (UDItype u, UDItype v)
   return w;
 }
 
+/* added signed variant for RTAI */
+
+static inline DItype
+__negdi2 (DItype u)
+{
+  DIunion w;
+  DIunion uu;
+
+  uu.ll = u;
+
+  w.s.low = -uu.s.low;
+  w.s.high = -uu.s.high - ((USItype) w.s.low > 0);
+
+  return w.ll;
+}
+
+DItype
+__divdi3 (DItype u, DItype v)
+{
+  word_type c = 0;
+  DIunion uu, vv;
+  DItype w;
+
+  uu.ll = u;
+  vv.ll = v;
+
+  if (uu.s.high < 0)
+    c = ~c,
+    uu.ll = __negdi2 (uu.ll);
+  if (vv.s.high < 0)
+    c = ~c,
+    vv.ll = __negdi2 (vv.ll);
+
+  w = __udivmoddi4 (uu.ll, vv.ll, (UDItype *) 0);
+  if (c)
+    w = __negdi2 (w);
+
+  return w;
+}
+
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/mach-pxa/time.c linux-2.6.8.1-tcl1-adeos/arch/arm/mach-pxa/time.c
--- linux-2.6.8.1-tcl1/arch/arm/mach-pxa/time.c	2005-11-18 09:07:01.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/mach-pxa/time.c	2005-11-18 12:39:59.000000000 +0000
@@ -5,6 +5,10 @@
  * Created:	Jun 15, 2001
  * Copyright:	MontaVista Software Inc.
  *
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -28,6 +32,7 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
+extern volatile u32 soft_timer_match;
 
 static inline unsigned long pxa_get_rtc_time(void)
 {
@@ -54,7 +59,12 @@ static unsigned long pxa_gettimeoffset (
 	long ticks_to_match, elapsed, usec;
 
 	/* Get ticks before next timer match */
+
+#ifndef CONFIG_ADEOS_CORE
 	ticks_to_match = OSMR0 - OSCR;
+#else
+	ticks_to_match = soft_timer_match - OSCR;
+#endif
 
 	/* We need elapsed ticks since last match */
 	elapsed = LATCH - ticks_to_match;
@@ -69,7 +79,7 @@ static unsigned long pxa_gettimeoffset (
 	return usec;
 }
 
-static irqreturn_t
+irqreturn_t
 pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	int next_match;
@@ -93,6 +103,9 @@ pxa_timer_interrupt(int irq, void *dev_i
 		timer_tick(regs);
 		OSSR = OSSR_M0;  /* Clear match on timer 0 */
 		next_match = (OSMR0 += LATCH);
+#ifdef CONFIG_ADEOS_CORE
+		soft_timer_match = next_match;
+#endif
 	} while( (signed long)(next_match - OSCR) <= 8 );
 
 	return IRQ_HANDLED;
@@ -122,3 +135,4 @@ void __init pxa_init_time(void)
 	OSCR = 0;		/* initialize free-running timer, force first match */
 }
 
+EXPORT_SYMBOL(pxa_timer_interrupt);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/mach-sa1100/time.c linux-2.6.8.1-tcl1-adeos/arch/arm/mach-sa1100/time.c
--- linux-2.6.8.1-tcl1/arch/arm/mach-sa1100/time.c	2005-11-18 09:07:21.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/mach-sa1100/time.c	2005-11-18 12:40:27.000000000 +0000
@@ -8,6 +8,7 @@
  *	Rewritten: big cleanup, much simpler, better HZ accuracy.
  *
  */
+
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/interrupt.h>
@@ -53,13 +54,22 @@ static int sa1100_set_rtc(void)
 	return 0;
 }
 
+
+#ifdef CONFIG_ADEOS_CORE
+extern volatile u32 soft_timer_match;
+#endif
+
 /* IRQs are disabled before entering here from do_gettimeofday() */
 static unsigned long sa1100_gettimeoffset (void)
 {
 	unsigned long ticks_to_match, elapsed, usec;
 
 	/* Get ticks before next timer match */
+#ifndef CONFIG_ADEOS_CORE
 	ticks_to_match = OSMR0 - OSCR;
+#else
+	ticks_to_match = soft_timer_match - OSCR;
+#endif
 
 	/* We need elapsed ticks since last match */
 	elapsed = LATCH - ticks_to_match;
@@ -88,6 +98,9 @@ sa1100_timer_interrupt(int irq, void *de
 		timer_tick(regs);
 		OSSR = OSSR_M0;  /* Clear match on timer 0 */
 		next_match = (OSMR0 += LATCH);
+#ifdef CONFIG_ADEOS_CORE
+		soft_timer_match = next_match;
+#endif
 	} while ((signed long)(next_match - OSCR) <= 0);
 
 	return IRQ_HANDLED;
@@ -117,3 +130,15 @@ void __init sa1100_init_time(void)
 	OSCR = 0;		/* initialize free-running timer, force first match */
 }
 
+#ifdef CONFIG_ADEOS_CORE
+
+static inline void __adeos_set_timer (unsigned long hz)
+
+{
+    OSMR0 = ((CLOCK_TICK_RATE + hz/2) / hz); /* set next match */
+    OSSR = 0xf;		/* clear status on all timers */
+    OIER |= OIER_E0;	/* enable match on timer 0 to cause interrupts */
+    OSCR = 0;		/* re-initialize free-running timer */
+}
+
+#endif /* CONFIG_ADEOS_CORE */
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/arch/arm/Makefile linux-2.6.8.1-tcl1-adeos/arch/arm/Makefile
--- linux-2.6.8.1-tcl1/arch/arm/Makefile	2005-11-18 09:08:08.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/arch/arm/Makefile	2005-11-18 12:41:17.000000000 +0000
@@ -55,8 +55,8 @@ tune-$(CONFIG_CPU_XSCALE)	:=$(call check
 tune-$(CONFIG_CPU_V6)		:=-mtune=strongarm
 
 # Need -Uarm for gcc < 3.x
-CFLAGS		+=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm
-AFLAGS		+=-mapcs-32 $(arch-y) $(tune-y) -msoft-float
+CFLAGS		+=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes)  -Uarm
+AFLAGS		+=-mapcs-32 $(arch-y) $(tune-y) 
 
 CHECK		:= $(CHECK) -D__arm__=1
 
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/balloon-adeos linux-2.6.8.1-tcl1-adeos/balloon-adeos
--- linux-2.6.8.1-tcl1/balloon-adeos	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/balloon-adeos	2005-11-18 14:18:46.000000000 +0000
@@ -0,0 +1,1113 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_ARM=y
+CONFIG_MMU=y
+CONFIG_UID16=y
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+CONFIG_CLEAN_COMPILE=y
+CONFIG_BROKEN_ON_SMP=y
+
+#
+# General setup
+#
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+# CONFIG_POSIX_MQUEUE is not set
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+# CONFIG_AUDIT is not set
+CONFIG_LOG_BUF_SHIFT=14
+CONFIG_HOTPLUG=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+# CONFIG_EMBEDDED is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_EXTRA_PASS is not set
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_AS=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+CONFIG_MODULE_FORCE_UNLOAD=y
+CONFIG_OBSOLETE_MODPARM=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# System Type
+#
+# CONFIG_ARCH_CLPS7500 is not set
+# CONFIG_ARCH_CLPS711X is not set
+# CONFIG_ARCH_CO285 is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_CAMELOT is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_INTEGRATOR is not set
+# CONFIG_ARCH_IOP3XX is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_L7200 is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+CONFIG_ARCH_SA1100=y
+# CONFIG_ARCH_S3C2410 is not set
+# CONFIG_ARCH_SHARK is not set
+# CONFIG_ARCH_LH7A40X is not set
+# CONFIG_ARCH_OMAP is not set
+# CONFIG_ARCH_VERSATILE_PB is not set
+
+#
+# SA11x0 Implementations
+#
+# CONFIG_SA1100_ASSABET is not set
+# CONFIG_SA1100_ADSBITSY is not set
+CONFIG_SA1100_BALLOON=y
+# CONFIG_SA1100_BRUTUS is not set
+# CONFIG_SA1100_CERF is not set
+# CONFIG_SA1100_COLLIE is not set
+# CONFIG_SA1100_H3100 is not set
+# CONFIG_SA1100_H3600 is not set
+# CONFIG_SA1100_H3800 is not set
+# CONFIG_SA1100_EXTENEX1 is not set
+# CONFIG_SA1100_FLEXANET is not set
+# CONFIG_SA1100_FREEBIRD is not set
+# CONFIG_SA1100_GRAPHICSCLIENT is not set
+# CONFIG_SA1100_GRAPHICSMASTER is not set
+# CONFIG_SA1100_BADGE4 is not set
+# CONFIG_SA1100_JORNADA720 is not set
+# CONFIG_SA1100_HACKKIT is not set
+# CONFIG_SA1100_HUW_WEBPANEL is not set
+# CONFIG_SA1100_ITSY is not set
+# CONFIG_SA1100_LART is not set
+# CONFIG_SA1100_NANOENGINE is not set
+# CONFIG_SA1100_OMNIMETER is not set
+# CONFIG_SA1100_PANGOLIN is not set
+# CONFIG_SA1100_PLEB is not set
+# CONFIG_SA1100_PT_SYSTEM3 is not set
+# CONFIG_SA1100_SHANNON is not set
+# CONFIG_SA1100_SHERMAN is not set
+# CONFIG_SA1100_SIMPAD is not set
+# CONFIG_SA1100_PFS168 is not set
+# CONFIG_SA1100_VICTOR is not set
+# CONFIG_SA1100_XP860 is not set
+# CONFIG_SA1100_YOPY is not set
+# CONFIG_SA1100_STORK is not set
+# CONFIG_SA1100_SSP is not set
+CONFIG_SA1100_USB=y
+CONFIG_SA1100_USB_NETLINK=m
+# CONFIG_SA1100_USB_CHAR is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_32=y
+CONFIG_CPU_SA1100=y
+CONFIG_CPU_32v4=y
+CONFIG_CPU_ABRT_EV4=y
+CONFIG_CPU_CACHE_V4WB=y
+CONFIG_CPU_TLB_V4WB=y
+CONFIG_CPU_MINICACHE=y
+
+#
+# Processor Features
+#
+
+#
+# General setup
+#
+CONFIG_DISCONTIGMEM=y
+CONFIG_ISA=y
+# CONFIG_ZBOOT_ROM is not set
+CONFIG_ZBOOT_ROM_TEXT=0x0
+CONFIG_ZBOOT_ROM_BSS=0x0
+# CONFIG_CPU_FREQ is not set
+
+#
+# PCMCIA/CardBus support
+#
+CONFIG_PCMCIA=m
+# CONFIG_PCMCIA_DEBUG is not set
+# CONFIG_I82365 is not set
+# CONFIG_TCIC is not set
+CONFIG_PCMCIA_SA1100=m
+
+#
+# At least one math emulation must be selected
+#
+CONFIG_FPE_NWFPE=y
+# CONFIG_FPE_NWFPE_XP is not set
+# CONFIG_FPE_FASTFPE is not set
+# CONFIG_VFP is not set
+CONFIG_BINFMT_ELF=y
+# CONFIG_BINFMT_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+
+#
+# Generic Driver Options
+#
+CONFIG_STANDALONE=y
+CONFIG_PREVENT_FIRMWARE_BUILD=y
+CONFIG_FW_LOADER=m
+# CONFIG_DEBUG_DRIVER is not set
+CONFIG_PM=y
+# CONFIG_PREEMPT is not set
+CONFIG_APM=y
+# CONFIG_ARTHUR is not set
+CONFIG_CMDLINE="root=/dev/nfs ip=bootp console=ttyS0,115200 mem=64M"
+CONFIG_LEDS=y
+CONFIG_LEDS_TIMER=y
+CONFIG_LEDS_CPU=y
+CONFIG_ALIGNMENT_TRAP=y
+
+#
+# Parallel port support
+#
+# CONFIG_PARPORT is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+CONFIG_MTD=y
+# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_PARTITIONS=y
+# CONFIG_MTD_CONCAT is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+# CONFIG_MTD_CMDLINE_PARTS is not set
+# CONFIG_MTD_AFS_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLKMTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOC2000 is not set
+# CONFIG_MTD_DOC2001 is not set
+# CONFIG_MTD_DOC2001PLUS is not set
+
+#
+# NAND Flash Device Drivers
+#
+CONFIG_MTD_NAND=y
+CONFIG_MTD_NAND_VERIFY_WRITE=y
+CONFIG_MTD_NAND_BALLOON=y
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+
+#
+# Plug and Play support
+#
+# CONFIG_PNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+CONFIG_BLK_DEV_LOOP=m
+# CONFIG_BLK_DEV_CRYPTOLOOP is not set
+# CONFIG_BLK_DEV_NBD is not set
+# CONFIG_BLK_DEV_RAM is not set
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Networking support
+#
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+CONFIG_PACKET_MMAP=y
+# CONFIG_NETLINK_DEV is not set
+CONFIG_UNIX=y
+# CONFIG_NET_KEY is not set
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_SYN_COOKIES is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_IPV6 is not set
+# CONFIG_NETFILTER is not set
+
+#
+# SCTP Configuration (EXPERIMENTAL)
+#
+# CONFIG_IP_SCTP is not set
+# CONFIG_ATM is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+# CONFIG_NET_CLS_ROUTE is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_IRDA is not set
+CONFIG_BT=m
+CONFIG_BT_L2CAP=m
+CONFIG_BT_SCO=m
+CONFIG_BT_RFCOMM=m
+CONFIG_BT_RFCOMM_TTY=y
+CONFIG_BT_BNEP=m
+CONFIG_BT_BNEP_MC_FILTER=y
+CONFIG_BT_BNEP_PROTO_FILTER=y
+CONFIG_BT_HIDP=m
+
+#
+# Bluetooth device drivers
+#
+CONFIG_BT_HCIUSB=m
+CONFIG_BT_HCIUSB_SCO=y
+# CONFIG_BT_HCIUART is not set
+CONFIG_BT_HCIBCM203X=m
+# CONFIG_BT_HCIBFUSB is not set
+# CONFIG_BT_HCIDTL1 is not set
+# CONFIG_BT_HCIBT3C is not set
+# CONFIG_BT_HCIBLUECARD is not set
+# CONFIG_BT_HCIBTUART is not set
+# CONFIG_BT_HCIVHCI is not set
+CONFIG_NETDEVICES=y
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+CONFIG_TUN=m
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+CONFIG_MII=m
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_SMC91X is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+# CONFIG_NET_PCI is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+
+#
+# Ethernet (10000 Mbit)
+#
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+CONFIG_NET_RADIO=y
+
+#
+# Obsolete Wireless cards support (pre-802.11)
+#
+# CONFIG_STRIP is not set
+# CONFIG_ARLAN is not set
+# CONFIG_WAVELAN is not set
+CONFIG_PCMCIA_WAVELAN=m
+CONFIG_PCMCIA_NETWAVE=m
+
+#
+# Wireless 802.11 Frequency Hopping cards support
+#
+CONFIG_PCMCIA_RAYCS=m
+
+#
+# Wireless 802.11b ISA/PCI cards support
+#
+CONFIG_HERMES=m
+CONFIG_ATMEL=m
+
+#
+# Wireless 802.11b Pcmcia/Cardbus cards support
+#
+CONFIG_PCMCIA_HERMES=m
+CONFIG_AIRO_CS=m
+CONFIG_PCMCIA_ATMEL=m
+CONFIG_PCMCIA_WL3501=m
+CONFIG_NET_WIRELESS=y
+
+#
+# PCMCIA network device support
+#
+CONFIG_NET_PCMCIA=y
+CONFIG_PCMCIA_3C589=m
+CONFIG_PCMCIA_3C574=m
+CONFIG_PCMCIA_FMVJ18X=m
+CONFIG_PCMCIA_PCNET=m
+CONFIG_PCMCIA_NMCLAN=m
+CONFIG_PCMCIA_SMC91C92=m
+CONFIG_PCMCIA_XIRC2PS=m
+CONFIG_PCMCIA_AXNET=m
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+CONFIG_PPP_DEFLATE=m
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPPOE is not set
+CONFIG_SLIP=m
+# CONFIG_SLIP_COMPRESSED is not set
+# CONFIG_SLIP_SMART is not set
+# CONFIG_SLIP_MODE_SLIP6 is not set
+# CONFIG_SHAPER is not set
+# CONFIG_NETCONSOLE is not set
+
+#
+# ATA/ATAPI/MFM/RLL support
+#
+CONFIG_IDE=m
+CONFIG_BLK_DEV_IDE=m
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+# CONFIG_BLK_DEV_IDE_SATA is not set
+CONFIG_BLK_DEV_IDEDISK=m
+# CONFIG_IDEDISK_MULTI_MODE is not set
+CONFIG_BLK_DEV_IDECS=m
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_IDE_TASK_IOCTL is not set
+# CONFIG_IDE_TASKFILE_IO is not set
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_IDE_GENERIC is not set
+# CONFIG_IDE_ARM is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_BLK_DEV_IDEDMA is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_BLK_DEV_HD is not set
+
+#
+# SCSI device support
+#
+# CONFIG_SCSI is not set
+
+#
+# Fusion MPT device support
+#
+
+#
+# IEEE 1394 (FireWire) support
+#
+
+#
+# I2O device support
+#
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_TSDEV is not set
+CONFIG_INPUT_EVDEV=m
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input I/O drivers
+#
+# CONFIG_GAMEPORT is not set
+CONFIG_SOUND_GAMEPORT=y
+CONFIG_SERIO=m
+# CONFIG_SERIO_I8042 is not set
+CONFIG_SERIO_SERPORT=m
+# CONFIG_SERIO_CT82C710 is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ATKBD is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+CONFIG_KEYBOARD_VIRTUAL=m
+CONFIG_INPUT_MOUSE=y
+# CONFIG_MOUSE_PS2 is not set
+CONFIG_MOUSE_SERIAL=m
+# CONFIG_MOUSE_INPORT is not set
+# CONFIG_MOUSE_LOGIBM is not set
+# CONFIG_MOUSE_PC110PAD is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+# CONFIG_INPUT_MISC is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_SERIAL_NONSTANDARD is not set
+
+#
+# Serial drivers
+#
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+CONFIG_SERIAL_SA1100=y
+CONFIG_SERIAL_SA1100_CONSOLE=y
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_UNIX98_PTYS=y
+CONFIG_LEGACY_PTYS=y
+CONFIG_LEGACY_PTY_COUNT=256
+# CONFIG_QIC02_TAPE is not set
+
+#
+# IPMI
+#
+# CONFIG_IPMI_HANDLER is not set
+
+#
+# Watchdog Cards
+#
+# CONFIG_WATCHDOG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_SA1100_RTC is not set
+# CONFIG_GEN_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+
+#
+# PCMCIA character devices
+#
+# CONFIG_SYNCLINK_CS is not set
+# CONFIG_RAW_DRIVER is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=m
+CONFIG_I2C_CHARDEV=m
+
+#
+# I2C Algorithms
+#
+CONFIG_I2C_ALGOBIT=m
+# CONFIG_I2C_ALGOPCF is not set
+
+#
+# I2C Hardware Bus support
+#
+# CONFIG_I2C_AMD756 is not set
+# CONFIG_I2C_AMD8111 is not set
+CONFIG_I2C_BALLOON=m
+# CONFIG_I2C_ELEKTOR is not set
+# CONFIG_I2C_ISA is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_SCx200_ACB is not set
+
+#
+# Hardware Sensors Chip support
+#
+CONFIG_I2C_SENSOR=m
+# CONFIG_SENSORS_ADM1021 is not set
+# CONFIG_SENSORS_ADM1025 is not set
+# CONFIG_SENSORS_ADM1031 is not set
+# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_DS1621 is not set
+# CONFIG_SENSORS_FSCHER is not set
+# CONFIG_SENSORS_GL518SM is not set
+# CONFIG_SENSORS_IT87 is not set
+# CONFIG_SENSORS_LM75 is not set
+# CONFIG_SENSORS_LM77 is not set
+# CONFIG_SENSORS_LM78 is not set
+# CONFIG_SENSORS_LM80 is not set
+# CONFIG_SENSORS_LM83 is not set
+# CONFIG_SENSORS_LM85 is not set
+# CONFIG_SENSORS_LM90 is not set
+# CONFIG_SENSORS_MAX1619 is not set
+# CONFIG_SENSORS_W83781D is not set
+# CONFIG_SENSORS_W83L785TS is not set
+# CONFIG_SENSORS_W83627HF is not set
+
+#
+# Other I2C Chip support
+#
+# CONFIG_SENSORS_EEPROM is not set
+CONFIG_SENSORS_PCF8574=m
+# CONFIG_SENSORS_PCF8591 is not set
+# CONFIG_SENSORS_RTC8564 is not set
+CONFIG_I2C_PCF8583=m
+CONFIG_BALLOON_RTC=m
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_I2C_DEBUG_CHIP is not set
+
+#
+# L3 serial bus support
+#
+CONFIG_L3=y
+CONFIG_L3_ALGOBIT=y
+CONFIG_L3_BIT_SA1100_GPIO=y
+CONFIG_BIT_SA1100_GPIO=y
+
+#
+# MMC/SD Card support
+#
+# CONFIG_MMC is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# Digital Video Broadcasting Devices
+#
+# CONFIG_DVB is not set
+
+#
+# File systems
+#
+CONFIG_EXT2_FS=m
+CONFIG_EXT2_FS_XATTR=y
+# CONFIG_EXT2_FS_POSIX_ACL is not set
+# CONFIG_EXT2_FS_SECURITY is not set
+CONFIG_EXT3_FS=m
+CONFIG_EXT3_FS_XATTR=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_JBD=m
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FS_MBCACHE=m
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_MINIX_FS is not set
+CONFIG_ROMFS_FS=m
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=m
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+# CONFIG_ZISOFS is not set
+CONFIG_UDF_FS=m
+CONFIG_UDF_NLS=y
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_FAT_DEFAULT_CODEPAGE=850
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_SYSFS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS_XATTR is not set
+CONFIG_TMPFS=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_RAMFS=y
+
+#
+# Miscellaneous filesystems
+#
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_CRAMFS=m
+# CONFIG_VXFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+CONFIG_NFS_FS=m
+# CONFIG_NFS_V3 is not set
+CONFIG_NFS_V4=y
+# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFSD is not set
+CONFIG_LOCKD=m
+# CONFIG_EXPORTFS is not set
+CONFIG_SUNRPC=m
+CONFIG_SUNRPC_GSS=m
+CONFIG_RPCSEC_GSS_KRB5=m
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+CONFIG_CIFS=m
+# CONFIG_CIFS_STATS is not set
+# CONFIG_CIFS_XATTR is not set
+# CONFIG_CIFS_POSIX is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+
+#
+# Native Language Support
+#
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+CONFIG_NLS_CODEPAGE_850=y
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=m
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+CONFIG_NLS_UTF8=m
+
+#
+# Profiling support
+#
+# CONFIG_PROFILING is not set
+
+#
+# Graphics support
+#
+CONFIG_FB=y
+CONFIG_FB_SA1100=y
+CONFIG_FB_PUG=y
+# CONFIG_FB_VIRTUAL is not set
+
+#
+# Console display driver support
+#
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_MDA_CONSOLE is not set
+CONFIG_DUMMY_CONSOLE=y
+CONFIG_FRAMEBUFFER_CONSOLE=y
+# CONFIG_FONTS is not set
+CONFIG_FONT_8x8=y
+CONFIG_FONT_8x16=y
+
+#
+# Logo configuration
+#
+# CONFIG_LOGO is not set
+
+#
+# Sound
+#
+CONFIG_SOUND=y
+
+#
+# Advanced Linux Sound Architecture
+#
+# CONFIG_SND is not set
+
+#
+# Open Sound System
+#
+CONFIG_SOUND_PRIME=y
+# CONFIG_SOUND_BT878 is not set
+# CONFIG_SOUND_FUSION is not set
+# CONFIG_SOUND_CS4281 is not set
+# CONFIG_SOUND_ESSSOLO1 is not set
+# CONFIG_SOUND_MAESTRO is not set
+# CONFIG_SOUND_SONICVIBES is not set
+# CONFIG_SOUND_TRIDENT is not set
+# CONFIG_SOUND_MSNDCLAS is not set
+# CONFIG_SOUND_MSNDPIN is not set
+CONFIG_SOUND_SA1100=y
+CONFIG_SOUND_UDA1341=y
+CONFIG_SOUND_BALLOON_UDA1341=y
+# CONFIG_SOUND_OSS is not set
+# CONFIG_SOUND_TVMIXER is not set
+# CONFIG_SOUND_AD1980 is not set
+
+#
+# Misc devices
+#
+# CONFIG_MCP is not set
+
+#
+# USB support
+#
+CONFIG_USB=y
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+# CONFIG_USB_DEVICEFS is not set
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_DYNAMIC_MINORS is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_EHCI_HCD is not set
+# CONFIG_USB_OHCI_HCD is not set
+# CONFIG_USB_UHCI_HCD is not set
+# CONFIG_USB_SL811HS is not set
+CONFIG_USB_OHCI116x=m
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_AUDIO is not set
+
+#
+# USB Bluetooth TTY can only be used with disabled Bluetooth subsystem
+#
+# CONFIG_USB_MIDI is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_STORAGE is not set
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=m
+CONFIG_USB_HIDINPUT=y
+# CONFIG_HID_FF is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# USB HID Boot Protocol drivers
+#
+# CONFIG_USB_KBD is not set
+# CONFIG_USB_MOUSE is not set
+# CONFIG_USB_AIPTEK is not set
+# CONFIG_USB_WACOM is not set
+# CONFIG_USB_KBTAB is not set
+# CONFIG_USB_POWERMATE is not set
+# CONFIG_USB_MTOUCH is not set
+# CONFIG_USB_EGALAX is not set
+# CONFIG_USB_XPAD is not set
+# CONFIG_USB_ATI_REMOTE is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+
+#
+# USB Multimedia devices
+#
+# CONFIG_USB_DABUSB is not set
+
+#
+# Video4Linux support is needed for USB Multimedia device support
+#
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+CONFIG_USB_PEGASUS=m
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+CONFIG_USB_SERIAL_BELKIN=m
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_KOBIL_SCT is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_SAFE is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_TIGL is not set
+# CONFIG_USB_AUERSWALD is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_LED is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_PHIDGETSERVO is not set
+
+#
+# USB Gadget Support
+#
+# CONFIG_USB_GADGET is not set
+
+#
+# Kernel hacking
+#
+CONFIG_FRAME_POINTER=y
+CONFIG_DEBUG_USER=y
+# CONFIG_DEBUG_INFO is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SLAB is not set
+CONFIG_MAGIC_SYSRQ=y
+# CONFIG_DEBUG_SPINLOCK is not set
+# CONFIG_DEBUG_WAITQ is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_LL=y
+# CONFIG_DEBUG_ICEDCC is not set
+
+#
+# Security options
+#
+# CONFIG_SECURITY is not set
+
+#
+# Cryptographic options
+#
+CONFIG_CRYPTO=y
+# CONFIG_CRYPTO_HMAC is not set
+# CONFIG_CRYPTO_NULL is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=m
+# CONFIG_CRYPTO_SHA1 is not set
+# CONFIG_CRYPTO_SHA256 is not set
+# CONFIG_CRYPTO_SHA512 is not set
+CONFIG_CRYPTO_DES=m
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_AES is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_ARC4 is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_DEFLATE is not set
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_CRC32C is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Library routines
+#
+CONFIG_CRC_CCITT=m
+CONFIG_CRC32=y
+# CONFIG_LIBCRC32C is not set
+CONFIG_ZLIB_INFLATE=m
+CONFIG_ZLIB_DEFLATE=m
+
+#
+# Adeos support
+#
+CONFIG_ADEOS=y
+CONFIG_ADEOS_CORE=y
+CONFIG_ADEOS_THREADS=y
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/Documentation/adeos.txt linux-2.6.8.1-tcl1-adeos/Documentation/adeos.txt
--- linux-2.6.8.1-tcl1/Documentation/adeos.txt	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/Documentation/adeos.txt	2005-11-18 12:35:35.000000000 +0000
@@ -0,0 +1,172 @@
+
+The Adeos nanokernel is based on research and publications made in the
+early '90s on the subject of nanokernels. Our basic method was to
+reverse the approach described in most of the papers on the subject.
+Instead of first building the nanokernel and then building the client
+OSes, we started from a live and known-to-be-functional OS, Linux, and
+inserted a nanokernel beneath it. Starting from Adeos, other client
+OSes can now be put side-by-side with the Linux kernel.
+
+To this end, Adeos enables multiple domains to exist simultaneously on
+the same hardware. None of these domains see each other, but all of
+them see Adeos. A domain is most probably a complete OS, but there is
+no assumption being made regarding the sophistication of what's in
+a domain.
+
+To share the hardware among the different OSes, Adeos implements an
+interrupt pipeline (ipipe). Every OS domain has an entry in the ipipe.
+Each interrupt that comes in the ipipe is passed on to every domain
+in the ipipe. Instead of disabling/enabling interrupts, each domain
+in the pipeline only needs to stall/unstall his pipeline stage. If
+an ipipe stage is stalled, then the interrupts do not progress in the
+ipipe until that stage has been unstalled. Each stage of the ipipe
+can, of course, decide to do a number of things with an interrupt.
+Among other things, it can decide that it's the last recipient of the
+interrupt. In that case, the ipipe does not propagate the interrupt
+to the rest of the domains in the ipipe.
+
+No hosted domain is allowed to use the real hardware cli/sti. But this
+is OK, since the stall/unstall calls achieve the same functionality.
+
+Our approach is based on the following papers (links to these
+papers are provided at the bottom of this message):
+[1] D. Probert, J. Bruno, and M. Karzaorman. "Space: a new approach to
+operating system abstraction." In: International Workshop on Object
+Orientation in Operating Systems, pages 133-137, October 1991.
+[2] D. Probert, J. Bruno. "Building fundamentally extensible application-
+specific operating systems in Space", March 1995.
+[3] D. Cheriton, K. Duda. "A caching model of operating system kernel
+functionality". In: Proc. Symp. on Operating Systems Design and
+Implementation, pages 179-194, Monterey CA (USA), 1994.
+[4] D. Engler, M. Kaashoek, and J. O'Toole Jr. "Exokernel: an operating
+system architecture for application-specific resource management",
+December 1995.
+
+If you don't want to go fetch the complete papers, here's a summary.
+The first 2 discuss the Space nanokernel, the 3rd discussed the cache
+nanokernel, and the last discusses exokernel.
+
+The complete Adeos approach has been thoroughly documented in a whitepaper
+published more than a year ago entitled "Adaptive Domain Environment
+for Operating Systems" and available here: http://www.opersys.com/adeos
+The current implementation is slightly different. Mainly, we do not
+implement the functionality to move Linux out of ring 0. Although of
+interest, this approach is not very portable.
+
+Instead, our patch taps right into Linux's main source of control
+over the hardware, the interrupt dispatching code, and inserts an
+interrupt pipeline which can then serve all the nanokernel's clients,
+including Linux.
+
+This is not a novelty in itself. Other OSes have been modified in such
+a way for a wide range of purposes. One of the most interesting
+examples is described by Stodolsky, Chen, and Bershad in a paper
+entitled "Fast Interrupt Priority Management in Operating System
+Kernels" published in 1993 as part of the Usenix Microkernels and
+Other Kernel Architectures Symposium. In that case, cli/sti were
+replaced by virtual cli/sti which did not modify the real interrupt
+mask in any way. Instead, interrupts were defered and delivered to
+the OS upon a call to the virtualized sti.
+
+Mainly, this resulted in increased performance for the OS. Although
+we haven't done any measurements on Linux's interrupt handling
+performance with Adeos, our nanokernel includes by definition the
+code implementing the technique described in the abovementioned
+Stodolsky paper, which we use to redirect the hardware interrupt flow
+to the pipeline.
+
+i386 and armnommu are currently supported. Most of the
+architecture-dependent code is easily portable to other architectures.
+
+Aside of adding the Adeos module (driver/adeos), we also modified some
+files to tap into Linux interrupt and system event dispatching (all
+the modifications are encapsulated in #ifdef CONFIG_ADEOS_*/#endif).
+
+We modified the idle task so it gives control back to Adeos in order for
+the ipipe to continue propagation.
+
+We modified init/main.c to initialize Adeos very early in the startup.
+
+Of course, we also added the appropriate makefile modifications and
+config options so that you can choose to enable/disable Adeos as
+part of the kernel build configuration.
+
+Adeos' public API is fully documented here:
+http://home.gna.org/adeos/doc/api/index.html.
+
+In Linux's case, adeos_register_domain() is called very early during
+system startup.
+
+To add your domain to the ipipe, you need to:
+1) Register your domain with Adeos using adeos_register_domain()
+2) Call adeos_virtualize_irq() for all the IRQs you wish to be
+notified about in the ipipe.
+
+That's it. Provided you gave Adeos appropriate handlers in step
+#2, your interrupts will be delivered via the ipipe.
+
+During runtime, you may change your position in the ipipe using
+adeos_renice_domain(). You may also stall/unstall the pipeline
+and change the ipipe's handling of the interrupts according to your
+needs.
+
+Over x86, Adeos supports SMP, and local/IO-APIC on UP.
+
+Here are some of the possible uses for Adeos (this list is far
+from complete):
+1) Much like User-Mode Linux, it should now be possible to have 2
+Linux kernels living side-by-side on the same hardware. In contrast
+to UML, this would not be 2 kernels one ontop of the other, but
+really side-by-side. Since Linux can be told at boot time to use
+only one portion of the available RAM, on a 128MB machine this
+would mean that the first could be made to use the 0-64MB space and
+the second would use the 64-128MB space. We realize that many
+modifications are required. Among other things, one of the 2 kernels
+will not need to conduct hardware initialization. Nevertheless, this
+possibility should be studied closer.
+
+2) It follows from #1 that adding other kernels beside Linux should
+be feasible. BSD is a prime candidate, but it would also be nice to
+see what virtualizers such as VMWare and Plex86 could do with Adeos.
+Proprietary operating systems could potentially also be accomodated.
+
+3) All the previous work that has been done on nanokernels should now
+be easily ported to Linux. Mainly, we would be very interested to
+hear about extensions to Adeos. Primarily, we have no mechanisms
+currently enabling multiple domains to share information. The papers
+mentioned earlier provide such mechanisms, but we'd like to see
+actual practical examples.
+
+4) Kernel debuggers' main problem (tapping into the kernel's
+interrupts) is solved and it should then be possible to provide
+patchless kernel debuggers. They would then become loadable kernel
+modules.
+
+5) Drivers who require absolute priority and dislike other kernel
+portions who use cli/sti can now create a domain of their own
+and place themselves before Linux in the ipipe. This provides a
+mechanism for the implementation of systems that can provide guaranteed
+realtime response.
+
+Philippe Gerum <rpm@xenomai.org>
+Karim Yaghmour <karim@opersys.com>
+
+----------------------------------------------------------------------
+Links to papers:
+1-
+http://citeseer.nj.nec.com/probert91space.html
+ftp://ftp.cs.ucsb.edu/pub/papers/space/iwooos91.ps.gz (not working)
+http://www4.informatik.uni-erlangen.de/~tsthiel/Papers/Space-iwooos91.ps.gz
+
+2-
+http://www.cs.ucsb.edu/research/trcs/abstracts/1995-06.shtml
+http://www4.informatik.uni-erlangen.de/~tsthiel/Papers/Space-trcs95-06.ps.gz
+
+3-
+http://citeseer.nj.nec.com/kenneth94caching.html
+http://guir.cs.berkeley.edu/projects/osprelims/papers/cachmodel-OSkernel.ps.gz
+
+4-
+http://citeseer.nj.nec.com/engler95exokernel.html
+ftp://ftp.cag.lcs.mit.edu/multiscale/exokernel.ps.Z
+----------------------------------------------------------------------
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/fs/file_table.c linux-2.6.8.1-tcl1-adeos/fs/file_table.c
--- linux-2.6.8.1-tcl1/fs/file_table.c	2005-11-18 10:22:51.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/fs/file_table.c	2005-11-18 13:46:13.000000000 +0000
@@ -168,7 +168,6 @@ void fastcall __fput(struct file *file)
 	struct dentry *dentry = file->f_dentry;
 	struct vfsmount *mnt = file->f_vfsmnt;
 	struct inode *inode = dentry->d_inode;
-
 	/*
 	 * The function eventpoll_release() should be the first called
 	 * in the file cleanup chain.
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/adeos.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/adeos.h
--- linux-2.6.8.1-tcl1/include/asm-arm/adeos.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/adeos.h	2005-11-18 13:48:46.000000000 +0000
@@ -0,0 +1,311 @@
+/*
+ *   include/asm-arm/adeos.h
+ *
+ *   Copyright (C) 2002,2003,2004 Philippe Gerum.
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version.
+ *
+ *   This program is 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 this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __ARM_ADEOS_H
+#define __ARM_ADEOS_H
+
+struct task_struct;
+
+#include <asm/irq.h>
+#include <asm/siginfo.h>
+#include <asm/ptrace.h>
+#include <asm/bitops.h>
+#include <linux/list.h>
+#include <linux/threads.h>
+#include <asm/arch/hardware.h>
+#include <asm/arch/irqs.h>
+
+#define ADEOS_ARCH_STRING "arm-PXA255"
+#define ADEOS_TIMER_IRQ   IRQ_OST0
+#ifdef CONFIG_ADEOS_MODULE
+extern int adp_pipelined;
+#else  /* !CONFIG_ADEOS_MODULE */
+#define adp_pipelined 1		/* Testing this should be optimized out. */
+#endif /* CONFIG_ADEOS_MODULE */
+
+#define ADEOS_NR_CPUS          1
+#define adeos_processor_id()   0
+/* Array references using this index should be optimized out. */
+#define adeos_declare_cpuid    const int cpuid = 0
+#define adeos_load_cpuid()      /* nop */
+#define adeos_lock_cpu(flags)   adeos_hw_local_irq_save(flags)
+#define adeos_unlock_cpu(flags) adeos_hw_local_irq_restore(flags)
+#define adeos_get_cpu(flags)    do { flags = flags; } while(0)
+#define adeos_put_cpu(flags)    /* nop */
+#define adp_current             (adp_cpu_current[0])
+
+
+/* ARM fault traps */
+#define ADEOS_NR_FAULTS         32
+/* Pseudo-vectors used for kernel events */
+#define ADEOS_FIRST_KEVENT      ADEOS_NR_FAULTS
+#define ADEOS_SYSCALL_PROLOGUE  (ADEOS_FIRST_KEVENT)
+#define ADEOS_SYSCALL_EPILOGUE  (ADEOS_FIRST_KEVENT + 1)
+#define ADEOS_SCHEDULE_HEAD     (ADEOS_FIRST_KEVENT + 2)
+#define ADEOS_SCHEDULE_TAIL     (ADEOS_FIRST_KEVENT + 3)
+#define ADEOS_ENTER_PROCESS     (ADEOS_FIRST_KEVENT + 4)
+#define ADEOS_EXIT_PROCESS      (ADEOS_FIRST_KEVENT + 5)
+#define ADEOS_SIGNAL_PROCESS    (ADEOS_FIRST_KEVENT + 6)
+#define ADEOS_KICK_PROCESS      (ADEOS_FIRST_KEVENT + 7)
+#define ADEOS_LAST_KEVENT       (ADEOS_KICK_PROCESS)
+#define ADEOS_RENICE_PROCESS    (ADEOS_FIRST_KEVENT + 8)
+#undef ADEOS_LAST_KEVENT
+#define ADEOS_LAST_KEVENT       (ADEOS_RENICE_PROCESS)
+#define ADEOS_USER_EVENT        (ADEOS_FIRST_KEVENT + 9)
+#undef ADEOS_LAST_KEVENT
+#define ADEOS_LAST_KEVENT       (ADEOS_USER_EVENT)
+
+#define ADEOS_NR_EVENTS         (ADEOS_LAST_KEVENT + 1)
+
+#define ADEOS_USR2KERN_MODE 			0x404404
+
+typedef struct adevinfo {
+
+    unsigned domid;
+    unsigned event;
+    void *evdata;
+
+    volatile int propagate;	/* Private */
+
+} adevinfo_t;
+
+typedef struct adsysinfo {
+
+    int ncpus;			/* Number of CPUs on board */
+
+    unsigned long long cpufreq;	/* CPU frequency (in Hz) */
+
+    /* Arch-dependent block */
+
+    struct {
+	unsigned tmirq;		/* Timer tick IRQ */
+    } archdep;
+
+} adsysinfo_t;
+
+#define IPIPE_NR_XIRQS   NR_IRQS
+/* Number of virtual IRQs */
+#define IPIPE_NR_VIRQS   32
+/* First virtual IRQ # */
+#define IPIPE_VIRQ_BASE   IPIPE_NR_XIRQS
+/* Total number of IRQs (external + virtual) */
+#define IPIPE_NR_IRQS     (IPIPE_NR_XIRQS + IPIPE_NR_VIRQS)
+/* Number of indirect words needed to map the whole IRQ space. */
+#define IPIPE_IRQ_IWORDS  ((IPIPE_NR_IRQS + 31) / 32)
+#define IPIPE_IRQ_IMASK   (BITS_PER_LONG - 1)
+#define IPIPE_IRQ_ISHIFT  5	/* 2^5 for 32bits arch. */
+
+#define IPIPE_IRQMASK_ANY   (~0UL)
+
+typedef struct adomain {
+
+    /* -- Section: offset-based references are made on these fields
+       from inline assembly code. Please don't move or reorder. */
+    void (*dswitch)(void);	/* Domain switch hook */
+    int *esp[ADEOS_NR_CPUS];	/* Domain stack pointers */
+    /* -- End of section. */
+
+    int *estackbase[ADEOS_NR_CPUS];
+
+    unsigned long flags;
+
+    unsigned domid;
+
+    const char *name;
+
+    int priority;
+
+    struct adcpudata {
+	volatile unsigned long status;
+	volatile unsigned long irq_pending_hi;
+	volatile unsigned long irq_pending_lo[IPIPE_IRQ_IWORDS];
+	volatile unsigned irq_hits[IPIPE_NR_IRQS];
+	adevinfo_t event_info;
+    } cpudata[ADEOS_NR_CPUS];
+
+    struct {
+	int (*acknowledge)(unsigned irq);
+	void (*handler)(unsigned irq);
+	volatile unsigned long control;
+    } irqs[IPIPE_NR_IRQS];
+
+    struct {
+	void (*handler)(adevinfo_t *evinfo);
+    } events[ADEOS_NR_EVENTS];
+
+    int ptd_keymax;
+    int ptd_keycount;
+    unsigned long ptd_keymap;
+    void (*ptd_setfun)(int, void *);
+    void *(*ptd_getfun)(int);
+
+    struct adomain *m_link;	/* Link in mutex sleep queue */
+
+    struct list_head p_link;	/* Link in pipeline */
+
+} adomain_t;
+
+typedef struct admutex {
+
+    spinlock_t lock;
+
+    adomain_t *sleepq, /* Pending domains queue */
+	      *owner;	/* Domain owning the mutex */
+
+#define ADEOS_MUTEX_UNLOCKED { SPIN_LOCK_UNLOCKED, NULL, NULL }
+
+} admutex_t;
+
+#define __clear_bit(nr,addr) clear_bit(nr,addr)
+
+/* The following macros must be used hw interrupts off. */
+
+#define __adeos_set_irq_bit(adp,cpuid,irq) \
+do { \
+    if (!__test_bit(IPIPE_LOCK_FLAG,&(adp)->irqs[irq].control)) { \
+        __set_bit(irq & IPIPE_IRQ_IMASK,&(adp)->cpudata[cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT]); \
+        __set_bit(irq >> IPIPE_IRQ_ISHIFT,&(adp)->cpudata[cpuid].irq_pending_hi); \
+       } \
+} while(0)
+
+#define __adeos_clear_pend(adp,cpuid,irq) \
+do { \
+    __clear_bit(irq & IPIPE_IRQ_IMASK,&(adp)->cpudata[cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT]); \
+    if ((adp)->cpudata[cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT] == 0) \
+        __clear_bit(irq >> IPIPE_IRQ_ISHIFT,&(adp)->cpudata[cpuid].irq_pending_hi); \
+} while(0)
+
+#define __adeos_lock_irq(adp,cpuid,irq) \
+do { \
+    if (!__test_and_set_bit(IPIPE_LOCK_FLAG,&(adp)->irqs[irq].control)) \
+	__adeos_clear_pend(adp,cpuid,irq); \
+} while(0)
+
+#define __adeos_unlock_irq(adp,irq) \
+do { \
+    int __cpuid, __nr_cpus = num_online_cpus();			       \
+    if (__test_and_clear_bit(IPIPE_LOCK_FLAG,&(adp)->irqs[irq].control)) \
+	for (__cpuid = 0; __cpuid < __nr_cpus; __cpuid++)      \
+         if ((adp)->cpudata[__cpuid].irq_hits[irq] > 0) { \
+           __set_bit(irq & IPIPE_IRQ_IMASK,&(adp)->cpudata[__cpuid].irq_pending_lo[irq >> IPIPE_IRQ_ISHIFT]); \
+           __set_bit(irq >> IPIPE_IRQ_ISHIFT,&(adp)->cpudata[__cpuid].irq_pending_hi); \
+         } \
+} while(0)
+
+#define __adeos_clear_irq(adp,irq) \
+do { \
+    int __cpuid, __nr_cpus = num_online_cpus(); \
+    __clear_bit(IPIPE_LOCK_FLAG,&(adp)->irqs[irq].control); \
+    for (__cpuid = 0; __cpuid < __nr_cpus; __cpuid++) {	\
+       (adp)->cpudata[__cpuid].irq_hits[irq] = 0; \
+       __adeos_clear_pend(adp,__cpuid,irq); \
+    } \
+} while(0)
+
+#define adeos_virtual_irq_p(irq) ((irq) >= IPIPE_VIRQ_BASE && \
+				  (irq) < IPIPE_NR_IRQS)
+
+#define adeos_hw_test_iflag(x)        (((x) & PSR_I_BIT)) /* We don't use the FIRQs */ 
+
+#define adeos_hw_irqs_disabled()	\
+({					\
+	unsigned long flags;		\
+	adeos_hw_local_irq_flags(flags);	\
+	adeos_hw_test_iflag(flags);	\
+})
+
+#define adeos_hw_tsc(t)  0
+#define adeos_cpu_freq() CLOCK_TICK_RATE
+
+#ifdef CONFIG_PREEMPT
+#define adeos_spin_lock(x)    _raw_spin_lock(x)
+#define adeos_spin_unlock(x)  _raw_spin_unlock(x)
+#define adeos_spin_trylock(x) _raw_spin_trylock(x)
+#else /* !CONFIG_PREEMPT */
+#define adeos_spin_lock(x)    spin_lock(x)
+#define adeos_spin_unlock(x)  spin_unlock(x)
+#define adeos_spin_trylock(x) spin_trylock(x)
+#endif /* CONFIG_PREEMPT */
+
+#define adeos_spin_lock_irqsave(x,flags)       do { adeos_hw_local_irq_save(flags); adeos_spin_lock(x); } while (0)
+#define adeos_spin_unlock_irqrestore(x,flags)  do { adeos_spin_unlock(x); adeos_hw_local_irq_restore(flags); } while (0)
+#define adeos_spin_lock_disable(x)             do { adeos_hw_cli(); adeos_spin_lock(x); } while (0)
+#define adeos_spin_unlock_enable(x)            do { adeos_spin_unlock(x); adeos_hw_sti(); } while (0)
+
+/* Private interface -- Internal use only */
+
+struct adattr;
+
+void __adeos_init(void);
+
+void __adeos_init_domain(adomain_t *adp,
+			 struct adattr *attr);
+
+void __adeos_cleanup_domain(adomain_t *adp);
+
+#define __adeos_check_machine() do { } while(0)
+
+void __adeos_enable_pipeline(void);
+
+void __adeos_disable_pipeline(void);
+
+void __adeos_init_stage(adomain_t *adp);
+
+void __adeos_sync_stage(void);
+
+void __adeos_tune_timer(unsigned long hz);
+
+asmlinkage int __adeos_handle_irq(int irq,
+				  struct pt_regs *regs);
+
+void __adeos_macro_disable_irq (void);
+void  __adeos_macro_enable_irq (void);
+
+asmlinkage void __adeos_wrap_schedule(void);
+asmlinkage void __adeos_wrap_syscall_trace(int why, struct pt_regs *regs);
+asmlinkage int __adeos_wrap_do_notify_resume( struct pt_regs *regs, unsigned int thread_flags, int syscall);
+
+asmlinkage int __adeos_switch_domain(adomain_t *adp,
+				     adomain_t **currentp);
+
+static inline void __adeos_switch_to(adomain_t *adp, int cpuid) {
+
+    extern adomain_t *adp_cpu_current[];
+    unsigned long flags;
+
+    adeos_hw_local_irq_save(flags);
+    __adeos_switch_domain(adp,&adp_cpu_current[cpuid]);
+    adeos_hw_local_irq_restore(flags);
+
+    if (adp_cpu_current[adeos_processor_id()]->dswitch != NULL)
+	adp_cpu_current[adeos_processor_id()]->dswitch();
+}
+
+extern struct pt_regs __adeos_irq_regs;
+
+extern unsigned long __adeos_virtual_irq_map;
+
+extern int (*adeos_irq_entry)(int irq, struct pt_regs *regs);
+extern int (*adeos_syscall_entry)(struct pt_regs *regs);
+#endif /* !__ARM_ADEOS_H */
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/arch/irq.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/arch/irq.h
--- linux-2.6.8.1-tcl1/include/asm-arm/arch/irq.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/arch/irq.h	2005-11-18 13:48:37.000000000 +0000
@@ -0,0 +1,19 @@
+/*
+ * linux/include/asm-arm/arch-pxa/irq.h
+ *
+ * Author:	Nicolas Pitre
+ * Created:	Jun 15, 2001
+ * Copyright:	MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define fixup_irq(x)	(x)
+
+/*
+ * This prototype is required for cascading of multiplexed interrupts.
+ * Since it doesn't exist elsewhere, we'll put it here for now.
+ */
+extern void do_IRQ(int irq, struct pt_regs *regs);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/arch-pxa/timex.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/arch-pxa/timex.h
--- linux-2.6.8.1-tcl1/include/asm-arm/arch-pxa/timex.h	2005-11-18 10:24:35.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/arch-pxa/timex.h	2005-11-18 13:47:55.000000000 +0000
@@ -5,13 +5,17 @@
  * Created:	Jun 15, 2001
  * Copyright:	MontaVista Software Inc.
  *
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
 
 #include <linux/config.h>
-
+extern void timer_tick(struct pt_regs *regs);
 #if defined(CONFIG_PXA25x)
 /* PXA250/210 timer base */
 #define CLOCK_TICK_RATE 3686400
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/arch-sa1100/irq.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/arch-sa1100/irq.h
--- linux-2.6.8.1-tcl1/include/asm-arm/arch-sa1100/irq.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/arch-sa1100/irq.h	2005-11-18 13:48:08.000000000 +0000
@@ -0,0 +1,19 @@
+/*
+ * linux/include/asm-arm/arch-pxa/irq.h
+ *
+ * Author:	Nicolas Pitre
+ * Created:	Jun 15, 2001
+ * Copyright:	MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#define fixup_irq(x)	(x)
+
+/*
+ * This prototype is required for cascading of multiplexed interrupts.
+ * Since it doesn't exist elsewhere, we'll put it here for now.
+ */
+extern void do_IRQ(int irq, struct pt_regs *regs);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/atomic.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/atomic.h
--- linux-2.6.8.1-tcl1/include/asm-arm/atomic.h	2005-11-18 10:25:03.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/atomic.h	2005-11-18 13:48:15.000000000 +0000
@@ -139,9 +139,17 @@ static inline void atomic_add(int i, ato
 {
 	unsigned long flags;
 
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_save(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_save(flags);
+#endif /* CONFIG_ADEOS_CORE */
 	v->counter += i;
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_restore(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_restore(flags);
+#endif /* CONFIG_ADEOS_CORE */
 }
 
 static inline int atomic_add_return(int i, atomic_t *v)
@@ -149,10 +157,18 @@ static inline int atomic_add_return(int 
 	unsigned long flags;
 	int val;
 
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_save(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_save(flags);
+#endif /* CONFIG_ADEOS_CORE */
 	val = v->counter;
 	v->counter = val += i;
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_restore(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_restore(flags);
+#endif /* CONFIG_ADEOS_CORE */
 
 	return val;
 }
@@ -161,9 +177,17 @@ static inline void atomic_sub(int i, ato
 {
 	unsigned long flags;
 
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_save(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_save(flags);
+#endif /* CONFIG_ADEOS_CORE */
 	v->counter -= i;
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_restore(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_restore(flags);
+#endif /* CONFIG_ADEOS_CORE */
 }
 
 static inline int atomic_sub_return(int i, atomic_t *v)
@@ -171,10 +195,18 @@ static inline int atomic_sub_return(int 
 	unsigned long flags;
 	int val;
 
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_save(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_save(flags);
+#endif /* CONFIG_ADEOS_CORE */
 	val = v->counter;
 	v->counter = val -= i;
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_restore(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_restore(flags);
+#endif /* CONFIG_ADEOS_CORE */
 
 	return val;
 }
@@ -183,9 +215,17 @@ static inline void atomic_clear_mask(uns
 {
 	unsigned long flags;
 
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_save(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_save(flags);
+#endif /* CONFIG_ADEOS_CORE */
 	*addr &= ~mask;
+#ifdef CONFIG_ADEOS_CORE
+	adeos_hw_local_irq_restore(flags);
+#else /* !CONFIG_ADEOS_CORE */
 	local_irq_restore(flags);
+#endif /* CONFIG_ADEOS_CORE */
 }
 
 #endif /* __LINUX_ARM_ARCH__ */
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/bitops.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/bitops.h
--- linux-2.6.8.1-tcl1/include/asm-arm/bitops.h	2005-11-18 10:25:03.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/bitops.h	2005-11-18 13:48:15.000000000 +0000
@@ -36,9 +36,9 @@ static inline void ____atomic_set_bit(un
 
 	p += bit >> 5;
 
-	local_irq_save(flags);
+	adeos_hw_local_irq_save(flags);			
 	*p |= mask;
-	local_irq_restore(flags);
+	adeos_hw_local_irq_restore(flags);
 }
 
 static inline void ____atomic_clear_bit(unsigned int bit, volatile unsigned long *p)
@@ -47,10 +47,9 @@ static inline void ____atomic_clear_bit(
 	unsigned long mask = 1UL << (bit & 31);
 
 	p += bit >> 5;
-
-	local_irq_save(flags);
+	adeos_hw_local_irq_save(flags);
 	*p &= ~mask;
-	local_irq_restore(flags);
+	adeos_hw_local_irq_restore(flags);
 }
 
 static inline void ____atomic_change_bit(unsigned int bit, volatile unsigned long *p)
@@ -60,9 +59,9 @@ static inline void ____atomic_change_bit
 
 	p += bit >> 5;
 
-	local_irq_save(flags);
+	adeos_hw_local_irq_save(flags);
 	*p ^= mask;
-	local_irq_restore(flags);
+	adeos_hw_local_irq_restore(flags);
 }
 
 static inline int
@@ -74,10 +73,10 @@ ____atomic_test_and_set_bit(unsigned int
 
 	p += bit >> 5;
 
-	local_irq_save(flags);
+	adeos_hw_local_irq_save(flags);
 	res = *p;
 	*p = res | mask;
-	local_irq_restore(flags);
+	adeos_hw_local_irq_restore(flags);
 
 	return res & mask;
 }
@@ -91,10 +90,10 @@ ____atomic_test_and_clear_bit(unsigned i
 
 	p += bit >> 5;
 
-	local_irq_save(flags);
+	adeos_hw_local_irq_save(flags);
 	res = *p;
 	*p = res & ~mask;
-	local_irq_restore(flags);
+	adeos_hw_local_irq_restore(flags);
 
 	return res & mask;
 }
@@ -108,10 +107,10 @@ ____atomic_test_and_change_bit(unsigned 
 
 	p += bit >> 5;
 
-	local_irq_save(flags);
+	adeos_hw_local_irq_save(flags);
 	res = *p;
 	*p = res ^ mask;
-	local_irq_restore(flags);
+	adeos_hw_local_irq_restore(flags);
 
 	return res & mask;
 }
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/mach/time.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/mach/time.h
--- linux-2.6.8.1-tcl1/include/asm-arm/mach/time.h	2005-11-18 10:25:01.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/mach/time.h	2005-11-18 13:48:14.000000000 +0000
@@ -15,6 +15,6 @@ extern void (*init_arch_time)(void);
 extern int (*set_rtc)(void);
 extern unsigned long(*gettimeoffset)(void);
 
-void timer_tick(struct pt_regs *);
+void timer_tick(struct pt_regs *regs);
 
 #endif
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/smp.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/smp.h
--- linux-2.6.8.1-tcl1/include/asm-arm/smp.h	2005-11-18 10:25:09.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/smp.h	2005-11-18 13:48:22.000000000 +0000
@@ -1,3 +1,8 @@
+/*
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+*/
 #ifndef __ASM_SMP_H
 #define __ASM_SMP_H
 
@@ -5,6 +10,8 @@
 
 #ifdef CONFIG_SMP
 #error SMP not supported
+#else
+#define smp_num_cpus			1
 #endif
 
 #endif
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/asm-arm/system.h linux-2.6.8.1-tcl1-adeos/include/asm-arm/system.h
--- linux-2.6.8.1-tcl1/include/asm-arm/system.h	2005-11-18 10:25:10.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/asm-arm/system.h	2005-11-18 13:48:22.000000000 +0000
@@ -1,3 +1,9 @@
+/*
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ */
+
 #ifndef __ASM_ARM_SYSTEM_H
 #define __ASM_ARM_SYSTEM_H
 
@@ -161,8 +167,12 @@ do {									\
  * spin_unlock_irq() and friends are implemented.  This avoids
  * us needlessly decrementing and incrementing the preempt count.
  */
+#ifndef CONFIG_ADEOS_CORE
 #define prepare_arch_switch(rq,next)	local_irq_enable()
 #define finish_arch_switch(rq,prev)	spin_unlock(&(rq)->lock)
+#else
+# define finish_arch_switch(rq, next)	spin_unlock_irq(&(rq)->lock)
+#endif   /*CONFIG_ADEOS_CORE*/
 #define task_running(rq,p)		((rq)->curr == (p))
 #endif
 
@@ -185,45 +195,45 @@ do {									\
  */
 #if __LINUX_ARM_ARCH__ >= 6
 
-#define local_irq_save(x)					\
+#define hard_local_irq_save(x)					\
 	({							\
 	__asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ local_irq_save\n"	\
+	"mrs	%0, cpsr		@ hard_local_irq_save\n"	\
 	"cpsid	i"						\
 	: "=r" (x) : : "memory", "cc");				\
 	})
 
-#define local_irq_enable()  __asm__("cpsie i	@ __sti" : : : "memory", "cc")
-#define local_irq_disable() __asm__("cpsid i	@ __cli" : : : "memory", "cc")
-#define local_fiq_enable()  __asm__("cpsie f	@ __stf" : : : "memory", "cc")
-#define local_fiq_disable() __asm__("cpsid f	@ __clf" : : : "memory", "cc")
+#define hard_local_irq_enable()  __asm__("cpsie i	@ __sti" : : : "memory", "cc")
+#define hard_local_irq_disable() __asm__("cpsid i	@ __cli" : : : "memory", "cc")
+#define hard_local_fiq_enable()  __asm__("cpsie f	@ __stf" : : : "memory", "cc")
+#define hard_local_fiq_disable() __asm__("cpsid f	@ __clf" : : : "memory", "cc")
 
 #else
 
 /*
  * Save the current interrupt enable state & disable IRQs
  */
-#define local_irq_save(x)					\
+#define hard_local_irq_save(x)					\
 	({							\
 		unsigned long temp;				\
 		(void) (&temp == &x);				\
 	__asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ local_irq_save\n"	\
+	"mrs	%0, cpsr		@ hard_local_irq_save\n"	\
 "	orr	%1, %0, #128\n"					\
 "	msr	cpsr_c, %1"					\
 	: "=r" (x), "=r" (temp)					\
 	:							\
 	: "memory", "cc");					\
 	})
-	
+
 /*
  * Enable IRQs
  */
-#define local_irq_enable()					\
+#define hard_local_irq_enable()					\
 	({							\
 		unsigned long temp;				\
 	__asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ local_irq_enable\n"	\
+	"mrs	%0, cpsr		@ hard_local_irq_enable\n"	\
 "	bic	%0, %0, #128\n"					\
 "	msr	cpsr_c, %0"					\
 	: "=r" (temp)						\
@@ -234,11 +244,11 @@ do {									\
 /*
  * Disable IRQs
  */
-#define local_irq_disable()					\
+#define hard_local_irq_disable()					\
 	({							\
 		unsigned long temp;				\
 	__asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ local_irq_disable\n"	\
+	"mrs	%0, cpsr		@ hard_local_irq_disable\n"	\
 "	orr	%0, %0, #128\n"					\
 "	msr	cpsr_c, %0"					\
 	: "=r" (temp)						\
@@ -249,11 +259,11 @@ do {									\
 /*
  * Enable FIQs
  */
-#define __stf()							\
+#define hard__stf()							\
 	({							\
 		unsigned long temp;				\
 	__asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ stf\n"		\
+	"mrs	%0, cpsr		@ hard__stf\n"		\
 "	bic	%0, %0, #64\n"					\
 "	msr	cpsr_c, %0"					\
 	: "=r" (temp)						\
@@ -264,11 +274,11 @@ do {									\
 /*
  * Disable FIQs
  */
-#define __clf()							\
+#define hard__clf()							\
 	({							\
 		unsigned long temp;				\
 	__asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ clf\n"		\
+	"mrs	%0, cpsr		@ hard__clf\n"		\
 "	orr	%0, %0, #64\n"					\
 "	msr	cpsr_c, %0"					\
 	: "=r" (temp)						\
@@ -281,24 +291,24 @@ do {									\
 /*
  * Save the current interrupt enable state.
  */
-#define local_save_flags(x)					\
+#define hard_local_save_flags(x)					\
 	({							\
 	__asm__ __volatile__(					\
-	"mrs	%0, cpsr		@ local_save_flags"	\
+	"mrs	%0, cpsr		@ hard_local_save_flags"	\
 	: "=r" (x) : : "memory", "cc");				\
 	})
 
 /*
  * restore saved IRQ & FIQ state
  */
-#define local_irq_restore(x)					\
+#define hard_local_irq_restore(x)					\
 	__asm__ __volatile__(					\
-	"msr	cpsr_c, %0		@ local_irq_restore\n"	\
+	"msr	cpsr_c, %0		@ hard_local_irq_restore\n"	\
 	:							\
 	: "r" (x)						\
 	: "memory", "cc")
 
-#ifdef CONFIG_SMP
+#ifdef CONFIG_SMP        /*SMP not available for ARM*/
 #error SMP not supported
 
 #define smp_mb()		mb()
@@ -313,16 +323,69 @@ do {									\
 #define smp_wmb()		barrier()
 #define smp_read_barrier_depends()		do { } while(0)
 
-#define clf()			__clf()
-#define stf()			__stf()
+#define clf()			hard__clf()
+#define stf()			hard__stf()
 
-#define irqs_disabled()			\
+#define hard_irqs_disabled()			\
 ({					\
 	unsigned long flags;		\
-	local_save_flags(flags);	\
+	hard_local_save_flags(flags);	\
 	flags & PSR_I_BIT;		\
 })
 
+#ifdef CONFIG_ADEOS_CORE
+
+extern void __adeos_stall_root(void);
+
+extern void __adeos_unstall_root(void);
+
+extern unsigned long __adeos_test_root(void);
+
+extern unsigned long __adeos_test_and_stall_root(void);
+
+void __adeos_restore_root(unsigned long flags);
+
+void __adeos_restore_root_nosync (unsigned long flags);
+
+#define __stf()                 __adeos_unstall_root()
+#define __clf()                 __adeos_stall_root()
+
+#define local_save_flags(x)	((x) = __adeos_test_root())
+#define local_irq_save(x)	((x) = __adeos_test_and_stall_root())
+#define local_irq_restore(x)	__adeos_restore_root(x)
+#define local_irq_disable()	__adeos_stall_root()
+#define local_irq_enable()	__adeos_unstall_root()
+
+#define irqs_disabled()         __adeos_test_root()
+
+#define adeos_hw_cli()   hard_local_irq_disable()
+
+#define adeos_hw_sti()		hard_local_irq_enable()
+
+#define adeos_hw_stf()		hard__stf()
+
+#define adeos_hw_clf()		hard__clf()
+
+#define adeos_hw_local_irq_save(x) 		hard_local_irq_save(x)
+
+#define adeos_hw_local_irq_restore(x) 		hard_local_irq_restore(x)
+
+#define adeos_hw_local_irq_flags(x) 		hard_local_save_flags(x)
+
+#else /* !CONFIG_ADEOS_CORE */
+
+#define local_irq_save(x)		hard_local_irq_save(x)
+#define local_irq_enable()		hard_local_irq_enable()
+#define local_irq_disable()		hard_local_irq_disable()
+#define local_fiq_enable()		hard_local_fiq_enable()
+#define local_fiq_disable()		hard_local_fiq_disable()
+#define __stf()					hard__stf()
+#define __clf()					hard__clf()
+#define local_save_flags(x)		hard_local_save_flags(x)
+#define local_irq_restore(x)		hard_local_irq_restore(x)
+#define irqs_disabled()			hard_irqs_disabled()
+#endif /* CONFIG_ADEOS_CORE */
+
 #if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110)
 /*
  * On the StrongARM, "swp" is terminally broken since it bypasses the
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/linux/adeos.h linux-2.6.8.1-tcl1-adeos/include/linux/adeos.h
--- linux-2.6.8.1-tcl1/include/linux/adeos.h	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/include/linux/adeos.h	2005-11-18 13:58:35.000000000 +0000
@@ -0,0 +1,397 @@
+/*
+ *   include/linux/adeos.h
+ *
+ *   Copyright (C) 2002,2003,2004 Philippe Gerum.
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version.
+ *
+ *   This program is 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 this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __LINUX_ADEOS_H
+#define __LINUX_ADEOS_H
+
+#include <linux/kernel.h>
+
+/* be paranoid and check assumptions (mostly if hw-irqs are off)? */
+#undef ADEOS_PARANOIA
+//#define ADEOS_PARANOIA	1
+#ifdef ADEOS_PARANOIA
+#define ADEOS_PARANOIA_ASSERT(cond)	BUG_ON(!(cond))
+#else
+#define ADEOS_PARANOIA_ASSERT(cond)	do { /* nop */ } while (0)
+#endif
+
+#include <asm-arm/bitops.h>
+#include <asm/adeos.h>
+
+#define ADEOS_VERSION_PREFIX  "2.6"
+#define ADEOS_VERSION_STRING  (ADEOS_VERSION_PREFIX ADEOS_ARCH_STRING)
+#define ADEOS_RELEASE_NUMBER  0x02040cff
+
+#define ADEOS_ROOT_PRI       100
+#define ADEOS_ROOT_ID        0
+#define ADEOS_ROOT_NPTDKEYS  4	/* Must be <= 32 */
+
+#define ADEOS_OTHER_CPUS   (-1)
+#define ADEOS_RESET_TIMER  0x1
+#define ADEOS_SAME_HANDLER ((void (*)(unsigned))(-1))
+
+/* Global domain flags */
+#define ADEOS_SPRINTK_FLAG 0	/* Synchronous printk() allowed */
+#define ADEOS_PPRINTK_FLAG 1	/* Asynchronous printk() request pending */
+
+#define IPIPE_STALL_FLAG   0	/* Stalls a pipeline stage */
+#define IPIPE_SYNC_FLAG    1	/* IRQ sync is undergoing */
+#define IPIPE_XPEND_FLAG   2	/* Exception notification is pending */
+#define IPIPE_SLEEP_FLAG   3	/* Domain has suspended itself */
+
+#define IPIPE_HANDLE_FLAG    0
+#define IPIPE_PASS_FLAG      1
+#define IPIPE_CALLASM_FLAG   2
+#define IPIPE_ENABLE_FLAG    3
+#define IPIPE_DYNAMIC_FLAG   IPIPE_HANDLE_FLAG
+#define IPIPE_EXCLUSIVE_FLAG 4
+#define IPIPE_STICKY_FLAG    5
+#define IPIPE_SYSTEM_FLAG    6
+#define IPIPE_LOCK_FLAG      7
+#define IPIPE_SHARED_FLAG    8
+
+#define IPIPE_HANDLE_MASK    (1 << IPIPE_HANDLE_FLAG)
+#define IPIPE_PASS_MASK      (1 << IPIPE_PASS_FLAG)
+#define IPIPE_CALLASM_MASK   (1 << IPIPE_CALLASM_FLAG)
+#define IPIPE_ENABLE_MASK    (1 << IPIPE_ENABLE_FLAG)
+#define IPIPE_DYNAMIC_MASK   IPIPE_HANDLE_MASK
+#define IPIPE_EXCLUSIVE_MASK (1 << IPIPE_EXCLUSIVE_FLAG)
+#define IPIPE_STICKY_MASK    (1 << IPIPE_STICKY_FLAG)
+#define IPIPE_SYSTEM_MASK    (1 << IPIPE_SYSTEM_FLAG)
+#define IPIPE_LOCK_MASK      (1 << IPIPE_LOCK_FLAG)
+#define IPIPE_SHARED_MASK    (1 << IPIPE_SHARED_FLAG)
+
+#define IPIPE_DEFAULT_MASK  (IPIPE_HANDLE_MASK|IPIPE_PASS_MASK)
+
+typedef struct adattr {
+
+    unsigned domid;		/* Domain identifier -- Magic value set by caller */
+    const char *name;		/* Domain name -- Warning: won't be dup'ed! */
+    int priority;		/* Priority in interrupt pipeline */
+    void (*entry)(int);		/* Domain entry point */
+    int estacksz;		/* Stack size for entry context -- 0 means unspec */
+    void (*dswitch)(void);	/* Handler called each time the domain is switched in */
+    int nptdkeys;		/* Max. number of per-thread data keys */
+    void (*ptdset)(int,void *);	/* Routine to set pt values */
+    void *(*ptdget)(int);	/* Routine to get pt values */
+
+} adattr_t;
+
+extern adomain_t *adp_cpu_current[],
+                 *adp_root; 
+
+extern int __adeos_event_monitors[];
+
+extern unsigned __adeos_printk_virq;
+
+extern struct  irqchip __adeos_std_irq_chip[];
+
+/* Private interface */
+
+#ifdef CONFIG_PROC_FS
+void __adeos_init_proc(void);
+#endif /* CONFIG_PROC_FS */
+
+void __adeos_takeover(void);
+
+int __adeos_handle_event(unsigned event,
+			 void *evdata);
+
+void __adeos_sync_console(unsigned irq);
+
+void __adeos_dump_state(void);
+
+static inline void __adeos_schedule_head(void *evdata) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_SCHEDULE_HEAD] > 0))
+	__adeos_handle_event(ADEOS_SCHEDULE_HEAD,evdata);
+}
+
+static inline int __adeos_schedule_tail(void *evdata) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_SCHEDULE_TAIL] > 0))
+	return __adeos_handle_event(ADEOS_SCHEDULE_TAIL,evdata);
+
+    return 0;
+}
+
+static inline void __adeos_enter_process(void) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_ENTER_PROCESS] > 0))
+	__adeos_handle_event(ADEOS_ENTER_PROCESS,NULL);
+}
+
+static inline void __adeos_exit_process(void *evdata) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_EXIT_PROCESS] > 0))
+	__adeos_handle_event(ADEOS_EXIT_PROCESS,evdata);
+}
+
+static inline int __adeos_signal_process(void *evdata) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_SIGNAL_PROCESS] > 0))
+	return __adeos_handle_event(ADEOS_SIGNAL_PROCESS,evdata);
+
+    return 0;
+}
+
+static inline void __adeos_kick_process(void *evdata) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_KICK_PROCESS] > 0))
+	__adeos_handle_event(ADEOS_KICK_PROCESS,evdata);
+}
+
+static inline int __adeos_renice_process(void *evdata) {
+
+    if (unlikely(__adeos_event_monitors[ADEOS_RENICE_PROCESS] > 0))
+	return __adeos_handle_event(ADEOS_RENICE_PROCESS,evdata);
+
+    return 0;
+}
+void __adeos_stall_root (void);
+
+void __adeos_unstall_root (void);
+
+unsigned long __adeos_test_root (void);
+
+unsigned long __adeos_test_and_stall_root (void);
+
+//void FASTCALL(__adeos_restore_root(unsigned long flags));
+void (__adeos_restore_root(unsigned long flags));
+
+void __adeos_schedule_back_root(struct task_struct *prev);
+
+/* Public interface */
+
+int adeos_register_domain(adomain_t *adp,
+			  adattr_t *attr);
+
+int adeos_unregister_domain(adomain_t *adp);
+
+void adeos_renice_domain(int newpri);
+
+void adeos_suspend_domain(void);
+
+int adeos_virtualize_irq_from(adomain_t *adp,
+			      unsigned irq,
+			      void (*handler)(unsigned irq),
+			      int (*acknowledge)(unsigned irq),
+			      unsigned modemask);
+
+static inline int adeos_virtualize_irq(unsigned irq,
+				       void (*handler)(unsigned irq),
+				       int (*acknowledge)(unsigned irq),
+				       unsigned modemask) {
+
+    return adeos_virtualize_irq_from(adp_current,
+				     irq,
+				     handler,
+				     acknowledge,
+				     modemask);
+}
+
+int adeos_control_irq(unsigned irq,
+		      unsigned clrmask,
+		      unsigned setmask);
+
+unsigned long adeos_set_irq_affinity(unsigned irq,
+				     unsigned long cpumask);
+
+static inline int adeos_share_irq (unsigned irq, int (*acknowledge)(unsigned irq)) {
+
+    return adeos_virtualize_irq(irq,
+				ADEOS_SAME_HANDLER,
+				acknowledge,
+				IPIPE_SHARED_MASK|IPIPE_HANDLE_MASK|IPIPE_PASS_MASK);
+}
+
+unsigned adeos_alloc_irq(void);
+
+int adeos_free_irq(unsigned irq);
+
+int FASTCALL(adeos_trigger_irq(unsigned irq));
+
+int FASTCALL(adeos_propagate_irq(unsigned irq));
+
+int FASTCALL(adeos_schedule_irq(unsigned irq));
+
+int FASTCALL(adeos_trigger_ipi(int cpuid));
+
+static inline void adeos_stall_pipeline_from (adomain_t *adp) {
+
+    adeos_declare_cpuid;
+    unsigned long flags;
+
+    adeos_get_cpu(flags);
+    set_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+    adeos_put_cpu(flags);
+}
+
+static inline void adeos_stall_pipeline (void) {
+
+    adeos_stall_pipeline_from(adp_current);
+}
+
+void FASTCALL(adeos_unstall_pipeline_from(adomain_t *adp));
+
+static inline void adeos_unstall_pipeline (void) {
+
+    adeos_declare_cpuid;
+    unsigned long flags;
+
+    adeos_lock_cpu(flags);
+
+    __clear_bit(IPIPE_STALL_FLAG,&adp_current->cpudata[cpuid].status);
+
+    if (unlikely(adp_current->cpudata[cpuid].irq_pending_hi != 0))
+	__adeos_sync_stage();
+
+    adeos_unlock_cpu(flags);
+}
+
+static inline unsigned long adeos_test_pipeline_from (adomain_t *adp) {
+
+    unsigned long flags, s;
+    adeos_declare_cpuid;
+
+    adeos_get_cpu(flags);
+    s = test_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+    adeos_put_cpu(flags);
+
+    return s;
+}
+
+static inline unsigned long adeos_test_pipeline (void) {
+
+    return adeos_test_pipeline_from(adp_current);
+}
+
+static inline unsigned long adeos_test_and_stall_pipeline_from (adomain_t *adp) {
+
+    unsigned long flags, s;
+    adeos_declare_cpuid;
+
+    adeos_get_cpu(flags);
+    s = test_and_set_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+    adeos_put_cpu(flags);
+
+    return s;
+}
+
+static inline unsigned long adeos_test_and_stall_pipeline (void) {
+
+    return adeos_test_and_stall_pipeline_from(adp_current);
+}
+
+static inline void adeos_restore_pipeline_from (adomain_t *adp, unsigned long flags) {
+
+    if (flags)
+	adeos_stall_pipeline_from(adp);
+    else
+	adeos_unstall_pipeline_from(adp);
+}
+
+static inline void adeos_restore_pipeline (unsigned long flags) {
+
+    unsigned long hwflags;
+    adeos_declare_cpuid;
+    adomain_t *adp;
+
+    adeos_lock_cpu(hwflags);
+
+    adp = adp_cpu_current[cpuid];
+
+    if (flags)
+	set_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+    else
+	{
+	__clear_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+
+	if (unlikely(adp->cpudata[cpuid].irq_pending_hi != 0))
+	    __adeos_sync_stage();
+	}
+
+    adeos_unlock_cpu(hwflags);
+}
+
+static inline void adeos_restore_pipeline_nosync (adomain_t *adp, unsigned long flags, int cpuid) {
+
+    /* If cpuid is current, then it must be held on entry
+       (adeos_get_cpu/adeos_hw_local_irq_save/adeos_hw_cli). */
+
+	unsigned long hwflags;
+    if (flags)
+	set_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+    else{
+		adeos_lock_cpu(hwflags);
+		__clear_bit(IPIPE_STALL_FLAG,&adp->cpudata[cpuid].status);
+		adeos_unlock_cpu(hwflags);
+	}
+}
+
+int adeos_catch_event_from(adomain_t *adp,
+			   unsigned event,
+			   void (*handler)(adevinfo_t *));
+
+static inline int adeos_catch_event (unsigned event, void (*handler)(adevinfo_t *)) {
+    return adeos_catch_event_from(adp_current,event,handler);
+}
+
+static inline void adeos_propagate_event(adevinfo_t *evinfo) {
+
+    evinfo->propagate = 1;
+}
+
+void (*adeos_hook_dswitch(void (*handler)(void)))(void);
+
+void adeos_init_attr(adattr_t *attr);
+
+int adeos_get_sysinfo(adsysinfo_t *sysinfo);
+
+int adeos_tune_timer(unsigned long ns,
+		     int flags);
+
+int adeos_alloc_ptdkey(void);
+
+int adeos_free_ptdkey(int key);
+
+int adeos_set_ptd(int key,
+		  void *value);
+
+void *adeos_get_ptd(int key);
+
+unsigned long adeos_critical_enter(void (*syncfn)(void));
+
+void adeos_critical_exit(unsigned long flags);
+
+int adeos_init_mutex(admutex_t *mutex);
+
+int adeos_destroy_mutex(admutex_t *mutex);
+
+unsigned long FASTCALL(adeos_lock_mutex(admutex_t *mutex));
+
+void FASTCALL(adeos_unlock_mutex(admutex_t *mutex,
+				 unsigned long flags));
+
+#endif /* !__LINUX_ADEOS_H */
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/linux/blkdev.h linux-2.6.8.1-tcl1-adeos/include/linux/blkdev.h
--- linux-2.6.8.1-tcl1/include/linux/blkdev.h	2005-11-18 10:34:18.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/linux/blkdev.h	2005-11-18 13:56:48.000000000 +0000
@@ -398,7 +398,7 @@ static inline int blk_queue_full(struct 
 {
 	if (rw == READ)
 		return test_bit(QUEUE_FLAG_READFULL, &q->queue_flags);
-	return test_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags);
+	return test_bit(QUEUE_FLAG_WRITEFULL, &q->queue_flags);  
 }
 
 static inline void blk_set_queue_full(struct request_queue *q, int rw)
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/linux/irq.h linux-2.6.8.1-tcl1-adeos/include/linux/irq.h
--- linux-2.6.8.1-tcl1/include/linux/irq.h	2005-11-18 10:35:13.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/linux/irq.h	2005-11-18 13:57:31.000000000 +0000
@@ -7,6 +7,9 @@
  * within this file.
  *
  * Thanks. --rmk
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
  */
 
 #include <linux/config.h>
@@ -67,9 +70,8 @@ typedef struct irq_desc {
 	spinlock_t lock;
 } ____cacheline_aligned irq_desc_t;
 
-extern irq_desc_t irq_desc [NR_IRQS];
 
-#include <asm/hw_irq.h> /* the arch dependent stuff */
+#include <asm/hardirq.h> /* the arch dependent stuff */
 
 extern int setup_irq(unsigned int , struct irqaction * );
 
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/linux/page-flags.h linux-2.6.8.1-tcl1-adeos/include/linux/page-flags.h
--- linux-2.6.8.1-tcl1/include/linux/page-flags.h	2005-11-18 10:35:33.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/linux/page-flags.h	2005-11-18 13:57:55.000000000 +0000
@@ -175,7 +175,7 @@ extern unsigned long __read_page_state(u
  * Manipulation of page state flags
  */
 #define PageLocked(page)		\
-		test_bit(PG_locked, &(page)->flags)
+		test_bit(PG_locked, &(page)->flags)    
 #define SetPageLocked(page)		\
 		set_bit(PG_locked, &(page)->flags)
 #define TestSetPageLocked(page)		\
@@ -194,7 +194,7 @@ extern unsigned long __read_page_state(u
 #define ClearPageReferenced(page)	clear_bit(PG_referenced, &(page)->flags)
 #define TestClearPageReferenced(page) test_and_clear_bit(PG_referenced, &(page)->flags)
 
-#define PageUptodate(page)	test_bit(PG_uptodate, &(page)->flags)
+#define PageUptodate(page)		test_bit(PG_uptodate, &(page)->flags)   
 #ifndef SetPageUptodate
 #define SetPageUptodate(page)	set_bit(PG_uptodate, &(page)->flags)
 #endif
@@ -217,7 +217,7 @@ extern unsigned long __read_page_state(u
 #define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags)
 #define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags)
 
-#define PageSlab(page)		test_bit(PG_slab, &(page)->flags)
+#define PageSlab(page)		test_bit(PG_slab, &(page)->flags)  
 #define SetPageSlab(page)	set_bit(PG_slab, &(page)->flags)
 #define ClearPageSlab(page)	clear_bit(PG_slab, &(page)->flags)
 #define TestClearPageSlab(page)	test_and_clear_bit(PG_slab, &(page)->flags)
@@ -229,11 +229,11 @@ extern unsigned long __read_page_state(u
 #define PageHighMem(page)	0 /* needed to optimize away at compile time */
 #endif
 
-#define PageChecked(page)	test_bit(PG_checked, &(page)->flags)
+#define PageChecked(page)		test_bit(PG_checked, &(page)->flags)
 #define SetPageChecked(page)	set_bit(PG_checked, &(page)->flags)
 #define ClearPageChecked(page)	clear_bit(PG_checked, &(page)->flags)
 
-#define PageReserved(page)	test_bit(PG_reserved, &(page)->flags)
+#define PageReserved(page)		test_bit(PG_reserved, &(page)->flags)
 #define SetPageReserved(page)	set_bit(PG_reserved, &(page)->flags)
 #define ClearPageReserved(page)	clear_bit(PG_reserved, &(page)->flags)
 
@@ -241,7 +241,7 @@ extern unsigned long __read_page_state(u
 #define ClearPagePrivate(page)	clear_bit(PG_private, &(page)->flags)
 #define PagePrivate(page)	test_bit(PG_private, &(page)->flags)
 
-#define PageWriteback(page)	test_bit(PG_writeback, &(page)->flags)
+#define PageWriteback(page)	test_bit(PG_writeback, &(page)->flags)   
 #define SetPageWriteback(page)						\
 	do {								\
 		if (!test_and_set_bit(PG_writeback,			\
@@ -283,7 +283,7 @@ extern unsigned long __read_page_state(u
 #define SetPageMappedToDisk(page) set_bit(PG_mappedtodisk, &(page)->flags)
 #define ClearPageMappedToDisk(page) clear_bit(PG_mappedtodisk, &(page)->flags)
 
-#define PageReclaim(page)	test_bit(PG_reclaim, &(page)->flags)
+#define PageReclaim(page)		test_bit(PG_reclaim, &(page)->flags)
 #define SetPageReclaim(page)	set_bit(PG_reclaim, &(page)->flags)
 #define ClearPageReclaim(page)	clear_bit(PG_reclaim, &(page)->flags)
 #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags)
@@ -292,12 +292,12 @@ extern unsigned long __read_page_state(u
 #define SetPageCompound(page)	set_bit(PG_compound, &(page)->flags)
 #define ClearPageCompound(page)	clear_bit(PG_compound, &(page)->flags)
 
-#define PageAnon(page)		test_bit(PG_anon, &(page)->flags)
+#define PageAnon(page)		test_bit(PG_anon, &(page)->flags)    
 #define SetPageAnon(page)	set_bit(PG_anon, &(page)->flags)
 #define ClearPageAnon(page)	clear_bit(PG_anon, &(page)->flags)
 
 #ifdef CONFIG_SWAP
-#define PageSwapCache(page)	test_bit(PG_swapcache, &(page)->flags)
+#define PageSwapCache(page)		test_bit(PG_swapcache, &(page)->flags)    
 #define SetPageSwapCache(page)	set_bit(PG_swapcache, &(page)->flags)
 #define ClearPageSwapCache(page) clear_bit(PG_swapcache, &(page)->flags)
 #else
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/linux/preempt.h linux-2.6.8.1-tcl1-adeos/include/linux/preempt.h
--- linux-2.6.8.1-tcl1/include/linux/preempt.h	2005-11-18 10:35:41.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/linux/preempt.h	2005-11-18 13:57:59.000000000 +0000
@@ -25,6 +25,47 @@ do { \
 
 asmlinkage void preempt_schedule(void);
 
+#ifdef CONFIG_ADEOS_CORE
+
+#include <asm/adeos.h>
+
+extern adomain_t *adp_cpu_current[],
+                 *adp_root; 
+
+#define preempt_disable() \
+do { \
+	if (adp_current == adp_root) { \
+   	    inc_preempt_count();       \
+	    barrier(); \
+        } \
+} while (0)
+
+#define preempt_enable_no_resched() \
+do { \
+        if (adp_current == adp_root) { \
+	    dec_preempt_count(); \
+	    barrier(); \
+        } \
+} while (0)
+
+#define preempt_check_resched() \
+do { \
+        if (adp_current == adp_root) { \
+	    if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
+		preempt_schedule(); \
+        } \
+} while (0)
+
+#define preempt_enable() \
+do { \
+	if (adp_current == adp_root) { \
+	    preempt_enable_no_resched(); \
+	    preempt_check_resched(); \
+        } \
+} while (0)
+
+#else /* !CONFIG_ADEOS_CORE */
+
 #define preempt_disable() \
 do { \
 	inc_preempt_count(); \
@@ -49,6 +90,8 @@ do { \
 	preempt_check_resched(); \
 } while (0)
 
+#endif /* CONFIG_ADEOS_CORE */
+
 #else
 
 #define preempt_disable()		do { } while (0)
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/include/linux/sched.h linux-2.6.8.1-tcl1-adeos/include/linux/sched.h
--- linux-2.6.8.1-tcl1/include/linux/sched.h	2005-11-18 10:35:51.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/include/linux/sched.h	2005-11-18 13:58:06.000000000 +0000
@@ -135,6 +135,10 @@ struct sched_param {
 
 #include <linux/spinlock.h>
 
+#ifdef CONFIG_ADEOS_CORE
+#include <linux/adeos.h>
+#endif /* CONFIG_ADEOS_CORE */
+
 /*
  * This serializes "schedule()" and also protects
  * the run-queue from deletions/modifications (but
@@ -512,6 +516,7 @@ struct task_struct {
 /* journalling filesystem info */
 	void *journal_info;
 
+
 /* VM state */
 	struct reclaim_state *reclaim_state;
 
@@ -527,6 +532,10 @@ struct task_struct {
   	struct mempolicy *mempolicy;
   	short il_next;		/* could be shared with used_math */
 #endif
+
+#ifdef CONFIG_ADEOS_CORE
+        void *ptd[ADEOS_ROOT_NPTDKEYS];
+#endif /* CONFIG_ADEOS_CORE */
 };
 
 static inline pid_t process_group(struct task_struct *tsk)
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/init/main.c linux-2.6.8.1-tcl1-adeos/init/main.c
--- linux-2.6.8.1-tcl1/init/main.c	2005-11-18 10:39:38.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/init/main.c	2005-11-18 14:01:13.000000000 +0000
@@ -477,6 +477,9 @@ asmlinkage void __init start_kernel(void
 	trap_init();
 	rcu_init();
 	init_IRQ();
+#ifdef CONFIG_ADEOS_CORE
+ 	__adeos_init();
+#endif /* CONFIG_ADEOS_CORE */
 	pidhash_init();
 	init_timers();
 	softirq_init();
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/adeos.c linux-2.6.8.1-tcl1-adeos/kernel/adeos.c
--- linux-2.6.8.1-tcl1/kernel/adeos.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/kernel/adeos.c	2005-11-18 14:02:03.000000000 +0000
@@ -0,0 +1,582 @@
+/*
+ *   linux/kernel/adeos.c
+ *
+ *   Copyright (C) 2002,2003,2004 Philippe Gerum.
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version.
+ *
+ *   This program is 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 this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *   Architecture-independent ADEOS core support.
+ */
+
+#include <linux/sched.h>
+#include <linux/module.h>
+#include <asm-arm/smp.h>
+#include <asm-arm/irq.h>
+#include <asm-arm/mach/irq.h>
+#ifdef CONFIG_PROC_FS
+#include <linux/proc_fs.h>
+#endif /* CONFIG_PROC_FS */
+
+struct irqchip __adeos_std_irq_chip[NR_IRQS];
+EXPORT_SYMBOL(__adeos_std_irq_chip);
+
+/* The pre-defined domain slot for the root domain. */
+adomain_t adeos_root_domain;
+
+/* A constant pointer to the root domain. */
+adomain_t *adp_root = &adeos_root_domain;
+
+/* A pointer to the current domain. */
+adomain_t *adp_cpu_current[ADEOS_NR_CPUS] = { [ 0 ... ADEOS_NR_CPUS - 1] = &adeos_root_domain };
+
+/* The spinlock protecting from races while modifying the pipeline. */
+spinlock_t __adeos_pipelock = SPIN_LOCK_UNLOCKED;
+
+/* The pipeline data structure. Enqueues adomain_t objects by priority. */
+struct list_head __adeos_pipeline;
+
+/* An array of global counters tracking domains monitoring events. */
+int __adeos_event_monitors[ADEOS_NR_EVENTS] = { [ 0 ... ADEOS_NR_EVENTS - 1] = 0 };
+
+/* The allocated VIRQ map. */
+unsigned long __adeos_virtual_irq_map = 0;
+
+/* A VIRQ to kick printk() output out when the root domain is in control. */
+unsigned __adeos_printk_virq;
+
+static void __adeos_set_root_ptd (int key, void *value) {
+
+    current->ptd[key] = value;
+}
+
+static void *__adeos_get_root_ptd (int key) {
+
+    return current->ptd[key];
+}
+
+/* adeos_init() -- Initialization routine of the ADEOS layer. Called
+   by the host kernel early during the boot procedure. */
+
+void __adeos_init (void)
+
+{
+	adomain_t *adp = &adeos_root_domain;   
+    __adeos_check_machine();	/* Do platform dependent checks first. */
+
+    /*
+      A lightweight registration code for the root domain. Current
+      assumptions are:
+      - We are running on the boot CPU, and secondary CPUs are still
+      lost in space.
+      - adeos_root_domain has been zero'ed.
+    */
+
+    INIT_LIST_HEAD(&__adeos_pipeline);
+
+    adp->name = "Linux";
+    adp->domid = ADEOS_ROOT_ID;
+    adp->priority = ADEOS_ROOT_PRI;
+    adp->ptd_setfun = &__adeos_set_root_ptd;
+    adp->ptd_getfun = &__adeos_get_root_ptd;
+    adp->ptd_keymax = ADEOS_ROOT_NPTDKEYS;	
+
+    __adeos_init_stage(adp);
+
+    INIT_LIST_HEAD(&adp->p_link);
+    list_add_tail(&adp->p_link,&__adeos_pipeline);
+
+    __adeos_printk_virq = adeos_alloc_irq(); /* Cannot fail here. */
+    adp->irqs[__adeos_printk_virq].handler = &__adeos_sync_console;
+    adp->irqs[__adeos_printk_virq].acknowledge = NULL;
+    adp->irqs[__adeos_printk_virq].control = IPIPE_HANDLE_MASK;   
+
+    printk(KERN_WARNING "Adeos %s: Root domain %s registered.\n",
+	   ADEOS_VERSION_STRING,
+	   adp->name);
+
+#ifndef CONFIG_ADEOS_MODULE
+    __adeos_takeover();
+#endif /* CONFIG_ADEOS_MODULE */
+
+}
+
+/* adeos_handle_event() -- Adeos' generic event handler. This routine
+calls the per-domain handlers registered for a given
+exception/event. Each domain before the one which raised the event in
+the pipeline will get a chance to process the event. The latter will
+eventually be allowed to process its own event too if a valid handler
+exists for it.  Handler executions are always scheduled by the domain
+which raised the event for the prioritary domains wanting to be
+notified of such event.  Note: evdata might be NULL. */
+
+asmlinkage int __adeos_handle_event (unsigned event, void *evdata)
+
+{
+    struct list_head *pos, *npos;
+    unsigned long flags;
+    adeos_declare_cpuid;
+    adevinfo_t evinfo;
+    int propagate = 1;
+
+    adeos_lock_cpu(flags);
+
+    list_for_each_safe(pos,npos,&__adeos_pipeline) {
+
+    	adomain_t *adp = list_entry(pos,adomain_t,p_link);
+
+	if (adp->events[event].handler != NULL)
+	    {
+	    if (adp == adp_cpu_current[cpuid])
+		{
+		evinfo.domid = adp->domid;
+		evinfo.event = event;
+		evinfo.evdata = evdata;
+		evinfo.propagate = 0;
+		adp->events[event].handler(&evinfo);
+		propagate = evinfo.propagate;
+		break;
+		}
+
+	    adp->cpudata[cpuid].event_info.domid = adp_cpu_current[cpuid]->domid;
+	    adp->cpudata[cpuid].event_info.event = event;
+	    adp->cpudata[cpuid].event_info.evdata = evdata;
+	    adp->cpudata[cpuid].event_info.propagate = 0;
+	    set_bit(IPIPE_XPEND_FLAG,&adp->cpudata[cpuid].status);
+
+	    /* Let the prioritary domain process the event. */
+	    __adeos_switch_to(adp,cpuid);
+
+#ifdef CONFIG_SMP
+	    adeos_load_cpuid();	/* Processor might have changed. */
+#endif /* CONFIG_SMP */
+
+	    if (!adp->cpudata[cpuid].event_info.propagate)
+		{
+		propagate = 0;
+		break;
+		}
+	    }
+
+	if (adp == adp_cpu_current[cpuid])
+	    break;
+    }
+
+    adeos_unlock_cpu(flags);
+
+    return !propagate;
+}
+
+void __adeos_stall_root (void)
+
+{
+    if (likely(adp_pipelined))
+	{
+	unsigned long flags;
+		adeos_hw_local_irq_save(flags);
+		__set_bit(IPIPE_STALL_FLAG, &adp_root->cpudata[adeos_processor_id()].status);
+		adeos_hw_local_irq_restore(flags);
+	}
+    else
+	adeos_hw_cli();
+}
+
+void __adeos_unstall_nosync_root (void)
+
+{
+    if (likely(adp_pipelined))
+	{
+	unsigned long flags;
+	adeos_hw_local_irq_save(flags);
+	__clear_bit(IPIPE_STALL_FLAG, &adp_root->cpudata[adeos_processor_id()].status);
+	adeos_hw_local_irq_restore(flags);
+	}
+}
+
+void __adeos_unstall_root (void)
+
+{
+    if (likely(adp_pipelined))      /*adp_pipelined*/
+	{
+	unsigned long hwflags;
+	int cpuid;
+	adeos_hw_local_irq_save(hwflags);
+	__clear_bit(IPIPE_STALL_FLAG, &(adp_root)->cpudata[cpuid = adeos_processor_id()].status);
+	if (adp_root->cpudata[cpuid].irq_pending_hi != 0)
+	    __adeos_sync_stage();
+	adeos_hw_local_irq_restore(hwflags);
+	}
+	adeos_hw_sti();
+}
+
+void __adeos_restore_root_nosync (unsigned long flags)
+{
+	if (flags) {
+		__adeos_stall_root();
+	} else {
+		__adeos_unstall_nosync_root ();
+	}
+}
+
+unsigned long __adeos_test_root (void)
+
+{
+    if (likely(adp_pipelined))
+	{
+	return __test_bit(IPIPE_STALL_FLAG, &adp_root->cpudata[adeos_processor_id()].status);
+	}
+
+    return adeos_hw_irqs_disabled();
+}
+
+unsigned long __adeos_test_and_stall_root (void)
+
+{
+    unsigned long flags;
+	adeos_hw_local_irq_save(flags);
+    if (likely(adp_pipelined))
+	{
+	unsigned long s;
+	s = __test_and_set_bit(IPIPE_STALL_FLAG, &adp_root->cpudata[adeos_processor_id()].status);
+	adeos_hw_local_irq_restore(flags);
+	return s;
+	}
+
+    return adeos_hw_test_iflag(flags);
+}
+
+void __adeos_restore_root (unsigned long flags)
+
+{
+	if (flags)
+	    __adeos_stall_root();
+	else
+	    __adeos_unstall_root();
+}
+
+/* adeos_suspend_domain() -- tell the ADEOS layer that the current
+   domain is now dormant. The calling domain is switched out, while
+   the next domain with work in progress or pending in the pipeline is
+   switched in. */
+
+#define __flush_pipeline_stage() \
+do { \
+    if (!test_bit(IPIPE_STALL_FLAG,&cpudata->status) && \
+	cpudata->irq_pending_hi != 0) \
+	{ \
+	__adeos_sync_stage(); \
+	adeos_load_cpuid(); \
+	cpudata = &adp->cpudata[cpuid]; \
+	} \
+    if (test_and_clear_bit(IPIPE_XPEND_FLAG,&cpudata->status)) \
+	adp->events[cpudata->event_info.event].handler(&cpudata->event_info); \
+} while(0)
+
+void adeos_suspend_domain (void)
+
+{
+    struct adcpudata *cpudata;
+    adomain_t *adp, *nadp;
+    struct list_head *ln;
+    unsigned long flags;
+    adeos_declare_cpuid;
+
+    adeos_lock_cpu(flags);
+    adp = nadp = adp_cpu_current[cpuid];
+    cpudata = &adp->cpudata[cpuid];
+
+    /* A suspending domain implicitely unstalls the pipeline. */
+    __clear_bit(IPIPE_STALL_FLAG,&cpudata->status);
+
+    /* Make sure that no event remains stuck in the pipeline. This
+       could happen with emerging SMP instances, or domains which
+       forget to unstall their stage before calling us. */
+    __flush_pipeline_stage();
+
+
+    for (;;)
+	{
+	ln = nadp->p_link.next;
+
+	if (ln == &__adeos_pipeline)	/* End of pipeline reached? */
+	    /* Caller should loop on its idle task on return. */
+	    goto release_cpu_and_exit;
+
+	nadp = list_entry(ln,adomain_t,p_link);
+
+	/* Make sure the domain was preempted (i.e. not sleeping) or
+	   has some event to process before switching to it. */
+
+	if (!test_bit(IPIPE_SLEEP_FLAG,&nadp->cpudata[cpuid].status) ||
+	    (!test_bit(IPIPE_STALL_FLAG,&nadp->cpudata[cpuid].status) &&
+	     nadp->cpudata[cpuid].irq_pending_hi != 0) ||
+	    test_bit(IPIPE_XPEND_FLAG,&nadp->cpudata[cpuid].status))
+	    break;
+	}     
+
+    /* Mark the outgoing domain as aslept (i.e. not preempted). */
+    set_bit(IPIPE_SLEEP_FLAG,&cpudata->status);
+
+    /* Suspend the calling domain, switching to the next one. */
+    __adeos_switch_to(nadp,cpuid);
+
+    /* Clear the sleep bit for the incoming domain (on the initial processor). */
+    __clear_bit(IPIPE_SLEEP_FLAG,&cpudata->status);
+
+#ifdef CONFIG_SMP
+    adeos_load_cpuid();	/* Processor might have changed. */
+    cpudata = &adp->cpudata[cpuid];
+#endif /* CONFIG_SMP */
+
+    /* Now, we are back into the calling domain. Flush the interrupt
+       log and fire the event interposition handler if needed.  CPU
+       migration is allowed in SMP-mode on behalf of an event handler
+       provided that the current domain raised it. Otherwise, it's
+       not. */
+
+    __flush_pipeline_stage();
+
+release_cpu_and_exit:
+
+    adeos_unlock_cpu(flags);
+
+    /* Return to the point of suspension in the calling domain. */
+}
+
+/* adeos_alloc_irq() -- Allocate a virtual/soft pipelined interrupt.
+   Virtual interrupts are handled in exactly the same way than their
+   hw-generated counterparts. This is a very basic, one-way only,
+   inter-domain communication system (see adeos_trigger_irq()).  Note:
+   it is not necessary for a domain to allocate a virtual interrupt to
+   trap it using adeos_virtualize_irq(). The newly allocated VIRQ
+   number which can be passed to other IRQ-related services is
+   returned on success, zero otherwise (i.e. no more virtual interrupt
+   channel is available). We need this service as part of the Adeos
+   bootstrap code, hence it must reside in a built-in area. */
+
+unsigned adeos_alloc_irq (void)
+
+{
+    unsigned long flags, irq = 0;
+    int ipos;
+
+    adeos_spin_lock_irqsave(&__adeos_pipelock,flags);
+
+    if (__adeos_virtual_irq_map != ~0)
+	{
+	ipos = ffz(__adeos_virtual_irq_map);
+	set_bit(ipos,&__adeos_virtual_irq_map);
+	irq = ipos + IPIPE_VIRQ_BASE;
+	}
+
+    adeos_spin_unlock_irqrestore(&__adeos_pipelock,flags);
+
+    return irq;
+}
+
+#ifdef CONFIG_PROC_FS
+
+#include <linux/proc_fs.h>
+
+static struct proc_dir_entry *adeos_proc_entry;
+
+static int __adeos_read_proc (char *page,
+			      char **start,
+			      off_t off,
+			      int count,
+			      int *eof,
+			      void *data)
+{
+    unsigned long flags, ctlbits;
+    struct list_head *pos;
+    unsigned irq, _irq;
+    char *p = page;
+    int len;
+
+#ifdef CONFIG_ADEOS_MODULE
+    p += sprintf(p,"Adeos %s -- Pipelining: %s\n\n",ADEOS_VERSION_STRING,adp_pipelined ? "active" : "stopped");
+#else /* !CONFIG_ADEOS_MODULE */
+    p += sprintf(p,"Adeos %s -- Pipelining: permanent\n\n",ADEOS_VERSION_STRING);
+#endif /* CONFIG_ADEOS_MODULE */
+
+    adeos_hw_local_irq_save(flags);
+
+    list_for_each(pos,&__adeos_pipeline) {
+
+    	adomain_t *adp = list_entry(pos,adomain_t,p_link);
+
+	p += sprintf(p,"%8s: priority=%d, id=0x%.8x, ptdkeys=%d/%d\n",
+		     adp->name,
+		     adp->priority,
+		     adp->domid,
+		     adp->ptd_keycount,
+		     adp->ptd_keymax);
+	irq = 0;
+
+	while (irq < IPIPE_NR_IRQS)
+	    {
+	    ctlbits = (adp->irqs[irq].control & (IPIPE_HANDLE_MASK|IPIPE_PASS_MASK|IPIPE_STICKY_MASK));
+
+	    if (adeos_virtual_irq_p(irq) && !test_bit(irq - IPIPE_VIRQ_BASE,&__adeos_virtual_irq_map))    
+		{
+		irq++;
+		continue;
+		}
+
+	    /* Attempt to group consecutive IRQ numbers having the
+	       same virtualization settings in a single line. */
+
+	    _irq = irq;
+
+	    while (++_irq < IPIPE_NR_IRQS)
+		{
+		if (adeos_virtual_irq_p(_irq) != adeos_virtual_irq_p(irq) ||
+		    (adeos_virtual_irq_p(_irq) && !test_bit(_irq - IPIPE_VIRQ_BASE,&__adeos_virtual_irq_map)) ||
+		    ctlbits != (adp->irqs[_irq].control & (IPIPE_HANDLE_MASK|IPIPE_PASS_MASK|IPIPE_STICKY_MASK)))
+		    break;
+		}
+
+	    if (_irq == irq + 1)
+		p += sprintf(p,"\tirq%u: ",irq);
+	    else
+		p += sprintf(p,"\tirq%u-%u: ",irq,_irq - 1);
+
+	    /* Statuses are as follows:
+	       o "accepted" means handled _and_ passed down the
+	       pipeline.
+	       o "grabbed" means handled, but the interrupt might be
+	       terminated _or_ passed down the pipeline depending on
+	       what the domain handler asks for to Adeos.
+	       o "passed" means unhandled by the domain but passed
+	       down the pipeline.
+	       o "discarded" means unhandled and _not_ passed down the
+	       pipeline. The interrupt merely disappears from the
+	       current domain down to the end of the pipeline. */
+
+	    if (ctlbits & IPIPE_HANDLE_MASK)
+		{
+		if (ctlbits & IPIPE_PASS_MASK)
+		    p += sprintf(p,"accepted");
+		else
+		    p += sprintf(p,"grabbed");
+		}
+	    else if (ctlbits & IPIPE_PASS_MASK)
+		p += sprintf(p,"passed");
+	    else
+		p += sprintf(p,"discarded");
+
+	    if (ctlbits & IPIPE_STICKY_MASK)
+		p += sprintf(p,", sticky");
+
+	    if (ctlbits & IPIPE_SHARED_MASK)
+		p += sprintf(p,", shared");
+
+	    if (adeos_virtual_irq_p(irq))
+		p += sprintf(p,", virtual");
+
+	    p += sprintf(p,"\n");
+
+	    irq = _irq;
+	    }
+    }
+
+    adeos_hw_local_irq_restore(flags);
+
+    len = p - page;
+
+    if (len <= off + count)
+	*eof = 1;
+
+    *start = page + off;
+
+    len -= off;
+
+    if (len > count)
+	len = count;
+
+    if (len < 0)
+	len = 0;
+
+    return len;
+}
+
+void __adeos_init_proc (void) {
+
+    adeos_proc_entry = create_proc_read_entry("adeos",
+					      0444,
+					      NULL,
+					      &__adeos_read_proc,
+					      NULL);
+}
+
+#endif /* CONFIG_PROC_FS */
+
+void __adeos_dump_state (void)
+
+{
+    int _cpuid, nr_cpus = smp_num_cpus;
+    struct list_head *pos;
+    unsigned long flags;
+    adeos_declare_cpuid;
+
+    adeos_lock_cpu(flags);
+
+    printk(KERN_WARNING "Adeos: Current domain=%s on CPU #%d [stackbase=%p]\n",
+	   adp_current->name,
+	   cpuid,
+	   (void *)adp_current->estackbase[cpuid]);
+
+    list_for_each(pos,&__adeos_pipeline) {
+
+        adomain_t *adp = list_entry(pos,adomain_t,p_link);
+
+        for (_cpuid = 0; _cpuid < nr_cpus; _cpuid++)
+            printk(KERN_WARNING "%8s[cpuid=%d]: priority=%d, status=0x%lx, pending_hi=0x%lx\n",
+                   adp->name,
+                   _cpuid,
+                   adp->priority,
+                   adp->cpudata[_cpuid].status,
+                   adp->cpudata[_cpuid].irq_pending_hi);
+    }
+
+    adeos_unlock_cpu(flags);
+}
+
+EXPORT_SYMBOL(__adeos_unstall_nosync_root);
+EXPORT_SYMBOL(adeos_suspend_domain);
+EXPORT_SYMBOL(adeos_alloc_irq);
+EXPORT_SYMBOL(adp_cpu_current);
+EXPORT_SYMBOL(adp_root);
+/* EXPORT_SYMBOL(adp_pipelined); */ /* already exported by armksyms.c */
+EXPORT_SYMBOL(__adeos_handle_event);
+EXPORT_SYMBOL(__adeos_unstall_root);
+EXPORT_SYMBOL(__adeos_stall_root);
+EXPORT_SYMBOL(__adeos_restore_root);
+EXPORT_SYMBOL(__adeos_restore_root_nosync);
+EXPORT_SYMBOL(__adeos_test_and_stall_root);
+EXPORT_SYMBOL(__adeos_test_root);
+EXPORT_SYMBOL(__adeos_dump_state);
+EXPORT_SYMBOL(__adeos_pipeline);
+EXPORT_SYMBOL(__adeos_pipelock);
+EXPORT_SYMBOL(__adeos_virtual_irq_map);
+EXPORT_SYMBOL(__adeos_event_monitors);
+/* The following are convenience exports which are needed by some
+   Adeos domains loaded as kernel modules. */
+EXPORT_SYMBOL(__mmdrop);
+EXPORT_SYMBOL(do_fork);
+EXPORT_SYMBOL(do_exit);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/exit.c linux-2.6.8.1-tcl1-adeos/kernel/exit.c
--- linux-2.6.8.1-tcl1/kernel/exit.c	2005-11-18 10:40:00.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/exit.c	2005-11-18 14:01:33.000000000 +0000
@@ -821,6 +821,9 @@ asmlinkage NORET_TYPE void do_exit(long 
 	}
 
 	acct_process(code);
+#ifdef CONFIG_ADEOS_CORE
+	__adeos_exit_process(tsk);
+#endif /* CONFIG_ADEOS_CORE */
 	__exit_mm(tsk);
 
 	exit_sem(tsk);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/fork.c linux-2.6.8.1-tcl1-adeos/kernel/fork.c
--- linux-2.6.8.1-tcl1/kernel/fork.c	2005-11-18 10:40:01.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/fork.c	2005-11-18 14:01:33.000000000 +0000
@@ -1094,6 +1094,14 @@ struct task_struct *copy_process(unsigne
 
 	nr_threads++;
 	write_unlock_irq(&tasklist_lock);
+#ifdef CONFIG_ADEOS_CORE
+	{
+	int k;
+
+	for (k = 0; k < ADEOS_ROOT_NPTDKEYS; k++)
+	    p->ptd[k] = NULL;
+	}
+#endif /* CONFIG_ADEOS_CORE */
 	retval = 0;
 
 fork_out:
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/Makefile linux-2.6.8.1-tcl1-adeos/kernel/Makefile
--- linux-2.6.8.1-tcl1/kernel/Makefile	2005-11-18 10:39:56.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/Makefile	2005-11-18 14:01:30.000000000 +0000
@@ -9,6 +9,7 @@ obj-y     = sched.o fork.o exec_domain.o
 	    rcupdate.o intermodule.o extable.o params.o posix-timers.o \
 	    kthread.o
 
+obj-$(CONFIG_ADEOS_CORE) += adeos.o
 obj-$(CONFIG_FUTEX) += futex.o
 obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
 obj-$(CONFIG_SMP) += cpu.o
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/panic.c linux-2.6.8.1-tcl1-adeos/kernel/panic.c
--- linux-2.6.8.1-tcl1/kernel/panic.c	2005-11-18 10:40:04.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/panic.c	2005-11-18 14:01:38.000000000 +0000
@@ -66,6 +66,9 @@ NORET_TYPE void panic(const char * fmt, 
 		printk(KERN_EMERG "In idle task - not syncing\n");
 	else
 		sys_sync();
+#ifdef CONFIG_ADEOS_CORE
+	__adeos_dump_state();
+#endif /* CONFIG_ADEOS_CORE */
 	bust_spinlocks(0);
 
 #ifdef CONFIG_SMP
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/printk.c linux-2.6.8.1-tcl1-adeos/kernel/printk.c
--- linux-2.6.8.1-tcl1/kernel/printk.c	2005-11-18 10:40:05.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/printk.c	2005-11-18 14:01:41.000000000 +0000
@@ -3,6 +3,10 @@
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
  *
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
+ *
  * Modified to make sys_syslog() more flexible: added commands to
  * return the last 4k of kernel messages, regardless of whether
  * they've been read or not.  Added option to suppress kernel printk's
@@ -33,6 +37,17 @@
 
 #include <asm/uaccess.h>
 
+#ifdef CONFIG_ADEOS_CORE
+#undef spin_lock_irq
+#define	spin_lock_irq(lock)                 adeos_spin_lock_disable(lock)
+#undef spin_unlock_irq
+#define	spin_unlock_irq(lock)               adeos_spin_unlock_enable(lock)
+#undef spin_lock_irqsave
+#define	spin_lock_irqsave(lock, flags)      adeos_spin_lock_irqsave(lock,flags)
+#undef spin_unlock_irqrestore
+#define spin_unlock_irqrestore(lock, flags) adeos_spin_unlock_irqrestore(lock,flags)
+#endif /* CONFIG_ADEOS_CORE */
+
 #define __LOG_BUF_LEN	(1 << CONFIG_LOG_BUF_SHIFT)
 
 /* printk's without a loglevel use this.. */
@@ -494,7 +509,7 @@ static void zap_locks(void)
 
 /*
  * This is printk.  It can be called from any context.  We want it to work.
- * 
+ *
  * We try to grab the console_sem.  If we succeed, it's easy - we log the output and
  * call the console drivers.  If we fail to get the semaphore we place the output
  * into the log buffer and return.  The current holder of the console_sem will
@@ -505,26 +520,27 @@ static void zap_locks(void)
  * then changes console_loglevel may break. This is because console_loglevel
  * is inspected when the actual printing occurs.
  */
+
 asmlinkage int printk(const char *fmt, ...)
 {
 	va_list args;
-	unsigned long flags;
+	unsigned long flags, swflag;
 	int printed_len;
 	char *p;
 	static char printk_buf[1024];
 	static int log_level_unknown = 1;
+	swflag = __adeos_test_root();
 
 	if (unlikely(oops_in_progress))
 		zap_locks();
-
 	/* This stops the holder of console_sem just where we want him */
+
 	spin_lock_irqsave(&logbuf_lock, flags);
 
 	/* Emit the output into the temporary buffer */
 	va_start(args, fmt);
 	printed_len = vscnprintf(printk_buf, sizeof(printk_buf), fmt, args);
 	va_end(args);
-
 	/*
 	 * Copy the output into log_buf.  If the caller didn't provide
 	 * appropriate log level tags, we insert them here
@@ -543,6 +559,26 @@ asmlinkage int printk(const char *fmt, .
 			log_level_unknown = 1;
 	}
 
+#ifdef CONFIG_ADEOS_CORE
+	if (adp_current != adp_root && !test_bit(ADEOS_SPRINTK_FLAG,&adp_current->flags)) {
+
+	/* When operating in asynchronous printk() mode, ensure the
+	   console drivers and klogd wakeup are only run by Linux,
+	   delegating the actual output to the root domain by mean of
+	   a virtual IRQ kicking our sync handler. If the current
+	   domain has a lower priority than Linux, then we'll get
+	   immediately preempted by it. In synchronous printk() mode,
+	   immediately call the console drivers. */
+
+	    spin_unlock_irqrestore(&logbuf_lock, flags);
+
+ 	    if (!test_and_set_bit(ADEOS_PPRINTK_FLAG,&adp_root->flags))
+ 		adeos_trigger_irq(__adeos_printk_virq);
+
+	    goto out;
+
+ 	}
+#endif /* CONFIG_ADEOS_CORE */
 	if (!cpu_online(smp_processor_id()) &&
 	    system_state != SYSTEM_RUNNING) {
 		/*
@@ -551,27 +587,42 @@ asmlinkage int printk(const char *fmt, .
 		 * CPU until it is officially up.  We shouldn't be calling into
 		 * random console drivers on a CPU which doesn't exist yet..
 		 */
+
 		spin_unlock_irqrestore(&logbuf_lock, flags);
+
 		goto out;
+
 	}
-	if (!down_trylock(&console_sem)) {
+#ifdef CONFIG_ADEOS_CORE
+ 	if (adp_current != adp_root || !down_trylock(&console_sem)) {
+#else /* !CONFIG_ADEOS_CORE */
+ 	if (!down_trylock(&console_sem)) {
+#endif /* CONFIG_ADEOS_CORE */
 		console_locked = 1;
 		/*
 		 * We own the drivers.  We can drop the spinlock and let
 		 * release_console_sem() print the text
 		 */
+
 		spin_unlock_irqrestore(&logbuf_lock, flags);
+
 		console_may_schedule = 0;
+
 		release_console_sem();
+
 	} else {
 		/*
 		 * Someone else owns the drivers.  We drop the spinlock, which
 		 * allows the semaphore holder to proceed and to call the
 		 * console drivers with the output which we just produced.
 		 */
+
 		spin_unlock_irqrestore(&logbuf_lock, flags);
+
 	}
+
 out:
+	__adeos_restore_root_nosync(swflag);
 	return printed_len;
 }
 EXPORT_SYMBOL(printk);
@@ -631,15 +682,57 @@ void release_console_sem(void)
 		spin_unlock_irqrestore(&logbuf_lock, flags);
 		call_console_drivers(_con_start, _log_end);
 	}
+
 	console_locked = 0;
+
 	console_may_schedule = 0;
+
+#ifdef CONFIG_ADEOS_CORE
+	if (adp_root != adp_current) {
+	    spin_unlock_irqrestore(&logbuf_lock, flags);
+	    return;
+	}
+	spin_unlock_irqrestore(&logbuf_lock, flags);
+
+	up(&console_sem);
+
+#else /* !CONFIG_ADEOS_CORE */
 	up(&console_sem);
 	spin_unlock_irqrestore(&logbuf_lock, flags);
+#endif /* CONFIG_ADEOS_CORE */
 	if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait))
 		wake_up_interruptible(&log_wait);
+
 }
+
+
 EXPORT_SYMBOL(release_console_sem);
 
+#ifdef CONFIG_ADEOS_CORE
+void __adeos_sync_console (unsigned virq) {
+
+    /* This handler always runs on behalf of the root (Linux) domain. */
+
+    unsigned long flags;
+
+    spin_lock_irqsave(&logbuf_lock, flags);
+
+    /* Not absolutely atomic wrt to the triggering point, but this is
+       harmless. We only try to reduce the useless triggers by a cheap
+       trick here. */
+
+    clear_bit(ADEOS_PPRINTK_FLAG,&adp_root->flags);
+
+    if (cpu_online(smp_processor_id()) && system_state == SYSTEM_RUNNING && !down_trylock(&console_sem)) {
+        console_locked = 1;
+	spin_unlock_irqrestore(&logbuf_lock, flags);
+        console_may_schedule = 0;
+	release_console_sem();
+    } else
+	spin_unlock_irqrestore(&logbuf_lock, flags);
+}
+#endif /* CONFIG_ADEOS_CORE */
+
 /** console_conditional_schedule - yield the CPU if required
  *
  * If the console code is currently allowed to sleep, and
@@ -832,7 +925,7 @@ int unregister_console(struct console * 
 	return res;
 }
 EXPORT_SYMBOL(unregister_console);
-	
+
 /**
  * tty_write_message - write a message to a certain tty, not just the console.
  *
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/sched.c linux-2.6.8.1-tcl1-adeos/kernel/sched.c
--- linux-2.6.8.1-tcl1/kernel/sched.c	2005-11-18 10:40:09.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/sched.c	2005-11-18 14:01:44.000000000 +0000
@@ -16,6 +16,10 @@
  *		by Davide Libenzi, preemptible kernel bits by Robert Love.
  *  2003-09-03	Interactivity tuning by Con Kolivas.
  *  2004-04-02	Scheduler domains code by Nick Piggin
+ *
+ *   RTAI/ARM over Adeos rewrite for PXA255_2.6.7:
+ *   Copyright (c) 2005 Stefano Gafforelli (stefano.gafforelli@tiscali.it)
+ *   Copyright (c) 2005 Luca Pizzi (lucapizzi@hotmail.com)
  */
 
 #include <linux/mm.h>
@@ -249,8 +253,16 @@ static DEFINE_PER_CPU(struct runqueue, r
  * Default context-switch locking:
  */
 #ifndef prepare_arch_switch
+#ifdef CONFIG_ADEOS_CORE
+#define prepare_arch_switch(rq,prev,next) \
+do { \
+    struct { struct task_struct *prev, *next; } arg = { (prev), (next) }; \
+    __adeos_schedule_head(&arg); \
+    adeos_hw_cli(); \
+} while(0)
+#else /* !CONFIG_ADEOS_CORE */
 # define prepare_arch_switch(rq, next)	do { } while (0)
-# define finish_arch_switch(rq, next)	spin_unlock_irq(&(rq)->lock)
+#endif /* CONFIG_ADEOS_CORE */
 # define task_running(rq, p)		((rq)->curr == (p))
 #endif
 
@@ -1043,6 +1055,10 @@ asmlinkage void schedule_tail(task_t *pr
 
 	if (current->set_child_tid)
 		put_user(current->pid, current->set_child_tid);
+
+#ifdef CONFIG_ADEOS_CORE
+	__adeos_enter_process();
+#endif /* CONFIG_ADEOS_CORE */
 }
 
 /*
@@ -2192,6 +2208,11 @@ asmlinkage void __sched schedule(void)
 	unsigned long run_time;
 	int cpu, idx;
 
+#ifdef CONFIG_ADEOS_CORE
+	if (adp_current != adp_root) /* Let's be helpful and	conservative. */
+	    return;
+#endif /* CONFIG_ADEOS_CORE */
+
 	/*
 	 * Test if we are atomic.  Since do_exit() needs to call into
 	 * schedule() atomically, we ignore that path for now.
@@ -2303,10 +2324,24 @@ switch_tasks:
 		rq->curr = next;
 		++*switch_count;
 
-		prepare_arch_switch(rq, next);
+#ifdef CONFIG_ADEOS_CORE
+		prepare_arch_switch(rq, prev, next);
+#else /* !CONFIG_ADEOS_CORE */
+  		prepare_arch_switch(rq, next);
+#endif /* CONFIG_ADEOS_CORE */
 		prev = context_switch(rq, prev, next);
 		barrier();
 
+#ifdef CONFIG_ADEOS_CORE
+		if (likely(adp_pipelined))
+		    adeos_hw_sti();
+
+		if (__adeos_schedule_tail(prev) > 0)
+		    /* Some event handler asked for a truncated
+		       scheduling tail. Just obey. */
+		    return;
+#endif /* CONFIG_ADEOS_CORE */
+
 		finish_task_switch(prev);
 	} else
 		spin_unlock_irq(&rq->lock);
@@ -2319,6 +2354,20 @@ switch_tasks:
 
 EXPORT_SYMBOL(schedule);
 
+#ifdef CONFIG_ADEOS_CORE
+
+void __adeos_schedule_back_root (struct task_struct *prev)
+
+{
+    finish_task_switch(prev);
+    reacquire_kernel_lock(current);
+    preempt_enable_no_resched();
+}
+
+EXPORT_SYMBOL(__adeos_schedule_back_root);
+
+#endif /* CONFIG_ADEOS_CORE */
+
 #ifdef CONFIG_PREEMPT
 /*
  * this is is the entry point to schedule() from in-kernel preemption
@@ -2329,6 +2378,14 @@ asmlinkage void __sched preempt_schedule
 {
 	struct thread_info *ti = current_thread_info();
 
+#ifdef CONFIG_ADEOS_CORE
+ 	/* The in-kernel preemption routine might be indirectly called
+ 	   from code running in other domains, so we must ensure that
+ 	   scheduling only takes place on behalf of the root (Linux)
+ 	   one. */
+	if (adp_current != adp_root)
+	    return;
+#endif /* CONFIG_ADEOS_CORE */
 	/*
 	 * If there is a non-zero preempt_count or interrupts are disabled,
 	 * we do not want to preempt the current task.  Just return..
@@ -2367,20 +2424,23 @@ EXPORT_SYMBOL(default_wake_function);
  * started to run but is not in state TASK_RUNNING.  try_to_wake_up() returns
  * zero in this (rare) case, and we handle it by continuing to scan the queue.
  */
+
 static void __wake_up_common(wait_queue_head_t *q, unsigned int mode,
 			     int nr_exclusive, int sync, void *key)
 {
 	struct list_head *tmp, *next;
-
 	list_for_each_safe(tmp, next, &q->task_list) {
 		wait_queue_t *curr;
 		unsigned flags;
 		curr = list_entry(tmp, wait_queue_t, task_list);
+
 		flags = curr->flags;
+
 		if (curr->func(curr, mode, sync, key) &&
 		    (flags & WQ_FLAG_EXCLUSIVE) &&
-		    !--nr_exclusive)
+		    !--nr_exclusive){
 			break;
+			}
 	}
 }
 
@@ -2396,10 +2456,13 @@ void fastcall __wake_up(wait_queue_head_
 	unsigned long flags;
 
 	spin_lock_irqsave(&q->lock, flags);
+
 	__wake_up_common(q, mode, nr_exclusive, 0, key);
+
 	spin_unlock_irqrestore(&q->lock, flags);
 }
 
+
 EXPORT_SYMBOL(__wake_up);
 
 /*
@@ -2774,6 +2837,16 @@ static int setscheduler(pid_t pid, int p
 	if (retval)
 		goto out_unlock;
 
+#ifdef CONFIG_ADEOS_CORE
+	{
+	struct { struct task_struct *task; int policy; struct sched_param *param; } evdata = { p, policy, &lp };
+	if (__adeos_renice_process(&evdata))
+	    {
+	    retval = 0;
+	    goto out_unlock;
+	    }
+	}
+#endif /* CONFIG_ADEOS_CORE */
 	array = p->array;
 	if (array)
 		deactivate_task(p, task_rq(p));
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/signal.c linux-2.6.8.1-tcl1-adeos/kernel/signal.c
--- linux-2.6.8.1-tcl1/kernel/signal.c	2005-11-18 10:40:10.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/signal.c	2005-11-18 14:01:46.000000000 +0000
@@ -557,6 +557,13 @@ void signal_wake_up(struct task_struct *
 
 	set_tsk_thread_flag(t, TIF_SIGPENDING);
 
+#ifdef CONFIG_ADEOS_CORE
+	{
+	struct { struct task_struct *t; } evdata = { t };
+	__adeos_kick_process(&evdata);
+	}
+#endif  /*CONFIG_ADEOS_CORE */
+
 	/*
 	 * If resume is set, we want to wake it up in the TASK_STOPPED case.
 	 * We don't check for TASK_STOPPED because there is a race with it
@@ -785,6 +792,17 @@ specific_send_sig_info(int sig, struct s
 		BUG();
 #endif
 
+#ifdef CONFIG_ADEOS_CORE
+	/* If some domain handler in the pipeline doesn't ask for
+	   propagation, return success pretending that 'sig' was
+	   delivered. */
+	{
+	struct { struct task_struct *task; int sig; } evdata = { t, sig };
+	if (__adeos_signal_process(&evdata))
+	    goto out;
+	}
+#endif /* CONFIG_ADEOS_CORE */
+
 	if (((unsigned long)info > 2) && (info->si_code == SI_TIMER))
 		/*
 		 * Set up a return to indicate that we dropped the signal.
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/softirq.c linux-2.6.8.1-tcl1-adeos/kernel/softirq.c
--- linux-2.6.8.1-tcl1/kernel/softirq.c	2005-11-18 10:40:11.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/softirq.c	2005-11-18 14:01:46.000000000 +0000
@@ -133,7 +133,7 @@ EXPORT_SYMBOL(do_softirq);
 void local_bh_enable(void)
 {
 	__local_bh_enable();
-	WARN_ON(irqs_disabled());
+	WARN_ON(irqs_disabled());                  
 	if (unlikely(!in_interrupt() &&
 		     local_softirq_pending()))
 		invoke_softirq();
@@ -306,7 +306,7 @@ void tasklet_kill(struct tasklet_struct 
 	while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
 		do
 			yield();
-		while (test_bit(TASKLET_STATE_SCHED, &t->state));
+		while (test_bit(TASKLET_STATE_SCHED, &t->state));    
 	}
 	tasklet_unlock_wait(t);
 	clear_bit(TASKLET_STATE_SCHED, &t->state);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/sysctl.c linux-2.6.8.1-tcl1-adeos/kernel/sysctl.c
--- linux-2.6.8.1-tcl1/kernel/sysctl.c	2005-11-18 10:40:13.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/sysctl.c	2005-11-18 14:01:49.000000000 +0000
@@ -917,6 +917,9 @@ void __init sysctl_init(void)
 #ifdef CONFIG_PROC_FS
 	register_proc_table(root_table, proc_sys_root);
 	init_irq_proc();
+#ifdef CONFIG_ADEOS_CORE
+	__adeos_init_proc();
+#endif /* CONFIG_ADEOS_CORE */
 #endif
 }
 
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/time.c linux-2.6.8.1-tcl1-adeos/kernel/time.c
--- linux-2.6.8.1-tcl1/kernel/time.c	2005-11-18 10:40:13.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/time.c	2005-11-18 14:01:49.000000000 +0000
@@ -31,6 +31,8 @@
 #include <asm/uaccess.h>
 #include <asm/unistd.h>
 
+volatile u32 soft_timer_match;
+EXPORT_SYMBOL(soft_timer_match);
 /* 
  * The timezone where the local system is located.  Used as a default by some
  * programs who obtain this value by using gettimeofday.
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/kernel/timer.c linux-2.6.8.1-tcl1-adeos/kernel/timer.c
--- linux-2.6.8.1-tcl1/kernel/timer.c	2005-11-18 10:40:13.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/kernel/timer.c	2005-11-18 14:01:49.000000000 +0000
@@ -1502,4 +1502,4 @@ void msleep(unsigned int msecs)
 }
 
 EXPORT_SYMBOL(msleep);
-
+EXPORT_SYMBOL(do_timer);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/Makefile linux-2.6.8.1-tcl1-adeos/Makefile
--- linux-2.6.8.1-tcl1/Makefile	2005-11-18 10:09:43.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/Makefile	2005-11-18 13:36:43.000000000 +0000
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 8
-EXTRAVERSION = .1-tcl1
+EXTRAVERSION = .1-tcl1-adeos
 NAME=Zonked Quokka
 
 # *DOCUMENTATION*
@@ -71,7 +71,7 @@ endif
 # In both cases the working directory must be the root of the kernel src.
 # 1) O=
 # Use "make O=dir/to/store/output/files/"
-# 
+#
 # 2) Set KBUILD_OUTPUT
 # Set the environment variable KBUILD_OUTPUT to point to the directory
 # where the output files shall be placed.
@@ -483,6 +483,8 @@ export MODLIB
 ifeq ($(KBUILD_EXTMOD),)
 core-y		+= kernel/ mm/ fs/ ipc/ security/ crypto/
 
+core-$(CONFIG_ADEOS) += adeos/
+
 vmlinux-dirs	:= $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
 		     $(core-y) $(core-m) $(drivers-y) $(drivers-m) \
 		     $(net-y) $(net-m) $(libs-y) $(libs-m)))
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/mm/bootmem.c linux-2.6.8.1-tcl1-adeos/mm/bootmem.c
--- linux-2.6.8.1-tcl1/mm/bootmem.c	2005-11-18 10:41:05.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/mm/bootmem.c	2005-11-18 14:02:42.000000000 +0000
@@ -192,7 +192,7 @@ restart_scan:
 		for (j = i + 1; j < i + areasize; ++j) {
 			if (j >= eidx)
 				goto fail_block;
-			if (test_bit (j, bdata->node_bootmem_map))
+			if (test_bit (j, bdata->node_bootmem_map))  
 				goto fail_block;
 		}
 		start = i;
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/mm/diffy.txt linux-2.6.8.1-tcl1-adeos/mm/diffy.txt
--- linux-2.6.8.1-tcl1/mm/diffy.txt	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/mm/diffy.txt	2005-11-18 14:03:11.000000000 +0000
@@ -0,0 +1,4 @@
+1192c1192
+< 		if (test_bit(n, used_node_mask))         
+---
+> 		if (test_bit(n, used_node_mask))
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/mm/highmem.c linux-2.6.8.1-tcl1-adeos/mm/highmem.c
--- linux-2.6.8.1-tcl1/mm/highmem.c	2005-11-18 10:41:09.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/mm/highmem.c	2005-11-18 14:02:43.000000000 +0000
@@ -350,7 +350,7 @@ static void __bounce_end_io_read(struct 
 {
 	struct bio *bio_orig = bio->bi_private;
 
-	if (test_bit(BIO_UPTODATE, &bio->bi_flags))
+	if (test_bit(BIO_UPTODATE, &bio->bi_flags))    
 		copy_to_high_bio_irq(bio_orig, bio);
 
 	bounce_end_io(bio, pool);
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/Module.symvers linux-2.6.8.1-tcl1-adeos/Module.symvers
--- linux-2.6.8.1-tcl1/Module.symvers	2005-11-18 10:58:18.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/Module.symvers	2005-11-18 14:18:46.000000000 +0000
@@ -32,6 +32,7 @@
 0x00000000	class_interface_unregister	vmlinux
 0x00000000	xdr_encode_netobj	net/sunrpc/sunrpc
 0x00000000	tty_register_device	vmlinux
+0x00000000	usb_bus_list_lock	vmlinux
 0x00000000	find_bus	vmlinux
 0x00000000	steal_locks	vmlinux
 0x00000000	memmove	vmlinux
@@ -66,13 +67,18 @@
 0x00000000	__arch_strncpy_from_user	vmlinux
 0x00000000	find_or_create_page	vmlinux
 0x00000000	sa1100_request_dma	vmlinux
+0x00000000	usb_sg_init	vmlinux
+0x00000000	usb_sg_wait	vmlinux
+0x00000000	usb_buffer_unmap_sg	vmlinux
 0x00000000	invalidate_bdev	vmlinux
 0x00000000	num_registered_fb	vmlinux
+0x00000000	usbctl_ep_set_callback	vmlinux
 0x00000000	xdr_buf_from_iov	net/sunrpc/sunrpc
 0x00000000	class_device_initialize	vmlinux
 0x00000000	blk_cleanup_queue	vmlinux
 0x00000000	tty_hung_up_p	vmlinux
 0x00000000	__blk_attempt_remerge	vmlinux
+0x00000000	usb_driver_release_interface	vmlinux
 0x00000000	mpage_writepages	vmlinux
 0x00000000	write_one_page	vmlinux
 0x00000000	nlmsvc_ops	fs/lockd/lockd
@@ -86,6 +92,7 @@
 0x00000000	freeze_bdev	vmlinux
 0x00000000	bd_release	vmlinux
 0x00000000	param_get_long	vmlinux
+0x00000000	__adeos_event_monitors	vmlinux
 0x00000000	pgprot_kernel	vmlinux
 0x00000000	skb_copy_datagram_iovec	vmlinux
 0x00000000	__kfree_skb	vmlinux
@@ -166,9 +173,11 @@
 0x00000000	strsep	vmlinux
 0x00000000	___pskb_trim	vmlinux
 0x00000000	iomem_resource	vmlinux
+0x00000000	usbctl_parse_request	vmlinux
 0x00000000	strcmp	vmlinux
 0x00000000	__get_user_4	vmlinux
 0x00000000	__put_user_4	vmlinux
+0x00000000	usb_serial_register	drivers/usb/serial/usbserial
 0x00000000	vfs_create	vmlinux
 0x00000000	send_sigqueue	vmlinux
 0x00000000	ide_driveid_update	drivers/ide/ide-core
@@ -189,6 +198,8 @@
 0x00000000	lockd_up	fs/lockd/lockd
 0x00000000	ide_add_setting	drivers/ide/ide-core
 0x00000000	__skb_linearize	vmlinux
+0x00000000	usbctl_init	vmlinux
+0x00000000	usbctl_exit	vmlinux
 0x00000000	cpufreq_get	vmlinux
 0x00000000	sock_no_getsockopt	vmlinux
 0x00000000	sock_no_setsockopt	vmlinux
@@ -218,6 +229,7 @@
 0x00000000	sysfs_create_file	vmlinux
 0x00000000	seq_lseek	vmlinux
 0x00000000	strpbrk	vmlinux
+0x00000000	usbctl_ep_idle	vmlinux
 0x00000000	cache_flush	net/sunrpc/sunrpc
 0x00000000	cache_fresh	net/sunrpc/sunrpc
 0x00000000	journal_invalidatepage	fs/jbd/jbd
@@ -235,6 +247,8 @@
 0x00000000	atmel_open	drivers/net/wireless/atmel
 0x00000000	mii_ethtool_gset	drivers/net/mii
 0x00000000	mii_ethtool_sset	drivers/net/mii
+0x00000000	__adeos_pipeline	vmlinux
+0x00000000	asm_do_IRQ	vmlinux
 0x00000000	release_sock	vmlinux
 0x00000000	class_remove_file	vmlinux
 0x00000000	sync_inode	vmlinux
@@ -251,8 +265,10 @@
 0x00000000	cap_task_reparent_to_init	vmlinux
 0x00000000	tty_flip_buffer_push	vmlinux
 0x00000000	swapper_space	vmlinux
+0x00000000	sa1100_usb_get_descriptor_ptr	vmlinux
 0x00000000	uart_get_divisor	vmlinux
 0x00000000	msleep	vmlinux
+0x00000000	usbctl	vmlinux
 0x00000000	unregister_netdev	vmlinux
 0x00000000	__bforget	vmlinux
 0x00000000	xdr_reserve_space	net/sunrpc/sunrpc
@@ -261,6 +277,7 @@
 0x00000000	get_random_bytes	vmlinux
 0x00000000	probe_irq_off	vmlinux
 0x00000000	rpcauth_unregister	net/sunrpc/sunrpc
+0x00000000	adeos_renice_domain	vmlinux
 0x00000000	balloon_cpld_clock_write	vmlinux
 0x00000000	sock_no_poll	vmlinux
 0x00000000	kmem_find_general_cachep	vmlinux
@@ -284,12 +301,14 @@
 0x00000000	svcauth_gss_register_pseudoflavor	net/sunrpc/auth_gss/auth_rpcgss
 0x00000000	tty_std_termios	vmlinux
 0x00000000	generic_readlink	vmlinux
+0x00000000	__adeos_pipelock	vmlinux
 0x00000000	zlib_deflateParams	lib/zlib_deflate/zlib_deflate
 0x00000000	ether_setup	vmlinux
 0x00000000	elv_requeue_request	vmlinux
 0x00000000	device_create_file	vmlinux
 0x00000000	__break_lease	vmlinux
 0x00000000	param_set_bool	vmlinux
+0x00000000	adeos_critical_exit	vmlinux
 0x00000000	pcmcia_validate_cis	drivers/pcmcia/pcmcia_core
 0x00000000	force_sig	vmlinux
 0x00000000	fat_truncate	fs/fat/fat
@@ -300,6 +319,7 @@
 0x00000000	system_bus_clock	drivers/ide/ide-core
 0x00000000	hci_free_dev	net/bluetooth/bluetooth
 0x00000000	igrab	vmlinux
+0x00000000	adeos_irq_entry	vmlinux
 0x00000000	per_cpu__softnet_data	vmlinux
 0x00000000	sock_recvmsg	vmlinux
 0x00000000	system_utsname	vmlinux
@@ -335,6 +355,7 @@
 0x00000000	block_invalidatepage	vmlinux
 0x00000000	balloon_pcmcia_assert_reset	vmlinux
 0x00000000	__release_sock	vmlinux
+0x00000000	__adeos_stall_root	vmlinux
 0x00000000	loop_unregister_transfer	drivers/block/loop
 0x00000000	xdr_decode_netobj	net/sunrpc/sunrpc
 0x00000000	ethtool_op_set_tso	vmlinux
@@ -353,6 +374,7 @@
 0x00000000	ethtool_op_set_tx_csum	vmlinux
 0x00000000	generic_mii_ioctl	drivers/net/mii
 0x00000000	bt_accept_dequeue	net/bluetooth/bluetooth
+0x00000000	usb_bulk_msg	vmlinux
 0x00000000	blk_attempt_remerge	vmlinux
 0x00000000	rb_prev	vmlinux
 0x00000000	unregister_framebuffer	vmlinux
@@ -372,6 +394,7 @@
 0x00000000	rpc_delay	net/sunrpc/sunrpc
 0x00000000	rpc_proc_unregister	net/sunrpc/sunrpc
 0x00000000	tcp_v4_remember_stamp	vmlinux
+0x00000000	__usb_reset_device	vmlinux
 0x00000000	device_power_up	vmlinux
 0x00000000	nobh_commit_write	vmlinux
 0x00000000	sk_free	vmlinux
@@ -381,7 +404,9 @@
 0x00000000	sleep_on	vmlinux
 0x00000000	proc_bus	vmlinux
 0x00000000	simple_lookup	vmlinux
+0x00000000	adeos_alloc_irq	vmlinux
 0x00000000	netlink_register_notifier	vmlinux
+0x00000000	usb_match_id	vmlinux
 0x00000000	unlock_rename	vmlinux
 0x00000000	devfs_mk_bdev	vmlinux
 0x00000000	devfs_mk_cdev	vmlinux
@@ -398,6 +423,7 @@
 0x00000000	svc_exit_thread	net/sunrpc/sunrpc
 0x00000000	current_kernel_time	vmlinux
 0x00000000	netlink_set_nonroot	vmlinux
+0x00000000	usb_reset_device	vmlinux
 0x00000000	locks_copy_lock	vmlinux
 0x00000000	pcmcia_eject_card	drivers/pcmcia/pcmcia_core
 0x00000000	sock_create_kern	vmlinux
@@ -406,6 +432,7 @@
 0x00000000	fb_set_cmap	vmlinux
 0x00000000	radix_tree_tagged	vmlinux
 0x00000000	unload_nls	vmlinux
+0x00000000	do_timer	vmlinux
 0x00000000	__down_trylock_failed	vmlinux
 0x00000000	gss_mech_get	net/sunrpc/auth_gss/auth_rpcgss
 0x00000000	ide_dma_enable	drivers/ide/ide-core
@@ -431,6 +458,8 @@
 0x00000000	system_serial_low	vmlinux
 0x00000000	register_blkdev	vmlinux
 0x00000000	wake_up_buffer	vmlinux
+0x00000000	usbc_string_free_all	vmlinux
+0x00000000	irq_desc	vmlinux
 0x00000000	neigh_event_ns	vmlinux
 0x00000000	request_firmware_nowait	drivers/base/firmware_class
 0x00000000	kref_get	vmlinux
@@ -476,6 +505,7 @@
 0x00000000	system_serial_high	vmlinux
 0x00000000	ip_dev_find	vmlinux
 0x00000000	path_lookup	vmlinux
+0x00000000	usbb_alloc	vmlinux
 0x00000000	rpcauth_init_credcache	net/sunrpc/sunrpc
 0x00000000	xdr_shift_buf	net/sunrpc/sunrpc
 0x00000000	device_register	vmlinux
@@ -501,11 +531,13 @@
 0x00000000	high_memory	vmlinux
 0x00000000	next_thread	vmlinux
 0x00000000	balloon_pinko_disable	vmlinux
+0x00000000	usb_serial_deregister	drivers/usb/serial/usbserial
 0x00000000	destroy_proc_ide_interfaces	drivers/ide/ide-core
 0x00000000	simple_link	vmlinux
 0x00000000	journal_blocks_per_page	fs/jbd/jbd
 0x00000000	sysdev_remove_file	vmlinux
 0x00000000	mempool_create	vmlinux
+0x00000000	__adeos_std_irq_chip	vmlinux
 0x00000000	kblockd_schedule_work	vmlinux
 0x00000000	send_sig_info	vmlinux
 0x00000000	__neigh_event_send	vmlinux
@@ -526,6 +558,7 @@
 0x00000000	kobject_put	vmlinux
 0x00000000	param_set_copystring	vmlinux
 0x00000000	consistent_sync	vmlinux
+0x00000000	usb_reset_configuration	vmlinux
 0x00000000	d_validate	vmlinux
 0x00000000	enable_irq_wake	vmlinux
 0x00000000	subsystem_init	vmlinux
@@ -542,15 +575,19 @@
 0x00000000	dlci_ioctl_set	vmlinux
 0x00000000	kobject_unregister	vmlinux
 0x00000000	register_sound_mixer	vmlinux
+0x00000000	usb_submit_urb	vmlinux
 0x00000000	page_symlink_inode_operations	vmlinux
 0x00000000	vunmap	vmlinux
 0x00000000	refrigerator	vmlinux
 0x00000000	shrink_dcache_anon	vmlinux
 0x00000000	set_page_dirty_lock	vmlinux
+0x00000000	adeos_unlock_mutex	vmlinux
 0x00000000	tcp_v4_conn_request	vmlinux
+0x00000000	usb_get_descriptor	vmlinux
 0x00000000	get_mtd_device	vmlinux
 0x00000000	batch_entropy_store	vmlinux
 0x00000000	tcp_v4_syn_recv_sock	vmlinux
+0x00000000	usb_put_dev	vmlinux
 0x00000000	kmem_cache_shrink	vmlinux
 0x00000000	__readwrite_bug	vmlinux
 0x00000000	mii_check_link	drivers/net/mii
@@ -563,6 +600,8 @@
 0x00000000	disable_irq	vmlinux
 0x00000000	pcmcia_get_configuration_info	drivers/pcmcia/pcmcia_core
 0x00000000	sysfs_remove_file	vmlinux
+0x00000000	__switch_to	vmlinux
+0x00000000	timer_tick	vmlinux
 0x00000000	pcmcia_register_mtd	drivers/pcmcia/pcmcia_core
 0x00000000	invalidate_partition	vmlinux
 0x00000000	do_brk	vmlinux
@@ -596,10 +635,13 @@
 0x00000000	taskfile_output_data	drivers/ide/ide-core
 0x00000000	sync_dirty_buffer	vmlinux
 0x00000000	kill_proc_info	vmlinux
+0x00000000	usb_alloc_urb	vmlinux
 0x00000000	add_disk_randomness	vmlinux
 0x00000000	inode_init_once	vmlinux
 0x00000000	pcmcia_suspend_card	drivers/pcmcia/pcmcia_core
 0x00000000	scsi_cmd_ioctl	vmlinux
+0x00000000	soft_timer_match	vmlinux
+0x00000000	adeos_trigger_irq	vmlinux
 0x00000000	fb_prepare_logo	vmlinux
 0x00000000	neigh_table_init	vmlinux
 0x00000000	blk_queue_segment_boundary	vmlinux
@@ -614,6 +656,7 @@
 0x00000000	ethtool_op_set_sg	vmlinux
 0x00000000	seq_release	vmlinux
 0x00000000	hotplug_path	vmlinux
+0x00000000	usbctl_ep_reset	vmlinux
 0x00000000	ide_task_ioctl	drivers/ide/ide-core
 0x00000000	baswap	net/bluetooth/bluetooth
 0x00000000	sysfs_create_bin_file	vmlinux
@@ -642,12 +685,14 @@
 0x00000000	files_lock	vmlinux
 0x00000000	vm_committed_space	vmlinux
 0x00000000	auth_unix_add_addr	net/sunrpc/sunrpc
+0x00000000	usb_alloc_dev	vmlinux
 0x00000000	proc_root_fs	vmlinux
 0x00000000	rpc_debug	net/sunrpc/sunrpc
 0x00000000	bus_create_file	vmlinux
 0x00000000	console_conditional_schedule	vmlinux
 0x00000000	svc_destroy	net/sunrpc/sunrpc
 0x00000000	fat_detach	fs/fat/fat
+0x00000000	__adeos_virtual_irq_map	vmlinux
 0x00000000	abi_defhandler_libcso	vmlinux
 0x00000000	vc_cons_allocated	vmlinux
 0x00000000	hci_register_proto	net/bluetooth/bluetooth
@@ -656,6 +701,7 @@
 0x00000000	elevator_noop	vmlinux
 0x00000000	__netdev_watchdog_up	vmlinux
 0x00000000	cache_check	net/sunrpc/sunrpc
+0x00000000	usb_check_bandwidth	vmlinux
 0x00000000	set_blocksize	vmlinux
 0x00000000	uart_unregister_driver	vmlinux
 0x00000000	blk_execute_rq	vmlinux
@@ -684,12 +730,14 @@
 0x00000000	kmem_cache_alloc_node	vmlinux
 0x00000000	param_set_long	vmlinux
 0x00000000	ip_mc_join_group	vmlinux
+0x00000000	usb_string	vmlinux
 0x00000000	journal_update_superblock	fs/jbd/jbd
 0x00000000	mb_cache_entry_dup	fs/mbcache
 0x00000000	skb_clone_fraglist	vmlinux
 0x00000000	cpu_sysdev_class	vmlinux
 0x00000000	class_simple_set_hotplug	vmlinux
 0x00000000	strlcpy	vmlinux
+0x00000000	__adeos_switch_domain	vmlinux
 0x00000000	strncpy	vmlinux
 0x00000000	_set_bit_le	vmlinux
 0x00000000	pcmcia_get_socket_by_nr	drivers/pcmcia/pcmcia_core
@@ -703,12 +751,14 @@
 0x00000000	allocate_resource	vmlinux
 0x00000000	block_prepare_write	vmlinux
 0x00000000	remove_suid	vmlinux
+0x00000000	do_fork	vmlinux
 0x00000000	kill_pg	vmlinux
 0x00000000	fat_notify_change	fs/fat/fat
 0x00000000	vfs_rmdir	vmlinux
 0x00000000	generic_shutdown_super	vmlinux
 0x00000000	get_jiffies_64	vmlinux
 0x00000000	svc_create_thread	net/sunrpc/sunrpc
+0x00000000	adeos_get_sysinfo	vmlinux
 0x00000000	cap_bprm_set_security	vmlinux
 0x00000000	del_mtd_partitions	vmlinux
 0x00000000	init_buffer	vmlinux
@@ -718,6 +768,7 @@
 0x00000000	vfs_link	vmlinux
 0x00000000	journal_flush	fs/jbd/jbd
 0x00000000	tcp_send_synack	vmlinux
+0x00000000	usb_buffer_alloc	vmlinux
 0x00000000	fb_iomove_buf_aligned	vmlinux
 0x00000000	panic_notifier_list	vmlinux
 0x00000000	ide_dump_atapi_status	drivers/ide/ide-core
@@ -734,6 +785,8 @@
 0x00000000	read_cache_page	vmlinux
 0x00000000	dev_change_flags	vmlinux
 0x00000000	cpu_present_map	vmlinux
+0x00000000	usbc_string_add	vmlinux
+0x00000000	usbc_string_del	vmlinux
 0x00000000	nand_scan	vmlinux
 0x00000000	bt_sock_unregister	net/bluetooth/bluetooth
 0x00000000	__kill_fasync	vmlinux
@@ -743,7 +796,9 @@
 0x00000000	generic_unplug_device	vmlinux
 0x00000000	set_dma_speed	vmlinux
 0x00000000	pm_unregister	vmlinux
+0x00000000	usbc_string_init	vmlinux
 0x00000000	__bug	vmlinux
+0x00000000	usb_init_urb	vmlinux
 0x00000000	_memcpy_fromio	vmlinux
 0x00000000	__get_user_2	vmlinux
 0x00000000	__put_user_2	vmlinux
@@ -780,6 +835,7 @@
 0x00000000	udp_sendmsg	vmlinux
 0x00000000	ide_unregister	drivers/ide/ide-core
 0x00000000	init_rwsem	vmlinux
+0x00000000	usb_kill_urb	vmlinux
 0x00000000	sk_wait_data	vmlinux
 0x00000000	sock_alloc_inode	vmlinux
 0x00000000	sa1100_audio_resume	vmlinux
@@ -788,7 +844,10 @@
 0x00000000	blk_phys_contig_segment	vmlinux
 0x00000000	end_buffer_read_sync	vmlinux
 0x00000000	inter_module_get_request	vmlinux
+0x00000000	usb_calc_bus_time	vmlinux
 0x00000000	param_get_ushort	vmlinux
+0x00000000	usb_find_interface	vmlinux
+0x00000000	usbctl_reset	vmlinux
 0x00000000	netdev_boot_setup_check	vmlinux
 0x00000000	sock_i_uid	vmlinux
 0x00000000	sock_i_ino	vmlinux
@@ -813,6 +872,7 @@
 0x00000000	icmp_send	vmlinux
 0x00000000	rtattr_parse	vmlinux
 0x00000000	journal_recover	fs/jbd/jbd
+0x00000000	usb_deregister_dev	vmlinux
 0x00000000	dev_open	vmlinux
 0x00000000	ilookup	vmlinux
 0x00000000	free_pages	vmlinux
@@ -838,9 +898,11 @@
 0x00000000	journal_start_commit	fs/jbd/jbd
 0x00000000	bus_add_device	vmlinux
 0x00000000	sock_release	vmlinux
+0x00000000	usb_hcd_giveback_urb	vmlinux
 0x00000000	add_wait_queue_exclusive	vmlinux
 0x00000000	crc_ccitt_table	lib/crc-ccitt
 0x00000000	nlmclnt_proc	fs/lockd/lockd
+0x00000000	usb_claim_bandwidth	vmlinux
 0x00000000	utf8_wcstombs	vmlinux
 0x00000000	kill_sl	vmlinux
 0x00000000	__orinoco_down	drivers/net/wireless/orinoco
@@ -850,8 +912,10 @@
 0x00000000	vmalloc	vmlinux
 0x00000000	__raw_readsl	vmlinux
 0x00000000	hermes_struct_init	drivers/net/wireless/hermes
+0x00000000	__adeos_test_root	vmlinux
 0x00000000	pcmcia_close_memory	drivers/pcmcia/pcmcia_core
 0x00000000	mb_cache_entry_find_first	fs/mbcache
+0x00000000	adeos_register_domain	vmlinux
 0x00000000	gss_mech_get_by_name	net/sunrpc/auth_gss/auth_rpcgss
 0x00000000	ppp_unregister_compressor	drivers/net/ppp_generic
 0x00000000	cap_capset_check	vmlinux
@@ -865,6 +929,7 @@
 0x00000000	neigh_sysctl_register	vmlinux
 0x00000000	sys_close	vmlinux
 0x00000000	fat_build_inode	fs/fat/fat
+0x00000000	adeos_unstall_pipeline	vmlinux
 0x00000000	seq_read	vmlinux
 0x00000000	is_bad_inode	vmlinux
 0x00000000	param_get_int	vmlinux
@@ -878,6 +943,8 @@
 0x00000000	dma_alloc_coherent	vmlinux
 0x00000000	simple_empty	vmlinux
 0x00000000	journal_lock_updates	fs/jbd/jbd
+0x00000000	usb_hcd_irq	vmlinux
+0x00000000	usb_hub_tt_clear_buffer	vmlinux
 0x00000000	blk_queue_merge_bvec	vmlinux
 0x00000000	set_dma_count	vmlinux
 0x00000000	dev_set_mtu	vmlinux
@@ -893,9 +960,11 @@
 0x00000000	add_mtd_blktrans_dev	vmlinux
 0x00000000	__div0	vmlinux
 0x00000000	pcmcia_resume_card	drivers/pcmcia/pcmcia_core
+0x00000000	usb_buffer_free	vmlinux
 0x00000000	ide_fops	drivers/ide/ide-core
 0x00000000	i2c_smbus_write_word_data	drivers/i2c/i2c-core
 0x00000000	tcp_sendmsg	vmlinux
+0x00000000	usbctl_suspend	vmlinux
 0x00000000	pcmcia_deregister_erase_queue	drivers/pcmcia/pcmcia_core
 0x00000000	sock_map_fd	vmlinux
 0x00000000	l3_bit_add_bus	vmlinux
@@ -932,6 +1001,8 @@
 0x00000000	nr_swap_pages	vmlinux
 0x00000000	sock_create	vmlinux
 0x00000000	kill_litter_super	vmlinux
+0x00000000	usbctl_stop	vmlinux
+0x00000000	usb_free_urb	vmlinux
 0x00000000	balloon_audio_latch	vmlinux
 0x00000000	pcmcia_get_first_tuple	drivers/pcmcia/pcmcia_core
 0x00000000	skb_copy_bits	vmlinux
@@ -963,6 +1034,7 @@
 0x00000000	fat_put_super	fs/fat/fat
 0x00000000	tcp_close	vmlinux
 0x00000000	__scm_send	vmlinux
+0x00000000	usb_register_dev	vmlinux
 0x00000000	blk_queue_activity_fn	vmlinux
 0x00000000	try_to_free_buffers	vmlinux
 0x00000000	rpc_destroy_client	net/sunrpc/sunrpc
@@ -983,9 +1055,11 @@
 0x00000000	hci_conn_encrypt	net/bluetooth/bluetooth
 0x00000000	simple_readpage	vmlinux
 0x00000000	__lock_page	vmlinux
+0x00000000	usbc_string_alloc	vmlinux
 0x00000000	__umodsi3	vmlinux
 0x00000000	pcmcia_access_configuration_register	drivers/pcmcia/pcmcia_core
 0x00000000	sysctl_max_syn_backlog	vmlinux
+0x00000000	usb_altnum_to_altsetting	vmlinux
 0x00000000	follow_down	vmlinux
 0x00000000	rpcauth_lookupcred	net/sunrpc/sunrpc
 0x00000000	ide_error	drivers/ide/ide-core
@@ -1002,6 +1076,7 @@
 0x00000000	class_device_get	vmlinux
 0x00000000	class_device_put	vmlinux
 0x00000000	del_timer	vmlinux
+0x00000000	usb_get_current_frame_number	vmlinux
 0x00000000	map_destroy	vmlinux
 0x00000000	scsi_command_size	vmlinux
 0x00000000	hci_suspend_dev	net/bluetooth/bluetooth
@@ -1017,21 +1092,26 @@
 0x00000000	strnlen	vmlinux
 0x00000000	hermes_docmd_wait	drivers/net/wireless/hermes
 0x00000000	crypto_alg_available	vmlinux
+0x00000000	adeos_destroy_mutex	vmlinux
 0x00000000	nobh_prepare_write	vmlinux
 0x00000000	i2c_check_addr	drivers/i2c/i2c-core
 0x00000000	blk_plug_device	vmlinux
 0x00000000	blk_rq_unmap_user	vmlinux
 0x00000000	acquire_console_sem	vmlinux
+0x00000000	sa1100_usb_add_string	vmlinux
 0x00000000	__printk_ratelimit	vmlinux
 0x00000000	xdr_encode_pages	net/sunrpc/sunrpc
 0x00000000	xdr_read_pages	net/sunrpc/sunrpc
+0x00000000	usb_alloc_bus	vmlinux
 0x00000000	paste_selection	vmlinux
 0x00000000	journal_get_create_access	fs/jbd/jbd
 0x00000000	open_private_file	vmlinux
 0x00000000	__ide_set_handler	drivers/ide/ide-core
+0x00000000	usb_control_msg	vmlinux
 0x00000000	mtd_table_mutex	vmlinux
 0x00000000	fb_load_cursor_image	vmlinux
 0x00000000	vfs_llseek	vmlinux
+0x00000000	usbctl_resume	vmlinux
 0x00000000	sock_rmalloc	vmlinux
 0x00000000	bt_sock_unlink	net/bluetooth/bluetooth
 0x00000000	panic_timeout	vmlinux
@@ -1055,6 +1135,7 @@
 0x00000000	process_that_request_first	vmlinux
 0x00000000	radix_tree_delete	vmlinux
 0x00000000	zlib_deflateInit_	lib/zlib_deflate/zlib_deflate
+0x00000000	adeos_alloc_ptdkey	vmlinux
 0x00000000	open_softirq	vmlinux
 0x00000000	names_cachep	vmlinux
 0x00000000	qword_addhex	net/sunrpc/sunrpc
@@ -1076,8 +1157,10 @@
 0x00000000	generic_ide_ioctl	drivers/ide/ide-core
 0x00000000	subsystem_register	vmlinux
 0x00000000	neigh_parms_alloc	vmlinux
+0x00000000	usb_disabled	vmlinux
 0x00000000	interruptible_sleep_on	vmlinux
 0x00000000	cpu_sa1100_set_pte	vmlinux
+0x00000000	usb_buffer_map_sg	vmlinux
 0x00000000	blk_queue_invalidate_tags	vmlinux
 0x00000000	io_schedule	vmlinux
 0x00000000	cfb_fillrect	vmlinux
@@ -1128,6 +1211,7 @@
 0x00000000	__scm_destroy	vmlinux
 0x00000000	d_move	vmlinux
 0x00000000	serio_register_port_delayed	drivers/input/serio/serio
+0x00000000	__adeos_sync_stage	vmlinux
 0x00000000	devfs_mk_symlink	vmlinux
 0x00000000	get_dma_residue	vmlinux
 0x00000000	sock_wmalloc	vmlinux
@@ -1139,6 +1223,7 @@
 0x00000000	_memcpy_toio	vmlinux
 0x00000000	ide_toggle_bounce	drivers/ide/ide-core
 0x00000000	pskb_expand_head	vmlinux
+0x00000000	usbc_string_from_cstr	vmlinux
 0x00000000	dma_alloc_writecombine	vmlinux
 0x00000000	elf_hwcap	vmlinux
 0x00000000	i2c_release_client	drivers/i2c/i2c-core
@@ -1148,6 +1233,7 @@
 0x00000000	lock_may_write	vmlinux
 0x00000000	xdr_buf_read_netobj	net/sunrpc/sunrpc
 0x00000000	sock_wake_async	vmlinux
+0x00000000	adeos_hook_dswitch	vmlinux
 0x00000000	neigh_dump_info	vmlinux
 0x00000000	__set_page_dirty_buffers	vmlinux
 0x00000000	synchronize_kernel	vmlinux
@@ -1175,9 +1261,11 @@
 0x00000000	getname	vmlinux
 0x00000000	slhc_compress	drivers/net/slhc
 0x00000000	ide_end_drive_cmd	drivers/ide/ide-core
+0x00000000	usb_hc_died	vmlinux
 0x00000000	__ioremap	vmlinux
 0x00000000	free_irq	vmlinux
 0x00000000	batostr	net/bluetooth/bluetooth
+0x00000000	usb_serial_probe	drivers/usb/serial/usbserial
 0x00000000	inetdev_lock	vmlinux
 0x00000000	filemap_fdatawait	vmlinux
 0x00000000	rpcauth_register	net/sunrpc/sunrpc
@@ -1187,10 +1275,13 @@
 0x00000000	simple_pin_fs	vmlinux
 0x00000000	schedule_delayed_work	vmlinux
 0x00000000	sock_no_sendpage	vmlinux
+0x00000000	__divdi3	vmlinux
 0x00000000	__muldi3	vmlinux
+0x00000000	adeos_get_ptd	vmlinux
 0x00000000	posix_block_lock	vmlinux
 0x00000000	kernel_sendmsg	vmlinux
 0x00000000	uart_register_driver	vmlinux
+0x00000000	__adeos_unstall_nosync_root	vmlinux
 0x00000000	tasklist_lock	vmlinux
 0x00000000	ata_output_data	drivers/ide/ide-core
 0x00000000	dev_remove_pack	vmlinux
@@ -1222,7 +1313,9 @@
 0x00000000	kobject_add	vmlinux
 0x00000000	net_random	vmlinux
 0x00000000	cdev_get	vmlinux
+0x00000000	__adeos_handle_event	vmlinux
 0x00000000	iw_handler_get_thrspy	vmlinux
+0x00000000	usb_get_urb	vmlinux
 0x00000000	simple_dir_operations	vmlinux
 0x00000000	tcp_memory_pressure	vmlinux
 0x00000000	ip_statistics	vmlinux
@@ -1250,11 +1343,14 @@
 0x00000000	vfs_rename	vmlinux
 0x00000000	generic_ro_fops	vmlinux
 0x00000000	kthread_bind	vmlinux
+0x00000000	usb_serial_port_softint	drivers/usb/serial/usbserial
 0x00000000	del_mtd_blktrans_dev	vmlinux
+0x00000000	__usbb_free	vmlinux
 0x00000000	cache_register	net/sunrpc/sunrpc
 0x00000000	inetdev_by_index	vmlinux
 0x00000000	bt_sock_wait_state	net/bluetooth/bluetooth
 0x00000000	ei_tx_timeout	drivers/net/8390
+0x00000000	adeos_free_ptdkey	vmlinux
 0x00000000	filemap_fdatawrite	vmlinux
 0x00000000	dev_base_lock	vmlinux
 0x00000000	console_blank_hook	vmlinux
@@ -1302,12 +1398,14 @@
 0x00000000	vt_cons	vmlinux
 0x00000000	make_bad_inode	vmlinux
 0x00000000	bio_uncopy_user	vmlinux
+0x00000000	__mmdrop	vmlinux
 0x00000000	gss_mech_unregister	net/sunrpc/auth_gss/auth_rpcgss
 0x00000000	hermes_write_ltv	drivers/net/wireless/hermes
 0x00000000	tcp_memory_allocated	vmlinux
 0x00000000	seq_release_private	vmlinux
 0x00000000	blk_max_pfn	vmlinux
 0x00000000	add_interrupt_randomness	vmlinux
+0x00000000	usbctl_proc_info	vmlinux
 0x00000000	auth_domain_lookup	net/sunrpc/sunrpc
 0x00000000	fb_get_mode	vmlinux
 0x00000000	update_atime	vmlinux
@@ -1317,6 +1415,8 @@
 0x00000000	tcp_listen_wlock	vmlinux
 0x00000000	fb_sysmove_buf_aligned	vmlinux
 0x00000000	search_binary_handler	vmlinux
+0x00000000	usbctl_open	vmlinux
+0x00000000	usbctl_close	vmlinux
 0x00000000	__get_user_8	vmlinux
 0x00000000	__put_user_8	vmlinux
 0x00000000	tcp_disconnect	vmlinux
@@ -1336,6 +1436,8 @@
 0x00000000	lookup_mnt	vmlinux
 0x00000000	unix_domain_find	net/sunrpc/sunrpc
 0x00000000	i2c_smbus_read_i2c_block_data	drivers/i2c/i2c-core
+0x00000000	adeos_schedule_irq	vmlinux
+0x00000000	adeos_init_mutex	vmlinux
 0x00000000	dev_get_by_name	vmlinux
 0x00000000	ip_options_undo	vmlinux
 0x00000000	unregister_sound_midi	vmlinux
@@ -1344,6 +1446,7 @@
 0x00000000	mb_cache_shrink	fs/mbcache
 0x00000000	register_mtd_parser	vmlinux
 0x00000000	mark_page_accessed	vmlinux
+0x00000000	adeos_trigger_ipi	vmlinux
 0x00000000	cdev_add	vmlinux
 0x00000000	block_sync_page	vmlinux
 0x00000000	__do_div64	vmlinux
@@ -1354,6 +1457,8 @@
 0x00000000	open_exec	vmlinux
 0x00000000	mb_cache_entry_find_next	fs/mbcache
 0x00000000	journal_forget	fs/jbd/jbd
+0x00000000	usb_register_root_hub	vmlinux
+0x00000000	usb_epnum_to_ep_desc	vmlinux
 0x00000000	__set_page_dirty_nobuffers	vmlinux
 0x00000000	pcmcia_parse_tuple	drivers/pcmcia/pcmcia_core
 0x00000000	slhc_init	drivers/net/slhc
@@ -1386,6 +1491,9 @@
 0x00000000	pcmcia_release_io	drivers/pcmcia/pcmcia_core
 0x00000000	reset_airo_card	drivers/net/wireless/airo
 0x00000000	seq_path	vmlinux
+0x00000000	__adeos_unstall_root	vmlinux
+0x00000000	__adeos_restore_root	vmlinux
+0x00000000	__adeos_test_and_stall_root	vmlinux
 0x00000000	g_verify_token_header	net/sunrpc/auth_gss/auth_rpcgss
 0x00000000	rtnl_sem	vmlinux
 0x00000000	radix_tree_tag_clear	vmlinux
@@ -1404,6 +1512,7 @@
 0x00000000	tcp_transmit_skb	vmlinux
 0x00000000	fb_con	vmlinux
 0x00000000	skb_queue_tail	vmlinux
+0x00000000	do_exit	vmlinux
 0x00000000	mark_buffer_dirty_inode	vmlinux
 0x00000000	uda1341_open	vmlinux
 0x00000000	queue_work	vmlinux
@@ -1423,6 +1532,7 @@
 0x00000000	__raw_writesl	vmlinux
 0x00000000	neigh_destroy	vmlinux
 0x00000000	_test_and_change_bit_le	vmlinux
+0x00000000	adeos_set_irq_affinity	vmlinux
 0x00000000	pskb_copy	vmlinux
 0x00000000	class_unregister	vmlinux
 0x00000000	__raw_readsb	vmlinux
@@ -1438,7 +1548,9 @@
 0x00000000	v4wb_flush_user_cache_all	vmlinux
 0x00000000	__dev_get_by_name	vmlinux
 0x00000000	skb_copy_and_csum_dev	vmlinux
+0x00000000	adeos_virtualize_irq_from	vmlinux
 0x00000000	register_netdev	vmlinux
+0x00000000	adeos_unstall_pipeline_from	vmlinux
 0x00000000	i2c_transfer	drivers/i2c/i2c-core
 0x00000000	param_set_int	vmlinux
 0x00000000	xdr_inline_pages	net/sunrpc/sunrpc
@@ -1457,11 +1569,13 @@
 0x00000000	set_selection	vmlinux
 0x00000000	generic_file_sendfile	vmlinux
 0x00000000	tcp_v4_do_rcv	vmlinux
+0x00000000	usb_register	vmlinux
 0x00000000	blk_dump_rq_flags	vmlinux
 0x00000000	get_device	vmlinux
 0x00000000	sysfs_create_group	vmlinux
 0x00000000	g_make_token_header	net/sunrpc/auth_gss/auth_rpcgss
 0x00000000	kobject_register	vmlinux
+0x00000000	adeos_free_irq	vmlinux
 0x00000000	ethtool_op_get_tso	vmlinux
 0x00000000	xprt_destroy	net/sunrpc/sunrpc
 0x00000000	ide_pio_timings	drivers/ide/ide-core
@@ -1479,10 +1593,13 @@
 0x00000000	journal_stop	fs/jbd/jbd
 0x00000000	wait_for_completion	vmlinux
 0x00000000	i2c_smbus_write_byte_data	drivers/i2c/i2c-core
+0x00000000	usb_unlink_urb	vmlinux
+0x00000000	__adeos_restore_root_nosync	vmlinux
 0x00000000	sa1100_reset_dma	vmlinux
 0x00000000	put_rpccred	net/sunrpc/sunrpc
 0x00000000	sock_create_lite	vmlinux
 0x00000000	sa1100_free_dma	vmlinux
+0x00000000	adeos_lock_mutex	vmlinux
 0x00000000	ip4_datagram_connect	vmlinux
 0x00000000	tcp_timewait_state_process	vmlinux
 0x00000000	mod_firmware_load	vmlinux
@@ -1491,6 +1608,8 @@
 0x00000000	vfs_follow_link	vmlinux
 0x00000000	sysdev_class_unregister	vmlinux
 0x00000000	cache_init	net/sunrpc/sunrpc
+0x00000000	usb_bus_init	vmlinux
+0x00000000	adeos_critical_enter	vmlinux
 0x00000000	serio_register_port	drivers/input/serio/serio
 0x00000000	request_module	vmlinux
 0x00000000	hci_conn_auth	net/bluetooth/bluetooth
@@ -1505,6 +1624,7 @@
 0x00000000	xtime	vmlinux
 0x00000000	proc_dointvec_jiffies	vmlinux
 0x00000000	sk_stream_wait_memory	vmlinux
+0x00000000	usb_set_interface	vmlinux
 0x00000000	strspn	vmlinux
 0x00000000	strlen	vmlinux
 0x00000000	add_keyboard_randomness	vmlinux
@@ -1516,6 +1636,7 @@
 0x00000000	radix_tree_tag_set	vmlinux
 0x00000000	__generic_file_aio_read	vmlinux
 0x00000000	sysctl_string	vmlinux
+0x00000000	usb_hcd_operations	vmlinux
 0x00000000	proc_sys_root	vmlinux
 0x00000000	__page_cache_release	vmlinux
 0x00000000	i2c_get_adapter	drivers/i2c/i2c-core
@@ -1538,6 +1659,7 @@
 0x00000000	seq_printf	vmlinux
 0x00000000	simple_strtol	vmlinux
 0x00000000	neigh_delete	vmlinux
+0x00000000	adeos_syscall_entry	vmlinux
 0x00000000	remote_llseek	vmlinux
 0x00000000	vfs_stat	vmlinux
 0x00000000	__bio_clone	vmlinux
@@ -1549,19 +1671,23 @@
 0x00000000	f_delown	vmlinux
 0x00000000	xdr_encode_string	net/sunrpc/sunrpc
 0x00000000	__down_write_trylock	vmlinux
+0x00000000	usb_clear_halt	vmlinux
 0x00000000	submit_bh	vmlinux
 0x00000000	console_print	vmlinux
 0x00000000	rb_insert_color	vmlinux
 0x00000000	__inode_dir_notify	vmlinux
+0x00000000	cpu_sa1100_switch_mm	vmlinux
 0x00000000	xprt_udp_slot_table_entries	net/sunrpc/sunrpc
 0x00000000	tcp_protocol	vmlinux
 0x00000000	symbol_put_addr	vmlinux
 0x00000000	i2c_smbus_read_word_data	drivers/i2c/i2c-core
+0x00000000	usb_buffer_unmap	vmlinux
 0x00000000	default_mtd_readv	vmlinux
 0x00000000	d_alloc	vmlinux
 0x00000000	journal_extend	fs/jbd/jbd
 0x00000000	soc_common_drv_pcmcia_remove	drivers/pcmcia/sa11xx_core
 0x00000000	balloon_nand_ready	vmlinux
+0x00000000	usb_disconnect	vmlinux
 0x00000000	udp_proc_register	vmlinux
 0x00000000	nr_free_pages	vmlinux
 0x00000000	clear_inode	vmlinux
@@ -1572,6 +1698,7 @@
 0x00000000	update_region	vmlinux
 0x00000000	hci_get_route	net/bluetooth/bluetooth
 0x00000000	scm_fp_dup	vmlinux
+0x00000000	usb_deregister_bus	vmlinux
 0x00000000	tty_vhangup	vmlinux
 0x00000000	shrink_dcache_parent	vmlinux
 0x00000000	user_get_super	vmlinux
@@ -1602,15 +1729,18 @@
 0x00000000	sysdev_register	vmlinux
 0x00000000	simple_unlink	vmlinux
 0x00000000	net_ratelimit	vmlinux
+0x00000000	__adeos_dump_state	vmlinux
 0x00000000	inter_module_get	vmlinux
 0x00000000	inter_module_put	vmlinux
 0x00000000	journal_dirty_data	fs/jbd/jbd
 0x00000000	find_vma	vmlinux
 0x00000000	ide_do_request	drivers/ide/ide-core
+0x00000000	hcd_buffer_create	vmlinux
 0x00000000	pcmcia_get_next_client	drivers/pcmcia/pcmcia_core
 0x00000000	inet_stream_connect	vmlinux
 0x00000000	v4wb_coherent_kern_range	vmlinux
 0x00000000	journal_ack_err	fs/jbd/jbd
+0x00000000	usb_get_string	vmlinux
 0x00000000	uda1341_close	vmlinux
 0x00000000	simple_strtoul	vmlinux
 0x00000000	tcp_rcv_established	vmlinux
@@ -1630,6 +1760,7 @@
 0x00000000	console_printk	vmlinux
 0x00000000	neigh_lookup	vmlinux
 0x00000000	machine_power_off	vmlinux
+0x00000000	adeos_suspend_domain	vmlinux
 0x00000000	cache_purge	net/sunrpc/sunrpc
 0x00000000	inode_setattr	vmlinux
 0x00000000	alloc_buffer_head	vmlinux
@@ -1651,6 +1782,7 @@
 0x00000000	skb_iter_next	vmlinux
 0x00000000	add_to_page_cache	vmlinux
 0x00000000	ROOT_DEV	vmlinux
+0x00000000	usb_get_status	vmlinux
 0x00000000	svc_auth_register	net/sunrpc/sunrpc
 0x00000000	flow_cache_genid	vmlinux
 0x00000000	input_class	vmlinux
@@ -1672,6 +1804,7 @@
 0x00000000	blk_queue_end_tag	vmlinux
 0x00000000	__up_read	vmlinux
 0x00000000	flush_old_exec	vmlinux
+0x00000000	__adeos_schedule_back_root	vmlinux
 0x00000000	inet_addr_type	vmlinux
 0x00000000	sock_disable_timestamp	vmlinux
 0x00000000	__sysrq_lock_table	vmlinux
@@ -1686,6 +1819,7 @@
 0x00000000	loopback_dev	vmlinux
 0x00000000	hci_unregister_proto	net/bluetooth/bluetooth
 0x00000000	strcspn	vmlinux
+0x00000000	adeos_init_attr	vmlinux
 0x00000000	neigh_ifdown	vmlinux
 0x00000000	do_kern_mount	vmlinux
 0x00000000	svc_process	net/sunrpc/sunrpc
@@ -1742,8 +1876,10 @@
 0x00000000	i2c_smbus_read_byte	drivers/i2c/i2c-core
 0x00000000	inet_unregister_protosw	vmlinux
 0x00000000	ei_close	drivers/net/8390
+0x00000000	adeos_tune_timer	vmlinux
 0x00000000	ide_ata66_check	drivers/ide/ide-core
 0x00000000	ide_wait_not_busy	drivers/ide/ide-core
+0x00000000	__usb_get_extra_descriptor	vmlinux
 0x00000000	simple_commit_write	vmlinux
 0x00000000	profile_event_register	vmlinux
 0x00000000	ppp_unit_number	drivers/net/ppp_generic
@@ -1775,6 +1911,7 @@
 0x00000000	rpc_wake_up_task	net/sunrpc/sunrpc
 0x00000000	task_no_data_intr	drivers/ide/ide-core
 0x00000000	proc_dostring	vmlinux
+0x00000000	adeos_set_ptd	vmlinux
 0x00000000	journal_force_commit_nested	fs/jbd/jbd
 0x00000000	pre_task_out_intr	drivers/ide/ide-core
 0x00000000	cap_vm_enough_memory	vmlinux
@@ -1783,11 +1920,13 @@
 0x00000000	log_wait_commit	fs/jbd/jbd
 0x00000000	blkdev_open	vmlinux
 0x00000000	__symbol_put	vmlinux
+0x00000000	__adeos_tune_timer	vmlinux
 0x00000000	get_zeroed_page	vmlinux
 0x00000000	input_close_device	vmlinux
 0x00000000	prepare_to_wait_exclusive	vmlinux
 0x00000000	current_capacity	drivers/ide/ide-core
 0x00000000	remove_proc_entry	vmlinux
+0x00000000	__adeos_init_stage	vmlinux
 0x00000000	filemap_nopage	vmlinux
 0x00000000	uart_resume_port	vmlinux
 0x00000000	sysctl_rmem_max	vmlinux
@@ -1797,6 +1936,7 @@
 0x00000000	xprt_tcp_slot_table_entries	net/sunrpc/sunrpc
 0x00000000	move_addr_to_user	vmlinux
 0x00000000	fb_unregister_client	vmlinux
+0x00000000	usbctl_start	vmlinux
 0x00000000	do_rw_taskfile	drivers/ide/ide-core
 0x00000000	ide_set_handler	drivers/ide/ide-core
 0x00000000	vfs_readlink	vmlinux
@@ -1805,6 +1945,7 @@
 0x00000000	udp_hash	vmlinux
 0x00000000	fb_default_cmap	vmlinux
 0x00000000	sysfs_remove_group	vmlinux
+0x00000000	usbc_string_free	vmlinux
 0x00000000	ide_cmd_ioctl	drivers/ide/ide-core
 0x00000000	rpc_init_task	net/sunrpc/sunrpc
 0x00000000	i2c_smbus_xfer	drivers/i2c/i2c-core
@@ -1859,6 +2000,7 @@
 0x00000000	sock_no_connect	vmlinux
 0x00000000	bh_waitq_head	vmlinux
 0x00000000	set_shrinker	vmlinux
+0x00000000	__adeos_handle_irq	vmlinux
 0x00000000	mb_cache_entry_get	fs/mbcache
 0x00000000	eth_type_trans	vmlinux
 0x00000000	send_sig	vmlinux
@@ -1866,6 +2008,7 @@
 0x00000000	param_set_uint	vmlinux
 0x00000000	rpc_init_wait_queue	net/sunrpc/sunrpc
 0x00000000	get_bus	vmlinux
+0x00000000	mio_irq	vmlinux
 0x00000000	groups_alloc	vmlinux
 0x00000000	kill_sl_info	vmlinux
 0x00000000	netlink_unregister_notifier	vmlinux
@@ -1881,6 +2024,7 @@
 0x00000000	rb_replace_node	vmlinux
 0x00000000	ide_execute_command	drivers/ide/ide-core
 0x00000000	sysctl_tcp_reordering	vmlinux
+0x00000000	usb_resume_device	vmlinux
 0x00000000	class_simple_destroy	vmlinux
 0x00000000	crypto_alloc_tfm	vmlinux
 0x00000000	tty_set_operations	vmlinux
@@ -1910,6 +2054,7 @@
 0x00000000	zlib_inflate_workspacesize	lib/zlib_inflate/zlib_inflate
 0x00000000	match_strcpy	vmlinux
 0x00000000	tcp_recvmsg	vmlinux
+0x00000000	usb_bus_list	vmlinux
 0x00000000	proc_dointvec_userhz_jiffies	vmlinux
 0x00000000	console_start	vmlinux
 0x00000000	tcp_simple_retransmit	vmlinux
@@ -1924,6 +2069,7 @@
 0x00000000	rb_first	vmlinux
 0x00000000	unregister_module_notifier	vmlinux
 0x00000000	xprt_create_proto	net/sunrpc/sunrpc
+0x00000000	adeos_unregister_domain	vmlinux
 0x00000000	bus_register	vmlinux
 0x00000000	input_open_device	vmlinux
 0x00000000	fsync_bdev	vmlinux
@@ -1970,6 +2116,7 @@
 0x00000000	cap_inode_removexattr	vmlinux
 0x00000000	dnotify_parent	vmlinux
 0x00000000	get_sb_single	vmlinux
+0x00000000	adp_cpu_current	vmlinux
 0x00000000	pm_power_off	vmlinux
 0x00000000	blk_queue_init_tags	vmlinux
 0x00000000	device_initialize	vmlinux
@@ -1998,13 +2145,16 @@
 0x00000000	xdr_encode_opaque_fixed	net/sunrpc/sunrpc
 0x00000000	set_dma_mode	vmlinux
 0x00000000	sysctl_overcommit_ratio	vmlinux
+0x00000000	adp_root	vmlinux
 0x00000000	hermes_bap_pread	drivers/net/wireless/hermes
+0x00000000	usb_deregister	vmlinux
 0x00000000	journal_callback_set	fs/jbd/jbd
 0x00000000	pcmcia_get_next_window	drivers/pcmcia/pcmcia_core
 0x00000000	vmalloc_earlyreserve	vmlinux
 0x00000000	dump_stack	vmlinux
 0x00000000	hermes_init	drivers/net/wireless/hermes
 0x00000000	net_sysctl_strdup	vmlinux
+0x00000000	usbctl_ep_queue_buffer	vmlinux
 0x00000000	kobject_del	vmlinux
 0x00000000	get_EDID_from_firmware	vmlinux
 0x00000000	poll_initwait	vmlinux
@@ -2014,6 +2164,7 @@
 0x00000000	netdev_state_change	vmlinux
 0x00000000	xprt_set_timeout	net/sunrpc/sunrpc
 0x00000000	ext2_xattr_list	fs/ext2/ext2
+0x00000000	usb_sg_cancel	vmlinux
 0x00000000	__udivdi3	vmlinux
 0x00000000	struct_module	vmlinux
 0x00000000	pcmcia_get_status	drivers/pcmcia/pcmcia_core
@@ -2037,9 +2188,12 @@
 0x00000000	inode_get_bytes	vmlinux
 0x00000000	__wake_up	vmlinux
 0x00000000	vfs_mkdir	vmlinux
+0x00000000	usb_driver_claim_interface	vmlinux
 0x00000000	tcp_bucket_create	vmlinux
 0x00000000	mb_cache_create	fs/mbcache
 0x00000000	pcmcia_release_irq	drivers/pcmcia/pcmcia_core
+0x00000000	usb_get_dev	vmlinux
+0x00000000	usb_find_device	vmlinux
 0x00000000	iunique	vmlinux
 0x00000000	mb_cache_destroy	fs/mbcache
 0x00000000	inet_dgram_ops	vmlinux
@@ -2069,6 +2223,7 @@
 0x00000000	__tasklet_hi_schedule	vmlinux
 0x00000000	read_bytes_from_xdr_buf	net/sunrpc/sunrpc
 0x00000000	zlib_inflateReset	lib/zlib_inflate/zlib_inflate
+0x00000000	adeos_stall_pipeline	vmlinux
 0x00000000	arp_send	vmlinux
 0x00000000	cdev_del	vmlinux
 0x00000000	pcmcia_release_configuration	drivers/pcmcia/pcmcia_core
@@ -2077,23 +2232,27 @@
 0x00000000	l3_add_adapter	vmlinux
 0x00000000	soft_cursor	vmlinux
 0x00000000	pcmcia_release_window	drivers/pcmcia/pcmcia_core
+0x00000000	adeos_catch_event_from	vmlinux
 0x00000000	iosched_as	vmlinux
 0x00000000	blk_queue_bounce	vmlinux
 0x00000000	fat_get_block	fs/fat/fat
 0x00000000	ip_rcv	vmlinux
 0x00000000	read_dev_sector	vmlinux
 0x00000000	journal_create	fs/jbd/jbd
+0x00000000	usb_ifnum_to_if	vmlinux
 0x00000000	__up_wakeup	vmlinux
 0x00000000	svc_makesock	net/sunrpc/sunrpc
 0x00000000	mb_cache_entry_release	fs/mbcache
 0x00000000	strcat	vmlinux
 0x00000000	execute_drive_cmd	drivers/ide/ide-core
+0x00000000	usb_register_bus	vmlinux
 0x00000000	radix_tree_insert	vmlinux
 0x00000000	kern_mount	vmlinux
 0x00000000	noop_qdisc_ops	vmlinux
 0x00000000	qdisc_create_dflt	vmlinux
 0x00000000	uart_add_one_port	vmlinux
 0x00000000	bmap	vmlinux
+0x00000000	show_regs	vmlinux
 0x00000000	ext2_xattr_unregister	fs/ext2/ext2
 0x00000000	tcp_connect	vmlinux
 0x00000000	neigh_table_clear	vmlinux
@@ -2104,6 +2263,7 @@
 0x00000000	hci_alloc_dev	net/bluetooth/bluetooth
 0x00000000	lock_page	vmlinux
 0x00000000	svc_reserve	net/sunrpc/sunrpc
+0x00000000	adeos_control_irq	vmlinux
 0x00000000	blk_queue_bounce_limit	vmlinux
 0x00000000	platform_bus	vmlinux
 0x00000000	journal_restart	fs/jbd/jbd
@@ -2116,6 +2276,7 @@
 0x00000000	tcp_timewait_cachep	vmlinux
 0x00000000	sysdev_driver_unregister	vmlinux
 0x00000000	compute_creds	vmlinux
+0x00000000	usb_suspend_device	vmlinux
 0x00000000	sysctl_tcp_wmem	vmlinux
 0x00000000	unregister_mtd_user	vmlinux
 0x00000000	probe_hwif_init	drivers/ide/ide-core
@@ -2141,6 +2302,7 @@
 0x00000000	__lock_sock	vmlinux
 0x00000000	i2c_detect	drivers/i2c/i2c-sensor
 0x00000000	irq_stat	vmlinux
+0x00000000	hcd_buffer_destroy	vmlinux
 0x00000000	permission	vmlinux
 0x00000000	xtime_lock	vmlinux
 0x00000000	inet_sendmsg	vmlinux
@@ -2150,6 +2312,7 @@
 0x00000000	all_channels	drivers/net/ppp_generic
 0x00000000	unregister_inetaddr_notifier	vmlinux
 0x00000000	unregister_exec_domain	vmlinux
+0x00000000	adeos_propagate_irq	vmlinux
 0x00000000	interruptible_sleep_on_timeout	vmlinux
 0x00000000	netlink_ack	vmlinux
 0x00000000	sock_get_timestamp	vmlinux
@@ -2157,6 +2320,7 @@
 0x00000000	param_set_charp	vmlinux
 0x00000000	orinoco_interrupt	drivers/net/wireless/orinoco
 0x00000000	tty_unregister_device	vmlinux
+0x00000000	usbc_string_find	vmlinux
 0x00000000	vsprintf	vmlinux
 0x00000000	tcp_poll	vmlinux
 0x00000000	__get_user_1	vmlinux
@@ -2199,6 +2363,7 @@
 0x00000000	sock_no_shutdown	vmlinux
 0x00000000	vc_resize	vmlinux
 0x00000000	param_set_ulong	vmlinux
+0x00000000	__adeos_irq_regs	vmlinux
 0x00000000	match_hex	vmlinux
 0x00000000	fb_register_client	vmlinux
 0x00000000	platform_device_register	vmlinux
@@ -2218,6 +2383,7 @@
 0x00000000	ip_queue_xmit	vmlinux
 0x00000000	unregister_chrdev	vmlinux
 0x00000000	inet_release	vmlinux
+0x00000000	usb_buffer_map	vmlinux
 0x00000000	blk_queue_start_tag	vmlinux
 0x00000000	neigh_create	vmlinux
 0x00000000	noautodma	drivers/ide/ide-core
@@ -2236,7 +2402,9 @@
 0x00000000	invalidate_inode_pages2	vmlinux
 0x00000000	kmem_cache_destroy	vmlinux
 0x00000000	pm_register	vmlinux
+0x00000000	usb_serial_disconnect	drivers/usb/serial/usbserial
 0x00000000	rtnl	vmlinux
+0x00000000	usb_release_bandwidth	vmlinux
 0x00000000	rpc_proc_register	net/sunrpc/sunrpc
 0x00000000	dget_locked	vmlinux
 0x00000000	__release_region	vmlinux
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/net/list linux-2.6.8.1-tcl1-adeos/net/list
--- linux-2.6.8.1-tcl1/net/list	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.8.1-tcl1-adeos/net/list	2005-11-18 14:08:36.000000000 +0000
@@ -0,0 +1,3 @@
+
+socket.o:     file format elf32-little
+
diff -uprN --exclude-from=dontdiff linux-2.6.8.1-tcl1/net/socket.c linux-2.6.8.1-tcl1-adeos/net/socket.c
--- linux-2.6.8.1-tcl1/net/socket.c	2005-11-18 10:47:18.000000000 +0000
+++ linux-2.6.8.1-tcl1-adeos/net/socket.c	2005-11-18 14:08:25.000000000 +0000
@@ -951,10 +951,9 @@ static int sock_mmap(struct file * file,
 int sock_close(struct inode *inode, struct file *filp)
 {
 	/*
-	 *	It was possible the inode is NULL we were 
-	 *	closing an unfinished socket. 
+	 *	It was possible the inode is NULL we were
+	 *	closing an unfinished socket.
 	 */
-
 	if (!inode)
 	{
 		printk(KERN_DEBUG "sock_close: NULL inode\n");
@@ -985,7 +984,6 @@ static int sock_fasync(int fd, struct fi
 	struct fasync_struct *fa, *fna=NULL, **prev;
 	struct socket *sock;
 	struct sock *sk;
-
 	if (on)
 	{
 		fna=(struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL);
@@ -1016,7 +1014,6 @@ static int sock_fasync(int fd, struct fi
 			write_lock_bh(&sk->sk_callback_lock);
 			fa->fa_fd=fd;
 			write_unlock_bh(&sk->sk_callback_lock);
-
 			kfree(fna);
 			goto out;
 		}
