Gabe Black wrote:
> nathan binkert wrote:
>   
>>> Hi Joel. I'm happy to hear it's booting for you! I've already translated
>>> the patches over to x86 and they do help boot time, but I couldn't tell
>>> you off hand where they went. I think we have a mercurial repository
>>> with those in it someplace.
>>>     
>>>       
>> I just wanted to say that I looked for these yesterday and couldn't
>> find them on daystrom.  Gabe, can you please look for them?
>>
>> Thanks,
>>
>>   Nate
>> _______________________________________________
>> m5-dev mailing list
>> [email protected]
>> http://m5sim.org/mailman/listinfo/m5-dev
>>   
>>     
>
> Yes. I think I might not have uploaded them since I wasn't sure they
> were correct. I have an idea of where to look.
>
> Gabe
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev
>   

Yep, right where I thought it'd be. Here's a diff that applies to the
tip of the kernel patch queue repository. These might not be quite ready
for prime time yet, but if I remember correctly they seemed to work.

Gabe
diff -r 0ab58d9bd9a5 m5/m5op.diff
--- a/m5/m5op.diff      Fri Dec 05 14:27:00 2008 -0500
+++ b/m5/m5op.diff      Thu Jun 10 16:34:12 2010 -0700
@@ -179,53 +179,122 @@
 +END(m5_panic)
 +
 +
+diff --git a/arch/x86_64/kernel/m5op.S b/arch/x86_64/kernel/m5op.S
+new file mode 100644
+--- /dev/null
++++ b/arch/x86_64/kernel/m5op.S
+@@ -0,0 +1,66 @@
++/*
++ * Copyright (c) 2003-2006 The Regents of The University of Michigan
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are
++ * met: redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ * redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution;
++ * neither the name of the copyright holders nor the names of its
++ * contributors may be used to endorse or promote products derived from
++ * this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ *
++ * Authors: Gabe Black
++ *          Nathan Binkert
++ *          Ali Saidi
++ */
++
++#include <linux/m5ops.h>
++
++#define TWO_BYTE_OP(name, number)         \
++        .globl name;                      \
++        .func name;                       \
++name:                                     \
++        .byte 0x0F, 0x04;                 \
++        .word number;                     \
++        ret;                              \
++        .endfunc;
++
++TWO_BYTE_OP(arm, arm_func)
++TWO_BYTE_OP(quiesce, quiesce_func)
++TWO_BYTE_OP(quiesceNs, quiescens_func)
++TWO_BYTE_OP(quiesceCycle, quiescecycle_func)
++TWO_BYTE_OP(quiesceTime, quiescetime_func)
++TWO_BYTE_OP(rpns, rpns_func)
++TWO_BYTE_OP(m5_exit, exit_func)
++TWO_BYTE_OP(m5_initparam, initparam_func)
++TWO_BYTE_OP(m5_loadsymbol, loadsymbol_func)
++TWO_BYTE_OP(m5_reset_stats, resetstats_func)
++TWO_BYTE_OP(m5_dump_stats, dumpstats_func)
++TWO_BYTE_OP(m5_dumpreset_stats, dumprststats_func)
++TWO_BYTE_OP(m5_checkpoint, ckpt_func)
++TWO_BYTE_OP(m5_readfile, readfile_func)
++TWO_BYTE_OP(m5_debugbreak, debugbreak_func)
++TWO_BYTE_OP(m5_switchcpu, switchcpu_func)
++TWO_BYTE_OP(m5_addsymbol, addsymbol_func)
++TWO_BYTE_OP(m5_panic, panic_func)
++TWO_BYTE_OP(m5_reserved1_func, reserved1_func)
++TWO_BYTE_OP(m5_reserved2_func, reserved2_func)
++TWO_BYTE_OP(m5_reserved3_func, reserved3_func)
++TWO_BYTE_OP(m5_reserved4_func, reserved4_func)
++TWO_BYTE_OP(m5_reserved5_func, reserved5_func)
 diff --git a/include/linux/m5op.h b/include/linux/m5op.h
 new file mode 100644
 --- /dev/null
 +++ b/include/linux/m5op.h
