aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-x86
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-x86')
-rw-r--r--include/asm-x86/irqflags.h29
-rw-r--r--include/asm-x86/lguest_hcall.h2
-rw-r--r--include/asm-x86/linkage.h35
-rw-r--r--include/asm-x86/mach-rdc321x/gpio.h9
-rw-r--r--include/asm-x86/mach-rdc321x/rdc321x_defs.h8
-rw-r--r--include/asm-x86/nops.h20
-rw-r--r--include/asm-x86/pgtable.h2
7 files changed, 88 insertions, 17 deletions
diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h
index 92021c1ffa3a..0e2292483b35 100644
--- a/include/asm-x86/irqflags.h
+++ b/include/asm-x86/irqflags.h
@@ -70,6 +70,26 @@ static inline void raw_local_irq_restore(unsigned long flags)
70 native_restore_fl(flags); 70 native_restore_fl(flags);
71} 71}
72 72
73#ifdef CONFIG_X86_VSMP
74
75/*
76 * Interrupt control for the VSMP architecture:
77 */
78
79static inline void raw_local_irq_disable(void)
80{
81 unsigned long flags = __raw_local_save_flags();
82 raw_local_irq_restore((flags & ~X86_EFLAGS_IF) | X86_EFLAGS_AC);
83}
84
85static inline void raw_local_irq_enable(void)
86{
87 unsigned long flags = __raw_local_save_flags();
88 raw_local_irq_restore((flags | X86_EFLAGS_IF) & (~X86_EFLAGS_AC));
89}
90
91#else
92
73static inline void raw_local_irq_disable(void) 93static inline void raw_local_irq_disable(void)
74{ 94{
75 native_irq_disable(); 95 native_irq_disable();
@@ -80,6 +100,8 @@ static inline void raw_local_irq_enable(void)
80 native_irq_enable(); 100 native_irq_enable();
81} 101}
82 102
103#endif
104
83/* 105/*
84 * Used in the idle loop; sti takes one instruction cycle 106 * Used in the idle loop; sti takes one instruction cycle
85 * to complete: 107 * to complete:
@@ -137,10 +159,17 @@ static inline unsigned long __raw_local_irq_save(void)
137#define raw_local_irq_save(flags) \ 159#define raw_local_irq_save(flags) \
138 do { (flags) = __raw_local_irq_save(); } while (0) 160 do { (flags) = __raw_local_irq_save(); } while (0)
139 161
162#ifdef CONFIG_X86_VSMP
163static inline int raw_irqs_disabled_flags(unsigned long flags)
164{
165 return !(flags & X86_EFLAGS_IF) || (flags & X86_EFLAGS_AC);
166}
167#else
140static inline int raw_irqs_disabled_flags(unsigned long flags) 168static inline int raw_irqs_disabled_flags(unsigned long flags)
141{ 169{
142 return !(flags & X86_EFLAGS_IF); 170 return !(flags & X86_EFLAGS_IF);
143} 171}
172#endif
144 173
145static inline int raw_irqs_disabled(void) 174static inline int raw_irqs_disabled(void)
146{ 175{
diff --git a/include/asm-x86/lguest_hcall.h b/include/asm-x86/lguest_hcall.h
index 758b9a5d4539..f239e7069cab 100644
--- a/include/asm-x86/lguest_hcall.h
+++ b/include/asm-x86/lguest_hcall.h
@@ -27,7 +27,7 @@
27#ifndef __ASSEMBLY__ 27#ifndef __ASSEMBLY__
28#include <asm/hw_irq.h> 28#include <asm/hw_irq.h>
29 29
30/*G:031 First, how does our Guest contact the Host to ask for privileged 30/*G:031 But first, how does our Guest contact the Host to ask for privileged
31 * operations? There are two ways: the direct way is to make a "hypercall", 31 * operations? There are two ways: the direct way is to make a "hypercall",
32 * to make requests of the Host Itself. 32 * to make requests of the Host Itself.
33 * 33 *
diff --git a/include/asm-x86/linkage.h b/include/asm-x86/linkage.h
index 31739c7d66a9..c048353f4b85 100644
--- a/include/asm-x86/linkage.h
+++ b/include/asm-x86/linkage.h
@@ -8,12 +8,45 @@
8 8
9#ifdef CONFIG_X86_32 9#ifdef CONFIG_X86_32
10#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0))) 10#define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
11#define prevent_tail_call(ret) __asm__ ("" : "=r" (ret) : "0" (ret))
12/* 11/*
13 * For 32-bit UML - mark functions implemented in assembly that use 12 * For 32-bit UML - mark functions implemented in assembly that use
14 * regparm input parameters: 13 * regparm input parameters:
15 */ 14 */
16#define asmregparm __attribute__((regparm(3))) 15#define asmregparm __attribute__((regparm(3)))
16
17/*
18 * Make sure the compiler doesn't do anything stupid with the
19 * arguments on the stack - they are owned by the *caller*, not
20 * the callee. This just fools gcc into not spilling into them,
21 * and keeps it from doing tailcall recursion and/or using the
22 * stack slots for temporaries, since they are live and "used"
23 * all the way to the end of the function.
24 *
25 * NOTE! On x86-64, all the arguments are in registers, so this
26 * only matters on a 32-bit kernel.
27 */
28#define asmlinkage_protect(n, ret, args...) \
29 __asmlinkage_protect##n(ret, ##args)
30#define __asmlinkage_protect_n(ret, args...) \
31 __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args)
32#define __asmlinkage_protect0(ret) \
33 __asmlinkage_protect_n(ret)
34#define __asmlinkage_protect1(ret, arg1) \
35 __asmlinkage_protect_n(ret, "g" (arg1))
36#define __asmlinkage_protect2(ret, arg1, arg2) \
37 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2))
38#define __asmlinkage_protect3(ret, arg1, arg2, arg3) \
39 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3))
40#define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \
41 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
42 "g" (arg4))
43#define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \
44 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
45 "g" (arg4), "g" (arg5))
46#define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \
47 __asmlinkage_protect_n(ret, "g" (arg1), "g" (arg2), "g" (arg3), \
48 "g" (arg4), "g" (arg5), "g" (arg6))
49
17#endif 50#endif
18 51
19#ifdef CONFIG_X86_ALIGNMENT_16 52#ifdef CONFIG_X86_ALIGNMENT_16
diff --git a/include/asm-x86/mach-rdc321x/gpio.h b/include/asm-x86/mach-rdc321x/gpio.h
index db31b929b990..acce0b7d397b 100644
--- a/include/asm-x86/mach-rdc321x/gpio.h
+++ b/include/asm-x86/mach-rdc321x/gpio.h
@@ -5,19 +5,20 @@ extern int rdc_gpio_get_value(unsigned gpio);
5extern void rdc_gpio_set_value(unsigned gpio, int value); 5extern void rdc_gpio_set_value(unsigned gpio, int value);
6extern int rdc_gpio_direction_input(unsigned gpio); 6extern int rdc_gpio_direction_input(unsigned gpio);
7extern int rdc_gpio_direction_output(unsigned gpio, int value); 7extern int rdc_gpio_direction_output(unsigned gpio, int value);
8 8extern int rdc_gpio_request(unsigned gpio, const char *label);
9extern void rdc_gpio_free(unsigned gpio);
10extern void __init rdc321x_gpio_setup(void);
9 11
10/* Wrappers for the arch-neutral GPIO API */ 12/* Wrappers for the arch-neutral GPIO API */
11 13
12static inline int gpio_request(unsigned gpio, const char *label) 14static inline int gpio_request(unsigned gpio, const char *label)
13{ 15{
14 /* Not yet implemented */ 16 return rdc_gpio_request(gpio, label);
15 return 0;
16} 17}
17 18
18static inline void gpio_free(unsigned gpio) 19static inline void gpio_free(unsigned gpio)
19{ 20{
20 /* Not yet implemented */ 21 rdc_gpio_free(gpio);
21} 22}
22 23
23static inline int gpio_direction_input(unsigned gpio) 24static inline int gpio_direction_input(unsigned gpio)
diff --git a/include/asm-x86/mach-rdc321x/rdc321x_defs.h b/include/asm-x86/mach-rdc321x/rdc321x_defs.h
index 838ba8f64fd3..c8e9c8bed3d0 100644
--- a/include/asm-x86/mach-rdc321x/rdc321x_defs.h
+++ b/include/asm-x86/mach-rdc321x/rdc321x_defs.h
@@ -3,4 +3,10 @@
3/* General purpose configuration and data registers */ 3/* General purpose configuration and data registers */
4#define RDC3210_CFGREG_ADDR 0x0CF8 4#define RDC3210_CFGREG_ADDR 0x0CF8
5#define RDC3210_CFGREG_DATA 0x0CFC 5#define RDC3210_CFGREG_DATA 0x0CFC
6#define RDC_MAX_GPIO 0x3A 6
7#define RDC321X_GPIO_CTRL_REG1 0x48
8#define RDC321X_GPIO_CTRL_REG2 0x84
9#define RDC321X_GPIO_DATA_REG1 0x4c
10#define RDC321X_GPIO_DATA_REG2 0x88
11
12#define RDC321X_MAX_GPIO 58
diff --git a/include/asm-x86/nops.h b/include/asm-x86/nops.h
index e3b2bce0aff8..b3930ae539b3 100644
--- a/include/asm-x86/nops.h
+++ b/include/asm-x86/nops.h
@@ -73,16 +73,7 @@
73#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n" 73#define P6_NOP7 ".byte 0x0f,0x1f,0x80,0,0,0,0\n"
74#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n" 74#define P6_NOP8 ".byte 0x0f,0x1f,0x84,0x00,0,0,0,0\n"
75 75
76#if defined(CONFIG_MK8) 76#if defined(CONFIG_MK7)
77#define ASM_NOP1 K8_NOP1
78#define ASM_NOP2 K8_NOP2
79#define ASM_NOP3 K8_NOP3
80#define ASM_NOP4 K8_NOP4
81#define ASM_NOP5 K8_NOP5
82#define ASM_NOP6 K8_NOP6
83#define ASM_NOP7 K8_NOP7
84#define ASM_NOP8 K8_NOP8
85#elif defined(CONFIG_MK7)
86#define ASM_NOP1 K7_NOP1 77#define ASM_NOP1 K7_NOP1
87#define ASM_NOP2 K7_NOP2 78#define ASM_NOP2 K7_NOP2
88#define ASM_NOP3 K7_NOP3 79#define ASM_NOP3 K7_NOP3
@@ -100,6 +91,15 @@
100#define ASM_NOP6 P6_NOP6 91#define ASM_NOP6 P6_NOP6
101#define ASM_NOP7 P6_NOP7 92#define ASM_NOP7 P6_NOP7
102#define ASM_NOP8 P6_NOP8 93#define ASM_NOP8 P6_NOP8
94#elif defined(CONFIG_X86_64)
95#define ASM_NOP1 K8_NOP1
96#define ASM_NOP2 K8_NOP2
97#define ASM_NOP3 K8_NOP3
98#define ASM_NOP4 K8_NOP4
99#define ASM_NOP5 K8_NOP5
100#define ASM_NOP6 K8_NOP6
101#define ASM_NOP7 K8_NOP7
102#define ASM_NOP8 K8_NOP8
103#else 103#else
104#define ASM_NOP1 GENERIC_NOP1 104#define ASM_NOP1 GENERIC_NOP1
105#define ASM_NOP2 GENERIC_NOP2 105#define ASM_NOP2 GENERIC_NOP2
diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h
index 174b87738714..9cf472aeb9ce 100644
--- a/include/asm-x86/pgtable.h
+++ b/include/asm-x86/pgtable.h
@@ -85,6 +85,7 @@ extern pteval_t __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
85#define __PAGE_KERNEL_RX (__PAGE_KERNEL_EXEC & ~_PAGE_RW) 85#define __PAGE_KERNEL_RX (__PAGE_KERNEL_EXEC & ~_PAGE_RW)
86#define __PAGE_KERNEL_EXEC_NOCACHE (__PAGE_KERNEL_EXEC | _PAGE_PCD | _PAGE_PWT) 86#define __PAGE_KERNEL_EXEC_NOCACHE (__PAGE_KERNEL_EXEC | _PAGE_PCD | _PAGE_PWT)
87#define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT) 87#define __PAGE_KERNEL_NOCACHE (__PAGE_KERNEL | _PAGE_PCD | _PAGE_PWT)
88#define __PAGE_KERNEL_UC_MINUS (__PAGE_KERNEL | _PAGE_PCD)
88#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RX | _PAGE_USER) 89#define __PAGE_KERNEL_VSYSCALL (__PAGE_KERNEL_RX | _PAGE_USER)
89#define __PAGE_KERNEL_VSYSCALL_NOCACHE (__PAGE_KERNEL_VSYSCALL | _PAGE_PCD | _PAGE_PWT) 90#define __PAGE_KERNEL_VSYSCALL_NOCACHE (__PAGE_KERNEL_VSYSCALL | _PAGE_PCD | _PAGE_PWT)
90#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE) 91#define __PAGE_KERNEL_LARGE (__PAGE_KERNEL | _PAGE_PSE)
@@ -101,6 +102,7 @@ extern pteval_t __PAGE_KERNEL, __PAGE_KERNEL_EXEC;
101#define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC) 102#define PAGE_KERNEL_EXEC MAKE_GLOBAL(__PAGE_KERNEL_EXEC)
102#define PAGE_KERNEL_RX MAKE_GLOBAL(__PAGE_KERNEL_RX) 103#define PAGE_KERNEL_RX MAKE_GLOBAL(__PAGE_KERNEL_RX)
103#define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE) 104#define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE)
105#define PAGE_KERNEL_UC_MINUS MAKE_GLOBAL(__PAGE_KERNEL_UC_MINUS)
104#define PAGE_KERNEL_EXEC_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_EXEC_NOCACHE) 106#define PAGE_KERNEL_EXEC_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_EXEC_NOCACHE)
105#define PAGE_KERNEL_LARGE MAKE_GLOBAL(__PAGE_KERNEL_LARGE) 107#define PAGE_KERNEL_LARGE MAKE_GLOBAL(__PAGE_KERNEL_LARGE)
106#define PAGE_KERNEL_LARGE_EXEC MAKE_GLOBAL(__PAGE_KERNEL_LARGE_EXEC) 108#define PAGE_KERNEL_LARGE_EXEC MAKE_GLOBAL(__PAGE_KERNEL_LARGE_EXEC)