diff -urNp 2.4.20pre8aa2/include/asm-x86_64/asm-macros.i ul-20021002/include/asm-x86_64/asm-macros.i --- 2.4.20pre8aa2/include/asm-x86_64/asm-macros.i Thu Sep 26 04:14:29 2002 +++ ul-20021002/include/asm-x86_64/asm-macros.i Thu Jan 1 01:00:00 1970 @@ -1,12 +0,0 @@ - - .macro SAVE_CALLEE_CLOBBERED - cld - pushq %rdi - pushq %rsi - pushq %rdx - pushq %rcx - pushq %rbx - pushq %rax - pushq %r8 - pushq %r9" - .endm diff -urNp 2.4.20pre8aa2/include/asm-x86_64/bitops.h ul-20021002/include/asm-x86_64/bitops.h --- 2.4.20pre8aa2/include/asm-x86_64/bitops.h Wed Oct 2 06:43:01 2002 +++ ul-20021002/include/asm-x86_64/bitops.h Wed Oct 2 06:31:50 2002 @@ -58,6 +58,14 @@ static __inline__ void __set_bit(long nr :"dIr" (nr)); } +static __inline__ void __clear_bit(int nr, volatile void * addr) +{ + __asm__ __volatile__( + "btrl %1,%0" + :"=m" (ADDR) + :"Ir" (nr)); +} + /** * clear_bit - Clears a bit in memory * @nr: Bit to clear @@ -78,15 +86,6 @@ static __inline__ void clear_bit(long nr #define smp_mb__before_clear_bit() barrier() #define smp_mb__after_clear_bit() barrier() -static __inline__ void __clear_bit(long nr, volatile void * addr) -{ - __asm__ __volatile__( - "btrq %1,%0" - :"=m" (ADDR) - :"dIr" (nr)); -} - - /** * __change_bit - Toggle a bit in memory * @nr: the bit to set @@ -324,7 +323,7 @@ static __inline__ int find_next_zero_bit return (offset + set + res); } -#include + /** * find_first_bit - find the first set bit in a memory region * @addr: The address to start the search at @@ -345,9 +344,9 @@ static __inline__ int find_first_bit(voi "jz 1f\n\t" "leaq -4(%%rdi),%%rdi\n\t" "bsfl (%%rdi),%%eax\n" - "1:\tsubq %%rbx,%%rdi\n\t" - "shlq $3,%%rdi\n\t" - "addq %%rdi,%%rax" + "1:\tsubl %%ebx,%%edi\n\t" + "shll $3,%%edi\n\t" + "addl %%edi,%%eax" :"=a" (res), "=&c" (d0), "=&D" (d1) :"1" ((size + 31) >> 5), "2" (addr), "b" (addr)); return res; @@ -421,6 +420,21 @@ static __inline__ unsigned long ffz(unsi return word; } + +/** + * __ffs - find first bit in word. + * @word: The word to search + * + * Undefined if no bit exists, so code should check against 0 first. + */ +static __inline__ unsigned long __ffs(unsigned long word) +{ + __asm__("bsfq %1,%0" + :"=r" (word) + :"rm" (word)); + return word; +} + #ifdef __KERNEL__ /** @@ -438,39 +452,10 @@ static __inline__ int ffs(int x) __asm__("bsfl %1,%0\n\t" "jnz 1f\n\t" "movl $-1,%0\n" - "1:" : "=r" (r) : "rm" (x)); + "1:" : "=r" (r) : "g" (x)); return r+1; } -static __inline__ unsigned long __ffs(unsigned long word) -{ - __asm__("bsfq %1,%0" - :"=r" (word) - :"rm" (word)); - return word; -} - - -/* - * Every architecture must define this function. It's the fastest - * way of searching a 140-bit bitmap where the first 100 bits are - * unlikely to be set. It's guaranteed that at least one of the 140 - * bits is cleared. - */ -static inline int _sched_find_first_bit(unsigned long *b) -{ - if (unlikely(b[0])) - return __ffs(b[0]); - if (unlikely(b[1])) - return __ffs(b[1]) + 32; - if (unlikely(b[2])) - return __ffs(b[2]) + 64; - if (b[3]) - return __ffs(b[3]) + 96; - return __ffs(b[4]) + 128; -} - - /** * hweightN - returns the hamming weight of a N-bit word * @x: the word to weigh diff -urNp 2.4.20pre8aa2/include/asm-x86_64/ia32_unistd.h ul-20021002/include/asm-x86_64/ia32_unistd.h --- 2.4.20pre8aa2/include/asm-x86_64/ia32_unistd.h Thu Sep 26 04:14:29 2002 +++ ul-20021002/include/asm-x86_64/ia32_unistd.h Wed Oct 2 06:31:50 2002 @@ -232,6 +232,19 @@ #define __NR_ia32_security 223 #define __NR_ia32_gettid 224 #define __NR_ia32_readahead 225 +#define __NR_ia32_setxattr 226 +#define __NR_ia32_lsetxattr 227 +#define __NR_ia32_fsetxattr 228 +#define __NR_ia32_getxattr 229 +#define __NR_ia32_lgetxattr 230 +#define __NR_ia32_fgetxattr 231 +#define __NR_ia32_listxattr 232 +#define __NR_ia32_llistxattr 233 +#define __NR_ia32_flistxattr 234 +#define __NR_ia32_removexattr 235 +#define __NR_ia32_lremovexattr 236 +#define __NR_ia32_fremovexattr 237 +#define __NR_ia32_tkill 238 #define __NR_ia32_sendfile64 239 #define __NR_ia32_futex 240 #define __NR_ia32_sched_setaffinity 241 @@ -240,14 +253,10 @@ #define __NR_ia32_get_thread_area 244 #define __NR_ia32_io_setup 245 #define __NR_ia32_io_destroy 246 -#define __NR_ia32_io_getevents 247 +#define __NR_ia32_io_getevents 247 #define __NR_ia32_io_submit 248 #define __NR_ia32_io_cancel 249 -#define __NR_ia32_alloc_hugepages 250 -#define __NR_ia32_free_hugepages 251 -#define __NR_ia32_exit_group 252 - -#define IA32_NR_syscalls 260 +#define IA32_NR_syscalls 250 #endif /* _ASM_X86_64_IA32_UNISTD_H_ */ diff -urNp 2.4.20pre8aa2/include/asm-x86_64/ioctls.h ul-20021002/include/asm-x86_64/ioctls.h --- 2.4.20pre8aa2/include/asm-x86_64/ioctls.h Wed Oct 2 06:43:01 2002 +++ ul-20021002/include/asm-x86_64/ioctls.h Wed Oct 2 06:31:50 2002 @@ -49,6 +49,7 @@ #define TIOCGSID 0x5429 /* Return the session ID of FD */ #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ +#define TIOCGDEV _IOR('T',0x32, unsigned int) #define FIONCLEX 0x5450 /* these numbers need to be adjusted. */ #define FIOCLEX 0x5451 diff -urNp 2.4.20pre8aa2/include/asm-x86_64/max_numnodes.h ul-20021002/include/asm-x86_64/max_numnodes.h --- 2.4.20pre8aa2/include/asm-x86_64/max_numnodes.h Thu Jan 1 01:00:00 1970 +++ ul-20021002/include/asm-x86_64/max_numnodes.h Wed Oct 2 06:31:27 2002 @@ -0,0 +1,14 @@ +#ifndef _ASM_MAX_NUMNODES_H +#define _ASM_MAX_NUMNODES_H + +#include + + + +#ifdef CONFIG_K8_NUMA +#define MAX_NUMNODES 8 +#else +#define MAX_NUMNODES 1 +#endif + +#endif diff -urNp 2.4.20pre8aa2/include/asm-x86_64/mman.h ul-20021002/include/asm-x86_64/mman.h --- 2.4.20pre8aa2/include/asm-x86_64/mman.h Wed Oct 2 06:43:01 2002 +++ ul-20021002/include/asm-x86_64/mman.h Wed Oct 2 06:31:43 2002 @@ -4,7 +4,7 @@ #define PROT_READ 0x1 /* page can be read */ #define PROT_WRITE 0x2 /* page can be written */ #define PROT_EXEC 0x4 /* page can be executed */ -#define PROT_SEM 0x8 +#define PROT_SEM 0x8 /* page may be used for atomic ops */ #define PROT_NONE 0x0 /* page can not be accessed */ #define MAP_SHARED 0x01 /* Share changes */ diff -urNp 2.4.20pre8aa2/include/asm-x86_64/mmzone.h ul-20021002/include/asm-x86_64/mmzone.h --- 2.4.20pre8aa2/include/asm-x86_64/mmzone.h Thu Sep 26 04:14:29 2002 +++ ul-20021002/include/asm-x86_64/mmzone.h Wed Oct 2 06:31:49 2002 @@ -22,8 +22,8 @@ struct bootmem_data_t; extern plat_pg_data_t *plat_node_data[]; +#include #define MAXNODE 8 -#define MAX_NUMNODES MAXNODE #define NODEMAPSIZE 0xff /* Simple perfect hash to map physical addresses to node numbers */ diff -urNp 2.4.20pre8aa2/include/asm-x86_64/system.h ul-20021002/include/asm-x86_64/system.h --- 2.4.20pre8aa2/include/asm-x86_64/system.h Wed Oct 2 06:43:01 2002 +++ ul-20021002/include/asm-x86_64/system.h Wed Oct 2 06:31:19 2002 @@ -239,7 +239,7 @@ static inline unsigned long __cmpxchg(vo #define warn_if_not_ulong(x) do { unsigned long foo; (void) (&(x) == &foo); } while (0) /* interrupt control.. */ -#define __save_flags(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# save_flags \n\t pushfq ; popq %0":"=g" (x): /* no input */ :"memory"); } while (0) +#define __save_flags(x) do { warn_if_not_ulong(x); __asm__ __volatile__("# save_flags \n\t pushfq ; popq %q0":"=g" (x): /* no input */ :"memory"); } while (0) #define __restore_flags(x) __asm__ __volatile__("# restore_flags \n\t pushq %0 ; popfq": /* no output */ :"g" (x):"memory", "cc") #define __cli() __asm__ __volatile__("cli": : :"memory") #define __sti() __asm__ __volatile__("sti": : :"memory") diff -urNp 2.4.20pre8aa2/include/asm-x86_64/unistd.h ul-20021002/include/asm-x86_64/unistd.h --- 2.4.20pre8aa2/include/asm-x86_64/unistd.h Wed Oct 2 06:43:01 2002 +++ ul-20021002/include/asm-x86_64/unistd.h Wed Oct 2 06:31:50 2002 @@ -436,55 +436,53 @@ __SYSCALL(__NR_gettid, sys_gettid) __SYSCALL(__NR_readahead, sys_readahead) #define __NR_setxattr 188 -__SYSCALL(__NR_setxattr, sys_ni_syscall) +__SYSCALL(__NR_setxattr, sys_setxattr) #define __NR_lsetxattr 189 -__SYSCALL(__NR_lsetxattr, sys_ni_syscall) +__SYSCALL(__NR_lsetxattr, sys_lsetxattr) #define __NR_fsetxattr 190 -__SYSCALL(__NR_fsetxattr, sys_ni_syscall) +__SYSCALL(__NR_fsetxattr, sys_fsetxattr) #define __NR_getxattr 191 -__SYSCALL(__NR_getxattr, sys_ni_syscall) +__SYSCALL(__NR_getxattr, sys_getxattr) #define __NR_lgetxattr 192 -__SYSCALL(__NR_lgetxattr, sys_ni_syscall) +__SYSCALL(__NR_lgetxattr, sys_lgetxattr) #define __NR_fgetxattr 193 -__SYSCALL(__NR_fgetxattr, sys_ni_syscall) +__SYSCALL(__NR_fgetxattr, sys_fgetxattr) #define __NR_listxattr 194 -__SYSCALL(__NR_listxattr, sys_ni_syscall) +__SYSCALL(__NR_listxattr, sys_listxattr) #define __NR_llistxattr 195 -__SYSCALL(__NR_llistxattr, sys_ni_syscall) +__SYSCALL(__NR_llistxattr, sys_llistxattr) #define __NR_flistxattr 196 -__SYSCALL(__NR_flistxattr, sys_ni_syscall) +__SYSCALL(__NR_flistxattr, sys_flistxattr) #define __NR_removexattr 197 -__SYSCALL(__NR_removexattr, sys_ni_syscall) +__SYSCALL(__NR_removexattr, sys_removexattr) #define __NR_lremovexattr 198 -__SYSCALL(__NR_lremovexattr, sys_ni_syscall) +__SYSCALL(__NR_lremovexattr, sys_lremovexattr) #define __NR_fremovexattr 199 -__SYSCALL(__NR_fremovexattr, sys_ni_syscall) +__SYSCALL(__NR_fremovexattr, sys_fremovexattr) #define __NR_tkill 200 /* 2.5 only */ __SYSCALL(__NR_tkill, sys_ni_syscall) #define __NR_time 201 __SYSCALL(__NR_time, sys_time) #define __NR_futex 202 /* 2.5 only */ -__SYSCALL(__NR_futex, sys_ni_syscall) +__SYSCALL(__NR_futex, sys_futex) #define __NR_sched_setaffinity 203 -__SYSCALL(__NR_sched_setaffinity, sys_ni_syscall) +__SYSCALL(__NR_sched_setaffinity, sys_sched_setaffinity) #define __NR_sched_getaffinity 204 -__SYSCALL(__NR_sched_getaffinity, sys_ni_syscall) +__SYSCALL(__NR_sched_getaffinity, sys_sched_getaffinity) #define __NR_set_thread_area 205 __SYSCALL(__NR_set_thread_area, sys_ni_syscall) #define __NR_io_setup 206 -__SYSCALL(__NR_io_setup, sys_ni_syscall) +__SYSCALL(__NR_io_setup, sys_io_setup) #define __NR_io_destroy 207 -__SYSCALL(__NR_io_destroy, sys_ni_syscall) +__SYSCALL(__NR_io_destroy, sys_io_destroy) #define __NR_io_getevents 208 -__SYSCALL(__NR_io_getevents, sys_ni_syscall) +__SYSCALL(__NR_io_getevents, sys_io_getevents) #define __NR_io_submit 209 -__SYSCALL(__NR_io_submit, sys_ni_syscall) +__SYSCALL(__NR_io_submit, sys_io_submit) #define __NR_io_cancel 210 -__SYSCALL(__NR_io_cancel, sys_ni_syscall) -#define __NR_get_thread_area 211 -__SYSCALL(__NR_get_thread_area, sys_ni_syscall) +__SYSCALL(__NR_io_cancel, sys_io_cancel) -#define __NR_syscall_max __NR_get_thread_area +#define __NR_syscall_max __NR_io_cancel #ifndef __NO_STUBS