-@@ -0,0 +1,57 @@
-+/* $Id$ */
-+
+@@ -0,0 +1,56 @@
 +/*
-+ * Copyright (c) 2003 - 2006
-+ * The Regents of The University of Michigan
-+ * All Rights Reserved
++ * Copyright (c) 2003-2006 The Regents of The University of Michigan
++ * All rights reserved.
 + *
-+ * This code is part of the M5 simulator.
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are
++ * met: redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ * redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution;
++ * neither the name of the copyright holders nor the names of its
++ * contributors may be used to endorse or promote products derived from
++ * this software without specific prior written permission.
 + *
-+ * Permission is granted to use, copy, create derivative works and
-+ * redistribute this software and such derivative works for any
-+ * purpose, so long as the copyright notice above, this grant of
-+ * permission, and the disclaimer below appear in all copies made; and
-+ * so long as the name of The University of Michigan is not used in
-+ * any advertising or publicity pertaining to the use or distribution
-+ * of this software without specific, written prior authorization.
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 + *
-+ * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
-+ * UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND
-+ * WITHOUT WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER
-+ * EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
-+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE. THE REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE
-+ * LIABLE FOR ANY DAMAGES, INCLUDING DIRECT, SPECIAL, INDIRECT,
-+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM
-+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
-+ * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH
-+ * DAMAGES.
-+ *
-+ * Authors: Nathan L. Binkert
-+ *          Ali G. Saidi
++ * Authors: Nathan Binkert
++ *          Ali Saidi
 + */
 +
 +#ifndef __M5OP_H__
 +#define __M5OP_H__
 +
-+
 +void arm(uint64_t address);
 +void quiesce(void);
 +void quiesceNs(uint64_t ns);
 +void quiesceCycle(uint64_t cycles);
 +uint64_t quiesceTime(void);
++uint64_t rpns(void);
 +
 +void m5_exit(uint64_t ns_delay);
 +uint64_t m5_initparam(void);
@@ -238,64 +307,70 @@
 +void m5_switchcpu(void);
 +void m5_addsymbol(uint64_t addr, char *symbol);
 +void m5_panic(void);
-+
++void m5_anbegin(uint64_t s);
++void m5_anwait(uint64_t s, uint64_t w);
 +
 +#endif // __M5OP_H__
 diff --git a/include/linux/m5ops.h b/include/linux/m5ops.h
 new file mode 100644
 --- /dev/null
 +++ b/include/linux/m5ops.h
-@@ -0,0 +1,53 @@
+@@ -0,0 +1,58 @@
 +/*
-+ * Copyright (c) 2003 - 2006
-+ * The Regents of The University of Michigan
-+ * All Rights Reserved
++ * Copyright (c) 2003-2006 The Regents of The University of Michigan
++ * All rights reserved.
 + *
-+ * This code is part of the M5 simulator.
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are
++ * met: redistributions of source code must retain the above copyright
++ * notice, this list of conditions and the following disclaimer;
++ * redistributions in binary form must reproduce the above copyright
++ * notice, this list of conditions and the following disclaimer in the
++ * documentation and/or other materials provided with the distribution;
++ * neither the name of the copyright holders nor the names of its
++ * contributors may be used to endorse or promote products derived from
++ * this software without specific prior written permission.
 + *
-+ * Permission is granted to use, copy, create derivative works and
-+ * redistribute this software and such derivative works for any
-+ * purpose, so long as the copyright notice above, this grant of
-+ * permission, and the disclaimer below appear in all copies made; and
-+ * so long as the name of The University of Michigan is not used in
-+ * any advertising or publicity pertaining to the use or distribution
-+ * of this software without specific, written prior authorization.
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 + *
-+ * THIS SOFTWARE IS PROVIDED AS IS, WITHOUT REPRESENTATION FROM THE
-+ * UNIVERSITY OF MICHIGAN AS TO ITS FITNESS FOR ANY PURPOSE, AND
-+ * WITHOUT WARRANTY BY THE UNIVERSITY OF MICHIGAN OF ANY KIND, EITHER
-+ * EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
-+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-+ * PURPOSE. THE REGENTS OF THE UNIVERSITY OF MICHIGAN SHALL NOT BE
-+ * LIABLE FOR ANY DAMAGES, INCLUDING DIRECT, SPECIAL, INDIRECT,
-+ * INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WITH RESPECT TO ANY CLAIM
-+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OF THE SOFTWARE, EVEN
-+ * IF IT HAS BEEN OR IS HEREAFTER ADVISED OF THE POSSIBILITY OF SUCH
-+ * DAMAGES.
-+ *
-+ * Authors: Nathan L. Binkert
-+ *          Ali G. Saidi
++ * Authors: Nathan Binkert
++ *          Ali Saidi
 + */
 +
