ia64/xen-unstable
changeset 3946:6a35285d5dae
bitkeeper revision 1.1159.258.16 (4221a2ecsI-7_TFUEYf9_8zVhzHq3Q)
Fix 2.4 build, and a small 2.6 bootstrap tweak.
Signed-off-by: Keir Fraser <keir@xensource.com>
Fix 2.4 build, and a small 2.6 bootstrap tweak.
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@scramble.cl.cam.ac.uk |
---|---|
date | Sun Feb 27 10:37:32 2005 +0000 (2005-02-27) |
parents | 8a2d8a8a5415 |
children | da2ab74c30e1 936a15585c3f |
files | .rootkeys linux-2.4.29-xen-sparse/include/asm-xen/synch_bitops.h linux-2.4.29-xen-sparse/include/asm-xen/system.h linux-2.4.29-xen-sparse/mkbuildtree linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c |
line diff
1.1 --- a/.rootkeys Sat Feb 26 18:36:40 2005 +0000 1.2 +++ b/.rootkeys Sun Feb 27 10:37:32 2005 +0000 1.3 @@ -107,7 +107,6 @@ 3e5a4e676uK4xErTBDH6XJREn9LSyg linux-2.4 1.4 41224663YBCUMX1kVo_HRUtgaHTi7w linux-2.4.29-xen-sparse/include/asm-xen/queues.h 1.5 3e5a4e68uJz-xI0IBVMD7xRLQKJDFg linux-2.4.29-xen-sparse/include/asm-xen/segment.h 1.6 3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA linux-2.4.29-xen-sparse/include/asm-xen/smp.h 1.7 -4062f7e2PzFOUGT0PaE7A0VprTU3JQ linux-2.4.29-xen-sparse/include/asm-xen/synch_bitops.h 1.8 3e5a4e68mTr0zcp9SXDbnd-XLrrfxw linux-2.4.29-xen-sparse/include/asm-xen/system.h 1.9 3f1056a9L_kqHcFheV00KbKBzv9j5w linux-2.4.29-xen-sparse/include/asm-xen/vga.h 1.10 40659defgWA92arexpMGn8X3QMDj3w linux-2.4.29-xen-sparse/include/asm-xen/xor.h
2.1 --- a/linux-2.4.29-xen-sparse/include/asm-xen/synch_bitops.h Sat Feb 26 18:36:40 2005 +0000 2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 2.3 @@ -1,83 +0,0 @@ 2.4 -#ifndef __XEN_SYNCH_BITOPS_H__ 2.5 -#define __XEN_SYNCH_BITOPS_H__ 2.6 - 2.7 -/* 2.8 - * Copyright 1992, Linus Torvalds. 2.9 - * Heavily modified to provide guaranteed strong synchronisation 2.10 - * when communicating with Xen or other guest OSes running on other CPUs. 2.11 - */ 2.12 - 2.13 -#include <linux/config.h> 2.14 - 2.15 -#define ADDR (*(volatile long *) addr) 2.16 - 2.17 -static __inline__ void synch_set_bit(int nr, volatile void * addr) 2.18 -{ 2.19 - __asm__ __volatile__ ( 2.20 - "lock btsl %1,%0" 2.21 - : "=m" (ADDR) : "Ir" (nr) : "memory" ); 2.22 -} 2.23 - 2.24 -static __inline__ void synch_clear_bit(int nr, volatile void * addr) 2.25 -{ 2.26 - __asm__ __volatile__ ( 2.27 - "lock btrl %1,%0" 2.28 - : "=m" (ADDR) : "Ir" (nr) : "memory" ); 2.29 -} 2.30 - 2.31 -static __inline__ void synch_change_bit(int nr, volatile void * addr) 2.32 -{ 2.33 - __asm__ __volatile__ ( 2.34 - "lock btcl %1,%0" 2.35 - : "=m" (ADDR) : "Ir" (nr) : "memory" ); 2.36 -} 2.37 - 2.38 -static __inline__ int synch_test_and_set_bit(int nr, volatile void * addr) 2.39 -{ 2.40 - int oldbit; 2.41 - __asm__ __volatile__ ( 2.42 - "lock btsl %2,%1\n\tsbbl %0,%0" 2.43 - : "=r" (oldbit), "=m" (ADDR) : "Ir" (nr) : "memory"); 2.44 - return oldbit; 2.45 -} 2.46 - 2.47 -static __inline__ int synch_test_and_clear_bit(int nr, volatile void * addr) 2.48 -{ 2.49 - int oldbit; 2.50 - __asm__ __volatile__ ( 2.51 - "lock btrl %2,%1\n\tsbbl %0,%0" 2.52 - : "=r" (oldbit), "=m" (ADDR) : "Ir" (nr) : "memory"); 2.53 - return oldbit; 2.54 -} 2.55 - 2.56 -static __inline__ int synch_test_and_change_bit(int nr, volatile void * addr) 2.57 -{ 2.58 - int oldbit; 2.59 - 2.60 - __asm__ __volatile__ ( 2.61 - "lock btcl %2,%1\n\tsbbl %0,%0" 2.62 - : "=r" (oldbit), "=m" (ADDR) : "Ir" (nr) : "memory"); 2.63 - return oldbit; 2.64 -} 2.65 - 2.66 -static __inline__ int synch_const_test_bit(int nr, const volatile void * addr) 2.67 -{ 2.68 - return ((1UL << (nr & 31)) & 2.69 - (((const volatile unsigned int *) addr)[nr >> 5])) != 0; 2.70 -} 2.71 - 2.72 -static __inline__ int synch_var_test_bit(int nr, volatile void * addr) 2.73 -{ 2.74 - int oldbit; 2.75 - __asm__ __volatile__ ( 2.76 - "btl %2,%1\n\tsbbl %0,%0" 2.77 - : "=r" (oldbit) : "m" (ADDR), "Ir" (nr) ); 2.78 - return oldbit; 2.79 -} 2.80 - 2.81 -#define synch_test_bit(nr,addr) \ 2.82 -(__builtin_constant_p(nr) ? \ 2.83 - synch_const_test_bit((nr),(addr)) : \ 2.84 - synch_var_test_bit((nr),(addr))) 2.85 - 2.86 -#endif /* __XEN_SYNCH_BITOPS_H__ */
3.1 --- a/linux-2.4.29-xen-sparse/include/asm-xen/system.h Sat Feb 26 18:36:40 2005 +0000 3.2 +++ b/linux-2.4.29-xen-sparse/include/asm-xen/system.h Sun Feb 27 10:37:32 2005 +0000 3.3 @@ -113,6 +113,22 @@ static inline unsigned long _get_base(ch 3.4 3.5 #endif /* __KERNEL__ */ 3.6 3.7 +/** 3.8 + * __ffs - find first bit in word. 3.9 + * @word: The word to search 3.10 + * 3.11 + * Undefined if no bit exists, so code should check against 0 first. 3.12 + * 3.13 + * Taken from 2.6 for Xen. 3.14 + */ 3.15 +static inline unsigned long __ffs(unsigned long word) 3.16 +{ 3.17 + __asm__("bsfl %1,%0" 3.18 + :"=r" (word) 3.19 + :"rm" (word)); 3.20 + return word; 3.21 +} 3.22 + 3.23 static inline unsigned long get_limit(unsigned long segment) 3.24 { 3.25 unsigned long __limit;
4.1 --- a/linux-2.4.29-xen-sparse/mkbuildtree Sat Feb 26 18:36:40 2005 +0000 4.2 +++ b/linux-2.4.29-xen-sparse/mkbuildtree Sun Feb 27 10:37:32 2005 +0000 4.3 @@ -211,6 +211,7 @@ ln -sf ../../${LINUX_26}/include/asm-xen 4.4 ln -sf ../../${LINUX_26}/include/asm-xen/hypervisor.h 4.5 ln -sf ../../${LINUX_26}/include/asm-xen/multicall.h 4.6 ln -sf ../../${LINUX_26}/include/asm-xen/xen_proc.h 4.7 +ln -sf ../../${LINUX_26}/include/asm-xen/asm-i386/synch_bitops.h 4.8 4.9 mkdir -p linux-public && cd linux-public 4.10 ln -sf ../../../${LINUX_26}/include/asm-xen/linux-public/privcmd.h
5.1 --- a/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c Sat Feb 26 18:36:40 2005 +0000 5.2 +++ b/linux-2.6.10-xen-sparse/arch/xen/i386/mm/init.c Sun Feb 27 10:37:32 2005 +0000 5.3 @@ -179,9 +179,7 @@ static void __init kernel_physical_mappi 5.4 pte += pte_ofs; 5.5 for (; pte_ofs < PTRS_PER_PTE && pfn < max_low_pfn; pte++, pfn++, pte_ofs++) { 5.6 /* XEN: Only map initial RAM allocation. */ 5.7 - if (pfn >= max_ram_pfn) 5.8 - break; 5.9 - if (pte_present(*pte)) 5.10 + if ((pfn >= max_ram_pfn) || pte_present(*pte)) 5.11 continue; 5.12 if (is_kernel_text(address)) 5.13 set_pte(pte, pfn_pte(pfn, PAGE_KERNEL_EXEC));