diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-04 06:41:37 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-04 06:41:37 -0400 |
commit | f9bcda7760e1373615c9f6d9ce24209b0ab97de1 (patch) | |
tree | f90b3031126c4e4beb8161f38ea436303e2b8b73 /include/asm-i386 | |
parent | 9bec2e38527a9f2497b3d976715c672d08d6160d (diff) | |
parent | c336923b668fdcf0312efbec3b44895d713f4d81 (diff) |
Merge branch 'master' into upstream
Diffstat (limited to 'include/asm-i386')
-rw-r--r-- | include/asm-i386/alternative.h | 20 | ||||
-rw-r--r-- | include/asm-i386/mach-default/mach_mpspec.h | 4 | ||||
-rw-r--r-- | include/asm-i386/rwlock.h | 28 | ||||
-rw-r--r-- | include/asm-i386/spinlock.h | 17 | ||||
-rw-r--r-- | include/asm-i386/unistd.h | 4 | ||||
-rw-r--r-- | include/asm-i386/unwind.h | 1 |
6 files changed, 23 insertions, 51 deletions
diff --git a/include/asm-i386/alternative.h b/include/asm-i386/alternative.h index 96adbabec740..b01a7ec409ce 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-i386/alternative.h | |||
@@ -88,9 +88,6 @@ static inline void alternatives_smp_switch(int smp) {} | |||
88 | /* | 88 | /* |
89 | * Alternative inline assembly for SMP. | 89 | * Alternative inline assembly for SMP. |
90 | * | 90 | * |
91 | * alternative_smp() takes two versions (SMP first, UP second) and is | ||
92 | * for more complex stuff such as spinlocks. | ||
93 | * | ||
94 | * The LOCK_PREFIX macro defined here replaces the LOCK and | 91 | * The LOCK_PREFIX macro defined here replaces the LOCK and |
95 | * LOCK_PREFIX macros used everywhere in the source tree. | 92 | * LOCK_PREFIX macros used everywhere in the source tree. |
96 | * | 93 | * |
@@ -110,21 +107,6 @@ static inline void alternatives_smp_switch(int smp) {} | |||
110 | */ | 107 | */ |
111 | 108 | ||
112 | #ifdef CONFIG_SMP | 109 | #ifdef CONFIG_SMP |
113 | #define alternative_smp(smpinstr, upinstr, args...) \ | ||
114 | asm volatile ("661:\n\t" smpinstr "\n662:\n" \ | ||
115 | ".section .smp_altinstructions,\"a\"\n" \ | ||
116 | " .align 4\n" \ | ||
117 | " .long 661b\n" /* label */ \ | ||
118 | " .long 663f\n" /* new instruction */ \ | ||
119 | " .byte 0x68\n" /* X86_FEATURE_UP */ \ | ||
120 | " .byte 662b-661b\n" /* sourcelen */ \ | ||
121 | " .byte 664f-663f\n" /* replacementlen */ \ | ||
122 | ".previous\n" \ | ||
123 | ".section .smp_altinstr_replacement,\"awx\"\n" \ | ||
124 | "663:\n\t" upinstr "\n" /* replacement */ \ | ||
125 | "664:\n\t.fill 662b-661b,1,0x42\n" /* space for original */ \ | ||
126 | ".previous" : args) | ||
127 | |||
128 | #define LOCK_PREFIX \ | 110 | #define LOCK_PREFIX \ |
129 | ".section .smp_locks,\"a\"\n" \ | 111 | ".section .smp_locks,\"a\"\n" \ |
130 | " .align 4\n" \ | 112 | " .align 4\n" \ |
@@ -133,8 +115,6 @@ static inline void alternatives_smp_switch(int smp) {} | |||
133 | "661:\n\tlock; " | 115 | "661:\n\tlock; " |
134 | 116 | ||
135 | #else /* ! CONFIG_SMP */ | 117 | #else /* ! CONFIG_SMP */ |
136 | #define alternative_smp(smpinstr, upinstr, args...) \ | ||
137 | asm volatile (upinstr : args) | ||
138 | #define LOCK_PREFIX "" | 118 | #define LOCK_PREFIX "" |
139 | #endif | 119 | #endif |
140 | 120 | ||
diff --git a/include/asm-i386/mach-default/mach_mpspec.h b/include/asm-i386/mach-default/mach_mpspec.h index 6b5dadcf1d0e..51c9a9775932 100644 --- a/include/asm-i386/mach-default/mach_mpspec.h +++ b/include/asm-i386/mach-default/mach_mpspec.h | |||
@@ -3,6 +3,10 @@ | |||
3 | 3 | ||
4 | #define MAX_IRQ_SOURCES 256 | 4 | #define MAX_IRQ_SOURCES 256 |
5 | 5 | ||
6 | #if CONFIG_BASE_SMALL == 0 | ||
7 | #define MAX_MP_BUSSES 256 | ||
8 | #else | ||
6 | #define MAX_MP_BUSSES 32 | 9 | #define MAX_MP_BUSSES 32 |
10 | #endif | ||
7 | 11 | ||
8 | #endif /* __ASM_MACH_MPSPEC_H */ | 12 | #endif /* __ASM_MACH_MPSPEC_H */ |
diff --git a/include/asm-i386/rwlock.h b/include/asm-i386/rwlock.h index 96b0bef2ea56..87c069ccba08 100644 --- a/include/asm-i386/rwlock.h +++ b/include/asm-i386/rwlock.h | |||
@@ -21,23 +21,21 @@ | |||
21 | #define RW_LOCK_BIAS_STR "0x01000000" | 21 | #define RW_LOCK_BIAS_STR "0x01000000" |
22 | 22 | ||
23 | #define __build_read_lock_ptr(rw, helper) \ | 23 | #define __build_read_lock_ptr(rw, helper) \ |
24 | alternative_smp("lock; subl $1,(%0)\n\t" \ | 24 | asm volatile(LOCK_PREFIX " subl $1,(%0)\n\t" \ |
25 | "jns 1f\n" \ | 25 | "jns 1f\n" \ |
26 | "call " helper "\n\t" \ | 26 | "call " helper "\n\t" \ |
27 | "1:\n", \ | 27 | "1:\n" \ |
28 | "subl $1,(%0)\n\t", \ | 28 | ::"a" (rw) : "memory") |
29 | :"a" (rw) : "memory") | ||
30 | 29 | ||
31 | #define __build_read_lock_const(rw, helper) \ | 30 | #define __build_read_lock_const(rw, helper) \ |
32 | alternative_smp("lock; subl $1,%0\n\t" \ | 31 | asm volatile(LOCK_PREFIX " subl $1,%0\n\t" \ |
33 | "jns 1f\n" \ | 32 | "jns 1f\n" \ |
34 | "pushl %%eax\n\t" \ | 33 | "pushl %%eax\n\t" \ |
35 | "leal %0,%%eax\n\t" \ | 34 | "leal %0,%%eax\n\t" \ |
36 | "call " helper "\n\t" \ | 35 | "call " helper "\n\t" \ |
37 | "popl %%eax\n\t" \ | 36 | "popl %%eax\n\t" \ |
38 | "1:\n", \ | 37 | "1:\n" \ |
39 | "subl $1,%0\n\t", \ | 38 | :"+m" (*(volatile int *)rw) : : "memory") |
40 | "+m" (*(volatile int *)rw) : : "memory") | ||
41 | 39 | ||
42 | #define __build_read_lock(rw, helper) do { \ | 40 | #define __build_read_lock(rw, helper) do { \ |
43 | if (__builtin_constant_p(rw)) \ | 41 | if (__builtin_constant_p(rw)) \ |
@@ -47,23 +45,21 @@ | |||
47 | } while (0) | 45 | } while (0) |
48 | 46 | ||
49 | #define __build_write_lock_ptr(rw, helper) \ | 47 | #define __build_write_lock_ptr(rw, helper) \ |
50 | alternative_smp("lock; subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \ | 48 | asm volatile(LOCK_PREFIX " subl $" RW_LOCK_BIAS_STR ",(%0)\n\t" \ |
51 | "jz 1f\n" \ | 49 | "jz 1f\n" \ |
52 | "call " helper "\n\t" \ | 50 | "call " helper "\n\t" \ |
53 | "1:\n", \ | 51 | "1:\n" \ |
54 | "subl $" RW_LOCK_BIAS_STR ",(%0)\n\t", \ | 52 | ::"a" (rw) : "memory") |
55 | :"a" (rw) : "memory") | ||
56 | 53 | ||
57 | #define __build_write_lock_const(rw, helper) \ | 54 | #define __build_write_lock_const(rw, helper) \ |
58 | alternative_smp("lock; subl $" RW_LOCK_BIAS_STR ",%0\n\t" \ | 55 | asm volatile(LOCK_PREFIX " subl $" RW_LOCK_BIAS_STR ",%0\n\t" \ |
59 | "jz 1f\n" \ | 56 | "jz 1f\n" \ |
60 | "pushl %%eax\n\t" \ | 57 | "pushl %%eax\n\t" \ |
61 | "leal %0,%%eax\n\t" \ | 58 | "leal %0,%%eax\n\t" \ |
62 | "call " helper "\n\t" \ | 59 | "call " helper "\n\t" \ |
63 | "popl %%eax\n\t" \ | 60 | "popl %%eax\n\t" \ |
64 | "1:\n", \ | 61 | "1:\n" \ |
65 | "subl $" RW_LOCK_BIAS_STR ",%0\n\t", \ | 62 | :"+m" (*(volatile int *)rw) : : "memory") |
66 | "+m" (*(volatile int *)rw) : : "memory") | ||
67 | 63 | ||
68 | #define __build_write_lock(rw, helper) do { \ | 64 | #define __build_write_lock(rw, helper) do { \ |
69 | if (__builtin_constant_p(rw)) \ | 65 | if (__builtin_constant_p(rw)) \ |
diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index d816c62a7a1d..d1020363c41a 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h | |||
@@ -22,7 +22,7 @@ | |||
22 | 22 | ||
23 | #define __raw_spin_lock_string \ | 23 | #define __raw_spin_lock_string \ |
24 | "\n1:\t" \ | 24 | "\n1:\t" \ |
25 | "lock ; decb %0\n\t" \ | 25 | LOCK_PREFIX " ; decb %0\n\t" \ |
26 | "jns 3f\n" \ | 26 | "jns 3f\n" \ |
27 | "2:\t" \ | 27 | "2:\t" \ |
28 | "rep;nop\n\t" \ | 28 | "rep;nop\n\t" \ |
@@ -38,7 +38,7 @@ | |||
38 | */ | 38 | */ |
39 | #define __raw_spin_lock_string_flags \ | 39 | #define __raw_spin_lock_string_flags \ |
40 | "\n1:\t" \ | 40 | "\n1:\t" \ |
41 | "lock ; decb %0\n\t" \ | 41 | LOCK_PREFIX " ; decb %0\n\t" \ |
42 | "jns 5f\n" \ | 42 | "jns 5f\n" \ |
43 | "2:\t" \ | 43 | "2:\t" \ |
44 | "testl $0x200, %1\n\t" \ | 44 | "testl $0x200, %1\n\t" \ |
@@ -57,15 +57,9 @@ | |||
57 | "jmp 4b\n" \ | 57 | "jmp 4b\n" \ |
58 | "5:\n\t" | 58 | "5:\n\t" |
59 | 59 | ||
60 | #define __raw_spin_lock_string_up \ | ||
61 | "\n\tdecb %0" | ||
62 | |||
63 | static inline void __raw_spin_lock(raw_spinlock_t *lock) | 60 | static inline void __raw_spin_lock(raw_spinlock_t *lock) |
64 | { | 61 | { |
65 | alternative_smp( | 62 | asm(__raw_spin_lock_string : "+m" (lock->slock) : : "memory"); |
66 | __raw_spin_lock_string, | ||
67 | __raw_spin_lock_string_up, | ||
68 | "+m" (lock->slock) : : "memory"); | ||
69 | } | 63 | } |
70 | 64 | ||
71 | /* | 65 | /* |
@@ -76,10 +70,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock) | |||
76 | #ifndef CONFIG_PROVE_LOCKING | 70 | #ifndef CONFIG_PROVE_LOCKING |
77 | static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) | 71 | static inline void __raw_spin_lock_flags(raw_spinlock_t *lock, unsigned long flags) |
78 | { | 72 | { |
79 | alternative_smp( | 73 | asm(__raw_spin_lock_string_flags : "+m" (lock->slock) : "r" (flags) : "memory"); |
80 | __raw_spin_lock_string_flags, | ||
81 | __raw_spin_lock_string_up, | ||
82 | "+m" (lock->slock) : "r" (flags) : "memory"); | ||
83 | } | 74 | } |
84 | #endif | 75 | #endif |
85 | 76 | ||
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index fc1c8ddae149..d983b74e4d9f 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h | |||
@@ -324,8 +324,6 @@ | |||
324 | #define __NR_vmsplice 316 | 324 | #define __NR_vmsplice 316 |
325 | #define __NR_move_pages 317 | 325 | #define __NR_move_pages 317 |
326 | 326 | ||
327 | #ifdef __KERNEL__ | ||
328 | |||
329 | #define NR_syscalls 318 | 327 | #define NR_syscalls 318 |
330 | 328 | ||
331 | /* | 329 | /* |
@@ -425,6 +423,8 @@ __asm__ volatile ("push %%ebp ; push %%ebx ; movl 4(%2),%%ebp ; " \ | |||
425 | __syscall_return(type,__res); \ | 423 | __syscall_return(type,__res); \ |
426 | } | 424 | } |
427 | 425 | ||
426 | #ifdef __KERNEL__ | ||
427 | |||
428 | #define __ARCH_WANT_IPC_PARSE_VERSION | 428 | #define __ARCH_WANT_IPC_PARSE_VERSION |
429 | #define __ARCH_WANT_OLD_READDIR | 429 | #define __ARCH_WANT_OLD_READDIR |
430 | #define __ARCH_WANT_OLD_STAT | 430 | #define __ARCH_WANT_OLD_STAT |
diff --git a/include/asm-i386/unwind.h b/include/asm-i386/unwind.h index 69f0f1df6722..4c1a0b968569 100644 --- a/include/asm-i386/unwind.h +++ b/include/asm-i386/unwind.h | |||
@@ -87,6 +87,7 @@ static inline int arch_unw_user_mode(const struct unwind_frame_info *info) | |||
87 | #else | 87 | #else |
88 | 88 | ||
89 | #define UNW_PC(frame) ((void)(frame), 0) | 89 | #define UNW_PC(frame) ((void)(frame), 0) |
90 | #define UNW_SP(frame) ((void)(frame), 0) | ||
90 | 91 | ||
91 | static inline int arch_unw_user_mode(const void *info) | 92 | static inline int arch_unw_user_mode(const void *info) |
92 | { | 93 | { |