++#define arm_func                0x00
++#define quiesce_func            0x01
++#define quiescens_func          0x02
++#define quiescecycle_func       0x03
++#define quiescetime_func        0x04
++#define rpns_func               0x07
++#define deprecated1_func        0x10 // obsolete ivlb
++#define deprecated2_func        0x11 // obsolete ivle
++#define deprecated3_func        0x20 // deprecated exit function
++#define exit_func               0x21
++#define initparam_func          0x30
++#define loadsymbol_func         0x31
++#define resetstats_func         0x40
++#define dumpstats_func          0x41
++#define dumprststats_func       0x42
++#define ckpt_func               0x43
++#define readfile_func           0x50
++#define debugbreak_func         0x51
++#define switchcpu_func          0x52
++#define addsymbol_func          0x53
++#define panic_func              0x54
 +
-+#define arm_func 0x00
-+#define quiesce_func 0x01
-+#define quiescens_func 0x02
-+#define quiescecycle_func 0x03
-+#define quiescetime_func 0x04
-+#define ivlb 0x10 // obsolete
-+#define ivle 0x11 // obsolete
-+#define exit_old_func 0x20 // deprecated!
-+#define exit_func 0x21
-+#define initparam_func 0x30
-+#define loadsymbol_func 0x31
-+#define resetstats_func 0x40
-+#define dumpstats_func 0x41
-+#define dumprststats_func 0x42
-+#define ckpt_func 0x43
-+#define readfile_func 0x50
-+#define debugbreak_func 0x51
-+#define switchcpu_func 0x52
-+#define addsymbol_func 0x53
-+#define panic_func     0x54
-+
++#define reserved1_func          0x55
++#define reserved2_func          0x56
++#define reserved3_func          0x57
++#define reserved4_func          0x58
++#define reserved5_func          0x59
diff -r 0ab58d9bd9a5 m5/m5op_makefile_2.6.13.diff
--- a/m5/m5op_makefile_2.6.13.diff      Fri Dec 05 14:27:00 2008 -0500
+++ b/m5/m5op_makefile_2.6.13.diff      Thu Jun 10 16:34:12 2010 -0700
@@ -1,7 +1,7 @@
 diff --git a/arch/alpha/kernel/Makefile b/arch/alpha/kernel/Makefile
 --- a/arch/alpha/kernel/Makefile
 +++ b/arch/alpha/kernel/Makefile
-@@ -8,7 +8,7 @@ EXTRA_CFLAGS   := -Werror -Wno-sign-compar
+@@ -8,7 +8,7 @@
  
  obj-y    := entry.o traps.o process.o init_task.o osf_sys.o irq.o \
            irq_alpha.o signal.o setup.o ptrace.o time.o semaphore.o \
@@ -10,4 +10,15 @@
  
  obj-$(CONFIG_VGA_HOSE)        += console.o
  obj-$(CONFIG_SMP)     += smp.o
-
+diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile
+--- a/arch/x86_64/kernel/Makefile
++++ b/arch/x86_64/kernel/Makefile
+@@ -9,7 +9,7 @@
+               x8664_ksyms.o i387.o syscall.o vsyscall.o \
+               setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
+               pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o bugs.o \
+-              perfctr-watchdog.o
++              perfctr-watchdog.o m5op.o
+ 
+ obj-$(CONFIG_STACKTRACE)      += stacktrace.o
+ obj-$(CONFIG_X86_MCE)         += mce.o therm_throt.o
diff -r 0ab58d9bd9a5 m5/quiesce.diff
--- a/m5/quiesce.diff   Fri Dec 05 14:27:00 2008 -0500
+++ b/m5/quiesce.diff   Thu Jun 10 16:34:12 2010 -0700
@@ -1,9 +1,9 @@
 Add support for quiescing when __delay() is called
 
