ia64/xen-unstable

changeset 12912:e108c5ac16ac

[XEN][POWERPC] Fully inline udelay()

Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Thu Sep 21 07:37:00 2006 -0400 (2006-09-21)
parents 8cb0d0eea355
children 95cead06e4ab
files xen/arch/powerpc/Makefile xen/arch/powerpc/delay.c xen/include/asm-powerpc/delay.h
line diff
     1.1 --- a/xen/arch/powerpc/Makefile	Thu Sep 21 07:36:17 2006 -0400
     1.2 +++ b/xen/arch/powerpc/Makefile	Thu Sep 21 07:37:00 2006 -0400
     1.3 @@ -12,7 +12,6 @@ obj-y += boot_of.o
     1.4  obj-y += dart.o
     1.5  obj-y += dart_u3.o
     1.6  obj-y += dart_u4.o
     1.7 -obj-y += delay.o
     1.8  obj-y += domctl.o
     1.9  obj-y += domain_build.o
    1.10  obj-y += domain.o
     2.1 --- a/xen/arch/powerpc/delay.c	Thu Sep 21 07:36:17 2006 -0400
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,37 +0,0 @@
     2.4 -/*
     2.5 - * This program is free software; you can redistribute it and/or modify
     2.6 - * it under the terms of the GNU General Public License as published by
     2.7 - * the Free Software Foundation; either version 2 of the License, or
     2.8 - * (at your option) any later version.
     2.9 - *
    2.10 - * This program is distributed in the hope that it will be useful,
    2.11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.13 - * GNU General Public License for more details.
    2.14 - *
    2.15 - * You should have received a copy of the GNU General Public License
    2.16 - * along with this program; if not, write to the Free Software
    2.17 - * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
    2.18 - *
    2.19 - * Copyright (C) IBM Corp. 2005
    2.20 - *
    2.21 - * Authors: Jimi Xenidis <jimix@watson.ibm.com>
    2.22 - */
    2.23 -
    2.24 -#include <xen/config.h>
    2.25 -#include <xen/delay.h>
    2.26 -#include <xen/time.h>
    2.27 -#include <asm/processor.h>
    2.28 -
    2.29 -void udelay(unsigned long usecs)
    2.30 -{
    2.31 -    ulong ticks = usecs * ticks_per_usec;
    2.32 -    ulong s;
    2.33 -    ulong e;
    2.34 -
    2.35 -    s = get_timebase();
    2.36 -    do {
    2.37 -        asm volatile("or 1,1,1"); /* also puts the thread to low priority */
    2.38 -        e = get_timebase();
    2.39 -    } while ((e-s) < ticks);
    2.40 -}
     3.1 --- a/xen/include/asm-powerpc/delay.h	Thu Sep 21 07:36:17 2006 -0400
     3.2 +++ b/xen/include/asm-powerpc/delay.h	Thu Sep 21 07:37:00 2006 -0400
     3.3 @@ -13,16 +13,29 @@
     3.4   * along with this program; if not, write to the Free Software
     3.5   * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     3.6   *
     3.7 - * Copyright (C) IBM Corp. 2005
     3.8 + * Copyright (C) IBM Corp. 2005, 2006
     3.9   *
    3.10   * Authors: Hollis Blanchard <hollisb@us.ibm.com>
    3.11 + *          Jimi Xenidis <jimix@watson.ibm.com>
    3.12   */
    3.13  
    3.14  #ifndef _ASM_DELAY_H_
    3.15  #define _ASM_DELAY_H_
    3.16  
    3.17 +#include <asm/time.h>
    3.18 +
    3.19  extern unsigned long ticks_per_usec; 
    3.20  #define __udelay udelay
    3.21 -extern void udelay(unsigned long usecs);
    3.22 +static inline void udelay(unsigned long usecs)
    3.23 +{
    3.24 +    unsigned long ticks = usecs * ticks_per_usec;
    3.25 +    unsigned long s;
    3.26 +    unsigned long e;
    3.27  
    3.28 +    s = get_timebase();
    3.29 +    do {
    3.30 +        asm volatile("or 1,1,1"); /* also puts the thread to low priority */
    3.31 +        e = get_timebase();
    3.32 +    } while ((e-s) < ticks);
    3.33 +}
    3.34  #endif