Contents of /trunk/kernel26-xen/patches-2.6.25-r1/1044-2.6.25-xen-x86_64-percpu-assembly-macros.patch
Parent Directory | Revision Log
Revision 606 -
(show annotations)
(download)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 1260 byte(s)
Thu May 22 23:13:13 2008 UTC (15 years, 11 months ago) by niro
File size: 1260 byte(s)
-ver bump to 2.6.25-magellan-r1: - linux-2.6.25.4 - fbcondecor-0.9.4 - squashfs-3.3 - unionfs-2.3.3 - tuxonice-3.0-rc7 - linux-phc-0.3.0 - acpi-dstd-0.9a - reiser4 - xen-3.2.0 . ipw3945-1.2.2
1 | From 99a35b361b4efabf50337f9f2a9e548c50e566cb Mon Sep 17 00:00:00 2001 |
2 | From: Eduardo Habkost <ehabkost@redhat.com> |
3 | Date: Thu, 29 Nov 2007 16:05:08 -0200 |
4 | Subject: [PATCH] x86_64 percpu assembly macros |
5 | |
6 | Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> |
7 | --- |
8 | include/asm-x86/percpu.h | 26 +++++++++++++++++++++++++- |
9 | 1 files changed, 25 insertions(+), 1 deletions(-) |
10 | |
11 | diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h |
12 | index 5dcb3bd..3f4522b 100644 |
13 | --- a/include/asm-x86/percpu.h |
14 | +++ b/include/asm-x86/percpu.h |
15 | @@ -9,7 +9,31 @@ |
16 | should be just put into a single section and referenced directly |
17 | from %gs */ |
18 | |
19 | -#ifndef __ASSEMBLY__ |
20 | +#ifdef __ASSEMBLY__ |
21 | + |
22 | +/* |
23 | + * PER_CPU finds an address of a per-cpu variable. |
24 | + * |
25 | + * Args: |
26 | + * var - variable name |
27 | + * reg - 32bit register |
28 | + * |
29 | + * The resulting address is stored in the "reg" argument. |
30 | + * |
31 | + * Example: |
32 | + * PER_CPU(cpu_gdt_descr, %ebx) |
33 | + */ |
34 | +#ifdef CONFIG_SMP |
35 | +#define PER_CPU(var, reg) \ |
36 | + movq %gs:pda_data_offset, reg; \ |
37 | + lea per_cpu__##var(reg), reg |
38 | +#else /* ! SMP */ |
39 | +#define PER_CPU(var, reg) \ |
40 | + movl $per_cpu__##var, reg |
41 | +#define PER_CPU_VAR(var) per_cpu__##var |
42 | +#endif /* SMP */ |
43 | + |
44 | +#else /* ...!ASSEMBLY */ |
45 | |
46 | #ifdef CONFIG_SMP |
47 | #include <asm/pda.h> |
48 | -- |
49 | 1.5.4.1 |
50 |