-diff -r bba7b4beba54 arch/alpha/kernel/time.c
---- a/arch/alpha/kernel/time.c Fri Aug 03 14:25:12 2007 -0400
-+++ b/arch/alpha/kernel/time.c Fri Aug 03 14:34:06 2007 -0400
-@@ -351,7 +351,7 @@ time_init(void)
+diff --git a/arch/alpha/kernel/time.c b/arch/alpha/kernel/time.c
+--- a/arch/alpha/kernel/time.c
++++ b/arch/alpha/kernel/time.c
+@@ -335,7 +335,7 @@
           to settle, as the Update-In-Progress bit going low isn't good
           enough on some hardware.  2ms is our guess; we haven't found 
           bogomips yet, but this is close on a 500Mhz box.  */
@@ -12,10 +12,10 @@
  
        sec = CMOS_READ(RTC_SECONDS);
        min = CMOS_READ(RTC_MINUTES);
-diff -r bba7b4beba54 arch/alpha/lib/udelay.c
---- a/arch/alpha/lib/udelay.c  Fri Aug 03 14:25:12 2007 -0400
-+++ b/arch/alpha/lib/udelay.c  Fri Aug 03 14:34:06 2007 -0400
-@@ -20,16 +20,23 @@
+diff --git a/arch/alpha/lib/udelay.c b/arch/alpha/lib/udelay.c
+--- a/arch/alpha/lib/udelay.c
++++ b/arch/alpha/lib/udelay.c
+@@ -19,16 +19,23 @@
   */
  
  void
@@ -43,7 +43,7 @@
  }
  
  #ifdef CONFIG_SMP
-@@ -41,15 +48,17 @@ void
+@@ -40,15 +47,17 @@
  void
  udelay(unsigned long usecs)
  {
@@ -63,10 +63,66 @@
 +      __delay((long)nsecs >> 32, ns);
  }
  EXPORT_SYMBOL(ndelay);
-diff -r bba7b4beba54 init/calibrate.c
---- a/init/calibrate.c Fri Aug 03 14:25:12 2007 -0400
-+++ b/init/calibrate.c Fri Aug 03 14:34:06 2007 -0400
-@@ -140,7 +140,7 @@ void __devinit calibrate_delay(void)
+diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c
+--- a/arch/x86_64/lib/delay.c
++++ b/arch/x86_64/lib/delay.c
+@@ -11,6 +11,7 @@
+ #include <linux/module.h>
+ #include <linux/sched.h>
+ #include <linux/delay.h>
++#include <linux/m5op.h>
+ #include <asm/delay.h>
+ #include <asm/msr.h>
+ 
+@@ -24,23 +25,25 @@
+       return 0;
+ }
+ 
+-void __delay(unsigned long loops)
++void __delay(unsigned long loops, unsigned long nsecs)
+ {
+-      unsigned bclock, now;
++      unsigned long long bclock, remaining;
++
+       
+-      rdtscl(bclock);
++      bclock = rpns();
++        remaining = nsecs;
+       do
+       {
+-              rep_nop(); 
+-              rdtscl(now);
++                quiesceNs(remaining);
++                remaining = nsecs - (rpns() - bclock);
+       }
+-      while((now-bclock) < loops);
++      while(remaining);
+ }
+ EXPORT_SYMBOL(__delay);
+ 
+ inline void __const_udelay(unsigned long xloops)
+ {
+-      __delay(((xloops * HZ * 
cpu_data[raw_smp_processor_id()].loops_per_jiffy) >> 32) + 1);
++      __delay(((xloops * HZ * 
cpu_data[raw_smp_processor_id()].loops_per_jiffy) >> 32) + 1, xloops / 0x10c7ul 
* 1000);
+ }
+ EXPORT_SYMBOL(__const_udelay);
+ 
+diff --git a/include/asm-x86_64/delay.h b/include/asm-x86_64/delay.h
+--- a/include/asm-x86_64/delay.h
++++ b/include/asm-x86_64/delay.h
+@@ -14,7 +14,7 @@
+ extern void __udelay(unsigned long usecs);
+ extern void __ndelay(unsigned long nsecs);
+ extern void __const_udelay(unsigned long usecs);
+-extern void __delay(unsigned long loops);
++extern void __delay(unsigned long loops, unsigned long nsecs);
+ 
+ /* 0x10c7 is 2**32 / 1000000 (rounded up) */
+ #define udelay(n) (__builtin_constant_p(n) ? \
+diff --git a/init/calibrate.c b/init/calibrate.c
+--- a/init/calibrate.c
++++ b/init/calibrate.c
+@@ -140,7 +140,7 @@
                                /* nothing */;
                        /* Go .. */
                        ticks = jiffies;
@@ -75,7 +131,7 @@
                        ticks = jiffies - ticks;
                        if (ticks)
                                break;
-@@ -158,7 +158,7 @@ void __devinit calibrate_delay(void)
+@@ -158,7 +158,7 @@
                        while (ticks == jiffies)
                                /* nothing */;
                        ticks = jiffies;
diff -r 0ab58d9bd9a5 m5/quiesce_2.6.16.diff
--- a/m5/quiesce_2.6.16.diff    Fri Dec 05 14:27:00 2008 -0500
+++ b/m5/quiesce_2.6.16.diff    Thu Jun 10 16:34:12 2010 -0700
@@ -1,19 +1,7 @@
-diff -r bba7b4beba54 include/asm-alpha/delay.h
---- a/include/asm-alpha/delay.h        Fri Aug 03 14:25:12 2007 -0400
-+++ b/include/asm-alpha/delay.h        Fri Aug 03 14:34:06 2007 -0400
-@@ -1,7 +1,7 @@
- #ifndef __ALPHA_DELAY_H
- #define __ALPHA_DELAY_H
- 
--extern void __delay(int loops);
-+extern void __delay(int loops, unsigned long ns);
- extern void udelay(unsigned long usecs);
- 
- extern void ndelay(unsigned long nsecs);
 diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
 --- a/arch/alpha/kernel/process.c
 +++ b/arch/alpha/kernel/process.c
-@@ -31,6 +31,7 @@
+@@ -30,6 +30,7 @@
  #include <linux/reboot.h>
  #include <linux/tty.h>
  #include <linux/console.h>
@@ -21,7 +9,7 @@
  
  #include <asm/reg.h>
  #include <asm/uaccess.h>
-@@ -51,14 +52,18 @@ void
+@@ -51,14 +52,18 @@
  void
  cpu_idle(void)
  {
@@ -42,3 +30,37 @@
                schedule();
        }
  }
+diff --git a/arch/x86_64/lib/delay.c b/arch/x86_64/lib/delay.c
+--- a/arch/x86_64/lib/delay.c
++++ b/arch/x86_64/lib/delay.c
+@@ -27,7 +27,8 @@
+ 
+ void __delay(unsigned long loops, unsigned long nsecs)
+ {
+-      unsigned long long bclock, remaining;
++      unsigned long long bclock;
++      long long remaining;
+ 
+       
+       bclock = rpns();
+@@ -37,7 +38,7 @@
+                 quiesceNs(remaining);
+                 remaining = nsecs - (rpns() - bclock);
+       }
+-      while(remaining);
++      while(remaining > 0);
+ }
+ EXPORT_SYMBOL(__delay);
+ 
+diff --git a/include/asm-alpha/delay.h b/include/asm-alpha/delay.h
+--- a/include/asm-alpha/delay.h
++++ b/include/asm-alpha/delay.h
+@@ -1,7 +1,7 @@
+ #ifndef __ALPHA_DELAY_H
+ #define __ALPHA_DELAY_H
+ 
+-extern void __delay(int loops);
++extern void __delay(int loops, unsigned long ns);
+ extern void udelay(unsigned long usecs);
+ 
+ extern void ndelay(unsigned long nsecs);
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to